@budibase/server 3.3.2 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/{index-f22ac5d2.js → index-3199ca61.js} +5 -5
- package/builder/assets/{index-5c106eca.css → index-fae37678.css} +1 -1
- package/builder/index.html +2 -2
- package/client/budibase-client.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/yarn.lock +3 -3
- package/package.json +2 -2
- package/src/api/routes/tests/automation.spec.ts +215 -231
- package/src/api/routes/tests/utilities/TestFunctions.ts +0 -9
- package/src/tests/utilities/TestConfiguration.ts +5 -1
- package/src/tests/utilities/api/automation.ts +86 -5
- package/src/tests/utilities/api/index.ts +24 -24
- package/src/tests/utilities/structures.ts +35 -29
|
@@ -20,7 +20,7 @@ var _d=Object.defineProperty;var bd=(br,Ea,yo)=>Ea in br?_d(br,Ea,{enumerable:!0
|
|
|
20
20
|
}`,E=`__svelte_${hash(T)}_${k}`,H=get_root_for_style(p),{stylesheet:F,rules:Z}=managed_styles.get(H)||create_style_information(H,p);Z[E]||(Z[E]=!0,F.insertRule(`@keyframes ${E} ${T}`,F.cssRules.length));const $=p.style.animation||"";return p.style.animation=`${$?`${$}, `:""}${E} ${m}ms linear ${v}ms 1 both`,active$1+=1,E}function delete_rule(p,u){const f=(p.style.animation||"").split(", "),m=f.filter(u?y=>y.indexOf(u)<0:y=>y.indexOf("__svelte")===-1),v=f.length-m.length;v&&(p.style.animation=m.join(", "),active$1-=v,active$1||clear_rules())}function clear_rules(){raf(()=>{active$1||(managed_styles.forEach(p=>{const{ownerNode:u}=p.stylesheet;u&&detach(u)}),managed_styles.clear())})}function create_animation(p,u,f,m){if(!u)return noop$2;const v=p.getBoundingClientRect();if(u.left===v.left&&u.right===v.right&&u.top===v.top&&u.bottom===v.bottom)return noop$2;const{delay:y=0,duration:w=300,easing:k=identity$2,start:S=now$1()+y,end:M=S+w,tick:T=noop$2,css:E}=f(p,{from:u,to:v},m);let H=!0,F=!1,Z;function $(){E&&(Z=create_rule(p,0,1,w,y,k,E)),y||(F=!0)}function J(){E&&delete_rule(p,Z),H=!1}return loop(ae=>{if(!F&&ae>=S&&(F=!0),F&&ae>=M&&(T(1,0),J()),!H)return!1;if(F){const ie=ae-S,he=0+1*k(ie/w);T(he,1-he)}return!0}),$(),T(0,1),J}function fix_position(p){const u=getComputedStyle(p);if(u.position!=="absolute"&&u.position!=="fixed"){const{width:f,height:m}=u,v=p.getBoundingClientRect();p.style.position="absolute",p.style.width=f,p.style.height=m,add_transform(p,v)}}function add_transform(p,u){const f=p.getBoundingClientRect();if(u.left!==f.left||u.top!==f.top){const m=getComputedStyle(p),v=m.transform==="none"?"":m.transform;p.style.transform=`${v} translate(${u.left-f.left}px, ${u.top-f.top}px)`}}let current_component;function set_current_component(p){current_component=p}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function beforeUpdate(p){get_current_component().$$.before_update.push(p)}function onMount(p){get_current_component().$$.on_mount.push(p)}function afterUpdate(p){get_current_component().$$.after_update.push(p)}function onDestroy(p){get_current_component().$$.on_destroy.push(p)}function createEventDispatcher(){const p=get_current_component();return(u,f,{cancelable:m=!1}={})=>{const v=p.$$.callbacks[u];if(v){const y=custom_event(u,f,{cancelable:m});return v.slice().forEach(w=>{w.call(p,y)}),!y.defaultPrevented}return!0}}function setContext(p,u){return get_current_component().$$.context.set(p,u),u}function getContext$1(p){return get_current_component().$$.context.get(p)}function getAllContexts(){return get_current_component().$$.context}function hasContext(p){return get_current_component().$$.context.has(p)}function bubble(p,u){const f=p.$$.callbacks[u.type];f&&f.slice().forEach(m=>m.call(this,u))}const dirty_components=[],intros={enabled:!1},binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function tick(){return schedule_update(),resolved_promise}function add_render_callback(p){render_callbacks.push(p)}function add_flush_callback(p){flush_callbacks.push(p)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const p=current_component;do{try{for(;flushidx<dirty_components.length;){const u=dirty_components[flushidx];flushidx++,set_current_component(u),update(u.$$)}}catch(u){throw dirty_components.length=0,flushidx=0,u}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let u=0;u<render_callbacks.length;u+=1){const f=render_callbacks[u];seen_callbacks.has(f)||(seen_callbacks.add(f),f())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(p)}function update(p){if(p.fragment!==null){p.update(),run_all(p.before_update);const u=p.dirty;p.dirty=[-1],p.fragment&&p.fragment.p(p.ctx,u),p.after_update.forEach(add_render_callback)}}function flush_render_callbacks(p){const u=[],f=[];render_callbacks.forEach(m=>p.indexOf(m)===-1?u.push(m):f.push(m)),f.forEach(m=>m()),render_callbacks=u}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch(p,u,f){p.dispatchEvent(custom_event(`${u?"intro":"outro"}${f}`))}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(p,u){p&&p.i&&(outroing.delete(p),p.i(u))}function transition_out(p,u,f,m){if(p&&p.o){if(outroing.has(p))return;outroing.add(p),outros.c.push(()=>{outroing.delete(p),m&&(f&&p.d(1),m())}),p.o(u)}else m&&m()}const null_transition={duration:0};function create_in_transition(p,u,f){const m={direction:"in"};let v=u(p,f,m),y=!1,w,k,S=0;function M(){w&&delete_rule(p,w)}function T(){const{delay:H=0,duration:F=300,easing:Z=identity$2,tick:$=noop$2,css:J}=v||null_transition;J&&(w=create_rule(p,0,1,F,H,Z,J,S++)),$(0,1);const ae=now$1()+H,ie=ae+F;k&&k.abort(),y=!0,add_render_callback(()=>dispatch(p,!0,"start")),k=loop(he=>{if(y){if(he>=ie)return $(1,0),dispatch(p,!0,"end"),M(),y=!1;if(he>=ae){const fe=Z((he-ae)/F);$(fe,1-fe)}}return y})}let E=!1;return{start(){E||(E=!0,delete_rule(p),is_function(v)?(v=v(m),wait().then(T)):T())},invalidate(){E=!1},end(){y&&(M(),y=!1)}}}function create_out_transition(p,u,f){const m={direction:"out"};let v=u(p,f,m),y=!0,w;const k=outros;k.r+=1;let S;function M(){const{delay:T=0,duration:E=300,easing:H=identity$2,tick:F=noop$2,css:Z}=v||null_transition;Z&&(w=create_rule(p,1,0,E,T,H,Z));const $=now$1()+T,J=$+E;add_render_callback(()=>dispatch(p,!1,"start")),"inert"in p&&(S=p.inert,p.inert=!0),loop(ae=>{if(y){if(ae>=J)return F(0,1),dispatch(p,!1,"end"),--k.r||run_all(k.c),!1;if(ae>=$){const ie=H((ae-$)/E);F(1-ie,ie)}}return y})}return is_function(v)?wait().then(()=>{v=v(m),M()}):M(),{end(T){T&&"inert"in p&&(p.inert=S),T&&v.tick&&v.tick(1,0),y&&(w&&delete_rule(p,w),y=!1)}}}function create_bidirectional_transition(p,u,f,m){let y=u(p,f,{direction:"both"}),w=m?0:1,k=null,S=null,M=null,T;function E(){M&&delete_rule(p,M)}function H(Z,$){const J=Z.b-w;return $*=Math.abs(J),{a:w,b:Z.b,d:J,duration:$,start:Z.start,end:Z.start+$,group:Z.group}}function F(Z){const{delay:$=0,duration:J=300,easing:ae=identity$2,tick:ie=noop$2,css:he}=y||null_transition,fe={start:now$1()+$,b:Z};Z||(fe.group=outros,outros.r+=1),"inert"in p&&(Z?T!==void 0&&(p.inert=T):(T=p.inert,p.inert=!0)),k||S?S=fe:(he&&(E(),M=create_rule(p,w,Z,J,$,ae,he)),Z&&ie(0,1),k=H(fe,J),add_render_callback(()=>dispatch(p,Z,"start")),loop(me=>{if(S&&me>S.start&&(k=H(S,J),S=null,dispatch(p,k.b,"start"),he&&(E(),M=create_rule(p,w,k.b,k.duration,0,ae,y.css))),k){if(me>=k.end)ie(w=k.b,1-w),dispatch(p,k.b,"end"),S||(k.b?E():--k.group.r||run_all(k.group.c)),k=null;else if(me>=k.start){const ve=me-k.start;w=k.a+k.d*ae(ve/k.duration),ie(w,1-w)}}return!!(k||S)}))}return{run(Z){is_function(y)?wait().then(()=>{y=y({direction:Z?"in":"out"}),F(Z)}):F(Z)},end(){E(),k=S=null}}}function handle_promise(p,u){const f=u.token={};function m(v,y,w,k){if(u.token!==f)return;u.resolved=k;let S=u.ctx;w!==void 0&&(S=S.slice(),S[w]=k);const M=v&&(u.current=v)(S);let T=!1;u.block&&(u.blocks?u.blocks.forEach((E,H)=>{H!==y&&E&&(group_outros(),transition_out(E,1,1,()=>{u.blocks[H]===E&&(u.blocks[H]=null)}),check_outros())}):u.block.d(1),M.c(),transition_in(M,1),M.m(u.mount(),u.anchor),T=!0),u.block=M,u.blocks&&(u.blocks[y]=M),T&&flush()}if(is_promise(p)){const v=get_current_component();if(p.then(y=>{set_current_component(v),m(u.then,1,u.value,y),set_current_component(null)},y=>{if(set_current_component(v),m(u.catch,2,u.error,y),set_current_component(null),!u.hasCatch)throw y}),u.current!==u.pending)return m(u.pending,0),!0}else{if(u.current!==u.then)return m(u.then,1,u.value,p),!0;u.resolved=p}}function update_await_block_branch(p,u,f){const m=u.slice(),{resolved:v}=p;p.current===p.then&&(m[p.value]=v),p.current===p.catch&&(m[p.error]=v),p.block.p(m,f)}function ensure_array_like(p){return(p==null?void 0:p.length)!==void 0?p:Array.from(p)}function destroy_block(p,u){p.d(1),u.delete(p.key)}function outro_and_destroy_block(p,u){transition_out(p,1,1,()=>{u.delete(p.key)})}function fix_and_destroy_block(p,u){p.f(),destroy_block(p,u)}function fix_and_outro_and_destroy_block(p,u){p.f(),outro_and_destroy_block(p,u)}function update_keyed_each(p,u,f,m,v,y,w,k,S,M,T,E){let H=p.length,F=y.length,Z=H;const $={};for(;Z--;)$[p[Z].key]=Z;const J=[],ae=new Map,ie=new Map,he=[];for(Z=F;Z--;){const Ce=E(v,y,Z),Ee=f(Ce);let Se=w.get(Ee);Se?m&&he.push(()=>Se.p(Ce,u)):(Se=M(Ee,Ce),Se.c()),ae.set(Ee,J[Z]=Se),Ee in $&&ie.set(Ee,Math.abs(Z-$[Ee]))}const fe=new Set,me=new Set;function ve(Ce){transition_in(Ce,1),Ce.m(k,T),w.set(Ce.key,Ce),T=Ce.first,F--}for(;H&&F;){const Ce=J[F-1],Ee=p[H-1],Se=Ce.key,Ie=Ee.key;Ce===Ee?(T=Ce.first,H--,F--):ae.has(Ie)?!w.has(Se)||fe.has(Se)?ve(Ce):me.has(Ie)?H--:ie.get(Se)>ie.get(Ie)?(me.add(Se),ve(Ce)):(fe.add(Ie),H--):(S(Ee,w),H--)}for(;H--;){const Ce=p[H];ae.has(Ce.key)||S(Ce,w)}for(;F;)ve(J[F-1]);return run_all(he),J}function validate_each_keys(p,u,f,m){const v=new Map;for(let y=0;y<u.length;y++){const w=m(f(p,u,y));if(v.has(w)){let k="";try{k=`with value '${String(w)}' `}catch{}throw new Error(`Cannot have duplicate keys in a keyed each: Keys at index ${v.get(w)} and ${y} ${k}are duplicates`)}v.set(w,y)}}function get_spread_update(p,u){const f={},m={},v={$$scope:1};let y=p.length;for(;y--;){const w=p[y],k=u[y];if(k){for(const S in w)S in k||(m[S]=1);for(const S in k)v[S]||(f[S]=k[S],v[S]=1);p[y]=k}else for(const S in w)v[S]=1}for(const w in m)w in f||(f[w]=void 0);return f}function get_spread_object(p){return typeof p=="object"&&p!==null?p:{}}const _boolean_attributes=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],boolean_attributes=new Set([..._boolean_attributes]),ATTR_REGEX=/[&"<]/g,CONTENT_REGEX=/[&<]/g;function escape$1(p,u=!1){const f=String(p),m=u?ATTR_REGEX:CONTENT_REGEX;m.lastIndex=0;let v="",y=0;for(;m.test(f);){const w=m.lastIndex-1,k=f[w];v+=f.substring(y,w)+(k==="&"?"&":k==='"'?""":"<"),y=w+1}return v+f.substring(y)}const void_element_names=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function is_void(p){return void_element_names.test(p)||p.toLowerCase()==="!doctype"}const invalid_attribute_name_character=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function spread(p,u){const f=Object.assign({},...p);if(u){const v=u.classes,y=u.styles;v&&(f.class==null?f.class=v:f.class+=" "+v),y&&(f.style==null?f.style=style_object_to_string(y):f.style=style_object_to_string(merge_ssr_styles(f.style,y)))}let m="";return Object.keys(f).forEach(v=>{if(invalid_attribute_name_character.test(v))return;const y=f[v];y===!0?m+=" "+v:boolean_attributes.has(v.toLowerCase())?y&&(m+=" "+v):y!=null&&(m+=` ${v}="${y}"`)}),m}function merge_ssr_styles(p,u){const f={};for(const m of p.split(";")){const v=m.indexOf(":"),y=m.slice(0,v).trim(),w=m.slice(v+1).trim();y&&(f[y]=w)}for(const m in u){const v=u[m];v?f[m]=v:delete f[m]}return f}function escape_attribute_value(p){return typeof p=="string"||p&&typeof p=="object"?escape$1(p,!0):p}function escape_object(p){const u={};for(const f in p)u[f]=escape_attribute_value(p[f]);return u}function each$2(p,u){p=ensure_array_like(p);let f="";for(let m=0;m<p.length;m+=1)f+=u(p[m],m);return f}const missing_component={$$render:()=>""};function validate_component(p,u){if(!p||!p.$$render)throw u==="svelte:component"&&(u+=" this={...}"),new Error(`<${u}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${u}>.`);return p}function debug(p,u,f,m){return console.log(`{@debug} ${p?p+" ":""}(${u}:${f})`),console.log(m),""}let on_destroy;function create_ssr_component(p){function u(f,m,v,y,w){const k=current_component,S={on_destroy,context:new Map(w||(k?k.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:blank_object()};set_current_component({$$:S});const M=p(f,m,v,y);return set_current_component(k),M}return{render:(f={},{$$slots:m={},context:v=new Map}={})=>{on_destroy=[];const y={title:"",head:"",css:new Set},w=u(y,f,{},m,v);return run_all(on_destroy),{html:w,css:{code:Array.from(y.css).map(k=>k.code).join(`
|
|
21
21
|
`),map:null},head:y.title+y.head}},$$render:u}}function add_attribute(p,u,f){if(u==null||f&&!u)return"";const m=f&&u===!0?"":`="${escape$1(u,!0)}"`;return` ${p}${m}`}function add_classes(p){return p?` class="${p}"`:""}function style_object_to_string(p){return Object.keys(p).filter(u=>p[u]!=null&&p[u]!=="").map(u=>`${u}: ${escape_attribute_value(p[u])};`).join(" ")}function add_styles(p){const u=style_object_to_string(p);return u?` style="${u}"`:""}function bind(p,u,f){const m=p.$$.props[u];m!==void 0&&(p.$$.bound[m]=f,f(p.$$.ctx[m]))}function create_component(p){p&&p.c()}function claim_component(p,u){p&&p.l(u)}function mount_component(p,u,f){const{fragment:m,after_update:v}=p.$$;m&&m.m(u,f),add_render_callback(()=>{const y=p.$$.on_mount.map(run).filter(is_function);p.$$.on_destroy?p.$$.on_destroy.push(...y):run_all(y),p.$$.on_mount=[]}),v.forEach(add_render_callback)}function destroy_component(p,u){const f=p.$$;f.fragment!==null&&(flush_render_callbacks(f.after_update),run_all(f.on_destroy),f.fragment&&f.fragment.d(u),f.on_destroy=f.fragment=null,f.ctx=[])}function make_dirty(p,u){p.$$.dirty[0]===-1&&(dirty_components.push(p),schedule_update(),p.$$.dirty.fill(0)),p.$$.dirty[u/31|0]|=1<<u%31}function init$1(p,u,f,m,v,y,w=null,k=[-1]){const S=current_component;set_current_component(p);const M=p.$$={fragment:null,ctx:[],props:y,update:noop$2,not_equal:v,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(u.context||(S?S.$$.context:[])),callbacks:blank_object(),dirty:k,skip_bound:!1,root:u.target||S.$$.root};w&&w(M.root);let T=!1;if(M.ctx=f?f(p,u.props||{},(E,H,...F)=>{const Z=F.length?F[0]:H;return M.ctx&&v(M.ctx[E],M.ctx[E]=Z)&&(!M.skip_bound&&M.bound[E]&&M.bound[E](Z),T&&make_dirty(p,E)),H}):[],M.update(),T=!0,run_all(M.before_update),M.fragment=m?m(M.ctx):!1,u.target){if(u.hydrate){start_hydrating();const E=children(u.target);M.fragment&&M.fragment.l(E),E.forEach(detach)}else M.fragment&&M.fragment.c();u.intro&&transition_in(p.$$.fragment),mount_component(p,u.target,u.anchor),end_hydrating(),flush()}set_current_component(S)}let SvelteElement;typeof HTMLElement=="function"&&(SvelteElement=class extends HTMLElement{constructor(u,f,m){super();ha(this,"$$ctor");ha(this,"$$s");ha(this,"$$c");ha(this,"$$cn",!1);ha(this,"$$d",{});ha(this,"$$r",!1);ha(this,"$$p_d",{});ha(this,"$$l",{});ha(this,"$$l_u",new Map);this.$$ctor=u,this.$$s=f,m&&this.attachShadow({mode:"open"})}addEventListener(u,f,m){if(this.$$l[u]=this.$$l[u]||[],this.$$l[u].push(f),this.$$c){const v=this.$$c.$on(u,f);this.$$l_u.set(f,v)}super.addEventListener(u,f,m)}removeEventListener(u,f,m){if(super.removeEventListener(u,f,m),this.$$c){const v=this.$$l_u.get(f);v&&(v(),this.$$l_u.delete(f))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let u=function(y){return()=>{let w;return{c:function(){w=element("slot"),y!=="default"&&attr(w,"name",y)},m:function(M,T){insert(M,w,T)},d:function(M){M&&detach(w)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const f={},m=get_custom_elements_slots(this);for(const y of this.$$s)y in m&&(f[y]=[u(y)]);for(const y of this.attributes){const w=this.$$g_p(y.name);w in this.$$d||(this.$$d[w]=get_custom_element_value(w,y.value,this.$$p_d,"toProp"))}for(const y in this.$$p_d)!(y in this.$$d)&&this[y]!==void 0&&(this.$$d[y]=this[y],delete this[y]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:f,$$scope:{ctx:[]}}});const v=()=>{this.$$r=!0;for(const y in this.$$p_d)if(this.$$d[y]=this.$$c.$$.ctx[this.$$c.$$.props[y]],this.$$p_d[y].reflect){const w=get_custom_element_value(y,this.$$d[y],this.$$p_d,"toAttribute");w==null?this.removeAttribute(this.$$p_d[y].attribute||y):this.setAttribute(this.$$p_d[y].attribute||y,w)}this.$$r=!1};this.$$c.$$.after_update.push(v),v();for(const y in this.$$l)for(const w of this.$$l[y]){const k=this.$$c.$on(y,w);this.$$l_u.set(w,k)}this.$$l={}}}attributeChangedCallback(u,f,m){var v;this.$$r||(u=this.$$g_p(u),this.$$d[u]=get_custom_element_value(u,m,this.$$p_d,"toProp"),(v=this.$$c)==null||v.$set({[u]:this.$$d[u]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(u){return Object.keys(this.$$p_d).find(f=>this.$$p_d[f].attribute===u||!this.$$p_d[f].attribute&&f.toLowerCase()===u)||u}});function get_custom_element_value(p,u,f,m){var y;const v=(y=f[p])==null?void 0:y.type;if(u=v==="Boolean"&&typeof u!="boolean"?u!=null:u,!m||!f[p])return u;if(m==="toAttribute")switch(v){case"Object":case"Array":return u==null?null:JSON.stringify(u);case"Boolean":return u?"":null;case"Number":return u??null;default:return u}else switch(v){case"Object":case"Array":return u&&JSON.parse(u);case"Boolean":return u;case"Number":return u!=null?+u:u;default:return u}}function create_custom_element(p,u,f,m,v,y){let w=class extends SvelteElement{constructor(){super(p,f,v),this.$$p_d=u}static get observedAttributes(){return Object.keys(u).map(k=>(u[k].attribute||k).toLowerCase())}};return Object.keys(u).forEach(k=>{Object.defineProperty(w.prototype,k,{get(){return this.$$c&&k in this.$$c?this.$$c[k]:this.$$d[k]},set(S){var M;S=get_custom_element_value(k,S,u),this.$$d[k]=S,(M=this.$$c)==null||M.$set({[k]:S})}})}),m.forEach(k=>{Object.defineProperty(w.prototype,k,{get(){var S;return(S=this.$$c)==null?void 0:S[k]}})}),y&&(w=y(w)),p.element=w,w}class SvelteComponent{constructor(){ha(this,"$$");ha(this,"$$set")}$destroy(){destroy_component(this,1),this.$destroy=noop$2}$on(u,f){if(!is_function(f))return noop$2;const m=this.$$.callbacks[u]||(this.$$.callbacks[u]=[]);return m.push(f),()=>{const v=m.indexOf(f);v!==-1&&m.splice(v,1)}}$set(u){this.$$set&&!is_empty(u)&&(this.$$.skip_bound=!0,this.$$set(u),this.$$.skip_bound=!1)}}const VERSION$2="4.2.19",PUBLIC_VERSION="4";function dispatch_dev(p,u){document.dispatchEvent(custom_event(p,{version:VERSION$2,...u},{bubbles:!0}))}function append_dev(p,u){dispatch_dev("SvelteDOMInsert",{target:p,node:u}),append$2(p,u)}function append_hydration_dev(p,u){dispatch_dev("SvelteDOMInsert",{target:p,node:u}),append_hydration(p,u)}function insert_dev(p,u,f){dispatch_dev("SvelteDOMInsert",{target:p,node:u,anchor:f}),insert(p,u,f)}function insert_hydration_dev(p,u,f){dispatch_dev("SvelteDOMInsert",{target:p,node:u,anchor:f}),insert_hydration(p,u,f)}function detach_dev(p){dispatch_dev("SvelteDOMRemove",{node:p}),detach(p)}function detach_between_dev(p,u){for(;p.nextSibling&&p.nextSibling!==u;)detach_dev(p.nextSibling)}function detach_before_dev(p){for(;p.previousSibling;)detach_dev(p.previousSibling)}function detach_after_dev(p){for(;p.nextSibling;)detach_dev(p.nextSibling)}function listen_dev(p,u,f,m,v,y,w){const k=m===!0?["capture"]:m?Array.from(Object.keys(m)):[];v&&k.push("preventDefault"),y&&k.push("stopPropagation"),w&&k.push("stopImmediatePropagation"),dispatch_dev("SvelteDOMAddEventListener",{node:p,event:u,handler:f,modifiers:k});const S=listen(p,u,f,m);return()=>{dispatch_dev("SvelteDOMRemoveEventListener",{node:p,event:u,handler:f,modifiers:k}),S()}}function attr_dev(p,u,f){attr(p,u,f),f==null?dispatch_dev("SvelteDOMRemoveAttribute",{node:p,attribute:u}):dispatch_dev("SvelteDOMSetAttribute",{node:p,attribute:u,value:f})}function prop_dev(p,u,f){p[u]=f,dispatch_dev("SvelteDOMSetProperty",{node:p,property:u,value:f})}function dataset_dev(p,u,f){p.dataset[u]=f,dispatch_dev("SvelteDOMSetDataset",{node:p,property:u,value:f})}function set_data_dev(p,u){u=""+u,p.data!==u&&(dispatch_dev("SvelteDOMSetData",{node:p,data:u}),p.data=u)}function set_data_contenteditable_dev(p,u){u=""+u,p.wholeText!==u&&(dispatch_dev("SvelteDOMSetData",{node:p,data:u}),p.data=u)}function set_data_maybe_contenteditable_dev(p,u,f){~contenteditable_truthy_values.indexOf(f)?set_data_contenteditable_dev(p,u):set_data_dev(p,u)}function ensure_array_like_dev(p){if(typeof p!="string"&&!(p&&typeof p=="object"&&"length"in p)&&!(typeof Symbol=="function"&&p&&Symbol.iterator in p))throw new Error("{#each} only works with iterable values.");return ensure_array_like(p)}function validate_slots(p,u,f){for(const m of Object.keys(u))~f.indexOf(m)||console.warn(`<${p}> received an unexpected slot "${m}".`)}function validate_dynamic_element(p){if(p&&!(typeof p=="string"))throw new Error('<svelte:element> expects "this" attribute to be a string.')}function validate_void_dynamic_element(p){p&&is_void(p)&&console.warn(`<svelte:element this="${p}"> is self-closing and cannot have content.`)}function construct_svelte_component_dev(p,u){const f="this={...} of <svelte:component> should specify a Svelte component.";try{const m=new p(u);if(!m.$$||!m.$set||!m.$on||!m.$destroy)throw new Error(f);return m}catch(m){const{message:v}=m;throw typeof v=="string"&&v.indexOf("is not a constructor")!==-1?new Error(f):m}}class SvelteComponentDev extends SvelteComponent{constructor(f){if(!f||!f.target&&!f.$$inline)throw new Error("'target' is a required option");super();ha(this,"$$prop_def");ha(this,"$$events_def");ha(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class SvelteComponentTyped extends SvelteComponentDev{}function loop_guard(p){const u=Date.now();return()=>{if(Date.now()-u>p)throw new Error("Infinite loop detected")}}const internal=Object.freeze(Object.defineProperty({__proto__:null,HtmlTag,HtmlTagHydration,ResizeObserverSingleton,SvelteComponent,SvelteComponentDev,SvelteComponentTyped,get SvelteElement(){return SvelteElement},action_destroyer,add_attribute,add_classes,add_flush_callback,add_iframe_resize_listener,add_location,add_render_callback,add_styles,add_transform,afterUpdate,append:append$2,append_dev,append_empty_stylesheet,append_hydration,append_hydration_dev,append_styles,assign,attr,attr_dev,attribute_to_object,beforeUpdate,bind,binding_callbacks,blank_object,bubble,check_outros,children,claim_comment,claim_component,claim_element,claim_html_tag,claim_space,claim_svg_element,claim_text,clear_loops,comment:comment$1,component_subscribe,compute_rest_props,compute_slots,construct_svelte_component,construct_svelte_component_dev,contenteditable_truthy_values,createEventDispatcher,create_animation,create_bidirectional_transition,create_component,create_custom_element,create_in_transition,create_out_transition,create_slot,create_ssr_component,get current_component(){return current_component},custom_event,dataset_dev,debug,destroy_block,destroy_component,destroy_each,detach,detach_after_dev,detach_before_dev,detach_between_dev,detach_dev,dirty_components,dispatch_dev,each:each$2,element,element_is,empty:empty$1,end_hydrating,ensure_array_like,ensure_array_like_dev,escape:escape$1,escape_attribute_value,escape_object,exclude_internal_props,fix_and_destroy_block,fix_and_outro_and_destroy_block,fix_position,flush,flush_render_callbacks,getAllContexts,getContext:getContext$1,get_all_dirty_from_scope,get_binding_group_value,get_current_component,get_custom_elements_slots,get_root_for_style,get_slot_changes,get_spread_object,get_spread_update,get_store_value,get_svelte_dataset,globals:globals$1,group_outros,handle_promise,hasContext,has_prop,head_selector,identity:identity$2,init:init$1,init_binding_group,init_binding_group_dynamic,insert,insert_dev,insert_hydration,insert_hydration_dev,intros,invalid_attribute_name_character,is_client,is_crossorigin,is_empty,is_function,is_promise,is_void,listen,listen_dev,loop,loop_guard,merge_ssr_styles,missing_component,mount_component,noop:noop$2,not_equal,get now(){return now$1},null_to_empty,object_without_properties,onDestroy,onMount,once:once$2,outro_and_destroy_block,prevent_default,prop_dev,query_selector_all,get raf(){return raf},resize_observer_border_box,resize_observer_content_box,resize_observer_device_pixel_content_box,run,run_all,safe_not_equal,schedule_update,select_multiple_value,select_option,select_options,select_value,self:self$1,setContext,set_attributes,set_current_component,set_custom_element_data,set_custom_element_data_map,set_data,set_data_contenteditable,set_data_contenteditable_dev,set_data_dev,set_data_maybe_contenteditable,set_data_maybe_contenteditable_dev,set_dynamic_element_data,set_input_type,set_input_value,set_now,set_raf,set_store_value,set_style,set_svg_attributes,space,split_css_unit,spread,src_url_equal,srcset_url_equal,start_hydrating,stop_immediate_propagation,stop_propagation,stringify_spread,subscribe,svg_element,text:text$1,tick,time_ranges_to_array,to_number,toggle_class,transition_in,transition_out,trusted,update_await_block_branch,update_keyed_each,update_slot,update_slot_base,validate_component,validate_dynamic_element,validate_each_keys,validate_slots,validate_store,validate_void_dynamic_element,xlink_attr},Symbol.toStringTag,{value:"Module"}));typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(PUBLIC_VERSION);const subscriber_queue=[];function readable(p,u){return{subscribe:writable(p,u).subscribe}}function writable(p,u=noop$2){let f;const m=new Set;function v(k){if(safe_not_equal(p,k)&&(p=k,f)){const S=!subscriber_queue.length;for(const M of m)M[1](),subscriber_queue.push(M,p);if(S){for(let M=0;M<subscriber_queue.length;M+=2)subscriber_queue[M][0](subscriber_queue[M+1]);subscriber_queue.length=0}}}function y(k){v(k(p))}function w(k,S=noop$2){const M=[k,S];return m.add(M),m.size===1&&(f=u(v,y)||noop$2),k(p),()=>{m.delete(M),m.size===0&&f&&(f(),f=null)}}return{set:v,update:y,subscribe:w}}function derived(p,u,f){const m=!Array.isArray(p),v=m?[p]:p;if(!v.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const y=u.length<2;return readable(f,(w,k)=>{let S=!1;const M=[];let T=0,E=noop$2;const H=()=>{if(T)return;E();const Z=u(m?M[0]:M,w,k);y?w(Z):E=is_function(Z)?Z:noop$2},F=v.map((Z,$)=>subscribe(Z,J=>{M[$]=J,T&=~(1<<$),S&&H()},()=>{T|=1<<$}));return S=!0,H(),function(){run_all(F),E(),S=!1}})}const svelte=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:SvelteComponentDev,SvelteComponentTyped,afterUpdate,beforeUpdate,createEventDispatcher,getAllContexts,getContext:getContext$1,hasContext,onDestroy,onMount,setContext,tick},Symbol.toStringTag,{value:"Module"})),bbui="",indexVars$I="",indexVars$H="";function create_fragment$3U(p){let u,f;const m=p[3].default,v=create_slot(m,p,p[2],null);return{c(){u=element("div"),v&&v.c()},m(y,w){insert(y,u,w),v&&v.m(u,null),p[4](u),f=!0},p(y,[w]){v&&v.p&&(!f||w&4)&&update_slot_base(v,m,y,y[2],f?get_slot_changes(m,y[2],w,null):get_all_dirty_from_scope(y[2]),null)},i(y){f||(transition_in(v,y),f=!0)},o(y){transition_out(v,y),f=!1},d(y){y&&detach(u),v&&v.d(y),p[4](null)}}}function instance$3R(p,u,f){let{$$slots:m={},$$scope:v}=u,{target:y=document.body}=u,w,k,S;onMount(()=>{if(typeof y=="string"){if(w=document.querySelector(y),w===null)return()=>{}}else if(y instanceof HTMLElement)w=y;else throw new TypeError(`Unknown target type: ${typeof y}. Allowed types: String (CSS selector), HTMLElement.`);return k=document.createElement("div"),w.appendChild(k),k.appendChild(S),()=>{w.removeChild(k)}});function M(T){binding_callbacks[T?"unshift":"push"](()=>{S=T,f(0,S)})}return p.$$set=T=>{"target"in T&&f(1,y=T.target),"$$scope"in T&&f(2,v=T.$$scope)},[S,y,v,m,M]}class Portal extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3R,create_fragment$3U,safe_not_equal,{target:1})}}function cubicOut(p){const u=p-1;return u*u*u+1}function fade(p,{delay:u=0,duration:f=400,easing:m=identity$2}={}){const v=+getComputedStyle(p).opacity;return{delay:u,duration:f,easing:m,css:y=>`opacity: ${y*v}`}}function fly(p,{delay:u=0,duration:f=400,easing:m=cubicOut,x:v=0,y=0,opacity:w=0}={}){const k=getComputedStyle(p),S=+k.opacity,M=k.transform==="none"?"":k.transform,T=S*(1-w),[E,H]=split_css_unit(v),[F,Z]=split_css_unit(y);return{delay:u,duration:f,easing:m,css:($,J)=>`
|
|
22
22
|
transform: ${M} translate(${(1-$)*E}${H}, ${(1-$)*F}${Z});
|
|
23
|
-
opacity: ${S-T*J}`}}const indexVars$G="",AbsTooltip_svelte_svelte_type_style_lang="";function create_if_block$2a(p){let u,f;return u=new Portal({props:{target:".spectrum",$$slots:{default:[create_default_slot$1U]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&132815&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_default_slot$1U(p){let u,f,m,v,y,w,k,S,M;return{c(){u=element("span"),f=element("span"),m=text$1(p[2]),v=space(),y=element("span"),attr(f,"class","spectrum-Tooltip-label svelte-9a74k9"),attr(y,"class","spectrum-Tooltip-tip svelte-9a74k9"),attr(y,"style",p[9]),attr(u,"class",w="spectrum-Tooltip spectrum-Tooltip--"+p[1]+" spectrum-Tooltip--"+p[0]+" is-open svelte-9a74k9"),attr(u,"style",k=`left:${p[6]}px;top:${p[7]}px;${p[10]}`),toggle_class(u,"noWrap",p[3])},m(T,E){insert(T,u,E),append$2(u,f),append$2(f,m),append$2(u,v),append$2(u,y),M=!0},p(T,E){(!M||E&4)&&set_data(m,T[2]),(!M||E&512)&&attr(y,"style",T[9]),(!M||E&3&&w!==(w="spectrum-Tooltip spectrum-Tooltip--"+T[1]+" spectrum-Tooltip--"+T[0]+" is-open svelte-9a74k9"))&&attr(u,"class",w),(!M||E&1216&&k!==(k=`left:${T[6]}px;top:${T[7]}px;${T[10]}`))&&attr(u,"style",k),(!M||E&11)&&toggle_class(u,"noWrap",T[3])},i(T){M||(T&&add_render_callback(()=>{M&&(S||(S=create_bidirectional_transition(u,fade,{duration:130},!0)),S.run(1))}),M=!0)},o(T){T&&(S||(S=create_bidirectional_transition(u,fade,{duration:130},!1)),S.run(0)),M=!1},d(T){T&&detach(u),T&&S&&S.end()}}}function create_fragment$3T(p){let u,f,m,v,y,w;const k=p[13].default,S=create_slot(k,p,p[17],null);let M=p[8]&&p[2]&&p[6]!=null&&p[7]!=null&&create_if_block$2a(p);return{c(){u=element("div"),S&&S.c(),f=space(),M&&M.c(),m=empty$1(),attr(u,"class","abs-tooltip svelte-9a74k9")},m(T,E){insert(T,u,E),S&&S.m(u,null),p[14](u),insert(T,f,E),M&&M.m(T,E),insert(T,m,E),v=!0,y||(w=[listen(u,"focus",null),listen(u,"mouseover",p[15]),listen(u,"mouseleave",p[16])],y=!0)},p(T,[E]){S&&S.p&&(!v||E&131072)&&update_slot_base(S,k,T,T[17],v?get_slot_changes(k,T[17],E,null):get_all_dirty_from_scope(T[17]),null),T[8]&&T[2]&&T[6]!=null&&T[7]!=null?M?(M.p(T,E),E&452&&transition_in(M,1)):(M=create_if_block$2a(T),M.c(),transition_in(M,1),M.m(m.parentNode,m)):M&&(group_outros(),transition_out(M,1,1,()=>{M=null}),check_outros())},i(T){v||(transition_in(S,T),transition_in(M),v=!0)},o(T){transition_out(S,T),transition_out(M),v=!1},d(T){T&&(detach(u),detach(f),detach(m)),S&&S.d(T),p[14](null),M&&M.d(T),y=!1,run_all(w)}}}const TooltipPosition={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},TooltipType={Default:"default",Info:"info",Positive:"positive",Negative:"negative"};function instance$3Q(p,u,f){let m,v,{$$slots:y={},$$scope:w}=u,{position:k=TooltipPosition.Top}=u,{type:S=TooltipType.Default}=u,{text:M=""}=u,{fixed:T=!1}=u,{color:E=""}=u,{noWrap:H=!1}=u,F,Z=!1,$,J,ae=!1,ie,he;const fe=()=>{var Ue;const Ie=(Ue=F==null?void 0:F.children)==null?void 0:Ue[0];if(!Ie){f(6,$=null),f(7,J=null);return}const xe=Ie.getBoundingClientRect();k===TooltipPosition.Top?(f(6,$=xe.left+xe.width/2),f(7,J=xe.top)):k===TooltipPosition.Right?(f(6,$=xe.left+xe.width),f(7,J=xe.top+xe.height/2)):k===TooltipPosition.Bottom?(f(6,$=xe.left+xe.width/2),f(7,J=xe.top+xe.height)):k===TooltipPosition.Left&&(f(6,$=xe.left),f(7,J=xe.top+xe.height/2))},me=()=>{fe(),he=setInterval(fe,100),f(8,ae=!0)},ve=()=>{clearTimeout(ie),clearInterval(he),f(8,ae=!1)};onDestroy(ve);function Ce(Ie){binding_callbacks[Ie?"unshift":"push"](()=>{F=Ie,f(5,F)})}const Ee=()=>f(4,Z=!0),Se=()=>f(4,Z=!1);return p.$$set=Ie=>{"position"in Ie&&f(0,k=Ie.position),"type"in Ie&&f(1,S=Ie.type),"text"in Ie&&f(2,M=Ie.text),"fixed"in Ie&&f(11,T=Ie.fixed),"color"in Ie&&f(12,E=Ie.color),"noWrap"in Ie&&f(3,H=Ie.noWrap),"$$scope"in Ie&&f(17,w=Ie.$$scope)},p.$$.update=()=>{p.$$.dirty&2064&&(Z||T?ie=setTimeout(me,200):ve()),p.$$.dirty&4096&&f(10,m=E?`background:${E};`:null),p.$$.dirty&4096&&f(9,v=E?`border-top-color:${E};`:null)},[k,S,M,H,Z,F,$,J,ae,v,m,T,E,y,Ce,Ee,Se,w]}class AbsTooltip extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3Q,create_fragment$3T,safe_not_equal,{position:0,type:1,text:2,fixed:11,color:12,noWrap:3})}}const Icon_svelte_svelte_type_style_lang$1="";function create_default_slot$1T(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=svg_element("svg"),m=svg_element("use"),set_style(m,"pointer-events","none"),xlink_attr(m,"xlink:href",v="#spectrum-icon-18-"+p[0]),attr(f,"class",y="spectrum-Icon spectrum-Icon--size"+p[2]+" svelte-10h2gx"),attr(f,"focusable","false"),attr(f,"aria-hidden",p[1]),attr(f,"aria-label",p[0]),attr(f,"style",w=`${p[5]?`color: ${p[5]};`:""} ${p[6]?`--hover-color: ${p[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`),toggle_class(f,"hoverable",p[3]),toggle_class(f,"disabled",p[4]),attr(u,"class","icon svelte-10h2gx"),toggle_class(u,"newStyles",p[12])},m(M,T){insert(M,u,T),append$2(u,f),append$2(f,m),k||(S=[listen(f,"contextmenu",p[13]),listen(f,"click",p[14])],k=!0)},p(M,T){T&1&&v!==(v="#spectrum-icon-18-"+M[0])&&xlink_attr(m,"xlink:href",v),T&4&&y!==(y="spectrum-Icon spectrum-Icon--size"+M[2]+" svelte-10h2gx")&&attr(f,"class",y),T&2&&attr(f,"aria-hidden",M[1]),T&1&&attr(f,"aria-label",M[0]),T&96&&w!==(w=`${M[5]?`color: ${M[5]};`:""} ${M[6]?`--hover-color: ${M[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`)&&attr(f,"style",w),T&12&&toggle_class(f,"hoverable",M[3]),T&20&&toggle_class(f,"disabled",M[4]),T&4096&&toggle_class(u,"newStyles",M[12])},d(M){M&&detach(u),k=!1,run_all(S)}}}function create_fragment$3S(p){let u,f;return u=new AbsTooltip({props:{text:p[7],type:p[9],position:p[8],color:p[10],noWrap:p[11],$$slots:{default:[create_default_slot$1T]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&128&&(y.text=m[7]),v&512&&(y.type=m[9]),v&256&&(y.position=m[8]),v&1024&&(y.color=m[10]),v&2048&&(y.noWrap=m[11]),v&36991&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3P(p,u,f){let{name:m="Add"}=u,{hidden:v=!1}=u,{size:y="M"}=u,{hoverable:w=!1}=u,{disabled:k=!1}=u,{color:S=void 0}=u,{hoverColor:M=void 0}=u,{tooltip:T=void 0}=u,{tooltipPosition:E=TooltipPosition.Bottom}=u,{tooltipType:H=TooltipType.Default}=u,{tooltipColor:F=void 0}=u,{tooltipWrap:Z=!0}=u,{newStyles:$=!1}=u;function J(ie){bubble.call(this,p,ie)}function ae(ie){bubble.call(this,p,ie)}return p.$$set=ie=>{"name"in ie&&f(0,m=ie.name),"hidden"in ie&&f(1,v=ie.hidden),"size"in ie&&f(2,y=ie.size),"hoverable"in ie&&f(3,w=ie.hoverable),"disabled"in ie&&f(4,k=ie.disabled),"color"in ie&&f(5,S=ie.color),"hoverColor"in ie&&f(6,M=ie.hoverColor),"tooltip"in ie&&f(7,T=ie.tooltip),"tooltipPosition"in ie&&f(8,E=ie.tooltipPosition),"tooltipType"in ie&&f(9,H=ie.tooltipType),"tooltipColor"in ie&&f(10,F=ie.tooltipColor),"tooltipWrap"in ie&&f(11,Z=ie.tooltipWrap),"newStyles"in ie&&f(12,$=ie.newStyles)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,J,ae]}let Icon$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3P,create_fragment$3S,safe_not_equal,{name:0,hidden:1,size:2,hoverable:3,disabled:4,color:5,hoverColor:6,tooltip:7,tooltipPosition:8,tooltipType:9,tooltipColor:10,tooltipWrap:11,newStyles:12})}};const TooltipWrapper_svelte_svelte_type_style_lang="";function create_if_block$29(p){let u,f,m;return f=new AbsTooltip({props:{text:p[0],$$slots:{default:[create_default_slot$1S]},$$scope:{ctx:p}}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","icon-container svelte-19tap7e")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y&1&&(w.text=v[0]),y&38&&(w.$$scope={dirty:y,ctx:v}),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_default_slot$1S(p){let u,f,m,v,y;return f=new Icon$1({props:{name:"InfoOutline",size:"S",disabled:p[2],hoverable:!0}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","icon svelte-19tap7e"),toggle_class(u,"icon-small",p[1]==="M"||p[1]==="S")},m(w,k){insert(w,u,k),mount_component(f,u,null),m=!0,v||(y=listen(u,"focus",p[4]),v=!0)},p(w,k){const S={};k&4&&(S.disabled=w[2]),f.$set(S),(!m||k&2)&&toggle_class(u,"icon-small",w[1]==="M"||w[1]==="S")},i(w){m||(transition_in(f.$$.fragment,w),m=!0)},o(w){transition_out(f.$$.fragment,w),m=!1},d(w){w&&detach(u),destroy_component(f),v=!1,y()}}}function create_fragment$3R(p){let u,f,m;const v=p[3].default,y=create_slot(v,p,p[5],null);let w=p[0]&&create_if_block$29(p);return{c(){u=element("div"),y&&y.c(),f=space(),w&&w.c(),attr(u,"class","svelte-19tap7e"),toggle_class(u,"container",!!p[0])},m(k,S){insert(k,u,S),y&&y.m(u,null),append$2(u,f),w&&w.m(u,null),m=!0},p(k,[S]){y&&y.p&&(!m||S&32)&&update_slot_base(y,v,k,k[5],m?get_slot_changes(v,k[5],S,null):get_all_dirty_from_scope(k[5]),null),k[0]?w?(w.p(k,S),S&1&&transition_in(w,1)):(w=create_if_block$29(k),w.c(),transition_in(w,1),w.m(u,null)):w&&(group_outros(),transition_out(w,1,1,()=>{w=null}),check_outros()),(!m||S&1)&&toggle_class(u,"container",!!k[0])},i(k){m||(transition_in(y,k),transition_in(w),m=!0)},o(k){transition_out(y,k),transition_out(w),m=!1},d(k){k&&detach(u),y&&y.d(k),w&&w.d()}}}function instance$3O(p,u,f){let{$$slots:m={},$$scope:v}=u,{tooltip:y=""}=u,{size:w="M"}=u,{disabled:k=!0}=u;function S(M){bubble.call(this,p,M)}return p.$$set=M=>{"tooltip"in M&&f(0,y=M.tooltip),"size"in M&&f(1,w=M.size),"disabled"in M&&f(2,k=M.disabled),"$$scope"in M&&f(5,v=M.$$scope)},[y,w,k,m,S,v]}class TooltipWrapper extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3O,create_fragment$3R,safe_not_equal,{tooltip:0,size:1,disabled:2})}}const FieldLabel_svelte_svelte_type_style_lang="";function create_default_slot$1R(p){let u,f=(p[1]||"")+"",m,v;return{c(){u=element("label"),m=text$1(f),attr(u,"for",p[0]),attr(u,"class",v=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${p[3]}`)+" svelte-dqoj9e")},m(y,w){insert(y,u,w),append$2(u,m)},p(y,w){w&2&&f!==(f=(y[1]||"")+"")&&set_data(m,f),w&1&&attr(u,"for",y[0]),w&8&&v!==(v=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${y[3]}`)+" svelte-dqoj9e")&&attr(u,"class",v)},d(y){y&&detach(u)}}}function create_fragment$3Q(p){let u,f;return u=new TooltipWrapper({props:{tooltip:p[2],size:"S",$$slots:{default:[create_default_slot$1R]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&4&&(y.tooltip=m[2]),v&43&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3N(p,u,f){let m,{forId:v}=u,{label:y}=u,{position:w="above"}=u,{tooltip:k=""}=u;return p.$$set=S=>{"forId"in S&&f(0,v=S.forId),"label"in S&&f(1,y=S.label),"position"in S&&f(4,w=S.position),"tooltip"in S&&f(2,k=S.tooltip)},p.$$.update=()=>{p.$$.dirty&16&&f(3,m=w==="above"?"":`spectrum-FieldLabel--${w}`)},[v,y,k,m,w]}class FieldLabel extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3N,create_fragment$3Q,safe_not_equal,{forId:0,label:1,position:4,tooltip:2})}}const Field_svelte_svelte_type_style_lang$1="";function create_if_block_2$H(p){let u,f;return u=new FieldLabel({props:{forId:p[0],label:p[1],position:p[2],tooltip:p[5]}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&1&&(y.forId=m[0]),v&2&&(y.label=m[1]),v&4&&(y.position=m[2]),v&32&&(y.tooltip=m[5]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_1$16(p){let u,f,m,v,y,w;return f=new Icon$1({props:{name:"HelpOutline"}}),{c(){u=element("div"),create_component(f.$$.fragment),m=space(),v=element("span"),y=text$1(p[4]),attr(v,"class","svelte-e52e9j"),attr(u,"class","helpText svelte-e52e9j")},m(k,S){insert(k,u,S),mount_component(f,u,null),append$2(u,m),append$2(u,v),append$2(v,y),w=!0},p(k,S){(!w||S&16)&&set_data(y,k[4])},i(k){w||(transition_in(f.$$.fragment,k),w=!0)},o(k){transition_out(f.$$.fragment,k),w=!1},d(k){k&&detach(u),destroy_component(f)}}}function create_if_block$28(p){let u,f;return{c(){u=element("div"),f=text$1(p[3]),attr(u,"class","error svelte-e52e9j")},m(m,v){insert(m,u,v),append$2(u,f)},p(m,v){v&8&&set_data(f,m[3])},i:noop$2,o:noop$2,d(m){m&&detach(u)}}}function create_fragment$3P(p){let u,f,m,v,y,w,k,S=p[1]&&create_if_block_2$H(p);const M=p[7].default,T=create_slot(M,p,p[6],null),E=[create_if_block$28,create_if_block_1$16],H=[];function F(Z,$){return Z[3]?0:Z[4]?1:-1}return~(y=F(p))&&(w=H[y]=E[y](p)),{c(){u=element("div"),S&&S.c(),f=space(),m=element("div"),T&&T.c(),v=space(),w&&w.c(),attr(m,"class","spectrum-Form-itemField svelte-e52e9j"),attr(u,"class","spectrum-Form-item svelte-e52e9j"),toggle_class(u,"above",p[2]==="above")},m(Z,$){insert(Z,u,$),S&&S.m(u,null),append$2(u,f),append$2(u,m),T&&T.m(m,null),append$2(m,v),~y&&H[y].m(m,null),k=!0},p(Z,[$]){Z[1]?S?(S.p(Z,$),$&2&&transition_in(S,1)):(S=create_if_block_2$H(Z),S.c(),transition_in(S,1),S.m(u,f)):S&&(group_outros(),transition_out(S,1,1,()=>{S=null}),check_outros()),T&&T.p&&(!k||$&64)&&update_slot_base(T,M,Z,Z[6],k?get_slot_changes(M,Z[6],$,null):get_all_dirty_from_scope(Z[6]),null);let J=y;y=F(Z),y===J?~y&&H[y].p(Z,$):(w&&(group_outros(),transition_out(H[J],1,1,()=>{H[J]=null}),check_outros()),~y?(w=H[y],w?w.p(Z,$):(w=H[y]=E[y](Z),w.c()),transition_in(w,1),w.m(m,null)):w=null),(!k||$&4)&&toggle_class(u,"above",Z[2]==="above")},i(Z){k||(transition_in(S),transition_in(T,Z),transition_in(w),k=!0)},o(Z){transition_out(S),transition_out(T,Z),transition_out(w),k=!1},d(Z){Z&&detach(u),S&&S.d(),T&&T.d(Z),~y&&H[y].d()}}}function instance$3M(p,u,f){let{$$slots:m={},$$scope:v}=u,{id:y=null}=u,{label:w=null}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{helpText:M=null}=u,{tooltip:T=""}=u;return p.$$set=E=>{"id"in E&&f(0,y=E.id),"label"in E&&f(1,w=E.label),"labelPosition"in E&&f(2,k=E.labelPosition),"error"in E&&f(3,S=E.error),"helpText"in E&&f(4,M=E.helpText),"tooltip"in E&&f(5,T=E.tooltip),"$$scope"in E&&f(6,v=E.$$scope)},[y,w,k,S,M,T,v,m]}let Field$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3M,create_fragment$3P,safe_not_equal,{id:0,label:1,labelPosition:2,error:3,helpText:4,tooltip:5})}};const indexVars$F="",TextField_svelte_svelte_type_style_lang="";function create_fragment$3O(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=element("input"),f.disabled=p[3],f.readOnly=p[5],attr(f,"id",p[4]),f.value=m=p[0]??"",attr(f,"placeholder",v=p[1]??""),attr(f,"type",p[2]),attr(f,"class","spectrum-Textfield-input svelte-1pznijr"),attr(f,"style",y=p[7]?`text-align: ${p[7]};`:""),attr(f,"inputmode",w=p[15](p[2])),attr(f,"autocomplete",p[8]),attr(u,"class","spectrum-Textfield svelte-1pznijr"),toggle_class(u,"spectrum-Textfield--quiet",p[6]),toggle_class(u,"is-disabled",p[3]),toggle_class(u,"is-focused",p[10])},m(M,T){insert(M,u,T),append$2(u,f),p[23](f),k||(S=[listen(f,"click",p[18]),listen(f,"blur",p[19]),listen(f,"focus",p[20]),listen(f,"input",p[21]),listen(f,"keyup",p[22]),listen(f,"blur",p[12]),listen(f,"focus",p[11]),listen(f,"input",p[13]),listen(f,"keyup",p[14])],k=!0)},p(M,[T]){T&8&&(f.disabled=M[3]),T&32&&(f.readOnly=M[5]),T&16&&attr(f,"id",M[4]),T&1&&m!==(m=M[0]??"")&&f.value!==m&&(f.value=m),T&2&&v!==(v=M[1]??"")&&attr(f,"placeholder",v),T&4&&attr(f,"type",M[2]),T&128&&y!==(y=M[7]?`text-align: ${M[7]};`:"")&&attr(f,"style",y),T&4&&w!==(w=M[15](M[2]))&&attr(f,"inputmode",w),T&256&&attr(f,"autocomplete",M[8]),T&64&&toggle_class(u,"spectrum-Textfield--quiet",M[6]),T&8&&toggle_class(u,"is-disabled",M[3]),T&1024&&toggle_class(u,"is-focused",M[10])},i:noop$2,o:noop$2,d(M){M&&detach(u),p[23](null),k=!1,run_all(S)}}}function instance$3L(p,u,f){let{value:m=null}=u,{placeholder:v=null}=u,{type:y="text"}=u,{disabled:w=!1}=u,{id:k=null}=u,{readonly:S=!1}=u,{updateOnChange:M=!0}=u,{quiet:T=!1}=u,{align:E}=u,{autofocus:H=!1}=u,{autocomplete:F=null}=u;const Z=createEventDispatcher();let $,J=!1;const ae=$e=>{if(!(S||w)){if(y==="number"){const Ye=parseFloat($e);$e=isNaN(Ye)?null:Ye}Z("change",$e)}},ie=()=>{S||w||f(10,J=!0)},he=$e=>{S||w||(f(10,J=!1),ae($e.target.value))},fe=$e=>{S||!M||w||ae($e.target.value)},me=$e=>{S||w||$e.key==="Enter"&&ae($e.target.value)},ve=$e=>$e==="bigint"?"numeric":$e==="number"?"decimal":"text";onMount(async()=>{w||(f(10,J=H),J&&(await tick(),$.focus()))});function Ce($e){bubble.call(this,p,$e)}function Ee($e){bubble.call(this,p,$e)}function Se($e){bubble.call(this,p,$e)}function Ie($e){bubble.call(this,p,$e)}function xe($e){bubble.call(this,p,$e)}function Ue($e){binding_callbacks[$e?"unshift":"push"](()=>{$=$e,f(9,$)})}return p.$$set=$e=>{"value"in $e&&f(0,m=$e.value),"placeholder"in $e&&f(1,v=$e.placeholder),"type"in $e&&f(2,y=$e.type),"disabled"in $e&&f(3,w=$e.disabled),"id"in $e&&f(4,k=$e.id),"readonly"in $e&&f(5,S=$e.readonly),"updateOnChange"in $e&&f(16,M=$e.updateOnChange),"quiet"in $e&&f(6,T=$e.quiet),"align"in $e&&f(7,E=$e.align),"autofocus"in $e&&f(17,H=$e.autofocus),"autocomplete"in $e&&f(8,F=$e.autocomplete)},[m,v,y,w,k,S,T,E,F,$,J,ie,he,fe,me,ve,M,H,Ce,Ee,Se,Ie,xe,Ue]}class TextField extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3L,create_fragment$3O,safe_not_equal,{value:0,placeholder:1,type:2,disabled:3,id:4,readonly:5,updateOnChange:16,quiet:6,align:7,autofocus:17,autocomplete:8})}}function create_default_slot$1Q(p){let u,f;return u=new TextField({props:{updateOnChange:p[8],error:p[7],disabled:p[5],readonly:p[6],value:p[0],placeholder:p[3],type:p[4],quiet:p[9],autofocus:p[10],autocomplete:p[11]}}),u.$on("change",p[13]),u.$on("click",p[14]),u.$on("input",p[15]),u.$on("blur",p[16]),u.$on("focus",p[17]),u.$on("keyup",p[18]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&256&&(y.updateOnChange=m[8]),v&128&&(y.error=m[7]),v&32&&(y.disabled=m[5]),v&64&&(y.readonly=m[6]),v&1&&(y.value=m[0]),v&8&&(y.placeholder=m[3]),v&16&&(y.type=m[4]),v&512&&(y.quiet=m[9]),v&1024&&(y.autofocus=m[10]),v&2048&&(y.autocomplete=m[11]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3N(p){let u,f;return u=new Field$1({props:{helpText:p[12],label:p[1],labelPosition:p[2],error:p[7],$$slots:{default:[create_default_slot$1Q]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&4096&&(y.helpText=m[12]),v&2&&(y.label=m[1]),v&4&&(y.labelPosition=m[2]),v&128&&(y.error=m[7]),v&1052665&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3K(p,u,f){let{value:m=null}=u,{label:v=null}=u,{labelPosition:y="above"}=u,{placeholder:w=null}=u,{type:k="text"}=u,{disabled:S=!1}=u,{readonly:M=!1}=u,{error:T=null}=u,{updateOnChange:E=!0}=u,{quiet:H=!1}=u,{autofocus:F}=u,{autocomplete:Z}=u,{helpText:$=null}=u;const J=createEventDispatcher(),ae=Ce=>{f(0,m=Ce.detail),J("change",Ce.detail)};function ie(Ce){bubble.call(this,p,Ce)}function he(Ce){bubble.call(this,p,Ce)}function fe(Ce){bubble.call(this,p,Ce)}function me(Ce){bubble.call(this,p,Ce)}function ve(Ce){bubble.call(this,p,Ce)}return p.$$set=Ce=>{"value"in Ce&&f(0,m=Ce.value),"label"in Ce&&f(1,v=Ce.label),"labelPosition"in Ce&&f(2,y=Ce.labelPosition),"placeholder"in Ce&&f(3,w=Ce.placeholder),"type"in Ce&&f(4,k=Ce.type),"disabled"in Ce&&f(5,S=Ce.disabled),"readonly"in Ce&&f(6,M=Ce.readonly),"error"in Ce&&f(7,T=Ce.error),"updateOnChange"in Ce&&f(8,E=Ce.updateOnChange),"quiet"in Ce&&f(9,H=Ce.quiet),"autofocus"in Ce&&f(10,F=Ce.autofocus),"autocomplete"in Ce&&f(11,Z=Ce.autocomplete),"helpText"in Ce&&f(12,$=Ce.helpText)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,ae,ie,he,fe,me,ve]}let Input$5=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3K,create_fragment$3N,safe_not_equal,{value:0,label:1,labelPosition:2,placeholder:3,type:4,disabled:5,readonly:6,error:7,updateOnChange:8,quiet:9,autofocus:10,autocomplete:11,helpText:12})}};const indexVars$E="",indexVars$D="",Stepper_svelte_svelte_type_style_lang="",TextArea_svelte_svelte_type_style_lang="";function create_fragment$3M(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=element("textarea"),attr(f,"placeholder",m=p[1]||""),attr(f,"class","spectrum-Textfield-input svelte-1kmb9uq"),attr(f,"style",v=p[5]?`text-align: ${p[5]}`:""),f.disabled=p[2],f.readOnly=p[3],attr(f,"id",p[4]),f.value=y=p[0]||"",attr(u,"style",w=`${p[9]}${p[8]}`),attr(u,"class","spectrum-Textfield spectrum-Textfield--multiline svelte-1kmb9uq"),toggle_class(u,"is-disabled",p[2]),toggle_class(u,"is-focused",p[6])},m(M,T){insert(M,u,T),append$2(u,f),p[14](f),k||(S=[listen(f,"focus",p[15]),listen(f,"blur",p[10])],k=!0)},p(M,[T]){T&2&&m!==(m=M[1]||"")&&attr(f,"placeholder",m),T&32&&v!==(v=M[5]?`text-align: ${M[5]}`:"")&&attr(f,"style",v),T&4&&(f.disabled=M[2]),T&8&&(f.readOnly=M[3]),T&16&&attr(f,"id",M[4]),T&1&&y!==(y=M[0]||"")&&(f.value=y),T&768&&w!==(w=`${M[9]}${M[8]}`)&&attr(u,"style",w),T&4&&toggle_class(u,"is-disabled",M[2]),T&64&&toggle_class(u,"is-focused",M[6])},i:noop$2,o:noop$2,d(M){M&&detach(u),p[14](null),k=!1,run_all(S)}}}function instance$3J(p,u,f){let m,v,{value:y=""}=u,{placeholder:w=null}=u,{disabled:k=!1}=u,{readonly:S=!1}=u,{id:M=null}=u,{height:T=null}=u,{minHeight:E=null}=u;const H=()=>({start:$.selectionStart,end:$.selectionEnd});let{align:F=null}=u,Z=!1,$;const J=createEventDispatcher(),ae=me=>{J("change",me.target.value),f(6,Z=!1)},ie=(me,ve)=>!me||ve==null?"":isNaN(ve)?`${me}:${ve};`:`${me}:${ve}px;`;function he(me){binding_callbacks[me?"unshift":"push"](()=>{$=me,f(7,$)})}const fe=()=>f(6,Z=!0);return p.$$set=me=>{"value"in me&&f(0,y=me.value),"placeholder"in me&&f(1,w=me.placeholder),"disabled"in me&&f(2,k=me.disabled),"readonly"in me&&f(3,S=me.readonly),"id"in me&&f(4,M=me.id),"height"in me&&f(11,T=me.height),"minHeight"in me&&f(12,E=me.minHeight),"align"in me&&f(5,F=me.align)},p.$$.update=()=>{p.$$.dirty&2048&&f(9,m=ie("height",T)),p.$$.dirty&4096&&f(8,v=ie("min-height",E))},[y,w,k,S,M,F,Z,$,v,m,ae,T,E,H,he,fe]}class TextArea extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3J,create_fragment$3M,safe_not_equal,{value:0,placeholder:1,disabled:2,readonly:3,id:4,height:11,minHeight:12,getCaretPosition:13,align:5})}get getCaretPosition(){return this.$$.ctx[13]}}const indexVars$C="",indexVars$B="",indexVars$A="",ignoredClasses=[".download-js-link",".spectrum-Menu",".date-time-popover"],conditionallyIgnoredClasses=[".spectrum-Underlay",".drawer-wrapper",".spectrum-Popover"];let clickHandlers=[],candidateTarget;const handleClick=p=>{if(!p.target.closest('[data-ignore-click-outside="true"]')){for(let u of ignoredClasses)if(p.target.closest(u))return;clickHandlers.forEach(u=>{var f;if(!u.element.contains(p.target)){for(let m of conditionallyIgnoredClasses){const v=u.anchor.closest(m)!=null;if(p.target.closest(m)!=null&&!v)return}(f=u.callback)==null||f.call(u,p)}})}},handleMouseUp=p=>{candidateTarget===p.target&&handleClick(p),candidateTarget=null},handleMouseDown=p=>{p.button===0&&(candidateTarget=p.target,document.removeEventListener("click",handleMouseUp),document.addEventListener("click",handleMouseUp,!0))};document.addEventListener("mousedown",handleMouseDown),document.addEventListener("contextmenu",handleClick);const updateHandler=(p,u,f,m)=>{let v=clickHandlers.find(y=>y.id===p);v?v.callback=m:clickHandlers.push({id:p,element:u,anchor:f,callback:m})},removeHandler=p=>{clickHandlers=clickHandlers.filter(u=>u.id!==p)},clickOutside=(p,u)=>{const f=Math.random(),m=v=>{const y=(v==null?void 0:v.callback)||(typeof v=="function"?v:null),w=(v==null?void 0:v.anchor)||p;updateHandler(f,p,w,y)};return m(u),{update:m,destroy:()=>removeHandler(f)}},indexVars$z="",Search_svelte_svelte_type_style_lang="";function create_fragment$3L(p){let u,f,m,v,y,w,k,S,M,T,E,H;return{c(){u=element("div"),f=element("div"),m=svg_element("svg"),v=svg_element("use"),y=space(),w=element("input"),M=space(),T=element("button"),T.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-Cross75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Cross75"></use></svg>',xlink_attr(v,"xlink:href","#spectrum-icon-18-Magnify"),attr(m,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-icon"),attr(m,"focusable","false"),attr(m,"aria-hidden","true"),w.disabled=p[3],attr(w,"id",p[4]),w.value=k=p[1]||"",attr(w,"placeholder",S=p[2]||""),attr(w,"type","search"),attr(w,"class","spectrum-Textfield-input spectrum-Search-input svelte-d7zw73"),attr(w,"autocomplete","off"),attr(f,"class","spectrum-Textfield svelte-d7zw73"),toggle_class(f,"spectrum-Textfield--quiet",p[5]),toggle_class(f,"is-focused",p[6]),toggle_class(f,"is-disabled",p[3]),attr(T,"type","reset"),attr(T,"class","spectrum-ClearButton spectrum-Search-clearButton svelte-d7zw73"),attr(u,"class","spectrum-Search svelte-d7zw73"),toggle_class(u,"is-disabled",p[3])},m(F,Z){insert(F,u,Z),append$2(u,f),append$2(f,m),append$2(m,v),append$2(f,y),append$2(f,w),p[17](w),append$2(u,M),append$2(u,T),E||(H=[listen(w,"click",p[13]),listen(w,"blur",p[14]),listen(w,"focus",p[15]),listen(w,"input",p[16]),listen(w,"blur",p[9]),listen(w,"focus",p[8]),listen(w,"input",p[10]),listen(w,"keyup",p[11]),listen(T,"click",p[18])],E=!0)},p(F,[Z]){Z&8&&(w.disabled=F[3]),Z&16&&attr(w,"id",F[4]),Z&2&&k!==(k=F[1]||"")&&w.value!==k&&(w.value=k),Z&4&&S!==(S=F[2]||"")&&attr(w,"placeholder",S),Z&32&&toggle_class(f,"spectrum-Textfield--quiet",F[5]),Z&64&&toggle_class(f,"is-focused",F[6]),Z&8&&toggle_class(f,"is-disabled",F[3]),Z&8&&toggle_class(u,"is-disabled",F[3])},i:noop$2,o:noop$2,d(F){F&&detach(u),p[17](null),E=!1,run_all(H)}}}function instance$3I(p,u,f){let{value:m=null}=u,{placeholder:v=null}=u,{disabled:y=!1}=u,{id:w=null}=u,{updateOnChange:k=!0}=u,{quiet:S=!1}=u,{inputRef:M}=u;const T=createEventDispatcher();let E=!1;const H=Ce=>{T("change",Ce)},F=()=>{f(6,E=!0)},Z=Ce=>{f(6,E=!1),H(Ce.target.value)},$=Ce=>{k&&H(Ce.target.value)},J=Ce=>{Ce.key==="Enter"&&H(Ce.target.value)};function ae(Ce){bubble.call(this,p,Ce)}function ie(Ce){bubble.call(this,p,Ce)}function he(Ce){bubble.call(this,p,Ce)}function fe(Ce){bubble.call(this,p,Ce)}function me(Ce){binding_callbacks[Ce?"unshift":"push"](()=>{M=Ce,f(0,M)})}const ve=()=>H("");return p.$$set=Ce=>{"value"in Ce&&f(1,m=Ce.value),"placeholder"in Ce&&f(2,v=Ce.placeholder),"disabled"in Ce&&f(3,y=Ce.disabled),"id"in Ce&&f(4,w=Ce.id),"updateOnChange"in Ce&&f(12,k=Ce.updateOnChange),"quiet"in Ce&&f(5,S=Ce.quiet),"inputRef"in Ce&&f(0,M=Ce.inputRef)},[M,m,v,y,w,S,E,H,F,Z,$,J,k,ae,ie,he,fe,me,ve]}class Search extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3I,create_fragment$3L,safe_not_equal,{value:1,placeholder:2,disabled:3,id:4,updateOnChange:12,quiet:5,inputRef:0})}}const indexVars$y="",StatusLight_svelte_svelte_type_style_lang="";function create_fragment$3K(p){let u,f,m,v,y,w;const k=p[21].default,S=create_slot(k,p,p[20],null);return{c(){u=element("div"),S&&S.c(),attr(u,"class",f="spectrum-StatusLight spectrum-StatusLight--size"+p[0]+" svelte-1wk2ay6"),attr(u,"style",m=`--color: ${p[16]??"var(--spectrum-global-color-gray-400)"};`),toggle_class(u,"custom",!!p[16]),toggle_class(u,"square",p[17]),toggle_class(u,"hoverable",p[18]),toggle_class(u,"spectrum-StatusLight--celery",p[1]),toggle_class(u,"spectrum-StatusLight--yellow",p[2]),toggle_class(u,"spectrum-StatusLight--fuchsia",p[3]),toggle_class(u,"spectrum-StatusLight--indigo",p[4]),toggle_class(u,"spectrum-StatusLight--seafoam",p[5]),toggle_class(u,"spectrum-StatusLight--chartreuse",p[6]),toggle_class(u,"spectrum-StatusLight--magenta",p[7]),toggle_class(u,"spectrum-StatusLight--purple",p[8]),toggle_class(u,"spectrum-StatusLight--neutral",p[9]),toggle_class(u,"spectrum-StatusLight--info",p[10]),toggle_class(u,"spectrum-StatusLight--positive",p[11]),toggle_class(u,"spectrum-StatusLight--notice",p[12]),toggle_class(u,"spectrum-StatusLight--negative",p[13]),toggle_class(u,"spectrum-StatusLight--disabled",p[14]),toggle_class(u,"spectrum-StatusLight--active",p[15]),toggle_class(u,"withText",!!p[19].default)},m(M,T){insert(M,u,T),S&&S.m(u,null),v=!0,y||(w=listen(u,"click",p[22]),y=!0)},p(M,[T]){S&&S.p&&(!v||T&1048576)&&update_slot_base(S,k,M,M[20],v?get_slot_changes(k,M[20],T,null):get_all_dirty_from_scope(M[20]),null),(!v||T&1&&f!==(f="spectrum-StatusLight spectrum-StatusLight--size"+M[0]+" svelte-1wk2ay6"))&&attr(u,"class",f),(!v||T&65536&&m!==(m=`--color: ${M[16]??"var(--spectrum-global-color-gray-400)"};`))&&attr(u,"style",m),(!v||T&65537)&&toggle_class(u,"custom",!!M[16]),(!v||T&131073)&&toggle_class(u,"square",M[17]),(!v||T&262145)&&toggle_class(u,"hoverable",M[18]),(!v||T&3)&&toggle_class(u,"spectrum-StatusLight--celery",M[1]),(!v||T&5)&&toggle_class(u,"spectrum-StatusLight--yellow",M[2]),(!v||T&9)&&toggle_class(u,"spectrum-StatusLight--fuchsia",M[3]),(!v||T&17)&&toggle_class(u,"spectrum-StatusLight--indigo",M[4]),(!v||T&33)&&toggle_class(u,"spectrum-StatusLight--seafoam",M[5]),(!v||T&65)&&toggle_class(u,"spectrum-StatusLight--chartreuse",M[6]),(!v||T&129)&&toggle_class(u,"spectrum-StatusLight--magenta",M[7]),(!v||T&257)&&toggle_class(u,"spectrum-StatusLight--purple",M[8]),(!v||T&513)&&toggle_class(u,"spectrum-StatusLight--neutral",M[9]),(!v||T&1025)&&toggle_class(u,"spectrum-StatusLight--info",M[10]),(!v||T&2049)&&toggle_class(u,"spectrum-StatusLight--positive",M[11]),(!v||T&4097)&&toggle_class(u,"spectrum-StatusLight--notice",M[12]),(!v||T&8193)&&toggle_class(u,"spectrum-StatusLight--negative",M[13]),(!v||T&16385)&&toggle_class(u,"spectrum-StatusLight--disabled",M[14]),(!v||T&32769)&&toggle_class(u,"spectrum-StatusLight--active",M[15]),(!v||T&524289)&&toggle_class(u,"withText",!!M[19].default)},i(M){v||(transition_in(S,M),v=!0)},o(M){transition_out(S,M),v=!1},d(M){M&&detach(u),S&&S.d(M),y=!1,w()}}}function instance$3H(p,u,f){let{$$slots:m={},$$scope:v}=u;const y=compute_slots(m);let{size:w="M"}=u,{celery:k=!1}=u,{yellow:S=!1}=u,{fuchsia:M=!1}=u,{indigo:T=!1}=u,{seafoam:E=!1}=u,{chartreuse:H=!1}=u,{magenta:F=!1}=u,{purple:Z=!1}=u,{neutral:$=!1}=u,{info:J=!1}=u,{positive:ae=!1}=u,{notice:ie=!1}=u,{negative:he=!1}=u,{disabled:fe=!1}=u,{active:me=!1}=u,{color:ve=null}=u,{square:Ce=!1}=u,{hoverable:Ee=!1}=u;function Se(Ie){bubble.call(this,p,Ie)}return p.$$set=Ie=>{"size"in Ie&&f(0,w=Ie.size),"celery"in Ie&&f(1,k=Ie.celery),"yellow"in Ie&&f(2,S=Ie.yellow),"fuchsia"in Ie&&f(3,M=Ie.fuchsia),"indigo"in Ie&&f(4,T=Ie.indigo),"seafoam"in Ie&&f(5,E=Ie.seafoam),"chartreuse"in Ie&&f(6,H=Ie.chartreuse),"magenta"in Ie&&f(7,F=Ie.magenta),"purple"in Ie&&f(8,Z=Ie.purple),"neutral"in Ie&&f(9,$=Ie.neutral),"info"in Ie&&f(10,J=Ie.info),"positive"in Ie&&f(11,ae=Ie.positive),"notice"in Ie&&f(12,ie=Ie.notice),"negative"in Ie&&f(13,he=Ie.negative),"disabled"in Ie&&f(14,fe=Ie.disabled),"active"in Ie&&f(15,me=Ie.active),"color"in Ie&&f(16,ve=Ie.color),"square"in Ie&&f(17,Ce=Ie.square),"hoverable"in Ie&&f(18,Ee=Ie.hoverable),"$$scope"in Ie&&f(20,v=Ie.$$scope)},[w,k,S,M,T,E,H,F,Z,$,J,ae,ie,he,fe,me,ve,Ce,Ee,y,v,m,Se]}class StatusLight extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3H,create_fragment$3K,safe_not_equal,{size:0,celery:1,yellow:2,fuchsia:3,indigo:4,seafoam:5,chartreuse:6,magenta:7,purple:8,neutral:9,info:10,positive:11,notice:12,negative:13,disabled:14,active:15,color:16,square:17,hoverable:18})}}function positionDropdown(p,u){let f,m=u;const v=()=>y(m),y=k=>{const{anchor:S,align:M,maxHeight:T,maxWidth:E,minWidth:H,useAnchorWidth:F,offset:Z=5,customUpdate:$,resizable:J,wrap:ae}=k;if(!S)return;const ie=S.getBoundingClientRect(),he=p.getBoundingClientRect(),fe=window.innerWidth,me=window.innerHeight,ve=8;let Ce={maxHeight:T,minWidth:F?ie.width:H,maxWidth:F?ie.width:E,left:0,top:0};if(typeof $=="function")Ce=$(ie,he,{...Ce,offset:k.offset});else{const Ee=()=>Ce.left+he.width>fe&&ie.left>fe-ie.right,Se=()=>Ce.top+he.height>me&&ie.top>me-ie.bottom,Ie=$e=>{!Ce.maxHeight&&J&&(Ce.maxHeight=$e)},xe=$e=>{switch($e){case"StartToStart":default:Ce.left=ie.left;break;case"EndToEnd":Ce.left=ie.right-he.width;break;case"StartToEnd":Ce.left=ie.right+Z;break;case"EndToStart":Ce.left=ie.left-he.width-Z;break;case"MidPoint":Ce.left=ie.left+ie.width/2-he.width/2;break;case"ScreenEdge":Ce.left=fe-he.width-ve;break}},Ue=$e=>{switch($e){case"StartToStart":Ce.top=ie.top,Ie(me-ie.top-ve);break;case"EndToEnd":Ce.top=ie.bottom-he.height,Ie(ie.bottom-ve);break;case"StartToEnd":default:Ce.top=ie.bottom+Z,Ie(me-ie.bottom-ve);break;case"EndToStart":Ce.top=ie.top-he.height-Z,Ie(ie.top-ve);break;case"MidPoint":Ce.top=ie.top+ie.height/2-he.height/2;break;case"ScreenEdge":Ce.top=me-he.height-ve,Ie(me-2*ve);break}};xe(M==="right"?"EndToEnd":M==="right-outside"||M==="right-context-menu"?"StartToEnd":M==="left-outside"||M==="left-context-menu"?"EndToStart":M==="center"?"MidPoint":"StartToStart"),M==="right-outside"||M==="left-outside"?Ue("MidPoint"):M==="right-context-menu"||M==="left-context-menu"?(Ue("StartToStart"),Ce.top&&(Ce.top-=5)):Ue("StartToEnd"),Ee()&&(M==="left"?xe("EndToEnd"):M==="right-outside"&&xe("EndToStart")),Se()&&(ae?(Ue("MidPoint"),Se()&&Ue("ScreenEdge"),xe("StartToEnd"),Ee()&&xe("EndToStart")):Ue(M==="left-outside"||M==="right-outside"?"ScreenEdge":"EndToStart"))}for(const[Ee,Se]of Object.entries(Ce))p.style.setProperty(Ee,Se?`${Se}px`:null)},w=k=>{m=k,f&&f.disconnect();const{anchor:S}=k;S&&(f=new ResizeObserver(()=>y(k)),f.observe(S),f.observe(p),f.observe(document.body))};return p.style.position="fixed",p.style.zIndex="9999",document.addEventListener("scroll",v,!0),w(u),{update:w,destroy(){f&&f.disconnect(),document.removeEventListener("scroll",v,!0)}}}const Context$1={Modal:"bbui-modal",PopoverRoot:"bbui-popover-root"},Popover_svelte_svelte_type_style_lang="";function create_if_block$27(p){let u,f;return u=new Portal({props:{target:p[17],$$slots:{default:[create_default_slot$1P]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&131072&&(y.target=m[17]),v&537001982&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_default_slot$1P(p){let u,f,m,v,y,w,k;const S=p[26].default,M=create_slot(S,p,p[29],null);return{c(){u=element("div"),M&&M.c(),attr(u,"tabindex","0"),attr(u,"class","spectrum-Popover is-open svelte-1uiag1x"),attr(u,"role","presentation"),set_style(u,"height",p[9]),set_style(u,"--customZindex",p[11]),toggle_class(u,"customZindex",p[11]),toggle_class(u,"hidden",!p[13]),toggle_class(u,"blockPointerEvents",p[16])},m(T,E){insert(T,u,E),M&&M.m(u,null),y=!0,w||(k=[action_destroyer(f=positionDropdown.call(null,u,{anchor:p[1],align:p[2],maxHeight:p[5],maxWidth:p[4],minWidth:p[3],useAnchorWidth:p[6],offset:p[8],customUpdate:p[12],resizable:p[14],wrap:p[15]})),action_destroyer(m=clickOutside.call(null,u,{callback:p[7]?p[18]:clickOutside_function,anchor:p[1]})),listen(u,"keydown",p[19]),listen(u,"mouseenter",p[27]),listen(u,"mouseleave",p[28])],w=!0)},p(T,E){p=T,M&&M.p&&(!y||E&536870912)&&update_slot_base(M,S,p,p[29],y?get_slot_changes(S,p[29],E,null):get_all_dirty_from_scope(p[29]),null),(!y||E&512)&&set_style(u,"height",p[9]),(!y||E&2048)&&set_style(u,"--customZindex",p[11]),f&&is_function(f.update)&&E&53630&&f.update.call(null,{anchor:p[1],align:p[2],maxHeight:p[5],maxWidth:p[4],minWidth:p[3],useAnchorWidth:p[6],offset:p[8],customUpdate:p[12],resizable:p[14],wrap:p[15]}),m&&is_function(m.update)&&E&130&&m.update.call(null,{callback:p[7]?p[18]:clickOutside_function,anchor:p[1]}),(!y||E&2048)&&toggle_class(u,"customZindex",p[11]),(!y||E&8192)&&toggle_class(u,"hidden",!p[13]),(!y||E&65536)&&toggle_class(u,"blockPointerEvents",p[16])},i(T){y||(transition_in(M,T),T&&add_render_callback(()=>{y&&(v||(v=create_bidirectional_transition(u,fly,{y:-20,duration:p[10]?animationDuration:0},!0)),v.run(1))}),y=!0)},o(T){transition_out(M,T),T&&(v||(v=create_bidirectional_transition(u,fly,{y:-20,duration:p[10]?animationDuration:0},!1)),v.run(0)),y=!1},d(T){T&&detach(u),M&&M.d(T),T&&v&&v.end(),w=!1,run_all(k)}}}function create_fragment$3J(p){let u,f,m=p[0]&&create_if_block$27(p);return{c(){m&&m.c(),u=empty$1()},m(v,y){m&&m.m(v,y),insert(v,u,y),f=!0},p(v,[y]){v[0]?m?(m.p(v,y),y&1&&transition_in(m,1)):(m=create_if_block$27(v),m.c(),transition_in(m,1),m.m(u.parentNode,u)):m&&(group_outros(),transition_out(m,1,1,()=>{m=null}),check_outros())},i(v){f||(transition_in(m),f=!0)},o(v){transition_out(m),f=!1},d(v){v&&detach(u),m&&m.d(v)}}}const animationDuration=260,clickOutside_function=()=>{};function instance$3G(p,u,f){let m,{$$slots:v={},$$scope:y}=u;const w=createEventDispatcher();let{anchor:k}=u,{align:S="right"}=u,{portalTarget:M=void 0}=u,{minWidth:T=void 0}=u,{maxWidth:E=void 0}=u,{maxHeight:H=void 0}=u,{open:F=!1}=u,{useAnchorWidth:Z=!1}=u,{dismissible:$=!0}=u,{offset:J=4}=u,{customHeight:ae=void 0}=u,{animate:ie=!0}=u,{customZindex:he=void 0}=u,{handlePostionUpdate:fe=void 0}=u,{showPopover:me=!0}=u,{clickOutsideOverride:ve=!1}=u,{resizable:Ce=!0}=u,{wrap:Ee=!1}=u,Se,Ie=!1;const xe=()=>{w("open"),f(0,F=!0)},Ue=()=>{w("close"),f(0,F=!1)},$e=()=>{F?Ue():xe()},Ye=Ne=>{if(!ve&&F){let Je=Ne.target,ft=!1;for(;!ft&&Je&&Je.parentNode;)ft=Je===k,Je=Je.parentNode;ft&&Ne.stopPropagation(),Ue()}},be=Ne=>{ve&&F&&Ne.key==="Escape"&&Ue()};onDestroy(()=>{clearTimeout(Se)});function Be(Ne){bubble.call(this,p,Ne)}function Xe(Ne){bubble.call(this,p,Ne)}return p.$$set=Ne=>{"anchor"in Ne&&f(1,k=Ne.anchor),"align"in Ne&&f(2,S=Ne.align),"portalTarget"in Ne&&f(20,M=Ne.portalTarget),"minWidth"in Ne&&f(3,T=Ne.minWidth),"maxWidth"in Ne&&f(4,E=Ne.maxWidth),"maxHeight"in Ne&&f(5,H=Ne.maxHeight),"open"in Ne&&f(0,F=Ne.open),"useAnchorWidth"in Ne&&f(6,Z=Ne.useAnchorWidth),"dismissible"in Ne&&f(7,$=Ne.dismissible),"offset"in Ne&&f(8,J=Ne.offset),"customHeight"in Ne&&f(9,ae=Ne.customHeight),"animate"in Ne&&f(10,ie=Ne.animate),"customZindex"in Ne&&f(11,he=Ne.customZindex),"handlePostionUpdate"in Ne&&f(12,fe=Ne.handlePostionUpdate),"showPopover"in Ne&&f(13,me=Ne.showPopover),"clickOutsideOverride"in Ne&&f(21,ve=Ne.clickOutsideOverride),"resizable"in Ne&&f(14,Ce=Ne.resizable),"wrap"in Ne&&f(15,Ee=Ne.wrap),"$$scope"in Ne&&f(29,y=Ne.$$scope)},p.$$.update=()=>{p.$$.dirty&1048576&&f(17,m=M||getContext$1(Context$1.PopoverRoot)||".spectrum"),p.$$.dirty&33555457&&F&&ie&&(f(16,Ie=!0),clearTimeout(Se),f(25,Se=setTimeout(()=>{f(16,Ie=!1)},animationDuration/2)))},[F,k,S,T,E,H,Z,$,J,ae,ie,he,fe,me,Ce,Ee,Ie,m,Ye,be,M,ve,xe,Ue,$e,Se,v,Be,Xe,y]}class Popover extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3G,create_fragment$3J,safe_not_equal,{anchor:1,align:2,portalTarget:20,minWidth:3,maxWidth:4,maxHeight:5,open:0,useAnchorWidth:6,dismissible:7,offset:8,customHeight:9,animate:10,customZindex:11,handlePostionUpdate:12,showPopover:13,clickOutsideOverride:21,resizable:14,wrap:15,show:22,hide:23,toggle:24})}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}}const indexVars$x="",Tags_svelte_svelte_type_style_lang="";function create_fragment$3I(p){let u,f;const m=p[1].default,v=create_slot(m,p,p[0],null);return{c(){u=element("div"),v&&v.c(),attr(u,"class","spectrum-Tags svelte-17cj8k0"),attr(u,"role","list"),attr(u,"aria-label","list")},m(y,w){insert(y,u,w),v&&v.m(u,null),f=!0},p(y,[w]){v&&v.p&&(!f||w&1)&&update_slot_base(v,m,y,y[0],f?get_slot_changes(m,y[0],w,null):get_all_dirty_from_scope(y[0]),null)},i(y){f||(transition_in(v,y),f=!0)},o(y){transition_out(v,y),f=!1},d(y){y&&detach(u),v&&v.d(y)}}}function instance$3F(p,u,f){let{$$slots:m={},$$scope:v}=u;return p.$$set=y=>{"$$scope"in y&&f(0,v=y.$$scope)},[v,m]}class Tags extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3F,create_fragment$3I,safe_not_equal,{})}}const indexVars$w="",Avatar_svelte_svelte_type_style_lang="";function create_else_block$F(p){let u,f=(p[3]||"")+"",m;return{c(){u=element("div"),m=text$1(f),attr(u,"class","spectrum-Avatar svelte-xutedg"),attr(u,"style",p[4]),toggle_class(u,"is-disabled",p[2])},m(v,y){insert(v,u,y),append$2(u,m)},p(v,y){y&8&&f!==(f=(v[3]||"")+"")&&set_data(m,f),y&16&&attr(u,"style",v[4]),y&4&&toggle_class(u,"is-disabled",v[2])},d(v){v&&detach(u)}}}function create_if_block$26(p){let u,f;return{c(){u=element("img"),attr(u,"class","spectrum-Avatar"),src_url_equal(u.src,f=p[1])||attr(u,"src",f),attr(u,"alt","Avatar"),set_style(u,"width","var("+p[5].get(p[0])+")"),set_style(u,"height","var("+p[5].get(p[0])+")"),toggle_class(u,"is-disabled",p[2])},m(m,v){insert(m,u,v)},p(m,v){v&2&&!src_url_equal(u.src,f=m[1])&&attr(u,"src",f),v&1&&set_style(u,"width","var("+m[5].get(m[0])+")"),v&1&&set_style(u,"height","var("+m[5].get(m[0])+")"),v&4&&toggle_class(u,"is-disabled",m[2])},d(m){m&&detach(u)}}}function create_fragment$3H(p){let u;function f(y,w){return y[1]?create_if_block$26:create_else_block$F}let m=f(p),v=m(p);return{c(){v.c(),u=empty$1()},m(y,w){v.m(y,w),insert(y,u,w)},p(y,[w]){m===(m=f(y))&&v?v.p(y,w):(v.d(1),v=m(y),v&&(v.c(),v.m(u.parentNode,u)))},i:noop$2,o:noop$2,d(y){y&&detach(u),v.d(y)}}}const DefaultColor="#3aab87";function instance$3E(p,u,f){let m,v,y=new Map([["XXS","--spectrum-alias-avatar-size-50"],["XS","--spectrum-alias-avatar-size-75"],["S","--spectrum-alias-avatar-size-200"],["M","--spectrum-alias-avatar-size-400"],["L","--spectrum-alias-avatar-size-500"],["XL","--spectrum-alias-avatar-size-600"],["XXL","--spectrum-alias-avatar-size-700"]]),{size:w="M"}=u,{url:k=""}=u,{disabled:S=!1}=u,{initials:M="JD"}=u,{color:T=null}=u;const E=F=>F!=null&&F.length?`hsl(${F[0].toLowerCase().charCodeAt(0)%26/26*360}, 50%, 50%)`:DefaultColor,H=(F,Z)=>{const $=`var(${y.get(F)})`,J=`calc(${$} / 2)`;return`width:${$}; height:${$}; font-size:${J}; background:${Z};`};return p.$$set=F=>{"size"in F&&f(0,w=F.size),"url"in F&&f(1,k=F.url),"disabled"in F&&f(2,S=F.disabled),"initials"in F&&f(3,M=F.initials),"color"in F&&f(6,T=F.color)},p.$$.update=()=>{p.$$.dirty&72&&f(7,m=T||E(M)),p.$$.dirty&129&&f(4,v=H(w,m))},[w,k,S,M,v,y,T,m]}class Avatar extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3E,create_fragment$3H,safe_not_equal,{size:0,url:1,disabled:2,initials:3,color:6})}}function create_fragment$3G(p){let u,f,m,v,y;return{c(){u=element("button"),f=svg_element("svg"),m=svg_element("use"),xlink_attr(m,"xlink:href","#spectrum-css-icon-Cross75"),attr(f,"class","spectrum-Icon spectrum-UIIcon-Cross75"),attr(f,"focusable","false"),attr(f,"aria-hidden","true"),attr(u,"class","spectrum-ClearButton"),u.disabled=p[1],toggle_class(u,"spectrum-ClearButton--small",p[0])},m(w,k){insert(w,u,k),append$2(u,f),append$2(f,m),v||(y=listen(u,"click",p[2]),v=!0)},p(w,[k]){k&2&&(u.disabled=w[1]),k&1&&toggle_class(u,"spectrum-ClearButton--small",w[0])},i:noop$2,o:noop$2,d(w){w&&detach(u),v=!1,y()}}}function instance$3D(p,u,f){let{small:m=!1}=u,{disabled:v}=u;function y(w){bubble.call(this,p,w)}return p.$$set=w=>{"small"in w&&f(0,m=w.small),"disabled"in w&&f(1,v=w.disabled)},[m,v,y]}class ClearButton extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3D,create_fragment$3G,safe_not_equal,{small:0,disabled:1})}}const Tag_svelte_svelte_type_style_lang$1="";function create_if_block_2$G(p){let u,f;return u=new Avatar({props:{url:p[1]}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&2&&(y.url=m[1]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_1$15(p){let u,f,m;return{c(){u=svg_element("svg"),f=svg_element("use"),xlink_attr(f,"xlink:href",m="#spectrum-icon-24-"+p[0]),attr(u,"class","spectrum-Icon spectrum-Icon--sizeS"),attr(u,"focusable","false"),attr(u,"aria-hidden","true"),attr(u,"aria-label","Tag")},m(v,y){insert(v,u,y),append$2(u,f)},p(v,y){y&1&&m!==(m="#spectrum-icon-24-"+v[0])&&xlink_attr(f,"xlink:href",m)},d(v){v&&detach(u)}}}function create_if_block$25(p){let u,f;return u=new ClearButton({}),u.$on("click",p[7]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3F(p){let u,f,m,v,y,w,k=p[1]&&create_if_block_2$G(p),S=p[0]&&create_if_block_1$15(p);const M=p[6].default,T=create_slot(M,p,p[5],null);let E=p[4]&&create_if_block$25(p);return{c(){u=element("div"),k&&k.c(),f=space(),S&&S.c(),m=space(),v=element("span"),T&&T.c(),y=space(),E&&E.c(),attr(v,"class","spectrum-Tags-itemLabel"),attr(u,"class","spectrum-Tags-item svelte-16fqld8"),attr(u,"role","listitem"),toggle_class(u,"is-invalid",p[2]),toggle_class(u,"is-disabled",p[3])},m(H,F){insert(H,u,F),k&&k.m(u,null),append$2(u,f),S&&S.m(u,null),append$2(u,m),append$2(u,v),T&&T.m(v,null),append$2(u,y),E&&E.m(u,null),w=!0},p(H,[F]){H[1]?k?(k.p(H,F),F&2&&transition_in(k,1)):(k=create_if_block_2$G(H),k.c(),transition_in(k,1),k.m(u,f)):k&&(group_outros(),transition_out(k,1,1,()=>{k=null}),check_outros()),H[0]?S?S.p(H,F):(S=create_if_block_1$15(H),S.c(),S.m(u,m)):S&&(S.d(1),S=null),T&&T.p&&(!w||F&32)&&update_slot_base(T,M,H,H[5],w?get_slot_changes(M,H[5],F,null):get_all_dirty_from_scope(H[5]),null),H[4]?E?F&16&&transition_in(E,1):(E=create_if_block$25(H),E.c(),transition_in(E,1),E.m(u,null)):E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()),(!w||F&4)&&toggle_class(u,"is-invalid",H[2]),(!w||F&8)&&toggle_class(u,"is-disabled",H[3])},i(H){w||(transition_in(k),transition_in(T,H),transition_in(E),w=!0)},o(H){transition_out(k),transition_out(T,H),transition_out(E),w=!1},d(H){H&&detach(u),k&&k.d(),S&&S.d(),T&&T.d(H),E&&E.d()}}}function instance$3C(p,u,f){let{$$slots:m={},$$scope:v}=u,{icon:y=""}=u,{avatar:w=""}=u,{invalid:k=!1}=u,{disabled:S=!1}=u,{closable:M=!1}=u;function T(E){bubble.call(this,p,E)}return p.$$set=E=>{"icon"in E&&f(0,y=E.icon),"avatar"in E&&f(1,w=E.avatar),"invalid"in E&&f(2,k=E.invalid),"disabled"in E&&f(3,S=E.disabled),"closable"in E&&f(4,M=E.closable),"$$scope"in E&&f(5,v=E.$$scope)},[y,w,k,S,M,v,m,T]}let Tag$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3C,create_fragment$3F,safe_not_equal,{icon:0,avatar:1,invalid:2,disabled:3,closable:4})}};const indexVars$v="";function create_fragment$3E(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z;return{c(){u=element("div"),f=element("div"),m=space(),v=element("div"),y=element("div"),w=element("div"),k=element("div"),S=space(),M=element("div"),T=element("div"),E=element("div"),attr(f,"class","spectrum-ProgressCircle-track"),attr(k,"class","spectrum-ProgressCircle-fill"),attr(w,"class","spectrum-ProgressCircle-fillSubMask1"),attr(w,"style",p[3]),attr(y,"class","spectrum-ProgressCircle-fillMask1"),attr(E,"class","spectrum-ProgressCircle-fill"),attr(T,"class","spectrum-ProgressCircle-fillSubMask2"),attr(T,"style",p[4]),attr(M,"class","spectrum-ProgressCircle-fillMask2"),attr(v,"class","spectrum-ProgressCircle-fills"),attr(u,"class",H="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(p[0])),toggle_class(u,"spectrum-ProgressCircle--indeterminate",p[1]==null),toggle_class(u,"spectrum-ProgressCircle--overBackground",p[2])},m($,J){insert($,u,J),append$2(u,f),append$2(u,m),append$2(u,v),append$2(v,y),append$2(y,w),append$2(w,k),append$2(v,S),append$2(v,M),append$2(M,T),append$2(T,E),F||(Z=listen(u,"click",p[7]),F=!0)},p($,[J]){J&8&&attr(w,"style",$[3]),J&16&&attr(T,"style",$[4]),J&1&&H!==(H="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize($[0]))&&attr(u,"class",H),J&3&&toggle_class(u,"spectrum-ProgressCircle--indeterminate",$[1]==null),J&5&&toggle_class(u,"spectrum-ProgressCircle--overBackground",$[2])},i:noop$2,o:noop$2,d($){$&&detach(u),F=!1,Z()}}}function convertSize(p){switch(p){case"S":return"small";case"L":return"large";default:return}}function instance$3B(p,u,f){let{size:m="M"}=u,{value:v=null}=u,{minValue:y=0}=u,{maxValue:w=100}=u,k,S;function M(H){if(H){let F=(H-y)/(w-y)*100,Z;F>0&&F<=50?(Z=-180+F/50*180,f(3,k=`transform: rotate(${Z}deg);`),f(4,S="transform: rotate(-180deg);")):F>50&&(Z=-180+(F-50)/50*180,f(3,k="transform: rotate(0deg);"),f(4,S=`transform: rotate(${Z}deg);`))}}let{overBackground:T=!1}=u;function E(H){bubble.call(this,p,H)}return p.$$set=H=>{"size"in H&&f(0,m=H.size),"value"in H&&f(1,v=H.value),"minValue"in H&&f(5,y=H.minValue),"maxValue"in H&&f(6,w=H.maxValue),"overBackground"in H&&f(2,T=H.overBackground)},p.$$.update=()=>{p.$$.dirty&2&&M(v)},[m,v,T,k,S,y,w,E]}class ProgressCircle extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3B,create_fragment$3E,safe_not_equal,{size:0,value:1,minValue:5,maxValue:6,overBackground:2})}}const Picker_svelte_svelte_type_style_lang="";function get_each_context$J(p,u,f){const m=p.slice();return m[49]=u[f],m[51]=f,m}function create_if_block_11$2(p){let u,f,m,v;const y=[create_if_block_12$2,create_else_block_1$d],w=[];function k(S,M){return S[15]?1:0}return u=k(p),f=w[u]=y[u](p),{c(){f.c(),m=empty$1()},m(S,M){w[u].m(S,M),insert(S,m,M),v=!0},p(S,M){let T=u;u=k(S),u===T?w[u].p(S,M):(group_outros(),transition_out(w[T],1,1,()=>{w[T]=null}),check_outros(),f=w[u],f?f.p(S,M):(f=w[u]=y[u](S),f.c()),transition_in(f,1),f.m(m.parentNode,m))},i(S){v||(transition_in(f),v=!0)},o(S){transition_out(f),v=!1},d(S){S&&detach(m),w[u].d(S)}}}function create_else_block_1$d(p){let u,f,m;return{c(){u=element("span"),f=element("img"),src_url_equal(f.src,m=p[5])||attr(f,"src",m),attr(f,"alt","icon"),attr(f,"width","15"),attr(f,"height","15"),attr(u,"class","option-extra icon field-icon svelte-1jmtv0w")},m(v,y){insert(v,u,y),append$2(u,f)},p(v,y){y[0]&32&&!src_url_equal(f.src,m=v[5])&&attr(f,"src",m)},i:noop$2,o:noop$2,d(v){v&&detach(u)}}}function create_if_block_12$2(p){let u,f,m;return f=new Icon$1({props:{size:"S",name:p[5]}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra icon svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&32&&(w.name=v[5]),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_10$3(p){let u,f,m;return f=new StatusLight({props:{square:!0,color:p[6]}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&64&&(w.color=v[6]),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_9$4(p){let u,f;return u=new Search({props:{value:p[0],disabled:p[3],placeholder:"Search"}}),u.$on("change",p[37]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1&&(y.value=m[0]),v[0]&8&&(y.disabled=m[3]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_8$5(p){let u,f,m,v,y,w,k,S;return{c(){u=element("li"),f=element("span"),m=text$1(p[8]),v=space(),y=svg_element("svg"),w=svg_element("use"),attr(f,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(w,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(y,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(y,"focusable","false"),attr(y,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item placeholder svelte-1jmtv0w"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[7])},m(M,T){insert(M,u,T),append$2(u,f),append$2(f,m),append$2(u,v),append$2(u,y),append$2(y,w),k||(S=listen(u,"click",p[38]),k=!0)},p(M,T){T[0]&256&&set_data(m,M[8]),T[0]&128&&toggle_class(u,"is-selected",M[7])},d(M){M&&detach(u),k=!1,S()}}}function create_if_block_2$F(p){let u,f,m=ensure_array_like(p[30]),v=[];for(let w=0;w<m.length;w+=1)v[w]=create_each_block$J(get_each_context$J(p,m,w));const y=w=>transition_out(v[w],1,1,()=>{v[w]=null});return{c(){for(let w=0;w<v.length;w+=1)v[w].c();u=empty$1()},m(w,k){for(let S=0;S<v.length;S+=1)v[S]&&v[S].m(w,k);insert(w,u,k),f=!0},p(w,k){if(k[0]&1275330048){m=ensure_array_like(w[30]);let S;for(S=0;S<m.length;S+=1){const M=get_each_context$J(w,m,S);v[S]?(v[S].p(M,k),transition_in(v[S],1)):(v[S]=create_each_block$J(M),v[S].c(),transition_in(v[S],1),v[S].m(u.parentNode,u))}for(group_outros(),S=m.length;S<v.length;S+=1)y(S);check_outros()}},i(w){if(!f){for(let k=0;k<m.length;k+=1)transition_in(v[k]);f=!0}},o(w){v=v.filter(Boolean);for(let k=0;k<v.length;k+=1)transition_out(v[k]);f=!1},d(w){w&&detach(u),destroy_each(v,w)}}}function create_if_block_6$b(p){let u,f,m,v;const y=[create_if_block_7$a,create_else_block$E],w=[];function k(S,M){return S[15]?0:1}return f=k(p),m=w[f]=y[f](p),{c(){u=element("span"),m.c(),attr(u,"class","option-extra icon svelte-1jmtv0w")},m(S,M){insert(S,u,M),w[f].m(u,null),v=!0},p(S,M){let T=f;f=k(S),f===T?w[f].p(S,M):(group_outros(),transition_out(w[T],1,1,()=>{w[T]=null}),check_outros(),m=w[f],m?m.p(S,M):(m=w[f]=y[f](S),m.c()),transition_in(m,1),m.m(u,null))},i(S){v||(transition_in(m),v=!0)},o(S){transition_out(m),v=!1},d(S){S&&detach(u),w[f].d()}}}function create_else_block$E(p){let u,f;return u=new Icon$1({props:{size:"S",name:p[14](p[49],p[51])}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1073758208&&(y.name=m[14](m[49],m[51])),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_7$a(p){let u,f;return{c(){u=element("img"),src_url_equal(u.src,f=p[14](p[49],p[51]))||attr(u,"src",f),attr(u,"alt","icon"),attr(u,"width","15"),attr(u,"height","15")},m(m,v){insert(m,u,v)},p(m,v){v[0]&1073758208&&!src_url_equal(u.src,f=m[14](m[49],m[51]))&&attr(u,"src",f)},i:noop$2,o:noop$2,d(m){m&&detach(u)}}}function create_if_block_5$g(p){let u,f,m;return f=new StatusLight({props:{square:!0,color:p[16](p[49],p[51])}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&1073807360&&(w.color=v[16](v[49],v[51])),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_4$j(p){let u,f=p[17](p[49],p[51])+"",m;return{c(){u=element("span"),m=text$1(f),attr(u,"class","subtitle-text svelte-1jmtv0w")},m(v,y){insert(v,u,y),append$2(u,m)},p(v,y){y[0]&1073872896&&f!==(f=v[17](v[49],v[51])+"")&&set_data(m,f)},d(v){v&&detach(u)}}}function create_if_block_3$q(p){let u,f,m;return f=new Tags({props:{$$slots:{default:[create_default_slot_1$J]},$$scope:{ctx:p}}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-tag svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&1073741824|y[1]&2097152&&(w.$$scope={dirty:y,ctx:v}),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_default_slot_2$u(p){let u=p[49].tag+"",f;return{c(){f=text$1(u)},m(m,v){insert(m,f,v)},p(m,v){v[0]&1073741824&&u!==(u=m[49].tag+"")&&set_data(f,u)},d(m){m&&detach(f)}}}function create_default_slot_1$J(p){let u,f;return u=new Tag$1({props:{icon:"LockClosed",$$slots:{default:[create_default_slot_2$u]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1073741824|v[1]&2097152&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_each_block$J(p){let u,f=p[14](p[49],p[51]),m,v=p[16](p[49],p[51]),y,w,k=p[12](p[49],p[51])+"",S,M,T=p[17](p[49],p[51]),E,H,F,Z,$,J,ae,ie,he=f&&create_if_block_6$b(p),fe=v&&create_if_block_5$g(p),me=T&&create_if_block_4$j(p),ve=p[49].tag&&create_if_block_3$q(p);function Ce(){return p[39](p[49],p[51])}function Ee(...Ie){return p[40](p[49],...Ie)}function Se(...Ie){return p[41](p[49],...Ie)}return{c(){u=element("li"),he&&he.c(),m=space(),fe&&fe.c(),y=space(),w=element("span"),S=text$1(k),M=space(),me&&me.c(),E=space(),ve&&ve.c(),H=space(),F=svg_element("svg"),Z=svg_element("use"),$=space(),attr(w,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(Z,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(F,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(F,"focusable","false"),attr(F,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item svelte-1jmtv0w"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[9](p[13](p[49],p[51]))),toggle_class(u,"is-disabled",!p[10](p[49]))},m(Ie,xe){insert(Ie,u,xe),he&&he.m(u,null),append$2(u,m),fe&&fe.m(u,null),append$2(u,y),append$2(u,w),append$2(w,S),append$2(w,M),me&&me.m(w,null),append$2(u,E),ve&&ve.m(u,null),append$2(u,H),append$2(u,F),append$2(F,Z),append$2(u,$),J=!0,ae||(ie=[listen(u,"click",Ce),listen(u,"mouseenter",Ee),listen(u,"mouseleave",Se)],ae=!0)},p(Ie,xe){p=Ie,xe[0]&1073758208&&(f=p[14](p[49],p[51])),f?he?(he.p(p,xe),xe[0]&1073758208&&transition_in(he,1)):(he=create_if_block_6$b(p),he.c(),transition_in(he,1),he.m(u,m)):he&&(group_outros(),transition_out(he,1,1,()=>{he=null}),check_outros()),xe[0]&1073807360&&(v=p[16](p[49],p[51])),v?fe?(fe.p(p,xe),xe[0]&1073807360&&transition_in(fe,1)):(fe=create_if_block_5$g(p),fe.c(),transition_in(fe,1),fe.m(u,y)):fe&&(group_outros(),transition_out(fe,1,1,()=>{fe=null}),check_outros()),(!J||xe[0]&1073745920)&&k!==(k=p[12](p[49],p[51])+"")&&set_data(S,k),xe[0]&1073872896&&(T=p[17](p[49],p[51])),T?me?me.p(p,xe):(me=create_if_block_4$j(p),me.c(),me.m(w,null)):me&&(me.d(1),me=null),p[49].tag?ve?(ve.p(p,xe),xe[0]&1073741824&&transition_in(ve,1)):(ve=create_if_block_3$q(p),ve.c(),transition_in(ve,1),ve.m(u,H)):ve&&(group_outros(),transition_out(ve,1,1,()=>{ve=null}),check_outros()),(!J||xe[0]&1073750528)&&toggle_class(u,"is-selected",p[9](p[13](p[49],p[51]))),(!J||xe[0]&1073742848)&&toggle_class(u,"is-disabled",!p[10](p[49]))},i(Ie){J||(transition_in(he),transition_in(fe),transition_in(ve),J=!0)},o(Ie){transition_out(he),transition_out(fe),transition_out(ve),J=!1},d(Ie){Ie&&detach(u),he&&he.d(),fe&&fe.d(),me&&me.d(),ve&&ve.d(),ae=!1,run_all(ie)}}}function create_if_block_1$14(p){let u,f,m;return f=new ProgressCircle({props:{size:"S"}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","loading svelte-1jmtv0w"),toggle_class(u,"loading--withAutocomplete",p[20])},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){(!m||y[0]&1048576)&&toggle_class(u,"loading--withAutocomplete",v[20])},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block$24(p){let u,f;return{c(){u=element("div"),f=text$1(p[23]),attr(u,"class","footer svelte-1jmtv0w")},m(m,v){insert(m,u,v),append$2(u,f)},p(m,v){v[0]&8388608&&set_data(f,m[23])},d(m){m&&detach(u)}}}function create_default_slot$1O(p){let u,f,m,v,y,w,k,S,M,T,E=p[20]&&create_if_block_9$4(p),H=p[8]&&create_if_block_8$5(p),F=p[30].length&&create_if_block_2$F(p),Z=p[25]&&create_if_block_1$14(p),$=p[23]&&create_if_block$24(p);return{c(){u=element("div"),E&&E.c(),f=space(),m=element("ul"),H&&H.c(),v=space(),F&&F.c(),y=space(),Z&&Z.c(),w=space(),$&&$.c(),attr(m,"class","spectrum-Menu"),attr(m,"role","listbox"),attr(u,"class","popover-content svelte-1jmtv0w"),toggle_class(u,"auto-width",p[19])},m(J,ae){insert(J,u,ae),E&&E.m(u,null),append$2(u,f),append$2(u,m),H&&H.m(m,null),append$2(m,v),F&&F.m(m,null),p[42](m),append$2(u,y),Z&&Z.m(u,null),append$2(u,w),$&&$.m(u,null),S=!0,M||(T=action_destroyer(k=clickOutside.call(null,u,p[43])),M=!0)},p(J,ae){J[20]?E?(E.p(J,ae),ae[0]&1048576&&transition_in(E,1)):(E=create_if_block_9$4(J),E.c(),transition_in(E,1),E.m(u,f)):E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()),J[8]?H?H.p(J,ae):(H=create_if_block_8$5(J),H.c(),H.m(m,v)):H&&(H.d(1),H=null),J[30].length?F?(F.p(J,ae),ae[0]&1073741824&&transition_in(F,1)):(F=create_if_block_2$F(J),F.c(),transition_in(F,1),F.m(m,null)):F&&(group_outros(),transition_out(F,1,1,()=>{F=null}),check_outros()),J[25]?Z?(Z.p(J,ae),ae[0]&33554432&&transition_in(Z,1)):(Z=create_if_block_1$14(J),Z.c(),transition_in(Z,1),Z.m(u,w)):Z&&(group_outros(),transition_out(Z,1,1,()=>{Z=null}),check_outros()),J[23]?$?$.p(J,ae):($=create_if_block$24(J),$.c(),$.m(u,null)):$&&($.d(1),$=null),k&&is_function(k.update)&&ae[0]&2&&k.update.call(null,J[43]),(!S||ae[0]&524288)&&toggle_class(u,"auto-width",J[19])},i(J){S||(transition_in(E),transition_in(F),transition_in(Z),S=!0)},o(J){transition_out(E),transition_out(F),transition_out(Z),S=!1},d(J){J&&detach(u),E&&E.d(),H&&H.d(),F&&F.d(),p[42](null),Z&&Z.d(),$&&$.d(),M=!1,T()}}}function create_fragment$3D(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z=p[5]&&create_if_block_11$2(p),$=p[6]&&create_if_block_10$3(p);return T=new Popover({props:{anchor:p[24]?p[24]:p[29],align:p[22]||"left",open:p[1],useAnchorWidth:!p[19],maxWidth:p[19]?400:null,customHeight:p[21],maxHeight:360,$$slots:{default:[create_default_slot$1O]},$$scope:{ctx:p}}}),T.$on("close",p[44]),{c(){u=element("button"),Z&&Z.c(),f=space(),$&&$.c(),m=space(),v=element("span"),y=text$1(p[4]),w=space(),k=svg_element("svg"),S=svg_element("use"),M=space(),create_component(T.$$.fragment),attr(v,"class","spectrum-Picker-label svelte-1jmtv0w"),toggle_class(v,"is-placeholder",p[7]),toggle_class(v,"auto-width",p[19]),xlink_attr(S,"xlink:href","#spectrum-css-icon-Chevron100"),attr(k,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"),attr(k,"focusable","false"),attr(k,"aria-hidden","true"),attr(u,"id",p[2]),attr(u,"class","spectrum-Picker spectrum-Picker--sizeM svelte-1jmtv0w"),u.disabled=p[3],attr(u,"aria-haspopup","listbox"),toggle_class(u,"spectrum-Picker--quiet",p[18]),toggle_class(u,"is-open",p[1])},m(J,ae){insert(J,u,ae),Z&&Z.m(u,null),append$2(u,f),$&&$.m(u,null),append$2(u,m),append$2(u,v),append$2(v,y),append$2(u,w),append$2(u,k),append$2(k,S),p[36](u),insert(J,M,ae),mount_component(T,J,ae),E=!0,H||(F=listen(u,"click",p[31]),H=!0)},p(J,ae){J[5]?Z?(Z.p(J,ae),ae[0]&32&&transition_in(Z,1)):(Z=create_if_block_11$2(J),Z.c(),transition_in(Z,1),Z.m(u,f)):Z&&(group_outros(),transition_out(Z,1,1,()=>{Z=null}),check_outros()),J[6]?$?($.p(J,ae),ae[0]&64&&transition_in($,1)):($=create_if_block_10$3(J),$.c(),transition_in($,1),$.m(u,m)):$&&(group_outros(),transition_out($,1,1,()=>{$=null}),check_outros()),(!E||ae[0]&16)&&set_data(y,J[4]),(!E||ae[0]&128)&&toggle_class(v,"is-placeholder",J[7]),(!E||ae[0]&524288)&&toggle_class(v,"auto-width",J[19]),(!E||ae[0]&4)&&attr(u,"id",J[2]),(!E||ae[0]&8)&&(u.disabled=J[3]),(!E||ae[0]&262144)&&toggle_class(u,"spectrum-Picker--quiet",J[18]),(!E||ae[0]&2)&&toggle_class(u,"is-open",J[1]);const ie={};ae[0]&553648128&&(ie.anchor=J[24]?J[24]:J[29]),ae[0]&4194304&&(ie.align=J[22]||"left"),ae[0]&2&&(ie.open=J[1]),ae[0]&524288&&(ie.useAnchorWidth=!J[19]),ae[0]&524288&&(ie.maxWidth=J[19]?400:null),ae[0]&2097152&&(ie.customHeight=J[21]),ae[0]&1587281803|ae[1]&2097152&&(ie.$$scope={dirty:ae,ctx:J}),T.$set(ie)},i(J){E||(transition_in(Z),transition_in($),transition_in(T.$$.fragment,J),E=!0)},o(J){transition_out(Z),transition_out($),transition_out(T.$$.fragment,J),E=!1},d(J){J&&(detach(u),detach(M)),Z&&Z.d(),$&&$.d(),p[36](null),destroy_component(T,J),H=!1,F()}}}function instance$3A(p,u,f){let m,v,{id:y=null}=u,{disabled:w=!1}=u,{fieldText:k=""}=u,{fieldIcon:S=""}=u,{fieldColour:M=""}=u,{isPlaceholder:T=!1}=u,{placeholderOption:E=null}=u,{options:H=[]}=u,{isOptionSelected:F=()=>!1}=u,{isOptionEnabled:Z=()=>!0}=u,{onSelectOption:$=()=>{}}=u,{getOptionLabel:J=cn=>cn}=u,{getOptionValue:ae=cn=>cn}=u,{getOptionIcon:ie=()=>null}=u,{useOptionIconImage:he=!1}=u,{getOptionColour:fe=()=>null}=u,{getOptionSubtitle:me=()=>null}=u,{open:ve=!1}=u,{readonly:Ce=!1}=u,{quiet:Ee=!1}=u,{autoWidth:Se=!1}=u,{autocomplete:Ie=!1}=u,{sort:xe=!1}=u,{searchTerm:Ue=null}=u,{customPopoverHeight:$e}=u,{align:Ye="left"}=u,{footer:be=null}=u,{customAnchor:Be=null}=u,{loading:Xe}=u,{onOptionMouseenter:Ne=()=>{}}=u,{onOptionMouseleave:Je=()=>{}}=u;const ft=createEventDispatcher();let Tt,qe;const Ge=cn=>{cn.preventDefault(),cn.stopPropagation(),ft("click"),!Ce&&(f(0,Ue=null),f(1,ve=!ve))},dt=(cn,Tn,an)=>!(cn!=null&&cn.length)||!Array.isArray(cn)?[]:an?cn.sort((gt,zn)=>{const Rt=Tn(gt),Et=Tn(zn);return Rt>Et?1:-1}):cn,Ct=(cn,Tn,an)=>{if(Ie&&Tn){const gt=Tn.toLowerCase();return cn.filter(zn=>`${an(zn)}`.toLowerCase().includes(gt))}return cn},ot=cn=>{cn.target.scrollHeight-cn.target.clientHeight-cn.target.scrollTop<100&&ft("loadMore")};onDestroy(()=>{qe==null||qe.removeEventListener("scroll",null)});function Wt(cn){binding_callbacks[cn?"unshift":"push"](()=>{Tt=cn,f(29,Tt)})}const Ke=cn=>f(0,Ue=cn.detail),jt=()=>$(null),Qt=(cn,Tn)=>$(ae(cn,Tn)),Nt=(cn,Tn)=>Ne(Tn,cn),Mt=(cn,Tn)=>Je(Tn,cn);function yt(cn){binding_callbacks[cn?"unshift":"push"](()=>{qe=cn,f(28,qe)})}const ln=()=>f(1,ve=!1),kn=()=>f(1,ve=!1);return p.$$set=cn=>{"id"in cn&&f(2,y=cn.id),"disabled"in cn&&f(3,w=cn.disabled),"fieldText"in cn&&f(4,k=cn.fieldText),"fieldIcon"in cn&&f(5,S=cn.fieldIcon),"fieldColour"in cn&&f(6,M=cn.fieldColour),"isPlaceholder"in cn&&f(7,T=cn.isPlaceholder),"placeholderOption"in cn&&f(8,E=cn.placeholderOption),"options"in cn&&f(32,H=cn.options),"isOptionSelected"in cn&&f(9,F=cn.isOptionSelected),"isOptionEnabled"in cn&&f(10,Z=cn.isOptionEnabled),"onSelectOption"in cn&&f(11,$=cn.onSelectOption),"getOptionLabel"in cn&&f(12,J=cn.getOptionLabel),"getOptionValue"in cn&&f(13,ae=cn.getOptionValue),"getOptionIcon"in cn&&f(14,ie=cn.getOptionIcon),"useOptionIconImage"in cn&&f(15,he=cn.useOptionIconImage),"getOptionColour"in cn&&f(16,fe=cn.getOptionColour),"getOptionSubtitle"in cn&&f(17,me=cn.getOptionSubtitle),"open"in cn&&f(1,ve=cn.open),"readonly"in cn&&f(33,Ce=cn.readonly),"quiet"in cn&&f(18,Ee=cn.quiet),"autoWidth"in cn&&f(19,Se=cn.autoWidth),"autocomplete"in cn&&f(20,Ie=cn.autocomplete),"sort"in cn&&f(34,xe=cn.sort),"searchTerm"in cn&&f(0,Ue=cn.searchTerm),"customPopoverHeight"in cn&&f(21,$e=cn.customPopoverHeight),"align"in cn&&f(22,Ye=cn.align),"footer"in cn&&f(23,be=cn.footer),"customAnchor"in cn&&f(24,Be=cn.customAnchor),"loading"in cn&&f(25,Xe=cn.loading),"onOptionMouseenter"in cn&&f(26,Ne=cn.onOptionMouseenter),"onOptionMouseleave"in cn&&f(27,Je=cn.onOptionMouseleave)},p.$$.update=()=>{p.$$.dirty[0]&4096|p.$$.dirty[1]&10&&f(35,m=dt(H,J,xe)),p.$$.dirty[0]&4097|p.$$.dirty[1]&16&&f(30,v=Ct(m,Ue,J)),p.$$.dirty[0]&268435456&&(qe==null||qe.addEventListener("scroll",ot))},[Ue,ve,y,w,k,S,M,T,E,F,Z,$,J,ae,ie,he,fe,me,Ee,Se,Ie,$e,Ye,be,Be,Xe,Ne,Je,qe,Tt,v,Ge,H,Ce,xe,m,Wt,Ke,jt,Qt,Nt,Mt,yt,ln,kn]}class Picker extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3A,create_fragment$3D,safe_not_equal,{id:2,disabled:3,fieldText:4,fieldIcon:5,fieldColour:6,isPlaceholder:7,placeholderOption:8,options:32,isOptionSelected:9,isOptionEnabled:10,onSelectOption:11,getOptionLabel:12,getOptionValue:13,getOptionIcon:14,useOptionIconImage:15,getOptionColour:16,getOptionSubtitle:17,open:1,readonly:33,quiet:18,autoWidth:19,autocomplete:20,sort:34,searchTerm:0,customPopoverHeight:21,align:22,footer:23,customAnchor:24,loading:25,onOptionMouseenter:26,onOptionMouseleave:27},null,[-1,-1])}}function create_fragment$3C(p){let u,f,m,v;function y(S){p[32](S)}function w(S){p[33](S)}let k={quiet:p[15],id:p[3],disabled:p[5],readonly:p[14],fieldText:p[27],fieldIcon:p[26],fieldColour:p[25],options:p[6],autoWidth:p[16],align:p[19],footer:p[20],getOptionLabel:p[7],getOptionValue:p[8],getOptionIcon:p[9],getOptionColour:p[10],getOptionSubtitle:p[11],useOptionIconImage:p[12],isOptionEnabled:p[13],autocomplete:p[17],sort:p[18],tag:p[21],onOptionMouseenter:p[23],onOptionMouseleave:p[24],isPlaceholder:p[2]==null||p[2]==="",placeholderOption:p[4]===!1?null:p[4]||"Choose an option",isOptionSelected:p[31],onSelectOption:p[29],loading:p[22]};return p[0]!==void 0&&(k.open=p[0]),p[1]!==void 0&&(k.searchTerm=p[1]),u=new Picker({props:k}),binding_callbacks.push(()=>bind(u,"open",y)),binding_callbacks.push(()=>bind(u,"searchTerm",w)),u.$on("click",p[34]),u.$on("loadMore",p[35]),{c(){create_component(u.$$.fragment)},m(S,M){mount_component(u,S,M),v=!0},p(S,M){const T={};M[0]&32768&&(T.quiet=S[15]),M[0]&8&&(T.id=S[3]),M[0]&32&&(T.disabled=S[5]),M[0]&16384&&(T.readonly=S[14]),M[0]&134217728&&(T.fieldText=S[27]),M[0]&67108864&&(T.fieldIcon=S[26]),M[0]&33554432&&(T.fieldColour=S[25]),M[0]&64&&(T.options=S[6]),M[0]&65536&&(T.autoWidth=S[16]),M[0]&524288&&(T.align=S[19]),M[0]&1048576&&(T.footer=S[20]),M[0]&128&&(T.getOptionLabel=S[7]),M[0]&256&&(T.getOptionValue=S[8]),M[0]&512&&(T.getOptionIcon=S[9]),M[0]&1024&&(T.getOptionColour=S[10]),M[0]&2048&&(T.getOptionSubtitle=S[11]),M[0]&4096&&(T.useOptionIconImage=S[12]),M[0]&8192&&(T.isOptionEnabled=S[13]),M[0]&131072&&(T.autocomplete=S[17]),M[0]&262144&&(T.sort=S[18]),M[0]&2097152&&(T.tag=S[21]),M[0]&8388608&&(T.onOptionMouseenter=S[23]),M[0]&16777216&&(T.onOptionMouseleave=S[24]),M[0]&4&&(T.isPlaceholder=S[2]==null||S[2]===""),M[0]&16&&(T.placeholderOption=S[4]===!1?null:S[4]||"Choose an option"),M[0]&4&&(T.isOptionSelected=S[31]),M[0]&4194304&&(T.loading=S[22]),!f&&M[0]&1&&(f=!0,T.open=S[0],add_flush_callback(()=>f=!1)),!m&&M[0]&2&&(m=!0,T.searchTerm=S[1],add_flush_callback(()=>m=!1)),u.$set(T)},i(S){v||(transition_in(u.$$.fragment,S),v=!0)},o(S){transition_out(u.$$.fragment,S),v=!1},d(S){destroy_component(u,S)}}}function instance$3z(p,u,f){let m,v,y,{value:w=null}=u,{id:k=null}=u,{placeholder:S="Choose an option"}=u,{disabled:M=!1}=u,{options:T=[]}=u,{getOptionLabel:E=ot=>ot}=u,{getOptionValue:H=ot=>ot}=u,{getOptionIcon:F=()=>null}=u,{getOptionColour:Z=()=>null}=u,{getOptionSubtitle:$=()=>null}=u,{compare:J=null}=u,{useOptionIconImage:ae=!1}=u,{isOptionEnabled:ie}=u,{readonly:he=!1}=u,{quiet:fe=!1}=u,{autoWidth:me=!1}=u,{autocomplete:ve=!1}=u,{sort:Ce=!1}=u,{align:Ee}=u,{footer:Se=null}=u,{open:Ie=!1}=u,{tag:xe=null}=u,{searchTerm:Ue=null}=u,{loading:$e}=u,{onOptionMouseenter:Ye=()=>{}}=u,{onOptionMouseleave:be=()=>{}}=u;const Be=createEventDispatcher();function Xe(ot,Wt){return typeof J=="function"?J(ot,Wt):ot===Wt}const Ne=(ot,Wt,Ke)=>{if(!(Ke!=null&&Ke.length))return"";const jt=Ke.findIndex((Qt,Nt)=>Xe(H(Qt,Nt),Wt));return jt!==-1?ot(Ke[jt],jt):null},Je=(ot,Wt,Ke)=>ot==null||ot===""?Ke===!1?"":Ke||"Choose an option":Ne(E,ot,Wt)||"Choose an option",ft=ot=>{Be("change",ot),f(0,Ie=!1)},Tt=ot=>Xe(ot,w);function qe(ot){Ie=ot,f(0,Ie)}function Ge(ot){Ue=ot,f(1,Ue)}function dt(ot){bubble.call(this,p,ot)}function Ct(ot){bubble.call(this,p,ot)}return p.$$set=ot=>{"value"in ot&&f(2,w=ot.value),"id"in ot&&f(3,k=ot.id),"placeholder"in ot&&f(4,S=ot.placeholder),"disabled"in ot&&f(5,M=ot.disabled),"options"in ot&&f(6,T=ot.options),"getOptionLabel"in ot&&f(7,E=ot.getOptionLabel),"getOptionValue"in ot&&f(8,H=ot.getOptionValue),"getOptionIcon"in ot&&f(9,F=ot.getOptionIcon),"getOptionColour"in ot&&f(10,Z=ot.getOptionColour),"getOptionSubtitle"in ot&&f(11,$=ot.getOptionSubtitle),"compare"in ot&&f(30,J=ot.compare),"useOptionIconImage"in ot&&f(12,ae=ot.useOptionIconImage),"isOptionEnabled"in ot&&f(13,ie=ot.isOptionEnabled),"readonly"in ot&&f(14,he=ot.readonly),"quiet"in ot&&f(15,fe=ot.quiet),"autoWidth"in ot&&f(16,me=ot.autoWidth),"autocomplete"in ot&&f(17,ve=ot.autocomplete),"sort"in ot&&f(18,Ce=ot.sort),"align"in ot&&f(19,Ee=ot.align),"footer"in ot&&f(20,Se=ot.footer),"open"in ot&&f(0,Ie=ot.open),"tag"in ot&&f(21,xe=ot.tag),"searchTerm"in ot&&f(1,Ue=ot.searchTerm),"loading"in ot&&f(22,$e=ot.loading),"onOptionMouseenter"in ot&&f(23,Ye=ot.onOptionMouseenter),"onOptionMouseleave"in ot&&f(24,be=ot.onOptionMouseleave)},p.$$.update=()=>{p.$$.dirty[0]&84&&f(27,m=Je(w,T,S)),p.$$.dirty[0]&580&&f(26,v=Ne(F,w,T)),p.$$.dirty[0]&1092&&f(25,y=Ne(Z,w,T))},[Ie,Ue,w,k,S,M,T,E,H,F,Z,$,ae,ie,he,fe,me,ve,Ce,Ee,Se,xe,$e,Ye,be,y,v,m,Xe,ft,J,Tt,qe,Ge,dt,Ct]}class Select extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3z,create_fragment$3C,safe_not_equal,{value:2,id:3,placeholder:4,disabled:5,options:6,getOptionLabel:7,getOptionValue:8,getOptionIcon:9,getOptionColour:10,getOptionSubtitle:11,compare:30,useOptionIconImage:12,isOptionEnabled:13,readonly:14,quiet:15,autoWidth:16,autocomplete:17,sort:18,align:19,footer:20,open:0,tag:21,searchTerm:1,loading:22,onOptionMouseenter:23,onOptionMouseleave:24},null,[-1,-1])}}function create_default_slot$1N(p){let u,f;return u=new Select({props:{quiet:p[15],error:p[5],disabled:p[2],readonly:p[3],value:p[0],options:p[7],placeholder:p[6],autoWidth:p[16],sort:p[17],align:p[21],footer:p[22],getOptionLabel:p[8],getOptionValue:p[9],getOptionIcon:p[11],getOptionColour:p[12],getOptionSubtitle:p[10],useOptionIconImage:p[13],isOptionEnabled:p[14],autocomplete:p[19],customPopoverHeight:p[20],tag:p[23],compare:p[25],onOptionMouseenter:p[26],onOptionMouseleave:p[27]}}),u.$on("change",p[28]),u.$on("click",p[29]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&32768&&(y.quiet=m[15]),v[0]&32&&(y.error=m[5]),v[0]&4&&(y.disabled=m[2]),v[0]&8&&(y.readonly=m[3]),v[0]&1&&(y.value=m[0]),v[0]&128&&(y.options=m[7]),v[0]&64&&(y.placeholder=m[6]),v[0]&65536&&(y.autoWidth=m[16]),v[0]&131072&&(y.sort=m[17]),v[0]&2097152&&(y.align=m[21]),v[0]&4194304&&(y.footer=m[22]),v[0]&256&&(y.getOptionLabel=m[8]),v[0]&512&&(y.getOptionValue=m[9]),v[0]&2048&&(y.getOptionIcon=m[11]),v[0]&4096&&(y.getOptionColour=m[12]),v[0]&1024&&(y.getOptionSubtitle=m[10]),v[0]&8192&&(y.useOptionIconImage=m[13]),v[0]&16384&&(y.isOptionEnabled=m[14]),v[0]&524288&&(y.autocomplete=m[19]),v[0]&1048576&&(y.customPopoverHeight=m[20]),v[0]&8388608&&(y.tag=m[23]),v[0]&33554432&&(y.compare=m[25]),v[0]&67108864&&(y.onOptionMouseenter=m[26]),v[0]&134217728&&(y.onOptionMouseleave=m[27]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3B(p){let u,f;return u=new Field$1({props:{helpText:p[24],label:p[1],labelPosition:p[4],error:p[5],tooltip:p[18],$$slots:{default:[create_default_slot$1N]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&16777216&&(y.helpText=m[24]),v[0]&2&&(y.label=m[1]),v[0]&16&&(y.labelPosition=m[4]),v[0]&32&&(y.error=m[5]),v[0]&262144&&(y.tooltip=m[18]),v[0]&251396077|v[1]&2&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3y(p,u,f){let{value:m=null}=u,{label:v=void 0}=u,{disabled:y=!1}=u,{readonly:w=!1}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{placeholder:M="Choose an option"}=u,{options:T=[]}=u,{getOptionLabel:E=Je=>Xe(Je,"label")}=u,{getOptionValue:H=Je=>Xe(Je,"value")}=u,{getOptionSubtitle:F=Je=>Je==null?void 0:Je.subtitle}=u,{getOptionIcon:Z=Je=>Je==null?void 0:Je.icon}=u,{getOptionColour:$=Je=>Je==null?void 0:Je.colour}=u,{useOptionIconImage:J=!1}=u,{isOptionEnabled:ae=void 0}=u,{quiet:ie=!1}=u,{autoWidth:he=!1}=u,{sort:fe=!1}=u,{tooltip:me=""}=u,{autocomplete:ve=!1}=u,{customPopoverHeight:Ce=void 0}=u,{align:Ee=void 0}=u,{footer:Se=null}=u,{tag:Ie=null}=u,{helpText:xe=null}=u,{compare:Ue=void 0}=u,{onOptionMouseenter:$e=()=>{}}=u,{onOptionMouseleave:Ye=()=>{}}=u;const be=createEventDispatcher(),Be=Je=>{f(0,m=Je.detail),be("change",Je.detail)},Xe=(Je,ft)=>Je&&typeof Je=="object"?Je[ft]:Je;function Ne(Je){bubble.call(this,p,Je)}return p.$$set=Je=>{"value"in Je&&f(0,m=Je.value),"label"in Je&&f(1,v=Je.label),"disabled"in Je&&f(2,y=Je.disabled),"readonly"in Je&&f(3,w=Je.readonly),"labelPosition"in Je&&f(4,k=Je.labelPosition),"error"in Je&&f(5,S=Je.error),"placeholder"in Je&&f(6,M=Je.placeholder),"options"in Je&&f(7,T=Je.options),"getOptionLabel"in Je&&f(8,E=Je.getOptionLabel),"getOptionValue"in Je&&f(9,H=Je.getOptionValue),"getOptionSubtitle"in Je&&f(10,F=Je.getOptionSubtitle),"getOptionIcon"in Je&&f(11,Z=Je.getOptionIcon),"getOptionColour"in Je&&f(12,$=Je.getOptionColour),"useOptionIconImage"in Je&&f(13,J=Je.useOptionIconImage),"isOptionEnabled"in Je&&f(14,ae=Je.isOptionEnabled),"quiet"in Je&&f(15,ie=Je.quiet),"autoWidth"in Je&&f(16,he=Je.autoWidth),"sort"in Je&&f(17,fe=Je.sort),"tooltip"in Je&&f(18,me=Je.tooltip),"autocomplete"in Je&&f(19,ve=Je.autocomplete),"customPopoverHeight"in Je&&f(20,Ce=Je.customPopoverHeight),"align"in Je&&f(21,Ee=Je.align),"footer"in Je&&f(22,Se=Je.footer),"tag"in Je&&f(23,Ie=Je.tag),"helpText"in Je&&f(24,xe=Je.helpText),"compare"in Je&&f(25,Ue=Je.compare),"onOptionMouseenter"in Je&&f(26,$e=Je.onOptionMouseenter),"onOptionMouseleave"in Je&&f(27,Ye=Je.onOptionMouseleave)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,J,ae,ie,he,fe,me,ve,Ce,Ee,Se,Ie,xe,Ue,$e,Ye,Be,Ne]}class Select_1 extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3y,create_fragment$3B,safe_not_equal,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,getOptionLabel:8,getOptionValue:9,getOptionSubtitle:10,getOptionIcon:11,getOptionColour:12,useOptionIconImage:13,isOptionEnabled:14,quiet:15,autoWidth:16,sort:17,tooltip:18,autocomplete:19,customPopoverHeight:20,align:21,footer:22,tag:23,helpText:24,compare:25,onOptionMouseenter:26,onOptionMouseleave:27},null,[-1,-1])}}const indexVars$u="",Combobox_svelte_svelte_type_style_lang="";function get_each_context$I(p,u,f){const m=p.slice();return m[22]=u[f],m}function create_if_block$23(p){let u,f=ensure_array_like(p[5]),m=[];for(let v=0;v<f.length;v+=1)m[v]=create_each_block$I(get_each_context$I(p,f,v));return{c(){for(let v=0;v<m.length;v+=1)m[v].c();u=empty$1()},m(v,y){for(let w=0;w<m.length;w+=1)m[w]&&m[w].m(v,y);insert(v,u,y)},p(v,y){if(y&8417){f=ensure_array_like(v[5]);let w;for(w=0;w<f.length;w+=1){const k=get_each_context$I(v,f,w);m[w]?m[w].p(k,y):(m[w]=create_each_block$I(k),m[w].c(),m[w].m(u.parentNode,u))}for(;w<m.length;w+=1)m[w].d(1);m.length=f.length}},d(v){v&&detach(u),destroy_each(m,v)}}}function create_each_block$I(p){let u,f,m=p[6](p[22])+"",v,y,w,k,S,M,T;function E(){return p[18](p[22])}return{c(){u=element("li"),f=element("span"),v=text$1(m),y=space(),w=svg_element("svg"),k=svg_element("use"),S=space(),attr(f,"class","spectrum-Menu-itemLabel svelte-otlbol"),xlink_attr(k,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(w,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"),attr(w,"focusable","false"),attr(w,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[7](p[22])===p[0])},m(H,F){insert(H,u,F),append$2(u,f),append$2(f,v),append$2(u,y),append$2(u,w),append$2(w,k),append$2(u,S),M||(T=listen(u,"click",E),M=!0)},p(H,F){p=H,F&96&&m!==(m=p[6](p[22])+"")&&set_data(v,m),F&161&&toggle_class(u,"is-selected",p[7](p[22])===p[0])},d(H){H&&detach(u),M=!1,T()}}}function create_default_slot$1M(p){let u,f,m=p[5]&&Array.isArray(p[5]),v,y,w,k=m&&create_if_block$23(p);return{c(){u=element("div"),f=element("ul"),k&&k.c(),attr(f,"class","spectrum-Menu"),attr(f,"role","listbox"),attr(u,"class","popover-content svelte-otlbol")},m(S,M){insert(S,u,M),append$2(u,f),k&&k.m(f,null),y||(w=action_destroyer(v=clickOutside.call(null,u,p[19])),y=!0)},p(S,M){M&32&&(m=S[5]&&Array.isArray(S[5])),m?k?k.p(S,M):(k=create_if_block$23(S),k.c(),k.m(f,null)):k&&(k.d(1),k=null),v&&is_function(v.update)&&M&256&&v.update.call(null,S[19])},d(S){S&&detach(u),k&&k.d(),y=!1,w()}}}function create_fragment$3A(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z;return E=new Popover({props:{anchor:p[10],open:p[8],align:"left",useAnchorWidth:!0,$$slots:{default:[create_default_slot$1M]},$$scope:{ctx:p}}}),E.$on("close",p[20]),{c(){u=element("div"),f=element("div"),m=element("input"),w=space(),k=element("button"),S=svg_element("svg"),M=svg_element("use"),T=space(),create_component(E.$$.fragment),attr(m,"id",p[1]),attr(m,"type","text"),m.value=v=p[0]||"",attr(m,"placeholder",y=p[2]||""),m.disabled=p[3],m.readOnly=p[4],attr(m,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-otlbol"),attr(f,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-otlbol"),toggle_class(f,"is-disabled",p[3]),toggle_class(f,"is-focused",p[8]||p[9]),xlink_attr(M,"xlink:href","#spectrum-css-icon-Chevron100"),attr(S,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon spectrum-InputGroup-icon"),attr(S,"focusable","false"),attr(S,"aria-hidden","true"),attr(k,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button"),attr(k,"tabindex","-1"),attr(k,"aria-haspopup","true"),k.disabled=p[3],attr(u,"class","spectrum-InputGroup svelte-otlbol"),toggle_class(u,"is-focused",p[8]||p[9]),toggle_class(u,"is-disabled",p[3])},m($,J){insert($,u,J),append$2(u,f),append$2(f,m),append$2(u,w),append$2(u,k),append$2(k,S),append$2(S,M),p[17](u),insert($,T,J),mount_component(E,$,J),H=!0,F||(Z=[listen(m,"focus",p[14]),listen(m,"blur",p[15]),listen(m,"change",p[12]),listen(k,"click",p[16])],F=!0)},p($,[J]){(!H||J&2)&&attr(m,"id",$[1]),(!H||J&1&&v!==(v=$[0]||"")&&m.value!==v)&&(m.value=v),(!H||J&4&&y!==(y=$[2]||""))&&attr(m,"placeholder",y),(!H||J&8)&&(m.disabled=$[3]),(!H||J&16)&&(m.readOnly=$[4]),(!H||J&8)&&toggle_class(f,"is-disabled",$[3]),(!H||J&768)&&toggle_class(f,"is-focused",$[8]||$[9]),(!H||J&8)&&(k.disabled=$[3]),(!H||J&768)&&toggle_class(u,"is-focused",$[8]||$[9]),(!H||J&8)&&toggle_class(u,"is-disabled",$[3]);const ae={};J&1024&&(ae.anchor=$[10]),J&256&&(ae.open=$[8]),J&33554913&&(ae.$$scope={dirty:J,ctx:$}),E.$set(ae)},i($){H||(transition_in(E.$$.fragment,$),H=!0)},o($){transition_out(E.$$.fragment,$),H=!1},d($){$&&(detach(u),detach(T)),p[17](null),destroy_component(E,$),F=!1,run_all(Z)}}}function instance$3x(p,u,f){let{value:m=void 0}=u,{id:v=void 0}=u,{placeholder:y="Choose an option or type"}=u,{disabled:w=!1}=u,{readonly:k=!1}=u,{options:S=[]}=u,{getOptionLabel:M=Se=>`${Se}`}=u,{getOptionValue:T=Se=>`${Se}`}=u;const E=createEventDispatcher();let H=!1,F=!1,Z;const $=Se=>{E("change",Se),f(8,H=!1)},J=Se=>{const Ie=Se.currentTarget.value;E("type",Ie),$(Ie)},ae=Se=>{E("pick",Se),$(Se)},ie=()=>f(9,F=!0),he=()=>{f(9,F=!1),E("blur")},fe=()=>f(8,H=!H);function me(Se){binding_callbacks[Se?"unshift":"push"](()=>{Z=Se,f(10,Z)})}const ve=Se=>ae(T(Se)),Ce=()=>f(8,H=!1),Ee=()=>f(8,H=!1);return p.$$set=Se=>{"value"in Se&&f(0,m=Se.value),"id"in Se&&f(1,v=Se.id),"placeholder"in Se&&f(2,y=Se.placeholder),"disabled"in Se&&f(3,w=Se.disabled),"readonly"in Se&&f(4,k=Se.readonly),"options"in Se&&f(5,S=Se.options),"getOptionLabel"in Se&&f(6,M=Se.getOptionLabel),"getOptionValue"in Se&&f(7,T=Se.getOptionValue)},[m,v,y,w,k,S,M,T,H,F,Z,E,J,ae,ie,he,fe,me,ve,Ce,Ee]}class Combobox extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3x,create_fragment$3A,safe_not_equal,{value:0,id:1,placeholder:2,disabled:3,readonly:4,options:5,getOptionLabel:6,getOptionValue:7})}}function create_default_slot$1L(p){let u,f;return u=new Combobox({props:{error:p[5],disabled:p[2],value:p[0],options:p[7],placeholder:p[6],readonly:p[3],getOptionLabel:p[9],getOptionValue:p[10]}}),u.$on("change",p[11]),u.$on("pick",p[12]),u.$on("type",p[13]),u.$on("blur",p[14]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&32&&(y.error=m[5]),v&4&&(y.disabled=m[2]),v&1&&(y.value=m[0]),v&128&&(y.options=m[7]),v&64&&(y.placeholder=m[6]),v&8&&(y.readonly=m[3]),v&512&&(y.getOptionLabel=m[9]),v&1024&&(y.getOptionValue=m[10]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3z(p){let u,f;return u=new Field$1({props:{helpText:p[8],label:p[1],labelPosition:p[4],error:p[5],$$slots:{default:[create_default_slot$1L]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&256&&(y.helpText=m[8]),v&2&&(y.label=m[1]),v&16&&(y.labelPosition=m[4]),v&32&&(y.error=m[5]),v&132845&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3w(p,u,f){let{value:m=null}=u,{label:v=void 0}=u,{disabled:y=!1}=u,{readonly:w=!1}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{placeholder:M="Choose an option or type"}=u,{options:T=[]}=u,{helpText:E=null}=u,{getOptionLabel:H=fe=>J(fe,"label")}=u,{getOptionValue:F=fe=>J(fe,"value")}=u;const Z=createEventDispatcher(),$=fe=>{f(0,m=fe.detail),Z("change",fe.detail)},J=(fe,me)=>fe&&typeof fe=="object"?fe[me]:fe;function ae(fe){bubble.call(this,p,fe)}function ie(fe){bubble.call(this,p,fe)}function he(fe){bubble.call(this,p,fe)}return p.$$set=fe=>{"value"in fe&&f(0,m=fe.value),"label"in fe&&f(1,v=fe.label),"disabled"in fe&&f(2,y=fe.disabled),"readonly"in fe&&f(3,w=fe.readonly),"labelPosition"in fe&&f(4,k=fe.labelPosition),"error"in fe&&f(5,S=fe.error),"placeholder"in fe&&f(6,M=fe.placeholder),"options"in fe&&f(7,T=fe.options),"helpText"in fe&&f(8,E=fe.helpText),"getOptionLabel"in fe&&f(9,H=fe.getOptionLabel),"getOptionValue"in fe&&f(10,F=fe.getOptionValue)},[m,v,y,w,k,S,M,T,E,H,F,$,ae,ie,he]}class Combobox_1 extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3w,create_fragment$3z,safe_not_equal,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,helpText:8,getOptionLabel:9,getOptionValue:10})}}const indexVars$t="",indexVars$s="",indexVars$r="";var AIOperationEnum=(p=>(p.SUMMARISE_TEXT="SUMMARISE_TEXT",p.CLEAN_DATA="CLEAN_DATA",p.TRANSLATE="TRANSLATE",p.CATEGORISE_TEXT="CATEGORISE_TEXT",p.SENTIMENT_ANALYSIS="SENTIMENT_ANALYSIS",p.PROMPT="PROMPT",p.SEARCH_WEB="SEARCH_WEB",p))(AIOperationEnum||{}),OperationFieldTypeEnum=(p=>(p.MULTI_COLUMN="columns",p.COLUMN="column",p.BINDABLE_TEXT="prompt",p))(OperationFieldTypeEnum||{}),Event$1=(p=>(p.USER_CREATED="user:created",p.USER_UPDATED="user:updated",p.USER_DELETED="user:deleted",p.USER_ONBOARDING_COMPLETE="user:onboarding:complete",p.USER_PERMISSION_ADMIN_ASSIGNED="user:admin:assigned",p.USER_PERMISSION_ADMIN_REMOVED="user:admin:removed",p.USER_PERMISSION_BUILDER_ASSIGNED="user:builder:assigned",p.USER_PERMISSION_BUILDER_REMOVED="user:builder:removed",p.USER_INVITED="user:invited",p.USER_INVITED_ACCEPTED="user:invite:accepted",p.USER_PASSWORD_FORCE_RESET="user:password:force:reset",p.USER_PASSWORD_UPDATED="user:password:updated",p.USER_PASSWORD_RESET_REQUESTED="user:password:reset:requested",p.USER_PASSWORD_RESET="user:password:reset",p.USER_DATA_COLLABORATION="user:data:collaboration",p.EMAIL_SMTP_CREATED="email:smtp:created",p.EMAIL_SMTP_UPDATED="email:smtp:updated",p.AI_CONFIG_CREATED="ai:config:created",p.AI_CONFIG_UPDATED="ai:config:updated",p.AUTH_SSO_CREATED="auth:sso:created",p.AUTH_SSO_UPDATED="auth:sso:updated",p.AUTH_SSO_ACTIVATED="auth:sso:activated",p.AUTH_SSO_DEACTIVATED="auth:sso:deactivated",p.AUTH_LOGIN="auth:login",p.AUTH_LOGOUT="auth:logout",p.ORG_NAME_UPDATED="org:info:name:updated",p.ORG_LOGO_UPDATED="org:info:logo:updated",p.ORG_PLATFORM_URL_UPDATED="org:platformurl:updated",p.INSTALLATION_VERSION_CHECKED="installation:version:checked",p.INSTALLATION_VERSION_UPGRADED="installation:version:upgraded",p.INSTALLATION_VERSION_DOWNGRADED="installation:version:downgraded",p.INSTALLATION_FIRST_STARTUP="installation:firstStartup",p.ANALYTICS_OPT_OUT="analytics:opt:out",p.ANALYTICS_OPT_IN="analytics:opt:in",p.APP_CREATED="app:created",p.APP_UPDATED="app:updated",p.APP_DELETED="app:deleted",p.APP_DUPLICATED="app:duplicated",p.APP_PUBLISHED="app:published",p.APP_UNPUBLISHED="app:unpublished",p.APP_TEMPLATE_IMPORTED="app:template:imported",p.APP_FILE_IMPORTED="app:file:imported",p.APP_VERSION_UPDATED="app:version:updated",p.APP_VERSION_REVERTED="app:version:reverted",p.APP_REVERTED="app:reverted",p.APP_EXPORTED="app:exported",p.ROLE_CREATED="role:created",p.ROLE_UPDATED="role:updated",p.ROLE_DELETED="role:deleted",p.ROLE_ASSIGNED="role:assigned",p.ROLE_UNASSIGNED="role:unassigned",p.SERVED_BUILDER="served:builder",p.SERVED_APP="served:app",p.SERVED_APP_PREVIEW="served:app:preview",p.DATASOURCE_CREATED="datasource:created",p.DATASOURCE_UPDATED="datasource:updated",p.DATASOURCE_DELETED="datasource:deleted",p.QUERY_CREATED="query:created",p.QUERY_UPDATED="query:updated",p.QUERY_DELETED="query:deleted",p.QUERY_IMPORT="query:import",p.QUERIES_RUN="queries:run",p.QUERY_PREVIEWED="query:previewed",p.TABLE_CREATED="table:created",p.TABLE_UPDATED="table:updated",p.TABLE_DELETED="table:deleted",p.TABLE_EXPORTED="table:exported",p.TABLE_IMPORTED="table:imported",p.TABLE_DATA_IMPORTED="table:data:imported",p.VIEW_CREATED="view:created",p.VIEW_UPDATED="view:updated",p.VIEW_DELETED="view:deleted",p.VIEW_EXPORTED="view:exported",p.VIEW_FILTER_CREATED="view:filter:created",p.VIEW_FILTER_UPDATED="view:filter:updated",p.VIEW_FILTER_DELETED="view:filter:deleted",p.VIEW_CALCULATION_CREATED="view:calculation:created",p.VIEW_CALCULATION_UPDATED="view:calculation:updated",p.VIEW_CALCULATION_DELETED="view:calculation:deleted",p.VIEW_JOIN_CREATED="view:join:created",p.ROWS_CREATED="rows:created",p.ROWS_IMPORTED="rows:imported",p.COMPONENT_CREATED="component:created",p.COMPONENT_DELETED="component:deleted",p.SCREEN_CREATED="screen:created",p.SCREEN_DELETED="screen:deleted",p.LAYOUT_CREATED="layout:created",p.LAYOUT_DELETED="layout:deleted",p.AUTOMATION_CREATED="automation:created",p.AUTOMATION_DELETED="automation:deleted",p.AUTOMATION_TESTED="automation:tested",p.AUTOMATIONS_RUN="automations:run",p.AUTOMATION_STEP_CREATED="automation:step:created",p.AUTOMATION_STEP_DELETED="automation:step:deleted",p.AUTOMATION_TRIGGER_UPDATED="automation:trigger:updated",p.LICENSE_PLAN_CHANGED="license:plan:changed",p.LICENSE_ACTIVATED="license:activated",p.LICENSE_PAYMENT_FAILED="license:payment:failed",p.LICENSE_PAYMENT_RECOVERED="license:payment:recovered",p.LICENSE_CHECKOUT_OPENED="license:checkout:opened",p.LICENSE_CHECKOUT_SUCCESS="license:checkout:success",p.LICENSE_PORTAL_OPENED="license:portal:opened",p.ACCOUNT_CREATED="account:created",p.ACCOUNT_DELETED="account:deleted",p.ACCOUNT_VERIFIED="account:verified",p.APP_BACKFILL_SUCCEEDED="app:backfill:succeeded",p.APP_BACKFILL_FAILED="app:backfill:failed",p.TENANT_BACKFILL_SUCCEEDED="tenant:backfill:succeeded",p.TENANT_BACKFILL_FAILED="tenant:backfill:failed",p.INSTALLATION_BACKFILL_SUCCEEDED="installation:backfill:succeeded",p.INSTALLATION_BACKFILL_FAILED="installation:backfill:failed",p.USER_GROUP_CREATED="user_group:created",p.USER_GROUP_UPDATED="user_group:updated",p.USER_GROUP_DELETED="user_group:deleted",p.USER_GROUP_USERS_ADDED="user_group:user_added",p.USER_GROUP_USERS_REMOVED="user_group:users_deleted",p.USER_GROUP_PERMISSIONS_EDITED="user_group:permissions_edited",p.USER_GROUP_ONBOARDING="user_group:onboarding_added",p.PLUGIN_INIT="plugin:init",p.PLUGIN_IMPORTED="plugin:imported",p.PLUGIN_DELETED="plugin:deleted",p.APP_BACKUP_RESTORED="app:backup:restored",p.APP_BACKUP_TRIGGERED="app:backup:triggered",p.ENVIRONMENT_VARIABLE_CREATED="environment_variable:created",p.ENVIRONMENT_VARIABLE_DELETED="environment_variable:deleted",p.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable:upgrade_panel_opened",p.AUDIT_LOGS_FILTERED="audit_log:filtered",p.AUDIT_LOGS_DOWNLOADED="audit_log:downloaded",p.ROW_ACTION_CREATED="row_action:created",p))(Event$1||{}),StaticQuotaName=(p=>(p.ROWS="rows",p.APPS="apps",p.USERS="users",p.CREATORS="creators",p.USER_GROUPS="userGroups",p.PLUGINS="plugins",p.AI_CUSTOM_CONFIGS="aiCustomConfigs",p))(StaticQuotaName||{}),MonthlyQuotaName=(p=>(p.QUERIES="queries",p.AUTOMATIONS="automations",p.BUDIBASE_AI_CREDITS="budibaseAICredits",p))(MonthlyQuotaName||{}),Feature=(p=>(p.USER_GROUPS="userGroups",p.APP_BACKUPS="appBackups",p.ENVIRONMENT_VARIABLES="environmentVariables",p.AUDIT_LOGS="auditLogs",p.ENFORCEABLE_SSO="enforceableSSO",p.BRANDING="branding",p.SCIM="scim",p.SYNC_AUTOMATIONS="syncAutomations",p.TRIGGER_AUTOMATION_RUN="triggerAutomationRun",p.APP_BUILDERS="appBuilders",p.OFFLINE="offline",p.EXPANDED_PUBLIC_API="expandedPublicApi",p.VIEW_PERMISSIONS="viewPermissions",p.VIEW_READONLY_COLUMNS="viewReadonlyColumns",p.BUDIBASE_AI="budibaseAI",p.AI_CUSTOM_CONFIGS="aiCustomConfigs",p))(Feature||{}),BasicOperator=(p=>(p.EQUAL="equal",p.NOT_EQUAL="notEqual",p.EMPTY="empty",p.NOT_EMPTY="notEmpty",p.FUZZY="fuzzy",p.STRING="string",p))(BasicOperator||{}),ArrayOperator=(p=>(p.CONTAINS="contains",p.NOT_CONTAINS="notContains",p.CONTAINS_ANY="containsAny",p.ONE_OF="oneOf",p))(ArrayOperator||{}),RangeOperator=(p=>(p.RANGE="range",p))(RangeOperator||{}),LogicalOperator=(p=>(p.AND="$and",p.OR="$or",p))(LogicalOperator||{});function isLogicalSearchOperator(p){return Object.values(LogicalOperator).includes(p)}function isBasicSearchOperator(p){return Object.values(BasicOperator).includes(p)}function isArraySearchOperator(p){return Object.values(ArrayOperator).includes(p)}function isRangeSearchOperator(p){return Object.values(RangeOperator).includes(p)}var InternalSearchFilterOperator=(p=>(p.COMPLEX_ID_OPERATOR="_complexIdOperator",p))(InternalSearchFilterOperator||{}),EmptyFilterOption=(p=>(p.RETURN_ALL="all",p.RETURN_NONE="none",p))(EmptyFilterOption||{}),UILogicalOperator=(p=>(p.ALL="all",p.ANY="any",p))(UILogicalOperator||{});Event$1.PLUGIN_INIT;var AutomationIOType=(p=>(p.OBJECT="object",p.STRING="string",p.BOOLEAN="boolean",p.NUMBER="number",p.ARRAY="array",p.JSON="json",p.DATE="date",p.ATTACHMENT="attachment",p))(AutomationIOType||{}),AutomationCustomIOType=(p=>(p.TABLE="table",p.ROW="row",p.ROWS="rows",p.WIDE="wide",p.QUERY="query",p.QUERY_PARAMS="queryParams",p.QUERY_LIMIT="queryLimit",p.LOOP_OPTION="loopOption",p.ITEM="item",p.CODE="code",p.FILTERS="filters",p.COLUMN="column",p.TRIGGER_SCHEMA="triggerSchema",p.CRON="cron",p.WEBHOOK_URL="webhookUrl",p.AUTOMATION="automation",p.AUTOMATION_FIELDS="automationFields",p.MULTI_ATTACHMENTS="multi_attachments",p.TRIGGER_FILTER="trigger_filter",p))(AutomationCustomIOType||{}),AutomationTriggerStepId=(p=>(p.ROW_SAVED="ROW_SAVED",p.ROW_UPDATED="ROW_UPDATED",p.ROW_DELETED="ROW_DELETED",p.WEBHOOK="WEBHOOK",p.APP="APP",p.CRON="CRON",p.ROW_ACTION="ROW_ACTION",p))(AutomationTriggerStepId||{}),AutomationStepType=(p=>(p.LOGIC="LOGIC",p.ACTION="ACTION",p.TRIGGER="TRIGGER",p))(AutomationStepType||{}),AutomationActionStepId=(p=>(p.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",p.CREATE_ROW="CREATE_ROW",p.UPDATE_ROW="UPDATE_ROW",p.DELETE_ROW="DELETE_ROW",p.EXECUTE_BASH="EXECUTE_BASH",p.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",p.EXECUTE_SCRIPT="EXECUTE_SCRIPT",p.EXECUTE_QUERY="EXECUTE_QUERY",p.SERVER_LOG="SERVER_LOG",p.DELAY="DELAY",p.FILTER="FILTER",p.QUERY_ROWS="QUERY_ROWS",p.LOOP="LOOP",p.COLLECT="COLLECT",p.OPENAI="OPENAI",p.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",p.BRANCH="BRANCH",p.discord="discord",p.slack="slack",p.zapier="zapier",p.integromat="integromat",p.n8n="n8n",p))(AutomationActionStepId||{});[...Object.values(AutomationActionStepId),...Object.values(AutomationTriggerStepId)];var AutomationFeature=(p=>(p.LOOPING="LOOPING",p))(AutomationFeature||{}),HttpMethod=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.HEAD="HEAD",p.DELETE="DELETE",p))(HttpMethod||{}),FieldType=(p=>(p.STRING="string",p.LONGFORM="longform",p.OPTIONS="options",p.NUMBER="number",p.BOOLEAN="boolean",p.ARRAY="array",p.DATETIME="datetime",p.ATTACHMENTS="attachment",p.ATTACHMENT_SINGLE="attachment_single",p.LINK="link",p.FORMULA="formula",p.AUTO="auto",p.AI="ai",p.JSON="json",p.INTERNAL="internal",p.BARCODEQR="barcodeqr",p.SIGNATURE_SINGLE="signature_single",p.BIGINT="bigint",p.BB_REFERENCE="bb_reference",p.BB_REFERENCE_SINGLE="bb_reference_single",p))(FieldType||{}),RelationshipType=(p=>(p.ONE_TO_MANY="one-to-many",p.MANY_TO_ONE="many-to-one",p.MANY_TO_MANY="many-to-many",p))(RelationshipType||{}),FormulaType=(p=>(p.STATIC="static",p.DYNAMIC="dynamic",p.AI="ai",p))(FormulaType||{}),BBReferenceFieldSubType=(p=>(p.USER="user",p.USERS="users",p))(BBReferenceFieldSubType||{});function isRelationshipField(p){return p.type===FieldType.LINK}var ViewV2Type=(p=>(p.CALCULATION="calculation",p))(ViewV2Type||{});const SEPARATOR$1="_",prefixed=p=>`${p}${SEPARATOR$1}`;var DocumentType=(p=>(p.USER="us",p.GROUP="gr",p.WORKSPACE="workspace",p.CONFIG="config",p.TEMPLATE="template",p.APP="app",p.DEV="dev",p.APP_DEV="app_dev",p.APP_METADATA="app_metadata",p.ROLE="role",p.MIGRATIONS="migrations",p.DEV_INFO="devinfo",p.AUTOMATION_LOG="log_au",p.ACCOUNT_METADATA="acc_metadata",p.PLUGIN="plg",p.DATASOURCE="datasource",p.DATASOURCE_PLUS="datasource_plus",p.APP_BACKUP="backup",p.TABLE="ta",p.ROW="ro",p.AUTOMATION="au",p.LINK="li",p.WEBHOOK="wh",p.INSTANCE="inst",p.LAYOUT="layout",p.SCREEN="screen",p.QUERY="query",p.DEPLOYMENTS="deployments",p.METADATA="metadata",p.MEM_VIEW="view",p.USER_FLAG="flag",p.AUTOMATION_METADATA="meta_au",p.AUDIT_LOG="al",p.APP_MIGRATION_METADATA="_design/migrations",p.SCIM_LOG="scimlog",p.ROW_ACTIONS="ra",p))(DocumentType||{});Object.values(DocumentType).sort((p,u)=>u.length-p.length);var InternalTable=(p=>(p.USER_METADATA="ta_users",p))(InternalTable||{}),VirtualDocumentType=(p=>(p.VIEW="view",p.ROW_ACTION="row_action",p))(VirtualDocumentType||{});Object.values(VirtualDocumentType).sort((p,u)=>u.length-p.length);var Theme=(p=>(p.LIGHTEST="lightest",p.LIGHT="light",p.DARK="dark",p.DARKEST="darkest",p.NORD="nord",p.MIDNIGHT="midnight",p))(Theme||{}),PluginType=(p=>(p.DATASOURCE="datasource",p.COMPONENT="component",p.AUTOMATION="automation",p))(PluginType||{});Object.values(PluginType),StaticQuotaName.ROWS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;var SortOrder=(p=>(p.ASCENDING="ascending",p.DESCENDING="descending",p))(SortOrder||{}),SortType=(p=>(p.STRING="string",p.NUMBER="number",p))(SortType||{}),util$2;(function(p){p.assertEqual=v=>v;function u(v){}p.assertIs=u;function f(v){throw new Error}p.assertNever=f,p.arrayToEnum=v=>{const y={};for(const w of v)y[w]=w;return y},p.getValidEnumValues=v=>{const y=p.objectKeys(v).filter(k=>typeof v[v[k]]!="number"),w={};for(const k of y)w[k]=v[k];return p.objectValues(w)},p.objectValues=v=>p.objectKeys(v).map(function(y){return v[y]}),p.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const y=[];for(const w in v)Object.prototype.hasOwnProperty.call(v,w)&&y.push(w);return y},p.find=(v,y)=>{for(const w of v)if(y(w))return w},p.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function m(v,y=" | "){return v.map(w=>typeof w=="string"?`'${w}'`:w).join(y)}p.joinValues=m,p.jsonStringifyReplacer=(v,y)=>typeof y=="bigint"?y.toString():y})(util$2||(util$2={}));var objectUtil;(function(p){p.mergeShapes=(u,f)=>({...u,...f})})(objectUtil||(objectUtil={}));const ZodParsedType=util$2.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=p=>{switch(typeof p){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(p)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(p)?ZodParsedType.array:p===null?ZodParsedType.null:p.then&&typeof p.then=="function"&&p.catch&&typeof p.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&p instanceof Map?ZodParsedType.map:typeof Set<"u"&&p instanceof Set?ZodParsedType.set:typeof Date<"u"&&p instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$2.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=p=>JSON.stringify(p,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(u){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=u}get errors(){return this.issues}format(u){const f=u||function(y){return y.message},m={_errors:[]},v=y=>{for(const w of y.issues)if(w.code==="invalid_union")w.unionErrors.map(v);else if(w.code==="invalid_return_type")v(w.returnTypeError);else if(w.code==="invalid_arguments")v(w.argumentsError);else if(w.path.length===0)m._errors.push(f(w));else{let k=m,S=0;for(;S<w.path.length;){const M=w.path[S];S===w.path.length-1?(k[M]=k[M]||{_errors:[]},k[M]._errors.push(f(w))):k[M]=k[M]||{_errors:[]},k=k[M],S++}}};return v(this),m}static assert(u){if(!(u instanceof ZodError))throw new Error(`Not a ZodError: ${u}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$2.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(u=f=>f.message){const f={},m=[];for(const v of this.issues)v.path.length>0?(f[v.path[0]]=f[v.path[0]]||[],f[v.path[0]].push(u(v))):m.push(u(v));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}}ZodError.create=p=>new ZodError(p);const errorMap=(p,u)=>{let f;switch(p.code){case ZodIssueCode.invalid_type:p.received===ZodParsedType.undefined?f="Required":f=`Expected ${p.expected}, received ${p.received}`;break;case ZodIssueCode.invalid_literal:f=`Invalid literal value, expected ${JSON.stringify(p.expected,util$2.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:f=`Unrecognized key(s) in object: ${util$2.joinValues(p.keys,", ")}`;break;case ZodIssueCode.invalid_union:f="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:f=`Invalid discriminator value. Expected ${util$2.joinValues(p.options)}`;break;case ZodIssueCode.invalid_enum_value:f=`Invalid enum value. Expected ${util$2.joinValues(p.options)}, received '${p.received}'`;break;case ZodIssueCode.invalid_arguments:f="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:f="Invalid function return type";break;case ZodIssueCode.invalid_date:f="Invalid date";break;case ZodIssueCode.invalid_string:typeof p.validation=="object"?"includes"in p.validation?(f=`Invalid input: must include "${p.validation.includes}"`,typeof p.validation.position=="number"&&(f=`${f} at one or more positions greater than or equal to ${p.validation.position}`)):"startsWith"in p.validation?f=`Invalid input: must start with "${p.validation.startsWith}"`:"endsWith"in p.validation?f=`Invalid input: must end with "${p.validation.endsWith}"`:util$2.assertNever(p.validation):p.validation!=="regex"?f=`Invalid ${p.validation}`:f="Invalid";break;case ZodIssueCode.too_small:p.type==="array"?f=`Array must contain ${p.exact?"exactly":p.inclusive?"at least":"more than"} ${p.minimum} element(s)`:p.type==="string"?f=`String must contain ${p.exact?"exactly":p.inclusive?"at least":"over"} ${p.minimum} character(s)`:p.type==="number"?f=`Number must be ${p.exact?"exactly equal to ":p.inclusive?"greater than or equal to ":"greater than "}${p.minimum}`:p.type==="date"?f=`Date must be ${p.exact?"exactly equal to ":p.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(p.minimum))}`:f="Invalid input";break;case ZodIssueCode.too_big:p.type==="array"?f=`Array must contain ${p.exact?"exactly":p.inclusive?"at most":"less than"} ${p.maximum} element(s)`:p.type==="string"?f=`String must contain ${p.exact?"exactly":p.inclusive?"at most":"under"} ${p.maximum} character(s)`:p.type==="number"?f=`Number must be ${p.exact?"exactly":p.inclusive?"less than or equal to":"less than"} ${p.maximum}`:p.type==="bigint"?f=`BigInt must be ${p.exact?"exactly":p.inclusive?"less than or equal to":"less than"} ${p.maximum}`:p.type==="date"?f=`Date must be ${p.exact?"exactly":p.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(p.maximum))}`:f="Invalid input";break;case ZodIssueCode.custom:f="Invalid input";break;case ZodIssueCode.invalid_intersection_types:f="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:f=`Number must be a multiple of ${p.multipleOf}`;break;case ZodIssueCode.not_finite:f="Number must be finite";break;default:f=u.defaultError,util$2.assertNever(p)}return{message:f}};let overrideErrorMap=errorMap;function setErrorMap(p){overrideErrorMap=p}function getErrorMap(){return overrideErrorMap}const makeIssue=p=>{const{data:u,path:f,errorMaps:m,issueData:v}=p,y=[...f,...v.path||[]],w={...v,path:y};if(v.message!==void 0)return{...v,path:y,message:v.message};let k="";const S=m.filter(M=>!!M).slice().reverse();for(const M of S)k=M(w,{data:u,defaultError:k}).message;return{...v,path:y,message:k}},EMPTY_PATH=[];function addIssueToContext(p,u){const f=getErrorMap(),m=makeIssue({issueData:u,data:p.data,path:p.path,errorMaps:[p.common.contextualErrorMap,p.schemaErrorMap,f,f===errorMap?void 0:errorMap].filter(v=>!!v)});p.common.issues.push(m)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(u,f){const m=[];for(const v of f){if(v.status==="aborted")return INVALID$3;v.status==="dirty"&&u.dirty(),m.push(v.value)}return{status:u.value,value:m}}static async mergeObjectAsync(u,f){const m=[];for(const v of f){const y=await v.key,w=await v.value;m.push({key:y,value:w})}return ParseStatus.mergeObjectSync(u,m)}static mergeObjectSync(u,f){const m={};for(const v of f){const{key:y,value:w}=v;if(y.status==="aborted"||w.status==="aborted")return INVALID$3;y.status==="dirty"&&u.dirty(),w.status==="dirty"&&u.dirty(),y.value!=="__proto__"&&(typeof w.value<"u"||v.alwaysSet)&&(m[y.value]=w.value)}return{status:u.value,value:m}}}const INVALID$3=Object.freeze({status:"aborted"}),DIRTY=p=>({status:"dirty",value:p}),OK=p=>({status:"valid",value:p}),isAborted=p=>p.status==="aborted",isDirty=p=>p.status==="dirty",isValid$3=p=>p.status==="valid",isAsync=p=>typeof Promise<"u"&&p instanceof Promise;function __classPrivateFieldGet(p,u,f,m){if(f==="a"&&!m)throw new TypeError("Private accessor was defined without a getter");if(typeof u=="function"?p!==u||!m:!u.has(p))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?m:f==="a"?m.call(p):m?m.value:u.get(p)}function __classPrivateFieldSet(p,u,f,m,v){if(m==="m")throw new TypeError("Private method is not writable");if(m==="a"&&!v)throw new TypeError("Private accessor was defined without a setter");if(typeof u=="function"?p!==u||!v:!u.has(p))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m==="a"?v.call(p,f):v?v.value=f:u.set(p,f),f}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(p){p.errToObj=u=>typeof u=="string"?{message:u}:u||{},p.toString=u=>typeof u=="string"?u:u==null?void 0:u.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(u,f,m,v){this._cachedPath=[],this.parent=u,this.data=f,this._path=m,this._key=v}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(p,u)=>{if(isValid$3(u))return{success:!0,data:u.value};if(!p.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const f=new ZodError(p.common.issues);return this._error=f,this._error}}};function processCreateParams(p){if(!p)return{};const{errorMap:u,invalid_type_error:f,required_error:m,description:v}=p;if(u&&(f||m))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:v}:{errorMap:(w,k)=>{var S,M;const{message:T}=p;return w.code==="invalid_enum_value"?{message:T??k.defaultError}:typeof k.data>"u"?{message:(S=T??m)!==null&&S!==void 0?S:k.defaultError}:w.code!=="invalid_type"?{message:k.defaultError}:{message:(M=T??f)!==null&&M!==void 0?M:k.defaultError}},description:v}}class ZodType{constructor(u){this.spa=this.safeParseAsync,this._def=u,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(u){return getParsedType(u.data)}_getOrReturnCtx(u,f){return f||{common:u.parent.common,data:u.data,parsedType:getParsedType(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new ParseStatus,ctx:{common:u.parent.common,data:u.data,parsedType:getParsedType(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const f=this._parse(u);if(isAsync(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(u){const f=this._parse(u);return Promise.resolve(f)}parse(u,f){const m=this.safeParse(u,f);if(m.success)return m.data;throw m.error}safeParse(u,f){var m;const v={common:{issues:[],async:(m=f==null?void 0:f.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f==null?void 0:f.errorMap},path:(f==null?void 0:f.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:getParsedType(u)},y=this._parseSync({data:u,path:v.path,parent:v});return handleResult(v,y)}async parseAsync(u,f){const m=await this.safeParseAsync(u,f);if(m.success)return m.data;throw m.error}async safeParseAsync(u,f){const m={common:{issues:[],contextualErrorMap:f==null?void 0:f.errorMap,async:!0},path:(f==null?void 0:f.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:getParsedType(u)},v=this._parse({data:u,path:m.path,parent:m}),y=await(isAsync(v)?v:Promise.resolve(v));return handleResult(m,y)}refine(u,f){const m=v=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(v):f;return this._refinement((v,y)=>{const w=u(v),k=()=>y.addIssue({code:ZodIssueCode.custom,...m(v)});return typeof Promise<"u"&&w instanceof Promise?w.then(S=>S?!0:(k(),!1)):w?!0:(k(),!1)})}refinement(u,f){return this._refinement((m,v)=>u(m)?!0:(v.addIssue(typeof f=="function"?f(m,v):f),!1))}_refinement(u){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(u){return ZodUnion.create([this,u],this._def)}and(u){return ZodIntersection.create(this,u,this._def)}transform(u){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const f=typeof u=="function"?u:()=>u;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:f,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(u){const f=typeof u=="function"?u:()=>u;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:f,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(u){const f=this.constructor;return new f({...this._def,description:u})}pipe(u){return ZodPipeline.create(this,u)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(p){let u="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return p.precision?u=`${u}\\.\\d{${p.precision}}`:p.precision==null&&(u=`${u}(\\.\\d+)?`),u}function timeRegex(p){return new RegExp(`^${timeRegexSource(p)}$`)}function datetimeRegex(p){let u=`${dateRegexSource}T${timeRegexSource(p)}`;const f=[];return f.push(p.local?"Z?":"Z"),p.offset&&f.push("([+-]\\d{2}:?\\d{2})"),u=`${u}(${f.join("|")})`,new RegExp(`^${u}$`)}function isValidIP(p,u){return!!((u==="v4"||!u)&&ipv4Regex.test(p)||(u==="v6"||!u)&&ipv6Regex.test(p))}class ZodString extends ZodType{_parse(u){if(this._def.coerce&&(u.data=String(u.data)),this._getType(u)!==ZodParsedType.string){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:y.parsedType}),INVALID$3}const m=new ParseStatus;let v;for(const y of this._def.checks)if(y.kind==="min")u.data.length<y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),m.dirty());else if(y.kind==="max")u.data.length>y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),m.dirty());else if(y.kind==="length"){const w=u.data.length>y.value,k=u.data.length<y.value;(w||k)&&(v=this._getOrReturnCtx(u,v),w?addIssueToContext(v,{code:ZodIssueCode.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}):k&&addIssueToContext(v,{code:ZodIssueCode.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}),m.dirty())}else if(y.kind==="email")emailRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"email",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"emoji",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="uuid")uuidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"uuid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="nanoid")nanoidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="cuid")cuidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"cuid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="cuid2")cuid2Regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="ulid")ulidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"ulid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="url")try{new URL(u.data)}catch{v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"url",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()}else y.kind==="regex"?(y.regex.lastIndex=0,y.regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"regex",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty())):y.kind==="trim"?u.data=u.data.trim():y.kind==="includes"?u.data.includes(y.value,y.position)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{includes:y.value,position:y.position},message:y.message}),m.dirty()):y.kind==="toLowerCase"?u.data=u.data.toLowerCase():y.kind==="toUpperCase"?u.data=u.data.toUpperCase():y.kind==="startsWith"?u.data.startsWith(y.value)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{startsWith:y.value},message:y.message}),m.dirty()):y.kind==="endsWith"?u.data.endsWith(y.value)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{endsWith:y.value},message:y.message}),m.dirty()):y.kind==="datetime"?datetimeRegex(y).test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"datetime",message:y.message}),m.dirty()):y.kind==="date"?dateRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"date",message:y.message}),m.dirty()):y.kind==="time"?timeRegex(y).test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"time",message:y.message}),m.dirty()):y.kind==="duration"?durationRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"duration",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):y.kind==="ip"?isValidIP(u.data,y.version)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"ip",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):y.kind==="base64"?base64Regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"base64",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):util$2.assertNever(y);return{status:m.value,value:u.data}}_regex(u,f,m){return this.refinement(v=>u.test(v),{validation:f,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(m)})}_addCheck(u){return new ZodString({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...errorUtil.errToObj(u)})}url(u){return this._addCheck({kind:"url",...errorUtil.errToObj(u)})}emoji(u){return this._addCheck({kind:"emoji",...errorUtil.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...errorUtil.errToObj(u)})}nanoid(u){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...errorUtil.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(u)})}ulid(u){return this._addCheck({kind:"ulid",...errorUtil.errToObj(u)})}base64(u){return this._addCheck({kind:"base64",...errorUtil.errToObj(u)})}ip(u){return this._addCheck({kind:"ip",...errorUtil.errToObj(u)})}datetime(u){var f,m;return typeof u=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:u}):this._addCheck({kind:"datetime",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,offset:(f=u==null?void 0:u.offset)!==null&&f!==void 0?f:!1,local:(m=u==null?void 0:u.local)!==null&&m!==void 0?m:!1,...errorUtil.errToObj(u==null?void 0:u.message)})}date(u){return this._addCheck({kind:"date",message:u})}time(u){return typeof u=="string"?this._addCheck({kind:"time",precision:null,message:u}):this._addCheck({kind:"time",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,...errorUtil.errToObj(u==null?void 0:u.message)})}duration(u){return this._addCheck({kind:"duration",...errorUtil.errToObj(u)})}regex(u,f){return this._addCheck({kind:"regex",regex:u,...errorUtil.errToObj(f)})}includes(u,f){return this._addCheck({kind:"includes",value:u,position:f==null?void 0:f.position,...errorUtil.errToObj(f==null?void 0:f.message)})}startsWith(u,f){return this._addCheck({kind:"startsWith",value:u,...errorUtil.errToObj(f)})}endsWith(u,f){return this._addCheck({kind:"endsWith",value:u,...errorUtil.errToObj(f)})}min(u,f){return this._addCheck({kind:"min",value:u,...errorUtil.errToObj(f)})}max(u,f){return this._addCheck({kind:"max",value:u,...errorUtil.errToObj(f)})}length(u,f){return this._addCheck({kind:"length",value:u,...errorUtil.errToObj(f)})}nonempty(u){return this.min(1,errorUtil.errToObj(u))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(u=>u.kind==="datetime")}get isDate(){return!!this._def.checks.find(u=>u.kind==="date")}get isTime(){return!!this._def.checks.find(u=>u.kind==="time")}get isDuration(){return!!this._def.checks.find(u=>u.kind==="duration")}get isEmail(){return!!this._def.checks.find(u=>u.kind==="email")}get isURL(){return!!this._def.checks.find(u=>u.kind==="url")}get isEmoji(){return!!this._def.checks.find(u=>u.kind==="emoji")}get isUUID(){return!!this._def.checks.find(u=>u.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(u=>u.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(u=>u.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(u=>u.kind==="cuid2")}get isULID(){return!!this._def.checks.find(u=>u.kind==="ulid")}get isIP(){return!!this._def.checks.find(u=>u.kind==="ip")}get isBase64(){return!!this._def.checks.find(u=>u.kind==="base64")}get minLength(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxLength(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}}ZodString.create=p=>{var u;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(u=p==null?void 0:p.coerce)!==null&&u!==void 0?u:!1,...processCreateParams(p)})};function floatSafeRemainder(p,u){const f=(p.toString().split(".")[1]||"").length,m=(u.toString().split(".")[1]||"").length,v=f>m?f:m,y=parseInt(p.toFixed(v).replace(".","")),w=parseInt(u.toFixed(v).replace(".",""));return y%w/Math.pow(10,v)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){if(this._def.coerce&&(u.data=Number(u.data)),this._getType(u)!==ZodParsedType.number){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:y.parsedType}),INVALID$3}let m;const v=new ParseStatus;for(const y of this._def.checks)y.kind==="int"?util$2.isInteger(u.data)||(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:y.message}),v.dirty()):y.kind==="min"?(y.inclusive?u.data<y.value:u.data<=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?u.data>y.value:u.data>=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="multipleOf"?floatSafeRemainder(u.data,y.value)!==0&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):y.kind==="finite"?Number.isFinite(u.data)||(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_finite,message:y.message}),v.dirty()):util$2.assertNever(y);return{status:v.value,value:u.data}}gte(u,f){return this.setLimit("min",u,!0,errorUtil.toString(f))}gt(u,f){return this.setLimit("min",u,!1,errorUtil.toString(f))}lte(u,f){return this.setLimit("max",u,!0,errorUtil.toString(f))}lt(u,f){return this.setLimit("max",u,!1,errorUtil.toString(f))}setLimit(u,f,m,v){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:u,value:f,inclusive:m,message:errorUtil.toString(v)}]})}_addCheck(u){return new ZodNumber({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:errorUtil.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(u)})}multipleOf(u,f){return this._addCheck({kind:"multipleOf",value:u,message:errorUtil.toString(f)})}finite(u){return this._addCheck({kind:"finite",message:errorUtil.toString(u)})}safe(u){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(u)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(u)})}get minValue(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxValue(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}get isInt(){return!!this._def.checks.find(u=>u.kind==="int"||u.kind==="multipleOf"&&util$2.isInteger(u.value))}get isFinite(){let u=null,f=null;for(const m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(u===null||m.value<u)&&(u=m.value)}return Number.isFinite(f)&&Number.isFinite(u)}}ZodNumber.create=p=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(p==null?void 0:p.coerce)||!1,...processCreateParams(p)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(u){if(this._def.coerce&&(u.data=BigInt(u.data)),this._getType(u)!==ZodParsedType.bigint){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:y.parsedType}),INVALID$3}let m;const v=new ParseStatus;for(const y of this._def.checks)y.kind==="min"?(y.inclusive?u.data<y.value:u.data<=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_small,type:"bigint",minimum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?u.data>y.value:u.data>=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_big,type:"bigint",maximum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="multipleOf"?u.data%y.value!==BigInt(0)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):util$2.assertNever(y);return{status:v.value,value:u.data}}gte(u,f){return this.setLimit("min",u,!0,errorUtil.toString(f))}gt(u,f){return this.setLimit("min",u,!1,errorUtil.toString(f))}lte(u,f){return this.setLimit("max",u,!0,errorUtil.toString(f))}lt(u,f){return this.setLimit("max",u,!1,errorUtil.toString(f))}setLimit(u,f,m,v){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:u,value:f,inclusive:m,message:errorUtil.toString(v)}]})}_addCheck(u){return new ZodBigInt({...this._def,checks:[...this._def.checks,u]})}positive(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(u)})}multipleOf(u,f){return this._addCheck({kind:"multipleOf",value:u,message:errorUtil.toString(f)})}get minValue(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxValue(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}}ZodBigInt.create=p=>{var u;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(u=p==null?void 0:p.coerce)!==null&&u!==void 0?u:!1,...processCreateParams(p)})};class ZodBoolean extends ZodType{_parse(u){if(this._def.coerce&&(u.data=!!u.data),this._getType(u)!==ZodParsedType.boolean){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodBoolean.create=p=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(p==null?void 0:p.coerce)||!1,...processCreateParams(p)});class ZodDate extends ZodType{_parse(u){if(this._def.coerce&&(u.data=new Date(u.data)),this._getType(u)!==ZodParsedType.date){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:y.parsedType}),INVALID$3}if(isNaN(u.data.getTime())){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_date}),INVALID$3}const m=new ParseStatus;let v;for(const y of this._def.checks)y.kind==="min"?u.data.getTime()<y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_small,message:y.message,inclusive:!0,exact:!1,minimum:y.value,type:"date"}),m.dirty()):y.kind==="max"?u.data.getTime()>y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_big,message:y.message,inclusive:!0,exact:!1,maximum:y.value,type:"date"}),m.dirty()):util$2.assertNever(y);return{status:m.value,value:new Date(u.data.getTime())}}_addCheck(u){return new ZodDate({...this._def,checks:[...this._def.checks,u]})}min(u,f){return this._addCheck({kind:"min",value:u.getTime(),message:errorUtil.toString(f)})}max(u,f){return this._addCheck({kind:"max",value:u.getTime(),message:errorUtil.toString(f)})}get minDate(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u!=null?new Date(u):null}get maxDate(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u!=null?new Date(u):null}}ZodDate.create=p=>new ZodDate({checks:[],coerce:(p==null?void 0:p.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(p)});class ZodSymbol extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.symbol){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodSymbol.create=p=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(p)});class ZodUndefined extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.undefined){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodUndefined.create=p=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(p)});class ZodNull extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.null){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodNull.create=p=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(p)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(u){return OK(u.data)}}ZodAny.create=p=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(p)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(u){return OK(u.data)}}ZodUnknown.create=p=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(p)});class ZodNever extends ZodType{_parse(u){const f=this._getOrReturnCtx(u);return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:f.parsedType}),INVALID$3}}ZodNever.create=p=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(p)});class ZodVoid extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.undefined){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodVoid.create=p=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(p)});class ZodArray extends ZodType{_parse(u){const{ctx:f,status:m}=this._processInputParams(u),v=this._def;if(f.parsedType!==ZodParsedType.array)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:f.parsedType}),INVALID$3;if(v.exactLength!==null){const w=f.data.length>v.exactLength.value,k=f.data.length<v.exactLength.value;(w||k)&&(addIssueToContext(f,{code:w?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:k?v.exactLength.value:void 0,maximum:w?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),m.dirty())}if(v.minLength!==null&&f.data.length<v.minLength.value&&(addIssueToContext(f,{code:ZodIssueCode.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),m.dirty()),v.maxLength!==null&&f.data.length>v.maxLength.value&&(addIssueToContext(f,{code:ZodIssueCode.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((w,k)=>v.type._parseAsync(new ParseInputLazyPath(f,w,f.path,k)))).then(w=>ParseStatus.mergeArray(m,w));const y=[...f.data].map((w,k)=>v.type._parseSync(new ParseInputLazyPath(f,w,f.path,k)));return ParseStatus.mergeArray(m,y)}get element(){return this._def.type}min(u,f){return new ZodArray({...this._def,minLength:{value:u,message:errorUtil.toString(f)}})}max(u,f){return new ZodArray({...this._def,maxLength:{value:u,message:errorUtil.toString(f)}})}length(u,f){return new ZodArray({...this._def,exactLength:{value:u,message:errorUtil.toString(f)}})}nonempty(u){return this.min(1,u)}}ZodArray.create=(p,u)=>new ZodArray({type:p,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(u)});function deepPartialify(p){if(p instanceof ZodObject){const u={};for(const f in p.shape){const m=p.shape[f];u[f]=ZodOptional.create(deepPartialify(m))}return new ZodObject({...p._def,shape:()=>u})}else return p instanceof ZodArray?new ZodArray({...p._def,type:deepPartialify(p.element)}):p instanceof ZodOptional?ZodOptional.create(deepPartialify(p.unwrap())):p instanceof ZodNullable?ZodNullable.create(deepPartialify(p.unwrap())):p instanceof ZodTuple?ZodTuple.create(p.items.map(u=>deepPartialify(u))):p}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const u=this._def.shape(),f=util$2.objectKeys(u);return this._cached={shape:u,keys:f}}_parse(u){if(this._getType(u)!==ZodParsedType.object){const M=this._getOrReturnCtx(u);return addIssueToContext(M,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:M.parsedType}),INVALID$3}const{status:m,ctx:v}=this._processInputParams(u),{shape:y,keys:w}=this._getCached(),k=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const M in v.data)w.includes(M)||k.push(M);const S=[];for(const M of w){const T=y[M],E=v.data[M];S.push({key:{status:"valid",value:M},value:T._parse(new ParseInputLazyPath(v,E,v.path,M)),alwaysSet:M in v.data})}if(this._def.catchall instanceof ZodNever){const M=this._def.unknownKeys;if(M==="passthrough")for(const T of k)S.push({key:{status:"valid",value:T},value:{status:"valid",value:v.data[T]}});else if(M==="strict")k.length>0&&(addIssueToContext(v,{code:ZodIssueCode.unrecognized_keys,keys:k}),m.dirty());else if(M!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const M=this._def.catchall;for(const T of k){const E=v.data[T];S.push({key:{status:"valid",value:T},value:M._parse(new ParseInputLazyPath(v,E,v.path,T)),alwaysSet:T in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const M=[];for(const T of S){const E=await T.key,H=await T.value;M.push({key:E,value:H,alwaysSet:T.alwaysSet})}return M}).then(M=>ParseStatus.mergeObjectSync(m,M)):ParseStatus.mergeObjectSync(m,S)}get shape(){return this._def.shape()}strict(u){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...u!==void 0?{errorMap:(f,m)=>{var v,y,w,k;const S=(w=(y=(v=this._def).errorMap)===null||y===void 0?void 0:y.call(v,f,m).message)!==null&&w!==void 0?w:m.defaultError;return f.code==="unrecognized_keys"?{message:(k=errorUtil.errToObj(u).message)!==null&&k!==void 0?k:S}:{message:S}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(u){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new ZodObject({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>({...this._def.shape(),...u._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(u,f){return this.augment({[u]:f})}catchall(u){return new ZodObject({...this._def,catchall:u})}pick(u){const f={};return util$2.objectKeys(u).forEach(m=>{u[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new ZodObject({...this._def,shape:()=>f})}omit(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{u[m]||(f[m]=this.shape[m])}),new ZodObject({...this._def,shape:()=>f})}deepPartial(){return deepPartialify(this)}partial(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{const v=this.shape[m];u&&!u[m]?f[m]=v:f[m]=v.optional()}),new ZodObject({...this._def,shape:()=>f})}required(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{if(u&&!u[m])f[m]=this.shape[m];else{let y=this.shape[m];for(;y instanceof ZodOptional;)y=y._def.innerType;f[m]=y}}),new ZodObject({...this._def,shape:()=>f})}keyof(){return createZodEnum(util$2.objectKeys(this.shape))}}ZodObject.create=(p,u)=>new ZodObject({shape:()=>p,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)}),ZodObject.strictCreate=(p,u)=>new ZodObject({shape:()=>p,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)}),ZodObject.lazycreate=(p,u)=>new ZodObject({shape:p,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)});class ZodUnion extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m=this._def.options;function v(y){for(const k of y)if(k.result.status==="valid")return k.result;for(const k of y)if(k.result.status==="dirty")return f.common.issues.push(...k.ctx.common.issues),k.result;const w=y.map(k=>new ZodError(k.ctx.common.issues));return addIssueToContext(f,{code:ZodIssueCode.invalid_union,unionErrors:w}),INVALID$3}if(f.common.async)return Promise.all(m.map(async y=>{const w={...f,common:{...f.common,issues:[]},parent:null};return{result:await y._parseAsync({data:f.data,path:f.path,parent:w}),ctx:w}})).then(v);{let y;const w=[];for(const S of m){const M={...f,common:{...f.common,issues:[]},parent:null},T=S._parseSync({data:f.data,path:f.path,parent:M});if(T.status==="valid")return T;T.status==="dirty"&&!y&&(y={result:T,ctx:M}),M.common.issues.length&&w.push(M.common.issues)}if(y)return f.common.issues.push(...y.ctx.common.issues),y.result;const k=w.map(S=>new ZodError(S));return addIssueToContext(f,{code:ZodIssueCode.invalid_union,unionErrors:k}),INVALID$3}}get options(){return this._def.options}}ZodUnion.create=(p,u)=>new ZodUnion({options:p,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(u)});const getDiscriminator=p=>p instanceof ZodLazy?getDiscriminator(p.schema):p instanceof ZodEffects?getDiscriminator(p.innerType()):p instanceof ZodLiteral?[p.value]:p instanceof ZodEnum?p.options:p instanceof ZodNativeEnum?util$2.objectValues(p.enum):p instanceof ZodDefault?getDiscriminator(p._def.innerType):p instanceof ZodUndefined?[void 0]:p instanceof ZodNull?[null]:p instanceof ZodOptional?[void 0,...getDiscriminator(p.unwrap())]:p instanceof ZodNullable?[null,...getDiscriminator(p.unwrap())]:p instanceof ZodBranded||p instanceof ZodReadonly?getDiscriminator(p.unwrap()):p instanceof ZodCatch?getDiscriminator(p._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.object)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:f.parsedType}),INVALID$3;const m=this.discriminator,v=f.data[m],y=this.optionsMap.get(v);return y?f.common.async?y._parseAsync({data:f.data,path:f.path,parent:f}):y._parseSync({data:f.data,path:f.path,parent:f}):(addIssueToContext(f,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),INVALID$3)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,f,m){const v=new Map;for(const y of f){const w=getDiscriminator(y.shape[u]);if(!w.length)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const k of w){if(v.has(k))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(k)}`);v.set(k,y)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:u,options:f,optionsMap:v,...processCreateParams(m)})}}function mergeValues(p,u){const f=getParsedType(p),m=getParsedType(u);if(p===u)return{valid:!0,data:p};if(f===ZodParsedType.object&&m===ZodParsedType.object){const v=util$2.objectKeys(u),y=util$2.objectKeys(p).filter(k=>v.indexOf(k)!==-1),w={...p,...u};for(const k of y){const S=mergeValues(p[k],u[k]);if(!S.valid)return{valid:!1};w[k]=S.data}return{valid:!0,data:w}}else if(f===ZodParsedType.array&&m===ZodParsedType.array){if(p.length!==u.length)return{valid:!1};const v=[];for(let y=0;y<p.length;y++){const w=p[y],k=u[y],S=mergeValues(w,k);if(!S.valid)return{valid:!1};v.push(S.data)}return{valid:!0,data:v}}else return f===ZodParsedType.date&&m===ZodParsedType.date&&+p==+u?{valid:!0,data:p}:{valid:!1}}class ZodIntersection extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u),v=(y,w)=>{if(isAborted(y)||isAborted(w))return INVALID$3;const k=mergeValues(y.value,w.value);return k.valid?((isDirty(y)||isDirty(w))&&f.dirty(),{status:f.value,value:k.data}):(addIssueToContext(m,{code:ZodIssueCode.invalid_intersection_types}),INVALID$3)};return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([y,w])=>v(y,w)):v(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}}ZodIntersection.create=(p,u,f)=>new ZodIntersection({left:p,right:u,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(f)});class ZodTuple extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.array)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:m.parsedType}),INVALID$3;if(m.data.length<this._def.items.length)return addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID$3;!this._def.rest&&m.data.length>this._def.items.length&&(addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());const y=[...m.data].map((w,k)=>{const S=this._def.items[k]||this._def.rest;return S?S._parse(new ParseInputLazyPath(m,w,m.path,k)):null}).filter(w=>!!w);return m.common.async?Promise.all(y).then(w=>ParseStatus.mergeArray(f,w)):ParseStatus.mergeArray(f,y)}get items(){return this._def.items}rest(u){return new ZodTuple({...this._def,rest:u})}}ZodTuple.create=(p,u)=>{if(!Array.isArray(p))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:p,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(u)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.object)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:m.parsedType}),INVALID$3;const v=[],y=this._def.keyType,w=this._def.valueType;for(const k in m.data)v.push({key:y._parse(new ParseInputLazyPath(m,k,m.path,k)),value:w._parse(new ParseInputLazyPath(m,m.data[k],m.path,k)),alwaysSet:k in m.data});return m.common.async?ParseStatus.mergeObjectAsync(f,v):ParseStatus.mergeObjectSync(f,v)}get element(){return this._def.valueType}static create(u,f,m){return f instanceof ZodType?new ZodRecord({keyType:u,valueType:f,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(m)}):new ZodRecord({keyType:ZodString.create(),valueType:u,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(f)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.map)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:m.parsedType}),INVALID$3;const v=this._def.keyType,y=this._def.valueType,w=[...m.data.entries()].map(([k,S],M)=>({key:v._parse(new ParseInputLazyPath(m,k,m.path,[M,"key"])),value:y._parse(new ParseInputLazyPath(m,S,m.path,[M,"value"]))}));if(m.common.async){const k=new Map;return Promise.resolve().then(async()=>{for(const S of w){const M=await S.key,T=await S.value;if(M.status==="aborted"||T.status==="aborted")return INVALID$3;(M.status==="dirty"||T.status==="dirty")&&f.dirty(),k.set(M.value,T.value)}return{status:f.value,value:k}})}else{const k=new Map;for(const S of w){const M=S.key,T=S.value;if(M.status==="aborted"||T.status==="aborted")return INVALID$3;(M.status==="dirty"||T.status==="dirty")&&f.dirty(),k.set(M.value,T.value)}return{status:f.value,value:k}}}}ZodMap.create=(p,u,f)=>new ZodMap({valueType:u,keyType:p,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(f)});class ZodSet extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.set)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:m.parsedType}),INVALID$3;const v=this._def;v.minSize!==null&&m.data.size<v.minSize.value&&(addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),f.dirty()),v.maxSize!==null&&m.data.size>v.maxSize.value&&(addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),f.dirty());const y=this._def.valueType;function w(S){const M=new Set;for(const T of S){if(T.status==="aborted")return INVALID$3;T.status==="dirty"&&f.dirty(),M.add(T.value)}return{status:f.value,value:M}}const k=[...m.data.values()].map((S,M)=>y._parse(new ParseInputLazyPath(m,S,m.path,M)));return m.common.async?Promise.all(k).then(S=>w(S)):w(k)}min(u,f){return new ZodSet({...this._def,minSize:{value:u,message:errorUtil.toString(f)}})}max(u,f){return new ZodSet({...this._def,maxSize:{value:u,message:errorUtil.toString(f)}})}size(u,f){return this.min(u,f).max(u,f)}nonempty(u){return this.min(1,u)}}ZodSet.create=(p,u)=>new ZodSet({valueType:p,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(u)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.function)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:f.parsedType}),INVALID$3;function m(k,S){return makeIssue({data:k,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,getErrorMap(),errorMap].filter(M=>!!M),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:S}})}function v(k,S){return makeIssue({data:k,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,getErrorMap(),errorMap].filter(M=>!!M),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:S}})}const y={errorMap:f.common.contextualErrorMap},w=f.data;if(this._def.returns instanceof ZodPromise){const k=this;return OK(async function(...S){const M=new ZodError([]),T=await k._def.args.parseAsync(S,y).catch(F=>{throw M.addIssue(m(S,F)),M}),E=await Reflect.apply(w,this,T);return await k._def.returns._def.type.parseAsync(E,y).catch(F=>{throw M.addIssue(v(E,F)),M})})}else{const k=this;return OK(function(...S){const M=k._def.args.safeParse(S,y);if(!M.success)throw new ZodError([m(S,M.error)]);const T=Reflect.apply(w,this,M.data),E=k._def.returns.safeParse(T,y);if(!E.success)throw new ZodError([v(T,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new ZodFunction({...this._def,args:ZodTuple.create(u).rest(ZodUnknown.create())})}returns(u){return new ZodFunction({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,f,m){return new ZodFunction({args:u||ZodTuple.create([]).rest(ZodUnknown.create()),returns:f||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(m)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(u){const{ctx:f}=this._processInputParams(u);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}}ZodLazy.create=(p,u)=>new ZodLazy({getter:p,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(u)});class ZodLiteral extends ZodType{_parse(u){if(u.data!==this._def.value){const f=this._getOrReturnCtx(u);return addIssueToContext(f,{received:f.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID$3}return{status:"valid",value:u.data}}get value(){return this._def.value}}ZodLiteral.create=(p,u)=>new ZodLiteral({value:p,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(u)});function createZodEnum(p,u){return new ZodEnum({values:p,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(u)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(u){if(typeof u.data!="string"){const f=this._getOrReturnCtx(u),m=this._def.values;return addIssueToContext(f,{expected:util$2.joinValues(m),received:f.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodEnum_cache,"f")||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values),"f"),!__classPrivateFieldGet(this,_ZodEnum_cache,"f").has(u.data)){const f=this._getOrReturnCtx(u),m=this._def.values;return addIssueToContext(f,{received:f.data,code:ZodIssueCode.invalid_enum_value,options:m}),INVALID$3}return OK(u.data)}get options(){return this._def.values}get enum(){const u={};for(const f of this._def.values)u[f]=f;return u}get Values(){const u={};for(const f of this._def.values)u[f]=f;return u}get Enum(){const u={};for(const f of this._def.values)u[f]=f;return u}extract(u,f=this._def){return ZodEnum.create(u,{...this._def,...f})}exclude(u,f=this._def){return ZodEnum.create(this.options.filter(m=>!u.includes(m)),{...this._def,...f})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(u){const f=util$2.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(u);if(m.parsedType!==ZodParsedType.string&&m.parsedType!==ZodParsedType.number){const v=util$2.objectValues(f);return addIssueToContext(m,{expected:util$2.joinValues(v),received:m.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util$2.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(u.data)){const v=util$2.objectValues(f);return addIssueToContext(m,{received:m.data,code:ZodIssueCode.invalid_enum_value,options:v}),INVALID$3}return OK(u.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(p,u)=>new ZodNativeEnum({values:p,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(u)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.promise&&f.common.async===!1)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:f.parsedType}),INVALID$3;const m=f.parsedType===ZodParsedType.promise?f.data:Promise.resolve(f.data);return OK(m.then(v=>this._def.type.parseAsync(v,{path:f.path,errorMap:f.common.contextualErrorMap})))}}ZodPromise.create=(p,u)=>new ZodPromise({type:p,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(u)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:f,ctx:m}=this._processInputParams(u),v=this._def.effect||null,y={addIssue:w=>{addIssueToContext(m,w),w.fatal?f.abort():f.dirty()},get path(){return m.path}};if(y.addIssue=y.addIssue.bind(y),v.type==="preprocess"){const w=v.transform(m.data,y);if(m.common.async)return Promise.resolve(w).then(async k=>{if(f.value==="aborted")return INVALID$3;const S=await this._def.schema._parseAsync({data:k,path:m.path,parent:m});return S.status==="aborted"?INVALID$3:S.status==="dirty"||f.value==="dirty"?DIRTY(S.value):S});{if(f.value==="aborted")return INVALID$3;const k=this._def.schema._parseSync({data:w,path:m.path,parent:m});return k.status==="aborted"?INVALID$3:k.status==="dirty"||f.value==="dirty"?DIRTY(k.value):k}}if(v.type==="refinement"){const w=k=>{const S=v.refinement(k,y);if(m.common.async)return Promise.resolve(S);if(S instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return k};if(m.common.async===!1){const k=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return k.status==="aborted"?INVALID$3:(k.status==="dirty"&&f.dirty(),w(k.value),{status:f.value,value:k.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(k=>k.status==="aborted"?INVALID$3:(k.status==="dirty"&&f.dirty(),w(k.value).then(()=>({status:f.value,value:k.value}))))}if(v.type==="transform")if(m.common.async===!1){const w=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!isValid$3(w))return w;const k=v.transform(w.value,y);if(k instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:k}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(w=>isValid$3(w)?Promise.resolve(v.transform(w.value,y)).then(k=>({status:f.value,value:k})):w);util$2.assertNever(v)}}ZodEffects.create=(p,u,f)=>new ZodEffects({schema:p,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:u,...processCreateParams(f)}),ZodEffects.createWithPreprocess=(p,u,f)=>new ZodEffects({schema:u,effect:{type:"preprocess",transform:p},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(f)});class ZodOptional extends ZodType{_parse(u){return this._getType(u)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodOptional.create=(p,u)=>new ZodOptional({innerType:p,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(u)});class ZodNullable extends ZodType{_parse(u){return this._getType(u)===ZodParsedType.null?OK(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodNullable.create=(p,u)=>new ZodNullable({innerType:p,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(u)});class ZodDefault extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u);let m=f.data;return f.parsedType===ZodParsedType.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}}ZodDefault.create=(p,u)=>new ZodDefault({innerType:p,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...processCreateParams(u)});class ZodCatch extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m={...f,common:{...f.common,issues:[]}},v=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return isAsync(v)?v.then(y=>({status:"valid",value:y.status==="valid"?y.value:this._def.catchValue({get error(){return new ZodError(m.common.issues)},input:m.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new ZodError(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(p,u)=>new ZodCatch({innerType:p,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...processCreateParams(u)});class ZodNaN extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.nan){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:m.parsedType}),INVALID$3}return{status:"valid",value:u.data}}}ZodNaN.create=p=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(p)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.common.async)return(async()=>{const y=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return y.status==="aborted"?INVALID$3:y.status==="dirty"?(f.dirty(),DIRTY(y.value)):this._def.out._parseAsync({data:y.value,path:m.path,parent:m})})();{const v=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return v.status==="aborted"?INVALID$3:v.status==="dirty"?(f.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:m.path,parent:m})}}static create(u,f){return new ZodPipeline({in:u,out:f,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(u){const f=this._def.innerType._parse(u),m=v=>(isValid$3(v)&&(v.value=Object.freeze(v.value)),v);return isAsync(f)?f.then(v=>m(v)):m(f)}unwrap(){return this._def.innerType}}ZodReadonly.create=(p,u)=>new ZodReadonly({innerType:p,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(u)});function custom(p,u={},f){return p?ZodAny.create().superRefine((m,v)=>{var y,w;if(!p(m)){const k=typeof u=="function"?u(m):typeof u=="string"?{message:u}:u,S=(w=(y=k.fatal)!==null&&y!==void 0?y:f)!==null&&w!==void 0?w:!0,M=typeof k=="string"?{message:k}:k;v.addIssue({code:"custom",...M,fatal:S})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(p){p.ZodString="ZodString",p.ZodNumber="ZodNumber",p.ZodNaN="ZodNaN",p.ZodBigInt="ZodBigInt",p.ZodBoolean="ZodBoolean",p.ZodDate="ZodDate",p.ZodSymbol="ZodSymbol",p.ZodUndefined="ZodUndefined",p.ZodNull="ZodNull",p.ZodAny="ZodAny",p.ZodUnknown="ZodUnknown",p.ZodNever="ZodNever",p.ZodVoid="ZodVoid",p.ZodArray="ZodArray",p.ZodObject="ZodObject",p.ZodUnion="ZodUnion",p.ZodDiscriminatedUnion="ZodDiscriminatedUnion",p.ZodIntersection="ZodIntersection",p.ZodTuple="ZodTuple",p.ZodRecord="ZodRecord",p.ZodMap="ZodMap",p.ZodSet="ZodSet",p.ZodFunction="ZodFunction",p.ZodLazy="ZodLazy",p.ZodLiteral="ZodLiteral",p.ZodEnum="ZodEnum",p.ZodEffects="ZodEffects",p.ZodNativeEnum="ZodNativeEnum",p.ZodOptional="ZodOptional",p.ZodNullable="ZodNullable",p.ZodDefault="ZodDefault",p.ZodCatch="ZodCatch",p.ZodPromise="ZodPromise",p.ZodBranded="ZodBranded",p.ZodPipeline="ZodPipeline",p.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(p,u={message:`Input not instance of ${p.name}`})=>custom(f=>f instanceof p,u),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType$1=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:p=>ZodString.create({...p,coerce:!0}),number:p=>ZodNumber.create({...p,coerce:!0}),boolean:p=>ZodBoolean.create({...p,coerce:!0}),bigint:p=>ZodBigInt.create({...p,coerce:!0}),date:p=>ZodDate.create({...p,coerce:!0})},NEVER=INVALID$3;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID:INVALID$3,DIRTY,OK,isAborted,isDirty,isValid:isValid$3,isAsync,get util(){return util$2},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType$1,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const fieldKey=z.string().refine(p=>p!==InternalSearchFilterOperator.COMPLEX_ID_OPERATOR,{message:`Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`}),stringBasicFilter=z.record(fieldKey,z.string()),basicFilter=z.record(fieldKey,z.any()),arrayFilter$2=z.record(fieldKey,z.union([z.any().array(),z.string()])),logicFilter=z.lazy(()=>z.object({conditions:z.array(z.object(queryFilterValidation))})),stringOrNumber=z.union([z.string(),z.number()]),queryFilterValidation={[BasicOperator.STRING]:stringBasicFilter.optional(),[BasicOperator.FUZZY]:stringBasicFilter.optional(),[RangeOperator.RANGE]:z.record(fieldKey,z.union([z.object({high:stringOrNumber,low:stringOrNumber}),z.object({high:stringOrNumber}),z.object({low:stringOrNumber})])).optional(),[BasicOperator.EQUAL]:basicFilter.optional(),[BasicOperator.NOT_EQUAL]:basicFilter.optional(),[BasicOperator.EMPTY]:basicFilter.optional(),[BasicOperator.NOT_EMPTY]:basicFilter.optional(),[ArrayOperator.ONE_OF]:arrayFilter$2.optional(),[ArrayOperator.CONTAINS]:arrayFilter$2.optional(),[ArrayOperator.NOT_CONTAINS]:arrayFilter$2.optional(),[ArrayOperator.CONTAINS_ANY]:arrayFilter$2.optional(),[LogicalOperator.AND]:logicFilter.optional(),[LogicalOperator.OR]:logicFilter.optional()};z.object({query:z.object({allOr:z.boolean().optional(),onEmptyFilter:z.nativeEnum(EmptyFilterOption).optional(),...queryFilterValidation}).optional(),paginate:z.boolean().optional(),bookmark:z.union([z.string(),z.number()]).nullish(),limit:z.number().optional(),sort:z.string().nullish(),sortOrder:z.nativeEnum(SortOrder).optional(),sortType:z.nativeEnum(SortType).nullish(),version:z.string().optional(),disableEscaping:z.boolean().optional(),countRows:z.boolean().optional()});var MaintenanceType=(p=>(p.SQS_MISSING="sqs_missing",p))(MaintenanceType||{});AIOperationEnum.SUMMARISE_TEXT+"",OperationFieldTypeEnum.MULTI_COLUMN,AIOperationEnum.CLEAN_DATA+"",OperationFieldTypeEnum.COLUMN,AIOperationEnum.TRANSLATE+"",OperationFieldTypeEnum.COLUMN,OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.CATEGORISE_TEXT+"",OperationFieldTypeEnum.MULTI_COLUMN,OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.SENTIMENT_ANALYSIS+"",OperationFieldTypeEnum.COLUMN,AIOperationEnum.PROMPT+"",OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.SEARCH_WEB+"",OperationFieldTypeEnum.MULTI_COLUMN;var Header=(p=>(p.API_KEY="x-budibase-api-key",p.LICENSE_KEY="x-budibase-license-key",p.API_VER="x-budibase-api-version",p.APP_ID="x-budibase-app-id",p.SESSION_ID="x-budibase-session-id",p.TYPE="x-budibase-type",p.PREVIEW_ROLE="x-budibase-role",p.TENANT_ID="x-budibase-tenant-id",p.VERIFICATION_CODE="x-budibase-verification-code",p.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",p.RESET_PASSWORD_CODE="x-budibase-reset-password-code",p.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",p.TOKEN="x-budibase-token",p.CSRF_TOKEN="x-csrf-token",p.CORRELATION_ID="x-budibase-correlation-id",p.AUTHORIZATION="authorization",p.MIGRATING_APP="x-budibase-migrating-app",p.COOKIE="cookie",p))(Header||{});FieldType.STRING+"",FieldType.STRING,FieldType.OPTIONS,FieldType.LONGFORM,FieldType.BARCODEQR,FieldType.OPTIONS+"",FieldType.OPTIONS,FieldType.STRING,FieldType.LONGFORM,FieldType.BARCODEQR,FieldType.LONGFORM+"",FieldType.LONGFORM,FieldType.STRING,FieldType.OPTIONS,FieldType.BARCODEQR,FieldType.BARCODEQR+"",FieldType.BARCODEQR,FieldType.STRING,FieldType.OPTIONS,FieldType.LONGFORM,FieldType.NUMBER+"",FieldType.NUMBER,FieldType.BOOLEAN;const ThemeClassPrefix="spectrum--";Theme.DARKEST;const DefaultAppTheme=Theme.LIGHT,ThemeOptions=[{id:Theme.LIGHT,name:"Light"},{id:Theme.DARKEST,name:"Dark"},{id:Theme.NORD,name:"Nord",base:Theme.DARKEST},{id:Theme.MIDNIGHT,name:"Midnight",base:Theme.DARKEST}],OperatorOptions={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than or equal to"},LessThan:{value:"rangeHigh",label:"Less than or equal to"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},SqlNumberTypeRangeMap={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}};var SocketEvent=(p=>(p.UserUpdate="UserUpdate",p.UserDisconnect="UserDisconnect",p.Heartbeat="Heartbeat",p))(SocketEvent||{}),GridSocketEvent=(p=>(p.RowChange="RowChange",p.DatasourceChange="DatasourceChange",p.SelectDatasource="SelectDatasource",p.SelectCell="SelectCell",p))(GridSocketEvent||{});const SocketSessionTTL=60,ValidColumnNameRegex=/^[_a-zA-Z0-9\s]*$/g;var BpmCorrelationKey=(p=>(p.ONBOARDING="budibase:onboarding:correlationkey",p.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",p))(BpmCorrelationKey||{});const DEFAULT_BB_DATASOURCE_ID="datasource_internal_bb_default";var commonjsGlobal$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}function getAugmentedNamespace(p){if(p.__esModule)return p;var u=p.default;if(typeof u=="function"){var f=function m(){return this instanceof m?Reflect.construct(u,arguments,this.constructor):u.apply(this,arguments)};f.prototype=u.prototype}else f={};return Object.defineProperty(f,"__esModule",{value:!0}),Object.keys(p).forEach(function(m){var v=Object.getOwnPropertyDescriptor(p,m);Object.defineProperty(f,m,v.get?v:{enumerable:!0,get:function(){return p[m]}})}),f}var dayjs_min$1={exports:{}};(function(p,u){(function(f,m){p.exports=m()})(commonjsGlobal$1,function(){var f=1e3,m=6e4,v=36e5,y="millisecond",w="second",k="minute",S="hour",M="day",T="week",E="month",H="quarter",F="year",Z="date",$="Invalid Date",J=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ae=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ie={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Ye){var be=["th","st","nd","rd"],Be=Ye%100;return"["+Ye+(be[(Be-20)%10]||be[Be]||be[0])+"]"}},he=function(Ye,be,Be){var Xe=String(Ye);return!Xe||Xe.length>=be?Ye:""+Array(be+1-Xe.length).join(Be)+Ye},fe={s:he,z:function(Ye){var be=-Ye.utcOffset(),Be=Math.abs(be),Xe=Math.floor(Be/60),Ne=Be%60;return(be<=0?"+":"-")+he(Xe,2,"0")+":"+he(Ne,2,"0")},m:function Ye(be,Be){if(be.date()<Be.date())return-Ye(Be,be);var Xe=12*(Be.year()-be.year())+(Be.month()-be.month()),Ne=be.clone().add(Xe,E),Je=Be-Ne<0,ft=be.clone().add(Xe+(Je?-1:1),E);return+(-(Xe+(Be-Ne)/(Je?Ne-ft:ft-Ne))||0)},a:function(Ye){return Ye<0?Math.ceil(Ye)||0:Math.floor(Ye)},p:function(Ye){return{M:E,y:F,w:T,d:M,D:Z,h:S,m:k,s:w,ms:y,Q:H}[Ye]||String(Ye||"").toLowerCase().replace(/s$/,"")},u:function(Ye){return Ye===void 0}},me="en",ve={};ve[me]=ie;var Ce="$isDayjsObject",Ee=function(Ye){return Ye instanceof Ue||!(!Ye||!Ye[Ce])},Se=function Ye(be,Be,Xe){var Ne;if(!be)return me;if(typeof be=="string"){var Je=be.toLowerCase();ve[Je]&&(Ne=Je),Be&&(ve[Je]=Be,Ne=Je);var ft=be.split("-");if(!Ne&&ft.length>1)return Ye(ft[0])}else{var Tt=be.name;ve[Tt]=be,Ne=Tt}return!Xe&&Ne&&(me=Ne),Ne||!Xe&&me},Ie=function(Ye,be){if(Ee(Ye))return Ye.clone();var Be=typeof be=="object"?be:{};return Be.date=Ye,Be.args=arguments,new Ue(Be)},xe=fe;xe.l=Se,xe.i=Ee,xe.w=function(Ye,be){return Ie(Ye,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var Ue=function(){function Ye(Be){this.$L=Se(Be.locale,null,!0),this.parse(Be),this.$x=this.$x||Be.x||{},this[Ce]=!0}var be=Ye.prototype;return be.parse=function(Be){this.$d=function(Xe){var Ne=Xe.date,Je=Xe.utc;if(Ne===null)return new Date(NaN);if(xe.u(Ne))return new Date;if(Ne instanceof Date)return new Date(Ne);if(typeof Ne=="string"&&!/Z$/i.test(Ne)){var ft=Ne.match(J);if(ft){var Tt=ft[2]-1||0,qe=(ft[7]||"0").substring(0,3);return Je?new Date(Date.UTC(ft[1],Tt,ft[3]||1,ft[4]||0,ft[5]||0,ft[6]||0,qe)):new Date(ft[1],Tt,ft[3]||1,ft[4]||0,ft[5]||0,ft[6]||0,qe)}}return new Date(Ne)}(Be),this.init()},be.init=function(){var Be=this.$d;this.$y=Be.getFullYear(),this.$M=Be.getMonth(),this.$D=Be.getDate(),this.$W=Be.getDay(),this.$H=Be.getHours(),this.$m=Be.getMinutes(),this.$s=Be.getSeconds(),this.$ms=Be.getMilliseconds()},be.$utils=function(){return xe},be.isValid=function(){return this.$d.toString()!==$},be.isSame=function(Be,Xe){var Ne=Ie(Be);return this.startOf(Xe)<=Ne&&Ne<=this.endOf(Xe)},be.isAfter=function(Be,Xe){return Ie(Be)<this.startOf(Xe)},be.isBefore=function(Be,Xe){return this.endOf(Xe)<Ie(Be)},be.$g=function(Be,Xe,Ne){return xe.u(Be)?this[Xe]:this.set(Ne,Be)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function(Be,Xe){var Ne=this,Je=!!xe.u(Xe)||Xe,ft=xe.p(Be),Tt=function(jt,Qt){var Nt=xe.w(Ne.$u?Date.UTC(Ne.$y,Qt,jt):new Date(Ne.$y,Qt,jt),Ne);return Je?Nt:Nt.endOf(M)},qe=function(jt,Qt){return xe.w(Ne.toDate()[jt].apply(Ne.toDate("s"),(Je?[0,0,0,0]:[23,59,59,999]).slice(Qt)),Ne)},Ge=this.$W,dt=this.$M,Ct=this.$D,ot="set"+(this.$u?"UTC":"");switch(ft){case F:return Je?Tt(1,0):Tt(31,11);case E:return Je?Tt(1,dt):Tt(0,dt+1);case T:var Wt=this.$locale().weekStart||0,Ke=(Ge<Wt?Ge+7:Ge)-Wt;return Tt(Je?Ct-Ke:Ct+(6-Ke),dt);case M:case Z:return qe(ot+"Hours",0);case S:return qe(ot+"Minutes",1);case k:return qe(ot+"Seconds",2);case w:return qe(ot+"Milliseconds",3);default:return this.clone()}},be.endOf=function(Be){return this.startOf(Be,!1)},be.$set=function(Be,Xe){var Ne,Je=xe.p(Be),ft="set"+(this.$u?"UTC":""),Tt=(Ne={},Ne[M]=ft+"Date",Ne[Z]=ft+"Date",Ne[E]=ft+"Month",Ne[F]=ft+"FullYear",Ne[S]=ft+"Hours",Ne[k]=ft+"Minutes",Ne[w]=ft+"Seconds",Ne[y]=ft+"Milliseconds",Ne)[Je],qe=Je===M?this.$D+(Xe-this.$W):Xe;if(Je===E||Je===F){var Ge=this.clone().set(Z,1);Ge.$d[Tt](qe),Ge.init(),this.$d=Ge.set(Z,Math.min(this.$D,Ge.daysInMonth())).$d}else Tt&&this.$d[Tt](qe);return this.init(),this},be.set=function(Be,Xe){return this.clone().$set(Be,Xe)},be.get=function(Be){return this[xe.p(Be)]()},be.add=function(Be,Xe){var Ne,Je=this;Be=Number(Be);var ft=xe.p(Xe),Tt=function(dt){var Ct=Ie(Je);return xe.w(Ct.date(Ct.date()+Math.round(dt*Be)),Je)};if(ft===E)return this.set(E,this.$M+Be);if(ft===F)return this.set(F,this.$y+Be);if(ft===M)return Tt(1);if(ft===T)return Tt(7);var qe=(Ne={},Ne[k]=m,Ne[S]=v,Ne[w]=f,Ne)[ft]||1,Ge=this.$d.getTime()+Be*qe;return xe.w(Ge,this)},be.subtract=function(Be,Xe){return this.add(-1*Be,Xe)},be.format=function(Be){var Xe=this,Ne=this.$locale();if(!this.isValid())return Ne.invalidDate||$;var Je=Be||"YYYY-MM-DDTHH:mm:ssZ",ft=xe.z(this),Tt=this.$H,qe=this.$m,Ge=this.$M,dt=Ne.weekdays,Ct=Ne.months,ot=Ne.meridiem,Wt=function(Qt,Nt,Mt,yt){return Qt&&(Qt[Nt]||Qt(Xe,Je))||Mt[Nt].slice(0,yt)},Ke=function(Qt){return xe.s(Tt%12||12,Qt,"0")},jt=ot||function(Qt,Nt,Mt){var yt=Qt<12?"AM":"PM";return Mt?yt.toLowerCase():yt};return Je.replace(ae,function(Qt,Nt){return Nt||function(Mt){switch(Mt){case"YY":return String(Xe.$y).slice(-2);case"YYYY":return xe.s(Xe.$y,4,"0");case"M":return Ge+1;case"MM":return xe.s(Ge+1,2,"0");case"MMM":return Wt(Ne.monthsShort,Ge,Ct,3);case"MMMM":return Wt(Ct,Ge);case"D":return Xe.$D;case"DD":return xe.s(Xe.$D,2,"0");case"d":return String(Xe.$W);case"dd":return Wt(Ne.weekdaysMin,Xe.$W,dt,2);case"ddd":return Wt(Ne.weekdaysShort,Xe.$W,dt,3);case"dddd":return dt[Xe.$W];case"H":return String(Tt);case"HH":return xe.s(Tt,2,"0");case"h":return Ke(1);case"hh":return Ke(2);case"a":return jt(Tt,qe,!0);case"A":return jt(Tt,qe,!1);case"m":return String(qe);case"mm":return xe.s(qe,2,"0");case"s":return String(Xe.$s);case"ss":return xe.s(Xe.$s,2,"0");case"SSS":return xe.s(Xe.$ms,3,"0");case"Z":return ft}return null}(Qt)||ft.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function(Be,Xe,Ne){var Je,ft=this,Tt=xe.p(Xe),qe=Ie(Be),Ge=(qe.utcOffset()-this.utcOffset())*m,dt=this-qe,Ct=function(){return xe.m(ft,qe)};switch(Tt){case F:Je=Ct()/12;break;case E:Je=Ct();break;case H:Je=Ct()/3;break;case T:Je=(dt-Ge)/6048e5;break;case M:Je=(dt-Ge)/864e5;break;case S:Je=dt/v;break;case k:Je=dt/m;break;case w:Je=dt/f;break;default:Je=dt}return Ne?Je:xe.a(Je)},be.daysInMonth=function(){return this.endOf(E).$D},be.$locale=function(){return ve[this.$L]},be.locale=function(Be,Xe){if(!Be)return this.$L;var Ne=this.clone(),Je=Se(Be,Xe,!0);return Je&&(Ne.$L=Je),Ne},be.clone=function(){return xe.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},Ye}(),$e=Ue.prototype;return Ie.prototype=$e,[["$ms",y],["$s",w],["$m",k],["$H",S],["$W",M],["$M",E],["$y",F],["$D",Z]].forEach(function(Ye){$e[Ye[1]]=function(be){return this.$g(be,Ye[0],Ye[1])}}),Ie.extend=function(Ye,be){return Ye.$i||(Ye(be,Ue,Ie),Ye.$i=!0),Ie},Ie.locale=Se,Ie.isDayjs=Ee,Ie.unix=function(Ye){return Ie(1e3*Ye)},Ie.en=ve[me],Ie.Ls=ve,Ie.p={},Ie})})(dayjs_min$1);var dayjs_minExports=dayjs_min$1.exports;const dayjs=getDefaultExportFromCjs$1(dayjs_minExports);var lodash={exports:{}};/**
|
|
23
|
+
opacity: ${S-T*J}`}}const indexVars$G="",AbsTooltip_svelte_svelte_type_style_lang="";function create_if_block$2a(p){let u,f;return u=new Portal({props:{target:".spectrum",$$slots:{default:[create_default_slot$1U]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&132815&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_default_slot$1U(p){let u,f,m,v,y,w,k,S,M;return{c(){u=element("span"),f=element("span"),m=text$1(p[2]),v=space(),y=element("span"),attr(f,"class","spectrum-Tooltip-label svelte-9a74k9"),attr(y,"class","spectrum-Tooltip-tip svelte-9a74k9"),attr(y,"style",p[9]),attr(u,"class",w="spectrum-Tooltip spectrum-Tooltip--"+p[1]+" spectrum-Tooltip--"+p[0]+" is-open svelte-9a74k9"),attr(u,"style",k=`left:${p[6]}px;top:${p[7]}px;${p[10]}`),toggle_class(u,"noWrap",p[3])},m(T,E){insert(T,u,E),append$2(u,f),append$2(f,m),append$2(u,v),append$2(u,y),M=!0},p(T,E){(!M||E&4)&&set_data(m,T[2]),(!M||E&512)&&attr(y,"style",T[9]),(!M||E&3&&w!==(w="spectrum-Tooltip spectrum-Tooltip--"+T[1]+" spectrum-Tooltip--"+T[0]+" is-open svelte-9a74k9"))&&attr(u,"class",w),(!M||E&1216&&k!==(k=`left:${T[6]}px;top:${T[7]}px;${T[10]}`))&&attr(u,"style",k),(!M||E&11)&&toggle_class(u,"noWrap",T[3])},i(T){M||(T&&add_render_callback(()=>{M&&(S||(S=create_bidirectional_transition(u,fade,{duration:130},!0)),S.run(1))}),M=!0)},o(T){T&&(S||(S=create_bidirectional_transition(u,fade,{duration:130},!1)),S.run(0)),M=!1},d(T){T&&detach(u),T&&S&&S.end()}}}function create_fragment$3T(p){let u,f,m,v,y,w;const k=p[13].default,S=create_slot(k,p,p[17],null);let M=p[8]&&p[2]&&p[6]!=null&&p[7]!=null&&create_if_block$2a(p);return{c(){u=element("div"),S&&S.c(),f=space(),M&&M.c(),m=empty$1(),attr(u,"class","abs-tooltip svelte-9a74k9")},m(T,E){insert(T,u,E),S&&S.m(u,null),p[14](u),insert(T,f,E),M&&M.m(T,E),insert(T,m,E),v=!0,y||(w=[listen(u,"focus",null),listen(u,"mouseover",p[15]),listen(u,"mouseleave",p[16])],y=!0)},p(T,[E]){S&&S.p&&(!v||E&131072)&&update_slot_base(S,k,T,T[17],v?get_slot_changes(k,T[17],E,null):get_all_dirty_from_scope(T[17]),null),T[8]&&T[2]&&T[6]!=null&&T[7]!=null?M?(M.p(T,E),E&452&&transition_in(M,1)):(M=create_if_block$2a(T),M.c(),transition_in(M,1),M.m(m.parentNode,m)):M&&(group_outros(),transition_out(M,1,1,()=>{M=null}),check_outros())},i(T){v||(transition_in(S,T),transition_in(M),v=!0)},o(T){transition_out(S,T),transition_out(M),v=!1},d(T){T&&(detach(u),detach(f),detach(m)),S&&S.d(T),p[14](null),M&&M.d(T),y=!1,run_all(w)}}}const TooltipPosition={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},TooltipType={Default:"default",Info:"info",Positive:"positive",Negative:"negative"};function instance$3Q(p,u,f){let m,v,{$$slots:y={},$$scope:w}=u,{position:k=TooltipPosition.Top}=u,{type:S=TooltipType.Default}=u,{text:M=""}=u,{fixed:T=!1}=u,{color:E=""}=u,{noWrap:H=!1}=u,F,Z=!1,$,J,ae=!1,ie,he;const fe=()=>{var Ue;const Ie=(Ue=F==null?void 0:F.children)==null?void 0:Ue[0];if(!Ie){f(6,$=null),f(7,J=null);return}const xe=Ie.getBoundingClientRect();k===TooltipPosition.Top?(f(6,$=xe.left+xe.width/2),f(7,J=xe.top)):k===TooltipPosition.Right?(f(6,$=xe.left+xe.width),f(7,J=xe.top+xe.height/2)):k===TooltipPosition.Bottom?(f(6,$=xe.left+xe.width/2),f(7,J=xe.top+xe.height)):k===TooltipPosition.Left&&(f(6,$=xe.left),f(7,J=xe.top+xe.height/2))},me=()=>{fe(),he=setInterval(fe,100),f(8,ae=!0)},ve=()=>{clearTimeout(ie),clearInterval(he),f(8,ae=!1)};onDestroy(ve);function Ce(Ie){binding_callbacks[Ie?"unshift":"push"](()=>{F=Ie,f(5,F)})}const Ee=()=>f(4,Z=!0),Se=()=>f(4,Z=!1);return p.$$set=Ie=>{"position"in Ie&&f(0,k=Ie.position),"type"in Ie&&f(1,S=Ie.type),"text"in Ie&&f(2,M=Ie.text),"fixed"in Ie&&f(11,T=Ie.fixed),"color"in Ie&&f(12,E=Ie.color),"noWrap"in Ie&&f(3,H=Ie.noWrap),"$$scope"in Ie&&f(17,w=Ie.$$scope)},p.$$.update=()=>{p.$$.dirty&2064&&(Z||T?ie=setTimeout(me,200):ve()),p.$$.dirty&4096&&f(10,m=E?`background:${E};`:null),p.$$.dirty&4096&&f(9,v=E?`border-top-color:${E};`:null)},[k,S,M,H,Z,F,$,J,ae,v,m,T,E,y,Ce,Ee,Se,w]}class AbsTooltip extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3Q,create_fragment$3T,safe_not_equal,{position:0,type:1,text:2,fixed:11,color:12,noWrap:3})}}const Icon_svelte_svelte_type_style_lang$1="";function create_default_slot$1T(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=svg_element("svg"),m=svg_element("use"),set_style(m,"pointer-events","none"),xlink_attr(m,"xlink:href",v="#spectrum-icon-18-"+p[0]),attr(f,"class",y="spectrum-Icon spectrum-Icon--size"+p[2]+" svelte-10h2gx"),attr(f,"focusable","false"),attr(f,"aria-hidden",p[1]),attr(f,"aria-label",p[0]),attr(f,"style",w=`${p[5]?`color: ${p[5]};`:""} ${p[6]?`--hover-color: ${p[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`),toggle_class(f,"hoverable",p[3]),toggle_class(f,"disabled",p[4]),attr(u,"class","icon svelte-10h2gx"),toggle_class(u,"newStyles",p[12])},m(M,T){insert(M,u,T),append$2(u,f),append$2(f,m),k||(S=[listen(f,"contextmenu",p[13]),listen(f,"click",p[14])],k=!0)},p(M,T){T&1&&v!==(v="#spectrum-icon-18-"+M[0])&&xlink_attr(m,"xlink:href",v),T&4&&y!==(y="spectrum-Icon spectrum-Icon--size"+M[2]+" svelte-10h2gx")&&attr(f,"class",y),T&2&&attr(f,"aria-hidden",M[1]),T&1&&attr(f,"aria-label",M[0]),T&96&&w!==(w=`${M[5]?`color: ${M[5]};`:""} ${M[6]?`--hover-color: ${M[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`)&&attr(f,"style",w),T&12&&toggle_class(f,"hoverable",M[3]),T&20&&toggle_class(f,"disabled",M[4]),T&4096&&toggle_class(u,"newStyles",M[12])},d(M){M&&detach(u),k=!1,run_all(S)}}}function create_fragment$3S(p){let u,f;return u=new AbsTooltip({props:{text:p[7],type:p[9],position:p[8],color:p[10],noWrap:p[11],$$slots:{default:[create_default_slot$1T]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&128&&(y.text=m[7]),v&512&&(y.type=m[9]),v&256&&(y.position=m[8]),v&1024&&(y.color=m[10]),v&2048&&(y.noWrap=m[11]),v&36991&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3P(p,u,f){let{name:m="Add"}=u,{hidden:v=!1}=u,{size:y="M"}=u,{hoverable:w=!1}=u,{disabled:k=!1}=u,{color:S=void 0}=u,{hoverColor:M=void 0}=u,{tooltip:T=void 0}=u,{tooltipPosition:E=TooltipPosition.Bottom}=u,{tooltipType:H=TooltipType.Default}=u,{tooltipColor:F=void 0}=u,{tooltipWrap:Z=!0}=u,{newStyles:$=!1}=u;function J(ie){bubble.call(this,p,ie)}function ae(ie){bubble.call(this,p,ie)}return p.$$set=ie=>{"name"in ie&&f(0,m=ie.name),"hidden"in ie&&f(1,v=ie.hidden),"size"in ie&&f(2,y=ie.size),"hoverable"in ie&&f(3,w=ie.hoverable),"disabled"in ie&&f(4,k=ie.disabled),"color"in ie&&f(5,S=ie.color),"hoverColor"in ie&&f(6,M=ie.hoverColor),"tooltip"in ie&&f(7,T=ie.tooltip),"tooltipPosition"in ie&&f(8,E=ie.tooltipPosition),"tooltipType"in ie&&f(9,H=ie.tooltipType),"tooltipColor"in ie&&f(10,F=ie.tooltipColor),"tooltipWrap"in ie&&f(11,Z=ie.tooltipWrap),"newStyles"in ie&&f(12,$=ie.newStyles)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,J,ae]}let Icon$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3P,create_fragment$3S,safe_not_equal,{name:0,hidden:1,size:2,hoverable:3,disabled:4,color:5,hoverColor:6,tooltip:7,tooltipPosition:8,tooltipType:9,tooltipColor:10,tooltipWrap:11,newStyles:12})}};const TooltipWrapper_svelte_svelte_type_style_lang="";function create_if_block$29(p){let u,f,m;return f=new AbsTooltip({props:{text:p[0],$$slots:{default:[create_default_slot$1S]},$$scope:{ctx:p}}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","icon-container svelte-19tap7e")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y&1&&(w.text=v[0]),y&38&&(w.$$scope={dirty:y,ctx:v}),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_default_slot$1S(p){let u,f,m,v,y;return f=new Icon$1({props:{name:"InfoOutline",size:"S",disabled:p[2],hoverable:!0}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","icon svelte-19tap7e"),toggle_class(u,"icon-small",p[1]==="M"||p[1]==="S")},m(w,k){insert(w,u,k),mount_component(f,u,null),m=!0,v||(y=listen(u,"focus",p[4]),v=!0)},p(w,k){const S={};k&4&&(S.disabled=w[2]),f.$set(S),(!m||k&2)&&toggle_class(u,"icon-small",w[1]==="M"||w[1]==="S")},i(w){m||(transition_in(f.$$.fragment,w),m=!0)},o(w){transition_out(f.$$.fragment,w),m=!1},d(w){w&&detach(u),destroy_component(f),v=!1,y()}}}function create_fragment$3R(p){let u,f,m;const v=p[3].default,y=create_slot(v,p,p[5],null);let w=p[0]&&create_if_block$29(p);return{c(){u=element("div"),y&&y.c(),f=space(),w&&w.c(),attr(u,"class","svelte-19tap7e"),toggle_class(u,"container",!!p[0])},m(k,S){insert(k,u,S),y&&y.m(u,null),append$2(u,f),w&&w.m(u,null),m=!0},p(k,[S]){y&&y.p&&(!m||S&32)&&update_slot_base(y,v,k,k[5],m?get_slot_changes(v,k[5],S,null):get_all_dirty_from_scope(k[5]),null),k[0]?w?(w.p(k,S),S&1&&transition_in(w,1)):(w=create_if_block$29(k),w.c(),transition_in(w,1),w.m(u,null)):w&&(group_outros(),transition_out(w,1,1,()=>{w=null}),check_outros()),(!m||S&1)&&toggle_class(u,"container",!!k[0])},i(k){m||(transition_in(y,k),transition_in(w),m=!0)},o(k){transition_out(y,k),transition_out(w),m=!1},d(k){k&&detach(u),y&&y.d(k),w&&w.d()}}}function instance$3O(p,u,f){let{$$slots:m={},$$scope:v}=u,{tooltip:y=""}=u,{size:w="M"}=u,{disabled:k=!0}=u;function S(M){bubble.call(this,p,M)}return p.$$set=M=>{"tooltip"in M&&f(0,y=M.tooltip),"size"in M&&f(1,w=M.size),"disabled"in M&&f(2,k=M.disabled),"$$scope"in M&&f(5,v=M.$$scope)},[y,w,k,m,S,v]}class TooltipWrapper extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3O,create_fragment$3R,safe_not_equal,{tooltip:0,size:1,disabled:2})}}const FieldLabel_svelte_svelte_type_style_lang="";function create_default_slot$1R(p){let u,f=(p[1]||"")+"",m,v;return{c(){u=element("label"),m=text$1(f),attr(u,"for",p[0]),attr(u,"class",v=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${p[3]}`)+" svelte-dqoj9e")},m(y,w){insert(y,u,w),append$2(u,m)},p(y,w){w&2&&f!==(f=(y[1]||"")+"")&&set_data(m,f),w&1&&attr(u,"for",y[0]),w&8&&v!==(v=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${y[3]}`)+" svelte-dqoj9e")&&attr(u,"class",v)},d(y){y&&detach(u)}}}function create_fragment$3Q(p){let u,f;return u=new TooltipWrapper({props:{tooltip:p[2],size:"S",$$slots:{default:[create_default_slot$1R]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&4&&(y.tooltip=m[2]),v&43&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3N(p,u,f){let m,{forId:v}=u,{label:y}=u,{position:w="above"}=u,{tooltip:k=""}=u;return p.$$set=S=>{"forId"in S&&f(0,v=S.forId),"label"in S&&f(1,y=S.label),"position"in S&&f(4,w=S.position),"tooltip"in S&&f(2,k=S.tooltip)},p.$$.update=()=>{p.$$.dirty&16&&f(3,m=w==="above"?"":`spectrum-FieldLabel--${w}`)},[v,y,k,m,w]}class FieldLabel extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3N,create_fragment$3Q,safe_not_equal,{forId:0,label:1,position:4,tooltip:2})}}const Field_svelte_svelte_type_style_lang$1="";function create_if_block_2$H(p){let u,f;return u=new FieldLabel({props:{forId:p[0],label:p[1],position:p[2],tooltip:p[5]}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&1&&(y.forId=m[0]),v&2&&(y.label=m[1]),v&4&&(y.position=m[2]),v&32&&(y.tooltip=m[5]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_1$16(p){let u,f,m,v,y,w;return f=new Icon$1({props:{name:"HelpOutline"}}),{c(){u=element("div"),create_component(f.$$.fragment),m=space(),v=element("span"),y=text$1(p[4]),attr(v,"class","svelte-e52e9j"),attr(u,"class","helpText svelte-e52e9j")},m(k,S){insert(k,u,S),mount_component(f,u,null),append$2(u,m),append$2(u,v),append$2(v,y),w=!0},p(k,S){(!w||S&16)&&set_data(y,k[4])},i(k){w||(transition_in(f.$$.fragment,k),w=!0)},o(k){transition_out(f.$$.fragment,k),w=!1},d(k){k&&detach(u),destroy_component(f)}}}function create_if_block$28(p){let u,f;return{c(){u=element("div"),f=text$1(p[3]),attr(u,"class","error svelte-e52e9j")},m(m,v){insert(m,u,v),append$2(u,f)},p(m,v){v&8&&set_data(f,m[3])},i:noop$2,o:noop$2,d(m){m&&detach(u)}}}function create_fragment$3P(p){let u,f,m,v,y,w,k,S=p[1]&&create_if_block_2$H(p);const M=p[7].default,T=create_slot(M,p,p[6],null),E=[create_if_block$28,create_if_block_1$16],H=[];function F(Z,$){return Z[3]?0:Z[4]?1:-1}return~(y=F(p))&&(w=H[y]=E[y](p)),{c(){u=element("div"),S&&S.c(),f=space(),m=element("div"),T&&T.c(),v=space(),w&&w.c(),attr(m,"class","spectrum-Form-itemField svelte-e52e9j"),attr(u,"class","spectrum-Form-item svelte-e52e9j"),toggle_class(u,"above",p[2]==="above")},m(Z,$){insert(Z,u,$),S&&S.m(u,null),append$2(u,f),append$2(u,m),T&&T.m(m,null),append$2(m,v),~y&&H[y].m(m,null),k=!0},p(Z,[$]){Z[1]?S?(S.p(Z,$),$&2&&transition_in(S,1)):(S=create_if_block_2$H(Z),S.c(),transition_in(S,1),S.m(u,f)):S&&(group_outros(),transition_out(S,1,1,()=>{S=null}),check_outros()),T&&T.p&&(!k||$&64)&&update_slot_base(T,M,Z,Z[6],k?get_slot_changes(M,Z[6],$,null):get_all_dirty_from_scope(Z[6]),null);let J=y;y=F(Z),y===J?~y&&H[y].p(Z,$):(w&&(group_outros(),transition_out(H[J],1,1,()=>{H[J]=null}),check_outros()),~y?(w=H[y],w?w.p(Z,$):(w=H[y]=E[y](Z),w.c()),transition_in(w,1),w.m(m,null)):w=null),(!k||$&4)&&toggle_class(u,"above",Z[2]==="above")},i(Z){k||(transition_in(S),transition_in(T,Z),transition_in(w),k=!0)},o(Z){transition_out(S),transition_out(T,Z),transition_out(w),k=!1},d(Z){Z&&detach(u),S&&S.d(),T&&T.d(Z),~y&&H[y].d()}}}function instance$3M(p,u,f){let{$$slots:m={},$$scope:v}=u,{id:y=null}=u,{label:w=null}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{helpText:M=null}=u,{tooltip:T=""}=u;return p.$$set=E=>{"id"in E&&f(0,y=E.id),"label"in E&&f(1,w=E.label),"labelPosition"in E&&f(2,k=E.labelPosition),"error"in E&&f(3,S=E.error),"helpText"in E&&f(4,M=E.helpText),"tooltip"in E&&f(5,T=E.tooltip),"$$scope"in E&&f(6,v=E.$$scope)},[y,w,k,S,M,T,v,m]}let Field$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3M,create_fragment$3P,safe_not_equal,{id:0,label:1,labelPosition:2,error:3,helpText:4,tooltip:5})}};const indexVars$F="",TextField_svelte_svelte_type_style_lang="";function create_fragment$3O(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=element("input"),f.disabled=p[3],f.readOnly=p[5],attr(f,"id",p[4]),f.value=m=p[0]??"",attr(f,"placeholder",v=p[1]??""),attr(f,"type",p[2]),attr(f,"class","spectrum-Textfield-input svelte-1pznijr"),attr(f,"style",y=p[7]?`text-align: ${p[7]};`:""),attr(f,"inputmode",w=p[15](p[2])),attr(f,"autocomplete",p[8]),attr(u,"class","spectrum-Textfield svelte-1pznijr"),toggle_class(u,"spectrum-Textfield--quiet",p[6]),toggle_class(u,"is-disabled",p[3]),toggle_class(u,"is-focused",p[10])},m(M,T){insert(M,u,T),append$2(u,f),p[23](f),k||(S=[listen(f,"click",p[18]),listen(f,"blur",p[19]),listen(f,"focus",p[20]),listen(f,"input",p[21]),listen(f,"keyup",p[22]),listen(f,"blur",p[12]),listen(f,"focus",p[11]),listen(f,"input",p[13]),listen(f,"keyup",p[14])],k=!0)},p(M,[T]){T&8&&(f.disabled=M[3]),T&32&&(f.readOnly=M[5]),T&16&&attr(f,"id",M[4]),T&1&&m!==(m=M[0]??"")&&f.value!==m&&(f.value=m),T&2&&v!==(v=M[1]??"")&&attr(f,"placeholder",v),T&4&&attr(f,"type",M[2]),T&128&&y!==(y=M[7]?`text-align: ${M[7]};`:"")&&attr(f,"style",y),T&4&&w!==(w=M[15](M[2]))&&attr(f,"inputmode",w),T&256&&attr(f,"autocomplete",M[8]),T&64&&toggle_class(u,"spectrum-Textfield--quiet",M[6]),T&8&&toggle_class(u,"is-disabled",M[3]),T&1024&&toggle_class(u,"is-focused",M[10])},i:noop$2,o:noop$2,d(M){M&&detach(u),p[23](null),k=!1,run_all(S)}}}function instance$3L(p,u,f){let{value:m=null}=u,{placeholder:v=null}=u,{type:y="text"}=u,{disabled:w=!1}=u,{id:k=null}=u,{readonly:S=!1}=u,{updateOnChange:M=!0}=u,{quiet:T=!1}=u,{align:E}=u,{autofocus:H=!1}=u,{autocomplete:F=null}=u;const Z=createEventDispatcher();let $,J=!1;const ae=$e=>{if(!(S||w)){if(y==="number"){const Ye=parseFloat($e);$e=isNaN(Ye)?null:Ye}Z("change",$e)}},ie=()=>{S||w||f(10,J=!0)},he=$e=>{S||w||(f(10,J=!1),ae($e.target.value))},fe=$e=>{S||!M||w||ae($e.target.value)},me=$e=>{S||w||$e.key==="Enter"&&ae($e.target.value)},ve=$e=>$e==="bigint"?"numeric":$e==="number"?"decimal":"text";onMount(async()=>{w||(f(10,J=H),J&&(await tick(),$.focus()))});function Ce($e){bubble.call(this,p,$e)}function Ee($e){bubble.call(this,p,$e)}function Se($e){bubble.call(this,p,$e)}function Ie($e){bubble.call(this,p,$e)}function xe($e){bubble.call(this,p,$e)}function Ue($e){binding_callbacks[$e?"unshift":"push"](()=>{$=$e,f(9,$)})}return p.$$set=$e=>{"value"in $e&&f(0,m=$e.value),"placeholder"in $e&&f(1,v=$e.placeholder),"type"in $e&&f(2,y=$e.type),"disabled"in $e&&f(3,w=$e.disabled),"id"in $e&&f(4,k=$e.id),"readonly"in $e&&f(5,S=$e.readonly),"updateOnChange"in $e&&f(16,M=$e.updateOnChange),"quiet"in $e&&f(6,T=$e.quiet),"align"in $e&&f(7,E=$e.align),"autofocus"in $e&&f(17,H=$e.autofocus),"autocomplete"in $e&&f(8,F=$e.autocomplete)},[m,v,y,w,k,S,T,E,F,$,J,ie,he,fe,me,ve,M,H,Ce,Ee,Se,Ie,xe,Ue]}class TextField extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3L,create_fragment$3O,safe_not_equal,{value:0,placeholder:1,type:2,disabled:3,id:4,readonly:5,updateOnChange:16,quiet:6,align:7,autofocus:17,autocomplete:8})}}function create_default_slot$1Q(p){let u,f;return u=new TextField({props:{updateOnChange:p[8],error:p[7],disabled:p[5],readonly:p[6],value:p[0],placeholder:p[3],type:p[4],quiet:p[9],autofocus:p[10],autocomplete:p[11]}}),u.$on("change",p[13]),u.$on("click",p[14]),u.$on("input",p[15]),u.$on("blur",p[16]),u.$on("focus",p[17]),u.$on("keyup",p[18]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&256&&(y.updateOnChange=m[8]),v&128&&(y.error=m[7]),v&32&&(y.disabled=m[5]),v&64&&(y.readonly=m[6]),v&1&&(y.value=m[0]),v&8&&(y.placeholder=m[3]),v&16&&(y.type=m[4]),v&512&&(y.quiet=m[9]),v&1024&&(y.autofocus=m[10]),v&2048&&(y.autocomplete=m[11]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3N(p){let u,f;return u=new Field$1({props:{helpText:p[12],label:p[1],labelPosition:p[2],error:p[7],$$slots:{default:[create_default_slot$1Q]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&4096&&(y.helpText=m[12]),v&2&&(y.label=m[1]),v&4&&(y.labelPosition=m[2]),v&128&&(y.error=m[7]),v&1052665&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3K(p,u,f){let{value:m=null}=u,{label:v=null}=u,{labelPosition:y="above"}=u,{placeholder:w=null}=u,{type:k="text"}=u,{disabled:S=!1}=u,{readonly:M=!1}=u,{error:T=null}=u,{updateOnChange:E=!0}=u,{quiet:H=!1}=u,{autofocus:F}=u,{autocomplete:Z}=u,{helpText:$=null}=u;const J=createEventDispatcher(),ae=Ce=>{f(0,m=Ce.detail),J("change",Ce.detail)};function ie(Ce){bubble.call(this,p,Ce)}function he(Ce){bubble.call(this,p,Ce)}function fe(Ce){bubble.call(this,p,Ce)}function me(Ce){bubble.call(this,p,Ce)}function ve(Ce){bubble.call(this,p,Ce)}return p.$$set=Ce=>{"value"in Ce&&f(0,m=Ce.value),"label"in Ce&&f(1,v=Ce.label),"labelPosition"in Ce&&f(2,y=Ce.labelPosition),"placeholder"in Ce&&f(3,w=Ce.placeholder),"type"in Ce&&f(4,k=Ce.type),"disabled"in Ce&&f(5,S=Ce.disabled),"readonly"in Ce&&f(6,M=Ce.readonly),"error"in Ce&&f(7,T=Ce.error),"updateOnChange"in Ce&&f(8,E=Ce.updateOnChange),"quiet"in Ce&&f(9,H=Ce.quiet),"autofocus"in Ce&&f(10,F=Ce.autofocus),"autocomplete"in Ce&&f(11,Z=Ce.autocomplete),"helpText"in Ce&&f(12,$=Ce.helpText)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,ae,ie,he,fe,me,ve]}let Input$5=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3K,create_fragment$3N,safe_not_equal,{value:0,label:1,labelPosition:2,placeholder:3,type:4,disabled:5,readonly:6,error:7,updateOnChange:8,quiet:9,autofocus:10,autocomplete:11,helpText:12})}};const indexVars$E="",indexVars$D="",Stepper_svelte_svelte_type_style_lang="",TextArea_svelte_svelte_type_style_lang="";function create_fragment$3M(p){let u,f,m,v,y,w,k,S;return{c(){u=element("div"),f=element("textarea"),attr(f,"placeholder",m=p[1]||""),attr(f,"class","spectrum-Textfield-input svelte-1kmb9uq"),attr(f,"style",v=p[5]?`text-align: ${p[5]}`:""),f.disabled=p[2],f.readOnly=p[3],attr(f,"id",p[4]),f.value=y=p[0]||"",attr(u,"style",w=`${p[9]}${p[8]}`),attr(u,"class","spectrum-Textfield spectrum-Textfield--multiline svelte-1kmb9uq"),toggle_class(u,"is-disabled",p[2]),toggle_class(u,"is-focused",p[6])},m(M,T){insert(M,u,T),append$2(u,f),p[14](f),k||(S=[listen(f,"focus",p[15]),listen(f,"blur",p[10])],k=!0)},p(M,[T]){T&2&&m!==(m=M[1]||"")&&attr(f,"placeholder",m),T&32&&v!==(v=M[5]?`text-align: ${M[5]}`:"")&&attr(f,"style",v),T&4&&(f.disabled=M[2]),T&8&&(f.readOnly=M[3]),T&16&&attr(f,"id",M[4]),T&1&&y!==(y=M[0]||"")&&(f.value=y),T&768&&w!==(w=`${M[9]}${M[8]}`)&&attr(u,"style",w),T&4&&toggle_class(u,"is-disabled",M[2]),T&64&&toggle_class(u,"is-focused",M[6])},i:noop$2,o:noop$2,d(M){M&&detach(u),p[14](null),k=!1,run_all(S)}}}function instance$3J(p,u,f){let m,v,{value:y=""}=u,{placeholder:w=null}=u,{disabled:k=!1}=u,{readonly:S=!1}=u,{id:M=null}=u,{height:T=null}=u,{minHeight:E=null}=u;const H=()=>({start:$.selectionStart,end:$.selectionEnd});let{align:F=null}=u,Z=!1,$;const J=createEventDispatcher(),ae=me=>{J("change",me.target.value),f(6,Z=!1)},ie=(me,ve)=>!me||ve==null?"":isNaN(ve)?`${me}:${ve};`:`${me}:${ve}px;`;function he(me){binding_callbacks[me?"unshift":"push"](()=>{$=me,f(7,$)})}const fe=()=>f(6,Z=!0);return p.$$set=me=>{"value"in me&&f(0,y=me.value),"placeholder"in me&&f(1,w=me.placeholder),"disabled"in me&&f(2,k=me.disabled),"readonly"in me&&f(3,S=me.readonly),"id"in me&&f(4,M=me.id),"height"in me&&f(11,T=me.height),"minHeight"in me&&f(12,E=me.minHeight),"align"in me&&f(5,F=me.align)},p.$$.update=()=>{p.$$.dirty&2048&&f(9,m=ie("height",T)),p.$$.dirty&4096&&f(8,v=ie("min-height",E))},[y,w,k,S,M,F,Z,$,v,m,ae,T,E,H,he,fe]}class TextArea extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3J,create_fragment$3M,safe_not_equal,{value:0,placeholder:1,disabled:2,readonly:3,id:4,height:11,minHeight:12,getCaretPosition:13,align:5})}get getCaretPosition(){return this.$$.ctx[13]}}const indexVars$C="",indexVars$B="",indexVars$A="",ignoredClasses=[".download-js-link",".spectrum-Menu",".date-time-popover"],conditionallyIgnoredClasses=[".spectrum-Underlay",".drawer-wrapper",".spectrum-Popover"];let clickHandlers=[],candidateTarget;const handleClick=p=>{if(!p.target.closest('[data-ignore-click-outside="true"]')){for(let u of ignoredClasses)if(p.target.closest(u))return;clickHandlers.forEach(u=>{var f;if(!u.element.contains(p.target)){for(let m of conditionallyIgnoredClasses){const v=u.anchor.closest(m)!=null;if(p.target.closest(m)!=null&&!v)return}(f=u.callback)==null||f.call(u,p)}})}},handleMouseUp=p=>{candidateTarget===p.target&&handleClick(p),candidateTarget=null},handleMouseDown=p=>{p.button===0&&(candidateTarget=p.target,document.removeEventListener("click",handleMouseUp),document.addEventListener("click",handleMouseUp,!0))};document.addEventListener("mousedown",handleMouseDown),document.addEventListener("contextmenu",handleClick);const updateHandler=(p,u,f,m)=>{let v=clickHandlers.find(y=>y.id===p);v?v.callback=m:clickHandlers.push({id:p,element:u,anchor:f,callback:m})},removeHandler=p=>{clickHandlers=clickHandlers.filter(u=>u.id!==p)},clickOutside=(p,u)=>{const f=Math.random(),m=v=>{const y=(v==null?void 0:v.callback)||(typeof v=="function"?v:null),w=(v==null?void 0:v.anchor)||p;updateHandler(f,p,w,y)};return m(u),{update:m,destroy:()=>removeHandler(f)}},indexVars$z="",Search_svelte_svelte_type_style_lang="";function create_fragment$3L(p){let u,f,m,v,y,w,k,S,M,T,E,H;return{c(){u=element("div"),f=element("div"),m=svg_element("svg"),v=svg_element("use"),y=space(),w=element("input"),M=space(),T=element("button"),T.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-Cross75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Cross75"></use></svg>',xlink_attr(v,"xlink:href","#spectrum-icon-18-Magnify"),attr(m,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-icon"),attr(m,"focusable","false"),attr(m,"aria-hidden","true"),w.disabled=p[3],attr(w,"id",p[4]),w.value=k=p[1]||"",attr(w,"placeholder",S=p[2]||""),attr(w,"type","search"),attr(w,"class","spectrum-Textfield-input spectrum-Search-input svelte-d7zw73"),attr(w,"autocomplete","off"),attr(f,"class","spectrum-Textfield svelte-d7zw73"),toggle_class(f,"spectrum-Textfield--quiet",p[5]),toggle_class(f,"is-focused",p[6]),toggle_class(f,"is-disabled",p[3]),attr(T,"type","reset"),attr(T,"class","spectrum-ClearButton spectrum-Search-clearButton svelte-d7zw73"),attr(u,"class","spectrum-Search svelte-d7zw73"),toggle_class(u,"is-disabled",p[3])},m(F,Z){insert(F,u,Z),append$2(u,f),append$2(f,m),append$2(m,v),append$2(f,y),append$2(f,w),p[17](w),append$2(u,M),append$2(u,T),E||(H=[listen(w,"click",p[13]),listen(w,"blur",p[14]),listen(w,"focus",p[15]),listen(w,"input",p[16]),listen(w,"blur",p[9]),listen(w,"focus",p[8]),listen(w,"input",p[10]),listen(w,"keyup",p[11]),listen(T,"click",p[18])],E=!0)},p(F,[Z]){Z&8&&(w.disabled=F[3]),Z&16&&attr(w,"id",F[4]),Z&2&&k!==(k=F[1]||"")&&w.value!==k&&(w.value=k),Z&4&&S!==(S=F[2]||"")&&attr(w,"placeholder",S),Z&32&&toggle_class(f,"spectrum-Textfield--quiet",F[5]),Z&64&&toggle_class(f,"is-focused",F[6]),Z&8&&toggle_class(f,"is-disabled",F[3]),Z&8&&toggle_class(u,"is-disabled",F[3])},i:noop$2,o:noop$2,d(F){F&&detach(u),p[17](null),E=!1,run_all(H)}}}function instance$3I(p,u,f){let{value:m=null}=u,{placeholder:v=null}=u,{disabled:y=!1}=u,{id:w=null}=u,{updateOnChange:k=!0}=u,{quiet:S=!1}=u,{inputRef:M}=u;const T=createEventDispatcher();let E=!1;const H=Ce=>{T("change",Ce)},F=()=>{f(6,E=!0)},Z=Ce=>{f(6,E=!1),H(Ce.target.value)},$=Ce=>{k&&H(Ce.target.value)},J=Ce=>{Ce.key==="Enter"&&H(Ce.target.value)};function ae(Ce){bubble.call(this,p,Ce)}function ie(Ce){bubble.call(this,p,Ce)}function he(Ce){bubble.call(this,p,Ce)}function fe(Ce){bubble.call(this,p,Ce)}function me(Ce){binding_callbacks[Ce?"unshift":"push"](()=>{M=Ce,f(0,M)})}const ve=()=>H("");return p.$$set=Ce=>{"value"in Ce&&f(1,m=Ce.value),"placeholder"in Ce&&f(2,v=Ce.placeholder),"disabled"in Ce&&f(3,y=Ce.disabled),"id"in Ce&&f(4,w=Ce.id),"updateOnChange"in Ce&&f(12,k=Ce.updateOnChange),"quiet"in Ce&&f(5,S=Ce.quiet),"inputRef"in Ce&&f(0,M=Ce.inputRef)},[M,m,v,y,w,S,E,H,F,Z,$,J,k,ae,ie,he,fe,me,ve]}class Search extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3I,create_fragment$3L,safe_not_equal,{value:1,placeholder:2,disabled:3,id:4,updateOnChange:12,quiet:5,inputRef:0})}}const indexVars$y="",StatusLight_svelte_svelte_type_style_lang="";function create_fragment$3K(p){let u,f,m,v,y,w;const k=p[21].default,S=create_slot(k,p,p[20],null);return{c(){u=element("div"),S&&S.c(),attr(u,"class",f="spectrum-StatusLight spectrum-StatusLight--size"+p[0]+" svelte-1wk2ay6"),attr(u,"style",m=`--color: ${p[16]??"var(--spectrum-global-color-gray-400)"};`),toggle_class(u,"custom",!!p[16]),toggle_class(u,"square",p[17]),toggle_class(u,"hoverable",p[18]),toggle_class(u,"spectrum-StatusLight--celery",p[1]),toggle_class(u,"spectrum-StatusLight--yellow",p[2]),toggle_class(u,"spectrum-StatusLight--fuchsia",p[3]),toggle_class(u,"spectrum-StatusLight--indigo",p[4]),toggle_class(u,"spectrum-StatusLight--seafoam",p[5]),toggle_class(u,"spectrum-StatusLight--chartreuse",p[6]),toggle_class(u,"spectrum-StatusLight--magenta",p[7]),toggle_class(u,"spectrum-StatusLight--purple",p[8]),toggle_class(u,"spectrum-StatusLight--neutral",p[9]),toggle_class(u,"spectrum-StatusLight--info",p[10]),toggle_class(u,"spectrum-StatusLight--positive",p[11]),toggle_class(u,"spectrum-StatusLight--notice",p[12]),toggle_class(u,"spectrum-StatusLight--negative",p[13]),toggle_class(u,"spectrum-StatusLight--disabled",p[14]),toggle_class(u,"spectrum-StatusLight--active",p[15]),toggle_class(u,"withText",!!p[19].default)},m(M,T){insert(M,u,T),S&&S.m(u,null),v=!0,y||(w=listen(u,"click",p[22]),y=!0)},p(M,[T]){S&&S.p&&(!v||T&1048576)&&update_slot_base(S,k,M,M[20],v?get_slot_changes(k,M[20],T,null):get_all_dirty_from_scope(M[20]),null),(!v||T&1&&f!==(f="spectrum-StatusLight spectrum-StatusLight--size"+M[0]+" svelte-1wk2ay6"))&&attr(u,"class",f),(!v||T&65536&&m!==(m=`--color: ${M[16]??"var(--spectrum-global-color-gray-400)"};`))&&attr(u,"style",m),(!v||T&65537)&&toggle_class(u,"custom",!!M[16]),(!v||T&131073)&&toggle_class(u,"square",M[17]),(!v||T&262145)&&toggle_class(u,"hoverable",M[18]),(!v||T&3)&&toggle_class(u,"spectrum-StatusLight--celery",M[1]),(!v||T&5)&&toggle_class(u,"spectrum-StatusLight--yellow",M[2]),(!v||T&9)&&toggle_class(u,"spectrum-StatusLight--fuchsia",M[3]),(!v||T&17)&&toggle_class(u,"spectrum-StatusLight--indigo",M[4]),(!v||T&33)&&toggle_class(u,"spectrum-StatusLight--seafoam",M[5]),(!v||T&65)&&toggle_class(u,"spectrum-StatusLight--chartreuse",M[6]),(!v||T&129)&&toggle_class(u,"spectrum-StatusLight--magenta",M[7]),(!v||T&257)&&toggle_class(u,"spectrum-StatusLight--purple",M[8]),(!v||T&513)&&toggle_class(u,"spectrum-StatusLight--neutral",M[9]),(!v||T&1025)&&toggle_class(u,"spectrum-StatusLight--info",M[10]),(!v||T&2049)&&toggle_class(u,"spectrum-StatusLight--positive",M[11]),(!v||T&4097)&&toggle_class(u,"spectrum-StatusLight--notice",M[12]),(!v||T&8193)&&toggle_class(u,"spectrum-StatusLight--negative",M[13]),(!v||T&16385)&&toggle_class(u,"spectrum-StatusLight--disabled",M[14]),(!v||T&32769)&&toggle_class(u,"spectrum-StatusLight--active",M[15]),(!v||T&524289)&&toggle_class(u,"withText",!!M[19].default)},i(M){v||(transition_in(S,M),v=!0)},o(M){transition_out(S,M),v=!1},d(M){M&&detach(u),S&&S.d(M),y=!1,w()}}}function instance$3H(p,u,f){let{$$slots:m={},$$scope:v}=u;const y=compute_slots(m);let{size:w="M"}=u,{celery:k=!1}=u,{yellow:S=!1}=u,{fuchsia:M=!1}=u,{indigo:T=!1}=u,{seafoam:E=!1}=u,{chartreuse:H=!1}=u,{magenta:F=!1}=u,{purple:Z=!1}=u,{neutral:$=!1}=u,{info:J=!1}=u,{positive:ae=!1}=u,{notice:ie=!1}=u,{negative:he=!1}=u,{disabled:fe=!1}=u,{active:me=!1}=u,{color:ve=null}=u,{square:Ce=!1}=u,{hoverable:Ee=!1}=u;function Se(Ie){bubble.call(this,p,Ie)}return p.$$set=Ie=>{"size"in Ie&&f(0,w=Ie.size),"celery"in Ie&&f(1,k=Ie.celery),"yellow"in Ie&&f(2,S=Ie.yellow),"fuchsia"in Ie&&f(3,M=Ie.fuchsia),"indigo"in Ie&&f(4,T=Ie.indigo),"seafoam"in Ie&&f(5,E=Ie.seafoam),"chartreuse"in Ie&&f(6,H=Ie.chartreuse),"magenta"in Ie&&f(7,F=Ie.magenta),"purple"in Ie&&f(8,Z=Ie.purple),"neutral"in Ie&&f(9,$=Ie.neutral),"info"in Ie&&f(10,J=Ie.info),"positive"in Ie&&f(11,ae=Ie.positive),"notice"in Ie&&f(12,ie=Ie.notice),"negative"in Ie&&f(13,he=Ie.negative),"disabled"in Ie&&f(14,fe=Ie.disabled),"active"in Ie&&f(15,me=Ie.active),"color"in Ie&&f(16,ve=Ie.color),"square"in Ie&&f(17,Ce=Ie.square),"hoverable"in Ie&&f(18,Ee=Ie.hoverable),"$$scope"in Ie&&f(20,v=Ie.$$scope)},[w,k,S,M,T,E,H,F,Z,$,J,ae,ie,he,fe,me,ve,Ce,Ee,y,v,m,Se]}class StatusLight extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3H,create_fragment$3K,safe_not_equal,{size:0,celery:1,yellow:2,fuchsia:3,indigo:4,seafoam:5,chartreuse:6,magenta:7,purple:8,neutral:9,info:10,positive:11,notice:12,negative:13,disabled:14,active:15,color:16,square:17,hoverable:18})}}function positionDropdown(p,u){let f,m=u;const v=()=>y(m),y=k=>{const{anchor:S,align:M,maxHeight:T,maxWidth:E,minWidth:H,useAnchorWidth:F,offset:Z=5,customUpdate:$,resizable:J,wrap:ae}=k;if(!S)return;const ie=S.getBoundingClientRect(),he=p.getBoundingClientRect(),fe=window.innerWidth,me=window.innerHeight,ve=8;let Ce={maxHeight:T,minWidth:F?ie.width:H,maxWidth:F?ie.width:E,left:0,top:0};if(typeof $=="function")Ce=$(ie,he,{...Ce,offset:k.offset});else{const Ee=()=>Ce.left+he.width>fe&&ie.left>fe-ie.right,Se=()=>Ce.top+he.height>me&&ie.top>me-ie.bottom,Ie=$e=>{!Ce.maxHeight&&J&&(Ce.maxHeight=$e)},xe=$e=>{switch($e){case"StartToStart":default:Ce.left=ie.left;break;case"EndToEnd":Ce.left=ie.right-he.width;break;case"StartToEnd":Ce.left=ie.right+Z;break;case"EndToStart":Ce.left=ie.left-he.width-Z;break;case"MidPoint":Ce.left=ie.left+ie.width/2-he.width/2;break;case"ScreenEdge":Ce.left=fe-he.width-ve;break}},Ue=$e=>{switch($e){case"StartToStart":Ce.top=ie.top,Ie(me-ie.top-ve);break;case"EndToEnd":Ce.top=ie.bottom-he.height,Ie(ie.bottom-ve);break;case"StartToEnd":default:Ce.top=ie.bottom+Z,Ie(me-ie.bottom-ve);break;case"EndToStart":Ce.top=ie.top-he.height-Z,Ie(ie.top-ve);break;case"MidPoint":Ce.top=ie.top+ie.height/2-he.height/2;break;case"ScreenEdge":Ce.top=me-he.height-ve,Ie(me-2*ve);break}};xe(M==="right"?"EndToEnd":M==="right-outside"||M==="right-context-menu"?"StartToEnd":M==="left-outside"||M==="left-context-menu"?"EndToStart":M==="center"?"MidPoint":"StartToStart"),M==="right-outside"||M==="left-outside"?Ue("MidPoint"):M==="right-context-menu"||M==="left-context-menu"?(Ue("StartToStart"),Ce.top&&(Ce.top-=5)):Ue("StartToEnd"),Ee()&&(M==="left"?xe("EndToEnd"):M==="right-outside"&&xe("EndToStart")),Se()&&(ae?(Ue("MidPoint"),Se()&&Ue("ScreenEdge"),xe("StartToEnd"),Ee()&&xe("EndToStart")):Ue(M==="left-outside"||M==="right-outside"?"ScreenEdge":"EndToStart"))}for(const[Ee,Se]of Object.entries(Ce)){const Ie=Ee;Se!=null?p.style[Ie]=`${Se}px`:p.style[Ie]=""}},w=k=>{m=k,f&&f.disconnect();const{anchor:S}=k;S&&(f=new ResizeObserver(()=>y(k)),f.observe(S),f.observe(p),f.observe(document.body))};return p.style.position="fixed",p.style.zIndex="9999",document.addEventListener("scroll",v,!0),w(u),{update:w,destroy(){f&&f.disconnect(),document.removeEventListener("scroll",v,!0)}}}const Context$1={Modal:"bbui-modal",PopoverRoot:"bbui-popover-root"},Popover_svelte_svelte_type_style_lang="";function create_if_block$27(p){let u,f;return u=new Portal({props:{target:p[17],$$slots:{default:[create_default_slot$1P]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&131072&&(y.target=m[17]),v&537001982&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_default_slot$1P(p){let u,f,m,v,y,w,k;const S=p[26].default,M=create_slot(S,p,p[29],null);return{c(){u=element("div"),M&&M.c(),attr(u,"tabindex","0"),attr(u,"class","spectrum-Popover is-open svelte-1uiag1x"),attr(u,"role","presentation"),set_style(u,"height",p[9]),set_style(u,"--customZindex",p[11]),toggle_class(u,"customZindex",p[11]),toggle_class(u,"hidden",!p[13]),toggle_class(u,"blockPointerEvents",p[16])},m(T,E){insert(T,u,E),M&&M.m(u,null),y=!0,w||(k=[action_destroyer(f=positionDropdown.call(null,u,{anchor:p[1],align:p[2],maxHeight:p[5],maxWidth:p[4],minWidth:p[3],useAnchorWidth:p[6],offset:p[8],customUpdate:p[12],resizable:p[14],wrap:p[15]})),action_destroyer(m=clickOutside.call(null,u,{callback:p[7]?p[18]:clickOutside_function,anchor:p[1]})),listen(u,"keydown",p[19]),listen(u,"mouseenter",p[27]),listen(u,"mouseleave",p[28])],w=!0)},p(T,E){p=T,M&&M.p&&(!y||E&536870912)&&update_slot_base(M,S,p,p[29],y?get_slot_changes(S,p[29],E,null):get_all_dirty_from_scope(p[29]),null),(!y||E&512)&&set_style(u,"height",p[9]),(!y||E&2048)&&set_style(u,"--customZindex",p[11]),f&&is_function(f.update)&&E&53630&&f.update.call(null,{anchor:p[1],align:p[2],maxHeight:p[5],maxWidth:p[4],minWidth:p[3],useAnchorWidth:p[6],offset:p[8],customUpdate:p[12],resizable:p[14],wrap:p[15]}),m&&is_function(m.update)&&E&130&&m.update.call(null,{callback:p[7]?p[18]:clickOutside_function,anchor:p[1]}),(!y||E&2048)&&toggle_class(u,"customZindex",p[11]),(!y||E&8192)&&toggle_class(u,"hidden",!p[13]),(!y||E&65536)&&toggle_class(u,"blockPointerEvents",p[16])},i(T){y||(transition_in(M,T),T&&add_render_callback(()=>{y&&(v||(v=create_bidirectional_transition(u,fly,{y:-20,duration:p[10]?animationDuration:0},!0)),v.run(1))}),y=!0)},o(T){transition_out(M,T),T&&(v||(v=create_bidirectional_transition(u,fly,{y:-20,duration:p[10]?animationDuration:0},!1)),v.run(0)),y=!1},d(T){T&&detach(u),M&&M.d(T),T&&v&&v.end(),w=!1,run_all(k)}}}function create_fragment$3J(p){let u,f,m=p[0]&&create_if_block$27(p);return{c(){m&&m.c(),u=empty$1()},m(v,y){m&&m.m(v,y),insert(v,u,y),f=!0},p(v,[y]){v[0]?m?(m.p(v,y),y&1&&transition_in(m,1)):(m=create_if_block$27(v),m.c(),transition_in(m,1),m.m(u.parentNode,u)):m&&(group_outros(),transition_out(m,1,1,()=>{m=null}),check_outros())},i(v){f||(transition_in(m),f=!0)},o(v){transition_out(m),f=!1},d(v){v&&detach(u),m&&m.d(v)}}}const animationDuration=260,clickOutside_function=()=>{};function instance$3G(p,u,f){let m,{$$slots:v={},$$scope:y}=u;const w=createEventDispatcher();let{anchor:k}=u,{align:S="right"}=u,{portalTarget:M=void 0}=u,{minWidth:T=void 0}=u,{maxWidth:E=void 0}=u,{maxHeight:H=void 0}=u,{open:F=!1}=u,{useAnchorWidth:Z=!1}=u,{dismissible:$=!0}=u,{offset:J=4}=u,{customHeight:ae=void 0}=u,{animate:ie=!0}=u,{customZindex:he=void 0}=u,{handlePostionUpdate:fe=void 0}=u,{showPopover:me=!0}=u,{clickOutsideOverride:ve=!1}=u,{resizable:Ce=!0}=u,{wrap:Ee=!1}=u,Se,Ie=!1;const xe=()=>{w("open"),f(0,F=!0)},Ue=()=>{w("close"),f(0,F=!1)},$e=()=>{F?Ue():xe()},Ye=Ne=>{if(!ve&&F){let Je=Ne.target,ft=!1;for(;!ft&&Je&&Je.parentNode;)ft=Je===k,Je=Je.parentNode;ft&&Ne.stopPropagation(),Ue()}},be=Ne=>{ve&&F&&Ne.key==="Escape"&&Ue()};onDestroy(()=>{clearTimeout(Se)});function Be(Ne){bubble.call(this,p,Ne)}function Xe(Ne){bubble.call(this,p,Ne)}return p.$$set=Ne=>{"anchor"in Ne&&f(1,k=Ne.anchor),"align"in Ne&&f(2,S=Ne.align),"portalTarget"in Ne&&f(20,M=Ne.portalTarget),"minWidth"in Ne&&f(3,T=Ne.minWidth),"maxWidth"in Ne&&f(4,E=Ne.maxWidth),"maxHeight"in Ne&&f(5,H=Ne.maxHeight),"open"in Ne&&f(0,F=Ne.open),"useAnchorWidth"in Ne&&f(6,Z=Ne.useAnchorWidth),"dismissible"in Ne&&f(7,$=Ne.dismissible),"offset"in Ne&&f(8,J=Ne.offset),"customHeight"in Ne&&f(9,ae=Ne.customHeight),"animate"in Ne&&f(10,ie=Ne.animate),"customZindex"in Ne&&f(11,he=Ne.customZindex),"handlePostionUpdate"in Ne&&f(12,fe=Ne.handlePostionUpdate),"showPopover"in Ne&&f(13,me=Ne.showPopover),"clickOutsideOverride"in Ne&&f(21,ve=Ne.clickOutsideOverride),"resizable"in Ne&&f(14,Ce=Ne.resizable),"wrap"in Ne&&f(15,Ee=Ne.wrap),"$$scope"in Ne&&f(29,y=Ne.$$scope)},p.$$.update=()=>{p.$$.dirty&1048576&&f(17,m=M||getContext$1(Context$1.PopoverRoot)||".spectrum"),p.$$.dirty&33555457&&F&&ie&&(f(16,Ie=!0),clearTimeout(Se),f(25,Se=setTimeout(()=>{f(16,Ie=!1)},animationDuration/2)))},[F,k,S,T,E,H,Z,$,J,ae,ie,he,fe,me,Ce,Ee,Ie,m,Ye,be,M,ve,xe,Ue,$e,Se,v,Be,Xe,y]}class Popover extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3G,create_fragment$3J,safe_not_equal,{anchor:1,align:2,portalTarget:20,minWidth:3,maxWidth:4,maxHeight:5,open:0,useAnchorWidth:6,dismissible:7,offset:8,customHeight:9,animate:10,customZindex:11,handlePostionUpdate:12,showPopover:13,clickOutsideOverride:21,resizable:14,wrap:15,show:22,hide:23,toggle:24})}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}}const indexVars$x="",Tags_svelte_svelte_type_style_lang="";function create_fragment$3I(p){let u,f;const m=p[1].default,v=create_slot(m,p,p[0],null);return{c(){u=element("div"),v&&v.c(),attr(u,"class","spectrum-Tags svelte-17cj8k0"),attr(u,"role","list"),attr(u,"aria-label","list")},m(y,w){insert(y,u,w),v&&v.m(u,null),f=!0},p(y,[w]){v&&v.p&&(!f||w&1)&&update_slot_base(v,m,y,y[0],f?get_slot_changes(m,y[0],w,null):get_all_dirty_from_scope(y[0]),null)},i(y){f||(transition_in(v,y),f=!0)},o(y){transition_out(v,y),f=!1},d(y){y&&detach(u),v&&v.d(y)}}}function instance$3F(p,u,f){let{$$slots:m={},$$scope:v}=u;return p.$$set=y=>{"$$scope"in y&&f(0,v=y.$$scope)},[v,m]}class Tags extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3F,create_fragment$3I,safe_not_equal,{})}}const indexVars$w="",Avatar_svelte_svelte_type_style_lang="";function create_else_block$F(p){let u,f=(p[3]||"")+"",m;return{c(){u=element("div"),m=text$1(f),attr(u,"class","spectrum-Avatar svelte-xutedg"),attr(u,"style",p[4]),toggle_class(u,"is-disabled",p[2])},m(v,y){insert(v,u,y),append$2(u,m)},p(v,y){y&8&&f!==(f=(v[3]||"")+"")&&set_data(m,f),y&16&&attr(u,"style",v[4]),y&4&&toggle_class(u,"is-disabled",v[2])},d(v){v&&detach(u)}}}function create_if_block$26(p){let u,f;return{c(){u=element("img"),attr(u,"class","spectrum-Avatar"),src_url_equal(u.src,f=p[1])||attr(u,"src",f),attr(u,"alt","Avatar"),set_style(u,"width","var("+p[5].get(p[0])+")"),set_style(u,"height","var("+p[5].get(p[0])+")"),toggle_class(u,"is-disabled",p[2])},m(m,v){insert(m,u,v)},p(m,v){v&2&&!src_url_equal(u.src,f=m[1])&&attr(u,"src",f),v&1&&set_style(u,"width","var("+m[5].get(m[0])+")"),v&1&&set_style(u,"height","var("+m[5].get(m[0])+")"),v&4&&toggle_class(u,"is-disabled",m[2])},d(m){m&&detach(u)}}}function create_fragment$3H(p){let u;function f(y,w){return y[1]?create_if_block$26:create_else_block$F}let m=f(p),v=m(p);return{c(){v.c(),u=empty$1()},m(y,w){v.m(y,w),insert(y,u,w)},p(y,[w]){m===(m=f(y))&&v?v.p(y,w):(v.d(1),v=m(y),v&&(v.c(),v.m(u.parentNode,u)))},i:noop$2,o:noop$2,d(y){y&&detach(u),v.d(y)}}}const DefaultColor="#3aab87";function instance$3E(p,u,f){let m,v,y=new Map([["XXS","--spectrum-alias-avatar-size-50"],["XS","--spectrum-alias-avatar-size-75"],["S","--spectrum-alias-avatar-size-200"],["M","--spectrum-alias-avatar-size-400"],["L","--spectrum-alias-avatar-size-500"],["XL","--spectrum-alias-avatar-size-600"],["XXL","--spectrum-alias-avatar-size-700"]]),{size:w="M"}=u,{url:k=""}=u,{disabled:S=!1}=u,{initials:M="JD"}=u,{color:T=null}=u;const E=F=>F!=null&&F.length?`hsl(${F[0].toLowerCase().charCodeAt(0)%26/26*360}, 50%, 50%)`:DefaultColor,H=(F,Z)=>{const $=`var(${y.get(F)})`,J=`calc(${$} / 2)`;return`width:${$}; height:${$}; font-size:${J}; background:${Z};`};return p.$$set=F=>{"size"in F&&f(0,w=F.size),"url"in F&&f(1,k=F.url),"disabled"in F&&f(2,S=F.disabled),"initials"in F&&f(3,M=F.initials),"color"in F&&f(6,T=F.color)},p.$$.update=()=>{p.$$.dirty&72&&f(7,m=T||E(M)),p.$$.dirty&129&&f(4,v=H(w,m))},[w,k,S,M,v,y,T,m]}class Avatar extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3E,create_fragment$3H,safe_not_equal,{size:0,url:1,disabled:2,initials:3,color:6})}}function create_fragment$3G(p){let u,f,m,v,y;return{c(){u=element("button"),f=svg_element("svg"),m=svg_element("use"),xlink_attr(m,"xlink:href","#spectrum-css-icon-Cross75"),attr(f,"class","spectrum-Icon spectrum-UIIcon-Cross75"),attr(f,"focusable","false"),attr(f,"aria-hidden","true"),attr(u,"class","spectrum-ClearButton"),u.disabled=p[1],toggle_class(u,"spectrum-ClearButton--small",p[0])},m(w,k){insert(w,u,k),append$2(u,f),append$2(f,m),v||(y=listen(u,"click",p[2]),v=!0)},p(w,[k]){k&2&&(u.disabled=w[1]),k&1&&toggle_class(u,"spectrum-ClearButton--small",w[0])},i:noop$2,o:noop$2,d(w){w&&detach(u),v=!1,y()}}}function instance$3D(p,u,f){let{small:m=!1}=u,{disabled:v}=u;function y(w){bubble.call(this,p,w)}return p.$$set=w=>{"small"in w&&f(0,m=w.small),"disabled"in w&&f(1,v=w.disabled)},[m,v,y]}class ClearButton extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3D,create_fragment$3G,safe_not_equal,{small:0,disabled:1})}}const Tag_svelte_svelte_type_style_lang$1="";function create_if_block_2$G(p){let u,f;return u=new Avatar({props:{url:p[1]}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&2&&(y.url=m[1]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_1$15(p){let u,f,m;return{c(){u=svg_element("svg"),f=svg_element("use"),xlink_attr(f,"xlink:href",m="#spectrum-icon-24-"+p[0]),attr(u,"class","spectrum-Icon spectrum-Icon--sizeS"),attr(u,"focusable","false"),attr(u,"aria-hidden","true"),attr(u,"aria-label","Tag")},m(v,y){insert(v,u,y),append$2(u,f)},p(v,y){y&1&&m!==(m="#spectrum-icon-24-"+v[0])&&xlink_attr(f,"xlink:href",m)},d(v){v&&detach(u)}}}function create_if_block$25(p){let u,f;return u=new ClearButton({}),u.$on("click",p[7]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3F(p){let u,f,m,v,y,w,k=p[1]&&create_if_block_2$G(p),S=p[0]&&create_if_block_1$15(p);const M=p[6].default,T=create_slot(M,p,p[5],null);let E=p[4]&&create_if_block$25(p);return{c(){u=element("div"),k&&k.c(),f=space(),S&&S.c(),m=space(),v=element("span"),T&&T.c(),y=space(),E&&E.c(),attr(v,"class","spectrum-Tags-itemLabel"),attr(u,"class","spectrum-Tags-item svelte-16fqld8"),attr(u,"role","listitem"),toggle_class(u,"is-invalid",p[2]),toggle_class(u,"is-disabled",p[3])},m(H,F){insert(H,u,F),k&&k.m(u,null),append$2(u,f),S&&S.m(u,null),append$2(u,m),append$2(u,v),T&&T.m(v,null),append$2(u,y),E&&E.m(u,null),w=!0},p(H,[F]){H[1]?k?(k.p(H,F),F&2&&transition_in(k,1)):(k=create_if_block_2$G(H),k.c(),transition_in(k,1),k.m(u,f)):k&&(group_outros(),transition_out(k,1,1,()=>{k=null}),check_outros()),H[0]?S?S.p(H,F):(S=create_if_block_1$15(H),S.c(),S.m(u,m)):S&&(S.d(1),S=null),T&&T.p&&(!w||F&32)&&update_slot_base(T,M,H,H[5],w?get_slot_changes(M,H[5],F,null):get_all_dirty_from_scope(H[5]),null),H[4]?E?F&16&&transition_in(E,1):(E=create_if_block$25(H),E.c(),transition_in(E,1),E.m(u,null)):E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()),(!w||F&4)&&toggle_class(u,"is-invalid",H[2]),(!w||F&8)&&toggle_class(u,"is-disabled",H[3])},i(H){w||(transition_in(k),transition_in(T,H),transition_in(E),w=!0)},o(H){transition_out(k),transition_out(T,H),transition_out(E),w=!1},d(H){H&&detach(u),k&&k.d(),S&&S.d(),T&&T.d(H),E&&E.d()}}}function instance$3C(p,u,f){let{$$slots:m={},$$scope:v}=u,{icon:y=""}=u,{avatar:w=""}=u,{invalid:k=!1}=u,{disabled:S=!1}=u,{closable:M=!1}=u;function T(E){bubble.call(this,p,E)}return p.$$set=E=>{"icon"in E&&f(0,y=E.icon),"avatar"in E&&f(1,w=E.avatar),"invalid"in E&&f(2,k=E.invalid),"disabled"in E&&f(3,S=E.disabled),"closable"in E&&f(4,M=E.closable),"$$scope"in E&&f(5,v=E.$$scope)},[y,w,k,S,M,v,m,T]}let Tag$1=class extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3C,create_fragment$3F,safe_not_equal,{icon:0,avatar:1,invalid:2,disabled:3,closable:4})}};const indexVars$v="";function create_fragment$3E(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z;return{c(){u=element("div"),f=element("div"),m=space(),v=element("div"),y=element("div"),w=element("div"),k=element("div"),S=space(),M=element("div"),T=element("div"),E=element("div"),attr(f,"class","spectrum-ProgressCircle-track"),attr(k,"class","spectrum-ProgressCircle-fill"),attr(w,"class","spectrum-ProgressCircle-fillSubMask1"),attr(w,"style",p[3]),attr(y,"class","spectrum-ProgressCircle-fillMask1"),attr(E,"class","spectrum-ProgressCircle-fill"),attr(T,"class","spectrum-ProgressCircle-fillSubMask2"),attr(T,"style",p[4]),attr(M,"class","spectrum-ProgressCircle-fillMask2"),attr(v,"class","spectrum-ProgressCircle-fills"),attr(u,"class",H="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(p[0])),toggle_class(u,"spectrum-ProgressCircle--indeterminate",p[1]==null),toggle_class(u,"spectrum-ProgressCircle--overBackground",p[2])},m($,J){insert($,u,J),append$2(u,f),append$2(u,m),append$2(u,v),append$2(v,y),append$2(y,w),append$2(w,k),append$2(v,S),append$2(v,M),append$2(M,T),append$2(T,E),F||(Z=listen(u,"click",p[7]),F=!0)},p($,[J]){J&8&&attr(w,"style",$[3]),J&16&&attr(T,"style",$[4]),J&1&&H!==(H="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize($[0]))&&attr(u,"class",H),J&3&&toggle_class(u,"spectrum-ProgressCircle--indeterminate",$[1]==null),J&5&&toggle_class(u,"spectrum-ProgressCircle--overBackground",$[2])},i:noop$2,o:noop$2,d($){$&&detach(u),F=!1,Z()}}}function convertSize(p){switch(p){case"S":return"small";case"L":return"large";default:return}}function instance$3B(p,u,f){let{size:m="M"}=u,{value:v=null}=u,{minValue:y=0}=u,{maxValue:w=100}=u,k,S;function M(H){if(H){let F=(H-y)/(w-y)*100,Z;F>0&&F<=50?(Z=-180+F/50*180,f(3,k=`transform: rotate(${Z}deg);`),f(4,S="transform: rotate(-180deg);")):F>50&&(Z=-180+(F-50)/50*180,f(3,k="transform: rotate(0deg);"),f(4,S=`transform: rotate(${Z}deg);`))}}let{overBackground:T=!1}=u;function E(H){bubble.call(this,p,H)}return p.$$set=H=>{"size"in H&&f(0,m=H.size),"value"in H&&f(1,v=H.value),"minValue"in H&&f(5,y=H.minValue),"maxValue"in H&&f(6,w=H.maxValue),"overBackground"in H&&f(2,T=H.overBackground)},p.$$.update=()=>{p.$$.dirty&2&&M(v)},[m,v,T,k,S,y,w,E]}class ProgressCircle extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3B,create_fragment$3E,safe_not_equal,{size:0,value:1,minValue:5,maxValue:6,overBackground:2})}}const Picker_svelte_svelte_type_style_lang="";function get_each_context$J(p,u,f){const m=p.slice();return m[49]=u[f],m[51]=f,m}function create_if_block_11$2(p){let u,f,m,v;const y=[create_if_block_12$2,create_else_block_1$d],w=[];function k(S,M){return S[15]?1:0}return u=k(p),f=w[u]=y[u](p),{c(){f.c(),m=empty$1()},m(S,M){w[u].m(S,M),insert(S,m,M),v=!0},p(S,M){let T=u;u=k(S),u===T?w[u].p(S,M):(group_outros(),transition_out(w[T],1,1,()=>{w[T]=null}),check_outros(),f=w[u],f?f.p(S,M):(f=w[u]=y[u](S),f.c()),transition_in(f,1),f.m(m.parentNode,m))},i(S){v||(transition_in(f),v=!0)},o(S){transition_out(f),v=!1},d(S){S&&detach(m),w[u].d(S)}}}function create_else_block_1$d(p){let u,f,m;return{c(){u=element("span"),f=element("img"),src_url_equal(f.src,m=p[5])||attr(f,"src",m),attr(f,"alt","icon"),attr(f,"width","15"),attr(f,"height","15"),attr(u,"class","option-extra icon field-icon svelte-1jmtv0w")},m(v,y){insert(v,u,y),append$2(u,f)},p(v,y){y[0]&32&&!src_url_equal(f.src,m=v[5])&&attr(f,"src",m)},i:noop$2,o:noop$2,d(v){v&&detach(u)}}}function create_if_block_12$2(p){let u,f,m;return f=new Icon$1({props:{size:"S",name:p[5]}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra icon svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&32&&(w.name=v[5]),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_10$3(p){let u,f,m;return f=new StatusLight({props:{square:!0,color:p[6]}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&64&&(w.color=v[6]),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_9$4(p){let u,f;return u=new Search({props:{value:p[0],disabled:p[3],placeholder:"Search"}}),u.$on("change",p[37]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1&&(y.value=m[0]),v[0]&8&&(y.disabled=m[3]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_8$5(p){let u,f,m,v,y,w,k,S;return{c(){u=element("li"),f=element("span"),m=text$1(p[8]),v=space(),y=svg_element("svg"),w=svg_element("use"),attr(f,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(w,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(y,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(y,"focusable","false"),attr(y,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item placeholder svelte-1jmtv0w"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[7])},m(M,T){insert(M,u,T),append$2(u,f),append$2(f,m),append$2(u,v),append$2(u,y),append$2(y,w),k||(S=listen(u,"click",p[38]),k=!0)},p(M,T){T[0]&256&&set_data(m,M[8]),T[0]&128&&toggle_class(u,"is-selected",M[7])},d(M){M&&detach(u),k=!1,S()}}}function create_if_block_2$F(p){let u,f,m=ensure_array_like(p[30]),v=[];for(let w=0;w<m.length;w+=1)v[w]=create_each_block$J(get_each_context$J(p,m,w));const y=w=>transition_out(v[w],1,1,()=>{v[w]=null});return{c(){for(let w=0;w<v.length;w+=1)v[w].c();u=empty$1()},m(w,k){for(let S=0;S<v.length;S+=1)v[S]&&v[S].m(w,k);insert(w,u,k),f=!0},p(w,k){if(k[0]&1275330048){m=ensure_array_like(w[30]);let S;for(S=0;S<m.length;S+=1){const M=get_each_context$J(w,m,S);v[S]?(v[S].p(M,k),transition_in(v[S],1)):(v[S]=create_each_block$J(M),v[S].c(),transition_in(v[S],1),v[S].m(u.parentNode,u))}for(group_outros(),S=m.length;S<v.length;S+=1)y(S);check_outros()}},i(w){if(!f){for(let k=0;k<m.length;k+=1)transition_in(v[k]);f=!0}},o(w){v=v.filter(Boolean);for(let k=0;k<v.length;k+=1)transition_out(v[k]);f=!1},d(w){w&&detach(u),destroy_each(v,w)}}}function create_if_block_6$b(p){let u,f,m,v;const y=[create_if_block_7$a,create_else_block$E],w=[];function k(S,M){return S[15]?0:1}return f=k(p),m=w[f]=y[f](p),{c(){u=element("span"),m.c(),attr(u,"class","option-extra icon svelte-1jmtv0w")},m(S,M){insert(S,u,M),w[f].m(u,null),v=!0},p(S,M){let T=f;f=k(S),f===T?w[f].p(S,M):(group_outros(),transition_out(w[T],1,1,()=>{w[T]=null}),check_outros(),m=w[f],m?m.p(S,M):(m=w[f]=y[f](S),m.c()),transition_in(m,1),m.m(u,null))},i(S){v||(transition_in(m),v=!0)},o(S){transition_out(m),v=!1},d(S){S&&detach(u),w[f].d()}}}function create_else_block$E(p){let u,f;return u=new Icon$1({props:{size:"S",name:p[14](p[49],p[51])}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1073758208&&(y.name=m[14](m[49],m[51])),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_if_block_7$a(p){let u,f;return{c(){u=element("img"),src_url_equal(u.src,f=p[14](p[49],p[51]))||attr(u,"src",f),attr(u,"alt","icon"),attr(u,"width","15"),attr(u,"height","15")},m(m,v){insert(m,u,v)},p(m,v){v[0]&1073758208&&!src_url_equal(u.src,f=m[14](m[49],m[51]))&&attr(u,"src",f)},i:noop$2,o:noop$2,d(m){m&&detach(u)}}}function create_if_block_5$g(p){let u,f,m;return f=new StatusLight({props:{square:!0,color:p[16](p[49],p[51])}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-extra svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&1073807360&&(w.color=v[16](v[49],v[51])),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block_4$j(p){let u,f=p[17](p[49],p[51])+"",m;return{c(){u=element("span"),m=text$1(f),attr(u,"class","subtitle-text svelte-1jmtv0w")},m(v,y){insert(v,u,y),append$2(u,m)},p(v,y){y[0]&1073872896&&f!==(f=v[17](v[49],v[51])+"")&&set_data(m,f)},d(v){v&&detach(u)}}}function create_if_block_3$q(p){let u,f,m;return f=new Tags({props:{$$slots:{default:[create_default_slot_1$J]},$$scope:{ctx:p}}}),{c(){u=element("span"),create_component(f.$$.fragment),attr(u,"class","option-tag svelte-1jmtv0w")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y[0]&1073741824|y[1]&2097152&&(w.$$scope={dirty:y,ctx:v}),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_default_slot_2$u(p){let u=p[49].tag+"",f;return{c(){f=text$1(u)},m(m,v){insert(m,f,v)},p(m,v){v[0]&1073741824&&u!==(u=m[49].tag+"")&&set_data(f,u)},d(m){m&&detach(f)}}}function create_default_slot_1$J(p){let u,f;return u=new Tag$1({props:{icon:"LockClosed",$$slots:{default:[create_default_slot_2$u]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&1073741824|v[1]&2097152&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_each_block$J(p){let u,f=p[14](p[49],p[51]),m,v=p[16](p[49],p[51]),y,w,k=p[12](p[49],p[51])+"",S,M,T=p[17](p[49],p[51]),E,H,F,Z,$,J,ae,ie,he=f&&create_if_block_6$b(p),fe=v&&create_if_block_5$g(p),me=T&&create_if_block_4$j(p),ve=p[49].tag&&create_if_block_3$q(p);function Ce(){return p[39](p[49],p[51])}function Ee(...Ie){return p[40](p[49],...Ie)}function Se(...Ie){return p[41](p[49],...Ie)}return{c(){u=element("li"),he&&he.c(),m=space(),fe&&fe.c(),y=space(),w=element("span"),S=text$1(k),M=space(),me&&me.c(),E=space(),ve&&ve.c(),H=space(),F=svg_element("svg"),Z=svg_element("use"),$=space(),attr(w,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(Z,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(F,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(F,"focusable","false"),attr(F,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item svelte-1jmtv0w"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[9](p[13](p[49],p[51]))),toggle_class(u,"is-disabled",!p[10](p[49]))},m(Ie,xe){insert(Ie,u,xe),he&&he.m(u,null),append$2(u,m),fe&&fe.m(u,null),append$2(u,y),append$2(u,w),append$2(w,S),append$2(w,M),me&&me.m(w,null),append$2(u,E),ve&&ve.m(u,null),append$2(u,H),append$2(u,F),append$2(F,Z),append$2(u,$),J=!0,ae||(ie=[listen(u,"click",Ce),listen(u,"mouseenter",Ee),listen(u,"mouseleave",Se)],ae=!0)},p(Ie,xe){p=Ie,xe[0]&1073758208&&(f=p[14](p[49],p[51])),f?he?(he.p(p,xe),xe[0]&1073758208&&transition_in(he,1)):(he=create_if_block_6$b(p),he.c(),transition_in(he,1),he.m(u,m)):he&&(group_outros(),transition_out(he,1,1,()=>{he=null}),check_outros()),xe[0]&1073807360&&(v=p[16](p[49],p[51])),v?fe?(fe.p(p,xe),xe[0]&1073807360&&transition_in(fe,1)):(fe=create_if_block_5$g(p),fe.c(),transition_in(fe,1),fe.m(u,y)):fe&&(group_outros(),transition_out(fe,1,1,()=>{fe=null}),check_outros()),(!J||xe[0]&1073745920)&&k!==(k=p[12](p[49],p[51])+"")&&set_data(S,k),xe[0]&1073872896&&(T=p[17](p[49],p[51])),T?me?me.p(p,xe):(me=create_if_block_4$j(p),me.c(),me.m(w,null)):me&&(me.d(1),me=null),p[49].tag?ve?(ve.p(p,xe),xe[0]&1073741824&&transition_in(ve,1)):(ve=create_if_block_3$q(p),ve.c(),transition_in(ve,1),ve.m(u,H)):ve&&(group_outros(),transition_out(ve,1,1,()=>{ve=null}),check_outros()),(!J||xe[0]&1073750528)&&toggle_class(u,"is-selected",p[9](p[13](p[49],p[51]))),(!J||xe[0]&1073742848)&&toggle_class(u,"is-disabled",!p[10](p[49]))},i(Ie){J||(transition_in(he),transition_in(fe),transition_in(ve),J=!0)},o(Ie){transition_out(he),transition_out(fe),transition_out(ve),J=!1},d(Ie){Ie&&detach(u),he&&he.d(),fe&&fe.d(),me&&me.d(),ve&&ve.d(),ae=!1,run_all(ie)}}}function create_if_block_1$14(p){let u,f,m;return f=new ProgressCircle({props:{size:"S"}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","loading svelte-1jmtv0w"),toggle_class(u,"loading--withAutocomplete",p[20])},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){(!m||y[0]&1048576)&&toggle_class(u,"loading--withAutocomplete",v[20])},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_if_block$24(p){let u,f;return{c(){u=element("div"),f=text$1(p[23]),attr(u,"class","footer svelte-1jmtv0w")},m(m,v){insert(m,u,v),append$2(u,f)},p(m,v){v[0]&8388608&&set_data(f,m[23])},d(m){m&&detach(u)}}}function create_default_slot$1O(p){let u,f,m,v,y,w,k,S,M,T,E=p[20]&&create_if_block_9$4(p),H=p[8]&&create_if_block_8$5(p),F=p[30].length&&create_if_block_2$F(p),Z=p[25]&&create_if_block_1$14(p),$=p[23]&&create_if_block$24(p);return{c(){u=element("div"),E&&E.c(),f=space(),m=element("ul"),H&&H.c(),v=space(),F&&F.c(),y=space(),Z&&Z.c(),w=space(),$&&$.c(),attr(m,"class","spectrum-Menu"),attr(m,"role","listbox"),attr(u,"class","popover-content svelte-1jmtv0w"),toggle_class(u,"auto-width",p[19])},m(J,ae){insert(J,u,ae),E&&E.m(u,null),append$2(u,f),append$2(u,m),H&&H.m(m,null),append$2(m,v),F&&F.m(m,null),p[42](m),append$2(u,y),Z&&Z.m(u,null),append$2(u,w),$&&$.m(u,null),S=!0,M||(T=action_destroyer(k=clickOutside.call(null,u,p[43])),M=!0)},p(J,ae){J[20]?E?(E.p(J,ae),ae[0]&1048576&&transition_in(E,1)):(E=create_if_block_9$4(J),E.c(),transition_in(E,1),E.m(u,f)):E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()),J[8]?H?H.p(J,ae):(H=create_if_block_8$5(J),H.c(),H.m(m,v)):H&&(H.d(1),H=null),J[30].length?F?(F.p(J,ae),ae[0]&1073741824&&transition_in(F,1)):(F=create_if_block_2$F(J),F.c(),transition_in(F,1),F.m(m,null)):F&&(group_outros(),transition_out(F,1,1,()=>{F=null}),check_outros()),J[25]?Z?(Z.p(J,ae),ae[0]&33554432&&transition_in(Z,1)):(Z=create_if_block_1$14(J),Z.c(),transition_in(Z,1),Z.m(u,w)):Z&&(group_outros(),transition_out(Z,1,1,()=>{Z=null}),check_outros()),J[23]?$?$.p(J,ae):($=create_if_block$24(J),$.c(),$.m(u,null)):$&&($.d(1),$=null),k&&is_function(k.update)&&ae[0]&2&&k.update.call(null,J[43]),(!S||ae[0]&524288)&&toggle_class(u,"auto-width",J[19])},i(J){S||(transition_in(E),transition_in(F),transition_in(Z),S=!0)},o(J){transition_out(E),transition_out(F),transition_out(Z),S=!1},d(J){J&&detach(u),E&&E.d(),H&&H.d(),F&&F.d(),p[42](null),Z&&Z.d(),$&&$.d(),M=!1,T()}}}function create_fragment$3D(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z=p[5]&&create_if_block_11$2(p),$=p[6]&&create_if_block_10$3(p);return T=new Popover({props:{anchor:p[24]?p[24]:p[29],align:p[22]||"left",open:p[1],useAnchorWidth:!p[19],maxWidth:p[19]?400:null,customHeight:p[21],maxHeight:360,$$slots:{default:[create_default_slot$1O]},$$scope:{ctx:p}}}),T.$on("close",p[44]),{c(){u=element("button"),Z&&Z.c(),f=space(),$&&$.c(),m=space(),v=element("span"),y=text$1(p[4]),w=space(),k=svg_element("svg"),S=svg_element("use"),M=space(),create_component(T.$$.fragment),attr(v,"class","spectrum-Picker-label svelte-1jmtv0w"),toggle_class(v,"is-placeholder",p[7]),toggle_class(v,"auto-width",p[19]),xlink_attr(S,"xlink:href","#spectrum-css-icon-Chevron100"),attr(k,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"),attr(k,"focusable","false"),attr(k,"aria-hidden","true"),attr(u,"id",p[2]),attr(u,"class","spectrum-Picker spectrum-Picker--sizeM svelte-1jmtv0w"),u.disabled=p[3],attr(u,"aria-haspopup","listbox"),toggle_class(u,"spectrum-Picker--quiet",p[18]),toggle_class(u,"is-open",p[1])},m(J,ae){insert(J,u,ae),Z&&Z.m(u,null),append$2(u,f),$&&$.m(u,null),append$2(u,m),append$2(u,v),append$2(v,y),append$2(u,w),append$2(u,k),append$2(k,S),p[36](u),insert(J,M,ae),mount_component(T,J,ae),E=!0,H||(F=listen(u,"click",p[31]),H=!0)},p(J,ae){J[5]?Z?(Z.p(J,ae),ae[0]&32&&transition_in(Z,1)):(Z=create_if_block_11$2(J),Z.c(),transition_in(Z,1),Z.m(u,f)):Z&&(group_outros(),transition_out(Z,1,1,()=>{Z=null}),check_outros()),J[6]?$?($.p(J,ae),ae[0]&64&&transition_in($,1)):($=create_if_block_10$3(J),$.c(),transition_in($,1),$.m(u,m)):$&&(group_outros(),transition_out($,1,1,()=>{$=null}),check_outros()),(!E||ae[0]&16)&&set_data(y,J[4]),(!E||ae[0]&128)&&toggle_class(v,"is-placeholder",J[7]),(!E||ae[0]&524288)&&toggle_class(v,"auto-width",J[19]),(!E||ae[0]&4)&&attr(u,"id",J[2]),(!E||ae[0]&8)&&(u.disabled=J[3]),(!E||ae[0]&262144)&&toggle_class(u,"spectrum-Picker--quiet",J[18]),(!E||ae[0]&2)&&toggle_class(u,"is-open",J[1]);const ie={};ae[0]&553648128&&(ie.anchor=J[24]?J[24]:J[29]),ae[0]&4194304&&(ie.align=J[22]||"left"),ae[0]&2&&(ie.open=J[1]),ae[0]&524288&&(ie.useAnchorWidth=!J[19]),ae[0]&524288&&(ie.maxWidth=J[19]?400:null),ae[0]&2097152&&(ie.customHeight=J[21]),ae[0]&1587281803|ae[1]&2097152&&(ie.$$scope={dirty:ae,ctx:J}),T.$set(ie)},i(J){E||(transition_in(Z),transition_in($),transition_in(T.$$.fragment,J),E=!0)},o(J){transition_out(Z),transition_out($),transition_out(T.$$.fragment,J),E=!1},d(J){J&&(detach(u),detach(M)),Z&&Z.d(),$&&$.d(),p[36](null),destroy_component(T,J),H=!1,F()}}}function instance$3A(p,u,f){let m,v,{id:y=null}=u,{disabled:w=!1}=u,{fieldText:k=""}=u,{fieldIcon:S=""}=u,{fieldColour:M=""}=u,{isPlaceholder:T=!1}=u,{placeholderOption:E=null}=u,{options:H=[]}=u,{isOptionSelected:F=()=>!1}=u,{isOptionEnabled:Z=()=>!0}=u,{onSelectOption:$=()=>{}}=u,{getOptionLabel:J=cn=>cn}=u,{getOptionValue:ae=cn=>cn}=u,{getOptionIcon:ie=()=>null}=u,{useOptionIconImage:he=!1}=u,{getOptionColour:fe=()=>null}=u,{getOptionSubtitle:me=()=>null}=u,{open:ve=!1}=u,{readonly:Ce=!1}=u,{quiet:Ee=!1}=u,{autoWidth:Se=!1}=u,{autocomplete:Ie=!1}=u,{sort:xe=!1}=u,{searchTerm:Ue=null}=u,{customPopoverHeight:$e}=u,{align:Ye="left"}=u,{footer:be=null}=u,{customAnchor:Be=null}=u,{loading:Xe}=u,{onOptionMouseenter:Ne=()=>{}}=u,{onOptionMouseleave:Je=()=>{}}=u;const ft=createEventDispatcher();let Tt,qe;const Ge=cn=>{cn.preventDefault(),cn.stopPropagation(),ft("click"),!Ce&&(f(0,Ue=null),f(1,ve=!ve))},dt=(cn,Tn,an)=>!(cn!=null&&cn.length)||!Array.isArray(cn)?[]:an?cn.sort((gt,zn)=>{const Rt=Tn(gt),Et=Tn(zn);return Rt>Et?1:-1}):cn,Ct=(cn,Tn,an)=>{if(Ie&&Tn){const gt=Tn.toLowerCase();return cn.filter(zn=>`${an(zn)}`.toLowerCase().includes(gt))}return cn},ot=cn=>{cn.target.scrollHeight-cn.target.clientHeight-cn.target.scrollTop<100&&ft("loadMore")};onDestroy(()=>{qe==null||qe.removeEventListener("scroll",null)});function Wt(cn){binding_callbacks[cn?"unshift":"push"](()=>{Tt=cn,f(29,Tt)})}const Ke=cn=>f(0,Ue=cn.detail),jt=()=>$(null),Qt=(cn,Tn)=>$(ae(cn,Tn)),Nt=(cn,Tn)=>Ne(Tn,cn),Mt=(cn,Tn)=>Je(Tn,cn);function yt(cn){binding_callbacks[cn?"unshift":"push"](()=>{qe=cn,f(28,qe)})}const ln=()=>f(1,ve=!1),kn=()=>f(1,ve=!1);return p.$$set=cn=>{"id"in cn&&f(2,y=cn.id),"disabled"in cn&&f(3,w=cn.disabled),"fieldText"in cn&&f(4,k=cn.fieldText),"fieldIcon"in cn&&f(5,S=cn.fieldIcon),"fieldColour"in cn&&f(6,M=cn.fieldColour),"isPlaceholder"in cn&&f(7,T=cn.isPlaceholder),"placeholderOption"in cn&&f(8,E=cn.placeholderOption),"options"in cn&&f(32,H=cn.options),"isOptionSelected"in cn&&f(9,F=cn.isOptionSelected),"isOptionEnabled"in cn&&f(10,Z=cn.isOptionEnabled),"onSelectOption"in cn&&f(11,$=cn.onSelectOption),"getOptionLabel"in cn&&f(12,J=cn.getOptionLabel),"getOptionValue"in cn&&f(13,ae=cn.getOptionValue),"getOptionIcon"in cn&&f(14,ie=cn.getOptionIcon),"useOptionIconImage"in cn&&f(15,he=cn.useOptionIconImage),"getOptionColour"in cn&&f(16,fe=cn.getOptionColour),"getOptionSubtitle"in cn&&f(17,me=cn.getOptionSubtitle),"open"in cn&&f(1,ve=cn.open),"readonly"in cn&&f(33,Ce=cn.readonly),"quiet"in cn&&f(18,Ee=cn.quiet),"autoWidth"in cn&&f(19,Se=cn.autoWidth),"autocomplete"in cn&&f(20,Ie=cn.autocomplete),"sort"in cn&&f(34,xe=cn.sort),"searchTerm"in cn&&f(0,Ue=cn.searchTerm),"customPopoverHeight"in cn&&f(21,$e=cn.customPopoverHeight),"align"in cn&&f(22,Ye=cn.align),"footer"in cn&&f(23,be=cn.footer),"customAnchor"in cn&&f(24,Be=cn.customAnchor),"loading"in cn&&f(25,Xe=cn.loading),"onOptionMouseenter"in cn&&f(26,Ne=cn.onOptionMouseenter),"onOptionMouseleave"in cn&&f(27,Je=cn.onOptionMouseleave)},p.$$.update=()=>{p.$$.dirty[0]&4096|p.$$.dirty[1]&10&&f(35,m=dt(H,J,xe)),p.$$.dirty[0]&4097|p.$$.dirty[1]&16&&f(30,v=Ct(m,Ue,J)),p.$$.dirty[0]&268435456&&(qe==null||qe.addEventListener("scroll",ot))},[Ue,ve,y,w,k,S,M,T,E,F,Z,$,J,ae,ie,he,fe,me,Ee,Se,Ie,$e,Ye,be,Be,Xe,Ne,Je,qe,Tt,v,Ge,H,Ce,xe,m,Wt,Ke,jt,Qt,Nt,Mt,yt,ln,kn]}class Picker extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3A,create_fragment$3D,safe_not_equal,{id:2,disabled:3,fieldText:4,fieldIcon:5,fieldColour:6,isPlaceholder:7,placeholderOption:8,options:32,isOptionSelected:9,isOptionEnabled:10,onSelectOption:11,getOptionLabel:12,getOptionValue:13,getOptionIcon:14,useOptionIconImage:15,getOptionColour:16,getOptionSubtitle:17,open:1,readonly:33,quiet:18,autoWidth:19,autocomplete:20,sort:34,searchTerm:0,customPopoverHeight:21,align:22,footer:23,customAnchor:24,loading:25,onOptionMouseenter:26,onOptionMouseleave:27},null,[-1,-1])}}function create_fragment$3C(p){let u,f,m,v;function y(S){p[32](S)}function w(S){p[33](S)}let k={quiet:p[15],id:p[3],disabled:p[5],readonly:p[14],fieldText:p[27],fieldIcon:p[26],fieldColour:p[25],options:p[6],autoWidth:p[16],align:p[19],footer:p[20],getOptionLabel:p[7],getOptionValue:p[8],getOptionIcon:p[9],getOptionColour:p[10],getOptionSubtitle:p[11],useOptionIconImage:p[12],isOptionEnabled:p[13],autocomplete:p[17],sort:p[18],tag:p[21],onOptionMouseenter:p[23],onOptionMouseleave:p[24],isPlaceholder:p[2]==null||p[2]==="",placeholderOption:p[4]===!1?null:p[4]||"Choose an option",isOptionSelected:p[31],onSelectOption:p[29],loading:p[22]};return p[0]!==void 0&&(k.open=p[0]),p[1]!==void 0&&(k.searchTerm=p[1]),u=new Picker({props:k}),binding_callbacks.push(()=>bind(u,"open",y)),binding_callbacks.push(()=>bind(u,"searchTerm",w)),u.$on("click",p[34]),u.$on("loadMore",p[35]),{c(){create_component(u.$$.fragment)},m(S,M){mount_component(u,S,M),v=!0},p(S,M){const T={};M[0]&32768&&(T.quiet=S[15]),M[0]&8&&(T.id=S[3]),M[0]&32&&(T.disabled=S[5]),M[0]&16384&&(T.readonly=S[14]),M[0]&134217728&&(T.fieldText=S[27]),M[0]&67108864&&(T.fieldIcon=S[26]),M[0]&33554432&&(T.fieldColour=S[25]),M[0]&64&&(T.options=S[6]),M[0]&65536&&(T.autoWidth=S[16]),M[0]&524288&&(T.align=S[19]),M[0]&1048576&&(T.footer=S[20]),M[0]&128&&(T.getOptionLabel=S[7]),M[0]&256&&(T.getOptionValue=S[8]),M[0]&512&&(T.getOptionIcon=S[9]),M[0]&1024&&(T.getOptionColour=S[10]),M[0]&2048&&(T.getOptionSubtitle=S[11]),M[0]&4096&&(T.useOptionIconImage=S[12]),M[0]&8192&&(T.isOptionEnabled=S[13]),M[0]&131072&&(T.autocomplete=S[17]),M[0]&262144&&(T.sort=S[18]),M[0]&2097152&&(T.tag=S[21]),M[0]&8388608&&(T.onOptionMouseenter=S[23]),M[0]&16777216&&(T.onOptionMouseleave=S[24]),M[0]&4&&(T.isPlaceholder=S[2]==null||S[2]===""),M[0]&16&&(T.placeholderOption=S[4]===!1?null:S[4]||"Choose an option"),M[0]&4&&(T.isOptionSelected=S[31]),M[0]&4194304&&(T.loading=S[22]),!f&&M[0]&1&&(f=!0,T.open=S[0],add_flush_callback(()=>f=!1)),!m&&M[0]&2&&(m=!0,T.searchTerm=S[1],add_flush_callback(()=>m=!1)),u.$set(T)},i(S){v||(transition_in(u.$$.fragment,S),v=!0)},o(S){transition_out(u.$$.fragment,S),v=!1},d(S){destroy_component(u,S)}}}function instance$3z(p,u,f){let m,v,y,{value:w=null}=u,{id:k=null}=u,{placeholder:S="Choose an option"}=u,{disabled:M=!1}=u,{options:T=[]}=u,{getOptionLabel:E=ot=>ot}=u,{getOptionValue:H=ot=>ot}=u,{getOptionIcon:F=()=>null}=u,{getOptionColour:Z=()=>null}=u,{getOptionSubtitle:$=()=>null}=u,{compare:J=null}=u,{useOptionIconImage:ae=!1}=u,{isOptionEnabled:ie}=u,{readonly:he=!1}=u,{quiet:fe=!1}=u,{autoWidth:me=!1}=u,{autocomplete:ve=!1}=u,{sort:Ce=!1}=u,{align:Ee}=u,{footer:Se=null}=u,{open:Ie=!1}=u,{tag:xe=null}=u,{searchTerm:Ue=null}=u,{loading:$e}=u,{onOptionMouseenter:Ye=()=>{}}=u,{onOptionMouseleave:be=()=>{}}=u;const Be=createEventDispatcher();function Xe(ot,Wt){return typeof J=="function"?J(ot,Wt):ot===Wt}const Ne=(ot,Wt,Ke)=>{if(!(Ke!=null&&Ke.length))return"";const jt=Ke.findIndex((Qt,Nt)=>Xe(H(Qt,Nt),Wt));return jt!==-1?ot(Ke[jt],jt):null},Je=(ot,Wt,Ke)=>ot==null||ot===""?Ke===!1?"":Ke||"Choose an option":Ne(E,ot,Wt)||"Choose an option",ft=ot=>{Be("change",ot),f(0,Ie=!1)},Tt=ot=>Xe(ot,w);function qe(ot){Ie=ot,f(0,Ie)}function Ge(ot){Ue=ot,f(1,Ue)}function dt(ot){bubble.call(this,p,ot)}function Ct(ot){bubble.call(this,p,ot)}return p.$$set=ot=>{"value"in ot&&f(2,w=ot.value),"id"in ot&&f(3,k=ot.id),"placeholder"in ot&&f(4,S=ot.placeholder),"disabled"in ot&&f(5,M=ot.disabled),"options"in ot&&f(6,T=ot.options),"getOptionLabel"in ot&&f(7,E=ot.getOptionLabel),"getOptionValue"in ot&&f(8,H=ot.getOptionValue),"getOptionIcon"in ot&&f(9,F=ot.getOptionIcon),"getOptionColour"in ot&&f(10,Z=ot.getOptionColour),"getOptionSubtitle"in ot&&f(11,$=ot.getOptionSubtitle),"compare"in ot&&f(30,J=ot.compare),"useOptionIconImage"in ot&&f(12,ae=ot.useOptionIconImage),"isOptionEnabled"in ot&&f(13,ie=ot.isOptionEnabled),"readonly"in ot&&f(14,he=ot.readonly),"quiet"in ot&&f(15,fe=ot.quiet),"autoWidth"in ot&&f(16,me=ot.autoWidth),"autocomplete"in ot&&f(17,ve=ot.autocomplete),"sort"in ot&&f(18,Ce=ot.sort),"align"in ot&&f(19,Ee=ot.align),"footer"in ot&&f(20,Se=ot.footer),"open"in ot&&f(0,Ie=ot.open),"tag"in ot&&f(21,xe=ot.tag),"searchTerm"in ot&&f(1,Ue=ot.searchTerm),"loading"in ot&&f(22,$e=ot.loading),"onOptionMouseenter"in ot&&f(23,Ye=ot.onOptionMouseenter),"onOptionMouseleave"in ot&&f(24,be=ot.onOptionMouseleave)},p.$$.update=()=>{p.$$.dirty[0]&84&&f(27,m=Je(w,T,S)),p.$$.dirty[0]&580&&f(26,v=Ne(F,w,T)),p.$$.dirty[0]&1092&&f(25,y=Ne(Z,w,T))},[Ie,Ue,w,k,S,M,T,E,H,F,Z,$,ae,ie,he,fe,me,ve,Ce,Ee,Se,xe,$e,Ye,be,y,v,m,Xe,ft,J,Tt,qe,Ge,dt,Ct]}class Select extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3z,create_fragment$3C,safe_not_equal,{value:2,id:3,placeholder:4,disabled:5,options:6,getOptionLabel:7,getOptionValue:8,getOptionIcon:9,getOptionColour:10,getOptionSubtitle:11,compare:30,useOptionIconImage:12,isOptionEnabled:13,readonly:14,quiet:15,autoWidth:16,autocomplete:17,sort:18,align:19,footer:20,open:0,tag:21,searchTerm:1,loading:22,onOptionMouseenter:23,onOptionMouseleave:24},null,[-1,-1])}}function create_default_slot$1N(p){let u,f;return u=new Select({props:{quiet:p[15],error:p[5],disabled:p[2],readonly:p[3],value:p[0],options:p[7],placeholder:p[6],autoWidth:p[16],sort:p[17],align:p[21],footer:p[22],getOptionLabel:p[8],getOptionValue:p[9],getOptionIcon:p[11],getOptionColour:p[12],getOptionSubtitle:p[10],useOptionIconImage:p[13],isOptionEnabled:p[14],autocomplete:p[19],customPopoverHeight:p[20],tag:p[23],compare:p[25],onOptionMouseenter:p[26],onOptionMouseleave:p[27]}}),u.$on("change",p[28]),u.$on("click",p[29]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&32768&&(y.quiet=m[15]),v[0]&32&&(y.error=m[5]),v[0]&4&&(y.disabled=m[2]),v[0]&8&&(y.readonly=m[3]),v[0]&1&&(y.value=m[0]),v[0]&128&&(y.options=m[7]),v[0]&64&&(y.placeholder=m[6]),v[0]&65536&&(y.autoWidth=m[16]),v[0]&131072&&(y.sort=m[17]),v[0]&2097152&&(y.align=m[21]),v[0]&4194304&&(y.footer=m[22]),v[0]&256&&(y.getOptionLabel=m[8]),v[0]&512&&(y.getOptionValue=m[9]),v[0]&2048&&(y.getOptionIcon=m[11]),v[0]&4096&&(y.getOptionColour=m[12]),v[0]&1024&&(y.getOptionSubtitle=m[10]),v[0]&8192&&(y.useOptionIconImage=m[13]),v[0]&16384&&(y.isOptionEnabled=m[14]),v[0]&524288&&(y.autocomplete=m[19]),v[0]&1048576&&(y.customPopoverHeight=m[20]),v[0]&8388608&&(y.tag=m[23]),v[0]&33554432&&(y.compare=m[25]),v[0]&67108864&&(y.onOptionMouseenter=m[26]),v[0]&134217728&&(y.onOptionMouseleave=m[27]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3B(p){let u,f;return u=new Field$1({props:{helpText:p[24],label:p[1],labelPosition:p[4],error:p[5],tooltip:p[18],$$slots:{default:[create_default_slot$1N]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v[0]&16777216&&(y.helpText=m[24]),v[0]&2&&(y.label=m[1]),v[0]&16&&(y.labelPosition=m[4]),v[0]&32&&(y.error=m[5]),v[0]&262144&&(y.tooltip=m[18]),v[0]&251396077|v[1]&2&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3y(p,u,f){let{value:m=null}=u,{label:v=void 0}=u,{disabled:y=!1}=u,{readonly:w=!1}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{placeholder:M="Choose an option"}=u,{options:T=[]}=u,{getOptionLabel:E=Je=>Xe(Je,"label")}=u,{getOptionValue:H=Je=>Xe(Je,"value")}=u,{getOptionSubtitle:F=Je=>Je==null?void 0:Je.subtitle}=u,{getOptionIcon:Z=Je=>Je==null?void 0:Je.icon}=u,{getOptionColour:$=Je=>Je==null?void 0:Je.colour}=u,{useOptionIconImage:J=!1}=u,{isOptionEnabled:ae=void 0}=u,{quiet:ie=!1}=u,{autoWidth:he=!1}=u,{sort:fe=!1}=u,{tooltip:me=""}=u,{autocomplete:ve=!1}=u,{customPopoverHeight:Ce=void 0}=u,{align:Ee=void 0}=u,{footer:Se=null}=u,{tag:Ie=null}=u,{helpText:xe=null}=u,{compare:Ue=void 0}=u,{onOptionMouseenter:$e=()=>{}}=u,{onOptionMouseleave:Ye=()=>{}}=u;const be=createEventDispatcher(),Be=Je=>{f(0,m=Je.detail),be("change",Je.detail)},Xe=(Je,ft)=>Je&&typeof Je=="object"?Je[ft]:Je;function Ne(Je){bubble.call(this,p,Je)}return p.$$set=Je=>{"value"in Je&&f(0,m=Je.value),"label"in Je&&f(1,v=Je.label),"disabled"in Je&&f(2,y=Je.disabled),"readonly"in Je&&f(3,w=Je.readonly),"labelPosition"in Je&&f(4,k=Je.labelPosition),"error"in Je&&f(5,S=Je.error),"placeholder"in Je&&f(6,M=Je.placeholder),"options"in Je&&f(7,T=Je.options),"getOptionLabel"in Je&&f(8,E=Je.getOptionLabel),"getOptionValue"in Je&&f(9,H=Je.getOptionValue),"getOptionSubtitle"in Je&&f(10,F=Je.getOptionSubtitle),"getOptionIcon"in Je&&f(11,Z=Je.getOptionIcon),"getOptionColour"in Je&&f(12,$=Je.getOptionColour),"useOptionIconImage"in Je&&f(13,J=Je.useOptionIconImage),"isOptionEnabled"in Je&&f(14,ae=Je.isOptionEnabled),"quiet"in Je&&f(15,ie=Je.quiet),"autoWidth"in Je&&f(16,he=Je.autoWidth),"sort"in Je&&f(17,fe=Je.sort),"tooltip"in Je&&f(18,me=Je.tooltip),"autocomplete"in Je&&f(19,ve=Je.autocomplete),"customPopoverHeight"in Je&&f(20,Ce=Je.customPopoverHeight),"align"in Je&&f(21,Ee=Je.align),"footer"in Je&&f(22,Se=Je.footer),"tag"in Je&&f(23,Ie=Je.tag),"helpText"in Je&&f(24,xe=Je.helpText),"compare"in Je&&f(25,Ue=Je.compare),"onOptionMouseenter"in Je&&f(26,$e=Je.onOptionMouseenter),"onOptionMouseleave"in Je&&f(27,Ye=Je.onOptionMouseleave)},[m,v,y,w,k,S,M,T,E,H,F,Z,$,J,ae,ie,he,fe,me,ve,Ce,Ee,Se,Ie,xe,Ue,$e,Ye,Be,Ne]}class Select_1 extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3y,create_fragment$3B,safe_not_equal,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,getOptionLabel:8,getOptionValue:9,getOptionSubtitle:10,getOptionIcon:11,getOptionColour:12,useOptionIconImage:13,isOptionEnabled:14,quiet:15,autoWidth:16,sort:17,tooltip:18,autocomplete:19,customPopoverHeight:20,align:21,footer:22,tag:23,helpText:24,compare:25,onOptionMouseenter:26,onOptionMouseleave:27},null,[-1,-1])}}const indexVars$u="",Combobox_svelte_svelte_type_style_lang="";function get_each_context$I(p,u,f){const m=p.slice();return m[22]=u[f],m}function create_if_block$23(p){let u,f=ensure_array_like(p[5]),m=[];for(let v=0;v<f.length;v+=1)m[v]=create_each_block$I(get_each_context$I(p,f,v));return{c(){for(let v=0;v<m.length;v+=1)m[v].c();u=empty$1()},m(v,y){for(let w=0;w<m.length;w+=1)m[w]&&m[w].m(v,y);insert(v,u,y)},p(v,y){if(y&8417){f=ensure_array_like(v[5]);let w;for(w=0;w<f.length;w+=1){const k=get_each_context$I(v,f,w);m[w]?m[w].p(k,y):(m[w]=create_each_block$I(k),m[w].c(),m[w].m(u.parentNode,u))}for(;w<m.length;w+=1)m[w].d(1);m.length=f.length}},d(v){v&&detach(u),destroy_each(m,v)}}}function create_each_block$I(p){let u,f,m=p[6](p[22])+"",v,y,w,k,S,M,T;function E(){return p[18](p[22])}return{c(){u=element("li"),f=element("span"),v=text$1(m),y=space(),w=svg_element("svg"),k=svg_element("use"),S=space(),attr(f,"class","spectrum-Menu-itemLabel svelte-otlbol"),xlink_attr(k,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(w,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"),attr(w,"focusable","false"),attr(w,"aria-hidden","true"),attr(u,"class","spectrum-Menu-item"),attr(u,"role","option"),attr(u,"aria-selected","true"),attr(u,"tabindex","0"),toggle_class(u,"is-selected",p[7](p[22])===p[0])},m(H,F){insert(H,u,F),append$2(u,f),append$2(f,v),append$2(u,y),append$2(u,w),append$2(w,k),append$2(u,S),M||(T=listen(u,"click",E),M=!0)},p(H,F){p=H,F&96&&m!==(m=p[6](p[22])+"")&&set_data(v,m),F&161&&toggle_class(u,"is-selected",p[7](p[22])===p[0])},d(H){H&&detach(u),M=!1,T()}}}function create_default_slot$1M(p){let u,f,m=p[5]&&Array.isArray(p[5]),v,y,w,k=m&&create_if_block$23(p);return{c(){u=element("div"),f=element("ul"),k&&k.c(),attr(f,"class","spectrum-Menu"),attr(f,"role","listbox"),attr(u,"class","popover-content svelte-otlbol")},m(S,M){insert(S,u,M),append$2(u,f),k&&k.m(f,null),y||(w=action_destroyer(v=clickOutside.call(null,u,p[19])),y=!0)},p(S,M){M&32&&(m=S[5]&&Array.isArray(S[5])),m?k?k.p(S,M):(k=create_if_block$23(S),k.c(),k.m(f,null)):k&&(k.d(1),k=null),v&&is_function(v.update)&&M&256&&v.update.call(null,S[19])},d(S){S&&detach(u),k&&k.d(),y=!1,w()}}}function create_fragment$3A(p){let u,f,m,v,y,w,k,S,M,T,E,H,F,Z;return E=new Popover({props:{anchor:p[10],open:p[8],align:"left",useAnchorWidth:!0,$$slots:{default:[create_default_slot$1M]},$$scope:{ctx:p}}}),E.$on("close",p[20]),{c(){u=element("div"),f=element("div"),m=element("input"),w=space(),k=element("button"),S=svg_element("svg"),M=svg_element("use"),T=space(),create_component(E.$$.fragment),attr(m,"id",p[1]),attr(m,"type","text"),m.value=v=p[0]||"",attr(m,"placeholder",y=p[2]||""),m.disabled=p[3],m.readOnly=p[4],attr(m,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-otlbol"),attr(f,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-otlbol"),toggle_class(f,"is-disabled",p[3]),toggle_class(f,"is-focused",p[8]||p[9]),xlink_attr(M,"xlink:href","#spectrum-css-icon-Chevron100"),attr(S,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon spectrum-InputGroup-icon"),attr(S,"focusable","false"),attr(S,"aria-hidden","true"),attr(k,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button"),attr(k,"tabindex","-1"),attr(k,"aria-haspopup","true"),k.disabled=p[3],attr(u,"class","spectrum-InputGroup svelte-otlbol"),toggle_class(u,"is-focused",p[8]||p[9]),toggle_class(u,"is-disabled",p[3])},m($,J){insert($,u,J),append$2(u,f),append$2(f,m),append$2(u,w),append$2(u,k),append$2(k,S),append$2(S,M),p[17](u),insert($,T,J),mount_component(E,$,J),H=!0,F||(Z=[listen(m,"focus",p[14]),listen(m,"blur",p[15]),listen(m,"change",p[12]),listen(k,"click",p[16])],F=!0)},p($,[J]){(!H||J&2)&&attr(m,"id",$[1]),(!H||J&1&&v!==(v=$[0]||"")&&m.value!==v)&&(m.value=v),(!H||J&4&&y!==(y=$[2]||""))&&attr(m,"placeholder",y),(!H||J&8)&&(m.disabled=$[3]),(!H||J&16)&&(m.readOnly=$[4]),(!H||J&8)&&toggle_class(f,"is-disabled",$[3]),(!H||J&768)&&toggle_class(f,"is-focused",$[8]||$[9]),(!H||J&8)&&(k.disabled=$[3]),(!H||J&768)&&toggle_class(u,"is-focused",$[8]||$[9]),(!H||J&8)&&toggle_class(u,"is-disabled",$[3]);const ae={};J&1024&&(ae.anchor=$[10]),J&256&&(ae.open=$[8]),J&33554913&&(ae.$$scope={dirty:J,ctx:$}),E.$set(ae)},i($){H||(transition_in(E.$$.fragment,$),H=!0)},o($){transition_out(E.$$.fragment,$),H=!1},d($){$&&(detach(u),detach(T)),p[17](null),destroy_component(E,$),F=!1,run_all(Z)}}}function instance$3x(p,u,f){let{value:m=void 0}=u,{id:v=void 0}=u,{placeholder:y="Choose an option or type"}=u,{disabled:w=!1}=u,{readonly:k=!1}=u,{options:S=[]}=u,{getOptionLabel:M=Se=>`${Se}`}=u,{getOptionValue:T=Se=>`${Se}`}=u;const E=createEventDispatcher();let H=!1,F=!1,Z;const $=Se=>{E("change",Se),f(8,H=!1)},J=Se=>{const Ie=Se.currentTarget.value;E("type",Ie),$(Ie)},ae=Se=>{E("pick",Se),$(Se)},ie=()=>f(9,F=!0),he=()=>{f(9,F=!1),E("blur")},fe=()=>f(8,H=!H);function me(Se){binding_callbacks[Se?"unshift":"push"](()=>{Z=Se,f(10,Z)})}const ve=Se=>ae(T(Se)),Ce=()=>f(8,H=!1),Ee=()=>f(8,H=!1);return p.$$set=Se=>{"value"in Se&&f(0,m=Se.value),"id"in Se&&f(1,v=Se.id),"placeholder"in Se&&f(2,y=Se.placeholder),"disabled"in Se&&f(3,w=Se.disabled),"readonly"in Se&&f(4,k=Se.readonly),"options"in Se&&f(5,S=Se.options),"getOptionLabel"in Se&&f(6,M=Se.getOptionLabel),"getOptionValue"in Se&&f(7,T=Se.getOptionValue)},[m,v,y,w,k,S,M,T,H,F,Z,E,J,ae,ie,he,fe,me,ve,Ce,Ee]}class Combobox extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3x,create_fragment$3A,safe_not_equal,{value:0,id:1,placeholder:2,disabled:3,readonly:4,options:5,getOptionLabel:6,getOptionValue:7})}}function create_default_slot$1L(p){let u,f;return u=new Combobox({props:{error:p[5],disabled:p[2],value:p[0],options:p[7],placeholder:p[6],readonly:p[3],getOptionLabel:p[9],getOptionValue:p[10]}}),u.$on("change",p[11]),u.$on("pick",p[12]),u.$on("type",p[13]),u.$on("blur",p[14]),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&32&&(y.error=m[5]),v&4&&(y.disabled=m[2]),v&1&&(y.value=m[0]),v&128&&(y.options=m[7]),v&64&&(y.placeholder=m[6]),v&8&&(y.readonly=m[3]),v&512&&(y.getOptionLabel=m[9]),v&1024&&(y.getOptionValue=m[10]),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$3z(p){let u,f;return u=new Field$1({props:{helpText:p[8],label:p[1],labelPosition:p[4],error:p[5],$$slots:{default:[create_default_slot$1L]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,[v]){const y={};v&256&&(y.helpText=m[8]),v&2&&(y.label=m[1]),v&16&&(y.labelPosition=m[4]),v&32&&(y.error=m[5]),v&132845&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function instance$3w(p,u,f){let{value:m=null}=u,{label:v=void 0}=u,{disabled:y=!1}=u,{readonly:w=!1}=u,{labelPosition:k="above"}=u,{error:S=null}=u,{placeholder:M="Choose an option or type"}=u,{options:T=[]}=u,{helpText:E=null}=u,{getOptionLabel:H=fe=>J(fe,"label")}=u,{getOptionValue:F=fe=>J(fe,"value")}=u;const Z=createEventDispatcher(),$=fe=>{f(0,m=fe.detail),Z("change",fe.detail)},J=(fe,me)=>fe&&typeof fe=="object"?fe[me]:fe;function ae(fe){bubble.call(this,p,fe)}function ie(fe){bubble.call(this,p,fe)}function he(fe){bubble.call(this,p,fe)}return p.$$set=fe=>{"value"in fe&&f(0,m=fe.value),"label"in fe&&f(1,v=fe.label),"disabled"in fe&&f(2,y=fe.disabled),"readonly"in fe&&f(3,w=fe.readonly),"labelPosition"in fe&&f(4,k=fe.labelPosition),"error"in fe&&f(5,S=fe.error),"placeholder"in fe&&f(6,M=fe.placeholder),"options"in fe&&f(7,T=fe.options),"helpText"in fe&&f(8,E=fe.helpText),"getOptionLabel"in fe&&f(9,H=fe.getOptionLabel),"getOptionValue"in fe&&f(10,F=fe.getOptionValue)},[m,v,y,w,k,S,M,T,E,H,F,$,ae,ie,he]}class Combobox_1 extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$3w,create_fragment$3z,safe_not_equal,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,helpText:8,getOptionLabel:9,getOptionValue:10})}}const indexVars$t="",indexVars$s="",indexVars$r="";var AIOperationEnum=(p=>(p.SUMMARISE_TEXT="SUMMARISE_TEXT",p.CLEAN_DATA="CLEAN_DATA",p.TRANSLATE="TRANSLATE",p.CATEGORISE_TEXT="CATEGORISE_TEXT",p.SENTIMENT_ANALYSIS="SENTIMENT_ANALYSIS",p.PROMPT="PROMPT",p.SEARCH_WEB="SEARCH_WEB",p))(AIOperationEnum||{}),OperationFieldTypeEnum=(p=>(p.MULTI_COLUMN="columns",p.COLUMN="column",p.BINDABLE_TEXT="prompt",p))(OperationFieldTypeEnum||{}),Event$1=(p=>(p.USER_CREATED="user:created",p.USER_UPDATED="user:updated",p.USER_DELETED="user:deleted",p.USER_ONBOARDING_COMPLETE="user:onboarding:complete",p.USER_PERMISSION_ADMIN_ASSIGNED="user:admin:assigned",p.USER_PERMISSION_ADMIN_REMOVED="user:admin:removed",p.USER_PERMISSION_BUILDER_ASSIGNED="user:builder:assigned",p.USER_PERMISSION_BUILDER_REMOVED="user:builder:removed",p.USER_INVITED="user:invited",p.USER_INVITED_ACCEPTED="user:invite:accepted",p.USER_PASSWORD_FORCE_RESET="user:password:force:reset",p.USER_PASSWORD_UPDATED="user:password:updated",p.USER_PASSWORD_RESET_REQUESTED="user:password:reset:requested",p.USER_PASSWORD_RESET="user:password:reset",p.USER_DATA_COLLABORATION="user:data:collaboration",p.EMAIL_SMTP_CREATED="email:smtp:created",p.EMAIL_SMTP_UPDATED="email:smtp:updated",p.AI_CONFIG_CREATED="ai:config:created",p.AI_CONFIG_UPDATED="ai:config:updated",p.AUTH_SSO_CREATED="auth:sso:created",p.AUTH_SSO_UPDATED="auth:sso:updated",p.AUTH_SSO_ACTIVATED="auth:sso:activated",p.AUTH_SSO_DEACTIVATED="auth:sso:deactivated",p.AUTH_LOGIN="auth:login",p.AUTH_LOGOUT="auth:logout",p.ORG_NAME_UPDATED="org:info:name:updated",p.ORG_LOGO_UPDATED="org:info:logo:updated",p.ORG_PLATFORM_URL_UPDATED="org:platformurl:updated",p.INSTALLATION_VERSION_CHECKED="installation:version:checked",p.INSTALLATION_VERSION_UPGRADED="installation:version:upgraded",p.INSTALLATION_VERSION_DOWNGRADED="installation:version:downgraded",p.INSTALLATION_FIRST_STARTUP="installation:firstStartup",p.ANALYTICS_OPT_OUT="analytics:opt:out",p.ANALYTICS_OPT_IN="analytics:opt:in",p.APP_CREATED="app:created",p.APP_UPDATED="app:updated",p.APP_DELETED="app:deleted",p.APP_DUPLICATED="app:duplicated",p.APP_PUBLISHED="app:published",p.APP_UNPUBLISHED="app:unpublished",p.APP_TEMPLATE_IMPORTED="app:template:imported",p.APP_FILE_IMPORTED="app:file:imported",p.APP_VERSION_UPDATED="app:version:updated",p.APP_VERSION_REVERTED="app:version:reverted",p.APP_REVERTED="app:reverted",p.APP_EXPORTED="app:exported",p.ROLE_CREATED="role:created",p.ROLE_UPDATED="role:updated",p.ROLE_DELETED="role:deleted",p.ROLE_ASSIGNED="role:assigned",p.ROLE_UNASSIGNED="role:unassigned",p.SERVED_BUILDER="served:builder",p.SERVED_APP="served:app",p.SERVED_APP_PREVIEW="served:app:preview",p.DATASOURCE_CREATED="datasource:created",p.DATASOURCE_UPDATED="datasource:updated",p.DATASOURCE_DELETED="datasource:deleted",p.QUERY_CREATED="query:created",p.QUERY_UPDATED="query:updated",p.QUERY_DELETED="query:deleted",p.QUERY_IMPORT="query:import",p.QUERIES_RUN="queries:run",p.QUERY_PREVIEWED="query:previewed",p.TABLE_CREATED="table:created",p.TABLE_UPDATED="table:updated",p.TABLE_DELETED="table:deleted",p.TABLE_EXPORTED="table:exported",p.TABLE_IMPORTED="table:imported",p.TABLE_DATA_IMPORTED="table:data:imported",p.VIEW_CREATED="view:created",p.VIEW_UPDATED="view:updated",p.VIEW_DELETED="view:deleted",p.VIEW_EXPORTED="view:exported",p.VIEW_FILTER_CREATED="view:filter:created",p.VIEW_FILTER_UPDATED="view:filter:updated",p.VIEW_FILTER_DELETED="view:filter:deleted",p.VIEW_CALCULATION_CREATED="view:calculation:created",p.VIEW_CALCULATION_UPDATED="view:calculation:updated",p.VIEW_CALCULATION_DELETED="view:calculation:deleted",p.VIEW_JOIN_CREATED="view:join:created",p.ROWS_CREATED="rows:created",p.ROWS_IMPORTED="rows:imported",p.COMPONENT_CREATED="component:created",p.COMPONENT_DELETED="component:deleted",p.SCREEN_CREATED="screen:created",p.SCREEN_DELETED="screen:deleted",p.LAYOUT_CREATED="layout:created",p.LAYOUT_DELETED="layout:deleted",p.AUTOMATION_CREATED="automation:created",p.AUTOMATION_DELETED="automation:deleted",p.AUTOMATION_TESTED="automation:tested",p.AUTOMATIONS_RUN="automations:run",p.AUTOMATION_STEP_CREATED="automation:step:created",p.AUTOMATION_STEP_DELETED="automation:step:deleted",p.AUTOMATION_TRIGGER_UPDATED="automation:trigger:updated",p.LICENSE_PLAN_CHANGED="license:plan:changed",p.LICENSE_ACTIVATED="license:activated",p.LICENSE_PAYMENT_FAILED="license:payment:failed",p.LICENSE_PAYMENT_RECOVERED="license:payment:recovered",p.LICENSE_CHECKOUT_OPENED="license:checkout:opened",p.LICENSE_CHECKOUT_SUCCESS="license:checkout:success",p.LICENSE_PORTAL_OPENED="license:portal:opened",p.ACCOUNT_CREATED="account:created",p.ACCOUNT_DELETED="account:deleted",p.ACCOUNT_VERIFIED="account:verified",p.APP_BACKFILL_SUCCEEDED="app:backfill:succeeded",p.APP_BACKFILL_FAILED="app:backfill:failed",p.TENANT_BACKFILL_SUCCEEDED="tenant:backfill:succeeded",p.TENANT_BACKFILL_FAILED="tenant:backfill:failed",p.INSTALLATION_BACKFILL_SUCCEEDED="installation:backfill:succeeded",p.INSTALLATION_BACKFILL_FAILED="installation:backfill:failed",p.USER_GROUP_CREATED="user_group:created",p.USER_GROUP_UPDATED="user_group:updated",p.USER_GROUP_DELETED="user_group:deleted",p.USER_GROUP_USERS_ADDED="user_group:user_added",p.USER_GROUP_USERS_REMOVED="user_group:users_deleted",p.USER_GROUP_PERMISSIONS_EDITED="user_group:permissions_edited",p.USER_GROUP_ONBOARDING="user_group:onboarding_added",p.PLUGIN_INIT="plugin:init",p.PLUGIN_IMPORTED="plugin:imported",p.PLUGIN_DELETED="plugin:deleted",p.APP_BACKUP_RESTORED="app:backup:restored",p.APP_BACKUP_TRIGGERED="app:backup:triggered",p.ENVIRONMENT_VARIABLE_CREATED="environment_variable:created",p.ENVIRONMENT_VARIABLE_DELETED="environment_variable:deleted",p.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable:upgrade_panel_opened",p.AUDIT_LOGS_FILTERED="audit_log:filtered",p.AUDIT_LOGS_DOWNLOADED="audit_log:downloaded",p.ROW_ACTION_CREATED="row_action:created",p))(Event$1||{}),StaticQuotaName=(p=>(p.ROWS="rows",p.APPS="apps",p.USERS="users",p.CREATORS="creators",p.USER_GROUPS="userGroups",p.PLUGINS="plugins",p.AI_CUSTOM_CONFIGS="aiCustomConfigs",p))(StaticQuotaName||{}),MonthlyQuotaName=(p=>(p.QUERIES="queries",p.AUTOMATIONS="automations",p.BUDIBASE_AI_CREDITS="budibaseAICredits",p))(MonthlyQuotaName||{}),Feature=(p=>(p.USER_GROUPS="userGroups",p.APP_BACKUPS="appBackups",p.ENVIRONMENT_VARIABLES="environmentVariables",p.AUDIT_LOGS="auditLogs",p.ENFORCEABLE_SSO="enforceableSSO",p.BRANDING="branding",p.SCIM="scim",p.SYNC_AUTOMATIONS="syncAutomations",p.TRIGGER_AUTOMATION_RUN="triggerAutomationRun",p.APP_BUILDERS="appBuilders",p.OFFLINE="offline",p.EXPANDED_PUBLIC_API="expandedPublicApi",p.VIEW_PERMISSIONS="viewPermissions",p.VIEW_READONLY_COLUMNS="viewReadonlyColumns",p.BUDIBASE_AI="budibaseAI",p.AI_CUSTOM_CONFIGS="aiCustomConfigs",p))(Feature||{}),BasicOperator=(p=>(p.EQUAL="equal",p.NOT_EQUAL="notEqual",p.EMPTY="empty",p.NOT_EMPTY="notEmpty",p.FUZZY="fuzzy",p.STRING="string",p))(BasicOperator||{}),ArrayOperator=(p=>(p.CONTAINS="contains",p.NOT_CONTAINS="notContains",p.CONTAINS_ANY="containsAny",p.ONE_OF="oneOf",p))(ArrayOperator||{}),RangeOperator=(p=>(p.RANGE="range",p))(RangeOperator||{}),LogicalOperator=(p=>(p.AND="$and",p.OR="$or",p))(LogicalOperator||{});function isLogicalSearchOperator(p){return Object.values(LogicalOperator).includes(p)}function isBasicSearchOperator(p){return Object.values(BasicOperator).includes(p)}function isArraySearchOperator(p){return Object.values(ArrayOperator).includes(p)}function isRangeSearchOperator(p){return Object.values(RangeOperator).includes(p)}var InternalSearchFilterOperator=(p=>(p.COMPLEX_ID_OPERATOR="_complexIdOperator",p))(InternalSearchFilterOperator||{}),EmptyFilterOption=(p=>(p.RETURN_ALL="all",p.RETURN_NONE="none",p))(EmptyFilterOption||{}),UILogicalOperator=(p=>(p.ALL="all",p.ANY="any",p))(UILogicalOperator||{});Event$1.PLUGIN_INIT;var AutomationIOType=(p=>(p.OBJECT="object",p.STRING="string",p.BOOLEAN="boolean",p.NUMBER="number",p.ARRAY="array",p.JSON="json",p.DATE="date",p.ATTACHMENT="attachment",p))(AutomationIOType||{}),AutomationCustomIOType=(p=>(p.TABLE="table",p.ROW="row",p.ROWS="rows",p.WIDE="wide",p.QUERY="query",p.QUERY_PARAMS="queryParams",p.QUERY_LIMIT="queryLimit",p.LOOP_OPTION="loopOption",p.ITEM="item",p.CODE="code",p.FILTERS="filters",p.COLUMN="column",p.TRIGGER_SCHEMA="triggerSchema",p.CRON="cron",p.WEBHOOK_URL="webhookUrl",p.AUTOMATION="automation",p.AUTOMATION_FIELDS="automationFields",p.MULTI_ATTACHMENTS="multi_attachments",p.TRIGGER_FILTER="trigger_filter",p))(AutomationCustomIOType||{}),AutomationTriggerStepId=(p=>(p.ROW_SAVED="ROW_SAVED",p.ROW_UPDATED="ROW_UPDATED",p.ROW_DELETED="ROW_DELETED",p.WEBHOOK="WEBHOOK",p.APP="APP",p.CRON="CRON",p.ROW_ACTION="ROW_ACTION",p))(AutomationTriggerStepId||{}),AutomationStepType=(p=>(p.LOGIC="LOGIC",p.ACTION="ACTION",p.TRIGGER="TRIGGER",p))(AutomationStepType||{}),AutomationActionStepId=(p=>(p.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",p.CREATE_ROW="CREATE_ROW",p.UPDATE_ROW="UPDATE_ROW",p.DELETE_ROW="DELETE_ROW",p.EXECUTE_BASH="EXECUTE_BASH",p.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",p.EXECUTE_SCRIPT="EXECUTE_SCRIPT",p.EXECUTE_QUERY="EXECUTE_QUERY",p.SERVER_LOG="SERVER_LOG",p.DELAY="DELAY",p.FILTER="FILTER",p.QUERY_ROWS="QUERY_ROWS",p.LOOP="LOOP",p.COLLECT="COLLECT",p.OPENAI="OPENAI",p.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",p.BRANCH="BRANCH",p.discord="discord",p.slack="slack",p.zapier="zapier",p.integromat="integromat",p.n8n="n8n",p))(AutomationActionStepId||{});[...Object.values(AutomationActionStepId),...Object.values(AutomationTriggerStepId)];var AutomationFeature=(p=>(p.LOOPING="LOOPING",p))(AutomationFeature||{}),HttpMethod=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.HEAD="HEAD",p.DELETE="DELETE",p))(HttpMethod||{}),FieldType=(p=>(p.STRING="string",p.LONGFORM="longform",p.OPTIONS="options",p.NUMBER="number",p.BOOLEAN="boolean",p.ARRAY="array",p.DATETIME="datetime",p.ATTACHMENTS="attachment",p.ATTACHMENT_SINGLE="attachment_single",p.LINK="link",p.FORMULA="formula",p.AUTO="auto",p.AI="ai",p.JSON="json",p.INTERNAL="internal",p.BARCODEQR="barcodeqr",p.SIGNATURE_SINGLE="signature_single",p.BIGINT="bigint",p.BB_REFERENCE="bb_reference",p.BB_REFERENCE_SINGLE="bb_reference_single",p))(FieldType||{}),RelationshipType=(p=>(p.ONE_TO_MANY="one-to-many",p.MANY_TO_ONE="many-to-one",p.MANY_TO_MANY="many-to-many",p))(RelationshipType||{}),FormulaType=(p=>(p.STATIC="static",p.DYNAMIC="dynamic",p.AI="ai",p))(FormulaType||{}),BBReferenceFieldSubType=(p=>(p.USER="user",p.USERS="users",p))(BBReferenceFieldSubType||{});function isRelationshipField(p){return p.type===FieldType.LINK}var ViewV2Type=(p=>(p.CALCULATION="calculation",p))(ViewV2Type||{});const SEPARATOR$1="_",prefixed=p=>`${p}${SEPARATOR$1}`;var DocumentType=(p=>(p.USER="us",p.GROUP="gr",p.WORKSPACE="workspace",p.CONFIG="config",p.TEMPLATE="template",p.APP="app",p.DEV="dev",p.APP_DEV="app_dev",p.APP_METADATA="app_metadata",p.ROLE="role",p.MIGRATIONS="migrations",p.DEV_INFO="devinfo",p.AUTOMATION_LOG="log_au",p.ACCOUNT_METADATA="acc_metadata",p.PLUGIN="plg",p.DATASOURCE="datasource",p.DATASOURCE_PLUS="datasource_plus",p.APP_BACKUP="backup",p.TABLE="ta",p.ROW="ro",p.AUTOMATION="au",p.LINK="li",p.WEBHOOK="wh",p.INSTANCE="inst",p.LAYOUT="layout",p.SCREEN="screen",p.QUERY="query",p.DEPLOYMENTS="deployments",p.METADATA="metadata",p.MEM_VIEW="view",p.USER_FLAG="flag",p.AUTOMATION_METADATA="meta_au",p.AUDIT_LOG="al",p.APP_MIGRATION_METADATA="_design/migrations",p.SCIM_LOG="scimlog",p.ROW_ACTIONS="ra",p))(DocumentType||{});Object.values(DocumentType).sort((p,u)=>u.length-p.length);var InternalTable=(p=>(p.USER_METADATA="ta_users",p))(InternalTable||{}),VirtualDocumentType=(p=>(p.VIEW="view",p.ROW_ACTION="row_action",p))(VirtualDocumentType||{});Object.values(VirtualDocumentType).sort((p,u)=>u.length-p.length);var Theme=(p=>(p.LIGHTEST="lightest",p.LIGHT="light",p.DARK="dark",p.DARKEST="darkest",p.NORD="nord",p.MIDNIGHT="midnight",p))(Theme||{}),PluginType=(p=>(p.DATASOURCE="datasource",p.COMPONENT="component",p.AUTOMATION="automation",p))(PluginType||{});Object.values(PluginType),StaticQuotaName.ROWS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;var SortOrder=(p=>(p.ASCENDING="ascending",p.DESCENDING="descending",p))(SortOrder||{}),SortType=(p=>(p.STRING="string",p.NUMBER="number",p))(SortType||{}),util$2;(function(p){p.assertEqual=v=>v;function u(v){}p.assertIs=u;function f(v){throw new Error}p.assertNever=f,p.arrayToEnum=v=>{const y={};for(const w of v)y[w]=w;return y},p.getValidEnumValues=v=>{const y=p.objectKeys(v).filter(k=>typeof v[v[k]]!="number"),w={};for(const k of y)w[k]=v[k];return p.objectValues(w)},p.objectValues=v=>p.objectKeys(v).map(function(y){return v[y]}),p.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const y=[];for(const w in v)Object.prototype.hasOwnProperty.call(v,w)&&y.push(w);return y},p.find=(v,y)=>{for(const w of v)if(y(w))return w},p.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function m(v,y=" | "){return v.map(w=>typeof w=="string"?`'${w}'`:w).join(y)}p.joinValues=m,p.jsonStringifyReplacer=(v,y)=>typeof y=="bigint"?y.toString():y})(util$2||(util$2={}));var objectUtil;(function(p){p.mergeShapes=(u,f)=>({...u,...f})})(objectUtil||(objectUtil={}));const ZodParsedType=util$2.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=p=>{switch(typeof p){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(p)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(p)?ZodParsedType.array:p===null?ZodParsedType.null:p.then&&typeof p.then=="function"&&p.catch&&typeof p.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&p instanceof Map?ZodParsedType.map:typeof Set<"u"&&p instanceof Set?ZodParsedType.set:typeof Date<"u"&&p instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$2.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=p=>JSON.stringify(p,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(u){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const f=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,f):this.__proto__=f,this.name="ZodError",this.issues=u}get errors(){return this.issues}format(u){const f=u||function(y){return y.message},m={_errors:[]},v=y=>{for(const w of y.issues)if(w.code==="invalid_union")w.unionErrors.map(v);else if(w.code==="invalid_return_type")v(w.returnTypeError);else if(w.code==="invalid_arguments")v(w.argumentsError);else if(w.path.length===0)m._errors.push(f(w));else{let k=m,S=0;for(;S<w.path.length;){const M=w.path[S];S===w.path.length-1?(k[M]=k[M]||{_errors:[]},k[M]._errors.push(f(w))):k[M]=k[M]||{_errors:[]},k=k[M],S++}}};return v(this),m}static assert(u){if(!(u instanceof ZodError))throw new Error(`Not a ZodError: ${u}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$2.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(u=f=>f.message){const f={},m=[];for(const v of this.issues)v.path.length>0?(f[v.path[0]]=f[v.path[0]]||[],f[v.path[0]].push(u(v))):m.push(u(v));return{formErrors:m,fieldErrors:f}}get formErrors(){return this.flatten()}}ZodError.create=p=>new ZodError(p);const errorMap=(p,u)=>{let f;switch(p.code){case ZodIssueCode.invalid_type:p.received===ZodParsedType.undefined?f="Required":f=`Expected ${p.expected}, received ${p.received}`;break;case ZodIssueCode.invalid_literal:f=`Invalid literal value, expected ${JSON.stringify(p.expected,util$2.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:f=`Unrecognized key(s) in object: ${util$2.joinValues(p.keys,", ")}`;break;case ZodIssueCode.invalid_union:f="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:f=`Invalid discriminator value. Expected ${util$2.joinValues(p.options)}`;break;case ZodIssueCode.invalid_enum_value:f=`Invalid enum value. Expected ${util$2.joinValues(p.options)}, received '${p.received}'`;break;case ZodIssueCode.invalid_arguments:f="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:f="Invalid function return type";break;case ZodIssueCode.invalid_date:f="Invalid date";break;case ZodIssueCode.invalid_string:typeof p.validation=="object"?"includes"in p.validation?(f=`Invalid input: must include "${p.validation.includes}"`,typeof p.validation.position=="number"&&(f=`${f} at one or more positions greater than or equal to ${p.validation.position}`)):"startsWith"in p.validation?f=`Invalid input: must start with "${p.validation.startsWith}"`:"endsWith"in p.validation?f=`Invalid input: must end with "${p.validation.endsWith}"`:util$2.assertNever(p.validation):p.validation!=="regex"?f=`Invalid ${p.validation}`:f="Invalid";break;case ZodIssueCode.too_small:p.type==="array"?f=`Array must contain ${p.exact?"exactly":p.inclusive?"at least":"more than"} ${p.minimum} element(s)`:p.type==="string"?f=`String must contain ${p.exact?"exactly":p.inclusive?"at least":"over"} ${p.minimum} character(s)`:p.type==="number"?f=`Number must be ${p.exact?"exactly equal to ":p.inclusive?"greater than or equal to ":"greater than "}${p.minimum}`:p.type==="date"?f=`Date must be ${p.exact?"exactly equal to ":p.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(p.minimum))}`:f="Invalid input";break;case ZodIssueCode.too_big:p.type==="array"?f=`Array must contain ${p.exact?"exactly":p.inclusive?"at most":"less than"} ${p.maximum} element(s)`:p.type==="string"?f=`String must contain ${p.exact?"exactly":p.inclusive?"at most":"under"} ${p.maximum} character(s)`:p.type==="number"?f=`Number must be ${p.exact?"exactly":p.inclusive?"less than or equal to":"less than"} ${p.maximum}`:p.type==="bigint"?f=`BigInt must be ${p.exact?"exactly":p.inclusive?"less than or equal to":"less than"} ${p.maximum}`:p.type==="date"?f=`Date must be ${p.exact?"exactly":p.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(p.maximum))}`:f="Invalid input";break;case ZodIssueCode.custom:f="Invalid input";break;case ZodIssueCode.invalid_intersection_types:f="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:f=`Number must be a multiple of ${p.multipleOf}`;break;case ZodIssueCode.not_finite:f="Number must be finite";break;default:f=u.defaultError,util$2.assertNever(p)}return{message:f}};let overrideErrorMap=errorMap;function setErrorMap(p){overrideErrorMap=p}function getErrorMap(){return overrideErrorMap}const makeIssue=p=>{const{data:u,path:f,errorMaps:m,issueData:v}=p,y=[...f,...v.path||[]],w={...v,path:y};if(v.message!==void 0)return{...v,path:y,message:v.message};let k="";const S=m.filter(M=>!!M).slice().reverse();for(const M of S)k=M(w,{data:u,defaultError:k}).message;return{...v,path:y,message:k}},EMPTY_PATH=[];function addIssueToContext(p,u){const f=getErrorMap(),m=makeIssue({issueData:u,data:p.data,path:p.path,errorMaps:[p.common.contextualErrorMap,p.schemaErrorMap,f,f===errorMap?void 0:errorMap].filter(v=>!!v)});p.common.issues.push(m)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(u,f){const m=[];for(const v of f){if(v.status==="aborted")return INVALID$3;v.status==="dirty"&&u.dirty(),m.push(v.value)}return{status:u.value,value:m}}static async mergeObjectAsync(u,f){const m=[];for(const v of f){const y=await v.key,w=await v.value;m.push({key:y,value:w})}return ParseStatus.mergeObjectSync(u,m)}static mergeObjectSync(u,f){const m={};for(const v of f){const{key:y,value:w}=v;if(y.status==="aborted"||w.status==="aborted")return INVALID$3;y.status==="dirty"&&u.dirty(),w.status==="dirty"&&u.dirty(),y.value!=="__proto__"&&(typeof w.value<"u"||v.alwaysSet)&&(m[y.value]=w.value)}return{status:u.value,value:m}}}const INVALID$3=Object.freeze({status:"aborted"}),DIRTY=p=>({status:"dirty",value:p}),OK=p=>({status:"valid",value:p}),isAborted=p=>p.status==="aborted",isDirty=p=>p.status==="dirty",isValid$3=p=>p.status==="valid",isAsync=p=>typeof Promise<"u"&&p instanceof Promise;function __classPrivateFieldGet(p,u,f,m){if(f==="a"&&!m)throw new TypeError("Private accessor was defined without a getter");if(typeof u=="function"?p!==u||!m:!u.has(p))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?m:f==="a"?m.call(p):m?m.value:u.get(p)}function __classPrivateFieldSet(p,u,f,m,v){if(m==="m")throw new TypeError("Private method is not writable");if(m==="a"&&!v)throw new TypeError("Private accessor was defined without a setter");if(typeof u=="function"?p!==u||!v:!u.has(p))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m==="a"?v.call(p,f):v?v.value=f:u.set(p,f),f}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(p){p.errToObj=u=>typeof u=="string"?{message:u}:u||{},p.toString=u=>typeof u=="string"?u:u==null?void 0:u.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(u,f,m,v){this._cachedPath=[],this.parent=u,this.data=f,this._path=m,this._key=v}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(p,u)=>{if(isValid$3(u))return{success:!0,data:u.value};if(!p.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const f=new ZodError(p.common.issues);return this._error=f,this._error}}};function processCreateParams(p){if(!p)return{};const{errorMap:u,invalid_type_error:f,required_error:m,description:v}=p;if(u&&(f||m))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:v}:{errorMap:(w,k)=>{var S,M;const{message:T}=p;return w.code==="invalid_enum_value"?{message:T??k.defaultError}:typeof k.data>"u"?{message:(S=T??m)!==null&&S!==void 0?S:k.defaultError}:w.code!=="invalid_type"?{message:k.defaultError}:{message:(M=T??f)!==null&&M!==void 0?M:k.defaultError}},description:v}}class ZodType{constructor(u){this.spa=this.safeParseAsync,this._def=u,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(u){return getParsedType(u.data)}_getOrReturnCtx(u,f){return f||{common:u.parent.common,data:u.data,parsedType:getParsedType(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new ParseStatus,ctx:{common:u.parent.common,data:u.data,parsedType:getParsedType(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const f=this._parse(u);if(isAsync(f))throw new Error("Synchronous parse encountered promise.");return f}_parseAsync(u){const f=this._parse(u);return Promise.resolve(f)}parse(u,f){const m=this.safeParse(u,f);if(m.success)return m.data;throw m.error}safeParse(u,f){var m;const v={common:{issues:[],async:(m=f==null?void 0:f.async)!==null&&m!==void 0?m:!1,contextualErrorMap:f==null?void 0:f.errorMap},path:(f==null?void 0:f.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:getParsedType(u)},y=this._parseSync({data:u,path:v.path,parent:v});return handleResult(v,y)}async parseAsync(u,f){const m=await this.safeParseAsync(u,f);if(m.success)return m.data;throw m.error}async safeParseAsync(u,f){const m={common:{issues:[],contextualErrorMap:f==null?void 0:f.errorMap,async:!0},path:(f==null?void 0:f.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:getParsedType(u)},v=this._parse({data:u,path:m.path,parent:m}),y=await(isAsync(v)?v:Promise.resolve(v));return handleResult(m,y)}refine(u,f){const m=v=>typeof f=="string"||typeof f>"u"?{message:f}:typeof f=="function"?f(v):f;return this._refinement((v,y)=>{const w=u(v),k=()=>y.addIssue({code:ZodIssueCode.custom,...m(v)});return typeof Promise<"u"&&w instanceof Promise?w.then(S=>S?!0:(k(),!1)):w?!0:(k(),!1)})}refinement(u,f){return this._refinement((m,v)=>u(m)?!0:(v.addIssue(typeof f=="function"?f(m,v):f),!1))}_refinement(u){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(u){return ZodUnion.create([this,u],this._def)}and(u){return ZodIntersection.create(this,u,this._def)}transform(u){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const f=typeof u=="function"?u:()=>u;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:f,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(u){const f=typeof u=="function"?u:()=>u;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:f,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(u){const f=this.constructor;return new f({...this._def,description:u})}pipe(u){return ZodPipeline.create(this,u)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(p){let u="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return p.precision?u=`${u}\\.\\d{${p.precision}}`:p.precision==null&&(u=`${u}(\\.\\d+)?`),u}function timeRegex(p){return new RegExp(`^${timeRegexSource(p)}$`)}function datetimeRegex(p){let u=`${dateRegexSource}T${timeRegexSource(p)}`;const f=[];return f.push(p.local?"Z?":"Z"),p.offset&&f.push("([+-]\\d{2}:?\\d{2})"),u=`${u}(${f.join("|")})`,new RegExp(`^${u}$`)}function isValidIP(p,u){return!!((u==="v4"||!u)&&ipv4Regex.test(p)||(u==="v6"||!u)&&ipv6Regex.test(p))}class ZodString extends ZodType{_parse(u){if(this._def.coerce&&(u.data=String(u.data)),this._getType(u)!==ZodParsedType.string){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:y.parsedType}),INVALID$3}const m=new ParseStatus;let v;for(const y of this._def.checks)if(y.kind==="min")u.data.length<y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),m.dirty());else if(y.kind==="max")u.data.length>y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!1,message:y.message}),m.dirty());else if(y.kind==="length"){const w=u.data.length>y.value,k=u.data.length<y.value;(w||k)&&(v=this._getOrReturnCtx(u,v),w?addIssueToContext(v,{code:ZodIssueCode.too_big,maximum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}):k&&addIssueToContext(v,{code:ZodIssueCode.too_small,minimum:y.value,type:"string",inclusive:!0,exact:!0,message:y.message}),m.dirty())}else if(y.kind==="email")emailRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"email",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"emoji",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="uuid")uuidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"uuid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="nanoid")nanoidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="cuid")cuidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"cuid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="cuid2")cuid2Regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="ulid")ulidRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"ulid",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty());else if(y.kind==="url")try{new URL(u.data)}catch{v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"url",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()}else y.kind==="regex"?(y.regex.lastIndex=0,y.regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"regex",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty())):y.kind==="trim"?u.data=u.data.trim():y.kind==="includes"?u.data.includes(y.value,y.position)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{includes:y.value,position:y.position},message:y.message}),m.dirty()):y.kind==="toLowerCase"?u.data=u.data.toLowerCase():y.kind==="toUpperCase"?u.data=u.data.toUpperCase():y.kind==="startsWith"?u.data.startsWith(y.value)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{startsWith:y.value},message:y.message}),m.dirty()):y.kind==="endsWith"?u.data.endsWith(y.value)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:{endsWith:y.value},message:y.message}),m.dirty()):y.kind==="datetime"?datetimeRegex(y).test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"datetime",message:y.message}),m.dirty()):y.kind==="date"?dateRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"date",message:y.message}),m.dirty()):y.kind==="time"?timeRegex(y).test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.invalid_string,validation:"time",message:y.message}),m.dirty()):y.kind==="duration"?durationRegex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"duration",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):y.kind==="ip"?isValidIP(u.data,y.version)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"ip",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):y.kind==="base64"?base64Regex.test(u.data)||(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{validation:"base64",code:ZodIssueCode.invalid_string,message:y.message}),m.dirty()):util$2.assertNever(y);return{status:m.value,value:u.data}}_regex(u,f,m){return this.refinement(v=>u.test(v),{validation:f,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(m)})}_addCheck(u){return new ZodString({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...errorUtil.errToObj(u)})}url(u){return this._addCheck({kind:"url",...errorUtil.errToObj(u)})}emoji(u){return this._addCheck({kind:"emoji",...errorUtil.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...errorUtil.errToObj(u)})}nanoid(u){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...errorUtil.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(u)})}ulid(u){return this._addCheck({kind:"ulid",...errorUtil.errToObj(u)})}base64(u){return this._addCheck({kind:"base64",...errorUtil.errToObj(u)})}ip(u){return this._addCheck({kind:"ip",...errorUtil.errToObj(u)})}datetime(u){var f,m;return typeof u=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:u}):this._addCheck({kind:"datetime",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,offset:(f=u==null?void 0:u.offset)!==null&&f!==void 0?f:!1,local:(m=u==null?void 0:u.local)!==null&&m!==void 0?m:!1,...errorUtil.errToObj(u==null?void 0:u.message)})}date(u){return this._addCheck({kind:"date",message:u})}time(u){return typeof u=="string"?this._addCheck({kind:"time",precision:null,message:u}):this._addCheck({kind:"time",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,...errorUtil.errToObj(u==null?void 0:u.message)})}duration(u){return this._addCheck({kind:"duration",...errorUtil.errToObj(u)})}regex(u,f){return this._addCheck({kind:"regex",regex:u,...errorUtil.errToObj(f)})}includes(u,f){return this._addCheck({kind:"includes",value:u,position:f==null?void 0:f.position,...errorUtil.errToObj(f==null?void 0:f.message)})}startsWith(u,f){return this._addCheck({kind:"startsWith",value:u,...errorUtil.errToObj(f)})}endsWith(u,f){return this._addCheck({kind:"endsWith",value:u,...errorUtil.errToObj(f)})}min(u,f){return this._addCheck({kind:"min",value:u,...errorUtil.errToObj(f)})}max(u,f){return this._addCheck({kind:"max",value:u,...errorUtil.errToObj(f)})}length(u,f){return this._addCheck({kind:"length",value:u,...errorUtil.errToObj(f)})}nonempty(u){return this.min(1,errorUtil.errToObj(u))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(u=>u.kind==="datetime")}get isDate(){return!!this._def.checks.find(u=>u.kind==="date")}get isTime(){return!!this._def.checks.find(u=>u.kind==="time")}get isDuration(){return!!this._def.checks.find(u=>u.kind==="duration")}get isEmail(){return!!this._def.checks.find(u=>u.kind==="email")}get isURL(){return!!this._def.checks.find(u=>u.kind==="url")}get isEmoji(){return!!this._def.checks.find(u=>u.kind==="emoji")}get isUUID(){return!!this._def.checks.find(u=>u.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(u=>u.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(u=>u.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(u=>u.kind==="cuid2")}get isULID(){return!!this._def.checks.find(u=>u.kind==="ulid")}get isIP(){return!!this._def.checks.find(u=>u.kind==="ip")}get isBase64(){return!!this._def.checks.find(u=>u.kind==="base64")}get minLength(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxLength(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}}ZodString.create=p=>{var u;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(u=p==null?void 0:p.coerce)!==null&&u!==void 0?u:!1,...processCreateParams(p)})};function floatSafeRemainder(p,u){const f=(p.toString().split(".")[1]||"").length,m=(u.toString().split(".")[1]||"").length,v=f>m?f:m,y=parseInt(p.toFixed(v).replace(".","")),w=parseInt(u.toFixed(v).replace(".",""));return y%w/Math.pow(10,v)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){if(this._def.coerce&&(u.data=Number(u.data)),this._getType(u)!==ZodParsedType.number){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:y.parsedType}),INVALID$3}let m;const v=new ParseStatus;for(const y of this._def.checks)y.kind==="int"?util$2.isInteger(u.data)||(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:y.message}),v.dirty()):y.kind==="min"?(y.inclusive?u.data<y.value:u.data<=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?u.data>y.value:u.data>=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:y.value,type:"number",inclusive:y.inclusive,exact:!1,message:y.message}),v.dirty()):y.kind==="multipleOf"?floatSafeRemainder(u.data,y.value)!==0&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):y.kind==="finite"?Number.isFinite(u.data)||(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_finite,message:y.message}),v.dirty()):util$2.assertNever(y);return{status:v.value,value:u.data}}gte(u,f){return this.setLimit("min",u,!0,errorUtil.toString(f))}gt(u,f){return this.setLimit("min",u,!1,errorUtil.toString(f))}lte(u,f){return this.setLimit("max",u,!0,errorUtil.toString(f))}lt(u,f){return this.setLimit("max",u,!1,errorUtil.toString(f))}setLimit(u,f,m,v){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:u,value:f,inclusive:m,message:errorUtil.toString(v)}]})}_addCheck(u){return new ZodNumber({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:errorUtil.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(u)})}multipleOf(u,f){return this._addCheck({kind:"multipleOf",value:u,message:errorUtil.toString(f)})}finite(u){return this._addCheck({kind:"finite",message:errorUtil.toString(u)})}safe(u){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(u)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(u)})}get minValue(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxValue(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}get isInt(){return!!this._def.checks.find(u=>u.kind==="int"||u.kind==="multipleOf"&&util$2.isInteger(u.value))}get isFinite(){let u=null,f=null;for(const m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(f===null||m.value>f)&&(f=m.value):m.kind==="max"&&(u===null||m.value<u)&&(u=m.value)}return Number.isFinite(f)&&Number.isFinite(u)}}ZodNumber.create=p=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(p==null?void 0:p.coerce)||!1,...processCreateParams(p)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(u){if(this._def.coerce&&(u.data=BigInt(u.data)),this._getType(u)!==ZodParsedType.bigint){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:y.parsedType}),INVALID$3}let m;const v=new ParseStatus;for(const y of this._def.checks)y.kind==="min"?(y.inclusive?u.data<y.value:u.data<=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_small,type:"bigint",minimum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="max"?(y.inclusive?u.data>y.value:u.data>=y.value)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.too_big,type:"bigint",maximum:y.value,inclusive:y.inclusive,message:y.message}),v.dirty()):y.kind==="multipleOf"?u.data%y.value!==BigInt(0)&&(m=this._getOrReturnCtx(u,m),addIssueToContext(m,{code:ZodIssueCode.not_multiple_of,multipleOf:y.value,message:y.message}),v.dirty()):util$2.assertNever(y);return{status:v.value,value:u.data}}gte(u,f){return this.setLimit("min",u,!0,errorUtil.toString(f))}gt(u,f){return this.setLimit("min",u,!1,errorUtil.toString(f))}lte(u,f){return this.setLimit("max",u,!0,errorUtil.toString(f))}lt(u,f){return this.setLimit("max",u,!1,errorUtil.toString(f))}setLimit(u,f,m,v){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:u,value:f,inclusive:m,message:errorUtil.toString(v)}]})}_addCheck(u){return new ZodBigInt({...this._def,checks:[...this._def.checks,u]})}positive(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(u)})}multipleOf(u,f){return this._addCheck({kind:"multipleOf",value:u,message:errorUtil.toString(f)})}get minValue(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u}get maxValue(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u}}ZodBigInt.create=p=>{var u;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(u=p==null?void 0:p.coerce)!==null&&u!==void 0?u:!1,...processCreateParams(p)})};class ZodBoolean extends ZodType{_parse(u){if(this._def.coerce&&(u.data=!!u.data),this._getType(u)!==ZodParsedType.boolean){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodBoolean.create=p=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(p==null?void 0:p.coerce)||!1,...processCreateParams(p)});class ZodDate extends ZodType{_parse(u){if(this._def.coerce&&(u.data=new Date(u.data)),this._getType(u)!==ZodParsedType.date){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:y.parsedType}),INVALID$3}if(isNaN(u.data.getTime())){const y=this._getOrReturnCtx(u);return addIssueToContext(y,{code:ZodIssueCode.invalid_date}),INVALID$3}const m=new ParseStatus;let v;for(const y of this._def.checks)y.kind==="min"?u.data.getTime()<y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_small,message:y.message,inclusive:!0,exact:!1,minimum:y.value,type:"date"}),m.dirty()):y.kind==="max"?u.data.getTime()>y.value&&(v=this._getOrReturnCtx(u,v),addIssueToContext(v,{code:ZodIssueCode.too_big,message:y.message,inclusive:!0,exact:!1,maximum:y.value,type:"date"}),m.dirty()):util$2.assertNever(y);return{status:m.value,value:new Date(u.data.getTime())}}_addCheck(u){return new ZodDate({...this._def,checks:[...this._def.checks,u]})}min(u,f){return this._addCheck({kind:"min",value:u.getTime(),message:errorUtil.toString(f)})}max(u,f){return this._addCheck({kind:"max",value:u.getTime(),message:errorUtil.toString(f)})}get minDate(){let u=null;for(const f of this._def.checks)f.kind==="min"&&(u===null||f.value>u)&&(u=f.value);return u!=null?new Date(u):null}get maxDate(){let u=null;for(const f of this._def.checks)f.kind==="max"&&(u===null||f.value<u)&&(u=f.value);return u!=null?new Date(u):null}}ZodDate.create=p=>new ZodDate({checks:[],coerce:(p==null?void 0:p.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(p)});class ZodSymbol extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.symbol){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodSymbol.create=p=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(p)});class ZodUndefined extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.undefined){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodUndefined.create=p=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(p)});class ZodNull extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.null){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodNull.create=p=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(p)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(u){return OK(u.data)}}ZodAny.create=p=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(p)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(u){return OK(u.data)}}ZodUnknown.create=p=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(p)});class ZodNever extends ZodType{_parse(u){const f=this._getOrReturnCtx(u);return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:f.parsedType}),INVALID$3}}ZodNever.create=p=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(p)});class ZodVoid extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.undefined){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:m.parsedType}),INVALID$3}return OK(u.data)}}ZodVoid.create=p=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(p)});class ZodArray extends ZodType{_parse(u){const{ctx:f,status:m}=this._processInputParams(u),v=this._def;if(f.parsedType!==ZodParsedType.array)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:f.parsedType}),INVALID$3;if(v.exactLength!==null){const w=f.data.length>v.exactLength.value,k=f.data.length<v.exactLength.value;(w||k)&&(addIssueToContext(f,{code:w?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:k?v.exactLength.value:void 0,maximum:w?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),m.dirty())}if(v.minLength!==null&&f.data.length<v.minLength.value&&(addIssueToContext(f,{code:ZodIssueCode.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),m.dirty()),v.maxLength!==null&&f.data.length>v.maxLength.value&&(addIssueToContext(f,{code:ZodIssueCode.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),m.dirty()),f.common.async)return Promise.all([...f.data].map((w,k)=>v.type._parseAsync(new ParseInputLazyPath(f,w,f.path,k)))).then(w=>ParseStatus.mergeArray(m,w));const y=[...f.data].map((w,k)=>v.type._parseSync(new ParseInputLazyPath(f,w,f.path,k)));return ParseStatus.mergeArray(m,y)}get element(){return this._def.type}min(u,f){return new ZodArray({...this._def,minLength:{value:u,message:errorUtil.toString(f)}})}max(u,f){return new ZodArray({...this._def,maxLength:{value:u,message:errorUtil.toString(f)}})}length(u,f){return new ZodArray({...this._def,exactLength:{value:u,message:errorUtil.toString(f)}})}nonempty(u){return this.min(1,u)}}ZodArray.create=(p,u)=>new ZodArray({type:p,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(u)});function deepPartialify(p){if(p instanceof ZodObject){const u={};for(const f in p.shape){const m=p.shape[f];u[f]=ZodOptional.create(deepPartialify(m))}return new ZodObject({...p._def,shape:()=>u})}else return p instanceof ZodArray?new ZodArray({...p._def,type:deepPartialify(p.element)}):p instanceof ZodOptional?ZodOptional.create(deepPartialify(p.unwrap())):p instanceof ZodNullable?ZodNullable.create(deepPartialify(p.unwrap())):p instanceof ZodTuple?ZodTuple.create(p.items.map(u=>deepPartialify(u))):p}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const u=this._def.shape(),f=util$2.objectKeys(u);return this._cached={shape:u,keys:f}}_parse(u){if(this._getType(u)!==ZodParsedType.object){const M=this._getOrReturnCtx(u);return addIssueToContext(M,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:M.parsedType}),INVALID$3}const{status:m,ctx:v}=this._processInputParams(u),{shape:y,keys:w}=this._getCached(),k=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const M in v.data)w.includes(M)||k.push(M);const S=[];for(const M of w){const T=y[M],E=v.data[M];S.push({key:{status:"valid",value:M},value:T._parse(new ParseInputLazyPath(v,E,v.path,M)),alwaysSet:M in v.data})}if(this._def.catchall instanceof ZodNever){const M=this._def.unknownKeys;if(M==="passthrough")for(const T of k)S.push({key:{status:"valid",value:T},value:{status:"valid",value:v.data[T]}});else if(M==="strict")k.length>0&&(addIssueToContext(v,{code:ZodIssueCode.unrecognized_keys,keys:k}),m.dirty());else if(M!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const M=this._def.catchall;for(const T of k){const E=v.data[T];S.push({key:{status:"valid",value:T},value:M._parse(new ParseInputLazyPath(v,E,v.path,T)),alwaysSet:T in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const M=[];for(const T of S){const E=await T.key,H=await T.value;M.push({key:E,value:H,alwaysSet:T.alwaysSet})}return M}).then(M=>ParseStatus.mergeObjectSync(m,M)):ParseStatus.mergeObjectSync(m,S)}get shape(){return this._def.shape()}strict(u){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...u!==void 0?{errorMap:(f,m)=>{var v,y,w,k;const S=(w=(y=(v=this._def).errorMap)===null||y===void 0?void 0:y.call(v,f,m).message)!==null&&w!==void 0?w:m.defaultError;return f.code==="unrecognized_keys"?{message:(k=errorUtil.errToObj(u).message)!==null&&k!==void 0?k:S}:{message:S}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(u){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new ZodObject({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>({...this._def.shape(),...u._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(u,f){return this.augment({[u]:f})}catchall(u){return new ZodObject({...this._def,catchall:u})}pick(u){const f={};return util$2.objectKeys(u).forEach(m=>{u[m]&&this.shape[m]&&(f[m]=this.shape[m])}),new ZodObject({...this._def,shape:()=>f})}omit(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{u[m]||(f[m]=this.shape[m])}),new ZodObject({...this._def,shape:()=>f})}deepPartial(){return deepPartialify(this)}partial(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{const v=this.shape[m];u&&!u[m]?f[m]=v:f[m]=v.optional()}),new ZodObject({...this._def,shape:()=>f})}required(u){const f={};return util$2.objectKeys(this.shape).forEach(m=>{if(u&&!u[m])f[m]=this.shape[m];else{let y=this.shape[m];for(;y instanceof ZodOptional;)y=y._def.innerType;f[m]=y}}),new ZodObject({...this._def,shape:()=>f})}keyof(){return createZodEnum(util$2.objectKeys(this.shape))}}ZodObject.create=(p,u)=>new ZodObject({shape:()=>p,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)}),ZodObject.strictCreate=(p,u)=>new ZodObject({shape:()=>p,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)}),ZodObject.lazycreate=(p,u)=>new ZodObject({shape:p,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(u)});class ZodUnion extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m=this._def.options;function v(y){for(const k of y)if(k.result.status==="valid")return k.result;for(const k of y)if(k.result.status==="dirty")return f.common.issues.push(...k.ctx.common.issues),k.result;const w=y.map(k=>new ZodError(k.ctx.common.issues));return addIssueToContext(f,{code:ZodIssueCode.invalid_union,unionErrors:w}),INVALID$3}if(f.common.async)return Promise.all(m.map(async y=>{const w={...f,common:{...f.common,issues:[]},parent:null};return{result:await y._parseAsync({data:f.data,path:f.path,parent:w}),ctx:w}})).then(v);{let y;const w=[];for(const S of m){const M={...f,common:{...f.common,issues:[]},parent:null},T=S._parseSync({data:f.data,path:f.path,parent:M});if(T.status==="valid")return T;T.status==="dirty"&&!y&&(y={result:T,ctx:M}),M.common.issues.length&&w.push(M.common.issues)}if(y)return f.common.issues.push(...y.ctx.common.issues),y.result;const k=w.map(S=>new ZodError(S));return addIssueToContext(f,{code:ZodIssueCode.invalid_union,unionErrors:k}),INVALID$3}}get options(){return this._def.options}}ZodUnion.create=(p,u)=>new ZodUnion({options:p,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(u)});const getDiscriminator=p=>p instanceof ZodLazy?getDiscriminator(p.schema):p instanceof ZodEffects?getDiscriminator(p.innerType()):p instanceof ZodLiteral?[p.value]:p instanceof ZodEnum?p.options:p instanceof ZodNativeEnum?util$2.objectValues(p.enum):p instanceof ZodDefault?getDiscriminator(p._def.innerType):p instanceof ZodUndefined?[void 0]:p instanceof ZodNull?[null]:p instanceof ZodOptional?[void 0,...getDiscriminator(p.unwrap())]:p instanceof ZodNullable?[null,...getDiscriminator(p.unwrap())]:p instanceof ZodBranded||p instanceof ZodReadonly?getDiscriminator(p.unwrap()):p instanceof ZodCatch?getDiscriminator(p._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.object)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:f.parsedType}),INVALID$3;const m=this.discriminator,v=f.data[m],y=this.optionsMap.get(v);return y?f.common.async?y._parseAsync({data:f.data,path:f.path,parent:f}):y._parseSync({data:f.data,path:f.path,parent:f}):(addIssueToContext(f,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),INVALID$3)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,f,m){const v=new Map;for(const y of f){const w=getDiscriminator(y.shape[u]);if(!w.length)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const k of w){if(v.has(k))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(k)}`);v.set(k,y)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:u,options:f,optionsMap:v,...processCreateParams(m)})}}function mergeValues(p,u){const f=getParsedType(p),m=getParsedType(u);if(p===u)return{valid:!0,data:p};if(f===ZodParsedType.object&&m===ZodParsedType.object){const v=util$2.objectKeys(u),y=util$2.objectKeys(p).filter(k=>v.indexOf(k)!==-1),w={...p,...u};for(const k of y){const S=mergeValues(p[k],u[k]);if(!S.valid)return{valid:!1};w[k]=S.data}return{valid:!0,data:w}}else if(f===ZodParsedType.array&&m===ZodParsedType.array){if(p.length!==u.length)return{valid:!1};const v=[];for(let y=0;y<p.length;y++){const w=p[y],k=u[y],S=mergeValues(w,k);if(!S.valid)return{valid:!1};v.push(S.data)}return{valid:!0,data:v}}else return f===ZodParsedType.date&&m===ZodParsedType.date&&+p==+u?{valid:!0,data:p}:{valid:!1}}class ZodIntersection extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u),v=(y,w)=>{if(isAborted(y)||isAborted(w))return INVALID$3;const k=mergeValues(y.value,w.value);return k.valid?((isDirty(y)||isDirty(w))&&f.dirty(),{status:f.value,value:k.data}):(addIssueToContext(m,{code:ZodIssueCode.invalid_intersection_types}),INVALID$3)};return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([y,w])=>v(y,w)):v(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}}ZodIntersection.create=(p,u,f)=>new ZodIntersection({left:p,right:u,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(f)});class ZodTuple extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.array)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:m.parsedType}),INVALID$3;if(m.data.length<this._def.items.length)return addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID$3;!this._def.rest&&m.data.length>this._def.items.length&&(addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());const y=[...m.data].map((w,k)=>{const S=this._def.items[k]||this._def.rest;return S?S._parse(new ParseInputLazyPath(m,w,m.path,k)):null}).filter(w=>!!w);return m.common.async?Promise.all(y).then(w=>ParseStatus.mergeArray(f,w)):ParseStatus.mergeArray(f,y)}get items(){return this._def.items}rest(u){return new ZodTuple({...this._def,rest:u})}}ZodTuple.create=(p,u)=>{if(!Array.isArray(p))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:p,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(u)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.object)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:m.parsedType}),INVALID$3;const v=[],y=this._def.keyType,w=this._def.valueType;for(const k in m.data)v.push({key:y._parse(new ParseInputLazyPath(m,k,m.path,k)),value:w._parse(new ParseInputLazyPath(m,m.data[k],m.path,k)),alwaysSet:k in m.data});return m.common.async?ParseStatus.mergeObjectAsync(f,v):ParseStatus.mergeObjectSync(f,v)}get element(){return this._def.valueType}static create(u,f,m){return f instanceof ZodType?new ZodRecord({keyType:u,valueType:f,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(m)}):new ZodRecord({keyType:ZodString.create(),valueType:u,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(f)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.map)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:m.parsedType}),INVALID$3;const v=this._def.keyType,y=this._def.valueType,w=[...m.data.entries()].map(([k,S],M)=>({key:v._parse(new ParseInputLazyPath(m,k,m.path,[M,"key"])),value:y._parse(new ParseInputLazyPath(m,S,m.path,[M,"value"]))}));if(m.common.async){const k=new Map;return Promise.resolve().then(async()=>{for(const S of w){const M=await S.key,T=await S.value;if(M.status==="aborted"||T.status==="aborted")return INVALID$3;(M.status==="dirty"||T.status==="dirty")&&f.dirty(),k.set(M.value,T.value)}return{status:f.value,value:k}})}else{const k=new Map;for(const S of w){const M=S.key,T=S.value;if(M.status==="aborted"||T.status==="aborted")return INVALID$3;(M.status==="dirty"||T.status==="dirty")&&f.dirty(),k.set(M.value,T.value)}return{status:f.value,value:k}}}}ZodMap.create=(p,u,f)=>new ZodMap({valueType:u,keyType:p,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(f)});class ZodSet extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.parsedType!==ZodParsedType.set)return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:m.parsedType}),INVALID$3;const v=this._def;v.minSize!==null&&m.data.size<v.minSize.value&&(addIssueToContext(m,{code:ZodIssueCode.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),f.dirty()),v.maxSize!==null&&m.data.size>v.maxSize.value&&(addIssueToContext(m,{code:ZodIssueCode.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),f.dirty());const y=this._def.valueType;function w(S){const M=new Set;for(const T of S){if(T.status==="aborted")return INVALID$3;T.status==="dirty"&&f.dirty(),M.add(T.value)}return{status:f.value,value:M}}const k=[...m.data.values()].map((S,M)=>y._parse(new ParseInputLazyPath(m,S,m.path,M)));return m.common.async?Promise.all(k).then(S=>w(S)):w(k)}min(u,f){return new ZodSet({...this._def,minSize:{value:u,message:errorUtil.toString(f)}})}max(u,f){return new ZodSet({...this._def,maxSize:{value:u,message:errorUtil.toString(f)}})}size(u,f){return this.min(u,f).max(u,f)}nonempty(u){return this.min(1,u)}}ZodSet.create=(p,u)=>new ZodSet({valueType:p,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(u)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.function)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:f.parsedType}),INVALID$3;function m(k,S){return makeIssue({data:k,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,getErrorMap(),errorMap].filter(M=>!!M),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:S}})}function v(k,S){return makeIssue({data:k,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,getErrorMap(),errorMap].filter(M=>!!M),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:S}})}const y={errorMap:f.common.contextualErrorMap},w=f.data;if(this._def.returns instanceof ZodPromise){const k=this;return OK(async function(...S){const M=new ZodError([]),T=await k._def.args.parseAsync(S,y).catch(F=>{throw M.addIssue(m(S,F)),M}),E=await Reflect.apply(w,this,T);return await k._def.returns._def.type.parseAsync(E,y).catch(F=>{throw M.addIssue(v(E,F)),M})})}else{const k=this;return OK(function(...S){const M=k._def.args.safeParse(S,y);if(!M.success)throw new ZodError([m(S,M.error)]);const T=Reflect.apply(w,this,M.data),E=k._def.returns.safeParse(T,y);if(!E.success)throw new ZodError([v(T,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new ZodFunction({...this._def,args:ZodTuple.create(u).rest(ZodUnknown.create())})}returns(u){return new ZodFunction({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,f,m){return new ZodFunction({args:u||ZodTuple.create([]).rest(ZodUnknown.create()),returns:f||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(m)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(u){const{ctx:f}=this._processInputParams(u);return this._def.getter()._parse({data:f.data,path:f.path,parent:f})}}ZodLazy.create=(p,u)=>new ZodLazy({getter:p,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(u)});class ZodLiteral extends ZodType{_parse(u){if(u.data!==this._def.value){const f=this._getOrReturnCtx(u);return addIssueToContext(f,{received:f.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID$3}return{status:"valid",value:u.data}}get value(){return this._def.value}}ZodLiteral.create=(p,u)=>new ZodLiteral({value:p,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(u)});function createZodEnum(p,u){return new ZodEnum({values:p,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(u)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(u){if(typeof u.data!="string"){const f=this._getOrReturnCtx(u),m=this._def.values;return addIssueToContext(f,{expected:util$2.joinValues(m),received:f.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodEnum_cache,"f")||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values),"f"),!__classPrivateFieldGet(this,_ZodEnum_cache,"f").has(u.data)){const f=this._getOrReturnCtx(u),m=this._def.values;return addIssueToContext(f,{received:f.data,code:ZodIssueCode.invalid_enum_value,options:m}),INVALID$3}return OK(u.data)}get options(){return this._def.values}get enum(){const u={};for(const f of this._def.values)u[f]=f;return u}get Values(){const u={};for(const f of this._def.values)u[f]=f;return u}get Enum(){const u={};for(const f of this._def.values)u[f]=f;return u}extract(u,f=this._def){return ZodEnum.create(u,{...this._def,...f})}exclude(u,f=this._def){return ZodEnum.create(this.options.filter(m=>!u.includes(m)),{...this._def,...f})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(u){const f=util$2.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(u);if(m.parsedType!==ZodParsedType.string&&m.parsedType!==ZodParsedType.number){const v=util$2.objectValues(f);return addIssueToContext(m,{expected:util$2.joinValues(v),received:m.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util$2.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(u.data)){const v=util$2.objectValues(f);return addIssueToContext(m,{received:m.data,code:ZodIssueCode.invalid_enum_value,options:v}),INVALID$3}return OK(u.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(p,u)=>new ZodNativeEnum({values:p,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(u)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(u){const{ctx:f}=this._processInputParams(u);if(f.parsedType!==ZodParsedType.promise&&f.common.async===!1)return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:f.parsedType}),INVALID$3;const m=f.parsedType===ZodParsedType.promise?f.data:Promise.resolve(f.data);return OK(m.then(v=>this._def.type.parseAsync(v,{path:f.path,errorMap:f.common.contextualErrorMap})))}}ZodPromise.create=(p,u)=>new ZodPromise({type:p,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(u)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:f,ctx:m}=this._processInputParams(u),v=this._def.effect||null,y={addIssue:w=>{addIssueToContext(m,w),w.fatal?f.abort():f.dirty()},get path(){return m.path}};if(y.addIssue=y.addIssue.bind(y),v.type==="preprocess"){const w=v.transform(m.data,y);if(m.common.async)return Promise.resolve(w).then(async k=>{if(f.value==="aborted")return INVALID$3;const S=await this._def.schema._parseAsync({data:k,path:m.path,parent:m});return S.status==="aborted"?INVALID$3:S.status==="dirty"||f.value==="dirty"?DIRTY(S.value):S});{if(f.value==="aborted")return INVALID$3;const k=this._def.schema._parseSync({data:w,path:m.path,parent:m});return k.status==="aborted"?INVALID$3:k.status==="dirty"||f.value==="dirty"?DIRTY(k.value):k}}if(v.type==="refinement"){const w=k=>{const S=v.refinement(k,y);if(m.common.async)return Promise.resolve(S);if(S instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return k};if(m.common.async===!1){const k=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return k.status==="aborted"?INVALID$3:(k.status==="dirty"&&f.dirty(),w(k.value),{status:f.value,value:k.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(k=>k.status==="aborted"?INVALID$3:(k.status==="dirty"&&f.dirty(),w(k.value).then(()=>({status:f.value,value:k.value}))))}if(v.type==="transform")if(m.common.async===!1){const w=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!isValid$3(w))return w;const k=v.transform(w.value,y);if(k instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:f.value,value:k}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(w=>isValid$3(w)?Promise.resolve(v.transform(w.value,y)).then(k=>({status:f.value,value:k})):w);util$2.assertNever(v)}}ZodEffects.create=(p,u,f)=>new ZodEffects({schema:p,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:u,...processCreateParams(f)}),ZodEffects.createWithPreprocess=(p,u,f)=>new ZodEffects({schema:u,effect:{type:"preprocess",transform:p},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(f)});class ZodOptional extends ZodType{_parse(u){return this._getType(u)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodOptional.create=(p,u)=>new ZodOptional({innerType:p,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(u)});class ZodNullable extends ZodType{_parse(u){return this._getType(u)===ZodParsedType.null?OK(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodNullable.create=(p,u)=>new ZodNullable({innerType:p,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(u)});class ZodDefault extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u);let m=f.data;return f.parsedType===ZodParsedType.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:f.path,parent:f})}removeDefault(){return this._def.innerType}}ZodDefault.create=(p,u)=>new ZodDefault({innerType:p,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...processCreateParams(u)});class ZodCatch extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m={...f,common:{...f.common,issues:[]}},v=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return isAsync(v)?v.then(y=>({status:"valid",value:y.status==="valid"?y.value:this._def.catchValue({get error(){return new ZodError(m.common.issues)},input:m.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new ZodError(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(p,u)=>new ZodCatch({innerType:p,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...processCreateParams(u)});class ZodNaN extends ZodType{_parse(u){if(this._getType(u)!==ZodParsedType.nan){const m=this._getOrReturnCtx(u);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:m.parsedType}),INVALID$3}return{status:"valid",value:u.data}}}ZodNaN.create=p=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(p)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(u){const{ctx:f}=this._processInputParams(u),m=f.data;return this._def.type._parse({data:m,path:f.path,parent:f})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(u){const{status:f,ctx:m}=this._processInputParams(u);if(m.common.async)return(async()=>{const y=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return y.status==="aborted"?INVALID$3:y.status==="dirty"?(f.dirty(),DIRTY(y.value)):this._def.out._parseAsync({data:y.value,path:m.path,parent:m})})();{const v=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return v.status==="aborted"?INVALID$3:v.status==="dirty"?(f.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:m.path,parent:m})}}static create(u,f){return new ZodPipeline({in:u,out:f,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(u){const f=this._def.innerType._parse(u),m=v=>(isValid$3(v)&&(v.value=Object.freeze(v.value)),v);return isAsync(f)?f.then(v=>m(v)):m(f)}unwrap(){return this._def.innerType}}ZodReadonly.create=(p,u)=>new ZodReadonly({innerType:p,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(u)});function custom(p,u={},f){return p?ZodAny.create().superRefine((m,v)=>{var y,w;if(!p(m)){const k=typeof u=="function"?u(m):typeof u=="string"?{message:u}:u,S=(w=(y=k.fatal)!==null&&y!==void 0?y:f)!==null&&w!==void 0?w:!0,M=typeof k=="string"?{message:k}:k;v.addIssue({code:"custom",...M,fatal:S})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(p){p.ZodString="ZodString",p.ZodNumber="ZodNumber",p.ZodNaN="ZodNaN",p.ZodBigInt="ZodBigInt",p.ZodBoolean="ZodBoolean",p.ZodDate="ZodDate",p.ZodSymbol="ZodSymbol",p.ZodUndefined="ZodUndefined",p.ZodNull="ZodNull",p.ZodAny="ZodAny",p.ZodUnknown="ZodUnknown",p.ZodNever="ZodNever",p.ZodVoid="ZodVoid",p.ZodArray="ZodArray",p.ZodObject="ZodObject",p.ZodUnion="ZodUnion",p.ZodDiscriminatedUnion="ZodDiscriminatedUnion",p.ZodIntersection="ZodIntersection",p.ZodTuple="ZodTuple",p.ZodRecord="ZodRecord",p.ZodMap="ZodMap",p.ZodSet="ZodSet",p.ZodFunction="ZodFunction",p.ZodLazy="ZodLazy",p.ZodLiteral="ZodLiteral",p.ZodEnum="ZodEnum",p.ZodEffects="ZodEffects",p.ZodNativeEnum="ZodNativeEnum",p.ZodOptional="ZodOptional",p.ZodNullable="ZodNullable",p.ZodDefault="ZodDefault",p.ZodCatch="ZodCatch",p.ZodPromise="ZodPromise",p.ZodBranded="ZodBranded",p.ZodPipeline="ZodPipeline",p.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(p,u={message:`Input not instance of ${p.name}`})=>custom(f=>f instanceof p,u),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType$1=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:p=>ZodString.create({...p,coerce:!0}),number:p=>ZodNumber.create({...p,coerce:!0}),boolean:p=>ZodBoolean.create({...p,coerce:!0}),bigint:p=>ZodBigInt.create({...p,coerce:!0}),date:p=>ZodDate.create({...p,coerce:!0})},NEVER=INVALID$3;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID:INVALID$3,DIRTY,OK,isAborted,isDirty,isValid:isValid$3,isAsync,get util(){return util$2},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType$1,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const fieldKey=z.string().refine(p=>p!==InternalSearchFilterOperator.COMPLEX_ID_OPERATOR,{message:`Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`}),stringBasicFilter=z.record(fieldKey,z.string()),basicFilter=z.record(fieldKey,z.any()),arrayFilter$2=z.record(fieldKey,z.union([z.any().array(),z.string()])),logicFilter=z.lazy(()=>z.object({conditions:z.array(z.object(queryFilterValidation))})),stringOrNumber=z.union([z.string(),z.number()]),queryFilterValidation={[BasicOperator.STRING]:stringBasicFilter.optional(),[BasicOperator.FUZZY]:stringBasicFilter.optional(),[RangeOperator.RANGE]:z.record(fieldKey,z.union([z.object({high:stringOrNumber,low:stringOrNumber}),z.object({high:stringOrNumber}),z.object({low:stringOrNumber})])).optional(),[BasicOperator.EQUAL]:basicFilter.optional(),[BasicOperator.NOT_EQUAL]:basicFilter.optional(),[BasicOperator.EMPTY]:basicFilter.optional(),[BasicOperator.NOT_EMPTY]:basicFilter.optional(),[ArrayOperator.ONE_OF]:arrayFilter$2.optional(),[ArrayOperator.CONTAINS]:arrayFilter$2.optional(),[ArrayOperator.NOT_CONTAINS]:arrayFilter$2.optional(),[ArrayOperator.CONTAINS_ANY]:arrayFilter$2.optional(),[LogicalOperator.AND]:logicFilter.optional(),[LogicalOperator.OR]:logicFilter.optional()};z.object({query:z.object({allOr:z.boolean().optional(),onEmptyFilter:z.nativeEnum(EmptyFilterOption).optional(),...queryFilterValidation}).optional(),paginate:z.boolean().optional(),bookmark:z.union([z.string(),z.number()]).nullish(),limit:z.number().optional(),sort:z.string().nullish(),sortOrder:z.nativeEnum(SortOrder).optional(),sortType:z.nativeEnum(SortType).nullish(),version:z.string().optional(),disableEscaping:z.boolean().optional(),countRows:z.boolean().optional()});var MaintenanceType=(p=>(p.SQS_MISSING="sqs_missing",p))(MaintenanceType||{});AIOperationEnum.SUMMARISE_TEXT+"",OperationFieldTypeEnum.MULTI_COLUMN,AIOperationEnum.CLEAN_DATA+"",OperationFieldTypeEnum.COLUMN,AIOperationEnum.TRANSLATE+"",OperationFieldTypeEnum.COLUMN,OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.CATEGORISE_TEXT+"",OperationFieldTypeEnum.MULTI_COLUMN,OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.SENTIMENT_ANALYSIS+"",OperationFieldTypeEnum.COLUMN,AIOperationEnum.PROMPT+"",OperationFieldTypeEnum.BINDABLE_TEXT,AIOperationEnum.SEARCH_WEB+"",OperationFieldTypeEnum.MULTI_COLUMN;var Header=(p=>(p.API_KEY="x-budibase-api-key",p.LICENSE_KEY="x-budibase-license-key",p.API_VER="x-budibase-api-version",p.APP_ID="x-budibase-app-id",p.SESSION_ID="x-budibase-session-id",p.TYPE="x-budibase-type",p.PREVIEW_ROLE="x-budibase-role",p.TENANT_ID="x-budibase-tenant-id",p.VERIFICATION_CODE="x-budibase-verification-code",p.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",p.RESET_PASSWORD_CODE="x-budibase-reset-password-code",p.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",p.TOKEN="x-budibase-token",p.CSRF_TOKEN="x-csrf-token",p.CORRELATION_ID="x-budibase-correlation-id",p.AUTHORIZATION="authorization",p.MIGRATING_APP="x-budibase-migrating-app",p.COOKIE="cookie",p))(Header||{});FieldType.STRING+"",FieldType.STRING,FieldType.OPTIONS,FieldType.LONGFORM,FieldType.BARCODEQR,FieldType.OPTIONS+"",FieldType.OPTIONS,FieldType.STRING,FieldType.LONGFORM,FieldType.BARCODEQR,FieldType.LONGFORM+"",FieldType.LONGFORM,FieldType.STRING,FieldType.OPTIONS,FieldType.BARCODEQR,FieldType.BARCODEQR+"",FieldType.BARCODEQR,FieldType.STRING,FieldType.OPTIONS,FieldType.LONGFORM,FieldType.NUMBER+"",FieldType.NUMBER,FieldType.BOOLEAN;const ThemeClassPrefix="spectrum--";Theme.DARKEST;const DefaultAppTheme=Theme.LIGHT,ThemeOptions=[{id:Theme.LIGHT,name:"Light"},{id:Theme.DARKEST,name:"Dark"},{id:Theme.NORD,name:"Nord",base:Theme.DARKEST},{id:Theme.MIDNIGHT,name:"Midnight",base:Theme.DARKEST}],OperatorOptions={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than or equal to"},LessThan:{value:"rangeHigh",label:"Less than or equal to"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},SqlNumberTypeRangeMap={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}};var SocketEvent=(p=>(p.UserUpdate="UserUpdate",p.UserDisconnect="UserDisconnect",p.Heartbeat="Heartbeat",p))(SocketEvent||{}),GridSocketEvent=(p=>(p.RowChange="RowChange",p.DatasourceChange="DatasourceChange",p.SelectDatasource="SelectDatasource",p.SelectCell="SelectCell",p))(GridSocketEvent||{});const SocketSessionTTL=60,ValidColumnNameRegex=/^[_a-zA-Z0-9\s]*$/g;var BpmCorrelationKey=(p=>(p.ONBOARDING="budibase:onboarding:correlationkey",p.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",p))(BpmCorrelationKey||{});const DEFAULT_BB_DATASOURCE_ID="datasource_internal_bb_default";var commonjsGlobal$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}function getAugmentedNamespace(p){if(p.__esModule)return p;var u=p.default;if(typeof u=="function"){var f=function m(){return this instanceof m?Reflect.construct(u,arguments,this.constructor):u.apply(this,arguments)};f.prototype=u.prototype}else f={};return Object.defineProperty(f,"__esModule",{value:!0}),Object.keys(p).forEach(function(m){var v=Object.getOwnPropertyDescriptor(p,m);Object.defineProperty(f,m,v.get?v:{enumerable:!0,get:function(){return p[m]}})}),f}var dayjs_min$1={exports:{}};(function(p,u){(function(f,m){p.exports=m()})(commonjsGlobal$1,function(){var f=1e3,m=6e4,v=36e5,y="millisecond",w="second",k="minute",S="hour",M="day",T="week",E="month",H="quarter",F="year",Z="date",$="Invalid Date",J=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ae=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ie={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Ye){var be=["th","st","nd","rd"],Be=Ye%100;return"["+Ye+(be[(Be-20)%10]||be[Be]||be[0])+"]"}},he=function(Ye,be,Be){var Xe=String(Ye);return!Xe||Xe.length>=be?Ye:""+Array(be+1-Xe.length).join(Be)+Ye},fe={s:he,z:function(Ye){var be=-Ye.utcOffset(),Be=Math.abs(be),Xe=Math.floor(Be/60),Ne=Be%60;return(be<=0?"+":"-")+he(Xe,2,"0")+":"+he(Ne,2,"0")},m:function Ye(be,Be){if(be.date()<Be.date())return-Ye(Be,be);var Xe=12*(Be.year()-be.year())+(Be.month()-be.month()),Ne=be.clone().add(Xe,E),Je=Be-Ne<0,ft=be.clone().add(Xe+(Je?-1:1),E);return+(-(Xe+(Be-Ne)/(Je?Ne-ft:ft-Ne))||0)},a:function(Ye){return Ye<0?Math.ceil(Ye)||0:Math.floor(Ye)},p:function(Ye){return{M:E,y:F,w:T,d:M,D:Z,h:S,m:k,s:w,ms:y,Q:H}[Ye]||String(Ye||"").toLowerCase().replace(/s$/,"")},u:function(Ye){return Ye===void 0}},me="en",ve={};ve[me]=ie;var Ce="$isDayjsObject",Ee=function(Ye){return Ye instanceof Ue||!(!Ye||!Ye[Ce])},Se=function Ye(be,Be,Xe){var Ne;if(!be)return me;if(typeof be=="string"){var Je=be.toLowerCase();ve[Je]&&(Ne=Je),Be&&(ve[Je]=Be,Ne=Je);var ft=be.split("-");if(!Ne&&ft.length>1)return Ye(ft[0])}else{var Tt=be.name;ve[Tt]=be,Ne=Tt}return!Xe&&Ne&&(me=Ne),Ne||!Xe&&me},Ie=function(Ye,be){if(Ee(Ye))return Ye.clone();var Be=typeof be=="object"?be:{};return Be.date=Ye,Be.args=arguments,new Ue(Be)},xe=fe;xe.l=Se,xe.i=Ee,xe.w=function(Ye,be){return Ie(Ye,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var Ue=function(){function Ye(Be){this.$L=Se(Be.locale,null,!0),this.parse(Be),this.$x=this.$x||Be.x||{},this[Ce]=!0}var be=Ye.prototype;return be.parse=function(Be){this.$d=function(Xe){var Ne=Xe.date,Je=Xe.utc;if(Ne===null)return new Date(NaN);if(xe.u(Ne))return new Date;if(Ne instanceof Date)return new Date(Ne);if(typeof Ne=="string"&&!/Z$/i.test(Ne)){var ft=Ne.match(J);if(ft){var Tt=ft[2]-1||0,qe=(ft[7]||"0").substring(0,3);return Je?new Date(Date.UTC(ft[1],Tt,ft[3]||1,ft[4]||0,ft[5]||0,ft[6]||0,qe)):new Date(ft[1],Tt,ft[3]||1,ft[4]||0,ft[5]||0,ft[6]||0,qe)}}return new Date(Ne)}(Be),this.init()},be.init=function(){var Be=this.$d;this.$y=Be.getFullYear(),this.$M=Be.getMonth(),this.$D=Be.getDate(),this.$W=Be.getDay(),this.$H=Be.getHours(),this.$m=Be.getMinutes(),this.$s=Be.getSeconds(),this.$ms=Be.getMilliseconds()},be.$utils=function(){return xe},be.isValid=function(){return this.$d.toString()!==$},be.isSame=function(Be,Xe){var Ne=Ie(Be);return this.startOf(Xe)<=Ne&&Ne<=this.endOf(Xe)},be.isAfter=function(Be,Xe){return Ie(Be)<this.startOf(Xe)},be.isBefore=function(Be,Xe){return this.endOf(Xe)<Ie(Be)},be.$g=function(Be,Xe,Ne){return xe.u(Be)?this[Xe]:this.set(Ne,Be)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function(Be,Xe){var Ne=this,Je=!!xe.u(Xe)||Xe,ft=xe.p(Be),Tt=function(jt,Qt){var Nt=xe.w(Ne.$u?Date.UTC(Ne.$y,Qt,jt):new Date(Ne.$y,Qt,jt),Ne);return Je?Nt:Nt.endOf(M)},qe=function(jt,Qt){return xe.w(Ne.toDate()[jt].apply(Ne.toDate("s"),(Je?[0,0,0,0]:[23,59,59,999]).slice(Qt)),Ne)},Ge=this.$W,dt=this.$M,Ct=this.$D,ot="set"+(this.$u?"UTC":"");switch(ft){case F:return Je?Tt(1,0):Tt(31,11);case E:return Je?Tt(1,dt):Tt(0,dt+1);case T:var Wt=this.$locale().weekStart||0,Ke=(Ge<Wt?Ge+7:Ge)-Wt;return Tt(Je?Ct-Ke:Ct+(6-Ke),dt);case M:case Z:return qe(ot+"Hours",0);case S:return qe(ot+"Minutes",1);case k:return qe(ot+"Seconds",2);case w:return qe(ot+"Milliseconds",3);default:return this.clone()}},be.endOf=function(Be){return this.startOf(Be,!1)},be.$set=function(Be,Xe){var Ne,Je=xe.p(Be),ft="set"+(this.$u?"UTC":""),Tt=(Ne={},Ne[M]=ft+"Date",Ne[Z]=ft+"Date",Ne[E]=ft+"Month",Ne[F]=ft+"FullYear",Ne[S]=ft+"Hours",Ne[k]=ft+"Minutes",Ne[w]=ft+"Seconds",Ne[y]=ft+"Milliseconds",Ne)[Je],qe=Je===M?this.$D+(Xe-this.$W):Xe;if(Je===E||Je===F){var Ge=this.clone().set(Z,1);Ge.$d[Tt](qe),Ge.init(),this.$d=Ge.set(Z,Math.min(this.$D,Ge.daysInMonth())).$d}else Tt&&this.$d[Tt](qe);return this.init(),this},be.set=function(Be,Xe){return this.clone().$set(Be,Xe)},be.get=function(Be){return this[xe.p(Be)]()},be.add=function(Be,Xe){var Ne,Je=this;Be=Number(Be);var ft=xe.p(Xe),Tt=function(dt){var Ct=Ie(Je);return xe.w(Ct.date(Ct.date()+Math.round(dt*Be)),Je)};if(ft===E)return this.set(E,this.$M+Be);if(ft===F)return this.set(F,this.$y+Be);if(ft===M)return Tt(1);if(ft===T)return Tt(7);var qe=(Ne={},Ne[k]=m,Ne[S]=v,Ne[w]=f,Ne)[ft]||1,Ge=this.$d.getTime()+Be*qe;return xe.w(Ge,this)},be.subtract=function(Be,Xe){return this.add(-1*Be,Xe)},be.format=function(Be){var Xe=this,Ne=this.$locale();if(!this.isValid())return Ne.invalidDate||$;var Je=Be||"YYYY-MM-DDTHH:mm:ssZ",ft=xe.z(this),Tt=this.$H,qe=this.$m,Ge=this.$M,dt=Ne.weekdays,Ct=Ne.months,ot=Ne.meridiem,Wt=function(Qt,Nt,Mt,yt){return Qt&&(Qt[Nt]||Qt(Xe,Je))||Mt[Nt].slice(0,yt)},Ke=function(Qt){return xe.s(Tt%12||12,Qt,"0")},jt=ot||function(Qt,Nt,Mt){var yt=Qt<12?"AM":"PM";return Mt?yt.toLowerCase():yt};return Je.replace(ae,function(Qt,Nt){return Nt||function(Mt){switch(Mt){case"YY":return String(Xe.$y).slice(-2);case"YYYY":return xe.s(Xe.$y,4,"0");case"M":return Ge+1;case"MM":return xe.s(Ge+1,2,"0");case"MMM":return Wt(Ne.monthsShort,Ge,Ct,3);case"MMMM":return Wt(Ct,Ge);case"D":return Xe.$D;case"DD":return xe.s(Xe.$D,2,"0");case"d":return String(Xe.$W);case"dd":return Wt(Ne.weekdaysMin,Xe.$W,dt,2);case"ddd":return Wt(Ne.weekdaysShort,Xe.$W,dt,3);case"dddd":return dt[Xe.$W];case"H":return String(Tt);case"HH":return xe.s(Tt,2,"0");case"h":return Ke(1);case"hh":return Ke(2);case"a":return jt(Tt,qe,!0);case"A":return jt(Tt,qe,!1);case"m":return String(qe);case"mm":return xe.s(qe,2,"0");case"s":return String(Xe.$s);case"ss":return xe.s(Xe.$s,2,"0");case"SSS":return xe.s(Xe.$ms,3,"0");case"Z":return ft}return null}(Qt)||ft.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function(Be,Xe,Ne){var Je,ft=this,Tt=xe.p(Xe),qe=Ie(Be),Ge=(qe.utcOffset()-this.utcOffset())*m,dt=this-qe,Ct=function(){return xe.m(ft,qe)};switch(Tt){case F:Je=Ct()/12;break;case E:Je=Ct();break;case H:Je=Ct()/3;break;case T:Je=(dt-Ge)/6048e5;break;case M:Je=(dt-Ge)/864e5;break;case S:Je=dt/v;break;case k:Je=dt/m;break;case w:Je=dt/f;break;default:Je=dt}return Ne?Je:xe.a(Je)},be.daysInMonth=function(){return this.endOf(E).$D},be.$locale=function(){return ve[this.$L]},be.locale=function(Be,Xe){if(!Be)return this.$L;var Ne=this.clone(),Je=Se(Be,Xe,!0);return Je&&(Ne.$L=Je),Ne},be.clone=function(){return xe.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},Ye}(),$e=Ue.prototype;return Ie.prototype=$e,[["$ms",y],["$s",w],["$m",k],["$H",S],["$W",M],["$M",E],["$y",F],["$D",Z]].forEach(function(Ye){$e[Ye[1]]=function(be){return this.$g(be,Ye[0],Ye[1])}}),Ie.extend=function(Ye,be){return Ye.$i||(Ye(be,Ue,Ie),Ye.$i=!0),Ie},Ie.locale=Se,Ie.isDayjs=Ee,Ie.unix=function(Ye){return Ie(1e3*Ye)},Ie.en=ve[me],Ie.Ls=ve,Ie.p={},Ie})})(dayjs_min$1);var dayjs_minExports=dayjs_min$1.exports;const dayjs=getDefaultExportFromCjs$1(dayjs_minExports);var lodash={exports:{}};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Lodash <https://lodash.com/>
|
|
26
26
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -380,7 +380,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
380
380
|
</g>
|
|
381
381
|
</g>
|
|
382
382
|
</svg>
|
|
383
|
-
`;var HTTPMethod=(p=>(p.POST="POST",p.PATCH="PATCH",p.GET="GET",p.PUT="PUT",p.DELETE="DELETE",p))(HTTPMethod||{});const BannedSearchTypes=[FieldType.LINK,FieldType.ATTACHMENT_SINGLE,FieldType.ATTACHMENTS,FieldType.FORMULA,FieldType.JSON,FieldType.ATTACHMENT_SINGLE,FieldType.SIGNATURE_SINGLE,"jsonarray","queryarray"],Cookies={Auth:"budibase:auth",CurrentApp:"budibase:currentapp",ReturnUrl:"budibase:returnurl",AccountReturnUrl:"budibase:account:returnurl",OnboardingProcessCorrelationKey:BpmCorrelationKey.ONBOARDING};var TableNames=(p=>(p.USERS="ta_users",p))(TableNames||{});const BudibaseRoles={AppUser:"appUser",Developer:"developer",Creator:"creator",Admin:"admin",Owner:"owner"},BudibaseRoleOptionsOld=[{label:"Developer",value:BudibaseRoles.Developer}],BudibaseRoleOptions=[{label:"Account admin",value:BudibaseRoles.Admin,subtitle:"Has full access to all apps and settings in your account",sortOrder:1},{label:"Creator",value:BudibaseRoles.Creator,subtitle:"Can create and edit apps they have access to",sortOrder:2},{label:"App user",value:BudibaseRoles.AppUser,subtitle:"Can only use published apps they have access to",sortOrder:3}],ExtendedBudibaseRoleOptions=[{label:"Account holder",value:BudibaseRoles.Owner,sortOrder:0},...BudibaseRoleOptions,...BudibaseRoleOptionsOld],PlanType={FREE:"free",TEAM:"team",PRO:"pro",BUSINESS:"business",PREMIUM:"premium",ENTERPRISE:"enterprise",ENTERPRISE_BASIC_TRIAL:"enterprise_basic_trial"},ApiVersion="1",Roles={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER",CREATOR:"CREATOR"},EventPublishType={ENV_VAR_UPGRADE_PANEL_OPENED:"environment_variable_upgrade_panel_opened"},ContextScopes={Local:"local",Global:"global"},TypeIconMap={[FieldType.STRING]:"Text",[FieldType.OPTIONS]:"Dropdown",[FieldType.DATETIME]:"Calendar",[FieldType.BARCODEQR]:"Camera",[FieldType.SIGNATURE_SINGLE]:"AnnotatePen",[FieldType.LONGFORM]:"TextAlignLeft",[FieldType.ARRAY]:"Duplicate",[FieldType.NUMBER]:"123",[FieldType.BOOLEAN]:"Boolean",[FieldType.ATTACHMENTS]:"DocumentFragmentGroup",[FieldType.ATTACHMENT_SINGLE]:"DocumentFragment",[FieldType.LINK]:"DataCorrelated",[FieldType.FORMULA]:"Calculator",[FieldType.AI]:"MagicWand",[FieldType.JSON]:"Brackets",[FieldType.BIGINT]:"TagBold",[FieldType.AUTO]:"Shapes",[FieldType.BB_REFERENCE]:{[BBReferenceFieldSubType.USER]:"UserGroup",[BBReferenceFieldSubType.USERS]:"UserGroup"},[FieldType.BB_REFERENCE_SINGLE]:{[BBReferenceFieldSubType.USER]:"User"}},OptionColours=[...new Array(12).keys()].map(p=>`hsla(${(p+1)*222%360}, 90%, 75%, 0.3)`),FilterOperator={ANY:"any",ALL:"all"},OnEmptyFilter={RETURN_ALL:"all",RETURN_NONE:"none"},FilterValueType={BINDING:"Binding",VALUE:"Value"},FieldPermissions={WRITABLE:"writable",READONLY:"readonly",HIDDEN:"hidden"},Constants$2=Object.freeze(Object.defineProperty({__proto__:null,ApiVersion,BannedSearchTypes,BudibaseRoleOptions,BudibaseRoleOptionsOld,BudibaseRoles,ContextScopes,Cookies,DEFAULT_BB_DATASOURCE_ID,EventPublishType,ExtendedBudibaseRoleOptions,Features:Feature,FieldPermissions,FilterOperator,FilterValueType,OnEmptyFilter,OperatorOptions,OptionColours,PlanType,Roles,SqlNumberTypeRangeMap,TableNames,TypeIconMap},Symbol.toStringTag,{value:"Module"})),buildAnalyticsEndpoints=p=>({getAnalyticsStatus:async()=>await p.get({url:"/api/bbtel"}),analyticsPing:async u=>await p.post({url:"/api/bbtel/ping",body:{...u,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}})}),buildAIEndpoints=p=>({generateCronExpression:async u=>await p.post({url:"/api/ai/cron",body:{prompt:u}})}),buildAppEndpoints=p=>({fetchAppPackage:async u=>await p.get({url:`/api/applications/${u}/appPackage`}),saveAppMetadata:async(u,f)=>await p.put({url:`/api/applications/${u}`,body:f}),publishAppChanges:async u=>await p.post({url:`/api/applications/${u}/publish`}),revertAppChanges:async u=>await p.post({url:`/api/dev/${u}/revert`}),updateAppClientVersion:async u=>await p.post({url:`/api/applications/${u}/client/update`}),revertAppClientVersion:async u=>await p.post({url:`/api/applications/${u}/client/revert`}),getAppDeployments:async()=>await p.get({url:"/api/deployments"}),createApp:async u=>await p.post({url:"/api/applications",body:u,json:!1}),duplicateApp:async(u,f)=>await p.post({url:`/api/applications/${u}/duplicate`,body:f,json:!1}),updateAppFromExport:async(u,f)=>{const m=getDevAppID(u);return await p.post({url:`/api/applications/${m}/import`,body:f,json:!1})},importApps:async u=>await p.post({url:"/api/cloud/import",body:u,json:!1}),unpublishApp:async u=>await p.post({url:`/api/applications/${u}/unpublish`}),deleteApp:async u=>await p.delete({url:`/api/applications/${u}`}),releaseAppLock:async u=>await p.delete({url:`/api/dev/${u}/lock`}),fetchSystemDebugInfo:async()=>await p.get({url:"/api/debug/diagnostics"}),syncApp:async u=>await p.post({url:`/api/applications/${u}/sync`}),getApps:async()=>await p.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async u=>await p.get({url:`/api/${u}/components/definitions`}),addSampleData:async u=>await p.post({url:`/api/applications/${u}/sample`}),setRevertableVersion:async(u,f)=>await p.post({url:`/api/applications/${u}/setRevertableVersion`,body:{revertableVersion:f}})}),buildAttachmentEndpoints=p=>{const u={getSignedDatasourceURL:async(f,m,v)=>await p.post({url:`/api/attachments/${f}/url`,body:{bucket:m,key:v}})};return{...u,uploadAttachment:async(f,m)=>await p.post({url:`/api/attachments/${f}/upload`,body:m,json:!1}),uploadBuilderAttachment:async f=>await p.post({url:"/api/attachments/process",body:f,json:!1}),externalUpload:async(f,m,v,y)=>{const{signedUrl:w,publicUrl:k}=await u.getSignedDatasourceURL(f,m,v);return w?(await p.put({url:w,body:y,json:!1,external:!0,parseResponse:S=>S}),{publicUrl:k}):{publicUrl:void 0}},downloadAttachment:async(f,m,v)=>await p.get({url:`/api/${f}/rows/${m}/attachment/${v}`,parseResponse:y=>y,suppressErrors:!0})}},buildAuthEndpoints=p=>({logIn:async(u,f,m)=>await p.post({url:`/api/global/auth/${u}/login`,body:{username:f,password:m}}),logOut:async()=>await p.post({url:"/api/global/auth/logout"}),setInitInfo:async u=>await p.post({url:"/api/global/auth/init",body:u}),getInitInfo:async()=>await p.get({url:"/api/global/auth/init"}),requestForgotPassword:async(u,f)=>await p.post({url:`/api/global/auth/${u}/reset`,body:{email:f}}),resetPassword:async(u,f,m)=>await p.post({url:`/api/global/auth/${u}/reset/update`,body:{password:f,resetCode:m}})}),buildAutomationEndpoints=p=>({triggerAutomation:async(u,f,m)=>await p.post({url:`/api/automations/${u}/trigger`,body:{fields:f,timeout:m}}),testAutomation:async(u,f)=>await p.post({url:`/api/automations/${u}/test`,body:f}),getAutomations:async()=>await p.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await p.get({url:"/api/automations/definitions/list"}),createAutomation:async u=>await p.post({url:"/api/automations",body:u}),updateAutomation:async u=>await p.put({url:"/api/automations",body:u}),deleteAutomation:async(u,f)=>await p.delete({url:`/api/automations/${u}/${f}`}),getAutomationLogs:async u=>await p.post({url:"/api/automations/logs/search",body:u}),clearAutomationLogErrors:async(u,f)=>await p.delete({url:"/api/automations/logs",body:{appId:f,automationId:u}})}),buildConfigEndpoints=p=>({saveConfig:async u=>await p.post({url:"/api/global/configs",body:u}),getConfig:async u=>await p.get({url:`/api/global/configs/${u}`}),deleteConfig:async(u,f)=>await p.delete({url:`/api/global/configs/${u}/${f}`}),getTenantConfig:async u=>await p.get({url:`/api/global/configs/public?tenantId=${u}`}),getOIDCConfigs:async u=>await p.get({url:`/api/global/configs/public/oidc?tenantId=${u}`}),getChecklist:async u=>await p.get({url:`/api/global/configs/checklist?tenantId=${u}`}),uploadLogo:async u=>await p.post({url:"/api/global/configs/upload/settings/logoUrl",body:u,json:!1}),uploadFavicon:async u=>await p.post({url:"/api/global/configs/upload/settings/faviconUrl",body:u,json:!1}),uploadOIDCLogo:async(u,f)=>await p.post({url:`/api/global/configs/upload/logos_oidc/${u}`,body:f,json:!1}),getOIDCLogos:async()=>await p.get({url:"/api/global/configs/logos_oidc"})}),buildDatasourceEndpoints=p=>({getDatasources:async()=>await p.get({url:"/api/datasources"}),buildDatasourceSchema:async(u,f)=>await p.post({url:`/api/datasources/${u}/schema`,body:{tablesFilter:f}}),createDatasource:async u=>await p.post({url:"/api/datasources",body:u}),updateDatasource:async u=>await p.put({url:`/api/datasources/${u._id}`,body:u}),deleteDatasource:async(u,f)=>await p.delete({url:`/api/datasources/${u}/${f}`}),validateDatasource:async u=>await p.post({url:"/api/datasources/verify",body:{datasource:u}}),fetchInfoForDatasource:async u=>await p.post({url:"/api/datasources/info",body:{datasource:u}}),fetchExternalSchema:async u=>await p.get({url:`/api/datasources/${u}/schema/external`})}),buildFlagEndpoints=p=>({getFlags:async()=>await p.get({url:"/api/users/flags"}),updateFlag:async(u,f)=>await p.post({url:"/api/users/flags",body:{flag:u,value:f}}),toggleUiFeature:async u=>await p.post({url:`/api/beta/${u}`})}),buildLayoutEndpoints=p=>({saveLayout:async u=>await p.post({url:"/api/layouts",body:u}),deleteLayout:async(u,f)=>await p.delete({url:`/api/layouts/${u}/${f}`})}),buildOtherEndpoints=p=>({getEnvironment:async()=>await p.get({url:"/api/system/environment"}),getSystemStatus:async()=>await p.get({url:"/api/system/status"}),getIntegrations:async()=>await p.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await p.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await p.get({url:"/api/permission/builtin"})}),buildPermissionsEndpoints=p=>({getPermissionForResource:async u=>await p.get({url:`/api/permission/${u}`}),updatePermissionForResource:async(u,f,m)=>await p.post({url:`/api/permission/${f}/${u}/${m}`}),removePermissionFromResource:async(u,f,m)=>await p.delete({url:`/api/permission/${f}/${u}/${m}`}),getDependants:async u=>await p.get({url:`/api/permission/${u}/dependants`})}),buildQueryEndpoints=p=>({executeQuery:async(u,{pagination:f,parameters:m}={})=>await p.post({url:`/api/v2/queries/${u}`,body:{parameters:m,pagination:f}}),fetchQueryDefinition:async u=>await p.get({url:`/api/queries/${u}`,cache:!0}),getQueries:async()=>await p.get({url:"/api/queries"}),saveQuery:async u=>await p.post({url:"/api/queries",body:u}),deleteQuery:async(u,f)=>await p.delete({url:`/api/queries/${u}/${f}`}),importQueries:async u=>await p.post({url:"/api/queries/import",body:u}),previewQuery:async u=>await p.post({url:"/api/queries/preview",body:u})}),buildRelationshipEndpoints=p=>({fetchRelationshipData:async(u,f,m)=>{const v=await p.get({url:`/api/${u}/${f}/enrich?field=${m}`});return m?v[m]||[]:[v]}}),buildRoleEndpoints=p=>({deleteRole:async(u,f)=>await p.delete({url:`/api/roles/${u}/${f}`}),saveRole:async u=>await p.post({url:"/api/roles",body:u}),getRoles:async()=>await p.get({url:"/api/roles"}),getRolesForApp:async u=>await p.get({url:`/api/global/roles/${u}`}),getAccessibleRoles:async()=>await p.get({url:"/api/roles/accessible"})}),buildRouteEndpoints=p=>({fetchClientAppRoutes:async()=>await p.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await p.get({url:"/api/routing"})}),buildRowEndpoints=p=>({fetchRow:async(u,f)=>await p.get({url:`/api/${u}/rows/${f}`}),saveRow:async(u,f=!1)=>{const m=u._viewId||u.tableId;return await p.post({url:`/api/${m}/rows`,body:u,suppressErrors:f})},patchRow:async(u,f=!1)=>{const m=u._viewId||u.tableId;return await p.patch({url:`/api/${m}/rows`,body:u,suppressErrors:f})},deleteRow:async(u,f)=>await p.delete({url:`/api/${u}/rows`,body:{_id:f}}),deleteRows:async(u,f)=>(f.forEach(m=>{typeof m=="object"&&(m==null||delete m._viewId)}),await p.delete({url:`/api/${u}/rows`,body:{rows:f}})),exportRows:async(u,f,m)=>await p.post({url:`/api/${u}/rows/exportRows?format=${f}`,body:m,parseResponse:async v=>await v.text()})}),buildScreenEndpoints=p=>({saveScreen:async u=>await p.post({url:"/api/screens",body:u}),deleteScreen:async(u,f)=>await p.delete({url:`/api/screens/${u}/${f}`})}),buildTableEndpoints=p=>({fetchTableDefinition:async u=>await p.get({url:`/api/tables/${u}`,cache:!0}),fetchTableData:async u=>await p.get({url:`/api/${u}/rows`}),searchTable:async(u,f)=>await p.post({url:`/api/${u}/search`,body:f}),importTableData:async(u,f,m)=>await p.post({url:`/api/tables/${u}/import`,body:{rows:f,identifierFields:m}}),csvToJson:async u=>await p.post({url:"/api/convert/csvToJson",body:{csvString:u}}),getTables:async()=>await p.get({url:"/api/tables"}),getTable:async u=>await p.get({url:`/api/tables/${u}`}),saveTable:async u=>await p.post({url:"/api/tables",body:u}),deleteTable:async(u,f)=>await p.delete({url:`/api/tables/${u}/${f}`}),validateNewTableImport:async(u,f)=>await p.post({url:"/api/tables/validateNewTableImport",body:{rows:u,schema:f}}),validateExistingTableImport:async(u,f)=>await p.post({url:"/api/tables/validateExistingTableImport",body:{rows:u,tableId:f}}),migrateColumn:async(u,f,m)=>await p.post({url:`/api/tables/${u}/migrate`,body:{oldColumn:f,newColumn:m}})}),buildTemplateEndpoints=p=>({getEmailTemplateDefinitions:async()=>await p.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await p.get({url:"/api/global/template/email"}),saveEmailTemplate:async u=>await p.post({url:"/api/global/template",body:u}),getAppTemplates:async()=>await p.get({url:"/api/templates"})}),buildUserEndpoints=p=>({getUsers:async()=>await p.get({url:"/api/global/users"}),searchUsers:async u=>await p.post({url:"/api/global/users/search",body:u}),getUser:async u=>await p.get({url:`/api/global/users/${u}`}),updateOwnMetadata:async u=>await p.post({url:"/api/users/metadata/self",body:u}),createAdminUser:async u=>await p.post({url:"/api/global/users/init",body:u}),saveUser:async u=>await p.post({url:"/api/global/users",body:u}),createUsers:async(u,f)=>(await p.post({url:"/api/global/users/bulk",body:{create:{users:u,groups:f}}})).created,deleteUser:async u=>await p.delete({url:`/api/global/users/${u}`}),deleteUsers:async u=>(await p.post({url:"/api/global/users/bulk",body:{delete:{users:u}}})).deleted,onboardUsers:async u=>await p.post({url:"/api/global/users/onboard",body:u}),updateUserInvite:async(u,f)=>await p.post({url:`/api/global/users/invite/update/${u}`,body:f}),getUserInvite:async u=>await p.get({url:`/api/global/users/invite/${u}`}),getUserInvites:async()=>await p.get({url:"/api/global/users/invites"}),inviteUsers:async u=>await p.post({url:"/api/global/users/multi/invite",body:u}),removeUserInvites:async u=>await p.post({url:"/api/global/users/multi/invite/delete",body:u}),acceptInvite:async u=>await p.post({url:"/api/global/users/invite/accept",body:u}),getUserCountByApp:async u=>(await p.get({url:`/api/global/users/count/${u}`})).userCount,addAppBuilder:async(u,f)=>await p.post({url:`/api/global/users/${u}/app/${f}/builder`}),removeAppBuilder:async(u,f)=>await p.delete({url:`/api/global/users/${u}/app/${f}/builder`}),getAccountHolder:async()=>await p.get({url:"/api/global/users/accountholder"})}),buildSelfEndpoints=p=>({generateAPIKey:async()=>{const u=await p.post({url:"/api/global/self/api_key"});return u==null?void 0:u.apiKey},fetchDeveloperInfo:async()=>p.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await p.get({url:"/api/self"}),fetchBuilderSelf:async()=>await p.get({url:"/api/global/self"}),updateSelf:async u=>await p.post({url:"/api/global/self",body:u})}),buildViewEndpoints=p=>({fetchViewData:async(u,{field:f,groupBy:m,calculation:v})=>{const y=new URLSearchParams;v&&(f&&y.set("field",f),y.set("calculation",v)),m&&y.set("group",m);const w=f?`/api/views/${encodeURIComponent(u)}?${y}`:`/api/views/${encodeURIComponent(u)}`;return await p.get({url:w})},exportView:async(u,f)=>{const m=encodeURIComponent(u);return await p.get({url:`/api/views/export?view=${m}&format=${f}`,parseResponse:async v=>await v.text()})},saveView:async u=>await p.post({url:"/api/views",body:u}),deleteView:async u=>await p.delete({url:`/api/views/${encodeURIComponent(u)}`})}),buildViewV2Endpoints=p=>({fetchDefinition:async u=>await p.get({url:`/api/v2/views/${encodeURIComponent(u)}`,cache:!0}),create:async u=>await p.post({url:"/api/v2/views",body:u}),update:async u=>await p.put({url:`/api/v2/views/${encodeURIComponent(u.id)}`,body:u}),fetch:async(u,f)=>await p.post({url:`/api/v2/views/${encodeURIComponent(u)}/search`,body:f}),delete:async u=>await p.delete({url:`/api/v2/views/${encodeURIComponent(u)}`})}),buildLicensingEndpoints=p=>({activateLicenseKey:async u=>p.post({url:"/api/global/license/key",body:{licenseKey:u}}),deleteLicenseKey:async()=>p.delete({url:"/api/global/license/key"}),getLicenseKey:async()=>{try{return await p.get({url:"/api/global/license/key"})}catch(u){if(u.status!==404)throw u}},activateOfflineLicense:async u=>p.post({url:"/api/global/license/offline",body:{offlineLicenseToken:u}}),deleteOfflineLicense:async()=>p.delete({url:"/api/global/license/offline"}),getOfflineLicense:async()=>{try{return await p.get({url:"/api/global/license/offline"})}catch(u){if(u.status!==404)throw u}},getOfflineLicenseIdentifier:async()=>await p.get({url:"/api/global/license/offline/identifier"}),refreshLicense:async()=>p.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>p.get({url:"/api/global/license/usage"})}),buildGroupsEndpoints=p=>{async function u(f,m,v,y){return await p.post({url:`/api/global/groups/${f}/${m}`,body:{[v]:y}})}return{saveGroup:async f=>await p.post({url:"/api/global/groups",body:f}),getGroups:async()=>(await p.get({url:"/api/global/groups"})).data,getGroup:async f=>await p.get({url:`/api/global/groups/${f}`}),deleteGroup:async(f,m)=>await p.delete({url:`/api/global/groups/${f}/${m}`}),getGroupUsers:async({id:f,bookmark:m,emailSearch:v})=>{let y=`/api/global/groups/${f}/users?`;return m&&(y+=`bookmark=${m}&`),v&&(y+=`emailSearch=${v}`),await p.get({url:y})},addUsersToGroup:async(f,m)=>u(f,"users","add",m),removeUsersFromGroup:async(f,m)=>u(f,"users","remove",m),addAppsToGroup:async(f,m)=>u(f,"apps","add",m),removeAppsFromGroup:async(f,m)=>u(f,"apps","remove",m),addGroupAppBuilder:async(f,m)=>await p.post({url:`/api/global/groups/${f}/app/${m}/builder`}),removeGroupAppBuilder:async(f,m)=>await p.delete({url:`/api/global/groups/${f}/app/${m}/builder`})}},buildPluginEndpoints=p=>({uploadPlugin:async u=>await p.post({url:"/api/plugin/upload",body:u,json:!1}),createPlugin:async u=>await p.post({url:"/api/plugin",body:u}),getPlugins:async()=>await p.get({url:"/api/plugin"}),deletePlugin:async u=>await p.delete({url:`/api/plugin/${u}`})}),buildBackupEndpoints=p=>({createManualBackup:async u=>await p.post({url:`/api/apps/${u}/backups`}),searchBackups:async(u,f)=>await p.post({url:`/api/apps/${u}/backups/search`,body:f}),deleteBackup:async(u,f)=>await p.delete({url:`/api/apps/${u}/backups/${f}`}),restoreBackup:async(u,f,m)=>await p.post({url:`/api/apps/${u}/backups/${f}/import`,body:{name:m}})}),buildEnvironmentVariableEndpoints=p=>({checkEnvironmentVariableStatus:async()=>await p.get({url:"/api/env/variables/status"}),fetchEnvironmentVariables:async()=>await p.get({url:"/api/env/variables",json:!1}),createEnvironmentVariable:async u=>await p.post({url:"/api/env/variables",body:u}),deleteEnvironmentVariable:async u=>await p.delete({url:`/api/env/variables/${u}`}),updateEnvironmentVariable:async(u,f)=>await p.patch({url:`/api/env/variables/${u}`,body:f})}),buildEventEndpoints=p=>({publishEvent:async u=>await p.post({url:"/api/global/event/publish",body:{type:u}})}),buildAuditLogEndpoints=p=>({searchAuditLogs:async u=>await p.post({url:"/api/global/auditlogs/search",body:u}),getEventDefinitions:async()=>await p.get({url:"/api/global/auditlogs/definitions"}),getDownloadUrl:u=>`/api/global/auditlogs/download?query=${encodeURIComponent(JSON.stringify(u))}`}),buildLogsEndpoints=p=>({getSystemLogs:async()=>await p.get({url:"/api/system/logs",json:!1,parseResponse:async u=>u})}),buildMigrationEndpoints=p=>({getMigrationStatus:async()=>await p.get({url:"/api/migrations/status"})}),buildRowActionEndpoints=p=>({fetch:async u=>(await p.get({url:`/api/tables/${u}/actions`})).actions,create:async(u,f)=>await p.post({url:`/api/tables/${u}/actions`,body:{name:f}}),delete:async(u,f)=>await p.delete({url:`/api/tables/${u}/actions/${f}`}),enableView:async(u,f,m)=>await p.post({url:`/api/tables/${u}/actions/${f}/permissions/${m}`}),disableView:async(u,f,m)=>await p.delete({url:`/api/tables/${u}/actions/${f}/permissions/${m}`}),trigger:async(u,f,m)=>await p.post({url:`/api/tables/${u}/actions/${f}/trigger`,body:{rowId:m}})}),APISessionID=uuid(),createAPIClient=(p={})=>{let u={};const f=async(M,T,E=!1)=>{let H=M.statusText,F=null;try{F=await M.json(),F!=null&&F.message?H=F.message:F!=null&&F.error&&(H=JSON.stringify(F.error))}catch{}return{message:H,json:F,status:M.status,url:M.url,method:T,handled:!0,suppressErrors:E}},m=(M,T,E)=>({message:M,json:null,status:400,url:T,method:E,handled:!0,suppressErrors:!1}),v=async M=>{let{json:T,method:E,external:H,body:F,url:Z,parseResponse:$,suppressErrors:J}=M;T=T&&E!==HTTPMethod.GET;let ae={Accept:"application/json"};ae[Header.SESSION_ID]=APISessionID,H||(ae[Header.API_VER]=ApiVersion),T&&(ae["Content-Type"]="application/json"),p!=null&&p.attachHeaders&&p.attachHeaders(ae);let ie=F;if(T)try{ie=JSON.stringify(F)}catch{throw m("Invalid JSON body",Z,E)}let he;try{he=await fetch(Z,{method:E,headers:ae,body:ie,credentials:"same-origin"})}catch{throw delete u[Z],m("Failed to send request",Z,E)}if(he.status>=200&&he.status<400){y(he);try{return he.status===204?void 0:$?await $(he):await he.json()}catch(fe){throw delete u[Z],`Failed to parse response: ${fe}`}}else throw delete u[Z],await f(he,E,J)},y=M=>{if(!p.onMigrationDetected)return;const T=M.headers.get(Header.MIGRATING_APP);T&&p.onMigrationDetected(T)},w=async M=>{const T=M.url;return u[T]||(u[T]=v(M),u[T]=await u[T]),await u[T]},k=M=>async T=>{try{let E={json:!0,external:!1,suppressErrors:!1,cache:!1,method:M,...T},{url:H,cache:F,external:Z}=E;return Z||(E.url=`/${H}`.replace("//","/")),await(F&&(p==null?void 0:p.enableCaching)?w:v)(E)}catch(E){throw p!=null&&p.onError&&p.onError(E),E}};let S={post:k(HTTPMethod.POST),get:k(HTTPMethod.GET),patch:k(HTTPMethod.PATCH),delete:k(HTTPMethod.DELETE),put:k(HTTPMethod.PUT),invalidateCache:()=>{u={}},getAppID:()=>{var T;let M={};return(T=p==null?void 0:p.attachHeaders)==null||T.call(p,M),M==null?void 0:M[Header.APP_ID]}};return{...S,...buildAIEndpoints(S),...buildAnalyticsEndpoints(S),...buildAppEndpoints(S),...buildAttachmentEndpoints(S),...buildAuthEndpoints(S),...buildAutomationEndpoints(S),...buildConfigEndpoints(S),...buildDatasourceEndpoints(S),...buildFlagEndpoints(S),...buildLayoutEndpoints(S),...buildOtherEndpoints(S),...buildPermissionsEndpoints(S),...buildQueryEndpoints(S),...buildRelationshipEndpoints(S),...buildRoleEndpoints(S),...buildRouteEndpoints(S),...buildRowEndpoints(S),...buildScreenEndpoints(S),...buildTableEndpoints(S),...buildTemplateEndpoints(S),...buildUserEndpoints(S),...buildViewEndpoints(S),...buildSelfEndpoints(S),...buildLicensingEndpoints(S),...buildGroupsEndpoints(S),...buildPluginEndpoints(S),...buildBackupEndpoints(S),...buildEnvironmentVariableEndpoints(S),...buildEventEndpoints(S),...buildAuditLogEndpoints(S),...buildLogsEndpoints(S),...buildMigrationEndpoints(S),viewV2:buildViewV2Endpoints(S),rowActions:buildRowActionEndpoints(S)}},getJSONArrayDatasourceSchema=(p,u)=>{let f=p,m=[];u.prefixKeys&&(m=u.prefixKeys.concat(["schema"])),m=m.concat(u.label.split(".").slice(2));for(let v=0;v<m.length;v++)f=f==null?void 0:f[m[v]],f!=null&&f.schema&&(f=f.schema);return convertJSONSchemaToTableSchema(f,{squashObjects:!0,prefixKeys:m})},convertJSONSchemaToTableSchema=(p,u)=>{if(!p)return null;u={squashObjects:!1,prefixKeys:null,...u},p.schema?p=p.schema:p={value:p};const f=extractJSONSchemaKeys(p,u.squashObjects);let m={};return f.forEach(({key:v,type:y})=>{m[v]={type:y,name:v,prefixKeys:u.prefixKeys}}),m},extractJSONSchemaKeys=(p,u=!1)=>{if(!p||!Object.keys(p).length)return[];let f=[];return Object.keys(p).forEach(m=>{const v=p[m].type;if(v==="json"&&u){const y=extractJSONSchemaKeys(p[m].schema,u);f=f.concat(y.map(w=>({key:`${m}.${w.key}`,type:w.type})))}else f.push({key:m,type:v==="array"?"jsonarray":v})}),f},generateQueryArraySchemas=(p,u)=>{var f,m;for(let v in p)((f=p[v])==null?void 0:f.type)==="json"&&((m=p[v])==null?void 0:m.subtype)==="array"&&hasSchema(u[v])&&(p[v]={schema:{schema:Object.entries(u[v]||{}).reduce((y,[w,k])=>(y[w]={name:w,type:k.type,subtype:k.subtype},y),{}),type:"json"},type:"json",subtype:"array"});return p};function setCookie(p,u,f){getCookie(p)&&removeCookie(p);let m=`${p}=${u}; Path=/;`;f&&(m+=` Domain=${f};`),window.document.cookie=m}function getCookie(p){const f=`; ${document.cookie}`.split(`; ${p}=`);if(f.length===2)return f[1].split(";").shift()}function removeCookie(p){getCookie(p)&&(document.cookie=`${p}=; Max-Age=-99999999; Path=/;`)}const RolePriorities={[Roles.ADMIN]:5,[Roles.CREATOR]:4,[Roles.POWER]:3,[Roles.BASIC]:2,[Roles.PUBLIC]:1},getRolePriority=p=>RolePriorities[p]??0,sleep=p=>new Promise(u=>setTimeout(u,p)),debounce=(p,u=1e3)=>{let f;return async(...m)=>new Promise(v=>{f&&clearTimeout(f),f=setTimeout(async()=>{v(await p(...m))},u)})},throttle=(p,u=1e3)=>{let f,m=!1,v=!1;const y=(...w)=>{if(f=w,m){v=!0;return}p(...f),m=!0,setTimeout(()=>{m=!1,v&&(v=!1,y(...f))},u)};return y},domDebounce=p=>{let u=!1,f;return(...m)=>{f=m,u||(u=!0,requestAnimationFrame(()=>{p(...f),u=!1}))}},buildFormBlockButtonConfig=p=>{const{_id:u,actionType:f,dataSource:m,notificationOverride:v,actionUrl:y,showDeleteButton:w,deleteButtonLabel:k,showSaveButton:S,saveButtonLabel:M}=p||{};if(!u)return;const T=`${u}-form`,E=`${u}-repeater`,H=m==null?void 0:m.resourceId,F=w===!1?"":k==null?void 0:k.trim(),Z=S===!1?"":M==null?void 0:M.trim(),$=[{"##eventHandlerType":"Validate Form",parameters:{componentId:T}},{"##eventHandlerType":"Save Row",parameters:{providerId:T,tableId:H,notificationOverride:v,confirm:null}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...f!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:T}}],...y?[{"##eventHandlerType":"Navigate To",parameters:{url:y}}]:[]],J=[{"##eventHandlerType":"Delete Row",parameters:{confirm:!0,tableId:H,rowId:`{{ ${makePropSafe(E)}.${makePropSafe("_id")} }}`,revId:`{{ ${makePropSafe(E)}.${makePropSafe("_rev")} }}`,notificationOverride:v}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...y?[{"##eventHandlerType":"Navigate To",parameters:{url:y}}]:[]],ae=[];return["Update","Create"].includes(f)&&S!==!1&&ae.push({text:Z||"Save",_id:uuid(),_component:"@budibase/standard-components/button",onClick:$,type:"cta"}),f==="Update"&&w!==!1&&ae.push({text:F||"Delete",_id:uuid(),_component:"@budibase/standard-components/button",onClick:J,quiet:!0,type:"warning"}),ae},buildMultiStepFormBlockDefaultProps=p=>{const{_id:u,stepCount:f,currentStep:m,actionType:v,dataSource:y}=p||{};if(!u||!f)return;const w=`Step {{ [${u}-form].[__currentStep] }}`,k=y==null?void 0:y.resourceId,S=`${u}-form`;let M=[];return m!==0&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Back",type:"secondary",size:"M",onClick:[{parameters:{type:"prev",componentId:S},"##eventHandlerType":"Change Form Step"}]}),m!==f-1&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Next",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:S}},{parameters:{type:"next",componentId:S},"##eventHandlerType":"Change Form Step"}]}),v!=="View"&&m===f-1&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Save",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:S}},{"##eventHandlerType":"Save Row",parameters:{tableId:k,providerId:S}},...v!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:S}}]]}),{buttons:M,title:w}};function parseFilter(p){if(!(p!=null&&p.groups))return p;const u=lodashExports.cloneDeep(p);return u.groups=u.groups.map(f=>(f.filters=f.filters.filter(m=>m.field&&m.operator),f.filters.length?f:null)).filter(f=>f),u}const isBetterSample=(p,u)=>{if(u==null&&p!=null)return!0;if(u!=null&&p==null)return!1;const f=typeof u,m=typeof p;return f!==m?!1:m==="string"&&p.length>u.length||m==="object"&&Object.keys(p).length>Object.keys(u).length},generateGoldenSample=p=>{let u={};return p==null||p.slice(0,100).forEach(f=>{Object.keys(f).forEach(m=>{isBetterSample(f[m],u[m])&&(u[m]=f[m])})}),u},getColumnIcon=p=>{if(p.schema.icon)return p.schema.icon;if(p.calculationType)return"Calculator";if(p.schema.autocolumn)return"MagicWand";if(isDeprecatedSingleUserColumn(p.schema))return"User";const{type:u,subtype:f}=p.schema;return(typeof TypeIconMap[u]=="object"&&f?TypeIconMap[u][f]:TypeIconMap[u])||"Text"},memo=p=>{const u=writable(p);let f=JSON.stringify(p);const m=v=>{const y=JSON.stringify(v);y!==f&&(u.set(v),f=y)};return{subscribe:u.subscribe,set:m,update:v=>{let y=JSON.parse(f);const w=v(y);m(w)}}},derivedMemo=(p,u)=>{const f=derived(p,u),m=memo(get_store_value(f));return f.subscribe(m.set),m},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0",PACKET_TYPES.close="1",PACKET_TYPES.ping="2",PACKET_TYPES.pong="3",PACKET_TYPES.message="4",PACKET_TYPES.upgrade="5",PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(p=>{PACKET_TYPES_REVERSE[PACKET_TYPES[p]]=p});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=p=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(p):p&&p.buffer instanceof ArrayBuffer,encodePacket=({type:p,data:u},f,m)=>withNativeBlob$1&&u instanceof Blob?f?m(u):encodeBlobAsBase64(u,m):withNativeArrayBuffer$2&&(u instanceof ArrayBuffer||isView$1(u))?f?m(u):encodeBlobAsBase64(new Blob([u]),m):m(PACKET_TYPES[p]+(u||"")),encodeBlobAsBase64=(p,u)=>{const f=new FileReader;return f.onload=function(){const m=f.result.split(",")[1];u("b"+(m||""))},f.readAsDataURL(p)};function toArray(p){return p instanceof Uint8Array?p:p instanceof ArrayBuffer?new Uint8Array(p):new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(p,u){if(withNativeBlob$1&&p.data instanceof Blob)return p.data.arrayBuffer().then(toArray).then(u);if(withNativeArrayBuffer$2&&(p.data instanceof ArrayBuffer||isView$1(p.data)))return u(toArray(p.data));encodePacket(p,!1,f=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),u(TEXT_ENCODER.encode(f))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$2=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let p=0;p<chars.length;p++)lookup$2[chars.charCodeAt(p)]=p;const decode$2=p=>{let u=p.length*.75,f=p.length,m,v=0,y,w,k,S;p[p.length-1]==="="&&(u--,p[p.length-2]==="="&&u--);const M=new ArrayBuffer(u),T=new Uint8Array(M);for(m=0;m<f;m+=4)y=lookup$2[p.charCodeAt(m)],w=lookup$2[p.charCodeAt(m+1)],k=lookup$2[p.charCodeAt(m+2)],S=lookup$2[p.charCodeAt(m+3)],T[v++]=y<<2|w>>4,T[v++]=(w&15)<<4|k>>2,T[v++]=(k&3)<<6|S&63;return M},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(p,u)=>{if(typeof p!="string")return{type:"message",data:mapBinary(p,u)};const f=p.charAt(0);return f==="b"?{type:"message",data:decodeBase64Packet(p.substring(1),u)}:PACKET_TYPES_REVERSE[f]?p.length>1?{type:PACKET_TYPES_REVERSE[f],data:p.substring(1)}:{type:PACKET_TYPES_REVERSE[f]}:ERROR_PACKET},decodeBase64Packet=(p,u)=>{if(withNativeArrayBuffer$1){const f=decode$2(p);return mapBinary(f,u)}else return{base64:!0,data:p}},mapBinary=(p,u)=>{switch(u){case"blob":return p instanceof Blob?p:new Blob([p]);case"arraybuffer":default:return p instanceof ArrayBuffer?p:p.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(p,u)=>{const f=p.length,m=new Array(f);let v=0;p.forEach((y,w)=>{encodePacket(y,!1,k=>{m[w]=k,++v===f&&u(m.join(SEPARATOR))})})},decodePayload=(p,u)=>{const f=p.split(SEPARATOR),m=[];for(let v=0;v<f.length;v++){const y=decodePacket(f[v],u);if(m.push(y),y.type==="error")break}return m};function createPacketEncoderStream(){return new TransformStream({transform(p,u){encodePacketToBinary(p,f=>{const m=f.length;let v;if(m<126)v=new Uint8Array(1),new DataView(v.buffer).setUint8(0,m);else if(m<65536){v=new Uint8Array(3);const y=new DataView(v.buffer);y.setUint8(0,126),y.setUint16(1,m)}else{v=new Uint8Array(9);const y=new DataView(v.buffer);y.setUint8(0,127),y.setBigUint64(1,BigInt(m))}p.data&&typeof p.data!="string"&&(v[0]|=128),u.enqueue(v),u.enqueue(f)})}})}let TEXT_DECODER;function totalLength(p){return p.reduce((u,f)=>u+f.length,0)}function concatChunks(p,u){if(p[0].length===u)return p.shift();const f=new Uint8Array(u);let m=0;for(let v=0;v<u;v++)f[v]=p[0][m++],m===p[0].length&&(p.shift(),m=0);return p.length&&m<p[0].length&&(p[0]=p[0].slice(m)),f}function createPacketDecoderStream(p,u){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const f=[];let m=0,v=-1,y=!1;return new TransformStream({transform(w,k){for(f.push(w);;){if(m===0){if(totalLength(f)<1)break;const S=concatChunks(f,1);y=(S[0]&128)===128,v=S[0]&127,v<126?m=3:v===126?m=1:m=2}else if(m===1){if(totalLength(f)<2)break;const S=concatChunks(f,2);v=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),m=3}else if(m===2){if(totalLength(f)<8)break;const S=concatChunks(f,8),M=new DataView(S.buffer,S.byteOffset,S.length),T=M.getUint32(0);if(T>Math.pow(2,53-32)-1){k.enqueue(ERROR_PACKET);break}v=T*Math.pow(2,32)+M.getUint32(4),m=3}else{if(totalLength(f)<v)break;const S=concatChunks(f,v);k.enqueue(decodePacket(y?S:TEXT_DECODER.decode(S),u)),m=0}if(v===0||v>p){k.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(p){if(p)return mixin(p)}function mixin(p){for(var u in Emitter.prototype)p[u]=Emitter.prototype[u];return p}Emitter.prototype.on=Emitter.prototype.addEventListener=function(p,u){return this._callbacks=this._callbacks||{},(this._callbacks["$"+p]=this._callbacks["$"+p]||[]).push(u),this},Emitter.prototype.once=function(p,u){function f(){this.off(p,f),u.apply(this,arguments)}return f.fn=u,this.on(p,f),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(p,u){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+p];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+p],this;for(var m,v=0;v<f.length;v++)if(m=f[v],m===u||m.fn===u){f.splice(v,1);break}return f.length===0&&delete this._callbacks["$"+p],this},Emitter.prototype.emit=function(p){this._callbacks=this._callbacks||{};for(var u=new Array(arguments.length-1),f=this._callbacks["$"+p],m=1;m<arguments.length;m++)u[m-1]=arguments[m];if(f){f=f.slice(0);for(var m=0,v=f.length;m<v;++m)f[m].apply(this,u)}return this},Emitter.prototype.emitReserved=Emitter.prototype.emit,Emitter.prototype.listeners=function(p){return this._callbacks=this._callbacks||{},this._callbacks["$"+p]||[]},Emitter.prototype.hasListeners=function(p){return!!this.listeners(p).length};const globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(p,...u){return u.reduce((f,m)=>(p.hasOwnProperty(m)&&(f[m]=p[m]),f),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(p,u){u.useNativeTimers?(p.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),p.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(p.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),p.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(p){return typeof p=="string"?utf8Length(p):Math.ceil((p.byteLength||p.size)*BASE64_OVERHEAD)}function utf8Length(p){let u=0,f=0;for(let m=0,v=p.length;m<v;m++)u=p.charCodeAt(m),u<128?f+=1:u<2048?f+=2:u<55296||u>=57344?f+=3:(m++,f+=4);return f}function encode$2(p){let u="";for(let f in p)p.hasOwnProperty(f)&&(u.length&&(u+="&"),u+=encodeURIComponent(f)+"="+encodeURIComponent(p[f]));return u}function decode$1(p){let u={},f=p.split("&");for(let m=0,v=f.length;m<v;m++){let y=f[m].split("=");u[decodeURIComponent(y[0])]=decodeURIComponent(y[1])}return u}class TransportError extends Error{constructor(u,f,m){super(u),this.description=f,this.context=m,this.type="TransportError"}}class Transport extends Emitter{constructor(u){super(),this.writable=!1,installTimerFunctions(this,u),this.opts=u,this.query=u.query,this.socket=u.socket}onError(u,f,m){return super.emitReserved("error",new TransportError(u,f,m)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(u){this.readyState==="open"&&this.write(u)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(u){const f=decodePacket(u,this.socket.binaryType);this.onPacket(f)}onPacket(u){super.emitReserved("packet",u)}onClose(u){this.readyState="closed",super.emitReserved("close",u)}pause(u){}createUri(u,f={}){return u+"://"+this._hostname()+this._port()+this.opts.path+this._query(f)}_hostname(){const u=this.opts.hostname;return u.indexOf(":")===-1?u:"["+u+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(u){const f=encode$2(u);return f.length?"?"+f:""}}const alphabet$3="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={};let seed$1=0,i=0,prev;function encode$1(p){let u="";do u=alphabet$3[p%length]+u,p=Math.floor(p/length);while(p>0);return u}function yeast(){const p=encode$1(+new Date);return p!==prev?(seed$1=0,prev=p):p+"."+encode$1(seed$1++)}for(;i<length;i++)map[alphabet$3[i]]=i;let value$1=!1;try{value$1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(p){}const hasCORS=value$1;function XHR(p){const u=p.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!u||hasCORS))return new XMLHttpRequest}catch{}if(!u)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function createCookieJar(){}function empty(){}const hasXHR2=function(){return new XHR({xdomain:!1}).responseType!=null}();class Polling extends Transport{constructor(u){if(super(u),this.polling=!1,typeof location<"u"){const m=location.protocol==="https:";let v=location.port;v||(v=m?"443":"80"),this.xd=typeof location<"u"&&u.hostname!==location.hostname||v!==u.port}const f=u&&u.forceBase64;this.supportsBinary=hasXHR2&&!f,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(u){this.readyState="pausing";const f=()=>{this.readyState="paused",u()};if(this.polling||!this.writable){let m=0;this.polling&&(m++,this.once("pollComplete",function(){--m||f()})),this.writable||(m++,this.once("drain",function(){--m||f()}))}else f()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(u){const f=m=>{if(this.readyState==="opening"&&m.type==="open"&&this.onOpen(),m.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(m)};decodePayload(u,this.socket.binaryType).forEach(f),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const u=()=>{this.write([{type:"close"}])};this.readyState==="open"?u():this.once("open",u)}write(u){this.writable=!1,encodePayload(u,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const u=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(u,f)}request(u={}){return Object.assign(u,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request(this.uri(),u)}doWrite(u,f){const m=this.request({method:"POST",data:u});m.on("success",f),m.on("error",(v,y)=>{this.onError("xhr post error",v,y)})}doPoll(){const u=this.request();u.on("data",this.onData.bind(this)),u.on("error",(f,m)=>{this.onError("xhr poll error",f,m)}),this.pollXhr=u}}class Request extends Emitter{constructor(u,f){super(),installTimerFunctions(this,f),this.opts=f,this.method=f.method||"GET",this.uri=u,this.data=f.data!==void 0?f.data:null,this.create()}create(){var u;const f=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this.opts.xd;const m=this.xhr=new XHR(f);try{m.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){m.setDisableHeaderCheck&&m.setDisableHeaderCheck(!0);for(let v in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(v)&&m.setRequestHeader(v,this.opts.extraHeaders[v])}}catch{}if(this.method==="POST")try{m.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{m.setRequestHeader("Accept","*/*")}catch{}(u=this.opts.cookieJar)===null||u===void 0||u.addCookies(m),"withCredentials"in m&&(m.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(m.timeout=this.opts.requestTimeout),m.onreadystatechange=()=>{var v;m.readyState===3&&((v=this.opts.cookieJar)===null||v===void 0||v.parseCookies(m)),m.readyState===4&&(m.status===200||m.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof m.status=="number"?m.status:0)},0))},m.send(this.data)}catch(v){this.setTimeoutFn(()=>{this.onError(v)},0);return}typeof document<"u"&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)}onError(u){this.emitReserved("error",u,this.xhr),this.cleanup(!0)}cleanup(u){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty,u)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this.index],this.xhr=null}}onLoad(){const u=this.xhr.responseText;u!==null&&(this.emitReserved("data",u),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Request.requestsCount=0,Request.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const p="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(p,unloadHandler,!1)}}function unloadHandler(){for(let p in Request.requests)Request.requests.hasOwnProperty(p)&&Request.requests[p].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?u=>Promise.resolve().then(u):(u,f)=>f(u,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(u){super(u),this.supportsBinary=!u.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const u=this.uri(),f=this.opts.protocols,m=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(m.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?f?new WebSocket(u,f):new WebSocket(u):new WebSocket(u,f,m)}catch(v){return this.emitReserved("error",v)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=u=>this.onClose({description:"websocket connection closed",context:u}),this.ws.onmessage=u=>this.onData(u.data),this.ws.onerror=u=>this.onError("websocket error",u)}write(u){this.writable=!1;for(let f=0;f<u.length;f++){const m=u[f],v=f===u.length-1;encodePacket(m,this.supportsBinary,y=>{const w={};try{usingBrowserWebSocket&&this.ws.send(y)}catch{}v&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const u=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=yeast()),this.supportsBinary||(f.b64=1),this.createUri(u,f)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(u=>{this.onError("webtransport error",u)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(u=>{const f=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),m=u.readable.pipeThrough(f).getReader(),v=createPacketEncoderStream();v.readable.pipeTo(u.writable),this.writer=v.writable.getWriter();const y=()=>{m.read().then(({done:k,value:S})=>{k||(this.onPacket(S),y())}).catch(k=>{})};y();const w={type:"open"};this.query.sid&&(w.data=`{"sid":"${this.query.sid}"}`),this.writer.write(w).then(()=>this.onOpen())})}))}write(u){this.writable=!1;for(let f=0;f<u.length;f++){const m=u[f],v=f===u.length-1;this.writer.write(m).then(()=>{v&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var u;(u=this.transport)===null||u===void 0||u.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$6(p){if(p.length>2e3)throw"URI too long";const u=p,f=p.indexOf("["),m=p.indexOf("]");f!=-1&&m!=-1&&(p=p.substring(0,f)+p.substring(f,m).replace(/:/g,";")+p.substring(m,p.length));let v=re.exec(p||""),y={},w=14;for(;w--;)y[parts[w]]=v[w]||"";return f!=-1&&m!=-1&&(y.source=u,y.host=y.host.substring(1,y.host.length-1).replace(/;/g,":"),y.authority=y.authority.replace("[","").replace("]","").replace(/;/g,":"),y.ipv6uri=!0),y.pathNames=pathNames(y,y.path),y.queryKey=queryKey(y,y.query),y}function pathNames(p,u){const f=/\/{2,9}/g,m=u.replace(f,"/").split("/");return(u.slice(0,1)=="/"||u.length===0)&&m.splice(0,1),u.slice(-1)=="/"&&m.splice(m.length-1,1),m}function queryKey(p,u){const f={};return u.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(m,v,y){v&&(f[v]=y)}),f}let Socket$1=class Ec extends Emitter{constructor(u,f={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],u&&typeof u=="object"&&(f=u,u=null),u?(u=parse$6(u),f.hostname=u.host,f.secure=u.protocol==="https"||u.protocol==="wss",f.port=u.port,u.query&&(f.query=u.query)):f.host&&(f.hostname=parse$6(f.host).host),installTimerFunctions(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=f.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(u){const f=Object.assign({},this.opts.query);f.EIO=protocol$1,f.transport=u,this.id&&(f.sid=this.id);const m=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[u]);return new transports[u](m)}open(){let u;if(this.opts.rememberUpgrade&&Ec.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)u="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else u=this.transports[0];this.readyState="opening";try{u=this.createTransport(u)}catch{this.transports.shift(),this.open();return}u.open(),this.setTransport(u)}setTransport(u){this.transport&&this.transport.removeAllListeners(),this.transport=u,u.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",f=>this.onClose("transport close",f))}probe(u){let f=this.createTransport(u),m=!1;Ec.priorWebsocketSuccess=!1;const v=()=>{m||(f.send([{type:"ping",data:"probe"}]),f.once("packet",E=>{if(!m)if(E.type==="pong"&&E.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Ec.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{m||this.readyState!=="closed"&&(T(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const H=new Error("probe error");H.transport=f.name,this.emitReserved("upgradeError",H)}}))};function y(){m||(m=!0,T(),f.close(),f=null)}const w=E=>{const H=new Error("probe error: "+E);H.transport=f.name,y(),this.emitReserved("upgradeError",H)};function k(){w("transport closed")}function S(){w("socket closed")}function M(E){f&&E.name!==f.name&&y()}const T=()=>{f.removeListener("open",v),f.removeListener("error",w),f.removeListener("close",k),this.off("close",S),this.off("upgrading",M)};f.once("open",v),f.once("error",w),f.once("close",k),this.once("close",S),this.once("upgrading",M),this.upgrades.indexOf("webtransport")!==-1&&u!=="webtransport"?this.setTimeoutFn(()=>{m||f.open()},200):f.open()}onOpen(){if(this.readyState="open",Ec.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let u=0;const f=this.upgrades.length;for(;u<f;u++)this.probe(this.upgrades[u])}}onPacket(u){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",u),this.emitReserved("heartbeat"),this.resetPingTimeout(),u.type){case"open":this.onHandshake(JSON.parse(u.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const f=new Error("server error");f.code=u.data,this.onError(f);break;case"message":this.emitReserved("data",u.data),this.emitReserved("message",u.data);break}}onHandshake(u){this.emitReserved("handshake",u),this.id=u.sid,this.transport.query.sid=u.sid,this.upgrades=this.filterUpgrades(u.upgrades),this.pingInterval=u.pingInterval,this.pingTimeout=u.pingTimeout,this.maxPayload=u.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const u=this.getWritablePackets();this.transport.send(u),this.prevBufferLen=u.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let f=1;for(let m=0;m<this.writeBuffer.length;m++){const v=this.writeBuffer[m].data;if(v&&(f+=byteLength(v)),m>0&&f>this.maxPayload)return this.writeBuffer.slice(0,m);f+=2}return this.writeBuffer}write(u,f,m){return this.sendPacket("message",u,f,m),this}send(u,f,m){return this.sendPacket("message",u,f,m),this}sendPacket(u,f,m,v){if(typeof f=="function"&&(v=f,f=void 0),typeof m=="function"&&(v=m,m=null),this.readyState==="closing"||this.readyState==="closed")return;m=m||{},m.compress=m.compress!==!1;const y={type:u,data:f,options:m};this.emitReserved("packetCreate",y),this.writeBuffer.push(y),v&&this.once("flush",v),this.flush()}close(){const u=()=>{this.onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),u()},m=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?m():u()}):this.upgrading?m():u()),this}onError(u){Ec.priorWebsocketSuccess=!1,this.emitReserved("error",u),this.onClose("transport error",u)}onClose(u,f){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",u,f),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(u){const f=[];let m=0;const v=u.length;for(;m<v;m++)~this.transports.indexOf(u[m])&&f.push(u[m]);return f}};Socket$1.protocol=protocol$1;function url(p,u="",f){let m=p;f=f||typeof location<"u"&&location,p==null&&(p=f.protocol+"//"+f.host),typeof p=="string"&&(p.charAt(0)==="/"&&(p.charAt(1)==="/"?p=f.protocol+p:p=f.host+p),/^(https?|wss?):\/\//.test(p)||(typeof f<"u"?p=f.protocol+"//"+p:p="https://"+p),m=parse$6(p)),m.port||(/^(http|ws)$/.test(m.protocol)?m.port="80":/^(http|ws)s$/.test(m.protocol)&&(m.port="443")),m.path=m.path||"/";const y=m.host.indexOf(":")!==-1?"["+m.host+"]":m.host;return m.id=m.protocol+"://"+y+":"+m.port+u,m.href=m.protocol+"://"+y+(f&&f.port===m.port?"":":"+m.port),m}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=p=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(p):p.buffer instanceof ArrayBuffer,toString=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString.call(File)==="[object FileConstructor]";function isBinary(p){return withNativeArrayBuffer&&(p instanceof ArrayBuffer||isView(p))||withNativeBlob&&p instanceof Blob||withNativeFile&&p instanceof File}function hasBinary(p,u){if(!p||typeof p!="object")return!1;if(Array.isArray(p)){for(let f=0,m=p.length;f<m;f++)if(hasBinary(p[f]))return!0;return!1}if(isBinary(p))return!0;if(p.toJSON&&typeof p.toJSON=="function"&&arguments.length===1)return hasBinary(p.toJSON(),!0);for(const f in p)if(Object.prototype.hasOwnProperty.call(p,f)&&hasBinary(p[f]))return!0;return!1}function deconstructPacket(p){const u=[],f=p.data,m=p;return m.data=_deconstructPacket(f,u),m.attachments=u.length,{packet:m,buffers:u}}function _deconstructPacket(p,u){if(!p)return p;if(isBinary(p)){const f={_placeholder:!0,num:u.length};return u.push(p),f}else if(Array.isArray(p)){const f=new Array(p.length);for(let m=0;m<p.length;m++)f[m]=_deconstructPacket(p[m],u);return f}else if(typeof p=="object"&&!(p instanceof Date)){const f={};for(const m in p)Object.prototype.hasOwnProperty.call(p,m)&&(f[m]=_deconstructPacket(p[m],u));return f}return p}function reconstructPacket(p,u){return p.data=_reconstructPacket(p.data,u),delete p.attachments,p}function _reconstructPacket(p,u){if(!p)return p;if(p&&p._placeholder===!0){if(typeof p.num=="number"&&p.num>=0&&p.num<u.length)return u[p.num];throw new Error("illegal attachments")}else if(Array.isArray(p))for(let f=0;f<p.length;f++)p[f]=_reconstructPacket(p[f],u);else if(typeof p=="object")for(const f in p)Object.prototype.hasOwnProperty.call(p,f)&&(p[f]=_reconstructPacket(p[f],u));return p}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(p){p[p.CONNECT=0]="CONNECT",p[p.DISCONNECT=1]="DISCONNECT",p[p.EVENT=2]="EVENT",p[p.ACK=3]="ACK",p[p.CONNECT_ERROR=4]="CONNECT_ERROR",p[p.BINARY_EVENT=5]="BINARY_EVENT",p[p.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(u){this.replacer=u}encode(u){return(u.type===PacketType.EVENT||u.type===PacketType.ACK)&&hasBinary(u)?this.encodeAsBinary({type:u.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:u.nsp,data:u.data,id:u.id}):[this.encodeAsString(u)]}encodeAsString(u){let f=""+u.type;return(u.type===PacketType.BINARY_EVENT||u.type===PacketType.BINARY_ACK)&&(f+=u.attachments+"-"),u.nsp&&u.nsp!=="/"&&(f+=u.nsp+","),u.id!=null&&(f+=u.id),u.data!=null&&(f+=JSON.stringify(u.data,this.replacer)),f}encodeAsBinary(u){const f=deconstructPacket(u),m=this.encodeAsString(f.packet),v=f.buffers;return v.unshift(m),v}}function isObject$1(p){return Object.prototype.toString.call(p)==="[object Object]"}class Decoder extends Emitter{constructor(u){super(),this.reviver=u}add(u){let f;if(typeof u=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");f=this.decodeString(u);const m=f.type===PacketType.BINARY_EVENT;m||f.type===PacketType.BINARY_ACK?(f.type=m?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(f),f.attachments===0&&super.emitReserved("decoded",f)):super.emitReserved("decoded",f)}else if(isBinary(u)||u.base64)if(this.reconstructor)f=this.reconstructor.takeBinaryData(u),f&&(this.reconstructor=null,super.emitReserved("decoded",f));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+u)}decodeString(u){let f=0;const m={type:Number(u.charAt(0))};if(PacketType[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===PacketType.BINARY_EVENT||m.type===PacketType.BINARY_ACK){const y=f+1;for(;u.charAt(++f)!=="-"&&f!=u.length;);const w=u.substring(y,f);if(w!=Number(w)||u.charAt(f)!=="-")throw new Error("Illegal attachments");m.attachments=Number(w)}if(u.charAt(f+1)==="/"){const y=f+1;for(;++f&&!(u.charAt(f)===","||f===u.length););m.nsp=u.substring(y,f)}else m.nsp="/";const v=u.charAt(f+1);if(v!==""&&Number(v)==v){const y=f+1;for(;++f;){const w=u.charAt(f);if(w==null||Number(w)!=w){--f;break}if(f===u.length)break}m.id=Number(u.substring(y,f+1))}if(u.charAt(++f)){const y=this.tryParse(u.substr(f));if(Decoder.isPayloadValid(m.type,y))m.data=y;else throw new Error("invalid payload")}return m}tryParse(u){try{return JSON.parse(u,this.reviver)}catch{return!1}}static isPayloadValid(u,f){switch(u){case PacketType.CONNECT:return isObject$1(f);case PacketType.DISCONNECT:return f===void 0;case PacketType.CONNECT_ERROR:return typeof f=="string"||isObject$1(f);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(f)&&(typeof f[0]=="number"||typeof f[0]=="string"&&RESERVED_EVENTS$1.indexOf(f[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(f)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(u){this.packet=u,this.buffers=[],this.reconPack=u}takeBinaryData(u){if(this.buffers.push(u),this.buffers.length===this.reconPack.attachments){const f=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),f}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser$1=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(p,u,f){return p.on(u,f),function(){p.off(u,f)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(u,f,m){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=u,this.nsp=f,m&&m.auth&&(this.auth=m.auth),this._opts=Object.assign({},m),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const u=this.io;this.subs=[on(u,"open",this.onopen.bind(this)),on(u,"packet",this.onpacket.bind(this)),on(u,"error",this.onerror.bind(this)),on(u,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...u){return u.unshift("message"),this.emit.apply(this,u),this}emit(u,...f){if(RESERVED_EVENTS.hasOwnProperty(u))throw new Error('"'+u.toString()+'" is a reserved event name');if(f.unshift(u),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(f),this;const m={type:PacketType.EVENT,data:f};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof f[f.length-1]=="function"){const w=this.ids++,k=f.pop();this._registerAckCallback(w,k),m.id=w}const v=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!v||!this.connected)||(this.connected?(this.notifyOutgoingListeners(m),this.packet(m)):this.sendBuffer.push(m)),this.flags={},this}_registerAckCallback(u,f){var m;const v=(m=this.flags.timeout)!==null&&m!==void 0?m:this._opts.ackTimeout;if(v===void 0){this.acks[u]=f;return}const y=this.io.setTimeoutFn(()=>{delete this.acks[u];for(let k=0;k<this.sendBuffer.length;k++)this.sendBuffer[k].id===u&&this.sendBuffer.splice(k,1);f.call(this,new Error("operation has timed out"))},v),w=(...k)=>{this.io.clearTimeoutFn(y),f.apply(this,k)};w.withError=!0,this.acks[u]=w}emitWithAck(u,...f){return new Promise((m,v)=>{const y=(w,k)=>w?v(w):m(k);y.withError=!0,f.push(y),this.emit(u,...f)})}_addToQueue(u){let f;typeof u[u.length-1]=="function"&&(f=u.pop());const m={id:this._queueSeq++,tryCount:0,pending:!1,args:u,flags:Object.assign({fromQueue:!0},this.flags)};u.push((v,...y)=>m!==this._queue[0]?void 0:(v!==null?m.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(v)):(this._queue.shift(),f&&f(null,...y)),m.pending=!1,this._drainQueue())),this._queue.push(m),this._drainQueue()}_drainQueue(u=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!u||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.args))}packet(u){u.nsp=this.nsp,this.io._packet(u)}onopen(){typeof this.auth=="function"?this.auth(u=>{this._sendConnectPacket(u)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(u){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},u):u})}onerror(u){this.connected||this.emitReserved("connect_error",u)}onclose(u,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",u,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(u=>{if(!this.sendBuffer.some(m=>String(m.id)===u)){const m=this.acks[u];delete this.acks[u],m.withError&&m.call(this,new Error("socket has been disconnected"))}})}onpacket(u){if(u.nsp===this.nsp)switch(u.type){case PacketType.CONNECT:u.data&&u.data.sid?this.onconnect(u.data.sid,u.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(u);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(u);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const m=new Error(u.data.message);m.data=u.data.data,this.emitReserved("connect_error",m);break}}onevent(u){const f=u.data||[];u.id!=null&&f.push(this.ack(u.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(u){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const m of f)m.apply(this,u)}super.emit.apply(this,u),this._pid&&u.length&&typeof u[u.length-1]=="string"&&(this._lastOffset=u[u.length-1])}ack(u){const f=this;let m=!1;return function(...v){m||(m=!0,f.packet({type:PacketType.ACK,id:u,data:v}))}}onack(u){const f=this.acks[u.id];typeof f=="function"&&(delete this.acks[u.id],f.withError&&u.data.unshift(null),f.apply(this,u.data))}onconnect(u,f){this.id=u,this.recovered=f&&this._pid===f,this._pid=f,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(u=>this.emitEvent(u)),this.receiveBuffer=[],this.sendBuffer.forEach(u=>{this.notifyOutgoingListeners(u),this.packet(u)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(u=>u()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(u){return this.flags.compress=u,this}get volatile(){return this.flags.volatile=!0,this}timeout(u){return this.flags.timeout=u,this}onAny(u){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(u),this}prependAny(u){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(u),this}offAny(u){if(!this._anyListeners)return this;if(u){const f=this._anyListeners;for(let m=0;m<f.length;m++)if(u===f[m])return f.splice(m,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(u){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(u),this}prependAnyOutgoing(u){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(u),this}offAnyOutgoing(u){if(!this._anyOutgoingListeners)return this;if(u){const f=this._anyOutgoingListeners;for(let m=0;m<f.length;m++)if(u===f[m])return f.splice(m,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(u){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const f=this._anyOutgoingListeners.slice();for(const m of f)m.apply(this,u.data)}}}function Backoff(p){p=p||{},this.ms=p.min||100,this.max=p.max||1e4,this.factor=p.factor||2,this.jitter=p.jitter>0&&p.jitter<=1?p.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var p=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var u=Math.random(),f=Math.floor(u*this.jitter*p);p=Math.floor(u*10)&1?p+f:p-f}return Math.min(p,this.max)|0},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(p){this.ms=p},Backoff.prototype.setMax=function(p){this.max=p},Backoff.prototype.setJitter=function(p){this.jitter=p};class Manager extends Emitter{constructor(u,f){var m;super(),this.nsps={},this.subs=[],u&&typeof u=="object"&&(f=u,u=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,installTimerFunctions(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((m=f.randomizationFactor)!==null&&m!==void 0?m:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=u;const v=f.parser||parser$1;this.encoder=new v.Encoder,this.decoder=new v.Decoder,this._autoConnect=f.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(u){return arguments.length?(this._reconnection=!!u,this):this._reconnection}reconnectionAttempts(u){return u===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=u,this)}reconnectionDelay(u){var f;return u===void 0?this._reconnectionDelay:(this._reconnectionDelay=u,(f=this.backoff)===null||f===void 0||f.setMin(u),this)}randomizationFactor(u){var f;return u===void 0?this._randomizationFactor:(this._randomizationFactor=u,(f=this.backoff)===null||f===void 0||f.setJitter(u),this)}reconnectionDelayMax(u){var f;return u===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=u,(f=this.backoff)===null||f===void 0||f.setMax(u),this)}timeout(u){return arguments.length?(this._timeout=u,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(u){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const f=this.engine,m=this;this._readyState="opening",this.skipReconnect=!1;const v=on(f,"open",function(){m.onopen(),u&&u()}),y=k=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",k),u?u(k):this.maybeReconnectOnOpen()},w=on(f,"error",y);if(this._timeout!==!1){const k=this._timeout,S=this.setTimeoutFn(()=>{v(),y(new Error("timeout")),f.close()},k);this.opts.autoUnref&&S.unref(),this.subs.push(()=>{this.clearTimeoutFn(S)})}return this.subs.push(v),this.subs.push(w),this}connect(u){return this.open(u)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const u=this.engine;this.subs.push(on(u,"ping",this.onping.bind(this)),on(u,"data",this.ondata.bind(this)),on(u,"error",this.onerror.bind(this)),on(u,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(u){try{this.decoder.add(u)}catch(f){this.onclose("parse error",f)}}ondecoded(u){nextTick(()=>{this.emitReserved("packet",u)},this.setTimeoutFn)}onerror(u){this.emitReserved("error",u)}socket(u,f){let m=this.nsps[u];return m?this._autoConnect&&!m.active&&m.connect():(m=new Socket(this,u,f),this.nsps[u]=m),m}_destroy(u){const f=Object.keys(this.nsps);for(const m of f)if(this.nsps[m].active)return;this._close()}_packet(u){const f=this.encoder.encode(u);for(let m=0;m<f.length;m++)this.engine.write(f[m],u.options)}cleanup(){this.subs.forEach(u=>u()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(u,f){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",u,f),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const u=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const f=this.backoff.duration();this._reconnecting=!0;const m=this.setTimeoutFn(()=>{u.skipReconnect||(this.emitReserved("reconnect_attempt",u.backoff.attempts),!u.skipReconnect&&u.open(v=>{v?(u._reconnecting=!1,u.reconnect(),this.emitReserved("reconnect_error",v)):u.onreconnect()}))},f);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}}onreconnect(){const u=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",u)}}const cache={};function lookup$1(p,u){typeof p=="object"&&(u=p,p=void 0),u=u||{};const f=url(p,u.path||"/socket.io"),m=f.source,v=f.id,y=f.path,w=cache[v]&&y in cache[v].nsps,k=u.forceNew||u["force new connection"]||u.multiplex===!1||w;let S;return k?S=new Manager(m,u):(cache[v]||(cache[v]=new Manager(m,u)),S=cache[v]),f.query&&!u.query&&(u.query=f.queryKey),S.socket(f.path,u)}Object.assign(lookup$1,{Manager,Socket,io:lookup$1,connect:lookup$1});const DefaultOptions={heartbeat:!0},createWebsocket=(p,u=DefaultOptions)=>{if(!p)throw"A websocket path must be provided";const{heartbeat:f}={...DefaultOptions,...u},m=location.protocol==="https:",v=m?"wss:":"ws:",y=location.hostname,w=location.port||(m?443:80);let k=lookup$1(`${v}//${y}:${w}`,{path:p,reconnectionAttempts:3,reconnectionDelay:5e3,reconnectionDelayMax:5e3,timeout:4e3,transports:["websocket"]}),S;return f&&(S=setInterval(()=>{k.emit(SocketEvent.Heartbeat)},SocketSessionTTL*500)),k.on("disconnect",()=>{clearInterval(S)}),k.onOther=(M,T)=>{k.on(M,E=>{(E==null?void 0:E.apiSessionId)!==APISessionID&&T(E)})},k},extractFileNameRegex=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;async function downloadStream(p){const u=await p.blob(),f=p.headers.get("Content-Disposition"),v=extractFileNameRegex.exec(f)[1].replace(/['"]/g,""),y=new Blob([u]),w=URL.createObjectURL(y),k=document.createElement("a");k.href=w,k.download=v,k.click(),URL.revokeObjectURL(w)}const shouldDisplaySetting=(p,u)=>{let f=u.dependsOn;return f&&!Array.isArray(f)&&(f=[f]),f!=null&&f.length?f.every(m=>{let v=m,y=null,w=!!m.invert;if(typeof m=="object"&&(v=m.setting,y=m.value),!v)return!1;Array.isArray(y)||(y=[y]);const k=deepGet$1(p,v);return y.some(M=>M==null?k!=null&&k!==!1&&k!=="":M===k)!==w}):!0},columnTypeManyTypeOverrides={[FieldType.DATETIME]:FieldType.STRING,[FieldType.BOOLEAN]:FieldType.STRING,[FieldType.SIGNATURE_SINGLE]:FieldType.ATTACHMENTS},columnTypeManyParser={[FieldType.DATETIME]:(p,u)=>{function f(m){const{timeOnly:v,dateOnly:y}=u||{},w=!y,k=parseDate(m,{enableTime:w});return getDateDisplayValue(k,{enableTime:w,timeOnly:v})}return p.map(m=>f(m))},[FieldType.BOOLEAN]:p=>p.map(u=>!!u),[FieldType.BB_REFERENCE_SINGLE]:p=>[...new Map(p.map(u=>[u._id,u])).values()],[FieldType.BB_REFERENCE]:p=>[...new Map(p.map(u=>[u._id,u])).values()],[FieldType.ARRAY]:p=>Array.from(new Set(p))};function enrichSchemaWithRelColumns(p){return Object.keys(p).reduce((f,m)=>{const v=p[m];if(f[m]=v,v.visible!==!1&&isRelationshipField(v)&&v.columns){const y=(v==null?void 0:v.relationshipType)===RelationshipType.ONE_TO_MANY;for(const w of Object.keys(v.columns)){const k=v.columns[w];if(!k.visible)continue;const S=`${v.name}.${w}`;f[S]={...k,type:k.type,name:S,related:{field:m,subField:w},cellRenderType:!y&&columnTypeManyTypeOverrides[k.type]||k.type}}}return f},{})}function getRelatedTableValues(p,u,f){var y,w,k,S;const m=isRelationshipField(f)&&(f==null?void 0:f.relationshipType)===RelationshipType.ONE_TO_MANY;let v="";if(m)v=(w=(y=p[u.related.field])==null?void 0:y[0])==null?void 0:w[u.related.subField];else{const M=columnTypeManyParser[u.type]||(H=>H),T=(S=(k=p[u.related.field])==null?void 0:k.flatMap(H=>H[u.related.subField]))==null?void 0:S.filter(H=>H!=null),E=M(T||[],u);v=E,[FieldType.STRING,FieldType.NUMBER,FieldType.BIGINT,FieldType.BOOLEAN,FieldType.DATETIME,FieldType.LONGFORM,FieldType.BARCODEQR].includes(u.type)&&(v=E==null?void 0:E.join(", "))}return v}function canBeDisplayColumn(p){return!(!canBeDisplayColumn$1(p.type)||p.related)}function canBeSortColumn(p){return p.calculationType?!0:!(!canBeSortColumn$1(p.type)||p.related)}const{buildQuery,limit:queryLimit,runQuery,sort}=QueryUtils;class BaseDataFetch{constructor(u){ha(this,"API");ha(this,"features");ha(this,"options");ha(this,"store");ha(this,"derivedStore");if(this.features={supportsSearch:!1,supportsSort:!1,supportsPagination:!1},this.options={datasource:u.datasource,limit:10,filter:null,query:u.query,sortColumn:null,sortOrder:SortOrder.ASCENDING,sortType:null,paginate:!0,clientSideSearching:!0,clientSideSorting:!0,clientSideLimiting:!0},this.store=writable({rows:[],info:null,schema:null,loading:!1,loaded:!1,query:u.query,pageNumber:0,cursor:null,cursors:[],resetKey:Math.random().toString(),error:null}),this.API=u==null?void 0:u.API,this.options={...this.options,...u},!this.API)throw"An API client is required for fetching data";if(this.getData=this.getData.bind(this),this.getPage=this.getPage.bind(this),this.getInitialData=this.getInitialData.bind(this),this.determineFeatureFlags=this.determineFeatureFlags.bind(this),this.refresh=this.refresh.bind(this),this.update=this.update.bind(this),this.hasNextPage=this.hasNextPage.bind(this),this.hasPrevPage=this.hasPrevPage.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.derivedStore=derived(this.store,f=>({...f,...this.features,hasNextPage:this.hasNextPage(f),hasPrevPage:this.hasPrevPage(f)})),!this.options.datasource){this.store.update(f=>({...f,loaded:!0}));return}}get subscribe(){return this.derivedStore.subscribe}getDefaultSortColumn(u,f){return u!=null&&u.primaryDisplay&&f[u.primaryDisplay]?u.primaryDisplay:Object.keys(f)[0]}async getInitialData(){const{filter:u,paginate:f}=this.options,m=await this.getDefinition(),v=await this.determineFeatureFlags();this.features={supportsSearch:!!(v!=null&&v.supportsSearch),supportsSort:!!(v!=null&&v.supportsSort),supportsPagination:f&&!!(v!=null&&v.supportsPagination)};let y=this.getSchema(m);if(!y)return;if(y=this.enrichSchema(y),this.options.sortColumn&&!y[this.options.sortColumn]&&(this.options.sortColumn=null),this.options.sortColumn||(this.options.sortColumn=this.getDefaultSortColumn(m,y)),!this.options.sortColumn)this.options.sortOrder=SortOrder.ASCENDING,this.options.sortType=null;else{this.options.sortType=SortType.STRING;const S=y==null?void 0:y[this.options.sortColumn];((S==null?void 0:S.type)===FieldType.NUMBER||(S==null?void 0:S.type)===FieldType.BIGINT||"calculationType"in S&&(S!=null&&S.calculationType))&&(this.options.sortType=SortType.NUMBER),this.options.sortOrder?this.options.sortOrder=this.options.sortOrder.toLowerCase():this.options.sortOrder=SortOrder.ASCENDING}let w=this.options.query;w||(w=buildQuery(u??void 0)),this.store.update(S=>({...S,definition:m,schema:y,query:w,loading:!0,cursors:[],cursor:null}));const k=await this.getPage();this.store.update(S=>({...S,loading:!1,loaded:!0,pageNumber:0,rows:k.rows,info:k.info,cursors:f&&k.hasNextPage?[null,k.cursor]:[null],error:k.error,resetKey:Math.random().toString()}))}async getPage(){const{sortColumn:u,sortOrder:f,sortType:m,limit:v,clientSideSearching:y,clientSideSorting:w,clientSideLimiting:k}=this.options,{query:S}=get_store_value(this.store);let{rows:M,info:T,hasNextPage:E,cursor:H,error:F}=await this.getData();return!this.features.supportsSearch&&y&&(M=runQuery(M,S)),!this.features.supportsSort&&w&&m&&(M=sort(M,u,f,m)),!this.features.supportsPagination&&k&&(M=queryLimit(M,v)),{rows:M,info:T,hasNextPage:E,cursor:H,error:F}}getSchema(u){return(u==null?void 0:u.schema)??void 0}enrichSchema(u){let f={};for(const v of Object.keys(u)){const y=u[v];if(y.type===FieldType.JSON){const w=convertJSONSchemaToTableSchema(y,{squashObjects:!0});if(w)for(const k of Object.keys(w))f[`${v}.${k}`]={type:w[k].type,nestedJSON:!0}}}let m={};return Object.entries({...u,...f}).forEach(([v,y])=>{typeof y=="string"?m[v]={type:y,name:v}:m[v]={...y,type:y.type,name:v}}),m}async determineFeatureFlags(){return{supportsSearch:!1,supportsSort:!1,supportsPagination:!1}}async update(u){let f=!1;for(const[m,v]of Object.entries(u||{})){const y=this.options[m]??null;if(JSON.stringify(v??null)!==JSON.stringify(y)){f=!0;break}}f&&(this.options={...this.options,...fp$1.cloneDeep(u)},await this.getInitialData())}async refresh(){if(get_store_value(this.store).loading)return;this.store.update(S=>({...S,loading:!0}));const{rows:u,info:f,error:m,cursor:v}=await this.getPage();let{cursors:y}=get_store_value(this.store);const{pageNumber:w}=get_store_value(this.store);if(!u.length&&w>0)return this.store.update(S=>({...S,loading:!1,cursors:y.slice(0,w)})),await this.prevPage();y[w+1]!=v&&(y=y.slice(0,w+1),y[w+1]=v),this.store.update(S=>({...S,rows:u,info:f,loading:!1,error:m,cursors:y}))}hasNextPage(u){return u.cursors[u.pageNumber+1]!=null}hasPrevPage(u){return u.pageNumber>0}async nextPage(){const u=get_store_value(this.derivedStore);if(u.loading||!this.options.paginate||!u.hasNextPage)return;const f=u.cursors[u.pageNumber+1];this.store.update(S=>({...S,loading:!0,cursor:f,pageNumber:S.pageNumber+1}));const{rows:m,info:v,hasNextPage:y,cursor:w,error:k}=await this.getPage();this.store.update(S=>{let{cursors:M,pageNumber:T}=S;return y&&(M[T+1]=w),{...S,rows:m,info:v,cursors:M,loading:!1,error:k}})}async prevPage(){const u=get_store_value(this.derivedStore);if(u.loading||!this.options.paginate||!u.hasPrevPage)return;const f=u.cursors[u.pageNumber-1];this.store.update(w=>({...w,loading:!0,cursor:f,pageNumber:w.pageNumber-1}));const{rows:m,info:v,error:y}=await this.getPage();this.store.update(w=>({...w,rows:m,info:v,loading:!1,error:y}))}}class TableFetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}async getData(){const{datasource:u,limit:f,sortColumn:m,sortOrder:v,sortType:y,paginate:w}=this.options,{tableId:k}=u,{cursor:S,query:M}=get_store_value(this.store);try{const T=await this.API.searchTable(k,{query:M,limit:f,sort:m,sortOrder:v??SortOrder.ASCENDING,sortType:y,paginate:w,bookmark:S});return{rows:(T==null?void 0:T.rows)||[],hasNextPage:(T==null?void 0:T.hasNextPage)||!1,cursor:(T==null?void 0:T.bookmark)||null}}catch(T){return{rows:[],hasNextPage:!1,error:T}}}}class ViewFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}getSchema(u){var m,v;const{datasource:f}=this.options;return(v=(m=u==null?void 0:u.views)==null?void 0:m[f==null?void 0:f.name])==null?void 0:v.schema}async getData(){const{datasource:u}=this.options;try{return{rows:await this.API.fetchViewData(u.name,{calculation:u.calculation,field:u.field,groupBy:u.groupBy,tableId:u.tableId})||[]}}catch(f){return console.error(f,{datasource:u}),{rows:[]}}}}class ViewV2Fetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:u}=this.options;try{const f=await this.API.viewV2.fetchDefinition(u.id);return f==null?void 0:f.data}catch(f){return this.store.update(m=>({...m,error:f})),null}}getDefaultSortColumn(){return null}async getData(){var T;const{datasource:u,limit:f,sortColumn:m,sortOrder:v,sortType:y,paginate:w}=this.options,{cursor:k,query:S,definition:M}=get_store_value(this.store);if((M==null?void 0:M.type)===ViewV2Type.CALCULATION&&!Object.values(M.schema||{}).some(isCalculationField))return{rows:[],hasNextPage:!1,cursor:null,error:null};!m&&((T=M==null?void 0:M.sort)!=null&&T.field)&&(this.options.sortColumn=M.sort.field,this.options.sortOrder=M.sort.order||SortOrder.ASCENDING);try{const E={query:S,paginate:w,limit:f,bookmark:k,sort:m,sortOrder:v,sortType:y};if(w){const H=await this.API.viewV2.fetch(u.id,{...E,paginate:w});return{rows:(H==null?void 0:H.rows)||[],hasNextPage:(H==null?void 0:H.hasNextPage)||!1,cursor:(H==null?void 0:H.bookmark)||null}}else{const H=await this.API.viewV2.fetch(u.id,{...E,paginate:w});return{rows:(H==null?void 0:H.rows)||[],hasNextPage:!1,cursor:null}}}catch(E){return{rows:[],hasNextPage:!1,cursor:null,error:E}}}}class QueryFetch extends BaseDataFetch{async determineFeatureFlags(){var m,v,y,w,k,S;const u=await this.getDefinition();return{supportsPagination:!!((v=(m=u==null?void 0:u.fields)==null?void 0:m.pagination)!=null&&v.type)&&!!((w=(y=u==null?void 0:u.fields)==null?void 0:y.pagination)!=null&&w.location)&&!!((S=(k=u==null?void 0:u.fields)==null?void 0:k.pagination)!=null&&S.pageParam)}}async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u._id))return null;try{const f=await this.API.fetchQueryDefinition(u._id);return f.fields||(f.fields=u.fields),f}catch{return null}}getDefaultSortColumn(){return null}async getData(){var T,E;const{datasource:u,limit:f,paginate:m}=this.options,{supportsPagination:v}=this.features,{cursor:y,definition:w}=get_store_value(this.store),k=(E=(T=w==null?void 0:w.fields)==null?void 0:T.pagination)==null?void 0:E.type,S=cloneDeep$1(u.queryParams||{});for(const H of(u==null?void 0:u.parameters)||[])S[H.name]||(S[H.name]=H.default);const M={parameters:S};if(m&&v){const H=k==="page"?parseInt(y||"1"):y;M.pagination={page:H,limit:f}}try{const H=await this.API.executeQuery(u==null?void 0:u._id,M),{data:F,pagination:Z,...$}=H;let J=null,ae=!1;return m&&v&&(k==="page"?(J=M.pagination.page+1,ae=(F==null?void 0:F.length)===f&&f>0):(J=Z==null?void 0:Z.cursor,ae=J!=null)),{rows:F||[],info:$,cursor:J,hasNextPage:ae}}catch{return{rows:[],hasNextPage:!1}}}}class RelationshipFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}async getData(){const{datasource:u}=this.options;if(!(u!=null&&u.rowId)||!(u!=null&&u.rowTableId))return{rows:[]};try{return{rows:await this.API.fetchRelationshipData(u.rowTableId,u.rowId,u.fieldName)}}catch{return{rows:[]}}}}class NestedProviderFetch extends BaseDataFetch{async getDefinition(){var f,m;const{datasource:u}=this.options;return{schema:(f=u==null?void 0:u.value)==null?void 0:f.schema,primaryDisplay:(m=u==null?void 0:u.value)==null?void 0:m.primaryDisplay}}async getData(){var f;const{datasource:u}=this.options;return{rows:((f=u==null?void 0:u.value)==null?void 0:f.rows)||[],hasNextPage:!1,cursor:null}}}function isArrayOfStrings(p){return Array.isArray(p)&&!!p[0]&&typeof p[0]!="object"}class FieldFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;let f;return u.fieldType==="attachment"?f={url:{type:"string"},name:{type:"string"}}:u.fieldType==="array"&&(f={value:{type:"string"}}),{schema:f}}async getData(){const{datasource:u}=this.options,f=(u==null?void 0:u.value)||[];let m;return isArrayOfStrings(f)?m=f.map(v=>({value:v})):m=f,{rows:m||[],hasNextPage:!1,cursor:null}}}class JSONArrayFetch extends FieldFetch{async getDefinition(){const{datasource:u}=this.options;try{const f=await this.API.fetchTableDefinition(u.tableId);return{schema:getJSONArrayDatasourceSchema(f==null?void 0:f.schema,u)}}catch{return null}}}class UserFetch extends BaseDataFetch{constructor(u){super({...u,datasource:{type:"user",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{limit:u,paginate:f}=this.options,{cursor:m,query:v}=get_store_value(this.store),{appId:y,paginated:w,...k}=v,S=isSupportedUserSearch(k)?k:{};try{const M={bookmark:m??void 0,query:S??void 0,appId:y,paginate:w||f,limit:u},T=await this.API.searchUsers(M);return{rows:(T==null?void 0:T.data)||[],hasNextPage:(T==null?void 0:T.hasNextPage)||!1,cursor:(T==null?void 0:T.nextPage)||null}}catch(M){return{rows:[],hasNextPage:!1,error:M}}}}class GroupUserFetch extends BaseDataFetch{constructor(u){super({...u,datasource:{type:"groupUser",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{query:u,cursor:f}=get_store_value(this.store);try{const m=await this.API.getGroupUsers({id:u.groupId,emailSearch:u.emailSearch,bookmark:f??void 0});return{rows:(m==null?void 0:m.users)||[],hasNextPage:(m==null?void 0:m.hasNextPage)||!1,cursor:(m==null?void 0:m.bookmark)||null}}catch(m){return{rows:[],hasNextPage:!1,error:m}}}}class CustomFetch extends BaseDataFetch{getType(u){return u==null?"string":typeof u==="object"?Array.isArray(u)?"array":"json":isNaN(u)?"string":"number"}parseCustomData(u){if(!u)return[];if(Array.isArray(u))return u;if(typeof u=="string"){try{const f=JSON.parse(u);return Array.isArray(f)?f:[f]}catch{}return u.includes(`
|
|
383
|
+
`;var HTTPMethod=(p=>(p.POST="POST",p.PATCH="PATCH",p.GET="GET",p.PUT="PUT",p.DELETE="DELETE",p))(HTTPMethod||{});const BannedSearchTypes=[FieldType.LINK,FieldType.ATTACHMENT_SINGLE,FieldType.ATTACHMENTS,FieldType.FORMULA,FieldType.JSON,FieldType.ATTACHMENT_SINGLE,FieldType.SIGNATURE_SINGLE,"jsonarray","queryarray"],Cookies={Auth:"budibase:auth",CurrentApp:"budibase:currentapp",ReturnUrl:"budibase:returnurl",AccountReturnUrl:"budibase:account:returnurl",OnboardingProcessCorrelationKey:BpmCorrelationKey.ONBOARDING};var TableNames=(p=>(p.USERS="ta_users",p))(TableNames||{});const BudibaseRoles={AppUser:"appUser",Developer:"developer",Creator:"creator",Admin:"admin",Owner:"owner"},BudibaseRoleOptionsOld=[{label:"Developer",value:BudibaseRoles.Developer}],BudibaseRoleOptions=[{label:"Account admin",value:BudibaseRoles.Admin,subtitle:"Has full access to all apps and settings in your account",sortOrder:1},{label:"Creator",value:BudibaseRoles.Creator,subtitle:"Can create and edit apps they have access to",sortOrder:2},{label:"App user",value:BudibaseRoles.AppUser,subtitle:"Can only use published apps they have access to",sortOrder:3}],ExtendedBudibaseRoleOptions=[{label:"Account holder",value:BudibaseRoles.Owner,sortOrder:0},...BudibaseRoleOptions,...BudibaseRoleOptionsOld],PlanType={FREE:"free",TEAM:"team",PRO:"pro",BUSINESS:"business",PREMIUM:"premium",ENTERPRISE:"enterprise",ENTERPRISE_BASIC_TRIAL:"enterprise_basic_trial"},ApiVersion="1",Roles={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER",CREATOR:"CREATOR"},EventPublishType={ENV_VAR_UPGRADE_PANEL_OPENED:"environment_variable_upgrade_panel_opened"},ContextScopes={Local:"local",Global:"global"},TypeIconMap={[FieldType.STRING]:"Text",[FieldType.OPTIONS]:"Dropdown",[FieldType.DATETIME]:"Calendar",[FieldType.BARCODEQR]:"Camera",[FieldType.SIGNATURE_SINGLE]:"AnnotatePen",[FieldType.LONGFORM]:"TextAlignLeft",[FieldType.ARRAY]:"Duplicate",[FieldType.NUMBER]:"123",[FieldType.BOOLEAN]:"Boolean",[FieldType.ATTACHMENTS]:"DocumentFragmentGroup",[FieldType.ATTACHMENT_SINGLE]:"DocumentFragment",[FieldType.LINK]:"DataCorrelated",[FieldType.FORMULA]:"Calculator",[FieldType.AI]:"MagicWand",[FieldType.JSON]:"Brackets",[FieldType.BIGINT]:"TagBold",[FieldType.AUTO]:"Shapes",[FieldType.BB_REFERENCE]:{[BBReferenceFieldSubType.USER]:"UserGroup",[BBReferenceFieldSubType.USERS]:"UserGroup"},[FieldType.BB_REFERENCE_SINGLE]:{[BBReferenceFieldSubType.USER]:"User"}},OptionColours=[...new Array(12).keys()].map(p=>`hsla(${(p+1)*222%360}, 90%, 75%, 0.3)`),FilterOperator={ANY:"any",ALL:"all"},OnEmptyFilter={RETURN_ALL:"all",RETURN_NONE:"none"},FilterValueType={BINDING:"Binding",VALUE:"Value"},FieldPermissions={WRITABLE:"writable",READONLY:"readonly",HIDDEN:"hidden"},Constants$2=Object.freeze(Object.defineProperty({__proto__:null,ApiVersion,BannedSearchTypes,BudibaseRoleOptions,BudibaseRoleOptionsOld,BudibaseRoles,ContextScopes,Cookies,DEFAULT_BB_DATASOURCE_ID,EventPublishType,ExtendedBudibaseRoleOptions,Features:Feature,FieldPermissions,FilterOperator,FilterValueType,OnEmptyFilter,OperatorOptions,OptionColours,PlanType,Roles,SqlNumberTypeRangeMap,TableNames,TypeIconMap},Symbol.toStringTag,{value:"Module"})),buildAnalyticsEndpoints=p=>({getAnalyticsStatus:async()=>await p.get({url:"/api/bbtel"}),analyticsPing:async u=>await p.post({url:"/api/bbtel/ping",body:{...u,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}})}),buildAIEndpoints=p=>({generateCronExpression:async u=>await p.post({url:"/api/ai/cron",body:{prompt:u}})}),buildAppEndpoints=p=>({fetchAppPackage:async u=>await p.get({url:`/api/applications/${u}/appPackage`}),saveAppMetadata:async(u,f)=>await p.put({url:`/api/applications/${u}`,body:f}),publishAppChanges:async u=>await p.post({url:`/api/applications/${u}/publish`}),revertAppChanges:async u=>await p.post({url:`/api/dev/${u}/revert`}),updateAppClientVersion:async u=>await p.post({url:`/api/applications/${u}/client/update`}),revertAppClientVersion:async u=>await p.post({url:`/api/applications/${u}/client/revert`}),getAppDeployments:async()=>await p.get({url:"/api/deployments"}),createApp:async u=>await p.post({url:"/api/applications",body:u,json:!1}),duplicateApp:async(u,f)=>await p.post({url:`/api/applications/${u}/duplicate`,body:f,json:!1}),updateAppFromExport:async(u,f)=>{const m=getDevAppID(u);return await p.post({url:`/api/applications/${m}/import`,body:f,json:!1})},importApps:async u=>await p.post({url:"/api/cloud/import",body:u,json:!1}),unpublishApp:async u=>await p.post({url:`/api/applications/${u}/unpublish`}),deleteApp:async u=>await p.delete({url:`/api/applications/${u}`}),releaseAppLock:async u=>await p.delete({url:`/api/dev/${u}/lock`}),fetchSystemDebugInfo:async()=>await p.get({url:"/api/debug/diagnostics"}),syncApp:async u=>await p.post({url:`/api/applications/${u}/sync`}),getApps:async()=>await p.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async u=>await p.get({url:`/api/${u}/components/definitions`}),addSampleData:async u=>await p.post({url:`/api/applications/${u}/sample`}),setRevertableVersion:async(u,f)=>await p.post({url:`/api/applications/${u}/setRevertableVersion`,body:{revertableVersion:f}})}),buildAttachmentEndpoints=p=>{const u={getSignedDatasourceURL:async(f,m,v)=>await p.post({url:`/api/attachments/${f}/url`,body:{bucket:m,key:v}})};return{...u,uploadAttachment:async(f,m)=>await p.post({url:`/api/attachments/${f}/upload`,body:m,json:!1}),uploadBuilderAttachment:async f=>await p.post({url:"/api/attachments/process",body:f,json:!1}),externalUpload:async(f,m,v,y)=>{const{signedUrl:w,publicUrl:k}=await u.getSignedDatasourceURL(f,m,v);return w?(await p.put({url:w,body:y,json:!1,external:!0,parseResponse:S=>S}),{publicUrl:k}):{publicUrl:void 0}},downloadAttachment:async(f,m,v)=>await p.get({url:`/api/${f}/rows/${m}/attachment/${v}`,parseResponse:y=>y,suppressErrors:!0})}},buildAuthEndpoints=p=>({logIn:async(u,f,m)=>await p.post({url:`/api/global/auth/${u}/login`,body:{username:f,password:m}}),logOut:async()=>await p.post({url:"/api/global/auth/logout"}),setInitInfo:async u=>await p.post({url:"/api/global/auth/init",body:u}),getInitInfo:async()=>await p.get({url:"/api/global/auth/init"}),requestForgotPassword:async(u,f)=>await p.post({url:`/api/global/auth/${u}/reset`,body:{email:f}}),resetPassword:async(u,f,m)=>await p.post({url:`/api/global/auth/${u}/reset/update`,body:{password:f,resetCode:m}})}),buildAutomationEndpoints=p=>({triggerAutomation:async(u,f,m)=>await p.post({url:`/api/automations/${u}/trigger`,body:{fields:f,timeout:m}}),testAutomation:async(u,f)=>await p.post({url:`/api/automations/${u}/test`,body:f}),getAutomations:async()=>await p.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await p.get({url:"/api/automations/definitions/list"}),createAutomation:async u=>await p.post({url:"/api/automations",body:u}),updateAutomation:async u=>await p.put({url:"/api/automations",body:u}),deleteAutomation:async(u,f)=>await p.delete({url:`/api/automations/${u}/${f}`}),getAutomationLogs:async u=>await p.post({url:"/api/automations/logs/search",body:u}),clearAutomationLogErrors:async(u,f)=>await p.delete({url:"/api/automations/logs",body:{appId:f,automationId:u}})}),buildConfigEndpoints=p=>({saveConfig:async u=>await p.post({url:"/api/global/configs",body:u}),getConfig:async u=>await p.get({url:`/api/global/configs/${u}`}),deleteConfig:async(u,f)=>await p.delete({url:`/api/global/configs/${u}/${f}`}),getTenantConfig:async u=>await p.get({url:`/api/global/configs/public?tenantId=${u}`}),getOIDCConfigs:async u=>await p.get({url:`/api/global/configs/public/oidc?tenantId=${u}`}),getChecklist:async u=>await p.get({url:`/api/global/configs/checklist?tenantId=${u}`}),uploadLogo:async u=>await p.post({url:"/api/global/configs/upload/settings/logoUrl",body:u,json:!1}),uploadFavicon:async u=>await p.post({url:"/api/global/configs/upload/settings/faviconUrl",body:u,json:!1}),uploadOIDCLogo:async(u,f)=>await p.post({url:`/api/global/configs/upload/logos_oidc/${u}`,body:f,json:!1}),getOIDCLogos:async()=>await p.get({url:"/api/global/configs/logos_oidc"})}),buildDatasourceEndpoints=p=>({getDatasources:async()=>await p.get({url:"/api/datasources"}),buildDatasourceSchema:async(u,f)=>await p.post({url:`/api/datasources/${u}/schema`,body:{tablesFilter:f}}),createDatasource:async u=>await p.post({url:"/api/datasources",body:u}),updateDatasource:async u=>await p.put({url:`/api/datasources/${u._id}`,body:u}),deleteDatasource:async(u,f)=>await p.delete({url:`/api/datasources/${u}/${f}`}),validateDatasource:async u=>await p.post({url:"/api/datasources/verify",body:{datasource:u}}),fetchInfoForDatasource:async u=>await p.post({url:"/api/datasources/info",body:{datasource:u}}),fetchExternalSchema:async u=>await p.get({url:`/api/datasources/${u}/schema/external`})}),buildFlagEndpoints=p=>({getFlags:async()=>await p.get({url:"/api/users/flags"}),updateFlag:async(u,f)=>await p.post({url:"/api/users/flags",body:{flag:u,value:f}}),toggleUiFeature:async u=>await p.post({url:`/api/beta/${u}`})}),buildLayoutEndpoints=p=>({saveLayout:async u=>await p.post({url:"/api/layouts",body:u}),deleteLayout:async(u,f)=>await p.delete({url:`/api/layouts/${u}/${f}`})}),buildOtherEndpoints=p=>({getEnvironment:async()=>await p.get({url:"/api/system/environment"}),getSystemStatus:async()=>await p.get({url:"/api/system/status"}),getIntegrations:async()=>await p.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await p.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await p.get({url:"/api/permission/builtin"})}),buildPermissionsEndpoints=p=>({getPermissionForResource:async u=>await p.get({url:`/api/permission/${u}`}),updatePermissionForResource:async(u,f,m)=>await p.post({url:`/api/permission/${f}/${u}/${m}`}),removePermissionFromResource:async(u,f,m)=>await p.delete({url:`/api/permission/${f}/${u}/${m}`}),getDependants:async u=>await p.get({url:`/api/permission/${u}/dependants`})}),buildQueryEndpoints=p=>({executeQuery:async(u,{pagination:f,parameters:m}={})=>await p.post({url:`/api/v2/queries/${u}`,body:{parameters:m,pagination:f}}),fetchQueryDefinition:async u=>await p.get({url:`/api/queries/${u}`,cache:!0}),getQueries:async()=>await p.get({url:"/api/queries"}),saveQuery:async u=>await p.post({url:"/api/queries",body:u}),deleteQuery:async(u,f)=>await p.delete({url:`/api/queries/${u}/${f}`}),importQueries:async u=>await p.post({url:"/api/queries/import",body:u}),previewQuery:async u=>await p.post({url:"/api/queries/preview",body:u})}),buildRelationshipEndpoints=p=>({fetchRelationshipData:async(u,f,m)=>{const v=await p.get({url:`/api/${u}/${f}/enrich?field=${m}`});return m?v[m]||[]:[v]}}),buildRoleEndpoints=p=>({deleteRole:async(u,f)=>await p.delete({url:`/api/roles/${u}/${f}`}),saveRole:async u=>await p.post({url:"/api/roles",body:u}),getRoles:async()=>await p.get({url:"/api/roles"}),getRolesForApp:async u=>await p.get({url:`/api/global/roles/${u}`}),getAccessibleRoles:async()=>await p.get({url:"/api/roles/accessible"})}),buildRouteEndpoints=p=>({fetchClientAppRoutes:async()=>await p.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await p.get({url:"/api/routing"})}),buildRowEndpoints=p=>({fetchRow:async(u,f)=>await p.get({url:`/api/${u}/rows/${f}`}),saveRow:async(u,f=!1)=>{const m=u._viewId||u.tableId;return await p.post({url:`/api/${m}/rows`,body:u,suppressErrors:f})},patchRow:async(u,f=!1)=>{const m=u._viewId||u.tableId;return await p.patch({url:`/api/${m}/rows`,body:u,suppressErrors:f})},deleteRow:async(u,f)=>await p.delete({url:`/api/${u}/rows`,body:{_id:f}}),deleteRows:async(u,f)=>(f.forEach(m=>{typeof m=="object"&&(m==null||delete m._viewId)}),await p.delete({url:`/api/${u}/rows`,body:{rows:f}})),exportRows:async(u,f,m)=>await p.post({url:`/api/${u}/rows/exportRows?format=${f}`,body:m,parseResponse:async v=>await v.text()})}),buildScreenEndpoints=p=>({saveScreen:async u=>await p.post({url:"/api/screens",body:u}),deleteScreen:async(u,f)=>await p.delete({url:`/api/screens/${u}/${f}`})}),buildTableEndpoints=p=>({fetchTableDefinition:async u=>await p.get({url:`/api/tables/${u}`,cache:!0}),fetchTableData:async u=>await p.get({url:`/api/${u}/rows`}),searchTable:async(u,f)=>await p.post({url:`/api/${u}/search`,body:f}),importTableData:async(u,f,m)=>await p.post({url:`/api/tables/${u}/import`,body:{rows:f,identifierFields:m}}),csvToJson:async u=>await p.post({url:"/api/convert/csvToJson",body:{csvString:u}}),getTables:async()=>await p.get({url:"/api/tables"}),getTable:async u=>await p.get({url:`/api/tables/${u}`}),saveTable:async u=>await p.post({url:"/api/tables",body:u}),deleteTable:async(u,f)=>await p.delete({url:`/api/tables/${u}/${f}`}),validateNewTableImport:async(u,f)=>await p.post({url:"/api/tables/validateNewTableImport",body:{rows:u,schema:f}}),validateExistingTableImport:async(u,f)=>await p.post({url:"/api/tables/validateExistingTableImport",body:{rows:u,tableId:f}}),migrateColumn:async(u,f,m)=>await p.post({url:`/api/tables/${u}/migrate`,body:{oldColumn:f,newColumn:m}})}),buildTemplateEndpoints=p=>({getEmailTemplateDefinitions:async()=>await p.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await p.get({url:"/api/global/template/email"}),saveEmailTemplate:async u=>await p.post({url:"/api/global/template",body:u}),getAppTemplates:async()=>await p.get({url:"/api/templates"})}),buildUserEndpoints=p=>({getUsers:async()=>await p.get({url:"/api/global/users"}),searchUsers:async u=>await p.post({url:"/api/global/users/search",body:u}),getUser:async u=>await p.get({url:`/api/global/users/${u}`}),updateOwnMetadata:async u=>await p.post({url:"/api/users/metadata/self",body:u}),createAdminUser:async u=>await p.post({url:"/api/global/users/init",body:u}),saveUser:async u=>await p.post({url:"/api/global/users",body:u}),createUsers:async(u,f)=>(await p.post({url:"/api/global/users/bulk",body:{create:{users:u,groups:f}}})).created,deleteUser:async u=>await p.delete({url:`/api/global/users/${u}`}),deleteUsers:async u=>(await p.post({url:"/api/global/users/bulk",body:{delete:{users:u}}})).deleted,onboardUsers:async u=>await p.post({url:"/api/global/users/onboard",body:u}),updateUserInvite:async(u,f)=>await p.post({url:`/api/global/users/invite/update/${u}`,body:f}),getUserInvite:async u=>await p.get({url:`/api/global/users/invite/${u}`}),getUserInvites:async()=>await p.get({url:"/api/global/users/invites"}),inviteUsers:async u=>await p.post({url:"/api/global/users/multi/invite",body:u}),removeUserInvites:async u=>await p.post({url:"/api/global/users/multi/invite/delete",body:u}),acceptInvite:async u=>await p.post({url:"/api/global/users/invite/accept",body:u}),getUserCountByApp:async u=>(await p.get({url:`/api/global/users/count/${u}`})).userCount,addAppBuilder:async(u,f)=>await p.post({url:`/api/global/users/${u}/app/${f}/builder`}),removeAppBuilder:async(u,f)=>await p.delete({url:`/api/global/users/${u}/app/${f}/builder`}),getAccountHolder:async()=>await p.get({url:"/api/global/users/accountholder"})}),buildSelfEndpoints=p=>({generateAPIKey:async()=>{const u=await p.post({url:"/api/global/self/api_key"});return u==null?void 0:u.apiKey},fetchDeveloperInfo:async()=>p.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await p.get({url:"/api/self"}),fetchBuilderSelf:async()=>await p.get({url:"/api/global/self"}),updateSelf:async u=>await p.post({url:"/api/global/self",body:u})}),buildViewEndpoints=p=>({fetchViewData:async(u,{field:f,groupBy:m,calculation:v})=>{const y=new URLSearchParams;v&&(f&&y.set("field",f),y.set("calculation",v)),m&&y.set("group",m);const w=f?`/api/views/${encodeURIComponent(u)}?${y}`:`/api/views/${encodeURIComponent(u)}`;return await p.get({url:w})},exportView:async(u,f)=>{const m=encodeURIComponent(u);return await p.get({url:`/api/views/export?view=${m}&format=${f}`,parseResponse:async v=>await v.text()})},saveView:async u=>await p.post({url:"/api/views",body:u}),deleteView:async u=>await p.delete({url:`/api/views/${encodeURIComponent(u)}`})}),buildViewV2Endpoints=p=>({fetchDefinition:async u=>await p.get({url:`/api/v2/views/${encodeURIComponent(u)}`,cache:!0}),create:async u=>await p.post({url:"/api/v2/views",body:u}),update:async u=>await p.put({url:`/api/v2/views/${encodeURIComponent(u.id)}`,body:u}),fetch:async(u,f)=>await p.post({url:`/api/v2/views/${encodeURIComponent(u)}/search`,body:f}),delete:async u=>await p.delete({url:`/api/v2/views/${encodeURIComponent(u)}`})}),buildLicensingEndpoints=p=>({activateLicenseKey:async u=>p.post({url:"/api/global/license/key",body:{licenseKey:u}}),deleteLicenseKey:async()=>p.delete({url:"/api/global/license/key"}),getLicenseKey:async()=>{try{return await p.get({url:"/api/global/license/key"})}catch(u){if(u.status!==404)throw u}},activateOfflineLicense:async u=>p.post({url:"/api/global/license/offline",body:{offlineLicenseToken:u}}),deleteOfflineLicense:async()=>p.delete({url:"/api/global/license/offline"}),getOfflineLicense:async()=>{try{return await p.get({url:"/api/global/license/offline"})}catch(u){if(u.status!==404)throw u}},getOfflineLicenseIdentifier:async()=>await p.get({url:"/api/global/license/offline/identifier"}),refreshLicense:async()=>p.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>p.get({url:"/api/global/license/usage"})}),buildGroupsEndpoints=p=>{async function u(f,m,v,y){return await p.post({url:`/api/global/groups/${f}/${m}`,body:{[v]:y}})}return{saveGroup:async f=>await p.post({url:"/api/global/groups",body:f}),getGroups:async()=>(await p.get({url:"/api/global/groups"})).data,getGroup:async f=>await p.get({url:`/api/global/groups/${f}`}),deleteGroup:async(f,m)=>await p.delete({url:`/api/global/groups/${f}/${m}`}),getGroupUsers:async({id:f,bookmark:m,emailSearch:v})=>{let y=`/api/global/groups/${f}/users?`;return m&&(y+=`bookmark=${m}&`),v&&(y+=`emailSearch=${v}`),await p.get({url:y})},addUsersToGroup:async(f,m)=>u(f,"users","add",m),removeUsersFromGroup:async(f,m)=>u(f,"users","remove",m),addAppsToGroup:async(f,m)=>u(f,"apps","add",m),removeAppsFromGroup:async(f,m)=>u(f,"apps","remove",m),addGroupAppBuilder:async(f,m)=>await p.post({url:`/api/global/groups/${f}/app/${m}/builder`}),removeGroupAppBuilder:async(f,m)=>await p.delete({url:`/api/global/groups/${f}/app/${m}/builder`})}},buildPluginEndpoints=p=>({uploadPlugin:async u=>await p.post({url:"/api/plugin/upload",body:u,json:!1}),createPlugin:async u=>await p.post({url:"/api/plugin",body:u}),getPlugins:async()=>await p.get({url:"/api/plugin"}),deletePlugin:async u=>await p.delete({url:`/api/plugin/${u}`})}),buildBackupEndpoints=p=>({createManualBackup:async u=>await p.post({url:`/api/apps/${u}/backups`}),searchBackups:async(u,f)=>await p.post({url:`/api/apps/${u}/backups/search`,body:f}),deleteBackup:async(u,f)=>await p.delete({url:`/api/apps/${u}/backups/${f}`}),restoreBackup:async(u,f,m)=>await p.post({url:`/api/apps/${u}/backups/${f}/import`,body:{name:m}})}),buildEnvironmentVariableEndpoints=p=>({checkEnvironmentVariableStatus:async()=>await p.get({url:"/api/env/variables/status"}),fetchEnvironmentVariables:async()=>await p.get({url:"/api/env/variables",json:!1}),createEnvironmentVariable:async u=>await p.post({url:"/api/env/variables",body:u}),deleteEnvironmentVariable:async u=>await p.delete({url:`/api/env/variables/${u}`}),updateEnvironmentVariable:async(u,f)=>await p.patch({url:`/api/env/variables/${u}`,body:f})}),buildEventEndpoints=p=>({publishEvent:async u=>await p.post({url:"/api/global/event/publish",body:{type:u}})}),buildAuditLogEndpoints=p=>({searchAuditLogs:async u=>await p.post({url:"/api/global/auditlogs/search",body:u}),getEventDefinitions:async()=>await p.get({url:"/api/global/auditlogs/definitions"}),getDownloadUrl:u=>`/api/global/auditlogs/download?query=${encodeURIComponent(JSON.stringify(u))}`}),buildLogsEndpoints=p=>({getSystemLogs:async()=>await p.get({url:"/api/system/logs",json:!1,parseResponse:async u=>u})}),buildMigrationEndpoints=p=>({getMigrationStatus:async()=>await p.get({url:"/api/migrations/status"})}),buildRowActionEndpoints=p=>({fetch:async u=>(await p.get({url:`/api/tables/${u}/actions`})).actions,create:async(u,f)=>await p.post({url:`/api/tables/${u}/actions`,body:{name:f}}),delete:async(u,f)=>await p.delete({url:`/api/tables/${u}/actions/${f}`}),enableView:async(u,f,m)=>await p.post({url:`/api/tables/${u}/actions/${f}/permissions/${m}`}),disableView:async(u,f,m)=>await p.delete({url:`/api/tables/${u}/actions/${f}/permissions/${m}`}),trigger:async(u,f,m)=>await p.post({url:`/api/tables/${u}/actions/${f}/trigger`,body:{rowId:m}})}),APISessionID=uuid(),createAPIClient=(p={})=>{let u={};const f=async(M,T,E=!1)=>{let H=M.statusText,F=null;try{F=await M.json(),F!=null&&F.message?H=F.message:F!=null&&F.error&&(H=JSON.stringify(F.error))}catch{}return{message:H,json:F,status:M.status,url:M.url,method:T,handled:!0,suppressErrors:E}},m=(M,T,E)=>({message:M,json:null,status:400,url:T,method:E,handled:!0,suppressErrors:!1}),v=async M=>{let{json:T,method:E,external:H,body:F,url:Z,parseResponse:$,suppressErrors:J}=M;T=T&&E!==HTTPMethod.GET;let ae={Accept:"application/json"};ae[Header.SESSION_ID]=APISessionID,H||(ae[Header.API_VER]=ApiVersion),T&&(ae["Content-Type"]="application/json"),p!=null&&p.attachHeaders&&p.attachHeaders(ae);let ie=F;if(T)try{ie=JSON.stringify(F)}catch{throw m("Invalid JSON body",Z,E)}let he;try{he=await fetch(Z,{method:E,headers:ae,body:ie,credentials:"same-origin"})}catch{throw delete u[Z],m("Failed to send request",Z,E)}if(he.status>=200&&he.status<400){y(he);try{return he.status===204?void 0:$?await $(he):await he.json()}catch(fe){throw delete u[Z],`Failed to parse response: ${fe}`}}else throw delete u[Z],await f(he,E,J)},y=M=>{if(!p.onMigrationDetected)return;const T=M.headers.get(Header.MIGRATING_APP);T&&p.onMigrationDetected(T)},w=async M=>{const T=M.url;return u[T]||(u[T]=v(M),u[T]=await u[T]),await u[T]},k=M=>async T=>{try{let E={json:!0,external:!1,suppressErrors:!1,cache:!1,method:M,...T},{url:H,cache:F,external:Z}=E;return Z||(E.url=`/${H}`.replace("//","/")),await(F&&(p==null?void 0:p.enableCaching)?w:v)(E)}catch(E){throw p!=null&&p.onError&&p.onError(E),E}};let S={post:k(HTTPMethod.POST),get:k(HTTPMethod.GET),patch:k(HTTPMethod.PATCH),delete:k(HTTPMethod.DELETE),put:k(HTTPMethod.PUT),invalidateCache:()=>{u={}},getAppID:()=>{var T;let M={};return(T=p==null?void 0:p.attachHeaders)==null||T.call(p,M),M==null?void 0:M[Header.APP_ID]}};return{...S,...buildAIEndpoints(S),...buildAnalyticsEndpoints(S),...buildAppEndpoints(S),...buildAttachmentEndpoints(S),...buildAuthEndpoints(S),...buildAutomationEndpoints(S),...buildConfigEndpoints(S),...buildDatasourceEndpoints(S),...buildFlagEndpoints(S),...buildLayoutEndpoints(S),...buildOtherEndpoints(S),...buildPermissionsEndpoints(S),...buildQueryEndpoints(S),...buildRelationshipEndpoints(S),...buildRoleEndpoints(S),...buildRouteEndpoints(S),...buildRowEndpoints(S),...buildScreenEndpoints(S),...buildTableEndpoints(S),...buildTemplateEndpoints(S),...buildUserEndpoints(S),...buildViewEndpoints(S),...buildSelfEndpoints(S),...buildLicensingEndpoints(S),...buildGroupsEndpoints(S),...buildPluginEndpoints(S),...buildBackupEndpoints(S),...buildEnvironmentVariableEndpoints(S),...buildEventEndpoints(S),...buildAuditLogEndpoints(S),...buildLogsEndpoints(S),...buildMigrationEndpoints(S),viewV2:buildViewV2Endpoints(S),rowActions:buildRowActionEndpoints(S)}},getJSONArrayDatasourceSchema=(p,u)=>{let f=p,m=[];u.prefixKeys&&(m=u.prefixKeys.concat(["schema"])),m=m.concat(u.label.split(".").slice(2));for(let v=0;v<m.length;v++)f=f==null?void 0:f[m[v]],f!=null&&f.schema&&(f=f.schema);return convertJSONSchemaToTableSchema(f,{squashObjects:!0,prefixKeys:m})},convertJSONSchemaToTableSchema=(p,u)=>{if(!p)return null;u={squashObjects:!1,prefixKeys:null,...u},p.schema?p=p.schema:p={value:p};const f=extractJSONSchemaKeys(p,u.squashObjects);let m={};return f.forEach(({key:v,type:y})=>{m[v]={type:y,name:v,prefixKeys:u.prefixKeys}}),m},extractJSONSchemaKeys=(p,u=!1)=>{if(!p||!Object.keys(p).length)return[];let f=[];return Object.keys(p).forEach(m=>{const v=p[m].type;if(v==="json"&&u){const y=extractJSONSchemaKeys(p[m].schema,u);f=f.concat(y.map(w=>({key:`${m}.${w.key}`,type:w.type})))}else f.push({key:m,type:v==="array"?"jsonarray":v})}),f},generateQueryArraySchemas=(p,u)=>{var f,m;for(let v in p)((f=p[v])==null?void 0:f.type)==="json"&&((m=p[v])==null?void 0:m.subtype)==="array"&&hasSchema(u[v])&&(p[v]={schema:{schema:Object.entries(u[v]||{}).reduce((y,[w,k])=>(y[w]={name:w,type:k.type,subtype:k.subtype},y),{}),type:"json"},type:"json",subtype:"array"});return p};function setCookie(p,u,f){getCookie(p)&&removeCookie(p);let m=`${p}=${u}; Path=/;`;f&&(m+=` Domain=${f};`),window.document.cookie=m}function getCookie(p){const f=`; ${document.cookie}`.split(`; ${p}=`);if(f.length===2)return f[1].split(";").shift()}function removeCookie(p){getCookie(p)&&(document.cookie=`${p}=; Max-Age=-99999999; Path=/;`)}const RolePriorities={[Roles.ADMIN]:5,[Roles.CREATOR]:4,[Roles.POWER]:3,[Roles.BASIC]:2,[Roles.PUBLIC]:1},getRolePriority=p=>RolePriorities[p]??0,sleep=p=>new Promise(u=>setTimeout(u,p)),debounce=(p,u=1e3)=>{let f;return async(...m)=>new Promise(v=>{f&&clearTimeout(f),f=setTimeout(async()=>{v(await p(...m))},u)})},throttle=(p,u=1e3)=>{let f,m=!1,v=!1;const y=(...w)=>{if(f=w,m){v=!0;return}p(...f),m=!0,setTimeout(()=>{m=!1,v&&(v=!1,y(...f))},u)};return y},domDebounce=p=>{let u=!1,f;return(...m)=>{f=m,u||(u=!0,requestAnimationFrame(()=>{p(...f),u=!1}))}},buildFormBlockButtonConfig=p=>{const{_id:u,actionType:f,dataSource:m,notificationOverride:v,actionUrl:y,showDeleteButton:w,deleteButtonLabel:k,showSaveButton:S,saveButtonLabel:M}=p||{};if(!u)return;const T=`${u}-form`,E=`${u}-repeater`,H=m==null?void 0:m.resourceId,F=w===!1?"":k==null?void 0:k.trim(),Z=S===!1?"":M==null?void 0:M.trim(),$=[{"##eventHandlerType":"Validate Form",parameters:{componentId:T}},{"##eventHandlerType":"Save Row",parameters:{providerId:T,tableId:H,notificationOverride:v,confirm:null}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...f!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:T}}],...y?[{"##eventHandlerType":"Navigate To",parameters:{url:y}}]:[]],J=[{"##eventHandlerType":"Delete Row",parameters:{confirm:!0,tableId:H,rowId:`{{ ${makePropSafe(E)}.${makePropSafe("_id")} }}`,revId:`{{ ${makePropSafe(E)}.${makePropSafe("_rev")} }}`,notificationOverride:v}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...y?[{"##eventHandlerType":"Navigate To",parameters:{url:y}}]:[]],ae=[];return f&&["Update","Create"].includes(f)&&S!==!1&&ae.push({text:Z||"Save",_id:uuid(),_component:"@budibase/standard-components/button",onClick:$,type:"cta"}),f==="Update"&&w!==!1&&ae.push({text:F||"Delete",_id:uuid(),_component:"@budibase/standard-components/button",onClick:J,quiet:!0,type:"warning"}),ae},buildMultiStepFormBlockDefaultProps=p=>{const{_id:u,stepCount:f,currentStep:m,actionType:v,dataSource:y}=p||{};if(!u||!f)return;const w=`Step {{ [${u}-form].[__currentStep] }}`,k=y==null?void 0:y.resourceId,S=`${u}-form`;let M=[];return m!==0&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Back",type:"secondary",size:"M",onClick:[{parameters:{type:"prev",componentId:S},"##eventHandlerType":"Change Form Step"}]}),m!==f-1&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Next",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:S}},{parameters:{type:"next",componentId:S},"##eventHandlerType":"Change Form Step"}]}),v!=="View"&&m===f-1&&M.push({_id:uuid(),_component:"@budibase/standard-components/button",_instanceName:uuid(),text:"Save",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:S}},{"##eventHandlerType":"Save Row",parameters:{tableId:k,providerId:S}},...v!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:S}}]]}),{buttons:M,title:w}};function parseFilter(p){var f;if(!(p!=null&&p.groups))return p;const u=lodashExports.cloneDeep(p);return u.groups=(f=u.groups)==null?void 0:f.map(m=>{var v,y;return m.filters=(v=m.filters)==null?void 0:v.filter(w=>w.field&&w.operator),(y=m.filters)!=null&&y.length?m:null}).filter(m=>!!m),u}const isBetterSample=(p,u)=>{if(u==null&&p!=null)return!0;if(u!=null&&p==null)return!1;const f=typeof u,m=typeof p;return f!==m?!1:m==="string"&&p.length>u.length||m==="object"&&Object.keys(p).length>Object.keys(u).length},generateGoldenSample=p=>{let u={};return p==null||p.slice(0,100).forEach(f=>{Object.keys(f).forEach(m=>{isBetterSample(f[m],u[m])&&(u[m]=f[m])})}),u},getColumnIcon=p=>{if(p.schema.icon)return p.schema.icon;if(p.calculationType)return"Calculator";if(p.schema.autocolumn)return"MagicWand";if(isDeprecatedSingleUserColumn(p.schema))return"User";const{type:u,subtype:f}=p.schema;return(typeof TypeIconMap[u]=="object"&&f?TypeIconMap[u][f]:TypeIconMap[u])||"Text"},memo=p=>{const u=writable(p);let f=JSON.stringify(p);const m=v=>{const y=JSON.stringify(v);y!==f&&(u.set(v),f=y)};return{subscribe:u.subscribe,set:m,update:v=>{let y=JSON.parse(f);const w=v(y);m(w)}}},derivedMemo=(p,u)=>{const f=derived(p,u),m=memo(get_store_value(f));return f.subscribe(m.set),m},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0",PACKET_TYPES.close="1",PACKET_TYPES.ping="2",PACKET_TYPES.pong="3",PACKET_TYPES.message="4",PACKET_TYPES.upgrade="5",PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(p=>{PACKET_TYPES_REVERSE[PACKET_TYPES[p]]=p});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=p=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(p):p&&p.buffer instanceof ArrayBuffer,encodePacket=({type:p,data:u},f,m)=>withNativeBlob$1&&u instanceof Blob?f?m(u):encodeBlobAsBase64(u,m):withNativeArrayBuffer$2&&(u instanceof ArrayBuffer||isView$1(u))?f?m(u):encodeBlobAsBase64(new Blob([u]),m):m(PACKET_TYPES[p]+(u||"")),encodeBlobAsBase64=(p,u)=>{const f=new FileReader;return f.onload=function(){const m=f.result.split(",")[1];u("b"+(m||""))},f.readAsDataURL(p)};function toArray(p){return p instanceof Uint8Array?p:p instanceof ArrayBuffer?new Uint8Array(p):new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(p,u){if(withNativeBlob$1&&p.data instanceof Blob)return p.data.arrayBuffer().then(toArray).then(u);if(withNativeArrayBuffer$2&&(p.data instanceof ArrayBuffer||isView$1(p.data)))return u(toArray(p.data));encodePacket(p,!1,f=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),u(TEXT_ENCODER.encode(f))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$2=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let p=0;p<chars.length;p++)lookup$2[chars.charCodeAt(p)]=p;const decode$2=p=>{let u=p.length*.75,f=p.length,m,v=0,y,w,k,S;p[p.length-1]==="="&&(u--,p[p.length-2]==="="&&u--);const M=new ArrayBuffer(u),T=new Uint8Array(M);for(m=0;m<f;m+=4)y=lookup$2[p.charCodeAt(m)],w=lookup$2[p.charCodeAt(m+1)],k=lookup$2[p.charCodeAt(m+2)],S=lookup$2[p.charCodeAt(m+3)],T[v++]=y<<2|w>>4,T[v++]=(w&15)<<4|k>>2,T[v++]=(k&3)<<6|S&63;return M},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(p,u)=>{if(typeof p!="string")return{type:"message",data:mapBinary(p,u)};const f=p.charAt(0);return f==="b"?{type:"message",data:decodeBase64Packet(p.substring(1),u)}:PACKET_TYPES_REVERSE[f]?p.length>1?{type:PACKET_TYPES_REVERSE[f],data:p.substring(1)}:{type:PACKET_TYPES_REVERSE[f]}:ERROR_PACKET},decodeBase64Packet=(p,u)=>{if(withNativeArrayBuffer$1){const f=decode$2(p);return mapBinary(f,u)}else return{base64:!0,data:p}},mapBinary=(p,u)=>{switch(u){case"blob":return p instanceof Blob?p:new Blob([p]);case"arraybuffer":default:return p instanceof ArrayBuffer?p:p.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(p,u)=>{const f=p.length,m=new Array(f);let v=0;p.forEach((y,w)=>{encodePacket(y,!1,k=>{m[w]=k,++v===f&&u(m.join(SEPARATOR))})})},decodePayload=(p,u)=>{const f=p.split(SEPARATOR),m=[];for(let v=0;v<f.length;v++){const y=decodePacket(f[v],u);if(m.push(y),y.type==="error")break}return m};function createPacketEncoderStream(){return new TransformStream({transform(p,u){encodePacketToBinary(p,f=>{const m=f.length;let v;if(m<126)v=new Uint8Array(1),new DataView(v.buffer).setUint8(0,m);else if(m<65536){v=new Uint8Array(3);const y=new DataView(v.buffer);y.setUint8(0,126),y.setUint16(1,m)}else{v=new Uint8Array(9);const y=new DataView(v.buffer);y.setUint8(0,127),y.setBigUint64(1,BigInt(m))}p.data&&typeof p.data!="string"&&(v[0]|=128),u.enqueue(v),u.enqueue(f)})}})}let TEXT_DECODER;function totalLength(p){return p.reduce((u,f)=>u+f.length,0)}function concatChunks(p,u){if(p[0].length===u)return p.shift();const f=new Uint8Array(u);let m=0;for(let v=0;v<u;v++)f[v]=p[0][m++],m===p[0].length&&(p.shift(),m=0);return p.length&&m<p[0].length&&(p[0]=p[0].slice(m)),f}function createPacketDecoderStream(p,u){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const f=[];let m=0,v=-1,y=!1;return new TransformStream({transform(w,k){for(f.push(w);;){if(m===0){if(totalLength(f)<1)break;const S=concatChunks(f,1);y=(S[0]&128)===128,v=S[0]&127,v<126?m=3:v===126?m=1:m=2}else if(m===1){if(totalLength(f)<2)break;const S=concatChunks(f,2);v=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),m=3}else if(m===2){if(totalLength(f)<8)break;const S=concatChunks(f,8),M=new DataView(S.buffer,S.byteOffset,S.length),T=M.getUint32(0);if(T>Math.pow(2,53-32)-1){k.enqueue(ERROR_PACKET);break}v=T*Math.pow(2,32)+M.getUint32(4),m=3}else{if(totalLength(f)<v)break;const S=concatChunks(f,v);k.enqueue(decodePacket(y?S:TEXT_DECODER.decode(S),u)),m=0}if(v===0||v>p){k.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(p){if(p)return mixin(p)}function mixin(p){for(var u in Emitter.prototype)p[u]=Emitter.prototype[u];return p}Emitter.prototype.on=Emitter.prototype.addEventListener=function(p,u){return this._callbacks=this._callbacks||{},(this._callbacks["$"+p]=this._callbacks["$"+p]||[]).push(u),this},Emitter.prototype.once=function(p,u){function f(){this.off(p,f),u.apply(this,arguments)}return f.fn=u,this.on(p,f),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(p,u){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+p];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+p],this;for(var m,v=0;v<f.length;v++)if(m=f[v],m===u||m.fn===u){f.splice(v,1);break}return f.length===0&&delete this._callbacks["$"+p],this},Emitter.prototype.emit=function(p){this._callbacks=this._callbacks||{};for(var u=new Array(arguments.length-1),f=this._callbacks["$"+p],m=1;m<arguments.length;m++)u[m-1]=arguments[m];if(f){f=f.slice(0);for(var m=0,v=f.length;m<v;++m)f[m].apply(this,u)}return this},Emitter.prototype.emitReserved=Emitter.prototype.emit,Emitter.prototype.listeners=function(p){return this._callbacks=this._callbacks||{},this._callbacks["$"+p]||[]},Emitter.prototype.hasListeners=function(p){return!!this.listeners(p).length};const globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(p,...u){return u.reduce((f,m)=>(p.hasOwnProperty(m)&&(f[m]=p[m]),f),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(p,u){u.useNativeTimers?(p.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),p.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(p.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),p.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(p){return typeof p=="string"?utf8Length(p):Math.ceil((p.byteLength||p.size)*BASE64_OVERHEAD)}function utf8Length(p){let u=0,f=0;for(let m=0,v=p.length;m<v;m++)u=p.charCodeAt(m),u<128?f+=1:u<2048?f+=2:u<55296||u>=57344?f+=3:(m++,f+=4);return f}function encode$2(p){let u="";for(let f in p)p.hasOwnProperty(f)&&(u.length&&(u+="&"),u+=encodeURIComponent(f)+"="+encodeURIComponent(p[f]));return u}function decode$1(p){let u={},f=p.split("&");for(let m=0,v=f.length;m<v;m++){let y=f[m].split("=");u[decodeURIComponent(y[0])]=decodeURIComponent(y[1])}return u}class TransportError extends Error{constructor(u,f,m){super(u),this.description=f,this.context=m,this.type="TransportError"}}class Transport extends Emitter{constructor(u){super(),this.writable=!1,installTimerFunctions(this,u),this.opts=u,this.query=u.query,this.socket=u.socket}onError(u,f,m){return super.emitReserved("error",new TransportError(u,f,m)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(u){this.readyState==="open"&&this.write(u)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(u){const f=decodePacket(u,this.socket.binaryType);this.onPacket(f)}onPacket(u){super.emitReserved("packet",u)}onClose(u){this.readyState="closed",super.emitReserved("close",u)}pause(u){}createUri(u,f={}){return u+"://"+this._hostname()+this._port()+this.opts.path+this._query(f)}_hostname(){const u=this.opts.hostname;return u.indexOf(":")===-1?u:"["+u+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(u){const f=encode$2(u);return f.length?"?"+f:""}}const alphabet$3="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={};let seed$1=0,i=0,prev;function encode$1(p){let u="";do u=alphabet$3[p%length]+u,p=Math.floor(p/length);while(p>0);return u}function yeast(){const p=encode$1(+new Date);return p!==prev?(seed$1=0,prev=p):p+"."+encode$1(seed$1++)}for(;i<length;i++)map[alphabet$3[i]]=i;let value$1=!1;try{value$1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(p){}const hasCORS=value$1;function XHR(p){const u=p.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!u||hasCORS))return new XMLHttpRequest}catch{}if(!u)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function createCookieJar(){}function empty(){}const hasXHR2=function(){return new XHR({xdomain:!1}).responseType!=null}();class Polling extends Transport{constructor(u){if(super(u),this.polling=!1,typeof location<"u"){const m=location.protocol==="https:";let v=location.port;v||(v=m?"443":"80"),this.xd=typeof location<"u"&&u.hostname!==location.hostname||v!==u.port}const f=u&&u.forceBase64;this.supportsBinary=hasXHR2&&!f,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(u){this.readyState="pausing";const f=()=>{this.readyState="paused",u()};if(this.polling||!this.writable){let m=0;this.polling&&(m++,this.once("pollComplete",function(){--m||f()})),this.writable||(m++,this.once("drain",function(){--m||f()}))}else f()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(u){const f=m=>{if(this.readyState==="opening"&&m.type==="open"&&this.onOpen(),m.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(m)};decodePayload(u,this.socket.binaryType).forEach(f),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const u=()=>{this.write([{type:"close"}])};this.readyState==="open"?u():this.once("open",u)}write(u){this.writable=!1,encodePayload(u,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const u=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(u,f)}request(u={}){return Object.assign(u,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request(this.uri(),u)}doWrite(u,f){const m=this.request({method:"POST",data:u});m.on("success",f),m.on("error",(v,y)=>{this.onError("xhr post error",v,y)})}doPoll(){const u=this.request();u.on("data",this.onData.bind(this)),u.on("error",(f,m)=>{this.onError("xhr poll error",f,m)}),this.pollXhr=u}}class Request extends Emitter{constructor(u,f){super(),installTimerFunctions(this,f),this.opts=f,this.method=f.method||"GET",this.uri=u,this.data=f.data!==void 0?f.data:null,this.create()}create(){var u;const f=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this.opts.xd;const m=this.xhr=new XHR(f);try{m.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){m.setDisableHeaderCheck&&m.setDisableHeaderCheck(!0);for(let v in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(v)&&m.setRequestHeader(v,this.opts.extraHeaders[v])}}catch{}if(this.method==="POST")try{m.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{m.setRequestHeader("Accept","*/*")}catch{}(u=this.opts.cookieJar)===null||u===void 0||u.addCookies(m),"withCredentials"in m&&(m.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(m.timeout=this.opts.requestTimeout),m.onreadystatechange=()=>{var v;m.readyState===3&&((v=this.opts.cookieJar)===null||v===void 0||v.parseCookies(m)),m.readyState===4&&(m.status===200||m.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof m.status=="number"?m.status:0)},0))},m.send(this.data)}catch(v){this.setTimeoutFn(()=>{this.onError(v)},0);return}typeof document<"u"&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)}onError(u){this.emitReserved("error",u,this.xhr),this.cleanup(!0)}cleanup(u){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty,u)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this.index],this.xhr=null}}onLoad(){const u=this.xhr.responseText;u!==null&&(this.emitReserved("data",u),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Request.requestsCount=0,Request.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const p="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(p,unloadHandler,!1)}}function unloadHandler(){for(let p in Request.requests)Request.requests.hasOwnProperty(p)&&Request.requests[p].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?u=>Promise.resolve().then(u):(u,f)=>f(u,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(u){super(u),this.supportsBinary=!u.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const u=this.uri(),f=this.opts.protocols,m=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(m.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?f?new WebSocket(u,f):new WebSocket(u):new WebSocket(u,f,m)}catch(v){return this.emitReserved("error",v)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=u=>this.onClose({description:"websocket connection closed",context:u}),this.ws.onmessage=u=>this.onData(u.data),this.ws.onerror=u=>this.onError("websocket error",u)}write(u){this.writable=!1;for(let f=0;f<u.length;f++){const m=u[f],v=f===u.length-1;encodePacket(m,this.supportsBinary,y=>{const w={};try{usingBrowserWebSocket&&this.ws.send(y)}catch{}v&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const u=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=yeast()),this.supportsBinary||(f.b64=1),this.createUri(u,f)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(u=>{this.onError("webtransport error",u)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(u=>{const f=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),m=u.readable.pipeThrough(f).getReader(),v=createPacketEncoderStream();v.readable.pipeTo(u.writable),this.writer=v.writable.getWriter();const y=()=>{m.read().then(({done:k,value:S})=>{k||(this.onPacket(S),y())}).catch(k=>{})};y();const w={type:"open"};this.query.sid&&(w.data=`{"sid":"${this.query.sid}"}`),this.writer.write(w).then(()=>this.onOpen())})}))}write(u){this.writable=!1;for(let f=0;f<u.length;f++){const m=u[f],v=f===u.length-1;this.writer.write(m).then(()=>{v&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var u;(u=this.transport)===null||u===void 0||u.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$6(p){if(p.length>2e3)throw"URI too long";const u=p,f=p.indexOf("["),m=p.indexOf("]");f!=-1&&m!=-1&&(p=p.substring(0,f)+p.substring(f,m).replace(/:/g,";")+p.substring(m,p.length));let v=re.exec(p||""),y={},w=14;for(;w--;)y[parts[w]]=v[w]||"";return f!=-1&&m!=-1&&(y.source=u,y.host=y.host.substring(1,y.host.length-1).replace(/;/g,":"),y.authority=y.authority.replace("[","").replace("]","").replace(/;/g,":"),y.ipv6uri=!0),y.pathNames=pathNames(y,y.path),y.queryKey=queryKey(y,y.query),y}function pathNames(p,u){const f=/\/{2,9}/g,m=u.replace(f,"/").split("/");return(u.slice(0,1)=="/"||u.length===0)&&m.splice(0,1),u.slice(-1)=="/"&&m.splice(m.length-1,1),m}function queryKey(p,u){const f={};return u.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(m,v,y){v&&(f[v]=y)}),f}let Socket$1=class Ec extends Emitter{constructor(u,f={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],u&&typeof u=="object"&&(f=u,u=null),u?(u=parse$6(u),f.hostname=u.host,f.secure=u.protocol==="https"||u.protocol==="wss",f.port=u.port,u.query&&(f.query=u.query)):f.host&&(f.hostname=parse$6(f.host).host),installTimerFunctions(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=f.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(u){const f=Object.assign({},this.opts.query);f.EIO=protocol$1,f.transport=u,this.id&&(f.sid=this.id);const m=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[u]);return new transports[u](m)}open(){let u;if(this.opts.rememberUpgrade&&Ec.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)u="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else u=this.transports[0];this.readyState="opening";try{u=this.createTransport(u)}catch{this.transports.shift(),this.open();return}u.open(),this.setTransport(u)}setTransport(u){this.transport&&this.transport.removeAllListeners(),this.transport=u,u.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",f=>this.onClose("transport close",f))}probe(u){let f=this.createTransport(u),m=!1;Ec.priorWebsocketSuccess=!1;const v=()=>{m||(f.send([{type:"ping",data:"probe"}]),f.once("packet",E=>{if(!m)if(E.type==="pong"&&E.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Ec.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{m||this.readyState!=="closed"&&(T(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const H=new Error("probe error");H.transport=f.name,this.emitReserved("upgradeError",H)}}))};function y(){m||(m=!0,T(),f.close(),f=null)}const w=E=>{const H=new Error("probe error: "+E);H.transport=f.name,y(),this.emitReserved("upgradeError",H)};function k(){w("transport closed")}function S(){w("socket closed")}function M(E){f&&E.name!==f.name&&y()}const T=()=>{f.removeListener("open",v),f.removeListener("error",w),f.removeListener("close",k),this.off("close",S),this.off("upgrading",M)};f.once("open",v),f.once("error",w),f.once("close",k),this.once("close",S),this.once("upgrading",M),this.upgrades.indexOf("webtransport")!==-1&&u!=="webtransport"?this.setTimeoutFn(()=>{m||f.open()},200):f.open()}onOpen(){if(this.readyState="open",Ec.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let u=0;const f=this.upgrades.length;for(;u<f;u++)this.probe(this.upgrades[u])}}onPacket(u){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",u),this.emitReserved("heartbeat"),this.resetPingTimeout(),u.type){case"open":this.onHandshake(JSON.parse(u.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const f=new Error("server error");f.code=u.data,this.onError(f);break;case"message":this.emitReserved("data",u.data),this.emitReserved("message",u.data);break}}onHandshake(u){this.emitReserved("handshake",u),this.id=u.sid,this.transport.query.sid=u.sid,this.upgrades=this.filterUpgrades(u.upgrades),this.pingInterval=u.pingInterval,this.pingTimeout=u.pingTimeout,this.maxPayload=u.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const u=this.getWritablePackets();this.transport.send(u),this.prevBufferLen=u.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let f=1;for(let m=0;m<this.writeBuffer.length;m++){const v=this.writeBuffer[m].data;if(v&&(f+=byteLength(v)),m>0&&f>this.maxPayload)return this.writeBuffer.slice(0,m);f+=2}return this.writeBuffer}write(u,f,m){return this.sendPacket("message",u,f,m),this}send(u,f,m){return this.sendPacket("message",u,f,m),this}sendPacket(u,f,m,v){if(typeof f=="function"&&(v=f,f=void 0),typeof m=="function"&&(v=m,m=null),this.readyState==="closing"||this.readyState==="closed")return;m=m||{},m.compress=m.compress!==!1;const y={type:u,data:f,options:m};this.emitReserved("packetCreate",y),this.writeBuffer.push(y),v&&this.once("flush",v),this.flush()}close(){const u=()=>{this.onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),u()},m=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?m():u()}):this.upgrading?m():u()),this}onError(u){Ec.priorWebsocketSuccess=!1,this.emitReserved("error",u),this.onClose("transport error",u)}onClose(u,f){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",u,f),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(u){const f=[];let m=0;const v=u.length;for(;m<v;m++)~this.transports.indexOf(u[m])&&f.push(u[m]);return f}};Socket$1.protocol=protocol$1;function url(p,u="",f){let m=p;f=f||typeof location<"u"&&location,p==null&&(p=f.protocol+"//"+f.host),typeof p=="string"&&(p.charAt(0)==="/"&&(p.charAt(1)==="/"?p=f.protocol+p:p=f.host+p),/^(https?|wss?):\/\//.test(p)||(typeof f<"u"?p=f.protocol+"//"+p:p="https://"+p),m=parse$6(p)),m.port||(/^(http|ws)$/.test(m.protocol)?m.port="80":/^(http|ws)s$/.test(m.protocol)&&(m.port="443")),m.path=m.path||"/";const y=m.host.indexOf(":")!==-1?"["+m.host+"]":m.host;return m.id=m.protocol+"://"+y+":"+m.port+u,m.href=m.protocol+"://"+y+(f&&f.port===m.port?"":":"+m.port),m}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=p=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(p):p.buffer instanceof ArrayBuffer,toString=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString.call(File)==="[object FileConstructor]";function isBinary(p){return withNativeArrayBuffer&&(p instanceof ArrayBuffer||isView(p))||withNativeBlob&&p instanceof Blob||withNativeFile&&p instanceof File}function hasBinary(p,u){if(!p||typeof p!="object")return!1;if(Array.isArray(p)){for(let f=0,m=p.length;f<m;f++)if(hasBinary(p[f]))return!0;return!1}if(isBinary(p))return!0;if(p.toJSON&&typeof p.toJSON=="function"&&arguments.length===1)return hasBinary(p.toJSON(),!0);for(const f in p)if(Object.prototype.hasOwnProperty.call(p,f)&&hasBinary(p[f]))return!0;return!1}function deconstructPacket(p){const u=[],f=p.data,m=p;return m.data=_deconstructPacket(f,u),m.attachments=u.length,{packet:m,buffers:u}}function _deconstructPacket(p,u){if(!p)return p;if(isBinary(p)){const f={_placeholder:!0,num:u.length};return u.push(p),f}else if(Array.isArray(p)){const f=new Array(p.length);for(let m=0;m<p.length;m++)f[m]=_deconstructPacket(p[m],u);return f}else if(typeof p=="object"&&!(p instanceof Date)){const f={};for(const m in p)Object.prototype.hasOwnProperty.call(p,m)&&(f[m]=_deconstructPacket(p[m],u));return f}return p}function reconstructPacket(p,u){return p.data=_reconstructPacket(p.data,u),delete p.attachments,p}function _reconstructPacket(p,u){if(!p)return p;if(p&&p._placeholder===!0){if(typeof p.num=="number"&&p.num>=0&&p.num<u.length)return u[p.num];throw new Error("illegal attachments")}else if(Array.isArray(p))for(let f=0;f<p.length;f++)p[f]=_reconstructPacket(p[f],u);else if(typeof p=="object")for(const f in p)Object.prototype.hasOwnProperty.call(p,f)&&(p[f]=_reconstructPacket(p[f],u));return p}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(p){p[p.CONNECT=0]="CONNECT",p[p.DISCONNECT=1]="DISCONNECT",p[p.EVENT=2]="EVENT",p[p.ACK=3]="ACK",p[p.CONNECT_ERROR=4]="CONNECT_ERROR",p[p.BINARY_EVENT=5]="BINARY_EVENT",p[p.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(u){this.replacer=u}encode(u){return(u.type===PacketType.EVENT||u.type===PacketType.ACK)&&hasBinary(u)?this.encodeAsBinary({type:u.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:u.nsp,data:u.data,id:u.id}):[this.encodeAsString(u)]}encodeAsString(u){let f=""+u.type;return(u.type===PacketType.BINARY_EVENT||u.type===PacketType.BINARY_ACK)&&(f+=u.attachments+"-"),u.nsp&&u.nsp!=="/"&&(f+=u.nsp+","),u.id!=null&&(f+=u.id),u.data!=null&&(f+=JSON.stringify(u.data,this.replacer)),f}encodeAsBinary(u){const f=deconstructPacket(u),m=this.encodeAsString(f.packet),v=f.buffers;return v.unshift(m),v}}function isObject$1(p){return Object.prototype.toString.call(p)==="[object Object]"}class Decoder extends Emitter{constructor(u){super(),this.reviver=u}add(u){let f;if(typeof u=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");f=this.decodeString(u);const m=f.type===PacketType.BINARY_EVENT;m||f.type===PacketType.BINARY_ACK?(f.type=m?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(f),f.attachments===0&&super.emitReserved("decoded",f)):super.emitReserved("decoded",f)}else if(isBinary(u)||u.base64)if(this.reconstructor)f=this.reconstructor.takeBinaryData(u),f&&(this.reconstructor=null,super.emitReserved("decoded",f));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+u)}decodeString(u){let f=0;const m={type:Number(u.charAt(0))};if(PacketType[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===PacketType.BINARY_EVENT||m.type===PacketType.BINARY_ACK){const y=f+1;for(;u.charAt(++f)!=="-"&&f!=u.length;);const w=u.substring(y,f);if(w!=Number(w)||u.charAt(f)!=="-")throw new Error("Illegal attachments");m.attachments=Number(w)}if(u.charAt(f+1)==="/"){const y=f+1;for(;++f&&!(u.charAt(f)===","||f===u.length););m.nsp=u.substring(y,f)}else m.nsp="/";const v=u.charAt(f+1);if(v!==""&&Number(v)==v){const y=f+1;for(;++f;){const w=u.charAt(f);if(w==null||Number(w)!=w){--f;break}if(f===u.length)break}m.id=Number(u.substring(y,f+1))}if(u.charAt(++f)){const y=this.tryParse(u.substr(f));if(Decoder.isPayloadValid(m.type,y))m.data=y;else throw new Error("invalid payload")}return m}tryParse(u){try{return JSON.parse(u,this.reviver)}catch{return!1}}static isPayloadValid(u,f){switch(u){case PacketType.CONNECT:return isObject$1(f);case PacketType.DISCONNECT:return f===void 0;case PacketType.CONNECT_ERROR:return typeof f=="string"||isObject$1(f);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(f)&&(typeof f[0]=="number"||typeof f[0]=="string"&&RESERVED_EVENTS$1.indexOf(f[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(f)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(u){this.packet=u,this.buffers=[],this.reconPack=u}takeBinaryData(u){if(this.buffers.push(u),this.buffers.length===this.reconPack.attachments){const f=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),f}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser$1=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(p,u,f){return p.on(u,f),function(){p.off(u,f)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(u,f,m){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=u,this.nsp=f,m&&m.auth&&(this.auth=m.auth),this._opts=Object.assign({},m),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const u=this.io;this.subs=[on(u,"open",this.onopen.bind(this)),on(u,"packet",this.onpacket.bind(this)),on(u,"error",this.onerror.bind(this)),on(u,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...u){return u.unshift("message"),this.emit.apply(this,u),this}emit(u,...f){if(RESERVED_EVENTS.hasOwnProperty(u))throw new Error('"'+u.toString()+'" is a reserved event name');if(f.unshift(u),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(f),this;const m={type:PacketType.EVENT,data:f};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof f[f.length-1]=="function"){const w=this.ids++,k=f.pop();this._registerAckCallback(w,k),m.id=w}const v=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!v||!this.connected)||(this.connected?(this.notifyOutgoingListeners(m),this.packet(m)):this.sendBuffer.push(m)),this.flags={},this}_registerAckCallback(u,f){var m;const v=(m=this.flags.timeout)!==null&&m!==void 0?m:this._opts.ackTimeout;if(v===void 0){this.acks[u]=f;return}const y=this.io.setTimeoutFn(()=>{delete this.acks[u];for(let k=0;k<this.sendBuffer.length;k++)this.sendBuffer[k].id===u&&this.sendBuffer.splice(k,1);f.call(this,new Error("operation has timed out"))},v),w=(...k)=>{this.io.clearTimeoutFn(y),f.apply(this,k)};w.withError=!0,this.acks[u]=w}emitWithAck(u,...f){return new Promise((m,v)=>{const y=(w,k)=>w?v(w):m(k);y.withError=!0,f.push(y),this.emit(u,...f)})}_addToQueue(u){let f;typeof u[u.length-1]=="function"&&(f=u.pop());const m={id:this._queueSeq++,tryCount:0,pending:!1,args:u,flags:Object.assign({fromQueue:!0},this.flags)};u.push((v,...y)=>m!==this._queue[0]?void 0:(v!==null?m.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(v)):(this._queue.shift(),f&&f(null,...y)),m.pending=!1,this._drainQueue())),this._queue.push(m),this._drainQueue()}_drainQueue(u=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!u||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.args))}packet(u){u.nsp=this.nsp,this.io._packet(u)}onopen(){typeof this.auth=="function"?this.auth(u=>{this._sendConnectPacket(u)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(u){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},u):u})}onerror(u){this.connected||this.emitReserved("connect_error",u)}onclose(u,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",u,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(u=>{if(!this.sendBuffer.some(m=>String(m.id)===u)){const m=this.acks[u];delete this.acks[u],m.withError&&m.call(this,new Error("socket has been disconnected"))}})}onpacket(u){if(u.nsp===this.nsp)switch(u.type){case PacketType.CONNECT:u.data&&u.data.sid?this.onconnect(u.data.sid,u.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(u);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(u);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const m=new Error(u.data.message);m.data=u.data.data,this.emitReserved("connect_error",m);break}}onevent(u){const f=u.data||[];u.id!=null&&f.push(this.ack(u.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(u){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const m of f)m.apply(this,u)}super.emit.apply(this,u),this._pid&&u.length&&typeof u[u.length-1]=="string"&&(this._lastOffset=u[u.length-1])}ack(u){const f=this;let m=!1;return function(...v){m||(m=!0,f.packet({type:PacketType.ACK,id:u,data:v}))}}onack(u){const f=this.acks[u.id];typeof f=="function"&&(delete this.acks[u.id],f.withError&&u.data.unshift(null),f.apply(this,u.data))}onconnect(u,f){this.id=u,this.recovered=f&&this._pid===f,this._pid=f,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(u=>this.emitEvent(u)),this.receiveBuffer=[],this.sendBuffer.forEach(u=>{this.notifyOutgoingListeners(u),this.packet(u)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(u=>u()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(u){return this.flags.compress=u,this}get volatile(){return this.flags.volatile=!0,this}timeout(u){return this.flags.timeout=u,this}onAny(u){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(u),this}prependAny(u){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(u),this}offAny(u){if(!this._anyListeners)return this;if(u){const f=this._anyListeners;for(let m=0;m<f.length;m++)if(u===f[m])return f.splice(m,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(u){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(u),this}prependAnyOutgoing(u){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(u),this}offAnyOutgoing(u){if(!this._anyOutgoingListeners)return this;if(u){const f=this._anyOutgoingListeners;for(let m=0;m<f.length;m++)if(u===f[m])return f.splice(m,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(u){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const f=this._anyOutgoingListeners.slice();for(const m of f)m.apply(this,u.data)}}}function Backoff(p){p=p||{},this.ms=p.min||100,this.max=p.max||1e4,this.factor=p.factor||2,this.jitter=p.jitter>0&&p.jitter<=1?p.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var p=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var u=Math.random(),f=Math.floor(u*this.jitter*p);p=Math.floor(u*10)&1?p+f:p-f}return Math.min(p,this.max)|0},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(p){this.ms=p},Backoff.prototype.setMax=function(p){this.max=p},Backoff.prototype.setJitter=function(p){this.jitter=p};class Manager extends Emitter{constructor(u,f){var m;super(),this.nsps={},this.subs=[],u&&typeof u=="object"&&(f=u,u=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,installTimerFunctions(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((m=f.randomizationFactor)!==null&&m!==void 0?m:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=u;const v=f.parser||parser$1;this.encoder=new v.Encoder,this.decoder=new v.Decoder,this._autoConnect=f.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(u){return arguments.length?(this._reconnection=!!u,this):this._reconnection}reconnectionAttempts(u){return u===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=u,this)}reconnectionDelay(u){var f;return u===void 0?this._reconnectionDelay:(this._reconnectionDelay=u,(f=this.backoff)===null||f===void 0||f.setMin(u),this)}randomizationFactor(u){var f;return u===void 0?this._randomizationFactor:(this._randomizationFactor=u,(f=this.backoff)===null||f===void 0||f.setJitter(u),this)}reconnectionDelayMax(u){var f;return u===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=u,(f=this.backoff)===null||f===void 0||f.setMax(u),this)}timeout(u){return arguments.length?(this._timeout=u,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(u){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const f=this.engine,m=this;this._readyState="opening",this.skipReconnect=!1;const v=on(f,"open",function(){m.onopen(),u&&u()}),y=k=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",k),u?u(k):this.maybeReconnectOnOpen()},w=on(f,"error",y);if(this._timeout!==!1){const k=this._timeout,S=this.setTimeoutFn(()=>{v(),y(new Error("timeout")),f.close()},k);this.opts.autoUnref&&S.unref(),this.subs.push(()=>{this.clearTimeoutFn(S)})}return this.subs.push(v),this.subs.push(w),this}connect(u){return this.open(u)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const u=this.engine;this.subs.push(on(u,"ping",this.onping.bind(this)),on(u,"data",this.ondata.bind(this)),on(u,"error",this.onerror.bind(this)),on(u,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(u){try{this.decoder.add(u)}catch(f){this.onclose("parse error",f)}}ondecoded(u){nextTick(()=>{this.emitReserved("packet",u)},this.setTimeoutFn)}onerror(u){this.emitReserved("error",u)}socket(u,f){let m=this.nsps[u];return m?this._autoConnect&&!m.active&&m.connect():(m=new Socket(this,u,f),this.nsps[u]=m),m}_destroy(u){const f=Object.keys(this.nsps);for(const m of f)if(this.nsps[m].active)return;this._close()}_packet(u){const f=this.encoder.encode(u);for(let m=0;m<f.length;m++)this.engine.write(f[m],u.options)}cleanup(){this.subs.forEach(u=>u()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(u,f){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",u,f),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const u=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const f=this.backoff.duration();this._reconnecting=!0;const m=this.setTimeoutFn(()=>{u.skipReconnect||(this.emitReserved("reconnect_attempt",u.backoff.attempts),!u.skipReconnect&&u.open(v=>{v?(u._reconnecting=!1,u.reconnect(),this.emitReserved("reconnect_error",v)):u.onreconnect()}))},f);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}}onreconnect(){const u=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",u)}}const cache={};function lookup$1(p,u){typeof p=="object"&&(u=p,p=void 0),u=u||{};const f=url(p,u.path||"/socket.io"),m=f.source,v=f.id,y=f.path,w=cache[v]&&y in cache[v].nsps,k=u.forceNew||u["force new connection"]||u.multiplex===!1||w;let S;return k?S=new Manager(m,u):(cache[v]||(cache[v]=new Manager(m,u)),S=cache[v]),f.query&&!u.query&&(u.query=f.queryKey),S.socket(f.path,u)}Object.assign(lookup$1,{Manager,Socket,io:lookup$1,connect:lookup$1});const DefaultOptions={heartbeat:!0},createWebsocket=(p,u=DefaultOptions)=>{if(!p)throw"A websocket path must be provided";const{heartbeat:f}={...DefaultOptions,...u},m=location.protocol==="https:",v=m?"wss:":"ws:",y=location.hostname,w=location.port||(m?443:80);let k=lookup$1(`${v}//${y}:${w}`,{path:p,reconnectionAttempts:3,reconnectionDelay:5e3,reconnectionDelayMax:5e3,timeout:4e3,transports:["websocket"]}),S;return f&&(S=setInterval(()=>{k.emit(SocketEvent.Heartbeat)},SocketSessionTTL*500)),k.on("disconnect",()=>{clearInterval(S)}),k.onOther=(M,T)=>{k.on(M,E=>{(E==null?void 0:E.apiSessionId)!==APISessionID&&T(E)})},k},extractFileNameRegex=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;async function downloadStream(p){const u=await p.blob(),f=p.headers.get("Content-Disposition"),v=extractFileNameRegex.exec(f)[1].replace(/['"]/g,""),y=new Blob([u]),w=URL.createObjectURL(y),k=document.createElement("a");k.href=w,k.download=v,k.click(),URL.revokeObjectURL(w)}const shouldDisplaySetting=(p,u)=>{let f=u.dependsOn;return f&&!Array.isArray(f)&&(f=[f]),f!=null&&f.length?f.every(m=>{let v=m,y=null,w=!!m.invert;if(typeof m=="object"&&(v=m.setting,y=m.value),!v)return!1;Array.isArray(y)||(y=[y]);const k=deepGet$1(p,v);return y.some(M=>M==null?k!=null&&k!==!1&&k!=="":M===k)!==w}):!0},columnTypeManyTypeOverrides={[FieldType.DATETIME]:FieldType.STRING,[FieldType.BOOLEAN]:FieldType.STRING,[FieldType.SIGNATURE_SINGLE]:FieldType.ATTACHMENTS},columnTypeManyParser={[FieldType.DATETIME]:(p,u)=>{function f(m){const{timeOnly:v,dateOnly:y}=u||{},w=!y,k=parseDate(m,{enableTime:w});return getDateDisplayValue(k,{enableTime:w,timeOnly:v})}return p.map(m=>f(m))},[FieldType.BOOLEAN]:p=>p.map(u=>!!u),[FieldType.BB_REFERENCE_SINGLE]:p=>[...new Map(p.map(u=>[u._id,u])).values()],[FieldType.BB_REFERENCE]:p=>[...new Map(p.map(u=>[u._id,u])).values()],[FieldType.ARRAY]:p=>Array.from(new Set(p))};function enrichSchemaWithRelColumns(p){return Object.keys(p).reduce((f,m)=>{const v=p[m];if(f[m]=v,v.visible!==!1&&isRelationshipField(v)&&v.columns){const y=(v==null?void 0:v.relationshipType)===RelationshipType.ONE_TO_MANY;for(const w of Object.keys(v.columns)){const k=v.columns[w];if(!k.visible)continue;const S=`${v.name}.${w}`;f[S]={...k,type:k.type,name:S,related:{field:m,subField:w},cellRenderType:!y&&columnTypeManyTypeOverrides[k.type]||k.type}}}return f},{})}function getRelatedTableValues(p,u,f){var y,w,k,S;const m=isRelationshipField(f)&&(f==null?void 0:f.relationshipType)===RelationshipType.ONE_TO_MANY;let v="";if(m)v=(w=(y=p[u.related.field])==null?void 0:y[0])==null?void 0:w[u.related.subField];else{const M=columnTypeManyParser[u.type]||(H=>H),T=(S=(k=p[u.related.field])==null?void 0:k.flatMap(H=>H[u.related.subField]))==null?void 0:S.filter(H=>H!=null),E=M(T||[],u);v=E,[FieldType.STRING,FieldType.NUMBER,FieldType.BIGINT,FieldType.BOOLEAN,FieldType.DATETIME,FieldType.LONGFORM,FieldType.BARCODEQR].includes(u.type)&&(v=E==null?void 0:E.join(", "))}return v}function canBeDisplayColumn(p){return!(!canBeDisplayColumn$1(p.type)||p.related)}function canBeSortColumn(p){return p.calculationType?!0:!(!canBeSortColumn$1(p.type)||p.related)}const{buildQuery,limit:queryLimit,runQuery,sort}=QueryUtils;class BaseDataFetch{constructor(u){ha(this,"API");ha(this,"features");ha(this,"options");ha(this,"store");ha(this,"derivedStore");if(this.features={supportsSearch:!1,supportsSort:!1,supportsPagination:!1},this.options={datasource:u.datasource,limit:10,filter:null,query:u.query,sortColumn:null,sortOrder:SortOrder.ASCENDING,sortType:null,paginate:!0,clientSideSearching:!0,clientSideSorting:!0,clientSideLimiting:!0},this.store=writable({rows:[],info:null,schema:null,loading:!1,loaded:!1,query:u.query,pageNumber:0,cursor:null,cursors:[],resetKey:Math.random().toString(),error:null}),this.API=u==null?void 0:u.API,this.options={...this.options,...u},!this.API)throw"An API client is required for fetching data";if(this.getData=this.getData.bind(this),this.getPage=this.getPage.bind(this),this.getInitialData=this.getInitialData.bind(this),this.determineFeatureFlags=this.determineFeatureFlags.bind(this),this.refresh=this.refresh.bind(this),this.update=this.update.bind(this),this.hasNextPage=this.hasNextPage.bind(this),this.hasPrevPage=this.hasPrevPage.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.derivedStore=derived(this.store,f=>({...f,...this.features,hasNextPage:this.hasNextPage(f),hasPrevPage:this.hasPrevPage(f)})),!this.options.datasource){this.store.update(f=>({...f,loaded:!0}));return}}get subscribe(){return this.derivedStore.subscribe}getDefaultSortColumn(u,f){return u!=null&&u.primaryDisplay&&f[u.primaryDisplay]?u.primaryDisplay:Object.keys(f)[0]}async getInitialData(){const{filter:u,paginate:f}=this.options,m=await this.getDefinition(),v=await this.determineFeatureFlags();this.features={supportsSearch:!!(v!=null&&v.supportsSearch),supportsSort:!!(v!=null&&v.supportsSort),supportsPagination:f&&!!(v!=null&&v.supportsPagination)};let y=this.getSchema(m);if(!y)return;if(y=this.enrichSchema(y),this.options.sortColumn&&!y[this.options.sortColumn]&&(this.options.sortColumn=null),this.options.sortColumn||(this.options.sortColumn=this.getDefaultSortColumn(m,y)),!this.options.sortColumn)this.options.sortOrder=SortOrder.ASCENDING,this.options.sortType=null;else{this.options.sortType=SortType.STRING;const S=y==null?void 0:y[this.options.sortColumn];((S==null?void 0:S.type)===FieldType.NUMBER||(S==null?void 0:S.type)===FieldType.BIGINT||"calculationType"in S&&(S!=null&&S.calculationType))&&(this.options.sortType=SortType.NUMBER),this.options.sortOrder?this.options.sortOrder=this.options.sortOrder.toLowerCase():this.options.sortOrder=SortOrder.ASCENDING}let w=this.options.query;w||(w=buildQuery(u??void 0)),this.store.update(S=>({...S,definition:m,schema:y,query:w,loading:!0,cursors:[],cursor:null}));const k=await this.getPage();this.store.update(S=>({...S,loading:!1,loaded:!0,pageNumber:0,rows:k.rows,info:k.info,cursors:f&&k.hasNextPage?[null,k.cursor]:[null],error:k.error,resetKey:Math.random().toString()}))}async getPage(){const{sortColumn:u,sortOrder:f,sortType:m,limit:v,clientSideSearching:y,clientSideSorting:w,clientSideLimiting:k}=this.options,{query:S}=get_store_value(this.store);let{rows:M,info:T,hasNextPage:E,cursor:H,error:F}=await this.getData();return!this.features.supportsSearch&&y&&(M=runQuery(M,S)),!this.features.supportsSort&&w&&m&&(M=sort(M,u,f,m)),!this.features.supportsPagination&&k&&(M=queryLimit(M,v)),{rows:M,info:T,hasNextPage:E,cursor:H,error:F}}getSchema(u){return(u==null?void 0:u.schema)??void 0}enrichSchema(u){let f={};for(const v of Object.keys(u)){const y=u[v];if(y.type===FieldType.JSON){const w=convertJSONSchemaToTableSchema(y,{squashObjects:!0});if(w)for(const k of Object.keys(w))f[`${v}.${k}`]={type:w[k].type,nestedJSON:!0}}}let m={};return Object.entries({...u,...f}).forEach(([v,y])=>{typeof y=="string"?m[v]={type:y,name:v}:m[v]={...y,type:y.type,name:v}}),m}async determineFeatureFlags(){return{supportsSearch:!1,supportsSort:!1,supportsPagination:!1}}async update(u){let f=!1;for(const[m,v]of Object.entries(u||{})){const y=this.options[m]??null;if(JSON.stringify(v??null)!==JSON.stringify(y)){f=!0;break}}f&&(this.options={...this.options,...fp$1.cloneDeep(u)},await this.getInitialData())}async refresh(){if(get_store_value(this.store).loading)return;this.store.update(S=>({...S,loading:!0}));const{rows:u,info:f,error:m,cursor:v}=await this.getPage();let{cursors:y}=get_store_value(this.store);const{pageNumber:w}=get_store_value(this.store);if(!u.length&&w>0)return this.store.update(S=>({...S,loading:!1,cursors:y.slice(0,w)})),await this.prevPage();y[w+1]!=v&&(y=y.slice(0,w+1),y[w+1]=v),this.store.update(S=>({...S,rows:u,info:f,loading:!1,error:m,cursors:y}))}hasNextPage(u){return u.cursors[u.pageNumber+1]!=null}hasPrevPage(u){return u.pageNumber>0}async nextPage(){const u=get_store_value(this.derivedStore);if(u.loading||!this.options.paginate||!u.hasNextPage)return;const f=u.cursors[u.pageNumber+1];this.store.update(S=>({...S,loading:!0,cursor:f,pageNumber:S.pageNumber+1}));const{rows:m,info:v,hasNextPage:y,cursor:w,error:k}=await this.getPage();this.store.update(S=>{let{cursors:M,pageNumber:T}=S;return y&&(M[T+1]=w),{...S,rows:m,info:v,cursors:M,loading:!1,error:k}})}async prevPage(){const u=get_store_value(this.derivedStore);if(u.loading||!this.options.paginate||!u.hasPrevPage)return;const f=u.cursors[u.pageNumber-1];this.store.update(w=>({...w,loading:!0,cursor:f,pageNumber:w.pageNumber-1}));const{rows:m,info:v,error:y}=await this.getPage();this.store.update(w=>({...w,rows:m,info:v,loading:!1,error:y}))}}class TableFetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}async getData(){const{datasource:u,limit:f,sortColumn:m,sortOrder:v,sortType:y,paginate:w}=this.options,{tableId:k}=u,{cursor:S,query:M}=get_store_value(this.store);try{const T=await this.API.searchTable(k,{query:M,limit:f,sort:m,sortOrder:v??SortOrder.ASCENDING,sortType:y,paginate:w,bookmark:S});return{rows:(T==null?void 0:T.rows)||[],hasNextPage:(T==null?void 0:T.hasNextPage)||!1,cursor:(T==null?void 0:T.bookmark)||null}}catch(T){return{rows:[],hasNextPage:!1,error:T}}}}class ViewFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}getSchema(u){var m,v;const{datasource:f}=this.options;return(v=(m=u==null?void 0:u.views)==null?void 0:m[f==null?void 0:f.name])==null?void 0:v.schema}async getData(){const{datasource:u}=this.options;try{return{rows:await this.API.fetchViewData(u.name,{calculation:u.calculation,field:u.field,groupBy:u.groupBy,tableId:u.tableId})||[]}}catch(f){return console.error(f,{datasource:u}),{rows:[]}}}}class ViewV2Fetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:u}=this.options;try{const f=await this.API.viewV2.fetchDefinition(u.id);return f==null?void 0:f.data}catch(f){return this.store.update(m=>({...m,error:f})),null}}getDefaultSortColumn(){return null}async getData(){var T;const{datasource:u,limit:f,sortColumn:m,sortOrder:v,sortType:y,paginate:w}=this.options,{cursor:k,query:S,definition:M}=get_store_value(this.store);if((M==null?void 0:M.type)===ViewV2Type.CALCULATION&&!Object.values(M.schema||{}).some(isCalculationField))return{rows:[],hasNextPage:!1,cursor:null,error:null};!m&&((T=M==null?void 0:M.sort)!=null&&T.field)&&(this.options.sortColumn=M.sort.field,this.options.sortOrder=M.sort.order||SortOrder.ASCENDING);try{const E={query:S,paginate:w,limit:f,bookmark:k,sort:m,sortOrder:v,sortType:y};if(w){const H=await this.API.viewV2.fetch(u.id,{...E,paginate:w});return{rows:(H==null?void 0:H.rows)||[],hasNextPage:(H==null?void 0:H.hasNextPage)||!1,cursor:(H==null?void 0:H.bookmark)||null}}else{const H=await this.API.viewV2.fetch(u.id,{...E,paginate:w});return{rows:(H==null?void 0:H.rows)||[],hasNextPage:!1,cursor:null}}}catch(E){return{rows:[],hasNextPage:!1,cursor:null,error:E}}}}class QueryFetch extends BaseDataFetch{async determineFeatureFlags(){var m,v,y,w,k,S;const u=await this.getDefinition();return{supportsPagination:!!((v=(m=u==null?void 0:u.fields)==null?void 0:m.pagination)!=null&&v.type)&&!!((w=(y=u==null?void 0:u.fields)==null?void 0:y.pagination)!=null&&w.location)&&!!((S=(k=u==null?void 0:u.fields)==null?void 0:k.pagination)!=null&&S.pageParam)}}async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u._id))return null;try{const f=await this.API.fetchQueryDefinition(u._id);return f.fields||(f.fields=u.fields),f}catch{return null}}getDefaultSortColumn(){return null}async getData(){var T,E;const{datasource:u,limit:f,paginate:m}=this.options,{supportsPagination:v}=this.features,{cursor:y,definition:w}=get_store_value(this.store),k=(E=(T=w==null?void 0:w.fields)==null?void 0:T.pagination)==null?void 0:E.type,S=cloneDeep$1(u.queryParams||{});for(const H of(u==null?void 0:u.parameters)||[])S[H.name]||(S[H.name]=H.default);const M={parameters:S};if(m&&v){const H=k==="page"?parseInt(y||"1"):y;M.pagination={page:H,limit:f}}try{const H=await this.API.executeQuery(u==null?void 0:u._id,M),{data:F,pagination:Z,...$}=H;let J=null,ae=!1;return m&&v&&(k==="page"?(J=M.pagination.page+1,ae=(F==null?void 0:F.length)===f&&f>0):(J=Z==null?void 0:Z.cursor,ae=J!=null)),{rows:F||[],info:$,cursor:J,hasNextPage:ae}}catch{return{rows:[],hasNextPage:!1}}}}class RelationshipFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{return await this.API.fetchTableDefinition(u.tableId)}catch(f){return this.store.update(m=>({...m,error:f})),null}}async getData(){const{datasource:u}=this.options;if(!(u!=null&&u.rowId)||!(u!=null&&u.rowTableId))return{rows:[]};try{return{rows:await this.API.fetchRelationshipData(u.rowTableId,u.rowId,u.fieldName)}}catch{return{rows:[]}}}}class NestedProviderFetch extends BaseDataFetch{async getDefinition(){var f,m;const{datasource:u}=this.options;return{schema:(f=u==null?void 0:u.value)==null?void 0:f.schema,primaryDisplay:(m=u==null?void 0:u.value)==null?void 0:m.primaryDisplay}}async getData(){var f;const{datasource:u}=this.options;return{rows:((f=u==null?void 0:u.value)==null?void 0:f.rows)||[],hasNextPage:!1,cursor:null}}}function isArrayOfStrings(p){return Array.isArray(p)&&!!p[0]&&typeof p[0]!="object"}class FieldFetch extends BaseDataFetch{async getDefinition(){const{datasource:u}=this.options;let f;return u.fieldType==="attachment"?f={url:{type:"string"},name:{type:"string"}}:u.fieldType==="array"&&(f={value:{type:"string"}}),{schema:f}}async getData(){const{datasource:u}=this.options,f=(u==null?void 0:u.value)||[];let m;return isArrayOfStrings(f)?m=f.map(v=>({value:v})):m=f,{rows:m||[],hasNextPage:!1,cursor:null}}}class JSONArrayFetch extends FieldFetch{async getDefinition(){const{datasource:u}=this.options;try{const f=await this.API.fetchTableDefinition(u.tableId);return{schema:getJSONArrayDatasourceSchema(f==null?void 0:f.schema,u)}}catch{return null}}}class UserFetch extends BaseDataFetch{constructor(u){super({...u,datasource:{type:"user",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{limit:u,paginate:f}=this.options,{cursor:m,query:v}=get_store_value(this.store),{appId:y,paginated:w,...k}=v,S=isSupportedUserSearch(k)?k:{};try{const M={bookmark:m??void 0,query:S??void 0,appId:y,paginate:w||f,limit:u},T=await this.API.searchUsers(M);return{rows:(T==null?void 0:T.data)||[],hasNextPage:(T==null?void 0:T.hasNextPage)||!1,cursor:(T==null?void 0:T.nextPage)||null}}catch(M){return{rows:[],hasNextPage:!1,error:M}}}}class GroupUserFetch extends BaseDataFetch{constructor(u){super({...u,datasource:{type:"groupUser",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{query:u,cursor:f}=get_store_value(this.store);try{const m=await this.API.getGroupUsers({id:u.groupId,emailSearch:u.emailSearch,bookmark:f??void 0});return{rows:(m==null?void 0:m.users)||[],hasNextPage:(m==null?void 0:m.hasNextPage)||!1,cursor:(m==null?void 0:m.bookmark)||null}}catch(m){return{rows:[],hasNextPage:!1,error:m}}}}class CustomFetch extends BaseDataFetch{getType(u){return u==null?"string":typeof u==="object"?Array.isArray(u)?"array":"json":isNaN(u)?"string":"number"}parseCustomData(u){if(!u)return[];if(Array.isArray(u))return u;if(typeof u=="string"){try{const f=JSON.parse(u);return Array.isArray(f)?f:[f]}catch{}return u.includes(`
|
|
384
384
|
`)?u.split(`
|
|
385
385
|
`).map(f=>f.trim()):u.split(",").map(f=>f.trim())}return[u]}enrichCustomData(u){return u!=null&&u.length?(u=u.filter(f=>f!=null&&f!==""&&!Array.isArray(f)),u.map(f=>{if(typeof f=="object")return f;if(typeof f=="string"){const m=f.split(",").map(y=>y.trim()),v={};for(let y=0;y<m.length;y++){const k=`Value${y===0?"":` ${y+1}`}`;v[k]=m[y]}return v}return{Value:f}})):[]}getCustomData(u){return this.enrichCustomData(this.parseCustomData(u==null?void 0:u.data))}async getDefinition(){const{datasource:u}=this.options,f={},m=this.getCustomData(u);if(!(m!=null&&m.length))return{schema:f};for(const v of m)for(const y of Object.keys(v))if(y!=="_id"&&!f[y]){let w=this.getType(v[y]);const k={};if(w==="string"){const S=[...new Set(m.map(T=>T[y]))];S.length/m.length<=.8&&S.length>1&&(w="options",k.inclusion=S)}else w==="array"&&(k.inclusion=[...new Set(m.map(S=>S[y]).flat())]);f[y]={type:w,constraints:k}}return{schema:f}}async getData(){const{datasource:u}=this.options;return{rows:this.getCustomData(u),hasNextPage:!1,cursor:null}}}class QueryArrayFetch extends FieldFetch{async getDefinition(){const{datasource:u}=this.options;if(!(u!=null&&u.tableId))return null;try{const f=await this.API.fetchQueryDefinition(u.tableId),m=generateQueryArraySchemas(f.schema,f.nestedSchemaFields);return{schema:getJSONArrayDatasourceSchema(m,u)}}catch{return null}}}const DataFetchMap={table:TableFetch,view:ViewFetch,viewV2:ViewV2Fetch,query:QueryFetch,link:RelationshipFetch,user:UserFetch,groupUser:GroupUserFetch,custom:CustomFetch,provider:NestedProviderFetch,field:FieldFetch,jsonarray:JSONArrayFetch,queryarray:QueryArrayFetch},fetchData=({API:p,datasource:u,options:f})=>{const m=DataFetchMap[u==null?void 0:u.type]||TableFetch,v=new m({API:p,datasource:u,...f});return v.getInitialData(),v},createEmptyFetchInstance=({API:p,datasource:u})=>{const f=DataFetchMap[u==null?void 0:u.type];return f?new f({API:p,datasource:u,query:null}):null},getDatasourceDefinition=async({API:p,datasource:u})=>{const f=createEmptyFetchInstance({API:p,datasource:u});return await(f==null?void 0:f.getDefinition())},getDatasourceSchema=({API:p,datasource:u,definition:f})=>{const m=createEmptyFetchInstance({API:p,datasource:u});return m==null?void 0:m.getSchema(f)},createLocalStorageStore=(p,u)=>{const f=writable(u,()=>{y();const w=({key:k})=>k===p&&y();return window.addEventListener("storage",w),()=>window.removeEventListener("storage",w)}),m=w=>{f.set(w),localStorage.setItem(p,JSON.stringify(w))},v=w=>m(w(get_store_value(f))),y=()=>{const w=localStorage.getItem(p);if(w==null)m(u);else try{f.set(JSON.parse(w))}catch{m(u)}};return{...f,set:m,update:v}},SplitPage_svelte_svelte_type_style_lang="",Testimonial_svelte_svelte_type_style_lang="",TestimonialPage_svelte_svelte_type_style_lang="",SignatureModal_svelte_svelte_type_style_lang="";function create_default_slot_2$p(p){let u,f,m,v={darkMode:p[3],value:p[1],saveIcon:!1};return f=new Signature({props:v}),p[8](f),f.$on("update",p[9]),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"class","signature-wrap modal svelte-1jbgrys")},m(y,w){insert(y,u,w),mount_component(f,u,null),m=!0},p(y,w){const k={};w&8&&(k.darkMode=y[3]),w&2&&(k.value=y[1]),f.$set(k)},i(y){m||(transition_in(f.$$.fragment,y),m=!0)},o(y){transition_out(f.$$.fragment,y),m=!1},d(y){y&&detach(u),p[8](null),destroy_component(f)}}}function create_default_slot_1$B(p){let u;return{c(){u=text$1(p[2])},m(f,m){insert(f,u,m)},p(f,m){m&4&&set_data(u,f[2])},d(f){f&&detach(u)}}}function create_header_slot(p){let u,f,m;return f=new Body({props:{$$slots:{default:[create_default_slot_1$B]},$$scope:{ctx:p}}}),{c(){u=element("div"),create_component(f.$$.fragment),attr(u,"slot","header")},m(v,y){insert(v,u,y),mount_component(f,u,null),m=!0},p(v,y){const w={};y&4100&&(w.$$scope={dirty:y,ctx:v}),f.$set(w)},i(v){m||(transition_in(f.$$.fragment,v),m=!0)},o(v){transition_out(f.$$.fragment,v),m=!1},d(v){v&&detach(u),destroy_component(f)}}}function create_default_slot$1m(p){let u,f;return u=new ModalContent({props:{showConfirmButton:!0,showCancelButton:!1,showCloseIcon:!1,custom:!0,disabled:!p[6],showDivider:!1,onConfirm:p[10],$$slots:{header:[create_header_slot],default:[create_default_slot_2$p]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&64&&(y.disabled=!m[6]),v&33&&(y.onConfirm=m[10]),v&4206&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$2H(p){let u,f,m={$$slots:{default:[create_default_slot$1m]},$$scope:{ctx:p}};return u=new Modal({props:m}),p[11](u),{c(){create_component(u.$$.fragment)},m(v,y){mount_component(u,v,y),f=!0},p(v,[y]){const w={};y&4207&&(w.$$scope={dirty:y,ctx:v}),u.$set(w)},i(v){f||(transition_in(u.$$.fragment,v),f=!0)},o(v){transition_out(u.$$.fragment,v),f=!1},d(v){p[11](null),destroy_component(u,v)}}}function instance$2E(p,u,f){let{onConfirm:m=()=>{}}=u,{value:v}=u,{title:y}=u,{darkMode:w}=u;const k=()=>{f(6,T=!1),S.show()};let S,M,T=!1;function E($){binding_callbacks[$?"unshift":"push"](()=>{M=$,f(5,M)})}const H=()=>{f(6,T=!0)},F=()=>{m(M)};function Z($){binding_callbacks[$?"unshift":"push"](()=>{S=$,f(4,S)})}return p.$$set=$=>{"onConfirm"in $&&f(0,m=$.onConfirm),"value"in $&&f(1,v=$.value),"title"in $&&f(2,y=$.title),"darkMode"in $&&f(3,w=$.darkMode)},[m,v,y,w,S,M,T,k,E,H,F,Z]}class SignatureModal extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$2E,create_fragment$2H,safe_not_equal,{onConfirm:0,value:1,title:2,darkMode:3,show:7})}get show(){return this.$$.ctx[7]}}function create_if_block$1B(p){let u,f;return u=new AbsTooltip({props:{text:p[3]?getUserLabel(p[0]):null,position:p[2],color:getUserColor(p[0]),$$slots:{default:[create_default_slot$1l]},$$scope:{ctx:p}}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&9&&(y.text=m[3]?getUserLabel(m[0]):null),v&4&&(y.position=m[2]),v&1&&(y.color=getUserColor(m[0])),v&19&&(y.$$scope={dirty:v,ctx:m}),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_default_slot$1l(p){let u,f;return u=new Avatar({props:{size:p[1],initials:getUserInitials(p[0]),color:getUserColor(p[0])}}),{c(){create_component(u.$$.fragment)},m(m,v){mount_component(u,m,v),f=!0},p(m,v){const y={};v&2&&(y.size=m[1]),v&1&&(y.initials=getUserInitials(m[0])),v&1&&(y.color=getUserColor(m[0])),u.$set(y)},i(m){f||(transition_in(u.$$.fragment,m),f=!0)},o(m){transition_out(u.$$.fragment,m),f=!1},d(m){destroy_component(u,m)}}}function create_fragment$2G(p){let u,f,m=p[0]&&create_if_block$1B(p);return{c(){m&&m.c(),u=empty$1()},m(v,y){m&&m.m(v,y),insert(v,u,y),f=!0},p(v,[y]){v[0]?m?(m.p(v,y),y&1&&transition_in(m,1)):(m=create_if_block$1B(v),m.c(),transition_in(m,1),m.m(u.parentNode,u)):m&&(group_outros(),transition_out(m,1,1,()=>{m=null}),check_outros())},i(v){f||(transition_in(m),f=!0)},o(v){transition_out(m),f=!1},d(v){v&&detach(u),m&&m.d(v)}}}function instance$2D(p,u,f){let{user:m}=u,{size:v="S"}=u,{tooltipPosition:y=TooltipPosition.Top}=u,{showTooltip:w=!0}=u;return p.$$set=k=>{"user"in k&&f(0,m=k.user),"size"in k&&f(1,v=k.size),"tooltipPosition"in k&&f(2,y=k.tooltipPosition),"showTooltip"in k&&f(3,w=k.showTooltip)},[m,v,y,w]}class UserAvatar extends SvelteComponent{constructor(u){super(),init$1(this,u,instance$2D,create_fragment$2G,safe_not_equal,{user:0,size:1,tooltipPosition:2,showTooltip:3})}}const UserAvatars_svelte_svelte_type_style_lang$1="",Updating_svelte_svelte_type_style_lang="";function create_else_block_1$9(p){let u;return{c(){u=text$1("Something went wrong!")},m(f,m){insert(f,u,m)},d(f){f&&detach(u)}}}function create_if_block_1$O(p){let u;return{c(){u=text$1("System update")},m(f,m){insert(f,u,m)},d(f){f&&detach(u)}}}function create_else_block$u(p){let u,f,m,v,y;return{c(){u=text$1(`An error occurred, please try again later.
|
|
386
386
|
`),f=element("br"),m=text$1(`
|