@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
|
@@ -3,7 +3,7 @@ var l4=Object.defineProperty;var c4=(to,ue,eo)=>ue in to?l4(to,ue,{enumerable:!0
|
|
|
3
3
|
`}const co=lo+`100% {${io(eo,1-eo)}}
|
|
4
4
|
}`,uo=`__svelte_${hash(co)}_${ao}`,fo=get_root_for_style(to),{stylesheet:po,rules:ho}=managed_styles.get(fo)||create_style_information(fo,to);ho[uo]||(ho[uo]=!0,po.insertRule(`@keyframes ${uo} ${co}`,po.cssRules.length));const _o=to.style.animation||"";return to.style.animation=`${_o?`${_o}, `:""}${uo} ${no}ms linear ${ro}ms 1 both`,active+=1,uo}function delete_rule(to,ue){const eo=(to.style.animation||"").split(", "),no=eo.filter(ue?oo=>oo.indexOf(ue)<0:oo=>oo.indexOf("__svelte")===-1),ro=eo.length-no.length;ro&&(to.style.animation=no.join(", "),active-=ro,active||clear_rules())}function clear_rules(){raf(()=>{active||(managed_styles.forEach(to=>{const{ownerNode:ue}=to.stylesheet;ue&&detach(ue)}),managed_styles.clear())})}function create_animation(to,ue,eo,no){if(!ue)return noop$6;const ro=to.getBoundingClientRect();if(ue.left===ro.left&&ue.right===ro.right&&ue.top===ro.top&&ue.bottom===ro.bottom)return noop$6;const{delay:oo=0,duration:io=300,easing:ao=identity$6,start:so=now$2()+oo,end:lo=so+io,tick:co=noop$6,css:uo}=eo(to,{from:ue,to:ro},no);let fo=!0,po=!1,ho;function _o(){uo&&(ho=create_rule(to,0,1,io,oo,ao,uo)),oo||(po=!0)}function go(){uo&&delete_rule(to,ho),fo=!1}return loop$1(bo=>{if(!po&&bo>=so&&(po=!0),po&&bo>=lo&&(co(1,0),go()),!fo)return!1;if(po){const vo=bo-so,yo=0+1*ao(vo/io);co(yo,1-yo)}return!0}),_o(),co(0,1),go}function fix_position(to){const ue=getComputedStyle(to);if(ue.position!=="absolute"&&ue.position!=="fixed"){const{width:eo,height:no}=ue,ro=to.getBoundingClientRect();to.style.position="absolute",to.style.width=eo,to.style.height=no,add_transform(to,ro)}}function add_transform(to,ue){const eo=to.getBoundingClientRect();if(ue.left!==eo.left||ue.top!==eo.top){const no=getComputedStyle(to),ro=no.transform==="none"?"":no.transform;to.style.transform=`${ro} translate(${ue.left-eo.left}px, ${ue.top-eo.top}px)`}}let current_component;function set_current_component(to){current_component=to}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(to){get_current_component().$$.on_mount.push(to)}function onDestroy(to){get_current_component().$$.on_destroy.push(to)}function createEventDispatcher(){const to=get_current_component();return(ue,eo,{cancelable:no=!1}={})=>{const ro=to.$$.callbacks[ue];if(ro){const oo=custom_event(ue,eo,{cancelable:no});return ro.slice().forEach(io=>{io.call(to,oo)}),!oo.defaultPrevented}return!0}}function setContext(to,ue){return get_current_component().$$.context.set(to,ue),ue}function getContext$1(to){return get_current_component().$$.context.get(to)}function hasContext(to){return get_current_component().$$.context.has(to)}function bubble(to,ue){const eo=to.$$.callbacks[ue.type];eo&&eo.slice().forEach(no=>no.call(this,ue))}const dirty_components=[],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(to){render_callbacks.push(to)}function add_flush_callback(to){flush_callbacks.push(to)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const to=current_component;do{try{for(;flushidx<dirty_components.length;){const ue=dirty_components[flushidx];flushidx++,set_current_component(ue),update(ue.$$)}}catch(ue){throw dirty_components.length=0,flushidx=0,ue}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let ue=0;ue<render_callbacks.length;ue+=1){const eo=render_callbacks[ue];seen_callbacks.has(eo)||(seen_callbacks.add(eo),eo())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(to)}function update(to){if(to.fragment!==null){to.update(),run_all(to.before_update);const ue=to.dirty;to.dirty=[-1],to.fragment&&to.fragment.p(to.ctx,ue),to.after_update.forEach(add_render_callback)}}function flush_render_callbacks(to){const ue=[],eo=[];render_callbacks.forEach(no=>to.indexOf(no)===-1?ue.push(no):eo.push(no)),eo.forEach(no=>no()),render_callbacks=ue}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch$1(to,ue,eo){to.dispatchEvent(custom_event(`${ue?"intro":"outro"}${eo}`))}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(to,ue){to&&to.i&&(outroing.delete(to),to.i(ue))}function transition_out(to,ue,eo,no){if(to&&to.o){if(outroing.has(to))return;outroing.add(to),outros.c.push(()=>{outroing.delete(to),no&&(eo&&to.d(1),no())}),to.o(ue)}else no&&no()}const null_transition={duration:0};function create_in_transition(to,ue,eo){const no={direction:"in"};let ro=ue(to,eo,no),oo=!1,io,ao,so=0;function lo(){io&&delete_rule(to,io)}function co(){const{delay:fo=0,duration:po=300,easing:ho=identity$6,tick:_o=noop$6,css:go}=ro||null_transition;go&&(io=create_rule(to,0,1,po,fo,ho,go,so++)),_o(0,1);const bo=now$2()+fo,vo=bo+po;ao&&ao.abort(),oo=!0,add_render_callback(()=>dispatch$1(to,!0,"start")),ao=loop$1(yo=>{if(oo){if(yo>=vo)return _o(1,0),dispatch$1(to,!0,"end"),lo(),oo=!1;if(yo>=bo){const wo=ho((yo-bo)/po);_o(wo,1-wo)}}return oo})}let uo=!1;return{start(){uo||(uo=!0,delete_rule(to),is_function(ro)?(ro=ro(no),wait().then(co)):co())},invalidate(){uo=!1},end(){oo&&(lo(),oo=!1)}}}function create_out_transition(to,ue,eo){const no={direction:"out"};let ro=ue(to,eo,no),oo=!0,io;const ao=outros;ao.r+=1;let so;function lo(){const{delay:co=0,duration:uo=300,easing:fo=identity$6,tick:po=noop$6,css:ho}=ro||null_transition;ho&&(io=create_rule(to,1,0,uo,co,fo,ho));const _o=now$2()+co,go=_o+uo;add_render_callback(()=>dispatch$1(to,!1,"start")),"inert"in to&&(so=to.inert,to.inert=!0),loop$1(bo=>{if(oo){if(bo>=go)return po(0,1),dispatch$1(to,!1,"end"),--ao.r||run_all(ao.c),!1;if(bo>=_o){const vo=fo((bo-_o)/uo);po(1-vo,vo)}}return oo})}return is_function(ro)?wait().then(()=>{ro=ro(no),lo()}):lo(),{end(co){co&&"inert"in to&&(to.inert=so),co&&ro.tick&&ro.tick(1,0),oo&&(io&&delete_rule(to,io),oo=!1)}}}function create_bidirectional_transition(to,ue,eo,no){let oo=ue(to,eo,{direction:"both"}),io=no?0:1,ao=null,so=null,lo=null,co;function uo(){lo&&delete_rule(to,lo)}function fo(ho,_o){const go=ho.b-io;return _o*=Math.abs(go),{a:io,b:ho.b,d:go,duration:_o,start:ho.start,end:ho.start+_o,group:ho.group}}function po(ho){const{delay:_o=0,duration:go=300,easing:bo=identity$6,tick:vo=noop$6,css:yo}=oo||null_transition,wo={start:now$2()+_o,b:ho};ho||(wo.group=outros,outros.r+=1),"inert"in to&&(ho?co!==void 0&&(to.inert=co):(co=to.inert,to.inert=!0)),ao||so?so=wo:(yo&&(uo(),lo=create_rule(to,io,ho,go,_o,bo,yo)),ho&&vo(0,1),ao=fo(wo,go),add_render_callback(()=>dispatch$1(to,ho,"start")),loop$1(ko=>{if(so&&ko>so.start&&(ao=fo(so,go),so=null,dispatch$1(to,ao.b,"start"),yo&&(uo(),lo=create_rule(to,io,ao.b,ao.duration,0,bo,oo.css))),ao){if(ko>=ao.end)vo(io=ao.b,1-io),dispatch$1(to,ao.b,"end"),so||(ao.b?uo():--ao.group.r||run_all(ao.group.c)),ao=null;else if(ko>=ao.start){const So=ko-ao.start;io=ao.a+ao.d*bo(So/ao.duration),vo(io,1-io)}}return!!(ao||so)}))}return{run(ho){is_function(oo)?wait().then(()=>{oo=oo({direction:ho?"in":"out"}),po(ho)}):po(ho)},end(){uo(),ao=so=null}}}function handle_promise(to,ue){const eo=ue.token={};function no(ro,oo,io,ao){if(ue.token!==eo)return;ue.resolved=ao;let so=ue.ctx;io!==void 0&&(so=so.slice(),so[io]=ao);const lo=ro&&(ue.current=ro)(so);let co=!1;ue.block&&(ue.blocks?ue.blocks.forEach((uo,fo)=>{fo!==oo&&uo&&(group_outros(),transition_out(uo,1,1,()=>{ue.blocks[fo]===uo&&(ue.blocks[fo]=null)}),check_outros())}):ue.block.d(1),lo.c(),transition_in(lo,1),lo.m(ue.mount(),ue.anchor),co=!0),ue.block=lo,ue.blocks&&(ue.blocks[oo]=lo),co&&flush()}if(is_promise(to)){const ro=get_current_component();if(to.then(oo=>{set_current_component(ro),no(ue.then,1,ue.value,oo),set_current_component(null)},oo=>{if(set_current_component(ro),no(ue.catch,2,ue.error,oo),set_current_component(null),!ue.hasCatch)throw oo}),ue.current!==ue.pending)return no(ue.pending,0),!0}else{if(ue.current!==ue.then)return no(ue.then,1,ue.value,to),!0;ue.resolved=to}}function update_await_block_branch(to,ue,eo){const no=ue.slice(),{resolved:ro}=to;to.current===to.then&&(no[to.value]=ro),to.current===to.catch&&(no[to.error]=ro),to.block.p(no,eo)}function ensure_array_like(to){return(to==null?void 0:to.length)!==void 0?to:Array.from(to)}function destroy_block(to,ue){to.d(1),ue.delete(to.key)}function outro_and_destroy_block(to,ue){transition_out(to,1,1,()=>{ue.delete(to.key)})}function fix_and_outro_and_destroy_block(to,ue){to.f(),outro_and_destroy_block(to,ue)}function update_keyed_each(to,ue,eo,no,ro,oo,io,ao,so,lo,co,uo){let fo=to.length,po=oo.length,ho=fo;const _o={};for(;ho--;)_o[to[ho].key]=ho;const go=[],bo=new Map,vo=new Map,yo=[];for(ho=po;ho--;){const Ao=uo(ro,oo,ho),Io=eo(Ao);let Eo=io.get(Io);Eo?no&&yo.push(()=>Eo.p(Ao,ue)):(Eo=lo(Io,Ao),Eo.c()),bo.set(Io,go[ho]=Eo),Io in _o&&vo.set(Io,Math.abs(ho-_o[Io]))}const wo=new Set,ko=new Set;function So(Ao){transition_in(Ao,1),Ao.m(ao,co),io.set(Ao.key,Ao),co=Ao.first,po--}for(;fo&&po;){const Ao=go[po-1],Io=to[fo-1],Eo=Ao.key,To=Io.key;Ao===Io?(co=Ao.first,fo--,po--):bo.has(To)?!io.has(Eo)||wo.has(Eo)?So(Ao):ko.has(To)?fo--:vo.get(Eo)>vo.get(To)?(ko.add(Eo),So(Ao)):(wo.add(To),fo--):(so(Io,io),fo--)}for(;fo--;){const Ao=to[fo];bo.has(Ao.key)||so(Ao,io)}for(;po;)So(go[po-1]);return run_all(yo),go}function get_spread_update(to,ue){const eo={},no={},ro={$$scope:1};let oo=to.length;for(;oo--;){const io=to[oo],ao=ue[oo];if(ao){for(const so in io)so in ao||(no[so]=1);for(const so in ao)ro[so]||(eo[so]=ao[so],ro[so]=1);to[oo]=ao}else for(const so in io)ro[so]=1}for(const io in no)io in eo||(eo[io]=void 0);return eo}function get_spread_object(to){return typeof to=="object"&&to!==null?to:{}}function bind$2(to,ue,eo){const no=to.$$.props[ue];no!==void 0&&(to.$$.bound[no]=eo,eo(to.$$.ctx[no]))}function create_component(to){to&&to.c()}function mount_component(to,ue,eo){const{fragment:no,after_update:ro}=to.$$;no&&no.m(ue,eo),add_render_callback(()=>{const oo=to.$$.on_mount.map(run$3).filter(is_function);to.$$.on_destroy?to.$$.on_destroy.push(...oo):run_all(oo),to.$$.on_mount=[]}),ro.forEach(add_render_callback)}function destroy_component(to,ue){const eo=to.$$;eo.fragment!==null&&(flush_render_callbacks(eo.after_update),run_all(eo.on_destroy),eo.fragment&&eo.fragment.d(ue),eo.on_destroy=eo.fragment=null,eo.ctx=[])}function make_dirty(to,ue){to.$$.dirty[0]===-1&&(dirty_components.push(to),schedule_update(),to.$$.dirty.fill(0)),to.$$.dirty[ue/31|0]|=1<<ue%31}function init$3(to,ue,eo,no,ro,oo,io=null,ao=[-1]){const so=current_component;set_current_component(to);const lo=to.$$={fragment:null,ctx:[],props:oo,update:noop$6,not_equal:ro,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(ue.context||(so?so.$$.context:[])),callbacks:blank_object(),dirty:ao,skip_bound:!1,root:ue.target||so.$$.root};io&&io(lo.root);let co=!1;if(lo.ctx=eo?eo(to,ue.props||{},(uo,fo,...po)=>{const ho=po.length?po[0]:fo;return lo.ctx&&ro(lo.ctx[uo],lo.ctx[uo]=ho)&&(!lo.skip_bound&&lo.bound[uo]&&lo.bound[uo](ho),co&&make_dirty(to,uo)),fo}):[],lo.update(),co=!0,run_all(lo.before_update),lo.fragment=no?no(lo.ctx):!1,ue.target){if(ue.hydrate){const uo=children$1(ue.target);lo.fragment&&lo.fragment.l(uo),uo.forEach(detach)}else lo.fragment&&lo.fragment.c();ue.intro&&transition_in(to.$$.fragment),mount_component(to,ue.target,ue.anchor),flush()}set_current_component(so)}class SvelteComponent{constructor(){pc(this,"$$");pc(this,"$$set")}$destroy(){destroy_component(this,1),this.$destroy=noop$6}$on(ue,eo){if(!is_function(eo))return noop$6;const no=this.$$.callbacks[ue]||(this.$$.callbacks[ue]=[]);return no.push(eo),()=>{const ro=no.indexOf(eo);ro!==-1&&no.splice(ro,1)}}$set(ue){this.$$set&&!is_empty(ue)&&(this.$$.skip_bound=!0,this.$$set(ue),this.$$.skip_bound=!1)}}const PUBLIC_VERSION="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(PUBLIC_VERSION);const defaultConfig$1={queryHandler:{parse:to=>fromEntries(new URLSearchParams(to)),stringify:to=>"?"+new URLSearchParams(to).toString()},urlTransform:{apply:to=>to,remove:to=>to},useHash:!1};function fromEntries(to){return[...to].reduce((ue,[eo,no])=>(ue[eo]=no,ue),{})}const MATCH_PARAM=RegExp(/\:([^/()]+)/g);function handleScroll(to,ue){if(navigator.userAgent.includes("jsdom"))return!1;ue&&scrollAncestorsToTop(to),handleHash()}function handleHash(){if(navigator.userAgent.includes("jsdom"))return!1;const{hash:to}=window.location;if(to){const ue=document.getElementById(to.substring(1));ue&&ue.scrollIntoView()}}function scrollAncestorsToTop(to){to&&to.scrollTo&&to.dataset.routify!=="scroll-lock"&&to.dataset["routify-scroll"]!=="lock"&&(to.style["scroll-behavior"]="auto",to.scrollTo({top:0,behavior:"auto"}),to.style["scroll-behavior"]="",scrollAncestorsToTop(to.parentElement))}const pathToRegex=(to,ue)=>{const eo=ue?"":"/?$";return to=to.replace(/\/_fallback?$/,"(/|$)"),to=to.replace(/\/index$/,"(/index)?"),to=to.replace(MATCH_PARAM,"([^/]+)")+eo,to=`^${to}`,to},pathToParamKeys=to=>{const ue=[];let eo;for(;eo=MATCH_PARAM.exec(to);)ue.push(eo[1]);return ue},pathToRank=({path:to})=>to.split("/").filter(Boolean).map(ue=>ue==="_fallback"?"A":ue.startsWith(":")?"B":"C").join("");function suppressComponentWarnings(to,ue){suppressComponentWarnings._console=suppressComponentWarnings._console||{log:console.log,warn:console.warn};const{_console:eo}=suppressComponentWarnings,no=to.componentFile.name.replace(/Proxy<_?(.+)>/,"$1").replace(/^Index$/,to.component.shortPath.split("/").pop()).replace(/^./,oo=>oo.toUpperCase()).replace(/\:(.+)/,"U5B$1u5D"),ro=[`<${no}> received an unexpected slot "default".`,`<${no}> was created with unknown prop 'scoped'`,`<${no}> was created with unknown prop 'scopedSync'`];for(const oo of["log","warn"])console[oo]=(...io)=>{ro.includes(io[0])||eo[oo](...io)},ue().then(()=>{console[oo]=eo[oo]})}function currentLocation(){let to=window.location.pathname+window.location.search+window.location.hash;const{url:ue,options:eo}=resolvePrefetch(to);return{...parseUrl(ue),options:eo}}function resolvePrefetch(to){const[ue,eo]=to.split("__[[routify_url_options]]__"),no=JSON.parse(decodeURIComponent(eo||"")||"{}");return window.routify=window.routify||{},window.routify.prefetched=no.prefetch,{url:ue,options:no}}function parseUrl(to){defaultConfig$1.useHash&&(to=to.replace(/.*#(.+)/,"$1"));const ue=to.startsWith("/")?window.location.origin:void 0,eo=new URL(to,ue),no=eo.pathname+eo.search+eo.hash;return{url:eo,fullpath:no}}function resolveUrl(to,ue,eo){const no=defaultConfig$1.useHash?"#":"";let ro;return ro=populateUrl(to,ue,eo),ro=defaultConfig$1.urlTransform.apply(ro),ro=no+ro,ro}function populateUrl(to,ue,eo){const no=Object.assign({},eo,ue),ro=getQueryString(to,ue);for(const[oo,io]of Object.entries(no))to=to.replace(new RegExp(`:${oo}(/|$)`),io+"$1");return`${to}${ro}`}function getQueryString(to,ue){if(!defaultConfig$1.queryHandler)return"";const eo=pathToParamKeys(to),no={};return ue&&Object.entries(ue).forEach(([ro,oo])=>{eo.includes(ro)||(no[ro]=oo)}),defaultConfig$1.queryHandler.stringify(no).replace(/\?$/,"")}function create_fragment$b$(to){let ue;const eo=to[2].default,no=create_slot(eo,to,to[1],null);return{c(){no&&no.c()},m(ro,oo){no&&no.m(ro,oo),ue=!0},p(ro,[oo]){no&&no.p&&(!ue||oo&2)&&update_slot_base(no,eo,ro,ro[1],ue?get_slot_changes(eo,ro[1],oo,null):get_all_dirty_from_scope(ro[1]),null)},i(ro){ue||(transition_in(no,ro),ue=!0)},o(ro){transition_out(no,ro),ue=!1},d(ro){no&&no.d(ro)}}}function instance$bY(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{scoped:oo={}}=ue;return to.$$set=io=>{"scoped"in io&&eo(0,oo=io.scoped),"$$scope"in io&&eo(1,ro=io.$$scope)},[oo,ro,no]}class Noop extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bY,create_fragment$b$,safe_not_equal,{scoped:0})}}const subscriber_queue=[];function readable(to,ue){return{subscribe:writable(to,ue).subscribe}}function writable(to,ue=noop$6){let eo;const no=new Set;function ro(ao){if(safe_not_equal(to,ao)&&(to=ao,eo)){const so=!subscriber_queue.length;for(const lo of no)lo[1](),subscriber_queue.push(lo,to);if(so){for(let lo=0;lo<subscriber_queue.length;lo+=2)subscriber_queue[lo][0](subscriber_queue[lo+1]);subscriber_queue.length=0}}}function oo(ao){ro(ao(to))}function io(ao,so=noop$6){const lo=[ao,so];return no.add(lo),no.size===1&&(eo=ue(ro,oo)||noop$6),ao(to),()=>{no.delete(lo),no.size===0&&eo&&(eo(),eo=null)}}return{set:ro,update:oo,subscribe:io}}function derived(to,ue,eo){const no=!Array.isArray(to),ro=no?[to]:to;if(!ro.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const oo=ue.length<2;return readable(eo,(io,ao)=>{let so=!1;const lo=[];let co=0,uo=noop$6;const fo=()=>{if(co)return;uo();const ho=ue(no?lo[0]:lo,io,ao);oo?io(ho):uo=is_function(ho)?ho:noop$6},po=ro.map((ho,_o)=>subscribe(ho,go=>{lo[_o]=go,co&=~(1<<_o),so&&fo()},()=>{co|=1<<_o}));return so=!0,fo(),function(){run_all(po),uo(),so=!1}})}window.routify=window.routify||{};const route=writable(null),routes$1=writable([]);routes$1.subscribe(to=>window.routify.routes=to);let rootContext=writable({component:{params:{}}});const urlRoute=writable(null),prefetchPath=writable(""),isChangingPage=writable(!0);async function onPageLoaded({page:to,metatags:ue,afterPageLoad:eo,parentNode:no}){const ro=to.last!==to;setTimeout(()=>handleScroll(no,ro));const{path:oo}=to,{options:io}=currentLocation(),ao=io.prefetch;for(const so of eo._hooks)so&&await so(to.api);ue.update(),dispatchEvent(new CustomEvent("app-loaded")),parent.postMessage({msg:"app-loaded",prefetched:window.routify.prefetched,path:oo,prefetchId:ao},"*"),window.routify.appLoaded=!0,window.routify.stopAutoReady=!1}function urlToRoute(to,ue=!1){to=defaultConfig$1.urlTransform.remove(to);let{pathname:eo,search:no}=parseUrl(to).url;const ro=get_store_value(routes$1),oo=ro.find(co=>eo===co.meta.name)||ro.find(co=>eo.match(co.regex));if(!oo)throw new Error(`Route could not be found for "${eo}".`);const io=ue?Object.create(oo):oo,{route:ao,redirectPath:so,rewritePath:lo}=resolveRedirects(io,ro);return lo&&({pathname:eo,search:no}=parseUrl(resolveUrl(lo,ao.params)).url,so&&(ao.redirectTo=resolveUrl(so,ao.params||{}))),defaultConfig$1.queryHandler&&(ao.params=Object.assign({},defaultConfig$1.queryHandler.parse(no))),assignParamsToRouteAndLayouts(ao,eo),ao.leftover=to.replace(new RegExp(ao.regex),""),ao}function assignParamsToRouteAndLayouts(to,ue){if(to.paramKeys){const eo=layoutByPos(to.layouts),no=ue.split("/").filter(Boolean);getRouteProps(to.path).forEach((oo,io)=>{oo&&(to.params[oo]=no[io],eo[io]?eo[io].param={[oo]:no[io]}:to.param={[oo]:no[io]})})}}function resolveRedirects(to,ue,eo,no){const{redirect:ro,rewrite:oo}=to.meta;if(ro||oo){eo=ro?ro.path||ro:eo,no=oo?oo.path||oo:eo;const io=ro&&ro.params,ao=oo&&oo.params,so=ue.find(lo=>lo.path.replace(/\/index$/,"")===no);return so===to&&console.error(`${no} is redirecting to itself`),so||console.error(`${to.path} is redirecting to non-existent path: ${no}`),(io||ao)&&(so.params=Object.assign({},so.params,io,ao)),resolveRedirects(so,ue,eo,no)}return{route:to,redirectPath:eo,rewritePath:no}}function layoutByPos(to){const ue=[];return to.forEach(eo=>{ue[eo.path.split("/").filter(Boolean).length-1]=eo}),ue}function getRouteProps(to){return to.split("/").filter(Boolean).map(ue=>ue.match(/\:(.+)/)).map(ue=>ue&&ue[1])}function get_each_context$2f(to,ue,eo){const no=to.slice();return no[1]=ue[eo],no}function create_each_block$2f(to,ue){let eo,no;return{key:to,first:null,c(){eo=element("iframe"),src_url_equal(eo.src,no=ue[1].url)||attr(eo,"src",no),attr(eo,"frameborder","0"),attr(eo,"title","routify prefetcher"),this.first=eo},m(ro,oo){insert$1(ro,eo,oo)},p(ro,oo){ue=ro,oo&1&&!src_url_equal(eo.src,no=ue[1].url)&&attr(eo,"src",no)},d(ro){ro&&detach(eo)}}}function create_fragment$b_(to){let ue,eo=[],no=new Map,ro=ensure_array_like(to[0]);const oo=io=>io[1].options.prefetch;for(let io=0;io<ro.length;io+=1){let ao=get_each_context$2f(to,ro,io),so=oo(ao);no.set(so,eo[io]=create_each_block$2f(so,ao))}return{c(){ue=element("div");for(let io=0;io<eo.length;io+=1)eo[io].c();attr(ue,"id","__routify_iframes"),set_style(ue,"display","none")},m(io,ao){insert$1(io,ue,ao);for(let so=0;so<eo.length;so+=1)eo[so]&&eo[so].m(ue,null)},p(io,[ao]){ao&1&&(ro=ensure_array_like(io[0]),eo=update_keyed_each(eo,ao,oo,1,io,ro,no,ue,destroy_block,create_each_block$2f,null,get_each_context$2f))},i:noop$6,o:noop$6,d(io){io&&detach(ue);for(let ao=0;ao<eo.length;ao+=1)eo[ao].d()}}}const iframeNum=2,defaults$4={validFor:60,timeout:5e3,gracePeriod:1e3},queue$1=writable([]),actives=derived(queue$1,to=>to.slice(0,iframeNum));actives.subscribe(to=>to.forEach(({options:ue})=>{setTimeout(()=>removeFromQueue(ue.prefetch),ue.timeout)}));function prefetch$1(to,ue={}){if(prefetch$1.id=prefetch$1.id||1,to=to.href||to,ue={...defaults$4,...ue},ue.prefetch=prefetch$1.id++,window.routify.prefetched||navigator.userAgent.match("jsdom"))return!1;queue$1.update(eo=>(eo.some(no=>no.options.path===to)||eo.push({url:`${to}__[[routify_url_options]]__${encodeURIComponent(JSON.stringify(ue))}`,options:ue}),eo))}function removeFromQueue(to){const ue=to.data?to.data.prefetchId:to;if(!ue)return null;const eo=get_store_value(queue$1).find(no=>no&&no.options.prefetch==ue);if(eo){const{gracePeriod:no}=eo.options,ro=new Promise(io=>setTimeout(io,no)),oo=new Promise(io=>{window.requestIdleCallback?window.requestIdleCallback(io):setTimeout(io,no+1e3)});Promise.all([ro,oo]).then(()=>{queue$1.update(io=>io.filter(ao=>ao.options.prefetch!=ue))})}}addEventListener("message",removeFromQueue,!1);function instance$bX(to,ue,eo){let no;return component_subscribe(to,actives,ro=>eo(0,no=ro)),[no]}class Prefetcher extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bX,create_fragment$b_,safe_not_equal,{})}}function getRoutifyContext(){return getContext$1("routify")||rootContext}const nodes={subscribe(to){const ue=[];return derived(routes$1,eo=>{eo.forEach(ro=>{const oo=ro.layouts.map(io=>io.api).filter(io=>!ue.includes(io));ue.push(ro.api,...oo)});const no=ue.find;return ue.find=(ro,...oo)=>typeof ro=="string"?ue.find(io=>io.meta.name===ro)||ue.find(io=>io.path===ro):no.bind(ue)(ro,...oo),ue}).subscribe(to)}},components$1=nodes,page={subscribe(to){return derived(route,ue=>ue.api).subscribe(to)}},node$2={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.component.api).subscribe(to)}},layout$2={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.layout.api).subscribe(to)}},context={subscribe(to){return getRoutifyContext().subscribe(to)}},ready={subscribe(to){window.routify.stopAutoReady=!0;async function ue(){await tick(),await onPageLoaded({page:get_store_value(route),metatags,afterPageLoad})}return to(ue),()=>{}}},afterPageLoad={_hooks:[to=>isChangingPage.set(!1)],subscribe:hookHandler},beforeUrlChange={_hooks:[],subscribe:hookHandler};function hookHandler(to){const ue=this._hooks,eo=ue.length;return to(no=>{ue[eo]=no}),(...no)=>{delete ue[eo],to(...no)}}const params={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.route.params).subscribe(to)}},leftover={subscribe(to){return derived(route,ue=>ue.leftover).subscribe(to)}};function isAncestor(to,ue,eo=!0){to=to.__file||to,ue=ue.__file||ue;const no=ue.parent===to.parent;return!to.isIndex||ue.shortPath===to.shortPath?!1:no&&!ue.isDir?!!eo:ue.shortPath.startsWith(to.shortPath)}const meta$2={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.layout.meta).subscribe(to)}},url$3={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>makeUrlHelper(eo,eo.route,eo.routes)).subscribe(to)}};function makeUrlHelper(to,ue,eo){return function(ro,oo={},io){const{component:ao}=to,so=Object.assign({},ue.params,ao.params);let lo=ro&&ro.nodeType&&ro;lo&&(ro=ro.getAttribute("href")),ro=ro?po(ro):ao.shortPath;const co=eo.find(ho=>[ho.shortPath||"/",ho.path].includes(ro));if(co&&co.meta.preload==="proximity"&&window.requestIdleCallback){const ho=routify.appLoaded?0:1500;setTimeout(()=>{window.requestIdleCallback(()=>co.api.preload())},ho)}io&&io.strict!==!1||(ro=ro.replace(/index$/,""));let fo=resolveUrl(ro,oo,so);if(lo)return lo.href=fo,{update(ho){lo.href=resolveUrl(ro,ho,so)}};return fo;function po(ho){if(ho.match(/^\.\.?\//)){let[,_o,go]=ho.match(/^([\.\/]+)(.*)/),bo=ao.path.replace(/\/$/,"");const vo=_o.match(/\.\.\//g)||[];ao.isPage&&vo.push(null),vo.forEach(()=>bo=bo.replace(/\/[^\/]+\/?$/,"")),ho=`${bo}/${go}`.replace(/\/$/,""),ho=ho||"/"}else if(!ho.match(/^\//)){const _o=eo.find(go=>go.meta.name===ho);_o&&(ho=_o.shortPath)}return ho}}}const goto={subscribe(to){const ue=getContext$1("routifyupdatepage");return derived(url$3,eo=>function(ro,oo,io,ao){const so=eo(ro,oo);io?ue(so,ao):history.pushState({},null,so)}).subscribe(to)}},redirect={subscribe(to){const ue=getContext$1("routifyupdatepage");return derived(url$3,eo=>function(ro,oo,io,ao){const so=eo(ro,oo);io?ue(so,ao):history.replaceState({},null,so)}).subscribe(to)}},isActive={subscribe(to){return derived([url$3,route],([ue,eo])=>function(ro="",oo={},{strict:io}={strict:!0}){ro=ue(ro,oo,{strict:io});const ao=ue(eo.path,oo,{strict:io}),so=new RegExp("^"+ro+"($|/)");return!!ao.match(so)}).subscribe(to)}};function precache(to,ue){(typeof to=="string"?urlToRoute(to):to).component()}function prefetch(to,ue){prefetch$1(to,ue)}function getConcestor(to,ue){const eo=to.__file,no=ue.__file,ro=[...eo.lineage,eo],oo=[...no.lineage,no];let io=ro[0],ao=[ro[0].api,oo[0].api];return ro.forEach((so,lo)=>{const co=oo[lo];co&&so.parent===co.parent&&(io=so.parent,ao=[so.api,co.api])}),[io.api,ao[0],ao[1]]}function getDirection$1(to,ue,eo){const no=to.findIndex(oo=>ue.path.startsWith(oo)),ro=to.findIndex(oo=>eo.path.startsWith(oo));return no-ro}function focus(to){focusIsSet||(focusIsSet=!0,to.setAttribute("tabindex","0"),to.focus(),setTimeout(()=>focusIsSet=!1))}let focusIsSet=!1;const _metatags={subscribe(to){return this._origin=this.getOrigin(),to(metatags)},props:{},templates:{},services:{plain:{propField:"name",valueField:"content"},twitter:{propField:"name",valueField:"content"},og:{propField:"property",valueField:"content"}},plugins:[{name:"applyTemplate",condition:()=>!0,action:(to,ue)=>{const eo=_metatags.getLongest(_metatags.templates,to)||(no=>no);return[to,eo(ue)]}},{name:"createMeta",condition:()=>!0,action(to,ue){_metatags.writeMeta(to,ue)}},{name:"createOG",condition:to=>!to.match(":"),action(to,ue){_metatags.writeMeta(`og:${to}`,ue)}},{name:"createTitle",condition:to=>to==="title",action(to,ue){document.title=ue}}],getLongest(to,ue){const eo=to[ue];if(eo){const no=get_store_value(route).path,io=Object.keys(to[ue]).filter(ao=>no.includes(ao)).sort((ao,so)=>so.length-ao.length)[0];return eo[io]}},writeMeta(to,ue){const eo=document.getElementsByTagName("head")[0],no=to.match(/(.+)\:/),ro=no&&no[1]||"plain",{propField:oo,valueField:io}=metatags.services[ro]||metatags.services.plain,ao=document.querySelector(`meta[${oo}='${to}']`);ao&&ao.remove();const so=document.createElement("meta");so.setAttribute(oo,to),so.setAttribute(io,ue),so.setAttribute("data-origin","routify"),eo.appendChild(so)},set(to,ue){typeof to=="string"&&_metatags.plugins.forEach(eo=>{eo.condition(to,ue)&&([to,ue]=eo.action(to,ue)||[to,ue])})},clear(){const to=document.querySelector("meta");to&&to.remove()},template(to,ue){const eo=_metatags.getOrigin;_metatags.templates[to]=_metatags.templates[to]||{},_metatags.templates[to][eo]=ue},update(){Object.keys(_metatags.props).forEach(to=>{let ue=_metatags.getLongest(_metatags.props,to);_metatags.plugins.forEach(eo=>{eo.condition(to,ue)&&([to,ue]=eo.action(to,ue)||[to,ue])})})},batchedUpdate(){_metatags._pendingUpdate||(_metatags._pendingUpdate=!0,setTimeout(()=>{_metatags._pendingUpdate=!1,this.update()}))},_updateQueued:!1,_origin:!1,getOrigin(){if(this._origin)return this._origin;const to=getRoutifyContext();return to&&get_store_value(to).path||"/"},_pendingUpdate:!1},metatags=new Proxy(_metatags,{set(to,ue,eo,no){const{props:ro}=to;return Reflect.has(to,ue)?Reflect.set(to,ue,eo,no):(ro[ue]=ro[ue]||{},ro[ue][to.getOrigin()]=eo),window.routify.appLoaded&&to.batchedUpdate(),!0}});function get_each_context$2e(to,ue,eo){const no=to.slice();return no[21]=ue[eo].component,no[22]=ue[eo].componentFile,no[2]=ue[eo].decorator,no[1]=ue[eo].nodes,no}function create_if_block_1$31(to){let ue=[],eo=new Map,no,ro,oo=ensure_array_like([to[4]]);const io=ao=>ao[7];for(let ao=0;ao<1;ao+=1){let so=get_each_context$2e(to,oo,ao),lo=io(so);eo.set(lo,ue[ao]=create_each_block$2e(lo,so))}return{c(){for(let ao=0;ao<1;ao+=1)ue[ao].c();no=empty$2()},m(ao,so){for(let lo=0;lo<1;lo+=1)ue[lo]&&ue[lo].m(ao,so);insert$1(ao,no,so),ro=!0},p(ao,so){so&33554621&&(oo=ensure_array_like([ao[4]]),group_outros(),ue=update_keyed_each(ue,so,io,1,ao,oo,eo,no.parentNode,outro_and_destroy_block,create_each_block$2e,no,get_each_context$2e),check_outros())},i(ao){if(!ro){for(let so=0;so<1;so+=1)transition_in(ue[so]);ro=!0}},o(ao){for(let so=0;so<1;so+=1)transition_out(ue[so]);ro=!1},d(ao){ao&&detach(no);for(let so=0;so<1;so+=1)ue[so].d(ao)}}}function create_if_block_2$1S(to){let ue,eo;return ue=new Route({props:{decorator:to[2],nodes:to[1],scoped:{...to[0],...to[25]}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&4&&(oo.decorator=no[2]),ro&16&&(oo.nodes=no[1]),ro&33554433&&(oo.scoped={...no[0],...no[25]}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$4q(to){let ue,eo,no=to[21]&&to[1].length&&create_if_block_2$1S(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,oo){ro[21]&&ro[1].length?no?(no.p(ro,oo),oo&16&&transition_in(no,1)):(no=create_if_block_2$1S(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function create_default_slot$74(to){let ue,eo,no;const ro=[{scoped:to[0]},{scopedSync:to[5]},to[3].param||{}];var oo=to[22];function io(ao,so){let lo={$$slots:{default:[create_default_slot_1$4q,({scoped:co,decorator:uo})=>({25:co,2:uo}),({scoped:co,decorator:uo})=>(co?33554432:0)|(uo?4:0)]},$$scope:{ctx:ao}};for(let co=0;co<ro.length;co+=1)lo=assign$1(lo,ro[co]);return so!==void 0&&so&41&&(lo=assign$1(lo,get_spread_update(ro,[so&1&&{scoped:ao[0]},so&32&&{scopedSync:ao[5]},so&8&&get_spread_object(ao[3].param||{})]))),{props:lo}}return oo&&(ue=construct_svelte_component(oo,io(to))),{c(){ue&&create_component(ue.$$.fragment),eo=space$1()},m(ao,so){ue&&mount_component(ue,ao,so),insert$1(ao,eo,so),no=!0},p(ao,so){if(so&16&&oo!==(oo=ao[22])){if(ue){group_outros();const lo=ue;transition_out(lo.$$.fragment,1,0,()=>{destroy_component(lo,1)}),check_outros()}oo?(ue=construct_svelte_component(oo,io(ao,so)),create_component(ue.$$.fragment),transition_in(ue.$$.fragment,1),mount_component(ue,eo.parentNode,eo)):ue=null}else if(oo){const lo=so&41?get_spread_update(ro,[so&1&&{scoped:ao[0]},so&32&&{scopedSync:ao[5]},so&8&&get_spread_object(ao[3].param||{})]):{};so&100663317&&(lo.$$scope={dirty:so,ctx:ao}),ue.$set(lo)}},i(ao){no||(ue&&transition_in(ue.$$.fragment,ao),no=!0)},o(ao){ue&&transition_out(ue.$$.fragment,ao),no=!1},d(ao){ao&&detach(eo),ue&&destroy_component(ue,ao)}}}function create_each_block$2e(to,ue){let eo,no,ro,oo;var io=ue[2];function ao(so,lo){return{props:{scoped:so[0],$$slots:{default:[create_default_slot$74]},$$scope:{ctx:so}}}}return io&&(no=construct_svelte_component(io,ao(ue))),{key:to,first:null,c(){eo=empty$2(),no&&create_component(no.$$.fragment),ro=empty$2(),this.first=eo},m(so,lo){insert$1(so,eo,lo),no&&mount_component(no,so,lo),insert$1(so,ro,lo),oo=!0},p(so,lo){if(ue=so,lo&16&&io!==(io=ue[2])){if(no){group_outros();const co=no;transition_out(co.$$.fragment,1,0,()=>{destroy_component(co,1)}),check_outros()}io?(no=construct_svelte_component(io,ao(ue)),create_component(no.$$.fragment),transition_in(no.$$.fragment,1),mount_component(no,ro.parentNode,ro)):no=null}else if(io){const co={};lo&1&&(co.scoped=ue[0]),lo&67108925&&(co.$$scope={dirty:lo,ctx:ue}),no.$set(co)}},i(so){oo||(no&&transition_in(no.$$.fragment,so),oo=!0)},o(so){no&&transition_out(no.$$.fragment,so),oo=!1},d(so){so&&(detach(eo),detach(ro)),no&&destroy_component(no,so)}}}function create_if_block$5z(to){let ue,eo,no;return{c(){ue=element("div"),set_style(ue,"display","contents")},m(ro,oo){insert$1(ro,ue,oo),eo||(no=action_destroyer(to[10].call(null,ue)),eo=!0)},d(ro){ro&&detach(ue),eo=!1,no()}}}function create_fragment$bZ(to){let ue,eo,no,ro=to[4]&&create_if_block_1$31(to),oo=!to[6]&&create_if_block$5z(to);return{c(){ro&&ro.c(),ue=space$1(),oo&&oo.c(),eo=empty$2()},m(io,ao){ro&&ro.m(io,ao),insert$1(io,ue,ao),oo&&oo.m(io,ao),insert$1(io,eo,ao),no=!0},p(io,[ao]){io[4]?ro?(ro.p(io,ao),ao&16&&transition_in(ro,1)):(ro=create_if_block_1$31(io),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros()),io[6]?oo&&(oo.d(1),oo=null):oo||(oo=create_if_block$5z(io),oo.c(),oo.m(eo.parentNode,eo))},i(io){no||(transition_in(ro),no=!0)},o(io){transition_out(ro),no=!1},d(io){io&&(detach(ue),detach(eo)),ro&&ro.d(io),oo&&oo.d(io)}}}function instance$bW(to,ue,eo){let no,ro,oo,io,ao;component_subscribe(to,route,Io=>eo(14,oo=Io)),component_subscribe(to,routes$1,Io=>eo(16,ao=Io));let{nodes:so=[]}=ue,{scoped:lo={}}=ue,{decorator:co=void 0}=ue,uo=null,fo=null,po={},ho,_o=1;const go=writable(null);component_subscribe(to,go,Io=>eo(4,ro=Io));const bo=getContext$1("routify")||rootContext;component_subscribe(to,bo,Io=>eo(15,io=Io));const vo=Io=>eo(6,ho=Io.parentNode);setContext("routify",go);let yo=[];function wo(Io){let Eo=Io.component();Eo instanceof Promise?Eo.then(ko):ko(Eo)}function ko(Io){eo(5,po={...lo});const Eo={...ro,nodes:fo,decorator:co||Noop,layout:uo.isLayout?uo:io.layout,component:uo,route:oo,routes:ao,componentFile:Io,parentNode:ho||io.parentNode};go.set(Eo),set_store_value(bo,io.child=uo,io),fo.length===0&&So()}async function So(){await new Promise(Eo=>setTimeout(Eo));const Io=ro.component.path===oo.path;!window.routify.stopAutoReady&&Io&&onPageLoaded({page:ro.component,metatags,afterPageLoad,parentNode:ho})}function Ao({meta:Io,path:Eo,param:To,params:Mo}){return JSON.stringify({path:Eo,invalidate:_o,param:(Io["param-is-page"]||Io["slug-is-page"])&&To,queryParams:Io["query-params-is-page"]&&Mo})}return to.$$set=Io=>{"nodes"in Io&&eo(1,so=Io.nodes),"scoped"in Io&&eo(0,lo=Io.scoped),"decorator"in Io&&eo(2,co=Io.decorator)},to.$$.update=()=>{to.$$.dirty&6146&&yo!==so&&(eo(12,yo=so),eo(3,[uo,...fo]=[...so],uo),eo(3,uo.api.reset=()=>eo(11,_o++,_o),uo)),to.$$.dirty&8&&wo(uo),to.$$.dirty&2064&&eo(7,no=ro&&_o&&Ao(ro.component)),to.$$.dirty&16&&ro&&suppressComponentWarnings(ro,tick)},[lo,so,co,uo,ro,po,ho,no,go,bo,vo,_o,yo]}class Route extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bW,create_fragment$bZ,safe_not_equal,{nodes:1,scoped:0,decorator:2})}}function init$2(to,ue){let eo=!1;function no(oo,io){const ao=oo||currentLocation().fullpath,so=urlToRoute(ao);so.redirectTo&&(history.replaceStateNative({},null,so.redirectTo),delete so.redirectTo);const uo=[...(io&&urlToRoute(currentLocation().fullpath,to)||so).layouts,so];eo&&delete eo.last,so.last=eo,eo=so,oo||urlRoute.set(so),route.set(so),so.api.preload().then(()=>{isChangingPage.set(!0),ue(uo)})}const ro=createEventListeners(no);return{updatePage:no,destroy:ro}}function createEventListeners(to){["pushState","replaceState"].forEach(ro=>{history[ro+"Native"]||(history[ro+"Native"]=history[ro]),history[ro]=async function(oo={},io,ao){const so=location.pathname+location.search+location.hash;if(ao===so)return!1;const{id:lo,path:co,params:uo}=get_store_value(route);oo={id:lo,path:co,params:uo,...oo};const fo=new Event(ro.toLowerCase());if(Object.assign(fo,{state:oo,title:io,url:ao}),await runHooksBeforeUrlChange(fo,ao))return history[ro+"Native"].apply(this,[oo,io,ao]),dispatchEvent(fo)}});let ue=!1;const eo={click:handleClick$1,pushstate:()=>to(),replacestate:()=>to(),popstate:async ro=>{ue?ue=!1:await runHooksBeforeUrlChange(ro,currentLocation().fullpath)?to():(ue=!0,ro.preventDefault(),history.go(1))}};return Object.entries(eo).forEach(ro=>addEventListener(...ro)),()=>{Object.entries(eo).forEach(ro=>removeEventListener(...ro))}}function handleClick$1(to){const ue=to.target.closest("a")||to.composedPath().find(oo=>oo.tagName==="A"),eo=ue&&ue.href;if(to.ctrlKey||to.metaKey||to.altKey||to.shiftKey||to.button||to.defaultPrevented||!eo||ue.target||ue.host!==location.host)return;const no=new URL(eo),ro=no.pathname+no.search+no.hash;to.preventDefault(),history.pushState({},"",ro)}async function runHooksBeforeUrlChange(to,ue){const eo=urlToRoute(ue).api;for(const no of beforeUrlChange._hooks.filter(Boolean))if(!await no(to,eo,{url:ue}))return!1;return!0}function create_if_block$5y(to){let ue,eo;return ue=new Route({props:{nodes:to[0]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.nodes=no[0]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bY(to){let ue,eo,no,ro=to[0]&&to[1]!==null&&create_if_block$5y(to);return eo=new Prefetcher({}),{c(){ro&&ro.c(),ue=space$1(),create_component(eo.$$.fragment)},m(oo,io){ro&&ro.m(oo,io),insert$1(oo,ue,io),mount_component(eo,oo,io),no=!0},p(oo,[io]){oo[0]&&oo[1]!==null?ro?(ro.p(oo,io),io&3&&transition_in(ro,1)):(ro=create_if_block$5y(oo),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros())},i(oo){no||(transition_in(ro),transition_in(eo.$$.fragment,oo),no=!0)},o(oo){transition_out(ro),transition_out(eo.$$.fragment,oo),no=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo),destroy_component(eo,oo)}}}function instance$bV(to,ue,eo){let no;component_subscribe(to,route,po=>eo(1,no=po));let{routes:ro}=ue,{config:oo={}}=ue,io,ao;window.routify=window.routify||{},window.routify.inBrowser=!window.navigator.userAgent.match("jsdom"),Object.assign(defaultConfig$1,oo),setContext("routifyupdatepage",(...po)=>ao&&ao.updatePage(...po));const lo=po=>eo(0,io=po),co=()=>{ao&&(ao.destroy(),ao=null)};let uo=null;const fo=()=>{clearTimeout(uo),uo=setTimeout(()=>{co(),ao=init$2(ro,lo),routes$1.set(ro),ao.updatePage()})};return onDestroy(co),to.$$set=po=>{"routes"in po&&eo(2,ro=po.routes),"config"in po&&eo(3,oo=po.config)},to.$$.update=()=>{to.$$.dirty&4&&ro&&fo()},[io,no,ro,oo]}class Router extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bV,create_fragment$bY,safe_not_equal,{routes:2,config:3})}}function createNodeMiddleware(to){const ue=async function(no){return await nodeMiddleware(to,{file:no.tree,state:{treePayload:no},scope:{}})};return ue.sync=function(no){return nodeMiddlewareSync(to,{file:no.tree,state:{treePayload:no},scope:{}})},ue}async function nodeMiddleware(to,ue){const eo=await to(ue);if(eo===!1)return!1;const no=eo||ue.file;if(no.children){const ro=await Promise.all(no.children.map(async oo=>nodeMiddleware(to,{state:ue.state,scope:clone$4(ue.scope||{}),parent:ue.file,file:await oo})));no.children=ro.filter(Boolean)}return no}function nodeMiddlewareSync(to,ue){const eo=to(ue);if(eo===!1)return!1;const no=eo||ue.file;if(no.children){const ro=no.children.map(oo=>nodeMiddlewareSync(to,{state:ue.state,scope:clone$4(ue.scope||{}),parent:ue.file,file:oo}));no.children=ro.filter(Boolean)}return no}function clone$4(to){return JSON.parse(JSON.stringify(to))}const setRegex=createNodeMiddleware(({file:to})=>{(to.isPage||to.isFallback)&&(to.regex=pathToRegex(to.path,to.isFallback))}),setParamKeys=createNodeMiddleware(({file:to})=>{to.paramKeys=pathToParamKeys(to.path)}),setShortPath=createNodeMiddleware(({file:to})=>{to.isFallback||to.isIndex?to.shortPath=to.path.replace(/\/[^/]+$/,""):to.shortPath=to.path}),setRank=createNodeMiddleware(({file:to})=>{to.ranking=pathToRank(to)}),addMetaChildren=createNodeMiddleware(({file:to})=>{const ue=to,eo=to.meta&&to.meta.children||[];eo.length&&(ue.children=ue.children||[],ue.children.push(...eo.map(no=>({isMeta:!0,...no,meta:no}))))}),setIsIndexable=createNodeMiddleware(to=>{const{file:ue}=to,{isFallback:eo,meta:no}=ue,ro=ue.path.split("/").pop().startsWith(":"),oo=ue.path.endsWith("/index"),io=no.index||no.index===0,ao=no.index===!1;ue.isIndexable=io||!eo&&!ro&&!oo&&!ao,ue.isNonIndexable=!ue.isIndexable}),assignRelations=createNodeMiddleware(({file:to,parent:ue})=>{Object.defineProperty(to,"parent",{get:()=>ue}),Object.defineProperty(to,"nextSibling",{get:()=>_getSibling(to,1)}),Object.defineProperty(to,"prevSibling",{get:()=>_getSibling(to,-1)}),Object.defineProperty(to,"lineage",{get:()=>_getLineage(ue)})});function _getLineage(to,ue=[]){return to&&(ue.unshift(to),_getLineage(to.parent,ue)),ue}function _getSibling(to,ue){if(!to.root){const eo=to.parent.children.filter(ro=>ro.isIndexable),no=eo.indexOf(to);return eo[no+ue]}}const assignIndex=createNodeMiddleware(({file:to,parent:ue})=>{to.isIndex&&Object.defineProperty(ue,"index",{get:()=>to})}),assignLayout=createNodeMiddleware(({file:to,scope:ue})=>{Object.defineProperty(to,"layouts",{get:()=>eo(to)});function eo(no){if(!no.isLayout&&no.meta.reset)return[];const{parent:ro}=no,oo=ro&&ro.component&&ro,io=oo&&(oo.isReset||oo.meta.reset),ao=ro&&!io&&eo(ro)||[];return oo&&ao.push(oo),ao}}),createFlatList=to=>{createNodeMiddleware(ue=>{(ue.file.isPage||ue.file.isFallback)&&ue.state.treePayload.routes.push(ue.file)}).sync(to),to.routes.sort((ue,eo)=>ue.ranking>=eo.ranking?-1:1)},setPrototype=createNodeMiddleware(({file:to})=>{const ue=to.root?so:to.children?to.isPage?io:no:to.isReset?ao:to.isLayout?eo:to.isFallback?ro:oo;Object.setPrototypeOf(to,ue.prototype);function eo(){}function no(){}function ro(){}function oo(){}function io(){}function ao(){}function so(){}}),miscPlugins=Object.freeze(Object.defineProperty({__proto__:null,addMetaChildren,assignIndex,assignLayout,assignRelations,createFlatList,setIsIndexable,setParamKeys,setPrototype,setRank,setRegex,setShortPath},Symbol.toStringTag,{value:"Module"})),defaultNode={isDir:!1,ext:"svelte",isLayout:!1,isReset:!1,isIndex:!1,isFallback:!1,isPage:!1,ownMeta:{},meta:{recursive:!0,preload:!1,prerender:!0},id:"__fallback"};function restoreDefaults(to){return Object.entries(defaultNode).forEach(([ue,eo])=>{typeof to[ue]>"u"&&(to[ue]=eo)}),to.children&&(to.children=to.children.map(restoreDefaults)),to}const assignAPI=createNodeMiddleware(({file:to})=>{to.api=new ClientApi(to)});class ClientApi{constructor(ue){this.__file=ue,Object.defineProperty(this,"__file",{enumerable:!1}),this.isMeta=!!ue.isMeta,this.path=ue.path,this.title=_prettyName(ue),this.meta=ue.meta}get parent(){return!this.__file.root&&this.__file.parent.api}get children(){return(this.__file.children||this.__file.isLayout&&this.__file.parent.children||[]).filter(ue=>!ue.isNonIndexable).sort((ue,eo)=>ue.isMeta&&eo.isMeta?0:(ue=(ue.meta.index||ue.meta.title||ue.path).toString(),eo=(eo.meta.index||eo.meta.title||eo.path).toString(),ue.localeCompare(eo,void 0,{numeric:!0,sensitivity:"base"}))).map(({api:ue})=>ue)}get next(){return _navigate(this,1)}get prev(){return _navigate(this,-1)}async preload(){const ue=[...this.__file.layouts,this.__file,this.index&&this.index.__file].filter(Boolean).map(eo=>eo.component());await Promise.all(ue)}get component(){return this.__file.component?this.__file.component():this.__file.index?this.__file.index.component():!1}get componentWithIndex(){return new Promise(ue=>Promise.all([this.component,this.index&&this.index.component]).then(eo=>ue(eo)))}get index(){const ue=this.__file.children&&this.__file.children.find(eo=>eo.isIndex);return ue&&ue.api}}function _navigate(to,ue){if(!to.__file.root){const no=to.parent.children.indexOf(to);return to.parent.children[no+ue]}}function _prettyName(to){return typeof to.meta.title<"u"?to.meta.title:(to.shortPath||to.path).split("/").pop().replace(/-/g," ")}const plugins$2={...miscPlugins,restoreDefaults:({tree:to})=>restoreDefaults(to),assignAPI};function buildClientTree(to){const ue=["restoreDefaults","setParamKeys","setRegex","setShortPath","setRank","assignLayout","setPrototype","addMetaChildren","assignRelations","setIsIndexable","assignIndex","assignAPI","createFlatList"],eo={tree:to,routes:[]};for(let no of ue)(plugins$2[no].sync||plugins$2[no])(eo);return eo}const routify$1=Object.freeze(Object.defineProperty({__proto__:null,Route,Router,afterPageLoad,beforeUrlChange,buildClientTree,components:components$1,context,focus,getConcestor,getDirection:getDirection$1,goto,isActive,isAncestor,isChangingPage,layout:layout$2,leftover,makeUrlHelper,meta:meta$2,metatags,node:node$2,nodes,page,params,precache,prefetch,prefetchPath,ready,redirect,rootContext,route,routes:routes$1,url:url$3,urlRoute},Symbol.toStringTag,{value:"Module"})),bbui="",indexVars$F="",indexVars$E="";function create_fragment$bX(to){let ue,eo;const no=to[3].default,ro=create_slot(no,to,to[2],null);return{c(){ue=element("div"),ro&&ro.c()},m(oo,io){insert$1(oo,ue,io),ro&&ro.m(ue,null),to[4](ue),eo=!0},p(oo,[io]){ro&&ro.p&&(!eo||io&4)&&update_slot_base(ro,no,oo,oo[2],eo?get_slot_changes(no,oo[2],io,null):get_all_dirty_from_scope(oo[2]),null)},i(oo){eo||(transition_in(ro,oo),eo=!0)},o(oo){transition_out(ro,oo),eo=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo),to[4](null)}}}function instance$bU(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{target:oo=document.body}=ue,io,ao,so;onMount(()=>{if(typeof oo=="string"){if(io=document.querySelector(oo),io===null)return()=>{}}else if(oo instanceof HTMLElement)io=oo;else throw new TypeError(`Unknown target type: ${typeof oo}. Allowed types: String (CSS selector), HTMLElement.`);return ao=document.createElement("div"),io.appendChild(ao),ao.appendChild(so),()=>{io.removeChild(ao)}});function lo(co){binding_callbacks[co?"unshift":"push"](()=>{so=co,eo(0,so)})}return to.$$set=co=>{"target"in co&&eo(1,oo=co.target),"$$scope"in co&&eo(2,ro=co.$$scope)},[so,oo,ro,no,lo]}let Portal$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bU,create_fragment$bX,safe_not_equal,{target:1})}};function cubicOut(to){const ue=to-1;return ue*ue*ue+1}function fade(to,{delay:ue=0,duration:eo=400,easing:no=identity$6}={}){const ro=+getComputedStyle(to).opacity;return{delay:ue,duration:eo,easing:no,css:oo=>`opacity: ${oo*ro}`}}function fly(to,{delay:ue=0,duration:eo=400,easing:no=cubicOut,x:ro=0,y:oo=0,opacity:io=0}={}){const ao=getComputedStyle(to),so=+ao.opacity,lo=ao.transform==="none"?"":ao.transform,co=so*(1-io),[uo,fo]=split_css_unit(ro),[po,ho]=split_css_unit(oo);return{delay:ue,duration:eo,easing:no,css:(_o,go)=>`
|
|
5
5
|
transform: ${lo} translate(${(1-_o)*uo}${fo}, ${(1-_o)*po}${ho});
|
|
6
|
-
opacity: ${so-co*go}`}}function slide(to,{delay:ue=0,duration:eo=400,easing:no=cubicOut,axis:ro="y"}={}){const oo=getComputedStyle(to),io=+oo.opacity,ao=ro==="y"?"height":"width",so=parseFloat(oo[ao]),lo=ro==="y"?["top","bottom"]:["left","right"],co=lo.map(bo=>`${bo[0].toUpperCase()}${bo.slice(1)}`),uo=parseFloat(oo[`padding${co[0]}`]),fo=parseFloat(oo[`padding${co[1]}`]),po=parseFloat(oo[`margin${co[0]}`]),ho=parseFloat(oo[`margin${co[1]}`]),_o=parseFloat(oo[`border${co[0]}Width`]),go=parseFloat(oo[`border${co[1]}Width`]);return{delay:ue,duration:eo,easing:no,css:bo=>`overflow: hidden;opacity: ${Math.min(bo*20,1)*io};${ao}: ${bo*so}px;padding-${lo[0]}: ${bo*uo}px;padding-${lo[1]}: ${bo*fo}px;margin-${lo[0]}: ${bo*po}px;margin-${lo[1]}: ${bo*ho}px;border-${lo[0]}-width: ${bo*_o}px;border-${lo[1]}-width: ${bo*go}px;`}}const indexVars$D="",AbsTooltip_svelte_svelte_type_style_lang="";function create_if_block$5x(to){let ue,eo;return ue=new Portal$1({props:{target:".spectrum",$$slots:{default:[create_default_slot$73]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&132815&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$73(to){let ue,eo,no,ro,oo,io,ao,so,lo;return{c(){ue=element("span"),eo=element("span"),no=text$1(to[2]),ro=space$1(),oo=element("span"),attr(eo,"class","spectrum-Tooltip-label svelte-9a74k9"),attr(oo,"class","spectrum-Tooltip-tip svelte-9a74k9"),attr(oo,"style",to[9]),attr(ue,"class",io="spectrum-Tooltip spectrum-Tooltip--"+to[1]+" spectrum-Tooltip--"+to[0]+" is-open svelte-9a74k9"),attr(ue,"style",ao=`left:${to[6]}px;top:${to[7]}px;${to[10]}`),toggle_class(ue,"noWrap",to[3])},m(co,uo){insert$1(co,ue,uo),append$2(ue,eo),append$2(eo,no),append$2(ue,ro),append$2(ue,oo),lo=!0},p(co,uo){(!lo||uo&4)&&set_data(no,co[2]),(!lo||uo&512)&&attr(oo,"style",co[9]),(!lo||uo&3&&io!==(io="spectrum-Tooltip spectrum-Tooltip--"+co[1]+" spectrum-Tooltip--"+co[0]+" is-open svelte-9a74k9"))&&attr(ue,"class",io),(!lo||uo&1216&&ao!==(ao=`left:${co[6]}px;top:${co[7]}px;${co[10]}`))&&attr(ue,"style",ao),(!lo||uo&11)&&toggle_class(ue,"noWrap",co[3])},i(co){lo||(co&&add_render_callback(()=>{lo&&(so||(so=create_bidirectional_transition(ue,fade,{duration:130},!0)),so.run(1))}),lo=!0)},o(co){co&&(so||(so=create_bidirectional_transition(ue,fade,{duration:130},!1)),so.run(0)),lo=!1},d(co){co&&detach(ue),co&&so&&so.end()}}}function create_fragment$bW(to){let ue,eo,no,ro,oo,io;const ao=to[13].default,so=create_slot(ao,to,to[17],null);let lo=to[8]&&to[2]&&to[6]!=null&&to[7]!=null&&create_if_block$5x(to);return{c(){ue=element("div"),so&&so.c(),eo=space$1(),lo&&lo.c(),no=empty$2(),attr(ue,"class","abs-tooltip svelte-9a74k9")},m(co,uo){insert$1(co,ue,uo),so&&so.m(ue,null),to[14](ue),insert$1(co,eo,uo),lo&&lo.m(co,uo),insert$1(co,no,uo),ro=!0,oo||(io=[listen(ue,"focus",null),listen(ue,"mouseover",to[15]),listen(ue,"mouseleave",to[16])],oo=!0)},p(co,[uo]){so&&so.p&&(!ro||uo&131072)&&update_slot_base(so,ao,co,co[17],ro?get_slot_changes(ao,co[17],uo,null):get_all_dirty_from_scope(co[17]),null),co[8]&&co[2]&&co[6]!=null&&co[7]!=null?lo?(lo.p(co,uo),uo&452&&transition_in(lo,1)):(lo=create_if_block$5x(co),lo.c(),transition_in(lo,1),lo.m(no.parentNode,no)):lo&&(group_outros(),transition_out(lo,1,1,()=>{lo=null}),check_outros())},i(co){ro||(transition_in(so,co),transition_in(lo),ro=!0)},o(co){transition_out(so,co),transition_out(lo),ro=!1},d(co){co&&(detach(ue),detach(eo),detach(no)),so&&so.d(co),to[14](null),lo&&lo.d(co),oo=!1,run_all(io)}}}const TooltipPosition={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},TooltipType={Default:"default",Info:"info",Positive:"positive",Negative:"negative"};function instance$bT(to,ue,eo){let no,ro,{$$slots:oo={},$$scope:io}=ue,{position:ao=TooltipPosition.Top}=ue,{type:so=TooltipType.Default}=ue,{text:lo=""}=ue,{fixed:co=!1}=ue,{color:uo=""}=ue,{noWrap:fo=!1}=ue,po,ho=!1,_o,go,bo=!1,vo,yo;const wo=()=>{var Vo;const To=(Vo=po==null?void 0:po.children)==null?void 0:Vo[0];if(!To){eo(6,_o=null),eo(7,go=null);return}const Mo=To.getBoundingClientRect();ao===TooltipPosition.Top?(eo(6,_o=Mo.left+Mo.width/2),eo(7,go=Mo.top)):ao===TooltipPosition.Right?(eo(6,_o=Mo.left+Mo.width),eo(7,go=Mo.top+Mo.height/2)):ao===TooltipPosition.Bottom?(eo(6,_o=Mo.left+Mo.width/2),eo(7,go=Mo.top+Mo.height)):ao===TooltipPosition.Left&&(eo(6,_o=Mo.left),eo(7,go=Mo.top+Mo.height/2))},ko=()=>{wo(),yo=setInterval(wo,100),eo(8,bo=!0)},So=()=>{clearTimeout(vo),clearInterval(yo),eo(8,bo=!1)};onDestroy(So);function Ao(To){binding_callbacks[To?"unshift":"push"](()=>{po=To,eo(5,po)})}const Io=()=>eo(4,ho=!0),Eo=()=>eo(4,ho=!1);return to.$$set=To=>{"position"in To&&eo(0,ao=To.position),"type"in To&&eo(1,so=To.type),"text"in To&&eo(2,lo=To.text),"fixed"in To&&eo(11,co=To.fixed),"color"in To&&eo(12,uo=To.color),"noWrap"in To&&eo(3,fo=To.noWrap),"$$scope"in To&&eo(17,io=To.$$scope)},to.$$.update=()=>{to.$$.dirty&2064&&(ho||co?vo=setTimeout(ko,200):So()),to.$$.dirty&4096&&eo(10,no=uo?`background:${uo};`:null),to.$$.dirty&4096&&eo(9,ro=uo?`border-top-color:${uo};`:null)},[ao,so,lo,fo,ho,po,_o,go,bo,ro,no,co,uo,oo,Ao,Io,Eo,io]}class AbsTooltip extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bT,create_fragment$bW,safe_not_equal,{position:0,type:1,text:2,fixed:11,color:12,noWrap:3})}}const Icon_svelte_svelte_type_style_lang="";function create_default_slot$72(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=svg_element("svg"),no=svg_element("use"),set_style(no,"pointer-events","none"),xlink_attr(no,"xlink:href",ro="#spectrum-icon-18-"+to[0]),attr(eo,"class",oo="spectrum-Icon spectrum-Icon--size"+to[2]+" svelte-10h2gx"),attr(eo,"focusable","false"),attr(eo,"aria-hidden",to[1]),attr(eo,"aria-label",to[0]),attr(eo,"style",io=`${to[5]?`color: ${to[5]};`:""} ${to[6]?`--hover-color: ${to[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`),toggle_class(eo,"hoverable",to[3]),toggle_class(eo,"disabled",to[4]),attr(ue,"class","icon svelte-10h2gx"),toggle_class(ue,"newStyles",to[12])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),append$2(eo,no),ao||(so=[listen(eo,"contextmenu",to[13]),listen(eo,"click",to[14])],ao=!0)},p(lo,co){co&1&&ro!==(ro="#spectrum-icon-18-"+lo[0])&&xlink_attr(no,"xlink:href",ro),co&4&&oo!==(oo="spectrum-Icon spectrum-Icon--size"+lo[2]+" svelte-10h2gx")&&attr(eo,"class",oo),co&2&&attr(eo,"aria-hidden",lo[1]),co&1&&attr(eo,"aria-label",lo[0]),co&96&&io!==(io=`${lo[5]?`color: ${lo[5]};`:""} ${lo[6]?`--hover-color: ${lo[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`)&&attr(eo,"style",io),co&12&&toggle_class(eo,"hoverable",lo[3]),co&20&&toggle_class(eo,"disabled",lo[4]),co&4096&&toggle_class(ue,"newStyles",lo[12])},d(lo){lo&&detach(ue),ao=!1,run_all(so)}}}function create_fragment$bV(to){let ue,eo;return ue=new AbsTooltip({props:{text:to[7],type:to[9],position:to[8],color:to[10],noWrap:to[11],$$slots:{default:[create_default_slot$72]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&128&&(oo.text=no[7]),ro&512&&(oo.type=no[9]),ro&256&&(oo.position=no[8]),ro&1024&&(oo.color=no[10]),ro&2048&&(oo.noWrap=no[11]),ro&36991&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bS(to,ue,eo){let{name:no="Add"}=ue,{hidden:ro=!1}=ue,{size:oo="M"}=ue,{hoverable:io=!1}=ue,{disabled:ao=!1}=ue,{color:so=void 0}=ue,{hoverColor:lo=void 0}=ue,{tooltip:co=void 0}=ue,{tooltipPosition:uo=TooltipPosition.Bottom}=ue,{tooltipType:fo=TooltipType.Default}=ue,{tooltipColor:po=void 0}=ue,{tooltipWrap:ho=!0}=ue,{newStyles:_o=!1}=ue;function go(vo){bubble.call(this,to,vo)}function bo(vo){bubble.call(this,to,vo)}return to.$$set=vo=>{"name"in vo&&eo(0,no=vo.name),"hidden"in vo&&eo(1,ro=vo.hidden),"size"in vo&&eo(2,oo=vo.size),"hoverable"in vo&&eo(3,io=vo.hoverable),"disabled"in vo&&eo(4,ao=vo.disabled),"color"in vo&&eo(5,so=vo.color),"hoverColor"in vo&&eo(6,lo=vo.hoverColor),"tooltip"in vo&&eo(7,co=vo.tooltip),"tooltipPosition"in vo&&eo(8,uo=vo.tooltipPosition),"tooltipType"in vo&&eo(9,fo=vo.tooltipType),"tooltipColor"in vo&&eo(10,po=vo.tooltipColor),"tooltipWrap"in vo&&eo(11,ho=vo.tooltipWrap),"newStyles"in vo&&eo(12,_o=vo.newStyles)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo]}class Icon extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bS,create_fragment$bV,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$5w(to){let ue,eo,no;return eo=new AbsTooltip({props:{text:to[0],$$slots:{default:[create_default_slot$71]},$$scope:{ctx:to}}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","icon-container svelte-19tap7e")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo&1&&(io.text=ro[0]),oo&38&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot$71(to){let ue,eo,no,ro,oo;return eo=new Icon({props:{name:"InfoOutline",size:"S",disabled:to[2],hoverable:!0}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","icon svelte-19tap7e"),toggle_class(ue,"icon-small",to[1]==="M"||to[1]==="S")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),no=!0,ro||(oo=listen(ue,"focus",to[4]),ro=!0)},p(io,ao){const so={};ao&4&&(so.disabled=io[2]),eo.$set(so),(!no||ao&2)&&toggle_class(ue,"icon-small",io[1]==="M"||io[1]==="S")},i(io){no||(transition_in(eo.$$.fragment,io),no=!0)},o(io){transition_out(eo.$$.fragment,io),no=!1},d(io){io&&detach(ue),destroy_component(eo),ro=!1,oo()}}}function create_fragment$bU(to){let ue,eo,no;const ro=to[3].default,oo=create_slot(ro,to,to[5],null);let io=to[0]&&create_if_block$5w(to);return{c(){ue=element("div"),oo&&oo.c(),eo=space$1(),io&&io.c(),attr(ue,"class","svelte-19tap7e"),toggle_class(ue,"container",!!to[0])},m(ao,so){insert$1(ao,ue,so),oo&&oo.m(ue,null),append$2(ue,eo),io&&io.m(ue,null),no=!0},p(ao,[so]){oo&&oo.p&&(!no||so&32)&&update_slot_base(oo,ro,ao,ao[5],no?get_slot_changes(ro,ao[5],so,null):get_all_dirty_from_scope(ao[5]),null),ao[0]?io?(io.p(ao,so),so&1&&transition_in(io,1)):(io=create_if_block$5w(ao),io.c(),transition_in(io,1),io.m(ue,null)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros()),(!no||so&1)&&toggle_class(ue,"container",!!ao[0])},i(ao){no||(transition_in(oo,ao),transition_in(io),no=!0)},o(ao){transition_out(oo,ao),transition_out(io),no=!1},d(ao){ao&&detach(ue),oo&&oo.d(ao),io&&io.d()}}}function instance$bR(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{tooltip:oo=""}=ue,{size:io="M"}=ue,{disabled:ao=!0}=ue;function so(lo){bubble.call(this,to,lo)}return to.$$set=lo=>{"tooltip"in lo&&eo(0,oo=lo.tooltip),"size"in lo&&eo(1,io=lo.size),"disabled"in lo&&eo(2,ao=lo.disabled),"$$scope"in lo&&eo(5,ro=lo.$$scope)},[oo,io,ao,no,so,ro]}class TooltipWrapper extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bR,create_fragment$bU,safe_not_equal,{tooltip:0,size:1,disabled:2})}}const FieldLabel_svelte_svelte_type_style_lang="";function create_default_slot$70(to){let ue,eo=(to[1]||"")+"",no,ro;return{c(){ue=element("label"),no=text$1(eo),attr(ue,"for",to[0]),attr(ue,"class",ro=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${to[3]}`)+" svelte-dqoj9e")},m(oo,io){insert$1(oo,ue,io),append$2(ue,no)},p(oo,io){io&2&&eo!==(eo=(oo[1]||"")+"")&&set_data(no,eo),io&1&&attr(ue,"for",oo[0]),io&8&&ro!==(ro=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${oo[3]}`)+" svelte-dqoj9e")&&attr(ue,"class",ro)},d(oo){oo&&detach(ue)}}}function create_fragment$bT(to){let ue,eo;return ue=new TooltipWrapper({props:{tooltip:to[2],size:"S",$$slots:{default:[create_default_slot$70]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4&&(oo.tooltip=no[2]),ro&43&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bQ(to,ue,eo){let no,{forId:ro}=ue,{label:oo}=ue,{position:io="above"}=ue,{tooltip:ao=""}=ue;return to.$$set=so=>{"forId"in so&&eo(0,ro=so.forId),"label"in so&&eo(1,oo=so.label),"position"in so&&eo(4,io=so.position),"tooltip"in so&&eo(2,ao=so.tooltip)},to.$$.update=()=>{to.$$.dirty&16&&eo(3,no=io==="above"?"":`spectrum-FieldLabel--${io}`)},[ro,oo,ao,no,io]}class FieldLabel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bQ,create_fragment$bT,safe_not_equal,{forId:0,label:1,position:4,tooltip:2})}}const Field_svelte_svelte_type_style_lang="";function create_if_block_2$1R(to){let ue,eo;return ue=new FieldLabel({props:{forId:to[0],label:to[1],position:to[2],tooltip:to[5]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.forId=no[0]),ro&2&&(oo.label=no[1]),ro&4&&(oo.position=no[2]),ro&32&&(oo.tooltip=no[5]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$30(to){let ue,eo,no,ro,oo,io;return eo=new Icon({props:{name:"HelpOutline"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),ro=element("span"),oo=text$1(to[4]),attr(ro,"class","svelte-e52e9j"),attr(ue,"class","helpText svelte-e52e9j")},m(ao,so){insert$1(ao,ue,so),mount_component(eo,ue,null),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),io=!0},p(ao,so){(!io||so&16)&&set_data(oo,ao[4])},i(ao){io||(transition_in(eo.$$.fragment,ao),io=!0)},o(ao){transition_out(eo.$$.fragment,ao),io=!1},d(ao){ao&&detach(ue),destroy_component(eo)}}}function create_if_block$5v(to){let ue,eo;return{c(){ue=element("div"),eo=text$1(to[3]),attr(ue,"class","error svelte-e52e9j")},m(no,ro){insert$1(no,ue,ro),append$2(ue,eo)},p(no,ro){ro&8&&set_data(eo,no[3])},i:noop$6,o:noop$6,d(no){no&&detach(ue)}}}function create_fragment$bS(to){let ue,eo,no,ro,oo,io,ao,so=to[1]&&create_if_block_2$1R(to);const lo=to[7].default,co=create_slot(lo,to,to[6],null),uo=[create_if_block$5v,create_if_block_1$30],fo=[];function po(ho,_o){return ho[3]?0:ho[4]?1:-1}return~(oo=po(to))&&(io=fo[oo]=uo[oo](to)),{c(){ue=element("div"),so&&so.c(),eo=space$1(),no=element("div"),co&&co.c(),ro=space$1(),io&&io.c(),attr(no,"class","spectrum-Form-itemField svelte-e52e9j"),attr(ue,"class","spectrum-Form-item svelte-e52e9j"),toggle_class(ue,"above",to[2]==="above")},m(ho,_o){insert$1(ho,ue,_o),so&&so.m(ue,null),append$2(ue,eo),append$2(ue,no),co&&co.m(no,null),append$2(no,ro),~oo&&fo[oo].m(no,null),ao=!0},p(ho,[_o]){ho[1]?so?(so.p(ho,_o),_o&2&&transition_in(so,1)):(so=create_if_block_2$1R(ho),so.c(),transition_in(so,1),so.m(ue,eo)):so&&(group_outros(),transition_out(so,1,1,()=>{so=null}),check_outros()),co&&co.p&&(!ao||_o&64)&&update_slot_base(co,lo,ho,ho[6],ao?get_slot_changes(lo,ho[6],_o,null):get_all_dirty_from_scope(ho[6]),null);let go=oo;oo=po(ho),oo===go?~oo&&fo[oo].p(ho,_o):(io&&(group_outros(),transition_out(fo[go],1,1,()=>{fo[go]=null}),check_outros()),~oo?(io=fo[oo],io?io.p(ho,_o):(io=fo[oo]=uo[oo](ho),io.c()),transition_in(io,1),io.m(no,null)):io=null),(!ao||_o&4)&&toggle_class(ue,"above",ho[2]==="above")},i(ho){ao||(transition_in(so),transition_in(co,ho),transition_in(io),ao=!0)},o(ho){transition_out(so),transition_out(co,ho),transition_out(io),ao=!1},d(ho){ho&&detach(ue),so&&so.d(),co&&co.d(ho),~oo&&fo[oo].d()}}}function instance$bP(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{id:oo=null}=ue,{label:io=null}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{helpText:lo=null}=ue,{tooltip:co=""}=ue;return to.$$set=uo=>{"id"in uo&&eo(0,oo=uo.id),"label"in uo&&eo(1,io=uo.label),"labelPosition"in uo&&eo(2,ao=uo.labelPosition),"error"in uo&&eo(3,so=uo.error),"helpText"in uo&&eo(4,lo=uo.helpText),"tooltip"in uo&&eo(5,co=uo.tooltip),"$$scope"in uo&&eo(6,ro=uo.$$scope)},[oo,io,ao,so,lo,co,ro,no]}class Field extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bP,create_fragment$bS,safe_not_equal,{id:0,label:1,labelPosition:2,error:3,helpText:4,tooltip:5})}}const indexVars$C="",TextField_svelte_svelte_type_style_lang="";function create_fragment$bR(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=element("input"),eo.disabled=to[3],eo.readOnly=to[5],attr(eo,"id",to[4]),eo.value=no=to[0]??"",attr(eo,"placeholder",ro=to[1]??""),attr(eo,"type",to[2]),attr(eo,"class","spectrum-Textfield-input svelte-1pznijr"),attr(eo,"style",oo=to[7]?`text-align: ${to[7]};`:""),attr(eo,"inputmode",io=to[15](to[2])),attr(eo,"autocomplete",to[8]),attr(ue,"class","spectrum-Textfield svelte-1pznijr"),toggle_class(ue,"spectrum-Textfield--quiet",to[6]),toggle_class(ue,"is-disabled",to[3]),toggle_class(ue,"is-focused",to[10])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),to[23](eo),ao||(so=[listen(eo,"click",to[18]),listen(eo,"blur",to[19]),listen(eo,"focus",to[20]),listen(eo,"input",to[21]),listen(eo,"keyup",to[22]),listen(eo,"blur",to[12]),listen(eo,"focus",to[11]),listen(eo,"input",to[13]),listen(eo,"keyup",to[14])],ao=!0)},p(lo,[co]){co&8&&(eo.disabled=lo[3]),co&32&&(eo.readOnly=lo[5]),co&16&&attr(eo,"id",lo[4]),co&1&&no!==(no=lo[0]??"")&&eo.value!==no&&(eo.value=no),co&2&&ro!==(ro=lo[1]??"")&&attr(eo,"placeholder",ro),co&4&&attr(eo,"type",lo[2]),co&128&&oo!==(oo=lo[7]?`text-align: ${lo[7]};`:"")&&attr(eo,"style",oo),co&4&&io!==(io=lo[15](lo[2]))&&attr(eo,"inputmode",io),co&256&&attr(eo,"autocomplete",lo[8]),co&64&&toggle_class(ue,"spectrum-Textfield--quiet",lo[6]),co&8&&toggle_class(ue,"is-disabled",lo[3]),co&1024&&toggle_class(ue,"is-focused",lo[10])},i:noop$6,o:noop$6,d(lo){lo&&detach(ue),to[23](null),ao=!1,run_all(so)}}}function instance$bO(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{type:oo="text"}=ue,{disabled:io=!1}=ue,{id:ao=null}=ue,{readonly:so=!1}=ue,{updateOnChange:lo=!0}=ue,{quiet:co=!1}=ue,{align:uo}=ue,{autofocus:fo=!1}=ue,{autocomplete:po=null}=ue;const ho=createEventDispatcher();let _o,go=!1;const bo=Fo=>{if(!(so||io)){if(oo==="number"){const Po=parseFloat(Fo);Fo=isNaN(Po)?null:Po}ho("change",Fo)}},vo=()=>{so||io||eo(10,go=!0)},yo=Fo=>{so||io||(eo(10,go=!1),bo(Fo.target.value))},wo=Fo=>{so||!lo||io||bo(Fo.target.value)},ko=Fo=>{so||io||Fo.key==="Enter"&&bo(Fo.target.value)},So=Fo=>Fo==="bigint"?"numeric":Fo==="number"?"decimal":"text";onMount(async()=>{io||(eo(10,go=fo),go&&(await tick(),_o.focus()))});function Ao(Fo){bubble.call(this,to,Fo)}function Io(Fo){bubble.call(this,to,Fo)}function Eo(Fo){bubble.call(this,to,Fo)}function To(Fo){bubble.call(this,to,Fo)}function Mo(Fo){bubble.call(this,to,Fo)}function Vo(Fo){binding_callbacks[Fo?"unshift":"push"](()=>{_o=Fo,eo(9,_o)})}return to.$$set=Fo=>{"value"in Fo&&eo(0,no=Fo.value),"placeholder"in Fo&&eo(1,ro=Fo.placeholder),"type"in Fo&&eo(2,oo=Fo.type),"disabled"in Fo&&eo(3,io=Fo.disabled),"id"in Fo&&eo(4,ao=Fo.id),"readonly"in Fo&&eo(5,so=Fo.readonly),"updateOnChange"in Fo&&eo(16,lo=Fo.updateOnChange),"quiet"in Fo&&eo(6,co=Fo.quiet),"align"in Fo&&eo(7,uo=Fo.align),"autofocus"in Fo&&eo(17,fo=Fo.autofocus),"autocomplete"in Fo&&eo(8,po=Fo.autocomplete)},[no,ro,oo,io,ao,so,co,uo,po,_o,go,vo,yo,wo,ko,So,lo,fo,Ao,Io,Eo,To,Mo,Vo]}class TextField extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bO,create_fragment$bR,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$6$(to){let ue,eo;return ue=new TextField({props:{updateOnChange:to[8],error:to[7],disabled:to[5],readonly:to[6],value:to[0],placeholder:to[3],type:to[4],quiet:to[9],autofocus:to[10],autocomplete:to[11]}}),ue.$on("change",to[13]),ue.$on("click",to[14]),ue.$on("input",to[15]),ue.$on("blur",to[16]),ue.$on("focus",to[17]),ue.$on("keyup",to[18]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.updateOnChange=no[8]),ro&128&&(oo.error=no[7]),ro&32&&(oo.disabled=no[5]),ro&64&&(oo.readonly=no[6]),ro&1&&(oo.value=no[0]),ro&8&&(oo.placeholder=no[3]),ro&16&&(oo.type=no[4]),ro&512&&(oo.quiet=no[9]),ro&1024&&(oo.autofocus=no[10]),ro&2048&&(oo.autocomplete=no[11]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bQ(to){let ue,eo;return ue=new Field({props:{helpText:to[12],label:to[1],labelPosition:to[2],error:to[7],$$slots:{default:[create_default_slot$6$]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4096&&(oo.helpText=no[12]),ro&2&&(oo.label=no[1]),ro&4&&(oo.labelPosition=no[2]),ro&128&&(oo.error=no[7]),ro&1052665&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bN(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{type:ao="text"}=ue,{disabled:so=!1}=ue,{readonly:lo=!1}=ue,{error:co=null}=ue,{updateOnChange:uo=!0}=ue,{quiet:fo=!1}=ue,{autofocus:po}=ue,{autocomplete:ho}=ue,{helpText:_o=null}=ue;const go=createEventDispatcher(),bo=Ao=>{eo(0,no=Ao.detail),go("change",Ao.detail)};function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){bubble.call(this,to,Ao)}function So(Ao){bubble.call(this,to,Ao)}return to.$$set=Ao=>{"value"in Ao&&eo(0,no=Ao.value),"label"in Ao&&eo(1,ro=Ao.label),"labelPosition"in Ao&&eo(2,oo=Ao.labelPosition),"placeholder"in Ao&&eo(3,io=Ao.placeholder),"type"in Ao&&eo(4,ao=Ao.type),"disabled"in Ao&&eo(5,so=Ao.disabled),"readonly"in Ao&&eo(6,lo=Ao.readonly),"error"in Ao&&eo(7,co=Ao.error),"updateOnChange"in Ao&&eo(8,uo=Ao.updateOnChange),"quiet"in Ao&&eo(9,fo=Ao.quiet),"autofocus"in Ao&&eo(10,po=Ao.autofocus),"autocomplete"in Ao&&eo(11,ho=Ao.autocomplete),"helpText"in Ao&&eo(12,_o=Ao.helpText)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So]}let Input$5=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bN,create_fragment$bQ,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$B="",indexVars$A="",Stepper_svelte_svelte_type_style_lang="";function create_fragment$bP(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo;return{c(){ue=element("div"),eo=element("div"),no=element("input"),oo=space$1(),io=element("span"),ao=element("button"),ao.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-ChevronUp75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Chevron75"></use></svg>',so=space$1(),lo=element("button"),lo.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Chevron75"></use></svg>',no.disabled=to[1],no.readOnly=to[3],attr(no,"id",to[2]),attr(no,"placeholder",ro=to[0]||""),attr(no,"type","number"),attr(no,"class","spectrum-Textfield-input spectrum-Stepper-input"),attr(eo,"class","spectrum-Textfield spectrum-Stepper-textfield"),attr(ao,"class","spectrum-ActionButton spectrum-ActionButton--sizeM spectrum-Stepper-stepUp"),attr(ao,"tabindex","-1"),attr(lo,"class","spectrum-ActionButton spectrum-ActionButton--sizeM spectrum-Stepper-stepDown"),attr(lo,"tabindex","-1"),attr(io,"class","spectrum-Stepper-buttons"),attr(ue,"class","spectrum-Stepper svelte-c6q2wy"),toggle_class(ue,"spectrum-Stepper--quiet",to[4]),toggle_class(ue,"is-disabled",to[1]),toggle_class(ue,"is-focused",to[5])},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),append$2(eo,no),set_input_value(no,to[6]),append$2(ue,oo),append$2(ue,io),append$2(io,ao),append$2(io,so),append$2(io,lo),co||(uo=[listen(no,"input",to[23]),listen(no,"click",to[18]),listen(no,"blur",to[19]),listen(no,"focus",to[20]),listen(no,"input",to[21]),listen(no,"keyup",to[22]),listen(no,"blur",to[8]),listen(no,"focus",to[7]),listen(no,"input",to[9]),listen(no,"keyup",to[10]),listen(ao,"click",to[11]),listen(lo,"click",to[12])],co=!0)},p(fo,[po]){po&2&&(no.disabled=fo[1]),po&8&&(no.readOnly=fo[3]),po&4&&attr(no,"id",fo[2]),po&1&&ro!==(ro=fo[0]||"")&&attr(no,"placeholder",ro),po&64&&to_number(no.value)!==fo[6]&&set_input_value(no,fo[6]),po&16&&toggle_class(ue,"spectrum-Stepper--quiet",fo[4]),po&2&&toggle_class(ue,"is-disabled",fo[1]),po&32&&toggle_class(ue,"is-focused",fo[5])},i:noop$6,o:noop$6,d(fo){fo&&detach(ue),co=!1,run_all(uo)}}}function instance$bM(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{disabled:oo=!1}=ue,{id:io=null}=ue,{readonly:ao=!1}=ue,{updateOnChange:so=!0}=ue,{quiet:lo=!1}=ue,{min:co}=ue,{max:uo}=ue,{step:fo}=ue;const po=createEventDispatcher();let ho=!1,_o=no;const go=Fo=>{if(ao)return;const Po=parseFloat(Fo);Fo=isNaN(Po)?null:Po,Fo!=null&&(co!=null&&Fo<co?Fo=co:uo!=null&&Fo>uo&&(Fo=uo)),po("change",Fo),eo(6,_o=Fo)},bo=()=>{ao||eo(5,ho=!0)},vo=Fo=>{ao||(eo(5,ho=!1),go(Fo.target.value))},yo=Fo=>{ao||!so||go(Fo.target.value)},wo=Fo=>{ao||Fo.key==="Enter"&&go(Fo.target.value)},ko=()=>{no==null||isNaN(no)?go(fo):go(no+fo)},So=()=>{no==null||isNaN(no)?go(fo):go(no-fo)};function Ao(Fo){bubble.call(this,to,Fo)}function Io(Fo){bubble.call(this,to,Fo)}function Eo(Fo){bubble.call(this,to,Fo)}function To(Fo){bubble.call(this,to,Fo)}function Mo(Fo){bubble.call(this,to,Fo)}function Vo(){_o=to_number(this.value),eo(6,_o),eo(14,no)}return to.$$set=Fo=>{"value"in Fo&&eo(14,no=Fo.value),"placeholder"in Fo&&eo(0,ro=Fo.placeholder),"disabled"in Fo&&eo(1,oo=Fo.disabled),"id"in Fo&&eo(2,io=Fo.id),"readonly"in Fo&&eo(3,ao=Fo.readonly),"updateOnChange"in Fo&&eo(15,so=Fo.updateOnChange),"quiet"in Fo&&eo(4,lo=Fo.quiet),"min"in Fo&&eo(16,co=Fo.min),"max"in Fo&&eo(17,uo=Fo.max),"step"in Fo&&eo(13,fo=Fo.step)},to.$$.update=()=>{to.$$.dirty&16384&&eo(6,_o=no),to.$$.dirty&8192&&eo(13,fo=fo==null||isNaN(fo)?1:fo)},[ro,oo,io,ao,lo,ho,_o,bo,vo,yo,wo,ko,So,fo,no,so,co,uo,Ao,Io,Eo,To,Mo,Vo]}class Stepper extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bM,create_fragment$bP,safe_not_equal,{value:14,placeholder:0,disabled:1,id:2,readonly:3,updateOnChange:15,quiet:4,min:16,max:17,step:13})}}function create_default_slot$6_(to){let ue,eo;return ue=new Stepper({props:{updateOnChange:to[7],error:to[6],disabled:to[4],readonly:to[5],value:to[0],placeholder:to[3],quiet:to[8],min:to[9],max:to[10],step:to[11]}}),ue.$on("change",to[13]),ue.$on("click",to[14]),ue.$on("input",to[15]),ue.$on("blur",to[16]),ue.$on("focus",to[17]),ue.$on("keyup",to[18]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&128&&(oo.updateOnChange=no[7]),ro&64&&(oo.error=no[6]),ro&16&&(oo.disabled=no[4]),ro&32&&(oo.readonly=no[5]),ro&1&&(oo.value=no[0]),ro&8&&(oo.placeholder=no[3]),ro&256&&(oo.quiet=no[8]),ro&512&&(oo.min=no[9]),ro&1024&&(oo.max=no[10]),ro&2048&&(oo.step=no[11]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bO(to){let ue,eo;return ue=new Field({props:{helpText:to[12],label:to[1],labelPosition:to[2],error:to[6],$$slots:{default:[create_default_slot$6_]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4096&&(oo.helpText=no[12]),ro&2&&(oo.label=no[1]),ro&4&&(oo.labelPosition=no[2]),ro&64&&(oo.error=no[6]),ro&1052665&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bL(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{readonly:so=!1}=ue,{error:lo=null}=ue,{updateOnChange:co=!0}=ue,{quiet:uo=!1}=ue,{min:fo=null}=ue,{max:po=null}=ue,{step:ho=1}=ue,{helpText:_o=null}=ue;const go=createEventDispatcher(),bo=Ao=>{eo(0,no=Ao.detail),go("change",Ao.detail)};function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){bubble.call(this,to,Ao)}function So(Ao){bubble.call(this,to,Ao)}return to.$$set=Ao=>{"value"in Ao&&eo(0,no=Ao.value),"label"in Ao&&eo(1,ro=Ao.label),"labelPosition"in Ao&&eo(2,oo=Ao.labelPosition),"placeholder"in Ao&&eo(3,io=Ao.placeholder),"disabled"in Ao&&eo(4,ao=Ao.disabled),"readonly"in Ao&&eo(5,so=Ao.readonly),"error"in Ao&&eo(6,lo=Ao.error),"updateOnChange"in Ao&&eo(7,co=Ao.updateOnChange),"quiet"in Ao&&eo(8,uo=Ao.quiet),"min"in Ao&&eo(9,fo=Ao.min),"max"in Ao&&eo(10,po=Ao.max),"step"in Ao&&eo(11,ho=Ao.step),"helpText"in Ao&&eo(12,_o=Ao.helpText)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So]}class Stepper_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bL,create_fragment$bO,safe_not_equal,{value:0,label:1,labelPosition:2,placeholder:3,disabled:4,readonly:5,error:6,updateOnChange:7,quiet:8,min:9,max:10,step:11,helpText:12})}}const TextArea_svelte_svelte_type_style_lang="";function create_fragment$bN(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=element("textarea"),attr(eo,"placeholder",no=to[1]||""),attr(eo,"class","spectrum-Textfield-input svelte-1kmb9uq"),attr(eo,"style",ro=to[5]?`text-align: ${to[5]}`:""),eo.disabled=to[2],eo.readOnly=to[3],attr(eo,"id",to[4]),eo.value=oo=to[0]||"",attr(ue,"style",io=`${to[9]}${to[8]}`),attr(ue,"class","spectrum-Textfield spectrum-Textfield--multiline svelte-1kmb9uq"),toggle_class(ue,"is-disabled",to[2]),toggle_class(ue,"is-focused",to[6])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),to[14](eo),ao||(so=[listen(eo,"focus",to[15]),listen(eo,"blur",to[10])],ao=!0)},p(lo,[co]){co&2&&no!==(no=lo[1]||"")&&attr(eo,"placeholder",no),co&32&&ro!==(ro=lo[5]?`text-align: ${lo[5]}`:"")&&attr(eo,"style",ro),co&4&&(eo.disabled=lo[2]),co&8&&(eo.readOnly=lo[3]),co&16&&attr(eo,"id",lo[4]),co&1&&oo!==(oo=lo[0]||"")&&(eo.value=oo),co&768&&io!==(io=`${lo[9]}${lo[8]}`)&&attr(ue,"style",io),co&4&&toggle_class(ue,"is-disabled",lo[2]),co&64&&toggle_class(ue,"is-focused",lo[6])},i:noop$6,o:noop$6,d(lo){lo&&detach(ue),to[14](null),ao=!1,run_all(so)}}}function instance$bK(to,ue,eo){let no,ro,{value:oo=""}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{readonly:so=!1}=ue,{id:lo=null}=ue,{height:co=null}=ue,{minHeight:uo=null}=ue;const fo=()=>({start:_o.selectionStart,end:_o.selectionEnd});let{align:po=null}=ue,ho=!1,_o;const go=createEventDispatcher(),bo=ko=>{go("change",ko.target.value),eo(6,ho=!1)},vo=(ko,So)=>!ko||So==null?"":isNaN(So)?`${ko}:${So};`:`${ko}:${So}px;`;function yo(ko){binding_callbacks[ko?"unshift":"push"](()=>{_o=ko,eo(7,_o)})}const wo=()=>eo(6,ho=!0);return to.$$set=ko=>{"value"in ko&&eo(0,oo=ko.value),"placeholder"in ko&&eo(1,io=ko.placeholder),"disabled"in ko&&eo(2,ao=ko.disabled),"readonly"in ko&&eo(3,so=ko.readonly),"id"in ko&&eo(4,lo=ko.id),"height"in ko&&eo(11,co=ko.height),"minHeight"in ko&&eo(12,uo=ko.minHeight),"align"in ko&&eo(5,po=ko.align)},to.$$.update=()=>{to.$$.dirty&2048&&eo(9,no=vo("height",co)),to.$$.dirty&4096&&eo(8,ro=vo("min-height",uo))},[oo,io,ao,so,lo,po,ho,_o,ro,no,bo,co,uo,fo,yo,wo]}class TextArea extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bK,create_fragment$bN,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]}}function create_default_slot$6Z(to){let ue,eo,no;function ro(io){to[11](io)}let oo={error:to[6],disabled:to[5],value:to[0],placeholder:to[4],height:to[7],minHeight:to[8]};return to[1]!==void 0&&(oo.getCaretPosition=to[1]),ue=new TextArea({props:oo}),binding_callbacks.push(()=>bind$2(ue,"getCaretPosition",ro)),ue.$on("change",to[10]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){const so={};ao&64&&(so.error=io[6]),ao&32&&(so.disabled=io[5]),ao&1&&(so.value=io[0]),ao&16&&(so.placeholder=io[4]),ao&128&&(so.height=io[7]),ao&256&&(so.minHeight=io[8]),!eo&&ao&2&&(eo=!0,so.getCaretPosition=io[1],add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_fragment$bM(to){let ue,eo;return ue=new Field({props:{helpText:to[9],label:to[2],labelPosition:to[3],error:to[6],$$slots:{default:[create_default_slot$6Z]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&512&&(oo.helpText=no[9]),ro&4&&(oo.label=no[2]),ro&8&&(oo.labelPosition=no[3]),ro&64&&(oo.error=no[6]),ro&8691&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bJ(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{error:so=null}=ue,{getCaretPosition:lo=null}=ue,{height:co=null}=ue,{minHeight:uo=null}=ue,{helpText:fo=null}=ue;const po=createEventDispatcher(),ho=go=>{eo(0,no=go.detail),po("change",go.detail)};function _o(go){lo=go,eo(1,lo)}return to.$$set=go=>{"value"in go&&eo(0,no=go.value),"label"in go&&eo(2,ro=go.label),"labelPosition"in go&&eo(3,oo=go.labelPosition),"placeholder"in go&&eo(4,io=go.placeholder),"disabled"in go&&eo(5,ao=go.disabled),"error"in go&&eo(6,so=go.error),"getCaretPosition"in go&&eo(1,lo=go.getCaretPosition),"height"in go&&eo(7,co=go.height),"minHeight"in go&&eo(8,uo=go.minHeight),"helpText"in go&&eo(9,fo=go.helpText)},[no,lo,ro,oo,io,ao,so,co,uo,fo,ho,_o]}class TextArea_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bJ,create_fragment$bM,safe_not_equal,{value:0,label:2,labelPosition:3,placeholder:4,disabled:5,error:6,getCaretPosition:1,height:7,minHeight:8,helpText:9})}}const indexVars$z="",indexVars$y="",indexVars$x="",ignoredClasses=[".download-js-link",".spectrum-Menu",".date-time-popover"],conditionallyIgnoredClasses=[".spectrum-Underlay",".drawer-wrapper",".spectrum-Popover"];let clickHandlers=[],candidateTarget;const handleClick=to=>{if(!to.target.closest('[data-ignore-click-outside="true"]')){for(let ue of ignoredClasses)if(to.target.closest(ue))return;clickHandlers.forEach(ue=>{var eo;if(!ue.element.contains(to.target)){for(let no of conditionallyIgnoredClasses){const ro=ue.anchor.closest(no)!=null;if(to.target.closest(no)!=null&&!ro)return}(eo=ue.callback)==null||eo.call(ue,to)}})}},handleMouseUp=to=>{candidateTarget===to.target&&handleClick(to),candidateTarget=null},handleMouseDown=to=>{to.button===0&&(candidateTarget=to.target,document.removeEventListener("click",handleMouseUp),document.addEventListener("click",handleMouseUp,!0))};document.addEventListener("mousedown",handleMouseDown);document.addEventListener("contextmenu",handleClick);const updateHandler=(to,ue,eo,no)=>{let ro=clickHandlers.find(oo=>oo.id===to);ro?ro.callback=no:clickHandlers.push({id:to,element:ue,anchor:eo,callback:no})},removeHandler=to=>{clickHandlers=clickHandlers.filter(ue=>ue.id!==to)},clickOutside=(to,ue)=>{const eo=Math.random(),no=ro=>{const oo=(ro==null?void 0:ro.callback)||(typeof ro=="function"?ro:null),io=(ro==null?void 0:ro.anchor)||to;updateHandler(eo,to,io,oo)};return no(ue),{update:no,destroy:()=>removeHandler(eo)}},indexVars$w="",Search_svelte_svelte_type_style_lang="";function create_fragment$bL(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo;return{c(){ue=element("div"),eo=element("div"),no=svg_element("svg"),ro=svg_element("use"),oo=space$1(),io=element("input"),lo=space$1(),co=element("button"),co.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-Cross75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Cross75"></use></svg>',xlink_attr(ro,"xlink:href","#spectrum-icon-18-Magnify"),attr(no,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-icon"),attr(no,"focusable","false"),attr(no,"aria-hidden","true"),io.disabled=to[3],attr(io,"id",to[4]),io.value=ao=to[1]||"",attr(io,"placeholder",so=to[2]||""),attr(io,"type","search"),attr(io,"class","spectrum-Textfield-input spectrum-Search-input svelte-d7zw73"),attr(io,"autocomplete","off"),attr(eo,"class","spectrum-Textfield svelte-d7zw73"),toggle_class(eo,"spectrum-Textfield--quiet",to[5]),toggle_class(eo,"is-focused",to[6]),toggle_class(eo,"is-disabled",to[3]),attr(co,"type","reset"),attr(co,"class","spectrum-ClearButton spectrum-Search-clearButton svelte-d7zw73"),attr(ue,"class","spectrum-Search svelte-d7zw73"),toggle_class(ue,"is-disabled",to[3])},m(po,ho){insert$1(po,ue,ho),append$2(ue,eo),append$2(eo,no),append$2(no,ro),append$2(eo,oo),append$2(eo,io),to[17](io),append$2(ue,lo),append$2(ue,co),uo||(fo=[listen(io,"click",to[13]),listen(io,"blur",to[14]),listen(io,"focus",to[15]),listen(io,"input",to[16]),listen(io,"blur",to[9]),listen(io,"focus",to[8]),listen(io,"input",to[10]),listen(io,"keyup",to[11]),listen(co,"click",to[18])],uo=!0)},p(po,[ho]){ho&8&&(io.disabled=po[3]),ho&16&&attr(io,"id",po[4]),ho&2&&ao!==(ao=po[1]||"")&&io.value!==ao&&(io.value=ao),ho&4&&so!==(so=po[2]||"")&&attr(io,"placeholder",so),ho&32&&toggle_class(eo,"spectrum-Textfield--quiet",po[5]),ho&64&&toggle_class(eo,"is-focused",po[6]),ho&8&&toggle_class(eo,"is-disabled",po[3]),ho&8&&toggle_class(ue,"is-disabled",po[3])},i:noop$6,o:noop$6,d(po){po&&detach(ue),to[17](null),uo=!1,run_all(fo)}}}function instance$bI(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{disabled:oo=!1}=ue,{id:io=null}=ue,{updateOnChange:ao=!0}=ue,{quiet:so=!1}=ue,{inputRef:lo}=ue;const co=createEventDispatcher();let uo=!1;const fo=Ao=>{co("change",Ao)},po=()=>{eo(6,uo=!0)},ho=Ao=>{eo(6,uo=!1),fo(Ao.target.value)},_o=Ao=>{ao&&fo(Ao.target.value)},go=Ao=>{Ao.key==="Enter"&&fo(Ao.target.value)};function bo(Ao){bubble.call(this,to,Ao)}function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{lo=Ao,eo(0,lo)})}const So=()=>fo("");return to.$$set=Ao=>{"value"in Ao&&eo(1,no=Ao.value),"placeholder"in Ao&&eo(2,ro=Ao.placeholder),"disabled"in Ao&&eo(3,oo=Ao.disabled),"id"in Ao&&eo(4,io=Ao.id),"updateOnChange"in Ao&&eo(12,ao=Ao.updateOnChange),"quiet"in Ao&&eo(5,so=Ao.quiet),"inputRef"in Ao&&eo(0,lo=Ao.inputRef)},[lo,no,ro,oo,io,so,uo,fo,po,ho,_o,go,ao,bo,vo,yo,wo,ko,So]}class Search extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bI,create_fragment$bL,safe_not_equal,{value:1,placeholder:2,disabled:3,id:4,updateOnChange:12,quiet:5,inputRef:0})}}const indexVars$v="",StatusLight_svelte_svelte_type_style_lang="";function create_fragment$bK(to){let ue,eo,no,ro,oo,io;const ao=to[21].default,so=create_slot(ao,to,to[20],null);return{c(){ue=element("div"),so&&so.c(),attr(ue,"class",eo="spectrum-StatusLight spectrum-StatusLight--size"+to[0]+" svelte-1wk2ay6"),attr(ue,"style",no=`--color: ${to[16]??"var(--spectrum-global-color-gray-400)"};`),toggle_class(ue,"custom",!!to[16]),toggle_class(ue,"square",to[17]),toggle_class(ue,"hoverable",to[18]),toggle_class(ue,"spectrum-StatusLight--celery",to[1]),toggle_class(ue,"spectrum-StatusLight--yellow",to[2]),toggle_class(ue,"spectrum-StatusLight--fuchsia",to[3]),toggle_class(ue,"spectrum-StatusLight--indigo",to[4]),toggle_class(ue,"spectrum-StatusLight--seafoam",to[5]),toggle_class(ue,"spectrum-StatusLight--chartreuse",to[6]),toggle_class(ue,"spectrum-StatusLight--magenta",to[7]),toggle_class(ue,"spectrum-StatusLight--purple",to[8]),toggle_class(ue,"spectrum-StatusLight--neutral",to[9]),toggle_class(ue,"spectrum-StatusLight--info",to[10]),toggle_class(ue,"spectrum-StatusLight--positive",to[11]),toggle_class(ue,"spectrum-StatusLight--notice",to[12]),toggle_class(ue,"spectrum-StatusLight--negative",to[13]),toggle_class(ue,"spectrum-StatusLight--disabled",to[14]),toggle_class(ue,"spectrum-StatusLight--active",to[15]),toggle_class(ue,"withText",!!to[19].default)},m(lo,co){insert$1(lo,ue,co),so&&so.m(ue,null),ro=!0,oo||(io=listen(ue,"click",to[22]),oo=!0)},p(lo,[co]){so&&so.p&&(!ro||co&1048576)&&update_slot_base(so,ao,lo,lo[20],ro?get_slot_changes(ao,lo[20],co,null):get_all_dirty_from_scope(lo[20]),null),(!ro||co&1&&eo!==(eo="spectrum-StatusLight spectrum-StatusLight--size"+lo[0]+" svelte-1wk2ay6"))&&attr(ue,"class",eo),(!ro||co&65536&&no!==(no=`--color: ${lo[16]??"var(--spectrum-global-color-gray-400)"};`))&&attr(ue,"style",no),(!ro||co&65537)&&toggle_class(ue,"custom",!!lo[16]),(!ro||co&131073)&&toggle_class(ue,"square",lo[17]),(!ro||co&262145)&&toggle_class(ue,"hoverable",lo[18]),(!ro||co&3)&&toggle_class(ue,"spectrum-StatusLight--celery",lo[1]),(!ro||co&5)&&toggle_class(ue,"spectrum-StatusLight--yellow",lo[2]),(!ro||co&9)&&toggle_class(ue,"spectrum-StatusLight--fuchsia",lo[3]),(!ro||co&17)&&toggle_class(ue,"spectrum-StatusLight--indigo",lo[4]),(!ro||co&33)&&toggle_class(ue,"spectrum-StatusLight--seafoam",lo[5]),(!ro||co&65)&&toggle_class(ue,"spectrum-StatusLight--chartreuse",lo[6]),(!ro||co&129)&&toggle_class(ue,"spectrum-StatusLight--magenta",lo[7]),(!ro||co&257)&&toggle_class(ue,"spectrum-StatusLight--purple",lo[8]),(!ro||co&513)&&toggle_class(ue,"spectrum-StatusLight--neutral",lo[9]),(!ro||co&1025)&&toggle_class(ue,"spectrum-StatusLight--info",lo[10]),(!ro||co&2049)&&toggle_class(ue,"spectrum-StatusLight--positive",lo[11]),(!ro||co&4097)&&toggle_class(ue,"spectrum-StatusLight--notice",lo[12]),(!ro||co&8193)&&toggle_class(ue,"spectrum-StatusLight--negative",lo[13]),(!ro||co&16385)&&toggle_class(ue,"spectrum-StatusLight--disabled",lo[14]),(!ro||co&32769)&&toggle_class(ue,"spectrum-StatusLight--active",lo[15]),(!ro||co&524289)&&toggle_class(ue,"withText",!!lo[19].default)},i(lo){ro||(transition_in(so,lo),ro=!0)},o(lo){transition_out(so,lo),ro=!1},d(lo){lo&&detach(ue),so&&so.d(lo),oo=!1,io()}}}function instance$bH(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue;const oo=compute_slots(no);let{size:io="M"}=ue,{celery:ao=!1}=ue,{yellow:so=!1}=ue,{fuchsia:lo=!1}=ue,{indigo:co=!1}=ue,{seafoam:uo=!1}=ue,{chartreuse:fo=!1}=ue,{magenta:po=!1}=ue,{purple:ho=!1}=ue,{neutral:_o=!1}=ue,{info:go=!1}=ue,{positive:bo=!1}=ue,{notice:vo=!1}=ue,{negative:yo=!1}=ue,{disabled:wo=!1}=ue,{active:ko=!1}=ue,{color:So=null}=ue,{square:Ao=!1}=ue,{hoverable:Io=!1}=ue;function Eo(To){bubble.call(this,to,To)}return to.$$set=To=>{"size"in To&&eo(0,io=To.size),"celery"in To&&eo(1,ao=To.celery),"yellow"in To&&eo(2,so=To.yellow),"fuchsia"in To&&eo(3,lo=To.fuchsia),"indigo"in To&&eo(4,co=To.indigo),"seafoam"in To&&eo(5,uo=To.seafoam),"chartreuse"in To&&eo(6,fo=To.chartreuse),"magenta"in To&&eo(7,po=To.magenta),"purple"in To&&eo(8,ho=To.purple),"neutral"in To&&eo(9,_o=To.neutral),"info"in To&&eo(10,go=To.info),"positive"in To&&eo(11,bo=To.positive),"notice"in To&&eo(12,vo=To.notice),"negative"in To&&eo(13,yo=To.negative),"disabled"in To&&eo(14,wo=To.disabled),"active"in To&&eo(15,ko=To.active),"color"in To&&eo(16,So=To.color),"square"in To&&eo(17,Ao=To.square),"hoverable"in To&&eo(18,Io=To.hoverable),"$$scope"in To&&eo(20,ro=To.$$scope)},[io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,So,Ao,Io,oo,ro,no,Eo]}class StatusLight extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bH,create_fragment$bK,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(to,ue){let eo,no=ue;const ro=()=>oo(no),oo=ao=>{const{anchor:so,align:lo,maxHeight:co,maxWidth:uo,minWidth:fo,useAnchorWidth:po,offset:ho=5,customUpdate:_o,resizable:go,wrap:bo}=ao;if(!so)return;const vo=so.getBoundingClientRect(),yo=to.getBoundingClientRect(),wo=window.innerWidth,ko=window.innerHeight,So=8;let Ao={maxHeight:co,minWidth:po?vo.width:fo,maxWidth:po?vo.width:uo,left:0,top:0};if(typeof _o=="function")Ao=_o(vo,yo,{...Ao,offset:ao.offset});else{const Io=()=>Ao.left+yo.width>wo&&vo.left>wo-vo.right,Eo=()=>Ao.top+yo.height>ko&&vo.top>ko-vo.bottom,To=Fo=>{!Ao.maxHeight&&go&&(Ao.maxHeight=Fo)},Mo=Fo=>{switch(Fo){case"StartToStart":default:Ao.left=vo.left;break;case"EndToEnd":Ao.left=vo.right-yo.width;break;case"StartToEnd":Ao.left=vo.right+ho;break;case"EndToStart":Ao.left=vo.left-yo.width-ho;break;case"MidPoint":Ao.left=vo.left+vo.width/2-yo.width/2;break;case"ScreenEdge":Ao.left=wo-yo.width-So;break}},Vo=Fo=>{switch(Fo){case"StartToStart":Ao.top=vo.top,To(ko-vo.top-So);break;case"EndToEnd":Ao.top=vo.bottom-yo.height,To(vo.bottom-So);break;case"StartToEnd":default:Ao.top=vo.bottom+ho,To(ko-vo.bottom-So);break;case"EndToStart":Ao.top=vo.top-yo.height-ho,To(vo.top-So);break;case"MidPoint":Ao.top=vo.top+vo.height/2-yo.height/2;break;case"ScreenEdge":Ao.top=ko-yo.height-So,To(ko-2*So);break}};Mo(lo==="right"?"EndToEnd":lo==="right-outside"||lo==="right-context-menu"?"StartToEnd":lo==="left-outside"||lo==="left-context-menu"?"EndToStart":lo==="center"?"MidPoint":"StartToStart"),lo==="right-outside"||lo==="left-outside"?Vo("MidPoint"):lo==="right-context-menu"||lo==="left-context-menu"?(Vo("StartToStart"),Ao.top&&(Ao.top-=5)):Vo("StartToEnd"),Io()&&(lo==="left"?Mo("EndToEnd"):lo==="right-outside"&&Mo("EndToStart")),Eo()&&(bo?(Vo("MidPoint"),Eo()&&Vo("ScreenEdge"),Mo("StartToEnd"),Io()&&Mo("EndToStart")):Vo(lo==="left-outside"||lo==="right-outside"?"ScreenEdge":"EndToStart"))}for(const[Io,Eo]of Object.entries(Ao))to.style.setProperty(Io,Eo?`${Eo}px`:null)},io=ao=>{no=ao,eo&&eo.disconnect();const{anchor:so}=ao;so&&(eo=new ResizeObserver(()=>oo(ao)),eo.observe(so),eo.observe(to),eo.observe(document.body))};return to.style.position="fixed",to.style.zIndex="9999",document.addEventListener("scroll",ro,!0),io(ue),{update:io,destroy(){eo&&eo.disconnect(),document.removeEventListener("scroll",ro,!0)}}}const Context$1={Modal:"bbui-modal",PopoverRoot:"bbui-popover-root"},Popover_svelte_svelte_type_style_lang="";function create_if_block$5u(to){let ue,eo;return ue=new Portal$1({props:{target:to[17],$$slots:{default:[create_default_slot$6Y]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&131072&&(oo.target=no[17]),ro&537001982&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$6Y(to){let ue,eo,no,ro,oo,io,ao;const so=to[26].default,lo=create_slot(so,to,to[29],null);return{c(){ue=element("div"),lo&&lo.c(),attr(ue,"tabindex","0"),attr(ue,"class","spectrum-Popover is-open svelte-1uiag1x"),attr(ue,"role","presentation"),set_style(ue,"height",to[9]),set_style(ue,"--customZindex",to[11]),toggle_class(ue,"customZindex",to[11]),toggle_class(ue,"hidden",!to[13]),toggle_class(ue,"blockPointerEvents",to[16])},m(co,uo){insert$1(co,ue,uo),lo&&lo.m(ue,null),oo=!0,io||(ao=[action_destroyer(eo=positionDropdown.call(null,ue,{anchor:to[1],align:to[2],maxHeight:to[5],maxWidth:to[4],minWidth:to[3],useAnchorWidth:to[6],offset:to[8],customUpdate:to[12],resizable:to[14],wrap:to[15]})),action_destroyer(no=clickOutside.call(null,ue,{callback:to[7]?to[18]:clickOutside_function,anchor:to[1]})),listen(ue,"keydown",to[19]),listen(ue,"mouseenter",to[27]),listen(ue,"mouseleave",to[28])],io=!0)},p(co,uo){to=co,lo&&lo.p&&(!oo||uo&536870912)&&update_slot_base(lo,so,to,to[29],oo?get_slot_changes(so,to[29],uo,null):get_all_dirty_from_scope(to[29]),null),(!oo||uo&512)&&set_style(ue,"height",to[9]),(!oo||uo&2048)&&set_style(ue,"--customZindex",to[11]),eo&&is_function(eo.update)&&uo&53630&&eo.update.call(null,{anchor:to[1],align:to[2],maxHeight:to[5],maxWidth:to[4],minWidth:to[3],useAnchorWidth:to[6],offset:to[8],customUpdate:to[12],resizable:to[14],wrap:to[15]}),no&&is_function(no.update)&&uo&130&&no.update.call(null,{callback:to[7]?to[18]:clickOutside_function,anchor:to[1]}),(!oo||uo&2048)&&toggle_class(ue,"customZindex",to[11]),(!oo||uo&8192)&&toggle_class(ue,"hidden",!to[13]),(!oo||uo&65536)&&toggle_class(ue,"blockPointerEvents",to[16])},i(co){oo||(transition_in(lo,co),co&&add_render_callback(()=>{oo&&(ro||(ro=create_bidirectional_transition(ue,fly,{y:-20,duration:to[10]?animationDuration:0},!0)),ro.run(1))}),oo=!0)},o(co){transition_out(lo,co),co&&(ro||(ro=create_bidirectional_transition(ue,fly,{y:-20,duration:to[10]?animationDuration:0},!1)),ro.run(0)),oo=!1},d(co){co&&detach(ue),lo&&lo.d(co),co&&ro&&ro.end(),io=!1,run_all(ao)}}}function create_fragment$bJ(to){let ue,eo,no=to[0]&&create_if_block$5u(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){ro[0]?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$5u(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}const animationDuration=260,clickOutside_function=()=>{};function instance$bG(to,ue,eo){let no,{$$slots:ro={},$$scope:oo}=ue;const io=createEventDispatcher();let{anchor:ao}=ue,{align:so="right"}=ue,{portalTarget:lo=void 0}=ue,{minWidth:co=void 0}=ue,{maxWidth:uo=void 0}=ue,{maxHeight:fo=void 0}=ue,{open:po=!1}=ue,{useAnchorWidth:ho=!1}=ue,{dismissible:_o=!0}=ue,{offset:go=4}=ue,{customHeight:bo=void 0}=ue,{animate:vo=!0}=ue,{customZindex:yo=void 0}=ue,{handlePostionUpdate:wo=void 0}=ue,{showPopover:ko=!0}=ue,{clickOutsideOverride:So=!1}=ue,{resizable:Ao=!0}=ue,{wrap:Io=!1}=ue,Eo,To=!1;const Mo=()=>{io("open"),eo(0,po=!0)},Vo=()=>{io("close"),eo(0,po=!1)},Fo=()=>{po?Vo():Mo()},Po=qo=>{if(!So&&po){let xo=qo.target,Zo=!1;for(;!Zo&&xo&&xo.parentNode;)Zo=xo===ao,xo=xo.parentNode;Zo&&qo.stopPropagation(),Vo()}},Ro=qo=>{So&&po&&qo.key==="Escape"&&Vo()};onDestroy(()=>{clearTimeout(Eo)});function Do(qo){bubble.call(this,to,qo)}function Uo(qo){bubble.call(this,to,qo)}return to.$$set=qo=>{"anchor"in qo&&eo(1,ao=qo.anchor),"align"in qo&&eo(2,so=qo.align),"portalTarget"in qo&&eo(20,lo=qo.portalTarget),"minWidth"in qo&&eo(3,co=qo.minWidth),"maxWidth"in qo&&eo(4,uo=qo.maxWidth),"maxHeight"in qo&&eo(5,fo=qo.maxHeight),"open"in qo&&eo(0,po=qo.open),"useAnchorWidth"in qo&&eo(6,ho=qo.useAnchorWidth),"dismissible"in qo&&eo(7,_o=qo.dismissible),"offset"in qo&&eo(8,go=qo.offset),"customHeight"in qo&&eo(9,bo=qo.customHeight),"animate"in qo&&eo(10,vo=qo.animate),"customZindex"in qo&&eo(11,yo=qo.customZindex),"handlePostionUpdate"in qo&&eo(12,wo=qo.handlePostionUpdate),"showPopover"in qo&&eo(13,ko=qo.showPopover),"clickOutsideOverride"in qo&&eo(21,So=qo.clickOutsideOverride),"resizable"in qo&&eo(14,Ao=qo.resizable),"wrap"in qo&&eo(15,Io=qo.wrap),"$$scope"in qo&&eo(29,oo=qo.$$scope)},to.$$.update=()=>{to.$$.dirty&1048576&&eo(17,no=lo||getContext$1(Context$1.PopoverRoot)||".spectrum"),to.$$.dirty&33555457&&po&&vo&&(eo(16,To=!0),clearTimeout(Eo),eo(25,Eo=setTimeout(()=>{eo(16,To=!1)},animationDuration/2)))},[po,ao,so,co,uo,fo,ho,_o,go,bo,vo,yo,wo,ko,Ao,Io,To,no,Po,Ro,lo,So,Mo,Vo,Fo,Eo,ro,Do,Uo,oo]}class Popover extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bG,create_fragment$bJ,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$u="",Tags_svelte_svelte_type_style_lang="";function create_fragment$bI(to){let ue,eo;const no=to[1].default,ro=create_slot(no,to,to[0],null);return{c(){ue=element("div"),ro&&ro.c(),attr(ue,"class","spectrum-Tags svelte-17cj8k0"),attr(ue,"role","list"),attr(ue,"aria-label","list")},m(oo,io){insert$1(oo,ue,io),ro&&ro.m(ue,null),eo=!0},p(oo,[io]){ro&&ro.p&&(!eo||io&1)&&update_slot_base(ro,no,oo,oo[0],eo?get_slot_changes(no,oo[0],io,null):get_all_dirty_from_scope(oo[0]),null)},i(oo){eo||(transition_in(ro,oo),eo=!0)},o(oo){transition_out(ro,oo),eo=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo)}}}function instance$bF(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue;return to.$$set=oo=>{"$$scope"in oo&&eo(0,ro=oo.$$scope)},[ro,no]}class Tags extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bF,create_fragment$bI,safe_not_equal,{})}}const indexVars$t="",Avatar_svelte_svelte_type_style_lang="";function create_else_block$21(to){let ue,eo=(to[3]||"")+"",no;return{c(){ue=element("div"),no=text$1(eo),attr(ue,"class","spectrum-Avatar svelte-xutedg"),attr(ue,"style",to[4]),toggle_class(ue,"is-disabled",to[2])},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,no)},p(ro,oo){oo&8&&eo!==(eo=(ro[3]||"")+"")&&set_data(no,eo),oo&16&&attr(ue,"style",ro[4]),oo&4&&toggle_class(ue,"is-disabled",ro[2])},d(ro){ro&&detach(ue)}}}function create_if_block$5t(to){let ue,eo;return{c(){ue=element("img"),attr(ue,"class","spectrum-Avatar"),src_url_equal(ue.src,eo=to[1])||attr(ue,"src",eo),attr(ue,"alt","Avatar"),set_style(ue,"width","var("+to[5].get(to[0])+")"),set_style(ue,"height","var("+to[5].get(to[0])+")"),toggle_class(ue,"is-disabled",to[2])},m(no,ro){insert$1(no,ue,ro)},p(no,ro){ro&2&&!src_url_equal(ue.src,eo=no[1])&&attr(ue,"src",eo),ro&1&&set_style(ue,"width","var("+no[5].get(no[0])+")"),ro&1&&set_style(ue,"height","var("+no[5].get(no[0])+")"),ro&4&&toggle_class(ue,"is-disabled",no[2])},d(no){no&&detach(ue)}}}function create_fragment$bH(to){let ue;function eo(oo,io){return oo[1]?create_if_block$5t:create_else_block$21}let no=eo(to),ro=no(to);return{c(){ro.c(),ue=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,ue,io)},p(oo,[io]){no===(no=eo(oo))&&ro?ro.p(oo,io):(ro.d(1),ro=no(oo),ro&&(ro.c(),ro.m(ue.parentNode,ue)))},i:noop$6,o:noop$6,d(oo){oo&&detach(ue),ro.d(oo)}}}const DefaultColor="#3aab87";function instance$bE(to,ue,eo){let no,ro,oo=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:io="M"}=ue,{url:ao=""}=ue,{disabled:so=!1}=ue,{initials:lo="JD"}=ue,{color:co=null}=ue;const uo=po=>po!=null&&po.length?`hsl(${po[0].toLowerCase().charCodeAt(0)%26/26*360}, 50%, 50%)`:DefaultColor,fo=(po,ho)=>{const _o=`var(${oo.get(po)})`,go=`calc(${_o} / 2)`;return`width:${_o}; height:${_o}; font-size:${go}; background:${ho};`};return to.$$set=po=>{"size"in po&&eo(0,io=po.size),"url"in po&&eo(1,ao=po.url),"disabled"in po&&eo(2,so=po.disabled),"initials"in po&&eo(3,lo=po.initials),"color"in po&&eo(6,co=po.color)},to.$$.update=()=>{to.$$.dirty&72&&eo(7,no=co||uo(lo)),to.$$.dirty&129&&eo(4,ro=fo(io,no))},[io,ao,so,lo,ro,oo,co,no]}class Avatar extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bE,create_fragment$bH,safe_not_equal,{size:0,url:1,disabled:2,initials:3,color:6})}}function create_fragment$bG(to){let ue,eo,no,ro,oo;return{c(){ue=element("button"),eo=svg_element("svg"),no=svg_element("use"),xlink_attr(no,"xlink:href","#spectrum-css-icon-Cross75"),attr(eo,"class","spectrum-Icon spectrum-UIIcon-Cross75"),attr(eo,"focusable","false"),attr(eo,"aria-hidden","true"),attr(ue,"class","spectrum-ClearButton"),ue.disabled=to[1],toggle_class(ue,"spectrum-ClearButton--small",to[0])},m(io,ao){insert$1(io,ue,ao),append$2(ue,eo),append$2(eo,no),ro||(oo=listen(ue,"click",to[2]),ro=!0)},p(io,[ao]){ao&2&&(ue.disabled=io[1]),ao&1&&toggle_class(ue,"spectrum-ClearButton--small",io[0])},i:noop$6,o:noop$6,d(io){io&&detach(ue),ro=!1,oo()}}}function instance$bD(to,ue,eo){let{small:no=!1}=ue,{disabled:ro}=ue;function oo(io){bubble.call(this,to,io)}return to.$$set=io=>{"small"in io&&eo(0,no=io.small),"disabled"in io&&eo(1,ro=io.disabled)},[no,ro,oo]}class ClearButton extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bD,create_fragment$bG,safe_not_equal,{small:0,disabled:1})}}const Tag_svelte_svelte_type_style_lang="";function create_if_block_2$1Q(to){let ue,eo;return ue=new Avatar({props:{url:to[1]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&2&&(oo.url=no[1]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$2$(to){let ue,eo,no;return{c(){ue=svg_element("svg"),eo=svg_element("use"),xlink_attr(eo,"xlink:href",no="#spectrum-icon-24-"+to[0]),attr(ue,"class","spectrum-Icon spectrum-Icon--sizeS"),attr(ue,"focusable","false"),attr(ue,"aria-hidden","true"),attr(ue,"aria-label","Tag")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,eo)},p(ro,oo){oo&1&&no!==(no="#spectrum-icon-24-"+ro[0])&&xlink_attr(eo,"xlink:href",no)},d(ro){ro&&detach(ue)}}}function create_if_block$5s(to){let ue,eo;return ue=new ClearButton({}),ue.$on("click",to[7]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bF(to){let ue,eo,no,ro,oo,io,ao=to[1]&&create_if_block_2$1Q(to),so=to[0]&&create_if_block_1$2$(to);const lo=to[6].default,co=create_slot(lo,to,to[5],null);let uo=to[4]&&create_if_block$5s(to);return{c(){ue=element("div"),ao&&ao.c(),eo=space$1(),so&&so.c(),no=space$1(),ro=element("span"),co&&co.c(),oo=space$1(),uo&&uo.c(),attr(ro,"class","spectrum-Tags-itemLabel"),attr(ue,"class","spectrum-Tags-item svelte-16fqld8"),attr(ue,"role","listitem"),toggle_class(ue,"is-invalid",to[2]),toggle_class(ue,"is-disabled",to[3])},m(fo,po){insert$1(fo,ue,po),ao&&ao.m(ue,null),append$2(ue,eo),so&&so.m(ue,null),append$2(ue,no),append$2(ue,ro),co&&co.m(ro,null),append$2(ue,oo),uo&&uo.m(ue,null),io=!0},p(fo,[po]){fo[1]?ao?(ao.p(fo,po),po&2&&transition_in(ao,1)):(ao=create_if_block_2$1Q(fo),ao.c(),transition_in(ao,1),ao.m(ue,eo)):ao&&(group_outros(),transition_out(ao,1,1,()=>{ao=null}),check_outros()),fo[0]?so?so.p(fo,po):(so=create_if_block_1$2$(fo),so.c(),so.m(ue,no)):so&&(so.d(1),so=null),co&&co.p&&(!io||po&32)&&update_slot_base(co,lo,fo,fo[5],io?get_slot_changes(lo,fo[5],po,null):get_all_dirty_from_scope(fo[5]),null),fo[4]?uo?po&16&&transition_in(uo,1):(uo=create_if_block$5s(fo),uo.c(),transition_in(uo,1),uo.m(ue,null)):uo&&(group_outros(),transition_out(uo,1,1,()=>{uo=null}),check_outros()),(!io||po&4)&&toggle_class(ue,"is-invalid",fo[2]),(!io||po&8)&&toggle_class(ue,"is-disabled",fo[3])},i(fo){io||(transition_in(ao),transition_in(co,fo),transition_in(uo),io=!0)},o(fo){transition_out(ao),transition_out(co,fo),transition_out(uo),io=!1},d(fo){fo&&detach(ue),ao&&ao.d(),so&&so.d(),co&&co.d(fo),uo&&uo.d()}}}function instance$bC(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{icon:oo=""}=ue,{avatar:io=""}=ue,{invalid:ao=!1}=ue,{disabled:so=!1}=ue,{closable:lo=!1}=ue;function co(uo){bubble.call(this,to,uo)}return to.$$set=uo=>{"icon"in uo&&eo(0,oo=uo.icon),"avatar"in uo&&eo(1,io=uo.avatar),"invalid"in uo&&eo(2,ao=uo.invalid),"disabled"in uo&&eo(3,so=uo.disabled),"closable"in uo&&eo(4,lo=uo.closable),"$$scope"in uo&&eo(5,ro=uo.$$scope)},[oo,io,ao,so,lo,ro,no,co]}let Tag$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bC,create_fragment$bF,safe_not_equal,{icon:0,avatar:1,invalid:2,disabled:3,closable:4})}};const indexVars$s="";function create_fragment$bE(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho;return{c(){ue=element("div"),eo=element("div"),no=space$1(),ro=element("div"),oo=element("div"),io=element("div"),ao=element("div"),so=space$1(),lo=element("div"),co=element("div"),uo=element("div"),attr(eo,"class","spectrum-ProgressCircle-track"),attr(ao,"class","spectrum-ProgressCircle-fill"),attr(io,"class","spectrum-ProgressCircle-fillSubMask1"),attr(io,"style",to[3]),attr(oo,"class","spectrum-ProgressCircle-fillMask1"),attr(uo,"class","spectrum-ProgressCircle-fill"),attr(co,"class","spectrum-ProgressCircle-fillSubMask2"),attr(co,"style",to[4]),attr(lo,"class","spectrum-ProgressCircle-fillMask2"),attr(ro,"class","spectrum-ProgressCircle-fills"),attr(ue,"class",fo="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(to[0])),toggle_class(ue,"spectrum-ProgressCircle--indeterminate",to[1]==null),toggle_class(ue,"spectrum-ProgressCircle--overBackground",to[2])},m(_o,go){insert$1(_o,ue,go),append$2(ue,eo),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),append$2(oo,io),append$2(io,ao),append$2(ro,so),append$2(ro,lo),append$2(lo,co),append$2(co,uo),po||(ho=listen(ue,"click",to[7]),po=!0)},p(_o,[go]){go&8&&attr(io,"style",_o[3]),go&16&&attr(co,"style",_o[4]),go&1&&fo!==(fo="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(_o[0]))&&attr(ue,"class",fo),go&3&&toggle_class(ue,"spectrum-ProgressCircle--indeterminate",_o[1]==null),go&5&&toggle_class(ue,"spectrum-ProgressCircle--overBackground",_o[2])},i:noop$6,o:noop$6,d(_o){_o&&detach(ue),po=!1,ho()}}}function convertSize(to){switch(to){case"S":return"small";case"L":return"large";default:return}}function instance$bB(to,ue,eo){let{size:no="M"}=ue,{value:ro=null}=ue,{minValue:oo=0}=ue,{maxValue:io=100}=ue,ao,so;function lo(fo){if(fo){let po=(fo-oo)/(io-oo)*100,ho;po>0&&po<=50?(ho=-180+po/50*180,eo(3,ao=`transform: rotate(${ho}deg);`),eo(4,so="transform: rotate(-180deg);")):po>50&&(ho=-180+(po-50)/50*180,eo(3,ao="transform: rotate(0deg);"),eo(4,so=`transform: rotate(${ho}deg);`))}}let{overBackground:co=!1}=ue;function uo(fo){bubble.call(this,to,fo)}return to.$$set=fo=>{"size"in fo&&eo(0,no=fo.size),"value"in fo&&eo(1,ro=fo.value),"minValue"in fo&&eo(5,oo=fo.minValue),"maxValue"in fo&&eo(6,io=fo.maxValue),"overBackground"in fo&&eo(2,co=fo.overBackground)},to.$$.update=()=>{to.$$.dirty&2&&lo(ro)},[no,ro,co,ao,so,oo,io,uo]}class ProgressCircle extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bB,create_fragment$bE,safe_not_equal,{size:0,value:1,minValue:5,maxValue:6,overBackground:2})}}const Picker_svelte_svelte_type_style_lang="";function get_each_context$2d(to,ue,eo){const no=to.slice();return no[49]=ue[eo],no[51]=eo,no}function create_if_block_11$6(to){let ue,eo,no,ro;const oo=[create_if_block_12$4,create_else_block_1$z],io=[];function ao(so,lo){return so[15]?1:0}return ue=ao(to),eo=io[ue]=oo[ue](to),{c(){eo.c(),no=empty$2()},m(so,lo){io[ue].m(so,lo),insert$1(so,no,lo),ro=!0},p(so,lo){let co=ue;ue=ao(so),ue===co?io[ue].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),eo=io[ue],eo?eo.p(so,lo):(eo=io[ue]=oo[ue](so),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no))},i(so){ro||(transition_in(eo),ro=!0)},o(so){transition_out(eo),ro=!1},d(so){so&&detach(no),io[ue].d(so)}}}function create_else_block_1$z(to){let ue,eo,no;return{c(){ue=element("span"),eo=element("img"),src_url_equal(eo.src,no=to[5])||attr(eo,"src",no),attr(eo,"alt","icon"),attr(eo,"width","15"),attr(eo,"height","15"),attr(ue,"class","option-extra icon field-icon svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,eo)},p(ro,oo){oo[0]&32&&!src_url_equal(eo.src,no=ro[5])&&attr(eo,"src",no)},i:noop$6,o:noop$6,d(ro){ro&&detach(ue)}}}function create_if_block_12$4(to){let ue,eo,no;return eo=new Icon({props:{size:"S",name:to[5]}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra icon svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&32&&(io.name=ro[5]),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_10$a(to){let ue,eo,no;return eo=new StatusLight({props:{square:!0,color:to[6]}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&64&&(io.color=ro[6]),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_9$h(to){let ue,eo;return ue=new Search({props:{value:to[0],disabled:to[3],placeholder:"Search"}}),ue.$on("change",to[37]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1&&(oo.value=no[0]),ro[0]&8&&(oo.disabled=no[3]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_8$k(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("li"),eo=element("span"),no=text$1(to[8]),ro=space$1(),oo=svg_element("svg"),io=svg_element("use"),attr(eo,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(io,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(oo,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(oo,"focusable","false"),attr(oo,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item placeholder svelte-1jmtv0w"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[7])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),append$2(eo,no),append$2(ue,ro),append$2(ue,oo),append$2(oo,io),ao||(so=listen(ue,"click",to[38]),ao=!0)},p(lo,co){co[0]&256&&set_data(no,lo[8]),co[0]&128&&toggle_class(ue,"is-selected",lo[7])},d(lo){lo&&detach(ue),ao=!1,so()}}}function create_if_block_2$1P(to){let ue,eo,no=ensure_array_like(to[30]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block$2d(get_each_context$2d(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){for(let io=0;io<ro.length;io+=1)ro[io].c();ue=empty$2()},m(io,ao){for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(io,ao);insert$1(io,ue,ao),eo=!0},p(io,ao){if(ao[0]&1275330048){no=ensure_array_like(io[30]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context$2d(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block$2d(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue.parentNode,ue))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_if_block_6$w(to){let ue,eo,no,ro;const oo=[create_if_block_7$s,create_else_block$20],io=[];function ao(so,lo){return so[15]?0:1}return eo=ao(to),no=io[eo]=oo[eo](to),{c(){ue=element("span"),no.c(),attr(ue,"class","option-extra icon svelte-1jmtv0w")},m(so,lo){insert$1(so,ue,lo),io[eo].m(ue,null),ro=!0},p(so,lo){let co=eo;eo=ao(so),eo===co?io[eo].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),no=io[eo],no?no.p(so,lo):(no=io[eo]=oo[eo](so),no.c()),transition_in(no,1),no.m(ue,null))},i(so){ro||(transition_in(no),ro=!0)},o(so){transition_out(no),ro=!1},d(so){so&&detach(ue),io[eo].d()}}}function create_else_block$20(to){let ue,eo;return ue=new Icon({props:{size:"S",name:to[14](to[49],to[51])}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1073758208&&(oo.name=no[14](no[49],no[51])),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_7$s(to){let ue,eo;return{c(){ue=element("img"),src_url_equal(ue.src,eo=to[14](to[49],to[51]))||attr(ue,"src",eo),attr(ue,"alt","icon"),attr(ue,"width","15"),attr(ue,"height","15")},m(no,ro){insert$1(no,ue,ro)},p(no,ro){ro[0]&1073758208&&!src_url_equal(ue.src,eo=no[14](no[49],no[51]))&&attr(ue,"src",eo)},i:noop$6,o:noop$6,d(no){no&&detach(ue)}}}function create_if_block_5$H(to){let ue,eo,no;return eo=new StatusLight({props:{square:!0,color:to[16](to[49],to[51])}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1073807360&&(io.color=ro[16](ro[49],ro[51])),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_4$V(to){let ue,eo=to[17](to[49],to[51])+"",no;return{c(){ue=element("span"),no=text$1(eo),attr(ue,"class","subtitle-text svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,no)},p(ro,oo){oo[0]&1073872896&&eo!==(eo=ro[17](ro[49],ro[51])+"")&&set_data(no,eo)},d(ro){ro&&detach(ue)}}}function create_if_block_3$1g(to){let ue,eo,no;return eo=new Tags({props:{$$slots:{default:[create_default_slot_1$4p]},$$scope:{ctx:to}}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-tag svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1073741824|oo[1]&2097152&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot_2$37(to){let ue=to[49].tag+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&1073741824&&ue!==(ue=no[49].tag+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_default_slot_1$4p(to){let ue,eo;return ue=new Tag$1({props:{icon:"LockClosed",$$slots:{default:[create_default_slot_2$37]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1073741824|ro[1]&2097152&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_each_block$2d(to){let ue,eo=to[14](to[49],to[51]),no,ro=to[16](to[49],to[51]),oo,io,ao=to[12](to[49],to[51])+"",so,lo,co=to[17](to[49],to[51]),uo,fo,po,ho,_o,go,bo,vo,yo=eo&&create_if_block_6$w(to),wo=ro&&create_if_block_5$H(to),ko=co&&create_if_block_4$V(to),So=to[49].tag&&create_if_block_3$1g(to);function Ao(){return to[39](to[49],to[51])}function Io(...To){return to[40](to[49],...To)}function Eo(...To){return to[41](to[49],...To)}return{c(){ue=element("li"),yo&&yo.c(),no=space$1(),wo&&wo.c(),oo=space$1(),io=element("span"),so=text$1(ao),lo=space$1(),ko&&ko.c(),uo=space$1(),So&&So.c(),fo=space$1(),po=svg_element("svg"),ho=svg_element("use"),_o=space$1(),attr(io,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(ho,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(po,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(po,"focusable","false"),attr(po,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item svelte-1jmtv0w"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[9](to[13](to[49],to[51]))),toggle_class(ue,"is-disabled",!to[10](to[49]))},m(To,Mo){insert$1(To,ue,Mo),yo&&yo.m(ue,null),append$2(ue,no),wo&&wo.m(ue,null),append$2(ue,oo),append$2(ue,io),append$2(io,so),append$2(io,lo),ko&&ko.m(io,null),append$2(ue,uo),So&&So.m(ue,null),append$2(ue,fo),append$2(ue,po),append$2(po,ho),append$2(ue,_o),go=!0,bo||(vo=[listen(ue,"click",Ao),listen(ue,"mouseenter",Io),listen(ue,"mouseleave",Eo)],bo=!0)},p(To,Mo){to=To,Mo[0]&1073758208&&(eo=to[14](to[49],to[51])),eo?yo?(yo.p(to,Mo),Mo[0]&1073758208&&transition_in(yo,1)):(yo=create_if_block_6$w(to),yo.c(),transition_in(yo,1),yo.m(ue,no)):yo&&(group_outros(),transition_out(yo,1,1,()=>{yo=null}),check_outros()),Mo[0]&1073807360&&(ro=to[16](to[49],to[51])),ro?wo?(wo.p(to,Mo),Mo[0]&1073807360&&transition_in(wo,1)):(wo=create_if_block_5$H(to),wo.c(),transition_in(wo,1),wo.m(ue,oo)):wo&&(group_outros(),transition_out(wo,1,1,()=>{wo=null}),check_outros()),(!go||Mo[0]&1073745920)&&ao!==(ao=to[12](to[49],to[51])+"")&&set_data(so,ao),Mo[0]&1073872896&&(co=to[17](to[49],to[51])),co?ko?ko.p(to,Mo):(ko=create_if_block_4$V(to),ko.c(),ko.m(io,null)):ko&&(ko.d(1),ko=null),to[49].tag?So?(So.p(to,Mo),Mo[0]&1073741824&&transition_in(So,1)):(So=create_if_block_3$1g(to),So.c(),transition_in(So,1),So.m(ue,fo)):So&&(group_outros(),transition_out(So,1,1,()=>{So=null}),check_outros()),(!go||Mo[0]&1073750528)&&toggle_class(ue,"is-selected",to[9](to[13](to[49],to[51]))),(!go||Mo[0]&1073742848)&&toggle_class(ue,"is-disabled",!to[10](to[49]))},i(To){go||(transition_in(yo),transition_in(wo),transition_in(So),go=!0)},o(To){transition_out(yo),transition_out(wo),transition_out(So),go=!1},d(To){To&&detach(ue),yo&&yo.d(),wo&&wo.d(),ko&&ko.d(),So&&So.d(),bo=!1,run_all(vo)}}}function create_if_block_1$2_(to){let ue,eo,no;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","loading svelte-1jmtv0w"),toggle_class(ue,"loading--withAutocomplete",to[20])},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){(!no||oo[0]&1048576)&&toggle_class(ue,"loading--withAutocomplete",ro[20])},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block$5r(to){let ue,eo;return{c(){ue=element("div"),eo=text$1(to[23]),attr(ue,"class","footer svelte-1jmtv0w")},m(no,ro){insert$1(no,ue,ro),append$2(ue,eo)},p(no,ro){ro[0]&8388608&&set_data(eo,no[23])},d(no){no&&detach(ue)}}}function create_default_slot$6X(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo=to[20]&&create_if_block_9$h(to),fo=to[8]&&create_if_block_8$k(to),po=to[30].length&&create_if_block_2$1P(to),ho=to[25]&&create_if_block_1$2_(to),_o=to[23]&&create_if_block$5r(to);return{c(){ue=element("div"),uo&&uo.c(),eo=space$1(),no=element("ul"),fo&&fo.c(),ro=space$1(),po&&po.c(),oo=space$1(),ho&&ho.c(),io=space$1(),_o&&_o.c(),attr(no,"class","spectrum-Menu"),attr(no,"role","listbox"),attr(ue,"class","popover-content svelte-1jmtv0w"),toggle_class(ue,"auto-width",to[19])},m(go,bo){insert$1(go,ue,bo),uo&&uo.m(ue,null),append$2(ue,eo),append$2(ue,no),fo&&fo.m(no,null),append$2(no,ro),po&&po.m(no,null),to[42](no),append$2(ue,oo),ho&&ho.m(ue,null),append$2(ue,io),_o&&_o.m(ue,null),so=!0,lo||(co=action_destroyer(ao=clickOutside.call(null,ue,to[43])),lo=!0)},p(go,bo){go[20]?uo?(uo.p(go,bo),bo[0]&1048576&&transition_in(uo,1)):(uo=create_if_block_9$h(go),uo.c(),transition_in(uo,1),uo.m(ue,eo)):uo&&(group_outros(),transition_out(uo,1,1,()=>{uo=null}),check_outros()),go[8]?fo?fo.p(go,bo):(fo=create_if_block_8$k(go),fo.c(),fo.m(no,ro)):fo&&(fo.d(1),fo=null),go[30].length?po?(po.p(go,bo),bo[0]&1073741824&&transition_in(po,1)):(po=create_if_block_2$1P(go),po.c(),transition_in(po,1),po.m(no,null)):po&&(group_outros(),transition_out(po,1,1,()=>{po=null}),check_outros()),go[25]?ho?(ho.p(go,bo),bo[0]&33554432&&transition_in(ho,1)):(ho=create_if_block_1$2_(go),ho.c(),transition_in(ho,1),ho.m(ue,io)):ho&&(group_outros(),transition_out(ho,1,1,()=>{ho=null}),check_outros()),go[23]?_o?_o.p(go,bo):(_o=create_if_block$5r(go),_o.c(),_o.m(ue,null)):_o&&(_o.d(1),_o=null),ao&&is_function(ao.update)&&bo[0]&2&&ao.update.call(null,go[43]),(!so||bo[0]&524288)&&toggle_class(ue,"auto-width",go[19])},i(go){so||(transition_in(uo),transition_in(po),transition_in(ho),so=!0)},o(go){transition_out(uo),transition_out(po),transition_out(ho),so=!1},d(go){go&&detach(ue),uo&&uo.d(),fo&&fo.d(),po&&po.d(),to[42](null),ho&&ho.d(),_o&&_o.d(),lo=!1,co()}}}function create_fragment$bD(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho=to[5]&&create_if_block_11$6(to),_o=to[6]&&create_if_block_10$a(to);return co=new Popover({props:{anchor:to[24]?to[24]:to[29],align:to[22]||"left",open:to[1],useAnchorWidth:!to[19],maxWidth:to[19]?400:null,customHeight:to[21],maxHeight:360,$$slots:{default:[create_default_slot$6X]},$$scope:{ctx:to}}}),co.$on("close",to[44]),{c(){ue=element("button"),ho&&ho.c(),eo=space$1(),_o&&_o.c(),no=space$1(),ro=element("span"),oo=text$1(to[4]),io=space$1(),ao=svg_element("svg"),so=svg_element("use"),lo=space$1(),create_component(co.$$.fragment),attr(ro,"class","spectrum-Picker-label svelte-1jmtv0w"),toggle_class(ro,"is-placeholder",to[7]),toggle_class(ro,"auto-width",to[19]),xlink_attr(so,"xlink:href","#spectrum-css-icon-Chevron100"),attr(ao,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"),attr(ao,"focusable","false"),attr(ao,"aria-hidden","true"),attr(ue,"id",to[2]),attr(ue,"class","spectrum-Picker spectrum-Picker--sizeM svelte-1jmtv0w"),ue.disabled=to[3],attr(ue,"aria-haspopup","listbox"),toggle_class(ue,"spectrum-Picker--quiet",to[18]),toggle_class(ue,"is-open",to[1])},m(go,bo){insert$1(go,ue,bo),ho&&ho.m(ue,null),append$2(ue,eo),_o&&_o.m(ue,null),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),append$2(ue,io),append$2(ue,ao),append$2(ao,so),to[36](ue),insert$1(go,lo,bo),mount_component(co,go,bo),uo=!0,fo||(po=listen(ue,"click",to[31]),fo=!0)},p(go,bo){go[5]?ho?(ho.p(go,bo),bo[0]&32&&transition_in(ho,1)):(ho=create_if_block_11$6(go),ho.c(),transition_in(ho,1),ho.m(ue,eo)):ho&&(group_outros(),transition_out(ho,1,1,()=>{ho=null}),check_outros()),go[6]?_o?(_o.p(go,bo),bo[0]&64&&transition_in(_o,1)):(_o=create_if_block_10$a(go),_o.c(),transition_in(_o,1),_o.m(ue,no)):_o&&(group_outros(),transition_out(_o,1,1,()=>{_o=null}),check_outros()),(!uo||bo[0]&16)&&set_data(oo,go[4]),(!uo||bo[0]&128)&&toggle_class(ro,"is-placeholder",go[7]),(!uo||bo[0]&524288)&&toggle_class(ro,"auto-width",go[19]),(!uo||bo[0]&4)&&attr(ue,"id",go[2]),(!uo||bo[0]&8)&&(ue.disabled=go[3]),(!uo||bo[0]&262144)&&toggle_class(ue,"spectrum-Picker--quiet",go[18]),(!uo||bo[0]&2)&&toggle_class(ue,"is-open",go[1]);const vo={};bo[0]&553648128&&(vo.anchor=go[24]?go[24]:go[29]),bo[0]&4194304&&(vo.align=go[22]||"left"),bo[0]&2&&(vo.open=go[1]),bo[0]&524288&&(vo.useAnchorWidth=!go[19]),bo[0]&524288&&(vo.maxWidth=go[19]?400:null),bo[0]&2097152&&(vo.customHeight=go[21]),bo[0]&1587281803|bo[1]&2097152&&(vo.$$scope={dirty:bo,ctx:go}),co.$set(vo)},i(go){uo||(transition_in(ho),transition_in(_o),transition_in(co.$$.fragment,go),uo=!0)},o(go){transition_out(ho),transition_out(_o),transition_out(co.$$.fragment,go),uo=!1},d(go){go&&(detach(ue),detach(lo)),ho&&ho.d(),_o&&_o.d(),to[36](null),destroy_component(co,go),fo=!1,po()}}}function instance$bA(to,ue,eo){let no,ro,{id:oo=null}=ue,{disabled:io=!1}=ue,{fieldText:ao=""}=ue,{fieldIcon:so=""}=ue,{fieldColour:lo=""}=ue,{isPlaceholder:co=!1}=ue,{placeholderOption:uo=null}=ue,{options:fo=[]}=ue,{isOptionSelected:po=()=>!1}=ue,{isOptionEnabled:ho=()=>!0}=ue,{onSelectOption:_o=()=>{}}=ue,{getOptionLabel:go=Va=>Va}=ue,{getOptionValue:bo=Va=>Va}=ue,{getOptionIcon:vo=()=>null}=ue,{useOptionIconImage:yo=!1}=ue,{getOptionColour:wo=()=>null}=ue,{getOptionSubtitle:ko=()=>null}=ue,{open:So=!1}=ue,{readonly:Ao=!1}=ue,{quiet:Io=!1}=ue,{autoWidth:Eo=!1}=ue,{autocomplete:To=!1}=ue,{sort:Mo=!1}=ue,{searchTerm:Vo=null}=ue,{customPopoverHeight:Fo}=ue,{align:Po="left"}=ue,{footer:Ro=null}=ue,{customAnchor:Do=null}=ue,{loading:Uo}=ue,{onOptionMouseenter:qo=()=>{}}=ue,{onOptionMouseleave:xo=()=>{}}=ue;const Zo=createEventDispatcher();let Xo,Yo;const Qo=Va=>{Va.preventDefault(),Va.stopPropagation(),Zo("click"),!Ao&&(eo(0,Vo=null),eo(1,So=!So))},Ko=(Va,Oa,Pa)=>!(Va!=null&&Va.length)||!Array.isArray(Va)?[]:Pa?Va.sort((ya,ds)=>{const Ma=Oa(ya),ga=Oa(ds);return Ma>ga?1:-1}):Va,ra=(Va,Oa,Pa)=>{if(To&&Oa){const ya=Oa.toLowerCase();return Va.filter(ds=>`${Pa(ds)}`.toLowerCase().includes(ya))}return Va},ea=Va=>{Va.target.scrollHeight-Va.target.clientHeight-Va.target.scrollTop<100&&Zo("loadMore")};onDestroy(()=>{Yo==null||Yo.removeEventListener("scroll",null)});function ia(Va){binding_callbacks[Va?"unshift":"push"](()=>{Xo=Va,eo(29,Xo)})}const Jo=Va=>eo(0,Vo=Va.detail),sa=()=>_o(null),Aa=(Va,Oa)=>_o(bo(Va,Oa)),pa=(Va,Oa)=>qo(Oa,Va),va=(Va,Oa)=>xo(Oa,Va);function da(Va){binding_callbacks[Va?"unshift":"push"](()=>{Yo=Va,eo(28,Yo)})}const Ra=()=>eo(1,So=!1),Ba=()=>eo(1,So=!1);return to.$$set=Va=>{"id"in Va&&eo(2,oo=Va.id),"disabled"in Va&&eo(3,io=Va.disabled),"fieldText"in Va&&eo(4,ao=Va.fieldText),"fieldIcon"in Va&&eo(5,so=Va.fieldIcon),"fieldColour"in Va&&eo(6,lo=Va.fieldColour),"isPlaceholder"in Va&&eo(7,co=Va.isPlaceholder),"placeholderOption"in Va&&eo(8,uo=Va.placeholderOption),"options"in Va&&eo(32,fo=Va.options),"isOptionSelected"in Va&&eo(9,po=Va.isOptionSelected),"isOptionEnabled"in Va&&eo(10,ho=Va.isOptionEnabled),"onSelectOption"in Va&&eo(11,_o=Va.onSelectOption),"getOptionLabel"in Va&&eo(12,go=Va.getOptionLabel),"getOptionValue"in Va&&eo(13,bo=Va.getOptionValue),"getOptionIcon"in Va&&eo(14,vo=Va.getOptionIcon),"useOptionIconImage"in Va&&eo(15,yo=Va.useOptionIconImage),"getOptionColour"in Va&&eo(16,wo=Va.getOptionColour),"getOptionSubtitle"in Va&&eo(17,ko=Va.getOptionSubtitle),"open"in Va&&eo(1,So=Va.open),"readonly"in Va&&eo(33,Ao=Va.readonly),"quiet"in Va&&eo(18,Io=Va.quiet),"autoWidth"in Va&&eo(19,Eo=Va.autoWidth),"autocomplete"in Va&&eo(20,To=Va.autocomplete),"sort"in Va&&eo(34,Mo=Va.sort),"searchTerm"in Va&&eo(0,Vo=Va.searchTerm),"customPopoverHeight"in Va&&eo(21,Fo=Va.customPopoverHeight),"align"in Va&&eo(22,Po=Va.align),"footer"in Va&&eo(23,Ro=Va.footer),"customAnchor"in Va&&eo(24,Do=Va.customAnchor),"loading"in Va&&eo(25,Uo=Va.loading),"onOptionMouseenter"in Va&&eo(26,qo=Va.onOptionMouseenter),"onOptionMouseleave"in Va&&eo(27,xo=Va.onOptionMouseleave)},to.$$.update=()=>{to.$$.dirty[0]&4096|to.$$.dirty[1]&10&&eo(35,no=Ko(fo,go,Mo)),to.$$.dirty[0]&4097|to.$$.dirty[1]&16&&eo(30,ro=ra(no,Vo,go)),to.$$.dirty[0]&268435456&&(Yo==null||Yo.addEventListener("scroll",ea))},[Vo,So,oo,io,ao,so,lo,co,uo,po,ho,_o,go,bo,vo,yo,wo,ko,Io,Eo,To,Fo,Po,Ro,Do,Uo,qo,xo,Yo,Xo,ro,Qo,fo,Ao,Mo,no,ia,Jo,sa,Aa,pa,va,da,Ra,Ba]}class Picker extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bA,create_fragment$bD,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$bC(to){let ue,eo,no,ro;function oo(so){to[32](so)}function io(so){to[33](so)}let ao={quiet:to[15],id:to[3],disabled:to[5],readonly:to[14],fieldText:to[27],fieldIcon:to[26],fieldColour:to[25],options:to[6],autoWidth:to[16],align:to[19],footer:to[20],getOptionLabel:to[7],getOptionValue:to[8],getOptionIcon:to[9],getOptionColour:to[10],getOptionSubtitle:to[11],useOptionIconImage:to[12],isOptionEnabled:to[13],autocomplete:to[17],sort:to[18],tag:to[21],onOptionMouseenter:to[23],onOptionMouseleave:to[24],isPlaceholder:to[2]==null||to[2]==="",placeholderOption:to[4]===!1?null:to[4]||"Choose an option",isOptionSelected:to[31],onSelectOption:to[29],loading:to[22]};return to[0]!==void 0&&(ao.open=to[0]),to[1]!==void 0&&(ao.searchTerm=to[1]),ue=new Picker({props:ao}),binding_callbacks.push(()=>bind$2(ue,"open",oo)),binding_callbacks.push(()=>bind$2(ue,"searchTerm",io)),ue.$on("click",to[34]),ue.$on("loadMore",to[35]),{c(){create_component(ue.$$.fragment)},m(so,lo){mount_component(ue,so,lo),ro=!0},p(so,lo){const co={};lo[0]&32768&&(co.quiet=so[15]),lo[0]&8&&(co.id=so[3]),lo[0]&32&&(co.disabled=so[5]),lo[0]&16384&&(co.readonly=so[14]),lo[0]&134217728&&(co.fieldText=so[27]),lo[0]&67108864&&(co.fieldIcon=so[26]),lo[0]&33554432&&(co.fieldColour=so[25]),lo[0]&64&&(co.options=so[6]),lo[0]&65536&&(co.autoWidth=so[16]),lo[0]&524288&&(co.align=so[19]),lo[0]&1048576&&(co.footer=so[20]),lo[0]&128&&(co.getOptionLabel=so[7]),lo[0]&256&&(co.getOptionValue=so[8]),lo[0]&512&&(co.getOptionIcon=so[9]),lo[0]&1024&&(co.getOptionColour=so[10]),lo[0]&2048&&(co.getOptionSubtitle=so[11]),lo[0]&4096&&(co.useOptionIconImage=so[12]),lo[0]&8192&&(co.isOptionEnabled=so[13]),lo[0]&131072&&(co.autocomplete=so[17]),lo[0]&262144&&(co.sort=so[18]),lo[0]&2097152&&(co.tag=so[21]),lo[0]&8388608&&(co.onOptionMouseenter=so[23]),lo[0]&16777216&&(co.onOptionMouseleave=so[24]),lo[0]&4&&(co.isPlaceholder=so[2]==null||so[2]===""),lo[0]&16&&(co.placeholderOption=so[4]===!1?null:so[4]||"Choose an option"),lo[0]&4&&(co.isOptionSelected=so[31]),lo[0]&4194304&&(co.loading=so[22]),!eo&&lo[0]&1&&(eo=!0,co.open=so[0],add_flush_callback(()=>eo=!1)),!no&&lo[0]&2&&(no=!0,co.searchTerm=so[1],add_flush_callback(()=>no=!1)),ue.$set(co)},i(so){ro||(transition_in(ue.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),ro=!1},d(so){destroy_component(ue,so)}}}function instance$bz(to,ue,eo){let no,ro,oo,{value:io=null}=ue,{id:ao=null}=ue,{placeholder:so="Choose an option"}=ue,{disabled:lo=!1}=ue,{options:co=[]}=ue,{getOptionLabel:uo=ea=>ea}=ue,{getOptionValue:fo=ea=>ea}=ue,{getOptionIcon:po=()=>null}=ue,{getOptionColour:ho=()=>null}=ue,{getOptionSubtitle:_o=()=>null}=ue,{compare:go=null}=ue,{useOptionIconImage:bo=!1}=ue,{isOptionEnabled:vo}=ue,{readonly:yo=!1}=ue,{quiet:wo=!1}=ue,{autoWidth:ko=!1}=ue,{autocomplete:So=!1}=ue,{sort:Ao=!1}=ue,{align:Io}=ue,{footer:Eo=null}=ue,{open:To=!1}=ue,{tag:Mo=null}=ue,{searchTerm:Vo=null}=ue,{loading:Fo}=ue,{onOptionMouseenter:Po=()=>{}}=ue,{onOptionMouseleave:Ro=()=>{}}=ue;const Do=createEventDispatcher();function Uo(ea,ia){return typeof go=="function"?go(ea,ia):ea===ia}const qo=(ea,ia,Jo)=>{if(!(Jo!=null&&Jo.length))return"";const sa=Jo.findIndex((Aa,pa)=>Uo(fo(Aa,pa),ia));return sa!==-1?ea(Jo[sa],sa):null},xo=(ea,ia,Jo)=>ea==null||ea===""?Jo===!1?"":Jo||"Choose an option":qo(uo,ea,ia)||"Choose an option",Zo=ea=>{Do("change",ea),eo(0,To=!1)},Xo=ea=>Uo(ea,io);function Yo(ea){To=ea,eo(0,To)}function Qo(ea){Vo=ea,eo(1,Vo)}function Ko(ea){bubble.call(this,to,ea)}function ra(ea){bubble.call(this,to,ea)}return to.$$set=ea=>{"value"in ea&&eo(2,io=ea.value),"id"in ea&&eo(3,ao=ea.id),"placeholder"in ea&&eo(4,so=ea.placeholder),"disabled"in ea&&eo(5,lo=ea.disabled),"options"in ea&&eo(6,co=ea.options),"getOptionLabel"in ea&&eo(7,uo=ea.getOptionLabel),"getOptionValue"in ea&&eo(8,fo=ea.getOptionValue),"getOptionIcon"in ea&&eo(9,po=ea.getOptionIcon),"getOptionColour"in ea&&eo(10,ho=ea.getOptionColour),"getOptionSubtitle"in ea&&eo(11,_o=ea.getOptionSubtitle),"compare"in ea&&eo(30,go=ea.compare),"useOptionIconImage"in ea&&eo(12,bo=ea.useOptionIconImage),"isOptionEnabled"in ea&&eo(13,vo=ea.isOptionEnabled),"readonly"in ea&&eo(14,yo=ea.readonly),"quiet"in ea&&eo(15,wo=ea.quiet),"autoWidth"in ea&&eo(16,ko=ea.autoWidth),"autocomplete"in ea&&eo(17,So=ea.autocomplete),"sort"in ea&&eo(18,Ao=ea.sort),"align"in ea&&eo(19,Io=ea.align),"footer"in ea&&eo(20,Eo=ea.footer),"open"in ea&&eo(0,To=ea.open),"tag"in ea&&eo(21,Mo=ea.tag),"searchTerm"in ea&&eo(1,Vo=ea.searchTerm),"loading"in ea&&eo(22,Fo=ea.loading),"onOptionMouseenter"in ea&&eo(23,Po=ea.onOptionMouseenter),"onOptionMouseleave"in ea&&eo(24,Ro=ea.onOptionMouseleave)},to.$$.update=()=>{to.$$.dirty[0]&84&&eo(27,no=xo(io,co,so)),to.$$.dirty[0]&580&&eo(26,ro=qo(po,io,co)),to.$$.dirty[0]&1092&&eo(25,oo=qo(ho,io,co))},[To,Vo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So,Ao,Io,Eo,Mo,Fo,Po,Ro,oo,ro,no,Uo,Zo,go,Xo,Yo,Qo,Ko,ra]}class Select extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bz,create_fragment$bC,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$6W(to){let ue,eo;return ue=new Select({props:{quiet:to[15],error:to[5],disabled:to[2],readonly:to[3],value:to[0],options:to[7],placeholder:to[6],autoWidth:to[16],sort:to[17],align:to[21],footer:to[22],getOptionLabel:to[8],getOptionValue:to[9],getOptionIcon:to[11],getOptionColour:to[12],getOptionSubtitle:to[10],useOptionIconImage:to[13],isOptionEnabled:to[14],autocomplete:to[19],customPopoverHeight:to[20],tag:to[23],compare:to[25],onOptionMouseenter:to[26],onOptionMouseleave:to[27]}}),ue.$on("change",to[28]),ue.$on("click",to[29]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&32768&&(oo.quiet=no[15]),ro[0]&32&&(oo.error=no[5]),ro[0]&4&&(oo.disabled=no[2]),ro[0]&8&&(oo.readonly=no[3]),ro[0]&1&&(oo.value=no[0]),ro[0]&128&&(oo.options=no[7]),ro[0]&64&&(oo.placeholder=no[6]),ro[0]&65536&&(oo.autoWidth=no[16]),ro[0]&131072&&(oo.sort=no[17]),ro[0]&2097152&&(oo.align=no[21]),ro[0]&4194304&&(oo.footer=no[22]),ro[0]&256&&(oo.getOptionLabel=no[8]),ro[0]&512&&(oo.getOptionValue=no[9]),ro[0]&2048&&(oo.getOptionIcon=no[11]),ro[0]&4096&&(oo.getOptionColour=no[12]),ro[0]&1024&&(oo.getOptionSubtitle=no[10]),ro[0]&8192&&(oo.useOptionIconImage=no[13]),ro[0]&16384&&(oo.isOptionEnabled=no[14]),ro[0]&524288&&(oo.autocomplete=no[19]),ro[0]&1048576&&(oo.customPopoverHeight=no[20]),ro[0]&8388608&&(oo.tag=no[23]),ro[0]&33554432&&(oo.compare=no[25]),ro[0]&67108864&&(oo.onOptionMouseenter=no[26]),ro[0]&134217728&&(oo.onOptionMouseleave=no[27]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bB(to){let ue,eo;return ue=new Field({props:{helpText:to[24],label:to[1],labelPosition:to[4],error:to[5],tooltip:to[18],$$slots:{default:[create_default_slot$6W]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&16777216&&(oo.helpText=no[24]),ro[0]&2&&(oo.label=no[1]),ro[0]&16&&(oo.labelPosition=no[4]),ro[0]&32&&(oo.error=no[5]),ro[0]&262144&&(oo.tooltip=no[18]),ro[0]&251396077|ro[1]&2&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$by(to,ue,eo){let{value:no=null}=ue,{label:ro=void 0}=ue,{disabled:oo=!1}=ue,{readonly:io=!1}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{placeholder:lo="Choose an option"}=ue,{options:co=[]}=ue,{getOptionLabel:uo=xo=>Uo(xo,"label")}=ue,{getOptionValue:fo=xo=>Uo(xo,"value")}=ue,{getOptionSubtitle:po=xo=>xo==null?void 0:xo.subtitle}=ue,{getOptionIcon:ho=xo=>xo==null?void 0:xo.icon}=ue,{getOptionColour:_o=xo=>xo==null?void 0:xo.colour}=ue,{useOptionIconImage:go=!1}=ue,{isOptionEnabled:bo=void 0}=ue,{quiet:vo=!1}=ue,{autoWidth:yo=!1}=ue,{sort:wo=!1}=ue,{tooltip:ko=""}=ue,{autocomplete:So=!1}=ue,{customPopoverHeight:Ao=void 0}=ue,{align:Io=void 0}=ue,{footer:Eo=null}=ue,{tag:To=null}=ue,{helpText:Mo=null}=ue,{compare:Vo=void 0}=ue,{onOptionMouseenter:Fo=()=>{}}=ue,{onOptionMouseleave:Po=()=>{}}=ue;const Ro=createEventDispatcher(),Do=xo=>{eo(0,no=xo.detail),Ro("change",xo.detail)},Uo=(xo,Zo)=>xo&&typeof xo=="object"?xo[Zo]:xo;function qo(xo){bubble.call(this,to,xo)}return to.$$set=xo=>{"value"in xo&&eo(0,no=xo.value),"label"in xo&&eo(1,ro=xo.label),"disabled"in xo&&eo(2,oo=xo.disabled),"readonly"in xo&&eo(3,io=xo.readonly),"labelPosition"in xo&&eo(4,ao=xo.labelPosition),"error"in xo&&eo(5,so=xo.error),"placeholder"in xo&&eo(6,lo=xo.placeholder),"options"in xo&&eo(7,co=xo.options),"getOptionLabel"in xo&&eo(8,uo=xo.getOptionLabel),"getOptionValue"in xo&&eo(9,fo=xo.getOptionValue),"getOptionSubtitle"in xo&&eo(10,po=xo.getOptionSubtitle),"getOptionIcon"in xo&&eo(11,ho=xo.getOptionIcon),"getOptionColour"in xo&&eo(12,_o=xo.getOptionColour),"useOptionIconImage"in xo&&eo(13,go=xo.useOptionIconImage),"isOptionEnabled"in xo&&eo(14,bo=xo.isOptionEnabled),"quiet"in xo&&eo(15,vo=xo.quiet),"autoWidth"in xo&&eo(16,yo=xo.autoWidth),"sort"in xo&&eo(17,wo=xo.sort),"tooltip"in xo&&eo(18,ko=xo.tooltip),"autocomplete"in xo&&eo(19,So=xo.autocomplete),"customPopoverHeight"in xo&&eo(20,Ao=xo.customPopoverHeight),"align"in xo&&eo(21,Io=xo.align),"footer"in xo&&eo(22,Eo=xo.footer),"tag"in xo&&eo(23,To=xo.tag),"helpText"in xo&&eo(24,Mo=xo.helpText),"compare"in xo&&eo(25,Vo=xo.compare),"onOptionMouseenter"in xo&&eo(26,Fo=xo.onOptionMouseenter),"onOptionMouseleave"in xo&&eo(27,Po=xo.onOptionMouseleave)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,So,Ao,Io,Eo,To,Mo,Vo,Fo,Po,Do,qo]}let Select_1$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$by,create_fragment$bB,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$r="",Combobox_svelte_svelte_type_style_lang="";function get_each_context$2c(to,ue,eo){const no=to.slice();return no[22]=ue[eo],no}function create_if_block$5q(to){let ue,eo=ensure_array_like(to[5]),no=[];for(let ro=0;ro<eo.length;ro+=1)no[ro]=create_each_block$2c(get_each_context$2c(to,eo,ro));return{c(){for(let ro=0;ro<no.length;ro+=1)no[ro].c();ue=empty$2()},m(ro,oo){for(let io=0;io<no.length;io+=1)no[io]&&no[io].m(ro,oo);insert$1(ro,ue,oo)},p(ro,oo){if(oo&8417){eo=ensure_array_like(ro[5]);let io;for(io=0;io<eo.length;io+=1){const ao=get_each_context$2c(ro,eo,io);no[io]?no[io].p(ao,oo):(no[io]=create_each_block$2c(ao),no[io].c(),no[io].m(ue.parentNode,ue))}for(;io<no.length;io+=1)no[io].d(1);no.length=eo.length}},d(ro){ro&&detach(ue),destroy_each(no,ro)}}}function create_each_block$2c(to){let ue,eo,no=to[6](to[22])+"",ro,oo,io,ao,so,lo,co;function uo(){return to[18](to[22])}return{c(){ue=element("li"),eo=element("span"),ro=text$1(no),oo=space$1(),io=svg_element("svg"),ao=svg_element("use"),so=space$1(),attr(eo,"class","spectrum-Menu-itemLabel svelte-otlbol"),xlink_attr(ao,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(io,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"),attr(io,"focusable","false"),attr(io,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[7](to[22])===to[0])},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),append$2(eo,ro),append$2(ue,oo),append$2(ue,io),append$2(io,ao),append$2(ue,so),lo||(co=listen(ue,"click",uo),lo=!0)},p(fo,po){to=fo,po&96&&no!==(no=to[6](to[22])+"")&&set_data(ro,no),po&161&&toggle_class(ue,"is-selected",to[7](to[22])===to[0])},d(fo){fo&&detach(ue),lo=!1,co()}}}function create_default_slot$6V(to){let ue,eo,no=to[5]&&Array.isArray(to[5]),ro,oo,io,ao=no&&create_if_block$5q(to);return{c(){ue=element("div"),eo=element("ul"),ao&&ao.c(),attr(eo,"class","spectrum-Menu"),attr(eo,"role","listbox"),attr(ue,"class","popover-content svelte-otlbol")},m(so,lo){insert$1(so,ue,lo),append$2(ue,eo),ao&&ao.m(eo,null),oo||(io=action_destroyer(ro=clickOutside.call(null,ue,to[19])),oo=!0)},p(so,lo){lo&32&&(no=so[5]&&Array.isArray(so[5])),no?ao?ao.p(so,lo):(ao=create_if_block$5q(so),ao.c(),ao.m(eo,null)):ao&&(ao.d(1),ao=null),ro&&is_function(ro.update)&&lo&256&&ro.update.call(null,so[19])},d(so){so&&detach(ue),ao&&ao.d(),oo=!1,io()}}}function create_fragment$bA(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho;return uo=new Popover({props:{anchor:to[10],open:to[8],align:"left",useAnchorWidth:!0,$$slots:{default:[create_default_slot$6V]},$$scope:{ctx:to}}}),uo.$on("close",to[20]),{c(){ue=element("div"),eo=element("div"),no=element("input"),io=space$1(),ao=element("button"),so=svg_element("svg"),lo=svg_element("use"),co=space$1(),create_component(uo.$$.fragment),attr(no,"id",to[1]),attr(no,"type","text"),no.value=ro=to[0]||"",attr(no,"placeholder",oo=to[2]||""),no.disabled=to[3],no.readOnly=to[4],attr(no,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-otlbol"),attr(eo,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-otlbol"),toggle_class(eo,"is-disabled",to[3]),toggle_class(eo,"is-focused",to[8]||to[9]),xlink_attr(lo,"xlink:href","#spectrum-css-icon-Chevron100"),attr(so,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon spectrum-InputGroup-icon"),attr(so,"focusable","false"),attr(so,"aria-hidden","true"),attr(ao,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button"),attr(ao,"tabindex","-1"),attr(ao,"aria-haspopup","true"),ao.disabled=to[3],attr(ue,"class","spectrum-InputGroup svelte-otlbol"),toggle_class(ue,"is-focused",to[8]||to[9]),toggle_class(ue,"is-disabled",to[3])},m(_o,go){insert$1(_o,ue,go),append$2(ue,eo),append$2(eo,no),append$2(ue,io),append$2(ue,ao),append$2(ao,so),append$2(so,lo),to[17](ue),insert$1(_o,co,go),mount_component(uo,_o,go),fo=!0,po||(ho=[listen(no,"focus",to[14]),listen(no,"blur",to[15]),listen(no,"change",to[12]),listen(ao,"click",to[16])],po=!0)},p(_o,[go]){(!fo||go&2)&&attr(no,"id",_o[1]),(!fo||go&1&&ro!==(ro=_o[0]||"")&&no.value!==ro)&&(no.value=ro),(!fo||go&4&&oo!==(oo=_o[2]||""))&&attr(no,"placeholder",oo),(!fo||go&8)&&(no.disabled=_o[3]),(!fo||go&16)&&(no.readOnly=_o[4]),(!fo||go&8)&&toggle_class(eo,"is-disabled",_o[3]),(!fo||go&768)&&toggle_class(eo,"is-focused",_o[8]||_o[9]),(!fo||go&8)&&(ao.disabled=_o[3]),(!fo||go&768)&&toggle_class(ue,"is-focused",_o[8]||_o[9]),(!fo||go&8)&&toggle_class(ue,"is-disabled",_o[3]);const bo={};go&1024&&(bo.anchor=_o[10]),go&256&&(bo.open=_o[8]),go&33554913&&(bo.$$scope={dirty:go,ctx:_o}),uo.$set(bo)},i(_o){fo||(transition_in(uo.$$.fragment,_o),fo=!0)},o(_o){transition_out(uo.$$.fragment,_o),fo=!1},d(_o){_o&&(detach(ue),detach(co)),to[17](null),destroy_component(uo,_o),po=!1,run_all(ho)}}}function instance$bx(to,ue,eo){let{value:no=void 0}=ue,{id:ro=void 0}=ue,{placeholder:oo="Choose an option or type"}=ue,{disabled:io=!1}=ue,{readonly:ao=!1}=ue,{options:so=[]}=ue,{getOptionLabel:lo=Eo=>`${Eo}`}=ue,{getOptionValue:co=Eo=>`${Eo}`}=ue;const uo=createEventDispatcher();let fo=!1,po=!1,ho;const _o=Eo=>{uo("change",Eo),eo(8,fo=!1)},go=Eo=>{const To=Eo.currentTarget.value;uo("type",To),_o(To)},bo=Eo=>{uo("pick",Eo),_o(Eo)},vo=()=>eo(9,po=!0),yo=()=>{eo(9,po=!1),uo("blur")},wo=()=>eo(8,fo=!fo);function ko(Eo){binding_callbacks[Eo?"unshift":"push"](()=>{ho=Eo,eo(10,ho)})}const So=Eo=>bo(co(Eo)),Ao=()=>eo(8,fo=!1),Io=()=>eo(8,fo=!1);return to.$$set=Eo=>{"value"in Eo&&eo(0,no=Eo.value),"id"in Eo&&eo(1,ro=Eo.id),"placeholder"in Eo&&eo(2,oo=Eo.placeholder),"disabled"in Eo&&eo(3,io=Eo.disabled),"readonly"in Eo&&eo(4,ao=Eo.readonly),"options"in Eo&&eo(5,so=Eo.options),"getOptionLabel"in Eo&&eo(6,lo=Eo.getOptionLabel),"getOptionValue"in Eo&&eo(7,co=Eo.getOptionValue)},[no,ro,oo,io,ao,so,lo,co,fo,po,ho,uo,go,bo,vo,yo,wo,ko,So,Ao,Io]}class Combobox extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bx,create_fragment$bA,safe_not_equal,{value:0,id:1,placeholder:2,disabled:3,readonly:4,options:5,getOptionLabel:6,getOptionValue:7})}}function create_default_slot$6U(to){let ue,eo;return ue=new Combobox({props:{error:to[5],disabled:to[2],value:to[0],options:to[7],placeholder:to[6],readonly:to[3],getOptionLabel:to[9],getOptionValue:to[10]}}),ue.$on("change",to[11]),ue.$on("pick",to[12]),ue.$on("type",to[13]),ue.$on("blur",to[14]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&32&&(oo.error=no[5]),ro&4&&(oo.disabled=no[2]),ro&1&&(oo.value=no[0]),ro&128&&(oo.options=no[7]),ro&64&&(oo.placeholder=no[6]),ro&8&&(oo.readonly=no[3]),ro&512&&(oo.getOptionLabel=no[9]),ro&1024&&(oo.getOptionValue=no[10]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bz(to){let ue,eo;return ue=new Field({props:{helpText:to[8],label:to[1],labelPosition:to[4],error:to[5],$$slots:{default:[create_default_slot$6U]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&256&&(oo.helpText=no[8]),ro&2&&(oo.label=no[1]),ro&16&&(oo.labelPosition=no[4]),ro&32&&(oo.error=no[5]),ro&132845&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bw(to,ue,eo){let{value:no=null}=ue,{label:ro=void 0}=ue,{disabled:oo=!1}=ue,{readonly:io=!1}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{placeholder:lo="Choose an option or type"}=ue,{options:co=[]}=ue,{helpText:uo=null}=ue,{getOptionLabel:fo=wo=>go(wo,"label")}=ue,{getOptionValue:po=wo=>go(wo,"value")}=ue;const ho=createEventDispatcher(),_o=wo=>{eo(0,no=wo.detail),ho("change",wo.detail)},go=(wo,ko)=>wo&&typeof wo=="object"?wo[ko]:wo;function bo(wo){bubble.call(this,to,wo)}function vo(wo){bubble.call(this,to,wo)}function yo(wo){bubble.call(this,to,wo)}return to.$$set=wo=>{"value"in wo&&eo(0,no=wo.value),"label"in wo&&eo(1,ro=wo.label),"disabled"in wo&&eo(2,oo=wo.disabled),"readonly"in wo&&eo(3,io=wo.readonly),"labelPosition"in wo&&eo(4,ao=wo.labelPosition),"error"in wo&&eo(5,so=wo.error),"placeholder"in wo&&eo(6,lo=wo.placeholder),"options"in wo&&eo(7,co=wo.options),"helpText"in wo&&eo(8,uo=wo.helpText),"getOptionLabel"in wo&&eo(9,fo=wo.getOptionLabel),"getOptionValue"in wo&&eo(10,po=wo.getOptionValue)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,_o,bo,vo,yo]}class Combobox_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bw,create_fragment$bz,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$q="",indexVars$p="",indexVars$o="";var AIOperationEnum=(to=>(to.SUMMARISE_TEXT="SUMMARISE_TEXT",to.CLEAN_DATA="CLEAN_DATA",to.TRANSLATE="TRANSLATE",to.CATEGORISE_TEXT="CATEGORISE_TEXT",to.SENTIMENT_ANALYSIS="SENTIMENT_ANALYSIS",to.PROMPT="PROMPT",to.SEARCH_WEB="SEARCH_WEB",to))(AIOperationEnum||{}),OperationFieldTypeEnum=(to=>(to.MULTI_COLUMN="columns",to.COLUMN="column",to.BINDABLE_TEXT="prompt",to))(OperationFieldTypeEnum||{}),Event$1=(to=>(to.USER_CREATED="user:created",to.USER_UPDATED="user:updated",to.USER_DELETED="user:deleted",to.USER_ONBOARDING_COMPLETE="user:onboarding:complete",to.USER_PERMISSION_ADMIN_ASSIGNED="user:admin:assigned",to.USER_PERMISSION_ADMIN_REMOVED="user:admin:removed",to.USER_PERMISSION_BUILDER_ASSIGNED="user:builder:assigned",to.USER_PERMISSION_BUILDER_REMOVED="user:builder:removed",to.USER_INVITED="user:invited",to.USER_INVITED_ACCEPTED="user:invite:accepted",to.USER_PASSWORD_FORCE_RESET="user:password:force:reset",to.USER_PASSWORD_UPDATED="user:password:updated",to.USER_PASSWORD_RESET_REQUESTED="user:password:reset:requested",to.USER_PASSWORD_RESET="user:password:reset",to.USER_DATA_COLLABORATION="user:data:collaboration",to.EMAIL_SMTP_CREATED="email:smtp:created",to.EMAIL_SMTP_UPDATED="email:smtp:updated",to.AI_CONFIG_CREATED="ai:config:created",to.AI_CONFIG_UPDATED="ai:config:updated",to.AUTH_SSO_CREATED="auth:sso:created",to.AUTH_SSO_UPDATED="auth:sso:updated",to.AUTH_SSO_ACTIVATED="auth:sso:activated",to.AUTH_SSO_DEACTIVATED="auth:sso:deactivated",to.AUTH_LOGIN="auth:login",to.AUTH_LOGOUT="auth:logout",to.ORG_NAME_UPDATED="org:info:name:updated",to.ORG_LOGO_UPDATED="org:info:logo:updated",to.ORG_PLATFORM_URL_UPDATED="org:platformurl:updated",to.INSTALLATION_VERSION_CHECKED="installation:version:checked",to.INSTALLATION_VERSION_UPGRADED="installation:version:upgraded",to.INSTALLATION_VERSION_DOWNGRADED="installation:version:downgraded",to.INSTALLATION_FIRST_STARTUP="installation:firstStartup",to.ANALYTICS_OPT_OUT="analytics:opt:out",to.ANALYTICS_OPT_IN="analytics:opt:in",to.APP_CREATED="app:created",to.APP_UPDATED="app:updated",to.APP_DELETED="app:deleted",to.APP_DUPLICATED="app:duplicated",to.APP_PUBLISHED="app:published",to.APP_UNPUBLISHED="app:unpublished",to.APP_TEMPLATE_IMPORTED="app:template:imported",to.APP_FILE_IMPORTED="app:file:imported",to.APP_VERSION_UPDATED="app:version:updated",to.APP_VERSION_REVERTED="app:version:reverted",to.APP_REVERTED="app:reverted",to.APP_EXPORTED="app:exported",to.ROLE_CREATED="role:created",to.ROLE_UPDATED="role:updated",to.ROLE_DELETED="role:deleted",to.ROLE_ASSIGNED="role:assigned",to.ROLE_UNASSIGNED="role:unassigned",to.SERVED_BUILDER="served:builder",to.SERVED_APP="served:app",to.SERVED_APP_PREVIEW="served:app:preview",to.DATASOURCE_CREATED="datasource:created",to.DATASOURCE_UPDATED="datasource:updated",to.DATASOURCE_DELETED="datasource:deleted",to.QUERY_CREATED="query:created",to.QUERY_UPDATED="query:updated",to.QUERY_DELETED="query:deleted",to.QUERY_IMPORT="query:import",to.QUERIES_RUN="queries:run",to.QUERY_PREVIEWED="query:previewed",to.TABLE_CREATED="table:created",to.TABLE_UPDATED="table:updated",to.TABLE_DELETED="table:deleted",to.TABLE_EXPORTED="table:exported",to.TABLE_IMPORTED="table:imported",to.TABLE_DATA_IMPORTED="table:data:imported",to.VIEW_CREATED="view:created",to.VIEW_UPDATED="view:updated",to.VIEW_DELETED="view:deleted",to.VIEW_EXPORTED="view:exported",to.VIEW_FILTER_CREATED="view:filter:created",to.VIEW_FILTER_UPDATED="view:filter:updated",to.VIEW_FILTER_DELETED="view:filter:deleted",to.VIEW_CALCULATION_CREATED="view:calculation:created",to.VIEW_CALCULATION_UPDATED="view:calculation:updated",to.VIEW_CALCULATION_DELETED="view:calculation:deleted",to.VIEW_JOIN_CREATED="view:join:created",to.ROWS_CREATED="rows:created",to.ROWS_IMPORTED="rows:imported",to.COMPONENT_CREATED="component:created",to.COMPONENT_DELETED="component:deleted",to.SCREEN_CREATED="screen:created",to.SCREEN_DELETED="screen:deleted",to.LAYOUT_CREATED="layout:created",to.LAYOUT_DELETED="layout:deleted",to.AUTOMATION_CREATED="automation:created",to.AUTOMATION_DELETED="automation:deleted",to.AUTOMATION_TESTED="automation:tested",to.AUTOMATIONS_RUN="automations:run",to.AUTOMATION_STEP_CREATED="automation:step:created",to.AUTOMATION_STEP_DELETED="automation:step:deleted",to.AUTOMATION_TRIGGER_UPDATED="automation:trigger:updated",to.LICENSE_PLAN_CHANGED="license:plan:changed",to.LICENSE_ACTIVATED="license:activated",to.LICENSE_PAYMENT_FAILED="license:payment:failed",to.LICENSE_PAYMENT_RECOVERED="license:payment:recovered",to.LICENSE_CHECKOUT_OPENED="license:checkout:opened",to.LICENSE_CHECKOUT_SUCCESS="license:checkout:success",to.LICENSE_PORTAL_OPENED="license:portal:opened",to.ACCOUNT_CREATED="account:created",to.ACCOUNT_DELETED="account:deleted",to.ACCOUNT_VERIFIED="account:verified",to.APP_BACKFILL_SUCCEEDED="app:backfill:succeeded",to.APP_BACKFILL_FAILED="app:backfill:failed",to.TENANT_BACKFILL_SUCCEEDED="tenant:backfill:succeeded",to.TENANT_BACKFILL_FAILED="tenant:backfill:failed",to.INSTALLATION_BACKFILL_SUCCEEDED="installation:backfill:succeeded",to.INSTALLATION_BACKFILL_FAILED="installation:backfill:failed",to.USER_GROUP_CREATED="user_group:created",to.USER_GROUP_UPDATED="user_group:updated",to.USER_GROUP_DELETED="user_group:deleted",to.USER_GROUP_USERS_ADDED="user_group:user_added",to.USER_GROUP_USERS_REMOVED="user_group:users_deleted",to.USER_GROUP_PERMISSIONS_EDITED="user_group:permissions_edited",to.USER_GROUP_ONBOARDING="user_group:onboarding_added",to.PLUGIN_INIT="plugin:init",to.PLUGIN_IMPORTED="plugin:imported",to.PLUGIN_DELETED="plugin:deleted",to.APP_BACKUP_RESTORED="app:backup:restored",to.APP_BACKUP_TRIGGERED="app:backup:triggered",to.ENVIRONMENT_VARIABLE_CREATED="environment_variable:created",to.ENVIRONMENT_VARIABLE_DELETED="environment_variable:deleted",to.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable:upgrade_panel_opened",to.AUDIT_LOGS_FILTERED="audit_log:filtered",to.AUDIT_LOGS_DOWNLOADED="audit_log:downloaded",to.ROW_ACTION_CREATED="row_action:created",to))(Event$1||{}),PlanType$1=(to=>(to.FREE="free",to.PRO="pro",to.TEAM="team",to.PREMIUM="premium",to.PREMIUM_PLUS="premium_plus",to.PREMIUM_PLUS_TRIAL="premium_plus_trial",to.BUSINESS="business",to.ENTERPRISE_BASIC="enterprise_basic",to.ENTERPRISE_BASIC_TRIAL="enterprise_basic_trial",to.ENTERPRISE="enterprise",to))(PlanType$1||{}),PlanModel$1=(to=>(to.PER_USER="perUser",to.PER_CREATOR_PER_USER="per_creator_per_user",to))(PlanModel$1||{}),StaticQuotaName=(to=>(to.ROWS="rows",to.APPS="apps",to.USERS="users",to.CREATORS="creators",to.USER_GROUPS="userGroups",to.PLUGINS="plugins",to.AI_CUSTOM_CONFIGS="aiCustomConfigs",to))(StaticQuotaName||{}),MonthlyQuotaName=(to=>(to.QUERIES="queries",to.AUTOMATIONS="automations",to.BUDIBASE_AI_CREDITS="budibaseAICredits",to))(MonthlyQuotaName||{}),Feature=(to=>(to.USER_GROUPS="userGroups",to.APP_BACKUPS="appBackups",to.ENVIRONMENT_VARIABLES="environmentVariables",to.AUDIT_LOGS="auditLogs",to.ENFORCEABLE_SSO="enforceableSSO",to.BRANDING="branding",to.SCIM="scim",to.SYNC_AUTOMATIONS="syncAutomations",to.TRIGGER_AUTOMATION_RUN="triggerAutomationRun",to.APP_BUILDERS="appBuilders",to.OFFLINE="offline",to.EXPANDED_PUBLIC_API="expandedPublicApi",to.VIEW_PERMISSIONS="viewPermissions",to.VIEW_READONLY_COLUMNS="viewReadonlyColumns",to.BUDIBASE_AI="budibaseAI",to.AI_CUSTOM_CONFIGS="aiCustomConfigs",to))(Feature||{}),SourceName=(to=>(to.POSTGRES="POSTGRES",to.DYNAMODB="DYNAMODB",to.MONGODB="MONGODB",to.ELASTICSEARCH="ELASTICSEARCH",to.COUCHDB="COUCHDB",to.SQL_SERVER="SQL_SERVER",to.S3="S3",to.AIRTABLE="AIRTABLE",to.MYSQL="MYSQL",to.ARANGODB="ARANGODB",to.REST="REST",to.ORACLE="ORACLE",to.GOOGLE_SHEETS="GOOGLE_SHEETS",to.FIRESTORE="FIRESTORE",to.REDIS="REDIS",to.SNOWFLAKE="SNOWFLAKE",to.BUDIBASE="BUDIBASE",to))(SourceName||{}),DatasourceFeature=(to=>(to.CONNECTION_CHECKING="connection",to.FETCH_TABLE_NAMES="fetch_table_names",to.EXPORT_SCHEMA="export_schema",to))(DatasourceFeature||{}),BasicOperator=(to=>(to.EQUAL="equal",to.NOT_EQUAL="notEqual",to.EMPTY="empty",to.NOT_EMPTY="notEmpty",to.FUZZY="fuzzy",to.STRING="string",to))(BasicOperator||{}),ArrayOperator=(to=>(to.CONTAINS="contains",to.NOT_CONTAINS="notContains",to.CONTAINS_ANY="containsAny",to.ONE_OF="oneOf",to))(ArrayOperator||{}),RangeOperator=(to=>(to.RANGE="range",to))(RangeOperator||{}),LogicalOperator=(to=>(to.AND="$and",to.OR="$or",to))(LogicalOperator||{});function isLogicalSearchOperator(to){return Object.values(LogicalOperator).includes(to)}function isBasicSearchOperator(to){return Object.values(BasicOperator).includes(to)}function isArraySearchOperator(to){return Object.values(ArrayOperator).includes(to)}function isRangeSearchOperator(to){return Object.values(RangeOperator).includes(to)}var InternalSearchFilterOperator=(to=>(to.COMPLEX_ID_OPERATOR="_complexIdOperator",to))(InternalSearchFilterOperator||{}),EmptyFilterOption=(to=>(to.RETURN_ALL="all",to.RETURN_NONE="none",to))(EmptyFilterOption||{}),UILogicalOperator=(to=>(to.ALL="all",to.ANY="any",to))(UILogicalOperator||{});const FeatureFlagDefaults={USE_ZOD_VALIDATOR:!1,CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS:!1,DIRECT_LOGIN_TO_ACCOUNT_PORTAL:!1};Event$1.PLUGIN_INIT;var PermissionSource=(to=>(to.EXPLICIT="EXPLICIT",to.INHERITED="INHERITED",to.BASE="BASE",to))(PermissionSource||{}),RowExportFormat=(to=>(to.CSV="csv",to.JSON="json",to.JSON_WITH_SCHEMA="jsonWithSchema",to))(RowExportFormat||{}),AutomationIOType=(to=>(to.OBJECT="object",to.STRING="string",to.BOOLEAN="boolean",to.NUMBER="number",to.ARRAY="array",to.JSON="json",to.DATE="date",to.ATTACHMENT="attachment",to))(AutomationIOType||{}),AutomationCustomIOType=(to=>(to.TABLE="table",to.ROW="row",to.ROWS="rows",to.WIDE="wide",to.QUERY="query",to.QUERY_PARAMS="queryParams",to.QUERY_LIMIT="queryLimit",to.LOOP_OPTION="loopOption",to.ITEM="item",to.CODE="code",to.FILTERS="filters",to.COLUMN="column",to.TRIGGER_SCHEMA="triggerSchema",to.CRON="cron",to.WEBHOOK_URL="webhookUrl",to.AUTOMATION="automation",to.AUTOMATION_FIELDS="automationFields",to.MULTI_ATTACHMENTS="multi_attachments",to.TRIGGER_FILTER="trigger_filter",to))(AutomationCustomIOType||{}),AutomationTriggerStepId=(to=>(to.ROW_SAVED="ROW_SAVED",to.ROW_UPDATED="ROW_UPDATED",to.ROW_DELETED="ROW_DELETED",to.WEBHOOK="WEBHOOK",to.APP="APP",to.CRON="CRON",to.ROW_ACTION="ROW_ACTION",to))(AutomationTriggerStepId||{}),AutomationStepType=(to=>(to.LOGIC="LOGIC",to.ACTION="ACTION",to.TRIGGER="TRIGGER",to))(AutomationStepType||{}),AutomationActionStepId=(to=>(to.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",to.CREATE_ROW="CREATE_ROW",to.UPDATE_ROW="UPDATE_ROW",to.DELETE_ROW="DELETE_ROW",to.EXECUTE_BASH="EXECUTE_BASH",to.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",to.EXECUTE_SCRIPT="EXECUTE_SCRIPT",to.EXECUTE_QUERY="EXECUTE_QUERY",to.SERVER_LOG="SERVER_LOG",to.DELAY="DELAY",to.FILTER="FILTER",to.QUERY_ROWS="QUERY_ROWS",to.LOOP="LOOP",to.COLLECT="COLLECT",to.OPENAI="OPENAI",to.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",to.BRANCH="BRANCH",to.discord="discord",to.slack="slack",to.zapier="zapier",to.integromat="integromat",to.n8n="n8n",to))(AutomationActionStepId||{});[...Object.values(AutomationActionStepId),...Object.values(AutomationTriggerStepId)];var AutomationFeature=(to=>(to.LOOPING="LOOPING",to))(AutomationFeature||{}),AutomationEventType=(to=>(to.ROW_SAVE="row:save",to.ROW_UPDATE="row:update",to.ROW_DELETE="row:delete",to.APP_TRIGGER="app:trigger",to.CRON_TRIGGER="cron:trigger",to.WEBHOOK_TRIGGER="web:trigger",to.ROW_ACTION="row:action",to))(AutomationEventType||{}),HttpMethod=(to=>(to.GET="GET",to.POST="POST",to.PATCH="PATCH",to.PUT="PUT",to.HEAD="HEAD",to.DELETE="DELETE",to))(HttpMethod||{});const INTERNAL_TABLE_SOURCE_ID="bb_internal";var FieldType=(to=>(to.STRING="string",to.LONGFORM="longform",to.OPTIONS="options",to.NUMBER="number",to.BOOLEAN="boolean",to.ARRAY="array",to.DATETIME="datetime",to.ATTACHMENTS="attachment",to.ATTACHMENT_SINGLE="attachment_single",to.LINK="link",to.FORMULA="formula",to.AUTO="auto",to.AI="ai",to.JSON="json",to.INTERNAL="internal",to.BARCODEQR="barcodeqr",to.SIGNATURE_SINGLE="signature_single",to.BIGINT="bigint",to.BB_REFERENCE="bb_reference",to.BB_REFERENCE_SINGLE="bb_reference_single",to))(FieldType||{});const NumericTypes=["number","bigint"];function isNumeric$1(to){return NumericTypes.includes(to)}const GroupByTypes=["string","longform","options","number","boolean","datetime","bigint","ai"];function canGroupBy(to){return GroupByTypes.includes(to)}var RelationshipType=(to=>(to.ONE_TO_MANY="one-to-many",to.MANY_TO_ONE="many-to-one",to.MANY_TO_MANY="many-to-many",to))(RelationshipType||{}),AutoFieldSubType=(to=>(to.CREATED_BY="createdBy",to.CREATED_AT="createdAt",to.UPDATED_BY="updatedBy",to.UPDATED_AT="updatedAt",to.AUTO_ID="autoID",to))(AutoFieldSubType||{}),FormulaType=(to=>(to.STATIC="static",to.DYNAMIC="dynamic",to.AI="ai",to))(FormulaType||{}),BBReferenceFieldSubType=(to=>(to.USER="user",to.USERS="users",to))(BBReferenceFieldSubType||{});function isRelationshipField(to){return to.type===FieldType.LINK}var CalculationType=(to=>(to.SUM="sum",to.AVG="avg",to.COUNT="count",to.MIN="min",to.MAX="max",to))(CalculationType||{}),ViewV2Type=(to=>(to.CALCULATION="calculation",to))(ViewV2Type||{});const SEPARATOR$1="_",prefixed=to=>`${to}${SEPARATOR$1}`;var DocumentType=(to=>(to.USER="us",to.GROUP="gr",to.WORKSPACE="workspace",to.CONFIG="config",to.TEMPLATE="template",to.APP="app",to.DEV="dev",to.APP_DEV="app_dev",to.APP_METADATA="app_metadata",to.ROLE="role",to.MIGRATIONS="migrations",to.DEV_INFO="devinfo",to.AUTOMATION_LOG="log_au",to.ACCOUNT_METADATA="acc_metadata",to.PLUGIN="plg",to.DATASOURCE="datasource",to.DATASOURCE_PLUS="datasource_plus",to.APP_BACKUP="backup",to.TABLE="ta",to.ROW="ro",to.AUTOMATION="au",to.LINK="li",to.WEBHOOK="wh",to.INSTANCE="inst",to.LAYOUT="layout",to.SCREEN="screen",to.QUERY="query",to.DEPLOYMENTS="deployments",to.METADATA="metadata",to.MEM_VIEW="view",to.USER_FLAG="flag",to.AUTOMATION_METADATA="meta_au",to.AUDIT_LOG="al",to.APP_MIGRATION_METADATA="_design/migrations",to.SCIM_LOG="scimlog",to.ROW_ACTIONS="ra",to))(DocumentType||{});Object.values(DocumentType).sort((to,ue)=>ue.length-to.length);var InternalTable=(to=>(to.USER_METADATA="ta_users",to))(InternalTable||{}),VirtualDocumentType=(to=>(to.VIEW="view",to.ROW_ACTION="row_action",to))(VirtualDocumentType||{});Object.values(VirtualDocumentType).sort((to,ue)=>ue.length-to.length);var Theme=(to=>(to.LIGHTEST="lightest",to.LIGHT="light",to.DARK="dark",to.DARKEST="darkest",to.NORD="nord",to.MIDNIGHT="midnight",to))(Theme||{}),DeploymentStatus=(to=>(to.SUCCESS="SUCCESS",to.PENDING="PENDING",to.FAILURE="FAILURE",to))(DeploymentStatus||{});const isConfig=to=>"type"in to&&"config"in to,isSCIMConfig=to=>to.type==="scim";var ConfigType=(to=>(to.SETTINGS="settings",to.ACCOUNT="account",to.SMTP="smtp",to.GOOGLE="google",to.OIDC="oidc",to.OIDC_LOGOS="logos_oidc",to.SCIM="scim",to.AI="ai",to))(ConfigType||{});function isSSOUser(to){return!!to.providerType}var PluginType=(to=>(to.DATASOURCE="datasource",to.COMPONENT="component",to.AUTOMATION="automation",to))(PluginType||{});Object.values(PluginType);StaticQuotaName.ROWS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;var SortOrder=(to=>(to.ASCENDING="ascending",to.DESCENDING="descending",to))(SortOrder||{}),SortType=(to=>(to.STRING="string",to.NUMBER="number",to))(SortType||{}),util$g;(function(to){to.assertEqual=ro=>ro;function ue(ro){}to.assertIs=ue;function eo(ro){throw new Error}to.assertNever=eo,to.arrayToEnum=ro=>{const oo={};for(const io of ro)oo[io]=io;return oo},to.getValidEnumValues=ro=>{const oo=to.objectKeys(ro).filter(ao=>typeof ro[ro[ao]]!="number"),io={};for(const ao of oo)io[ao]=ro[ao];return to.objectValues(io)},to.objectValues=ro=>to.objectKeys(ro).map(function(oo){return ro[oo]}),to.objectKeys=typeof Object.keys=="function"?ro=>Object.keys(ro):ro=>{const oo=[];for(const io in ro)Object.prototype.hasOwnProperty.call(ro,io)&&oo.push(io);return oo},to.find=(ro,oo)=>{for(const io of ro)if(oo(io))return io},to.isInteger=typeof Number.isInteger=="function"?ro=>Number.isInteger(ro):ro=>typeof ro=="number"&&isFinite(ro)&&Math.floor(ro)===ro;function no(ro,oo=" | "){return ro.map(io=>typeof io=="string"?`'${io}'`:io).join(oo)}to.joinValues=no,to.jsonStringifyReplacer=(ro,oo)=>typeof oo=="bigint"?oo.toString():oo})(util$g||(util$g={}));var objectUtil;(function(to){to.mergeShapes=(ue,eo)=>({...ue,...eo})})(objectUtil||(objectUtil={}));const ZodParsedType=util$g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=to=>{switch(typeof to){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(to)?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(to)?ZodParsedType.array:to===null?ZodParsedType.null:to.then&&typeof to.then=="function"&&to.catch&&typeof to.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&to instanceof Map?ZodParsedType.map:typeof Set<"u"&&to instanceof Set?ZodParsedType.set:typeof Date<"u"&&to instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$g.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=to=>JSON.stringify(to,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(ue){super(),this.issues=[],this.addIssue=no=>{this.issues=[...this.issues,no]},this.addIssues=(no=[])=>{this.issues=[...this.issues,...no]};const eo=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,eo):this.__proto__=eo,this.name="ZodError",this.issues=ue}get errors(){return this.issues}format(ue){const eo=ue||function(oo){return oo.message},no={_errors:[]},ro=oo=>{for(const io of oo.issues)if(io.code==="invalid_union")io.unionErrors.map(ro);else if(io.code==="invalid_return_type")ro(io.returnTypeError);else if(io.code==="invalid_arguments")ro(io.argumentsError);else if(io.path.length===0)no._errors.push(eo(io));else{let ao=no,so=0;for(;so<io.path.length;){const lo=io.path[so];so===io.path.length-1?(ao[lo]=ao[lo]||{_errors:[]},ao[lo]._errors.push(eo(io))):ao[lo]=ao[lo]||{_errors:[]},ao=ao[lo],so++}}};return ro(this),no}static assert(ue){if(!(ue instanceof ZodError))throw new Error(`Not a ZodError: ${ue}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$g.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(ue=eo=>eo.message){const eo={},no=[];for(const ro of this.issues)ro.path.length>0?(eo[ro.path[0]]=eo[ro.path[0]]||[],eo[ro.path[0]].push(ue(ro))):no.push(ue(ro));return{formErrors:no,fieldErrors:eo}}get formErrors(){return this.flatten()}}ZodError.create=to=>new ZodError(to);const errorMap=(to,ue)=>{let eo;switch(to.code){case ZodIssueCode.invalid_type:to.received===ZodParsedType.undefined?eo="Required":eo=`Expected ${to.expected}, received ${to.received}`;break;case ZodIssueCode.invalid_literal:eo=`Invalid literal value, expected ${JSON.stringify(to.expected,util$g.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:eo=`Unrecognized key(s) in object: ${util$g.joinValues(to.keys,", ")}`;break;case ZodIssueCode.invalid_union:eo="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:eo=`Invalid discriminator value. Expected ${util$g.joinValues(to.options)}`;break;case ZodIssueCode.invalid_enum_value:eo=`Invalid enum value. Expected ${util$g.joinValues(to.options)}, received '${to.received}'`;break;case ZodIssueCode.invalid_arguments:eo="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:eo="Invalid function return type";break;case ZodIssueCode.invalid_date:eo="Invalid date";break;case ZodIssueCode.invalid_string:typeof to.validation=="object"?"includes"in to.validation?(eo=`Invalid input: must include "${to.validation.includes}"`,typeof to.validation.position=="number"&&(eo=`${eo} at one or more positions greater than or equal to ${to.validation.position}`)):"startsWith"in to.validation?eo=`Invalid input: must start with "${to.validation.startsWith}"`:"endsWith"in to.validation?eo=`Invalid input: must end with "${to.validation.endsWith}"`:util$g.assertNever(to.validation):to.validation!=="regex"?eo=`Invalid ${to.validation}`:eo="Invalid";break;case ZodIssueCode.too_small:to.type==="array"?eo=`Array must contain ${to.exact?"exactly":to.inclusive?"at least":"more than"} ${to.minimum} element(s)`:to.type==="string"?eo=`String must contain ${to.exact?"exactly":to.inclusive?"at least":"over"} ${to.minimum} character(s)`:to.type==="number"?eo=`Number must be ${to.exact?"exactly equal to ":to.inclusive?"greater than or equal to ":"greater than "}${to.minimum}`:to.type==="date"?eo=`Date must be ${to.exact?"exactly equal to ":to.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(to.minimum))}`:eo="Invalid input";break;case ZodIssueCode.too_big:to.type==="array"?eo=`Array must contain ${to.exact?"exactly":to.inclusive?"at most":"less than"} ${to.maximum} element(s)`:to.type==="string"?eo=`String must contain ${to.exact?"exactly":to.inclusive?"at most":"under"} ${to.maximum} character(s)`:to.type==="number"?eo=`Number must be ${to.exact?"exactly":to.inclusive?"less than or equal to":"less than"} ${to.maximum}`:to.type==="bigint"?eo=`BigInt must be ${to.exact?"exactly":to.inclusive?"less than or equal to":"less than"} ${to.maximum}`:to.type==="date"?eo=`Date must be ${to.exact?"exactly":to.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(to.maximum))}`:eo="Invalid input";break;case ZodIssueCode.custom:eo="Invalid input";break;case ZodIssueCode.invalid_intersection_types:eo="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:eo=`Number must be a multiple of ${to.multipleOf}`;break;case ZodIssueCode.not_finite:eo="Number must be finite";break;default:eo=ue.defaultError,util$g.assertNever(to)}return{message:eo}};let overrideErrorMap=errorMap;function setErrorMap(to){overrideErrorMap=to}function getErrorMap(){return overrideErrorMap}const makeIssue=to=>{const{data:ue,path:eo,errorMaps:no,issueData:ro}=to,oo=[...eo,...ro.path||[]],io={...ro,path:oo};if(ro.message!==void 0)return{...ro,path:oo,message:ro.message};let ao="";const so=no.filter(lo=>!!lo).slice().reverse();for(const lo of so)ao=lo(io,{data:ue,defaultError:ao}).message;return{...ro,path:oo,message:ao}},EMPTY_PATH=[];function addIssueToContext(to,ue){const eo=getErrorMap(),no=makeIssue({issueData:ue,data:to.data,path:to.path,errorMaps:[to.common.contextualErrorMap,to.schemaErrorMap,eo,eo===errorMap?void 0:errorMap].filter(ro=>!!ro)});to.common.issues.push(no)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(ue,eo){const no=[];for(const ro of eo){if(ro.status==="aborted")return INVALID$3;ro.status==="dirty"&&ue.dirty(),no.push(ro.value)}return{status:ue.value,value:no}}static async mergeObjectAsync(ue,eo){const no=[];for(const ro of eo){const oo=await ro.key,io=await ro.value;no.push({key:oo,value:io})}return ParseStatus.mergeObjectSync(ue,no)}static mergeObjectSync(ue,eo){const no={};for(const ro of eo){const{key:oo,value:io}=ro;if(oo.status==="aborted"||io.status==="aborted")return INVALID$3;oo.status==="dirty"&&ue.dirty(),io.status==="dirty"&&ue.dirty(),oo.value!=="__proto__"&&(typeof io.value<"u"||ro.alwaysSet)&&(no[oo.value]=io.value)}return{status:ue.value,value:no}}}const INVALID$3=Object.freeze({status:"aborted"}),DIRTY=to=>({status:"dirty",value:to}),OK=to=>({status:"valid",value:to}),isAborted=to=>to.status==="aborted",isDirty=to=>to.status==="dirty",isValid$2=to=>to.status==="valid",isAsync=to=>typeof Promise<"u"&&to instanceof Promise;function __classPrivateFieldGet(to,ue,eo,no){if(eo==="a"&&!no)throw new TypeError("Private accessor was defined without a getter");if(typeof ue=="function"?to!==ue||!no:!ue.has(to))throw new TypeError("Cannot read private member from an object whose class did not declare it");return eo==="m"?no:eo==="a"?no.call(to):no?no.value:ue.get(to)}function __classPrivateFieldSet(to,ue,eo,no,ro){if(no==="m")throw new TypeError("Private method is not writable");if(no==="a"&&!ro)throw new TypeError("Private accessor was defined without a setter");if(typeof ue=="function"?to!==ue||!ro:!ue.has(to))throw new TypeError("Cannot write private member to an object whose class did not declare it");return no==="a"?ro.call(to,eo):ro?ro.value=eo:ue.set(to,eo),eo}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(to){to.errToObj=ue=>typeof ue=="string"?{message:ue}:ue||{},to.toString=ue=>typeof ue=="string"?ue:ue==null?void 0:ue.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(ue,eo,no,ro){this._cachedPath=[],this.parent=ue,this.data=eo,this._path=no,this._key=ro}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=(to,ue)=>{if(isValid$2(ue))return{success:!0,data:ue.value};if(!to.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const eo=new ZodError(to.common.issues);return this._error=eo,this._error}}};function processCreateParams(to){if(!to)return{};const{errorMap:ue,invalid_type_error:eo,required_error:no,description:ro}=to;if(ue&&(eo||no))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return ue?{errorMap:ue,description:ro}:{errorMap:(io,ao)=>{var so,lo;const{message:co}=to;return io.code==="invalid_enum_value"?{message:co??ao.defaultError}:typeof ao.data>"u"?{message:(so=co??no)!==null&&so!==void 0?so:ao.defaultError}:io.code!=="invalid_type"?{message:ao.defaultError}:{message:(lo=co??eo)!==null&&lo!==void 0?lo:ao.defaultError}},description:ro}}class ZodType{constructor(ue){this.spa=this.safeParseAsync,this._def=ue,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(ue){return getParsedType(ue.data)}_getOrReturnCtx(ue,eo){return eo||{common:ue.parent.common,data:ue.data,parsedType:getParsedType(ue.data),schemaErrorMap:this._def.errorMap,path:ue.path,parent:ue.parent}}_processInputParams(ue){return{status:new ParseStatus,ctx:{common:ue.parent.common,data:ue.data,parsedType:getParsedType(ue.data),schemaErrorMap:this._def.errorMap,path:ue.path,parent:ue.parent}}}_parseSync(ue){const eo=this._parse(ue);if(isAsync(eo))throw new Error("Synchronous parse encountered promise.");return eo}_parseAsync(ue){const eo=this._parse(ue);return Promise.resolve(eo)}parse(ue,eo){const no=this.safeParse(ue,eo);if(no.success)return no.data;throw no.error}safeParse(ue,eo){var no;const ro={common:{issues:[],async:(no=eo==null?void 0:eo.async)!==null&&no!==void 0?no:!1,contextualErrorMap:eo==null?void 0:eo.errorMap},path:(eo==null?void 0:eo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ue,parsedType:getParsedType(ue)},oo=this._parseSync({data:ue,path:ro.path,parent:ro});return handleResult(ro,oo)}async parseAsync(ue,eo){const no=await this.safeParseAsync(ue,eo);if(no.success)return no.data;throw no.error}async safeParseAsync(ue,eo){const no={common:{issues:[],contextualErrorMap:eo==null?void 0:eo.errorMap,async:!0},path:(eo==null?void 0:eo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ue,parsedType:getParsedType(ue)},ro=this._parse({data:ue,path:no.path,parent:no}),oo=await(isAsync(ro)?ro:Promise.resolve(ro));return handleResult(no,oo)}refine(ue,eo){const no=ro=>typeof eo=="string"||typeof eo>"u"?{message:eo}:typeof eo=="function"?eo(ro):eo;return this._refinement((ro,oo)=>{const io=ue(ro),ao=()=>oo.addIssue({code:ZodIssueCode.custom,...no(ro)});return typeof Promise<"u"&&io instanceof Promise?io.then(so=>so?!0:(ao(),!1)):io?!0:(ao(),!1)})}refinement(ue,eo){return this._refinement((no,ro)=>ue(no)?!0:(ro.addIssue(typeof eo=="function"?eo(no,ro):eo),!1))}_refinement(ue){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:ue}})}superRefine(ue){return this._refinement(ue)}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(ue){return ZodUnion.create([this,ue],this._def)}and(ue){return ZodIntersection.create(this,ue,this._def)}transform(ue){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:ue}})}default(ue){const eo=typeof ue=="function"?ue:()=>ue;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:eo,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(ue){const eo=typeof ue=="function"?ue:()=>ue;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:eo,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(ue){const eo=this.constructor;return new eo({...this._def,description:ue})}pipe(ue){return ZodPipeline.create(this,ue)}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(to){let ue="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return to.precision?ue=`${ue}\\.\\d{${to.precision}}`:to.precision==null&&(ue=`${ue}(\\.\\d+)?`),ue}function timeRegex(to){return new RegExp(`^${timeRegexSource(to)}$`)}function datetimeRegex(to){let ue=`${dateRegexSource}T${timeRegexSource(to)}`;const eo=[];return eo.push(to.local?"Z?":"Z"),to.offset&&eo.push("([+-]\\d{2}:?\\d{2})"),ue=`${ue}(${eo.join("|")})`,new RegExp(`^${ue}$`)}function isValidIP(to,ue){return!!((ue==="v4"||!ue)&&ipv4Regex.test(to)||(ue==="v6"||!ue)&&ipv6Regex.test(to))}class ZodString extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=String(ue.data)),this._getType(ue)!==ZodParsedType.string){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:oo.parsedType}),INVALID$3}const no=new ParseStatus;let ro;for(const oo of this._def.checks)if(oo.kind==="min")ue.data.length<oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_small,minimum:oo.value,type:"string",inclusive:!0,exact:!1,message:oo.message}),no.dirty());else if(oo.kind==="max")ue.data.length>oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_big,maximum:oo.value,type:"string",inclusive:!0,exact:!1,message:oo.message}),no.dirty());else if(oo.kind==="length"){const io=ue.data.length>oo.value,ao=ue.data.length<oo.value;(io||ao)&&(ro=this._getOrReturnCtx(ue,ro),io?addIssueToContext(ro,{code:ZodIssueCode.too_big,maximum:oo.value,type:"string",inclusive:!0,exact:!0,message:oo.message}):ao&&addIssueToContext(ro,{code:ZodIssueCode.too_small,minimum:oo.value,type:"string",inclusive:!0,exact:!0,message:oo.message}),no.dirty())}else if(oo.kind==="email")emailRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"email",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"emoji",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="uuid")uuidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"uuid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="nanoid")nanoidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="cuid")cuidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"cuid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="cuid2")cuid2Regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="ulid")ulidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"ulid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="url")try{new URL(ue.data)}catch{ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"url",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()}else oo.kind==="regex"?(oo.regex.lastIndex=0,oo.regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"regex",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty())):oo.kind==="trim"?ue.data=ue.data.trim():oo.kind==="includes"?ue.data.includes(oo.value,oo.position)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{includes:oo.value,position:oo.position},message:oo.message}),no.dirty()):oo.kind==="toLowerCase"?ue.data=ue.data.toLowerCase():oo.kind==="toUpperCase"?ue.data=ue.data.toUpperCase():oo.kind==="startsWith"?ue.data.startsWith(oo.value)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{startsWith:oo.value},message:oo.message}),no.dirty()):oo.kind==="endsWith"?ue.data.endsWith(oo.value)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{endsWith:oo.value},message:oo.message}),no.dirty()):oo.kind==="datetime"?datetimeRegex(oo).test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"datetime",message:oo.message}),no.dirty()):oo.kind==="date"?dateRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"date",message:oo.message}),no.dirty()):oo.kind==="time"?timeRegex(oo).test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"time",message:oo.message}),no.dirty()):oo.kind==="duration"?durationRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"duration",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):oo.kind==="ip"?isValidIP(ue.data,oo.version)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"ip",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):oo.kind==="base64"?base64Regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"base64",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):util$g.assertNever(oo);return{status:no.value,value:ue.data}}_regex(ue,eo,no){return this.refinement(ro=>ue.test(ro),{validation:eo,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(no)})}_addCheck(ue){return new ZodString({...this._def,checks:[...this._def.checks,ue]})}email(ue){return this._addCheck({kind:"email",...errorUtil.errToObj(ue)})}url(ue){return this._addCheck({kind:"url",...errorUtil.errToObj(ue)})}emoji(ue){return this._addCheck({kind:"emoji",...errorUtil.errToObj(ue)})}uuid(ue){return this._addCheck({kind:"uuid",...errorUtil.errToObj(ue)})}nanoid(ue){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(ue)})}cuid(ue){return this._addCheck({kind:"cuid",...errorUtil.errToObj(ue)})}cuid2(ue){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(ue)})}ulid(ue){return this._addCheck({kind:"ulid",...errorUtil.errToObj(ue)})}base64(ue){return this._addCheck({kind:"base64",...errorUtil.errToObj(ue)})}ip(ue){return this._addCheck({kind:"ip",...errorUtil.errToObj(ue)})}datetime(ue){var eo,no;return typeof ue=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:ue}):this._addCheck({kind:"datetime",precision:typeof(ue==null?void 0:ue.precision)>"u"?null:ue==null?void 0:ue.precision,offset:(eo=ue==null?void 0:ue.offset)!==null&&eo!==void 0?eo:!1,local:(no=ue==null?void 0:ue.local)!==null&&no!==void 0?no:!1,...errorUtil.errToObj(ue==null?void 0:ue.message)})}date(ue){return this._addCheck({kind:"date",message:ue})}time(ue){return typeof ue=="string"?this._addCheck({kind:"time",precision:null,message:ue}):this._addCheck({kind:"time",precision:typeof(ue==null?void 0:ue.precision)>"u"?null:ue==null?void 0:ue.precision,...errorUtil.errToObj(ue==null?void 0:ue.message)})}duration(ue){return this._addCheck({kind:"duration",...errorUtil.errToObj(ue)})}regex(ue,eo){return this._addCheck({kind:"regex",regex:ue,...errorUtil.errToObj(eo)})}includes(ue,eo){return this._addCheck({kind:"includes",value:ue,position:eo==null?void 0:eo.position,...errorUtil.errToObj(eo==null?void 0:eo.message)})}startsWith(ue,eo){return this._addCheck({kind:"startsWith",value:ue,...errorUtil.errToObj(eo)})}endsWith(ue,eo){return this._addCheck({kind:"endsWith",value:ue,...errorUtil.errToObj(eo)})}min(ue,eo){return this._addCheck({kind:"min",value:ue,...errorUtil.errToObj(eo)})}max(ue,eo){return this._addCheck({kind:"max",value:ue,...errorUtil.errToObj(eo)})}length(ue,eo){return this._addCheck({kind:"length",value:ue,...errorUtil.errToObj(eo)})}nonempty(ue){return this.min(1,errorUtil.errToObj(ue))}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(ue=>ue.kind==="datetime")}get isDate(){return!!this._def.checks.find(ue=>ue.kind==="date")}get isTime(){return!!this._def.checks.find(ue=>ue.kind==="time")}get isDuration(){return!!this._def.checks.find(ue=>ue.kind==="duration")}get isEmail(){return!!this._def.checks.find(ue=>ue.kind==="email")}get isURL(){return!!this._def.checks.find(ue=>ue.kind==="url")}get isEmoji(){return!!this._def.checks.find(ue=>ue.kind==="emoji")}get isUUID(){return!!this._def.checks.find(ue=>ue.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(ue=>ue.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(ue=>ue.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(ue=>ue.kind==="cuid2")}get isULID(){return!!this._def.checks.find(ue=>ue.kind==="ulid")}get isIP(){return!!this._def.checks.find(ue=>ue.kind==="ip")}get isBase64(){return!!this._def.checks.find(ue=>ue.kind==="base64")}get minLength(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxLength(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}}ZodString.create=to=>{var ue;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(ue=to==null?void 0:to.coerce)!==null&&ue!==void 0?ue:!1,...processCreateParams(to)})};function floatSafeRemainder(to,ue){const eo=(to.toString().split(".")[1]||"").length,no=(ue.toString().split(".")[1]||"").length,ro=eo>no?eo:no,oo=parseInt(to.toFixed(ro).replace(".","")),io=parseInt(ue.toFixed(ro).replace(".",""));return oo%io/Math.pow(10,ro)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(ue){if(this._def.coerce&&(ue.data=Number(ue.data)),this._getType(ue)!==ZodParsedType.number){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:oo.parsedType}),INVALID$3}let no;const ro=new ParseStatus;for(const oo of this._def.checks)oo.kind==="int"?util$g.isInteger(ue.data)||(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:oo.message}),ro.dirty()):oo.kind==="min"?(oo.inclusive?ue.data<oo.value:ue.data<=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:oo.value,type:"number",inclusive:oo.inclusive,exact:!1,message:oo.message}),ro.dirty()):oo.kind==="max"?(oo.inclusive?ue.data>oo.value:ue.data>=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:oo.value,type:"number",inclusive:oo.inclusive,exact:!1,message:oo.message}),ro.dirty()):oo.kind==="multipleOf"?floatSafeRemainder(ue.data,oo.value)!==0&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_multiple_of,multipleOf:oo.value,message:oo.message}),ro.dirty()):oo.kind==="finite"?Number.isFinite(ue.data)||(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_finite,message:oo.message}),ro.dirty()):util$g.assertNever(oo);return{status:ro.value,value:ue.data}}gte(ue,eo){return this.setLimit("min",ue,!0,errorUtil.toString(eo))}gt(ue,eo){return this.setLimit("min",ue,!1,errorUtil.toString(eo))}lte(ue,eo){return this.setLimit("max",ue,!0,errorUtil.toString(eo))}lt(ue,eo){return this.setLimit("max",ue,!1,errorUtil.toString(eo))}setLimit(ue,eo,no,ro){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:ue,value:eo,inclusive:no,message:errorUtil.toString(ro)}]})}_addCheck(ue){return new ZodNumber({...this._def,checks:[...this._def.checks,ue]})}int(ue){return this._addCheck({kind:"int",message:errorUtil.toString(ue)})}positive(ue){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(ue)})}negative(ue){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(ue)})}nonpositive(ue){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(ue)})}nonnegative(ue){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(ue)})}multipleOf(ue,eo){return this._addCheck({kind:"multipleOf",value:ue,message:errorUtil.toString(eo)})}finite(ue){return this._addCheck({kind:"finite",message:errorUtil.toString(ue)})}safe(ue){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(ue)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(ue)})}get minValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}get isInt(){return!!this._def.checks.find(ue=>ue.kind==="int"||ue.kind==="multipleOf"&&util$g.isInteger(ue.value))}get isFinite(){let ue=null,eo=null;for(const no of this._def.checks){if(no.kind==="finite"||no.kind==="int"||no.kind==="multipleOf")return!0;no.kind==="min"?(eo===null||no.value>eo)&&(eo=no.value):no.kind==="max"&&(ue===null||no.value<ue)&&(ue=no.value)}return Number.isFinite(eo)&&Number.isFinite(ue)}}ZodNumber.create=to=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(to==null?void 0:to.coerce)||!1,...processCreateParams(to)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(ue){if(this._def.coerce&&(ue.data=BigInt(ue.data)),this._getType(ue)!==ZodParsedType.bigint){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:oo.parsedType}),INVALID$3}let no;const ro=new ParseStatus;for(const oo of this._def.checks)oo.kind==="min"?(oo.inclusive?ue.data<oo.value:ue.data<=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_small,type:"bigint",minimum:oo.value,inclusive:oo.inclusive,message:oo.message}),ro.dirty()):oo.kind==="max"?(oo.inclusive?ue.data>oo.value:ue.data>=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_big,type:"bigint",maximum:oo.value,inclusive:oo.inclusive,message:oo.message}),ro.dirty()):oo.kind==="multipleOf"?ue.data%oo.value!==BigInt(0)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_multiple_of,multipleOf:oo.value,message:oo.message}),ro.dirty()):util$g.assertNever(oo);return{status:ro.value,value:ue.data}}gte(ue,eo){return this.setLimit("min",ue,!0,errorUtil.toString(eo))}gt(ue,eo){return this.setLimit("min",ue,!1,errorUtil.toString(eo))}lte(ue,eo){return this.setLimit("max",ue,!0,errorUtil.toString(eo))}lt(ue,eo){return this.setLimit("max",ue,!1,errorUtil.toString(eo))}setLimit(ue,eo,no,ro){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:ue,value:eo,inclusive:no,message:errorUtil.toString(ro)}]})}_addCheck(ue){return new ZodBigInt({...this._def,checks:[...this._def.checks,ue]})}positive(ue){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ue)})}negative(ue){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ue)})}nonpositive(ue){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ue)})}nonnegative(ue){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ue)})}multipleOf(ue,eo){return this._addCheck({kind:"multipleOf",value:ue,message:errorUtil.toString(eo)})}get minValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}}ZodBigInt.create=to=>{var ue;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(ue=to==null?void 0:to.coerce)!==null&&ue!==void 0?ue:!1,...processCreateParams(to)})};class ZodBoolean extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=!!ue.data),this._getType(ue)!==ZodParsedType.boolean){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodBoolean.create=to=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(to==null?void 0:to.coerce)||!1,...processCreateParams(to)});class ZodDate extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=new Date(ue.data)),this._getType(ue)!==ZodParsedType.date){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:oo.parsedType}),INVALID$3}if(isNaN(ue.data.getTime())){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_date}),INVALID$3}const no=new ParseStatus;let ro;for(const oo of this._def.checks)oo.kind==="min"?ue.data.getTime()<oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_small,message:oo.message,inclusive:!0,exact:!1,minimum:oo.value,type:"date"}),no.dirty()):oo.kind==="max"?ue.data.getTime()>oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_big,message:oo.message,inclusive:!0,exact:!1,maximum:oo.value,type:"date"}),no.dirty()):util$g.assertNever(oo);return{status:no.value,value:new Date(ue.data.getTime())}}_addCheck(ue){return new ZodDate({...this._def,checks:[...this._def.checks,ue]})}min(ue,eo){return this._addCheck({kind:"min",value:ue.getTime(),message:errorUtil.toString(eo)})}max(ue,eo){return this._addCheck({kind:"max",value:ue.getTime(),message:errorUtil.toString(eo)})}get minDate(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue!=null?new Date(ue):null}get maxDate(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue!=null?new Date(ue):null}}ZodDate.create=to=>new ZodDate({checks:[],coerce:(to==null?void 0:to.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(to)});class ZodSymbol extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.symbol){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodSymbol.create=to=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(to)});class ZodUndefined extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.undefined){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodUndefined.create=to=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(to)});class ZodNull extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.null){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodNull.create=to=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(to)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(ue){return OK(ue.data)}}ZodAny.create=to=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(to)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(ue){return OK(ue.data)}}ZodUnknown.create=to=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(to)});class ZodNever extends ZodType{_parse(ue){const eo=this._getOrReturnCtx(ue);return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:eo.parsedType}),INVALID$3}}ZodNever.create=to=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(to)});class ZodVoid extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.undefined){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodVoid.create=to=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(to)});class ZodArray extends ZodType{_parse(ue){const{ctx:eo,status:no}=this._processInputParams(ue),ro=this._def;if(eo.parsedType!==ZodParsedType.array)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:eo.parsedType}),INVALID$3;if(ro.exactLength!==null){const io=eo.data.length>ro.exactLength.value,ao=eo.data.length<ro.exactLength.value;(io||ao)&&(addIssueToContext(eo,{code:io?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:ao?ro.exactLength.value:void 0,maximum:io?ro.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:ro.exactLength.message}),no.dirty())}if(ro.minLength!==null&&eo.data.length<ro.minLength.value&&(addIssueToContext(eo,{code:ZodIssueCode.too_small,minimum:ro.minLength.value,type:"array",inclusive:!0,exact:!1,message:ro.minLength.message}),no.dirty()),ro.maxLength!==null&&eo.data.length>ro.maxLength.value&&(addIssueToContext(eo,{code:ZodIssueCode.too_big,maximum:ro.maxLength.value,type:"array",inclusive:!0,exact:!1,message:ro.maxLength.message}),no.dirty()),eo.common.async)return Promise.all([...eo.data].map((io,ao)=>ro.type._parseAsync(new ParseInputLazyPath(eo,io,eo.path,ao)))).then(io=>ParseStatus.mergeArray(no,io));const oo=[...eo.data].map((io,ao)=>ro.type._parseSync(new ParseInputLazyPath(eo,io,eo.path,ao)));return ParseStatus.mergeArray(no,oo)}get element(){return this._def.type}min(ue,eo){return new ZodArray({...this._def,minLength:{value:ue,message:errorUtil.toString(eo)}})}max(ue,eo){return new ZodArray({...this._def,maxLength:{value:ue,message:errorUtil.toString(eo)}})}length(ue,eo){return new ZodArray({...this._def,exactLength:{value:ue,message:errorUtil.toString(eo)}})}nonempty(ue){return this.min(1,ue)}}ZodArray.create=(to,ue)=>new ZodArray({type:to,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(ue)});function deepPartialify(to){if(to instanceof ZodObject){const ue={};for(const eo in to.shape){const no=to.shape[eo];ue[eo]=ZodOptional.create(deepPartialify(no))}return new ZodObject({...to._def,shape:()=>ue})}else return to instanceof ZodArray?new ZodArray({...to._def,type:deepPartialify(to.element)}):to instanceof ZodOptional?ZodOptional.create(deepPartialify(to.unwrap())):to instanceof ZodNullable?ZodNullable.create(deepPartialify(to.unwrap())):to instanceof ZodTuple?ZodTuple.create(to.items.map(ue=>deepPartialify(ue))):to}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 ue=this._def.shape(),eo=util$g.objectKeys(ue);return this._cached={shape:ue,keys:eo}}_parse(ue){if(this._getType(ue)!==ZodParsedType.object){const lo=this._getOrReturnCtx(ue);return addIssueToContext(lo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:lo.parsedType}),INVALID$3}const{status:no,ctx:ro}=this._processInputParams(ue),{shape:oo,keys:io}=this._getCached(),ao=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const lo in ro.data)io.includes(lo)||ao.push(lo);const so=[];for(const lo of io){const co=oo[lo],uo=ro.data[lo];so.push({key:{status:"valid",value:lo},value:co._parse(new ParseInputLazyPath(ro,uo,ro.path,lo)),alwaysSet:lo in ro.data})}if(this._def.catchall instanceof ZodNever){const lo=this._def.unknownKeys;if(lo==="passthrough")for(const co of ao)so.push({key:{status:"valid",value:co},value:{status:"valid",value:ro.data[co]}});else if(lo==="strict")ao.length>0&&(addIssueToContext(ro,{code:ZodIssueCode.unrecognized_keys,keys:ao}),no.dirty());else if(lo!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const lo=this._def.catchall;for(const co of ao){const uo=ro.data[co];so.push({key:{status:"valid",value:co},value:lo._parse(new ParseInputLazyPath(ro,uo,ro.path,co)),alwaysSet:co in ro.data})}}return ro.common.async?Promise.resolve().then(async()=>{const lo=[];for(const co of so){const uo=await co.key,fo=await co.value;lo.push({key:uo,value:fo,alwaysSet:co.alwaysSet})}return lo}).then(lo=>ParseStatus.mergeObjectSync(no,lo)):ParseStatus.mergeObjectSync(no,so)}get shape(){return this._def.shape()}strict(ue){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...ue!==void 0?{errorMap:(eo,no)=>{var ro,oo,io,ao;const so=(io=(oo=(ro=this._def).errorMap)===null||oo===void 0?void 0:oo.call(ro,eo,no).message)!==null&&io!==void 0?io:no.defaultError;return eo.code==="unrecognized_keys"?{message:(ao=errorUtil.errToObj(ue).message)!==null&&ao!==void 0?ao:so}:{message:so}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(ue){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...ue})})}merge(ue){return new ZodObject({unknownKeys:ue._def.unknownKeys,catchall:ue._def.catchall,shape:()=>({...this._def.shape(),...ue._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(ue,eo){return this.augment({[ue]:eo})}catchall(ue){return new ZodObject({...this._def,catchall:ue})}pick(ue){const eo={};return util$g.objectKeys(ue).forEach(no=>{ue[no]&&this.shape[no]&&(eo[no]=this.shape[no])}),new ZodObject({...this._def,shape:()=>eo})}omit(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{ue[no]||(eo[no]=this.shape[no])}),new ZodObject({...this._def,shape:()=>eo})}deepPartial(){return deepPartialify(this)}partial(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{const ro=this.shape[no];ue&&!ue[no]?eo[no]=ro:eo[no]=ro.optional()}),new ZodObject({...this._def,shape:()=>eo})}required(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{if(ue&&!ue[no])eo[no]=this.shape[no];else{let oo=this.shape[no];for(;oo instanceof ZodOptional;)oo=oo._def.innerType;eo[no]=oo}}),new ZodObject({...this._def,shape:()=>eo})}keyof(){return createZodEnum(util$g.objectKeys(this.shape))}}ZodObject.create=(to,ue)=>new ZodObject({shape:()=>to,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});ZodObject.strictCreate=(to,ue)=>new ZodObject({shape:()=>to,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});ZodObject.lazycreate=(to,ue)=>new ZodObject({shape:to,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});class ZodUnion extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no=this._def.options;function ro(oo){for(const ao of oo)if(ao.result.status==="valid")return ao.result;for(const ao of oo)if(ao.result.status==="dirty")return eo.common.issues.push(...ao.ctx.common.issues),ao.result;const io=oo.map(ao=>new ZodError(ao.ctx.common.issues));return addIssueToContext(eo,{code:ZodIssueCode.invalid_union,unionErrors:io}),INVALID$3}if(eo.common.async)return Promise.all(no.map(async oo=>{const io={...eo,common:{...eo.common,issues:[]},parent:null};return{result:await oo._parseAsync({data:eo.data,path:eo.path,parent:io}),ctx:io}})).then(ro);{let oo;const io=[];for(const so of no){const lo={...eo,common:{...eo.common,issues:[]},parent:null},co=so._parseSync({data:eo.data,path:eo.path,parent:lo});if(co.status==="valid")return co;co.status==="dirty"&&!oo&&(oo={result:co,ctx:lo}),lo.common.issues.length&&io.push(lo.common.issues)}if(oo)return eo.common.issues.push(...oo.ctx.common.issues),oo.result;const ao=io.map(so=>new ZodError(so));return addIssueToContext(eo,{code:ZodIssueCode.invalid_union,unionErrors:ao}),INVALID$3}}get options(){return this._def.options}}ZodUnion.create=(to,ue)=>new ZodUnion({options:to,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(ue)});const getDiscriminator=to=>to instanceof ZodLazy?getDiscriminator(to.schema):to instanceof ZodEffects?getDiscriminator(to.innerType()):to instanceof ZodLiteral?[to.value]:to instanceof ZodEnum?to.options:to instanceof ZodNativeEnum?util$g.objectValues(to.enum):to instanceof ZodDefault?getDiscriminator(to._def.innerType):to instanceof ZodUndefined?[void 0]:to instanceof ZodNull?[null]:to instanceof ZodOptional?[void 0,...getDiscriminator(to.unwrap())]:to instanceof ZodNullable?[null,...getDiscriminator(to.unwrap())]:to instanceof ZodBranded||to instanceof ZodReadonly?getDiscriminator(to.unwrap()):to instanceof ZodCatch?getDiscriminator(to._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.object)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:eo.parsedType}),INVALID$3;const no=this.discriminator,ro=eo.data[no],oo=this.optionsMap.get(ro);return oo?eo.common.async?oo._parseAsync({data:eo.data,path:eo.path,parent:eo}):oo._parseSync({data:eo.data,path:eo.path,parent:eo}):(addIssueToContext(eo,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[no]}),INVALID$3)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(ue,eo,no){const ro=new Map;for(const oo of eo){const io=getDiscriminator(oo.shape[ue]);if(!io.length)throw new Error(`A discriminator value for key \`${ue}\` could not be extracted from all schema options`);for(const ao of io){if(ro.has(ao))throw new Error(`Discriminator property ${String(ue)} has duplicate value ${String(ao)}`);ro.set(ao,oo)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:ue,options:eo,optionsMap:ro,...processCreateParams(no)})}}function mergeValues(to,ue){const eo=getParsedType(to),no=getParsedType(ue);if(to===ue)return{valid:!0,data:to};if(eo===ZodParsedType.object&&no===ZodParsedType.object){const ro=util$g.objectKeys(ue),oo=util$g.objectKeys(to).filter(ao=>ro.indexOf(ao)!==-1),io={...to,...ue};for(const ao of oo){const so=mergeValues(to[ao],ue[ao]);if(!so.valid)return{valid:!1};io[ao]=so.data}return{valid:!0,data:io}}else if(eo===ZodParsedType.array&&no===ZodParsedType.array){if(to.length!==ue.length)return{valid:!1};const ro=[];for(let oo=0;oo<to.length;oo++){const io=to[oo],ao=ue[oo],so=mergeValues(io,ao);if(!so.valid)return{valid:!1};ro.push(so.data)}return{valid:!0,data:ro}}else return eo===ZodParsedType.date&&no===ZodParsedType.date&&+to==+ue?{valid:!0,data:to}:{valid:!1}}class ZodIntersection extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue),ro=(oo,io)=>{if(isAborted(oo)||isAborted(io))return INVALID$3;const ao=mergeValues(oo.value,io.value);return ao.valid?((isDirty(oo)||isDirty(io))&&eo.dirty(),{status:eo.value,value:ao.data}):(addIssueToContext(no,{code:ZodIssueCode.invalid_intersection_types}),INVALID$3)};return no.common.async?Promise.all([this._def.left._parseAsync({data:no.data,path:no.path,parent:no}),this._def.right._parseAsync({data:no.data,path:no.path,parent:no})]).then(([oo,io])=>ro(oo,io)):ro(this._def.left._parseSync({data:no.data,path:no.path,parent:no}),this._def.right._parseSync({data:no.data,path:no.path,parent:no}))}}ZodIntersection.create=(to,ue,eo)=>new ZodIntersection({left:to,right:ue,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(eo)});class ZodTuple extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.array)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:no.parsedType}),INVALID$3;if(no.data.length<this._def.items.length)return addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID$3;!this._def.rest&&no.data.length>this._def.items.length&&(addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),eo.dirty());const oo=[...no.data].map((io,ao)=>{const so=this._def.items[ao]||this._def.rest;return so?so._parse(new ParseInputLazyPath(no,io,no.path,ao)):null}).filter(io=>!!io);return no.common.async?Promise.all(oo).then(io=>ParseStatus.mergeArray(eo,io)):ParseStatus.mergeArray(eo,oo)}get items(){return this._def.items}rest(ue){return new ZodTuple({...this._def,rest:ue})}}ZodTuple.create=(to,ue)=>{if(!Array.isArray(to))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:to,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(ue)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.object)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:no.parsedType}),INVALID$3;const ro=[],oo=this._def.keyType,io=this._def.valueType;for(const ao in no.data)ro.push({key:oo._parse(new ParseInputLazyPath(no,ao,no.path,ao)),value:io._parse(new ParseInputLazyPath(no,no.data[ao],no.path,ao)),alwaysSet:ao in no.data});return no.common.async?ParseStatus.mergeObjectAsync(eo,ro):ParseStatus.mergeObjectSync(eo,ro)}get element(){return this._def.valueType}static create(ue,eo,no){return eo instanceof ZodType?new ZodRecord({keyType:ue,valueType:eo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(no)}):new ZodRecord({keyType:ZodString.create(),valueType:ue,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(eo)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.map)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:no.parsedType}),INVALID$3;const ro=this._def.keyType,oo=this._def.valueType,io=[...no.data.entries()].map(([ao,so],lo)=>({key:ro._parse(new ParseInputLazyPath(no,ao,no.path,[lo,"key"])),value:oo._parse(new ParseInputLazyPath(no,so,no.path,[lo,"value"]))}));if(no.common.async){const ao=new Map;return Promise.resolve().then(async()=>{for(const so of io){const lo=await so.key,co=await so.value;if(lo.status==="aborted"||co.status==="aborted")return INVALID$3;(lo.status==="dirty"||co.status==="dirty")&&eo.dirty(),ao.set(lo.value,co.value)}return{status:eo.value,value:ao}})}else{const ao=new Map;for(const so of io){const lo=so.key,co=so.value;if(lo.status==="aborted"||co.status==="aborted")return INVALID$3;(lo.status==="dirty"||co.status==="dirty")&&eo.dirty(),ao.set(lo.value,co.value)}return{status:eo.value,value:ao}}}}ZodMap.create=(to,ue,eo)=>new ZodMap({valueType:ue,keyType:to,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(eo)});class ZodSet extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.set)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:no.parsedType}),INVALID$3;const ro=this._def;ro.minSize!==null&&no.data.size<ro.minSize.value&&(addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:ro.minSize.value,type:"set",inclusive:!0,exact:!1,message:ro.minSize.message}),eo.dirty()),ro.maxSize!==null&&no.data.size>ro.maxSize.value&&(addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:ro.maxSize.value,type:"set",inclusive:!0,exact:!1,message:ro.maxSize.message}),eo.dirty());const oo=this._def.valueType;function io(so){const lo=new Set;for(const co of so){if(co.status==="aborted")return INVALID$3;co.status==="dirty"&&eo.dirty(),lo.add(co.value)}return{status:eo.value,value:lo}}const ao=[...no.data.values()].map((so,lo)=>oo._parse(new ParseInputLazyPath(no,so,no.path,lo)));return no.common.async?Promise.all(ao).then(so=>io(so)):io(ao)}min(ue,eo){return new ZodSet({...this._def,minSize:{value:ue,message:errorUtil.toString(eo)}})}max(ue,eo){return new ZodSet({...this._def,maxSize:{value:ue,message:errorUtil.toString(eo)}})}size(ue,eo){return this.min(ue,eo).max(ue,eo)}nonempty(ue){return this.min(1,ue)}}ZodSet.create=(to,ue)=>new ZodSet({valueType:to,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(ue)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.function)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:eo.parsedType}),INVALID$3;function no(ao,so){return makeIssue({data:ao,path:eo.path,errorMaps:[eo.common.contextualErrorMap,eo.schemaErrorMap,getErrorMap(),errorMap].filter(lo=>!!lo),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:so}})}function ro(ao,so){return makeIssue({data:ao,path:eo.path,errorMaps:[eo.common.contextualErrorMap,eo.schemaErrorMap,getErrorMap(),errorMap].filter(lo=>!!lo),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:so}})}const oo={errorMap:eo.common.contextualErrorMap},io=eo.data;if(this._def.returns instanceof ZodPromise){const ao=this;return OK(async function(...so){const lo=new ZodError([]),co=await ao._def.args.parseAsync(so,oo).catch(po=>{throw lo.addIssue(no(so,po)),lo}),uo=await Reflect.apply(io,this,co);return await ao._def.returns._def.type.parseAsync(uo,oo).catch(po=>{throw lo.addIssue(ro(uo,po)),lo})})}else{const ao=this;return OK(function(...so){const lo=ao._def.args.safeParse(so,oo);if(!lo.success)throw new ZodError([no(so,lo.error)]);const co=Reflect.apply(io,this,lo.data),uo=ao._def.returns.safeParse(co,oo);if(!uo.success)throw new ZodError([ro(co,uo.error)]);return uo.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...ue){return new ZodFunction({...this._def,args:ZodTuple.create(ue).rest(ZodUnknown.create())})}returns(ue){return new ZodFunction({...this._def,returns:ue})}implement(ue){return this.parse(ue)}strictImplement(ue){return this.parse(ue)}static create(ue,eo,no){return new ZodFunction({args:ue||ZodTuple.create([]).rest(ZodUnknown.create()),returns:eo||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(no)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(ue){const{ctx:eo}=this._processInputParams(ue);return this._def.getter()._parse({data:eo.data,path:eo.path,parent:eo})}}ZodLazy.create=(to,ue)=>new ZodLazy({getter:to,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(ue)});class ZodLiteral extends ZodType{_parse(ue){if(ue.data!==this._def.value){const eo=this._getOrReturnCtx(ue);return addIssueToContext(eo,{received:eo.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID$3}return{status:"valid",value:ue.data}}get value(){return this._def.value}}ZodLiteral.create=(to,ue)=>new ZodLiteral({value:to,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(ue)});function createZodEnum(to,ue){return new ZodEnum({values:to,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(ue)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(ue){if(typeof ue.data!="string"){const eo=this._getOrReturnCtx(ue),no=this._def.values;return addIssueToContext(eo,{expected:util$g.joinValues(no),received:eo.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(ue.data)){const eo=this._getOrReturnCtx(ue),no=this._def.values;return addIssueToContext(eo,{received:eo.data,code:ZodIssueCode.invalid_enum_value,options:no}),INVALID$3}return OK(ue.data)}get options(){return this._def.values}get enum(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}get Values(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}get Enum(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}extract(ue,eo=this._def){return ZodEnum.create(ue,{...this._def,...eo})}exclude(ue,eo=this._def){return ZodEnum.create(this.options.filter(no=>!ue.includes(no)),{...this._def,...eo})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(ue){const eo=util$g.getValidEnumValues(this._def.values),no=this._getOrReturnCtx(ue);if(no.parsedType!==ZodParsedType.string&&no.parsedType!==ZodParsedType.number){const ro=util$g.objectValues(eo);return addIssueToContext(no,{expected:util$g.joinValues(ro),received:no.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util$g.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(ue.data)){const ro=util$g.objectValues(eo);return addIssueToContext(no,{received:no.data,code:ZodIssueCode.invalid_enum_value,options:ro}),INVALID$3}return OK(ue.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(to,ue)=>new ZodNativeEnum({values:to,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(ue)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.promise&&eo.common.async===!1)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:eo.parsedType}),INVALID$3;const no=eo.parsedType===ZodParsedType.promise?eo.data:Promise.resolve(eo.data);return OK(no.then(ro=>this._def.type.parseAsync(ro,{path:eo.path,errorMap:eo.common.contextualErrorMap})))}}ZodPromise.create=(to,ue)=>new ZodPromise({type:to,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(ue)});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(ue){const{status:eo,ctx:no}=this._processInputParams(ue),ro=this._def.effect||null,oo={addIssue:io=>{addIssueToContext(no,io),io.fatal?eo.abort():eo.dirty()},get path(){return no.path}};if(oo.addIssue=oo.addIssue.bind(oo),ro.type==="preprocess"){const io=ro.transform(no.data,oo);if(no.common.async)return Promise.resolve(io).then(async ao=>{if(eo.value==="aborted")return INVALID$3;const so=await this._def.schema._parseAsync({data:ao,path:no.path,parent:no});return so.status==="aborted"?INVALID$3:so.status==="dirty"||eo.value==="dirty"?DIRTY(so.value):so});{if(eo.value==="aborted")return INVALID$3;const ao=this._def.schema._parseSync({data:io,path:no.path,parent:no});return ao.status==="aborted"?INVALID$3:ao.status==="dirty"||eo.value==="dirty"?DIRTY(ao.value):ao}}if(ro.type==="refinement"){const io=ao=>{const so=ro.refinement(ao,oo);if(no.common.async)return Promise.resolve(so);if(so instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ao};if(no.common.async===!1){const ao=this._def.schema._parseSync({data:no.data,path:no.path,parent:no});return ao.status==="aborted"?INVALID$3:(ao.status==="dirty"&&eo.dirty(),io(ao.value),{status:eo.value,value:ao.value})}else return this._def.schema._parseAsync({data:no.data,path:no.path,parent:no}).then(ao=>ao.status==="aborted"?INVALID$3:(ao.status==="dirty"&&eo.dirty(),io(ao.value).then(()=>({status:eo.value,value:ao.value}))))}if(ro.type==="transform")if(no.common.async===!1){const io=this._def.schema._parseSync({data:no.data,path:no.path,parent:no});if(!isValid$2(io))return io;const ao=ro.transform(io.value,oo);if(ao instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:eo.value,value:ao}}else return this._def.schema._parseAsync({data:no.data,path:no.path,parent:no}).then(io=>isValid$2(io)?Promise.resolve(ro.transform(io.value,oo)).then(ao=>({status:eo.value,value:ao})):io);util$g.assertNever(ro)}}ZodEffects.create=(to,ue,eo)=>new ZodEffects({schema:to,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:ue,...processCreateParams(eo)});ZodEffects.createWithPreprocess=(to,ue,eo)=>new ZodEffects({schema:ue,effect:{type:"preprocess",transform:to},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(eo)});class ZodOptional extends ZodType{_parse(ue){return this._getType(ue)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(ue)}unwrap(){return this._def.innerType}}ZodOptional.create=(to,ue)=>new ZodOptional({innerType:to,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(ue)});class ZodNullable extends ZodType{_parse(ue){return this._getType(ue)===ZodParsedType.null?OK(null):this._def.innerType._parse(ue)}unwrap(){return this._def.innerType}}ZodNullable.create=(to,ue)=>new ZodNullable({innerType:to,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(ue)});class ZodDefault extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue);let no=eo.data;return eo.parsedType===ZodParsedType.undefined&&(no=this._def.defaultValue()),this._def.innerType._parse({data:no,path:eo.path,parent:eo})}removeDefault(){return this._def.innerType}}ZodDefault.create=(to,ue)=>new ZodDefault({innerType:to,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof ue.default=="function"?ue.default:()=>ue.default,...processCreateParams(ue)});class ZodCatch extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no={...eo,common:{...eo.common,issues:[]}},ro=this._def.innerType._parse({data:no.data,path:no.path,parent:{...no}});return isAsync(ro)?ro.then(oo=>({status:"valid",value:oo.status==="valid"?oo.value:this._def.catchValue({get error(){return new ZodError(no.common.issues)},input:no.data})})):{status:"valid",value:ro.status==="valid"?ro.value:this._def.catchValue({get error(){return new ZodError(no.common.issues)},input:no.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(to,ue)=>new ZodCatch({innerType:to,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof ue.catch=="function"?ue.catch:()=>ue.catch,...processCreateParams(ue)});class ZodNaN extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.nan){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:no.parsedType}),INVALID$3}return{status:"valid",value:ue.data}}}ZodNaN.create=to=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(to)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no=eo.data;return this._def.type._parse({data:no,path:eo.path,parent:eo})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.common.async)return(async()=>{const oo=await this._def.in._parseAsync({data:no.data,path:no.path,parent:no});return oo.status==="aborted"?INVALID$3:oo.status==="dirty"?(eo.dirty(),DIRTY(oo.value)):this._def.out._parseAsync({data:oo.value,path:no.path,parent:no})})();{const ro=this._def.in._parseSync({data:no.data,path:no.path,parent:no});return ro.status==="aborted"?INVALID$3:ro.status==="dirty"?(eo.dirty(),{status:"dirty",value:ro.value}):this._def.out._parseSync({data:ro.value,path:no.path,parent:no})}}static create(ue,eo){return new ZodPipeline({in:ue,out:eo,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(ue){const eo=this._def.innerType._parse(ue),no=ro=>(isValid$2(ro)&&(ro.value=Object.freeze(ro.value)),ro);return isAsync(eo)?eo.then(ro=>no(ro)):no(eo)}unwrap(){return this._def.innerType}}ZodReadonly.create=(to,ue)=>new ZodReadonly({innerType:to,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(ue)});function custom(to,ue={},eo){return to?ZodAny.create().superRefine((no,ro)=>{var oo,io;if(!to(no)){const ao=typeof ue=="function"?ue(no):typeof ue=="string"?{message:ue}:ue,so=(io=(oo=ao.fatal)!==null&&oo!==void 0?oo:eo)!==null&&io!==void 0?io:!0,lo=typeof ao=="string"?{message:ao}:ao;ro.addIssue({code:"custom",...lo,fatal:so})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(to){to.ZodString="ZodString",to.ZodNumber="ZodNumber",to.ZodNaN="ZodNaN",to.ZodBigInt="ZodBigInt",to.ZodBoolean="ZodBoolean",to.ZodDate="ZodDate",to.ZodSymbol="ZodSymbol",to.ZodUndefined="ZodUndefined",to.ZodNull="ZodNull",to.ZodAny="ZodAny",to.ZodUnknown="ZodUnknown",to.ZodNever="ZodNever",to.ZodVoid="ZodVoid",to.ZodArray="ZodArray",to.ZodObject="ZodObject",to.ZodUnion="ZodUnion",to.ZodDiscriminatedUnion="ZodDiscriminatedUnion",to.ZodIntersection="ZodIntersection",to.ZodTuple="ZodTuple",to.ZodRecord="ZodRecord",to.ZodMap="ZodMap",to.ZodSet="ZodSet",to.ZodFunction="ZodFunction",to.ZodLazy="ZodLazy",to.ZodLiteral="ZodLiteral",to.ZodEnum="ZodEnum",to.ZodEffects="ZodEffects",to.ZodNativeEnum="ZodNativeEnum",to.ZodOptional="ZodOptional",to.ZodNullable="ZodNullable",to.ZodDefault="ZodDefault",to.ZodCatch="ZodCatch",to.ZodPromise="ZodPromise",to.ZodBranded="ZodBranded",to.ZodPipeline="ZodPipeline",to.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(to,ue={message:`Input not instance of ${to.name}`})=>custom(eo=>eo instanceof to,ue),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$1={string:to=>ZodString.create({...to,coerce:!0}),number:to=>ZodNumber.create({...to,coerce:!0}),boolean:to=>ZodBoolean.create({...to,coerce:!0}),bigint:to=>ZodBigInt.create({...to,coerce:!0}),date:to=>ZodDate.create({...to,coerce:!0})},NEVER=INVALID$3;var z$1=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID:INVALID$3,DIRTY,OK,isAborted,isDirty,isValid:isValid$2,isAsync,get util(){return util$g},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:coerce$1,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$1.string().refine(to=>to!==InternalSearchFilterOperator.COMPLEX_ID_OPERATOR,{message:`Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`}),stringBasicFilter=z$1.record(fieldKey,z$1.string()),basicFilter=z$1.record(fieldKey,z$1.any()),arrayFilter$2=z$1.record(fieldKey,z$1.union([z$1.any().array(),z$1.string()])),logicFilter=z$1.lazy(()=>z$1.object({conditions:z$1.array(z$1.object(queryFilterValidation))})),stringOrNumber=z$1.union([z$1.string(),z$1.number()]),queryFilterValidation={[BasicOperator.STRING]:stringBasicFilter.optional(),[BasicOperator.FUZZY]:stringBasicFilter.optional(),[RangeOperator.RANGE]:z$1.record(fieldKey,z$1.union([z$1.object({high:stringOrNumber,low:stringOrNumber}),z$1.object({high:stringOrNumber}),z$1.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$1.object({query:z$1.object({allOr:z$1.boolean().optional(),onEmptyFilter:z$1.nativeEnum(EmptyFilterOption).optional(),...queryFilterValidation}).optional(),paginate:z$1.boolean().optional(),bookmark:z$1.union([z$1.string(),z$1.number()]).nullish(),limit:z$1.number().optional(),sort:z$1.string().nullish(),sortOrder:z$1.nativeEnum(SortOrder).optional(),sortType:z$1.nativeEnum(SortType).nullish(),version:z$1.string().optional(),disableEscaping:z$1.boolean().optional(),countRows:z$1.boolean().optional()});var EventPublishType$1=(to=>(to.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable_upgrade_panel_opened",to))(EventPublishType$1||{}),MaintenanceType=(to=>(to.SQS_MISSING="sqs_missing",to))(MaintenanceType||{}),BindingMode=(to=>(to.Text="Text",to.JavaScript="JavaScript",to))(BindingMode||{}),SidePanel=(to=>(to.Bindings="FlashOn",to.Evaluation="Play",to.Snippets="Code",to))(SidePanel||{});const AIOperations={SUMMARISE_TEXT:{label:"Summarise Text",value:"SUMMARISE_TEXT"},CLEAN_DATA:{label:"Clean Data",value:"CLEAN_DATA"},TRANSLATE:{label:"Translate",value:"TRANSLATE"},CATEGORISE_TEXT:{label:"Categorise Text",value:"CATEGORISE_TEXT"},SENTIMENT_ANALYSIS:{label:"Sentiment Analysis",value:"SENTIMENT_ANALYSIS"},PROMPT:{label:"Prompt",value:"PROMPT"},SEARCH_WEB:{label:"Search Web",value:"SEARCH_WEB"}},OperationFieldTypes={MULTI_COLUMN:"columns",COLUMN:"column",BINDABLE_TEXT:"prompt"},OperationFields={[AIOperationEnum.SUMMARISE_TEXT]:{columns:OperationFieldTypeEnum.MULTI_COLUMN},[AIOperationEnum.CLEAN_DATA]:{column:OperationFieldTypeEnum.COLUMN},[AIOperationEnum.TRANSLATE]:{column:OperationFieldTypeEnum.COLUMN,language:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.CATEGORISE_TEXT]:{columns:OperationFieldTypeEnum.MULTI_COLUMN,categories:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.SENTIMENT_ANALYSIS]:{column:OperationFieldTypeEnum.COLUMN},[AIOperationEnum.PROMPT]:{prompt:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.SEARCH_WEB]:{columns:OperationFieldTypeEnum.MULTI_COLUMN}};var Header$1=(to=>(to.API_KEY="x-budibase-api-key",to.LICENSE_KEY="x-budibase-license-key",to.API_VER="x-budibase-api-version",to.APP_ID="x-budibase-app-id",to.SESSION_ID="x-budibase-session-id",to.TYPE="x-budibase-type",to.PREVIEW_ROLE="x-budibase-role",to.TENANT_ID="x-budibase-tenant-id",to.VERIFICATION_CODE="x-budibase-verification-code",to.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",to.RESET_PASSWORD_CODE="x-budibase-reset-password-code",to.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",to.TOKEN="x-budibase-token",to.CSRF_TOKEN="x-csrf-token",to.CORRELATION_ID="x-budibase-correlation-id",to.AUTHORIZATION="authorization",to.MIGRATING_APP="x-budibase-migrating-app",to.COOKIE="cookie",to))(Header$1||{});const SWITCHABLE_TYPES={[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]},PROTECTED_INTERNAL_COLUMNS=["_id","_rev","type","createdAt","updatedAt","tableId"],PROTECTED_EXTERNAL_COLUMNS=["_id","_rev","tableId"],ThemeClassPrefix="spectrum--",DefaultBuilderTheme=Theme.DARKEST,DefaultAppTheme$1=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=(to=>(to.UserUpdate="UserUpdate",to.UserDisconnect="UserDisconnect",to.Heartbeat="Heartbeat",to))(SocketEvent||{}),GridSocketEvent=(to=>(to.RowChange="RowChange",to.DatasourceChange="DatasourceChange",to.SelectDatasource="SelectDatasource",to.SelectCell="SelectCell",to))(GridSocketEvent||{}),BuilderSocketEvent=(to=>(to.SelectApp="SelectApp",to.TableChange="TableChange",to.DatasourceChange="DatasourceChange",to.LockTransfer="LockTransfer",to.ScreenChange="ScreenChange",to.AppMetadataChange="AppMetadataChange",to.SelectResource="SelectResource",to.AppPublishChange="AppPublishChange",to.AutomationChange="AutomationChange",to.RoleChange="RoleChange",to))(BuilderSocketEvent||{});const SocketSessionTTL=60,ValidQueryNameRegex=/^[^()]*$/,ValidColumnNameRegex=/^[_a-zA-Z0-9\s]*$/g,ValidSnippetNameRegex=/^[a-z_][a-z0-9_]*$/i,REBOOT_CRON="@reboot";var BpmCorrelationKey=(to=>(to.ONBOARDING="budibase:onboarding:correlationkey",to.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",to))(BpmCorrelationKey||{});const DEFAULT_BB_DATASOURCE_ID$1="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(to){return to&&to.__esModule&&Object.prototype.hasOwnProperty.call(to,"default")?to.default:to}function getAugmentedNamespace(to){if(to.__esModule)return to;var ue=to.default;if(typeof ue=="function"){var eo=function no(){return this instanceof no?Reflect.construct(ue,arguments,this.constructor):ue.apply(this,arguments)};eo.prototype=ue.prototype}else eo={};return Object.defineProperty(eo,"__esModule",{value:!0}),Object.keys(to).forEach(function(no){var ro=Object.getOwnPropertyDescriptor(to,no);Object.defineProperty(eo,no,ro.get?ro:{enumerable:!0,get:function(){return to[no]}})}),eo}var dayjs_min$1={exports:{}};(function(to,ue){(function(eo,no){to.exports=no()})(commonjsGlobal$1,function(){var eo=1e3,no=6e4,ro=36e5,oo="millisecond",io="second",ao="minute",so="hour",lo="day",co="week",uo="month",fo="quarter",po="year",ho="date",_o="Invalid Date",go=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bo=/\[([^\]]+)]|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,vo={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(Po){var Ro=["th","st","nd","rd"],Do=Po%100;return"["+Po+(Ro[(Do-20)%10]||Ro[Do]||Ro[0])+"]"}},yo=function(Po,Ro,Do){var Uo=String(Po);return!Uo||Uo.length>=Ro?Po:""+Array(Ro+1-Uo.length).join(Do)+Po},wo={s:yo,z:function(Po){var Ro=-Po.utcOffset(),Do=Math.abs(Ro),Uo=Math.floor(Do/60),qo=Do%60;return(Ro<=0?"+":"-")+yo(Uo,2,"0")+":"+yo(qo,2,"0")},m:function Po(Ro,Do){if(Ro.date()<Do.date())return-Po(Do,Ro);var Uo=12*(Do.year()-Ro.year())+(Do.month()-Ro.month()),qo=Ro.clone().add(Uo,uo),xo=Do-qo<0,Zo=Ro.clone().add(Uo+(xo?-1:1),uo);return+(-(Uo+(Do-qo)/(xo?qo-Zo:Zo-qo))||0)},a:function(Po){return Po<0?Math.ceil(Po)||0:Math.floor(Po)},p:function(Po){return{M:uo,y:po,w:co,d:lo,D:ho,h:so,m:ao,s:io,ms:oo,Q:fo}[Po]||String(Po||"").toLowerCase().replace(/s$/,"")},u:function(Po){return Po===void 0}},ko="en",So={};So[ko]=vo;var Ao="$isDayjsObject",Io=function(Po){return Po instanceof Vo||!(!Po||!Po[Ao])},Eo=function Po(Ro,Do,Uo){var qo;if(!Ro)return ko;if(typeof Ro=="string"){var xo=Ro.toLowerCase();So[xo]&&(qo=xo),Do&&(So[xo]=Do,qo=xo);var Zo=Ro.split("-");if(!qo&&Zo.length>1)return Po(Zo[0])}else{var Xo=Ro.name;So[Xo]=Ro,qo=Xo}return!Uo&&qo&&(ko=qo),qo||!Uo&&ko},To=function(Po,Ro){if(Io(Po))return Po.clone();var Do=typeof Ro=="object"?Ro:{};return Do.date=Po,Do.args=arguments,new Vo(Do)},Mo=wo;Mo.l=Eo,Mo.i=Io,Mo.w=function(Po,Ro){return To(Po,{locale:Ro.$L,utc:Ro.$u,x:Ro.$x,$offset:Ro.$offset})};var Vo=function(){function Po(Do){this.$L=Eo(Do.locale,null,!0),this.parse(Do),this.$x=this.$x||Do.x||{},this[Ao]=!0}var Ro=Po.prototype;return Ro.parse=function(Do){this.$d=function(Uo){var qo=Uo.date,xo=Uo.utc;if(qo===null)return new Date(NaN);if(Mo.u(qo))return new Date;if(qo instanceof Date)return new Date(qo);if(typeof qo=="string"&&!/Z$/i.test(qo)){var Zo=qo.match(go);if(Zo){var Xo=Zo[2]-1||0,Yo=(Zo[7]||"0").substring(0,3);return xo?new Date(Date.UTC(Zo[1],Xo,Zo[3]||1,Zo[4]||0,Zo[5]||0,Zo[6]||0,Yo)):new Date(Zo[1],Xo,Zo[3]||1,Zo[4]||0,Zo[5]||0,Zo[6]||0,Yo)}}return new Date(qo)}(Do),this.init()},Ro.init=function(){var Do=this.$d;this.$y=Do.getFullYear(),this.$M=Do.getMonth(),this.$D=Do.getDate(),this.$W=Do.getDay(),this.$H=Do.getHours(),this.$m=Do.getMinutes(),this.$s=Do.getSeconds(),this.$ms=Do.getMilliseconds()},Ro.$utils=function(){return Mo},Ro.isValid=function(){return this.$d.toString()!==_o},Ro.isSame=function(Do,Uo){var qo=To(Do);return this.startOf(Uo)<=qo&&qo<=this.endOf(Uo)},Ro.isAfter=function(Do,Uo){return To(Do)<this.startOf(Uo)},Ro.isBefore=function(Do,Uo){return this.endOf(Uo)<To(Do)},Ro.$g=function(Do,Uo,qo){return Mo.u(Do)?this[Uo]:this.set(qo,Do)},Ro.unix=function(){return Math.floor(this.valueOf()/1e3)},Ro.valueOf=function(){return this.$d.getTime()},Ro.startOf=function(Do,Uo){var qo=this,xo=!!Mo.u(Uo)||Uo,Zo=Mo.p(Do),Xo=function(sa,Aa){var pa=Mo.w(qo.$u?Date.UTC(qo.$y,Aa,sa):new Date(qo.$y,Aa,sa),qo);return xo?pa:pa.endOf(lo)},Yo=function(sa,Aa){return Mo.w(qo.toDate()[sa].apply(qo.toDate("s"),(xo?[0,0,0,0]:[23,59,59,999]).slice(Aa)),qo)},Qo=this.$W,Ko=this.$M,ra=this.$D,ea="set"+(this.$u?"UTC":"");switch(Zo){case po:return xo?Xo(1,0):Xo(31,11);case uo:return xo?Xo(1,Ko):Xo(0,Ko+1);case co:var ia=this.$locale().weekStart||0,Jo=(Qo<ia?Qo+7:Qo)-ia;return Xo(xo?ra-Jo:ra+(6-Jo),Ko);case lo:case ho:return Yo(ea+"Hours",0);case so:return Yo(ea+"Minutes",1);case ao:return Yo(ea+"Seconds",2);case io:return Yo(ea+"Milliseconds",3);default:return this.clone()}},Ro.endOf=function(Do){return this.startOf(Do,!1)},Ro.$set=function(Do,Uo){var qo,xo=Mo.p(Do),Zo="set"+(this.$u?"UTC":""),Xo=(qo={},qo[lo]=Zo+"Date",qo[ho]=Zo+"Date",qo[uo]=Zo+"Month",qo[po]=Zo+"FullYear",qo[so]=Zo+"Hours",qo[ao]=Zo+"Minutes",qo[io]=Zo+"Seconds",qo[oo]=Zo+"Milliseconds",qo)[xo],Yo=xo===lo?this.$D+(Uo-this.$W):Uo;if(xo===uo||xo===po){var Qo=this.clone().set(ho,1);Qo.$d[Xo](Yo),Qo.init(),this.$d=Qo.set(ho,Math.min(this.$D,Qo.daysInMonth())).$d}else Xo&&this.$d[Xo](Yo);return this.init(),this},Ro.set=function(Do,Uo){return this.clone().$set(Do,Uo)},Ro.get=function(Do){return this[Mo.p(Do)]()},Ro.add=function(Do,Uo){var qo,xo=this;Do=Number(Do);var Zo=Mo.p(Uo),Xo=function(Ko){var ra=To(xo);return Mo.w(ra.date(ra.date()+Math.round(Ko*Do)),xo)};if(Zo===uo)return this.set(uo,this.$M+Do);if(Zo===po)return this.set(po,this.$y+Do);if(Zo===lo)return Xo(1);if(Zo===co)return Xo(7);var Yo=(qo={},qo[ao]=no,qo[so]=ro,qo[io]=eo,qo)[Zo]||1,Qo=this.$d.getTime()+Do*Yo;return Mo.w(Qo,this)},Ro.subtract=function(Do,Uo){return this.add(-1*Do,Uo)},Ro.format=function(Do){var Uo=this,qo=this.$locale();if(!this.isValid())return qo.invalidDate||_o;var xo=Do||"YYYY-MM-DDTHH:mm:ssZ",Zo=Mo.z(this),Xo=this.$H,Yo=this.$m,Qo=this.$M,Ko=qo.weekdays,ra=qo.months,ea=qo.meridiem,ia=function(Aa,pa,va,da){return Aa&&(Aa[pa]||Aa(Uo,xo))||va[pa].slice(0,da)},Jo=function(Aa){return Mo.s(Xo%12||12,Aa,"0")},sa=ea||function(Aa,pa,va){var da=Aa<12?"AM":"PM";return va?da.toLowerCase():da};return xo.replace(bo,function(Aa,pa){return pa||function(va){switch(va){case"YY":return String(Uo.$y).slice(-2);case"YYYY":return Mo.s(Uo.$y,4,"0");case"M":return Qo+1;case"MM":return Mo.s(Qo+1,2,"0");case"MMM":return ia(qo.monthsShort,Qo,ra,3);case"MMMM":return ia(ra,Qo);case"D":return Uo.$D;case"DD":return Mo.s(Uo.$D,2,"0");case"d":return String(Uo.$W);case"dd":return ia(qo.weekdaysMin,Uo.$W,Ko,2);case"ddd":return ia(qo.weekdaysShort,Uo.$W,Ko,3);case"dddd":return Ko[Uo.$W];case"H":return String(Xo);case"HH":return Mo.s(Xo,2,"0");case"h":return Jo(1);case"hh":return Jo(2);case"a":return sa(Xo,Yo,!0);case"A":return sa(Xo,Yo,!1);case"m":return String(Yo);case"mm":return Mo.s(Yo,2,"0");case"s":return String(Uo.$s);case"ss":return Mo.s(Uo.$s,2,"0");case"SSS":return Mo.s(Uo.$ms,3,"0");case"Z":return Zo}return null}(Aa)||Zo.replace(":","")})},Ro.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Ro.diff=function(Do,Uo,qo){var xo,Zo=this,Xo=Mo.p(Uo),Yo=To(Do),Qo=(Yo.utcOffset()-this.utcOffset())*no,Ko=this-Yo,ra=function(){return Mo.m(Zo,Yo)};switch(Xo){case po:xo=ra()/12;break;case uo:xo=ra();break;case fo:xo=ra()/3;break;case co:xo=(Ko-Qo)/6048e5;break;case lo:xo=(Ko-Qo)/864e5;break;case so:xo=Ko/ro;break;case ao:xo=Ko/no;break;case io:xo=Ko/eo;break;default:xo=Ko}return qo?xo:Mo.a(xo)},Ro.daysInMonth=function(){return this.endOf(uo).$D},Ro.$locale=function(){return So[this.$L]},Ro.locale=function(Do,Uo){if(!Do)return this.$L;var qo=this.clone(),xo=Eo(Do,Uo,!0);return xo&&(qo.$L=xo),qo},Ro.clone=function(){return Mo.w(this.$d,this)},Ro.toDate=function(){return new Date(this.valueOf())},Ro.toJSON=function(){return this.isValid()?this.toISOString():null},Ro.toISOString=function(){return this.$d.toISOString()},Ro.toString=function(){return this.$d.toUTCString()},Po}(),Fo=Vo.prototype;return To.prototype=Fo,[["$ms",oo],["$s",io],["$m",ao],["$H",so],["$W",lo],["$M",uo],["$y",po],["$D",ho]].forEach(function(Po){Fo[Po[1]]=function(Ro){return this.$g(Ro,Po[0],Po[1])}}),To.extend=function(Po,Ro){return Po.$i||(Po(Ro,Vo,To),Po.$i=!0),To},To.locale=Eo,To.isDayjs=Io,To.unix=function(Po){return To(1e3*Po)},To.en=So[ko],To.Ls=So,To.p={},To})})(dayjs_min$1);var dayjs_minExports=dayjs_min$1.exports;const dayjs=getDefaultExportFromCjs$1(dayjs_minExports);var lodash$2={exports:{}};/**
|
|
6
|
+
opacity: ${so-co*go}`}}function slide(to,{delay:ue=0,duration:eo=400,easing:no=cubicOut,axis:ro="y"}={}){const oo=getComputedStyle(to),io=+oo.opacity,ao=ro==="y"?"height":"width",so=parseFloat(oo[ao]),lo=ro==="y"?["top","bottom"]:["left","right"],co=lo.map(bo=>`${bo[0].toUpperCase()}${bo.slice(1)}`),uo=parseFloat(oo[`padding${co[0]}`]),fo=parseFloat(oo[`padding${co[1]}`]),po=parseFloat(oo[`margin${co[0]}`]),ho=parseFloat(oo[`margin${co[1]}`]),_o=parseFloat(oo[`border${co[0]}Width`]),go=parseFloat(oo[`border${co[1]}Width`]);return{delay:ue,duration:eo,easing:no,css:bo=>`overflow: hidden;opacity: ${Math.min(bo*20,1)*io};${ao}: ${bo*so}px;padding-${lo[0]}: ${bo*uo}px;padding-${lo[1]}: ${bo*fo}px;margin-${lo[0]}: ${bo*po}px;margin-${lo[1]}: ${bo*ho}px;border-${lo[0]}-width: ${bo*_o}px;border-${lo[1]}-width: ${bo*go}px;`}}const indexVars$D="",AbsTooltip_svelte_svelte_type_style_lang="";function create_if_block$5x(to){let ue,eo;return ue=new Portal$1({props:{target:".spectrum",$$slots:{default:[create_default_slot$73]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&132815&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$73(to){let ue,eo,no,ro,oo,io,ao,so,lo;return{c(){ue=element("span"),eo=element("span"),no=text$1(to[2]),ro=space$1(),oo=element("span"),attr(eo,"class","spectrum-Tooltip-label svelte-9a74k9"),attr(oo,"class","spectrum-Tooltip-tip svelte-9a74k9"),attr(oo,"style",to[9]),attr(ue,"class",io="spectrum-Tooltip spectrum-Tooltip--"+to[1]+" spectrum-Tooltip--"+to[0]+" is-open svelte-9a74k9"),attr(ue,"style",ao=`left:${to[6]}px;top:${to[7]}px;${to[10]}`),toggle_class(ue,"noWrap",to[3])},m(co,uo){insert$1(co,ue,uo),append$2(ue,eo),append$2(eo,no),append$2(ue,ro),append$2(ue,oo),lo=!0},p(co,uo){(!lo||uo&4)&&set_data(no,co[2]),(!lo||uo&512)&&attr(oo,"style",co[9]),(!lo||uo&3&&io!==(io="spectrum-Tooltip spectrum-Tooltip--"+co[1]+" spectrum-Tooltip--"+co[0]+" is-open svelte-9a74k9"))&&attr(ue,"class",io),(!lo||uo&1216&&ao!==(ao=`left:${co[6]}px;top:${co[7]}px;${co[10]}`))&&attr(ue,"style",ao),(!lo||uo&11)&&toggle_class(ue,"noWrap",co[3])},i(co){lo||(co&&add_render_callback(()=>{lo&&(so||(so=create_bidirectional_transition(ue,fade,{duration:130},!0)),so.run(1))}),lo=!0)},o(co){co&&(so||(so=create_bidirectional_transition(ue,fade,{duration:130},!1)),so.run(0)),lo=!1},d(co){co&&detach(ue),co&&so&&so.end()}}}function create_fragment$bW(to){let ue,eo,no,ro,oo,io;const ao=to[13].default,so=create_slot(ao,to,to[17],null);let lo=to[8]&&to[2]&&to[6]!=null&&to[7]!=null&&create_if_block$5x(to);return{c(){ue=element("div"),so&&so.c(),eo=space$1(),lo&&lo.c(),no=empty$2(),attr(ue,"class","abs-tooltip svelte-9a74k9")},m(co,uo){insert$1(co,ue,uo),so&&so.m(ue,null),to[14](ue),insert$1(co,eo,uo),lo&&lo.m(co,uo),insert$1(co,no,uo),ro=!0,oo||(io=[listen(ue,"focus",null),listen(ue,"mouseover",to[15]),listen(ue,"mouseleave",to[16])],oo=!0)},p(co,[uo]){so&&so.p&&(!ro||uo&131072)&&update_slot_base(so,ao,co,co[17],ro?get_slot_changes(ao,co[17],uo,null):get_all_dirty_from_scope(co[17]),null),co[8]&&co[2]&&co[6]!=null&&co[7]!=null?lo?(lo.p(co,uo),uo&452&&transition_in(lo,1)):(lo=create_if_block$5x(co),lo.c(),transition_in(lo,1),lo.m(no.parentNode,no)):lo&&(group_outros(),transition_out(lo,1,1,()=>{lo=null}),check_outros())},i(co){ro||(transition_in(so,co),transition_in(lo),ro=!0)},o(co){transition_out(so,co),transition_out(lo),ro=!1},d(co){co&&(detach(ue),detach(eo),detach(no)),so&&so.d(co),to[14](null),lo&&lo.d(co),oo=!1,run_all(io)}}}const TooltipPosition={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},TooltipType={Default:"default",Info:"info",Positive:"positive",Negative:"negative"};function instance$bT(to,ue,eo){let no,ro,{$$slots:oo={},$$scope:io}=ue,{position:ao=TooltipPosition.Top}=ue,{type:so=TooltipType.Default}=ue,{text:lo=""}=ue,{fixed:co=!1}=ue,{color:uo=""}=ue,{noWrap:fo=!1}=ue,po,ho=!1,_o,go,bo=!1,vo,yo;const wo=()=>{var Vo;const To=(Vo=po==null?void 0:po.children)==null?void 0:Vo[0];if(!To){eo(6,_o=null),eo(7,go=null);return}const Mo=To.getBoundingClientRect();ao===TooltipPosition.Top?(eo(6,_o=Mo.left+Mo.width/2),eo(7,go=Mo.top)):ao===TooltipPosition.Right?(eo(6,_o=Mo.left+Mo.width),eo(7,go=Mo.top+Mo.height/2)):ao===TooltipPosition.Bottom?(eo(6,_o=Mo.left+Mo.width/2),eo(7,go=Mo.top+Mo.height)):ao===TooltipPosition.Left&&(eo(6,_o=Mo.left),eo(7,go=Mo.top+Mo.height/2))},ko=()=>{wo(),yo=setInterval(wo,100),eo(8,bo=!0)},So=()=>{clearTimeout(vo),clearInterval(yo),eo(8,bo=!1)};onDestroy(So);function Ao(To){binding_callbacks[To?"unshift":"push"](()=>{po=To,eo(5,po)})}const Io=()=>eo(4,ho=!0),Eo=()=>eo(4,ho=!1);return to.$$set=To=>{"position"in To&&eo(0,ao=To.position),"type"in To&&eo(1,so=To.type),"text"in To&&eo(2,lo=To.text),"fixed"in To&&eo(11,co=To.fixed),"color"in To&&eo(12,uo=To.color),"noWrap"in To&&eo(3,fo=To.noWrap),"$$scope"in To&&eo(17,io=To.$$scope)},to.$$.update=()=>{to.$$.dirty&2064&&(ho||co?vo=setTimeout(ko,200):So()),to.$$.dirty&4096&&eo(10,no=uo?`background:${uo};`:null),to.$$.dirty&4096&&eo(9,ro=uo?`border-top-color:${uo};`:null)},[ao,so,lo,fo,ho,po,_o,go,bo,ro,no,co,uo,oo,Ao,Io,Eo,io]}class AbsTooltip extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bT,create_fragment$bW,safe_not_equal,{position:0,type:1,text:2,fixed:11,color:12,noWrap:3})}}const Icon_svelte_svelte_type_style_lang="";function create_default_slot$72(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=svg_element("svg"),no=svg_element("use"),set_style(no,"pointer-events","none"),xlink_attr(no,"xlink:href",ro="#spectrum-icon-18-"+to[0]),attr(eo,"class",oo="spectrum-Icon spectrum-Icon--size"+to[2]+" svelte-10h2gx"),attr(eo,"focusable","false"),attr(eo,"aria-hidden",to[1]),attr(eo,"aria-label",to[0]),attr(eo,"style",io=`${to[5]?`color: ${to[5]};`:""} ${to[6]?`--hover-color: ${to[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`),toggle_class(eo,"hoverable",to[3]),toggle_class(eo,"disabled",to[4]),attr(ue,"class","icon svelte-10h2gx"),toggle_class(ue,"newStyles",to[12])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),append$2(eo,no),ao||(so=[listen(eo,"contextmenu",to[13]),listen(eo,"click",to[14])],ao=!0)},p(lo,co){co&1&&ro!==(ro="#spectrum-icon-18-"+lo[0])&&xlink_attr(no,"xlink:href",ro),co&4&&oo!==(oo="spectrum-Icon spectrum-Icon--size"+lo[2]+" svelte-10h2gx")&&attr(eo,"class",oo),co&2&&attr(eo,"aria-hidden",lo[1]),co&1&&attr(eo,"aria-label",lo[0]),co&96&&io!==(io=`${lo[5]?`color: ${lo[5]};`:""} ${lo[6]?`--hover-color: ${lo[6]}`:"--hover-color: var(--spectrum-alias-icon-color-selected-hover)"}`)&&attr(eo,"style",io),co&12&&toggle_class(eo,"hoverable",lo[3]),co&20&&toggle_class(eo,"disabled",lo[4]),co&4096&&toggle_class(ue,"newStyles",lo[12])},d(lo){lo&&detach(ue),ao=!1,run_all(so)}}}function create_fragment$bV(to){let ue,eo;return ue=new AbsTooltip({props:{text:to[7],type:to[9],position:to[8],color:to[10],noWrap:to[11],$$slots:{default:[create_default_slot$72]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&128&&(oo.text=no[7]),ro&512&&(oo.type=no[9]),ro&256&&(oo.position=no[8]),ro&1024&&(oo.color=no[10]),ro&2048&&(oo.noWrap=no[11]),ro&36991&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bS(to,ue,eo){let{name:no="Add"}=ue,{hidden:ro=!1}=ue,{size:oo="M"}=ue,{hoverable:io=!1}=ue,{disabled:ao=!1}=ue,{color:so=void 0}=ue,{hoverColor:lo=void 0}=ue,{tooltip:co=void 0}=ue,{tooltipPosition:uo=TooltipPosition.Bottom}=ue,{tooltipType:fo=TooltipType.Default}=ue,{tooltipColor:po=void 0}=ue,{tooltipWrap:ho=!0}=ue,{newStyles:_o=!1}=ue;function go(vo){bubble.call(this,to,vo)}function bo(vo){bubble.call(this,to,vo)}return to.$$set=vo=>{"name"in vo&&eo(0,no=vo.name),"hidden"in vo&&eo(1,ro=vo.hidden),"size"in vo&&eo(2,oo=vo.size),"hoverable"in vo&&eo(3,io=vo.hoverable),"disabled"in vo&&eo(4,ao=vo.disabled),"color"in vo&&eo(5,so=vo.color),"hoverColor"in vo&&eo(6,lo=vo.hoverColor),"tooltip"in vo&&eo(7,co=vo.tooltip),"tooltipPosition"in vo&&eo(8,uo=vo.tooltipPosition),"tooltipType"in vo&&eo(9,fo=vo.tooltipType),"tooltipColor"in vo&&eo(10,po=vo.tooltipColor),"tooltipWrap"in vo&&eo(11,ho=vo.tooltipWrap),"newStyles"in vo&&eo(12,_o=vo.newStyles)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo]}class Icon extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bS,create_fragment$bV,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$5w(to){let ue,eo,no;return eo=new AbsTooltip({props:{text:to[0],$$slots:{default:[create_default_slot$71]},$$scope:{ctx:to}}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","icon-container svelte-19tap7e")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo&1&&(io.text=ro[0]),oo&38&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot$71(to){let ue,eo,no,ro,oo;return eo=new Icon({props:{name:"InfoOutline",size:"S",disabled:to[2],hoverable:!0}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","icon svelte-19tap7e"),toggle_class(ue,"icon-small",to[1]==="M"||to[1]==="S")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),no=!0,ro||(oo=listen(ue,"focus",to[4]),ro=!0)},p(io,ao){const so={};ao&4&&(so.disabled=io[2]),eo.$set(so),(!no||ao&2)&&toggle_class(ue,"icon-small",io[1]==="M"||io[1]==="S")},i(io){no||(transition_in(eo.$$.fragment,io),no=!0)},o(io){transition_out(eo.$$.fragment,io),no=!1},d(io){io&&detach(ue),destroy_component(eo),ro=!1,oo()}}}function create_fragment$bU(to){let ue,eo,no;const ro=to[3].default,oo=create_slot(ro,to,to[5],null);let io=to[0]&&create_if_block$5w(to);return{c(){ue=element("div"),oo&&oo.c(),eo=space$1(),io&&io.c(),attr(ue,"class","svelte-19tap7e"),toggle_class(ue,"container",!!to[0])},m(ao,so){insert$1(ao,ue,so),oo&&oo.m(ue,null),append$2(ue,eo),io&&io.m(ue,null),no=!0},p(ao,[so]){oo&&oo.p&&(!no||so&32)&&update_slot_base(oo,ro,ao,ao[5],no?get_slot_changes(ro,ao[5],so,null):get_all_dirty_from_scope(ao[5]),null),ao[0]?io?(io.p(ao,so),so&1&&transition_in(io,1)):(io=create_if_block$5w(ao),io.c(),transition_in(io,1),io.m(ue,null)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros()),(!no||so&1)&&toggle_class(ue,"container",!!ao[0])},i(ao){no||(transition_in(oo,ao),transition_in(io),no=!0)},o(ao){transition_out(oo,ao),transition_out(io),no=!1},d(ao){ao&&detach(ue),oo&&oo.d(ao),io&&io.d()}}}function instance$bR(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{tooltip:oo=""}=ue,{size:io="M"}=ue,{disabled:ao=!0}=ue;function so(lo){bubble.call(this,to,lo)}return to.$$set=lo=>{"tooltip"in lo&&eo(0,oo=lo.tooltip),"size"in lo&&eo(1,io=lo.size),"disabled"in lo&&eo(2,ao=lo.disabled),"$$scope"in lo&&eo(5,ro=lo.$$scope)},[oo,io,ao,no,so,ro]}class TooltipWrapper extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bR,create_fragment$bU,safe_not_equal,{tooltip:0,size:1,disabled:2})}}const FieldLabel_svelte_svelte_type_style_lang="";function create_default_slot$70(to){let ue,eo=(to[1]||"")+"",no,ro;return{c(){ue=element("label"),no=text$1(eo),attr(ue,"for",to[0]),attr(ue,"class",ro=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${to[3]}`)+" svelte-dqoj9e")},m(oo,io){insert$1(oo,ue,io),append$2(ue,no)},p(oo,io){io&2&&eo!==(eo=(oo[1]||"")+"")&&set_data(no,eo),io&1&&attr(ue,"for",oo[0]),io&8&&ro!==(ro=null_to_empty(`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${oo[3]}`)+" svelte-dqoj9e")&&attr(ue,"class",ro)},d(oo){oo&&detach(ue)}}}function create_fragment$bT(to){let ue,eo;return ue=new TooltipWrapper({props:{tooltip:to[2],size:"S",$$slots:{default:[create_default_slot$70]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4&&(oo.tooltip=no[2]),ro&43&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bQ(to,ue,eo){let no,{forId:ro}=ue,{label:oo}=ue,{position:io="above"}=ue,{tooltip:ao=""}=ue;return to.$$set=so=>{"forId"in so&&eo(0,ro=so.forId),"label"in so&&eo(1,oo=so.label),"position"in so&&eo(4,io=so.position),"tooltip"in so&&eo(2,ao=so.tooltip)},to.$$.update=()=>{to.$$.dirty&16&&eo(3,no=io==="above"?"":`spectrum-FieldLabel--${io}`)},[ro,oo,ao,no,io]}class FieldLabel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bQ,create_fragment$bT,safe_not_equal,{forId:0,label:1,position:4,tooltip:2})}}const Field_svelte_svelte_type_style_lang="";function create_if_block_2$1R(to){let ue,eo;return ue=new FieldLabel({props:{forId:to[0],label:to[1],position:to[2],tooltip:to[5]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.forId=no[0]),ro&2&&(oo.label=no[1]),ro&4&&(oo.position=no[2]),ro&32&&(oo.tooltip=no[5]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$30(to){let ue,eo,no,ro,oo,io;return eo=new Icon({props:{name:"HelpOutline"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),ro=element("span"),oo=text$1(to[4]),attr(ro,"class","svelte-e52e9j"),attr(ue,"class","helpText svelte-e52e9j")},m(ao,so){insert$1(ao,ue,so),mount_component(eo,ue,null),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),io=!0},p(ao,so){(!io||so&16)&&set_data(oo,ao[4])},i(ao){io||(transition_in(eo.$$.fragment,ao),io=!0)},o(ao){transition_out(eo.$$.fragment,ao),io=!1},d(ao){ao&&detach(ue),destroy_component(eo)}}}function create_if_block$5v(to){let ue,eo;return{c(){ue=element("div"),eo=text$1(to[3]),attr(ue,"class","error svelte-e52e9j")},m(no,ro){insert$1(no,ue,ro),append$2(ue,eo)},p(no,ro){ro&8&&set_data(eo,no[3])},i:noop$6,o:noop$6,d(no){no&&detach(ue)}}}function create_fragment$bS(to){let ue,eo,no,ro,oo,io,ao,so=to[1]&&create_if_block_2$1R(to);const lo=to[7].default,co=create_slot(lo,to,to[6],null),uo=[create_if_block$5v,create_if_block_1$30],fo=[];function po(ho,_o){return ho[3]?0:ho[4]?1:-1}return~(oo=po(to))&&(io=fo[oo]=uo[oo](to)),{c(){ue=element("div"),so&&so.c(),eo=space$1(),no=element("div"),co&&co.c(),ro=space$1(),io&&io.c(),attr(no,"class","spectrum-Form-itemField svelte-e52e9j"),attr(ue,"class","spectrum-Form-item svelte-e52e9j"),toggle_class(ue,"above",to[2]==="above")},m(ho,_o){insert$1(ho,ue,_o),so&&so.m(ue,null),append$2(ue,eo),append$2(ue,no),co&&co.m(no,null),append$2(no,ro),~oo&&fo[oo].m(no,null),ao=!0},p(ho,[_o]){ho[1]?so?(so.p(ho,_o),_o&2&&transition_in(so,1)):(so=create_if_block_2$1R(ho),so.c(),transition_in(so,1),so.m(ue,eo)):so&&(group_outros(),transition_out(so,1,1,()=>{so=null}),check_outros()),co&&co.p&&(!ao||_o&64)&&update_slot_base(co,lo,ho,ho[6],ao?get_slot_changes(lo,ho[6],_o,null):get_all_dirty_from_scope(ho[6]),null);let go=oo;oo=po(ho),oo===go?~oo&&fo[oo].p(ho,_o):(io&&(group_outros(),transition_out(fo[go],1,1,()=>{fo[go]=null}),check_outros()),~oo?(io=fo[oo],io?io.p(ho,_o):(io=fo[oo]=uo[oo](ho),io.c()),transition_in(io,1),io.m(no,null)):io=null),(!ao||_o&4)&&toggle_class(ue,"above",ho[2]==="above")},i(ho){ao||(transition_in(so),transition_in(co,ho),transition_in(io),ao=!0)},o(ho){transition_out(so),transition_out(co,ho),transition_out(io),ao=!1},d(ho){ho&&detach(ue),so&&so.d(),co&&co.d(ho),~oo&&fo[oo].d()}}}function instance$bP(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{id:oo=null}=ue,{label:io=null}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{helpText:lo=null}=ue,{tooltip:co=""}=ue;return to.$$set=uo=>{"id"in uo&&eo(0,oo=uo.id),"label"in uo&&eo(1,io=uo.label),"labelPosition"in uo&&eo(2,ao=uo.labelPosition),"error"in uo&&eo(3,so=uo.error),"helpText"in uo&&eo(4,lo=uo.helpText),"tooltip"in uo&&eo(5,co=uo.tooltip),"$$scope"in uo&&eo(6,ro=uo.$$scope)},[oo,io,ao,so,lo,co,ro,no]}class Field extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bP,create_fragment$bS,safe_not_equal,{id:0,label:1,labelPosition:2,error:3,helpText:4,tooltip:5})}}const indexVars$C="",TextField_svelte_svelte_type_style_lang="";function create_fragment$bR(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=element("input"),eo.disabled=to[3],eo.readOnly=to[5],attr(eo,"id",to[4]),eo.value=no=to[0]??"",attr(eo,"placeholder",ro=to[1]??""),attr(eo,"type",to[2]),attr(eo,"class","spectrum-Textfield-input svelte-1pznijr"),attr(eo,"style",oo=to[7]?`text-align: ${to[7]};`:""),attr(eo,"inputmode",io=to[15](to[2])),attr(eo,"autocomplete",to[8]),attr(ue,"class","spectrum-Textfield svelte-1pznijr"),toggle_class(ue,"spectrum-Textfield--quiet",to[6]),toggle_class(ue,"is-disabled",to[3]),toggle_class(ue,"is-focused",to[10])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),to[23](eo),ao||(so=[listen(eo,"click",to[18]),listen(eo,"blur",to[19]),listen(eo,"focus",to[20]),listen(eo,"input",to[21]),listen(eo,"keyup",to[22]),listen(eo,"blur",to[12]),listen(eo,"focus",to[11]),listen(eo,"input",to[13]),listen(eo,"keyup",to[14])],ao=!0)},p(lo,[co]){co&8&&(eo.disabled=lo[3]),co&32&&(eo.readOnly=lo[5]),co&16&&attr(eo,"id",lo[4]),co&1&&no!==(no=lo[0]??"")&&eo.value!==no&&(eo.value=no),co&2&&ro!==(ro=lo[1]??"")&&attr(eo,"placeholder",ro),co&4&&attr(eo,"type",lo[2]),co&128&&oo!==(oo=lo[7]?`text-align: ${lo[7]};`:"")&&attr(eo,"style",oo),co&4&&io!==(io=lo[15](lo[2]))&&attr(eo,"inputmode",io),co&256&&attr(eo,"autocomplete",lo[8]),co&64&&toggle_class(ue,"spectrum-Textfield--quiet",lo[6]),co&8&&toggle_class(ue,"is-disabled",lo[3]),co&1024&&toggle_class(ue,"is-focused",lo[10])},i:noop$6,o:noop$6,d(lo){lo&&detach(ue),to[23](null),ao=!1,run_all(so)}}}function instance$bO(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{type:oo="text"}=ue,{disabled:io=!1}=ue,{id:ao=null}=ue,{readonly:so=!1}=ue,{updateOnChange:lo=!0}=ue,{quiet:co=!1}=ue,{align:uo}=ue,{autofocus:fo=!1}=ue,{autocomplete:po=null}=ue;const ho=createEventDispatcher();let _o,go=!1;const bo=Fo=>{if(!(so||io)){if(oo==="number"){const Po=parseFloat(Fo);Fo=isNaN(Po)?null:Po}ho("change",Fo)}},vo=()=>{so||io||eo(10,go=!0)},yo=Fo=>{so||io||(eo(10,go=!1),bo(Fo.target.value))},wo=Fo=>{so||!lo||io||bo(Fo.target.value)},ko=Fo=>{so||io||Fo.key==="Enter"&&bo(Fo.target.value)},So=Fo=>Fo==="bigint"?"numeric":Fo==="number"?"decimal":"text";onMount(async()=>{io||(eo(10,go=fo),go&&(await tick(),_o.focus()))});function Ao(Fo){bubble.call(this,to,Fo)}function Io(Fo){bubble.call(this,to,Fo)}function Eo(Fo){bubble.call(this,to,Fo)}function To(Fo){bubble.call(this,to,Fo)}function Mo(Fo){bubble.call(this,to,Fo)}function Vo(Fo){binding_callbacks[Fo?"unshift":"push"](()=>{_o=Fo,eo(9,_o)})}return to.$$set=Fo=>{"value"in Fo&&eo(0,no=Fo.value),"placeholder"in Fo&&eo(1,ro=Fo.placeholder),"type"in Fo&&eo(2,oo=Fo.type),"disabled"in Fo&&eo(3,io=Fo.disabled),"id"in Fo&&eo(4,ao=Fo.id),"readonly"in Fo&&eo(5,so=Fo.readonly),"updateOnChange"in Fo&&eo(16,lo=Fo.updateOnChange),"quiet"in Fo&&eo(6,co=Fo.quiet),"align"in Fo&&eo(7,uo=Fo.align),"autofocus"in Fo&&eo(17,fo=Fo.autofocus),"autocomplete"in Fo&&eo(8,po=Fo.autocomplete)},[no,ro,oo,io,ao,so,co,uo,po,_o,go,vo,yo,wo,ko,So,lo,fo,Ao,Io,Eo,To,Mo,Vo]}class TextField extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bO,create_fragment$bR,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$6$(to){let ue,eo;return ue=new TextField({props:{updateOnChange:to[8],error:to[7],disabled:to[5],readonly:to[6],value:to[0],placeholder:to[3],type:to[4],quiet:to[9],autofocus:to[10],autocomplete:to[11]}}),ue.$on("change",to[13]),ue.$on("click",to[14]),ue.$on("input",to[15]),ue.$on("blur",to[16]),ue.$on("focus",to[17]),ue.$on("keyup",to[18]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.updateOnChange=no[8]),ro&128&&(oo.error=no[7]),ro&32&&(oo.disabled=no[5]),ro&64&&(oo.readonly=no[6]),ro&1&&(oo.value=no[0]),ro&8&&(oo.placeholder=no[3]),ro&16&&(oo.type=no[4]),ro&512&&(oo.quiet=no[9]),ro&1024&&(oo.autofocus=no[10]),ro&2048&&(oo.autocomplete=no[11]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bQ(to){let ue,eo;return ue=new Field({props:{helpText:to[12],label:to[1],labelPosition:to[2],error:to[7],$$slots:{default:[create_default_slot$6$]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4096&&(oo.helpText=no[12]),ro&2&&(oo.label=no[1]),ro&4&&(oo.labelPosition=no[2]),ro&128&&(oo.error=no[7]),ro&1052665&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bN(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{type:ao="text"}=ue,{disabled:so=!1}=ue,{readonly:lo=!1}=ue,{error:co=null}=ue,{updateOnChange:uo=!0}=ue,{quiet:fo=!1}=ue,{autofocus:po}=ue,{autocomplete:ho}=ue,{helpText:_o=null}=ue;const go=createEventDispatcher(),bo=Ao=>{eo(0,no=Ao.detail),go("change",Ao.detail)};function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){bubble.call(this,to,Ao)}function So(Ao){bubble.call(this,to,Ao)}return to.$$set=Ao=>{"value"in Ao&&eo(0,no=Ao.value),"label"in Ao&&eo(1,ro=Ao.label),"labelPosition"in Ao&&eo(2,oo=Ao.labelPosition),"placeholder"in Ao&&eo(3,io=Ao.placeholder),"type"in Ao&&eo(4,ao=Ao.type),"disabled"in Ao&&eo(5,so=Ao.disabled),"readonly"in Ao&&eo(6,lo=Ao.readonly),"error"in Ao&&eo(7,co=Ao.error),"updateOnChange"in Ao&&eo(8,uo=Ao.updateOnChange),"quiet"in Ao&&eo(9,fo=Ao.quiet),"autofocus"in Ao&&eo(10,po=Ao.autofocus),"autocomplete"in Ao&&eo(11,ho=Ao.autocomplete),"helpText"in Ao&&eo(12,_o=Ao.helpText)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So]}let Input$5=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bN,create_fragment$bQ,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$B="",indexVars$A="",Stepper_svelte_svelte_type_style_lang="";function create_fragment$bP(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo;return{c(){ue=element("div"),eo=element("div"),no=element("input"),oo=space$1(),io=element("span"),ao=element("button"),ao.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-ChevronUp75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Chevron75"></use></svg>',so=space$1(),lo=element("button"),lo.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Chevron75"></use></svg>',no.disabled=to[1],no.readOnly=to[3],attr(no,"id",to[2]),attr(no,"placeholder",ro=to[0]||""),attr(no,"type","number"),attr(no,"class","spectrum-Textfield-input spectrum-Stepper-input"),attr(eo,"class","spectrum-Textfield spectrum-Stepper-textfield"),attr(ao,"class","spectrum-ActionButton spectrum-ActionButton--sizeM spectrum-Stepper-stepUp"),attr(ao,"tabindex","-1"),attr(lo,"class","spectrum-ActionButton spectrum-ActionButton--sizeM spectrum-Stepper-stepDown"),attr(lo,"tabindex","-1"),attr(io,"class","spectrum-Stepper-buttons"),attr(ue,"class","spectrum-Stepper svelte-c6q2wy"),toggle_class(ue,"spectrum-Stepper--quiet",to[4]),toggle_class(ue,"is-disabled",to[1]),toggle_class(ue,"is-focused",to[5])},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),append$2(eo,no),set_input_value(no,to[6]),append$2(ue,oo),append$2(ue,io),append$2(io,ao),append$2(io,so),append$2(io,lo),co||(uo=[listen(no,"input",to[23]),listen(no,"click",to[18]),listen(no,"blur",to[19]),listen(no,"focus",to[20]),listen(no,"input",to[21]),listen(no,"keyup",to[22]),listen(no,"blur",to[8]),listen(no,"focus",to[7]),listen(no,"input",to[9]),listen(no,"keyup",to[10]),listen(ao,"click",to[11]),listen(lo,"click",to[12])],co=!0)},p(fo,[po]){po&2&&(no.disabled=fo[1]),po&8&&(no.readOnly=fo[3]),po&4&&attr(no,"id",fo[2]),po&1&&ro!==(ro=fo[0]||"")&&attr(no,"placeholder",ro),po&64&&to_number(no.value)!==fo[6]&&set_input_value(no,fo[6]),po&16&&toggle_class(ue,"spectrum-Stepper--quiet",fo[4]),po&2&&toggle_class(ue,"is-disabled",fo[1]),po&32&&toggle_class(ue,"is-focused",fo[5])},i:noop$6,o:noop$6,d(fo){fo&&detach(ue),co=!1,run_all(uo)}}}function instance$bM(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{disabled:oo=!1}=ue,{id:io=null}=ue,{readonly:ao=!1}=ue,{updateOnChange:so=!0}=ue,{quiet:lo=!1}=ue,{min:co}=ue,{max:uo}=ue,{step:fo}=ue;const po=createEventDispatcher();let ho=!1,_o=no;const go=Fo=>{if(ao)return;const Po=parseFloat(Fo);Fo=isNaN(Po)?null:Po,Fo!=null&&(co!=null&&Fo<co?Fo=co:uo!=null&&Fo>uo&&(Fo=uo)),po("change",Fo),eo(6,_o=Fo)},bo=()=>{ao||eo(5,ho=!0)},vo=Fo=>{ao||(eo(5,ho=!1),go(Fo.target.value))},yo=Fo=>{ao||!so||go(Fo.target.value)},wo=Fo=>{ao||Fo.key==="Enter"&&go(Fo.target.value)},ko=()=>{no==null||isNaN(no)?go(fo):go(no+fo)},So=()=>{no==null||isNaN(no)?go(fo):go(no-fo)};function Ao(Fo){bubble.call(this,to,Fo)}function Io(Fo){bubble.call(this,to,Fo)}function Eo(Fo){bubble.call(this,to,Fo)}function To(Fo){bubble.call(this,to,Fo)}function Mo(Fo){bubble.call(this,to,Fo)}function Vo(){_o=to_number(this.value),eo(6,_o),eo(14,no)}return to.$$set=Fo=>{"value"in Fo&&eo(14,no=Fo.value),"placeholder"in Fo&&eo(0,ro=Fo.placeholder),"disabled"in Fo&&eo(1,oo=Fo.disabled),"id"in Fo&&eo(2,io=Fo.id),"readonly"in Fo&&eo(3,ao=Fo.readonly),"updateOnChange"in Fo&&eo(15,so=Fo.updateOnChange),"quiet"in Fo&&eo(4,lo=Fo.quiet),"min"in Fo&&eo(16,co=Fo.min),"max"in Fo&&eo(17,uo=Fo.max),"step"in Fo&&eo(13,fo=Fo.step)},to.$$.update=()=>{to.$$.dirty&16384&&eo(6,_o=no),to.$$.dirty&8192&&eo(13,fo=fo==null||isNaN(fo)?1:fo)},[ro,oo,io,ao,lo,ho,_o,bo,vo,yo,wo,ko,So,fo,no,so,co,uo,Ao,Io,Eo,To,Mo,Vo]}class Stepper extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bM,create_fragment$bP,safe_not_equal,{value:14,placeholder:0,disabled:1,id:2,readonly:3,updateOnChange:15,quiet:4,min:16,max:17,step:13})}}function create_default_slot$6_(to){let ue,eo;return ue=new Stepper({props:{updateOnChange:to[7],error:to[6],disabled:to[4],readonly:to[5],value:to[0],placeholder:to[3],quiet:to[8],min:to[9],max:to[10],step:to[11]}}),ue.$on("change",to[13]),ue.$on("click",to[14]),ue.$on("input",to[15]),ue.$on("blur",to[16]),ue.$on("focus",to[17]),ue.$on("keyup",to[18]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&128&&(oo.updateOnChange=no[7]),ro&64&&(oo.error=no[6]),ro&16&&(oo.disabled=no[4]),ro&32&&(oo.readonly=no[5]),ro&1&&(oo.value=no[0]),ro&8&&(oo.placeholder=no[3]),ro&256&&(oo.quiet=no[8]),ro&512&&(oo.min=no[9]),ro&1024&&(oo.max=no[10]),ro&2048&&(oo.step=no[11]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bO(to){let ue,eo;return ue=new Field({props:{helpText:to[12],label:to[1],labelPosition:to[2],error:to[6],$$slots:{default:[create_default_slot$6_]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&4096&&(oo.helpText=no[12]),ro&2&&(oo.label=no[1]),ro&4&&(oo.labelPosition=no[2]),ro&64&&(oo.error=no[6]),ro&1052665&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bL(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{readonly:so=!1}=ue,{error:lo=null}=ue,{updateOnChange:co=!0}=ue,{quiet:uo=!1}=ue,{min:fo=null}=ue,{max:po=null}=ue,{step:ho=1}=ue,{helpText:_o=null}=ue;const go=createEventDispatcher(),bo=Ao=>{eo(0,no=Ao.detail),go("change",Ao.detail)};function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){bubble.call(this,to,Ao)}function So(Ao){bubble.call(this,to,Ao)}return to.$$set=Ao=>{"value"in Ao&&eo(0,no=Ao.value),"label"in Ao&&eo(1,ro=Ao.label),"labelPosition"in Ao&&eo(2,oo=Ao.labelPosition),"placeholder"in Ao&&eo(3,io=Ao.placeholder),"disabled"in Ao&&eo(4,ao=Ao.disabled),"readonly"in Ao&&eo(5,so=Ao.readonly),"error"in Ao&&eo(6,lo=Ao.error),"updateOnChange"in Ao&&eo(7,co=Ao.updateOnChange),"quiet"in Ao&&eo(8,uo=Ao.quiet),"min"in Ao&&eo(9,fo=Ao.min),"max"in Ao&&eo(10,po=Ao.max),"step"in Ao&&eo(11,ho=Ao.step),"helpText"in Ao&&eo(12,_o=Ao.helpText)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So]}class Stepper_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bL,create_fragment$bO,safe_not_equal,{value:0,label:1,labelPosition:2,placeholder:3,disabled:4,readonly:5,error:6,updateOnChange:7,quiet:8,min:9,max:10,step:11,helpText:12})}}const TextArea_svelte_svelte_type_style_lang="";function create_fragment$bN(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("div"),eo=element("textarea"),attr(eo,"placeholder",no=to[1]||""),attr(eo,"class","spectrum-Textfield-input svelte-1kmb9uq"),attr(eo,"style",ro=to[5]?`text-align: ${to[5]}`:""),eo.disabled=to[2],eo.readOnly=to[3],attr(eo,"id",to[4]),eo.value=oo=to[0]||"",attr(ue,"style",io=`${to[9]}${to[8]}`),attr(ue,"class","spectrum-Textfield spectrum-Textfield--multiline svelte-1kmb9uq"),toggle_class(ue,"is-disabled",to[2]),toggle_class(ue,"is-focused",to[6])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),to[14](eo),ao||(so=[listen(eo,"focus",to[15]),listen(eo,"blur",to[10])],ao=!0)},p(lo,[co]){co&2&&no!==(no=lo[1]||"")&&attr(eo,"placeholder",no),co&32&&ro!==(ro=lo[5]?`text-align: ${lo[5]}`:"")&&attr(eo,"style",ro),co&4&&(eo.disabled=lo[2]),co&8&&(eo.readOnly=lo[3]),co&16&&attr(eo,"id",lo[4]),co&1&&oo!==(oo=lo[0]||"")&&(eo.value=oo),co&768&&io!==(io=`${lo[9]}${lo[8]}`)&&attr(ue,"style",io),co&4&&toggle_class(ue,"is-disabled",lo[2]),co&64&&toggle_class(ue,"is-focused",lo[6])},i:noop$6,o:noop$6,d(lo){lo&&detach(ue),to[14](null),ao=!1,run_all(so)}}}function instance$bK(to,ue,eo){let no,ro,{value:oo=""}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{readonly:so=!1}=ue,{id:lo=null}=ue,{height:co=null}=ue,{minHeight:uo=null}=ue;const fo=()=>({start:_o.selectionStart,end:_o.selectionEnd});let{align:po=null}=ue,ho=!1,_o;const go=createEventDispatcher(),bo=ko=>{go("change",ko.target.value),eo(6,ho=!1)},vo=(ko,So)=>!ko||So==null?"":isNaN(So)?`${ko}:${So};`:`${ko}:${So}px;`;function yo(ko){binding_callbacks[ko?"unshift":"push"](()=>{_o=ko,eo(7,_o)})}const wo=()=>eo(6,ho=!0);return to.$$set=ko=>{"value"in ko&&eo(0,oo=ko.value),"placeholder"in ko&&eo(1,io=ko.placeholder),"disabled"in ko&&eo(2,ao=ko.disabled),"readonly"in ko&&eo(3,so=ko.readonly),"id"in ko&&eo(4,lo=ko.id),"height"in ko&&eo(11,co=ko.height),"minHeight"in ko&&eo(12,uo=ko.minHeight),"align"in ko&&eo(5,po=ko.align)},to.$$.update=()=>{to.$$.dirty&2048&&eo(9,no=vo("height",co)),to.$$.dirty&4096&&eo(8,ro=vo("min-height",uo))},[oo,io,ao,so,lo,po,ho,_o,ro,no,bo,co,uo,fo,yo,wo]}class TextArea extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bK,create_fragment$bN,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]}}function create_default_slot$6Z(to){let ue,eo,no;function ro(io){to[11](io)}let oo={error:to[6],disabled:to[5],value:to[0],placeholder:to[4],height:to[7],minHeight:to[8]};return to[1]!==void 0&&(oo.getCaretPosition=to[1]),ue=new TextArea({props:oo}),binding_callbacks.push(()=>bind$2(ue,"getCaretPosition",ro)),ue.$on("change",to[10]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){const so={};ao&64&&(so.error=io[6]),ao&32&&(so.disabled=io[5]),ao&1&&(so.value=io[0]),ao&16&&(so.placeholder=io[4]),ao&128&&(so.height=io[7]),ao&256&&(so.minHeight=io[8]),!eo&&ao&2&&(eo=!0,so.getCaretPosition=io[1],add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_fragment$bM(to){let ue,eo;return ue=new Field({props:{helpText:to[9],label:to[2],labelPosition:to[3],error:to[6],$$slots:{default:[create_default_slot$6Z]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&512&&(oo.helpText=no[9]),ro&4&&(oo.label=no[2]),ro&8&&(oo.labelPosition=no[3]),ro&64&&(oo.error=no[6]),ro&8691&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bJ(to,ue,eo){let{value:no=null}=ue,{label:ro=null}=ue,{labelPosition:oo="above"}=ue,{placeholder:io=null}=ue,{disabled:ao=!1}=ue,{error:so=null}=ue,{getCaretPosition:lo=null}=ue,{height:co=null}=ue,{minHeight:uo=null}=ue,{helpText:fo=null}=ue;const po=createEventDispatcher(),ho=go=>{eo(0,no=go.detail),po("change",go.detail)};function _o(go){lo=go,eo(1,lo)}return to.$$set=go=>{"value"in go&&eo(0,no=go.value),"label"in go&&eo(2,ro=go.label),"labelPosition"in go&&eo(3,oo=go.labelPosition),"placeholder"in go&&eo(4,io=go.placeholder),"disabled"in go&&eo(5,ao=go.disabled),"error"in go&&eo(6,so=go.error),"getCaretPosition"in go&&eo(1,lo=go.getCaretPosition),"height"in go&&eo(7,co=go.height),"minHeight"in go&&eo(8,uo=go.minHeight),"helpText"in go&&eo(9,fo=go.helpText)},[no,lo,ro,oo,io,ao,so,co,uo,fo,ho,_o]}class TextArea_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bJ,create_fragment$bM,safe_not_equal,{value:0,label:2,labelPosition:3,placeholder:4,disabled:5,error:6,getCaretPosition:1,height:7,minHeight:8,helpText:9})}}const indexVars$z="",indexVars$y="",indexVars$x="",ignoredClasses=[".download-js-link",".spectrum-Menu",".date-time-popover"],conditionallyIgnoredClasses=[".spectrum-Underlay",".drawer-wrapper",".spectrum-Popover"];let clickHandlers=[],candidateTarget;const handleClick=to=>{if(!to.target.closest('[data-ignore-click-outside="true"]')){for(let ue of ignoredClasses)if(to.target.closest(ue))return;clickHandlers.forEach(ue=>{var eo;if(!ue.element.contains(to.target)){for(let no of conditionallyIgnoredClasses){const ro=ue.anchor.closest(no)!=null;if(to.target.closest(no)!=null&&!ro)return}(eo=ue.callback)==null||eo.call(ue,to)}})}},handleMouseUp=to=>{candidateTarget===to.target&&handleClick(to),candidateTarget=null},handleMouseDown=to=>{to.button===0&&(candidateTarget=to.target,document.removeEventListener("click",handleMouseUp),document.addEventListener("click",handleMouseUp,!0))};document.addEventListener("mousedown",handleMouseDown);document.addEventListener("contextmenu",handleClick);const updateHandler=(to,ue,eo,no)=>{let ro=clickHandlers.find(oo=>oo.id===to);ro?ro.callback=no:clickHandlers.push({id:to,element:ue,anchor:eo,callback:no})},removeHandler=to=>{clickHandlers=clickHandlers.filter(ue=>ue.id!==to)},clickOutside=(to,ue)=>{const eo=Math.random(),no=ro=>{const oo=(ro==null?void 0:ro.callback)||(typeof ro=="function"?ro:null),io=(ro==null?void 0:ro.anchor)||to;updateHandler(eo,to,io,oo)};return no(ue),{update:no,destroy:()=>removeHandler(eo)}},indexVars$w="",Search_svelte_svelte_type_style_lang="";function create_fragment$bL(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo;return{c(){ue=element("div"),eo=element("div"),no=svg_element("svg"),ro=svg_element("use"),oo=space$1(),io=element("input"),lo=space$1(),co=element("button"),co.innerHTML='<svg class="spectrum-Icon spectrum-UIIcon-Cross75" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Cross75"></use></svg>',xlink_attr(ro,"xlink:href","#spectrum-icon-18-Magnify"),attr(no,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-icon"),attr(no,"focusable","false"),attr(no,"aria-hidden","true"),io.disabled=to[3],attr(io,"id",to[4]),io.value=ao=to[1]||"",attr(io,"placeholder",so=to[2]||""),attr(io,"type","search"),attr(io,"class","spectrum-Textfield-input spectrum-Search-input svelte-d7zw73"),attr(io,"autocomplete","off"),attr(eo,"class","spectrum-Textfield svelte-d7zw73"),toggle_class(eo,"spectrum-Textfield--quiet",to[5]),toggle_class(eo,"is-focused",to[6]),toggle_class(eo,"is-disabled",to[3]),attr(co,"type","reset"),attr(co,"class","spectrum-ClearButton spectrum-Search-clearButton svelte-d7zw73"),attr(ue,"class","spectrum-Search svelte-d7zw73"),toggle_class(ue,"is-disabled",to[3])},m(po,ho){insert$1(po,ue,ho),append$2(ue,eo),append$2(eo,no),append$2(no,ro),append$2(eo,oo),append$2(eo,io),to[17](io),append$2(ue,lo),append$2(ue,co),uo||(fo=[listen(io,"click",to[13]),listen(io,"blur",to[14]),listen(io,"focus",to[15]),listen(io,"input",to[16]),listen(io,"blur",to[9]),listen(io,"focus",to[8]),listen(io,"input",to[10]),listen(io,"keyup",to[11]),listen(co,"click",to[18])],uo=!0)},p(po,[ho]){ho&8&&(io.disabled=po[3]),ho&16&&attr(io,"id",po[4]),ho&2&&ao!==(ao=po[1]||"")&&io.value!==ao&&(io.value=ao),ho&4&&so!==(so=po[2]||"")&&attr(io,"placeholder",so),ho&32&&toggle_class(eo,"spectrum-Textfield--quiet",po[5]),ho&64&&toggle_class(eo,"is-focused",po[6]),ho&8&&toggle_class(eo,"is-disabled",po[3]),ho&8&&toggle_class(ue,"is-disabled",po[3])},i:noop$6,o:noop$6,d(po){po&&detach(ue),to[17](null),uo=!1,run_all(fo)}}}function instance$bI(to,ue,eo){let{value:no=null}=ue,{placeholder:ro=null}=ue,{disabled:oo=!1}=ue,{id:io=null}=ue,{updateOnChange:ao=!0}=ue,{quiet:so=!1}=ue,{inputRef:lo}=ue;const co=createEventDispatcher();let uo=!1;const fo=Ao=>{co("change",Ao)},po=()=>{eo(6,uo=!0)},ho=Ao=>{eo(6,uo=!1),fo(Ao.target.value)},_o=Ao=>{ao&&fo(Ao.target.value)},go=Ao=>{Ao.key==="Enter"&&fo(Ao.target.value)};function bo(Ao){bubble.call(this,to,Ao)}function vo(Ao){bubble.call(this,to,Ao)}function yo(Ao){bubble.call(this,to,Ao)}function wo(Ao){bubble.call(this,to,Ao)}function ko(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{lo=Ao,eo(0,lo)})}const So=()=>fo("");return to.$$set=Ao=>{"value"in Ao&&eo(1,no=Ao.value),"placeholder"in Ao&&eo(2,ro=Ao.placeholder),"disabled"in Ao&&eo(3,oo=Ao.disabled),"id"in Ao&&eo(4,io=Ao.id),"updateOnChange"in Ao&&eo(12,ao=Ao.updateOnChange),"quiet"in Ao&&eo(5,so=Ao.quiet),"inputRef"in Ao&&eo(0,lo=Ao.inputRef)},[lo,no,ro,oo,io,so,uo,fo,po,ho,_o,go,ao,bo,vo,yo,wo,ko,So]}class Search extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bI,create_fragment$bL,safe_not_equal,{value:1,placeholder:2,disabled:3,id:4,updateOnChange:12,quiet:5,inputRef:0})}}const indexVars$v="",StatusLight_svelte_svelte_type_style_lang="";function create_fragment$bK(to){let ue,eo,no,ro,oo,io;const ao=to[21].default,so=create_slot(ao,to,to[20],null);return{c(){ue=element("div"),so&&so.c(),attr(ue,"class",eo="spectrum-StatusLight spectrum-StatusLight--size"+to[0]+" svelte-1wk2ay6"),attr(ue,"style",no=`--color: ${to[16]??"var(--spectrum-global-color-gray-400)"};`),toggle_class(ue,"custom",!!to[16]),toggle_class(ue,"square",to[17]),toggle_class(ue,"hoverable",to[18]),toggle_class(ue,"spectrum-StatusLight--celery",to[1]),toggle_class(ue,"spectrum-StatusLight--yellow",to[2]),toggle_class(ue,"spectrum-StatusLight--fuchsia",to[3]),toggle_class(ue,"spectrum-StatusLight--indigo",to[4]),toggle_class(ue,"spectrum-StatusLight--seafoam",to[5]),toggle_class(ue,"spectrum-StatusLight--chartreuse",to[6]),toggle_class(ue,"spectrum-StatusLight--magenta",to[7]),toggle_class(ue,"spectrum-StatusLight--purple",to[8]),toggle_class(ue,"spectrum-StatusLight--neutral",to[9]),toggle_class(ue,"spectrum-StatusLight--info",to[10]),toggle_class(ue,"spectrum-StatusLight--positive",to[11]),toggle_class(ue,"spectrum-StatusLight--notice",to[12]),toggle_class(ue,"spectrum-StatusLight--negative",to[13]),toggle_class(ue,"spectrum-StatusLight--disabled",to[14]),toggle_class(ue,"spectrum-StatusLight--active",to[15]),toggle_class(ue,"withText",!!to[19].default)},m(lo,co){insert$1(lo,ue,co),so&&so.m(ue,null),ro=!0,oo||(io=listen(ue,"click",to[22]),oo=!0)},p(lo,[co]){so&&so.p&&(!ro||co&1048576)&&update_slot_base(so,ao,lo,lo[20],ro?get_slot_changes(ao,lo[20],co,null):get_all_dirty_from_scope(lo[20]),null),(!ro||co&1&&eo!==(eo="spectrum-StatusLight spectrum-StatusLight--size"+lo[0]+" svelte-1wk2ay6"))&&attr(ue,"class",eo),(!ro||co&65536&&no!==(no=`--color: ${lo[16]??"var(--spectrum-global-color-gray-400)"};`))&&attr(ue,"style",no),(!ro||co&65537)&&toggle_class(ue,"custom",!!lo[16]),(!ro||co&131073)&&toggle_class(ue,"square",lo[17]),(!ro||co&262145)&&toggle_class(ue,"hoverable",lo[18]),(!ro||co&3)&&toggle_class(ue,"spectrum-StatusLight--celery",lo[1]),(!ro||co&5)&&toggle_class(ue,"spectrum-StatusLight--yellow",lo[2]),(!ro||co&9)&&toggle_class(ue,"spectrum-StatusLight--fuchsia",lo[3]),(!ro||co&17)&&toggle_class(ue,"spectrum-StatusLight--indigo",lo[4]),(!ro||co&33)&&toggle_class(ue,"spectrum-StatusLight--seafoam",lo[5]),(!ro||co&65)&&toggle_class(ue,"spectrum-StatusLight--chartreuse",lo[6]),(!ro||co&129)&&toggle_class(ue,"spectrum-StatusLight--magenta",lo[7]),(!ro||co&257)&&toggle_class(ue,"spectrum-StatusLight--purple",lo[8]),(!ro||co&513)&&toggle_class(ue,"spectrum-StatusLight--neutral",lo[9]),(!ro||co&1025)&&toggle_class(ue,"spectrum-StatusLight--info",lo[10]),(!ro||co&2049)&&toggle_class(ue,"spectrum-StatusLight--positive",lo[11]),(!ro||co&4097)&&toggle_class(ue,"spectrum-StatusLight--notice",lo[12]),(!ro||co&8193)&&toggle_class(ue,"spectrum-StatusLight--negative",lo[13]),(!ro||co&16385)&&toggle_class(ue,"spectrum-StatusLight--disabled",lo[14]),(!ro||co&32769)&&toggle_class(ue,"spectrum-StatusLight--active",lo[15]),(!ro||co&524289)&&toggle_class(ue,"withText",!!lo[19].default)},i(lo){ro||(transition_in(so,lo),ro=!0)},o(lo){transition_out(so,lo),ro=!1},d(lo){lo&&detach(ue),so&&so.d(lo),oo=!1,io()}}}function instance$bH(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue;const oo=compute_slots(no);let{size:io="M"}=ue,{celery:ao=!1}=ue,{yellow:so=!1}=ue,{fuchsia:lo=!1}=ue,{indigo:co=!1}=ue,{seafoam:uo=!1}=ue,{chartreuse:fo=!1}=ue,{magenta:po=!1}=ue,{purple:ho=!1}=ue,{neutral:_o=!1}=ue,{info:go=!1}=ue,{positive:bo=!1}=ue,{notice:vo=!1}=ue,{negative:yo=!1}=ue,{disabled:wo=!1}=ue,{active:ko=!1}=ue,{color:So=null}=ue,{square:Ao=!1}=ue,{hoverable:Io=!1}=ue;function Eo(To){bubble.call(this,to,To)}return to.$$set=To=>{"size"in To&&eo(0,io=To.size),"celery"in To&&eo(1,ao=To.celery),"yellow"in To&&eo(2,so=To.yellow),"fuchsia"in To&&eo(3,lo=To.fuchsia),"indigo"in To&&eo(4,co=To.indigo),"seafoam"in To&&eo(5,uo=To.seafoam),"chartreuse"in To&&eo(6,fo=To.chartreuse),"magenta"in To&&eo(7,po=To.magenta),"purple"in To&&eo(8,ho=To.purple),"neutral"in To&&eo(9,_o=To.neutral),"info"in To&&eo(10,go=To.info),"positive"in To&&eo(11,bo=To.positive),"notice"in To&&eo(12,vo=To.notice),"negative"in To&&eo(13,yo=To.negative),"disabled"in To&&eo(14,wo=To.disabled),"active"in To&&eo(15,ko=To.active),"color"in To&&eo(16,So=To.color),"square"in To&&eo(17,Ao=To.square),"hoverable"in To&&eo(18,Io=To.hoverable),"$$scope"in To&&eo(20,ro=To.$$scope)},[io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,So,Ao,Io,oo,ro,no,Eo]}class StatusLight extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bH,create_fragment$bK,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(to,ue){let eo,no=ue;const ro=()=>oo(no),oo=ao=>{const{anchor:so,align:lo,maxHeight:co,maxWidth:uo,minWidth:fo,useAnchorWidth:po,offset:ho=5,customUpdate:_o,resizable:go,wrap:bo}=ao;if(!so)return;const vo=so.getBoundingClientRect(),yo=to.getBoundingClientRect(),wo=window.innerWidth,ko=window.innerHeight,So=8;let Ao={maxHeight:co,minWidth:po?vo.width:fo,maxWidth:po?vo.width:uo,left:0,top:0};if(typeof _o=="function")Ao=_o(vo,yo,{...Ao,offset:ao.offset});else{const Io=()=>Ao.left+yo.width>wo&&vo.left>wo-vo.right,Eo=()=>Ao.top+yo.height>ko&&vo.top>ko-vo.bottom,To=Fo=>{!Ao.maxHeight&&go&&(Ao.maxHeight=Fo)},Mo=Fo=>{switch(Fo){case"StartToStart":default:Ao.left=vo.left;break;case"EndToEnd":Ao.left=vo.right-yo.width;break;case"StartToEnd":Ao.left=vo.right+ho;break;case"EndToStart":Ao.left=vo.left-yo.width-ho;break;case"MidPoint":Ao.left=vo.left+vo.width/2-yo.width/2;break;case"ScreenEdge":Ao.left=wo-yo.width-So;break}},Vo=Fo=>{switch(Fo){case"StartToStart":Ao.top=vo.top,To(ko-vo.top-So);break;case"EndToEnd":Ao.top=vo.bottom-yo.height,To(vo.bottom-So);break;case"StartToEnd":default:Ao.top=vo.bottom+ho,To(ko-vo.bottom-So);break;case"EndToStart":Ao.top=vo.top-yo.height-ho,To(vo.top-So);break;case"MidPoint":Ao.top=vo.top+vo.height/2-yo.height/2;break;case"ScreenEdge":Ao.top=ko-yo.height-So,To(ko-2*So);break}};Mo(lo==="right"?"EndToEnd":lo==="right-outside"||lo==="right-context-menu"?"StartToEnd":lo==="left-outside"||lo==="left-context-menu"?"EndToStart":lo==="center"?"MidPoint":"StartToStart"),lo==="right-outside"||lo==="left-outside"?Vo("MidPoint"):lo==="right-context-menu"||lo==="left-context-menu"?(Vo("StartToStart"),Ao.top&&(Ao.top-=5)):Vo("StartToEnd"),Io()&&(lo==="left"?Mo("EndToEnd"):lo==="right-outside"&&Mo("EndToStart")),Eo()&&(bo?(Vo("MidPoint"),Eo()&&Vo("ScreenEdge"),Mo("StartToEnd"),Io()&&Mo("EndToStart")):Vo(lo==="left-outside"||lo==="right-outside"?"ScreenEdge":"EndToStart"))}for(const[Io,Eo]of Object.entries(Ao)){const To=Io;Eo!=null?to.style[To]=`${Eo}px`:to.style[To]=""}},io=ao=>{no=ao,eo&&eo.disconnect();const{anchor:so}=ao;so&&(eo=new ResizeObserver(()=>oo(ao)),eo.observe(so),eo.observe(to),eo.observe(document.body))};return to.style.position="fixed",to.style.zIndex="9999",document.addEventListener("scroll",ro,!0),io(ue),{update:io,destroy(){eo&&eo.disconnect(),document.removeEventListener("scroll",ro,!0)}}}const Context$1={Modal:"bbui-modal",PopoverRoot:"bbui-popover-root"},Popover_svelte_svelte_type_style_lang="";function create_if_block$5u(to){let ue,eo;return ue=new Portal$1({props:{target:to[17],$$slots:{default:[create_default_slot$6Y]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&131072&&(oo.target=no[17]),ro&537001982&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$6Y(to){let ue,eo,no,ro,oo,io,ao;const so=to[26].default,lo=create_slot(so,to,to[29],null);return{c(){ue=element("div"),lo&&lo.c(),attr(ue,"tabindex","0"),attr(ue,"class","spectrum-Popover is-open svelte-1uiag1x"),attr(ue,"role","presentation"),set_style(ue,"height",to[9]),set_style(ue,"--customZindex",to[11]),toggle_class(ue,"customZindex",to[11]),toggle_class(ue,"hidden",!to[13]),toggle_class(ue,"blockPointerEvents",to[16])},m(co,uo){insert$1(co,ue,uo),lo&&lo.m(ue,null),oo=!0,io||(ao=[action_destroyer(eo=positionDropdown.call(null,ue,{anchor:to[1],align:to[2],maxHeight:to[5],maxWidth:to[4],minWidth:to[3],useAnchorWidth:to[6],offset:to[8],customUpdate:to[12],resizable:to[14],wrap:to[15]})),action_destroyer(no=clickOutside.call(null,ue,{callback:to[7]?to[18]:clickOutside_function,anchor:to[1]})),listen(ue,"keydown",to[19]),listen(ue,"mouseenter",to[27]),listen(ue,"mouseleave",to[28])],io=!0)},p(co,uo){to=co,lo&&lo.p&&(!oo||uo&536870912)&&update_slot_base(lo,so,to,to[29],oo?get_slot_changes(so,to[29],uo,null):get_all_dirty_from_scope(to[29]),null),(!oo||uo&512)&&set_style(ue,"height",to[9]),(!oo||uo&2048)&&set_style(ue,"--customZindex",to[11]),eo&&is_function(eo.update)&&uo&53630&&eo.update.call(null,{anchor:to[1],align:to[2],maxHeight:to[5],maxWidth:to[4],minWidth:to[3],useAnchorWidth:to[6],offset:to[8],customUpdate:to[12],resizable:to[14],wrap:to[15]}),no&&is_function(no.update)&&uo&130&&no.update.call(null,{callback:to[7]?to[18]:clickOutside_function,anchor:to[1]}),(!oo||uo&2048)&&toggle_class(ue,"customZindex",to[11]),(!oo||uo&8192)&&toggle_class(ue,"hidden",!to[13]),(!oo||uo&65536)&&toggle_class(ue,"blockPointerEvents",to[16])},i(co){oo||(transition_in(lo,co),co&&add_render_callback(()=>{oo&&(ro||(ro=create_bidirectional_transition(ue,fly,{y:-20,duration:to[10]?animationDuration:0},!0)),ro.run(1))}),oo=!0)},o(co){transition_out(lo,co),co&&(ro||(ro=create_bidirectional_transition(ue,fly,{y:-20,duration:to[10]?animationDuration:0},!1)),ro.run(0)),oo=!1},d(co){co&&detach(ue),lo&&lo.d(co),co&&ro&&ro.end(),io=!1,run_all(ao)}}}function create_fragment$bJ(to){let ue,eo,no=to[0]&&create_if_block$5u(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){ro[0]?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$5u(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}const animationDuration=260,clickOutside_function=()=>{};function instance$bG(to,ue,eo){let no,{$$slots:ro={},$$scope:oo}=ue;const io=createEventDispatcher();let{anchor:ao}=ue,{align:so="right"}=ue,{portalTarget:lo=void 0}=ue,{minWidth:co=void 0}=ue,{maxWidth:uo=void 0}=ue,{maxHeight:fo=void 0}=ue,{open:po=!1}=ue,{useAnchorWidth:ho=!1}=ue,{dismissible:_o=!0}=ue,{offset:go=4}=ue,{customHeight:bo=void 0}=ue,{animate:vo=!0}=ue,{customZindex:yo=void 0}=ue,{handlePostionUpdate:wo=void 0}=ue,{showPopover:ko=!0}=ue,{clickOutsideOverride:So=!1}=ue,{resizable:Ao=!0}=ue,{wrap:Io=!1}=ue,Eo,To=!1;const Mo=()=>{io("open"),eo(0,po=!0)},Vo=()=>{io("close"),eo(0,po=!1)},Fo=()=>{po?Vo():Mo()},Po=qo=>{if(!So&&po){let xo=qo.target,Zo=!1;for(;!Zo&&xo&&xo.parentNode;)Zo=xo===ao,xo=xo.parentNode;Zo&&qo.stopPropagation(),Vo()}},Ro=qo=>{So&&po&&qo.key==="Escape"&&Vo()};onDestroy(()=>{clearTimeout(Eo)});function Do(qo){bubble.call(this,to,qo)}function Uo(qo){bubble.call(this,to,qo)}return to.$$set=qo=>{"anchor"in qo&&eo(1,ao=qo.anchor),"align"in qo&&eo(2,so=qo.align),"portalTarget"in qo&&eo(20,lo=qo.portalTarget),"minWidth"in qo&&eo(3,co=qo.minWidth),"maxWidth"in qo&&eo(4,uo=qo.maxWidth),"maxHeight"in qo&&eo(5,fo=qo.maxHeight),"open"in qo&&eo(0,po=qo.open),"useAnchorWidth"in qo&&eo(6,ho=qo.useAnchorWidth),"dismissible"in qo&&eo(7,_o=qo.dismissible),"offset"in qo&&eo(8,go=qo.offset),"customHeight"in qo&&eo(9,bo=qo.customHeight),"animate"in qo&&eo(10,vo=qo.animate),"customZindex"in qo&&eo(11,yo=qo.customZindex),"handlePostionUpdate"in qo&&eo(12,wo=qo.handlePostionUpdate),"showPopover"in qo&&eo(13,ko=qo.showPopover),"clickOutsideOverride"in qo&&eo(21,So=qo.clickOutsideOverride),"resizable"in qo&&eo(14,Ao=qo.resizable),"wrap"in qo&&eo(15,Io=qo.wrap),"$$scope"in qo&&eo(29,oo=qo.$$scope)},to.$$.update=()=>{to.$$.dirty&1048576&&eo(17,no=lo||getContext$1(Context$1.PopoverRoot)||".spectrum"),to.$$.dirty&33555457&&po&&vo&&(eo(16,To=!0),clearTimeout(Eo),eo(25,Eo=setTimeout(()=>{eo(16,To=!1)},animationDuration/2)))},[po,ao,so,co,uo,fo,ho,_o,go,bo,vo,yo,wo,ko,Ao,Io,To,no,Po,Ro,lo,So,Mo,Vo,Fo,Eo,ro,Do,Uo,oo]}class Popover extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bG,create_fragment$bJ,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$u="",Tags_svelte_svelte_type_style_lang="";function create_fragment$bI(to){let ue,eo;const no=to[1].default,ro=create_slot(no,to,to[0],null);return{c(){ue=element("div"),ro&&ro.c(),attr(ue,"class","spectrum-Tags svelte-17cj8k0"),attr(ue,"role","list"),attr(ue,"aria-label","list")},m(oo,io){insert$1(oo,ue,io),ro&&ro.m(ue,null),eo=!0},p(oo,[io]){ro&&ro.p&&(!eo||io&1)&&update_slot_base(ro,no,oo,oo[0],eo?get_slot_changes(no,oo[0],io,null):get_all_dirty_from_scope(oo[0]),null)},i(oo){eo||(transition_in(ro,oo),eo=!0)},o(oo){transition_out(ro,oo),eo=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo)}}}function instance$bF(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue;return to.$$set=oo=>{"$$scope"in oo&&eo(0,ro=oo.$$scope)},[ro,no]}class Tags extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bF,create_fragment$bI,safe_not_equal,{})}}const indexVars$t="",Avatar_svelte_svelte_type_style_lang="";function create_else_block$21(to){let ue,eo=(to[3]||"")+"",no;return{c(){ue=element("div"),no=text$1(eo),attr(ue,"class","spectrum-Avatar svelte-xutedg"),attr(ue,"style",to[4]),toggle_class(ue,"is-disabled",to[2])},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,no)},p(ro,oo){oo&8&&eo!==(eo=(ro[3]||"")+"")&&set_data(no,eo),oo&16&&attr(ue,"style",ro[4]),oo&4&&toggle_class(ue,"is-disabled",ro[2])},d(ro){ro&&detach(ue)}}}function create_if_block$5t(to){let ue,eo;return{c(){ue=element("img"),attr(ue,"class","spectrum-Avatar"),src_url_equal(ue.src,eo=to[1])||attr(ue,"src",eo),attr(ue,"alt","Avatar"),set_style(ue,"width","var("+to[5].get(to[0])+")"),set_style(ue,"height","var("+to[5].get(to[0])+")"),toggle_class(ue,"is-disabled",to[2])},m(no,ro){insert$1(no,ue,ro)},p(no,ro){ro&2&&!src_url_equal(ue.src,eo=no[1])&&attr(ue,"src",eo),ro&1&&set_style(ue,"width","var("+no[5].get(no[0])+")"),ro&1&&set_style(ue,"height","var("+no[5].get(no[0])+")"),ro&4&&toggle_class(ue,"is-disabled",no[2])},d(no){no&&detach(ue)}}}function create_fragment$bH(to){let ue;function eo(oo,io){return oo[1]?create_if_block$5t:create_else_block$21}let no=eo(to),ro=no(to);return{c(){ro.c(),ue=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,ue,io)},p(oo,[io]){no===(no=eo(oo))&&ro?ro.p(oo,io):(ro.d(1),ro=no(oo),ro&&(ro.c(),ro.m(ue.parentNode,ue)))},i:noop$6,o:noop$6,d(oo){oo&&detach(ue),ro.d(oo)}}}const DefaultColor="#3aab87";function instance$bE(to,ue,eo){let no,ro,oo=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:io="M"}=ue,{url:ao=""}=ue,{disabled:so=!1}=ue,{initials:lo="JD"}=ue,{color:co=null}=ue;const uo=po=>po!=null&&po.length?`hsl(${po[0].toLowerCase().charCodeAt(0)%26/26*360}, 50%, 50%)`:DefaultColor,fo=(po,ho)=>{const _o=`var(${oo.get(po)})`,go=`calc(${_o} / 2)`;return`width:${_o}; height:${_o}; font-size:${go}; background:${ho};`};return to.$$set=po=>{"size"in po&&eo(0,io=po.size),"url"in po&&eo(1,ao=po.url),"disabled"in po&&eo(2,so=po.disabled),"initials"in po&&eo(3,lo=po.initials),"color"in po&&eo(6,co=po.color)},to.$$.update=()=>{to.$$.dirty&72&&eo(7,no=co||uo(lo)),to.$$.dirty&129&&eo(4,ro=fo(io,no))},[io,ao,so,lo,ro,oo,co,no]}class Avatar extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bE,create_fragment$bH,safe_not_equal,{size:0,url:1,disabled:2,initials:3,color:6})}}function create_fragment$bG(to){let ue,eo,no,ro,oo;return{c(){ue=element("button"),eo=svg_element("svg"),no=svg_element("use"),xlink_attr(no,"xlink:href","#spectrum-css-icon-Cross75"),attr(eo,"class","spectrum-Icon spectrum-UIIcon-Cross75"),attr(eo,"focusable","false"),attr(eo,"aria-hidden","true"),attr(ue,"class","spectrum-ClearButton"),ue.disabled=to[1],toggle_class(ue,"spectrum-ClearButton--small",to[0])},m(io,ao){insert$1(io,ue,ao),append$2(ue,eo),append$2(eo,no),ro||(oo=listen(ue,"click",to[2]),ro=!0)},p(io,[ao]){ao&2&&(ue.disabled=io[1]),ao&1&&toggle_class(ue,"spectrum-ClearButton--small",io[0])},i:noop$6,o:noop$6,d(io){io&&detach(ue),ro=!1,oo()}}}function instance$bD(to,ue,eo){let{small:no=!1}=ue,{disabled:ro}=ue;function oo(io){bubble.call(this,to,io)}return to.$$set=io=>{"small"in io&&eo(0,no=io.small),"disabled"in io&&eo(1,ro=io.disabled)},[no,ro,oo]}class ClearButton extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bD,create_fragment$bG,safe_not_equal,{small:0,disabled:1})}}const Tag_svelte_svelte_type_style_lang="";function create_if_block_2$1Q(to){let ue,eo;return ue=new Avatar({props:{url:to[1]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&2&&(oo.url=no[1]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$2$(to){let ue,eo,no;return{c(){ue=svg_element("svg"),eo=svg_element("use"),xlink_attr(eo,"xlink:href",no="#spectrum-icon-24-"+to[0]),attr(ue,"class","spectrum-Icon spectrum-Icon--sizeS"),attr(ue,"focusable","false"),attr(ue,"aria-hidden","true"),attr(ue,"aria-label","Tag")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,eo)},p(ro,oo){oo&1&&no!==(no="#spectrum-icon-24-"+ro[0])&&xlink_attr(eo,"xlink:href",no)},d(ro){ro&&detach(ue)}}}function create_if_block$5s(to){let ue,eo;return ue=new ClearButton({}),ue.$on("click",to[7]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bF(to){let ue,eo,no,ro,oo,io,ao=to[1]&&create_if_block_2$1Q(to),so=to[0]&&create_if_block_1$2$(to);const lo=to[6].default,co=create_slot(lo,to,to[5],null);let uo=to[4]&&create_if_block$5s(to);return{c(){ue=element("div"),ao&&ao.c(),eo=space$1(),so&&so.c(),no=space$1(),ro=element("span"),co&&co.c(),oo=space$1(),uo&&uo.c(),attr(ro,"class","spectrum-Tags-itemLabel"),attr(ue,"class","spectrum-Tags-item svelte-16fqld8"),attr(ue,"role","listitem"),toggle_class(ue,"is-invalid",to[2]),toggle_class(ue,"is-disabled",to[3])},m(fo,po){insert$1(fo,ue,po),ao&&ao.m(ue,null),append$2(ue,eo),so&&so.m(ue,null),append$2(ue,no),append$2(ue,ro),co&&co.m(ro,null),append$2(ue,oo),uo&&uo.m(ue,null),io=!0},p(fo,[po]){fo[1]?ao?(ao.p(fo,po),po&2&&transition_in(ao,1)):(ao=create_if_block_2$1Q(fo),ao.c(),transition_in(ao,1),ao.m(ue,eo)):ao&&(group_outros(),transition_out(ao,1,1,()=>{ao=null}),check_outros()),fo[0]?so?so.p(fo,po):(so=create_if_block_1$2$(fo),so.c(),so.m(ue,no)):so&&(so.d(1),so=null),co&&co.p&&(!io||po&32)&&update_slot_base(co,lo,fo,fo[5],io?get_slot_changes(lo,fo[5],po,null):get_all_dirty_from_scope(fo[5]),null),fo[4]?uo?po&16&&transition_in(uo,1):(uo=create_if_block$5s(fo),uo.c(),transition_in(uo,1),uo.m(ue,null)):uo&&(group_outros(),transition_out(uo,1,1,()=>{uo=null}),check_outros()),(!io||po&4)&&toggle_class(ue,"is-invalid",fo[2]),(!io||po&8)&&toggle_class(ue,"is-disabled",fo[3])},i(fo){io||(transition_in(ao),transition_in(co,fo),transition_in(uo),io=!0)},o(fo){transition_out(ao),transition_out(co,fo),transition_out(uo),io=!1},d(fo){fo&&detach(ue),ao&&ao.d(),so&&so.d(),co&&co.d(fo),uo&&uo.d()}}}function instance$bC(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{icon:oo=""}=ue,{avatar:io=""}=ue,{invalid:ao=!1}=ue,{disabled:so=!1}=ue,{closable:lo=!1}=ue;function co(uo){bubble.call(this,to,uo)}return to.$$set=uo=>{"icon"in uo&&eo(0,oo=uo.icon),"avatar"in uo&&eo(1,io=uo.avatar),"invalid"in uo&&eo(2,ao=uo.invalid),"disabled"in uo&&eo(3,so=uo.disabled),"closable"in uo&&eo(4,lo=uo.closable),"$$scope"in uo&&eo(5,ro=uo.$$scope)},[oo,io,ao,so,lo,ro,no,co]}let Tag$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bC,create_fragment$bF,safe_not_equal,{icon:0,avatar:1,invalid:2,disabled:3,closable:4})}};const indexVars$s="";function create_fragment$bE(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho;return{c(){ue=element("div"),eo=element("div"),no=space$1(),ro=element("div"),oo=element("div"),io=element("div"),ao=element("div"),so=space$1(),lo=element("div"),co=element("div"),uo=element("div"),attr(eo,"class","spectrum-ProgressCircle-track"),attr(ao,"class","spectrum-ProgressCircle-fill"),attr(io,"class","spectrum-ProgressCircle-fillSubMask1"),attr(io,"style",to[3]),attr(oo,"class","spectrum-ProgressCircle-fillMask1"),attr(uo,"class","spectrum-ProgressCircle-fill"),attr(co,"class","spectrum-ProgressCircle-fillSubMask2"),attr(co,"style",to[4]),attr(lo,"class","spectrum-ProgressCircle-fillMask2"),attr(ro,"class","spectrum-ProgressCircle-fills"),attr(ue,"class",fo="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(to[0])),toggle_class(ue,"spectrum-ProgressCircle--indeterminate",to[1]==null),toggle_class(ue,"spectrum-ProgressCircle--overBackground",to[2])},m(_o,go){insert$1(_o,ue,go),append$2(ue,eo),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),append$2(oo,io),append$2(io,ao),append$2(ro,so),append$2(ro,lo),append$2(lo,co),append$2(co,uo),po||(ho=listen(ue,"click",to[7]),po=!0)},p(_o,[go]){go&8&&attr(io,"style",_o[3]),go&16&&attr(co,"style",_o[4]),go&1&&fo!==(fo="spectrum-ProgressCircle spectrum-ProgressCircle--"+convertSize(_o[0]))&&attr(ue,"class",fo),go&3&&toggle_class(ue,"spectrum-ProgressCircle--indeterminate",_o[1]==null),go&5&&toggle_class(ue,"spectrum-ProgressCircle--overBackground",_o[2])},i:noop$6,o:noop$6,d(_o){_o&&detach(ue),po=!1,ho()}}}function convertSize(to){switch(to){case"S":return"small";case"L":return"large";default:return}}function instance$bB(to,ue,eo){let{size:no="M"}=ue,{value:ro=null}=ue,{minValue:oo=0}=ue,{maxValue:io=100}=ue,ao,so;function lo(fo){if(fo){let po=(fo-oo)/(io-oo)*100,ho;po>0&&po<=50?(ho=-180+po/50*180,eo(3,ao=`transform: rotate(${ho}deg);`),eo(4,so="transform: rotate(-180deg);")):po>50&&(ho=-180+(po-50)/50*180,eo(3,ao="transform: rotate(0deg);"),eo(4,so=`transform: rotate(${ho}deg);`))}}let{overBackground:co=!1}=ue;function uo(fo){bubble.call(this,to,fo)}return to.$$set=fo=>{"size"in fo&&eo(0,no=fo.size),"value"in fo&&eo(1,ro=fo.value),"minValue"in fo&&eo(5,oo=fo.minValue),"maxValue"in fo&&eo(6,io=fo.maxValue),"overBackground"in fo&&eo(2,co=fo.overBackground)},to.$$.update=()=>{to.$$.dirty&2&&lo(ro)},[no,ro,co,ao,so,oo,io,uo]}class ProgressCircle extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bB,create_fragment$bE,safe_not_equal,{size:0,value:1,minValue:5,maxValue:6,overBackground:2})}}const Picker_svelte_svelte_type_style_lang="";function get_each_context$2d(to,ue,eo){const no=to.slice();return no[49]=ue[eo],no[51]=eo,no}function create_if_block_11$6(to){let ue,eo,no,ro;const oo=[create_if_block_12$4,create_else_block_1$z],io=[];function ao(so,lo){return so[15]?1:0}return ue=ao(to),eo=io[ue]=oo[ue](to),{c(){eo.c(),no=empty$2()},m(so,lo){io[ue].m(so,lo),insert$1(so,no,lo),ro=!0},p(so,lo){let co=ue;ue=ao(so),ue===co?io[ue].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),eo=io[ue],eo?eo.p(so,lo):(eo=io[ue]=oo[ue](so),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no))},i(so){ro||(transition_in(eo),ro=!0)},o(so){transition_out(eo),ro=!1},d(so){so&&detach(no),io[ue].d(so)}}}function create_else_block_1$z(to){let ue,eo,no;return{c(){ue=element("span"),eo=element("img"),src_url_equal(eo.src,no=to[5])||attr(eo,"src",no),attr(eo,"alt","icon"),attr(eo,"width","15"),attr(eo,"height","15"),attr(ue,"class","option-extra icon field-icon svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,eo)},p(ro,oo){oo[0]&32&&!src_url_equal(eo.src,no=ro[5])&&attr(eo,"src",no)},i:noop$6,o:noop$6,d(ro){ro&&detach(ue)}}}function create_if_block_12$4(to){let ue,eo,no;return eo=new Icon({props:{size:"S",name:to[5]}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra icon svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&32&&(io.name=ro[5]),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_10$a(to){let ue,eo,no;return eo=new StatusLight({props:{square:!0,color:to[6]}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&64&&(io.color=ro[6]),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_9$h(to){let ue,eo;return ue=new Search({props:{value:to[0],disabled:to[3],placeholder:"Search"}}),ue.$on("change",to[37]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1&&(oo.value=no[0]),ro[0]&8&&(oo.disabled=no[3]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_8$k(to){let ue,eo,no,ro,oo,io,ao,so;return{c(){ue=element("li"),eo=element("span"),no=text$1(to[8]),ro=space$1(),oo=svg_element("svg"),io=svg_element("use"),attr(eo,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(io,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(oo,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(oo,"focusable","false"),attr(oo,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item placeholder svelte-1jmtv0w"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[7])},m(lo,co){insert$1(lo,ue,co),append$2(ue,eo),append$2(eo,no),append$2(ue,ro),append$2(ue,oo),append$2(oo,io),ao||(so=listen(ue,"click",to[38]),ao=!0)},p(lo,co){co[0]&256&&set_data(no,lo[8]),co[0]&128&&toggle_class(ue,"is-selected",lo[7])},d(lo){lo&&detach(ue),ao=!1,so()}}}function create_if_block_2$1P(to){let ue,eo,no=ensure_array_like(to[30]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block$2d(get_each_context$2d(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){for(let io=0;io<ro.length;io+=1)ro[io].c();ue=empty$2()},m(io,ao){for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(io,ao);insert$1(io,ue,ao),eo=!0},p(io,ao){if(ao[0]&1275330048){no=ensure_array_like(io[30]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context$2d(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block$2d(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue.parentNode,ue))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_if_block_6$w(to){let ue,eo,no,ro;const oo=[create_if_block_7$s,create_else_block$20],io=[];function ao(so,lo){return so[15]?0:1}return eo=ao(to),no=io[eo]=oo[eo](to),{c(){ue=element("span"),no.c(),attr(ue,"class","option-extra icon svelte-1jmtv0w")},m(so,lo){insert$1(so,ue,lo),io[eo].m(ue,null),ro=!0},p(so,lo){let co=eo;eo=ao(so),eo===co?io[eo].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),no=io[eo],no?no.p(so,lo):(no=io[eo]=oo[eo](so),no.c()),transition_in(no,1),no.m(ue,null))},i(so){ro||(transition_in(no),ro=!0)},o(so){transition_out(no),ro=!1},d(so){so&&detach(ue),io[eo].d()}}}function create_else_block$20(to){let ue,eo;return ue=new Icon({props:{size:"S",name:to[14](to[49],to[51])}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1073758208&&(oo.name=no[14](no[49],no[51])),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_7$s(to){let ue,eo;return{c(){ue=element("img"),src_url_equal(ue.src,eo=to[14](to[49],to[51]))||attr(ue,"src",eo),attr(ue,"alt","icon"),attr(ue,"width","15"),attr(ue,"height","15")},m(no,ro){insert$1(no,ue,ro)},p(no,ro){ro[0]&1073758208&&!src_url_equal(ue.src,eo=no[14](no[49],no[51]))&&attr(ue,"src",eo)},i:noop$6,o:noop$6,d(no){no&&detach(ue)}}}function create_if_block_5$H(to){let ue,eo,no;return eo=new StatusLight({props:{square:!0,color:to[16](to[49],to[51])}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-extra svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1073807360&&(io.color=ro[16](ro[49],ro[51])),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block_4$V(to){let ue,eo=to[17](to[49],to[51])+"",no;return{c(){ue=element("span"),no=text$1(eo),attr(ue,"class","subtitle-text svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,no)},p(ro,oo){oo[0]&1073872896&&eo!==(eo=ro[17](ro[49],ro[51])+"")&&set_data(no,eo)},d(ro){ro&&detach(ue)}}}function create_if_block_3$1g(to){let ue,eo,no;return eo=new Tags({props:{$$slots:{default:[create_default_slot_1$4p]},$$scope:{ctx:to}}}),{c(){ue=element("span"),create_component(eo.$$.fragment),attr(ue,"class","option-tag svelte-1jmtv0w")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1073741824|oo[1]&2097152&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot_2$37(to){let ue=to[49].tag+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&1073741824&&ue!==(ue=no[49].tag+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_default_slot_1$4p(to){let ue,eo;return ue=new Tag$1({props:{icon:"LockClosed",$$slots:{default:[create_default_slot_2$37]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&1073741824|ro[1]&2097152&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_each_block$2d(to){let ue,eo=to[14](to[49],to[51]),no,ro=to[16](to[49],to[51]),oo,io,ao=to[12](to[49],to[51])+"",so,lo,co=to[17](to[49],to[51]),uo,fo,po,ho,_o,go,bo,vo,yo=eo&&create_if_block_6$w(to),wo=ro&&create_if_block_5$H(to),ko=co&&create_if_block_4$V(to),So=to[49].tag&&create_if_block_3$1g(to);function Ao(){return to[39](to[49],to[51])}function Io(...To){return to[40](to[49],...To)}function Eo(...To){return to[41](to[49],...To)}return{c(){ue=element("li"),yo&&yo.c(),no=space$1(),wo&&wo.c(),oo=space$1(),io=element("span"),so=text$1(ao),lo=space$1(),ko&&ko.c(),uo=space$1(),So&&So.c(),fo=space$1(),po=svg_element("svg"),ho=svg_element("use"),_o=space$1(),attr(io,"class","spectrum-Menu-itemLabel svelte-1jmtv0w"),xlink_attr(ho,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(po,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon svelte-1jmtv0w"),attr(po,"focusable","false"),attr(po,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item svelte-1jmtv0w"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[9](to[13](to[49],to[51]))),toggle_class(ue,"is-disabled",!to[10](to[49]))},m(To,Mo){insert$1(To,ue,Mo),yo&&yo.m(ue,null),append$2(ue,no),wo&&wo.m(ue,null),append$2(ue,oo),append$2(ue,io),append$2(io,so),append$2(io,lo),ko&&ko.m(io,null),append$2(ue,uo),So&&So.m(ue,null),append$2(ue,fo),append$2(ue,po),append$2(po,ho),append$2(ue,_o),go=!0,bo||(vo=[listen(ue,"click",Ao),listen(ue,"mouseenter",Io),listen(ue,"mouseleave",Eo)],bo=!0)},p(To,Mo){to=To,Mo[0]&1073758208&&(eo=to[14](to[49],to[51])),eo?yo?(yo.p(to,Mo),Mo[0]&1073758208&&transition_in(yo,1)):(yo=create_if_block_6$w(to),yo.c(),transition_in(yo,1),yo.m(ue,no)):yo&&(group_outros(),transition_out(yo,1,1,()=>{yo=null}),check_outros()),Mo[0]&1073807360&&(ro=to[16](to[49],to[51])),ro?wo?(wo.p(to,Mo),Mo[0]&1073807360&&transition_in(wo,1)):(wo=create_if_block_5$H(to),wo.c(),transition_in(wo,1),wo.m(ue,oo)):wo&&(group_outros(),transition_out(wo,1,1,()=>{wo=null}),check_outros()),(!go||Mo[0]&1073745920)&&ao!==(ao=to[12](to[49],to[51])+"")&&set_data(so,ao),Mo[0]&1073872896&&(co=to[17](to[49],to[51])),co?ko?ko.p(to,Mo):(ko=create_if_block_4$V(to),ko.c(),ko.m(io,null)):ko&&(ko.d(1),ko=null),to[49].tag?So?(So.p(to,Mo),Mo[0]&1073741824&&transition_in(So,1)):(So=create_if_block_3$1g(to),So.c(),transition_in(So,1),So.m(ue,fo)):So&&(group_outros(),transition_out(So,1,1,()=>{So=null}),check_outros()),(!go||Mo[0]&1073750528)&&toggle_class(ue,"is-selected",to[9](to[13](to[49],to[51]))),(!go||Mo[0]&1073742848)&&toggle_class(ue,"is-disabled",!to[10](to[49]))},i(To){go||(transition_in(yo),transition_in(wo),transition_in(So),go=!0)},o(To){transition_out(yo),transition_out(wo),transition_out(So),go=!1},d(To){To&&detach(ue),yo&&yo.d(),wo&&wo.d(),ko&&ko.d(),So&&So.d(),bo=!1,run_all(vo)}}}function create_if_block_1$2_(to){let ue,eo,no;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","loading svelte-1jmtv0w"),toggle_class(ue,"loading--withAutocomplete",to[20])},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){(!no||oo[0]&1048576)&&toggle_class(ue,"loading--withAutocomplete",ro[20])},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_if_block$5r(to){let ue,eo;return{c(){ue=element("div"),eo=text$1(to[23]),attr(ue,"class","footer svelte-1jmtv0w")},m(no,ro){insert$1(no,ue,ro),append$2(ue,eo)},p(no,ro){ro[0]&8388608&&set_data(eo,no[23])},d(no){no&&detach(ue)}}}function create_default_slot$6X(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo=to[20]&&create_if_block_9$h(to),fo=to[8]&&create_if_block_8$k(to),po=to[30].length&&create_if_block_2$1P(to),ho=to[25]&&create_if_block_1$2_(to),_o=to[23]&&create_if_block$5r(to);return{c(){ue=element("div"),uo&&uo.c(),eo=space$1(),no=element("ul"),fo&&fo.c(),ro=space$1(),po&&po.c(),oo=space$1(),ho&&ho.c(),io=space$1(),_o&&_o.c(),attr(no,"class","spectrum-Menu"),attr(no,"role","listbox"),attr(ue,"class","popover-content svelte-1jmtv0w"),toggle_class(ue,"auto-width",to[19])},m(go,bo){insert$1(go,ue,bo),uo&&uo.m(ue,null),append$2(ue,eo),append$2(ue,no),fo&&fo.m(no,null),append$2(no,ro),po&&po.m(no,null),to[42](no),append$2(ue,oo),ho&&ho.m(ue,null),append$2(ue,io),_o&&_o.m(ue,null),so=!0,lo||(co=action_destroyer(ao=clickOutside.call(null,ue,to[43])),lo=!0)},p(go,bo){go[20]?uo?(uo.p(go,bo),bo[0]&1048576&&transition_in(uo,1)):(uo=create_if_block_9$h(go),uo.c(),transition_in(uo,1),uo.m(ue,eo)):uo&&(group_outros(),transition_out(uo,1,1,()=>{uo=null}),check_outros()),go[8]?fo?fo.p(go,bo):(fo=create_if_block_8$k(go),fo.c(),fo.m(no,ro)):fo&&(fo.d(1),fo=null),go[30].length?po?(po.p(go,bo),bo[0]&1073741824&&transition_in(po,1)):(po=create_if_block_2$1P(go),po.c(),transition_in(po,1),po.m(no,null)):po&&(group_outros(),transition_out(po,1,1,()=>{po=null}),check_outros()),go[25]?ho?(ho.p(go,bo),bo[0]&33554432&&transition_in(ho,1)):(ho=create_if_block_1$2_(go),ho.c(),transition_in(ho,1),ho.m(ue,io)):ho&&(group_outros(),transition_out(ho,1,1,()=>{ho=null}),check_outros()),go[23]?_o?_o.p(go,bo):(_o=create_if_block$5r(go),_o.c(),_o.m(ue,null)):_o&&(_o.d(1),_o=null),ao&&is_function(ao.update)&&bo[0]&2&&ao.update.call(null,go[43]),(!so||bo[0]&524288)&&toggle_class(ue,"auto-width",go[19])},i(go){so||(transition_in(uo),transition_in(po),transition_in(ho),so=!0)},o(go){transition_out(uo),transition_out(po),transition_out(ho),so=!1},d(go){go&&detach(ue),uo&&uo.d(),fo&&fo.d(),po&&po.d(),to[42](null),ho&&ho.d(),_o&&_o.d(),lo=!1,co()}}}function create_fragment$bD(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho=to[5]&&create_if_block_11$6(to),_o=to[6]&&create_if_block_10$a(to);return co=new Popover({props:{anchor:to[24]?to[24]:to[29],align:to[22]||"left",open:to[1],useAnchorWidth:!to[19],maxWidth:to[19]?400:null,customHeight:to[21],maxHeight:360,$$slots:{default:[create_default_slot$6X]},$$scope:{ctx:to}}}),co.$on("close",to[44]),{c(){ue=element("button"),ho&&ho.c(),eo=space$1(),_o&&_o.c(),no=space$1(),ro=element("span"),oo=text$1(to[4]),io=space$1(),ao=svg_element("svg"),so=svg_element("use"),lo=space$1(),create_component(co.$$.fragment),attr(ro,"class","spectrum-Picker-label svelte-1jmtv0w"),toggle_class(ro,"is-placeholder",to[7]),toggle_class(ro,"auto-width",to[19]),xlink_attr(so,"xlink:href","#spectrum-css-icon-Chevron100"),attr(ao,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"),attr(ao,"focusable","false"),attr(ao,"aria-hidden","true"),attr(ue,"id",to[2]),attr(ue,"class","spectrum-Picker spectrum-Picker--sizeM svelte-1jmtv0w"),ue.disabled=to[3],attr(ue,"aria-haspopup","listbox"),toggle_class(ue,"spectrum-Picker--quiet",to[18]),toggle_class(ue,"is-open",to[1])},m(go,bo){insert$1(go,ue,bo),ho&&ho.m(ue,null),append$2(ue,eo),_o&&_o.m(ue,null),append$2(ue,no),append$2(ue,ro),append$2(ro,oo),append$2(ue,io),append$2(ue,ao),append$2(ao,so),to[36](ue),insert$1(go,lo,bo),mount_component(co,go,bo),uo=!0,fo||(po=listen(ue,"click",to[31]),fo=!0)},p(go,bo){go[5]?ho?(ho.p(go,bo),bo[0]&32&&transition_in(ho,1)):(ho=create_if_block_11$6(go),ho.c(),transition_in(ho,1),ho.m(ue,eo)):ho&&(group_outros(),transition_out(ho,1,1,()=>{ho=null}),check_outros()),go[6]?_o?(_o.p(go,bo),bo[0]&64&&transition_in(_o,1)):(_o=create_if_block_10$a(go),_o.c(),transition_in(_o,1),_o.m(ue,no)):_o&&(group_outros(),transition_out(_o,1,1,()=>{_o=null}),check_outros()),(!uo||bo[0]&16)&&set_data(oo,go[4]),(!uo||bo[0]&128)&&toggle_class(ro,"is-placeholder",go[7]),(!uo||bo[0]&524288)&&toggle_class(ro,"auto-width",go[19]),(!uo||bo[0]&4)&&attr(ue,"id",go[2]),(!uo||bo[0]&8)&&(ue.disabled=go[3]),(!uo||bo[0]&262144)&&toggle_class(ue,"spectrum-Picker--quiet",go[18]),(!uo||bo[0]&2)&&toggle_class(ue,"is-open",go[1]);const vo={};bo[0]&553648128&&(vo.anchor=go[24]?go[24]:go[29]),bo[0]&4194304&&(vo.align=go[22]||"left"),bo[0]&2&&(vo.open=go[1]),bo[0]&524288&&(vo.useAnchorWidth=!go[19]),bo[0]&524288&&(vo.maxWidth=go[19]?400:null),bo[0]&2097152&&(vo.customHeight=go[21]),bo[0]&1587281803|bo[1]&2097152&&(vo.$$scope={dirty:bo,ctx:go}),co.$set(vo)},i(go){uo||(transition_in(ho),transition_in(_o),transition_in(co.$$.fragment,go),uo=!0)},o(go){transition_out(ho),transition_out(_o),transition_out(co.$$.fragment,go),uo=!1},d(go){go&&(detach(ue),detach(lo)),ho&&ho.d(),_o&&_o.d(),to[36](null),destroy_component(co,go),fo=!1,po()}}}function instance$bA(to,ue,eo){let no,ro,{id:oo=null}=ue,{disabled:io=!1}=ue,{fieldText:ao=""}=ue,{fieldIcon:so=""}=ue,{fieldColour:lo=""}=ue,{isPlaceholder:co=!1}=ue,{placeholderOption:uo=null}=ue,{options:fo=[]}=ue,{isOptionSelected:po=()=>!1}=ue,{isOptionEnabled:ho=()=>!0}=ue,{onSelectOption:_o=()=>{}}=ue,{getOptionLabel:go=Va=>Va}=ue,{getOptionValue:bo=Va=>Va}=ue,{getOptionIcon:vo=()=>null}=ue,{useOptionIconImage:yo=!1}=ue,{getOptionColour:wo=()=>null}=ue,{getOptionSubtitle:ko=()=>null}=ue,{open:So=!1}=ue,{readonly:Ao=!1}=ue,{quiet:Io=!1}=ue,{autoWidth:Eo=!1}=ue,{autocomplete:To=!1}=ue,{sort:Mo=!1}=ue,{searchTerm:Vo=null}=ue,{customPopoverHeight:Fo}=ue,{align:Po="left"}=ue,{footer:Ro=null}=ue,{customAnchor:Do=null}=ue,{loading:Uo}=ue,{onOptionMouseenter:qo=()=>{}}=ue,{onOptionMouseleave:xo=()=>{}}=ue;const Zo=createEventDispatcher();let Xo,Yo;const Qo=Va=>{Va.preventDefault(),Va.stopPropagation(),Zo("click"),!Ao&&(eo(0,Vo=null),eo(1,So=!So))},Ko=(Va,Oa,Pa)=>!(Va!=null&&Va.length)||!Array.isArray(Va)?[]:Pa?Va.sort((ya,ds)=>{const Ma=Oa(ya),ga=Oa(ds);return Ma>ga?1:-1}):Va,ra=(Va,Oa,Pa)=>{if(To&&Oa){const ya=Oa.toLowerCase();return Va.filter(ds=>`${Pa(ds)}`.toLowerCase().includes(ya))}return Va},ea=Va=>{Va.target.scrollHeight-Va.target.clientHeight-Va.target.scrollTop<100&&Zo("loadMore")};onDestroy(()=>{Yo==null||Yo.removeEventListener("scroll",null)});function ia(Va){binding_callbacks[Va?"unshift":"push"](()=>{Xo=Va,eo(29,Xo)})}const Jo=Va=>eo(0,Vo=Va.detail),sa=()=>_o(null),Aa=(Va,Oa)=>_o(bo(Va,Oa)),pa=(Va,Oa)=>qo(Oa,Va),va=(Va,Oa)=>xo(Oa,Va);function da(Va){binding_callbacks[Va?"unshift":"push"](()=>{Yo=Va,eo(28,Yo)})}const Ra=()=>eo(1,So=!1),Ba=()=>eo(1,So=!1);return to.$$set=Va=>{"id"in Va&&eo(2,oo=Va.id),"disabled"in Va&&eo(3,io=Va.disabled),"fieldText"in Va&&eo(4,ao=Va.fieldText),"fieldIcon"in Va&&eo(5,so=Va.fieldIcon),"fieldColour"in Va&&eo(6,lo=Va.fieldColour),"isPlaceholder"in Va&&eo(7,co=Va.isPlaceholder),"placeholderOption"in Va&&eo(8,uo=Va.placeholderOption),"options"in Va&&eo(32,fo=Va.options),"isOptionSelected"in Va&&eo(9,po=Va.isOptionSelected),"isOptionEnabled"in Va&&eo(10,ho=Va.isOptionEnabled),"onSelectOption"in Va&&eo(11,_o=Va.onSelectOption),"getOptionLabel"in Va&&eo(12,go=Va.getOptionLabel),"getOptionValue"in Va&&eo(13,bo=Va.getOptionValue),"getOptionIcon"in Va&&eo(14,vo=Va.getOptionIcon),"useOptionIconImage"in Va&&eo(15,yo=Va.useOptionIconImage),"getOptionColour"in Va&&eo(16,wo=Va.getOptionColour),"getOptionSubtitle"in Va&&eo(17,ko=Va.getOptionSubtitle),"open"in Va&&eo(1,So=Va.open),"readonly"in Va&&eo(33,Ao=Va.readonly),"quiet"in Va&&eo(18,Io=Va.quiet),"autoWidth"in Va&&eo(19,Eo=Va.autoWidth),"autocomplete"in Va&&eo(20,To=Va.autocomplete),"sort"in Va&&eo(34,Mo=Va.sort),"searchTerm"in Va&&eo(0,Vo=Va.searchTerm),"customPopoverHeight"in Va&&eo(21,Fo=Va.customPopoverHeight),"align"in Va&&eo(22,Po=Va.align),"footer"in Va&&eo(23,Ro=Va.footer),"customAnchor"in Va&&eo(24,Do=Va.customAnchor),"loading"in Va&&eo(25,Uo=Va.loading),"onOptionMouseenter"in Va&&eo(26,qo=Va.onOptionMouseenter),"onOptionMouseleave"in Va&&eo(27,xo=Va.onOptionMouseleave)},to.$$.update=()=>{to.$$.dirty[0]&4096|to.$$.dirty[1]&10&&eo(35,no=Ko(fo,go,Mo)),to.$$.dirty[0]&4097|to.$$.dirty[1]&16&&eo(30,ro=ra(no,Vo,go)),to.$$.dirty[0]&268435456&&(Yo==null||Yo.addEventListener("scroll",ea))},[Vo,So,oo,io,ao,so,lo,co,uo,po,ho,_o,go,bo,vo,yo,wo,ko,Io,Eo,To,Fo,Po,Ro,Do,Uo,qo,xo,Yo,Xo,ro,Qo,fo,Ao,Mo,no,ia,Jo,sa,Aa,pa,va,da,Ra,Ba]}class Picker extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bA,create_fragment$bD,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$bC(to){let ue,eo,no,ro;function oo(so){to[32](so)}function io(so){to[33](so)}let ao={quiet:to[15],id:to[3],disabled:to[5],readonly:to[14],fieldText:to[27],fieldIcon:to[26],fieldColour:to[25],options:to[6],autoWidth:to[16],align:to[19],footer:to[20],getOptionLabel:to[7],getOptionValue:to[8],getOptionIcon:to[9],getOptionColour:to[10],getOptionSubtitle:to[11],useOptionIconImage:to[12],isOptionEnabled:to[13],autocomplete:to[17],sort:to[18],tag:to[21],onOptionMouseenter:to[23],onOptionMouseleave:to[24],isPlaceholder:to[2]==null||to[2]==="",placeholderOption:to[4]===!1?null:to[4]||"Choose an option",isOptionSelected:to[31],onSelectOption:to[29],loading:to[22]};return to[0]!==void 0&&(ao.open=to[0]),to[1]!==void 0&&(ao.searchTerm=to[1]),ue=new Picker({props:ao}),binding_callbacks.push(()=>bind$2(ue,"open",oo)),binding_callbacks.push(()=>bind$2(ue,"searchTerm",io)),ue.$on("click",to[34]),ue.$on("loadMore",to[35]),{c(){create_component(ue.$$.fragment)},m(so,lo){mount_component(ue,so,lo),ro=!0},p(so,lo){const co={};lo[0]&32768&&(co.quiet=so[15]),lo[0]&8&&(co.id=so[3]),lo[0]&32&&(co.disabled=so[5]),lo[0]&16384&&(co.readonly=so[14]),lo[0]&134217728&&(co.fieldText=so[27]),lo[0]&67108864&&(co.fieldIcon=so[26]),lo[0]&33554432&&(co.fieldColour=so[25]),lo[0]&64&&(co.options=so[6]),lo[0]&65536&&(co.autoWidth=so[16]),lo[0]&524288&&(co.align=so[19]),lo[0]&1048576&&(co.footer=so[20]),lo[0]&128&&(co.getOptionLabel=so[7]),lo[0]&256&&(co.getOptionValue=so[8]),lo[0]&512&&(co.getOptionIcon=so[9]),lo[0]&1024&&(co.getOptionColour=so[10]),lo[0]&2048&&(co.getOptionSubtitle=so[11]),lo[0]&4096&&(co.useOptionIconImage=so[12]),lo[0]&8192&&(co.isOptionEnabled=so[13]),lo[0]&131072&&(co.autocomplete=so[17]),lo[0]&262144&&(co.sort=so[18]),lo[0]&2097152&&(co.tag=so[21]),lo[0]&8388608&&(co.onOptionMouseenter=so[23]),lo[0]&16777216&&(co.onOptionMouseleave=so[24]),lo[0]&4&&(co.isPlaceholder=so[2]==null||so[2]===""),lo[0]&16&&(co.placeholderOption=so[4]===!1?null:so[4]||"Choose an option"),lo[0]&4&&(co.isOptionSelected=so[31]),lo[0]&4194304&&(co.loading=so[22]),!eo&&lo[0]&1&&(eo=!0,co.open=so[0],add_flush_callback(()=>eo=!1)),!no&&lo[0]&2&&(no=!0,co.searchTerm=so[1],add_flush_callback(()=>no=!1)),ue.$set(co)},i(so){ro||(transition_in(ue.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),ro=!1},d(so){destroy_component(ue,so)}}}function instance$bz(to,ue,eo){let no,ro,oo,{value:io=null}=ue,{id:ao=null}=ue,{placeholder:so="Choose an option"}=ue,{disabled:lo=!1}=ue,{options:co=[]}=ue,{getOptionLabel:uo=ea=>ea}=ue,{getOptionValue:fo=ea=>ea}=ue,{getOptionIcon:po=()=>null}=ue,{getOptionColour:ho=()=>null}=ue,{getOptionSubtitle:_o=()=>null}=ue,{compare:go=null}=ue,{useOptionIconImage:bo=!1}=ue,{isOptionEnabled:vo}=ue,{readonly:yo=!1}=ue,{quiet:wo=!1}=ue,{autoWidth:ko=!1}=ue,{autocomplete:So=!1}=ue,{sort:Ao=!1}=ue,{align:Io}=ue,{footer:Eo=null}=ue,{open:To=!1}=ue,{tag:Mo=null}=ue,{searchTerm:Vo=null}=ue,{loading:Fo}=ue,{onOptionMouseenter:Po=()=>{}}=ue,{onOptionMouseleave:Ro=()=>{}}=ue;const Do=createEventDispatcher();function Uo(ea,ia){return typeof go=="function"?go(ea,ia):ea===ia}const qo=(ea,ia,Jo)=>{if(!(Jo!=null&&Jo.length))return"";const sa=Jo.findIndex((Aa,pa)=>Uo(fo(Aa,pa),ia));return sa!==-1?ea(Jo[sa],sa):null},xo=(ea,ia,Jo)=>ea==null||ea===""?Jo===!1?"":Jo||"Choose an option":qo(uo,ea,ia)||"Choose an option",Zo=ea=>{Do("change",ea),eo(0,To=!1)},Xo=ea=>Uo(ea,io);function Yo(ea){To=ea,eo(0,To)}function Qo(ea){Vo=ea,eo(1,Vo)}function Ko(ea){bubble.call(this,to,ea)}function ra(ea){bubble.call(this,to,ea)}return to.$$set=ea=>{"value"in ea&&eo(2,io=ea.value),"id"in ea&&eo(3,ao=ea.id),"placeholder"in ea&&eo(4,so=ea.placeholder),"disabled"in ea&&eo(5,lo=ea.disabled),"options"in ea&&eo(6,co=ea.options),"getOptionLabel"in ea&&eo(7,uo=ea.getOptionLabel),"getOptionValue"in ea&&eo(8,fo=ea.getOptionValue),"getOptionIcon"in ea&&eo(9,po=ea.getOptionIcon),"getOptionColour"in ea&&eo(10,ho=ea.getOptionColour),"getOptionSubtitle"in ea&&eo(11,_o=ea.getOptionSubtitle),"compare"in ea&&eo(30,go=ea.compare),"useOptionIconImage"in ea&&eo(12,bo=ea.useOptionIconImage),"isOptionEnabled"in ea&&eo(13,vo=ea.isOptionEnabled),"readonly"in ea&&eo(14,yo=ea.readonly),"quiet"in ea&&eo(15,wo=ea.quiet),"autoWidth"in ea&&eo(16,ko=ea.autoWidth),"autocomplete"in ea&&eo(17,So=ea.autocomplete),"sort"in ea&&eo(18,Ao=ea.sort),"align"in ea&&eo(19,Io=ea.align),"footer"in ea&&eo(20,Eo=ea.footer),"open"in ea&&eo(0,To=ea.open),"tag"in ea&&eo(21,Mo=ea.tag),"searchTerm"in ea&&eo(1,Vo=ea.searchTerm),"loading"in ea&&eo(22,Fo=ea.loading),"onOptionMouseenter"in ea&&eo(23,Po=ea.onOptionMouseenter),"onOptionMouseleave"in ea&&eo(24,Ro=ea.onOptionMouseleave)},to.$$.update=()=>{to.$$.dirty[0]&84&&eo(27,no=xo(io,co,so)),to.$$.dirty[0]&580&&eo(26,ro=qo(po,io,co)),to.$$.dirty[0]&1092&&eo(25,oo=qo(ho,io,co))},[To,Vo,io,ao,so,lo,co,uo,fo,po,ho,_o,bo,vo,yo,wo,ko,So,Ao,Io,Eo,Mo,Fo,Po,Ro,oo,ro,no,Uo,Zo,go,Xo,Yo,Qo,Ko,ra]}class Select extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bz,create_fragment$bC,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$6W(to){let ue,eo;return ue=new Select({props:{quiet:to[15],error:to[5],disabled:to[2],readonly:to[3],value:to[0],options:to[7],placeholder:to[6],autoWidth:to[16],sort:to[17],align:to[21],footer:to[22],getOptionLabel:to[8],getOptionValue:to[9],getOptionIcon:to[11],getOptionColour:to[12],getOptionSubtitle:to[10],useOptionIconImage:to[13],isOptionEnabled:to[14],autocomplete:to[19],customPopoverHeight:to[20],tag:to[23],compare:to[25],onOptionMouseenter:to[26],onOptionMouseleave:to[27]}}),ue.$on("change",to[28]),ue.$on("click",to[29]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&32768&&(oo.quiet=no[15]),ro[0]&32&&(oo.error=no[5]),ro[0]&4&&(oo.disabled=no[2]),ro[0]&8&&(oo.readonly=no[3]),ro[0]&1&&(oo.value=no[0]),ro[0]&128&&(oo.options=no[7]),ro[0]&64&&(oo.placeholder=no[6]),ro[0]&65536&&(oo.autoWidth=no[16]),ro[0]&131072&&(oo.sort=no[17]),ro[0]&2097152&&(oo.align=no[21]),ro[0]&4194304&&(oo.footer=no[22]),ro[0]&256&&(oo.getOptionLabel=no[8]),ro[0]&512&&(oo.getOptionValue=no[9]),ro[0]&2048&&(oo.getOptionIcon=no[11]),ro[0]&4096&&(oo.getOptionColour=no[12]),ro[0]&1024&&(oo.getOptionSubtitle=no[10]),ro[0]&8192&&(oo.useOptionIconImage=no[13]),ro[0]&16384&&(oo.isOptionEnabled=no[14]),ro[0]&524288&&(oo.autocomplete=no[19]),ro[0]&1048576&&(oo.customPopoverHeight=no[20]),ro[0]&8388608&&(oo.tag=no[23]),ro[0]&33554432&&(oo.compare=no[25]),ro[0]&67108864&&(oo.onOptionMouseenter=no[26]),ro[0]&134217728&&(oo.onOptionMouseleave=no[27]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bB(to){let ue,eo;return ue=new Field({props:{helpText:to[24],label:to[1],labelPosition:to[4],error:to[5],tooltip:to[18],$$slots:{default:[create_default_slot$6W]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&16777216&&(oo.helpText=no[24]),ro[0]&2&&(oo.label=no[1]),ro[0]&16&&(oo.labelPosition=no[4]),ro[0]&32&&(oo.error=no[5]),ro[0]&262144&&(oo.tooltip=no[18]),ro[0]&251396077|ro[1]&2&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$by(to,ue,eo){let{value:no=null}=ue,{label:ro=void 0}=ue,{disabled:oo=!1}=ue,{readonly:io=!1}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{placeholder:lo="Choose an option"}=ue,{options:co=[]}=ue,{getOptionLabel:uo=xo=>Uo(xo,"label")}=ue,{getOptionValue:fo=xo=>Uo(xo,"value")}=ue,{getOptionSubtitle:po=xo=>xo==null?void 0:xo.subtitle}=ue,{getOptionIcon:ho=xo=>xo==null?void 0:xo.icon}=ue,{getOptionColour:_o=xo=>xo==null?void 0:xo.colour}=ue,{useOptionIconImage:go=!1}=ue,{isOptionEnabled:bo=void 0}=ue,{quiet:vo=!1}=ue,{autoWidth:yo=!1}=ue,{sort:wo=!1}=ue,{tooltip:ko=""}=ue,{autocomplete:So=!1}=ue,{customPopoverHeight:Ao=void 0}=ue,{align:Io=void 0}=ue,{footer:Eo=null}=ue,{tag:To=null}=ue,{helpText:Mo=null}=ue,{compare:Vo=void 0}=ue,{onOptionMouseenter:Fo=()=>{}}=ue,{onOptionMouseleave:Po=()=>{}}=ue;const Ro=createEventDispatcher(),Do=xo=>{eo(0,no=xo.detail),Ro("change",xo.detail)},Uo=(xo,Zo)=>xo&&typeof xo=="object"?xo[Zo]:xo;function qo(xo){bubble.call(this,to,xo)}return to.$$set=xo=>{"value"in xo&&eo(0,no=xo.value),"label"in xo&&eo(1,ro=xo.label),"disabled"in xo&&eo(2,oo=xo.disabled),"readonly"in xo&&eo(3,io=xo.readonly),"labelPosition"in xo&&eo(4,ao=xo.labelPosition),"error"in xo&&eo(5,so=xo.error),"placeholder"in xo&&eo(6,lo=xo.placeholder),"options"in xo&&eo(7,co=xo.options),"getOptionLabel"in xo&&eo(8,uo=xo.getOptionLabel),"getOptionValue"in xo&&eo(9,fo=xo.getOptionValue),"getOptionSubtitle"in xo&&eo(10,po=xo.getOptionSubtitle),"getOptionIcon"in xo&&eo(11,ho=xo.getOptionIcon),"getOptionColour"in xo&&eo(12,_o=xo.getOptionColour),"useOptionIconImage"in xo&&eo(13,go=xo.useOptionIconImage),"isOptionEnabled"in xo&&eo(14,bo=xo.isOptionEnabled),"quiet"in xo&&eo(15,vo=xo.quiet),"autoWidth"in xo&&eo(16,yo=xo.autoWidth),"sort"in xo&&eo(17,wo=xo.sort),"tooltip"in xo&&eo(18,ko=xo.tooltip),"autocomplete"in xo&&eo(19,So=xo.autocomplete),"customPopoverHeight"in xo&&eo(20,Ao=xo.customPopoverHeight),"align"in xo&&eo(21,Io=xo.align),"footer"in xo&&eo(22,Eo=xo.footer),"tag"in xo&&eo(23,To=xo.tag),"helpText"in xo&&eo(24,Mo=xo.helpText),"compare"in xo&&eo(25,Vo=xo.compare),"onOptionMouseenter"in xo&&eo(26,Fo=xo.onOptionMouseenter),"onOptionMouseleave"in xo&&eo(27,Po=xo.onOptionMouseleave)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,So,Ao,Io,Eo,To,Mo,Vo,Fo,Po,Do,qo]}let Select_1$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$by,create_fragment$bB,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$r="",Combobox_svelte_svelte_type_style_lang="";function get_each_context$2c(to,ue,eo){const no=to.slice();return no[22]=ue[eo],no}function create_if_block$5q(to){let ue,eo=ensure_array_like(to[5]),no=[];for(let ro=0;ro<eo.length;ro+=1)no[ro]=create_each_block$2c(get_each_context$2c(to,eo,ro));return{c(){for(let ro=0;ro<no.length;ro+=1)no[ro].c();ue=empty$2()},m(ro,oo){for(let io=0;io<no.length;io+=1)no[io]&&no[io].m(ro,oo);insert$1(ro,ue,oo)},p(ro,oo){if(oo&8417){eo=ensure_array_like(ro[5]);let io;for(io=0;io<eo.length;io+=1){const ao=get_each_context$2c(ro,eo,io);no[io]?no[io].p(ao,oo):(no[io]=create_each_block$2c(ao),no[io].c(),no[io].m(ue.parentNode,ue))}for(;io<no.length;io+=1)no[io].d(1);no.length=eo.length}},d(ro){ro&&detach(ue),destroy_each(no,ro)}}}function create_each_block$2c(to){let ue,eo,no=to[6](to[22])+"",ro,oo,io,ao,so,lo,co;function uo(){return to[18](to[22])}return{c(){ue=element("li"),eo=element("span"),ro=text$1(no),oo=space$1(),io=svg_element("svg"),ao=svg_element("use"),so=space$1(),attr(eo,"class","spectrum-Menu-itemLabel svelte-otlbol"),xlink_attr(ao,"xlink:href","#spectrum-css-icon-Checkmark100"),attr(io,"class","spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"),attr(io,"focusable","false"),attr(io,"aria-hidden","true"),attr(ue,"class","spectrum-Menu-item"),attr(ue,"role","option"),attr(ue,"aria-selected","true"),attr(ue,"tabindex","0"),toggle_class(ue,"is-selected",to[7](to[22])===to[0])},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),append$2(eo,ro),append$2(ue,oo),append$2(ue,io),append$2(io,ao),append$2(ue,so),lo||(co=listen(ue,"click",uo),lo=!0)},p(fo,po){to=fo,po&96&&no!==(no=to[6](to[22])+"")&&set_data(ro,no),po&161&&toggle_class(ue,"is-selected",to[7](to[22])===to[0])},d(fo){fo&&detach(ue),lo=!1,co()}}}function create_default_slot$6V(to){let ue,eo,no=to[5]&&Array.isArray(to[5]),ro,oo,io,ao=no&&create_if_block$5q(to);return{c(){ue=element("div"),eo=element("ul"),ao&&ao.c(),attr(eo,"class","spectrum-Menu"),attr(eo,"role","listbox"),attr(ue,"class","popover-content svelte-otlbol")},m(so,lo){insert$1(so,ue,lo),append$2(ue,eo),ao&&ao.m(eo,null),oo||(io=action_destroyer(ro=clickOutside.call(null,ue,to[19])),oo=!0)},p(so,lo){lo&32&&(no=so[5]&&Array.isArray(so[5])),no?ao?ao.p(so,lo):(ao=create_if_block$5q(so),ao.c(),ao.m(eo,null)):ao&&(ao.d(1),ao=null),ro&&is_function(ro.update)&&lo&256&&ro.update.call(null,so[19])},d(so){so&&detach(ue),ao&&ao.d(),oo=!1,io()}}}function create_fragment$bA(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho;return uo=new Popover({props:{anchor:to[10],open:to[8],align:"left",useAnchorWidth:!0,$$slots:{default:[create_default_slot$6V]},$$scope:{ctx:to}}}),uo.$on("close",to[20]),{c(){ue=element("div"),eo=element("div"),no=element("input"),io=space$1(),ao=element("button"),so=svg_element("svg"),lo=svg_element("use"),co=space$1(),create_component(uo.$$.fragment),attr(no,"id",to[1]),attr(no,"type","text"),no.value=ro=to[0]||"",attr(no,"placeholder",oo=to[2]||""),no.disabled=to[3],no.readOnly=to[4],attr(no,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-otlbol"),attr(eo,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-otlbol"),toggle_class(eo,"is-disabled",to[3]),toggle_class(eo,"is-focused",to[8]||to[9]),xlink_attr(lo,"xlink:href","#spectrum-css-icon-Chevron100"),attr(so,"class","spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon spectrum-InputGroup-icon"),attr(so,"focusable","false"),attr(so,"aria-hidden","true"),attr(ao,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button"),attr(ao,"tabindex","-1"),attr(ao,"aria-haspopup","true"),ao.disabled=to[3],attr(ue,"class","spectrum-InputGroup svelte-otlbol"),toggle_class(ue,"is-focused",to[8]||to[9]),toggle_class(ue,"is-disabled",to[3])},m(_o,go){insert$1(_o,ue,go),append$2(ue,eo),append$2(eo,no),append$2(ue,io),append$2(ue,ao),append$2(ao,so),append$2(so,lo),to[17](ue),insert$1(_o,co,go),mount_component(uo,_o,go),fo=!0,po||(ho=[listen(no,"focus",to[14]),listen(no,"blur",to[15]),listen(no,"change",to[12]),listen(ao,"click",to[16])],po=!0)},p(_o,[go]){(!fo||go&2)&&attr(no,"id",_o[1]),(!fo||go&1&&ro!==(ro=_o[0]||"")&&no.value!==ro)&&(no.value=ro),(!fo||go&4&&oo!==(oo=_o[2]||""))&&attr(no,"placeholder",oo),(!fo||go&8)&&(no.disabled=_o[3]),(!fo||go&16)&&(no.readOnly=_o[4]),(!fo||go&8)&&toggle_class(eo,"is-disabled",_o[3]),(!fo||go&768)&&toggle_class(eo,"is-focused",_o[8]||_o[9]),(!fo||go&8)&&(ao.disabled=_o[3]),(!fo||go&768)&&toggle_class(ue,"is-focused",_o[8]||_o[9]),(!fo||go&8)&&toggle_class(ue,"is-disabled",_o[3]);const bo={};go&1024&&(bo.anchor=_o[10]),go&256&&(bo.open=_o[8]),go&33554913&&(bo.$$scope={dirty:go,ctx:_o}),uo.$set(bo)},i(_o){fo||(transition_in(uo.$$.fragment,_o),fo=!0)},o(_o){transition_out(uo.$$.fragment,_o),fo=!1},d(_o){_o&&(detach(ue),detach(co)),to[17](null),destroy_component(uo,_o),po=!1,run_all(ho)}}}function instance$bx(to,ue,eo){let{value:no=void 0}=ue,{id:ro=void 0}=ue,{placeholder:oo="Choose an option or type"}=ue,{disabled:io=!1}=ue,{readonly:ao=!1}=ue,{options:so=[]}=ue,{getOptionLabel:lo=Eo=>`${Eo}`}=ue,{getOptionValue:co=Eo=>`${Eo}`}=ue;const uo=createEventDispatcher();let fo=!1,po=!1,ho;const _o=Eo=>{uo("change",Eo),eo(8,fo=!1)},go=Eo=>{const To=Eo.currentTarget.value;uo("type",To),_o(To)},bo=Eo=>{uo("pick",Eo),_o(Eo)},vo=()=>eo(9,po=!0),yo=()=>{eo(9,po=!1),uo("blur")},wo=()=>eo(8,fo=!fo);function ko(Eo){binding_callbacks[Eo?"unshift":"push"](()=>{ho=Eo,eo(10,ho)})}const So=Eo=>bo(co(Eo)),Ao=()=>eo(8,fo=!1),Io=()=>eo(8,fo=!1);return to.$$set=Eo=>{"value"in Eo&&eo(0,no=Eo.value),"id"in Eo&&eo(1,ro=Eo.id),"placeholder"in Eo&&eo(2,oo=Eo.placeholder),"disabled"in Eo&&eo(3,io=Eo.disabled),"readonly"in Eo&&eo(4,ao=Eo.readonly),"options"in Eo&&eo(5,so=Eo.options),"getOptionLabel"in Eo&&eo(6,lo=Eo.getOptionLabel),"getOptionValue"in Eo&&eo(7,co=Eo.getOptionValue)},[no,ro,oo,io,ao,so,lo,co,fo,po,ho,uo,go,bo,vo,yo,wo,ko,So,Ao,Io]}class Combobox extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bx,create_fragment$bA,safe_not_equal,{value:0,id:1,placeholder:2,disabled:3,readonly:4,options:5,getOptionLabel:6,getOptionValue:7})}}function create_default_slot$6U(to){let ue,eo;return ue=new Combobox({props:{error:to[5],disabled:to[2],value:to[0],options:to[7],placeholder:to[6],readonly:to[3],getOptionLabel:to[9],getOptionValue:to[10]}}),ue.$on("change",to[11]),ue.$on("pick",to[12]),ue.$on("type",to[13]),ue.$on("blur",to[14]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&32&&(oo.error=no[5]),ro&4&&(oo.disabled=no[2]),ro&1&&(oo.value=no[0]),ro&128&&(oo.options=no[7]),ro&64&&(oo.placeholder=no[6]),ro&8&&(oo.readonly=no[3]),ro&512&&(oo.getOptionLabel=no[9]),ro&1024&&(oo.getOptionValue=no[10]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$bz(to){let ue,eo;return ue=new Field({props:{helpText:to[8],label:to[1],labelPosition:to[4],error:to[5],$$slots:{default:[create_default_slot$6U]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&256&&(oo.helpText=no[8]),ro&2&&(oo.label=no[1]),ro&16&&(oo.labelPosition=no[4]),ro&32&&(oo.error=no[5]),ro&132845&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$bw(to,ue,eo){let{value:no=null}=ue,{label:ro=void 0}=ue,{disabled:oo=!1}=ue,{readonly:io=!1}=ue,{labelPosition:ao="above"}=ue,{error:so=null}=ue,{placeholder:lo="Choose an option or type"}=ue,{options:co=[]}=ue,{helpText:uo=null}=ue,{getOptionLabel:fo=wo=>go(wo,"label")}=ue,{getOptionValue:po=wo=>go(wo,"value")}=ue;const ho=createEventDispatcher(),_o=wo=>{eo(0,no=wo.detail),ho("change",wo.detail)},go=(wo,ko)=>wo&&typeof wo=="object"?wo[ko]:wo;function bo(wo){bubble.call(this,to,wo)}function vo(wo){bubble.call(this,to,wo)}function yo(wo){bubble.call(this,to,wo)}return to.$$set=wo=>{"value"in wo&&eo(0,no=wo.value),"label"in wo&&eo(1,ro=wo.label),"disabled"in wo&&eo(2,oo=wo.disabled),"readonly"in wo&&eo(3,io=wo.readonly),"labelPosition"in wo&&eo(4,ao=wo.labelPosition),"error"in wo&&eo(5,so=wo.error),"placeholder"in wo&&eo(6,lo=wo.placeholder),"options"in wo&&eo(7,co=wo.options),"helpText"in wo&&eo(8,uo=wo.helpText),"getOptionLabel"in wo&&eo(9,fo=wo.getOptionLabel),"getOptionValue"in wo&&eo(10,po=wo.getOptionValue)},[no,ro,oo,io,ao,so,lo,co,uo,fo,po,_o,bo,vo,yo]}class Combobox_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$bw,create_fragment$bz,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$q="",indexVars$p="",indexVars$o="";var AIOperationEnum=(to=>(to.SUMMARISE_TEXT="SUMMARISE_TEXT",to.CLEAN_DATA="CLEAN_DATA",to.TRANSLATE="TRANSLATE",to.CATEGORISE_TEXT="CATEGORISE_TEXT",to.SENTIMENT_ANALYSIS="SENTIMENT_ANALYSIS",to.PROMPT="PROMPT",to.SEARCH_WEB="SEARCH_WEB",to))(AIOperationEnum||{}),OperationFieldTypeEnum=(to=>(to.MULTI_COLUMN="columns",to.COLUMN="column",to.BINDABLE_TEXT="prompt",to))(OperationFieldTypeEnum||{}),Event$1=(to=>(to.USER_CREATED="user:created",to.USER_UPDATED="user:updated",to.USER_DELETED="user:deleted",to.USER_ONBOARDING_COMPLETE="user:onboarding:complete",to.USER_PERMISSION_ADMIN_ASSIGNED="user:admin:assigned",to.USER_PERMISSION_ADMIN_REMOVED="user:admin:removed",to.USER_PERMISSION_BUILDER_ASSIGNED="user:builder:assigned",to.USER_PERMISSION_BUILDER_REMOVED="user:builder:removed",to.USER_INVITED="user:invited",to.USER_INVITED_ACCEPTED="user:invite:accepted",to.USER_PASSWORD_FORCE_RESET="user:password:force:reset",to.USER_PASSWORD_UPDATED="user:password:updated",to.USER_PASSWORD_RESET_REQUESTED="user:password:reset:requested",to.USER_PASSWORD_RESET="user:password:reset",to.USER_DATA_COLLABORATION="user:data:collaboration",to.EMAIL_SMTP_CREATED="email:smtp:created",to.EMAIL_SMTP_UPDATED="email:smtp:updated",to.AI_CONFIG_CREATED="ai:config:created",to.AI_CONFIG_UPDATED="ai:config:updated",to.AUTH_SSO_CREATED="auth:sso:created",to.AUTH_SSO_UPDATED="auth:sso:updated",to.AUTH_SSO_ACTIVATED="auth:sso:activated",to.AUTH_SSO_DEACTIVATED="auth:sso:deactivated",to.AUTH_LOGIN="auth:login",to.AUTH_LOGOUT="auth:logout",to.ORG_NAME_UPDATED="org:info:name:updated",to.ORG_LOGO_UPDATED="org:info:logo:updated",to.ORG_PLATFORM_URL_UPDATED="org:platformurl:updated",to.INSTALLATION_VERSION_CHECKED="installation:version:checked",to.INSTALLATION_VERSION_UPGRADED="installation:version:upgraded",to.INSTALLATION_VERSION_DOWNGRADED="installation:version:downgraded",to.INSTALLATION_FIRST_STARTUP="installation:firstStartup",to.ANALYTICS_OPT_OUT="analytics:opt:out",to.ANALYTICS_OPT_IN="analytics:opt:in",to.APP_CREATED="app:created",to.APP_UPDATED="app:updated",to.APP_DELETED="app:deleted",to.APP_DUPLICATED="app:duplicated",to.APP_PUBLISHED="app:published",to.APP_UNPUBLISHED="app:unpublished",to.APP_TEMPLATE_IMPORTED="app:template:imported",to.APP_FILE_IMPORTED="app:file:imported",to.APP_VERSION_UPDATED="app:version:updated",to.APP_VERSION_REVERTED="app:version:reverted",to.APP_REVERTED="app:reverted",to.APP_EXPORTED="app:exported",to.ROLE_CREATED="role:created",to.ROLE_UPDATED="role:updated",to.ROLE_DELETED="role:deleted",to.ROLE_ASSIGNED="role:assigned",to.ROLE_UNASSIGNED="role:unassigned",to.SERVED_BUILDER="served:builder",to.SERVED_APP="served:app",to.SERVED_APP_PREVIEW="served:app:preview",to.DATASOURCE_CREATED="datasource:created",to.DATASOURCE_UPDATED="datasource:updated",to.DATASOURCE_DELETED="datasource:deleted",to.QUERY_CREATED="query:created",to.QUERY_UPDATED="query:updated",to.QUERY_DELETED="query:deleted",to.QUERY_IMPORT="query:import",to.QUERIES_RUN="queries:run",to.QUERY_PREVIEWED="query:previewed",to.TABLE_CREATED="table:created",to.TABLE_UPDATED="table:updated",to.TABLE_DELETED="table:deleted",to.TABLE_EXPORTED="table:exported",to.TABLE_IMPORTED="table:imported",to.TABLE_DATA_IMPORTED="table:data:imported",to.VIEW_CREATED="view:created",to.VIEW_UPDATED="view:updated",to.VIEW_DELETED="view:deleted",to.VIEW_EXPORTED="view:exported",to.VIEW_FILTER_CREATED="view:filter:created",to.VIEW_FILTER_UPDATED="view:filter:updated",to.VIEW_FILTER_DELETED="view:filter:deleted",to.VIEW_CALCULATION_CREATED="view:calculation:created",to.VIEW_CALCULATION_UPDATED="view:calculation:updated",to.VIEW_CALCULATION_DELETED="view:calculation:deleted",to.VIEW_JOIN_CREATED="view:join:created",to.ROWS_CREATED="rows:created",to.ROWS_IMPORTED="rows:imported",to.COMPONENT_CREATED="component:created",to.COMPONENT_DELETED="component:deleted",to.SCREEN_CREATED="screen:created",to.SCREEN_DELETED="screen:deleted",to.LAYOUT_CREATED="layout:created",to.LAYOUT_DELETED="layout:deleted",to.AUTOMATION_CREATED="automation:created",to.AUTOMATION_DELETED="automation:deleted",to.AUTOMATION_TESTED="automation:tested",to.AUTOMATIONS_RUN="automations:run",to.AUTOMATION_STEP_CREATED="automation:step:created",to.AUTOMATION_STEP_DELETED="automation:step:deleted",to.AUTOMATION_TRIGGER_UPDATED="automation:trigger:updated",to.LICENSE_PLAN_CHANGED="license:plan:changed",to.LICENSE_ACTIVATED="license:activated",to.LICENSE_PAYMENT_FAILED="license:payment:failed",to.LICENSE_PAYMENT_RECOVERED="license:payment:recovered",to.LICENSE_CHECKOUT_OPENED="license:checkout:opened",to.LICENSE_CHECKOUT_SUCCESS="license:checkout:success",to.LICENSE_PORTAL_OPENED="license:portal:opened",to.ACCOUNT_CREATED="account:created",to.ACCOUNT_DELETED="account:deleted",to.ACCOUNT_VERIFIED="account:verified",to.APP_BACKFILL_SUCCEEDED="app:backfill:succeeded",to.APP_BACKFILL_FAILED="app:backfill:failed",to.TENANT_BACKFILL_SUCCEEDED="tenant:backfill:succeeded",to.TENANT_BACKFILL_FAILED="tenant:backfill:failed",to.INSTALLATION_BACKFILL_SUCCEEDED="installation:backfill:succeeded",to.INSTALLATION_BACKFILL_FAILED="installation:backfill:failed",to.USER_GROUP_CREATED="user_group:created",to.USER_GROUP_UPDATED="user_group:updated",to.USER_GROUP_DELETED="user_group:deleted",to.USER_GROUP_USERS_ADDED="user_group:user_added",to.USER_GROUP_USERS_REMOVED="user_group:users_deleted",to.USER_GROUP_PERMISSIONS_EDITED="user_group:permissions_edited",to.USER_GROUP_ONBOARDING="user_group:onboarding_added",to.PLUGIN_INIT="plugin:init",to.PLUGIN_IMPORTED="plugin:imported",to.PLUGIN_DELETED="plugin:deleted",to.APP_BACKUP_RESTORED="app:backup:restored",to.APP_BACKUP_TRIGGERED="app:backup:triggered",to.ENVIRONMENT_VARIABLE_CREATED="environment_variable:created",to.ENVIRONMENT_VARIABLE_DELETED="environment_variable:deleted",to.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable:upgrade_panel_opened",to.AUDIT_LOGS_FILTERED="audit_log:filtered",to.AUDIT_LOGS_DOWNLOADED="audit_log:downloaded",to.ROW_ACTION_CREATED="row_action:created",to))(Event$1||{}),PlanType$1=(to=>(to.FREE="free",to.PRO="pro",to.TEAM="team",to.PREMIUM="premium",to.PREMIUM_PLUS="premium_plus",to.PREMIUM_PLUS_TRIAL="premium_plus_trial",to.BUSINESS="business",to.ENTERPRISE_BASIC="enterprise_basic",to.ENTERPRISE_BASIC_TRIAL="enterprise_basic_trial",to.ENTERPRISE="enterprise",to))(PlanType$1||{}),PlanModel$1=(to=>(to.PER_USER="perUser",to.PER_CREATOR_PER_USER="per_creator_per_user",to))(PlanModel$1||{}),StaticQuotaName=(to=>(to.ROWS="rows",to.APPS="apps",to.USERS="users",to.CREATORS="creators",to.USER_GROUPS="userGroups",to.PLUGINS="plugins",to.AI_CUSTOM_CONFIGS="aiCustomConfigs",to))(StaticQuotaName||{}),MonthlyQuotaName=(to=>(to.QUERIES="queries",to.AUTOMATIONS="automations",to.BUDIBASE_AI_CREDITS="budibaseAICredits",to))(MonthlyQuotaName||{}),Feature=(to=>(to.USER_GROUPS="userGroups",to.APP_BACKUPS="appBackups",to.ENVIRONMENT_VARIABLES="environmentVariables",to.AUDIT_LOGS="auditLogs",to.ENFORCEABLE_SSO="enforceableSSO",to.BRANDING="branding",to.SCIM="scim",to.SYNC_AUTOMATIONS="syncAutomations",to.TRIGGER_AUTOMATION_RUN="triggerAutomationRun",to.APP_BUILDERS="appBuilders",to.OFFLINE="offline",to.EXPANDED_PUBLIC_API="expandedPublicApi",to.VIEW_PERMISSIONS="viewPermissions",to.VIEW_READONLY_COLUMNS="viewReadonlyColumns",to.BUDIBASE_AI="budibaseAI",to.AI_CUSTOM_CONFIGS="aiCustomConfigs",to))(Feature||{}),SourceName=(to=>(to.POSTGRES="POSTGRES",to.DYNAMODB="DYNAMODB",to.MONGODB="MONGODB",to.ELASTICSEARCH="ELASTICSEARCH",to.COUCHDB="COUCHDB",to.SQL_SERVER="SQL_SERVER",to.S3="S3",to.AIRTABLE="AIRTABLE",to.MYSQL="MYSQL",to.ARANGODB="ARANGODB",to.REST="REST",to.ORACLE="ORACLE",to.GOOGLE_SHEETS="GOOGLE_SHEETS",to.FIRESTORE="FIRESTORE",to.REDIS="REDIS",to.SNOWFLAKE="SNOWFLAKE",to.BUDIBASE="BUDIBASE",to))(SourceName||{}),DatasourceFeature=(to=>(to.CONNECTION_CHECKING="connection",to.FETCH_TABLE_NAMES="fetch_table_names",to.EXPORT_SCHEMA="export_schema",to))(DatasourceFeature||{}),BasicOperator=(to=>(to.EQUAL="equal",to.NOT_EQUAL="notEqual",to.EMPTY="empty",to.NOT_EMPTY="notEmpty",to.FUZZY="fuzzy",to.STRING="string",to))(BasicOperator||{}),ArrayOperator=(to=>(to.CONTAINS="contains",to.NOT_CONTAINS="notContains",to.CONTAINS_ANY="containsAny",to.ONE_OF="oneOf",to))(ArrayOperator||{}),RangeOperator=(to=>(to.RANGE="range",to))(RangeOperator||{}),LogicalOperator=(to=>(to.AND="$and",to.OR="$or",to))(LogicalOperator||{});function isLogicalSearchOperator(to){return Object.values(LogicalOperator).includes(to)}function isBasicSearchOperator(to){return Object.values(BasicOperator).includes(to)}function isArraySearchOperator(to){return Object.values(ArrayOperator).includes(to)}function isRangeSearchOperator(to){return Object.values(RangeOperator).includes(to)}var InternalSearchFilterOperator=(to=>(to.COMPLEX_ID_OPERATOR="_complexIdOperator",to))(InternalSearchFilterOperator||{}),EmptyFilterOption=(to=>(to.RETURN_ALL="all",to.RETURN_NONE="none",to))(EmptyFilterOption||{}),UILogicalOperator=(to=>(to.ALL="all",to.ANY="any",to))(UILogicalOperator||{});const FeatureFlagDefaults={USE_ZOD_VALIDATOR:!1,CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS:!1,DIRECT_LOGIN_TO_ACCOUNT_PORTAL:!1};Event$1.PLUGIN_INIT;var PermissionSource=(to=>(to.EXPLICIT="EXPLICIT",to.INHERITED="INHERITED",to.BASE="BASE",to))(PermissionSource||{}),RowExportFormat=(to=>(to.CSV="csv",to.JSON="json",to.JSON_WITH_SCHEMA="jsonWithSchema",to))(RowExportFormat||{}),AutomationIOType=(to=>(to.OBJECT="object",to.STRING="string",to.BOOLEAN="boolean",to.NUMBER="number",to.ARRAY="array",to.JSON="json",to.DATE="date",to.ATTACHMENT="attachment",to))(AutomationIOType||{}),AutomationCustomIOType=(to=>(to.TABLE="table",to.ROW="row",to.ROWS="rows",to.WIDE="wide",to.QUERY="query",to.QUERY_PARAMS="queryParams",to.QUERY_LIMIT="queryLimit",to.LOOP_OPTION="loopOption",to.ITEM="item",to.CODE="code",to.FILTERS="filters",to.COLUMN="column",to.TRIGGER_SCHEMA="triggerSchema",to.CRON="cron",to.WEBHOOK_URL="webhookUrl",to.AUTOMATION="automation",to.AUTOMATION_FIELDS="automationFields",to.MULTI_ATTACHMENTS="multi_attachments",to.TRIGGER_FILTER="trigger_filter",to))(AutomationCustomIOType||{}),AutomationTriggerStepId=(to=>(to.ROW_SAVED="ROW_SAVED",to.ROW_UPDATED="ROW_UPDATED",to.ROW_DELETED="ROW_DELETED",to.WEBHOOK="WEBHOOK",to.APP="APP",to.CRON="CRON",to.ROW_ACTION="ROW_ACTION",to))(AutomationTriggerStepId||{}),AutomationStepType=(to=>(to.LOGIC="LOGIC",to.ACTION="ACTION",to.TRIGGER="TRIGGER",to))(AutomationStepType||{}),AutomationActionStepId=(to=>(to.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",to.CREATE_ROW="CREATE_ROW",to.UPDATE_ROW="UPDATE_ROW",to.DELETE_ROW="DELETE_ROW",to.EXECUTE_BASH="EXECUTE_BASH",to.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",to.EXECUTE_SCRIPT="EXECUTE_SCRIPT",to.EXECUTE_QUERY="EXECUTE_QUERY",to.SERVER_LOG="SERVER_LOG",to.DELAY="DELAY",to.FILTER="FILTER",to.QUERY_ROWS="QUERY_ROWS",to.LOOP="LOOP",to.COLLECT="COLLECT",to.OPENAI="OPENAI",to.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",to.BRANCH="BRANCH",to.discord="discord",to.slack="slack",to.zapier="zapier",to.integromat="integromat",to.n8n="n8n",to))(AutomationActionStepId||{});[...Object.values(AutomationActionStepId),...Object.values(AutomationTriggerStepId)];var AutomationFeature=(to=>(to.LOOPING="LOOPING",to))(AutomationFeature||{}),AutomationEventType=(to=>(to.ROW_SAVE="row:save",to.ROW_UPDATE="row:update",to.ROW_DELETE="row:delete",to.APP_TRIGGER="app:trigger",to.CRON_TRIGGER="cron:trigger",to.WEBHOOK_TRIGGER="web:trigger",to.ROW_ACTION="row:action",to))(AutomationEventType||{}),HttpMethod=(to=>(to.GET="GET",to.POST="POST",to.PATCH="PATCH",to.PUT="PUT",to.HEAD="HEAD",to.DELETE="DELETE",to))(HttpMethod||{});const INTERNAL_TABLE_SOURCE_ID="bb_internal";var FieldType=(to=>(to.STRING="string",to.LONGFORM="longform",to.OPTIONS="options",to.NUMBER="number",to.BOOLEAN="boolean",to.ARRAY="array",to.DATETIME="datetime",to.ATTACHMENTS="attachment",to.ATTACHMENT_SINGLE="attachment_single",to.LINK="link",to.FORMULA="formula",to.AUTO="auto",to.AI="ai",to.JSON="json",to.INTERNAL="internal",to.BARCODEQR="barcodeqr",to.SIGNATURE_SINGLE="signature_single",to.BIGINT="bigint",to.BB_REFERENCE="bb_reference",to.BB_REFERENCE_SINGLE="bb_reference_single",to))(FieldType||{});const NumericTypes=["number","bigint"];function isNumeric$1(to){return NumericTypes.includes(to)}const GroupByTypes=["string","longform","options","number","boolean","datetime","bigint","ai"];function canGroupBy(to){return GroupByTypes.includes(to)}var RelationshipType=(to=>(to.ONE_TO_MANY="one-to-many",to.MANY_TO_ONE="many-to-one",to.MANY_TO_MANY="many-to-many",to))(RelationshipType||{}),AutoFieldSubType=(to=>(to.CREATED_BY="createdBy",to.CREATED_AT="createdAt",to.UPDATED_BY="updatedBy",to.UPDATED_AT="updatedAt",to.AUTO_ID="autoID",to))(AutoFieldSubType||{}),FormulaType=(to=>(to.STATIC="static",to.DYNAMIC="dynamic",to.AI="ai",to))(FormulaType||{}),BBReferenceFieldSubType=(to=>(to.USER="user",to.USERS="users",to))(BBReferenceFieldSubType||{});function isRelationshipField(to){return to.type===FieldType.LINK}var CalculationType=(to=>(to.SUM="sum",to.AVG="avg",to.COUNT="count",to.MIN="min",to.MAX="max",to))(CalculationType||{}),ViewV2Type=(to=>(to.CALCULATION="calculation",to))(ViewV2Type||{});const SEPARATOR$1="_",prefixed=to=>`${to}${SEPARATOR$1}`;var DocumentType=(to=>(to.USER="us",to.GROUP="gr",to.WORKSPACE="workspace",to.CONFIG="config",to.TEMPLATE="template",to.APP="app",to.DEV="dev",to.APP_DEV="app_dev",to.APP_METADATA="app_metadata",to.ROLE="role",to.MIGRATIONS="migrations",to.DEV_INFO="devinfo",to.AUTOMATION_LOG="log_au",to.ACCOUNT_METADATA="acc_metadata",to.PLUGIN="plg",to.DATASOURCE="datasource",to.DATASOURCE_PLUS="datasource_plus",to.APP_BACKUP="backup",to.TABLE="ta",to.ROW="ro",to.AUTOMATION="au",to.LINK="li",to.WEBHOOK="wh",to.INSTANCE="inst",to.LAYOUT="layout",to.SCREEN="screen",to.QUERY="query",to.DEPLOYMENTS="deployments",to.METADATA="metadata",to.MEM_VIEW="view",to.USER_FLAG="flag",to.AUTOMATION_METADATA="meta_au",to.AUDIT_LOG="al",to.APP_MIGRATION_METADATA="_design/migrations",to.SCIM_LOG="scimlog",to.ROW_ACTIONS="ra",to))(DocumentType||{});Object.values(DocumentType).sort((to,ue)=>ue.length-to.length);var InternalTable=(to=>(to.USER_METADATA="ta_users",to))(InternalTable||{}),VirtualDocumentType=(to=>(to.VIEW="view",to.ROW_ACTION="row_action",to))(VirtualDocumentType||{});Object.values(VirtualDocumentType).sort((to,ue)=>ue.length-to.length);var Theme=(to=>(to.LIGHTEST="lightest",to.LIGHT="light",to.DARK="dark",to.DARKEST="darkest",to.NORD="nord",to.MIDNIGHT="midnight",to))(Theme||{}),DeploymentStatus=(to=>(to.SUCCESS="SUCCESS",to.PENDING="PENDING",to.FAILURE="FAILURE",to))(DeploymentStatus||{});const isConfig=to=>"type"in to&&"config"in to,isSCIMConfig=to=>to.type==="scim";var ConfigType=(to=>(to.SETTINGS="settings",to.ACCOUNT="account",to.SMTP="smtp",to.GOOGLE="google",to.OIDC="oidc",to.OIDC_LOGOS="logos_oidc",to.SCIM="scim",to.AI="ai",to))(ConfigType||{});function isSSOUser(to){return!!to.providerType}var PluginType=(to=>(to.DATASOURCE="datasource",to.COMPONENT="component",to.AUTOMATION="automation",to))(PluginType||{});Object.values(PluginType);StaticQuotaName.ROWS,MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;MonthlyQuotaName.QUERIES,MonthlyQuotaName.AUTOMATIONS;var SortOrder=(to=>(to.ASCENDING="ascending",to.DESCENDING="descending",to))(SortOrder||{}),SortType=(to=>(to.STRING="string",to.NUMBER="number",to))(SortType||{}),util$g;(function(to){to.assertEqual=ro=>ro;function ue(ro){}to.assertIs=ue;function eo(ro){throw new Error}to.assertNever=eo,to.arrayToEnum=ro=>{const oo={};for(const io of ro)oo[io]=io;return oo},to.getValidEnumValues=ro=>{const oo=to.objectKeys(ro).filter(ao=>typeof ro[ro[ao]]!="number"),io={};for(const ao of oo)io[ao]=ro[ao];return to.objectValues(io)},to.objectValues=ro=>to.objectKeys(ro).map(function(oo){return ro[oo]}),to.objectKeys=typeof Object.keys=="function"?ro=>Object.keys(ro):ro=>{const oo=[];for(const io in ro)Object.prototype.hasOwnProperty.call(ro,io)&&oo.push(io);return oo},to.find=(ro,oo)=>{for(const io of ro)if(oo(io))return io},to.isInteger=typeof Number.isInteger=="function"?ro=>Number.isInteger(ro):ro=>typeof ro=="number"&&isFinite(ro)&&Math.floor(ro)===ro;function no(ro,oo=" | "){return ro.map(io=>typeof io=="string"?`'${io}'`:io).join(oo)}to.joinValues=no,to.jsonStringifyReplacer=(ro,oo)=>typeof oo=="bigint"?oo.toString():oo})(util$g||(util$g={}));var objectUtil;(function(to){to.mergeShapes=(ue,eo)=>({...ue,...eo})})(objectUtil||(objectUtil={}));const ZodParsedType=util$g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=to=>{switch(typeof to){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(to)?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(to)?ZodParsedType.array:to===null?ZodParsedType.null:to.then&&typeof to.then=="function"&&to.catch&&typeof to.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&to instanceof Map?ZodParsedType.map:typeof Set<"u"&&to instanceof Set?ZodParsedType.set:typeof Date<"u"&&to instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$g.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=to=>JSON.stringify(to,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(ue){super(),this.issues=[],this.addIssue=no=>{this.issues=[...this.issues,no]},this.addIssues=(no=[])=>{this.issues=[...this.issues,...no]};const eo=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,eo):this.__proto__=eo,this.name="ZodError",this.issues=ue}get errors(){return this.issues}format(ue){const eo=ue||function(oo){return oo.message},no={_errors:[]},ro=oo=>{for(const io of oo.issues)if(io.code==="invalid_union")io.unionErrors.map(ro);else if(io.code==="invalid_return_type")ro(io.returnTypeError);else if(io.code==="invalid_arguments")ro(io.argumentsError);else if(io.path.length===0)no._errors.push(eo(io));else{let ao=no,so=0;for(;so<io.path.length;){const lo=io.path[so];so===io.path.length-1?(ao[lo]=ao[lo]||{_errors:[]},ao[lo]._errors.push(eo(io))):ao[lo]=ao[lo]||{_errors:[]},ao=ao[lo],so++}}};return ro(this),no}static assert(ue){if(!(ue instanceof ZodError))throw new Error(`Not a ZodError: ${ue}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$g.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(ue=eo=>eo.message){const eo={},no=[];for(const ro of this.issues)ro.path.length>0?(eo[ro.path[0]]=eo[ro.path[0]]||[],eo[ro.path[0]].push(ue(ro))):no.push(ue(ro));return{formErrors:no,fieldErrors:eo}}get formErrors(){return this.flatten()}}ZodError.create=to=>new ZodError(to);const errorMap=(to,ue)=>{let eo;switch(to.code){case ZodIssueCode.invalid_type:to.received===ZodParsedType.undefined?eo="Required":eo=`Expected ${to.expected}, received ${to.received}`;break;case ZodIssueCode.invalid_literal:eo=`Invalid literal value, expected ${JSON.stringify(to.expected,util$g.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:eo=`Unrecognized key(s) in object: ${util$g.joinValues(to.keys,", ")}`;break;case ZodIssueCode.invalid_union:eo="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:eo=`Invalid discriminator value. Expected ${util$g.joinValues(to.options)}`;break;case ZodIssueCode.invalid_enum_value:eo=`Invalid enum value. Expected ${util$g.joinValues(to.options)}, received '${to.received}'`;break;case ZodIssueCode.invalid_arguments:eo="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:eo="Invalid function return type";break;case ZodIssueCode.invalid_date:eo="Invalid date";break;case ZodIssueCode.invalid_string:typeof to.validation=="object"?"includes"in to.validation?(eo=`Invalid input: must include "${to.validation.includes}"`,typeof to.validation.position=="number"&&(eo=`${eo} at one or more positions greater than or equal to ${to.validation.position}`)):"startsWith"in to.validation?eo=`Invalid input: must start with "${to.validation.startsWith}"`:"endsWith"in to.validation?eo=`Invalid input: must end with "${to.validation.endsWith}"`:util$g.assertNever(to.validation):to.validation!=="regex"?eo=`Invalid ${to.validation}`:eo="Invalid";break;case ZodIssueCode.too_small:to.type==="array"?eo=`Array must contain ${to.exact?"exactly":to.inclusive?"at least":"more than"} ${to.minimum} element(s)`:to.type==="string"?eo=`String must contain ${to.exact?"exactly":to.inclusive?"at least":"over"} ${to.minimum} character(s)`:to.type==="number"?eo=`Number must be ${to.exact?"exactly equal to ":to.inclusive?"greater than or equal to ":"greater than "}${to.minimum}`:to.type==="date"?eo=`Date must be ${to.exact?"exactly equal to ":to.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(to.minimum))}`:eo="Invalid input";break;case ZodIssueCode.too_big:to.type==="array"?eo=`Array must contain ${to.exact?"exactly":to.inclusive?"at most":"less than"} ${to.maximum} element(s)`:to.type==="string"?eo=`String must contain ${to.exact?"exactly":to.inclusive?"at most":"under"} ${to.maximum} character(s)`:to.type==="number"?eo=`Number must be ${to.exact?"exactly":to.inclusive?"less than or equal to":"less than"} ${to.maximum}`:to.type==="bigint"?eo=`BigInt must be ${to.exact?"exactly":to.inclusive?"less than or equal to":"less than"} ${to.maximum}`:to.type==="date"?eo=`Date must be ${to.exact?"exactly":to.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(to.maximum))}`:eo="Invalid input";break;case ZodIssueCode.custom:eo="Invalid input";break;case ZodIssueCode.invalid_intersection_types:eo="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:eo=`Number must be a multiple of ${to.multipleOf}`;break;case ZodIssueCode.not_finite:eo="Number must be finite";break;default:eo=ue.defaultError,util$g.assertNever(to)}return{message:eo}};let overrideErrorMap=errorMap;function setErrorMap(to){overrideErrorMap=to}function getErrorMap(){return overrideErrorMap}const makeIssue=to=>{const{data:ue,path:eo,errorMaps:no,issueData:ro}=to,oo=[...eo,...ro.path||[]],io={...ro,path:oo};if(ro.message!==void 0)return{...ro,path:oo,message:ro.message};let ao="";const so=no.filter(lo=>!!lo).slice().reverse();for(const lo of so)ao=lo(io,{data:ue,defaultError:ao}).message;return{...ro,path:oo,message:ao}},EMPTY_PATH=[];function addIssueToContext(to,ue){const eo=getErrorMap(),no=makeIssue({issueData:ue,data:to.data,path:to.path,errorMaps:[to.common.contextualErrorMap,to.schemaErrorMap,eo,eo===errorMap?void 0:errorMap].filter(ro=>!!ro)});to.common.issues.push(no)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(ue,eo){const no=[];for(const ro of eo){if(ro.status==="aborted")return INVALID$3;ro.status==="dirty"&&ue.dirty(),no.push(ro.value)}return{status:ue.value,value:no}}static async mergeObjectAsync(ue,eo){const no=[];for(const ro of eo){const oo=await ro.key,io=await ro.value;no.push({key:oo,value:io})}return ParseStatus.mergeObjectSync(ue,no)}static mergeObjectSync(ue,eo){const no={};for(const ro of eo){const{key:oo,value:io}=ro;if(oo.status==="aborted"||io.status==="aborted")return INVALID$3;oo.status==="dirty"&&ue.dirty(),io.status==="dirty"&&ue.dirty(),oo.value!=="__proto__"&&(typeof io.value<"u"||ro.alwaysSet)&&(no[oo.value]=io.value)}return{status:ue.value,value:no}}}const INVALID$3=Object.freeze({status:"aborted"}),DIRTY=to=>({status:"dirty",value:to}),OK=to=>({status:"valid",value:to}),isAborted=to=>to.status==="aborted",isDirty=to=>to.status==="dirty",isValid$2=to=>to.status==="valid",isAsync=to=>typeof Promise<"u"&&to instanceof Promise;function __classPrivateFieldGet(to,ue,eo,no){if(eo==="a"&&!no)throw new TypeError("Private accessor was defined without a getter");if(typeof ue=="function"?to!==ue||!no:!ue.has(to))throw new TypeError("Cannot read private member from an object whose class did not declare it");return eo==="m"?no:eo==="a"?no.call(to):no?no.value:ue.get(to)}function __classPrivateFieldSet(to,ue,eo,no,ro){if(no==="m")throw new TypeError("Private method is not writable");if(no==="a"&&!ro)throw new TypeError("Private accessor was defined without a setter");if(typeof ue=="function"?to!==ue||!ro:!ue.has(to))throw new TypeError("Cannot write private member to an object whose class did not declare it");return no==="a"?ro.call(to,eo):ro?ro.value=eo:ue.set(to,eo),eo}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(to){to.errToObj=ue=>typeof ue=="string"?{message:ue}:ue||{},to.toString=ue=>typeof ue=="string"?ue:ue==null?void 0:ue.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(ue,eo,no,ro){this._cachedPath=[],this.parent=ue,this.data=eo,this._path=no,this._key=ro}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=(to,ue)=>{if(isValid$2(ue))return{success:!0,data:ue.value};if(!to.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const eo=new ZodError(to.common.issues);return this._error=eo,this._error}}};function processCreateParams(to){if(!to)return{};const{errorMap:ue,invalid_type_error:eo,required_error:no,description:ro}=to;if(ue&&(eo||no))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return ue?{errorMap:ue,description:ro}:{errorMap:(io,ao)=>{var so,lo;const{message:co}=to;return io.code==="invalid_enum_value"?{message:co??ao.defaultError}:typeof ao.data>"u"?{message:(so=co??no)!==null&&so!==void 0?so:ao.defaultError}:io.code!=="invalid_type"?{message:ao.defaultError}:{message:(lo=co??eo)!==null&&lo!==void 0?lo:ao.defaultError}},description:ro}}class ZodType{constructor(ue){this.spa=this.safeParseAsync,this._def=ue,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(ue){return getParsedType(ue.data)}_getOrReturnCtx(ue,eo){return eo||{common:ue.parent.common,data:ue.data,parsedType:getParsedType(ue.data),schemaErrorMap:this._def.errorMap,path:ue.path,parent:ue.parent}}_processInputParams(ue){return{status:new ParseStatus,ctx:{common:ue.parent.common,data:ue.data,parsedType:getParsedType(ue.data),schemaErrorMap:this._def.errorMap,path:ue.path,parent:ue.parent}}}_parseSync(ue){const eo=this._parse(ue);if(isAsync(eo))throw new Error("Synchronous parse encountered promise.");return eo}_parseAsync(ue){const eo=this._parse(ue);return Promise.resolve(eo)}parse(ue,eo){const no=this.safeParse(ue,eo);if(no.success)return no.data;throw no.error}safeParse(ue,eo){var no;const ro={common:{issues:[],async:(no=eo==null?void 0:eo.async)!==null&&no!==void 0?no:!1,contextualErrorMap:eo==null?void 0:eo.errorMap},path:(eo==null?void 0:eo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ue,parsedType:getParsedType(ue)},oo=this._parseSync({data:ue,path:ro.path,parent:ro});return handleResult(ro,oo)}async parseAsync(ue,eo){const no=await this.safeParseAsync(ue,eo);if(no.success)return no.data;throw no.error}async safeParseAsync(ue,eo){const no={common:{issues:[],contextualErrorMap:eo==null?void 0:eo.errorMap,async:!0},path:(eo==null?void 0:eo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ue,parsedType:getParsedType(ue)},ro=this._parse({data:ue,path:no.path,parent:no}),oo=await(isAsync(ro)?ro:Promise.resolve(ro));return handleResult(no,oo)}refine(ue,eo){const no=ro=>typeof eo=="string"||typeof eo>"u"?{message:eo}:typeof eo=="function"?eo(ro):eo;return this._refinement((ro,oo)=>{const io=ue(ro),ao=()=>oo.addIssue({code:ZodIssueCode.custom,...no(ro)});return typeof Promise<"u"&&io instanceof Promise?io.then(so=>so?!0:(ao(),!1)):io?!0:(ao(),!1)})}refinement(ue,eo){return this._refinement((no,ro)=>ue(no)?!0:(ro.addIssue(typeof eo=="function"?eo(no,ro):eo),!1))}_refinement(ue){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:ue}})}superRefine(ue){return this._refinement(ue)}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(ue){return ZodUnion.create([this,ue],this._def)}and(ue){return ZodIntersection.create(this,ue,this._def)}transform(ue){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:ue}})}default(ue){const eo=typeof ue=="function"?ue:()=>ue;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:eo,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(ue){const eo=typeof ue=="function"?ue:()=>ue;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:eo,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(ue){const eo=this.constructor;return new eo({...this._def,description:ue})}pipe(ue){return ZodPipeline.create(this,ue)}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(to){let ue="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return to.precision?ue=`${ue}\\.\\d{${to.precision}}`:to.precision==null&&(ue=`${ue}(\\.\\d+)?`),ue}function timeRegex(to){return new RegExp(`^${timeRegexSource(to)}$`)}function datetimeRegex(to){let ue=`${dateRegexSource}T${timeRegexSource(to)}`;const eo=[];return eo.push(to.local?"Z?":"Z"),to.offset&&eo.push("([+-]\\d{2}:?\\d{2})"),ue=`${ue}(${eo.join("|")})`,new RegExp(`^${ue}$`)}function isValidIP(to,ue){return!!((ue==="v4"||!ue)&&ipv4Regex.test(to)||(ue==="v6"||!ue)&&ipv6Regex.test(to))}class ZodString extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=String(ue.data)),this._getType(ue)!==ZodParsedType.string){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:oo.parsedType}),INVALID$3}const no=new ParseStatus;let ro;for(const oo of this._def.checks)if(oo.kind==="min")ue.data.length<oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_small,minimum:oo.value,type:"string",inclusive:!0,exact:!1,message:oo.message}),no.dirty());else if(oo.kind==="max")ue.data.length>oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_big,maximum:oo.value,type:"string",inclusive:!0,exact:!1,message:oo.message}),no.dirty());else if(oo.kind==="length"){const io=ue.data.length>oo.value,ao=ue.data.length<oo.value;(io||ao)&&(ro=this._getOrReturnCtx(ue,ro),io?addIssueToContext(ro,{code:ZodIssueCode.too_big,maximum:oo.value,type:"string",inclusive:!0,exact:!0,message:oo.message}):ao&&addIssueToContext(ro,{code:ZodIssueCode.too_small,minimum:oo.value,type:"string",inclusive:!0,exact:!0,message:oo.message}),no.dirty())}else if(oo.kind==="email")emailRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"email",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"emoji",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="uuid")uuidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"uuid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="nanoid")nanoidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="cuid")cuidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"cuid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="cuid2")cuid2Regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="ulid")ulidRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"ulid",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty());else if(oo.kind==="url")try{new URL(ue.data)}catch{ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"url",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()}else oo.kind==="regex"?(oo.regex.lastIndex=0,oo.regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"regex",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty())):oo.kind==="trim"?ue.data=ue.data.trim():oo.kind==="includes"?ue.data.includes(oo.value,oo.position)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{includes:oo.value,position:oo.position},message:oo.message}),no.dirty()):oo.kind==="toLowerCase"?ue.data=ue.data.toLowerCase():oo.kind==="toUpperCase"?ue.data=ue.data.toUpperCase():oo.kind==="startsWith"?ue.data.startsWith(oo.value)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{startsWith:oo.value},message:oo.message}),no.dirty()):oo.kind==="endsWith"?ue.data.endsWith(oo.value)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:{endsWith:oo.value},message:oo.message}),no.dirty()):oo.kind==="datetime"?datetimeRegex(oo).test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"datetime",message:oo.message}),no.dirty()):oo.kind==="date"?dateRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"date",message:oo.message}),no.dirty()):oo.kind==="time"?timeRegex(oo).test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.invalid_string,validation:"time",message:oo.message}),no.dirty()):oo.kind==="duration"?durationRegex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"duration",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):oo.kind==="ip"?isValidIP(ue.data,oo.version)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"ip",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):oo.kind==="base64"?base64Regex.test(ue.data)||(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{validation:"base64",code:ZodIssueCode.invalid_string,message:oo.message}),no.dirty()):util$g.assertNever(oo);return{status:no.value,value:ue.data}}_regex(ue,eo,no){return this.refinement(ro=>ue.test(ro),{validation:eo,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(no)})}_addCheck(ue){return new ZodString({...this._def,checks:[...this._def.checks,ue]})}email(ue){return this._addCheck({kind:"email",...errorUtil.errToObj(ue)})}url(ue){return this._addCheck({kind:"url",...errorUtil.errToObj(ue)})}emoji(ue){return this._addCheck({kind:"emoji",...errorUtil.errToObj(ue)})}uuid(ue){return this._addCheck({kind:"uuid",...errorUtil.errToObj(ue)})}nanoid(ue){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(ue)})}cuid(ue){return this._addCheck({kind:"cuid",...errorUtil.errToObj(ue)})}cuid2(ue){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(ue)})}ulid(ue){return this._addCheck({kind:"ulid",...errorUtil.errToObj(ue)})}base64(ue){return this._addCheck({kind:"base64",...errorUtil.errToObj(ue)})}ip(ue){return this._addCheck({kind:"ip",...errorUtil.errToObj(ue)})}datetime(ue){var eo,no;return typeof ue=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:ue}):this._addCheck({kind:"datetime",precision:typeof(ue==null?void 0:ue.precision)>"u"?null:ue==null?void 0:ue.precision,offset:(eo=ue==null?void 0:ue.offset)!==null&&eo!==void 0?eo:!1,local:(no=ue==null?void 0:ue.local)!==null&&no!==void 0?no:!1,...errorUtil.errToObj(ue==null?void 0:ue.message)})}date(ue){return this._addCheck({kind:"date",message:ue})}time(ue){return typeof ue=="string"?this._addCheck({kind:"time",precision:null,message:ue}):this._addCheck({kind:"time",precision:typeof(ue==null?void 0:ue.precision)>"u"?null:ue==null?void 0:ue.precision,...errorUtil.errToObj(ue==null?void 0:ue.message)})}duration(ue){return this._addCheck({kind:"duration",...errorUtil.errToObj(ue)})}regex(ue,eo){return this._addCheck({kind:"regex",regex:ue,...errorUtil.errToObj(eo)})}includes(ue,eo){return this._addCheck({kind:"includes",value:ue,position:eo==null?void 0:eo.position,...errorUtil.errToObj(eo==null?void 0:eo.message)})}startsWith(ue,eo){return this._addCheck({kind:"startsWith",value:ue,...errorUtil.errToObj(eo)})}endsWith(ue,eo){return this._addCheck({kind:"endsWith",value:ue,...errorUtil.errToObj(eo)})}min(ue,eo){return this._addCheck({kind:"min",value:ue,...errorUtil.errToObj(eo)})}max(ue,eo){return this._addCheck({kind:"max",value:ue,...errorUtil.errToObj(eo)})}length(ue,eo){return this._addCheck({kind:"length",value:ue,...errorUtil.errToObj(eo)})}nonempty(ue){return this.min(1,errorUtil.errToObj(ue))}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(ue=>ue.kind==="datetime")}get isDate(){return!!this._def.checks.find(ue=>ue.kind==="date")}get isTime(){return!!this._def.checks.find(ue=>ue.kind==="time")}get isDuration(){return!!this._def.checks.find(ue=>ue.kind==="duration")}get isEmail(){return!!this._def.checks.find(ue=>ue.kind==="email")}get isURL(){return!!this._def.checks.find(ue=>ue.kind==="url")}get isEmoji(){return!!this._def.checks.find(ue=>ue.kind==="emoji")}get isUUID(){return!!this._def.checks.find(ue=>ue.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(ue=>ue.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(ue=>ue.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(ue=>ue.kind==="cuid2")}get isULID(){return!!this._def.checks.find(ue=>ue.kind==="ulid")}get isIP(){return!!this._def.checks.find(ue=>ue.kind==="ip")}get isBase64(){return!!this._def.checks.find(ue=>ue.kind==="base64")}get minLength(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxLength(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}}ZodString.create=to=>{var ue;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(ue=to==null?void 0:to.coerce)!==null&&ue!==void 0?ue:!1,...processCreateParams(to)})};function floatSafeRemainder(to,ue){const eo=(to.toString().split(".")[1]||"").length,no=(ue.toString().split(".")[1]||"").length,ro=eo>no?eo:no,oo=parseInt(to.toFixed(ro).replace(".","")),io=parseInt(ue.toFixed(ro).replace(".",""));return oo%io/Math.pow(10,ro)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(ue){if(this._def.coerce&&(ue.data=Number(ue.data)),this._getType(ue)!==ZodParsedType.number){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:oo.parsedType}),INVALID$3}let no;const ro=new ParseStatus;for(const oo of this._def.checks)oo.kind==="int"?util$g.isInteger(ue.data)||(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:oo.message}),ro.dirty()):oo.kind==="min"?(oo.inclusive?ue.data<oo.value:ue.data<=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:oo.value,type:"number",inclusive:oo.inclusive,exact:!1,message:oo.message}),ro.dirty()):oo.kind==="max"?(oo.inclusive?ue.data>oo.value:ue.data>=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:oo.value,type:"number",inclusive:oo.inclusive,exact:!1,message:oo.message}),ro.dirty()):oo.kind==="multipleOf"?floatSafeRemainder(ue.data,oo.value)!==0&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_multiple_of,multipleOf:oo.value,message:oo.message}),ro.dirty()):oo.kind==="finite"?Number.isFinite(ue.data)||(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_finite,message:oo.message}),ro.dirty()):util$g.assertNever(oo);return{status:ro.value,value:ue.data}}gte(ue,eo){return this.setLimit("min",ue,!0,errorUtil.toString(eo))}gt(ue,eo){return this.setLimit("min",ue,!1,errorUtil.toString(eo))}lte(ue,eo){return this.setLimit("max",ue,!0,errorUtil.toString(eo))}lt(ue,eo){return this.setLimit("max",ue,!1,errorUtil.toString(eo))}setLimit(ue,eo,no,ro){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:ue,value:eo,inclusive:no,message:errorUtil.toString(ro)}]})}_addCheck(ue){return new ZodNumber({...this._def,checks:[...this._def.checks,ue]})}int(ue){return this._addCheck({kind:"int",message:errorUtil.toString(ue)})}positive(ue){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(ue)})}negative(ue){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(ue)})}nonpositive(ue){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(ue)})}nonnegative(ue){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(ue)})}multipleOf(ue,eo){return this._addCheck({kind:"multipleOf",value:ue,message:errorUtil.toString(eo)})}finite(ue){return this._addCheck({kind:"finite",message:errorUtil.toString(ue)})}safe(ue){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(ue)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(ue)})}get minValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}get isInt(){return!!this._def.checks.find(ue=>ue.kind==="int"||ue.kind==="multipleOf"&&util$g.isInteger(ue.value))}get isFinite(){let ue=null,eo=null;for(const no of this._def.checks){if(no.kind==="finite"||no.kind==="int"||no.kind==="multipleOf")return!0;no.kind==="min"?(eo===null||no.value>eo)&&(eo=no.value):no.kind==="max"&&(ue===null||no.value<ue)&&(ue=no.value)}return Number.isFinite(eo)&&Number.isFinite(ue)}}ZodNumber.create=to=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(to==null?void 0:to.coerce)||!1,...processCreateParams(to)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(ue){if(this._def.coerce&&(ue.data=BigInt(ue.data)),this._getType(ue)!==ZodParsedType.bigint){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:oo.parsedType}),INVALID$3}let no;const ro=new ParseStatus;for(const oo of this._def.checks)oo.kind==="min"?(oo.inclusive?ue.data<oo.value:ue.data<=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_small,type:"bigint",minimum:oo.value,inclusive:oo.inclusive,message:oo.message}),ro.dirty()):oo.kind==="max"?(oo.inclusive?ue.data>oo.value:ue.data>=oo.value)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.too_big,type:"bigint",maximum:oo.value,inclusive:oo.inclusive,message:oo.message}),ro.dirty()):oo.kind==="multipleOf"?ue.data%oo.value!==BigInt(0)&&(no=this._getOrReturnCtx(ue,no),addIssueToContext(no,{code:ZodIssueCode.not_multiple_of,multipleOf:oo.value,message:oo.message}),ro.dirty()):util$g.assertNever(oo);return{status:ro.value,value:ue.data}}gte(ue,eo){return this.setLimit("min",ue,!0,errorUtil.toString(eo))}gt(ue,eo){return this.setLimit("min",ue,!1,errorUtil.toString(eo))}lte(ue,eo){return this.setLimit("max",ue,!0,errorUtil.toString(eo))}lt(ue,eo){return this.setLimit("max",ue,!1,errorUtil.toString(eo))}setLimit(ue,eo,no,ro){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:ue,value:eo,inclusive:no,message:errorUtil.toString(ro)}]})}_addCheck(ue){return new ZodBigInt({...this._def,checks:[...this._def.checks,ue]})}positive(ue){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ue)})}negative(ue){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ue)})}nonpositive(ue){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ue)})}nonnegative(ue){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ue)})}multipleOf(ue,eo){return this._addCheck({kind:"multipleOf",value:ue,message:errorUtil.toString(eo)})}get minValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue}get maxValue(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue}}ZodBigInt.create=to=>{var ue;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(ue=to==null?void 0:to.coerce)!==null&&ue!==void 0?ue:!1,...processCreateParams(to)})};class ZodBoolean extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=!!ue.data),this._getType(ue)!==ZodParsedType.boolean){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodBoolean.create=to=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(to==null?void 0:to.coerce)||!1,...processCreateParams(to)});class ZodDate extends ZodType{_parse(ue){if(this._def.coerce&&(ue.data=new Date(ue.data)),this._getType(ue)!==ZodParsedType.date){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:oo.parsedType}),INVALID$3}if(isNaN(ue.data.getTime())){const oo=this._getOrReturnCtx(ue);return addIssueToContext(oo,{code:ZodIssueCode.invalid_date}),INVALID$3}const no=new ParseStatus;let ro;for(const oo of this._def.checks)oo.kind==="min"?ue.data.getTime()<oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_small,message:oo.message,inclusive:!0,exact:!1,minimum:oo.value,type:"date"}),no.dirty()):oo.kind==="max"?ue.data.getTime()>oo.value&&(ro=this._getOrReturnCtx(ue,ro),addIssueToContext(ro,{code:ZodIssueCode.too_big,message:oo.message,inclusive:!0,exact:!1,maximum:oo.value,type:"date"}),no.dirty()):util$g.assertNever(oo);return{status:no.value,value:new Date(ue.data.getTime())}}_addCheck(ue){return new ZodDate({...this._def,checks:[...this._def.checks,ue]})}min(ue,eo){return this._addCheck({kind:"min",value:ue.getTime(),message:errorUtil.toString(eo)})}max(ue,eo){return this._addCheck({kind:"max",value:ue.getTime(),message:errorUtil.toString(eo)})}get minDate(){let ue=null;for(const eo of this._def.checks)eo.kind==="min"&&(ue===null||eo.value>ue)&&(ue=eo.value);return ue!=null?new Date(ue):null}get maxDate(){let ue=null;for(const eo of this._def.checks)eo.kind==="max"&&(ue===null||eo.value<ue)&&(ue=eo.value);return ue!=null?new Date(ue):null}}ZodDate.create=to=>new ZodDate({checks:[],coerce:(to==null?void 0:to.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(to)});class ZodSymbol extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.symbol){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodSymbol.create=to=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(to)});class ZodUndefined extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.undefined){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodUndefined.create=to=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(to)});class ZodNull extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.null){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodNull.create=to=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(to)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(ue){return OK(ue.data)}}ZodAny.create=to=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(to)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(ue){return OK(ue.data)}}ZodUnknown.create=to=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(to)});class ZodNever extends ZodType{_parse(ue){const eo=this._getOrReturnCtx(ue);return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:eo.parsedType}),INVALID$3}}ZodNever.create=to=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(to)});class ZodVoid extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.undefined){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:no.parsedType}),INVALID$3}return OK(ue.data)}}ZodVoid.create=to=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(to)});class ZodArray extends ZodType{_parse(ue){const{ctx:eo,status:no}=this._processInputParams(ue),ro=this._def;if(eo.parsedType!==ZodParsedType.array)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:eo.parsedType}),INVALID$3;if(ro.exactLength!==null){const io=eo.data.length>ro.exactLength.value,ao=eo.data.length<ro.exactLength.value;(io||ao)&&(addIssueToContext(eo,{code:io?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:ao?ro.exactLength.value:void 0,maximum:io?ro.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:ro.exactLength.message}),no.dirty())}if(ro.minLength!==null&&eo.data.length<ro.minLength.value&&(addIssueToContext(eo,{code:ZodIssueCode.too_small,minimum:ro.minLength.value,type:"array",inclusive:!0,exact:!1,message:ro.minLength.message}),no.dirty()),ro.maxLength!==null&&eo.data.length>ro.maxLength.value&&(addIssueToContext(eo,{code:ZodIssueCode.too_big,maximum:ro.maxLength.value,type:"array",inclusive:!0,exact:!1,message:ro.maxLength.message}),no.dirty()),eo.common.async)return Promise.all([...eo.data].map((io,ao)=>ro.type._parseAsync(new ParseInputLazyPath(eo,io,eo.path,ao)))).then(io=>ParseStatus.mergeArray(no,io));const oo=[...eo.data].map((io,ao)=>ro.type._parseSync(new ParseInputLazyPath(eo,io,eo.path,ao)));return ParseStatus.mergeArray(no,oo)}get element(){return this._def.type}min(ue,eo){return new ZodArray({...this._def,minLength:{value:ue,message:errorUtil.toString(eo)}})}max(ue,eo){return new ZodArray({...this._def,maxLength:{value:ue,message:errorUtil.toString(eo)}})}length(ue,eo){return new ZodArray({...this._def,exactLength:{value:ue,message:errorUtil.toString(eo)}})}nonempty(ue){return this.min(1,ue)}}ZodArray.create=(to,ue)=>new ZodArray({type:to,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(ue)});function deepPartialify(to){if(to instanceof ZodObject){const ue={};for(const eo in to.shape){const no=to.shape[eo];ue[eo]=ZodOptional.create(deepPartialify(no))}return new ZodObject({...to._def,shape:()=>ue})}else return to instanceof ZodArray?new ZodArray({...to._def,type:deepPartialify(to.element)}):to instanceof ZodOptional?ZodOptional.create(deepPartialify(to.unwrap())):to instanceof ZodNullable?ZodNullable.create(deepPartialify(to.unwrap())):to instanceof ZodTuple?ZodTuple.create(to.items.map(ue=>deepPartialify(ue))):to}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 ue=this._def.shape(),eo=util$g.objectKeys(ue);return this._cached={shape:ue,keys:eo}}_parse(ue){if(this._getType(ue)!==ZodParsedType.object){const lo=this._getOrReturnCtx(ue);return addIssueToContext(lo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:lo.parsedType}),INVALID$3}const{status:no,ctx:ro}=this._processInputParams(ue),{shape:oo,keys:io}=this._getCached(),ao=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const lo in ro.data)io.includes(lo)||ao.push(lo);const so=[];for(const lo of io){const co=oo[lo],uo=ro.data[lo];so.push({key:{status:"valid",value:lo},value:co._parse(new ParseInputLazyPath(ro,uo,ro.path,lo)),alwaysSet:lo in ro.data})}if(this._def.catchall instanceof ZodNever){const lo=this._def.unknownKeys;if(lo==="passthrough")for(const co of ao)so.push({key:{status:"valid",value:co},value:{status:"valid",value:ro.data[co]}});else if(lo==="strict")ao.length>0&&(addIssueToContext(ro,{code:ZodIssueCode.unrecognized_keys,keys:ao}),no.dirty());else if(lo!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const lo=this._def.catchall;for(const co of ao){const uo=ro.data[co];so.push({key:{status:"valid",value:co},value:lo._parse(new ParseInputLazyPath(ro,uo,ro.path,co)),alwaysSet:co in ro.data})}}return ro.common.async?Promise.resolve().then(async()=>{const lo=[];for(const co of so){const uo=await co.key,fo=await co.value;lo.push({key:uo,value:fo,alwaysSet:co.alwaysSet})}return lo}).then(lo=>ParseStatus.mergeObjectSync(no,lo)):ParseStatus.mergeObjectSync(no,so)}get shape(){return this._def.shape()}strict(ue){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...ue!==void 0?{errorMap:(eo,no)=>{var ro,oo,io,ao;const so=(io=(oo=(ro=this._def).errorMap)===null||oo===void 0?void 0:oo.call(ro,eo,no).message)!==null&&io!==void 0?io:no.defaultError;return eo.code==="unrecognized_keys"?{message:(ao=errorUtil.errToObj(ue).message)!==null&&ao!==void 0?ao:so}:{message:so}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(ue){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...ue})})}merge(ue){return new ZodObject({unknownKeys:ue._def.unknownKeys,catchall:ue._def.catchall,shape:()=>({...this._def.shape(),...ue._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(ue,eo){return this.augment({[ue]:eo})}catchall(ue){return new ZodObject({...this._def,catchall:ue})}pick(ue){const eo={};return util$g.objectKeys(ue).forEach(no=>{ue[no]&&this.shape[no]&&(eo[no]=this.shape[no])}),new ZodObject({...this._def,shape:()=>eo})}omit(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{ue[no]||(eo[no]=this.shape[no])}),new ZodObject({...this._def,shape:()=>eo})}deepPartial(){return deepPartialify(this)}partial(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{const ro=this.shape[no];ue&&!ue[no]?eo[no]=ro:eo[no]=ro.optional()}),new ZodObject({...this._def,shape:()=>eo})}required(ue){const eo={};return util$g.objectKeys(this.shape).forEach(no=>{if(ue&&!ue[no])eo[no]=this.shape[no];else{let oo=this.shape[no];for(;oo instanceof ZodOptional;)oo=oo._def.innerType;eo[no]=oo}}),new ZodObject({...this._def,shape:()=>eo})}keyof(){return createZodEnum(util$g.objectKeys(this.shape))}}ZodObject.create=(to,ue)=>new ZodObject({shape:()=>to,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});ZodObject.strictCreate=(to,ue)=>new ZodObject({shape:()=>to,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});ZodObject.lazycreate=(to,ue)=>new ZodObject({shape:to,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ue)});class ZodUnion extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no=this._def.options;function ro(oo){for(const ao of oo)if(ao.result.status==="valid")return ao.result;for(const ao of oo)if(ao.result.status==="dirty")return eo.common.issues.push(...ao.ctx.common.issues),ao.result;const io=oo.map(ao=>new ZodError(ao.ctx.common.issues));return addIssueToContext(eo,{code:ZodIssueCode.invalid_union,unionErrors:io}),INVALID$3}if(eo.common.async)return Promise.all(no.map(async oo=>{const io={...eo,common:{...eo.common,issues:[]},parent:null};return{result:await oo._parseAsync({data:eo.data,path:eo.path,parent:io}),ctx:io}})).then(ro);{let oo;const io=[];for(const so of no){const lo={...eo,common:{...eo.common,issues:[]},parent:null},co=so._parseSync({data:eo.data,path:eo.path,parent:lo});if(co.status==="valid")return co;co.status==="dirty"&&!oo&&(oo={result:co,ctx:lo}),lo.common.issues.length&&io.push(lo.common.issues)}if(oo)return eo.common.issues.push(...oo.ctx.common.issues),oo.result;const ao=io.map(so=>new ZodError(so));return addIssueToContext(eo,{code:ZodIssueCode.invalid_union,unionErrors:ao}),INVALID$3}}get options(){return this._def.options}}ZodUnion.create=(to,ue)=>new ZodUnion({options:to,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(ue)});const getDiscriminator=to=>to instanceof ZodLazy?getDiscriminator(to.schema):to instanceof ZodEffects?getDiscriminator(to.innerType()):to instanceof ZodLiteral?[to.value]:to instanceof ZodEnum?to.options:to instanceof ZodNativeEnum?util$g.objectValues(to.enum):to instanceof ZodDefault?getDiscriminator(to._def.innerType):to instanceof ZodUndefined?[void 0]:to instanceof ZodNull?[null]:to instanceof ZodOptional?[void 0,...getDiscriminator(to.unwrap())]:to instanceof ZodNullable?[null,...getDiscriminator(to.unwrap())]:to instanceof ZodBranded||to instanceof ZodReadonly?getDiscriminator(to.unwrap()):to instanceof ZodCatch?getDiscriminator(to._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.object)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:eo.parsedType}),INVALID$3;const no=this.discriminator,ro=eo.data[no],oo=this.optionsMap.get(ro);return oo?eo.common.async?oo._parseAsync({data:eo.data,path:eo.path,parent:eo}):oo._parseSync({data:eo.data,path:eo.path,parent:eo}):(addIssueToContext(eo,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[no]}),INVALID$3)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(ue,eo,no){const ro=new Map;for(const oo of eo){const io=getDiscriminator(oo.shape[ue]);if(!io.length)throw new Error(`A discriminator value for key \`${ue}\` could not be extracted from all schema options`);for(const ao of io){if(ro.has(ao))throw new Error(`Discriminator property ${String(ue)} has duplicate value ${String(ao)}`);ro.set(ao,oo)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:ue,options:eo,optionsMap:ro,...processCreateParams(no)})}}function mergeValues(to,ue){const eo=getParsedType(to),no=getParsedType(ue);if(to===ue)return{valid:!0,data:to};if(eo===ZodParsedType.object&&no===ZodParsedType.object){const ro=util$g.objectKeys(ue),oo=util$g.objectKeys(to).filter(ao=>ro.indexOf(ao)!==-1),io={...to,...ue};for(const ao of oo){const so=mergeValues(to[ao],ue[ao]);if(!so.valid)return{valid:!1};io[ao]=so.data}return{valid:!0,data:io}}else if(eo===ZodParsedType.array&&no===ZodParsedType.array){if(to.length!==ue.length)return{valid:!1};const ro=[];for(let oo=0;oo<to.length;oo++){const io=to[oo],ao=ue[oo],so=mergeValues(io,ao);if(!so.valid)return{valid:!1};ro.push(so.data)}return{valid:!0,data:ro}}else return eo===ZodParsedType.date&&no===ZodParsedType.date&&+to==+ue?{valid:!0,data:to}:{valid:!1}}class ZodIntersection extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue),ro=(oo,io)=>{if(isAborted(oo)||isAborted(io))return INVALID$3;const ao=mergeValues(oo.value,io.value);return ao.valid?((isDirty(oo)||isDirty(io))&&eo.dirty(),{status:eo.value,value:ao.data}):(addIssueToContext(no,{code:ZodIssueCode.invalid_intersection_types}),INVALID$3)};return no.common.async?Promise.all([this._def.left._parseAsync({data:no.data,path:no.path,parent:no}),this._def.right._parseAsync({data:no.data,path:no.path,parent:no})]).then(([oo,io])=>ro(oo,io)):ro(this._def.left._parseSync({data:no.data,path:no.path,parent:no}),this._def.right._parseSync({data:no.data,path:no.path,parent:no}))}}ZodIntersection.create=(to,ue,eo)=>new ZodIntersection({left:to,right:ue,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(eo)});class ZodTuple extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.array)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:no.parsedType}),INVALID$3;if(no.data.length<this._def.items.length)return addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID$3;!this._def.rest&&no.data.length>this._def.items.length&&(addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),eo.dirty());const oo=[...no.data].map((io,ao)=>{const so=this._def.items[ao]||this._def.rest;return so?so._parse(new ParseInputLazyPath(no,io,no.path,ao)):null}).filter(io=>!!io);return no.common.async?Promise.all(oo).then(io=>ParseStatus.mergeArray(eo,io)):ParseStatus.mergeArray(eo,oo)}get items(){return this._def.items}rest(ue){return new ZodTuple({...this._def,rest:ue})}}ZodTuple.create=(to,ue)=>{if(!Array.isArray(to))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:to,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(ue)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.object)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:no.parsedType}),INVALID$3;const ro=[],oo=this._def.keyType,io=this._def.valueType;for(const ao in no.data)ro.push({key:oo._parse(new ParseInputLazyPath(no,ao,no.path,ao)),value:io._parse(new ParseInputLazyPath(no,no.data[ao],no.path,ao)),alwaysSet:ao in no.data});return no.common.async?ParseStatus.mergeObjectAsync(eo,ro):ParseStatus.mergeObjectSync(eo,ro)}get element(){return this._def.valueType}static create(ue,eo,no){return eo instanceof ZodType?new ZodRecord({keyType:ue,valueType:eo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(no)}):new ZodRecord({keyType:ZodString.create(),valueType:ue,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(eo)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.map)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:no.parsedType}),INVALID$3;const ro=this._def.keyType,oo=this._def.valueType,io=[...no.data.entries()].map(([ao,so],lo)=>({key:ro._parse(new ParseInputLazyPath(no,ao,no.path,[lo,"key"])),value:oo._parse(new ParseInputLazyPath(no,so,no.path,[lo,"value"]))}));if(no.common.async){const ao=new Map;return Promise.resolve().then(async()=>{for(const so of io){const lo=await so.key,co=await so.value;if(lo.status==="aborted"||co.status==="aborted")return INVALID$3;(lo.status==="dirty"||co.status==="dirty")&&eo.dirty(),ao.set(lo.value,co.value)}return{status:eo.value,value:ao}})}else{const ao=new Map;for(const so of io){const lo=so.key,co=so.value;if(lo.status==="aborted"||co.status==="aborted")return INVALID$3;(lo.status==="dirty"||co.status==="dirty")&&eo.dirty(),ao.set(lo.value,co.value)}return{status:eo.value,value:ao}}}}ZodMap.create=(to,ue,eo)=>new ZodMap({valueType:ue,keyType:to,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(eo)});class ZodSet extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.parsedType!==ZodParsedType.set)return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:no.parsedType}),INVALID$3;const ro=this._def;ro.minSize!==null&&no.data.size<ro.minSize.value&&(addIssueToContext(no,{code:ZodIssueCode.too_small,minimum:ro.minSize.value,type:"set",inclusive:!0,exact:!1,message:ro.minSize.message}),eo.dirty()),ro.maxSize!==null&&no.data.size>ro.maxSize.value&&(addIssueToContext(no,{code:ZodIssueCode.too_big,maximum:ro.maxSize.value,type:"set",inclusive:!0,exact:!1,message:ro.maxSize.message}),eo.dirty());const oo=this._def.valueType;function io(so){const lo=new Set;for(const co of so){if(co.status==="aborted")return INVALID$3;co.status==="dirty"&&eo.dirty(),lo.add(co.value)}return{status:eo.value,value:lo}}const ao=[...no.data.values()].map((so,lo)=>oo._parse(new ParseInputLazyPath(no,so,no.path,lo)));return no.common.async?Promise.all(ao).then(so=>io(so)):io(ao)}min(ue,eo){return new ZodSet({...this._def,minSize:{value:ue,message:errorUtil.toString(eo)}})}max(ue,eo){return new ZodSet({...this._def,maxSize:{value:ue,message:errorUtil.toString(eo)}})}size(ue,eo){return this.min(ue,eo).max(ue,eo)}nonempty(ue){return this.min(1,ue)}}ZodSet.create=(to,ue)=>new ZodSet({valueType:to,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(ue)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.function)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:eo.parsedType}),INVALID$3;function no(ao,so){return makeIssue({data:ao,path:eo.path,errorMaps:[eo.common.contextualErrorMap,eo.schemaErrorMap,getErrorMap(),errorMap].filter(lo=>!!lo),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:so}})}function ro(ao,so){return makeIssue({data:ao,path:eo.path,errorMaps:[eo.common.contextualErrorMap,eo.schemaErrorMap,getErrorMap(),errorMap].filter(lo=>!!lo),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:so}})}const oo={errorMap:eo.common.contextualErrorMap},io=eo.data;if(this._def.returns instanceof ZodPromise){const ao=this;return OK(async function(...so){const lo=new ZodError([]),co=await ao._def.args.parseAsync(so,oo).catch(po=>{throw lo.addIssue(no(so,po)),lo}),uo=await Reflect.apply(io,this,co);return await ao._def.returns._def.type.parseAsync(uo,oo).catch(po=>{throw lo.addIssue(ro(uo,po)),lo})})}else{const ao=this;return OK(function(...so){const lo=ao._def.args.safeParse(so,oo);if(!lo.success)throw new ZodError([no(so,lo.error)]);const co=Reflect.apply(io,this,lo.data),uo=ao._def.returns.safeParse(co,oo);if(!uo.success)throw new ZodError([ro(co,uo.error)]);return uo.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...ue){return new ZodFunction({...this._def,args:ZodTuple.create(ue).rest(ZodUnknown.create())})}returns(ue){return new ZodFunction({...this._def,returns:ue})}implement(ue){return this.parse(ue)}strictImplement(ue){return this.parse(ue)}static create(ue,eo,no){return new ZodFunction({args:ue||ZodTuple.create([]).rest(ZodUnknown.create()),returns:eo||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(no)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(ue){const{ctx:eo}=this._processInputParams(ue);return this._def.getter()._parse({data:eo.data,path:eo.path,parent:eo})}}ZodLazy.create=(to,ue)=>new ZodLazy({getter:to,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(ue)});class ZodLiteral extends ZodType{_parse(ue){if(ue.data!==this._def.value){const eo=this._getOrReturnCtx(ue);return addIssueToContext(eo,{received:eo.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID$3}return{status:"valid",value:ue.data}}get value(){return this._def.value}}ZodLiteral.create=(to,ue)=>new ZodLiteral({value:to,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(ue)});function createZodEnum(to,ue){return new ZodEnum({values:to,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(ue)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(ue){if(typeof ue.data!="string"){const eo=this._getOrReturnCtx(ue),no=this._def.values;return addIssueToContext(eo,{expected:util$g.joinValues(no),received:eo.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(ue.data)){const eo=this._getOrReturnCtx(ue),no=this._def.values;return addIssueToContext(eo,{received:eo.data,code:ZodIssueCode.invalid_enum_value,options:no}),INVALID$3}return OK(ue.data)}get options(){return this._def.values}get enum(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}get Values(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}get Enum(){const ue={};for(const eo of this._def.values)ue[eo]=eo;return ue}extract(ue,eo=this._def){return ZodEnum.create(ue,{...this._def,...eo})}exclude(ue,eo=this._def){return ZodEnum.create(this.options.filter(no=>!ue.includes(no)),{...this._def,...eo})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(ue){const eo=util$g.getValidEnumValues(this._def.values),no=this._getOrReturnCtx(ue);if(no.parsedType!==ZodParsedType.string&&no.parsedType!==ZodParsedType.number){const ro=util$g.objectValues(eo);return addIssueToContext(no,{expected:util$g.joinValues(ro),received:no.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util$g.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(ue.data)){const ro=util$g.objectValues(eo);return addIssueToContext(no,{received:no.data,code:ZodIssueCode.invalid_enum_value,options:ro}),INVALID$3}return OK(ue.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(to,ue)=>new ZodNativeEnum({values:to,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(ue)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(ue){const{ctx:eo}=this._processInputParams(ue);if(eo.parsedType!==ZodParsedType.promise&&eo.common.async===!1)return addIssueToContext(eo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:eo.parsedType}),INVALID$3;const no=eo.parsedType===ZodParsedType.promise?eo.data:Promise.resolve(eo.data);return OK(no.then(ro=>this._def.type.parseAsync(ro,{path:eo.path,errorMap:eo.common.contextualErrorMap})))}}ZodPromise.create=(to,ue)=>new ZodPromise({type:to,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(ue)});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(ue){const{status:eo,ctx:no}=this._processInputParams(ue),ro=this._def.effect||null,oo={addIssue:io=>{addIssueToContext(no,io),io.fatal?eo.abort():eo.dirty()},get path(){return no.path}};if(oo.addIssue=oo.addIssue.bind(oo),ro.type==="preprocess"){const io=ro.transform(no.data,oo);if(no.common.async)return Promise.resolve(io).then(async ao=>{if(eo.value==="aborted")return INVALID$3;const so=await this._def.schema._parseAsync({data:ao,path:no.path,parent:no});return so.status==="aborted"?INVALID$3:so.status==="dirty"||eo.value==="dirty"?DIRTY(so.value):so});{if(eo.value==="aborted")return INVALID$3;const ao=this._def.schema._parseSync({data:io,path:no.path,parent:no});return ao.status==="aborted"?INVALID$3:ao.status==="dirty"||eo.value==="dirty"?DIRTY(ao.value):ao}}if(ro.type==="refinement"){const io=ao=>{const so=ro.refinement(ao,oo);if(no.common.async)return Promise.resolve(so);if(so instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ao};if(no.common.async===!1){const ao=this._def.schema._parseSync({data:no.data,path:no.path,parent:no});return ao.status==="aborted"?INVALID$3:(ao.status==="dirty"&&eo.dirty(),io(ao.value),{status:eo.value,value:ao.value})}else return this._def.schema._parseAsync({data:no.data,path:no.path,parent:no}).then(ao=>ao.status==="aborted"?INVALID$3:(ao.status==="dirty"&&eo.dirty(),io(ao.value).then(()=>({status:eo.value,value:ao.value}))))}if(ro.type==="transform")if(no.common.async===!1){const io=this._def.schema._parseSync({data:no.data,path:no.path,parent:no});if(!isValid$2(io))return io;const ao=ro.transform(io.value,oo);if(ao instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:eo.value,value:ao}}else return this._def.schema._parseAsync({data:no.data,path:no.path,parent:no}).then(io=>isValid$2(io)?Promise.resolve(ro.transform(io.value,oo)).then(ao=>({status:eo.value,value:ao})):io);util$g.assertNever(ro)}}ZodEffects.create=(to,ue,eo)=>new ZodEffects({schema:to,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:ue,...processCreateParams(eo)});ZodEffects.createWithPreprocess=(to,ue,eo)=>new ZodEffects({schema:ue,effect:{type:"preprocess",transform:to},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(eo)});class ZodOptional extends ZodType{_parse(ue){return this._getType(ue)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(ue)}unwrap(){return this._def.innerType}}ZodOptional.create=(to,ue)=>new ZodOptional({innerType:to,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(ue)});class ZodNullable extends ZodType{_parse(ue){return this._getType(ue)===ZodParsedType.null?OK(null):this._def.innerType._parse(ue)}unwrap(){return this._def.innerType}}ZodNullable.create=(to,ue)=>new ZodNullable({innerType:to,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(ue)});class ZodDefault extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue);let no=eo.data;return eo.parsedType===ZodParsedType.undefined&&(no=this._def.defaultValue()),this._def.innerType._parse({data:no,path:eo.path,parent:eo})}removeDefault(){return this._def.innerType}}ZodDefault.create=(to,ue)=>new ZodDefault({innerType:to,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof ue.default=="function"?ue.default:()=>ue.default,...processCreateParams(ue)});class ZodCatch extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no={...eo,common:{...eo.common,issues:[]}},ro=this._def.innerType._parse({data:no.data,path:no.path,parent:{...no}});return isAsync(ro)?ro.then(oo=>({status:"valid",value:oo.status==="valid"?oo.value:this._def.catchValue({get error(){return new ZodError(no.common.issues)},input:no.data})})):{status:"valid",value:ro.status==="valid"?ro.value:this._def.catchValue({get error(){return new ZodError(no.common.issues)},input:no.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(to,ue)=>new ZodCatch({innerType:to,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof ue.catch=="function"?ue.catch:()=>ue.catch,...processCreateParams(ue)});class ZodNaN extends ZodType{_parse(ue){if(this._getType(ue)!==ZodParsedType.nan){const no=this._getOrReturnCtx(ue);return addIssueToContext(no,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:no.parsedType}),INVALID$3}return{status:"valid",value:ue.data}}}ZodNaN.create=to=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(to)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(ue){const{ctx:eo}=this._processInputParams(ue),no=eo.data;return this._def.type._parse({data:no,path:eo.path,parent:eo})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(ue){const{status:eo,ctx:no}=this._processInputParams(ue);if(no.common.async)return(async()=>{const oo=await this._def.in._parseAsync({data:no.data,path:no.path,parent:no});return oo.status==="aborted"?INVALID$3:oo.status==="dirty"?(eo.dirty(),DIRTY(oo.value)):this._def.out._parseAsync({data:oo.value,path:no.path,parent:no})})();{const ro=this._def.in._parseSync({data:no.data,path:no.path,parent:no});return ro.status==="aborted"?INVALID$3:ro.status==="dirty"?(eo.dirty(),{status:"dirty",value:ro.value}):this._def.out._parseSync({data:ro.value,path:no.path,parent:no})}}static create(ue,eo){return new ZodPipeline({in:ue,out:eo,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(ue){const eo=this._def.innerType._parse(ue),no=ro=>(isValid$2(ro)&&(ro.value=Object.freeze(ro.value)),ro);return isAsync(eo)?eo.then(ro=>no(ro)):no(eo)}unwrap(){return this._def.innerType}}ZodReadonly.create=(to,ue)=>new ZodReadonly({innerType:to,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(ue)});function custom(to,ue={},eo){return to?ZodAny.create().superRefine((no,ro)=>{var oo,io;if(!to(no)){const ao=typeof ue=="function"?ue(no):typeof ue=="string"?{message:ue}:ue,so=(io=(oo=ao.fatal)!==null&&oo!==void 0?oo:eo)!==null&&io!==void 0?io:!0,lo=typeof ao=="string"?{message:ao}:ao;ro.addIssue({code:"custom",...lo,fatal:so})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(to){to.ZodString="ZodString",to.ZodNumber="ZodNumber",to.ZodNaN="ZodNaN",to.ZodBigInt="ZodBigInt",to.ZodBoolean="ZodBoolean",to.ZodDate="ZodDate",to.ZodSymbol="ZodSymbol",to.ZodUndefined="ZodUndefined",to.ZodNull="ZodNull",to.ZodAny="ZodAny",to.ZodUnknown="ZodUnknown",to.ZodNever="ZodNever",to.ZodVoid="ZodVoid",to.ZodArray="ZodArray",to.ZodObject="ZodObject",to.ZodUnion="ZodUnion",to.ZodDiscriminatedUnion="ZodDiscriminatedUnion",to.ZodIntersection="ZodIntersection",to.ZodTuple="ZodTuple",to.ZodRecord="ZodRecord",to.ZodMap="ZodMap",to.ZodSet="ZodSet",to.ZodFunction="ZodFunction",to.ZodLazy="ZodLazy",to.ZodLiteral="ZodLiteral",to.ZodEnum="ZodEnum",to.ZodEffects="ZodEffects",to.ZodNativeEnum="ZodNativeEnum",to.ZodOptional="ZodOptional",to.ZodNullable="ZodNullable",to.ZodDefault="ZodDefault",to.ZodCatch="ZodCatch",to.ZodPromise="ZodPromise",to.ZodBranded="ZodBranded",to.ZodPipeline="ZodPipeline",to.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(to,ue={message:`Input not instance of ${to.name}`})=>custom(eo=>eo instanceof to,ue),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$1={string:to=>ZodString.create({...to,coerce:!0}),number:to=>ZodNumber.create({...to,coerce:!0}),boolean:to=>ZodBoolean.create({...to,coerce:!0}),bigint:to=>ZodBigInt.create({...to,coerce:!0}),date:to=>ZodDate.create({...to,coerce:!0})},NEVER=INVALID$3;var z$1=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID:INVALID$3,DIRTY,OK,isAborted,isDirty,isValid:isValid$2,isAsync,get util(){return util$g},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:coerce$1,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$1.string().refine(to=>to!==InternalSearchFilterOperator.COMPLEX_ID_OPERATOR,{message:`Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`}),stringBasicFilter=z$1.record(fieldKey,z$1.string()),basicFilter=z$1.record(fieldKey,z$1.any()),arrayFilter$2=z$1.record(fieldKey,z$1.union([z$1.any().array(),z$1.string()])),logicFilter=z$1.lazy(()=>z$1.object({conditions:z$1.array(z$1.object(queryFilterValidation))})),stringOrNumber=z$1.union([z$1.string(),z$1.number()]),queryFilterValidation={[BasicOperator.STRING]:stringBasicFilter.optional(),[BasicOperator.FUZZY]:stringBasicFilter.optional(),[RangeOperator.RANGE]:z$1.record(fieldKey,z$1.union([z$1.object({high:stringOrNumber,low:stringOrNumber}),z$1.object({high:stringOrNumber}),z$1.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$1.object({query:z$1.object({allOr:z$1.boolean().optional(),onEmptyFilter:z$1.nativeEnum(EmptyFilterOption).optional(),...queryFilterValidation}).optional(),paginate:z$1.boolean().optional(),bookmark:z$1.union([z$1.string(),z$1.number()]).nullish(),limit:z$1.number().optional(),sort:z$1.string().nullish(),sortOrder:z$1.nativeEnum(SortOrder).optional(),sortType:z$1.nativeEnum(SortType).nullish(),version:z$1.string().optional(),disableEscaping:z$1.boolean().optional(),countRows:z$1.boolean().optional()});var EventPublishType$1=(to=>(to.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED="environment_variable_upgrade_panel_opened",to))(EventPublishType$1||{}),MaintenanceType=(to=>(to.SQS_MISSING="sqs_missing",to))(MaintenanceType||{}),BindingMode=(to=>(to.Text="Text",to.JavaScript="JavaScript",to))(BindingMode||{}),SidePanel=(to=>(to.Bindings="FlashOn",to.Evaluation="Play",to.Snippets="Code",to))(SidePanel||{});const AIOperations={SUMMARISE_TEXT:{label:"Summarise Text",value:"SUMMARISE_TEXT"},CLEAN_DATA:{label:"Clean Data",value:"CLEAN_DATA"},TRANSLATE:{label:"Translate",value:"TRANSLATE"},CATEGORISE_TEXT:{label:"Categorise Text",value:"CATEGORISE_TEXT"},SENTIMENT_ANALYSIS:{label:"Sentiment Analysis",value:"SENTIMENT_ANALYSIS"},PROMPT:{label:"Prompt",value:"PROMPT"},SEARCH_WEB:{label:"Search Web",value:"SEARCH_WEB"}},OperationFieldTypes={MULTI_COLUMN:"columns",COLUMN:"column",BINDABLE_TEXT:"prompt"},OperationFields={[AIOperationEnum.SUMMARISE_TEXT]:{columns:OperationFieldTypeEnum.MULTI_COLUMN},[AIOperationEnum.CLEAN_DATA]:{column:OperationFieldTypeEnum.COLUMN},[AIOperationEnum.TRANSLATE]:{column:OperationFieldTypeEnum.COLUMN,language:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.CATEGORISE_TEXT]:{columns:OperationFieldTypeEnum.MULTI_COLUMN,categories:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.SENTIMENT_ANALYSIS]:{column:OperationFieldTypeEnum.COLUMN},[AIOperationEnum.PROMPT]:{prompt:OperationFieldTypeEnum.BINDABLE_TEXT},[AIOperationEnum.SEARCH_WEB]:{columns:OperationFieldTypeEnum.MULTI_COLUMN}};var Header$1=(to=>(to.API_KEY="x-budibase-api-key",to.LICENSE_KEY="x-budibase-license-key",to.API_VER="x-budibase-api-version",to.APP_ID="x-budibase-app-id",to.SESSION_ID="x-budibase-session-id",to.TYPE="x-budibase-type",to.PREVIEW_ROLE="x-budibase-role",to.TENANT_ID="x-budibase-tenant-id",to.VERIFICATION_CODE="x-budibase-verification-code",to.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",to.RESET_PASSWORD_CODE="x-budibase-reset-password-code",to.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",to.TOKEN="x-budibase-token",to.CSRF_TOKEN="x-csrf-token",to.CORRELATION_ID="x-budibase-correlation-id",to.AUTHORIZATION="authorization",to.MIGRATING_APP="x-budibase-migrating-app",to.COOKIE="cookie",to))(Header$1||{});const SWITCHABLE_TYPES={[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]},PROTECTED_INTERNAL_COLUMNS=["_id","_rev","type","createdAt","updatedAt","tableId"],PROTECTED_EXTERNAL_COLUMNS=["_id","_rev","tableId"],ThemeClassPrefix="spectrum--",DefaultBuilderTheme=Theme.DARKEST,DefaultAppTheme$1=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=(to=>(to.UserUpdate="UserUpdate",to.UserDisconnect="UserDisconnect",to.Heartbeat="Heartbeat",to))(SocketEvent||{}),GridSocketEvent=(to=>(to.RowChange="RowChange",to.DatasourceChange="DatasourceChange",to.SelectDatasource="SelectDatasource",to.SelectCell="SelectCell",to))(GridSocketEvent||{}),BuilderSocketEvent=(to=>(to.SelectApp="SelectApp",to.TableChange="TableChange",to.DatasourceChange="DatasourceChange",to.LockTransfer="LockTransfer",to.ScreenChange="ScreenChange",to.AppMetadataChange="AppMetadataChange",to.SelectResource="SelectResource",to.AppPublishChange="AppPublishChange",to.AutomationChange="AutomationChange",to.RoleChange="RoleChange",to))(BuilderSocketEvent||{});const SocketSessionTTL=60,ValidQueryNameRegex=/^[^()]*$/,ValidColumnNameRegex=/^[_a-zA-Z0-9\s]*$/g,ValidSnippetNameRegex=/^[a-z_][a-z0-9_]*$/i,REBOOT_CRON="@reboot";var BpmCorrelationKey=(to=>(to.ONBOARDING="budibase:onboarding:correlationkey",to.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",to))(BpmCorrelationKey||{});const DEFAULT_BB_DATASOURCE_ID$1="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(to){return to&&to.__esModule&&Object.prototype.hasOwnProperty.call(to,"default")?to.default:to}function getAugmentedNamespace(to){if(to.__esModule)return to;var ue=to.default;if(typeof ue=="function"){var eo=function no(){return this instanceof no?Reflect.construct(ue,arguments,this.constructor):ue.apply(this,arguments)};eo.prototype=ue.prototype}else eo={};return Object.defineProperty(eo,"__esModule",{value:!0}),Object.keys(to).forEach(function(no){var ro=Object.getOwnPropertyDescriptor(to,no);Object.defineProperty(eo,no,ro.get?ro:{enumerable:!0,get:function(){return to[no]}})}),eo}var dayjs_min$1={exports:{}};(function(to,ue){(function(eo,no){to.exports=no()})(commonjsGlobal$1,function(){var eo=1e3,no=6e4,ro=36e5,oo="millisecond",io="second",ao="minute",so="hour",lo="day",co="week",uo="month",fo="quarter",po="year",ho="date",_o="Invalid Date",go=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bo=/\[([^\]]+)]|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,vo={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(Po){var Ro=["th","st","nd","rd"],Do=Po%100;return"["+Po+(Ro[(Do-20)%10]||Ro[Do]||Ro[0])+"]"}},yo=function(Po,Ro,Do){var Uo=String(Po);return!Uo||Uo.length>=Ro?Po:""+Array(Ro+1-Uo.length).join(Do)+Po},wo={s:yo,z:function(Po){var Ro=-Po.utcOffset(),Do=Math.abs(Ro),Uo=Math.floor(Do/60),qo=Do%60;return(Ro<=0?"+":"-")+yo(Uo,2,"0")+":"+yo(qo,2,"0")},m:function Po(Ro,Do){if(Ro.date()<Do.date())return-Po(Do,Ro);var Uo=12*(Do.year()-Ro.year())+(Do.month()-Ro.month()),qo=Ro.clone().add(Uo,uo),xo=Do-qo<0,Zo=Ro.clone().add(Uo+(xo?-1:1),uo);return+(-(Uo+(Do-qo)/(xo?qo-Zo:Zo-qo))||0)},a:function(Po){return Po<0?Math.ceil(Po)||0:Math.floor(Po)},p:function(Po){return{M:uo,y:po,w:co,d:lo,D:ho,h:so,m:ao,s:io,ms:oo,Q:fo}[Po]||String(Po||"").toLowerCase().replace(/s$/,"")},u:function(Po){return Po===void 0}},ko="en",So={};So[ko]=vo;var Ao="$isDayjsObject",Io=function(Po){return Po instanceof Vo||!(!Po||!Po[Ao])},Eo=function Po(Ro,Do,Uo){var qo;if(!Ro)return ko;if(typeof Ro=="string"){var xo=Ro.toLowerCase();So[xo]&&(qo=xo),Do&&(So[xo]=Do,qo=xo);var Zo=Ro.split("-");if(!qo&&Zo.length>1)return Po(Zo[0])}else{var Xo=Ro.name;So[Xo]=Ro,qo=Xo}return!Uo&&qo&&(ko=qo),qo||!Uo&&ko},To=function(Po,Ro){if(Io(Po))return Po.clone();var Do=typeof Ro=="object"?Ro:{};return Do.date=Po,Do.args=arguments,new Vo(Do)},Mo=wo;Mo.l=Eo,Mo.i=Io,Mo.w=function(Po,Ro){return To(Po,{locale:Ro.$L,utc:Ro.$u,x:Ro.$x,$offset:Ro.$offset})};var Vo=function(){function Po(Do){this.$L=Eo(Do.locale,null,!0),this.parse(Do),this.$x=this.$x||Do.x||{},this[Ao]=!0}var Ro=Po.prototype;return Ro.parse=function(Do){this.$d=function(Uo){var qo=Uo.date,xo=Uo.utc;if(qo===null)return new Date(NaN);if(Mo.u(qo))return new Date;if(qo instanceof Date)return new Date(qo);if(typeof qo=="string"&&!/Z$/i.test(qo)){var Zo=qo.match(go);if(Zo){var Xo=Zo[2]-1||0,Yo=(Zo[7]||"0").substring(0,3);return xo?new Date(Date.UTC(Zo[1],Xo,Zo[3]||1,Zo[4]||0,Zo[5]||0,Zo[6]||0,Yo)):new Date(Zo[1],Xo,Zo[3]||1,Zo[4]||0,Zo[5]||0,Zo[6]||0,Yo)}}return new Date(qo)}(Do),this.init()},Ro.init=function(){var Do=this.$d;this.$y=Do.getFullYear(),this.$M=Do.getMonth(),this.$D=Do.getDate(),this.$W=Do.getDay(),this.$H=Do.getHours(),this.$m=Do.getMinutes(),this.$s=Do.getSeconds(),this.$ms=Do.getMilliseconds()},Ro.$utils=function(){return Mo},Ro.isValid=function(){return this.$d.toString()!==_o},Ro.isSame=function(Do,Uo){var qo=To(Do);return this.startOf(Uo)<=qo&&qo<=this.endOf(Uo)},Ro.isAfter=function(Do,Uo){return To(Do)<this.startOf(Uo)},Ro.isBefore=function(Do,Uo){return this.endOf(Uo)<To(Do)},Ro.$g=function(Do,Uo,qo){return Mo.u(Do)?this[Uo]:this.set(qo,Do)},Ro.unix=function(){return Math.floor(this.valueOf()/1e3)},Ro.valueOf=function(){return this.$d.getTime()},Ro.startOf=function(Do,Uo){var qo=this,xo=!!Mo.u(Uo)||Uo,Zo=Mo.p(Do),Xo=function(sa,Aa){var pa=Mo.w(qo.$u?Date.UTC(qo.$y,Aa,sa):new Date(qo.$y,Aa,sa),qo);return xo?pa:pa.endOf(lo)},Yo=function(sa,Aa){return Mo.w(qo.toDate()[sa].apply(qo.toDate("s"),(xo?[0,0,0,0]:[23,59,59,999]).slice(Aa)),qo)},Qo=this.$W,Ko=this.$M,ra=this.$D,ea="set"+(this.$u?"UTC":"");switch(Zo){case po:return xo?Xo(1,0):Xo(31,11);case uo:return xo?Xo(1,Ko):Xo(0,Ko+1);case co:var ia=this.$locale().weekStart||0,Jo=(Qo<ia?Qo+7:Qo)-ia;return Xo(xo?ra-Jo:ra+(6-Jo),Ko);case lo:case ho:return Yo(ea+"Hours",0);case so:return Yo(ea+"Minutes",1);case ao:return Yo(ea+"Seconds",2);case io:return Yo(ea+"Milliseconds",3);default:return this.clone()}},Ro.endOf=function(Do){return this.startOf(Do,!1)},Ro.$set=function(Do,Uo){var qo,xo=Mo.p(Do),Zo="set"+(this.$u?"UTC":""),Xo=(qo={},qo[lo]=Zo+"Date",qo[ho]=Zo+"Date",qo[uo]=Zo+"Month",qo[po]=Zo+"FullYear",qo[so]=Zo+"Hours",qo[ao]=Zo+"Minutes",qo[io]=Zo+"Seconds",qo[oo]=Zo+"Milliseconds",qo)[xo],Yo=xo===lo?this.$D+(Uo-this.$W):Uo;if(xo===uo||xo===po){var Qo=this.clone().set(ho,1);Qo.$d[Xo](Yo),Qo.init(),this.$d=Qo.set(ho,Math.min(this.$D,Qo.daysInMonth())).$d}else Xo&&this.$d[Xo](Yo);return this.init(),this},Ro.set=function(Do,Uo){return this.clone().$set(Do,Uo)},Ro.get=function(Do){return this[Mo.p(Do)]()},Ro.add=function(Do,Uo){var qo,xo=this;Do=Number(Do);var Zo=Mo.p(Uo),Xo=function(Ko){var ra=To(xo);return Mo.w(ra.date(ra.date()+Math.round(Ko*Do)),xo)};if(Zo===uo)return this.set(uo,this.$M+Do);if(Zo===po)return this.set(po,this.$y+Do);if(Zo===lo)return Xo(1);if(Zo===co)return Xo(7);var Yo=(qo={},qo[ao]=no,qo[so]=ro,qo[io]=eo,qo)[Zo]||1,Qo=this.$d.getTime()+Do*Yo;return Mo.w(Qo,this)},Ro.subtract=function(Do,Uo){return this.add(-1*Do,Uo)},Ro.format=function(Do){var Uo=this,qo=this.$locale();if(!this.isValid())return qo.invalidDate||_o;var xo=Do||"YYYY-MM-DDTHH:mm:ssZ",Zo=Mo.z(this),Xo=this.$H,Yo=this.$m,Qo=this.$M,Ko=qo.weekdays,ra=qo.months,ea=qo.meridiem,ia=function(Aa,pa,va,da){return Aa&&(Aa[pa]||Aa(Uo,xo))||va[pa].slice(0,da)},Jo=function(Aa){return Mo.s(Xo%12||12,Aa,"0")},sa=ea||function(Aa,pa,va){var da=Aa<12?"AM":"PM";return va?da.toLowerCase():da};return xo.replace(bo,function(Aa,pa){return pa||function(va){switch(va){case"YY":return String(Uo.$y).slice(-2);case"YYYY":return Mo.s(Uo.$y,4,"0");case"M":return Qo+1;case"MM":return Mo.s(Qo+1,2,"0");case"MMM":return ia(qo.monthsShort,Qo,ra,3);case"MMMM":return ia(ra,Qo);case"D":return Uo.$D;case"DD":return Mo.s(Uo.$D,2,"0");case"d":return String(Uo.$W);case"dd":return ia(qo.weekdaysMin,Uo.$W,Ko,2);case"ddd":return ia(qo.weekdaysShort,Uo.$W,Ko,3);case"dddd":return Ko[Uo.$W];case"H":return String(Xo);case"HH":return Mo.s(Xo,2,"0");case"h":return Jo(1);case"hh":return Jo(2);case"a":return sa(Xo,Yo,!0);case"A":return sa(Xo,Yo,!1);case"m":return String(Yo);case"mm":return Mo.s(Yo,2,"0");case"s":return String(Uo.$s);case"ss":return Mo.s(Uo.$s,2,"0");case"SSS":return Mo.s(Uo.$ms,3,"0");case"Z":return Zo}return null}(Aa)||Zo.replace(":","")})},Ro.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Ro.diff=function(Do,Uo,qo){var xo,Zo=this,Xo=Mo.p(Uo),Yo=To(Do),Qo=(Yo.utcOffset()-this.utcOffset())*no,Ko=this-Yo,ra=function(){return Mo.m(Zo,Yo)};switch(Xo){case po:xo=ra()/12;break;case uo:xo=ra();break;case fo:xo=ra()/3;break;case co:xo=(Ko-Qo)/6048e5;break;case lo:xo=(Ko-Qo)/864e5;break;case so:xo=Ko/ro;break;case ao:xo=Ko/no;break;case io:xo=Ko/eo;break;default:xo=Ko}return qo?xo:Mo.a(xo)},Ro.daysInMonth=function(){return this.endOf(uo).$D},Ro.$locale=function(){return So[this.$L]},Ro.locale=function(Do,Uo){if(!Do)return this.$L;var qo=this.clone(),xo=Eo(Do,Uo,!0);return xo&&(qo.$L=xo),qo},Ro.clone=function(){return Mo.w(this.$d,this)},Ro.toDate=function(){return new Date(this.valueOf())},Ro.toJSON=function(){return this.isValid()?this.toISOString():null},Ro.toISOString=function(){return this.$d.toISOString()},Ro.toString=function(){return this.$d.toUTCString()},Po}(),Fo=Vo.prototype;return To.prototype=Fo,[["$ms",oo],["$s",io],["$m",ao],["$H",so],["$W",lo],["$M",uo],["$y",po],["$D",ho]].forEach(function(Po){Fo[Po[1]]=function(Ro){return this.$g(Ro,Po[0],Po[1])}}),To.extend=function(Po,Ro){return Po.$i||(Po(Ro,Vo,To),Po.$i=!0),To},To.locale=Eo,To.isDayjs=Io,To.unix=function(Po){return To(1e3*Po)},To.en=So[ko],To.Ls=So,To.p={},To})})(dayjs_min$1);var dayjs_minExports=dayjs_min$1.exports;const dayjs=getDefaultExportFromCjs$1(dayjs_minExports);var lodash$2={exports:{}};/**
|
|
7
7
|
* @license
|
|
8
8
|
* Lodash <https://lodash.com/>
|
|
9
9
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -472,7 +472,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
472
472
|
${ao[2]?`font-weight:${ao[2]};`:""}
|
|
473
473
|
${ao[3]?`text-align:${ao[3]};`:""}
|
|
474
474
|
${ao[4]?`color:${ao[4]};`:""}
|
|
475
|
-
`))&&attr(ue,"style",eo),(!ro||so&1&&no!==(no="spectrum-Body spectrum-Body--size"+ao[0]+" svelte-10a30y"))&&attr(ue,"class",no),(!ro||so&3)&&toggle_class(ue,"spectrum-Body--serif",ao[1])},i(ao){ro||(transition_in(io,ao),ro=!0)},o(ao){transition_out(io,ao),ro=!1},d(ao){ao&&detach(ue),io&&io.d(ao)}}}function instance$a4(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{size:oo="M"}=ue,{serif:io=!1}=ue,{weight:ao=null}=ue,{textAlign:so=null}=ue,{color:lo=null}=ue;return to.$$set=co=>{"size"in co&&eo(0,oo=co.size),"serif"in co&&eo(1,io=co.serif),"weight"in co&&eo(2,ao=co.weight),"textAlign"in co&&eo(3,so=co.textAlign),"color"in co&&eo(4,lo=co.color),"$$scope"in co&&eo(5,ro=co.$$scope)},[oo,io,ao,so,lo,ro,no]}class Body extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a4,create_fragment$a7,safe_not_equal,{size:0,serif:1,weight:2,textAlign:3,color:4})}}const Heading_svelte_svelte_type_style_lang="";function create_fragment$a6(to){let ue,eo,no,ro;const oo=to[5].default,io=create_slot(oo,to,to[4],null);return{c(){ue=element("h1"),io&&io.c(),attr(ue,"data-testid","typography-heading"),attr(ue,"style",eo=to[1]?`text-align:${to[1]}`:""),attr(ue,"class",no="spectrum-Heading spectrum-Heading--size"+to[0]+" spectrum-Heading--"+to[3]+" svelte-3sm8u5"),toggle_class(ue,"noPadding",to[2])},m(ao,so){insert$1(ao,ue,so),io&&io.m(ue,null),ro=!0},p(ao,[so]){io&&io.p&&(!ro||so&16)&&update_slot_base(io,oo,ao,ao[4],ro?get_slot_changes(oo,ao[4],so,null):get_all_dirty_from_scope(ao[4]),null),(!ro||so&2&&eo!==(eo=ao[1]?`text-align:${ao[1]}`:""))&&attr(ue,"style",eo),(!ro||so&9&&no!==(no="spectrum-Heading spectrum-Heading--size"+ao[0]+" spectrum-Heading--"+ao[3]+" svelte-3sm8u5"))&&attr(ue,"class",no),(!ro||so&13)&&toggle_class(ue,"noPadding",ao[2])},i(ao){ro||(transition_in(io,ao),ro=!0)},o(ao){transition_out(io,ao),ro=!1},d(ao){ao&&detach(ue),io&&io.d(ao)}}}function instance$a3(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{size:oo="M"}=ue,{textAlign:io=void 0}=ue,{noPadding:ao=!1}=ue,{weight:so="default"}=ue;return to.$$set=lo=>{"size"in lo&&eo(0,oo=lo.size),"textAlign"in lo&&eo(1,io=lo.textAlign),"noPadding"in lo&&eo(2,ao=lo.noPadding),"weight"in lo&&eo(3,so=lo.weight),"$$scope"in lo&&eo(4,ro=lo.$$scope)},[oo,io,ao,so,ro,no]}class Heading extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a3,create_fragment$a6,safe_not_equal,{size:0,textAlign:1,noPadding:2,weight:3})}}var HTTPMethod=(to=>(to.POST="POST",to.PATCH="PATCH",to.GET="GET",to.PUT="PUT",to.DELETE="DELETE",to))(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$1=(to=>(to.USERS="ta_users",to))(TableNames$1||{});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$2={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER",CREATOR:"CREATOR"},EventPublishType={ENV_VAR_UPGRADE_PANEL_OPENED:"environment_variable_upgrade_panel_opened"},ContextScopes$2={Local:"local",Global:"global"},TypeIconMap$1={[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(to=>`hsla(${(to+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$1={WRITABLE:"writable",READONLY:"readonly",HIDDEN:"hidden"},Constants$1=Object.freeze(Object.defineProperty({__proto__:null,ApiVersion,BannedSearchTypes,BudibaseRoleOptions,BudibaseRoleOptionsOld,BudibaseRoles,ContextScopes:ContextScopes$2,Cookies,DEFAULT_BB_DATASOURCE_ID:DEFAULT_BB_DATASOURCE_ID$1,EventPublishType,ExtendedBudibaseRoleOptions,Features:Feature,FieldPermissions:FieldPermissions$1,FilterOperator,FilterValueType,OnEmptyFilter,OperatorOptions,OptionColours,PlanType,Roles:Roles$2,SqlNumberTypeRangeMap,TableNames:TableNames$1,TypeIconMap:TypeIconMap$1},Symbol.toStringTag,{value:"Module"})),buildAnalyticsEndpoints=to=>({getAnalyticsStatus:async()=>await to.get({url:"/api/bbtel"}),analyticsPing:async ue=>await to.post({url:"/api/bbtel/ping",body:{...ue,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}})}),buildAIEndpoints=to=>({generateCronExpression:async ue=>await to.post({url:"/api/ai/cron",body:{prompt:ue}})}),buildAppEndpoints=to=>({fetchAppPackage:async ue=>await to.get({url:`/api/applications/${ue}/appPackage`}),saveAppMetadata:async(ue,eo)=>await to.put({url:`/api/applications/${ue}`,body:eo}),publishAppChanges:async ue=>await to.post({url:`/api/applications/${ue}/publish`}),revertAppChanges:async ue=>await to.post({url:`/api/dev/${ue}/revert`}),updateAppClientVersion:async ue=>await to.post({url:`/api/applications/${ue}/client/update`}),revertAppClientVersion:async ue=>await to.post({url:`/api/applications/${ue}/client/revert`}),getAppDeployments:async()=>await to.get({url:"/api/deployments"}),createApp:async ue=>await to.post({url:"/api/applications",body:ue,json:!1}),duplicateApp:async(ue,eo)=>await to.post({url:`/api/applications/${ue}/duplicate`,body:eo,json:!1}),updateAppFromExport:async(ue,eo)=>{const no=getDevAppID(ue);return await to.post({url:`/api/applications/${no}/import`,body:eo,json:!1})},importApps:async ue=>await to.post({url:"/api/cloud/import",body:ue,json:!1}),unpublishApp:async ue=>await to.post({url:`/api/applications/${ue}/unpublish`}),deleteApp:async ue=>await to.delete({url:`/api/applications/${ue}`}),releaseAppLock:async ue=>await to.delete({url:`/api/dev/${ue}/lock`}),fetchSystemDebugInfo:async()=>await to.get({url:"/api/debug/diagnostics"}),syncApp:async ue=>await to.post({url:`/api/applications/${ue}/sync`}),getApps:async()=>await to.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async ue=>await to.get({url:`/api/${ue}/components/definitions`}),addSampleData:async ue=>await to.post({url:`/api/applications/${ue}/sample`}),setRevertableVersion:async(ue,eo)=>await to.post({url:`/api/applications/${ue}/setRevertableVersion`,body:{revertableVersion:eo}})}),buildAttachmentEndpoints=to=>{const ue={getSignedDatasourceURL:async(eo,no,ro)=>await to.post({url:`/api/attachments/${eo}/url`,body:{bucket:no,key:ro}})};return{...ue,uploadAttachment:async(eo,no)=>await to.post({url:`/api/attachments/${eo}/upload`,body:no,json:!1}),uploadBuilderAttachment:async eo=>await to.post({url:"/api/attachments/process",body:eo,json:!1}),externalUpload:async(eo,no,ro,oo)=>{const{signedUrl:io,publicUrl:ao}=await ue.getSignedDatasourceURL(eo,no,ro);return io?(await to.put({url:io,body:oo,json:!1,external:!0,parseResponse:so=>so}),{publicUrl:ao}):{publicUrl:void 0}},downloadAttachment:async(eo,no,ro)=>await to.get({url:`/api/${eo}/rows/${no}/attachment/${ro}`,parseResponse:oo=>oo,suppressErrors:!0})}},buildAuthEndpoints=to=>({logIn:async(ue,eo,no)=>await to.post({url:`/api/global/auth/${ue}/login`,body:{username:eo,password:no}}),logOut:async()=>await to.post({url:"/api/global/auth/logout"}),setInitInfo:async ue=>await to.post({url:"/api/global/auth/init",body:ue}),getInitInfo:async()=>await to.get({url:"/api/global/auth/init"}),requestForgotPassword:async(ue,eo)=>await to.post({url:`/api/global/auth/${ue}/reset`,body:{email:eo}}),resetPassword:async(ue,eo,no)=>await to.post({url:`/api/global/auth/${ue}/reset/update`,body:{password:eo,resetCode:no}})}),buildAutomationEndpoints=to=>({triggerAutomation:async(ue,eo,no)=>await to.post({url:`/api/automations/${ue}/trigger`,body:{fields:eo,timeout:no}}),testAutomation:async(ue,eo)=>await to.post({url:`/api/automations/${ue}/test`,body:eo}),getAutomations:async()=>await to.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await to.get({url:"/api/automations/definitions/list"}),createAutomation:async ue=>await to.post({url:"/api/automations",body:ue}),updateAutomation:async ue=>await to.put({url:"/api/automations",body:ue}),deleteAutomation:async(ue,eo)=>await to.delete({url:`/api/automations/${ue}/${eo}`}),getAutomationLogs:async ue=>await to.post({url:"/api/automations/logs/search",body:ue}),clearAutomationLogErrors:async(ue,eo)=>await to.delete({url:"/api/automations/logs",body:{appId:eo,automationId:ue}})}),buildConfigEndpoints=to=>({saveConfig:async ue=>await to.post({url:"/api/global/configs",body:ue}),getConfig:async ue=>await to.get({url:`/api/global/configs/${ue}`}),deleteConfig:async(ue,eo)=>await to.delete({url:`/api/global/configs/${ue}/${eo}`}),getTenantConfig:async ue=>await to.get({url:`/api/global/configs/public?tenantId=${ue}`}),getOIDCConfigs:async ue=>await to.get({url:`/api/global/configs/public/oidc?tenantId=${ue}`}),getChecklist:async ue=>await to.get({url:`/api/global/configs/checklist?tenantId=${ue}`}),uploadLogo:async ue=>await to.post({url:"/api/global/configs/upload/settings/logoUrl",body:ue,json:!1}),uploadFavicon:async ue=>await to.post({url:"/api/global/configs/upload/settings/faviconUrl",body:ue,json:!1}),uploadOIDCLogo:async(ue,eo)=>await to.post({url:`/api/global/configs/upload/logos_oidc/${ue}`,body:eo,json:!1}),getOIDCLogos:async()=>await to.get({url:"/api/global/configs/logos_oidc"})}),buildDatasourceEndpoints=to=>({getDatasources:async()=>await to.get({url:"/api/datasources"}),buildDatasourceSchema:async(ue,eo)=>await to.post({url:`/api/datasources/${ue}/schema`,body:{tablesFilter:eo}}),createDatasource:async ue=>await to.post({url:"/api/datasources",body:ue}),updateDatasource:async ue=>await to.put({url:`/api/datasources/${ue._id}`,body:ue}),deleteDatasource:async(ue,eo)=>await to.delete({url:`/api/datasources/${ue}/${eo}`}),validateDatasource:async ue=>await to.post({url:"/api/datasources/verify",body:{datasource:ue}}),fetchInfoForDatasource:async ue=>await to.post({url:"/api/datasources/info",body:{datasource:ue}}),fetchExternalSchema:async ue=>await to.get({url:`/api/datasources/${ue}/schema/external`})}),buildFlagEndpoints=to=>({getFlags:async()=>await to.get({url:"/api/users/flags"}),updateFlag:async(ue,eo)=>await to.post({url:"/api/users/flags",body:{flag:ue,value:eo}}),toggleUiFeature:async ue=>await to.post({url:`/api/beta/${ue}`})}),buildLayoutEndpoints=to=>({saveLayout:async ue=>await to.post({url:"/api/layouts",body:ue}),deleteLayout:async(ue,eo)=>await to.delete({url:`/api/layouts/${ue}/${eo}`})}),buildOtherEndpoints=to=>({getEnvironment:async()=>await to.get({url:"/api/system/environment"}),getSystemStatus:async()=>await to.get({url:"/api/system/status"}),getIntegrations:async()=>await to.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await to.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await to.get({url:"/api/permission/builtin"})}),buildPermissionsEndpoints=to=>({getPermissionForResource:async ue=>await to.get({url:`/api/permission/${ue}`}),updatePermissionForResource:async(ue,eo,no)=>await to.post({url:`/api/permission/${eo}/${ue}/${no}`}),removePermissionFromResource:async(ue,eo,no)=>await to.delete({url:`/api/permission/${eo}/${ue}/${no}`}),getDependants:async ue=>await to.get({url:`/api/permission/${ue}/dependants`})}),buildQueryEndpoints=to=>({executeQuery:async(ue,{pagination:eo,parameters:no}={})=>await to.post({url:`/api/v2/queries/${ue}`,body:{parameters:no,pagination:eo}}),fetchQueryDefinition:async ue=>await to.get({url:`/api/queries/${ue}`,cache:!0}),getQueries:async()=>await to.get({url:"/api/queries"}),saveQuery:async ue=>await to.post({url:"/api/queries",body:ue}),deleteQuery:async(ue,eo)=>await to.delete({url:`/api/queries/${ue}/${eo}`}),importQueries:async ue=>await to.post({url:"/api/queries/import",body:ue}),previewQuery:async ue=>await to.post({url:"/api/queries/preview",body:ue})}),buildRelationshipEndpoints=to=>({fetchRelationshipData:async(ue,eo,no)=>{const ro=await to.get({url:`/api/${ue}/${eo}/enrich?field=${no}`});return no?ro[no]||[]:[ro]}}),buildRoleEndpoints=to=>({deleteRole:async(ue,eo)=>await to.delete({url:`/api/roles/${ue}/${eo}`}),saveRole:async ue=>await to.post({url:"/api/roles",body:ue}),getRoles:async()=>await to.get({url:"/api/roles"}),getRolesForApp:async ue=>await to.get({url:`/api/global/roles/${ue}`}),getAccessibleRoles:async()=>await to.get({url:"/api/roles/accessible"})}),buildRouteEndpoints=to=>({fetchClientAppRoutes:async()=>await to.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await to.get({url:"/api/routing"})}),buildRowEndpoints=to=>({fetchRow:async(ue,eo)=>await to.get({url:`/api/${ue}/rows/${eo}`}),saveRow:async(ue,eo=!1)=>{const no=ue._viewId||ue.tableId;return await to.post({url:`/api/${no}/rows`,body:ue,suppressErrors:eo})},patchRow:async(ue,eo=!1)=>{const no=ue._viewId||ue.tableId;return await to.patch({url:`/api/${no}/rows`,body:ue,suppressErrors:eo})},deleteRow:async(ue,eo)=>await to.delete({url:`/api/${ue}/rows`,body:{_id:eo}}),deleteRows:async(ue,eo)=>(eo.forEach(no=>{typeof no=="object"&&(no==null||delete no._viewId)}),await to.delete({url:`/api/${ue}/rows`,body:{rows:eo}})),exportRows:async(ue,eo,no)=>await to.post({url:`/api/${ue}/rows/exportRows?format=${eo}`,body:no,parseResponse:async ro=>await ro.text()})}),buildScreenEndpoints=to=>({saveScreen:async ue=>await to.post({url:"/api/screens",body:ue}),deleteScreen:async(ue,eo)=>await to.delete({url:`/api/screens/${ue}/${eo}`})}),buildTableEndpoints=to=>({fetchTableDefinition:async ue=>await to.get({url:`/api/tables/${ue}`,cache:!0}),fetchTableData:async ue=>await to.get({url:`/api/${ue}/rows`}),searchTable:async(ue,eo)=>await to.post({url:`/api/${ue}/search`,body:eo}),importTableData:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/import`,body:{rows:eo,identifierFields:no}}),csvToJson:async ue=>await to.post({url:"/api/convert/csvToJson",body:{csvString:ue}}),getTables:async()=>await to.get({url:"/api/tables"}),getTable:async ue=>await to.get({url:`/api/tables/${ue}`}),saveTable:async ue=>await to.post({url:"/api/tables",body:ue}),deleteTable:async(ue,eo)=>await to.delete({url:`/api/tables/${ue}/${eo}`}),validateNewTableImport:async(ue,eo)=>await to.post({url:"/api/tables/validateNewTableImport",body:{rows:ue,schema:eo}}),validateExistingTableImport:async(ue,eo)=>await to.post({url:"/api/tables/validateExistingTableImport",body:{rows:ue,tableId:eo}}),migrateColumn:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/migrate`,body:{oldColumn:eo,newColumn:no}})}),buildTemplateEndpoints=to=>({getEmailTemplateDefinitions:async()=>await to.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await to.get({url:"/api/global/template/email"}),saveEmailTemplate:async ue=>await to.post({url:"/api/global/template",body:ue}),getAppTemplates:async()=>await to.get({url:"/api/templates"})}),buildUserEndpoints=to=>({getUsers:async()=>await to.get({url:"/api/global/users"}),searchUsers:async ue=>await to.post({url:"/api/global/users/search",body:ue}),getUser:async ue=>await to.get({url:`/api/global/users/${ue}`}),updateOwnMetadata:async ue=>await to.post({url:"/api/users/metadata/self",body:ue}),createAdminUser:async ue=>await to.post({url:"/api/global/users/init",body:ue}),saveUser:async ue=>await to.post({url:"/api/global/users",body:ue}),createUsers:async(ue,eo)=>(await to.post({url:"/api/global/users/bulk",body:{create:{users:ue,groups:eo}}})).created,deleteUser:async ue=>await to.delete({url:`/api/global/users/${ue}`}),deleteUsers:async ue=>(await to.post({url:"/api/global/users/bulk",body:{delete:{users:ue}}})).deleted,onboardUsers:async ue=>await to.post({url:"/api/global/users/onboard",body:ue}),updateUserInvite:async(ue,eo)=>await to.post({url:`/api/global/users/invite/update/${ue}`,body:eo}),getUserInvite:async ue=>await to.get({url:`/api/global/users/invite/${ue}`}),getUserInvites:async()=>await to.get({url:"/api/global/users/invites"}),inviteUsers:async ue=>await to.post({url:"/api/global/users/multi/invite",body:ue}),removeUserInvites:async ue=>await to.post({url:"/api/global/users/multi/invite/delete",body:ue}),acceptInvite:async ue=>await to.post({url:"/api/global/users/invite/accept",body:ue}),getUserCountByApp:async ue=>(await to.get({url:`/api/global/users/count/${ue}`})).userCount,addAppBuilder:async(ue,eo)=>await to.post({url:`/api/global/users/${ue}/app/${eo}/builder`}),removeAppBuilder:async(ue,eo)=>await to.delete({url:`/api/global/users/${ue}/app/${eo}/builder`}),getAccountHolder:async()=>await to.get({url:"/api/global/users/accountholder"})}),buildSelfEndpoints=to=>({generateAPIKey:async()=>{const ue=await to.post({url:"/api/global/self/api_key"});return ue==null?void 0:ue.apiKey},fetchDeveloperInfo:async()=>to.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await to.get({url:"/api/self"}),fetchBuilderSelf:async()=>await to.get({url:"/api/global/self"}),updateSelf:async ue=>await to.post({url:"/api/global/self",body:ue})}),buildViewEndpoints=to=>({fetchViewData:async(ue,{field:eo,groupBy:no,calculation:ro})=>{const oo=new URLSearchParams;ro&&(eo&&oo.set("field",eo),oo.set("calculation",ro)),no&&oo.set("group",no);const io=eo?`/api/views/${encodeURIComponent(ue)}?${oo}`:`/api/views/${encodeURIComponent(ue)}`;return await to.get({url:io})},exportView:async(ue,eo)=>{const no=encodeURIComponent(ue);return await to.get({url:`/api/views/export?view=${no}&format=${eo}`,parseResponse:async ro=>await ro.text()})},saveView:async ue=>await to.post({url:"/api/views",body:ue}),deleteView:async ue=>await to.delete({url:`/api/views/${encodeURIComponent(ue)}`})}),buildViewV2Endpoints=to=>({fetchDefinition:async ue=>await to.get({url:`/api/v2/views/${encodeURIComponent(ue)}`,cache:!0}),create:async ue=>await to.post({url:"/api/v2/views",body:ue}),update:async ue=>await to.put({url:`/api/v2/views/${encodeURIComponent(ue.id)}`,body:ue}),fetch:async(ue,eo)=>await to.post({url:`/api/v2/views/${encodeURIComponent(ue)}/search`,body:eo}),delete:async ue=>await to.delete({url:`/api/v2/views/${encodeURIComponent(ue)}`})}),buildLicensingEndpoints=to=>({activateLicenseKey:async ue=>to.post({url:"/api/global/license/key",body:{licenseKey:ue}}),deleteLicenseKey:async()=>to.delete({url:"/api/global/license/key"}),getLicenseKey:async()=>{try{return await to.get({url:"/api/global/license/key"})}catch(ue){if(ue.status!==404)throw ue}},activateOfflineLicense:async ue=>to.post({url:"/api/global/license/offline",body:{offlineLicenseToken:ue}}),deleteOfflineLicense:async()=>to.delete({url:"/api/global/license/offline"}),getOfflineLicense:async()=>{try{return await to.get({url:"/api/global/license/offline"})}catch(ue){if(ue.status!==404)throw ue}},getOfflineLicenseIdentifier:async()=>await to.get({url:"/api/global/license/offline/identifier"}),refreshLicense:async()=>to.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>to.get({url:"/api/global/license/usage"})}),buildGroupsEndpoints=to=>{async function ue(eo,no,ro,oo){return await to.post({url:`/api/global/groups/${eo}/${no}`,body:{[ro]:oo}})}return{saveGroup:async eo=>await to.post({url:"/api/global/groups",body:eo}),getGroups:async()=>(await to.get({url:"/api/global/groups"})).data,getGroup:async eo=>await to.get({url:`/api/global/groups/${eo}`}),deleteGroup:async(eo,no)=>await to.delete({url:`/api/global/groups/${eo}/${no}`}),getGroupUsers:async({id:eo,bookmark:no,emailSearch:ro})=>{let oo=`/api/global/groups/${eo}/users?`;return no&&(oo+=`bookmark=${no}&`),ro&&(oo+=`emailSearch=${ro}`),await to.get({url:oo})},addUsersToGroup:async(eo,no)=>ue(eo,"users","add",no),removeUsersFromGroup:async(eo,no)=>ue(eo,"users","remove",no),addAppsToGroup:async(eo,no)=>ue(eo,"apps","add",no),removeAppsFromGroup:async(eo,no)=>ue(eo,"apps","remove",no),addGroupAppBuilder:async(eo,no)=>await to.post({url:`/api/global/groups/${eo}/app/${no}/builder`}),removeGroupAppBuilder:async(eo,no)=>await to.delete({url:`/api/global/groups/${eo}/app/${no}/builder`})}},buildPluginEndpoints=to=>({uploadPlugin:async ue=>await to.post({url:"/api/plugin/upload",body:ue,json:!1}),createPlugin:async ue=>await to.post({url:"/api/plugin",body:ue}),getPlugins:async()=>await to.get({url:"/api/plugin"}),deletePlugin:async ue=>await to.delete({url:`/api/plugin/${ue}`})}),buildBackupEndpoints=to=>({createManualBackup:async ue=>await to.post({url:`/api/apps/${ue}/backups`}),searchBackups:async(ue,eo)=>await to.post({url:`/api/apps/${ue}/backups/search`,body:eo}),deleteBackup:async(ue,eo)=>await to.delete({url:`/api/apps/${ue}/backups/${eo}`}),restoreBackup:async(ue,eo,no)=>await to.post({url:`/api/apps/${ue}/backups/${eo}/import`,body:{name:no}})}),buildEnvironmentVariableEndpoints=to=>({checkEnvironmentVariableStatus:async()=>await to.get({url:"/api/env/variables/status"}),fetchEnvironmentVariables:async()=>await to.get({url:"/api/env/variables",json:!1}),createEnvironmentVariable:async ue=>await to.post({url:"/api/env/variables",body:ue}),deleteEnvironmentVariable:async ue=>await to.delete({url:`/api/env/variables/${ue}`}),updateEnvironmentVariable:async(ue,eo)=>await to.patch({url:`/api/env/variables/${ue}`,body:eo})}),buildEventEndpoints=to=>({publishEvent:async ue=>await to.post({url:"/api/global/event/publish",body:{type:ue}})}),buildAuditLogEndpoints=to=>({searchAuditLogs:async ue=>await to.post({url:"/api/global/auditlogs/search",body:ue}),getEventDefinitions:async()=>await to.get({url:"/api/global/auditlogs/definitions"}),getDownloadUrl:ue=>`/api/global/auditlogs/download?query=${encodeURIComponent(JSON.stringify(ue))}`}),buildLogsEndpoints=to=>({getSystemLogs:async()=>await to.get({url:"/api/system/logs",json:!1,parseResponse:async ue=>ue})}),buildMigrationEndpoints=to=>({getMigrationStatus:async()=>await to.get({url:"/api/migrations/status"})}),buildRowActionEndpoints=to=>({fetch:async ue=>(await to.get({url:`/api/tables/${ue}/actions`})).actions,create:async(ue,eo)=>await to.post({url:`/api/tables/${ue}/actions`,body:{name:eo}}),delete:async(ue,eo)=>await to.delete({url:`/api/tables/${ue}/actions/${eo}`}),enableView:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/actions/${eo}/permissions/${no}`}),disableView:async(ue,eo,no)=>await to.delete({url:`/api/tables/${ue}/actions/${eo}/permissions/${no}`}),trigger:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/actions/${eo}/trigger`,body:{rowId:no}})}),APISessionID=uuid$2(),createAPIClient=(to={})=>{let ue={};const eo=async(lo,co,uo=!1)=>{let fo=lo.statusText,po=null;try{po=await lo.json(),po!=null&&po.message?fo=po.message:po!=null&&po.error&&(fo=JSON.stringify(po.error))}catch{}return{message:fo,json:po,status:lo.status,url:lo.url,method:co,handled:!0,suppressErrors:uo}},no=(lo,co,uo)=>({message:lo,json:null,status:400,url:co,method:uo,handled:!0,suppressErrors:!1}),ro=async lo=>{let{json:co,method:uo,external:fo,body:po,url:ho,parseResponse:_o,suppressErrors:go}=lo;co=co&&uo!==HTTPMethod.GET;let bo={Accept:"application/json"};bo[Header$1.SESSION_ID]=APISessionID,fo||(bo[Header$1.API_VER]=ApiVersion),co&&(bo["Content-Type"]="application/json"),to!=null&&to.attachHeaders&&to.attachHeaders(bo);let vo=po;if(co)try{vo=JSON.stringify(po)}catch{throw no("Invalid JSON body",ho,uo)}let yo;try{yo=await fetch(ho,{method:uo,headers:bo,body:vo,credentials:"same-origin"})}catch{throw delete ue[ho],no("Failed to send request",ho,uo)}if(yo.status>=200&&yo.status<400){oo(yo);try{return yo.status===204?void 0:_o?await _o(yo):await yo.json()}catch(wo){throw delete ue[ho],`Failed to parse response: ${wo}`}}else throw delete ue[ho],await eo(yo,uo,go)},oo=lo=>{if(!to.onMigrationDetected)return;const co=lo.headers.get(Header$1.MIGRATING_APP);co&&to.onMigrationDetected(co)},io=async lo=>{const co=lo.url;return ue[co]||(ue[co]=ro(lo),ue[co]=await ue[co]),await ue[co]},ao=lo=>async co=>{try{let uo={json:!0,external:!1,suppressErrors:!1,cache:!1,method:lo,...co},{url:fo,cache:po,external:ho}=uo;return ho||(uo.url=`/${fo}`.replace("//","/")),await(po&&(to==null?void 0:to.enableCaching)?io:ro)(uo)}catch(uo){throw to!=null&&to.onError&&to.onError(uo),uo}};let so={post:ao(HTTPMethod.POST),get:ao(HTTPMethod.GET),patch:ao(HTTPMethod.PATCH),delete:ao(HTTPMethod.DELETE),put:ao(HTTPMethod.PUT),invalidateCache:()=>{ue={}},getAppID:()=>{var co;let lo={};return(co=to==null?void 0:to.attachHeaders)==null||co.call(to,lo),lo==null?void 0:lo[Header$1.APP_ID]}};return{...so,...buildAIEndpoints(so),...buildAnalyticsEndpoints(so),...buildAppEndpoints(so),...buildAttachmentEndpoints(so),...buildAuthEndpoints(so),...buildAutomationEndpoints(so),...buildConfigEndpoints(so),...buildDatasourceEndpoints(so),...buildFlagEndpoints(so),...buildLayoutEndpoints(so),...buildOtherEndpoints(so),...buildPermissionsEndpoints(so),...buildQueryEndpoints(so),...buildRelationshipEndpoints(so),...buildRoleEndpoints(so),...buildRouteEndpoints(so),...buildRowEndpoints(so),...buildScreenEndpoints(so),...buildTableEndpoints(so),...buildTemplateEndpoints(so),...buildUserEndpoints(so),...buildViewEndpoints(so),...buildSelfEndpoints(so),...buildLicensingEndpoints(so),...buildGroupsEndpoints(so),...buildPluginEndpoints(so),...buildBackupEndpoints(so),...buildEnvironmentVariableEndpoints(so),...buildEventEndpoints(so),...buildAuditLogEndpoints(so),...buildLogsEndpoints(so),...buildMigrationEndpoints(so),viewV2:buildViewV2Endpoints(so),rowActions:buildRowActionEndpoints(so)}},getJSONArrayDatasourceSchema=(to,ue)=>{let eo=to,no=[];ue.prefixKeys&&(no=ue.prefixKeys.concat(["schema"])),no=no.concat(ue.label.split(".").slice(2));for(let ro=0;ro<no.length;ro++)eo=eo==null?void 0:eo[no[ro]],eo!=null&&eo.schema&&(eo=eo.schema);return convertJSONSchemaToTableSchema(eo,{squashObjects:!0,prefixKeys:no})},convertJSONSchemaToTableSchema=(to,ue)=>{if(!to)return null;ue={squashObjects:!1,prefixKeys:null,...ue},to.schema?to=to.schema:to={value:to};const eo=extractJSONSchemaKeys(to,ue.squashObjects);let no={};return eo.forEach(({key:ro,type:oo})=>{no[ro]={type:oo,name:ro,prefixKeys:ue.prefixKeys}}),no},extractJSONSchemaKeys=(to,ue=!1)=>{if(!to||!Object.keys(to).length)return[];let eo=[];return Object.keys(to).forEach(no=>{const ro=to[no].type;if(ro==="json"&&ue){const oo=extractJSONSchemaKeys(to[no].schema,ue);eo=eo.concat(oo.map(io=>({key:`${no}.${io.key}`,type:io.type})))}else eo.push({key:no,type:ro==="array"?"jsonarray":ro})}),eo},generateQueryArraySchemas=(to,ue)=>{var eo,no;for(let ro in to)((eo=to[ro])==null?void 0:eo.type)==="json"&&((no=to[ro])==null?void 0:no.subtype)==="array"&&hasSchema(ue[ro])&&(to[ro]={schema:{schema:Object.entries(ue[ro]||{}).reduce((oo,[io,ao])=>(oo[io]={name:io,type:ao.type,subtype:ao.subtype},oo),{}),type:"json"},type:"json",subtype:"array"});return to};function setCookie(to,ue,eo){getCookie(to)&&removeCookie(to);let no=`${to}=${ue}; Path=/;`;eo&&(no+=` Domain=${eo};`),window.document.cookie=no}function getCookie(to){const eo=`; ${document.cookie}`.split(`; ${to}=`);if(eo.length===2)return eo[1].split(";").shift()}function removeCookie(to){getCookie(to)&&(document.cookie=`${to}=; Max-Age=-99999999; Path=/;`)}const RolePriorities={[Roles$2.ADMIN]:5,[Roles$2.CREATOR]:4,[Roles$2.POWER]:3,[Roles$2.BASIC]:2,[Roles$2.PUBLIC]:1},getRolePriority=to=>RolePriorities[to]??0,sleep$2=to=>new Promise(ue=>setTimeout(ue,to)),sequential=to=>{let ue=[];return(...eo)=>new Promise((no,ro)=>{ue.push(async()=>{let oo,io;try{oo=await to(...eo)}catch(ao){io=ao}ue.shift(),ue.length&&ue[0](),io?ro(io):no(oo)}),ue.length===1&&ue[0]()})},debounce=(to,ue=1e3)=>{let eo;return async(...no)=>new Promise(ro=>{eo&&clearTimeout(eo),eo=setTimeout(async()=>{ro(await to(...no))},ue)})},domDebounce=to=>{let ue=!1,eo;return(...no)=>{eo=no,ue||(ue=!0,requestAnimationFrame(()=>{to(...eo),ue=!1}))}},buildFormBlockButtonConfig=to=>{const{_id:ue,actionType:eo,dataSource:no,notificationOverride:ro,actionUrl:oo,showDeleteButton:io,deleteButtonLabel:ao,showSaveButton:so,saveButtonLabel:lo}=to||{};if(!ue)return;const co=`${ue}-form`,uo=`${ue}-repeater`,fo=no==null?void 0:no.resourceId,po=io===!1?"":ao==null?void 0:ao.trim(),ho=so===!1?"":lo==null?void 0:lo.trim(),_o=[{"##eventHandlerType":"Validate Form",parameters:{componentId:co}},{"##eventHandlerType":"Save Row",parameters:{providerId:co,tableId:fo,notificationOverride:ro,confirm:null}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...eo!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:co}}],...oo?[{"##eventHandlerType":"Navigate To",parameters:{url:oo}}]:[]],go=[{"##eventHandlerType":"Delete Row",parameters:{confirm:!0,tableId:fo,rowId:`{{ ${makePropSafe(uo)}.${makePropSafe("_id")} }}`,revId:`{{ ${makePropSafe(uo)}.${makePropSafe("_rev")} }}`,notificationOverride:ro}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...oo?[{"##eventHandlerType":"Navigate To",parameters:{url:oo}}]:[]],bo=[];return["Update","Create"].includes(eo)&&so!==!1&&bo.push({text:ho||"Save",_id:uuid$2(),_component:"@budibase/standard-components/button",onClick:_o,type:"cta"}),eo==="Update"&&io!==!1&&bo.push({text:po||"Delete",_id:uuid$2(),_component:"@budibase/standard-components/button",onClick:go,quiet:!0,type:"warning"}),bo},buildMultiStepFormBlockDefaultProps=to=>{const{_id:ue,stepCount:eo,currentStep:no,actionType:ro,dataSource:oo}=to||{};if(!ue||!eo)return;const io=`Step {{ [${ue}-form].[__currentStep] }}`,ao=oo==null?void 0:oo.resourceId,so=`${ue}-form`;let lo=[];return no!==0&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Back",type:"secondary",size:"M",onClick:[{parameters:{type:"prev",componentId:so},"##eventHandlerType":"Change Form Step"}]}),no!==eo-1&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Next",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:so}},{parameters:{type:"next",componentId:so},"##eventHandlerType":"Change Form Step"}]}),ro!=="View"&&no===eo-1&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Save",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:so}},{"##eventHandlerType":"Save Row",parameters:{tableId:ao,providerId:so}},...ro!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:so}}]]}),{buttons:lo,title:io}};function parseFilter(to){if(!(to!=null&&to.groups))return to;const ue=lodashExports.cloneDeep(to);return ue.groups=ue.groups.map(eo=>(eo.filters=eo.filters.filter(no=>no.field&&no.operator),eo.filters.length?eo:null)).filter(eo=>eo),ue}const isBetterSample=(to,ue)=>{if(ue==null&&to!=null)return!0;if(ue!=null&&to==null)return!1;const eo=typeof ue,no=typeof to;return eo!==no?!1:no==="string"&&to.length>ue.length||no==="object"&&Object.keys(to).length>Object.keys(ue).length},generateGoldenSample=to=>{let ue={};return to==null||to.slice(0,100).forEach(eo=>{Object.keys(eo).forEach(no=>{isBetterSample(eo[no],ue[no])&&(ue[no]=eo[no])})}),ue};function getTableFields(to,ue){const eo=to.find(ro=>ro._id===ue.tableId);return!eo||!eo.sql?[]:getFields(to,Object.values(eo.schema),{allowLinks:!1}).map(ro=>({...ro,name:`${ue.name}.${ro.name}`}))}function getFields(to,ue,{allowLinks:eo}={allowLinks:!0}){let no=ue.filter(oo=>!BannedSearchTypes.includes(oo.type));if(eo){const oo=ue.filter(io=>io.type==="link");for(let io of oo)no=no.concat(getTableFields(to,io))}const ro=ue.filter(oo=>oo.type==="formula"&&oo.formulaType==="static");return no.concat(ro)}const getColumnIcon=to=>{if(to.schema.icon)return to.schema.icon;if(to.calculationType)return"Calculator";if(to.schema.autocolumn)return"MagicWand";if(isDeprecatedSingleUserColumn(to.schema))return"User";const{type:ue,subtype:eo}=to.schema;return(typeof TypeIconMap$1[ue]=="object"&&eo?TypeIconMap$1[ue][eo]:TypeIconMap$1[ue])||"Text"},memo=to=>{const ue=writable(to);let eo=JSON.stringify(to);const no=ro=>{const oo=JSON.stringify(ro);oo!==eo&&(ue.set(ro),eo=oo)};return{subscribe:ue.subscribe,set:no,update:ro=>{let oo=JSON.parse(eo);const io=ro(oo);no(io)}}},derivedMemo=(to,ue)=>{const eo=derived(to,ue),no=memo(get_store_value(eo));return eo.subscribe(no.set),no},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(to=>{PACKET_TYPES_REVERSE[PACKET_TYPES[to]]=to});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=to=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(to):to&&to.buffer instanceof ArrayBuffer,encodePacket=({type:to,data:ue},eo,no)=>withNativeBlob$1&&ue instanceof Blob?eo?no(ue):encodeBlobAsBase64(ue,no):withNativeArrayBuffer$2&&(ue instanceof ArrayBuffer||isView$1(ue))?eo?no(ue):encodeBlobAsBase64(new Blob([ue]),no):no(PACKET_TYPES[to]+(ue||"")),encodeBlobAsBase64=(to,ue)=>{const eo=new FileReader;return eo.onload=function(){const no=eo.result.split(",")[1];ue("b"+(no||""))},eo.readAsDataURL(to)};function toArray$2(to){return to instanceof Uint8Array?to:to instanceof ArrayBuffer?new Uint8Array(to):new Uint8Array(to.buffer,to.byteOffset,to.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(to,ue){if(withNativeBlob$1&&to.data instanceof Blob)return to.data.arrayBuffer().then(toArray$2).then(ue);if(withNativeArrayBuffer$2&&(to.data instanceof ArrayBuffer||isView$1(to.data)))return ue(toArray$2(to.data));encodePacket(to,!1,eo=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),ue(TEXT_ENCODER.encode(eo))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let to=0;to<chars.length;to++)lookup$1[chars.charCodeAt(to)]=to;const decode$3=to=>{let ue=to.length*.75,eo=to.length,no,ro=0,oo,io,ao,so;to[to.length-1]==="="&&(ue--,to[to.length-2]==="="&&ue--);const lo=new ArrayBuffer(ue),co=new Uint8Array(lo);for(no=0;no<eo;no+=4)oo=lookup$1[to.charCodeAt(no)],io=lookup$1[to.charCodeAt(no+1)],ao=lookup$1[to.charCodeAt(no+2)],so=lookup$1[to.charCodeAt(no+3)],co[ro++]=oo<<2|io>>4,co[ro++]=(io&15)<<4|ao>>2,co[ro++]=(ao&3)<<6|so&63;return lo},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(to,ue)=>{if(typeof to!="string")return{type:"message",data:mapBinary(to,ue)};const eo=to.charAt(0);return eo==="b"?{type:"message",data:decodeBase64Packet(to.substring(1),ue)}:PACKET_TYPES_REVERSE[eo]?to.length>1?{type:PACKET_TYPES_REVERSE[eo],data:to.substring(1)}:{type:PACKET_TYPES_REVERSE[eo]}:ERROR_PACKET},decodeBase64Packet=(to,ue)=>{if(withNativeArrayBuffer$1){const eo=decode$3(to);return mapBinary(eo,ue)}else return{base64:!0,data:to}},mapBinary=(to,ue)=>{switch(ue){case"blob":return to instanceof Blob?to:new Blob([to]);case"arraybuffer":default:return to instanceof ArrayBuffer?to:to.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(to,ue)=>{const eo=to.length,no=new Array(eo);let ro=0;to.forEach((oo,io)=>{encodePacket(oo,!1,ao=>{no[io]=ao,++ro===eo&&ue(no.join(SEPARATOR))})})},decodePayload=(to,ue)=>{const eo=to.split(SEPARATOR),no=[];for(let ro=0;ro<eo.length;ro++){const oo=decodePacket(eo[ro],ue);if(no.push(oo),oo.type==="error")break}return no};function createPacketEncoderStream(){return new TransformStream({transform(to,ue){encodePacketToBinary(to,eo=>{const no=eo.length;let ro;if(no<126)ro=new Uint8Array(1),new DataView(ro.buffer).setUint8(0,no);else if(no<65536){ro=new Uint8Array(3);const oo=new DataView(ro.buffer);oo.setUint8(0,126),oo.setUint16(1,no)}else{ro=new Uint8Array(9);const oo=new DataView(ro.buffer);oo.setUint8(0,127),oo.setBigUint64(1,BigInt(no))}to.data&&typeof to.data!="string"&&(ro[0]|=128),ue.enqueue(ro),ue.enqueue(eo)})}})}let TEXT_DECODER;function totalLength(to){return to.reduce((ue,eo)=>ue+eo.length,0)}function concatChunks(to,ue){if(to[0].length===ue)return to.shift();const eo=new Uint8Array(ue);let no=0;for(let ro=0;ro<ue;ro++)eo[ro]=to[0][no++],no===to[0].length&&(to.shift(),no=0);return to.length&&no<to[0].length&&(to[0]=to[0].slice(no)),eo}function createPacketDecoderStream(to,ue){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const eo=[];let no=0,ro=-1,oo=!1;return new TransformStream({transform(io,ao){for(eo.push(io);;){if(no===0){if(totalLength(eo)<1)break;const so=concatChunks(eo,1);oo=(so[0]&128)===128,ro=so[0]&127,ro<126?no=3:ro===126?no=1:no=2}else if(no===1){if(totalLength(eo)<2)break;const so=concatChunks(eo,2);ro=new DataView(so.buffer,so.byteOffset,so.length).getUint16(0),no=3}else if(no===2){if(totalLength(eo)<8)break;const so=concatChunks(eo,8),lo=new DataView(so.buffer,so.byteOffset,so.length),co=lo.getUint32(0);if(co>Math.pow(2,53-32)-1){ao.enqueue(ERROR_PACKET);break}ro=co*Math.pow(2,32)+lo.getUint32(4),no=3}else{if(totalLength(eo)<ro)break;const so=concatChunks(eo,ro);ao.enqueue(decodePacket(oo?so:TEXT_DECODER.decode(so),ue)),no=0}if(ro===0||ro>to){ao.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(to){if(to)return mixin(to)}function mixin(to){for(var ue in Emitter.prototype)to[ue]=Emitter.prototype[ue];return to}Emitter.prototype.on=Emitter.prototype.addEventListener=function(to,ue){return this._callbacks=this._callbacks||{},(this._callbacks["$"+to]=this._callbacks["$"+to]||[]).push(ue),this};Emitter.prototype.once=function(to,ue){function eo(){this.off(to,eo),ue.apply(this,arguments)}return eo.fn=ue,this.on(to,eo),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(to,ue){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var eo=this._callbacks["$"+to];if(!eo)return this;if(arguments.length==1)return delete this._callbacks["$"+to],this;for(var no,ro=0;ro<eo.length;ro++)if(no=eo[ro],no===ue||no.fn===ue){eo.splice(ro,1);break}return eo.length===0&&delete this._callbacks["$"+to],this};Emitter.prototype.emit=function(to){this._callbacks=this._callbacks||{};for(var ue=new Array(arguments.length-1),eo=this._callbacks["$"+to],no=1;no<arguments.length;no++)ue[no-1]=arguments[no];if(eo){eo=eo.slice(0);for(var no=0,ro=eo.length;no<ro;++no)eo[no].apply(this,ue)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(to){return this._callbacks=this._callbacks||{},this._callbacks["$"+to]||[]};Emitter.prototype.hasListeners=function(to){return!!this.listeners(to).length};const globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick$1(to,...ue){return ue.reduce((eo,no)=>(to.hasOwnProperty(no)&&(eo[no]=to[no]),eo),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(to,ue){ue.useNativeTimers?(to.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),to.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(to.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),to.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(to){return typeof to=="string"?utf8Length(to):Math.ceil((to.byteLength||to.size)*BASE64_OVERHEAD)}function utf8Length(to){let ue=0,eo=0;for(let no=0,ro=to.length;no<ro;no++)ue=to.charCodeAt(no),ue<128?eo+=1:ue<2048?eo+=2:ue<55296||ue>=57344?eo+=3:(no++,eo+=4);return eo}function encode$3(to){let ue="";for(let eo in to)to.hasOwnProperty(eo)&&(ue.length&&(ue+="&"),ue+=encodeURIComponent(eo)+"="+encodeURIComponent(to[eo]));return ue}function decode$2(to){let ue={},eo=to.split("&");for(let no=0,ro=eo.length;no<ro;no++){let oo=eo[no].split("=");ue[decodeURIComponent(oo[0])]=decodeURIComponent(oo[1])}return ue}class TransportError extends Error{constructor(ue,eo,no){super(ue),this.description=eo,this.context=no,this.type="TransportError"}}class Transport extends Emitter{constructor(ue){super(),this.writable=!1,installTimerFunctions(this,ue),this.opts=ue,this.query=ue.query,this.socket=ue.socket}onError(ue,eo,no){return super.emitReserved("error",new TransportError(ue,eo,no)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(ue){this.readyState==="open"&&this.write(ue)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(ue){const eo=decodePacket(ue,this.socket.binaryType);this.onPacket(eo)}onPacket(ue){super.emitReserved("packet",ue)}onClose(ue){this.readyState="closed",super.emitReserved("close",ue)}pause(ue){}createUri(ue,eo={}){return ue+"://"+this._hostname()+this._port()+this.opts.path+this._query(eo)}_hostname(){const ue=this.opts.hostname;return ue.indexOf(":")===-1?ue:"["+ue+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(ue){const eo=encode$3(ue);return eo.length?"?"+eo:""}}const alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={};let seed=0,i$2=0,prev;function encode$2(to){let ue="";do ue=alphabet[to%length]+ue,to=Math.floor(to/length);while(to>0);return ue}function yeast(){const to=encode$2(+new Date);return to!==prev?(seed=0,prev=to):to+"."+encode$2(seed++)}for(;i$2<length;i$2++)map[alphabet[i$2]]=i$2;let value$1=!1;try{value$1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(to){}const hasCORS=value$1;function XHR(to){const ue=to.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!ue||hasCORS))return new XMLHttpRequest}catch{}if(!ue)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function createCookieJar(){}function empty$1(){}const hasXHR2=function(){return new XHR({xdomain:!1}).responseType!=null}();class Polling extends Transport{constructor(ue){if(super(ue),this.polling=!1,typeof location<"u"){const no=location.protocol==="https:";let ro=location.port;ro||(ro=no?"443":"80"),this.xd=typeof location<"u"&&ue.hostname!==location.hostname||ro!==ue.port}const eo=ue&&ue.forceBase64;this.supportsBinary=hasXHR2&&!eo,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(ue){this.readyState="pausing";const eo=()=>{this.readyState="paused",ue()};if(this.polling||!this.writable){let no=0;this.polling&&(no++,this.once("pollComplete",function(){--no||eo()})),this.writable||(no++,this.once("drain",function(){--no||eo()}))}else eo()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(ue){const eo=no=>{if(this.readyState==="opening"&&no.type==="open"&&this.onOpen(),no.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(no)};decodePayload(ue,this.socket.binaryType).forEach(eo),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const ue=()=>{this.write([{type:"close"}])};this.readyState==="open"?ue():this.once("open",ue)}write(ue){this.writable=!1,encodePayload(ue,eo=>{this.doWrite(eo,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const ue=this.opts.secure?"https":"http",eo=this.query||{};return this.opts.timestampRequests!==!1&&(eo[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!eo.sid&&(eo.b64=1),this.createUri(ue,eo)}request(ue={}){return Object.assign(ue,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request(this.uri(),ue)}doWrite(ue,eo){const no=this.request({method:"POST",data:ue});no.on("success",eo),no.on("error",(ro,oo)=>{this.onError("xhr post error",ro,oo)})}doPoll(){const ue=this.request();ue.on("data",this.onData.bind(this)),ue.on("error",(eo,no)=>{this.onError("xhr poll error",eo,no)}),this.pollXhr=ue}}class Request extends Emitter{constructor(ue,eo){super(),installTimerFunctions(this,eo),this.opts=eo,this.method=eo.method||"GET",this.uri=ue,this.data=eo.data!==void 0?eo.data:null,this.create()}create(){var ue;const eo=pick$1(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");eo.xdomain=!!this.opts.xd;const no=this.xhr=new XHR(eo);try{no.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){no.setDisableHeaderCheck&&no.setDisableHeaderCheck(!0);for(let ro in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(ro)&&no.setRequestHeader(ro,this.opts.extraHeaders[ro])}}catch{}if(this.method==="POST")try{no.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{no.setRequestHeader("Accept","*/*")}catch{}(ue=this.opts.cookieJar)===null||ue===void 0||ue.addCookies(no),"withCredentials"in no&&(no.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(no.timeout=this.opts.requestTimeout),no.onreadystatechange=()=>{var ro;no.readyState===3&&((ro=this.opts.cookieJar)===null||ro===void 0||ro.parseCookies(no)),no.readyState===4&&(no.status===200||no.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof no.status=="number"?no.status:0)},0))},no.send(this.data)}catch(ro){this.setTimeoutFn(()=>{this.onError(ro)},0);return}typeof document<"u"&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)}onError(ue){this.emitReserved("error",ue,this.xhr),this.cleanup(!0)}cleanup(ue){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$1,ue)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this.index],this.xhr=null}}onLoad(){const ue=this.xhr.responseText;ue!==null&&(this.emitReserved("data",ue),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Request.requestsCount=0;Request.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const to="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(to,unloadHandler,!1)}}function unloadHandler(){for(let to in Request.requests)Request.requests.hasOwnProperty(to)&&Request.requests[to].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?ue=>Promise.resolve().then(ue):(ue,eo)=>eo(ue,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(ue){super(ue),this.supportsBinary=!ue.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const ue=this.uri(),eo=this.opts.protocols,no=isReactNative?{}:pick$1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(no.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?eo?new WebSocket(ue,eo):new WebSocket(ue):new WebSocket(ue,eo,no)}catch(ro){return this.emitReserved("error",ro)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=ue=>this.onClose({description:"websocket connection closed",context:ue}),this.ws.onmessage=ue=>this.onData(ue.data),this.ws.onerror=ue=>this.onError("websocket error",ue)}write(ue){this.writable=!1;for(let eo=0;eo<ue.length;eo++){const no=ue[eo],ro=eo===ue.length-1;encodePacket(no,this.supportsBinary,oo=>{const io={};try{usingBrowserWebSocket&&this.ws.send(oo)}catch{}ro&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const ue=this.opts.secure?"wss":"ws",eo=this.query||{};return this.opts.timestampRequests&&(eo[this.opts.timestampParam]=yeast()),this.supportsBinary||(eo.b64=1),this.createUri(ue,eo)}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(ue=>{this.onError("webtransport error",ue)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(ue=>{const eo=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),no=ue.readable.pipeThrough(eo).getReader(),ro=createPacketEncoderStream();ro.readable.pipeTo(ue.writable),this.writer=ro.writable.getWriter();const oo=()=>{no.read().then(({done:ao,value:so})=>{ao||(this.onPacket(so),oo())}).catch(ao=>{})};oo();const io={type:"open"};this.query.sid&&(io.data=`{"sid":"${this.query.sid}"}`),this.writer.write(io).then(()=>this.onOpen())})}))}write(ue){this.writable=!1;for(let eo=0;eo<ue.length;eo++){const no=ue[eo],ro=eo===ue.length-1;this.writer.write(no).then(()=>{ro&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var ue;(ue=this.transport)===null||ue===void 0||ue.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(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$8(to){if(to.length>2e3)throw"URI too long";const ue=to,eo=to.indexOf("["),no=to.indexOf("]");eo!=-1&&no!=-1&&(to=to.substring(0,eo)+to.substring(eo,no).replace(/:/g,";")+to.substring(no,to.length));let ro=re$1.exec(to||""),oo={},io=14;for(;io--;)oo[parts[io]]=ro[io]||"";return eo!=-1&&no!=-1&&(oo.source=ue,oo.host=oo.host.substring(1,oo.host.length-1).replace(/;/g,":"),oo.authority=oo.authority.replace("[","").replace("]","").replace(/;/g,":"),oo.ipv6uri=!0),oo.pathNames=pathNames(oo,oo.path),oo.queryKey=queryKey(oo,oo.query),oo}function pathNames(to,ue){const eo=/\/{2,9}/g,no=ue.replace(eo,"/").split("/");return(ue.slice(0,1)=="/"||ue.length===0)&&no.splice(0,1),ue.slice(-1)=="/"&&no.splice(no.length-1,1),no}function queryKey(to,ue){const eo={};return ue.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(no,ro,oo){ro&&(eo[ro]=oo)}),eo}let Socket$1=class ph extends Emitter{constructor(ue,eo={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],ue&&typeof ue=="object"&&(eo=ue,ue=null),ue?(ue=parse$8(ue),eo.hostname=ue.host,eo.secure=ue.protocol==="https"||ue.protocol==="wss",eo.port=ue.port,ue.query&&(eo.query=ue.query)):eo.host&&(eo.hostname=parse$8(eo.host).host),installTimerFunctions(this,eo),this.secure=eo.secure!=null?eo.secure:typeof location<"u"&&location.protocol==="https:",eo.hostname&&!eo.port&&(eo.port=this.secure?"443":"80"),this.hostname=eo.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=eo.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=eo.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},eo),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$2(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(ue){const eo=Object.assign({},this.opts.query);eo.EIO=protocol$1,eo.transport=ue,this.id&&(eo.sid=this.id);const no=Object.assign({},this.opts,{query:eo,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[ue]);return new transports[ue](no)}open(){let ue;if(this.opts.rememberUpgrade&&ph.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)ue="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else ue=this.transports[0];this.readyState="opening";try{ue=this.createTransport(ue)}catch{this.transports.shift(),this.open();return}ue.open(),this.setTransport(ue)}setTransport(ue){this.transport&&this.transport.removeAllListeners(),this.transport=ue,ue.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",eo=>this.onClose("transport close",eo))}probe(ue){let eo=this.createTransport(ue),no=!1;ph.priorWebsocketSuccess=!1;const ro=()=>{no||(eo.send([{type:"ping",data:"probe"}]),eo.once("packet",uo=>{if(!no)if(uo.type==="pong"&&uo.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",eo),!eo)return;ph.priorWebsocketSuccess=eo.name==="websocket",this.transport.pause(()=>{no||this.readyState!=="closed"&&(co(),this.setTransport(eo),eo.send([{type:"upgrade"}]),this.emitReserved("upgrade",eo),eo=null,this.upgrading=!1,this.flush())})}else{const fo=new Error("probe error");fo.transport=eo.name,this.emitReserved("upgradeError",fo)}}))};function oo(){no||(no=!0,co(),eo.close(),eo=null)}const io=uo=>{const fo=new Error("probe error: "+uo);fo.transport=eo.name,oo(),this.emitReserved("upgradeError",fo)};function ao(){io("transport closed")}function so(){io("socket closed")}function lo(uo){eo&&uo.name!==eo.name&&oo()}const co=()=>{eo.removeListener("open",ro),eo.removeListener("error",io),eo.removeListener("close",ao),this.off("close",so),this.off("upgrading",lo)};eo.once("open",ro),eo.once("error",io),eo.once("close",ao),this.once("close",so),this.once("upgrading",lo),this.upgrades.indexOf("webtransport")!==-1&&ue!=="webtransport"?this.setTimeoutFn(()=>{no||eo.open()},200):eo.open()}onOpen(){if(this.readyState="open",ph.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let ue=0;const eo=this.upgrades.length;for(;ue<eo;ue++)this.probe(this.upgrades[ue])}}onPacket(ue){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",ue),this.emitReserved("heartbeat"),this.resetPingTimeout(),ue.type){case"open":this.onHandshake(JSON.parse(ue.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const eo=new Error("server error");eo.code=ue.data,this.onError(eo);break;case"message":this.emitReserved("data",ue.data),this.emitReserved("message",ue.data);break}}onHandshake(ue){this.emitReserved("handshake",ue),this.id=ue.sid,this.transport.query.sid=ue.sid,this.upgrades=this.filterUpgrades(ue.upgrades),this.pingInterval=ue.pingInterval,this.pingTimeout=ue.pingTimeout,this.maxPayload=ue.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 ue=this.getWritablePackets();this.transport.send(ue),this.prevBufferLen=ue.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let eo=1;for(let no=0;no<this.writeBuffer.length;no++){const ro=this.writeBuffer[no].data;if(ro&&(eo+=byteLength(ro)),no>0&&eo>this.maxPayload)return this.writeBuffer.slice(0,no);eo+=2}return this.writeBuffer}write(ue,eo,no){return this.sendPacket("message",ue,eo,no),this}send(ue,eo,no){return this.sendPacket("message",ue,eo,no),this}sendPacket(ue,eo,no,ro){if(typeof eo=="function"&&(ro=eo,eo=void 0),typeof no=="function"&&(ro=no,no=null),this.readyState==="closing"||this.readyState==="closed")return;no=no||{},no.compress=no.compress!==!1;const oo={type:ue,data:eo,options:no};this.emitReserved("packetCreate",oo),this.writeBuffer.push(oo),ro&&this.once("flush",ro),this.flush()}close(){const ue=()=>{this.onClose("forced close"),this.transport.close()},eo=()=>{this.off("upgrade",eo),this.off("upgradeError",eo),ue()},no=()=>{this.once("upgrade",eo),this.once("upgradeError",eo)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?no():ue()}):this.upgrading?no():ue()),this}onError(ue){ph.priorWebsocketSuccess=!1,this.emitReserved("error",ue),this.onClose("transport error",ue)}onClose(ue,eo){(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",ue,eo),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(ue){const eo=[];let no=0;const ro=ue.length;for(;no<ro;no++)~this.transports.indexOf(ue[no])&&eo.push(ue[no]);return eo}};Socket$1.protocol=protocol$1;function url$1(to,ue="",eo){let no=to;eo=eo||typeof location<"u"&&location,to==null&&(to=eo.protocol+"//"+eo.host),typeof to=="string"&&(to.charAt(0)==="/"&&(to.charAt(1)==="/"?to=eo.protocol+to:to=eo.host+to),/^(https?|wss?):\/\//.test(to)||(typeof eo<"u"?to=eo.protocol+"//"+to:to="https://"+to),no=parse$8(to)),no.port||(/^(http|ws)$/.test(no.protocol)?no.port="80":/^(http|ws)s$/.test(no.protocol)&&(no.port="443")),no.path=no.path||"/";const oo=no.host.indexOf(":")!==-1?"["+no.host+"]":no.host;return no.id=no.protocol+"://"+oo+":"+no.port+ue,no.href=no.protocol+"://"+oo+(eo&&eo.port===no.port?"":":"+no.port),no}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=to=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(to):to.buffer instanceof ArrayBuffer,toString$4=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$4.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$4.call(File)==="[object FileConstructor]";function isBinary(to){return withNativeArrayBuffer&&(to instanceof ArrayBuffer||isView(to))||withNativeBlob&&to instanceof Blob||withNativeFile&&to instanceof File}function hasBinary(to,ue){if(!to||typeof to!="object")return!1;if(Array.isArray(to)){for(let eo=0,no=to.length;eo<no;eo++)if(hasBinary(to[eo]))return!0;return!1}if(isBinary(to))return!0;if(to.toJSON&&typeof to.toJSON=="function"&&arguments.length===1)return hasBinary(to.toJSON(),!0);for(const eo in to)if(Object.prototype.hasOwnProperty.call(to,eo)&&hasBinary(to[eo]))return!0;return!1}function deconstructPacket(to){const ue=[],eo=to.data,no=to;return no.data=_deconstructPacket(eo,ue),no.attachments=ue.length,{packet:no,buffers:ue}}function _deconstructPacket(to,ue){if(!to)return to;if(isBinary(to)){const eo={_placeholder:!0,num:ue.length};return ue.push(to),eo}else if(Array.isArray(to)){const eo=new Array(to.length);for(let no=0;no<to.length;no++)eo[no]=_deconstructPacket(to[no],ue);return eo}else if(typeof to=="object"&&!(to instanceof Date)){const eo={};for(const no in to)Object.prototype.hasOwnProperty.call(to,no)&&(eo[no]=_deconstructPacket(to[no],ue));return eo}return to}function reconstructPacket(to,ue){return to.data=_reconstructPacket(to.data,ue),delete to.attachments,to}function _reconstructPacket(to,ue){if(!to)return to;if(to&&to._placeholder===!0){if(typeof to.num=="number"&&to.num>=0&&to.num<ue.length)return ue[to.num];throw new Error("illegal attachments")}else if(Array.isArray(to))for(let eo=0;eo<to.length;eo++)to[eo]=_reconstructPacket(to[eo],ue);else if(typeof to=="object")for(const eo in to)Object.prototype.hasOwnProperty.call(to,eo)&&(to[eo]=_reconstructPacket(to[eo],ue));return to}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(to){to[to.CONNECT=0]="CONNECT",to[to.DISCONNECT=1]="DISCONNECT",to[to.EVENT=2]="EVENT",to[to.ACK=3]="ACK",to[to.CONNECT_ERROR=4]="CONNECT_ERROR",to[to.BINARY_EVENT=5]="BINARY_EVENT",to[to.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(ue){this.replacer=ue}encode(ue){return(ue.type===PacketType.EVENT||ue.type===PacketType.ACK)&&hasBinary(ue)?this.encodeAsBinary({type:ue.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:ue.nsp,data:ue.data,id:ue.id}):[this.encodeAsString(ue)]}encodeAsString(ue){let eo=""+ue.type;return(ue.type===PacketType.BINARY_EVENT||ue.type===PacketType.BINARY_ACK)&&(eo+=ue.attachments+"-"),ue.nsp&&ue.nsp!=="/"&&(eo+=ue.nsp+","),ue.id!=null&&(eo+=ue.id),ue.data!=null&&(eo+=JSON.stringify(ue.data,this.replacer)),eo}encodeAsBinary(ue){const eo=deconstructPacket(ue),no=this.encodeAsString(eo.packet),ro=eo.buffers;return ro.unshift(no),ro}}function isObject$7(to){return Object.prototype.toString.call(to)==="[object Object]"}class Decoder extends Emitter{constructor(ue){super(),this.reviver=ue}add(ue){let eo;if(typeof ue=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");eo=this.decodeString(ue);const no=eo.type===PacketType.BINARY_EVENT;no||eo.type===PacketType.BINARY_ACK?(eo.type=no?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(eo),eo.attachments===0&&super.emitReserved("decoded",eo)):super.emitReserved("decoded",eo)}else if(isBinary(ue)||ue.base64)if(this.reconstructor)eo=this.reconstructor.takeBinaryData(ue),eo&&(this.reconstructor=null,super.emitReserved("decoded",eo));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+ue)}decodeString(ue){let eo=0;const no={type:Number(ue.charAt(0))};if(PacketType[no.type]===void 0)throw new Error("unknown packet type "+no.type);if(no.type===PacketType.BINARY_EVENT||no.type===PacketType.BINARY_ACK){const oo=eo+1;for(;ue.charAt(++eo)!=="-"&&eo!=ue.length;);const io=ue.substring(oo,eo);if(io!=Number(io)||ue.charAt(eo)!=="-")throw new Error("Illegal attachments");no.attachments=Number(io)}if(ue.charAt(eo+1)==="/"){const oo=eo+1;for(;++eo&&!(ue.charAt(eo)===","||eo===ue.length););no.nsp=ue.substring(oo,eo)}else no.nsp="/";const ro=ue.charAt(eo+1);if(ro!==""&&Number(ro)==ro){const oo=eo+1;for(;++eo;){const io=ue.charAt(eo);if(io==null||Number(io)!=io){--eo;break}if(eo===ue.length)break}no.id=Number(ue.substring(oo,eo+1))}if(ue.charAt(++eo)){const oo=this.tryParse(ue.substr(eo));if(Decoder.isPayloadValid(no.type,oo))no.data=oo;else throw new Error("invalid payload")}return no}tryParse(ue){try{return JSON.parse(ue,this.reviver)}catch{return!1}}static isPayloadValid(ue,eo){switch(ue){case PacketType.CONNECT:return isObject$7(eo);case PacketType.DISCONNECT:return eo===void 0;case PacketType.CONNECT_ERROR:return typeof eo=="string"||isObject$7(eo);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(eo)&&(typeof eo[0]=="number"||typeof eo[0]=="string"&&RESERVED_EVENTS$1.indexOf(eo[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(eo)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(ue){this.packet=ue,this.buffers=[],this.reconPack=ue}takeBinaryData(ue){if(this.buffers.push(ue),this.buffers.length===this.reconPack.attachments){const eo=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),eo}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser$2=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on$1(to,ue,eo){return to.on(ue,eo),function(){to.off(ue,eo)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(ue,eo,no){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=ue,this.nsp=eo,no&&no.auth&&(this.auth=no.auth),this._opts=Object.assign({},no),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const ue=this.io;this.subs=[on$1(ue,"open",this.onopen.bind(this)),on$1(ue,"packet",this.onpacket.bind(this)),on$1(ue,"error",this.onerror.bind(this)),on$1(ue,"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(...ue){return ue.unshift("message"),this.emit.apply(this,ue),this}emit(ue,...eo){if(RESERVED_EVENTS.hasOwnProperty(ue))throw new Error('"'+ue.toString()+'" is a reserved event name');if(eo.unshift(ue),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(eo),this;const no={type:PacketType.EVENT,data:eo};if(no.options={},no.options.compress=this.flags.compress!==!1,typeof eo[eo.length-1]=="function"){const io=this.ids++,ao=eo.pop();this._registerAckCallback(io,ao),no.id=io}const ro=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!ro||!this.connected)||(this.connected?(this.notifyOutgoingListeners(no),this.packet(no)):this.sendBuffer.push(no)),this.flags={},this}_registerAckCallback(ue,eo){var no;const ro=(no=this.flags.timeout)!==null&&no!==void 0?no:this._opts.ackTimeout;if(ro===void 0){this.acks[ue]=eo;return}const oo=this.io.setTimeoutFn(()=>{delete this.acks[ue];for(let ao=0;ao<this.sendBuffer.length;ao++)this.sendBuffer[ao].id===ue&&this.sendBuffer.splice(ao,1);eo.call(this,new Error("operation has timed out"))},ro),io=(...ao)=>{this.io.clearTimeoutFn(oo),eo.apply(this,ao)};io.withError=!0,this.acks[ue]=io}emitWithAck(ue,...eo){return new Promise((no,ro)=>{const oo=(io,ao)=>io?ro(io):no(ao);oo.withError=!0,eo.push(oo),this.emit(ue,...eo)})}_addToQueue(ue){let eo;typeof ue[ue.length-1]=="function"&&(eo=ue.pop());const no={id:this._queueSeq++,tryCount:0,pending:!1,args:ue,flags:Object.assign({fromQueue:!0},this.flags)};ue.push((ro,...oo)=>no!==this._queue[0]?void 0:(ro!==null?no.tryCount>this._opts.retries&&(this._queue.shift(),eo&&eo(ro)):(this._queue.shift(),eo&&eo(null,...oo)),no.pending=!1,this._drainQueue())),this._queue.push(no),this._drainQueue()}_drainQueue(ue=!1){if(!this.connected||this._queue.length===0)return;const eo=this._queue[0];eo.pending&&!ue||(eo.pending=!0,eo.tryCount++,this.flags=eo.flags,this.emit.apply(this,eo.args))}packet(ue){ue.nsp=this.nsp,this.io._packet(ue)}onopen(){typeof this.auth=="function"?this.auth(ue=>{this._sendConnectPacket(ue)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(ue){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},ue):ue})}onerror(ue){this.connected||this.emitReserved("connect_error",ue)}onclose(ue,eo){this.connected=!1,delete this.id,this.emitReserved("disconnect",ue,eo),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(ue=>{if(!this.sendBuffer.some(no=>String(no.id)===ue)){const no=this.acks[ue];delete this.acks[ue],no.withError&&no.call(this,new Error("socket has been disconnected"))}})}onpacket(ue){if(ue.nsp===this.nsp)switch(ue.type){case PacketType.CONNECT:ue.data&&ue.data.sid?this.onconnect(ue.data.sid,ue.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(ue);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(ue);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const no=new Error(ue.data.message);no.data=ue.data.data,this.emitReserved("connect_error",no);break}}onevent(ue){const eo=ue.data||[];ue.id!=null&&eo.push(this.ack(ue.id)),this.connected?this.emitEvent(eo):this.receiveBuffer.push(Object.freeze(eo))}emitEvent(ue){if(this._anyListeners&&this._anyListeners.length){const eo=this._anyListeners.slice();for(const no of eo)no.apply(this,ue)}super.emit.apply(this,ue),this._pid&&ue.length&&typeof ue[ue.length-1]=="string"&&(this._lastOffset=ue[ue.length-1])}ack(ue){const eo=this;let no=!1;return function(...ro){no||(no=!0,eo.packet({type:PacketType.ACK,id:ue,data:ro}))}}onack(ue){const eo=this.acks[ue.id];typeof eo=="function"&&(delete this.acks[ue.id],eo.withError&&ue.data.unshift(null),eo.apply(this,ue.data))}onconnect(ue,eo){this.id=ue,this.recovered=eo&&this._pid===eo,this._pid=eo,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(ue=>this.emitEvent(ue)),this.receiveBuffer=[],this.sendBuffer.forEach(ue=>{this.notifyOutgoingListeners(ue),this.packet(ue)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(ue=>ue()),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(ue){return this.flags.compress=ue,this}get volatile(){return this.flags.volatile=!0,this}timeout(ue){return this.flags.timeout=ue,this}onAny(ue){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(ue),this}prependAny(ue){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(ue),this}offAny(ue){if(!this._anyListeners)return this;if(ue){const eo=this._anyListeners;for(let no=0;no<eo.length;no++)if(ue===eo[no])return eo.splice(no,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(ue){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(ue),this}prependAnyOutgoing(ue){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(ue),this}offAnyOutgoing(ue){if(!this._anyOutgoingListeners)return this;if(ue){const eo=this._anyOutgoingListeners;for(let no=0;no<eo.length;no++)if(ue===eo[no])return eo.splice(no,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(ue){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const eo=this._anyOutgoingListeners.slice();for(const no of eo)no.apply(this,ue.data)}}}function Backoff(to){to=to||{},this.ms=to.min||100,this.max=to.max||1e4,this.factor=to.factor||2,this.jitter=to.jitter>0&&to.jitter<=1?to.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var to=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var ue=Math.random(),eo=Math.floor(ue*this.jitter*to);to=Math.floor(ue*10)&1?to+eo:to-eo}return Math.min(to,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(to){this.ms=to};Backoff.prototype.setMax=function(to){this.max=to};Backoff.prototype.setJitter=function(to){this.jitter=to};class Manager extends Emitter{constructor(ue,eo){var no;super(),this.nsps={},this.subs=[],ue&&typeof ue=="object"&&(eo=ue,ue=void 0),eo=eo||{},eo.path=eo.path||"/socket.io",this.opts=eo,installTimerFunctions(this,eo),this.reconnection(eo.reconnection!==!1),this.reconnectionAttempts(eo.reconnectionAttempts||1/0),this.reconnectionDelay(eo.reconnectionDelay||1e3),this.reconnectionDelayMax(eo.reconnectionDelayMax||5e3),this.randomizationFactor((no=eo.randomizationFactor)!==null&&no!==void 0?no:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(eo.timeout==null?2e4:eo.timeout),this._readyState="closed",this.uri=ue;const ro=eo.parser||parser$2;this.encoder=new ro.Encoder,this.decoder=new ro.Decoder,this._autoConnect=eo.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(ue){return arguments.length?(this._reconnection=!!ue,this):this._reconnection}reconnectionAttempts(ue){return ue===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=ue,this)}reconnectionDelay(ue){var eo;return ue===void 0?this._reconnectionDelay:(this._reconnectionDelay=ue,(eo=this.backoff)===null||eo===void 0||eo.setMin(ue),this)}randomizationFactor(ue){var eo;return ue===void 0?this._randomizationFactor:(this._randomizationFactor=ue,(eo=this.backoff)===null||eo===void 0||eo.setJitter(ue),this)}reconnectionDelayMax(ue){var eo;return ue===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=ue,(eo=this.backoff)===null||eo===void 0||eo.setMax(ue),this)}timeout(ue){return arguments.length?(this._timeout=ue,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(ue){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const eo=this.engine,no=this;this._readyState="opening",this.skipReconnect=!1;const ro=on$1(eo,"open",function(){no.onopen(),ue&&ue()}),oo=ao=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",ao),ue?ue(ao):this.maybeReconnectOnOpen()},io=on$1(eo,"error",oo);if(this._timeout!==!1){const ao=this._timeout,so=this.setTimeoutFn(()=>{ro(),oo(new Error("timeout")),eo.close()},ao);this.opts.autoUnref&&so.unref(),this.subs.push(()=>{this.clearTimeoutFn(so)})}return this.subs.push(ro),this.subs.push(io),this}connect(ue){return this.open(ue)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const ue=this.engine;this.subs.push(on$1(ue,"ping",this.onping.bind(this)),on$1(ue,"data",this.ondata.bind(this)),on$1(ue,"error",this.onerror.bind(this)),on$1(ue,"close",this.onclose.bind(this)),on$1(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(ue){try{this.decoder.add(ue)}catch(eo){this.onclose("parse error",eo)}}ondecoded(ue){nextTick(()=>{this.emitReserved("packet",ue)},this.setTimeoutFn)}onerror(ue){this.emitReserved("error",ue)}socket(ue,eo){let no=this.nsps[ue];return no?this._autoConnect&&!no.active&&no.connect():(no=new Socket(this,ue,eo),this.nsps[ue]=no),no}_destroy(ue){const eo=Object.keys(this.nsps);for(const no of eo)if(this.nsps[no].active)return;this._close()}_packet(ue){const eo=this.encoder.encode(ue);for(let no=0;no<eo.length;no++)this.engine.write(eo[no],ue.options)}cleanup(){this.subs.forEach(ue=>ue()),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(ue,eo){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",ue,eo),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const ue=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const eo=this.backoff.duration();this._reconnecting=!0;const no=this.setTimeoutFn(()=>{ue.skipReconnect||(this.emitReserved("reconnect_attempt",ue.backoff.attempts),!ue.skipReconnect&&ue.open(ro=>{ro?(ue._reconnecting=!1,ue.reconnect(),this.emitReserved("reconnect_error",ro)):ue.onreconnect()}))},eo);this.opts.autoUnref&&no.unref(),this.subs.push(()=>{this.clearTimeoutFn(no)})}}onreconnect(){const ue=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",ue)}}const cache$1={};function lookup(to,ue){typeof to=="object"&&(ue=to,to=void 0),ue=ue||{};const eo=url$1(to,ue.path||"/socket.io"),no=eo.source,ro=eo.id,oo=eo.path,io=cache$1[ro]&&oo in cache$1[ro].nsps,ao=ue.forceNew||ue["force new connection"]||ue.multiplex===!1||io;let so;return ao?so=new Manager(no,ue):(cache$1[ro]||(cache$1[ro]=new Manager(no,ue)),so=cache$1[ro]),eo.query&&!ue.query&&(ue.query=eo.queryKey),so.socket(eo.path,ue)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const DefaultOptions={heartbeat:!0},createWebsocket=(to,ue=DefaultOptions)=>{if(!to)throw"A websocket path must be provided";const{heartbeat:eo}={...DefaultOptions,...ue},no=location.protocol==="https:",ro=no?"wss:":"ws:",oo=location.hostname,io=location.port||(no?443:80);let ao=lookup(`${ro}//${oo}:${io}`,{path:to,reconnectionAttempts:3,reconnectionDelay:5e3,reconnectionDelayMax:5e3,timeout:4e3,transports:["websocket"]}),so;return eo&&(so=setInterval(()=>{ao.emit(SocketEvent.Heartbeat)},SocketSessionTTL*500)),ao.on("disconnect",()=>{clearInterval(so)}),ao.onOther=(lo,co)=>{ao.on(lo,uo=>{(uo==null?void 0:uo.apiSessionId)!==APISessionID&&co(uo)})},ao},defaultColors={keyColor:"dimgray",numberColor:"lightskyblue",stringColor:"lightcoral",trueColor:"lightseagreen",falseColor:"#f66578",nullColor:"cornflowerblue"},entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="};function escapeHtml(to){return String(to).replace(/[&<>"'`=]/g,function(ue){return entityMap[ue]})}function format$1(to,ue={}){const eo=typeof to;let no=typeof to=="string"?to:JSON.stringify(to,null,2)||eo,ro=Object.assign({},defaultColors,ue);return no=no.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),no.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+]?\d+)?)/g,oo=>{let io=ro.numberColor,ao="";return/^"/.test(oo)?/:$/.test(oo)?io=ro.keyColor:(io=ro.stringColor,oo='"'+escapeHtml(oo.substr(1,oo.length-2))+'"',ao="word-wrap:break-word;white-space:pre-wrap;"):io=/true/.test(oo)?ro.trueColor:/false/.test(oo)?ro.falseColor:/null/.test(oo)?ro.nullColor:io,`<span style="${ao}color:${io}">${oo}</span>`})}const extractFileNameRegex=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;function downloadText(to,ue){typeof ue=="object"&&(ue=JSON.stringify(ue));const eo=new Blob([ue],{type:"plain/text"}),no=URL.createObjectURL(eo),ro=document.createElement("a");ro.href=no,ro.download=to,ro.click(),URL.revokeObjectURL(no)}async function downloadStream(to){const ue=await to.blob(),eo=to.headers.get("Content-Disposition"),ro=extractFileNameRegex.exec(eo)[1].replace(/['"]/g,""),oo=new Blob([ue]),io=URL.createObjectURL(oo),ao=document.createElement("a");ao.href=io,ao.download=ro,ao.click(),URL.revokeObjectURL(io)}async function downloadFile(to,ue){const eo=await fetch(to,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ue)});if(eo.ok){const no=eo.headers.get("Content-Disposition"),oo=extractFileNameRegex.exec(no)[1].replace(/['"]/g,""),io=URL.createObjectURL(await eo.blob()),ao=document.createElement("a");return ao.href=io,ao.download=oo,ao.click(),URL.revokeObjectURL(io),!0}else return!1}const shouldDisplaySetting=(to,ue)=>{let eo=ue.dependsOn;return eo&&!Array.isArray(eo)&&(eo=[eo]),eo!=null&&eo.length?eo.every(no=>{let ro=no,oo=null,io=!!no.invert;if(typeof no=="object"&&(ro=no.setting,oo=no.value),!ro)return!1;Array.isArray(oo)||(oo=[oo]);const ao=deepGet$1(to,ro);return oo.some(lo=>lo==null?ao!=null&&ao!==!1&&ao!=="":lo===ao)!==io}):!0},columnTypeManyTypeOverrides={[FieldType.DATETIME]:FieldType.STRING,[FieldType.BOOLEAN]:FieldType.STRING,[FieldType.SIGNATURE_SINGLE]:FieldType.ATTACHMENTS},columnTypeManyParser={[FieldType.DATETIME]:(to,ue)=>{function eo(no){const{timeOnly:ro,dateOnly:oo}=ue||{},io=!oo,ao=parseDate(no,{enableTime:io});return getDateDisplayValue(ao,{enableTime:io,timeOnly:ro})}return to.map(no=>eo(no))},[FieldType.BOOLEAN]:to=>to.map(ue=>!!ue),[FieldType.BB_REFERENCE_SINGLE]:to=>[...new Map(to.map(ue=>[ue._id,ue])).values()],[FieldType.BB_REFERENCE]:to=>[...new Map(to.map(ue=>[ue._id,ue])).values()],[FieldType.ARRAY]:to=>Array.from(new Set(to))};function enrichSchemaWithRelColumns(to){return Object.keys(to).reduce((eo,no)=>{const ro=to[no];if(eo[no]=ro,ro.visible!==!1&&isRelationshipField(ro)&&ro.columns){const oo=(ro==null?void 0:ro.relationshipType)===RelationshipType.ONE_TO_MANY;for(const io of Object.keys(ro.columns)){const ao=ro.columns[io];if(!ao.visible)continue;const so=`${ro.name}.${io}`;eo[so]={...ao,type:ao.type,name:so,related:{field:no,subField:io},cellRenderType:!oo&&columnTypeManyTypeOverrides[ao.type]||ao.type}}}return eo},{})}function getRelatedTableValues(to,ue,eo){var oo,io,ao,so;const no=isRelationshipField(eo)&&(eo==null?void 0:eo.relationshipType)===RelationshipType.ONE_TO_MANY;let ro="";if(no)ro=(io=(oo=to[ue.related.field])==null?void 0:oo[0])==null?void 0:io[ue.related.subField];else{const lo=columnTypeManyParser[ue.type]||(fo=>fo),co=(so=(ao=to[ue.related.field])==null?void 0:ao.flatMap(fo=>fo[ue.related.subField]))==null?void 0:so.filter(fo=>fo!=null),uo=lo(co||[],ue);ro=uo,[FieldType.STRING,FieldType.NUMBER,FieldType.BIGINT,FieldType.BOOLEAN,FieldType.DATETIME,FieldType.LONGFORM,FieldType.BARCODEQR].includes(ue.type)&&(ro=uo==null?void 0:uo.join(", "))}return ro}function canBeDisplayColumn(to){return!(!canBeDisplayColumn$1(to.type)||to.related)}function canBeSortColumn(to){return to.calculationType?!0:!(!canBeSortColumn$1(to.type)||to.related)}const{buildQuery,limit:queryLimit,runQuery,sort:sort$2}=QueryUtils;class BaseDataFetch{constructor(ue){pc(this,"API");pc(this,"features");pc(this,"options");pc(this,"store");pc(this,"derivedStore");if(this.features={supportsSearch:!1,supportsSort:!1,supportsPagination:!1},this.options={datasource:ue.datasource,limit:10,filter:null,query:ue.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:ue.query,pageNumber:0,cursor:null,cursors:[],resetKey:Math.random().toString(),error:null}),this.API=ue==null?void 0:ue.API,this.options={...this.options,...ue},!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,eo=>({...eo,...this.features,hasNextPage:this.hasNextPage(eo),hasPrevPage:this.hasPrevPage(eo)})),!this.options.datasource){this.store.update(eo=>({...eo,loaded:!0}));return}}get subscribe(){return this.derivedStore.subscribe}getDefaultSortColumn(ue,eo){return ue!=null&&ue.primaryDisplay&&eo[ue.primaryDisplay]?ue.primaryDisplay:Object.keys(eo)[0]}async getInitialData(){const{filter:ue,paginate:eo}=this.options,no=await this.getDefinition(),ro=await this.determineFeatureFlags();this.features={supportsSearch:!!(ro!=null&&ro.supportsSearch),supportsSort:!!(ro!=null&&ro.supportsSort),supportsPagination:eo&&!!(ro!=null&&ro.supportsPagination)};let oo=this.getSchema(no);if(!oo)return;if(oo=this.enrichSchema(oo),this.options.sortColumn&&!oo[this.options.sortColumn]&&(this.options.sortColumn=null),this.options.sortColumn||(this.options.sortColumn=this.getDefaultSortColumn(no,oo)),!this.options.sortColumn)this.options.sortOrder=SortOrder.ASCENDING,this.options.sortType=null;else{this.options.sortType=SortType.STRING;const so=oo==null?void 0:oo[this.options.sortColumn];((so==null?void 0:so.type)===FieldType.NUMBER||(so==null?void 0:so.type)===FieldType.BIGINT||"calculationType"in so&&(so!=null&&so.calculationType))&&(this.options.sortType=SortType.NUMBER),this.options.sortOrder?this.options.sortOrder=this.options.sortOrder.toLowerCase():this.options.sortOrder=SortOrder.ASCENDING}let io=this.options.query;io||(io=buildQuery(ue??void 0)),this.store.update(so=>({...so,definition:no,schema:oo,query:io,loading:!0,cursors:[],cursor:null}));const ao=await this.getPage();this.store.update(so=>({...so,loading:!1,loaded:!0,pageNumber:0,rows:ao.rows,info:ao.info,cursors:eo&&ao.hasNextPage?[null,ao.cursor]:[null],error:ao.error,resetKey:Math.random().toString()}))}async getPage(){const{sortColumn:ue,sortOrder:eo,sortType:no,limit:ro,clientSideSearching:oo,clientSideSorting:io,clientSideLimiting:ao}=this.options,{query:so}=get_store_value(this.store);let{rows:lo,info:co,hasNextPage:uo,cursor:fo,error:po}=await this.getData();return!this.features.supportsSearch&&oo&&(lo=runQuery(lo,so)),!this.features.supportsSort&&io&&no&&(lo=sort$2(lo,ue,eo,no)),!this.features.supportsPagination&&ao&&(lo=queryLimit(lo,ro)),{rows:lo,info:co,hasNextPage:uo,cursor:fo,error:po}}getSchema(ue){return(ue==null?void 0:ue.schema)??void 0}enrichSchema(ue){let eo={};for(const ro of Object.keys(ue)){const oo=ue[ro];if(oo.type===FieldType.JSON){const io=convertJSONSchemaToTableSchema(oo,{squashObjects:!0});if(io)for(const ao of Object.keys(io))eo[`${ro}.${ao}`]={type:io[ao].type,nestedJSON:!0}}}let no={};return Object.entries({...ue,...eo}).forEach(([ro,oo])=>{typeof oo=="string"?no[ro]={type:oo,name:ro}:no[ro]={...oo,type:oo.type,name:ro}}),no}async determineFeatureFlags(){return{supportsSearch:!1,supportsSort:!1,supportsPagination:!1}}async update(ue){let eo=!1;for(const[no,ro]of Object.entries(ue||{})){const oo=this.options[no]??null;if(JSON.stringify(ro??null)!==JSON.stringify(oo)){eo=!0;break}}eo&&(this.options={...this.options,...fp$1.cloneDeep(ue)},await this.getInitialData())}async refresh(){if(get_store_value(this.store).loading)return;this.store.update(so=>({...so,loading:!0}));const{rows:ue,info:eo,error:no,cursor:ro}=await this.getPage();let{cursors:oo}=get_store_value(this.store);const{pageNumber:io}=get_store_value(this.store);if(!ue.length&&io>0)return this.store.update(so=>({...so,loading:!1,cursors:oo.slice(0,io)})),await this.prevPage();oo[io+1]!=ro&&(oo=oo.slice(0,io+1),oo[io+1]=ro),this.store.update(so=>({...so,rows:ue,info:eo,loading:!1,error:no,cursors:oo}))}hasNextPage(ue){return ue.cursors[ue.pageNumber+1]!=null}hasPrevPage(ue){return ue.pageNumber>0}async nextPage(){const ue=get_store_value(this.derivedStore);if(ue.loading||!this.options.paginate||!ue.hasNextPage)return;const eo=ue.cursors[ue.pageNumber+1];this.store.update(so=>({...so,loading:!0,cursor:eo,pageNumber:so.pageNumber+1}));const{rows:no,info:ro,hasNextPage:oo,cursor:io,error:ao}=await this.getPage();this.store.update(so=>{let{cursors:lo,pageNumber:co}=so;return oo&&(lo[co+1]=io),{...so,rows:no,info:ro,cursors:lo,loading:!1,error:ao}})}async prevPage(){const ue=get_store_value(this.derivedStore);if(ue.loading||!this.options.paginate||!ue.hasPrevPage)return;const eo=ue.cursors[ue.pageNumber-1];this.store.update(io=>({...io,loading:!0,cursor:eo,pageNumber:io.pageNumber-1}));const{rows:no,info:ro,error:oo}=await this.getPage();this.store.update(io=>({...io,rows:no,info:ro,loading:!1,error:oo}))}}class TableFetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}async getData(){const{datasource:ue,limit:eo,sortColumn:no,sortOrder:ro,sortType:oo,paginate:io}=this.options,{tableId:ao}=ue,{cursor:so,query:lo}=get_store_value(this.store);try{const co=await this.API.searchTable(ao,{query:lo,limit:eo,sort:no,sortOrder:ro??SortOrder.ASCENDING,sortType:oo,paginate:io,bookmark:so});return{rows:(co==null?void 0:co.rows)||[],hasNextPage:(co==null?void 0:co.hasNextPage)||!1,cursor:(co==null?void 0:co.bookmark)||null}}catch(co){return{rows:[],hasNextPage:!1,error:co}}}}class ViewFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}getSchema(ue){var no,ro;const{datasource:eo}=this.options;return(ro=(no=ue==null?void 0:ue.views)==null?void 0:no[eo==null?void 0:eo.name])==null?void 0:ro.schema}async getData(){const{datasource:ue}=this.options;try{return{rows:await this.API.fetchViewData(ue.name,{calculation:ue.calculation,field:ue.field,groupBy:ue.groupBy,tableId:ue.tableId})||[]}}catch(eo){return console.error(eo,{datasource:ue}),{rows:[]}}}}class ViewV2Fetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:ue}=this.options;try{const eo=await this.API.viewV2.fetchDefinition(ue.id);return eo==null?void 0:eo.data}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}getDefaultSortColumn(){return null}async getData(){var co;const{datasource:ue,limit:eo,sortColumn:no,sortOrder:ro,sortType:oo,paginate:io}=this.options,{cursor:ao,query:so,definition:lo}=get_store_value(this.store);if((lo==null?void 0:lo.type)===ViewV2Type.CALCULATION&&!Object.values(lo.schema||{}).some(isCalculationField))return{rows:[],hasNextPage:!1,cursor:null,error:null};!no&&((co=lo==null?void 0:lo.sort)!=null&&co.field)&&(this.options.sortColumn=lo.sort.field,this.options.sortOrder=lo.sort.order||SortOrder.ASCENDING);try{const uo={query:so,paginate:io,limit:eo,bookmark:ao,sort:no,sortOrder:ro,sortType:oo};if(io){const fo=await this.API.viewV2.fetch(ue.id,{...uo,paginate:io});return{rows:(fo==null?void 0:fo.rows)||[],hasNextPage:(fo==null?void 0:fo.hasNextPage)||!1,cursor:(fo==null?void 0:fo.bookmark)||null}}else{const fo=await this.API.viewV2.fetch(ue.id,{...uo,paginate:io});return{rows:(fo==null?void 0:fo.rows)||[],hasNextPage:!1,cursor:null}}}catch(uo){return{rows:[],hasNextPage:!1,cursor:null,error:uo}}}}class QueryFetch extends BaseDataFetch{async determineFeatureFlags(){var no,ro,oo,io,ao,so;const ue=await this.getDefinition();return{supportsPagination:!!((ro=(no=ue==null?void 0:ue.fields)==null?void 0:no.pagination)!=null&&ro.type)&&!!((io=(oo=ue==null?void 0:ue.fields)==null?void 0:oo.pagination)!=null&&io.location)&&!!((so=(ao=ue==null?void 0:ue.fields)==null?void 0:ao.pagination)!=null&&so.pageParam)}}async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue._id))return null;try{const eo=await this.API.fetchQueryDefinition(ue._id);return eo.fields||(eo.fields=ue.fields),eo}catch{return null}}getDefaultSortColumn(){return null}async getData(){var co,uo;const{datasource:ue,limit:eo,paginate:no}=this.options,{supportsPagination:ro}=this.features,{cursor:oo,definition:io}=get_store_value(this.store),ao=(uo=(co=io==null?void 0:io.fields)==null?void 0:co.pagination)==null?void 0:uo.type,so=cloneDeep(ue.queryParams||{});for(const fo of(ue==null?void 0:ue.parameters)||[])so[fo.name]||(so[fo.name]=fo.default);const lo={parameters:so};if(no&&ro){const fo=ao==="page"?parseInt(oo||"1"):oo;lo.pagination={page:fo,limit:eo}}try{const fo=await this.API.executeQuery(ue==null?void 0:ue._id,lo),{data:po,pagination:ho,..._o}=fo;let go=null,bo=!1;return no&&ro&&(ao==="page"?(go=lo.pagination.page+1,bo=(po==null?void 0:po.length)===eo&&eo>0):(go=ho==null?void 0:ho.cursor,bo=go!=null)),{rows:po||[],info:_o,cursor:go,hasNextPage:bo}}catch{return{rows:[],hasNextPage:!1}}}}class RelationshipFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}async getData(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.rowId)||!(ue!=null&&ue.rowTableId))return{rows:[]};try{return{rows:await this.API.fetchRelationshipData(ue.rowTableId,ue.rowId,ue.fieldName)}}catch{return{rows:[]}}}}class NestedProviderFetch extends BaseDataFetch{async getDefinition(){var eo,no;const{datasource:ue}=this.options;return{schema:(eo=ue==null?void 0:ue.value)==null?void 0:eo.schema,primaryDisplay:(no=ue==null?void 0:ue.value)==null?void 0:no.primaryDisplay}}async getData(){var eo;const{datasource:ue}=this.options;return{rows:((eo=ue==null?void 0:ue.value)==null?void 0:eo.rows)||[],hasNextPage:!1,cursor:null}}}function isArrayOfStrings(to){return Array.isArray(to)&&!!to[0]&&typeof to[0]!="object"}class FieldFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;let eo;return ue.fieldType==="attachment"?eo={url:{type:"string"},name:{type:"string"}}:ue.fieldType==="array"&&(eo={value:{type:"string"}}),{schema:eo}}async getData(){const{datasource:ue}=this.options,eo=(ue==null?void 0:ue.value)||[];let no;return isArrayOfStrings(eo)?no=eo.map(ro=>({value:ro})):no=eo,{rows:no||[],hasNextPage:!1,cursor:null}}}class JSONArrayFetch extends FieldFetch{async getDefinition(){const{datasource:ue}=this.options;try{const eo=await this.API.fetchTableDefinition(ue.tableId);return{schema:getJSONArrayDatasourceSchema(eo==null?void 0:eo.schema,ue)}}catch{return null}}}class UserFetch extends BaseDataFetch{constructor(ue){super({...ue,datasource:{type:"user",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{limit:ue,paginate:eo}=this.options,{cursor:no,query:ro}=get_store_value(this.store),{appId:oo,paginated:io,...ao}=ro,so=isSupportedUserSearch(ao)?ao:{};try{const lo={bookmark:no??void 0,query:so??void 0,appId:oo,paginate:io||eo,limit:ue},co=await this.API.searchUsers(lo);return{rows:(co==null?void 0:co.data)||[],hasNextPage:(co==null?void 0:co.hasNextPage)||!1,cursor:(co==null?void 0:co.nextPage)||null}}catch(lo){return{rows:[],hasNextPage:!1,error:lo}}}}class GroupUserFetch extends BaseDataFetch{constructor(ue){super({...ue,datasource:{type:"groupUser",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{query:ue,cursor:eo}=get_store_value(this.store);try{const no=await this.API.getGroupUsers({id:ue.groupId,emailSearch:ue.emailSearch,bookmark:eo??void 0});return{rows:(no==null?void 0:no.users)||[],hasNextPage:(no==null?void 0:no.hasNextPage)||!1,cursor:(no==null?void 0:no.bookmark)||null}}catch(no){return{rows:[],hasNextPage:!1,error:no}}}}class CustomFetch extends BaseDataFetch{getType(ue){return ue==null?"string":typeof ue==="object"?Array.isArray(ue)?"array":"json":isNaN(ue)?"string":"number"}parseCustomData(ue){if(!ue)return[];if(Array.isArray(ue))return ue;if(typeof ue=="string"){try{const eo=JSON.parse(ue);return Array.isArray(eo)?eo:[eo]}catch{}return ue.includes(`
|
|
475
|
+
`))&&attr(ue,"style",eo),(!ro||so&1&&no!==(no="spectrum-Body spectrum-Body--size"+ao[0]+" svelte-10a30y"))&&attr(ue,"class",no),(!ro||so&3)&&toggle_class(ue,"spectrum-Body--serif",ao[1])},i(ao){ro||(transition_in(io,ao),ro=!0)},o(ao){transition_out(io,ao),ro=!1},d(ao){ao&&detach(ue),io&&io.d(ao)}}}function instance$a4(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{size:oo="M"}=ue,{serif:io=!1}=ue,{weight:ao=null}=ue,{textAlign:so=null}=ue,{color:lo=null}=ue;return to.$$set=co=>{"size"in co&&eo(0,oo=co.size),"serif"in co&&eo(1,io=co.serif),"weight"in co&&eo(2,ao=co.weight),"textAlign"in co&&eo(3,so=co.textAlign),"color"in co&&eo(4,lo=co.color),"$$scope"in co&&eo(5,ro=co.$$scope)},[oo,io,ao,so,lo,ro,no]}class Body extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a4,create_fragment$a7,safe_not_equal,{size:0,serif:1,weight:2,textAlign:3,color:4})}}const Heading_svelte_svelte_type_style_lang="";function create_fragment$a6(to){let ue,eo,no,ro;const oo=to[5].default,io=create_slot(oo,to,to[4],null);return{c(){ue=element("h1"),io&&io.c(),attr(ue,"data-testid","typography-heading"),attr(ue,"style",eo=to[1]?`text-align:${to[1]}`:""),attr(ue,"class",no="spectrum-Heading spectrum-Heading--size"+to[0]+" spectrum-Heading--"+to[3]+" svelte-3sm8u5"),toggle_class(ue,"noPadding",to[2])},m(ao,so){insert$1(ao,ue,so),io&&io.m(ue,null),ro=!0},p(ao,[so]){io&&io.p&&(!ro||so&16)&&update_slot_base(io,oo,ao,ao[4],ro?get_slot_changes(oo,ao[4],so,null):get_all_dirty_from_scope(ao[4]),null),(!ro||so&2&&eo!==(eo=ao[1]?`text-align:${ao[1]}`:""))&&attr(ue,"style",eo),(!ro||so&9&&no!==(no="spectrum-Heading spectrum-Heading--size"+ao[0]+" spectrum-Heading--"+ao[3]+" svelte-3sm8u5"))&&attr(ue,"class",no),(!ro||so&13)&&toggle_class(ue,"noPadding",ao[2])},i(ao){ro||(transition_in(io,ao),ro=!0)},o(ao){transition_out(io,ao),ro=!1},d(ao){ao&&detach(ue),io&&io.d(ao)}}}function instance$a3(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{size:oo="M"}=ue,{textAlign:io=void 0}=ue,{noPadding:ao=!1}=ue,{weight:so="default"}=ue;return to.$$set=lo=>{"size"in lo&&eo(0,oo=lo.size),"textAlign"in lo&&eo(1,io=lo.textAlign),"noPadding"in lo&&eo(2,ao=lo.noPadding),"weight"in lo&&eo(3,so=lo.weight),"$$scope"in lo&&eo(4,ro=lo.$$scope)},[oo,io,ao,so,ro,no]}class Heading extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a3,create_fragment$a6,safe_not_equal,{size:0,textAlign:1,noPadding:2,weight:3})}}var HTTPMethod=(to=>(to.POST="POST",to.PATCH="PATCH",to.GET="GET",to.PUT="PUT",to.DELETE="DELETE",to))(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$1=(to=>(to.USERS="ta_users",to))(TableNames$1||{});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$2={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER",CREATOR:"CREATOR"},EventPublishType={ENV_VAR_UPGRADE_PANEL_OPENED:"environment_variable_upgrade_panel_opened"},ContextScopes$2={Local:"local",Global:"global"},TypeIconMap$1={[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(to=>`hsla(${(to+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$1={WRITABLE:"writable",READONLY:"readonly",HIDDEN:"hidden"},Constants$1=Object.freeze(Object.defineProperty({__proto__:null,ApiVersion,BannedSearchTypes,BudibaseRoleOptions,BudibaseRoleOptionsOld,BudibaseRoles,ContextScopes:ContextScopes$2,Cookies,DEFAULT_BB_DATASOURCE_ID:DEFAULT_BB_DATASOURCE_ID$1,EventPublishType,ExtendedBudibaseRoleOptions,Features:Feature,FieldPermissions:FieldPermissions$1,FilterOperator,FilterValueType,OnEmptyFilter,OperatorOptions,OptionColours,PlanType,Roles:Roles$2,SqlNumberTypeRangeMap,TableNames:TableNames$1,TypeIconMap:TypeIconMap$1},Symbol.toStringTag,{value:"Module"})),buildAnalyticsEndpoints=to=>({getAnalyticsStatus:async()=>await to.get({url:"/api/bbtel"}),analyticsPing:async ue=>await to.post({url:"/api/bbtel/ping",body:{...ue,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}})}),buildAIEndpoints=to=>({generateCronExpression:async ue=>await to.post({url:"/api/ai/cron",body:{prompt:ue}})}),buildAppEndpoints=to=>({fetchAppPackage:async ue=>await to.get({url:`/api/applications/${ue}/appPackage`}),saveAppMetadata:async(ue,eo)=>await to.put({url:`/api/applications/${ue}`,body:eo}),publishAppChanges:async ue=>await to.post({url:`/api/applications/${ue}/publish`}),revertAppChanges:async ue=>await to.post({url:`/api/dev/${ue}/revert`}),updateAppClientVersion:async ue=>await to.post({url:`/api/applications/${ue}/client/update`}),revertAppClientVersion:async ue=>await to.post({url:`/api/applications/${ue}/client/revert`}),getAppDeployments:async()=>await to.get({url:"/api/deployments"}),createApp:async ue=>await to.post({url:"/api/applications",body:ue,json:!1}),duplicateApp:async(ue,eo)=>await to.post({url:`/api/applications/${ue}/duplicate`,body:eo,json:!1}),updateAppFromExport:async(ue,eo)=>{const no=getDevAppID(ue);return await to.post({url:`/api/applications/${no}/import`,body:eo,json:!1})},importApps:async ue=>await to.post({url:"/api/cloud/import",body:ue,json:!1}),unpublishApp:async ue=>await to.post({url:`/api/applications/${ue}/unpublish`}),deleteApp:async ue=>await to.delete({url:`/api/applications/${ue}`}),releaseAppLock:async ue=>await to.delete({url:`/api/dev/${ue}/lock`}),fetchSystemDebugInfo:async()=>await to.get({url:"/api/debug/diagnostics"}),syncApp:async ue=>await to.post({url:`/api/applications/${ue}/sync`}),getApps:async()=>await to.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async ue=>await to.get({url:`/api/${ue}/components/definitions`}),addSampleData:async ue=>await to.post({url:`/api/applications/${ue}/sample`}),setRevertableVersion:async(ue,eo)=>await to.post({url:`/api/applications/${ue}/setRevertableVersion`,body:{revertableVersion:eo}})}),buildAttachmentEndpoints=to=>{const ue={getSignedDatasourceURL:async(eo,no,ro)=>await to.post({url:`/api/attachments/${eo}/url`,body:{bucket:no,key:ro}})};return{...ue,uploadAttachment:async(eo,no)=>await to.post({url:`/api/attachments/${eo}/upload`,body:no,json:!1}),uploadBuilderAttachment:async eo=>await to.post({url:"/api/attachments/process",body:eo,json:!1}),externalUpload:async(eo,no,ro,oo)=>{const{signedUrl:io,publicUrl:ao}=await ue.getSignedDatasourceURL(eo,no,ro);return io?(await to.put({url:io,body:oo,json:!1,external:!0,parseResponse:so=>so}),{publicUrl:ao}):{publicUrl:void 0}},downloadAttachment:async(eo,no,ro)=>await to.get({url:`/api/${eo}/rows/${no}/attachment/${ro}`,parseResponse:oo=>oo,suppressErrors:!0})}},buildAuthEndpoints=to=>({logIn:async(ue,eo,no)=>await to.post({url:`/api/global/auth/${ue}/login`,body:{username:eo,password:no}}),logOut:async()=>await to.post({url:"/api/global/auth/logout"}),setInitInfo:async ue=>await to.post({url:"/api/global/auth/init",body:ue}),getInitInfo:async()=>await to.get({url:"/api/global/auth/init"}),requestForgotPassword:async(ue,eo)=>await to.post({url:`/api/global/auth/${ue}/reset`,body:{email:eo}}),resetPassword:async(ue,eo,no)=>await to.post({url:`/api/global/auth/${ue}/reset/update`,body:{password:eo,resetCode:no}})}),buildAutomationEndpoints=to=>({triggerAutomation:async(ue,eo,no)=>await to.post({url:`/api/automations/${ue}/trigger`,body:{fields:eo,timeout:no}}),testAutomation:async(ue,eo)=>await to.post({url:`/api/automations/${ue}/test`,body:eo}),getAutomations:async()=>await to.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await to.get({url:"/api/automations/definitions/list"}),createAutomation:async ue=>await to.post({url:"/api/automations",body:ue}),updateAutomation:async ue=>await to.put({url:"/api/automations",body:ue}),deleteAutomation:async(ue,eo)=>await to.delete({url:`/api/automations/${ue}/${eo}`}),getAutomationLogs:async ue=>await to.post({url:"/api/automations/logs/search",body:ue}),clearAutomationLogErrors:async(ue,eo)=>await to.delete({url:"/api/automations/logs",body:{appId:eo,automationId:ue}})}),buildConfigEndpoints=to=>({saveConfig:async ue=>await to.post({url:"/api/global/configs",body:ue}),getConfig:async ue=>await to.get({url:`/api/global/configs/${ue}`}),deleteConfig:async(ue,eo)=>await to.delete({url:`/api/global/configs/${ue}/${eo}`}),getTenantConfig:async ue=>await to.get({url:`/api/global/configs/public?tenantId=${ue}`}),getOIDCConfigs:async ue=>await to.get({url:`/api/global/configs/public/oidc?tenantId=${ue}`}),getChecklist:async ue=>await to.get({url:`/api/global/configs/checklist?tenantId=${ue}`}),uploadLogo:async ue=>await to.post({url:"/api/global/configs/upload/settings/logoUrl",body:ue,json:!1}),uploadFavicon:async ue=>await to.post({url:"/api/global/configs/upload/settings/faviconUrl",body:ue,json:!1}),uploadOIDCLogo:async(ue,eo)=>await to.post({url:`/api/global/configs/upload/logos_oidc/${ue}`,body:eo,json:!1}),getOIDCLogos:async()=>await to.get({url:"/api/global/configs/logos_oidc"})}),buildDatasourceEndpoints=to=>({getDatasources:async()=>await to.get({url:"/api/datasources"}),buildDatasourceSchema:async(ue,eo)=>await to.post({url:`/api/datasources/${ue}/schema`,body:{tablesFilter:eo}}),createDatasource:async ue=>await to.post({url:"/api/datasources",body:ue}),updateDatasource:async ue=>await to.put({url:`/api/datasources/${ue._id}`,body:ue}),deleteDatasource:async(ue,eo)=>await to.delete({url:`/api/datasources/${ue}/${eo}`}),validateDatasource:async ue=>await to.post({url:"/api/datasources/verify",body:{datasource:ue}}),fetchInfoForDatasource:async ue=>await to.post({url:"/api/datasources/info",body:{datasource:ue}}),fetchExternalSchema:async ue=>await to.get({url:`/api/datasources/${ue}/schema/external`})}),buildFlagEndpoints=to=>({getFlags:async()=>await to.get({url:"/api/users/flags"}),updateFlag:async(ue,eo)=>await to.post({url:"/api/users/flags",body:{flag:ue,value:eo}}),toggleUiFeature:async ue=>await to.post({url:`/api/beta/${ue}`})}),buildLayoutEndpoints=to=>({saveLayout:async ue=>await to.post({url:"/api/layouts",body:ue}),deleteLayout:async(ue,eo)=>await to.delete({url:`/api/layouts/${ue}/${eo}`})}),buildOtherEndpoints=to=>({getEnvironment:async()=>await to.get({url:"/api/system/environment"}),getSystemStatus:async()=>await to.get({url:"/api/system/status"}),getIntegrations:async()=>await to.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await to.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await to.get({url:"/api/permission/builtin"})}),buildPermissionsEndpoints=to=>({getPermissionForResource:async ue=>await to.get({url:`/api/permission/${ue}`}),updatePermissionForResource:async(ue,eo,no)=>await to.post({url:`/api/permission/${eo}/${ue}/${no}`}),removePermissionFromResource:async(ue,eo,no)=>await to.delete({url:`/api/permission/${eo}/${ue}/${no}`}),getDependants:async ue=>await to.get({url:`/api/permission/${ue}/dependants`})}),buildQueryEndpoints=to=>({executeQuery:async(ue,{pagination:eo,parameters:no}={})=>await to.post({url:`/api/v2/queries/${ue}`,body:{parameters:no,pagination:eo}}),fetchQueryDefinition:async ue=>await to.get({url:`/api/queries/${ue}`,cache:!0}),getQueries:async()=>await to.get({url:"/api/queries"}),saveQuery:async ue=>await to.post({url:"/api/queries",body:ue}),deleteQuery:async(ue,eo)=>await to.delete({url:`/api/queries/${ue}/${eo}`}),importQueries:async ue=>await to.post({url:"/api/queries/import",body:ue}),previewQuery:async ue=>await to.post({url:"/api/queries/preview",body:ue})}),buildRelationshipEndpoints=to=>({fetchRelationshipData:async(ue,eo,no)=>{const ro=await to.get({url:`/api/${ue}/${eo}/enrich?field=${no}`});return no?ro[no]||[]:[ro]}}),buildRoleEndpoints=to=>({deleteRole:async(ue,eo)=>await to.delete({url:`/api/roles/${ue}/${eo}`}),saveRole:async ue=>await to.post({url:"/api/roles",body:ue}),getRoles:async()=>await to.get({url:"/api/roles"}),getRolesForApp:async ue=>await to.get({url:`/api/global/roles/${ue}`}),getAccessibleRoles:async()=>await to.get({url:"/api/roles/accessible"})}),buildRouteEndpoints=to=>({fetchClientAppRoutes:async()=>await to.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await to.get({url:"/api/routing"})}),buildRowEndpoints=to=>({fetchRow:async(ue,eo)=>await to.get({url:`/api/${ue}/rows/${eo}`}),saveRow:async(ue,eo=!1)=>{const no=ue._viewId||ue.tableId;return await to.post({url:`/api/${no}/rows`,body:ue,suppressErrors:eo})},patchRow:async(ue,eo=!1)=>{const no=ue._viewId||ue.tableId;return await to.patch({url:`/api/${no}/rows`,body:ue,suppressErrors:eo})},deleteRow:async(ue,eo)=>await to.delete({url:`/api/${ue}/rows`,body:{_id:eo}}),deleteRows:async(ue,eo)=>(eo.forEach(no=>{typeof no=="object"&&(no==null||delete no._viewId)}),await to.delete({url:`/api/${ue}/rows`,body:{rows:eo}})),exportRows:async(ue,eo,no)=>await to.post({url:`/api/${ue}/rows/exportRows?format=${eo}`,body:no,parseResponse:async ro=>await ro.text()})}),buildScreenEndpoints=to=>({saveScreen:async ue=>await to.post({url:"/api/screens",body:ue}),deleteScreen:async(ue,eo)=>await to.delete({url:`/api/screens/${ue}/${eo}`})}),buildTableEndpoints=to=>({fetchTableDefinition:async ue=>await to.get({url:`/api/tables/${ue}`,cache:!0}),fetchTableData:async ue=>await to.get({url:`/api/${ue}/rows`}),searchTable:async(ue,eo)=>await to.post({url:`/api/${ue}/search`,body:eo}),importTableData:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/import`,body:{rows:eo,identifierFields:no}}),csvToJson:async ue=>await to.post({url:"/api/convert/csvToJson",body:{csvString:ue}}),getTables:async()=>await to.get({url:"/api/tables"}),getTable:async ue=>await to.get({url:`/api/tables/${ue}`}),saveTable:async ue=>await to.post({url:"/api/tables",body:ue}),deleteTable:async(ue,eo)=>await to.delete({url:`/api/tables/${ue}/${eo}`}),validateNewTableImport:async(ue,eo)=>await to.post({url:"/api/tables/validateNewTableImport",body:{rows:ue,schema:eo}}),validateExistingTableImport:async(ue,eo)=>await to.post({url:"/api/tables/validateExistingTableImport",body:{rows:ue,tableId:eo}}),migrateColumn:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/migrate`,body:{oldColumn:eo,newColumn:no}})}),buildTemplateEndpoints=to=>({getEmailTemplateDefinitions:async()=>await to.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await to.get({url:"/api/global/template/email"}),saveEmailTemplate:async ue=>await to.post({url:"/api/global/template",body:ue}),getAppTemplates:async()=>await to.get({url:"/api/templates"})}),buildUserEndpoints=to=>({getUsers:async()=>await to.get({url:"/api/global/users"}),searchUsers:async ue=>await to.post({url:"/api/global/users/search",body:ue}),getUser:async ue=>await to.get({url:`/api/global/users/${ue}`}),updateOwnMetadata:async ue=>await to.post({url:"/api/users/metadata/self",body:ue}),createAdminUser:async ue=>await to.post({url:"/api/global/users/init",body:ue}),saveUser:async ue=>await to.post({url:"/api/global/users",body:ue}),createUsers:async(ue,eo)=>(await to.post({url:"/api/global/users/bulk",body:{create:{users:ue,groups:eo}}})).created,deleteUser:async ue=>await to.delete({url:`/api/global/users/${ue}`}),deleteUsers:async ue=>(await to.post({url:"/api/global/users/bulk",body:{delete:{users:ue}}})).deleted,onboardUsers:async ue=>await to.post({url:"/api/global/users/onboard",body:ue}),updateUserInvite:async(ue,eo)=>await to.post({url:`/api/global/users/invite/update/${ue}`,body:eo}),getUserInvite:async ue=>await to.get({url:`/api/global/users/invite/${ue}`}),getUserInvites:async()=>await to.get({url:"/api/global/users/invites"}),inviteUsers:async ue=>await to.post({url:"/api/global/users/multi/invite",body:ue}),removeUserInvites:async ue=>await to.post({url:"/api/global/users/multi/invite/delete",body:ue}),acceptInvite:async ue=>await to.post({url:"/api/global/users/invite/accept",body:ue}),getUserCountByApp:async ue=>(await to.get({url:`/api/global/users/count/${ue}`})).userCount,addAppBuilder:async(ue,eo)=>await to.post({url:`/api/global/users/${ue}/app/${eo}/builder`}),removeAppBuilder:async(ue,eo)=>await to.delete({url:`/api/global/users/${ue}/app/${eo}/builder`}),getAccountHolder:async()=>await to.get({url:"/api/global/users/accountholder"})}),buildSelfEndpoints=to=>({generateAPIKey:async()=>{const ue=await to.post({url:"/api/global/self/api_key"});return ue==null?void 0:ue.apiKey},fetchDeveloperInfo:async()=>to.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await to.get({url:"/api/self"}),fetchBuilderSelf:async()=>await to.get({url:"/api/global/self"}),updateSelf:async ue=>await to.post({url:"/api/global/self",body:ue})}),buildViewEndpoints=to=>({fetchViewData:async(ue,{field:eo,groupBy:no,calculation:ro})=>{const oo=new URLSearchParams;ro&&(eo&&oo.set("field",eo),oo.set("calculation",ro)),no&&oo.set("group",no);const io=eo?`/api/views/${encodeURIComponent(ue)}?${oo}`:`/api/views/${encodeURIComponent(ue)}`;return await to.get({url:io})},exportView:async(ue,eo)=>{const no=encodeURIComponent(ue);return await to.get({url:`/api/views/export?view=${no}&format=${eo}`,parseResponse:async ro=>await ro.text()})},saveView:async ue=>await to.post({url:"/api/views",body:ue}),deleteView:async ue=>await to.delete({url:`/api/views/${encodeURIComponent(ue)}`})}),buildViewV2Endpoints=to=>({fetchDefinition:async ue=>await to.get({url:`/api/v2/views/${encodeURIComponent(ue)}`,cache:!0}),create:async ue=>await to.post({url:"/api/v2/views",body:ue}),update:async ue=>await to.put({url:`/api/v2/views/${encodeURIComponent(ue.id)}`,body:ue}),fetch:async(ue,eo)=>await to.post({url:`/api/v2/views/${encodeURIComponent(ue)}/search`,body:eo}),delete:async ue=>await to.delete({url:`/api/v2/views/${encodeURIComponent(ue)}`})}),buildLicensingEndpoints=to=>({activateLicenseKey:async ue=>to.post({url:"/api/global/license/key",body:{licenseKey:ue}}),deleteLicenseKey:async()=>to.delete({url:"/api/global/license/key"}),getLicenseKey:async()=>{try{return await to.get({url:"/api/global/license/key"})}catch(ue){if(ue.status!==404)throw ue}},activateOfflineLicense:async ue=>to.post({url:"/api/global/license/offline",body:{offlineLicenseToken:ue}}),deleteOfflineLicense:async()=>to.delete({url:"/api/global/license/offline"}),getOfflineLicense:async()=>{try{return await to.get({url:"/api/global/license/offline"})}catch(ue){if(ue.status!==404)throw ue}},getOfflineLicenseIdentifier:async()=>await to.get({url:"/api/global/license/offline/identifier"}),refreshLicense:async()=>to.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>to.get({url:"/api/global/license/usage"})}),buildGroupsEndpoints=to=>{async function ue(eo,no,ro,oo){return await to.post({url:`/api/global/groups/${eo}/${no}`,body:{[ro]:oo}})}return{saveGroup:async eo=>await to.post({url:"/api/global/groups",body:eo}),getGroups:async()=>(await to.get({url:"/api/global/groups"})).data,getGroup:async eo=>await to.get({url:`/api/global/groups/${eo}`}),deleteGroup:async(eo,no)=>await to.delete({url:`/api/global/groups/${eo}/${no}`}),getGroupUsers:async({id:eo,bookmark:no,emailSearch:ro})=>{let oo=`/api/global/groups/${eo}/users?`;return no&&(oo+=`bookmark=${no}&`),ro&&(oo+=`emailSearch=${ro}`),await to.get({url:oo})},addUsersToGroup:async(eo,no)=>ue(eo,"users","add",no),removeUsersFromGroup:async(eo,no)=>ue(eo,"users","remove",no),addAppsToGroup:async(eo,no)=>ue(eo,"apps","add",no),removeAppsFromGroup:async(eo,no)=>ue(eo,"apps","remove",no),addGroupAppBuilder:async(eo,no)=>await to.post({url:`/api/global/groups/${eo}/app/${no}/builder`}),removeGroupAppBuilder:async(eo,no)=>await to.delete({url:`/api/global/groups/${eo}/app/${no}/builder`})}},buildPluginEndpoints=to=>({uploadPlugin:async ue=>await to.post({url:"/api/plugin/upload",body:ue,json:!1}),createPlugin:async ue=>await to.post({url:"/api/plugin",body:ue}),getPlugins:async()=>await to.get({url:"/api/plugin"}),deletePlugin:async ue=>await to.delete({url:`/api/plugin/${ue}`})}),buildBackupEndpoints=to=>({createManualBackup:async ue=>await to.post({url:`/api/apps/${ue}/backups`}),searchBackups:async(ue,eo)=>await to.post({url:`/api/apps/${ue}/backups/search`,body:eo}),deleteBackup:async(ue,eo)=>await to.delete({url:`/api/apps/${ue}/backups/${eo}`}),restoreBackup:async(ue,eo,no)=>await to.post({url:`/api/apps/${ue}/backups/${eo}/import`,body:{name:no}})}),buildEnvironmentVariableEndpoints=to=>({checkEnvironmentVariableStatus:async()=>await to.get({url:"/api/env/variables/status"}),fetchEnvironmentVariables:async()=>await to.get({url:"/api/env/variables",json:!1}),createEnvironmentVariable:async ue=>await to.post({url:"/api/env/variables",body:ue}),deleteEnvironmentVariable:async ue=>await to.delete({url:`/api/env/variables/${ue}`}),updateEnvironmentVariable:async(ue,eo)=>await to.patch({url:`/api/env/variables/${ue}`,body:eo})}),buildEventEndpoints=to=>({publishEvent:async ue=>await to.post({url:"/api/global/event/publish",body:{type:ue}})}),buildAuditLogEndpoints=to=>({searchAuditLogs:async ue=>await to.post({url:"/api/global/auditlogs/search",body:ue}),getEventDefinitions:async()=>await to.get({url:"/api/global/auditlogs/definitions"}),getDownloadUrl:ue=>`/api/global/auditlogs/download?query=${encodeURIComponent(JSON.stringify(ue))}`}),buildLogsEndpoints=to=>({getSystemLogs:async()=>await to.get({url:"/api/system/logs",json:!1,parseResponse:async ue=>ue})}),buildMigrationEndpoints=to=>({getMigrationStatus:async()=>await to.get({url:"/api/migrations/status"})}),buildRowActionEndpoints=to=>({fetch:async ue=>(await to.get({url:`/api/tables/${ue}/actions`})).actions,create:async(ue,eo)=>await to.post({url:`/api/tables/${ue}/actions`,body:{name:eo}}),delete:async(ue,eo)=>await to.delete({url:`/api/tables/${ue}/actions/${eo}`}),enableView:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/actions/${eo}/permissions/${no}`}),disableView:async(ue,eo,no)=>await to.delete({url:`/api/tables/${ue}/actions/${eo}/permissions/${no}`}),trigger:async(ue,eo,no)=>await to.post({url:`/api/tables/${ue}/actions/${eo}/trigger`,body:{rowId:no}})}),APISessionID=uuid$2(),createAPIClient=(to={})=>{let ue={};const eo=async(lo,co,uo=!1)=>{let fo=lo.statusText,po=null;try{po=await lo.json(),po!=null&&po.message?fo=po.message:po!=null&&po.error&&(fo=JSON.stringify(po.error))}catch{}return{message:fo,json:po,status:lo.status,url:lo.url,method:co,handled:!0,suppressErrors:uo}},no=(lo,co,uo)=>({message:lo,json:null,status:400,url:co,method:uo,handled:!0,suppressErrors:!1}),ro=async lo=>{let{json:co,method:uo,external:fo,body:po,url:ho,parseResponse:_o,suppressErrors:go}=lo;co=co&&uo!==HTTPMethod.GET;let bo={Accept:"application/json"};bo[Header$1.SESSION_ID]=APISessionID,fo||(bo[Header$1.API_VER]=ApiVersion),co&&(bo["Content-Type"]="application/json"),to!=null&&to.attachHeaders&&to.attachHeaders(bo);let vo=po;if(co)try{vo=JSON.stringify(po)}catch{throw no("Invalid JSON body",ho,uo)}let yo;try{yo=await fetch(ho,{method:uo,headers:bo,body:vo,credentials:"same-origin"})}catch{throw delete ue[ho],no("Failed to send request",ho,uo)}if(yo.status>=200&&yo.status<400){oo(yo);try{return yo.status===204?void 0:_o?await _o(yo):await yo.json()}catch(wo){throw delete ue[ho],`Failed to parse response: ${wo}`}}else throw delete ue[ho],await eo(yo,uo,go)},oo=lo=>{if(!to.onMigrationDetected)return;const co=lo.headers.get(Header$1.MIGRATING_APP);co&&to.onMigrationDetected(co)},io=async lo=>{const co=lo.url;return ue[co]||(ue[co]=ro(lo),ue[co]=await ue[co]),await ue[co]},ao=lo=>async co=>{try{let uo={json:!0,external:!1,suppressErrors:!1,cache:!1,method:lo,...co},{url:fo,cache:po,external:ho}=uo;return ho||(uo.url=`/${fo}`.replace("//","/")),await(po&&(to==null?void 0:to.enableCaching)?io:ro)(uo)}catch(uo){throw to!=null&&to.onError&&to.onError(uo),uo}};let so={post:ao(HTTPMethod.POST),get:ao(HTTPMethod.GET),patch:ao(HTTPMethod.PATCH),delete:ao(HTTPMethod.DELETE),put:ao(HTTPMethod.PUT),invalidateCache:()=>{ue={}},getAppID:()=>{var co;let lo={};return(co=to==null?void 0:to.attachHeaders)==null||co.call(to,lo),lo==null?void 0:lo[Header$1.APP_ID]}};return{...so,...buildAIEndpoints(so),...buildAnalyticsEndpoints(so),...buildAppEndpoints(so),...buildAttachmentEndpoints(so),...buildAuthEndpoints(so),...buildAutomationEndpoints(so),...buildConfigEndpoints(so),...buildDatasourceEndpoints(so),...buildFlagEndpoints(so),...buildLayoutEndpoints(so),...buildOtherEndpoints(so),...buildPermissionsEndpoints(so),...buildQueryEndpoints(so),...buildRelationshipEndpoints(so),...buildRoleEndpoints(so),...buildRouteEndpoints(so),...buildRowEndpoints(so),...buildScreenEndpoints(so),...buildTableEndpoints(so),...buildTemplateEndpoints(so),...buildUserEndpoints(so),...buildViewEndpoints(so),...buildSelfEndpoints(so),...buildLicensingEndpoints(so),...buildGroupsEndpoints(so),...buildPluginEndpoints(so),...buildBackupEndpoints(so),...buildEnvironmentVariableEndpoints(so),...buildEventEndpoints(so),...buildAuditLogEndpoints(so),...buildLogsEndpoints(so),...buildMigrationEndpoints(so),viewV2:buildViewV2Endpoints(so),rowActions:buildRowActionEndpoints(so)}},getJSONArrayDatasourceSchema=(to,ue)=>{let eo=to,no=[];ue.prefixKeys&&(no=ue.prefixKeys.concat(["schema"])),no=no.concat(ue.label.split(".").slice(2));for(let ro=0;ro<no.length;ro++)eo=eo==null?void 0:eo[no[ro]],eo!=null&&eo.schema&&(eo=eo.schema);return convertJSONSchemaToTableSchema(eo,{squashObjects:!0,prefixKeys:no})},convertJSONSchemaToTableSchema=(to,ue)=>{if(!to)return null;ue={squashObjects:!1,prefixKeys:null,...ue},to.schema?to=to.schema:to={value:to};const eo=extractJSONSchemaKeys(to,ue.squashObjects);let no={};return eo.forEach(({key:ro,type:oo})=>{no[ro]={type:oo,name:ro,prefixKeys:ue.prefixKeys}}),no},extractJSONSchemaKeys=(to,ue=!1)=>{if(!to||!Object.keys(to).length)return[];let eo=[];return Object.keys(to).forEach(no=>{const ro=to[no].type;if(ro==="json"&&ue){const oo=extractJSONSchemaKeys(to[no].schema,ue);eo=eo.concat(oo.map(io=>({key:`${no}.${io.key}`,type:io.type})))}else eo.push({key:no,type:ro==="array"?"jsonarray":ro})}),eo},generateQueryArraySchemas=(to,ue)=>{var eo,no;for(let ro in to)((eo=to[ro])==null?void 0:eo.type)==="json"&&((no=to[ro])==null?void 0:no.subtype)==="array"&&hasSchema(ue[ro])&&(to[ro]={schema:{schema:Object.entries(ue[ro]||{}).reduce((oo,[io,ao])=>(oo[io]={name:io,type:ao.type,subtype:ao.subtype},oo),{}),type:"json"},type:"json",subtype:"array"});return to};function setCookie(to,ue,eo){getCookie(to)&&removeCookie(to);let no=`${to}=${ue}; Path=/;`;eo&&(no+=` Domain=${eo};`),window.document.cookie=no}function getCookie(to){const eo=`; ${document.cookie}`.split(`; ${to}=`);if(eo.length===2)return eo[1].split(";").shift()}function removeCookie(to){getCookie(to)&&(document.cookie=`${to}=; Max-Age=-99999999; Path=/;`)}const RolePriorities={[Roles$2.ADMIN]:5,[Roles$2.CREATOR]:4,[Roles$2.POWER]:3,[Roles$2.BASIC]:2,[Roles$2.PUBLIC]:1},getRolePriority=to=>RolePriorities[to]??0,sleep$2=to=>new Promise(ue=>setTimeout(ue,to)),sequential=to=>{let ue=[];return(...no)=>new Promise((ro,oo)=>{ue.push(async()=>{let io,ao;try{io=await to(...no)}catch(so){ao=so}ue.shift(),ue.length&&ue[0](),ao?oo(ao):ro(io)}),ue.length===1&&ue[0]()})},debounce=(to,ue=1e3)=>{let eo;return async(...no)=>new Promise(ro=>{eo&&clearTimeout(eo),eo=setTimeout(async()=>{ro(await to(...no))},ue)})},domDebounce=to=>{let ue=!1,eo;return(...no)=>{eo=no,ue||(ue=!0,requestAnimationFrame(()=>{to(...eo),ue=!1}))}},buildFormBlockButtonConfig=to=>{const{_id:ue,actionType:eo,dataSource:no,notificationOverride:ro,actionUrl:oo,showDeleteButton:io,deleteButtonLabel:ao,showSaveButton:so,saveButtonLabel:lo}=to||{};if(!ue)return;const co=`${ue}-form`,uo=`${ue}-repeater`,fo=no==null?void 0:no.resourceId,po=io===!1?"":ao==null?void 0:ao.trim(),ho=so===!1?"":lo==null?void 0:lo.trim(),_o=[{"##eventHandlerType":"Validate Form",parameters:{componentId:co}},{"##eventHandlerType":"Save Row",parameters:{providerId:co,tableId:fo,notificationOverride:ro,confirm:null}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...eo!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:co}}],...oo?[{"##eventHandlerType":"Navigate To",parameters:{url:oo}}]:[]],go=[{"##eventHandlerType":"Delete Row",parameters:{confirm:!0,tableId:fo,rowId:`{{ ${makePropSafe(uo)}.${makePropSafe("_id")} }}`,revId:`{{ ${makePropSafe(uo)}.${makePropSafe("_rev")} }}`,notificationOverride:ro}},{"##eventHandlerType":"Close Screen Modal"},{"##eventHandlerType":"Close Side Panel"},{"##eventHandlerType":"Close Modal"},...oo?[{"##eventHandlerType":"Navigate To",parameters:{url:oo}}]:[]],bo=[];return eo&&["Update","Create"].includes(eo)&&so!==!1&&bo.push({text:ho||"Save",_id:uuid$2(),_component:"@budibase/standard-components/button",onClick:_o,type:"cta"}),eo==="Update"&&io!==!1&&bo.push({text:po||"Delete",_id:uuid$2(),_component:"@budibase/standard-components/button",onClick:go,quiet:!0,type:"warning"}),bo},buildMultiStepFormBlockDefaultProps=to=>{const{_id:ue,stepCount:eo,currentStep:no,actionType:ro,dataSource:oo}=to||{};if(!ue||!eo)return;const io=`Step {{ [${ue}-form].[__currentStep] }}`,ao=oo==null?void 0:oo.resourceId,so=`${ue}-form`;let lo=[];return no!==0&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Back",type:"secondary",size:"M",onClick:[{parameters:{type:"prev",componentId:so},"##eventHandlerType":"Change Form Step"}]}),no!==eo-1&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Next",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:so}},{parameters:{type:"next",componentId:so},"##eventHandlerType":"Change Form Step"}]}),ro!=="View"&&no===eo-1&&lo.push({_id:uuid$2(),_component:"@budibase/standard-components/button",_instanceName:uuid$2(),text:"Save",type:"cta",size:"M",onClick:[{"##eventHandlerType":"Validate Form",parameters:{componentId:so}},{"##eventHandlerType":"Save Row",parameters:{tableId:ao,providerId:so}},...ro!=="Create"?[]:[{"##eventHandlerType":"Clear Form",parameters:{componentId:so}}]]}),{buttons:lo,title:io}};function parseFilter(to){var eo;if(!(to!=null&&to.groups))return to;const ue=lodashExports.cloneDeep(to);return ue.groups=(eo=ue.groups)==null?void 0:eo.map(no=>{var ro,oo;return no.filters=(ro=no.filters)==null?void 0:ro.filter(io=>io.field&&io.operator),(oo=no.filters)!=null&&oo.length?no:null}).filter(no=>!!no),ue}const isBetterSample=(to,ue)=>{if(ue==null&&to!=null)return!0;if(ue!=null&&to==null)return!1;const eo=typeof ue,no=typeof to;return eo!==no?!1:no==="string"&&to.length>ue.length||no==="object"&&Object.keys(to).length>Object.keys(ue).length},generateGoldenSample=to=>{let ue={};return to==null||to.slice(0,100).forEach(eo=>{Object.keys(eo).forEach(no=>{isBetterSample(eo[no],ue[no])&&(ue[no]=eo[no])})}),ue};function getTableFields(to,ue){const eo=to.find(ro=>ro._id===ue.tableId);return!eo||!eo.sql?[]:getFields(to,Object.values(eo.schema),{allowLinks:!1}).map(ro=>({...ro,name:`${ue.name}.${ro.name}`}))}function getFields(to,ue,{allowLinks:eo}={allowLinks:!0}){let no=ue.filter(oo=>!BannedSearchTypes.includes(oo.type));if(eo){const oo=ue.filter(io=>io.type==="link");for(let io of oo)no=no.concat(getTableFields(to,io))}const ro=ue.filter(oo=>oo.type==="formula"&&oo.formulaType==="static");return no.concat(ro)}const getColumnIcon=to=>{if(to.schema.icon)return to.schema.icon;if(to.calculationType)return"Calculator";if(to.schema.autocolumn)return"MagicWand";if(isDeprecatedSingleUserColumn(to.schema))return"User";const{type:ue,subtype:eo}=to.schema;return(typeof TypeIconMap$1[ue]=="object"&&eo?TypeIconMap$1[ue][eo]:TypeIconMap$1[ue])||"Text"},memo=to=>{const ue=writable(to);let eo=JSON.stringify(to);const no=ro=>{const oo=JSON.stringify(ro);oo!==eo&&(ue.set(ro),eo=oo)};return{subscribe:ue.subscribe,set:no,update:ro=>{let oo=JSON.parse(eo);const io=ro(oo);no(io)}}},derivedMemo=(to,ue)=>{const eo=derived(to,ue),no=memo(get_store_value(eo));return eo.subscribe(no.set),no},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(to=>{PACKET_TYPES_REVERSE[PACKET_TYPES[to]]=to});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=to=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(to):to&&to.buffer instanceof ArrayBuffer,encodePacket=({type:to,data:ue},eo,no)=>withNativeBlob$1&&ue instanceof Blob?eo?no(ue):encodeBlobAsBase64(ue,no):withNativeArrayBuffer$2&&(ue instanceof ArrayBuffer||isView$1(ue))?eo?no(ue):encodeBlobAsBase64(new Blob([ue]),no):no(PACKET_TYPES[to]+(ue||"")),encodeBlobAsBase64=(to,ue)=>{const eo=new FileReader;return eo.onload=function(){const no=eo.result.split(",")[1];ue("b"+(no||""))},eo.readAsDataURL(to)};function toArray$2(to){return to instanceof Uint8Array?to:to instanceof ArrayBuffer?new Uint8Array(to):new Uint8Array(to.buffer,to.byteOffset,to.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(to,ue){if(withNativeBlob$1&&to.data instanceof Blob)return to.data.arrayBuffer().then(toArray$2).then(ue);if(withNativeArrayBuffer$2&&(to.data instanceof ArrayBuffer||isView$1(to.data)))return ue(toArray$2(to.data));encodePacket(to,!1,eo=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),ue(TEXT_ENCODER.encode(eo))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let to=0;to<chars.length;to++)lookup$1[chars.charCodeAt(to)]=to;const decode$3=to=>{let ue=to.length*.75,eo=to.length,no,ro=0,oo,io,ao,so;to[to.length-1]==="="&&(ue--,to[to.length-2]==="="&&ue--);const lo=new ArrayBuffer(ue),co=new Uint8Array(lo);for(no=0;no<eo;no+=4)oo=lookup$1[to.charCodeAt(no)],io=lookup$1[to.charCodeAt(no+1)],ao=lookup$1[to.charCodeAt(no+2)],so=lookup$1[to.charCodeAt(no+3)],co[ro++]=oo<<2|io>>4,co[ro++]=(io&15)<<4|ao>>2,co[ro++]=(ao&3)<<6|so&63;return lo},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(to,ue)=>{if(typeof to!="string")return{type:"message",data:mapBinary(to,ue)};const eo=to.charAt(0);return eo==="b"?{type:"message",data:decodeBase64Packet(to.substring(1),ue)}:PACKET_TYPES_REVERSE[eo]?to.length>1?{type:PACKET_TYPES_REVERSE[eo],data:to.substring(1)}:{type:PACKET_TYPES_REVERSE[eo]}:ERROR_PACKET},decodeBase64Packet=(to,ue)=>{if(withNativeArrayBuffer$1){const eo=decode$3(to);return mapBinary(eo,ue)}else return{base64:!0,data:to}},mapBinary=(to,ue)=>{switch(ue){case"blob":return to instanceof Blob?to:new Blob([to]);case"arraybuffer":default:return to instanceof ArrayBuffer?to:to.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(to,ue)=>{const eo=to.length,no=new Array(eo);let ro=0;to.forEach((oo,io)=>{encodePacket(oo,!1,ao=>{no[io]=ao,++ro===eo&&ue(no.join(SEPARATOR))})})},decodePayload=(to,ue)=>{const eo=to.split(SEPARATOR),no=[];for(let ro=0;ro<eo.length;ro++){const oo=decodePacket(eo[ro],ue);if(no.push(oo),oo.type==="error")break}return no};function createPacketEncoderStream(){return new TransformStream({transform(to,ue){encodePacketToBinary(to,eo=>{const no=eo.length;let ro;if(no<126)ro=new Uint8Array(1),new DataView(ro.buffer).setUint8(0,no);else if(no<65536){ro=new Uint8Array(3);const oo=new DataView(ro.buffer);oo.setUint8(0,126),oo.setUint16(1,no)}else{ro=new Uint8Array(9);const oo=new DataView(ro.buffer);oo.setUint8(0,127),oo.setBigUint64(1,BigInt(no))}to.data&&typeof to.data!="string"&&(ro[0]|=128),ue.enqueue(ro),ue.enqueue(eo)})}})}let TEXT_DECODER;function totalLength(to){return to.reduce((ue,eo)=>ue+eo.length,0)}function concatChunks(to,ue){if(to[0].length===ue)return to.shift();const eo=new Uint8Array(ue);let no=0;for(let ro=0;ro<ue;ro++)eo[ro]=to[0][no++],no===to[0].length&&(to.shift(),no=0);return to.length&&no<to[0].length&&(to[0]=to[0].slice(no)),eo}function createPacketDecoderStream(to,ue){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const eo=[];let no=0,ro=-1,oo=!1;return new TransformStream({transform(io,ao){for(eo.push(io);;){if(no===0){if(totalLength(eo)<1)break;const so=concatChunks(eo,1);oo=(so[0]&128)===128,ro=so[0]&127,ro<126?no=3:ro===126?no=1:no=2}else if(no===1){if(totalLength(eo)<2)break;const so=concatChunks(eo,2);ro=new DataView(so.buffer,so.byteOffset,so.length).getUint16(0),no=3}else if(no===2){if(totalLength(eo)<8)break;const so=concatChunks(eo,8),lo=new DataView(so.buffer,so.byteOffset,so.length),co=lo.getUint32(0);if(co>Math.pow(2,53-32)-1){ao.enqueue(ERROR_PACKET);break}ro=co*Math.pow(2,32)+lo.getUint32(4),no=3}else{if(totalLength(eo)<ro)break;const so=concatChunks(eo,ro);ao.enqueue(decodePacket(oo?so:TEXT_DECODER.decode(so),ue)),no=0}if(ro===0||ro>to){ao.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(to){if(to)return mixin(to)}function mixin(to){for(var ue in Emitter.prototype)to[ue]=Emitter.prototype[ue];return to}Emitter.prototype.on=Emitter.prototype.addEventListener=function(to,ue){return this._callbacks=this._callbacks||{},(this._callbacks["$"+to]=this._callbacks["$"+to]||[]).push(ue),this};Emitter.prototype.once=function(to,ue){function eo(){this.off(to,eo),ue.apply(this,arguments)}return eo.fn=ue,this.on(to,eo),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(to,ue){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var eo=this._callbacks["$"+to];if(!eo)return this;if(arguments.length==1)return delete this._callbacks["$"+to],this;for(var no,ro=0;ro<eo.length;ro++)if(no=eo[ro],no===ue||no.fn===ue){eo.splice(ro,1);break}return eo.length===0&&delete this._callbacks["$"+to],this};Emitter.prototype.emit=function(to){this._callbacks=this._callbacks||{};for(var ue=new Array(arguments.length-1),eo=this._callbacks["$"+to],no=1;no<arguments.length;no++)ue[no-1]=arguments[no];if(eo){eo=eo.slice(0);for(var no=0,ro=eo.length;no<ro;++no)eo[no].apply(this,ue)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(to){return this._callbacks=this._callbacks||{},this._callbacks["$"+to]||[]};Emitter.prototype.hasListeners=function(to){return!!this.listeners(to).length};const globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick$1(to,...ue){return ue.reduce((eo,no)=>(to.hasOwnProperty(no)&&(eo[no]=to[no]),eo),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(to,ue){ue.useNativeTimers?(to.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),to.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(to.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),to.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(to){return typeof to=="string"?utf8Length(to):Math.ceil((to.byteLength||to.size)*BASE64_OVERHEAD)}function utf8Length(to){let ue=0,eo=0;for(let no=0,ro=to.length;no<ro;no++)ue=to.charCodeAt(no),ue<128?eo+=1:ue<2048?eo+=2:ue<55296||ue>=57344?eo+=3:(no++,eo+=4);return eo}function encode$3(to){let ue="";for(let eo in to)to.hasOwnProperty(eo)&&(ue.length&&(ue+="&"),ue+=encodeURIComponent(eo)+"="+encodeURIComponent(to[eo]));return ue}function decode$2(to){let ue={},eo=to.split("&");for(let no=0,ro=eo.length;no<ro;no++){let oo=eo[no].split("=");ue[decodeURIComponent(oo[0])]=decodeURIComponent(oo[1])}return ue}class TransportError extends Error{constructor(ue,eo,no){super(ue),this.description=eo,this.context=no,this.type="TransportError"}}class Transport extends Emitter{constructor(ue){super(),this.writable=!1,installTimerFunctions(this,ue),this.opts=ue,this.query=ue.query,this.socket=ue.socket}onError(ue,eo,no){return super.emitReserved("error",new TransportError(ue,eo,no)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(ue){this.readyState==="open"&&this.write(ue)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(ue){const eo=decodePacket(ue,this.socket.binaryType);this.onPacket(eo)}onPacket(ue){super.emitReserved("packet",ue)}onClose(ue){this.readyState="closed",super.emitReserved("close",ue)}pause(ue){}createUri(ue,eo={}){return ue+"://"+this._hostname()+this._port()+this.opts.path+this._query(eo)}_hostname(){const ue=this.opts.hostname;return ue.indexOf(":")===-1?ue:"["+ue+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(ue){const eo=encode$3(ue);return eo.length?"?"+eo:""}}const alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={};let seed=0,i$2=0,prev;function encode$2(to){let ue="";do ue=alphabet[to%length]+ue,to=Math.floor(to/length);while(to>0);return ue}function yeast(){const to=encode$2(+new Date);return to!==prev?(seed=0,prev=to):to+"."+encode$2(seed++)}for(;i$2<length;i$2++)map[alphabet[i$2]]=i$2;let value$1=!1;try{value$1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(to){}const hasCORS=value$1;function XHR(to){const ue=to.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!ue||hasCORS))return new XMLHttpRequest}catch{}if(!ue)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function createCookieJar(){}function empty$1(){}const hasXHR2=function(){return new XHR({xdomain:!1}).responseType!=null}();class Polling extends Transport{constructor(ue){if(super(ue),this.polling=!1,typeof location<"u"){const no=location.protocol==="https:";let ro=location.port;ro||(ro=no?"443":"80"),this.xd=typeof location<"u"&&ue.hostname!==location.hostname||ro!==ue.port}const eo=ue&&ue.forceBase64;this.supportsBinary=hasXHR2&&!eo,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(ue){this.readyState="pausing";const eo=()=>{this.readyState="paused",ue()};if(this.polling||!this.writable){let no=0;this.polling&&(no++,this.once("pollComplete",function(){--no||eo()})),this.writable||(no++,this.once("drain",function(){--no||eo()}))}else eo()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(ue){const eo=no=>{if(this.readyState==="opening"&&no.type==="open"&&this.onOpen(),no.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(no)};decodePayload(ue,this.socket.binaryType).forEach(eo),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const ue=()=>{this.write([{type:"close"}])};this.readyState==="open"?ue():this.once("open",ue)}write(ue){this.writable=!1,encodePayload(ue,eo=>{this.doWrite(eo,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const ue=this.opts.secure?"https":"http",eo=this.query||{};return this.opts.timestampRequests!==!1&&(eo[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!eo.sid&&(eo.b64=1),this.createUri(ue,eo)}request(ue={}){return Object.assign(ue,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request(this.uri(),ue)}doWrite(ue,eo){const no=this.request({method:"POST",data:ue});no.on("success",eo),no.on("error",(ro,oo)=>{this.onError("xhr post error",ro,oo)})}doPoll(){const ue=this.request();ue.on("data",this.onData.bind(this)),ue.on("error",(eo,no)=>{this.onError("xhr poll error",eo,no)}),this.pollXhr=ue}}class Request extends Emitter{constructor(ue,eo){super(),installTimerFunctions(this,eo),this.opts=eo,this.method=eo.method||"GET",this.uri=ue,this.data=eo.data!==void 0?eo.data:null,this.create()}create(){var ue;const eo=pick$1(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");eo.xdomain=!!this.opts.xd;const no=this.xhr=new XHR(eo);try{no.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){no.setDisableHeaderCheck&&no.setDisableHeaderCheck(!0);for(let ro in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(ro)&&no.setRequestHeader(ro,this.opts.extraHeaders[ro])}}catch{}if(this.method==="POST")try{no.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{no.setRequestHeader("Accept","*/*")}catch{}(ue=this.opts.cookieJar)===null||ue===void 0||ue.addCookies(no),"withCredentials"in no&&(no.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(no.timeout=this.opts.requestTimeout),no.onreadystatechange=()=>{var ro;no.readyState===3&&((ro=this.opts.cookieJar)===null||ro===void 0||ro.parseCookies(no)),no.readyState===4&&(no.status===200||no.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof no.status=="number"?no.status:0)},0))},no.send(this.data)}catch(ro){this.setTimeoutFn(()=>{this.onError(ro)},0);return}typeof document<"u"&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)}onError(ue){this.emitReserved("error",ue,this.xhr),this.cleanup(!0)}cleanup(ue){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$1,ue)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this.index],this.xhr=null}}onLoad(){const ue=this.xhr.responseText;ue!==null&&(this.emitReserved("data",ue),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Request.requestsCount=0;Request.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const to="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(to,unloadHandler,!1)}}function unloadHandler(){for(let to in Request.requests)Request.requests.hasOwnProperty(to)&&Request.requests[to].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?ue=>Promise.resolve().then(ue):(ue,eo)=>eo(ue,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(ue){super(ue),this.supportsBinary=!ue.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const ue=this.uri(),eo=this.opts.protocols,no=isReactNative?{}:pick$1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(no.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?eo?new WebSocket(ue,eo):new WebSocket(ue):new WebSocket(ue,eo,no)}catch(ro){return this.emitReserved("error",ro)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=ue=>this.onClose({description:"websocket connection closed",context:ue}),this.ws.onmessage=ue=>this.onData(ue.data),this.ws.onerror=ue=>this.onError("websocket error",ue)}write(ue){this.writable=!1;for(let eo=0;eo<ue.length;eo++){const no=ue[eo],ro=eo===ue.length-1;encodePacket(no,this.supportsBinary,oo=>{const io={};try{usingBrowserWebSocket&&this.ws.send(oo)}catch{}ro&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const ue=this.opts.secure?"wss":"ws",eo=this.query||{};return this.opts.timestampRequests&&(eo[this.opts.timestampParam]=yeast()),this.supportsBinary||(eo.b64=1),this.createUri(ue,eo)}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(ue=>{this.onError("webtransport error",ue)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(ue=>{const eo=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),no=ue.readable.pipeThrough(eo).getReader(),ro=createPacketEncoderStream();ro.readable.pipeTo(ue.writable),this.writer=ro.writable.getWriter();const oo=()=>{no.read().then(({done:ao,value:so})=>{ao||(this.onPacket(so),oo())}).catch(ao=>{})};oo();const io={type:"open"};this.query.sid&&(io.data=`{"sid":"${this.query.sid}"}`),this.writer.write(io).then(()=>this.onOpen())})}))}write(ue){this.writable=!1;for(let eo=0;eo<ue.length;eo++){const no=ue[eo],ro=eo===ue.length-1;this.writer.write(no).then(()=>{ro&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var ue;(ue=this.transport)===null||ue===void 0||ue.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(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$8(to){if(to.length>2e3)throw"URI too long";const ue=to,eo=to.indexOf("["),no=to.indexOf("]");eo!=-1&&no!=-1&&(to=to.substring(0,eo)+to.substring(eo,no).replace(/:/g,";")+to.substring(no,to.length));let ro=re$1.exec(to||""),oo={},io=14;for(;io--;)oo[parts[io]]=ro[io]||"";return eo!=-1&&no!=-1&&(oo.source=ue,oo.host=oo.host.substring(1,oo.host.length-1).replace(/;/g,":"),oo.authority=oo.authority.replace("[","").replace("]","").replace(/;/g,":"),oo.ipv6uri=!0),oo.pathNames=pathNames(oo,oo.path),oo.queryKey=queryKey(oo,oo.query),oo}function pathNames(to,ue){const eo=/\/{2,9}/g,no=ue.replace(eo,"/").split("/");return(ue.slice(0,1)=="/"||ue.length===0)&&no.splice(0,1),ue.slice(-1)=="/"&&no.splice(no.length-1,1),no}function queryKey(to,ue){const eo={};return ue.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(no,ro,oo){ro&&(eo[ro]=oo)}),eo}let Socket$1=class ph extends Emitter{constructor(ue,eo={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],ue&&typeof ue=="object"&&(eo=ue,ue=null),ue?(ue=parse$8(ue),eo.hostname=ue.host,eo.secure=ue.protocol==="https"||ue.protocol==="wss",eo.port=ue.port,ue.query&&(eo.query=ue.query)):eo.host&&(eo.hostname=parse$8(eo.host).host),installTimerFunctions(this,eo),this.secure=eo.secure!=null?eo.secure:typeof location<"u"&&location.protocol==="https:",eo.hostname&&!eo.port&&(eo.port=this.secure?"443":"80"),this.hostname=eo.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=eo.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=eo.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},eo),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$2(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(ue){const eo=Object.assign({},this.opts.query);eo.EIO=protocol$1,eo.transport=ue,this.id&&(eo.sid=this.id);const no=Object.assign({},this.opts,{query:eo,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[ue]);return new transports[ue](no)}open(){let ue;if(this.opts.rememberUpgrade&&ph.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)ue="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else ue=this.transports[0];this.readyState="opening";try{ue=this.createTransport(ue)}catch{this.transports.shift(),this.open();return}ue.open(),this.setTransport(ue)}setTransport(ue){this.transport&&this.transport.removeAllListeners(),this.transport=ue,ue.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",eo=>this.onClose("transport close",eo))}probe(ue){let eo=this.createTransport(ue),no=!1;ph.priorWebsocketSuccess=!1;const ro=()=>{no||(eo.send([{type:"ping",data:"probe"}]),eo.once("packet",uo=>{if(!no)if(uo.type==="pong"&&uo.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",eo),!eo)return;ph.priorWebsocketSuccess=eo.name==="websocket",this.transport.pause(()=>{no||this.readyState!=="closed"&&(co(),this.setTransport(eo),eo.send([{type:"upgrade"}]),this.emitReserved("upgrade",eo),eo=null,this.upgrading=!1,this.flush())})}else{const fo=new Error("probe error");fo.transport=eo.name,this.emitReserved("upgradeError",fo)}}))};function oo(){no||(no=!0,co(),eo.close(),eo=null)}const io=uo=>{const fo=new Error("probe error: "+uo);fo.transport=eo.name,oo(),this.emitReserved("upgradeError",fo)};function ao(){io("transport closed")}function so(){io("socket closed")}function lo(uo){eo&&uo.name!==eo.name&&oo()}const co=()=>{eo.removeListener("open",ro),eo.removeListener("error",io),eo.removeListener("close",ao),this.off("close",so),this.off("upgrading",lo)};eo.once("open",ro),eo.once("error",io),eo.once("close",ao),this.once("close",so),this.once("upgrading",lo),this.upgrades.indexOf("webtransport")!==-1&&ue!=="webtransport"?this.setTimeoutFn(()=>{no||eo.open()},200):eo.open()}onOpen(){if(this.readyState="open",ph.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let ue=0;const eo=this.upgrades.length;for(;ue<eo;ue++)this.probe(this.upgrades[ue])}}onPacket(ue){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",ue),this.emitReserved("heartbeat"),this.resetPingTimeout(),ue.type){case"open":this.onHandshake(JSON.parse(ue.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const eo=new Error("server error");eo.code=ue.data,this.onError(eo);break;case"message":this.emitReserved("data",ue.data),this.emitReserved("message",ue.data);break}}onHandshake(ue){this.emitReserved("handshake",ue),this.id=ue.sid,this.transport.query.sid=ue.sid,this.upgrades=this.filterUpgrades(ue.upgrades),this.pingInterval=ue.pingInterval,this.pingTimeout=ue.pingTimeout,this.maxPayload=ue.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 ue=this.getWritablePackets();this.transport.send(ue),this.prevBufferLen=ue.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let eo=1;for(let no=0;no<this.writeBuffer.length;no++){const ro=this.writeBuffer[no].data;if(ro&&(eo+=byteLength(ro)),no>0&&eo>this.maxPayload)return this.writeBuffer.slice(0,no);eo+=2}return this.writeBuffer}write(ue,eo,no){return this.sendPacket("message",ue,eo,no),this}send(ue,eo,no){return this.sendPacket("message",ue,eo,no),this}sendPacket(ue,eo,no,ro){if(typeof eo=="function"&&(ro=eo,eo=void 0),typeof no=="function"&&(ro=no,no=null),this.readyState==="closing"||this.readyState==="closed")return;no=no||{},no.compress=no.compress!==!1;const oo={type:ue,data:eo,options:no};this.emitReserved("packetCreate",oo),this.writeBuffer.push(oo),ro&&this.once("flush",ro),this.flush()}close(){const ue=()=>{this.onClose("forced close"),this.transport.close()},eo=()=>{this.off("upgrade",eo),this.off("upgradeError",eo),ue()},no=()=>{this.once("upgrade",eo),this.once("upgradeError",eo)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?no():ue()}):this.upgrading?no():ue()),this}onError(ue){ph.priorWebsocketSuccess=!1,this.emitReserved("error",ue),this.onClose("transport error",ue)}onClose(ue,eo){(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",ue,eo),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(ue){const eo=[];let no=0;const ro=ue.length;for(;no<ro;no++)~this.transports.indexOf(ue[no])&&eo.push(ue[no]);return eo}};Socket$1.protocol=protocol$1;function url$1(to,ue="",eo){let no=to;eo=eo||typeof location<"u"&&location,to==null&&(to=eo.protocol+"//"+eo.host),typeof to=="string"&&(to.charAt(0)==="/"&&(to.charAt(1)==="/"?to=eo.protocol+to:to=eo.host+to),/^(https?|wss?):\/\//.test(to)||(typeof eo<"u"?to=eo.protocol+"//"+to:to="https://"+to),no=parse$8(to)),no.port||(/^(http|ws)$/.test(no.protocol)?no.port="80":/^(http|ws)s$/.test(no.protocol)&&(no.port="443")),no.path=no.path||"/";const oo=no.host.indexOf(":")!==-1?"["+no.host+"]":no.host;return no.id=no.protocol+"://"+oo+":"+no.port+ue,no.href=no.protocol+"://"+oo+(eo&&eo.port===no.port?"":":"+no.port),no}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=to=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(to):to.buffer instanceof ArrayBuffer,toString$4=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$4.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$4.call(File)==="[object FileConstructor]";function isBinary(to){return withNativeArrayBuffer&&(to instanceof ArrayBuffer||isView(to))||withNativeBlob&&to instanceof Blob||withNativeFile&&to instanceof File}function hasBinary(to,ue){if(!to||typeof to!="object")return!1;if(Array.isArray(to)){for(let eo=0,no=to.length;eo<no;eo++)if(hasBinary(to[eo]))return!0;return!1}if(isBinary(to))return!0;if(to.toJSON&&typeof to.toJSON=="function"&&arguments.length===1)return hasBinary(to.toJSON(),!0);for(const eo in to)if(Object.prototype.hasOwnProperty.call(to,eo)&&hasBinary(to[eo]))return!0;return!1}function deconstructPacket(to){const ue=[],eo=to.data,no=to;return no.data=_deconstructPacket(eo,ue),no.attachments=ue.length,{packet:no,buffers:ue}}function _deconstructPacket(to,ue){if(!to)return to;if(isBinary(to)){const eo={_placeholder:!0,num:ue.length};return ue.push(to),eo}else if(Array.isArray(to)){const eo=new Array(to.length);for(let no=0;no<to.length;no++)eo[no]=_deconstructPacket(to[no],ue);return eo}else if(typeof to=="object"&&!(to instanceof Date)){const eo={};for(const no in to)Object.prototype.hasOwnProperty.call(to,no)&&(eo[no]=_deconstructPacket(to[no],ue));return eo}return to}function reconstructPacket(to,ue){return to.data=_reconstructPacket(to.data,ue),delete to.attachments,to}function _reconstructPacket(to,ue){if(!to)return to;if(to&&to._placeholder===!0){if(typeof to.num=="number"&&to.num>=0&&to.num<ue.length)return ue[to.num];throw new Error("illegal attachments")}else if(Array.isArray(to))for(let eo=0;eo<to.length;eo++)to[eo]=_reconstructPacket(to[eo],ue);else if(typeof to=="object")for(const eo in to)Object.prototype.hasOwnProperty.call(to,eo)&&(to[eo]=_reconstructPacket(to[eo],ue));return to}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(to){to[to.CONNECT=0]="CONNECT",to[to.DISCONNECT=1]="DISCONNECT",to[to.EVENT=2]="EVENT",to[to.ACK=3]="ACK",to[to.CONNECT_ERROR=4]="CONNECT_ERROR",to[to.BINARY_EVENT=5]="BINARY_EVENT",to[to.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(ue){this.replacer=ue}encode(ue){return(ue.type===PacketType.EVENT||ue.type===PacketType.ACK)&&hasBinary(ue)?this.encodeAsBinary({type:ue.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:ue.nsp,data:ue.data,id:ue.id}):[this.encodeAsString(ue)]}encodeAsString(ue){let eo=""+ue.type;return(ue.type===PacketType.BINARY_EVENT||ue.type===PacketType.BINARY_ACK)&&(eo+=ue.attachments+"-"),ue.nsp&&ue.nsp!=="/"&&(eo+=ue.nsp+","),ue.id!=null&&(eo+=ue.id),ue.data!=null&&(eo+=JSON.stringify(ue.data,this.replacer)),eo}encodeAsBinary(ue){const eo=deconstructPacket(ue),no=this.encodeAsString(eo.packet),ro=eo.buffers;return ro.unshift(no),ro}}function isObject$7(to){return Object.prototype.toString.call(to)==="[object Object]"}class Decoder extends Emitter{constructor(ue){super(),this.reviver=ue}add(ue){let eo;if(typeof ue=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");eo=this.decodeString(ue);const no=eo.type===PacketType.BINARY_EVENT;no||eo.type===PacketType.BINARY_ACK?(eo.type=no?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(eo),eo.attachments===0&&super.emitReserved("decoded",eo)):super.emitReserved("decoded",eo)}else if(isBinary(ue)||ue.base64)if(this.reconstructor)eo=this.reconstructor.takeBinaryData(ue),eo&&(this.reconstructor=null,super.emitReserved("decoded",eo));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+ue)}decodeString(ue){let eo=0;const no={type:Number(ue.charAt(0))};if(PacketType[no.type]===void 0)throw new Error("unknown packet type "+no.type);if(no.type===PacketType.BINARY_EVENT||no.type===PacketType.BINARY_ACK){const oo=eo+1;for(;ue.charAt(++eo)!=="-"&&eo!=ue.length;);const io=ue.substring(oo,eo);if(io!=Number(io)||ue.charAt(eo)!=="-")throw new Error("Illegal attachments");no.attachments=Number(io)}if(ue.charAt(eo+1)==="/"){const oo=eo+1;for(;++eo&&!(ue.charAt(eo)===","||eo===ue.length););no.nsp=ue.substring(oo,eo)}else no.nsp="/";const ro=ue.charAt(eo+1);if(ro!==""&&Number(ro)==ro){const oo=eo+1;for(;++eo;){const io=ue.charAt(eo);if(io==null||Number(io)!=io){--eo;break}if(eo===ue.length)break}no.id=Number(ue.substring(oo,eo+1))}if(ue.charAt(++eo)){const oo=this.tryParse(ue.substr(eo));if(Decoder.isPayloadValid(no.type,oo))no.data=oo;else throw new Error("invalid payload")}return no}tryParse(ue){try{return JSON.parse(ue,this.reviver)}catch{return!1}}static isPayloadValid(ue,eo){switch(ue){case PacketType.CONNECT:return isObject$7(eo);case PacketType.DISCONNECT:return eo===void 0;case PacketType.CONNECT_ERROR:return typeof eo=="string"||isObject$7(eo);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(eo)&&(typeof eo[0]=="number"||typeof eo[0]=="string"&&RESERVED_EVENTS$1.indexOf(eo[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(eo)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(ue){this.packet=ue,this.buffers=[],this.reconPack=ue}takeBinaryData(ue){if(this.buffers.push(ue),this.buffers.length===this.reconPack.attachments){const eo=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),eo}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser$2=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on$1(to,ue,eo){return to.on(ue,eo),function(){to.off(ue,eo)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(ue,eo,no){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=ue,this.nsp=eo,no&&no.auth&&(this.auth=no.auth),this._opts=Object.assign({},no),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const ue=this.io;this.subs=[on$1(ue,"open",this.onopen.bind(this)),on$1(ue,"packet",this.onpacket.bind(this)),on$1(ue,"error",this.onerror.bind(this)),on$1(ue,"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(...ue){return ue.unshift("message"),this.emit.apply(this,ue),this}emit(ue,...eo){if(RESERVED_EVENTS.hasOwnProperty(ue))throw new Error('"'+ue.toString()+'" is a reserved event name');if(eo.unshift(ue),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(eo),this;const no={type:PacketType.EVENT,data:eo};if(no.options={},no.options.compress=this.flags.compress!==!1,typeof eo[eo.length-1]=="function"){const io=this.ids++,ao=eo.pop();this._registerAckCallback(io,ao),no.id=io}const ro=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!ro||!this.connected)||(this.connected?(this.notifyOutgoingListeners(no),this.packet(no)):this.sendBuffer.push(no)),this.flags={},this}_registerAckCallback(ue,eo){var no;const ro=(no=this.flags.timeout)!==null&&no!==void 0?no:this._opts.ackTimeout;if(ro===void 0){this.acks[ue]=eo;return}const oo=this.io.setTimeoutFn(()=>{delete this.acks[ue];for(let ao=0;ao<this.sendBuffer.length;ao++)this.sendBuffer[ao].id===ue&&this.sendBuffer.splice(ao,1);eo.call(this,new Error("operation has timed out"))},ro),io=(...ao)=>{this.io.clearTimeoutFn(oo),eo.apply(this,ao)};io.withError=!0,this.acks[ue]=io}emitWithAck(ue,...eo){return new Promise((no,ro)=>{const oo=(io,ao)=>io?ro(io):no(ao);oo.withError=!0,eo.push(oo),this.emit(ue,...eo)})}_addToQueue(ue){let eo;typeof ue[ue.length-1]=="function"&&(eo=ue.pop());const no={id:this._queueSeq++,tryCount:0,pending:!1,args:ue,flags:Object.assign({fromQueue:!0},this.flags)};ue.push((ro,...oo)=>no!==this._queue[0]?void 0:(ro!==null?no.tryCount>this._opts.retries&&(this._queue.shift(),eo&&eo(ro)):(this._queue.shift(),eo&&eo(null,...oo)),no.pending=!1,this._drainQueue())),this._queue.push(no),this._drainQueue()}_drainQueue(ue=!1){if(!this.connected||this._queue.length===0)return;const eo=this._queue[0];eo.pending&&!ue||(eo.pending=!0,eo.tryCount++,this.flags=eo.flags,this.emit.apply(this,eo.args))}packet(ue){ue.nsp=this.nsp,this.io._packet(ue)}onopen(){typeof this.auth=="function"?this.auth(ue=>{this._sendConnectPacket(ue)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(ue){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},ue):ue})}onerror(ue){this.connected||this.emitReserved("connect_error",ue)}onclose(ue,eo){this.connected=!1,delete this.id,this.emitReserved("disconnect",ue,eo),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(ue=>{if(!this.sendBuffer.some(no=>String(no.id)===ue)){const no=this.acks[ue];delete this.acks[ue],no.withError&&no.call(this,new Error("socket has been disconnected"))}})}onpacket(ue){if(ue.nsp===this.nsp)switch(ue.type){case PacketType.CONNECT:ue.data&&ue.data.sid?this.onconnect(ue.data.sid,ue.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(ue);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(ue);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const no=new Error(ue.data.message);no.data=ue.data.data,this.emitReserved("connect_error",no);break}}onevent(ue){const eo=ue.data||[];ue.id!=null&&eo.push(this.ack(ue.id)),this.connected?this.emitEvent(eo):this.receiveBuffer.push(Object.freeze(eo))}emitEvent(ue){if(this._anyListeners&&this._anyListeners.length){const eo=this._anyListeners.slice();for(const no of eo)no.apply(this,ue)}super.emit.apply(this,ue),this._pid&&ue.length&&typeof ue[ue.length-1]=="string"&&(this._lastOffset=ue[ue.length-1])}ack(ue){const eo=this;let no=!1;return function(...ro){no||(no=!0,eo.packet({type:PacketType.ACK,id:ue,data:ro}))}}onack(ue){const eo=this.acks[ue.id];typeof eo=="function"&&(delete this.acks[ue.id],eo.withError&&ue.data.unshift(null),eo.apply(this,ue.data))}onconnect(ue,eo){this.id=ue,this.recovered=eo&&this._pid===eo,this._pid=eo,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(ue=>this.emitEvent(ue)),this.receiveBuffer=[],this.sendBuffer.forEach(ue=>{this.notifyOutgoingListeners(ue),this.packet(ue)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(ue=>ue()),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(ue){return this.flags.compress=ue,this}get volatile(){return this.flags.volatile=!0,this}timeout(ue){return this.flags.timeout=ue,this}onAny(ue){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(ue),this}prependAny(ue){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(ue),this}offAny(ue){if(!this._anyListeners)return this;if(ue){const eo=this._anyListeners;for(let no=0;no<eo.length;no++)if(ue===eo[no])return eo.splice(no,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(ue){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(ue),this}prependAnyOutgoing(ue){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(ue),this}offAnyOutgoing(ue){if(!this._anyOutgoingListeners)return this;if(ue){const eo=this._anyOutgoingListeners;for(let no=0;no<eo.length;no++)if(ue===eo[no])return eo.splice(no,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(ue){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const eo=this._anyOutgoingListeners.slice();for(const no of eo)no.apply(this,ue.data)}}}function Backoff(to){to=to||{},this.ms=to.min||100,this.max=to.max||1e4,this.factor=to.factor||2,this.jitter=to.jitter>0&&to.jitter<=1?to.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var to=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var ue=Math.random(),eo=Math.floor(ue*this.jitter*to);to=Math.floor(ue*10)&1?to+eo:to-eo}return Math.min(to,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(to){this.ms=to};Backoff.prototype.setMax=function(to){this.max=to};Backoff.prototype.setJitter=function(to){this.jitter=to};class Manager extends Emitter{constructor(ue,eo){var no;super(),this.nsps={},this.subs=[],ue&&typeof ue=="object"&&(eo=ue,ue=void 0),eo=eo||{},eo.path=eo.path||"/socket.io",this.opts=eo,installTimerFunctions(this,eo),this.reconnection(eo.reconnection!==!1),this.reconnectionAttempts(eo.reconnectionAttempts||1/0),this.reconnectionDelay(eo.reconnectionDelay||1e3),this.reconnectionDelayMax(eo.reconnectionDelayMax||5e3),this.randomizationFactor((no=eo.randomizationFactor)!==null&&no!==void 0?no:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(eo.timeout==null?2e4:eo.timeout),this._readyState="closed",this.uri=ue;const ro=eo.parser||parser$2;this.encoder=new ro.Encoder,this.decoder=new ro.Decoder,this._autoConnect=eo.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(ue){return arguments.length?(this._reconnection=!!ue,this):this._reconnection}reconnectionAttempts(ue){return ue===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=ue,this)}reconnectionDelay(ue){var eo;return ue===void 0?this._reconnectionDelay:(this._reconnectionDelay=ue,(eo=this.backoff)===null||eo===void 0||eo.setMin(ue),this)}randomizationFactor(ue){var eo;return ue===void 0?this._randomizationFactor:(this._randomizationFactor=ue,(eo=this.backoff)===null||eo===void 0||eo.setJitter(ue),this)}reconnectionDelayMax(ue){var eo;return ue===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=ue,(eo=this.backoff)===null||eo===void 0||eo.setMax(ue),this)}timeout(ue){return arguments.length?(this._timeout=ue,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(ue){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const eo=this.engine,no=this;this._readyState="opening",this.skipReconnect=!1;const ro=on$1(eo,"open",function(){no.onopen(),ue&&ue()}),oo=ao=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",ao),ue?ue(ao):this.maybeReconnectOnOpen()},io=on$1(eo,"error",oo);if(this._timeout!==!1){const ao=this._timeout,so=this.setTimeoutFn(()=>{ro(),oo(new Error("timeout")),eo.close()},ao);this.opts.autoUnref&&so.unref(),this.subs.push(()=>{this.clearTimeoutFn(so)})}return this.subs.push(ro),this.subs.push(io),this}connect(ue){return this.open(ue)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const ue=this.engine;this.subs.push(on$1(ue,"ping",this.onping.bind(this)),on$1(ue,"data",this.ondata.bind(this)),on$1(ue,"error",this.onerror.bind(this)),on$1(ue,"close",this.onclose.bind(this)),on$1(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(ue){try{this.decoder.add(ue)}catch(eo){this.onclose("parse error",eo)}}ondecoded(ue){nextTick(()=>{this.emitReserved("packet",ue)},this.setTimeoutFn)}onerror(ue){this.emitReserved("error",ue)}socket(ue,eo){let no=this.nsps[ue];return no?this._autoConnect&&!no.active&&no.connect():(no=new Socket(this,ue,eo),this.nsps[ue]=no),no}_destroy(ue){const eo=Object.keys(this.nsps);for(const no of eo)if(this.nsps[no].active)return;this._close()}_packet(ue){const eo=this.encoder.encode(ue);for(let no=0;no<eo.length;no++)this.engine.write(eo[no],ue.options)}cleanup(){this.subs.forEach(ue=>ue()),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(ue,eo){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",ue,eo),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const ue=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const eo=this.backoff.duration();this._reconnecting=!0;const no=this.setTimeoutFn(()=>{ue.skipReconnect||(this.emitReserved("reconnect_attempt",ue.backoff.attempts),!ue.skipReconnect&&ue.open(ro=>{ro?(ue._reconnecting=!1,ue.reconnect(),this.emitReserved("reconnect_error",ro)):ue.onreconnect()}))},eo);this.opts.autoUnref&&no.unref(),this.subs.push(()=>{this.clearTimeoutFn(no)})}}onreconnect(){const ue=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",ue)}}const cache$1={};function lookup(to,ue){typeof to=="object"&&(ue=to,to=void 0),ue=ue||{};const eo=url$1(to,ue.path||"/socket.io"),no=eo.source,ro=eo.id,oo=eo.path,io=cache$1[ro]&&oo in cache$1[ro].nsps,ao=ue.forceNew||ue["force new connection"]||ue.multiplex===!1||io;let so;return ao?so=new Manager(no,ue):(cache$1[ro]||(cache$1[ro]=new Manager(no,ue)),so=cache$1[ro]),eo.query&&!ue.query&&(ue.query=eo.queryKey),so.socket(eo.path,ue)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const DefaultOptions={heartbeat:!0},createWebsocket=(to,ue=DefaultOptions)=>{if(!to)throw"A websocket path must be provided";const{heartbeat:eo}={...DefaultOptions,...ue},no=location.protocol==="https:",ro=no?"wss:":"ws:",oo=location.hostname,io=location.port||(no?443:80);let ao=lookup(`${ro}//${oo}:${io}`,{path:to,reconnectionAttempts:3,reconnectionDelay:5e3,reconnectionDelayMax:5e3,timeout:4e3,transports:["websocket"]}),so;return eo&&(so=setInterval(()=>{ao.emit(SocketEvent.Heartbeat)},SocketSessionTTL*500)),ao.on("disconnect",()=>{clearInterval(so)}),ao.onOther=(lo,co)=>{ao.on(lo,uo=>{(uo==null?void 0:uo.apiSessionId)!==APISessionID&&co(uo)})},ao},defaultColors={keyColor:"dimgray",numberColor:"lightskyblue",stringColor:"lightcoral",trueColor:"lightseagreen",falseColor:"#f66578",nullColor:"cornflowerblue"},entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="};function escapeHtml(to){return String(to).replace(/[&<>"'`=]/g,function(ue){return entityMap[ue]})}function format$1(to,ue={}){const eo=typeof to;let no=typeof to=="string"?to:JSON.stringify(to,null,2)||eo,ro=Object.assign({},defaultColors,ue);return no=no.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),no.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+]?\d+)?)/g,oo=>{let io=ro.numberColor,ao="";return/^"/.test(oo)?/:$/.test(oo)?io=ro.keyColor:(io=ro.stringColor,oo='"'+escapeHtml(oo.substr(1,oo.length-2))+'"',ao="word-wrap:break-word;white-space:pre-wrap;"):io=/true/.test(oo)?ro.trueColor:/false/.test(oo)?ro.falseColor:/null/.test(oo)?ro.nullColor:io,`<span style="${ao}color:${io}">${oo}</span>`})}const extractFileNameRegex=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;function downloadText(to,ue){typeof ue=="object"&&(ue=JSON.stringify(ue));const eo=new Blob([ue],{type:"plain/text"}),no=URL.createObjectURL(eo),ro=document.createElement("a");ro.href=no,ro.download=to,ro.click(),URL.revokeObjectURL(no)}async function downloadStream(to){const ue=await to.blob(),eo=to.headers.get("Content-Disposition"),ro=extractFileNameRegex.exec(eo)[1].replace(/['"]/g,""),oo=new Blob([ue]),io=URL.createObjectURL(oo),ao=document.createElement("a");ao.href=io,ao.download=ro,ao.click(),URL.revokeObjectURL(io)}async function downloadFile(to,ue){const eo=await fetch(to,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ue)});if(eo.ok){const no=eo.headers.get("Content-Disposition"),oo=extractFileNameRegex.exec(no)[1].replace(/['"]/g,""),io=URL.createObjectURL(await eo.blob()),ao=document.createElement("a");return ao.href=io,ao.download=oo,ao.click(),URL.revokeObjectURL(io),!0}else return!1}const shouldDisplaySetting=(to,ue)=>{let eo=ue.dependsOn;return eo&&!Array.isArray(eo)&&(eo=[eo]),eo!=null&&eo.length?eo.every(no=>{let ro=no,oo=null,io=!!no.invert;if(typeof no=="object"&&(ro=no.setting,oo=no.value),!ro)return!1;Array.isArray(oo)||(oo=[oo]);const ao=deepGet$1(to,ro);return oo.some(lo=>lo==null?ao!=null&&ao!==!1&&ao!=="":lo===ao)!==io}):!0},columnTypeManyTypeOverrides={[FieldType.DATETIME]:FieldType.STRING,[FieldType.BOOLEAN]:FieldType.STRING,[FieldType.SIGNATURE_SINGLE]:FieldType.ATTACHMENTS},columnTypeManyParser={[FieldType.DATETIME]:(to,ue)=>{function eo(no){const{timeOnly:ro,dateOnly:oo}=ue||{},io=!oo,ao=parseDate(no,{enableTime:io});return getDateDisplayValue(ao,{enableTime:io,timeOnly:ro})}return to.map(no=>eo(no))},[FieldType.BOOLEAN]:to=>to.map(ue=>!!ue),[FieldType.BB_REFERENCE_SINGLE]:to=>[...new Map(to.map(ue=>[ue._id,ue])).values()],[FieldType.BB_REFERENCE]:to=>[...new Map(to.map(ue=>[ue._id,ue])).values()],[FieldType.ARRAY]:to=>Array.from(new Set(to))};function enrichSchemaWithRelColumns(to){return Object.keys(to).reduce((eo,no)=>{const ro=to[no];if(eo[no]=ro,ro.visible!==!1&&isRelationshipField(ro)&&ro.columns){const oo=(ro==null?void 0:ro.relationshipType)===RelationshipType.ONE_TO_MANY;for(const io of Object.keys(ro.columns)){const ao=ro.columns[io];if(!ao.visible)continue;const so=`${ro.name}.${io}`;eo[so]={...ao,type:ao.type,name:so,related:{field:no,subField:io},cellRenderType:!oo&&columnTypeManyTypeOverrides[ao.type]||ao.type}}}return eo},{})}function getRelatedTableValues(to,ue,eo){var oo,io,ao,so;const no=isRelationshipField(eo)&&(eo==null?void 0:eo.relationshipType)===RelationshipType.ONE_TO_MANY;let ro="";if(no)ro=(io=(oo=to[ue.related.field])==null?void 0:oo[0])==null?void 0:io[ue.related.subField];else{const lo=columnTypeManyParser[ue.type]||(fo=>fo),co=(so=(ao=to[ue.related.field])==null?void 0:ao.flatMap(fo=>fo[ue.related.subField]))==null?void 0:so.filter(fo=>fo!=null),uo=lo(co||[],ue);ro=uo,[FieldType.STRING,FieldType.NUMBER,FieldType.BIGINT,FieldType.BOOLEAN,FieldType.DATETIME,FieldType.LONGFORM,FieldType.BARCODEQR].includes(ue.type)&&(ro=uo==null?void 0:uo.join(", "))}return ro}function canBeDisplayColumn(to){return!(!canBeDisplayColumn$1(to.type)||to.related)}function canBeSortColumn(to){return to.calculationType?!0:!(!canBeSortColumn$1(to.type)||to.related)}const{buildQuery,limit:queryLimit,runQuery,sort:sort$2}=QueryUtils;class BaseDataFetch{constructor(ue){pc(this,"API");pc(this,"features");pc(this,"options");pc(this,"store");pc(this,"derivedStore");if(this.features={supportsSearch:!1,supportsSort:!1,supportsPagination:!1},this.options={datasource:ue.datasource,limit:10,filter:null,query:ue.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:ue.query,pageNumber:0,cursor:null,cursors:[],resetKey:Math.random().toString(),error:null}),this.API=ue==null?void 0:ue.API,this.options={...this.options,...ue},!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,eo=>({...eo,...this.features,hasNextPage:this.hasNextPage(eo),hasPrevPage:this.hasPrevPage(eo)})),!this.options.datasource){this.store.update(eo=>({...eo,loaded:!0}));return}}get subscribe(){return this.derivedStore.subscribe}getDefaultSortColumn(ue,eo){return ue!=null&&ue.primaryDisplay&&eo[ue.primaryDisplay]?ue.primaryDisplay:Object.keys(eo)[0]}async getInitialData(){const{filter:ue,paginate:eo}=this.options,no=await this.getDefinition(),ro=await this.determineFeatureFlags();this.features={supportsSearch:!!(ro!=null&&ro.supportsSearch),supportsSort:!!(ro!=null&&ro.supportsSort),supportsPagination:eo&&!!(ro!=null&&ro.supportsPagination)};let oo=this.getSchema(no);if(!oo)return;if(oo=this.enrichSchema(oo),this.options.sortColumn&&!oo[this.options.sortColumn]&&(this.options.sortColumn=null),this.options.sortColumn||(this.options.sortColumn=this.getDefaultSortColumn(no,oo)),!this.options.sortColumn)this.options.sortOrder=SortOrder.ASCENDING,this.options.sortType=null;else{this.options.sortType=SortType.STRING;const so=oo==null?void 0:oo[this.options.sortColumn];((so==null?void 0:so.type)===FieldType.NUMBER||(so==null?void 0:so.type)===FieldType.BIGINT||"calculationType"in so&&(so!=null&&so.calculationType))&&(this.options.sortType=SortType.NUMBER),this.options.sortOrder?this.options.sortOrder=this.options.sortOrder.toLowerCase():this.options.sortOrder=SortOrder.ASCENDING}let io=this.options.query;io||(io=buildQuery(ue??void 0)),this.store.update(so=>({...so,definition:no,schema:oo,query:io,loading:!0,cursors:[],cursor:null}));const ao=await this.getPage();this.store.update(so=>({...so,loading:!1,loaded:!0,pageNumber:0,rows:ao.rows,info:ao.info,cursors:eo&&ao.hasNextPage?[null,ao.cursor]:[null],error:ao.error,resetKey:Math.random().toString()}))}async getPage(){const{sortColumn:ue,sortOrder:eo,sortType:no,limit:ro,clientSideSearching:oo,clientSideSorting:io,clientSideLimiting:ao}=this.options,{query:so}=get_store_value(this.store);let{rows:lo,info:co,hasNextPage:uo,cursor:fo,error:po}=await this.getData();return!this.features.supportsSearch&&oo&&(lo=runQuery(lo,so)),!this.features.supportsSort&&io&&no&&(lo=sort$2(lo,ue,eo,no)),!this.features.supportsPagination&&ao&&(lo=queryLimit(lo,ro)),{rows:lo,info:co,hasNextPage:uo,cursor:fo,error:po}}getSchema(ue){return(ue==null?void 0:ue.schema)??void 0}enrichSchema(ue){let eo={};for(const ro of Object.keys(ue)){const oo=ue[ro];if(oo.type===FieldType.JSON){const io=convertJSONSchemaToTableSchema(oo,{squashObjects:!0});if(io)for(const ao of Object.keys(io))eo[`${ro}.${ao}`]={type:io[ao].type,nestedJSON:!0}}}let no={};return Object.entries({...ue,...eo}).forEach(([ro,oo])=>{typeof oo=="string"?no[ro]={type:oo,name:ro}:no[ro]={...oo,type:oo.type,name:ro}}),no}async determineFeatureFlags(){return{supportsSearch:!1,supportsSort:!1,supportsPagination:!1}}async update(ue){let eo=!1;for(const[no,ro]of Object.entries(ue||{})){const oo=this.options[no]??null;if(JSON.stringify(ro??null)!==JSON.stringify(oo)){eo=!0;break}}eo&&(this.options={...this.options,...fp$1.cloneDeep(ue)},await this.getInitialData())}async refresh(){if(get_store_value(this.store).loading)return;this.store.update(so=>({...so,loading:!0}));const{rows:ue,info:eo,error:no,cursor:ro}=await this.getPage();let{cursors:oo}=get_store_value(this.store);const{pageNumber:io}=get_store_value(this.store);if(!ue.length&&io>0)return this.store.update(so=>({...so,loading:!1,cursors:oo.slice(0,io)})),await this.prevPage();oo[io+1]!=ro&&(oo=oo.slice(0,io+1),oo[io+1]=ro),this.store.update(so=>({...so,rows:ue,info:eo,loading:!1,error:no,cursors:oo}))}hasNextPage(ue){return ue.cursors[ue.pageNumber+1]!=null}hasPrevPage(ue){return ue.pageNumber>0}async nextPage(){const ue=get_store_value(this.derivedStore);if(ue.loading||!this.options.paginate||!ue.hasNextPage)return;const eo=ue.cursors[ue.pageNumber+1];this.store.update(so=>({...so,loading:!0,cursor:eo,pageNumber:so.pageNumber+1}));const{rows:no,info:ro,hasNextPage:oo,cursor:io,error:ao}=await this.getPage();this.store.update(so=>{let{cursors:lo,pageNumber:co}=so;return oo&&(lo[co+1]=io),{...so,rows:no,info:ro,cursors:lo,loading:!1,error:ao}})}async prevPage(){const ue=get_store_value(this.derivedStore);if(ue.loading||!this.options.paginate||!ue.hasPrevPage)return;const eo=ue.cursors[ue.pageNumber-1];this.store.update(io=>({...io,loading:!0,cursor:eo,pageNumber:io.pageNumber-1}));const{rows:no,info:ro,error:oo}=await this.getPage();this.store.update(io=>({...io,rows:no,info:ro,loading:!1,error:oo}))}}class TableFetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}async getData(){const{datasource:ue,limit:eo,sortColumn:no,sortOrder:ro,sortType:oo,paginate:io}=this.options,{tableId:ao}=ue,{cursor:so,query:lo}=get_store_value(this.store);try{const co=await this.API.searchTable(ao,{query:lo,limit:eo,sort:no,sortOrder:ro??SortOrder.ASCENDING,sortType:oo,paginate:io,bookmark:so});return{rows:(co==null?void 0:co.rows)||[],hasNextPage:(co==null?void 0:co.hasNextPage)||!1,cursor:(co==null?void 0:co.bookmark)||null}}catch(co){return{rows:[],hasNextPage:!1,error:co}}}}class ViewFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}getSchema(ue){var no,ro;const{datasource:eo}=this.options;return(ro=(no=ue==null?void 0:ue.views)==null?void 0:no[eo==null?void 0:eo.name])==null?void 0:ro.schema}async getData(){const{datasource:ue}=this.options;try{return{rows:await this.API.fetchViewData(ue.name,{calculation:ue.calculation,field:ue.field,groupBy:ue.groupBy,tableId:ue.tableId})||[]}}catch(eo){return console.error(eo,{datasource:ue}),{rows:[]}}}}class ViewV2Fetch extends BaseDataFetch{async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!0,supportsPagination:!0}}async getDefinition(){const{datasource:ue}=this.options;try{const eo=await this.API.viewV2.fetchDefinition(ue.id);return eo==null?void 0:eo.data}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}getDefaultSortColumn(){return null}async getData(){var co;const{datasource:ue,limit:eo,sortColumn:no,sortOrder:ro,sortType:oo,paginate:io}=this.options,{cursor:ao,query:so,definition:lo}=get_store_value(this.store);if((lo==null?void 0:lo.type)===ViewV2Type.CALCULATION&&!Object.values(lo.schema||{}).some(isCalculationField))return{rows:[],hasNextPage:!1,cursor:null,error:null};!no&&((co=lo==null?void 0:lo.sort)!=null&&co.field)&&(this.options.sortColumn=lo.sort.field,this.options.sortOrder=lo.sort.order||SortOrder.ASCENDING);try{const uo={query:so,paginate:io,limit:eo,bookmark:ao,sort:no,sortOrder:ro,sortType:oo};if(io){const fo=await this.API.viewV2.fetch(ue.id,{...uo,paginate:io});return{rows:(fo==null?void 0:fo.rows)||[],hasNextPage:(fo==null?void 0:fo.hasNextPage)||!1,cursor:(fo==null?void 0:fo.bookmark)||null}}else{const fo=await this.API.viewV2.fetch(ue.id,{...uo,paginate:io});return{rows:(fo==null?void 0:fo.rows)||[],hasNextPage:!1,cursor:null}}}catch(uo){return{rows:[],hasNextPage:!1,cursor:null,error:uo}}}}class QueryFetch extends BaseDataFetch{async determineFeatureFlags(){var no,ro,oo,io,ao,so;const ue=await this.getDefinition();return{supportsPagination:!!((ro=(no=ue==null?void 0:ue.fields)==null?void 0:no.pagination)!=null&&ro.type)&&!!((io=(oo=ue==null?void 0:ue.fields)==null?void 0:oo.pagination)!=null&&io.location)&&!!((so=(ao=ue==null?void 0:ue.fields)==null?void 0:ao.pagination)!=null&&so.pageParam)}}async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue._id))return null;try{const eo=await this.API.fetchQueryDefinition(ue._id);return eo.fields||(eo.fields=ue.fields),eo}catch{return null}}getDefaultSortColumn(){return null}async getData(){var co,uo;const{datasource:ue,limit:eo,paginate:no}=this.options,{supportsPagination:ro}=this.features,{cursor:oo,definition:io}=get_store_value(this.store),ao=(uo=(co=io==null?void 0:io.fields)==null?void 0:co.pagination)==null?void 0:uo.type,so=cloneDeep(ue.queryParams||{});for(const fo of(ue==null?void 0:ue.parameters)||[])so[fo.name]||(so[fo.name]=fo.default);const lo={parameters:so};if(no&&ro){const fo=ao==="page"?parseInt(oo||"1"):oo;lo.pagination={page:fo,limit:eo}}try{const fo=await this.API.executeQuery(ue==null?void 0:ue._id,lo),{data:po,pagination:ho,..._o}=fo;let go=null,bo=!1;return no&&ro&&(ao==="page"?(go=lo.pagination.page+1,bo=(po==null?void 0:po.length)===eo&&eo>0):(go=ho==null?void 0:ho.cursor,bo=go!=null)),{rows:po||[],info:_o,cursor:go,hasNextPage:bo}}catch{return{rows:[],hasNextPage:!1}}}}class RelationshipFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{return await this.API.fetchTableDefinition(ue.tableId)}catch(eo){return this.store.update(no=>({...no,error:eo})),null}}async getData(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.rowId)||!(ue!=null&&ue.rowTableId))return{rows:[]};try{return{rows:await this.API.fetchRelationshipData(ue.rowTableId,ue.rowId,ue.fieldName)}}catch{return{rows:[]}}}}class NestedProviderFetch extends BaseDataFetch{async getDefinition(){var eo,no;const{datasource:ue}=this.options;return{schema:(eo=ue==null?void 0:ue.value)==null?void 0:eo.schema,primaryDisplay:(no=ue==null?void 0:ue.value)==null?void 0:no.primaryDisplay}}async getData(){var eo;const{datasource:ue}=this.options;return{rows:((eo=ue==null?void 0:ue.value)==null?void 0:eo.rows)||[],hasNextPage:!1,cursor:null}}}function isArrayOfStrings(to){return Array.isArray(to)&&!!to[0]&&typeof to[0]!="object"}class FieldFetch extends BaseDataFetch{async getDefinition(){const{datasource:ue}=this.options;let eo;return ue.fieldType==="attachment"?eo={url:{type:"string"},name:{type:"string"}}:ue.fieldType==="array"&&(eo={value:{type:"string"}}),{schema:eo}}async getData(){const{datasource:ue}=this.options,eo=(ue==null?void 0:ue.value)||[];let no;return isArrayOfStrings(eo)?no=eo.map(ro=>({value:ro})):no=eo,{rows:no||[],hasNextPage:!1,cursor:null}}}class JSONArrayFetch extends FieldFetch{async getDefinition(){const{datasource:ue}=this.options;try{const eo=await this.API.fetchTableDefinition(ue.tableId);return{schema:getJSONArrayDatasourceSchema(eo==null?void 0:eo.schema,ue)}}catch{return null}}}class UserFetch extends BaseDataFetch{constructor(ue){super({...ue,datasource:{type:"user",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{limit:ue,paginate:eo}=this.options,{cursor:no,query:ro}=get_store_value(this.store),{appId:oo,paginated:io,...ao}=ro,so=isSupportedUserSearch(ao)?ao:{};try{const lo={bookmark:no??void 0,query:so??void 0,appId:oo,paginate:io||eo,limit:ue},co=await this.API.searchUsers(lo);return{rows:(co==null?void 0:co.data)||[],hasNextPage:(co==null?void 0:co.hasNextPage)||!1,cursor:(co==null?void 0:co.nextPage)||null}}catch(lo){return{rows:[],hasNextPage:!1,error:lo}}}}class GroupUserFetch extends BaseDataFetch{constructor(ue){super({...ue,datasource:{type:"groupUser",tableId:InternalTable.USER_METADATA}})}async determineFeatureFlags(){return{supportsSearch:!0,supportsSort:!1,supportsPagination:!0}}async getDefinition(){return{schema:{}}}async getData(){const{query:ue,cursor:eo}=get_store_value(this.store);try{const no=await this.API.getGroupUsers({id:ue.groupId,emailSearch:ue.emailSearch,bookmark:eo??void 0});return{rows:(no==null?void 0:no.users)||[],hasNextPage:(no==null?void 0:no.hasNextPage)||!1,cursor:(no==null?void 0:no.bookmark)||null}}catch(no){return{rows:[],hasNextPage:!1,error:no}}}}class CustomFetch extends BaseDataFetch{getType(ue){return ue==null?"string":typeof ue==="object"?Array.isArray(ue)?"array":"json":isNaN(ue)?"string":"number"}parseCustomData(ue){if(!ue)return[];if(Array.isArray(ue))return ue;if(typeof ue=="string"){try{const eo=JSON.parse(ue);return Array.isArray(eo)?eo:[eo]}catch{}return ue.includes(`
|
|
476
476
|
`)?ue.split(`
|
|
477
477
|
`).map(eo=>eo.trim()):ue.split(",").map(eo=>eo.trim())}return[ue]}enrichCustomData(ue){return ue!=null&&ue.length?(ue=ue.filter(eo=>eo!=null&&eo!==""&&!Array.isArray(eo)),ue.map(eo=>{if(typeof eo=="object")return eo;if(typeof eo=="string"){const no=eo.split(",").map(oo=>oo.trim()),ro={};for(let oo=0;oo<no.length;oo++){const ao=`Value${oo===0?"":` ${oo+1}`}`;ro[ao]=no[oo]}return ro}return{Value:eo}})):[]}getCustomData(ue){return this.enrichCustomData(this.parseCustomData(ue==null?void 0:ue.data))}async getDefinition(){const{datasource:ue}=this.options,eo={},no=this.getCustomData(ue);if(!(no!=null&&no.length))return{schema:eo};for(const ro of no)for(const oo of Object.keys(ro))if(oo!=="_id"&&!eo[oo]){let io=this.getType(ro[oo]);const ao={};if(io==="string"){const so=[...new Set(no.map(co=>co[oo]))];so.length/no.length<=.8&&so.length>1&&(io="options",ao.inclusion=so)}else io==="array"&&(ao.inclusion=[...new Set(no.map(so=>so[oo]).flat())]);eo[oo]={type:io,constraints:ao}}return{schema:eo}}async getData(){const{datasource:ue}=this.options;return{rows:this.getCustomData(ue),hasNextPage:!1,cursor:null}}}class QueryArrayFetch extends FieldFetch{async getDefinition(){const{datasource:ue}=this.options;if(!(ue!=null&&ue.tableId))return null;try{const eo=await this.API.fetchQueryDefinition(ue.tableId),no=generateQueryArraySchemas(eo.schema,eo.nestedSchemaFields);return{schema:getJSONArrayDatasourceSchema(no,ue)}}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:to,datasource:ue,options:eo})=>{const no=DataFetchMap[ue==null?void 0:ue.type]||TableFetch,ro=new no({API:to,datasource:ue,...eo});return ro.getInitialData(),ro},createEmptyFetchInstance=({API:to,datasource:ue})=>{const eo=DataFetchMap[ue==null?void 0:ue.type];return eo?new eo({API:to,datasource:ue,query:null}):null},getDatasourceDefinition=async({API:to,datasource:ue})=>{const eo=createEmptyFetchInstance({API:to,datasource:ue});return await(eo==null?void 0:eo.getDefinition())},getDatasourceSchema=({API:to,datasource:ue,definition:eo})=>{const no=createEmptyFetchInstance({API:to,datasource:ue});return no==null?void 0:no.getSchema(eo)},createLocalStorageStore=(to,ue)=>{const eo=writable(ue,()=>{oo();const io=({key:ao})=>ao===to&&oo();return window.addEventListener("storage",io),()=>window.removeEventListener("storage",io)}),no=io=>{eo.set(io),localStorage.setItem(to,JSON.stringify(io))},ro=io=>no(io(get_store_value(eo))),oo=()=>{const io=localStorage.getItem(to);if(io==null)no(ue);else try{eo.set(JSON.parse(io))}catch{no(ue)}};return{...eo,set:no,update:ro}},createSessionStorageStore=(to,ue)=>{const eo=writable(ue,()=>{oo();const io=({key:ao})=>ao===to&&oo();return window.addEventListener("storage",io),()=>window.removeEventListener("storage",io)}),no=io=>{eo.set(io),sessionStorage.setItem(to,JSON.stringify(io))},ro=io=>no(io(get_store_value(eo))),oo=()=>{const io=sessionStorage.getItem(to);if(io==null)no(ue);else try{eo.set(JSON.parse(io))}catch{no(ue)}};return{...eo,set:no,update:ro}},BG="/builder/assets/bg-29e85dd5.png",SplitPage_svelte_svelte_type_style_lang="",get_right_slot_changes$1=to=>({}),get_right_slot_context$1=to=>({});function create_fragment$a5(to){let ue,eo,no,ro,oo,io,ao,so,lo;const co=to[1].default,uo=create_slot(co,to,to[0],null),fo=to[1].right,po=create_slot(fo,to,to[0],get_right_slot_context$1);return{c(){ue=element("div"),eo=element("div"),no=element("div"),uo&&uo.c(),ro=space$1(),oo=element("div"),io=element("img"),so=space$1(),po&&po.c(),attr(no,"class","content svelte-63esek"),attr(eo,"class","left svelte-63esek"),src_url_equal(io.src,ao=BG)||attr(io,"src",ao),attr(io,"alt"," "),attr(io,"class","svelte-63esek"),attr(oo,"class","right spectrum spectrum--darkest svelte-63esek"),attr(ue,"class","split-page svelte-63esek")},m(ho,_o){insert$1(ho,ue,_o),append$2(ue,eo),append$2(eo,no),uo&&uo.m(no,null),append$2(ue,ro),append$2(ue,oo),append$2(oo,io),append$2(oo,so),po&&po.m(oo,null),lo=!0},p(ho,[_o]){uo&&uo.p&&(!lo||_o&1)&&update_slot_base(uo,co,ho,ho[0],lo?get_slot_changes(co,ho[0],_o,null):get_all_dirty_from_scope(ho[0]),null),po&&po.p&&(!lo||_o&1)&&update_slot_base(po,fo,ho,ho[0],lo?get_slot_changes(fo,ho[0],_o,get_right_slot_changes$1):get_all_dirty_from_scope(ho[0]),get_right_slot_context$1)},i(ho){lo||(transition_in(uo,ho),transition_in(po,ho),lo=!0)},o(ho){transition_out(uo,ho),transition_out(po,ho),lo=!1},d(ho){ho&&detach(ue),uo&&uo.d(ho),po&&po.d(ho)}}}function instance$a2(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue;return to.$$set=oo=>{"$$scope"in oo&&eo(0,ro=oo.$$scope)},[ro,no]}class SplitPage extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a2,create_fragment$a5,safe_not_equal,{})}}const Bulgaria="/builder/assets/bulgaria-bd68393d.png",Covanta="/builder/assets/covanta-72c46c1e.png",Schnellecke="/builder/assets/schnellecke-cf1837a8.png",Testimonial_svelte_svelte_type_style_lang="";function create_default_slot$6c(to){let ue,eo,no,ro,oo,io,ao,so,lo;return{c(){ue=element("img"),no=space$1(),ro=element("div"),ro.textContent=`"${to[0].text}"`,oo=space$1(),io=element("div"),ao=element("div"),ao.textContent=`${to[0].name}`,so=space$1(),lo=element("div"),lo.textContent=`${to[0].role}`,attr(ue,"width",to[0].imageSize),attr(ue,"alt","a-happy-budibase-user"),src_url_equal(ue.src,eo=to[0].image)||attr(ue,"src",eo),attr(ro,"class","text svelte-1rdu21t"),attr(ao,"class","name svelte-1rdu21t"),attr(lo,"class","company svelte-1rdu21t"),attr(io,"class","author")},m(co,uo){insert$1(co,ue,uo),insert$1(co,no,uo),insert$1(co,ro,uo),insert$1(co,oo,uo),insert$1(co,io,uo),append$2(io,ao),append$2(io,so),append$2(io,lo)},p:noop$6,d(co){co&&(detach(ue),detach(no),detach(ro),detach(oo),detach(io))}}}function create_fragment$a4(to){let ue,eo,no;return eo=new Layout$n({props:{noPadding:!0,gap:"S",$$slots:{default:[create_default_slot$6c]},$$scope:{ctx:to}}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","testimonial svelte-1rdu21t")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,[oo]){const io={};oo&4&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function instance$a1(to){return[[{text:"Budibase was the only solution that checked all the boxes for Covanta. Covanta expects to realize $3.2MM in savings due to the elimination of redundant data entry.",name:"Charles Link",role:"Senior Director, Data and Analytics",image:Covanta,imageSize:105},{text:"Budibase was mission-critical for us and went a long way in preventing what could have become a humanitarian crisis here in Bulgaria.",name:"Bozhidar Bozhanov",role:"Government of Bulgaria",image:Bulgaria,imageSize:49},{text:"Centralization of authentication, quick turnaround time for requests, integration with different database systems has given it the edge and it’s now used daily for internal development for those apps that you know you need but don’t feel value in losing days of development to reinvent the wheel.",name:"Davide Lenzarini",role:"IT manager",image:Schnellecke,imageSize:141}][Math.floor(Math.random()*3)]]}class Testimonial extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a1,create_fragment$a4,safe_not_equal,{})}}const TestimonialPage_svelte_svelte_type_style_lang="";function create_default_slot$6b(to){let ue;const eo=to[1].default,no=create_slot(eo,to,to[2],null);return{c(){no&&no.c()},m(ro,oo){no&&no.m(ro,oo),ue=!0},p(ro,oo){no&&no.p&&(!ue||oo&4)&&update_slot_base(no,eo,ro,ro[2],ue?get_slot_changes(eo,ro[2],oo,null):get_all_dirty_from_scope(ro[2]),null)},i(ro){ue||(transition_in(no,ro),ue=!0)},o(ro){transition_out(no,ro),ue=!1},d(ro){no&&no.d(ro)}}}function create_if_block$4J(to){let ue,eo;return ue=new Testimonial({}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_right_slot$3(to){let ue,eo,no=to[0]&&create_if_block$4J();return{c(){ue=element("div"),no&&no.c(),attr(ue,"slot","right"),attr(ue,"class","svelte-1ow1lgm"),toggle_class(ue,"wrapper",to[0])},m(ro,oo){insert$1(ro,ue,oo),no&&no.m(ue,null),eo=!0},p(ro,oo){ro[0]?no?oo&1&&transition_in(no,1):(no=create_if_block$4J(),no.c(),transition_in(no,1),no.m(ue,null)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros()),(!eo||oo&1)&&toggle_class(ue,"wrapper",ro[0])},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d()}}}function create_fragment$a3(to){let ue,eo;return ue=new SplitPage({props:{$$slots:{right:[create_right_slot$3],default:[create_default_slot$6b]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&5&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$a0(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{enabled:oo=!0}=ue;return to.$$set=io=>{"enabled"in io&&eo(0,oo=io.enabled),"$$scope"in io&&eo(2,ro=io.$$scope)},[oo,no,ro]}class TestimonialPage extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$a0,create_fragment$a3,safe_not_equal,{enabled:0})}}const SignatureModal_svelte_svelte_type_style_lang="";function create_default_slot_2$31(to){let ue,eo,no,ro={darkMode:to[3],value:to[1],saveIcon:!1};return eo=new Signature({props:ro}),to[8](eo),eo.$on("update",to[9]),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","signature-wrap modal svelte-1jbgrys")},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),no=!0},p(oo,io){const ao={};io&8&&(ao.darkMode=oo[3]),io&2&&(ao.value=oo[1]),eo.$set(ao)},i(oo){no||(transition_in(eo.$$.fragment,oo),no=!0)},o(oo){transition_out(eo.$$.fragment,oo),no=!1},d(oo){oo&&detach(ue),to[8](null),destroy_component(eo)}}}function create_default_slot_1$4d(to){let ue;return{c(){ue=text$1(to[2])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&4&&set_data(ue,eo[2])},d(eo){eo&&detach(ue)}}}function create_header_slot$4(to){let ue,eo,no;return eo=new Body({props:{$$slots:{default:[create_default_slot_1$4d]},$$scope:{ctx:to}}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"slot","header")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo&4100&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot$6a(to){let ue,eo;return ue=new ModalContent({props:{showConfirmButton:!0,showCancelButton:!1,showCloseIcon:!1,custom:!0,disabled:!to[6],showDivider:!1,onConfirm:to[10],$$slots:{header:[create_header_slot$4],default:[create_default_slot_2$31]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&64&&(oo.disabled=!no[6]),ro&33&&(oo.onConfirm=no[10]),ro&4206&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$a2(to){let ue,eo,no={$$slots:{default:[create_default_slot$6a]},$$scope:{ctx:to}};return ue=new Modal({props:no}),to[11](ue),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,[oo]){const io={};oo&4207&&(io.$$scope={dirty:oo,ctx:ro}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){to[11](null),destroy_component(ue,ro)}}}function instance$9$(to,ue,eo){let{onConfirm:no=()=>{}}=ue,{value:ro}=ue,{title:oo}=ue,{darkMode:io}=ue;const ao=()=>{eo(6,co=!1),so.show()};let so,lo,co=!1;function uo(_o){binding_callbacks[_o?"unshift":"push"](()=>{lo=_o,eo(5,lo)})}const fo=()=>{eo(6,co=!0)},po=()=>{no(lo)};function ho(_o){binding_callbacks[_o?"unshift":"push"](()=>{so=_o,eo(4,so)})}return to.$$set=_o=>{"onConfirm"in _o&&eo(0,no=_o.onConfirm),"value"in _o&&eo(1,ro=_o.value),"title"in _o&&eo(2,oo=_o.title),"darkMode"in _o&&eo(3,io=_o.darkMode)},[no,ro,oo,io,so,lo,co,ao,uo,fo,po,ho]}class SignatureModal extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9$,create_fragment$a2,safe_not_equal,{onConfirm:0,value:1,title:2,darkMode:3,show:7})}get show(){return this.$$.ctx[7]}}function create_if_block$4I(to){let ue,eo;return ue=new AbsTooltip({props:{text:to[3]?getUserLabel(to[0]):null,position:to[2],color:getUserColor(to[0]),$$slots:{default:[create_default_slot$69]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&9&&(oo.text=no[3]?getUserLabel(no[0]):null),ro&4&&(oo.position=no[2]),ro&1&&(oo.color=getUserColor(no[0])),ro&19&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$69(to){let ue,eo;return ue=new Avatar({props:{size:to[1],initials:getUserInitials(to[0]),color:getUserColor(to[0])}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&2&&(oo.size=no[1]),ro&1&&(oo.initials=getUserInitials(no[0])),ro&1&&(oo.color=getUserColor(no[0])),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$a1(to){let ue,eo,no=to[0]&&create_if_block$4I(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){ro[0]?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$4I(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function instance$9_(to,ue,eo){let{user:no}=ue,{size:ro="S"}=ue,{tooltipPosition:oo=TooltipPosition.Top}=ue,{showTooltip:io=!0}=ue;return to.$$set=ao=>{"user"in ao&&eo(0,no=ao.user),"size"in ao&&eo(1,ro=ao.size),"tooltipPosition"in ao&&eo(2,oo=ao.tooltipPosition),"showTooltip"in ao&&eo(3,io=ao.showTooltip)},[no,ro,oo,io]}class UserAvatar extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9_,create_fragment$a1,safe_not_equal,{user:0,size:1,tooltipPosition:2,showTooltip:3})}}const UserAvatars_svelte_svelte_type_style_lang$1="";function get_each_context$1W(to,ue,eo){const no=to.slice();return no[8]=ue[eo],no}function create_else_block$1P(to){let ue,eo;return ue=new UserAvatar({props:{size:to[0],user:to[8],tooltipPosition:to[1]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.size=no[0]),ro&4&&(oo.user=no[8]),ro&2&&(oo.tooltipPosition=no[1]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block$4H(to){let ue,eo;return ue=new Avatar({props:{size:to[0],initials:to[8].label,color:"var(--spectrum-global-color-gray-500)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.size=no[0]),ro&4&&(oo.initials=no[8].label),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_each_block$1W(to){let ue,eo,no,ro,oo;const io=[create_if_block$4H,create_else_block$1P],ao=[];function so(lo,co){return lo[8]._id==="overflow"?0:1}return eo=so(to),no=ao[eo]=io[eo](to),{c(){ue=element("span"),no.c(),ro=space$1(),set_style(ue,"z-index",to[8].zIndex),attr(ue,"class","svelte-1wnz660")},m(lo,co){insert$1(lo,ue,co),ao[eo].m(ue,null),append$2(ue,ro),oo=!0},p(lo,co){let uo=eo;eo=so(lo),eo===uo?ao[eo].p(lo,co):(group_outros(),transition_out(ao[uo],1,1,()=>{ao[uo]=null}),check_outros(),no=ao[eo],no?no.p(lo,co):(no=ao[eo]=io[eo](lo),no.c()),transition_in(no,1),no.m(ue,ro)),(!oo||co&4)&&set_style(ue,"z-index",lo[8].zIndex)},i(lo){oo||(transition_in(no),oo=!0)},o(lo){transition_out(no),oo=!1},d(lo){lo&&detach(ue),ao[eo].d()}}}function create_fragment$a0(to){let ue,eo,no=ensure_array_like(to[2]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block$1W(get_each_context$1W(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){ue=element("div");for(let io=0;io<ro.length;io+=1)ro[io].c();attr(ue,"class","avatars svelte-1wnz660")},m(io,ao){insert$1(io,ue,ao);for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(ue,null);eo=!0},p(io,[ao]){if(ao&7){no=ensure_array_like(io[2]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context$1W(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block$1W(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue,null))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function instance$9Z(to,ue,eo){let no,ro,{users:oo=[]}=ue,{order:io="ltr"}=ue,{size:ao="S"}=ue,{tooltipPosition:so=TooltipPosition.Top}=ue;const lo=uo=>{let fo={};return uo==null||uo.forEach(po=>{fo[po.email]=po}),Object.values(fo)},co=(uo,fo)=>{const po=uo.slice(0,3);if(uo.length>3){const ho={_id:"overflow",label:`+${uo.length-3}`};fo==="ltr"?po.push(ho):po.unshift(ho)}return po.map((ho,_o)=>({...ho,zIndex:fo==="ltr"?_o:no.length-_o}))};return to.$$set=uo=>{"users"in uo&&eo(3,oo=uo.users),"order"in uo&&eo(4,io=uo.order),"size"in uo&&eo(0,ao=uo.size),"tooltipPosition"in uo&&eo(1,so=uo.tooltipPosition)},to.$$.update=()=>{to.$$.dirty&24&&eo(5,no=lo(oo)),to.$$.dirty&48&&eo(2,ro=co(no,io))},[ao,so,ro,oo,io,no]}let UserAvatars$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9Z,create_fragment$a0,safe_not_equal,{users:3,order:4,size:0,tooltipPosition:1})}};const Updating_svelte_svelte_type_style_lang="";function create_else_block_1$u(to){let ue;return{c(){ue=text$1("Something went wrong!")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_if_block_1$2x(to){let ue;return{c(){ue=text$1("System update")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_else_block$1O(to){let ue,eo,no,ro,oo;return{c(){ue=text$1(`An error occurred, please try again later.
|
|
478
478
|
`),eo=element("br"),no=text$1(`
|
|
@@ -505,7 +505,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
505
505
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
506
506
|
* (c) 2017-2021 Joachim Wester
|
|
507
507
|
* MIT license
|
|
508
|
-
*/var beforeDict=new WeakMap,Mirror=function(){function to(ue){this.observers=new Map,this.obj=ue}return to}(),ObserverInfo=function(){function to(ue,eo){this.callback=ue,this.observer=eo}return to}();function getMirror(to){return beforeDict.get(to)}function getObserverFromMirror(to,ue){return to.observers.get(ue)}function removeObserverFromMirror(to,ue){to.observers.delete(ue.callback)}function unobserve$1(to,ue){ue.unobserve()}function observe$2(to,ue){var eo=[],no,ro=getMirror(to);if(!ro)ro=new Mirror(to),beforeDict.set(to,ro);else{var oo=getObserverFromMirror(ro,ue);no=oo&&oo.observer}if(no)return no;if(no={},ro.value=_deepClone(to),ue){no.callback=ue,no.next=null;var io=function(){generate$1(no)},ao=function(){clearTimeout(no.next),no.next=setTimeout(io)};typeof window<"u"&&(window.addEventListener("mouseup",ao),window.addEventListener("keyup",ao),window.addEventListener("mousedown",ao),window.addEventListener("keydown",ao),window.addEventListener("change",ao))}return no.patches=eo,no.object=to,no.unobserve=function(){generate$1(no),clearTimeout(no.next),removeObserverFromMirror(ro,no),typeof window<"u"&&(window.removeEventListener("mouseup",ao),window.removeEventListener("keyup",ao),window.removeEventListener("mousedown",ao),window.removeEventListener("keydown",ao),window.removeEventListener("change",ao))},ro.observers.set(ue,new ObserverInfo(ue,no)),no}function generate$1(to,ue){ue===void 0&&(ue=!1);var eo=beforeDict.get(to.object);_generate(eo.value,to.object,to.patches,"",ue),to.patches.length&&applyPatch(eo.value,to.patches);var no=to.patches;return no.length>0&&(to.patches=[],to.callback&&to.callback(no)),no}function _generate(to,ue,eo,no,ro){if(ue!==to){typeof ue.toJSON=="function"&&(ue=ue.toJSON());for(var oo=_objectKeys(ue),io=_objectKeys(to),ao=!1,so=io.length-1;so>=0;so--){var lo=io[so],co=to[lo];if(hasOwnProperty$6(ue,lo)&&!(ue[lo]===void 0&&co!==void 0&&Array.isArray(ue)===!1)){var uo=ue[lo];typeof co=="object"&&co!=null&&typeof uo=="object"&&uo!=null&&Array.isArray(co)===Array.isArray(uo)?_generate(co,uo,eo,no+"/"+escapePathComponent(lo),ro):co!==uo&&(ro&&eo.push({op:"test",path:no+"/"+escapePathComponent(lo),value:_deepClone(co)}),eo.push({op:"replace",path:no+"/"+escapePathComponent(lo),value:_deepClone(uo)}))}else Array.isArray(to)===Array.isArray(ue)?(ro&&eo.push({op:"test",path:no+"/"+escapePathComponent(lo),value:_deepClone(co)}),eo.push({op:"remove",path:no+"/"+escapePathComponent(lo)}),ao=!0):(ro&&eo.push({op:"test",path:no,value:to}),eo.push({op:"replace",path:no,value:ue}))}if(!(!ao&&oo.length==io.length))for(var so=0;so<oo.length;so++){var lo=oo[so];!hasOwnProperty$6(to,lo)&&ue[lo]!==void 0&&eo.push({op:"add",path:no+"/"+escapePathComponent(lo),value:_deepClone(ue[lo])})}}}function compare$1(to,ue,eo){eo===void 0&&(eo=!1);var no=[];return _generate(to,ue,no,"",eo),no}const duplex=Object.freeze(Object.defineProperty({__proto__:null,compare:compare$1,generate:generate$1,observe:observe$2,unobserve:unobserve$1},Symbol.toStringTag,{value:"Module"}));Object.assign({},core,duplex,{JsonPatchError:PatchError,deepClone:_deepClone,escapePathComponent,unescapePathComponent});const Operations={Add:"Add",Delete:"Delete",Change:"Change"},initialState$2={history:[],position:0,loading:!1},createHistoryStore=({getDoc:to,selectDoc:ue,beforeAction:eo,afterAction:no})=>{const ro=writable(initialState$2),oo=derived(ro,go=>({...go,canUndo:go.position>0,canRedo:go.position<go.history.length}));let io,ao;const so=()=>{ro.update(go=>(go.loading=!0,go))},lo=()=>{ro.update(go=>(go.loading=!1,go))},co=()=>{ro.set(initialState$2)},uo=go=>{ro.update(bo=>{let vo=bo.history,yo=bo.position;if(!go.id)go.id=Math.random(),vo=[...vo.slice(0,bo.position),go],yo+=1;else{const wo=vo.findIndex(ko=>ko.id===go.id);vo[wo].doc=go.doc}return{history:vo,position:yo}})},fo=go=>(io=async(bo,vo)=>{if(!(!bo||Array.isArray(bo))){so();try{const yo=to(bo._id),wo=_deepClone(await go(bo));return uo(yo?{type:Operations.Change,forwardPatch:compare$1(yo,bo),backwardsPatch:compare$1(bo,yo),doc:wo,id:vo}:{type:Operations.Add,doc:wo,id:vo}),lo(),wo}catch(yo){throw lo(),yo}}},io),po=go=>(ao=async(bo,vo)=>{if(!(!bo||Array.isArray(bo))){so();try{const yo=_deepClone(bo);await go(bo),uo({type:Operations.Delete,doc:yo,id:vo}),lo()}catch(yo){throw lo(),yo}}},ao),ho=async()=>{const{canUndo:go,history:bo,position:vo,loading:yo}=get_store_value(oo);if(!go||yo)return;const wo=bo[vo-1];if(wo){so(),await(eo==null?void 0:eo(wo)),ro.update(ko=>({...ko,position:ko.position-1}));try{if(wo.type===Operations.Add){const So=to(wo.doc._id)||wo.doc;await ao(So,wo.id)}else if(wo.type===Operations.Delete){let ko=_deepClone(wo.doc);delete ko._rev;const So=await io(ko,wo.id);ue==null||ue((So==null?void 0:So._id)||ko._id)}else{let ko=_deepClone(to(wo.doc._id));ko&&(applyPatch(ko,_deepClone(wo.backwardsPatch)),await io(ko,wo.id),ue==null||ue(ko._id))}lo()}catch(ko){throw lo(),ko}await(no==null?void 0:no(wo))}},_o=async()=>{const{canRedo:go,history:bo,position:vo,loading:yo}=get_store_value(oo);if(!go||yo)return;const wo=bo[vo];if(wo){so(),await(eo==null?void 0:eo(wo)),ro.update(ko=>({...ko,position:ko.position+1}));try{if(wo.type===Operations.Add){let ko=_deepClone(wo.doc);delete ko._rev;const So=await io(ko,wo.id);ue==null||ue((So==null?void 0:So._id)||ko._id)}else if(wo.type===Operations.Delete){const So=to(wo.doc._id)||wo.doc;await ao(So,wo.id)}else{let ko=_deepClone(to(wo.doc._id));ko&&(applyPatch(ko,_deepClone(wo.forwardPatch)),await io(ko,wo.id),ue==null||ue(ko._id))}lo()}catch(ko){throw lo(),ko}await(no==null?void 0:no(wo))}};return{subscribe:oo.subscribe,wrapSaveDoc:fo,wrapDeleteDoc:po,reset:co,undo:ho,redo:_o}},initialScreenState={screens:[]};class ScreenStore extends BudiStore{constructor(){super(initialScreenState),this.sequentialScreenPatch=sequential(async(ue,eo)=>{const ro=get_store_value(this.store).screens.find(ao=>ao._id===eo);if(!ro)return;let oo=fp$1.cloneDeep(ro);if(ue(oo)!==!1)return this.save(oo)}),this.select=this.select.bind(this),this.reset=this.reset.bind(this),this.syncAppScreens=this.syncAppScreens.bind(this),this.validate=this.validate.bind(this),this.patch=this.patch.bind(this),this.replace=this.replace.bind(this),this.saveScreen=this.saveScreen.bind(this),this.deleteScreen=this.deleteScreen.bind(this),this.syncScreenData=this.syncScreenData.bind(this),this.updateSetting=this.updateSetting.bind(this),this.sequentialScreenPatch=this.sequentialScreenPatch.bind(this),this.removeCustomLayout=this.removeCustomLayout.bind(this),this.history=createHistoryStore({getDoc:ue=>{var eo;return(eo=get_store_value(this.store).screens)==null?void 0:eo.find(no=>no._id===ue)},selectDoc:this.select,beforeAction:()=>{},afterAction:()=>{get_store_value(selectedComponent)||this.update(ue=>{var eo;return{...ue,selectedComponentId:(eo=get_store_value(selectedScreen))==null?void 0:eo.props._id}})}}),this.delete=this.history.wrapDeleteDoc(this.deleteScreen),this.save=this.history.wrapSaveDoc(this.saveScreen)}reset(){this.store.set({...initialScreenState})}syncAppScreens(ue){this.update(eo=>({...eo,screens:[...ue.screens]}))}select(ue){const eo=get_store_value(this.store),no=eo.screens.find(ro=>ro._id===ue);no&&eo.selectedScreenId!==no._id&&this.update(ro=>(ro.selectedScreenId=no._id,ro))}validate(ue){const eo=(ro,oo=[],io=[])=>{var lo,co,uo;const ao=ro._component;if(oo.includes(ao)||io.length&&!io.includes(ao))return ao;if(!((lo=ro==null?void 0:ro._children)!=null&&lo.length))return;["@budibase/standard-components/sidepanel","@budibase/standard-components/modal"].includes(ao)&&(oo=[]);const so=componentStore.getDefinition(ro._component);if(so==null)throw`Invalid defintion ${ro._component}`;if(io=[],(co=so==null?void 0:so.legalDirectChildren)!=null&&co.length&&(io=so.legalDirectChildren.map(fo=>`@budibase/standard-components/${fo}`)),(uo=so==null?void 0:so.illegalChildren)!=null&&uo.length){const fo=so.illegalChildren.map(po=>`@budibase/standard-components/${po}`);oo=[...new Set([...oo,...fo])]}for(let fo of ro._children){const po=eo(fo,oo,io);if(po)return po}},no=eo(ue.props);if(no){const ro=componentStore.getDefinition(no);throw`You can't place a ${ro==null?void 0:ro.name} here`}}async saveScreen(ue){var oo;(oo=get_store_value(appStore).features)!=null&&oo.componentValidation&&this.validate(ue),this.enrichEmptySettings(ue);const no=ue._id===void 0,ro=await API.saveScreen(ue);return this.update(io=>{const ao=io.screens.findIndex(so=>so._id===ro._id);return ao!==-1?io.screens.splice(ao,1,ro):io.screens.push(ro),no&&(io.selectedScreenId=ro._id,componentStore.update(so=>({...so,selectedComponentId:ro.props._id}))),io}),await this.syncScreenData(ro),ro}async syncScreenData(ue){const eo=get_store_value(appStore);let no=eo.usedPlugins;if(ue.pluginAdded){const{application:oo}=await API.fetchAppPackage(eo.appId);no=oo.usedPlugins||[]}const ro=await API.fetchAppRoutes();appStore.update(oo=>({...oo,routes:ro.routes,usedPlugins:no}))}async patch(ue,eo){if(eo||(eo=get_store_value(this.store).selectedScreenId),!(!eo||!ue))return await this.sequentialScreenPatch(ue,eo)}async replace(ue,eo){if(ue)if(!eo)this.update(no=>({...no,screens:no.screens.filter(ro=>ro._id!==ue)}));else{const no=get_store_value(this.store).screens.findIndex(ro=>ro._id===eo._id);no===-1?this.update(ro=>({...ro,screens:[...ro.screens,eo]})):this.update(ro=>(ro.screens[no]=eo,ro))}}async deleteScreen(ue){const eo=Array.isArray(ue)?ue:[ue];let no=[],ro=[];eo.filter(ao=>!!ao._id||!!ao._rev).forEach(ao=>{no.push(API.deleteScreen(ao._id,ao._rev)),ro.push(ao.routing.route)}),await Promise.all(no),await navigationStore.deleteLink(ro);const oo=eo.map(ao=>ao._id),io=await API.fetchAppRoutes();this.update(ao=>(ao.screens=ao.screens.filter(so=>!oo.includes(so._id)),ao.selectedScreenId&&oo.includes(ao.selectedScreenId)&&(delete ao.selectedScreenId,componentStore.update(so=>(delete so.selectedComponentId,so))),appStore.update(so=>({...so,routes:io.routes})),ao))}async updateSetting(ue,eo,no){if(!ue||!eo)return;const ro=so=>{if(!so||deepGet(so,eo)===no)return!1;deepSet(so,eo,no)};await this.patch(ro,ue._id);const oo=get_store_value(this.store),io=oo.screens.find(so=>so._id===ue._id);if(!io)return;const ao=oo.screens.filter(so=>so.routing.roleId===io.routing.roleId&&so.routing.homeScreen&&so._id!==ue._id);if(ao.length&&io.routing.homeScreen){const so=lo=>{lo.routing.homeScreen=!1};for(let lo of ao)await this.patch(so,lo._id)}}async removeCustomLayout(ue){const eo=get_store_value(layoutStore).layouts.find(ro=>ro._id===ue.layoutId),no=ro=>{delete ro.layoutId,ro.showNavigation=(eo==null?void 0:eo.props.navigation)!=="None",ro.width=(eo==null?void 0:eo.props.width)||"Large"};await this.patch(no,ue._id)}async enrichEmptySettings(ue){findAllMatchingComponents(ue.props,no=>no).forEach(no=>{componentStore.enrichEmptySettings(no,{screen:ue})})}}const screenStore=new ScreenStore,selectedScreen=derived(screenStore,to=>to.screens.find(ue=>ue._id===to.selectedScreenId)),sortedScreens=derived(screenStore,to=>to.screens.slice().sort((ue,eo)=>{const no=getRolePriority(ue.routing.roleId),ro=getRolePriority(eo.routing.roleId);if(no!==ro)return no>ro?-1:1;const oo=!!ue.routing.homeScreen,io=!!eo.routing.homeScreen;if(oo!==io)return oo?-1:1;const ao=ue.routing.route.split("/"),so=eo.routing.route.split("/");let lo=Math.min(ao.length,so.length);for(let co=0;co<lo;co++)if(ao[co]!==so[co])return ao[co]<so[co]?-1:1;return ao.length<so.length?-1:1})),INITIAL_COMPONENTS_STATE={components:{},customComponents:[],settingsCache:{}};class ComponentStore extends BudiStore{constructor(){super(INITIAL_COMPONENTS_STATE),this.reset=this.reset.bind(this),this.refreshDefinitions=this.refreshDefinitions.bind(this),this.getDefinition=this.getDefinition.bind(this),this.getDefaultDatasource=this.getDefaultDatasource.bind(this),this.enrichEmptySettings=this.enrichEmptySettings.bind(this),this.createInstance=this.createInstance.bind(this),this.create=this.create.bind(this),this.patch=this.patch.bind(this),this.delete=this.delete.bind(this),this.copy=this.copy.bind(this),this.paste=this.paste.bind(this),this.select=this.select.bind(this),this.getPrevious=this.getPrevious.bind(this),this.getNext=this.getNext.bind(this),this.selectPrevious=this.selectPrevious.bind(this),this.selectNext=this.selectNext.bind(this),this.moveUp=this.moveUp.bind(this),this.moveDown=this.moveDown.bind(this),this.updateStyle=this.updateStyle.bind(this),this.updateStyles=this.updateStyles.bind(this),this.updateCustomStyle=this.updateCustomStyle.bind(this),this.updateConditions=this.updateConditions.bind(this),this.requestEjectBlock=this.requestEjectBlock.bind(this),this.handleEjectBlock=this.handleEjectBlock.bind(this),this.updateSetting=this.updateSetting.bind(this),this.updateComponentSetting=this.updateComponentSetting.bind(this),this.addParent=this.addParent.bind(this),this.isCached=this.isCached.bind(this),this.cacheSettings=this.cacheSettings.bind(this),this.getComponentSettings=this.getComponentSettings.bind(this)}reset(){this.store.set({...INITIAL_COMPONENTS_STATE})}async refreshDefinitions(ue){if(!ue)return;const eo=await API.fetchComponentLibDefinitions(ue),no=Object.keys(eo).filter(ro=>ro.startsWith("plugin/"));return this.update(ro=>({...ro,components:eo,customComponents:no})),appStore.syncClientFeatures(eo.features),appStore.syncClientTypeSupportPresets((eo==null?void 0:eo.typeSupportPresets)??{}),eo}getDefinition(ue){return ue?get_store_value(this.store).components[ue]:null}getDefaultDatasource(){const ue=get_store_value(tables).list.filter(no=>no._id!=="ta_users");let eo=ue.find(no=>no.sourceId===BUDIBASE_INTERNAL_DB_ID&&no.sourceType===DB_TYPE_INTERNAL);return eo||(eo=ue.find(no=>no.sourceId===DEFAULT_BB_DATASOURCE_ID&&no.sourceType===DB_TYPE_INTERNAL),eo)?eo:ue.find(no=>no.sourceType===DB_TYPE_EXTERNAL)}migrateSettings(ue){var io;const eo="@budibase/standard-components";let no=!1;if((ue==null?void 0:ue._component)===`${eo}/formblock`){if(!("buttons"in ue))ue.buttons=buildFormBlockButtonConfig(ue),no=!0;else if(ue.buttons==null){const{_id:ao,actionType:so,dataSource:lo}=ue;ue.buttons=buildFormBlockButtonConfig({_id:ao,actionType:so,dataSource:lo}),no=!0}"buttonPosition"in ue||(ue.buttonPosition="top",no=!0)}if(!(ue!=null&&ue._component))return no;const ro=this.getDefinition(ue==null?void 0:ue._component),oo=(io=ro==null?void 0:ro.settings)==null?void 0:io.filter(ao=>{var so;return(so=ao==null?void 0:ao.type)==null?void 0:so.startsWith("filter")});for(let ao of oo||[])if(Array.isArray(ue[ao.key])){const lo=processSearchFilters(ue[ao.key]);ue[ao.key]=lo,no=!0}return no}enrichEmptySettings(ue,eo){if(!(ue!=null&&ue._component))return;const no=this.getDefaultDatasource(),ro=this.getComponentSettings(ue._component),{parent:oo,screen:io,useDefaultValues:ao}=eo||{},so=(oo==null?void 0:oo._id)||ue._id;if(io&&(ro.forEach(lo=>{var uo,fo;const co=ue[lo.key];if(co==null||co==="")if(lo.type==="multifield"&&lo.selectAllFields)ue[lo.key]=Object.keys((no==null?void 0:no.schema)||{});else if((lo.type==="dataSource"||lo.type==="table")&&no)ue[lo.key]={label:no.name,tableId:no._id,resourceId:no._id,type:"table"};else if(lo.type==="dataProvider"){const ho=findComponentPath(io.props,so).filter(_o=>{var go;return(go=_o._component)==null?void 0:go.endsWith("/dataprovider")});if(ho.length){const _o=(uo=ho[ho.length-1])==null?void 0:uo._id;ue[lo.key]=`{{ literal ${makePropSafe(_o)} }}`}}else if(lo.type.startsWith("field/")){let po=getComponentFieldOptions(io.props,so,lo.type,!1);const ho=findClosestMatchingComponent(io.props,so,go=>go._component==="@budibase/standard-components/form"),_o=Object.keys(buildFormSchema(ho)||{});po=po.filter(go=>!_o.includes(go)),po[0]&&(ue[lo.key]=po[0],ue.label=po[0])}else ao&&lo.defaultValue!==void 0&&(ue[lo.key]=lo.defaultValue);else if(lo.type==="dataProvider"){const po=findAllMatchingComponents(io==null?void 0:io.props,_o=>_o._component==="@budibase/standard-components/dataprovider");if(!(po==null?void 0:po.some(_o=>{var go;return(go=co.includes)==null?void 0:go.call(co,_o._id)})))if(po.length){const _o=(fo=po[po.length-1])==null?void 0:fo._id;ue[lo.key]=`{{ literal ${makePropSafe(_o)} }}`}else delete ue[lo.key]}}),ue._component.endsWith("/cardsblock")&&["cardTitle","cardSubtitle","cardDescription"].every(co=>!ue[co])&&!ue.cardImageURL)){const{_id:co,dataSource:uo}=ue;if(uo){const{schema:fo,table:po}=getSchemaForDatasource(io,uo,{}),ho=wo=>(Array.isArray(wo)||(wo=[wo]),Object.entries(fo||{}).filter(([ko,So])=>wo.includes(So.type)&&!So.autoColumn&&ko!==(po==null?void 0:po.primaryDisplay)&&!ko.startsWith("_")).map(([ko])=>ko)),_o=(wo,ko,...So)=>{So.some(Ao=>Ao==null)?ue[wo]=ko:(So.unshift(`${co}-repeater`),ue[wo]=`{{ ${So.map(makePropSafe).join(".")} }}`)},go=[...ho(FieldType.STRING),...ho(FieldType.OPTIONS),...ho(FieldType.ARRAY),...ho(FieldType.NUMBER)],bo=ho(FieldType.LONGFORM);po!=null&&po.primaryDisplay&&(fo!=null&&fo[po.primaryDisplay])&&go.unshift(po.primaryDisplay),_o("cardTitle","Title",go[0]),_o("cardSubtitle","Subtitle",go[1]);const vo=bo[0]??go[2];_o("cardDescription","Description",vo);let yo=ho(FieldType.ATTACHMENT_SINGLE)[0];yo?_o("cardImageURL",null,yo,"url"):(yo=ho(FieldType.ATTACHMENTS)[0],yo&&_o("cardImageURL",null,yo,0,"url"))}}}createInstance(ue,eo,no){const ro=get_store_value(selectedScreen);if(!ro)throw"A valid screen must be selected";const oo=this.getDefinition(ue);if(!oo)return null;let io={_id:uuid$2(),_component:oo.component,_styles:{normal:{},hover:{},active:{}},_instanceName:`New ${oo.friendlyName||oo.name}`,...eo};this.enrichEmptySettings(io,{parent:no,screen:ro,useDefaultValues:!0});try{this.migrateSettings(io)}catch(so){throw console.error(so),so}let ao={};if(oo.hasChildren&&(ao._children=[]),ue.endsWith("/formstep")){const so=findClosestMatchingComponent(ro.props,get_store_value(selectedComponent)._id,co=>co._component.endsWith("/form")),lo=findAllMatchingComponents(so,co=>co._component.endsWith("/formstep"));ao.step=lo.length+1,ao._instanceName=`Step ${lo.length+1}`}return{...fp$1.cloneDeep(io),...ao}}async create(ue,eo,no,ro){const oo=get_store_value(this.store),io=this.createInstance(ue,eo,no);if(io)return no&&ro!=null?await screenStore.patch(ao=>{var lo;let so=findComponent(ao.props,no);(lo=so._children)!=null&&lo.length?so._children.splice(ro,0,io):so._children=[io]},null):await screenStore.patch(ao=>{let so=oo.selectedComponentId;so!=null&&so.startsWith(`${ao._id}-`)&&(so=ao.props._id);const lo=findComponent(ao.props,so);if(!lo)return!1;let co;if(lo){const uo=this.getDefinition(lo._component);uo!=null&&uo.hasChildren?co=lo:co=findComponentParent(ao.props,lo._id)}else co=ao.props;if(!co)return!1;co._children||(co._children=[]),co._children.push(io)},null),this.update(ao=>(ao.selectedComponentId=io._id,ao)),componentTreeNodesStore.makeNodeVisible(io._id),analytics.captureEvent(Events.COMPONENT_CREATED,{name:io._component}),io}async patch(ue,eo,no){if(!eo||!no){const oo=get_store_value(this.store);eo=eo??oo.selectedComponentId??void 0;const io=get_store_value(screenStore);no=no||io.selectedScreenId}if(!eo||!no||!ue)return;const ro=oo=>{let io=findComponent(oo.props,eo);if(!io)return!1;const ao=ue(io,oo);return this.migrateSettings(io)?null:ao};await screenStore.patch(ro,no)}async delete(ue){if(!ue)return;const eo=get_store_value(this.store);let no="";eo.selectedComponentId===ue._id&&(no=this.getNext(),no||(no=this.getPrevious())),no&&(no.endsWith("-navigation")&&(no=no.replace("-navigation","-screen")),this.update(ro=>(ro.selectedComponentId=no,ro))),await screenStore.patch(ro=>{if(ue=findComponent(ro.props,ue._id),!ue)return!1;const oo=findComponentParent(ro.props,ue._id);if(!oo)return!1;oo._children=oo._children.filter(io=>io._id!==ue._id)},null)}copy(ue,eo=!1,no=!0){if(this.update(ro=>(ro.componentToPaste=fp$1.cloneDeep(ue),ro.componentToPaste.isCut=eo,ro.componentToPaste.screenId=get_store_value(screenStore).selectedScreenId,ro)),eo&&no){const ro=get_store_value(selectedScreen),oo=findComponentParent(ro==null?void 0:ro.props,ue._id);oo&&this.update(io=>(io.selectedComponentId=oo._id,io))}}select(ue){this.update(eo=>(eo.selectedComponentId=ue,eo))}async paste(ue,eo,no,ro=!0){const oo=get_store_value(this.store);if(!oo.componentToPaste)return;let io="",ao=fp$1.cloneDeep(oo.componentToPaste);ao.isCut&&this.update(co=>(delete co.componentToPaste,co));const so=co=>{var ho;if(ue=findComponent(co.props,ue._id),!ue)return!1;const uo=ao.isCut,fo=ao.screenId,po=ao._id;if(delete ao.isCut,delete ao.screenId,uo||(ao=makeComponentUnique(ao)),io=ao._id,fo&&fo!==co._id)for(let _o of Object.keys(((ho=ao._styles)==null?void 0:ho.normal)||{}))_o.startsWith("--grid")&&(_o.endsWith("-start")||_o.endsWith("-end"))&&delete ao._styles.normal[_o];if(uo){const _o=findComponentParent(co.props,po);_o!=null&&_o._children&&(_o._children=_o._children.filter(go=>go._id!==po))}if(eo==="inside"){const _o=this.getDefinition(ue._component);_o!=null&&_o.hasChildren||(eo="below")}if(eo==="inside")ue._children||(ue._children=[]),ue._children.push(ao);else{const _o=findComponentParent(co.props,ue._id);if(!(_o!=null&&_o._children))return!1;const go=_o._children.findIndex(vo=>vo._id===ue._id),bo=eo==="above"?go:go+1;_o._children.splice(bo,0,ao)}},lo=(no==null?void 0:no._id)??oo.selectedScreenId??null;await screenStore.patch(so,lo),ro&&this.update(co=>(co.selectedScreenId=lo,co.selectedComponentId=io,co)),componentTreeNodesStore.makeNodeVisible(io)}getPrevious(){var so,lo;const eo=get_store_value(this.store).selectedComponentId,no=get_store_value(selectedScreen);if(!no)throw"A valid screen must be selected";const ro=findComponentParent(no.props,eo),oo=ro==null?void 0:ro._children.findIndex(co=>co._id===eo),io=`${no._id}-screen`,ao=`${no._id}-navigation`;if(eo===io)return null;if(eo===ao)return io;if(ro._id===no.props._id&&oo===0)return ao;if(oo>0){const co=ro._children[oo-1];if((so=co._children)!=null&&so.length&&componentTreeNodesStore.isNodeExpanded(co._id)){let uo=co;for(;(lo=uo._children)!=null&&lo.length&&componentTreeNodesStore.isNodeExpanded(uo._id);)uo=uo._children[uo._children.length-1];return uo._id}return co._id}return ro._id}getNext(){var fo,po;const ue=get_store_value(this.store),eo=get_store_value(selectedComponent),no=eo==null?void 0:eo._id,ro=get_store_value(selectedScreen);if(!ro)throw"A valid screen must be selected";const oo=findComponentParent(ro.props,no),io=oo==null?void 0:oo._children.findIndex(ho=>ho._id===no),ao=`${ro._id}-screen`,so=`${ro._id}-navigation`;if(ue.selectedComponentId===ao)return so;if((fo=eo._children)!=null&&fo.length&&(ue.selectedComponentId===so||componentTreeNodesStore.isNodeExpanded(eo._id)))return eo._children[0]._id;if(!oo)return null;if(io<oo._children.length-1)return oo._children[io+1]._id;let lo=oo,co=findComponentParent(ro.props,lo._id),uo=co==null?void 0:co._children.findIndex(ho=>ho._id===lo._id);for(;co!=null&&uo===((po=co._children)==null?void 0:po.length)-1;)lo=co,co=findComponentParent(ro.props,lo._id),uo=co==null?void 0:co._children.findIndex(ho=>ho._id===lo._id);return co?co._children[uo+1]._id:null}selectPrevious(){const ue=this.getPrevious();ue&&this.update(eo=>(eo.selectedComponentId=ue,eo))}selectNext(){const ue=this.getNext();ue&&this.update(eo=>(eo.selectedComponentId=ue,eo))}async moveUp(ue){await screenStore.patch(eo=>{const no=ue==null?void 0:ue._id,ro=findComponentParent(eo.props,no),oo=ro==null?void 0:ro._children.findIndex(ao=>ao._id===no);if(!ro||oo===0&&ro._id===eo.props._id)return;const io=fp$1.cloneDeep(ro._children[oo]);if(ro._children=ro._children.filter(ao=>ao._id!==no),oo>0){const ao=ro._children[oo-1],so=this.getDefinition(ao._component);so!=null&&so.hasChildren&&componentTreeNodesStore.isNodeExpanded(ao._id)?ao._children.push(io):ro._children.splice(oo-1,0,io)}else if(ro._id!==eo.props._id){const ao=findComponentParent(eo.props,ro._id),so=ao._children.findIndex(lo=>lo._id===ro._id);ao._children.splice(so,0,io)}},null)}async moveDown(ue){await screenStore.patch(eo=>{var ao;const no=ue==null?void 0:ue._id,ro=findComponentParent(eo.props,no);if(!((ao=ro==null?void 0:ro._children)!=null&&ao.length))return!1;const oo=ro._children.findIndex(so=>so._id===no);if(oo===ro._children.length-1&&ro._id===eo.props._id)return;const io=fp$1.cloneDeep(ro._children[oo]);if(ro._children=ro._children.filter(so=>so._id!==no),oo<ro._children.length){const so=ro._children[oo],lo=this.getDefinition(so._component);lo!=null&&lo.hasChildren&&componentTreeNodesStore.isNodeExpanded(so._id)?so._children.splice(0,0,io):ro._children.splice(oo+1,0,io)}else{const so=findComponentParent(eo.props,ro._id),lo=so._children.findIndex(co=>co._id===ro._id);so._children.splice(lo+1,0,io)}},null)}async updateStyle(ue,eo){await this.patch(no=>{eo==null||eo===""?delete no._styles.normal[ue]:no._styles.normal[ue]=eo})}async updateStyles(ue,eo){const no=ro=>{ro._styles.normal={...ro._styles.normal,...ue}};await this.patch(no,eo)}async updateCustomStyle(ue){await this.patch(eo=>{eo._styles.custom=ue})}async updateConditions(ue){await this.patch(eo=>{eo._conditions=ue})}async updateSetting(ue,eo){await this.patch(this.updateComponentSetting(ue,eo))}updateComponentSetting(ue,eo){return no=>{if(!ue||!no||no[ue]===eo)return!1;const ro=this.getComponentSettings(no._component),oo=ro.find(io=>io.key===ue);if(ro.forEach(io=>{(ue===io.resetOn||Array.isArray(io.resetOn)&&io.resetOn.includes(ue))&&(no[io.key]=io.defaultValue||null)}),(oo==null?void 0:oo.type)==="dataSource"||(oo==null?void 0:oo.type)==="table"){const{schema:io}=getSchemaForDatasource(null,eo,null),ao=Object.keys(io||{});ro.filter(lo=>lo.type==="multifield"&&lo.selectAllFields).map(lo=>lo.key).forEach(lo=>{no[lo]=ao})}return no[ue]=eo,!0}}requestEjectBlock(ue){previewStore.sendEvent("eject-block",ue)}async handleEjectBlock(ue,eo){let no;await screenStore.patch(ro=>{var lo;const oo=findComponent(ro.props,ue),io=findComponentParent(ro.props,ue);if(!oo||!((lo=io==null?void 0:io._children)!=null&&lo.length))return!1;analytics.captureEvent(Events.BLOCK_EJECTED,{block:oo._component});const ao=findAllMatchingComponents(eo,co=>co._containsSlot)[0];ao&&(delete ao._containsSlot,ao._children=[...ao._children||[],...oo._children||[]]),eo=makeComponentUnique(eo);const so=io._children.findIndex(co=>co._id===ue);io._children[so]=eo,no=eo._id},null),no&&this.update(ro=>(ro.selectedComponentId=no,ro))}async addParent(ue,eo){if(!ue||!eo)return;const no=this.createInstance(eo,null,parent);no&&(await screenStore.patch(ro=>{let oo=findComponent(ro.props,ue),io=findComponentParent(ro.props,ue);if(!oo||!io)return!1;const ao=io._children.findIndex(so=>so._id===ue);if(ao===-1)return!1;io._children[ao]={...no,_children:[oo]}},null),this.update(ro=>(ro.selectedComponentId=no._id,ro)))}isCached(ue){const eo=get_store_value(this.store).settingsCache;return ue in eo}cacheSettings(ue,eo){var ro,oo;let no=[];return eo&&(no=((ro=eo.settings)==null?void 0:ro.filter(io=>!io.section))??[],(oo=eo.settings)==null||oo.filter(io=>io.section).forEach(io=>{no=no.concat((io.settings||[]).map(ao=>({...ao,section:io.name})))})),this.update(io=>({...io,settingsCache:{...io.settingsCache,[ue]:no}})),no}getComponentSettings(ue){if(!ue)return[];!ue.startsWith("plugin/")&&!ue.startsWith("@budibase")&&(ue=`@budibase/standard-components/${ue}`);const eo=get_store_value(this.store).settingsCache[ue];if(eo)return eo;const no=this.getDefinition(ue);return this.cacheSettings(ue,no)}}const componentStore=new ComponentStore,selectedComponent=derived([componentStore,selectedScreen],([to,ue])=>{var ro;if(ue&&((ro=to.selectedComponentId)!=null&&ro.startsWith(`${ue._id}-`)))return ue==null?void 0:ue.props;if(!ue||!to.selectedComponentId)return null;const eo=findComponent(ue==null?void 0:ue.props,to.selectedComponentId),no=eo&&fp$1.cloneDeep(eo);return componentStore.migrateSettings(no),no}),INITIAL_NAVIGATION_STATE={navigation:"Top",links:[],textAlign:"Left"};class NavigationStore extends BudiStore{constructor(){super(INITIAL_NAVIGATION_STATE)}syncAppNavigation(ue){this.update(eo=>({...eo,...ue}))}reset(){this.store.set({...INITIAL_NAVIGATION_STATE})}async save(ue){const eo=get_store_value(appStore).appId,no=await API.saveAppMetadata(eo,{navigation:ue});no.navigation&&this.syncAppNavigation(no.navigation)}async saveLink(ue,eo,no){const ro=get_store_value(this.store);let oo=[...(ro==null?void 0:ro.links)??[]];oo.find(io=>io.url===ue&&io.text===eo)||(oo.push({text:eo,url:ue,type:"link",roleId:no}),await this.save({...ro,links:[...oo]}))}async deleteLink(ue){const eo=get_store_value(this.store);let no=eo==null?void 0:eo.links;no!=null&&no.length&&(ue=Array.isArray(ue)?ue:[ue],no=no.filter(ro=>!ue.includes(ro.url)),no.forEach(ro=>{var oo;ro.type==="sublinks"&&((oo=ro.subLinks)!=null&&oo.length)&&(ro.subLinks=ro.subLinks.filter(io=>!ue.includes(io.url)))}),await this.save({...eo,links:no}))}syncMetadata(ue){const{navigation:eo}=ue;this.syncAppNavigation(eo)}}const navigationStore=new NavigationStore;class ThemeStore extends BudiStore{constructor(){super({theme:DefaultAppTheme$1,customTheme:{}}),this.syncAppTheme=ue=>{this.update(eo=>{const no=ensureValidTheme(ue.theme,DefaultAppTheme$1);return{...eo,theme:no,customTheme:ue.customTheme||{}}})},this.save=async(ue,eo)=>{const no=await API.saveAppMetadata(eo,{theme:ue});this.update(ro=>({...ro,theme:ensureValidTheme(no.theme,DefaultAppTheme$1)}))},this.saveCustom=async(ue,eo)=>{const no={...get_store_value(this).customTheme,...ue},ro=await API.saveAppMetadata(eo,{customTheme:no});this.update(oo=>({...oo,customTheme:ro.customTheme||{}}))},this.syncMetadata=ue=>{const{theme:eo,customTheme:no}=ue;this.update(ro=>({...ro,theme:ensureValidTheme(eo,DefaultAppTheme$1),customTheme:no||{}}))}}}const themeStore=new ThemeStore,createBuilderWebsocket=to=>{const ue=createWebsocket("/socket/builder");return ue.on("connect",()=>{ue.emit(BuilderSocketEvent.SelectApp,{appId:to},({users:eo})=>{userStore.init(eo)})}),ue.on("connect_error",eo=>{console.error("Failed to connect to builder websocket:",eo.message)}),ue.on("disconnect",()=>{userStore.reset()}),ue.onOther(SocketEvent.UserUpdate,({user:eo})=>{userStore.updateUser(eo)}),ue.onOther(SocketEvent.UserDisconnect,({sessionId:eo})=>{userStore.removeUser(eo)}),ue.onOther(BuilderSocketEvent.LockTransfer,({userId:eo})=>{var no,ro;eo===((ro=(no=get_store_value(auth))==null?void 0:no.user)==null?void 0:ro._id)&&appStore.update(oo=>({...oo,hasLock:!0}))}),ue.onOther(BuilderSocketEvent.TableChange,({id:eo,table:no})=>{tables.replaceTable(eo,no)}),ue.onOther(BuilderSocketEvent.DatasourceChange,({id:eo,datasource:no})=>{datasources.replaceDatasource(eo,no)}),ue.onOther(BuilderSocketEvent.RoleChange,({id:eo,role:no})=>{roles.replace(eo,no)}),ue.onOther(BuilderSocketEvent.ScreenChange,({id:eo,screen:no})=>{screenStore.replace(eo,no)}),ue.onOther(BuilderSocketEvent.AppMetadataChange,({metadata:eo})=>{appStore.syncMetadata(eo),themeStore.syncMetadata(eo),navigationStore.syncMetadata(eo),snippets$1.syncMetadata(eo)}),ue.onOther(BuilderSocketEvent.AppPublishChange,async({user:eo,published:no})=>{await appsStore.load(),no&&await deploymentStore.load();const ro=no?"published":"unpublished";notifications.success(`${getUserLabel(eo)} ${ro} this app`)}),ue.onOther(BuilderSocketEvent.AutomationChange,({id:eo,automation:no})=>{automationStore.actions.replace(eo,no)}),ue};function create_fragment$9f(to){let ue;return{c(){ue=element("div"),ue.innerHTML=`In this section you can manage the data for your app:
|
|
508
|
+
*/var beforeDict=new WeakMap,Mirror=function(){function to(ue){this.observers=new Map,this.obj=ue}return to}(),ObserverInfo=function(){function to(ue,eo){this.callback=ue,this.observer=eo}return to}();function getMirror(to){return beforeDict.get(to)}function getObserverFromMirror(to,ue){return to.observers.get(ue)}function removeObserverFromMirror(to,ue){to.observers.delete(ue.callback)}function unobserve$1(to,ue){ue.unobserve()}function observe$2(to,ue){var eo=[],no,ro=getMirror(to);if(!ro)ro=new Mirror(to),beforeDict.set(to,ro);else{var oo=getObserverFromMirror(ro,ue);no=oo&&oo.observer}if(no)return no;if(no={},ro.value=_deepClone(to),ue){no.callback=ue,no.next=null;var io=function(){generate$1(no)},ao=function(){clearTimeout(no.next),no.next=setTimeout(io)};typeof window<"u"&&(window.addEventListener("mouseup",ao),window.addEventListener("keyup",ao),window.addEventListener("mousedown",ao),window.addEventListener("keydown",ao),window.addEventListener("change",ao))}return no.patches=eo,no.object=to,no.unobserve=function(){generate$1(no),clearTimeout(no.next),removeObserverFromMirror(ro,no),typeof window<"u"&&(window.removeEventListener("mouseup",ao),window.removeEventListener("keyup",ao),window.removeEventListener("mousedown",ao),window.removeEventListener("keydown",ao),window.removeEventListener("change",ao))},ro.observers.set(ue,new ObserverInfo(ue,no)),no}function generate$1(to,ue){ue===void 0&&(ue=!1);var eo=beforeDict.get(to.object);_generate(eo.value,to.object,to.patches,"",ue),to.patches.length&&applyPatch(eo.value,to.patches);var no=to.patches;return no.length>0&&(to.patches=[],to.callback&&to.callback(no)),no}function _generate(to,ue,eo,no,ro){if(ue!==to){typeof ue.toJSON=="function"&&(ue=ue.toJSON());for(var oo=_objectKeys(ue),io=_objectKeys(to),ao=!1,so=io.length-1;so>=0;so--){var lo=io[so],co=to[lo];if(hasOwnProperty$6(ue,lo)&&!(ue[lo]===void 0&&co!==void 0&&Array.isArray(ue)===!1)){var uo=ue[lo];typeof co=="object"&&co!=null&&typeof uo=="object"&&uo!=null&&Array.isArray(co)===Array.isArray(uo)?_generate(co,uo,eo,no+"/"+escapePathComponent(lo),ro):co!==uo&&(ro&&eo.push({op:"test",path:no+"/"+escapePathComponent(lo),value:_deepClone(co)}),eo.push({op:"replace",path:no+"/"+escapePathComponent(lo),value:_deepClone(uo)}))}else Array.isArray(to)===Array.isArray(ue)?(ro&&eo.push({op:"test",path:no+"/"+escapePathComponent(lo),value:_deepClone(co)}),eo.push({op:"remove",path:no+"/"+escapePathComponent(lo)}),ao=!0):(ro&&eo.push({op:"test",path:no,value:to}),eo.push({op:"replace",path:no,value:ue}))}if(!(!ao&&oo.length==io.length))for(var so=0;so<oo.length;so++){var lo=oo[so];!hasOwnProperty$6(to,lo)&&ue[lo]!==void 0&&eo.push({op:"add",path:no+"/"+escapePathComponent(lo),value:_deepClone(ue[lo])})}}}function compare$1(to,ue,eo){eo===void 0&&(eo=!1);var no=[];return _generate(to,ue,no,"",eo),no}const duplex=Object.freeze(Object.defineProperty({__proto__:null,compare:compare$1,generate:generate$1,observe:observe$2,unobserve:unobserve$1},Symbol.toStringTag,{value:"Module"}));Object.assign({},core,duplex,{JsonPatchError:PatchError,deepClone:_deepClone,escapePathComponent,unescapePathComponent});const initialState$2={history:[],position:0,loading:!1},createHistoryStore=({getDoc:to,selectDoc:ue,beforeAction:eo,afterAction:no})=>{const ro=writable(initialState$2),oo=derived(ro,go=>({...go,canUndo:go.position>0,canRedo:go.position<go.history.length}));let io,ao;const so=()=>{ro.update(go=>(go.loading=!0,go))},lo=()=>{ro.update(go=>(go.loading=!1,go))},co=()=>{ro.set(initialState$2)},uo=go=>{ro.update(bo=>{let vo=bo.history,yo=bo.position;if(!go.id)go.id=Math.random(),vo=[...vo.slice(0,bo.position),go],yo+=1;else{const wo=vo.findIndex(ko=>ko.id===go.id);vo[wo].doc=go.doc}return{history:vo,position:yo}})},fo=go=>(io=async(bo,vo)=>{if(!(!bo||Array.isArray(bo))){so();try{const yo=to(bo._id),wo=_deepClone(await go(bo));return uo(yo?{type:"Change",forwardPatch:compare$1(yo,bo),backwardsPatch:compare$1(bo,yo),doc:wo,id:vo}:{type:"Add",doc:wo,id:vo}),lo(),wo}catch(yo){throw lo(),yo}}},io),po=go=>(ao=async(bo,vo)=>{if(!(!bo||Array.isArray(bo))){so();try{const yo=_deepClone(bo);await go(bo),uo({type:"Delete",doc:yo,id:vo}),lo()}catch(yo){throw lo(),yo}}},ao),ho=async()=>{const{canUndo:go,history:bo,position:vo,loading:yo}=get_store_value(oo);if(!go||yo)return;const wo=bo[vo-1];if(wo){so(),await(eo==null?void 0:eo(wo)),ro.update(ko=>({...ko,position:ko.position-1}));try{if(wo.type==="Add"){const So=to(wo.doc._id)||wo.doc;await ao(So,wo.id)}else if(wo.type==="Delete"){let ko=_deepClone(wo.doc);delete ko._rev;const So=await io(ko,wo.id);ue==null||ue((So==null?void 0:So._id)||ko._id)}else{let ko=_deepClone(to(wo.doc._id));ko&&(applyPatch(ko,_deepClone(wo.backwardsPatch)),await io(ko,wo.id),ue==null||ue(ko._id))}lo()}catch(ko){throw lo(),ko}await(no==null?void 0:no(wo))}},_o=async()=>{const{canRedo:go,history:bo,position:vo,loading:yo}=get_store_value(oo);if(!go||yo)return;const wo=bo[vo];if(wo){so(),await(eo==null?void 0:eo(wo)),ro.update(ko=>({...ko,position:ko.position+1}));try{if(wo.type==="Add"){let ko=_deepClone(wo.doc);delete ko._rev;const So=await io(ko,wo.id);ue==null||ue((So==null?void 0:So._id)||ko._id)}else if(wo.type==="Delete"){const So=to(wo.doc._id)||wo.doc;await ao(So,wo.id)}else{let ko=_deepClone(to(wo.doc._id));ko&&(applyPatch(ko,_deepClone(wo.forwardPatch)),await io(ko,wo.id),ue==null||ue(ko._id))}lo()}catch(ko){throw lo(),ko}await(no==null?void 0:no(wo))}};return{subscribe:oo.subscribe,wrapSaveDoc:fo,wrapDeleteDoc:po,reset:co,undo:ho,redo:_o}},initialScreenState={screens:[]};class ScreenStore extends BudiStore{constructor(){super(initialScreenState),this.sequentialScreenPatch=sequential(async(ue,eo)=>{const ro=get_store_value(this.store).screens.find(ao=>ao._id===eo);if(!ro)return;let oo=fp$1.cloneDeep(ro);if(ue(oo)!==!1)return this.save(oo)}),this.select=this.select.bind(this),this.reset=this.reset.bind(this),this.syncAppScreens=this.syncAppScreens.bind(this),this.validate=this.validate.bind(this),this.patch=this.patch.bind(this),this.replace=this.replace.bind(this),this.saveScreen=this.saveScreen.bind(this),this.deleteScreen=this.deleteScreen.bind(this),this.syncScreenData=this.syncScreenData.bind(this),this.updateSetting=this.updateSetting.bind(this),this.sequentialScreenPatch=this.sequentialScreenPatch.bind(this),this.removeCustomLayout=this.removeCustomLayout.bind(this),this.history=createHistoryStore({getDoc:ue=>{var eo;return(eo=get_store_value(this.store).screens)==null?void 0:eo.find(no=>no._id===ue)},selectDoc:this.select,afterAction:()=>{get_store_value(selectedComponent)||componentStore.update(ue=>{var eo;return{...ue,selectedComponentId:(eo=get_store_value(selectedScreen))==null?void 0:eo._id}})}}),this.delete=this.history.wrapDeleteDoc(this.deleteScreen),this.save=this.history.wrapSaveDoc(this.saveScreen)}reset(){this.store.set({...initialScreenState})}syncAppScreens(ue){this.update(eo=>({...eo,screens:[...ue.screens]}))}select(ue){const eo=get_store_value(this.store),no=eo.screens.find(ro=>ro._id===ue);no&&eo.selectedScreenId!==no._id&&this.update(ro=>(ro.selectedScreenId=no._id,ro))}validate(ue){const eo=(ro,oo=[],io=[])=>{var lo,co,uo;const ao=ro._component;if(oo.includes(ao)||io.length&&!io.includes(ao))return ao;if(!((lo=ro==null?void 0:ro._children)!=null&&lo.length))return;["@budibase/standard-components/sidepanel","@budibase/standard-components/modal"].includes(ao)&&(oo=[]);const so=componentStore.getDefinition(ro._component);if(so==null)throw`Invalid defintion ${ro._component}`;if(io=[],(co=so==null?void 0:so.legalDirectChildren)!=null&&co.length&&(io=so.legalDirectChildren.map(fo=>`@budibase/standard-components/${fo}`)),(uo=so==null?void 0:so.illegalChildren)!=null&&uo.length){const fo=so.illegalChildren.map(po=>`@budibase/standard-components/${po}`);oo=[...new Set([...oo,...fo])]}for(let fo of ro._children){const po=eo(fo,oo,io);if(po)return po}},no=eo(ue.props);if(no){const ro=componentStore.getDefinition(no);throw`You can't place a ${ro==null?void 0:ro.name} here`}}async saveScreen(ue){var oo;(oo=get_store_value(appStore).features)!=null&&oo.componentValidation&&this.validate(ue),this.enrichEmptySettings(ue);const no=ue._id===void 0,ro=await API.saveScreen(ue);return this.update(io=>{const ao=io.screens.findIndex(so=>so._id===ro._id);return ao!==-1?io.screens.splice(ao,1,ro):io.screens.push(ro),no&&(io.selectedScreenId=ro._id,componentStore.update(so=>({...so,selectedComponentId:ro.props._id}))),io}),await this.syncScreenData(ro),ro}async syncScreenData(ue){const eo=get_store_value(appStore);let no=eo.usedPlugins;if(ue.pluginAdded){const{application:oo}=await API.fetchAppPackage(eo.appId);no=oo.usedPlugins||[]}const ro=await API.fetchAppRoutes();appStore.update(oo=>({...oo,routes:ro.routes,usedPlugins:no}))}async patch(ue,eo){if(eo||(eo=get_store_value(this.store).selectedScreenId),!(!eo||!ue))return await this.sequentialScreenPatch(ue,eo)}async replace(ue,eo){if(ue)if(!eo)this.update(no=>({...no,screens:no.screens.filter(ro=>ro._id!==ue)}));else{const no=get_store_value(this.store).screens.findIndex(ro=>ro._id===eo._id);no===-1?this.update(ro=>({...ro,screens:[...ro.screens,eo]})):this.update(ro=>(ro.screens[no]=eo,ro))}}async deleteScreen(ue){const eo=[ue];let no=[],ro=[];eo.filter(ao=>!!ao._id||!!ao._rev).forEach(ao=>{no.push(API.deleteScreen(ao._id,ao._rev)),ro.push(ao.routing.route)}),await Promise.all(no),await navigationStore.deleteLink(ro);const oo=eo.map(ao=>ao._id),io=await API.fetchAppRoutes();this.update(ao=>(ao.screens=ao.screens.filter(so=>!oo.includes(so._id)),ao.selectedScreenId&&oo.includes(ao.selectedScreenId)&&(delete ao.selectedScreenId,componentStore.update(so=>(delete so.selectedComponentId,so))),appStore.update(so=>({...so,routes:io.routes})),ao))}async updateSetting(ue,eo,no){if(!ue||!eo)return;const ro=so=>{if(!so||deepGet(so,eo)===no)return!1;deepSet(so,eo,no)};await this.patch(ro,ue._id);const oo=get_store_value(this.store),io=oo.screens.find(so=>so._id===ue._id);if(!io)return;const ao=oo.screens.filter(so=>so.routing.roleId===io.routing.roleId&&so.routing.homeScreen&&so._id!==ue._id);if(ao.length&&io.routing.homeScreen){const so=lo=>{lo.routing.homeScreen=!1};for(let lo of ao)await this.patch(so,lo._id)}}async removeCustomLayout(ue){const eo=get_store_value(layoutStore).layouts.find(ro=>ro._id===ue.layoutId),no=ro=>{delete ro.layoutId,ro.showNavigation=(eo==null?void 0:eo.props.navigation)!=="None",ro.width=(eo==null?void 0:eo.props.width)||"Large"};await this.patch(no,ue._id)}async enrichEmptySettings(ue){findAllMatchingComponents(ue.props,no=>no).forEach(no=>{componentStore.enrichEmptySettings(no,{screen:ue})})}}const screenStore=new ScreenStore,selectedScreen=derived(screenStore,to=>to.screens.find(ue=>ue._id===to.selectedScreenId)),sortedScreens=derived(screenStore,to=>to.screens.slice().sort((ue,eo)=>{const no=getRolePriority(ue.routing.roleId),ro=getRolePriority(eo.routing.roleId);if(no!==ro)return no>ro?-1:1;const oo=!!ue.routing.homeScreen,io=!!eo.routing.homeScreen;if(oo!==io)return oo?-1:1;const ao=ue.routing.route.split("/"),so=eo.routing.route.split("/");let lo=Math.min(ao.length,so.length);for(let co=0;co<lo;co++)if(ao[co]!==so[co])return ao[co]<so[co]?-1:1;return ao.length<so.length?-1:1})),INITIAL_COMPONENTS_STATE={components:{},customComponents:[],settingsCache:{}};class ComponentStore extends BudiStore{constructor(){super(INITIAL_COMPONENTS_STATE),this.reset=this.reset.bind(this),this.refreshDefinitions=this.refreshDefinitions.bind(this),this.getDefinition=this.getDefinition.bind(this),this.getDefaultDatasource=this.getDefaultDatasource.bind(this),this.enrichEmptySettings=this.enrichEmptySettings.bind(this),this.createInstance=this.createInstance.bind(this),this.create=this.create.bind(this),this.patch=this.patch.bind(this),this.delete=this.delete.bind(this),this.copy=this.copy.bind(this),this.paste=this.paste.bind(this),this.select=this.select.bind(this),this.getPrevious=this.getPrevious.bind(this),this.getNext=this.getNext.bind(this),this.selectPrevious=this.selectPrevious.bind(this),this.selectNext=this.selectNext.bind(this),this.moveUp=this.moveUp.bind(this),this.moveDown=this.moveDown.bind(this),this.updateStyle=this.updateStyle.bind(this),this.updateStyles=this.updateStyles.bind(this),this.updateCustomStyle=this.updateCustomStyle.bind(this),this.updateConditions=this.updateConditions.bind(this),this.requestEjectBlock=this.requestEjectBlock.bind(this),this.handleEjectBlock=this.handleEjectBlock.bind(this),this.updateSetting=this.updateSetting.bind(this),this.updateComponentSetting=this.updateComponentSetting.bind(this),this.addParent=this.addParent.bind(this),this.isCached=this.isCached.bind(this),this.cacheSettings=this.cacheSettings.bind(this),this.getComponentSettings=this.getComponentSettings.bind(this)}reset(){this.store.set({...INITIAL_COMPONENTS_STATE})}async refreshDefinitions(ue){if(!ue)return;const eo=await API.fetchComponentLibDefinitions(ue),no=Object.keys(eo).filter(ro=>ro.startsWith("plugin/"));return this.update(ro=>({...ro,components:eo,customComponents:no})),appStore.syncClientFeatures(eo.features),appStore.syncClientTypeSupportPresets((eo==null?void 0:eo.typeSupportPresets)??{}),eo}getDefinition(ue){return ue?get_store_value(this.store).components[ue]:null}getDefaultDatasource(){const ue=get_store_value(tables).list.filter(no=>no._id!=="ta_users");let eo=ue.find(no=>no.sourceId===BUDIBASE_INTERNAL_DB_ID&&no.sourceType===DB_TYPE_INTERNAL);return eo||(eo=ue.find(no=>no.sourceId===DEFAULT_BB_DATASOURCE_ID&&no.sourceType===DB_TYPE_INTERNAL),eo)?eo:ue.find(no=>no.sourceType===DB_TYPE_EXTERNAL)}migrateSettings(ue){var io;const eo="@budibase/standard-components";let no=!1;if((ue==null?void 0:ue._component)===`${eo}/formblock`){if(!("buttons"in ue))ue.buttons=buildFormBlockButtonConfig(ue),no=!0;else if(ue.buttons==null){const{_id:ao,actionType:so,dataSource:lo}=ue;ue.buttons=buildFormBlockButtonConfig({_id:ao,actionType:so,dataSource:lo}),no=!0}"buttonPosition"in ue||(ue.buttonPosition="top",no=!0)}if(!(ue!=null&&ue._component))return no;const ro=this.getDefinition(ue==null?void 0:ue._component),oo=(io=ro==null?void 0:ro.settings)==null?void 0:io.filter(ao=>{var so;return(so=ao==null?void 0:ao.type)==null?void 0:so.startsWith("filter")});for(let ao of oo||[])if(Array.isArray(ue[ao.key])){const lo=processSearchFilters(ue[ao.key]);ue[ao.key]=lo,no=!0}return no}enrichEmptySettings(ue,eo){if(!(ue!=null&&ue._component))return;const no=this.getDefaultDatasource(),ro=this.getComponentSettings(ue._component),{parent:oo,screen:io,useDefaultValues:ao}=eo||{},so=(oo==null?void 0:oo._id)||ue._id;if(io&&(ro.forEach(lo=>{var uo,fo;const co=ue[lo.key];if(co==null||co==="")if(lo.type==="multifield"&&lo.selectAllFields)ue[lo.key]=Object.keys((no==null?void 0:no.schema)||{});else if((lo.type==="dataSource"||lo.type==="table")&&no)ue[lo.key]={label:no.name,tableId:no._id,resourceId:no._id,type:"table"};else if(lo.type==="dataProvider"){const ho=findComponentPath(io.props,so).filter(_o=>{var go;return(go=_o._component)==null?void 0:go.endsWith("/dataprovider")});if(ho.length){const _o=(uo=ho[ho.length-1])==null?void 0:uo._id;ue[lo.key]=`{{ literal ${makePropSafe(_o)} }}`}}else if(lo.type.startsWith("field/")){let po=getComponentFieldOptions(io.props,so,lo.type,!1);const ho=findClosestMatchingComponent(io.props,so,go=>go._component==="@budibase/standard-components/form"),_o=Object.keys(buildFormSchema(ho)||{});po=po.filter(go=>!_o.includes(go)),po[0]&&(ue[lo.key]=po[0],ue.label=po[0])}else ao&&lo.defaultValue!==void 0&&(ue[lo.key]=lo.defaultValue);else if(lo.type==="dataProvider"){const po=findAllMatchingComponents(io==null?void 0:io.props,_o=>_o._component==="@budibase/standard-components/dataprovider");if(!(po==null?void 0:po.some(_o=>{var go;return(go=co.includes)==null?void 0:go.call(co,_o._id)})))if(po.length){const _o=(fo=po[po.length-1])==null?void 0:fo._id;ue[lo.key]=`{{ literal ${makePropSafe(_o)} }}`}else delete ue[lo.key]}}),ue._component.endsWith("/cardsblock")&&["cardTitle","cardSubtitle","cardDescription"].every(co=>!ue[co])&&!ue.cardImageURL)){const{_id:co,dataSource:uo}=ue;if(uo){const{schema:fo,table:po}=getSchemaForDatasource(io,uo,{}),ho=wo=>(Array.isArray(wo)||(wo=[wo]),Object.entries(fo||{}).filter(([ko,So])=>wo.includes(So.type)&&!So.autoColumn&&ko!==(po==null?void 0:po.primaryDisplay)&&!ko.startsWith("_")).map(([ko])=>ko)),_o=(wo,ko,...So)=>{So.some(Ao=>Ao==null)?ue[wo]=ko:(So.unshift(`${co}-repeater`),ue[wo]=`{{ ${So.map(makePropSafe).join(".")} }}`)},go=[...ho(FieldType.STRING),...ho(FieldType.OPTIONS),...ho(FieldType.ARRAY),...ho(FieldType.NUMBER)],bo=ho(FieldType.LONGFORM);po!=null&&po.primaryDisplay&&(fo!=null&&fo[po.primaryDisplay])&&go.unshift(po.primaryDisplay),_o("cardTitle","Title",go[0]),_o("cardSubtitle","Subtitle",go[1]);const vo=bo[0]??go[2];_o("cardDescription","Description",vo);let yo=ho(FieldType.ATTACHMENT_SINGLE)[0];yo?_o("cardImageURL",null,yo,"url"):(yo=ho(FieldType.ATTACHMENTS)[0],yo&&_o("cardImageURL",null,yo,0,"url"))}}}createInstance(ue,eo,no){var so;const ro=get_store_value(selectedScreen);if(!ro)throw"A valid screen must be selected";const oo=this.getDefinition(ue);if(!oo)return null;let io={_id:uuid$2(),_component:oo.component,_styles:{normal:{},hover:{},active:{}},_instanceName:`New ${oo.friendlyName||oo.name}`,...eo};this.enrichEmptySettings(io,{parent:no,screen:ro,useDefaultValues:!0});try{this.migrateSettings(io)}catch(lo){throw console.error(lo),lo}let ao={};if(oo.hasChildren&&(ao._children=[]),ue.endsWith("/formstep")){const lo=findClosestMatchingComponent(ro.props,(so=get_store_value(selectedComponent))==null?void 0:so._id,uo=>uo._component.endsWith("/form")),co=findAllMatchingComponents(lo,uo=>uo._component.endsWith("/formstep"));ao.step=co.length+1,ao._instanceName=`Step ${co.length+1}`}return{...fp$1.cloneDeep(io),...ao}}async create(ue,eo,no,ro){const oo=get_store_value(this.store),io=this.createInstance(ue,eo,no);if(io)return no&&ro!=null?await screenStore.patch(ao=>{var lo;let so=findComponent(ao.props,no);(lo=so._children)!=null&&lo.length?so._children.splice(ro,0,io):so._children=[io]},null):await screenStore.patch(ao=>{let so=oo.selectedComponentId;so!=null&&so.startsWith(`${ao._id}-`)&&(so=ao.props._id);const lo=findComponent(ao.props,so);if(!lo)return!1;let co;if(lo){const uo=this.getDefinition(lo._component);uo!=null&&uo.hasChildren?co=lo:co=findComponentParent(ao.props,lo._id)}else co=ao.props;if(!co)return!1;co._children||(co._children=[]),co._children.push(io)},null),this.update(ao=>(ao.selectedComponentId=io._id,ao)),componentTreeNodesStore.makeNodeVisible(io._id),analytics.captureEvent(Events.COMPONENT_CREATED,{name:io._component}),io}async patch(ue,eo,no){if(!eo||!no){const oo=get_store_value(this.store);eo=eo??oo.selectedComponentId??void 0;const io=get_store_value(screenStore);no=no||io.selectedScreenId}if(!eo||!no||!ue)return;const ro=oo=>{let io=findComponent(oo.props,eo);if(!io)return!1;const ao=ue(io,oo);return this.migrateSettings(io)?null:ao};await screenStore.patch(ro,no)}async delete(ue){if(!ue)return;const eo=get_store_value(this.store);let no="";eo.selectedComponentId===ue._id&&(no=this.getNext(),no||(no=this.getPrevious())),no&&(no.endsWith("-navigation")&&(no=no.replace("-navigation","-screen")),this.update(ro=>(ro.selectedComponentId=no,ro))),await screenStore.patch(ro=>{if(ue=findComponent(ro.props,ue._id),!ue)return!1;const oo=findComponentParent(ro.props,ue._id);if(!oo)return!1;oo._children=oo._children.filter(io=>io._id!==ue._id)},null)}copy(ue,eo=!1,no=!0){if(this.update(ro=>(ro.componentToPaste=fp$1.cloneDeep(ue),ro.componentToPaste.isCut=eo,ro.componentToPaste.screenId=get_store_value(screenStore).selectedScreenId,ro)),eo&&no){const ro=get_store_value(selectedScreen),oo=findComponentParent(ro==null?void 0:ro.props,ue._id);oo&&this.update(io=>(io.selectedComponentId=oo._id,io))}}select(ue){this.update(eo=>(eo.selectedComponentId=ue,eo))}async paste(ue,eo,no,ro=!0){const oo=get_store_value(this.store);if(!oo.componentToPaste)return;let io="",ao=fp$1.cloneDeep(oo.componentToPaste);ao.isCut&&this.update(co=>(delete co.componentToPaste,co));const so=co=>{var ho;if(ue=findComponent(co.props,ue._id),!ue)return!1;const uo=ao.isCut,fo=ao.screenId,po=ao._id;if(delete ao.isCut,delete ao.screenId,uo||(ao=makeComponentUnique(ao)),io=ao._id,fo&&fo!==co._id)for(let _o of Object.keys(((ho=ao._styles)==null?void 0:ho.normal)||{}))_o.startsWith("--grid")&&(_o.endsWith("-start")||_o.endsWith("-end"))&&delete ao._styles.normal[_o];if(uo){const _o=findComponentParent(co.props,po);_o!=null&&_o._children&&(_o._children=_o._children.filter(go=>go._id!==po))}if(eo==="inside"){const _o=this.getDefinition(ue._component);_o!=null&&_o.hasChildren||(eo="below")}if(eo==="inside")ue._children||(ue._children=[]),ue._children.push(ao);else{const _o=findComponentParent(co.props,ue._id);if(!(_o!=null&&_o._children))return!1;const go=_o._children.findIndex(vo=>vo._id===ue._id),bo=eo==="above"?go:go+1;_o._children.splice(bo,0,ao)}},lo=(no==null?void 0:no._id)??oo.selectedScreenId??null;await screenStore.patch(so,lo),ro&&this.update(co=>(co.selectedScreenId=lo,co.selectedComponentId=io,co)),componentTreeNodesStore.makeNodeVisible(io)}getPrevious(){var so,lo;const eo=get_store_value(this.store).selectedComponentId,no=get_store_value(selectedScreen);if(!no)throw"A valid screen must be selected";const ro=findComponentParent(no.props,eo),oo=ro==null?void 0:ro._children.findIndex(co=>co._id===eo),io=`${no._id}-screen`,ao=`${no._id}-navigation`;if(eo===io)return null;if(eo===ao)return io;if(ro._id===no.props._id&&oo===0)return ao;if(oo>0){const co=ro._children[oo-1];if((so=co._children)!=null&&so.length&&componentTreeNodesStore.isNodeExpanded(co._id)){let uo=co;for(;(lo=uo._children)!=null&&lo.length&&componentTreeNodesStore.isNodeExpanded(uo._id);)uo=uo._children[uo._children.length-1];return uo._id}return co._id}return ro._id}getNext(){var fo,po;const ue=get_store_value(this.store),eo=get_store_value(selectedComponent),no=eo==null?void 0:eo._id,ro=get_store_value(selectedScreen);if(!ro)throw"A valid screen must be selected";const oo=findComponentParent(ro.props,no),io=oo==null?void 0:oo._children.findIndex(ho=>ho._id===no),ao=`${ro._id}-screen`,so=`${ro._id}-navigation`;if(ue.selectedComponentId===ao)return so;if((fo=eo==null?void 0:eo._children)!=null&&fo.length&&(ue.selectedComponentId===so||componentTreeNodesStore.isNodeExpanded(eo._id)))return eo._children[0]._id;if(!oo)return null;if(io<oo._children.length-1)return oo._children[io+1]._id;let lo=oo,co=findComponentParent(ro.props,lo._id),uo=co==null?void 0:co._children.findIndex(ho=>ho._id===lo._id);for(;co!=null&&uo===((po=co._children)==null?void 0:po.length)-1;)lo=co,co=findComponentParent(ro.props,lo._id),uo=co==null?void 0:co._children.findIndex(ho=>ho._id===lo._id);return co?co._children[uo+1]._id:null}selectPrevious(){const ue=this.getPrevious();ue&&this.update(eo=>(eo.selectedComponentId=ue,eo))}selectNext(){const ue=this.getNext();ue&&this.update(eo=>(eo.selectedComponentId=ue,eo))}async moveUp(ue){await screenStore.patch(eo=>{const no=ue==null?void 0:ue._id,ro=findComponentParent(eo.props,no),oo=ro==null?void 0:ro._children.findIndex(ao=>ao._id===no);if(!ro||oo===0&&ro._id===eo.props._id)return;const io=fp$1.cloneDeep(ro._children[oo]);if(ro._children=ro._children.filter(ao=>ao._id!==no),oo>0){const ao=ro._children[oo-1],so=this.getDefinition(ao._component);so!=null&&so.hasChildren&&componentTreeNodesStore.isNodeExpanded(ao._id)?ao._children.push(io):ro._children.splice(oo-1,0,io)}else if(ro._id!==eo.props._id){const ao=findComponentParent(eo.props,ro._id),so=ao._children.findIndex(lo=>lo._id===ro._id);ao._children.splice(so,0,io)}},null)}async moveDown(ue){await screenStore.patch(eo=>{var ao;const no=ue==null?void 0:ue._id,ro=findComponentParent(eo.props,no);if(!((ao=ro==null?void 0:ro._children)!=null&&ao.length))return!1;const oo=ro._children.findIndex(so=>so._id===no);if(oo===ro._children.length-1&&ro._id===eo.props._id)return;const io=fp$1.cloneDeep(ro._children[oo]);if(ro._children=ro._children.filter(so=>so._id!==no),oo<ro._children.length){const so=ro._children[oo],lo=this.getDefinition(so._component);lo!=null&&lo.hasChildren&&componentTreeNodesStore.isNodeExpanded(so._id)?so._children.splice(0,0,io):ro._children.splice(oo+1,0,io)}else{const so=findComponentParent(eo.props,ro._id),lo=so._children.findIndex(co=>co._id===ro._id);so._children.splice(lo+1,0,io)}},null)}async updateStyle(ue,eo){await this.patch(no=>{eo==null||eo===""?delete no._styles.normal[ue]:no._styles.normal[ue]=eo})}async updateStyles(ue,eo){const no=ro=>{ro._styles.normal={...ro._styles.normal,...ue}};await this.patch(no,eo)}async updateCustomStyle(ue){await this.patch(eo=>{eo._styles.custom=ue})}async updateConditions(ue){await this.patch(eo=>{eo._conditions=ue})}async updateSetting(ue,eo){await this.patch(this.updateComponentSetting(ue,eo))}updateComponentSetting(ue,eo){return no=>{if(!ue||!no||no[ue]===eo)return!1;const ro=this.getComponentSettings(no._component),oo=ro.find(io=>io.key===ue);if(ro.forEach(io=>{(ue===io.resetOn||Array.isArray(io.resetOn)&&io.resetOn.includes(ue))&&(no[io.key]=io.defaultValue||null)}),(oo==null?void 0:oo.type)==="dataSource"||(oo==null?void 0:oo.type)==="table"){const{schema:io}=getSchemaForDatasource(null,eo,null),ao=Object.keys(io||{});ro.filter(lo=>lo.type==="multifield"&&lo.selectAllFields).map(lo=>lo.key).forEach(lo=>{no[lo]=ao})}return no[ue]=eo,!0}}requestEjectBlock(ue){previewStore.sendEvent("eject-block",ue)}async handleEjectBlock(ue,eo){let no;await screenStore.patch(ro=>{var lo;const oo=findComponent(ro.props,ue),io=findComponentParent(ro.props,ue);if(!oo||!((lo=io==null?void 0:io._children)!=null&&lo.length))return!1;analytics.captureEvent(Events.BLOCK_EJECTED,{block:oo._component});const ao=findAllMatchingComponents(eo,co=>co._containsSlot)[0];ao&&(delete ao._containsSlot,ao._children=[...ao._children||[],...oo._children||[]]),eo=makeComponentUnique(eo);const so=io._children.findIndex(co=>co._id===ue);io._children[so]=eo,no=eo._id},null),no&&this.update(ro=>(ro.selectedComponentId=no,ro))}async addParent(ue,eo){if(!ue||!eo)return;const no=this.createInstance(eo,null,parent);no&&(await screenStore.patch(ro=>{let oo=findComponent(ro.props,ue),io=findComponentParent(ro.props,ue);if(!oo||!io)return!1;const ao=io._children.findIndex(so=>so._id===ue);if(ao===-1)return!1;io._children[ao]={...no,_children:[oo]}},null),this.update(ro=>(ro.selectedComponentId=no._id,ro)))}isCached(ue){const eo=get_store_value(this.store).settingsCache;return ue in eo}cacheSettings(ue,eo){var ro,oo;let no=[];return eo&&(no=((ro=eo.settings)==null?void 0:ro.filter(io=>!io.section))??[],(oo=eo.settings)==null||oo.filter(io=>io.section).forEach(io=>{no=no.concat((io.settings||[]).map(ao=>({...ao,section:io.name})))})),this.update(io=>({...io,settingsCache:{...io.settingsCache,[ue]:no}})),no}getComponentSettings(ue){if(!ue)return[];!ue.startsWith("plugin/")&&!ue.startsWith("@budibase")&&(ue=`@budibase/standard-components/${ue}`);const eo=get_store_value(this.store).settingsCache[ue];if(eo)return eo;const no=this.getDefinition(ue);return this.cacheSettings(ue,no)}}const componentStore=new ComponentStore,selectedComponent=derived([componentStore,selectedScreen],([to,ue])=>{var ro;if(ue&&((ro=to.selectedComponentId)!=null&&ro.startsWith(`${ue._id}-`)))return{...ue.props,_id:ue.props._id};if(!ue||!to.selectedComponentId)return null;const eo=findComponent(ue==null?void 0:ue.props,to.selectedComponentId),no=eo&&fp$1.cloneDeep(eo);return componentStore.migrateSettings(no),no}),INITIAL_NAVIGATION_STATE={navigation:"Top",links:[],textAlign:"Left"};class NavigationStore extends BudiStore{constructor(){super(INITIAL_NAVIGATION_STATE)}syncAppNavigation(ue){this.update(eo=>({...eo,...ue}))}reset(){this.store.set({...INITIAL_NAVIGATION_STATE})}async save(ue){const eo=get_store_value(appStore).appId,no=await API.saveAppMetadata(eo,{navigation:ue});no.navigation&&this.syncAppNavigation(no.navigation)}async saveLink(ue,eo,no){const ro=get_store_value(this.store);let oo=[...(ro==null?void 0:ro.links)??[]];oo.find(io=>io.url===ue&&io.text===eo)||(oo.push({text:eo,url:ue,type:"link",roleId:no}),await this.save({...ro,links:[...oo]}))}async deleteLink(ue){const eo=get_store_value(this.store);let no=eo==null?void 0:eo.links;no!=null&&no.length&&(ue=Array.isArray(ue)?ue:[ue],no=no.filter(ro=>!ue.includes(ro.url)),no.forEach(ro=>{var oo;ro.type==="sublinks"&&((oo=ro.subLinks)!=null&&oo.length)&&(ro.subLinks=ro.subLinks.filter(io=>!ue.includes(io.url)))}),await this.save({...eo,links:no}))}syncMetadata(ue){const{navigation:eo}=ue;this.syncAppNavigation(eo)}}const navigationStore=new NavigationStore;class ThemeStore extends BudiStore{constructor(){super({theme:DefaultAppTheme$1,customTheme:{}}),this.syncAppTheme=ue=>{this.update(eo=>{const no=ensureValidTheme(ue.theme,DefaultAppTheme$1);return{...eo,theme:no,customTheme:ue.customTheme||{}}})},this.save=async(ue,eo)=>{const no=await API.saveAppMetadata(eo,{theme:ue});this.update(ro=>({...ro,theme:ensureValidTheme(no.theme,DefaultAppTheme$1)}))},this.saveCustom=async(ue,eo)=>{const no={...get_store_value(this).customTheme,...ue},ro=await API.saveAppMetadata(eo,{customTheme:no});this.update(oo=>({...oo,customTheme:ro.customTheme||{}}))},this.syncMetadata=ue=>{const{theme:eo,customTheme:no}=ue;this.update(ro=>({...ro,theme:ensureValidTheme(eo,DefaultAppTheme$1),customTheme:no||{}}))}}}const themeStore=new ThemeStore,createBuilderWebsocket=to=>{const ue=createWebsocket("/socket/builder");return ue.on("connect",()=>{ue.emit(BuilderSocketEvent.SelectApp,{appId:to},({users:eo})=>{userStore.init(eo)})}),ue.on("connect_error",eo=>{console.error("Failed to connect to builder websocket:",eo.message)}),ue.on("disconnect",()=>{userStore.reset()}),ue.onOther(SocketEvent.UserUpdate,({user:eo})=>{userStore.updateUser(eo)}),ue.onOther(SocketEvent.UserDisconnect,({sessionId:eo})=>{userStore.removeUser(eo)}),ue.onOther(BuilderSocketEvent.LockTransfer,({userId:eo})=>{var no,ro;eo===((ro=(no=get_store_value(auth))==null?void 0:no.user)==null?void 0:ro._id)&&appStore.update(oo=>({...oo,hasLock:!0}))}),ue.onOther(BuilderSocketEvent.TableChange,({id:eo,table:no})=>{tables.replaceTable(eo,no)}),ue.onOther(BuilderSocketEvent.DatasourceChange,({id:eo,datasource:no})=>{datasources.replaceDatasource(eo,no)}),ue.onOther(BuilderSocketEvent.RoleChange,({id:eo,role:no})=>{roles.replace(eo,no)}),ue.onOther(BuilderSocketEvent.ScreenChange,({id:eo,screen:no})=>{screenStore.replace(eo,no)}),ue.onOther(BuilderSocketEvent.AppMetadataChange,({metadata:eo})=>{appStore.syncMetadata(eo),themeStore.syncMetadata(eo),navigationStore.syncMetadata(eo),snippets$1.syncMetadata(eo)}),ue.onOther(BuilderSocketEvent.AppPublishChange,async({user:eo,published:no})=>{await appsStore.load(),no&&await deploymentStore.load();const ro=no?"published":"unpublished";notifications.success(`${getUserLabel(eo)} ${ro} this app`)}),ue.onOther(BuilderSocketEvent.AutomationChange,({id:eo,automation:no})=>{automationStore.actions.replace(eo,no)}),ue};function create_fragment$9f(to){let ue;return{c(){ue=element("div"),ue.innerHTML=`In this section you can manage the data for your app:
|
|
509
509
|
<ul class="feature-list"><li>Connect data sources</li> <li>Edit data</li> <li>Manage read & write access</li> <li>Create views</li> <li>Add bindings</li></ul>`},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}class OnboardingData extends SvelteComponent{constructor(ue){super(),init$3(this,ue,null,create_fragment$9f,safe_not_equal,{})}}function create_fragment$9e(to){let ue;return{c(){ue=element("div"),ue.innerHTML=`After setting up your data, Design is where you build the screens for your
|
|
510
510
|
app:
|
|
511
511
|
<ul class="feature-list"><li>Add screens</li> <li>Add components</li> <li>Choose your theme</li> <li>Edit navigation</li></ul>`},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}class OnboardingDesign extends SvelteComponent{constructor(ue){super(),init$3(this,ue,null,create_fragment$9e,safe_not_equal,{})}}function create_fragment$9d(to){let ue;return{c(){ue=element("div"),ue.innerHTML=`Once you’re happy with your app you can publish it to production!
|
|
@@ -516,7 +516,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
516
516
|
enhance user experience.
|
|
517
517
|
|
|
518
518
|
<p>Breaking the form into multiple steps can significantly improve usability by
|
|
519
|
-
making the process more digestible for your users.</p>`},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}class NewFormSteps extends SvelteComponent{constructor(ue){super(),init$3(this,ue,null,create_fragment$9b,safe_not_equal,{})}}const ONBOARDING_EVENT_PREFIX="onboarding",TOUR_STEP_KEYS={BUILDER_APP_PUBLISH:"builder-app-publish",BUILDER_DATA_SECTION:"builder-data-section",BUILDER_DESIGN_SECTION:"builder-design-section",BUILDER_USER_MANAGEMENT:"builder-user-management",BUILDER_AUTOMATION_SECTION:"builder-automation-section",FEATURE_USER_MANAGEMENT:"feature-user-management",BUILDER_FORM_CREATE_STEPS:"builder-form-create-steps",BUILDER_FORM_VIEW_UPDATE_STEPS:"builder-form-view-update-steps",BUILDER_FORM_ROW_ID:"builder-form-row-id"},TOUR_KEYS={TOUR_BUILDER_ONBOARDING:"builder-onboarding",FEATURE_ONBOARDING:"feature-onboarding",BUILDER_FORM_CREATE:"builder-form-create",BUILDER_FORM_VIEW_UPDATE:"builder-form-view-update"},getCurrentStepIdx=(to,ue)=>{if(to!=null&&to.length)return to!=null&&to.length&&!ue?0:to.findIndex(eo=>eo.id===ue)},endUserOnboarding=async({skipped:to=!1}={})=>{if(get_store_value(auth).user){try{await API.updateSelf({onboardedAt:new Date().toISOString()}),to&&tourEvent("skipped"),await auth.getSelf(),builderStore.endBuilderOnboarding(),builderStore.setTour()}catch(ue){return console.error("Onboarding failed",ue),!1}return!0}},endTour=async({key:to,skipped:ue=!1}={})=>{const{tours:eo={}}=get_store_value(auth).user;eo[to]=new Date().toISOString(),await API.updateSelf({tours:eo}),ue&&tourEvent(to,ue),await auth.getSelf(),builderStore.setTour()},tourEvent=(to,ue)=>{analytics.captureEvent(`${ONBOARDING_EVENT_PREFIX}:${to}`,{eventSource:EventSource.PORTAL,skipped:ue})},getTours=()=>({[TOUR_KEYS.TOUR_BUILDER_ONBOARDING]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_DATA_SECTION,title:"Data",route:"/builder/app/:application/data",layout:OnboardingData,query:".topleftnav .spectrum-Tabs-item#builder-data-tab",onLoad:async()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_DATA_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_DESIGN_SECTION,title:"Design",route:"/builder/app/:application/design",layout:OnboardingDesign,query:".topleftnav .spectrum-Tabs-item#builder-design-tab",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_DESIGN_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_AUTOMATION_SECTION,title:"Automations",route:"/builder/app/:application/automation",query:".topleftnav .spectrum-Tabs-item#builder-automation-tab",body:"Once you have your app screens made, you can set up automations to fit in with your current workflow",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_AUTOMATION_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT,title:"Users",query:".toprightnav #builder-app-users-button",body:"Add users to your app and control what level of access they have.",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT)}},{id:TOUR_STEP_KEYS.BUILDER_APP_PUBLISH,title:"Publish",layout:OnboardingPublish,route:"/builder/app/:application/design",query:".toprightnav #builder-app-publish-button",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_APP_PUBLISH)},onComplete:endUserOnboarding}],onSkip:async()=>{await endUserOnboarding({skipped:!0})},endRoute:"/builder/app/:application/data"},[TOUR_KEYS.FEATURE_ONBOARDING]:{steps:[{id:TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT,title:"Users",query:".toprightnav #builder-app-users-button",body:"Add users to your app and control what level of access they have.",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT)},onComplete:endUserOnboarding}]},[TOUR_KEYS.BUILDER_FORM_CREATE]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_FORM_CREATE_STEPS,title:"Add multiple steps",layout:NewFormSteps,query:"#steps-prop-control-wrap",onComplete:()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_CREATE})},onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_CREATE_STEPS),builderStore.highlightSetting("steps","info")},align:"left-outside"}]},[TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_FORM_ROW_ID,title:"Add row ID to update a row",layout:NewViewUpdateFormRowId,query:"#rowId-prop-control-wrap",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_ROW_ID),builderStore.highlightSetting("rowId","info")},align:"left-outside"},{id:TOUR_STEP_KEYS.BUILDER_FORM_VIEW_UPDATE_STEPS,title:"Add multiple steps",layout:NewFormSteps,query:"#steps-prop-control-wrap",onComplete:()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE})},onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_VIEW_UPDATE_STEPS),builderStore.highlightSetting("steps","info")},align:"left-outside",scrollIntoView:!0}],onSkip:async()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE,skipped:!0})}}}),TOURS=getTours(),TOURSBYSTEP=Object.keys(TOURS).reduce((to,ue)=>(TOURS[ue].steps.forEach(eo=>{to[eo.id]=eo,to[eo.id].tour=ue}),to),{}),INITIAL_BUILDER_STATE={previousTopNavPath:{},highlightedSetting:null,propertyFocus:null,builderSidePanel:!1,onboarding:!1,tourNodes:null,tourKey:null,tourStepKey:null,hoveredComponentId:null};class BuilderStore extends BudiStore{constructor(){super({...INITIAL_BUILDER_STATE}),this.init=this.init.bind(this),this.refresh=this.refresh.bind(this),this.reset=this.reset.bind(this),this.highlightSetting=this.highlightSetting.bind(this),this.propertyFocus=this.propertyFocus.bind(this),this.hideBuilderSidePanel=this.hideBuilderSidePanel.bind(this),this.showBuilderSidePanel=this.showBuilderSidePanel.bind(this),this.setPreviousTopNavPath=this.setPreviousTopNavPath.bind(this),this.selectResource=this.selectResource.bind(this),this.registerTourNode=this.registerTourNode.bind(this),this.destroyTourNode=this.destroyTourNode.bind(this),this.startBuilderOnboarding=this.startBuilderOnboarding.bind(this)}init(ue){if(!(ue!=null&&ue.appId)){console.error("BuilderStore: No appId supplied for websocket");return}this.websocket||(this.websocket=createBuilderWebsocket(ue.appId))}refresh(){const ue=get_store_value(this.store);this.store.set(ue)}reset(){var ue;this.store.set({...INITIAL_BUILDER_STATE}),(ue=this.websocket)==null||ue.disconnect(),this.websocket=void 0}highlightSetting(ue,eo){this.update(no=>({...no,highlightedSetting:ue?{key:ue,type:eo||"info"}:null}))}propertyFocus(ue){this.update(eo=>({...eo,propertyFocus:ue}))}showBuilderSidePanel(){this.update(ue=>({...ue,builderSidePanel:!0}))}hideBuilderSidePanel(){this.update(ue=>({...ue,builderSidePanel:!1}))}setPreviousTopNavPath(ue,eo){this.update(no=>({...no,previousTopNavPath:{...no.previousTopNavPath||{},[ue]:eo}}))}selectResource(ue){var eo;(eo=this.websocket)==null||eo.emit(BuilderSocketEvent.SelectResource,{resourceId:ue})}registerTourNode(ue,eo){this.update(no=>({...no,tourNodes:{...no.tourNodes,[ue]:eo}}))}destroyTourNode(ue){var no;const eo=get_store_value(this.store);if((no=eo.tourNodes)!=null&&no[ue]){const ro={...eo.tourNodes};delete ro[ue],this.update(oo=>({...oo,tourNodes:ro}))}}startBuilderOnboarding(){this.update(ue=>({...ue,onboarding:!0,tourKey:TOUR_KEYS.TOUR_BUILDER_ONBOARDING}))}endBuilderOnboarding(){this.update(ue=>({...ue,onboarding:!1}))}setTour(ue){this.update(eo=>({...eo,tourStepKey:null,tourNodes:null,tourKey:ue||null}))}}const builderStore=new BuilderStore,INITIAL_HOVER_STATE={componentId:null};class HoverStore extends BudiStore{constructor(){super({...INITIAL_HOVER_STATE}),this.hover=this.hover.bind(this)}hover(ue,eo=!0){clearTimeout(this.hoverTimeout),ue?this.processHover(ue,eo):this.hoverTimeout=setTimeout(()=>{this.processHover(ue,eo)},10)}processHover(ue,eo){ue!==get_store_value(this.store).componentId&&(this.update(no=>(no.componentId=ue,no)),eo&&previewStore.sendEvent("hover-component",ue))}}const hoverStore=new HoverStore,INITIAL_PREVIEW_STATE={previewDevice:"desktop",previewEventHandler:null,showPreview:!1,selectedComponentContext:null};class PreviewStore extends BudiStore{constructor(){super(INITIAL_PREVIEW_STATE),this.setDevice=this.setDevice.bind(this),this.sendEvent=this.sendEvent.bind(this),this.registerEventHandler=this.registerEventHandler.bind(this),this.startDrag=this.startDrag.bind(this),this.stopDrag=this.stopDrag.bind(this),this.showPreview=this.showPreview.bind(this),this.setSelectedComponentContext=this.setSelectedComponentContext.bind(this),this.requestComponentContext=this.requestComponentContext.bind(this)}setDevice(ue){this.update(eo=>({...eo,previewDevice:ue}))}sendEvent(ue,eo){const{previewEventHandler:no}=get_store_value(this.store);no==null||no(ue,eo)}registerEventHandler(ue){this.update(eo=>({...eo,previewEventHandler:ue}))}startDrag(ue){this.sendEvent("dragging-new-component",{dragging:!0,component:ue})}stopDrag(){this.sendEvent("dragging-new-component",{dragging:!1})}showPreview(ue){this.update(eo=>({...eo,showPreview:ue}))}setSelectedComponentContext(ue){this.update(eo=>({...eo,selectedComponentContext:ue}))}requestComponentContext(){this.sendEvent("request-context")}}const previewStore=new PreviewStore,TriggerStepID={ROW_SAVED:"ROW_SAVED",ROW_UPDATED:"ROW_UPDATED",ROW_DELETED:"ROW_DELETED",ROW_ACTION:"ROW_ACTION",WEBHOOK:"WEBHOOK",APP:"APP",CRON:"CRON"},ActionStepID={SEND_EMAIL_SMTP:"SEND_EMAIL_SMTP",CREATE_ROW:"CREATE_ROW",UPDATE_ROW:"UPDATE_ROW",DELETE_ROW:"DELETE_ROW",OUTGOING_WEBHOOK:"OUTGOING_WEBHOOK",EXECUTE_SCRIPT:"EXECUTE_SCRIPT",EXECUTE_QUERY:"EXECUTE_QUERY",SERVER_LOG:"SERVER_LOG",DELAY:"DELAY",FILTER:"FILTER",QUERY_ROWS:"QUERY_ROWS",LOOP:"LOOP",COLLECT:"COLLECT",TRIGGER_AUTOMATION_RUN:"TRIGGER_AUTOMATION_RUN",discord:"discord",slack:"slack",zapier:"zapier",integromat:"integromat",n8n:"n8n"},Features={LOOPING:"LOOPING"};class TableStore extends DerivedBudiStore{constructor(){const ue=eo=>derived(eo,no=>{var ro;return{...no,selected:(ro=no.list)==null?void 0:ro.find(oo=>oo._id===no.selectedTableId)}});super({list:[],selectedTableId:void 0},ue),this.select=this.select.bind(this)}async init(){return this.fetch()}async fetch(){const ue=await API.getTables();this.store.update(eo=>({...eo,list:ue}))}async singleFetch(ue){const eo=await API.getTable(ue);this.store.update(no=>{const ro=[];for(let oo of no.list)eo._id===oo._id?ro.push(eo):ro.push(oo);return no.list=ro,no})}select(ue){this.store.update(eo=>({...eo,selectedTableId:ue}))}async save(ue){var lo;const eo=fp$1.cloneDeep(ue),no=get_store_value(this.store).list.filter(co=>co._id===ue._id)[0],ro=[];for(let co of Object.keys(eo.schema)){if(ro.indexOf(co.toLowerCase())!==-1){delete eo.schema[co];continue}const uo=eo.schema[co],fo=no==null?void 0:no.schema[co];fo!=null&&(fo==null?void 0:fo.type)!==uo.type&&!((lo=SWITCHABLE_TYPES[fo==null?void 0:fo.type])!=null&&lo.includes(uo.type))&&(eo.schema[co]=fo),uo.name&&uo.name!==co&&(eo.schema[uo.name]=uo,eo._rename={old:co,updated:uo.name},delete eo.schema[co]),ro.push(co.toLowerCase())}const oo=await API.saveTable(eo);this.replaceTable(oo._id,oo),this.select(oo._id);let io=[];for(let co of Object.values((eo==null?void 0:eo.schema)||{}))co.type===FieldType.LINK&&io.push(co.tableId);let ao=[];for(let co of Object.values((no==null?void 0:no.schema)||{}))co.type===FieldType.LINK&&ao.push(co.tableId);const so=[...new Set([...io,...ao])];return so.length>3?await this.fetch():await Promise.all(so.map(co=>this.singleFetch(co))),oo}async delete(ue){await API.deleteTable(ue._id,ue._rev),this.replaceTable(ue._id,null)}async saveField({originalName:ue,field:eo,primaryDisplay:no=!1,indexes:ro}){const oo=fp$1.cloneDeep(get_store_value(this.derivedStore).selected);if(ue!=null&&ue!==eo.name&&(delete oo.schema[ue],oo._rename={old:ue,updated:eo.name}),no)oo.primaryDisplay=eo.name;else if(oo.primaryDisplay===ue){const io=Object.keys(oo.schema);oo.primaryDisplay=io.filter(ao=>ao!==ue||ao!==eo.name)[0]}ro&&(oo.indexes=ro),oo.schema={...oo.schema,[eo.name]:fp$1.cloneDeep(eo)},await this.save(oo)}async deleteField(ue){let eo=fp$1.cloneDeep(get_store_value(this.derivedStore).selected);delete eo.schema[ue.name],await this.save(eo)}replaceTable(ue,eo){if(!ue)return;if(!eo){this.store.update(ro=>({...ro,list:ro.list.filter(oo=>oo._id!==ue)}));return}const no=get_store_value(this.store).list.findIndex(ro=>ro._id===eo._id);no===-1?this.store.update(ro=>({...ro,list:[...ro.list,eo]})):eo&&this.store.update(ro=>(ro.list[no]={...eo,type:ro.list[no].type},ro))}removeDatasourceTables(ue){this.store.update(eo=>({...eo,list:eo.list.filter(no=>no.sourceId!==ue)}))}}const tables=new TableStore;class ViewV2Store extends DerivedBudiStore{constructor(){const ue=eo=>derived([eo,tables],([no,ro])=>{var io;let oo=[];return(io=ro.list)==null||io.forEach(ao=>{const so=Object.values((ao==null?void 0:ao.views)||{}).filter(isV2);oo=oo.concat(so)}),{...no,list:oo,selected:oo.find(ao=>ao.id===no.selectedViewId)}});super({selectedViewId:null},ue),this.select=this.select.bind(this)}select(ue){this.store.update(eo=>({...eo,selectedViewId:ue}))}async delete(ue){await API.viewV2.delete(ue.id),this.replaceView(ue.id,null)}async create(ue){const no=(await API.viewV2.create(ue)).data;return this.replaceView(no.id,no),no}async save(ue){const eo=await API.viewV2.update(ue),no=eo==null?void 0:eo.data;this.replaceView(ue.id,no)}replaceView(ue,eo){const no=get_store_value(this.derivedStore).list.find(oo=>oo.id===ue),ro=get_store_value(tables).list.findIndex(oo=>oo._id===(eo==null?void 0:eo.tableId)||oo._id===(no==null?void 0:no.tableId));if(ro!==-1)if(!eo&&no){tables.update(oo=>(delete oo.list[ro].views[no.name],oo));return}else!no&&eo?tables.update(oo=>{var io;return(io=oo.list[ro]).views??(io.views={}),oo.list[ro].views[eo.name]=eo,oo}):no&&eo&&tables.update(oo=>{var io;return(io=oo.list[ro]).views??(io.views={}),delete oo.list[ro].views[no.name],oo.list[ro].views[eo.name]=eo,oo})}}const viewsV2=new ViewV2Store,duplicateName=(to,ue)=>{const eo=new RegExp("\\s(\\d+)$"),no=to.split(eo)[0],ro=new RegExp(`${no}\\s(\\d+)$`),oo=[];ue.filter(ao=>{if(ao===no)return!0;const so=ao.match(ro);return so?(oo.push(parseInt(so[1])),!0):!1}),oo.sort((ao,so)=>ao-so);let io;if(oo.length===0)io=1;else{for(let ao=0;ao<oo.length;ao++)if(oo[ao]!==ao+1){io=ao+1;break}io||(io=oo.length+1)}return`${no} ${io}`},getSequentialName=(to,ue,{getName:eo,numberFirstItem:no}={})=>{if(!(ue!=null&&ue.length))return null;const ro=ue.trim(),oo=no?`${ue}1`:ro;if(!(to!=null&&to.length))return oo;let io=0;return to.forEach(ao=>{const so=(eo==null?void 0:eo(ao))??ao;if(typeof so!="string"||!so.startsWith(ro))return;const lo=so.split(ro);if(lo.length!==2)return;lo[1].trim()===""&&(lo[1]="1");const co=parseInt(lo[1]);co>io&&(io=co)}),io===0?oo:`${ue}${io+1}`},initialState$1={};class RowActionStore extends BudiStore{constructor(){super(initialState$1),this.reset=()=>{this.set(initialState$1)},this.refreshRowActions=async ue=>{var oo;if(!ue)return;let eo=(oo=get_store_value(tables).list.find(io=>io._id===ue))==null?void 0:oo._id;if(!eo){const io=get_store_value(viewsV2).list.find(ao=>ao.id===ue);eo=io==null?void 0:io.tableId}if(!eo)return;const no=await API.rowActions.fetch(eo),ro=Object.values(no||{});this.update(io=>({...io,[eo]:ro}))},this.createRowAction=async(ue,eo,no)=>{if(!ue)return;if(!no){const oo=get_store_value(this)[ue]||[];no=getSequentialName(oo,"New row action ",{getName:io=>io.name})}if(!no)throw new Error("Failed to generate a unique name for the row action");const ro=await API.rowActions.create(ue,no);return eo?await Promise.all([this.enableView(ue,ro.id,eo),automationStore.actions.fetch()]):await Promise.all([this.refreshRowActions(ue),automationStore.actions.fetch()]),ro},this.enableView=async(ue,eo,no)=>{await API.rowActions.enableView(ue,eo,no),await this.refreshRowActions(ue)},this.disableView=async(ue,eo,no)=>{await API.rowActions.disableView(ue,eo,no),await this.refreshRowActions(ue)},this.delete=async(ue,eo)=>{await API.rowActions.delete(ue,eo),await this.refreshRowActions(ue)},this.trigger=async(ue,eo,no)=>{await API.rowActions.trigger(ue,eo,no)}}}const store=new RowActionStore,derivedStore=derived(store,to=>{const ue={};return Object.keys(to||{}).forEach(eo=>{ue[eo]=to[eo];for(let no of to[eo]){const ro=(no.allowedSources||[]).filter(oo=>oo!==eo);for(let oo of ro)ue[oo]??(ue[oo]=[]),ue[oo].push(no)}}),ue}),rowActions={...store,subscribe:derivedStore.subscribe},getNewStepName=(to,ue)=>{const eo=ue.name,no=oo=>oo.reduce((io,ao)=>(ao.name&&ao.name.startsWith(eo)&&io++,ao.stepId===AutomationActionStepId.BRANCH&&ao.inputs&&ao.inputs.children&&Object.values(ao.inputs.children).forEach(so=>{io+=no(so)}),io),0);let ro=0;return to!=null&&to.definition&&(ro=no(to.definition.steps)),ro===0?eo:`${eo} ${ro+1}`},initialAutomationState={automations:[],testResults:null,showTestPanel:!1,blockDefinitions:{TRIGGER:{},CREATABLE_TRIGGER:{},ACTION:{}},selectedAutomationId:null},getFinalDefinitions=(to,ue)=>{const eo={};return Object.entries(to).forEach(no=>{no[0]!==AutomationTriggerStepId.ROW_ACTION&&(eo[no[0]]=no[1])}),{TRIGGER:to,CREATABLE_TRIGGER:eo,ACTION:ue}},automationActions=to=>({moveBlock:async(ue,eo,no)=>{const ro=ue.at(-1),oo=eo.at(-1),io=(ro==null?void 0:ro.id)===(oo==null?void 0:oo.id),ao=(oo==null?void 0:oo.branchStepId)&&oo.branchIdx===(ro==null?void 0:ro.branchIdx)&&(ro==null?void 0:ro.stepIdx)===0;if(io||ao)return;const{deleted:so,newAutomation:lo}=to.actions.deleteBlock(ue,no),co={};to.actions.traverse(co,lo);let uo;oo!=null&&oo.branchStepId?(uo=co[oo.branchStepId].pathTo,uo.push(oo)):(oo!=null&&oo.id&&(uo=co[oo.id].pathTo),uo.at(-1).stepIdx+=1);const fo=to.actions.updateStep(uo,lo,so,!0);try{await to.actions.save(fo)}catch(po){notifications.error("Error moving automation block"),console.error("Error moving automation block ",po)}},deleteBlock:(ue,eo)=>{let no=fp$1.cloneDeep(eo);const ro=[no.definition.trigger,...no.definition.steps];let oo;return ue.forEach((io,ao,so)=>{const lo=ao===so.length-1,{stepIdx:co,branchIdx:uo}=io,fo=(po,ho)=>{const _o=po[ho],go=[_o.id],bo=[],vo={};po.forEach(wo=>{const{blockToLoop:ko,id:So}=wo;ko&&(vo[ko]=So)});const yo=vo[_o.id];yo&&go.push(yo);for(let wo=po.length-1;wo>=0;wo--)if(go.includes(po[wo].id)){const[ko]=po.splice(wo,1);bo.unshift(ko)}return{deleted:bo,newAutomation:no}};if(!oo){lo?oo=fo(no.definition.steps,co>0?co-1:0):oo=ro[co];return}if(Number.isInteger(uo)){const po=oo.inputs.branches[uo].id,ho=oo.inputs.children[po],_o=ho[co];lo?oo=fo(ho,co):oo=_o}}),oo},registerBlock:(ue,eo,no,ro)=>{ue[eo.id]={...ue[eo.id]||{},pathTo:no,terminating:ro||!1,...eo.blockToLoop?{blockToLoop:eo.blockToLoop}:{}},eo.blockToLoop&&(ue[eo.blockToLoop]={...ue[eo.blockToLoop]||{},looped:eo.id})},getPathSteps:(ue,eo)=>{const no=[eo.definition.trigger,...eo.definition.steps];let ro=[];return ue.forEach(oo=>{const{stepIdx:io,branchIdx:ao}=oo;let so=ro.length?ro[ro.length-1]:[];if(!ro.length){ro=no.slice(0,io+1);return}if(so&&"inputs"in so&&Number.isInteger(ao)){const lo=so.inputs.branches[ao].id,uo=so.inputs.children[lo].slice(0,io+1);ro=ro.concat(uo)}}),ro},updateStep:(ue,eo,no,ro=!1)=>{let oo=fp$1.cloneDeep(eo);const io=(so,lo,co)=>{so.splice(lo,ro?0:Array.isArray(co)?co.length:1,...Array.isArray(co)?co:[co])};let ao=null;return ue.forEach((so,lo,co)=>{const{stepIdx:uo,branchIdx:fo}=so;let po=lo===co.length-1;if(!ao){let ho=Math.max(uo-1,0);if(po){io(oo.definition.steps,ho,no);return}ao=oo.definition.steps[ho]}if(Number.isInteger(fo)){const ho=ao.inputs.branches[fo].id,_o=ao.inputs.children[ho];po?io(_o,uo,no):ao=_o[uo]}}),oo},buildEnvironmentBindings:()=>get_store_value(licensing).environmentVariablesEnabled?getEnvironmentBindings().map(ue=>({...ue,display:{...ue.display,rank:98}})):[],buildUserBindings:()=>getUserBindings().map(ue=>({...ue,category:"User",display:{...ue.display,rank:98}})),buildSettingBindings:()=>getSettingBindings().map(ue=>({...ue,display:{...ue.display,rank:98}})),getPathBindings:ue=>{var no,ro;const eo=(no=get_store_value(selectedAutomation))==null?void 0:no.blockRefs[ue];return to.actions.getAvailableBindings(eo,(ro=get_store_value(selectedAutomation))==null?void 0:ro.data)},traverse:(ue,eo)=>{var oo;let no=[];if(!eo||!ue)return;(oo=eo.definition)!=null&&oo.trigger&&no.push(eo.definition.trigger),no=no.concat(eo.definition.steps||[]);const ro=(io,ao,so,lo,co)=>{var po;const uo=[...ao||[],{...Number.isInteger(lo)?{branchIdx:lo}:{},stepIdx:so,id:io.id}],fo=((po=io.inputs)==null?void 0:po.branches)||[];fo.forEach((ho,_o)=>{var go;(go=io.inputs)==null||go.children[ho.id].forEach((bo,vo,yo)=>{var ko,So;const wo=yo.length-1===vo&&!((So=(ko=bo.inputs)==null?void 0:ko.branches)!=null&&So.length);ro(bo,uo,vo,_o,wo)})}),to.actions.registerBlock(ue,io,uo,co&&!fo.length)};return no.forEach((io,ao,so)=>{ro(io,null,ao,null,so.length-1===ao)}),ue},getAvailableBindings:(ue,eo)=>{var lo,co,uo,fo,po,ho,_o;if(!ue||!(eo!=null&&eo.definition))return[];const no=(lo=get_store_value(selectedAutomation))==null?void 0:lo.blockRefs,ro=to.actions.getPathSteps(ue.pathTo,eo).slice(0,-1),oo=to.actions.getPathSteps(ue.pathTo,eo).at(-1);let io=[];const ao=(go,bo,vo,yo,wo,ko)=>{if(!go)return;const So=to.actions.determineRuntimeBinding(go,yo,wo,ko,eo,oo,ro),Ao=to.actions.determineCategoryName(yo,wo,ko,so);io.push(to.actions.createBindingObject(go,bo,vo,yo,so,wo,So,Ao,ko))};let so=0;for(let go=0;go<ro.length;go++){const bo=ro[go],vo=((co=eo.definition.stepNames)==null?void 0:co[bo.id])||bo.name;let yo=fp$1.cloneDeep((fo=(uo=bo==null?void 0:bo.schema)==null?void 0:uo.outputs)==null?void 0:fo.properties)??{},wo=!1;bo.blockToLoop&&(wo=bo.stepId===ActionStepID.LOOP&&bo.blockToLoop in no);const ko=bo.type===AutomationStepType.TRIGGER;wo&&so==0&&(yo={currentItem:{type:AutomationIOType.STRING,description:"the item currently being executed"}});const So=ko?bo.icon:wo?"Reuse":bo.icon;if(go===0&&ko)if(bo.event===AutomationEventType.ROW_UPDATE||bo.event===AutomationEventType.ROW_SAVE){let Ao=get_store_value(tables).list.find(Io=>Io._id===bo.inputs.tableId);for(const Io in Ao==null?void 0:Ao.schema)yo[Io]={type:Ao.schema[Io].type,subtype:Ao.schema[Io].subtype};delete yo.row}else bo.event===AutomationEventType.APP_TRIGGER&&(yo=Object.fromEntries(Object.keys(bo.inputs.fields||[]).map(Ao=>[Ao,{type:bo.inputs.fields[Ao]}])));if((po=no[bo.id])!=null&&po.looped){so++;const Ao=no[bo.id].looped,Io=ro.find(Eo=>Eo.id===Ao);Io?yo=fp$1.cloneDeep((_o=(ho=Io.schema)==null?void 0:ho.outputs)==null?void 0:_o.properties):console.error("Loop block missing.")}Object.entries(yo).forEach(([Ao,Io])=>{ao(Ao,Io,So,go,wo,vo)})}return ue.looped||(io=io.filter(go=>!go.readableBinding.includes("loop"))),io},determineRuntimeBinding:(ue,eo,no,ro,oo,io,ao)=>{var lo,co,uo;let so;if(eo===0&&((lo=oo.definition.trigger)==null?void 0:lo.event)===AutomationEventType.APP_TRIGGER)return`trigger.fields.${ue}`;if(eo===0&&(((co=oo.definition.trigger)==null?void 0:co.event)===AutomationEventType.ROW_UPDATE||((uo=oo.definition.trigger)==null?void 0:uo.event)===AutomationEventType.ROW_SAVE)&&!["id","revision","oldRow"].includes(ue))return`trigger.row.${ue}`;if(no)so=`loop.${ue}`;else if(eo===0)so=`trigger.${ue}`;else if((io==null?void 0:io.stepId)===AutomationActionStepId.EXECUTE_SCRIPT){const fo=ao[eo].id;if(!fo)return notifications.error("Error generating binding: Step ID not found."),null;so=`steps["${fo}"].${ue}`}else{const fo=ao[eo].id;if(!fo)return notifications.error("Error generating binding: Step ID not found."),null;so=`steps.${fo}.${ue}`}return so},determineCategoryName:(ue,eo,no,ro)=>ue===0?"Trigger outputs":eo?"Loop Outputs":no?`${no} outputs`:`Step ${ue-ro} outputs`,createBindingObject:(ue,eo,no,ro,oo,io,ao,so,lo)=>{const co=Object.values(FIELDS).find(uo=>uo.type===eo.type&&("subtype"in uo?uo.subtype===eo.subtype:!0));return{readableBinding:lo&&!io&&ro!==0?`steps.${lo}.${ue}`:ao,runtimeBinding:ao,type:eo.type,description:eo.description,icon:no,category:so,display:{type:(co==null?void 0:co.name)||eo.type,name:ue,rank:io?ro+1:ro-oo}}},processBlockInputs:async(ue,eo)=>{var io;let no={...ue,inputs:{...ue.inputs,...eo}};Object.keys(no.inputs).forEach(ao=>{const so=no.inputs[ao];(so==null||so==="")&&delete no.inputs[ao]});const ro=(io=get_store_value(selectedAutomation))==null?void 0:io.data;if(!ro)return!1;const oo=to.actions.getUpdatedDefinition(ro,no);return JSON.stringify(oo)===JSON.stringify(ro)?!1:oo},updateBlockInputs:async(ue,eo)=>{const no=await to.actions.processBlockInputs(ue,eo);no!==!1&&await to.actions.save(no)},test:async(ue,eo)=>{var ro,oo;let no;try{no=await API.testAutomation(ue._id,eo)}catch(io){throw`Automation test failed - ${io.message||io.status||JSON.stringify(io)}`}if(!(no!=null&&no.trigger)&&!((ro=no==null?void 0:no.steps)!=null&&ro.length)&&!(no!=null&&no.message))throw((oo=no==null?void 0:no.err)==null?void 0:oo.code)==="usage_limit_exceeded"?"You have exceeded your automation quota":"Something went wrong testing your automation";to.update(io=>(io.testResults=no,io))},getUpdatedDefinition:(ue,eo)=>{var ro;let no;if(((ro=ue.definition.trigger)==null?void 0:ro.id)===eo.id)no=fp$1.cloneDeep(ue),no.definition.trigger=eo;else{const oo=get_store_value(selectedAutomation).blockRefs[eo.id].pathTo;no=to.actions.updateStep(oo,ue,eo)}return no},getLogs:async({automationId:ue,startDate:eo,status:no,page:ro}={})=>await API.getAutomationLogs({automationId:ue,startDate:eo,status:no,page:ro}),clearLogErrors:async({automationId:ue,appId:eo})=>{if(!ue||!eo)throw new Error("automationId and appId are required");return await API.clearAutomationLogErrors(ue,eo)},addTestDataToAutomation:ue=>{var no;let eo=fp$1.cloneDeep((no=get_store_value(selectedAutomation))==null?void 0:no.data);return eo&&(eo.testData={...eo.testData,...ue},eo)},constructBlock:(ue,eo,no)=>{var io;const ro={...no,inputs:no.inputs||{},stepId:eo,type:ue,id:shortid.generate()},oo=getNewStepName((io=get_store_value(selectedAutomation))==null?void 0:io.data,ro);return ro.name=oo,ro},generateBranchBlock:()=>{const ue=get_store_value(to).blockDefinitions.ACTION.BRANCH;return to.actions.constructBlock("ACTION","BRANCH",ue)},addBlockToAutomation:async(ue,eo)=>{var ao;const no=(ao=get_store_value(selectedAutomation))==null?void 0:ao.data;if(!no)return;let ro=fp$1.cloneDeep(no);const oo=[ro.definition.trigger,...ro.definition.steps];let io;eo.forEach((so,lo,co)=>{const{stepIdx:uo,branchIdx:fo}=so,po=lo===co.length-1,ho=(_o,go)=>{const bo=!Number.isInteger(go),vo=ue.blockToLoop||bo?go:go+1;_o.splice(vo,0,ue)};if(!io){po?(ho(ro.definition.steps,uo-1),io=ue):io=oo[uo];return}if(Number.isInteger(fo)){const _o=io.inputs.branches[fo].id,go=io.inputs.children[_o];po?(ho(go,uo),io=go):io=go[uo]}});try{await to.actions.save(ro)}catch(so){notifications.error("Error adding automation block"),console.error("Automation adding block ",so)}},generateDefaultConditions:()=>{const ue={logicalOperator:UILogicalOperator.ALL,onEmptyFilter:EmptyFilterOption.RETURN_NONE,groups:[]};return{condition:buildQuery$1(ue),conditionUI:ue}},branchAutomation:async(ue,eo)=>{var uo;const no=ue.at(-1);let ro=fp$1.cloneDeep(eo),oo,io=!1;const ao=fo=>({name:fo,...to.actions.generateDefaultConditions(),id:shortid.generate()});ue.forEach((fo,po,ho)=>{const{stepIdx:_o,branchIdx:go}=fo,bo=po===ho.length-1;if(oo||(bo?(oo=ro.definition.steps,io=!0):oo=ro.definition.steps[_o-1]),Number.isInteger(go)){const vo=oo.inputs.branches[go].id,yo=oo.inputs.children[vo];oo=bo?yo:yo[_o]}});const so=Math.max(no.stepIdx-1,0),lo=io?so:no.stepIdx;if(((uo=oo[lo])==null?void 0:uo.stepId)=="BRANCH"){let fo=oo[lo].inputs.branches;const po=ao(`Branch ${fo.length+1}`);fo.splice(fo.length,0,po),oo[lo].inputs.children[po.id]=[];try{await to.actions.save(ro)}catch(ho){notifications.error("Error adding branch to automation"),console.error("Error adding automation branch",ho)}return}const co=to.actions.generateBranchBlock();co.inputs.branches=Array.from({length:2}).map((fo,po)=>ao(`Branch ${po+1}`)),co.inputs.children=co.inputs.branches.reduce((fo,po,ho)=>(fo[po.id]=ho==0?oo.slice(lo+1):[],fo),{}),oo.splice(lo+1),oo.push(co);try{await to.actions.save(ro)}catch(fo){notifications.error("Error adding branch to automation"),console.error("Error adding automation branch",fo)}},branchLeft:async(ue,eo,no)=>{const ro=to.actions.shiftBranch(ue,no);if(ro){const oo=to.actions.updateStep(ue.slice(0,-1),eo,ro);await to.actions.save(oo)}},branchRight:async(ue,eo,no)=>{const ro=to.actions.shiftBranch(ue,no,1);if(ro){const oo=to.actions.updateStep(ue.slice(0,-1),eo,ro);await to.actions.save(oo)}},shiftBranch:(ue,eo,no=-1)=>{let ro=fp$1.cloneDeep(eo);const io=ue.at(-1).branchIdx;if(!ro.inputs.branches[io+no]){console.error("Invalid index");return}let[ao]=ro.inputs.branches.splice(io+no,1);return ro.inputs.branches.splice(io,0,ao),ro},deleteBranch:async(ue,eo)=>{let no=fp$1.cloneDeep(eo),ro=[];ue.forEach((oo,io,ao)=>{const{stepIdx:so,branchIdx:lo}=oo,co=io===ao.length-1;if(!ro.length){if(co){ro=no.definition.steps;return}ro=[{node:no.definition.steps[so-1],context:no.definition.steps}]}const uo=ro.at(-1);if(Number.isInteger(lo)){const fo=uo.node.inputs.branches[lo].id,po=uo.node.inputs.children[fo];if(co){const ho=uo.node.inputs.branches.length==2;if(uo.node.inputs.branches.splice(lo,1),delete uo.node.inputs.children[fo],ho){const _o=uo.node.inputs.branches[0].id,go=uo.node.inputs.children[_o],bo=ro.at(-1).context;bo.pop(),bo.splice(bo.length,0,...go)}return}ro.push({node:po[so],context:po})}});try{await to.actions.save(no)}catch(oo){notifications.error("Error deleting automation branch"),console.error("Error deleting automation branch",oo)}},saveAutomationName:async(ue,eo)=>{var io;const no=(io=get_store_value(selectedAutomation))==null?void 0:io.data;let ro=fp$1.cloneDeep(no);if(!ro)return;const oo=eo.trim();ro.definition.stepNames={...ro.definition.stepNames,[ue]:oo},await to.actions.save(ro)},deleteAutomationName:async ue=>{var ro;const eo=(ro=get_store_value(selectedAutomation))==null?void 0:ro.data;let no=fp$1.cloneDeep(eo);!eo||!no||(no!=null&&no.definition.stepNames&&delete no.definition.stepNames[ue],await to.actions.save(no))},deleteAutomationBlock:async ue=>{var ro;const eo=(ro=get_store_value(selectedAutomation))==null?void 0:ro.data;if(!eo)return;const{newAutomation:no}=to.actions.deleteBlock(ue,eo);try{await to.actions.save(no)}catch(oo){notifications.error("Error deleting automation block"),console.error("Automation deleting block ",oo)}},replace:(ue,eo)=>{if(!eo)to.store.update(no=>{var ro;return no.automations=no.automations.filter(oo=>oo._id!==ue),ue===no.selectedAutomationId&&to.actions.select(((ro=no.automations[0])==null?void 0:ro._id)||null),no});else{const no=get_store_value(to.store).automations.findIndex(ro=>ro._id===eo._id);no===-1?to.store.update(ro=>({...ro,automations:[...ro.automations,eo]})):to.store.update(ro=>(ro.automations[no]=eo,ro))}},create:async(ue,eo)=>{const no={name:ue,type:"automation",appId:get_store_value(appStore).appId,definition:{steps:[],trigger:eo},disabled:!1};return await to.actions.save(no)},duplicate:async ue=>await to.actions.save({...ue,name:`${ue.name} - copy`,_id:void 0,_rev:void 0}),toggleDisabled:async ue=>{let eo;try{if(eo=to.actions.getDefinition(ue),!eo)return;eo.disabled=!eo.disabled,await to.actions.save(eo),notifications.success(`Automation ${eo.disabled?"disabled":"enabled"} successfully`)}catch{notifications.error(`Error ${eo!=null&&eo.disabled?"disabling":"enabling"} automation`)}},definitions:async()=>{const ue=await API.getAutomationDefinitions();return to.update(eo=>(eo.blockDefinitions=getFinalDefinitions(ue.trigger,ue.action),eo)),ue},fetch:async()=>{const[ue,eo]=await Promise.all([API.getAutomations(),API.getAutomationDefinitions()]);to.update(no=>(no.automations=ue.automations,no.automations.sort((ro,oo)=>ro.name<oo.name?-1:1),no.blockDefinitions=getFinalDefinitions(eo.trigger,eo.action),no))},select:ue=>{!ue||ue===get_store_value(to).selectedAutomationId||to.update(eo=>(eo.selectedAutomationId=ue,eo.testResults=null,eo.showTestPanel=!1,eo))},getDefinition:ue=>{var eo;return(eo=get_store_value(to.store).automations)==null?void 0:eo.find(no=>no._id===ue)},save:async ue=>{const eo=await API.updateAutomation(ue);return await to.actions.fetch(),to.actions.select(eo.automation._id),eo.automation},delete:async ue=>{isRowAction(ue)?await rowActions.delete(ue.definition.trigger.inputs.tableId,ue.definition.trigger.inputs.rowActionId):await API.deleteAutomation(ue._id,ue._rev),to.update(no=>{var ro;return no.automations=no.automations.filter(oo=>oo._id!==ue._id),ue._id===no.selectedAutomationId&&(no.selectedAutomationId=((ro=no.automations[0])==null?void 0:ro._id)||null),no})}});class AutomationStore extends BudiStore{constructor(){super(initialAutomationState),this.actions=automationActions(this),this.history=createHistoryStore({getDoc:this.actions.getDefinition.bind(this),selectDoc:this.actions.select.bind(this),beforeAction:()=>{},afterAction:()=>{}});const ue=this.actions.save.bind(this.actions),eo=this.actions.delete.bind(this.actions);this.actions.save=this.history.wrapSaveDoc(ue),this.actions.delete=this.history.wrapDeleteDoc(eo)}}const automationStore=new AutomationStore,automationHistoryStore=automationStore.history;class SelectedAutomationStore extends DerivedBudiStore{constructor(ue){const eo=()=>derived(ue,no=>{var ao;if(!no.selectedAutomationId)return{data:null,blockRefs:{},...no};const ro=(ao=no.automations)==null?void 0:ao.find(so=>so._id===no.selectedAutomationId);if(!ro)return{data:null,blockRefs:{},...no};const oo={},io=fp$1.cloneDeep(ro);return io&&(ue.actions.traverse(oo,io),Object.values(oo).filter(so=>so.terminating).forEach(so=>{ue.actions.getPathSteps(so.pathTo,io).forEach((lo,co,uo)=>{migrateReferencesInObject({obj:lo,originalIndex:co,steps:uo})})})),{data:io,blockRefs:oo,...no}});super(initialAutomationState,eo)}}const selectedAutomation=new SelectedAutomationStore(automationStore);class UserStore extends BudiStore{constructor(){super([])}init(ue){this.set(ue)}updateUser(ue){const eo=get_store_value(this);eo.some(no=>no.sessionId===ue.sessionId)?this.update(no=>{const ro=no.findIndex(oo=>oo.sessionId===ue.sessionId);return no[ro]=ue,no.slice()}):this.set([...eo,ue])}removeUser(ue){this.update(eo=>eo.filter(no=>no.sessionId!==ue))}reset(){this.set([])}}const userStore=new UserStore,userSelectedResourceMap=derived(userStore,to=>{let ue={};return to.forEach(eo=>{var ro;const no=(ro=eo.builderMetadata)==null?void 0:ro.selectedResourceId;no&&(ue[no]||(ue[no]=[]),ue[no].push(eo))}),ue}),isOnlyUser=derived(userStore,to=>to.length<2),createDeploymentStore=()=>{let to=writable([]);const ue=async()=>{try{to.set(await API.getAppDeployments())}catch{notifications.error("Error fetching deployments")}};return{subscribe:to.subscribe,load:ue}},deploymentStore=createDeploymentStore(),INITIAL_CONTEXT_MENU_STATE={id:null,items:[],position:{x:0,y:0},visible:!1};function createViewsStore(){const to=writable({...INITIAL_CONTEXT_MENU_STATE}),ue=(no,ro,oo)=>{to.set({id:no,items:ro,position:oo,visible:!0})},eo=()=>{to.set({...INITIAL_CONTEXT_MENU_STATE})};return{subscribe:to.subscribe,open:ue,close:eo}}const contextMenuStore=createViewsStore();class SnippetStore extends BudiStore{constructor(){super([]),this.syncMetadata=ue=>{this.set((ue==null?void 0:ue.snippets)||[])},this.saveSnippet=async ue=>{const eo=[...get_store_value(this).filter(ro=>ro.name!==ue.name),ue],no=await API.saveAppMetadata(get_store_value(appStore).appId,{snippets:eo});this.syncMetadata(no)},this.deleteSnippet=async ue=>{const eo=get_store_value(this).filter(ro=>ro.name!==ue),no=await API.saveAppMetadata(get_store_value(appStore).appId,{snippets:eo});this.syncMetadata(no)}}}const snippets$1=new SnippetStore,features={spectrumThemes:!0,unifiedTheme:!0,intelligentLoading:!0,deviceAwareness:!0,state:!0,customThemes:!0,devicePreview:!0,messagePassing:!0,rowSelection:!0,continueIfAction:!0,showNotificationAction:!0,sidePanel:!0,modal:!0,skeletonLoader:!0},typeSupportPresets={numberLike:{supported:["number","boolean"],partialSupport:[{type:"longform",message:"stringAsNumber"},{type:"string",message:"stringAsNumber"},{type:"bigint",message:"stringAsNumber"},{type:"options",message:"stringAsNumber"},{type:"formula",message:"stringAsNumber"},{type:"datetime",message:"dateAsNumber"}],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]},stringLike:{supported:["string","number","bigint","options","longform","boolean","datetime"],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]},datetimeLike:{supported:["datetime"],partialSupport:[{type:"longform",message:"stringAsDate"},{type:"string",message:"stringAsDate"},{type:"options",message:"stringAsDate"},{type:"formula",message:"stringAsDate"},{type:"bigint",message:"stringAsDate"},{type:"number",message:"numberAsDate"}],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]}},layout$1={name:"Layout",description:"This component is specific only to layouts",icon:"Sandbox",hasChildren:!0,styles:["padding","background"],settings:[{type:"text",label:"Logo URL",key:"logoUrl"},{type:"text",label:"Title",key:"title"},{type:"select",label:"Navigation",key:"navigation",options:["Top","Left","None"],defaultValue:"Top"},{type:"select",label:"Width",key:"width",options:["Small","Medium","Large","Max"],defaultValue:"Large"},{type:"navigation",label:"Links",key:"links"},{type:"boolean",label:"Hide title",key:"hideTitle",defaultValue:!1},{type:"boolean",label:"Hide logo",key:"hideLogo",defaultValue:!1},{type:"boolean",label:"Sticky header",key:"sticky",defaultValue:!1}]},container$1={name:"Container",description:"This component contains things within itself",icon:"Selection",hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},styles:["padding","size","background","border","shadow"],settings:[{type:"select",label:"Layout",key:"layout",showInBar:!0,barStyle:"buttons",options:[{label:"Flex",value:"flex",barIcon:"ModernGridView",barTitle:"Flex layout"},{label:"Grid",value:"grid",barIcon:"ViewGrid",barTitle:"Grid layout"}],defaultValue:"grid"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Size",key:"size",showInBar:!0,barStyle:"buttons",options:[{label:"Shrink",value:"shrink",barIcon:"Minimize",barTitle:"Shrink container"},{label:"Grow",value:"grow",barIcon:"Maximize",barTitle:"Grow container"}],defaultValue:"shrink",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"boolean",label:"Wrap",key:"wrap",showInBar:!0,barIcon:"ModernGridView",barTitle:"Wrap",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"event",label:"On click",key:"onClick"}]},section={name:"Section",description:"Add a section to your application",icon:"ColumnTwoB",hasChildren:!0,illegalChildren:["section"],showEmptyState:!1,size:{width:600,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"section",label:"Type",key:"type",defaultValue:"mainSidebar"}]},screenslot={name:"Screenslot",icon:"WebPage",description:"Contains your app screens",static:!0},buttongroup={name:"Button group",icon:"Button",hasChildren:!1,size:{width:200,height:60},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,defaultValue:[{type:"cta",text:"Button 1"},{type:"primary",text:"Button 2"}]}]},{section:!0,name:"Layout",settings:[{type:"boolean",label:"Collapse",key:"collapsed"},{type:"text",label:"Collapsed text",key:"collapsedText",dependsOn:"collapsed",placeholder:"Action"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"row",dependsOn:{setting:"collapsed",invert:!0}},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"left"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Size",key:"size",showInBar:!0,barStyle:"buttons",options:[{label:"Shrink",value:"shrink",barIcon:"Minimize",barTitle:"Shrink container"},{label:"Grow",value:"grow",barIcon:"Maximize",barTitle:"Grow container"}],defaultValue:"shrink",dependsOn:{setting:"collapsed",invert:!0}},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M",dependsOn:{setting:"collapsed",invert:!0}},{type:"boolean",label:"Wrap",key:"wrap",showInBar:!0,barIcon:"ModernGridView",barTitle:"Wrap",dependsOn:{setting:"collapsed",invert:!0}}]}]},button={name:"Button",description:"A basic html button that is ready for styling",icon:"Button",editable:!0,size:{width:120,height:32},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Text",key:"text",defaultValue:"New Button"},{type:"select",showInBar:!0,label:"Variant",key:"type",options:[{label:"Action",value:"cta"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Warning",value:"warning"},{label:"Over background",value:"overBackground"}],defaultValue:"cta"},{type:"select",label:"Size",showInBar:!0,key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"},{type:"boolean",label:"Quiet",key:"quiet",showInBar:!0,barIcon:"VisibilityOff",barTitle:"Quiet variant",barSeparator:!1},{type:"boolean",label:"Disabled",showInBar:!0,barIcon:"NoEdit",barTitle:"Disable button",key:"disabled"},{type:"icon",label:"Icon",key:"icon"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",dependsOn:"icon",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"},{type:"event",label:"On click",key:"onClick"}]},divider={name:"Divider",description:"A basic divider",icon:"Separator",illegalChildren:["section"],size:{width:400,height:10},settings:[{type:"select",label:"Size",key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"},{type:"boolean",label:"Vertical",key:"vertical"}]},repeater={name:"Repeater",description:"A configurable data list that attaches to your backend tables.",icon:"JourneyData",illegalChildren:["section"],hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column"},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"}],context:[{type:"schema",scope:"local"},{type:"static",scope:"local",values:[{label:"Row index",key:"index",type:"number"}]}]},stackedlist={deprecated:!0,name:"Stacked List",icon:"TaskList",description:"A basic card component that can contain content and actions.",illegalChildren:["section"],settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Subheading",key:"subheading"},{type:"text",label:"Link URL",key:"destinationUrl",placeholder:"/screen"}]},card={deprecated:!0,name:"Vertical Card",description:"A basic card component that can contain content and actions.",icon:"ViewColumn",illegalChildren:["section"],settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Description",key:"description"},{type:"text",label:"Link text",key:"linkText"},{type:"text",label:"Link URL",key:"linkUrl",placeholder:"/screen"},{type:"color",label:"Link color",key:"linkColor",defaultValue:"#000"},{type:"color",label:"Hover color",key:"linkHoverColor",defaultValue:"#222"},{type:"select",label:"Image height",key:"imageHeight",options:["auto","12rem","16rem","20rem","24rem"],defaultValue:"auto"},{type:"select",label:"Card width",key:"cardWidth",options:["16rem","20rem","24rem"],defaultValue:"20rem"}]},text={name:"Paragraph",description:"A component for displaying paragraph text.",icon:"TextParagraph",illegalChildren:["section"],editable:!0,size:{width:400,height:24},settings:[{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Extra small",value:"XS"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"},{label:"2XL",value:"XXL"},{label:"3XL",value:"XXXL"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},heading$1={name:"Headline",icon:"TextBold",description:"A component for displaying heading text",illegalChildren:["section"],editable:!0,size:{width:400,height:32},settings:[{type:"text",key:"text",label:"Text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Extra small",value:"XS"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"},{label:"2XL",value:"XXL"},{label:"3XL",value:"XXXL"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},tag={name:"Tag",icon:"Label",size:{width:100,height:25},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}]},{type:"color",label:"Color",key:"color",showInBar:!0},{type:"color",label:"Text Color",key:"textColor",showInBar:!0},{type:"boolean",label:"Allow delete",key:"closable"},{type:"event",label:"On click delete",key:"onClick",dependsOn:"closable"}]},image={name:"Image",description:"A basic component for displaying images",icon:"Image",styles:["size"],size:{width:400,height:300},settings:[{type:"text",label:"URL",key:"url",required:!0}]},backgroundimage={name:"Background Image",description:"A background image",icon:"Images",hasChildren:!0,styles:["size"],showEmptyState:!1,size:{width:400,height:300},settings:[{type:"text",label:"URL",key:"url",required:!0},{type:"select",label:"Position",key:"position",defaultValue:"center center",options:[{label:"Center top",value:"center top"},{label:"Center",value:"center center"},{label:"Center bottom",value:"center bottom"},{label:"Left top",value:"left top"},{label:"Left center",value:"left center"},{label:"Left bottom",value:"left bottom"},{label:"Right top",value:"right top"},{label:"Right center",value:"right center"},{label:"Right bottom",value:"right bottom"}]}]},icon={name:"Icon",description:"A basic component for displaying icons",icon:"Shapes",size:{width:25,height:25},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"icon",label:"Icon",key:"icon",required:!0},{type:"select",label:"Size",key:"size",defaultValue:"ri-1x",options:[{value:"ri-xxs",label:"XXS"},{value:"ri-xs",label:"XS"},{value:"ri-sm",label:"Small"},{value:"ri-1x",label:"Medium"},{value:"ri-lg",label:"Large"},{value:"ri-xl",label:"XL"},{value:"ri-2x",label:"2XL"},{value:"ri-3x",label:"3XL"},{value:"ri-4x",label:"4XL"},{value:"ri-5x",label:"5XL"},{value:"ri-6x",label:"6XL"},{value:"ri-7x",label:"7XL"},{value:"ri-8x",label:"8XL"},{value:"ri-9x",label:"9XL"},{value:"ri-10x",label:"10XL"}]},{type:"color",label:"Color",key:"color"},{type:"event",label:"On click",key:"onClick"}]},navigation={deprecated:!0,name:"Nav Bar",description:"A component for handling the navigation within your app.",icon:"BreadcrumbNavigation",illegalChildren:["section"],hasChildren:!0,settings:[{type:"text",label:"Logo URL",key:"logoUrl"},{type:"boolean",label:"Hide logo",key:"hideLogo",defaultValue:!1}]},link={name:"Link",description:"A basic link component for internal and external links",icon:"Link",editable:!0,size:{width:200,height:30},settings:[{type:"text",label:"Text",key:"text"},{type:"url",label:"URL",key:"url",placeholder:"/screen"},{type:"boolean",label:"New tab",key:"openInNewTab"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},cardhorizontal={deprecated:!0,name:"Horizontal Card",description:"A basic card component that can contain content and actions.",icon:"ViewRow",settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Description",key:"description"},{type:"text",label:"Subtext",key:"subtext"},{type:"text",label:"Link text",key:"linkText"},{type:"text",label:"Link URL",key:"linkUrl",placeholder:"/screen"},{type:"color",label:"Link color",key:"linkColor",defaultValue:"#000"},{type:"color",label:"Hover color",key:"linkHoverColor",defaultValue:"#222"},{type:"select",label:"Card width",key:"cardWidth",options:["24rem","28rem","32rem","40rem","48rem","60rem","100%"],defaultValue:"32rem"},{type:"select",label:"Image width",key:"imageWidth",options:["auto","8rem","12rem","16rem"],defaultValue:"8rem"},{type:"select",label:"Image height",key:"imageHeight",options:["auto","8rem","12rem","16rem","auto"],defaultValue:"auto"}]},cardstat={name:"Stat Card",description:"A card component for displaying numbers.",icon:"Card",size:{width:260,height:143},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title",placeholder:"Total Revenue",defaultValue:"Title"},{type:"text",label:"Value",key:"value",placeholder:"$1,981,983",defaultValue:"Value"},{type:"text",label:"Label",key:"label",placeholder:"Stripe",defaultValue:"Label"}]},embed={name:"Embed",icon:"Code",description:"Embed content from 3rd party sources",styles:["size"],size:{width:400,height:100},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"text",label:"Embed",key:"embed",required:!0}]},bar={documentationLink:"https://docs.budibase.com/docs/bar-chart",name:"Bar Chart",description:"Bar chart",icon:"GraphBarVertical",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!1},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},line={documentationLink:"https://docs.budibase.com/docs/line-chart",name:"Line Chart",description:"Line chart",icon:"GraphTrend",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},area={documentationLink:"https://docs.budibase.com/docs/area-chart",name:"Area Chart",description:"Line chart",icon:"GraphAreaStacked",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!0},{type:"boolean",label:"Gradient",key:"gradient",defaultValue:!1}]},pie={documentationLink:"https://docs.budibase.com/docs/pie-donut-chart",name:"Pie Chart",description:"Pie chart",icon:"GraphPie",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},donut={documentationLink:"https://docs.budibase.com/docs/pie-donut-chart",name:"Donut Chart",description:"Donut chart",icon:"GraphDonut",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data columns",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},candlestick={documentationLink:"https://docs.budibase.com/docs/candlestick-chart",name:"Candlestick Chart",description:"Candlestick chart",icon:"GraphBarVerticalStacked",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Date column",key:"dateColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"datetimeLike"}},required:!0},{type:"field",label:"Open column",key:"openColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Close column",key:"closeColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"High column",key:"highColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Low column",key:"lowColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0}]},histogram={documentationLink:"https://docs.budibase.com/docs/histogram-chart",name:"Histogram Chart",description:"Histogram chart",icon:"Histogram",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Y axis label",key:"yAxisLabel",defaultValue:"Frequency"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"number",label:"Bucket count",key:"bucketCount",defaultValue:10,min:2},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1}]},form$2={name:"Form",icon:"Form",hasChildren:!0,illegalChildren:["section","form","formblock"],actions:["ValidateForm","ClearForm","ChangeFormStep","UpdateFieldValue","ScrollTo"],styles:["padding","size","background","border","shadow"],size:{width:400,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"select",label:"Type",key:"actionType",options:["Create","Update"],defaultValue:"Create"},{type:"schema",label:"Schema",key:"dataSource",defaultValue:{name:"Custom",label:"Custom"}},{type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"text",label:"Initial form step",key:"initialFormStep",defaultValue:1}],context:[{type:"static",values:[{label:"Value",key:"__value",type:"object"},{label:"Valid",key:"__valid",type:"boolean"},{label:"Current Step",key:"__currentStep",type:"number"},{label:"Current Step Valid",key:"__currentStepValid",type:"boolean"}]},{type:"form"}]},formstep={name:"Form Step",icon:"AssetsAdded",hasChildren:!0,requiredAncestors:["form"],illegalChildren:["section","form","formstep","formblock"],styles:["size"],size:{width:400,height:400},settings:[{type:"number",label:"Step",key:"step",defaultValue:1,min:1}]},fieldgroup={name:"Field Group",icon:"Group",requiredAncestors:["form"],illegalChildren:["section"],styles:["size"],hasChildren:!0,size:{width:400,height:400},settings:[{type:"select",label:"Labels",key:"labelPosition",defaultValue:"above",options:[{label:"Left",value:"left"},{label:"Above",value:"above"}]},{type:"section",label:"Type",key:"type",defaultValue:"oneColumn",dependsOn:{setting:"labelPosition",value:"above"}}]},labelfield={name:"Text Field",icon:"Text",editable:!0,size:{width:400,height:60},settings:[{type:"plainText",label:"Label",key:"label"},{type:"number",label:"Initial width",key:"width",placeholder:"Auto",min:80,max:9999},{type:"tableConditions",label:"Conditions",key:"conditions"}]},stringfield={name:"Text Field",icon:"Text",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/string",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},numberfield={name:"Number Field",icon:"123",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/number",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/number",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"number"}]}},bigintfield={name:"BigInt Field",icon:"TagBold",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/bigint",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"number"}]}},passwordfield={name:"Password Field",icon:"LockClosed",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/string",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},optionsfield={name:"Options Picker",icon:"Menu",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/options",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Choose an option"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"select",label:"Type",key:"optionsType",defaultValue:"select",placeholder:"Pick an options type",options:[{label:"Select",value:"select"},{label:"Radio buttons",value:"radio"}]},{type:"select",label:"Direction",key:"direction",defaultValue:"vertical",options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],dependsOn:{setting:"optionsType",value:"radio"}},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Autocomplete",key:"autocomplete",defaultValue:!1,dependsOn:{setting:"optionsType",value:"select"}},{type:"boolean",label:"Alphabetical",key:"sort",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Options source",key:"optionsSource",defaultValue:"schema",placeholder:"Pick an options source",options:[{label:"Schema",value:"schema"},{label:"Data provider",value:"provider"},{label:"Custom",value:"custom"}]},{type:"dataProvider",label:"Options provider",key:"dataProvider",required:!0,dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Label column",key:"labelColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Value column",key:"valueColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"options",label:"Custom options",key:"customOptions",dependsOn:{setting:"optionsSource",value:"custom"}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},multifieldselect={name:"Multi-select Picker",icon:"ViewList",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/array",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Choose an option"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Autocomplete",key:"autocomplete",defaultValue:!1,dependsOn:{setting:"optionsType",value:"select"}},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Type",key:"optionsType",defaultValue:"select",placeholder:"Pick an options type",options:[{label:"Select",value:"select"},{label:"Checkboxes",value:"checkbox"}]},{type:"select",label:"Direction",key:"direction",defaultValue:"vertical",options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],dependsOn:{setting:"optionsType",value:"checkbox"}},{type:"select",label:"Options source",key:"optionsSource",defaultValue:"schema",placeholder:"Pick an options source",options:[{label:"Schema",value:"schema"},{label:"Data provider",value:"provider"},{label:"Custom",value:"custom"}]},{type:"dataProvider",label:"Options provider",key:"dataProvider",required:!0,dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Label column",key:"labelColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Value column",key:"valueColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"options",label:"Custom options",key:"customOptions",dependsOn:{setting:"optionsSource",value:"custom"}},{type:"validation/array",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},booleanfield={name:"Checkbox",icon:"SelectBox",editable:!0,size:{width:400,height:60},settings:[{type:"field/boolean",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/boolean",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"boolean"}]}},longformfield={name:"Long Form Field",icon:"TextAlignLeft",styles:["size"],editable:!0,size:{width:400,height:100},settings:[{type:"field/longform",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Type something..."},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"select",label:"Formatting",key:"format",placeholder:null,options:[{label:"Auto",value:"auto"},{label:"Plain text",value:"plain"},{label:"Rich text (markdown)",value:"rich"}],defaultValue:"auto"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},datetimefield={name:"Date Picker",icon:"Date",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/datetime",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"boolean",label:"Show time",key:"enableTime",defaultValue:!0},{type:"boolean",label:"Time only",key:"timeOnly",defaultValue:!1},{type:"boolean",label:"Ignore time zones",key:"ignoreTimezones",defaultValue:!1},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/datetime",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"datetime"}]}},codescanner={name:"Barcode/QR Scanner",icon:"Camera",styles:["size"],size:{width:400,height:60},settings:[{type:"field/barcodeqr",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Button text",key:"scanButtonText"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Manual entry",key:"allowManualEntry",defaultValue:!1},{type:"boolean",label:"Auto confirm",key:"autoConfirm",defaultValue:!1},{type:"boolean",label:"Play sound on scan",key:"beepOnScan",defaultValue:!1},{type:"select",label:"Sound pitch",key:"beepFrequency",dependsOn:"beepOnScan",defaultValue:2637,options:[{label:"Low",value:2096},{label:"Regular",value:2637},{label:"High",value:3136},{label:"Custom",value:"custom"}]},{type:"number",label:"Sound frequency (Hz)",key:"customFrequency",defaultValue:1046,min:20,max:8e3,dependsOn:{setting:"beepFrequency",value:"custom"}},{type:"select",label:"Preferred camera",key:"preferredCamera",defaultValue:"environment",options:[{label:"Front",value:"user"},{label:"Back",value:"environment"}]},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},signaturesinglefield={name:"Signature",icon:"AnnotatePen",styles:["size"],size:{width:400,height:60},settings:[{type:"field/signature_single",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/signature_single",label:"Validation",key:"validation"}]},embeddedmap={name:"Embedded Map",icon:"Location",styles:["size"],draggable:!1,size:{width:400,height:320},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider"},{type:"field",label:"Latitude key",key:"latitudeKey",dependsOn:"dataProvider"},{type:"field",label:"Longitude key",key:"longitudeKey",dependsOn:"dataProvider"},{type:"field",label:"Title key",key:"titleKey",dependsOn:"dataProvider"},{type:"event",label:"On click marker",key:"onClickMarker",context:[{label:"Clicked marker",key:"marker"}]},{type:"boolean",label:"Enable adding",key:"creationEnabled",defaultValue:!1},{type:"event",label:"On create marker",key:"onCreateMarker",dependsOn:"creationEnabled",context:[{label:"New marker latitude",key:"lat"},{label:"New marker longitude",key:"lng"}]},{type:"boolean",label:"Enable fullscreen",key:"fullScreenEnabled",defaultValue:!0},{type:"boolean",label:"Enable location",key:"locationEnabled",defaultValue:!0},{type:"boolean",label:"Enable zoom",key:"zoomEnabled",defaultValue:!0},{type:"text",label:"Tile URL",key:"tileURL",defaultValue:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"},{type:"text",label:"Default location",key:"defaultLocation",placeholder:"51.5072,-0.1276"},{type:"number",label:"Default zoom (0-100)",key:"zoomLevel",placeholder:50,max:100,min:0},{type:"text",label:"Map attribution",key:"mapAttribution",defaultValue:"OpenStreetMap contributors"}]},attachmentfield={name:"Attachment List",icon:"DocumentFragmentGroup",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:200},settings:[{type:"field/attachment",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"text",label:"Extensions",key:"extensions"},{type:"number",label:"Max attachments",key:"maximum",min:1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Compact",key:"compact",defaultValue:!1},{type:"boolean",label:"Read only",key:"disabled",defaultValue:!1},{type:"validation/attachment",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},attachmentsinglefield={name:"Single Attachment",icon:"DocumentFragment",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:200},settings:[{type:"field/attachment_single",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"text",label:"Extensions",key:"extensions"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Compact",key:"compact",defaultValue:!1},{type:"boolean",label:"Read only",key:"disabled",defaultValue:!1},{type:"validation/attachment_single",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},relationshipfield={name:"Relationship Picker",icon:"TaskList",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:60},settings:[{type:"field/link",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"filter/relationship",label:"Filtering",key:"filter"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},jsonfield={name:"JSON Field",icon:"Brackets",styles:["size"],editable:!0,size:{width:400,height:100},settings:[{type:"field/json",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},s3upload={name:"S3 File Upload",icon:"UploadToCloud",styles:["size"],editable:!0,size:{width:400,height:200},settings:[{type:"field/s3",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"dataSource/s3",label:"S3 datasource",key:"datasourceId",info:"This component can't be used with S3 datasources that use custom endpoints"},{type:"text",label:"Bucket",key:"bucket"},{type:"text",label:"File name",key:"key",nested:!0},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"validation/attachment",label:"Validation",key:"validation"}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},dataprovider={name:"Data Provider",icon:"Data",illegalChildren:["section"],hasChildren:!0,actions:["RefreshDatasource"],size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"filter",label:"Filtering",key:"filter",resetOn:"dataSource"},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending"},{type:"number",label:"Limit",key:"limit",defaultValue:50},{type:"boolean",label:"Paginate",key:"paginate",defaultValue:!0,info:"Pagination is only available for data stored in tables"}],context:{type:"static",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]}},table$1={deprecated:!0,name:"Table",icon:"Table",illegalChildren:["section"],hasChildren:!0,showEmptyState:!1,actions:["ClearRowSelection"],size:{width:600,height:400},settings:[{type:"dataProvider",label:"Data provider",key:"dataProvider",required:!0},{type:"columns",label:"Columns",key:"columns",dependsOn:"dataProvider",nested:!0},{type:"select",label:"Size",key:"size",defaultValue:"spectrum--medium",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}]},{type:"number",label:"Row count",key:"rowCount",defaultValue:8},{type:"boolean",label:"Quiet",key:"quiet"},{type:"boolean",label:"Compact",key:"compact"},{type:"boolean",label:"Row selection",key:"allowSelectRows",defaultValue:!1,info:"Row selection is only compatible with internal or SQL tables"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{section:!0,name:"On Row Click",settings:[{type:"event",key:"onClick",context:[{label:"Clicked row",key:"row"}]}]}],context:[{type:"schema",scope:"local"},{type:"static",values:[{label:"Selected Rows",key:"selectedRows",type:"array"}]}]},daterangepicker={name:"Date Range",icon:"Calendar",styles:["size"],hasChildren:!1,size:{width:200,height:50},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0,info:"Your data provider will be automatically filtered to the given date range."},{type:"field",label:"Date field",key:"field",required:!0},{type:"select",label:"Default range",key:"defaultValue",options:["Last 1 day","Last 7 days","Last 30 days","Last 3 months","Last 6 months","Last 1 year"],defaultValue:"Last 30 days"}]},spectrumcard={name:"Card",icon:"PersonalizationField",styles:["size"],size:{width:300,height:120},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",key:"title",label:"Title",defaultValue:"Title"},{type:"text",key:"subtitle",label:"Subtitle",defaultValue:"Subtitle"},{type:"text",key:"description",label:"Description",defaultValue:"Description"},{type:"text",key:"imageURL",label:"Image URL"},{type:"url",key:"linkURL",label:"Link URL"},{type:"boolean",key:"linkPeek",label:"Open in modal"},{type:"boolean",key:"horizontal",label:"Horizontal"},{type:"boolean",label:"Show button",key:"showButton"},{type:"text",key:"buttonText",label:"Button text",dependsOn:"showButton"},{type:"event",label:"Click action",key:"buttonOnClick"}]},dynamicfilter={name:"Dynamic Filter",icon:"Filter",size:{width:100,height:35},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"columns/basic",label:"Allowed filter columns",key:"allowedFields",dependsOn:"dataProvider"},{type:"select",label:"Button size",showInBar:!0,key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"}]},chartblock={documentationLink:"https://docs.budibase.com/docs/chart",block:!0,name:"Chart Block",icon:"GraphPie",hasChildren:!1,size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"select",label:"Chart type",key:"chartType",required:!0,options:[{label:"Pie",value:"pie"},{label:"Bar",value:"bar"},{label:"Histogram",value:"histogram"},{label:"Line",value:"line"},{label:"Donut",value:"donut"},{label:"Candlestick",value:"candlestick"},{label:"Area",value:"area"}]},{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"text",label:"Title",key:"chartTitle"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field",label:"Sort column",key:"sortColumn"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending"},{type:"number",label:"Limit",key:"limit",defaultValue:50},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Legend",key:"legend",defaultValue:!0},{type:"boolean",label:"Animate",key:"animate",defaultValue:!1},{section:!0,name:"Pie Chart",icon:"GraphPie",dependsOn:{setting:"chartType",value:"pie"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0}]},{section:!0,name:"Donut Chart",icon:"GraphDonut",dependsOn:{setting:"chartType",value:"donut"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0}]},{section:!0,name:"Bar Chart",icon:"GraphBarVertical",dependsOn:{setting:"chartType",value:"bar"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!1},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1}]},{section:!0,name:"Histogram Chart",icon:"Histogram",dependsOn:{setting:"chartType",value:"histogram"},settings:[{type:"field",label:"Value column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1},{type:"number",label:"Bucket count",key:"bucketCount",defaultValue:10,min:2}]},{section:!0,name:"Line Chart",icon:"GraphTrend",dependsOn:{setting:"chartType",value:"line"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"}]},{section:!0,name:"Area Chart",icon:"GraphAreaStacked",dependsOn:{setting:"chartType",value:"area"},settings:[{type:"field",label:"Label columns",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!0},{type:"boolean",label:"Gradient",key:"gradient",defaultValue:!1}]},{section:!0,name:"Candlestick Chart",icon:"GraphBarVerticalStacked",dependsOn:{setting:"chartType",value:"candlestick"},settings:[{type:"field",label:"Date column",key:"dateColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"datetimeLike"}},required:!0},{type:"field",label:"Open column",key:"openColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Close column",key:"closeColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"High column",key:"highColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Low column",key:"lowColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"}]}]},tableblock={deprecated:!0,block:!0,name:"Table Block",icon:"Table",styles:["size"],size:{width:600,height:400},settings:[{type:"text",label:"Title",key:"title"},{section:!0,name:"Table",settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"columns",label:"Columns",key:"tableColumns",dependsOn:"dataSource",placeholder:"All columns",nested:!0},{type:"field/sortable",label:"Sort by",key:"sortColumn",placeholder:"Default"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending",dependsOn:"sortColumn"},{type:"select",label:"Size",key:"size",defaultValue:"spectrum--medium",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}]},{type:"number",label:"Scroll limit",key:"rowCount",defaultValue:8},{type:"boolean",label:"Paginate",key:"paginate",defaultValue:!0},{type:"boolean",label:"Quiet",key:"quiet"},{type:"boolean",label:"Compact",key:"compact"},{type:"boolean",label:"Row selection",key:"allowSelectRows",info:"Row selection is only compatible with internal or SQL tables"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"searchfield",label:"Search fields",key:"searchColumns",placeholder:"Choose search fields",info:"Only the first 5 fields will be used"}]},{section:!0,name:"On row click",settings:[{label:"Behaviour",labelHidden:!0,type:"radio",key:"clickBehaviour",sendEvents:!0,defaultValue:"actions",info:"Details side panel is only compatible with internal or SQL tables",options:[{label:"Run actions",value:"actions"},{label:"Show details side panel",value:"details"}]},{label:"Actions",labelHidden:!0,type:"event",key:"onClick",nested:!0,dependsOn:{setting:"clickBehaviour",value:"actions"},context:[{label:"Clicked row",key:"row"}]},{label:"",type:"fieldConfiguration",key:"sidePanelFields",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"},resetOn:"dataSource"},{label:"Save button",type:"text",key:"sidePanelSaveLabel",defaultValue:"Save",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"}},{label:"Delete button",type:"text",key:"sidePanelDeleteLabel",defaultValue:"Delete",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"}},{type:"boolean",label:"Hide notifications",key:"notificationOverride",defaultValue:!1,dependsOn:{setting:"clickBehaviour",value:"details"}}]},{section:!0,name:"Button",settings:[{type:"boolean",key:"showTitleButton",label:"Show button",defaultValue:!1},{type:"text",key:"titleButtonText",label:"Text",defaultValue:"Create row",dependsOn:"showTitleButton"},{type:"radio",key:"titleButtonClickBehaviour",label:"Behaviour",dependsOn:"showTitleButton",defaultValue:"actions",info:"New row side panel is only compatible with internal or SQL tables",options:[{label:"Run actions",value:"actions"},{label:"Show new row side panel",value:"new"}]},{type:"event",label:"On click",key:"onClickTitleButton",nested:!0,dependsOn:{setting:"titleButtonClickBehaviour",value:"actions"}}]}],context:[{type:"static",suffix:"provider",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]},{type:"static",suffix:"table",values:[{label:"Selected Rows",key:"selectedRows",type:"array"}]}]},cardsblock={block:!0,name:"Cards Block",icon:"PersonalizationField",styles:["size"],size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"searchfield",label:"Search columns",key:"searchColumns",placeholder:"Choose search columns",info:"Max 5 columns will be used"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Descending"},{type:"number",label:"Limit",key:"limit",defaultValue:8},{type:"boolean",label:"Paginate",key:"paginate"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{section:!0,name:"Cards",settings:[{type:"text",key:"cardTitle",label:"Title",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardSubtitle",label:"Subtitle",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardDescription",label:"Description",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardImageURL",label:"Image URL",nested:!0,resetOn:"dataSource"},{type:"boolean",key:"linkCardTitle",label:"Link card title"},{type:"boolean",key:"cardPeek",label:"Open in modal"},{type:"url",label:"Link screen",key:"cardURL",nested:!0},{type:"boolean",key:"cardHorizontal",label:"Horizontal"},{type:"boolean",label:"Add button",key:"showCardButton"},{type:"text",key:"cardButtonText",label:"Button text",nested:!0,dependsOn:"showCardButton"},{type:"event",label:"Click action",key:"cardButtonOnClick",nested:!0}]},{section:!0,name:"Title button",settings:[{type:"boolean",key:"showTitleButton",label:"Show button"},{type:"boolean",label:"Open in modal",key:"titleButtonPeek"},{type:"text",key:"titleButtonText",label:"Button text"},{type:"url",label:"Button link",key:"titleButtonURL"}]},{section:!0,name:"Advanced",settings:[{type:"field",label:"ID column",key:"linkColumn",placeholder:"Default"}]}],context:{type:"schema",suffix:"repeater",scope:"local"}},repeaterblock={block:!0,name:"Repeater Block",icon:"ViewList",illegalChildren:["section","rowexplorer"],hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Descending"},{type:"number",label:"Limit",key:"limit",defaultValue:10},{type:"boolean",label:"Paginate",key:"paginate"},{section:!0,name:"Layout settings",settings:[{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column"},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"}]}],context:[{type:"static",suffix:"provider",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]},{type:"static",suffix:"repeater",values:[{label:"Row Index",key:"index",type:"number"}]},{type:"schema",suffix:"repeater",scope:"local"}]},markdownviewer={name:"Markdown Viewer",icon:"Preview",styles:["size"],size:{width:400,height:100},grid:{hAlign:"stretch",vAlign:"start"},settings:[{type:"text",label:"Markdown",key:"value",required:!0}]},multistepformblock={name:"Multi-step Form Block",icon:"AssetsAdded",block:!0,hasChildren:!1,ejectable:!1,size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"start"},styles:["padding","size","background","border","shadow"],settings:[{type:"table",label:"Data",key:"dataSource"},{type:"radio",label:"Type",key:"actionType",options:["Create","Update","View"],defaultValue:"Create"},{section:!0,dependsOn:{setting:"actionType",value:"Create",invert:!0},name:"Row ID",info:"<a href='https://docs.budibase.com/docs/form-block' target='_blank'>How to pass a row ID using bindings</a>",settings:[{type:"text",label:"Row ID",key:"rowId",nested:!0},{type:"text",label:"No rows found",key:"noRowsMessage",defaultValue:"We couldn't find a row to display",nested:!0}]},{section:!0,name:"Details",settings:[{type:"stepConfiguration",key:"steps",nested:!0,labelHidden:!0,resetOn:["dataSource","actionType"],defaultValue:[{}]}]},{tag:"style",type:"select",label:"Button position",key:"buttonPosition",options:[{label:"Bottom",value:"bottom"},{label:"Top",value:"top"}],defaultValue:"bottom"},{tag:"style",type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"}],actions:[{type:"ValidateForm",suffix:"form"},{type:"ClearForm",suffix:"form"},{type:"UpdateFieldValue",suffix:"form"},{type:"ScrollTo",suffix:"form"},{type:"ChangeFormStep",suffix:"form"},{type:"RefreshDatasource",suffix:"provider"}],context:[{type:"form",suffix:"form"},{type:"schema",suffix:"repeater"},{type:"static",suffix:"form",values:[{label:"Value",key:"__value",type:"object"},{label:"Valid",key:"__valid",type:"boolean"},{label:"Current Step",key:"__currentStep",type:"number"},{label:"Current Step Valid",key:"__currentStepValid",type:"boolean"}]}]},multistepformblockstep={name:"Multi-step Form Block Step",settings:[{type:"formStepControls",label:"Steps",key:"steps"},{type:"text",label:"Title",key:"title",nested:!0},{type:"text",label:"Description",key:"desc",nested:!0},{type:"fieldConfiguration",key:"fields",nested:!0},{type:"buttonConfiguration",label:"Buttons",key:"buttons",wide:!0,nested:!0},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]},formblock={name:"Form Block",icon:"Form",styles:["padding","size","background","border","shadow"],block:!0,info:"Form blocks are only compatible with internal or SQL tables",size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"start"},settings:[{type:"table",label:"Data",key:"dataSource"},{type:"radio",label:"Type",key:"actionType",options:["Create","Update","View"],defaultValue:"Create"},{section:!0,dependsOn:{setting:"actionType",value:"Create",invert:!0},name:"Row ID",info:"<a href='https://docs.budibase.com/docs/form-block' target='_blank'>How to pass a row ID using bindings</a>",settings:[{type:"text",label:"Row ID",key:"rowId",nested:!0},{type:"text",label:"No rows found",key:"noRowsMessage",defaultValue:"We couldn't find a row to display",nested:!0}]},{section:!0,name:"Details",settings:[{type:"text",label:"Title",key:"title",nested:!0},{type:"text",label:"Description",key:"description",nested:!0},{type:"fieldConfiguration",key:"fields",nested:!0,resetOn:"dataSource",selectAllFields:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1}]},{tag:"style",type:"select",label:"Button position",key:"buttonPosition",options:[{label:"Bottom",value:"bottom"},{label:"Top",value:"top"}],defaultValue:"bottom"},{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,resetOn:["actionType","dataSource"]},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]},{tag:"style",type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"}],actions:[{type:"ValidateForm",suffix:"form"},{type:"ClearForm",suffix:"form"},{type:"UpdateFieldValue",suffix:"form"},{type:"ScrollTo",suffix:"form"},{type:"RefreshDatasource",suffix:"provider"}],context:[{type:"form",suffix:"form"},{type:"schema",suffix:"repeater"}]},sidepanel={name:"Side Panel",icon:"RailRight",hasChildren:!0,ignoresLayout:!0,illegalChildren:["section","sidepanel","modal"],showEmptyState:!1,draggable:!1,info:"Side panels are hidden by default. They will only be revealed when triggered by the 'Open Side Panel' action.",settings:[{type:"boolean",key:"ignoreClicksOutside",label:"Ignore clicks outside",defaultValue:!1},{type:"event",key:"onClose",label:"On close"}]},modal$1={name:"Modal",icon:"MBox",hasChildren:!0,illegalChildren:["section","modal","sidepanel"],ignoresLayout:!0,showEmptyState:!1,draggable:!1,info:"Modals are hidden by default. They will only be revealed when triggered by the 'Open Modal' action.",settings:[{type:"boolean",key:"ignoreClicksOutside",label:"Ignore clicks outside",defaultValue:!1},{type:"event",key:"onClose",label:"On close"},{type:"select",label:"Size",key:"size",defaultValue:"small",options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"Fullscreen",value:"fullscreen"}]}]},rowexplorer={block:!0,name:"Row Explorer Block",icon:"PersonalizationField",size:{width:800,height:426},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"table",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"text",label:"Height",key:"height",defaultValue:"426px"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No data"},{section:!0,name:"Cards",settings:[{type:"field",label:"Search field",key:"cardSearchField",nested:!0},{type:"text",key:"cardTitle",label:"Title",nested:!0,defaultValue:"Title"},{type:"text",key:"cardSubtitle",label:"Subtitle",nested:!0,defaultValue:"Subtitle"},{type:"text",key:"cardDescription",label:"Description",nested:!0,defaultValue:"Description"},{type:"text",key:"cardImageURL",label:"Image URL",nested:!0}]},{section:!0,name:"Details",settings:[{type:"text",key:"detailTitle",label:"Title"},{type:"multifield",label:"Fields",key:"detailFields",nested:!0,selectAllFields:!0}]}],context:{type:"schema",suffix:"repeater",scope:"local"}},gridblock={name:"Table",icon:"Table",styles:["size"],size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"table",required:!0},{type:"filter",label:"Filtering",key:"initialFilter",dependsOn:{setting:"table.type",value:"custom",invert:!0}},{type:"field/sortable",label:"Sort column",key:"initialSortColumn",placeholder:"Default",dependsOn:{setting:"table.type",value:"custom",invert:!0}},{type:"select",label:"Sort order",key:"initialSortOrder",options:["Ascending","Descending"],defaultValue:"Ascending",dependsOn:"initialSortColumn"},{type:"select",label:"Row height",key:"fixedRowHeight",placeholder:"Default",options:[{label:"Small",value:36},{label:"Medium",value:64},{label:"Large",value:92}]},{type:"event",label:"On row click",key:"onRowClick",context:[{label:"Clicked row",key:"row"}]},{type:"boolean",label:"Add rows",key:"allowAddRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"Edit rows",key:"allowEditRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"Delete rows",key:"allowDeleteRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"High contrast",key:"stripeRows",defaultValue:!1},{type:"boolean",label:"Quiet",key:"quiet",defaultValue:!1},{section:!0,name:"Columns",settings:[{type:"columns/grid",key:"columns",resetOn:"table"}]},{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,context:[{label:"Clicked row",key:"row"}]},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]}],context:[{type:"schema",scope:"local"},{type:"static",values:[{label:"Selected rows",key:"selectedRows",type:"array"}]}],actions:["RefreshDatasource"]},bbreferencefield={devComment:"As bb reference is only used for user subtype for now, we are using user for icon and labels",name:"User List Field",icon:"UserGroup",styles:["size"],editable:!0,size:{width:400,height:50},settings:[{type:"field/bb_reference",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue"},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},bbreferencesinglefield={devComment:"As bb reference is only used for user subtype for now, we are using user for icon and labels",name:"User Field",icon:"User",styles:["size"],editable:!0,size:{width:400,height:50},settings:[{type:"field/bb_reference_single",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue"},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},clientManifest={features,typeSupportPresets,layout:layout$1,container:container$1,section,screenslot,buttongroup,button,divider,repeater,stackedlist,card,text,heading:heading$1,tag,image,backgroundimage,icon,navigation,link,cardhorizontal,cardstat,embed,bar,line,area,pie,donut,candlestick,histogram,form:form$2,formstep,fieldgroup,labelfield,stringfield,numberfield,bigintfield,passwordfield,optionsfield,multifieldselect,booleanfield,longformfield,datetimefield,codescanner,signaturesinglefield,embeddedmap,attachmentfield,attachmentsinglefield,relationshipfield,jsonfield,s3upload,dataprovider,table:table$1,daterangepicker,spectrumcard,dynamicfilter,chartblock,tableblock,cardsblock,repeaterblock,markdownviewer,multistepformblock,multistepformblockstep,formblock,sidepanel,modal:modal$1,rowexplorer,gridblock,bbreferencefield,bbreferencesinglefield};function findComponentsBySettingsType(to,ue){const eo=Array.isArray(ue)?ue:[ue],no=[];function ro(oo){var so;if(!oo)return;const io=getManifestDefinition(oo),ao="settings"in io&&io.settings.find(lo=>eo.includes(lo.type));ao&&"type"in ao&&no.push({component:oo,setting:{type:ao.type,key:ao.key}}),(so=oo._children)==null||so.forEach(lo=>{ro(lo)})}return ro(to==null?void 0:to.props),no}function getManifestDefinition(to){const ue=to._component.split("/").slice(-1)[0];return clientManifest[ue]}class TableImportError extends Error{constructor(ue){super(),this.name="TableImportError",this.errors=ue}get description(){let ue="";for(const eo in this.errors)ue+=`${eo}: ${this.errors[eo]}
|
|
519
|
+
making the process more digestible for your users.</p>`},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}class NewFormSteps extends SvelteComponent{constructor(ue){super(),init$3(this,ue,null,create_fragment$9b,safe_not_equal,{})}}const ONBOARDING_EVENT_PREFIX="onboarding",TOUR_STEP_KEYS={BUILDER_APP_PUBLISH:"builder-app-publish",BUILDER_DATA_SECTION:"builder-data-section",BUILDER_DESIGN_SECTION:"builder-design-section",BUILDER_USER_MANAGEMENT:"builder-user-management",BUILDER_AUTOMATION_SECTION:"builder-automation-section",FEATURE_USER_MANAGEMENT:"feature-user-management",BUILDER_FORM_CREATE_STEPS:"builder-form-create-steps",BUILDER_FORM_VIEW_UPDATE_STEPS:"builder-form-view-update-steps",BUILDER_FORM_ROW_ID:"builder-form-row-id"},TOUR_KEYS={TOUR_BUILDER_ONBOARDING:"builder-onboarding",FEATURE_ONBOARDING:"feature-onboarding",BUILDER_FORM_CREATE:"builder-form-create",BUILDER_FORM_VIEW_UPDATE:"builder-form-view-update"},getCurrentStepIdx=(to,ue)=>{if(to!=null&&to.length)return to!=null&&to.length&&!ue?0:to.findIndex(eo=>eo.id===ue)},endUserOnboarding=async({skipped:to=!1}={})=>{if(get_store_value(auth).user){try{await API.updateSelf({onboardedAt:new Date().toISOString()}),to&&tourEvent("skipped"),await auth.getSelf(),builderStore.endBuilderOnboarding(),builderStore.setTour()}catch(ue){return console.error("Onboarding failed",ue),!1}return!0}},endTour=async({key:to,skipped:ue=!1}={})=>{const{tours:eo={}}=get_store_value(auth).user;eo[to]=new Date().toISOString(),await API.updateSelf({tours:eo}),ue&&tourEvent(to,ue),await auth.getSelf(),builderStore.setTour()},tourEvent=(to,ue)=>{analytics.captureEvent(`${ONBOARDING_EVENT_PREFIX}:${to}`,{eventSource:EventSource.PORTAL,skipped:ue})},getTours=()=>({[TOUR_KEYS.TOUR_BUILDER_ONBOARDING]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_DATA_SECTION,title:"Data",route:"/builder/app/:application/data",layout:OnboardingData,query:".topleftnav .spectrum-Tabs-item#builder-data-tab",onLoad:async()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_DATA_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_DESIGN_SECTION,title:"Design",route:"/builder/app/:application/design",layout:OnboardingDesign,query:".topleftnav .spectrum-Tabs-item#builder-design-tab",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_DESIGN_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_AUTOMATION_SECTION,title:"Automations",route:"/builder/app/:application/automation",query:".topleftnav .spectrum-Tabs-item#builder-automation-tab",body:"Once you have your app screens made, you can set up automations to fit in with your current workflow",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_AUTOMATION_SECTION)},align:"left"},{id:TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT,title:"Users",query:".toprightnav #builder-app-users-button",body:"Add users to your app and control what level of access they have.",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT)}},{id:TOUR_STEP_KEYS.BUILDER_APP_PUBLISH,title:"Publish",layout:OnboardingPublish,route:"/builder/app/:application/design",query:".toprightnav #builder-app-publish-button",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_APP_PUBLISH)},onComplete:endUserOnboarding}],onSkip:async()=>{await endUserOnboarding({skipped:!0})},endRoute:"/builder/app/:application/data"},[TOUR_KEYS.FEATURE_ONBOARDING]:{steps:[{id:TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT,title:"Users",query:".toprightnav #builder-app-users-button",body:"Add users to your app and control what level of access they have.",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT)},onComplete:endUserOnboarding}]},[TOUR_KEYS.BUILDER_FORM_CREATE]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_FORM_CREATE_STEPS,title:"Add multiple steps",layout:NewFormSteps,query:"#steps-prop-control-wrap",onComplete:()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_CREATE})},onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_CREATE_STEPS),builderStore.highlightSetting("steps","info")},align:"left-outside"}]},[TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE]:{steps:[{id:TOUR_STEP_KEYS.BUILDER_FORM_ROW_ID,title:"Add row ID to update a row",layout:NewViewUpdateFormRowId,query:"#rowId-prop-control-wrap",onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_ROW_ID),builderStore.highlightSetting("rowId","info")},align:"left-outside"},{id:TOUR_STEP_KEYS.BUILDER_FORM_VIEW_UPDATE_STEPS,title:"Add multiple steps",layout:NewFormSteps,query:"#steps-prop-control-wrap",onComplete:()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE})},onLoad:()=>{tourEvent(TOUR_STEP_KEYS.BUILDER_FORM_VIEW_UPDATE_STEPS),builderStore.highlightSetting("steps","info")},align:"left-outside",scrollIntoView:!0}],onSkip:async()=>{builderStore.highlightSetting(),endTour({key:TOUR_KEYS.BUILDER_FORM_VIEW_UPDATE,skipped:!0})}}}),TOURS=getTours(),TOURSBYSTEP=Object.keys(TOURS).reduce((to,ue)=>(TOURS[ue].steps.forEach(eo=>{to[eo.id]=eo,to[eo.id].tour=ue}),to),{}),INITIAL_BUILDER_STATE={previousTopNavPath:{},highlightedSetting:null,propertyFocus:null,builderSidePanel:!1,onboarding:!1,tourNodes:null,tourKey:null,tourStepKey:null,hoveredComponentId:null};class BuilderStore extends BudiStore{constructor(){super({...INITIAL_BUILDER_STATE}),this.init=this.init.bind(this),this.refresh=this.refresh.bind(this),this.reset=this.reset.bind(this),this.highlightSetting=this.highlightSetting.bind(this),this.propertyFocus=this.propertyFocus.bind(this),this.hideBuilderSidePanel=this.hideBuilderSidePanel.bind(this),this.showBuilderSidePanel=this.showBuilderSidePanel.bind(this),this.setPreviousTopNavPath=this.setPreviousTopNavPath.bind(this),this.selectResource=this.selectResource.bind(this),this.registerTourNode=this.registerTourNode.bind(this),this.destroyTourNode=this.destroyTourNode.bind(this),this.startBuilderOnboarding=this.startBuilderOnboarding.bind(this)}init(ue){if(!(ue!=null&&ue.appId)){console.error("BuilderStore: No appId supplied for websocket");return}this.websocket||(this.websocket=createBuilderWebsocket(ue.appId))}refresh(){const ue=get_store_value(this.store);this.store.set(ue)}reset(){var ue;this.store.set({...INITIAL_BUILDER_STATE}),(ue=this.websocket)==null||ue.disconnect(),this.websocket=void 0}highlightSetting(ue,eo){this.update(no=>({...no,highlightedSetting:ue?{key:ue,type:eo||"info"}:null}))}propertyFocus(ue){this.update(eo=>({...eo,propertyFocus:ue}))}showBuilderSidePanel(){this.update(ue=>({...ue,builderSidePanel:!0}))}hideBuilderSidePanel(){this.update(ue=>({...ue,builderSidePanel:!1}))}setPreviousTopNavPath(ue,eo){this.update(no=>({...no,previousTopNavPath:{...no.previousTopNavPath||{},[ue]:eo}}))}selectResource(ue){var eo;(eo=this.websocket)==null||eo.emit(BuilderSocketEvent.SelectResource,{resourceId:ue})}registerTourNode(ue,eo){this.update(no=>({...no,tourNodes:{...no.tourNodes,[ue]:eo}}))}destroyTourNode(ue){var no;const eo=get_store_value(this.store);if((no=eo.tourNodes)!=null&&no[ue]){const ro={...eo.tourNodes};delete ro[ue],this.update(oo=>({...oo,tourNodes:ro}))}}startBuilderOnboarding(){this.update(ue=>({...ue,onboarding:!0,tourKey:TOUR_KEYS.TOUR_BUILDER_ONBOARDING}))}endBuilderOnboarding(){this.update(ue=>({...ue,onboarding:!1}))}setTour(ue){this.update(eo=>({...eo,tourStepKey:null,tourNodes:null,tourKey:ue||null}))}}const builderStore=new BuilderStore,INITIAL_HOVER_STATE={componentId:null};class HoverStore extends BudiStore{constructor(){super({...INITIAL_HOVER_STATE}),this.hover=this.hover.bind(this)}hover(ue,eo=!0){clearTimeout(this.hoverTimeout),ue?this.processHover(ue,eo):this.hoverTimeout=setTimeout(()=>{this.processHover(ue,eo)},10)}processHover(ue,eo){ue!==get_store_value(this.store).componentId&&(this.update(no=>(no.componentId=ue,no)),eo&&previewStore.sendEvent("hover-component",ue))}}const hoverStore=new HoverStore,INITIAL_PREVIEW_STATE={previewDevice:"desktop",previewEventHandler:null,showPreview:!1,selectedComponentContext:null};class PreviewStore extends BudiStore{constructor(){super(INITIAL_PREVIEW_STATE),this.setDevice=this.setDevice.bind(this),this.sendEvent=this.sendEvent.bind(this),this.registerEventHandler=this.registerEventHandler.bind(this),this.startDrag=this.startDrag.bind(this),this.stopDrag=this.stopDrag.bind(this),this.showPreview=this.showPreview.bind(this),this.setSelectedComponentContext=this.setSelectedComponentContext.bind(this),this.requestComponentContext=this.requestComponentContext.bind(this)}setDevice(ue){this.update(eo=>({...eo,previewDevice:ue}))}sendEvent(ue,eo){const{previewEventHandler:no}=get_store_value(this.store);no==null||no(ue,eo)}registerEventHandler(ue){this.update(eo=>({...eo,previewEventHandler:ue}))}startDrag(ue){this.sendEvent("dragging-new-component",{dragging:!0,component:ue})}stopDrag(){this.sendEvent("dragging-new-component",{dragging:!1})}showPreview(ue){this.update(eo=>({...eo,showPreview:ue}))}setSelectedComponentContext(ue){this.update(eo=>({...eo,selectedComponentContext:ue}))}requestComponentContext(){this.sendEvent("request-context")}}const previewStore=new PreviewStore,TriggerStepID={ROW_SAVED:"ROW_SAVED",ROW_UPDATED:"ROW_UPDATED",ROW_DELETED:"ROW_DELETED",ROW_ACTION:"ROW_ACTION",WEBHOOK:"WEBHOOK",APP:"APP",CRON:"CRON"},ActionStepID={SEND_EMAIL_SMTP:"SEND_EMAIL_SMTP",CREATE_ROW:"CREATE_ROW",UPDATE_ROW:"UPDATE_ROW",DELETE_ROW:"DELETE_ROW",OUTGOING_WEBHOOK:"OUTGOING_WEBHOOK",EXECUTE_SCRIPT:"EXECUTE_SCRIPT",EXECUTE_QUERY:"EXECUTE_QUERY",SERVER_LOG:"SERVER_LOG",DELAY:"DELAY",FILTER:"FILTER",QUERY_ROWS:"QUERY_ROWS",LOOP:"LOOP",COLLECT:"COLLECT",TRIGGER_AUTOMATION_RUN:"TRIGGER_AUTOMATION_RUN",discord:"discord",slack:"slack",zapier:"zapier",integromat:"integromat",n8n:"n8n"},Features={LOOPING:"LOOPING"};class TableStore extends DerivedBudiStore{constructor(){const ue=eo=>derived(eo,no=>{var ro;return{...no,selected:(ro=no.list)==null?void 0:ro.find(oo=>oo._id===no.selectedTableId)}});super({list:[],selectedTableId:void 0},ue),this.select=this.select.bind(this)}async init(){return this.fetch()}async fetch(){const ue=await API.getTables();this.store.update(eo=>({...eo,list:ue}))}async singleFetch(ue){const eo=await API.getTable(ue);this.store.update(no=>{const ro=[];for(let oo of no.list)eo._id===oo._id?ro.push(eo):ro.push(oo);return no.list=ro,no})}select(ue){this.store.update(eo=>({...eo,selectedTableId:ue}))}async save(ue){var lo;const eo=fp$1.cloneDeep(ue),no=get_store_value(this.store).list.filter(co=>co._id===ue._id)[0],ro=[];for(let co of Object.keys(eo.schema)){if(ro.indexOf(co.toLowerCase())!==-1){delete eo.schema[co];continue}const uo=eo.schema[co],fo=no==null?void 0:no.schema[co];fo!=null&&(fo==null?void 0:fo.type)!==uo.type&&!((lo=SWITCHABLE_TYPES[fo==null?void 0:fo.type])!=null&&lo.includes(uo.type))&&(eo.schema[co]=fo),uo.name&&uo.name!==co&&(eo.schema[uo.name]=uo,eo._rename={old:co,updated:uo.name},delete eo.schema[co]),ro.push(co.toLowerCase())}const oo=await API.saveTable(eo);this.replaceTable(oo._id,oo),this.select(oo._id);let io=[];for(let co of Object.values((eo==null?void 0:eo.schema)||{}))co.type===FieldType.LINK&&io.push(co.tableId);let ao=[];for(let co of Object.values((no==null?void 0:no.schema)||{}))co.type===FieldType.LINK&&ao.push(co.tableId);const so=[...new Set([...io,...ao])];return so.length>3?await this.fetch():await Promise.all(so.map(co=>this.singleFetch(co))),oo}async delete(ue){await API.deleteTable(ue._id,ue._rev),this.replaceTable(ue._id,null)}async saveField({originalName:ue,field:eo,primaryDisplay:no=!1,indexes:ro}){const oo=fp$1.cloneDeep(get_store_value(this.derivedStore).selected);if(ue!=null&&ue!==eo.name&&(delete oo.schema[ue],oo._rename={old:ue,updated:eo.name}),no)oo.primaryDisplay=eo.name;else if(oo.primaryDisplay===ue){const io=Object.keys(oo.schema);oo.primaryDisplay=io.filter(ao=>ao!==ue||ao!==eo.name)[0]}ro&&(oo.indexes=ro),oo.schema={...oo.schema,[eo.name]:fp$1.cloneDeep(eo)},await this.save(oo)}async deleteField(ue){let eo=fp$1.cloneDeep(get_store_value(this.derivedStore).selected);delete eo.schema[ue.name],await this.save(eo)}replaceTable(ue,eo){if(!ue)return;if(!eo){this.store.update(ro=>({...ro,list:ro.list.filter(oo=>oo._id!==ue)}));return}const no=get_store_value(this.store).list.findIndex(ro=>ro._id===eo._id);no===-1?this.store.update(ro=>({...ro,list:[...ro.list,eo]})):eo&&this.store.update(ro=>(ro.list[no]={...eo,type:ro.list[no].type},ro))}removeDatasourceTables(ue){this.store.update(eo=>({...eo,list:eo.list.filter(no=>no.sourceId!==ue)}))}}const tables=new TableStore;class ViewV2Store extends DerivedBudiStore{constructor(){const ue=eo=>derived([eo,tables],([no,ro])=>{var io;let oo=[];return(io=ro.list)==null||io.forEach(ao=>{const so=Object.values((ao==null?void 0:ao.views)||{}).filter(isV2);oo=oo.concat(so)}),{...no,list:oo,selected:oo.find(ao=>ao.id===no.selectedViewId)}});super({selectedViewId:null},ue),this.select=this.select.bind(this)}select(ue){this.store.update(eo=>({...eo,selectedViewId:ue}))}async delete(ue){await API.viewV2.delete(ue.id),this.replaceView(ue.id,null)}async create(ue){const no=(await API.viewV2.create(ue)).data;return this.replaceView(no.id,no),no}async save(ue){const eo=await API.viewV2.update(ue),no=eo==null?void 0:eo.data;this.replaceView(ue.id,no)}replaceView(ue,eo){const no=get_store_value(this.derivedStore).list.find(oo=>oo.id===ue),ro=get_store_value(tables).list.findIndex(oo=>oo._id===(eo==null?void 0:eo.tableId)||oo._id===(no==null?void 0:no.tableId));if(ro!==-1)if(!eo&&no){tables.update(oo=>(delete oo.list[ro].views[no.name],oo));return}else!no&&eo?tables.update(oo=>{var io;return(io=oo.list[ro]).views??(io.views={}),oo.list[ro].views[eo.name]=eo,oo}):no&&eo&&tables.update(oo=>{var io;return(io=oo.list[ro]).views??(io.views={}),delete oo.list[ro].views[no.name],oo.list[ro].views[eo.name]=eo,oo})}}const viewsV2=new ViewV2Store,duplicateName=(to,ue)=>{const eo=new RegExp("\\s(\\d+)$"),no=to.split(eo)[0],ro=new RegExp(`${no}\\s(\\d+)$`),oo=[];ue.filter(ao=>{if(ao===no)return!0;const so=ao.match(ro);return so?(oo.push(parseInt(so[1])),!0):!1}),oo.sort((ao,so)=>ao-so);let io;if(oo.length===0)io=1;else{for(let ao=0;ao<oo.length;ao++)if(oo[ao]!==ao+1){io=ao+1;break}io||(io=oo.length+1)}return`${no} ${io}`},getSequentialName=(to,ue,{getName:eo,numberFirstItem:no}={})=>{if(!(ue!=null&&ue.length))return null;const ro=ue.trim(),oo=no?`${ue}1`:ro;if(!(to!=null&&to.length))return oo;let io=0;return to.forEach(ao=>{const so=(eo==null?void 0:eo(ao))??ao;if(typeof so!="string"||!so.startsWith(ro))return;const lo=so.split(ro);if(lo.length!==2)return;lo[1].trim()===""&&(lo[1]="1");const co=parseInt(lo[1]);co>io&&(io=co)}),io===0?oo:`${ue}${io+1}`},initialState$1={};class RowActionStore extends BudiStore{constructor(){super(initialState$1),this.reset=()=>{this.set(initialState$1)},this.refreshRowActions=async ue=>{var oo;if(!ue)return;let eo=(oo=get_store_value(tables).list.find(io=>io._id===ue))==null?void 0:oo._id;if(!eo){const io=get_store_value(viewsV2).list.find(ao=>ao.id===ue);eo=io==null?void 0:io.tableId}if(!eo)return;const no=await API.rowActions.fetch(eo),ro=Object.values(no||{});this.update(io=>({...io,[eo]:ro}))},this.createRowAction=async(ue,eo,no)=>{if(!ue)return;if(!no){const oo=get_store_value(this)[ue]||[];no=getSequentialName(oo,"New row action ",{getName:io=>io.name})}if(!no)throw new Error("Failed to generate a unique name for the row action");const ro=await API.rowActions.create(ue,no);return eo?await Promise.all([this.enableView(ue,ro.id,eo),automationStore.actions.fetch()]):await Promise.all([this.refreshRowActions(ue),automationStore.actions.fetch()]),ro},this.enableView=async(ue,eo,no)=>{await API.rowActions.enableView(ue,eo,no),await this.refreshRowActions(ue)},this.disableView=async(ue,eo,no)=>{await API.rowActions.disableView(ue,eo,no),await this.refreshRowActions(ue)},this.delete=async(ue,eo)=>{await API.rowActions.delete(ue,eo),await this.refreshRowActions(ue)},this.trigger=async(ue,eo,no)=>{await API.rowActions.trigger(ue,eo,no)}}}const store=new RowActionStore,derivedStore=derived(store,to=>{const ue={};return Object.keys(to||{}).forEach(eo=>{ue[eo]=to[eo];for(let no of to[eo]){const ro=(no.allowedSources||[]).filter(oo=>oo!==eo);for(let oo of ro)ue[oo]??(ue[oo]=[]),ue[oo].push(no)}}),ue}),rowActions={...store,subscribe:derivedStore.subscribe},getNewStepName=(to,ue)=>{const eo=ue.name,no=oo=>oo.reduce((io,ao)=>(ao.name&&ao.name.startsWith(eo)&&io++,ao.stepId===AutomationActionStepId.BRANCH&&ao.inputs&&ao.inputs.children&&Object.values(ao.inputs.children).forEach(so=>{io+=no(so)}),io),0);let ro=0;return to!=null&&to.definition&&(ro=no(to.definition.steps)),ro===0?eo:`${eo} ${ro+1}`},initialAutomationState={automations:[],testResults:null,showTestPanel:!1,blockDefinitions:{TRIGGER:{},CREATABLE_TRIGGER:{},ACTION:{}},selectedAutomationId:null},getFinalDefinitions=(to,ue)=>{const eo={};return Object.entries(to).forEach(no=>{no[0]!==AutomationTriggerStepId.ROW_ACTION&&(eo[no[0]]=no[1])}),{TRIGGER:to,CREATABLE_TRIGGER:eo,ACTION:ue}},automationActions=to=>({moveBlock:async(ue,eo,no)=>{const ro=ue.at(-1),oo=eo.at(-1),io=(ro==null?void 0:ro.id)===(oo==null?void 0:oo.id),ao=(oo==null?void 0:oo.branchStepId)&&oo.branchIdx===(ro==null?void 0:ro.branchIdx)&&(ro==null?void 0:ro.stepIdx)===0;if(io||ao)return;const{deleted:so,newAutomation:lo}=to.actions.deleteBlock(ue,no),co={};to.actions.traverse(co,lo);let uo;oo!=null&&oo.branchStepId?(uo=co[oo.branchStepId].pathTo,uo.push(oo)):(oo!=null&&oo.id&&(uo=co[oo.id].pathTo),uo.at(-1).stepIdx+=1);const fo=to.actions.updateStep(uo,lo,so,!0);try{await to.actions.save(fo)}catch(po){notifications.error("Error moving automation block"),console.error("Error moving automation block ",po)}},deleteBlock:(ue,eo)=>{let no=fp$1.cloneDeep(eo);const ro=[no.definition.trigger,...no.definition.steps];let oo;return ue.forEach((io,ao,so)=>{const lo=ao===so.length-1,{stepIdx:co,branchIdx:uo}=io,fo=(po,ho)=>{const _o=po[ho],go=[_o.id],bo=[],vo={};po.forEach(wo=>{const{blockToLoop:ko,id:So}=wo;ko&&(vo[ko]=So)});const yo=vo[_o.id];yo&&go.push(yo);for(let wo=po.length-1;wo>=0;wo--)if(go.includes(po[wo].id)){const[ko]=po.splice(wo,1);bo.unshift(ko)}return{deleted:bo,newAutomation:no}};if(!oo){lo?oo=fo(no.definition.steps,co>0?co-1:0):oo=ro[co];return}if(Number.isInteger(uo)){const po=oo.inputs.branches[uo].id,ho=oo.inputs.children[po],_o=ho[co];lo?oo=fo(ho,co):oo=_o}}),oo},registerBlock:(ue,eo,no,ro)=>{ue[eo.id]={...ue[eo.id]||{},pathTo:no,terminating:ro||!1,...eo.blockToLoop?{blockToLoop:eo.blockToLoop}:{}},eo.blockToLoop&&(ue[eo.blockToLoop]={...ue[eo.blockToLoop]||{},looped:eo.id})},getPathSteps:(ue,eo)=>{const no=[eo.definition.trigger,...eo.definition.steps];let ro=[];return ue.forEach(oo=>{const{stepIdx:io,branchIdx:ao}=oo;let so=ro.length?ro[ro.length-1]:[];if(!ro.length){ro=no.slice(0,io+1);return}if(so&&"inputs"in so&&Number.isInteger(ao)){const lo=so.inputs.branches[ao].id,uo=so.inputs.children[lo].slice(0,io+1);ro=ro.concat(uo)}}),ro},updateStep:(ue,eo,no,ro=!1)=>{let oo=fp$1.cloneDeep(eo);const io=(so,lo,co)=>{so.splice(lo,ro?0:Array.isArray(co)?co.length:1,...Array.isArray(co)?co:[co])};let ao=null;return ue.forEach((so,lo,co)=>{const{stepIdx:uo,branchIdx:fo}=so;let po=lo===co.length-1;if(!ao){let ho=Math.max(uo-1,0);if(po){io(oo.definition.steps,ho,no);return}ao=oo.definition.steps[ho]}if(Number.isInteger(fo)){const ho=ao.inputs.branches[fo].id,_o=ao.inputs.children[ho];po?io(_o,uo,no):ao=_o[uo]}}),oo},buildEnvironmentBindings:()=>get_store_value(licensing).environmentVariablesEnabled?getEnvironmentBindings().map(ue=>({...ue,display:{...ue.display,rank:98}})):[],buildUserBindings:()=>getUserBindings().map(ue=>({...ue,category:"User",display:{...ue.display,rank:98}})),buildSettingBindings:()=>getSettingBindings().map(ue=>({...ue,display:{...ue.display,rank:98}})),getPathBindings:ue=>{var no,ro;const eo=(no=get_store_value(selectedAutomation))==null?void 0:no.blockRefs[ue];return to.actions.getAvailableBindings(eo,(ro=get_store_value(selectedAutomation))==null?void 0:ro.data)},traverse:(ue,eo)=>{var oo;let no=[];if(!eo||!ue)return;(oo=eo.definition)!=null&&oo.trigger&&no.push(eo.definition.trigger),no=no.concat(eo.definition.steps||[]);const ro=(io,ao,so,lo,co)=>{var po;const uo=[...ao||[],{...Number.isInteger(lo)?{branchIdx:lo}:{},stepIdx:so,id:io.id}],fo=((po=io.inputs)==null?void 0:po.branches)||[];fo.forEach((ho,_o)=>{var go;(go=io.inputs)==null||go.children[ho.id].forEach((bo,vo,yo)=>{var ko,So;const wo=yo.length-1===vo&&!((So=(ko=bo.inputs)==null?void 0:ko.branches)!=null&&So.length);ro(bo,uo,vo,_o,wo)})}),to.actions.registerBlock(ue,io,uo,co&&!fo.length)};return no.forEach((io,ao,so)=>{ro(io,null,ao,null,so.length-1===ao)}),ue},getAvailableBindings:(ue,eo)=>{var lo,co,uo,fo,po,ho,_o;if(!ue||!(eo!=null&&eo.definition))return[];const no=(lo=get_store_value(selectedAutomation))==null?void 0:lo.blockRefs,ro=to.actions.getPathSteps(ue.pathTo,eo).slice(0,-1),oo=to.actions.getPathSteps(ue.pathTo,eo).at(-1);let io=[];const ao=(go,bo,vo,yo,wo,ko)=>{if(!go)return;const So=to.actions.determineRuntimeBinding(go,yo,wo,ko,eo,oo,ro),Ao=to.actions.determineCategoryName(yo,wo,ko,so);io.push(to.actions.createBindingObject(go,bo,vo,yo,so,wo,So,Ao,ko))};let so=0;for(let go=0;go<ro.length;go++){const bo=ro[go],vo=((co=eo.definition.stepNames)==null?void 0:co[bo.id])||bo.name;let yo=fp$1.cloneDeep((fo=(uo=bo==null?void 0:bo.schema)==null?void 0:uo.outputs)==null?void 0:fo.properties)??{},wo=!1;bo.blockToLoop&&(wo=bo.stepId===ActionStepID.LOOP&&bo.blockToLoop in no);const ko=bo.type===AutomationStepType.TRIGGER;wo&&so==0&&(yo={currentItem:{type:AutomationIOType.STRING,description:"the item currently being executed"}});const So=ko?bo.icon:wo?"Reuse":bo.icon;if(go===0&&ko)if(bo.event===AutomationEventType.ROW_UPDATE||bo.event===AutomationEventType.ROW_SAVE){let Ao=get_store_value(tables).list.find(Io=>Io._id===bo.inputs.tableId);for(const Io in Ao==null?void 0:Ao.schema)yo[Io]={type:Ao.schema[Io].type,subtype:Ao.schema[Io].subtype};delete yo.row}else bo.event===AutomationEventType.APP_TRIGGER&&(yo=Object.fromEntries(Object.keys(bo.inputs.fields||[]).map(Ao=>[Ao,{type:bo.inputs.fields[Ao]}])));if((po=no[bo.id])!=null&&po.looped){so++;const Ao=no[bo.id].looped,Io=ro.find(Eo=>Eo.id===Ao);Io?yo=fp$1.cloneDeep((_o=(ho=Io.schema)==null?void 0:ho.outputs)==null?void 0:_o.properties):console.error("Loop block missing.")}Object.entries(yo).forEach(([Ao,Io])=>{ao(Ao,Io,So,go,wo,vo)})}return ue.looped||(io=io.filter(go=>!go.readableBinding.includes("loop"))),io},determineRuntimeBinding:(ue,eo,no,ro,oo,io,ao)=>{var lo,co,uo;let so;if(eo===0&&((lo=oo.definition.trigger)==null?void 0:lo.event)===AutomationEventType.APP_TRIGGER)return`trigger.fields.${ue}`;if(eo===0&&(((co=oo.definition.trigger)==null?void 0:co.event)===AutomationEventType.ROW_UPDATE||((uo=oo.definition.trigger)==null?void 0:uo.event)===AutomationEventType.ROW_SAVE)&&!["id","revision","oldRow"].includes(ue))return`trigger.row.${ue}`;if(no)so=`loop.${ue}`;else if(eo===0)so=`trigger.${ue}`;else if((io==null?void 0:io.stepId)===AutomationActionStepId.EXECUTE_SCRIPT){const fo=ao[eo].id;if(!fo)return notifications.error("Error generating binding: Step ID not found."),null;so=`steps["${fo}"].${ue}`}else{const fo=ao[eo].id;if(!fo)return notifications.error("Error generating binding: Step ID not found."),null;so=`steps.${fo}.${ue}`}return so},determineCategoryName:(ue,eo,no,ro)=>ue===0?"Trigger outputs":eo?"Loop Outputs":no?`${no} outputs`:`Step ${ue-ro} outputs`,createBindingObject:(ue,eo,no,ro,oo,io,ao,so,lo)=>{const co=Object.values(FIELDS).find(uo=>uo.type===eo.type&&("subtype"in uo?uo.subtype===eo.subtype:!0));return{readableBinding:lo&&!io&&ro!==0?`steps.${lo}.${ue}`:ao,runtimeBinding:ao,type:eo.type,description:eo.description,icon:no,category:so,display:{type:(co==null?void 0:co.name)||eo.type,name:ue,rank:io?ro+1:ro-oo}}},processBlockInputs:async(ue,eo)=>{var io;let no={...ue,inputs:{...ue.inputs,...eo}};Object.keys(no.inputs).forEach(ao=>{const so=no.inputs[ao];(so==null||so==="")&&delete no.inputs[ao]});const ro=(io=get_store_value(selectedAutomation))==null?void 0:io.data;if(!ro)return!1;const oo=to.actions.getUpdatedDefinition(ro,no);return JSON.stringify(oo)===JSON.stringify(ro)?!1:oo},updateBlockInputs:async(ue,eo)=>{const no=await to.actions.processBlockInputs(ue,eo);no!==!1&&await to.actions.save(no)},test:async(ue,eo)=>{var ro,oo;let no;try{no=await API.testAutomation(ue._id,eo)}catch(io){throw`Automation test failed - ${io.message||io.status||JSON.stringify(io)}`}if(!(no!=null&&no.trigger)&&!((ro=no==null?void 0:no.steps)!=null&&ro.length)&&!(no!=null&&no.message))throw((oo=no==null?void 0:no.err)==null?void 0:oo.code)==="usage_limit_exceeded"?"You have exceeded your automation quota":"Something went wrong testing your automation";to.update(io=>(io.testResults=no,io))},getUpdatedDefinition:(ue,eo)=>{var ro;let no;if(((ro=ue.definition.trigger)==null?void 0:ro.id)===eo.id)no=fp$1.cloneDeep(ue),no.definition.trigger=eo;else{const oo=get_store_value(selectedAutomation).blockRefs[eo.id].pathTo;no=to.actions.updateStep(oo,ue,eo)}return no},getLogs:async({automationId:ue,startDate:eo,status:no,page:ro}={})=>await API.getAutomationLogs({automationId:ue,startDate:eo,status:no,page:ro}),clearLogErrors:async({automationId:ue,appId:eo})=>{if(!ue||!eo)throw new Error("automationId and appId are required");return await API.clearAutomationLogErrors(ue,eo)},addTestDataToAutomation:ue=>{var no;let eo=fp$1.cloneDeep((no=get_store_value(selectedAutomation))==null?void 0:no.data);return eo&&(eo.testData={...eo.testData,...ue},eo)},constructBlock:(ue,eo,no)=>{var io;const ro={...no,inputs:no.inputs||{},stepId:eo,type:ue,id:shortid.generate()},oo=getNewStepName((io=get_store_value(selectedAutomation))==null?void 0:io.data,ro);return ro.name=oo,ro},generateBranchBlock:()=>{const ue=get_store_value(to).blockDefinitions.ACTION.BRANCH;return to.actions.constructBlock("ACTION","BRANCH",ue)},addBlockToAutomation:async(ue,eo)=>{var ao;const no=(ao=get_store_value(selectedAutomation))==null?void 0:ao.data;if(!no)return;let ro=fp$1.cloneDeep(no);const oo=[ro.definition.trigger,...ro.definition.steps];let io;eo.forEach((so,lo,co)=>{const{stepIdx:uo,branchIdx:fo}=so,po=lo===co.length-1,ho=(_o,go)=>{const bo=!Number.isInteger(go),vo=ue.blockToLoop||bo?go:go+1;_o.splice(vo,0,ue)};if(!io){po?(ho(ro.definition.steps,uo-1),io=ue):io=oo[uo];return}if(Number.isInteger(fo)){const _o=io.inputs.branches[fo].id,go=io.inputs.children[_o];po?(ho(go,uo),io=go):io=go[uo]}});try{await to.actions.save(ro)}catch(so){notifications.error("Error adding automation block"),console.error("Automation adding block ",so)}},generateDefaultConditions:()=>{const ue={logicalOperator:UILogicalOperator.ALL,onEmptyFilter:EmptyFilterOption.RETURN_NONE,groups:[]};return{condition:buildQuery$1(ue),conditionUI:ue}},branchAutomation:async(ue,eo)=>{var uo;const no=ue.at(-1);let ro=fp$1.cloneDeep(eo),oo,io=!1;const ao=fo=>({name:fo,...to.actions.generateDefaultConditions(),id:shortid.generate()});ue.forEach((fo,po,ho)=>{const{stepIdx:_o,branchIdx:go}=fo,bo=po===ho.length-1;if(oo||(bo?(oo=ro.definition.steps,io=!0):oo=ro.definition.steps[_o-1]),Number.isInteger(go)){const vo=oo.inputs.branches[go].id,yo=oo.inputs.children[vo];oo=bo?yo:yo[_o]}});const so=Math.max(no.stepIdx-1,0),lo=io?so:no.stepIdx;if(((uo=oo[lo])==null?void 0:uo.stepId)=="BRANCH"){let fo=oo[lo].inputs.branches;const po=ao(`Branch ${fo.length+1}`);fo.splice(fo.length,0,po),oo[lo].inputs.children[po.id]=[];try{await to.actions.save(ro)}catch(ho){notifications.error("Error adding branch to automation"),console.error("Error adding automation branch",ho)}return}const co=to.actions.generateBranchBlock();co.inputs.branches=Array.from({length:2}).map((fo,po)=>ao(`Branch ${po+1}`)),co.inputs.children=co.inputs.branches.reduce((fo,po,ho)=>(fo[po.id]=ho==0?oo.slice(lo+1):[],fo),{}),oo.splice(lo+1),oo.push(co);try{await to.actions.save(ro)}catch(fo){notifications.error("Error adding branch to automation"),console.error("Error adding automation branch",fo)}},branchLeft:async(ue,eo,no)=>{const ro=to.actions.shiftBranch(ue,no);if(ro){const oo=to.actions.updateStep(ue.slice(0,-1),eo,ro);await to.actions.save(oo)}},branchRight:async(ue,eo,no)=>{const ro=to.actions.shiftBranch(ue,no,1);if(ro){const oo=to.actions.updateStep(ue.slice(0,-1),eo,ro);await to.actions.save(oo)}},shiftBranch:(ue,eo,no=-1)=>{let ro=fp$1.cloneDeep(eo);const io=ue.at(-1).branchIdx;if(!ro.inputs.branches[io+no]){console.error("Invalid index");return}let[ao]=ro.inputs.branches.splice(io+no,1);return ro.inputs.branches.splice(io,0,ao),ro},deleteBranch:async(ue,eo)=>{let no=fp$1.cloneDeep(eo),ro=[];ue.forEach((oo,io,ao)=>{const{stepIdx:so,branchIdx:lo}=oo,co=io===ao.length-1;if(!ro.length){if(co){ro=no.definition.steps;return}ro=[{node:no.definition.steps[so-1],context:no.definition.steps}]}const uo=ro.at(-1);if(Number.isInteger(lo)){const fo=uo.node.inputs.branches[lo].id,po=uo.node.inputs.children[fo];if(co){const ho=uo.node.inputs.branches.length==2;if(uo.node.inputs.branches.splice(lo,1),delete uo.node.inputs.children[fo],ho){const _o=uo.node.inputs.branches[0].id,go=uo.node.inputs.children[_o],bo=ro.at(-1).context;bo.pop(),bo.splice(bo.length,0,...go)}return}ro.push({node:po[so],context:po})}});try{await to.actions.save(no)}catch(oo){notifications.error("Error deleting automation branch"),console.error("Error deleting automation branch",oo)}},saveAutomationName:async(ue,eo)=>{var io;const no=(io=get_store_value(selectedAutomation))==null?void 0:io.data;let ro=fp$1.cloneDeep(no);if(!ro)return;const oo=eo.trim();ro.definition.stepNames={...ro.definition.stepNames,[ue]:oo},await to.actions.save(ro)},deleteAutomationName:async ue=>{var ro;const eo=(ro=get_store_value(selectedAutomation))==null?void 0:ro.data;let no=fp$1.cloneDeep(eo);!eo||!no||(no!=null&&no.definition.stepNames&&delete no.definition.stepNames[ue],await to.actions.save(no))},deleteAutomationBlock:async ue=>{var ro;const eo=(ro=get_store_value(selectedAutomation))==null?void 0:ro.data;if(!eo)return;const{newAutomation:no}=to.actions.deleteBlock(ue,eo);try{await to.actions.save(no)}catch(oo){notifications.error("Error deleting automation block"),console.error("Automation deleting block ",oo)}},replace:(ue,eo)=>{if(!eo)to.store.update(no=>{var ro;return no.automations=no.automations.filter(oo=>oo._id!==ue),ue===no.selectedAutomationId&&to.actions.select(((ro=no.automations[0])==null?void 0:ro._id)||null),no});else{const no=get_store_value(to.store).automations.findIndex(ro=>ro._id===eo._id);no===-1?to.store.update(ro=>({...ro,automations:[...ro.automations,eo]})):to.store.update(ro=>(ro.automations[no]=eo,ro))}},create:async(ue,eo)=>{const no={name:ue,type:"automation",appId:get_store_value(appStore).appId,definition:{steps:[],trigger:eo},disabled:!1};return await to.actions.save(no)},duplicate:async ue=>await to.actions.save({...ue,name:`${ue.name} - copy`,_id:void 0,_rev:void 0}),toggleDisabled:async ue=>{let eo;try{if(eo=to.actions.getDefinition(ue),!eo)return;eo.disabled=!eo.disabled,await to.actions.save(eo),notifications.success(`Automation ${eo.disabled?"disabled":"enabled"} successfully`)}catch{notifications.error(`Error ${eo!=null&&eo.disabled?"disabling":"enabling"} automation`)}},definitions:async()=>{const ue=await API.getAutomationDefinitions();return to.update(eo=>(eo.blockDefinitions=getFinalDefinitions(ue.trigger,ue.action),eo)),ue},fetch:async()=>{const[ue,eo]=await Promise.all([API.getAutomations(),API.getAutomationDefinitions()]);to.update(no=>(no.automations=ue.automations,no.automations.sort((ro,oo)=>ro.name<oo.name?-1:1),no.blockDefinitions=getFinalDefinitions(eo.trigger,eo.action),no))},select:ue=>{!ue||ue===get_store_value(to).selectedAutomationId||to.update(eo=>(eo.selectedAutomationId=ue,eo.testResults=null,eo.showTestPanel=!1,eo))},getDefinition:ue=>{var eo;return(eo=get_store_value(to.store).automations)==null?void 0:eo.find(no=>no._id===ue)},save:async ue=>{const eo=await API.updateAutomation(ue);return await to.actions.fetch(),to.actions.select(eo.automation._id),eo.automation},delete:async ue=>{isRowAction(ue)?await rowActions.delete(ue.definition.trigger.inputs.tableId,ue.definition.trigger.inputs.rowActionId):await API.deleteAutomation(ue._id,ue._rev),to.update(no=>{var ro;return no.automations=no.automations.filter(oo=>oo._id!==ue._id),ue._id===no.selectedAutomationId&&(no.selectedAutomationId=((ro=no.automations[0])==null?void 0:ro._id)||null),no})}});class AutomationStore extends BudiStore{constructor(){super(initialAutomationState),this.actions=automationActions(this),this.history=createHistoryStore({getDoc:this.actions.getDefinition.bind(this),selectDoc:this.actions.select.bind(this)});const ue=this.actions.save.bind(this.actions),eo=this.actions.delete.bind(this.actions);this.actions.save=this.history.wrapSaveDoc(ue),this.actions.delete=this.history.wrapDeleteDoc(eo)}}const automationStore=new AutomationStore,automationHistoryStore=automationStore.history;class SelectedAutomationStore extends DerivedBudiStore{constructor(ue){const eo=()=>derived(ue,no=>{var ao;if(!no.selectedAutomationId)return{data:null,blockRefs:{},...no};const ro=(ao=no.automations)==null?void 0:ao.find(so=>so._id===no.selectedAutomationId);if(!ro)return{data:null,blockRefs:{},...no};const oo={},io=fp$1.cloneDeep(ro);return io&&(ue.actions.traverse(oo,io),Object.values(oo).filter(so=>so.terminating).forEach(so=>{ue.actions.getPathSteps(so.pathTo,io).forEach((lo,co,uo)=>{migrateReferencesInObject({obj:lo,originalIndex:co,steps:uo})})})),{data:io,blockRefs:oo,...no}});super(initialAutomationState,eo)}}const selectedAutomation=new SelectedAutomationStore(automationStore);class UserStore extends BudiStore{constructor(){super([])}init(ue){this.set(ue)}updateUser(ue){const eo=get_store_value(this);eo.some(no=>no.sessionId===ue.sessionId)?this.update(no=>{const ro=no.findIndex(oo=>oo.sessionId===ue.sessionId);return no[ro]=ue,no.slice()}):this.set([...eo,ue])}removeUser(ue){this.update(eo=>eo.filter(no=>no.sessionId!==ue))}reset(){this.set([])}}const userStore=new UserStore,userSelectedResourceMap=derived(userStore,to=>{let ue={};return to.forEach(eo=>{var ro;const no=(ro=eo.builderMetadata)==null?void 0:ro.selectedResourceId;no&&(ue[no]||(ue[no]=[]),ue[no].push(eo))}),ue}),isOnlyUser=derived(userStore,to=>to.length<2),createDeploymentStore=()=>{let to=writable([]);const ue=async()=>{try{to.set(await API.getAppDeployments())}catch{notifications.error("Error fetching deployments")}};return{subscribe:to.subscribe,load:ue}},deploymentStore=createDeploymentStore(),INITIAL_CONTEXT_MENU_STATE={id:null,items:[],position:{x:0,y:0},visible:!1};function createViewsStore(){const to=writable({...INITIAL_CONTEXT_MENU_STATE}),ue=(no,ro,oo)=>{to.set({id:no,items:ro,position:oo,visible:!0})},eo=()=>{to.set({...INITIAL_CONTEXT_MENU_STATE})};return{subscribe:to.subscribe,open:ue,close:eo}}const contextMenuStore=createViewsStore();class SnippetStore extends BudiStore{constructor(){super([]),this.syncMetadata=ue=>{this.set((ue==null?void 0:ue.snippets)||[])},this.saveSnippet=async ue=>{const eo=[...get_store_value(this).filter(ro=>ro.name!==ue.name),ue],no=await API.saveAppMetadata(get_store_value(appStore).appId,{snippets:eo});this.syncMetadata(no)},this.deleteSnippet=async ue=>{const eo=get_store_value(this).filter(ro=>ro.name!==ue),no=await API.saveAppMetadata(get_store_value(appStore).appId,{snippets:eo});this.syncMetadata(no)}}}const snippets$1=new SnippetStore,features={spectrumThemes:!0,unifiedTheme:!0,intelligentLoading:!0,deviceAwareness:!0,state:!0,customThemes:!0,devicePreview:!0,messagePassing:!0,rowSelection:!0,continueIfAction:!0,showNotificationAction:!0,sidePanel:!0,modal:!0,skeletonLoader:!0},typeSupportPresets={numberLike:{supported:["number","boolean"],partialSupport:[{type:"longform",message:"stringAsNumber"},{type:"string",message:"stringAsNumber"},{type:"bigint",message:"stringAsNumber"},{type:"options",message:"stringAsNumber"},{type:"formula",message:"stringAsNumber"},{type:"datetime",message:"dateAsNumber"}],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]},stringLike:{supported:["string","number","bigint","options","longform","boolean","datetime"],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]},datetimeLike:{supported:["datetime"],partialSupport:[{type:"longform",message:"stringAsDate"},{type:"string",message:"stringAsDate"},{type:"options",message:"stringAsDate"},{type:"formula",message:"stringAsDate"},{type:"bigint",message:"stringAsDate"},{type:"number",message:"numberAsDate"}],unsupported:[{type:"json",message:"jsonPrimitivesOnly"}]}},layout$1={name:"Layout",description:"This component is specific only to layouts",icon:"Sandbox",hasChildren:!0,styles:["padding","background"],settings:[{type:"text",label:"Logo URL",key:"logoUrl"},{type:"text",label:"Title",key:"title"},{type:"select",label:"Navigation",key:"navigation",options:["Top","Left","None"],defaultValue:"Top"},{type:"select",label:"Width",key:"width",options:["Small","Medium","Large","Max"],defaultValue:"Large"},{type:"navigation",label:"Links",key:"links"},{type:"boolean",label:"Hide title",key:"hideTitle",defaultValue:!1},{type:"boolean",label:"Hide logo",key:"hideLogo",defaultValue:!1},{type:"boolean",label:"Sticky header",key:"sticky",defaultValue:!1}]},container$1={name:"Container",description:"This component contains things within itself",icon:"Selection",hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},styles:["padding","size","background","border","shadow"],settings:[{type:"select",label:"Layout",key:"layout",showInBar:!0,barStyle:"buttons",options:[{label:"Flex",value:"flex",barIcon:"ModernGridView",barTitle:"Flex layout"},{label:"Grid",value:"grid",barIcon:"ViewGrid",barTitle:"Grid layout"}],defaultValue:"grid"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Size",key:"size",showInBar:!0,barStyle:"buttons",options:[{label:"Shrink",value:"shrink",barIcon:"Minimize",barTitle:"Shrink container"},{label:"Grow",value:"grow",barIcon:"Maximize",barTitle:"Grow container"}],defaultValue:"shrink",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"boolean",label:"Wrap",key:"wrap",showInBar:!0,barIcon:"ModernGridView",barTitle:"Wrap",dependsOn:{setting:"layout",value:"grid",invert:!0}},{type:"event",label:"On click",key:"onClick"}]},section={name:"Section",description:"Add a section to your application",icon:"ColumnTwoB",hasChildren:!0,illegalChildren:["section"],showEmptyState:!1,size:{width:600,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"section",label:"Type",key:"type",defaultValue:"mainSidebar"}]},screenslot={name:"Screenslot",icon:"WebPage",description:"Contains your app screens",static:!0},buttongroup={name:"Button group",icon:"Button",hasChildren:!1,size:{width:200,height:60},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,defaultValue:[{type:"cta",text:"Button 1"},{type:"primary",text:"Button 2"}]}]},{section:!0,name:"Layout",settings:[{type:"boolean",label:"Collapse",key:"collapsed"},{type:"text",label:"Collapsed text",key:"collapsedText",dependsOn:"collapsed",placeholder:"Action"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"row",dependsOn:{setting:"collapsed",invert:!0}},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"left"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Size",key:"size",showInBar:!0,barStyle:"buttons",options:[{label:"Shrink",value:"shrink",barIcon:"Minimize",barTitle:"Shrink container"},{label:"Grow",value:"grow",barIcon:"Maximize",barTitle:"Grow container"}],defaultValue:"shrink",dependsOn:{setting:"collapsed",invert:!0}},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M",dependsOn:{setting:"collapsed",invert:!0}},{type:"boolean",label:"Wrap",key:"wrap",showInBar:!0,barIcon:"ModernGridView",barTitle:"Wrap",dependsOn:{setting:"collapsed",invert:!0}}]}]},button={name:"Button",description:"A basic html button that is ready for styling",icon:"Button",editable:!0,size:{width:120,height:32},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Text",key:"text",defaultValue:"New Button"},{type:"select",showInBar:!0,label:"Variant",key:"type",options:[{label:"Action",value:"cta"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Warning",value:"warning"},{label:"Over background",value:"overBackground"}],defaultValue:"cta"},{type:"select",label:"Size",showInBar:!0,key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"},{type:"boolean",label:"Quiet",key:"quiet",showInBar:!0,barIcon:"VisibilityOff",barTitle:"Quiet variant",barSeparator:!1},{type:"boolean",label:"Disabled",showInBar:!0,barIcon:"NoEdit",barTitle:"Disable button",key:"disabled"},{type:"icon",label:"Icon",key:"icon"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",dependsOn:"icon",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"},{type:"event",label:"On click",key:"onClick"}]},divider={name:"Divider",description:"A basic divider",icon:"Separator",illegalChildren:["section"],size:{width:400,height:10},settings:[{type:"select",label:"Size",key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"},{type:"boolean",label:"Vertical",key:"vertical"}]},repeater={name:"Repeater",description:"A configurable data list that attaches to your backend tables.",icon:"JourneyData",illegalChildren:["section"],hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column"},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"}],context:[{type:"schema",scope:"local"},{type:"static",scope:"local",values:[{label:"Row index",key:"index",type:"number"}]}]},stackedlist={deprecated:!0,name:"Stacked List",icon:"TaskList",description:"A basic card component that can contain content and actions.",illegalChildren:["section"],settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Subheading",key:"subheading"},{type:"text",label:"Link URL",key:"destinationUrl",placeholder:"/screen"}]},card={deprecated:!0,name:"Vertical Card",description:"A basic card component that can contain content and actions.",icon:"ViewColumn",illegalChildren:["section"],settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Description",key:"description"},{type:"text",label:"Link text",key:"linkText"},{type:"text",label:"Link URL",key:"linkUrl",placeholder:"/screen"},{type:"color",label:"Link color",key:"linkColor",defaultValue:"#000"},{type:"color",label:"Hover color",key:"linkHoverColor",defaultValue:"#222"},{type:"select",label:"Image height",key:"imageHeight",options:["auto","12rem","16rem","20rem","24rem"],defaultValue:"auto"},{type:"select",label:"Card width",key:"cardWidth",options:["16rem","20rem","24rem"],defaultValue:"20rem"}]},text={name:"Paragraph",description:"A component for displaying paragraph text.",icon:"TextParagraph",illegalChildren:["section"],editable:!0,size:{width:400,height:24},settings:[{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Extra small",value:"XS"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"},{label:"2XL",value:"XXL"},{label:"3XL",value:"XXXL"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},heading$1={name:"Headline",icon:"TextBold",description:"A component for displaying heading text",illegalChildren:["section"],editable:!0,size:{width:400,height:32},settings:[{type:"text",key:"text",label:"Text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Extra small",value:"XS"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"},{label:"2XL",value:"XXL"},{label:"3XL",value:"XXXL"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},tag={name:"Tag",icon:"Label",size:{width:100,height:25},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}]},{type:"color",label:"Color",key:"color",showInBar:!0},{type:"color",label:"Text Color",key:"textColor",showInBar:!0},{type:"boolean",label:"Allow delete",key:"closable"},{type:"event",label:"On click delete",key:"onClick",dependsOn:"closable"}]},image={name:"Image",description:"A basic component for displaying images",icon:"Image",styles:["size"],size:{width:400,height:300},settings:[{type:"text",label:"URL",key:"url",required:!0}]},backgroundimage={name:"Background Image",description:"A background image",icon:"Images",hasChildren:!0,styles:["size"],showEmptyState:!1,size:{width:400,height:300},settings:[{type:"text",label:"URL",key:"url",required:!0},{type:"select",label:"Position",key:"position",defaultValue:"center center",options:[{label:"Center top",value:"center top"},{label:"Center",value:"center center"},{label:"Center bottom",value:"center bottom"},{label:"Left top",value:"left top"},{label:"Left center",value:"left center"},{label:"Left bottom",value:"left bottom"},{label:"Right top",value:"right top"},{label:"Right center",value:"right center"},{label:"Right bottom",value:"right bottom"}]}]},icon={name:"Icon",description:"A basic component for displaying icons",icon:"Shapes",size:{width:25,height:25},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"icon",label:"Icon",key:"icon",required:!0},{type:"select",label:"Size",key:"size",defaultValue:"ri-1x",options:[{value:"ri-xxs",label:"XXS"},{value:"ri-xs",label:"XS"},{value:"ri-sm",label:"Small"},{value:"ri-1x",label:"Medium"},{value:"ri-lg",label:"Large"},{value:"ri-xl",label:"XL"},{value:"ri-2x",label:"2XL"},{value:"ri-3x",label:"3XL"},{value:"ri-4x",label:"4XL"},{value:"ri-5x",label:"5XL"},{value:"ri-6x",label:"6XL"},{value:"ri-7x",label:"7XL"},{value:"ri-8x",label:"8XL"},{value:"ri-9x",label:"9XL"},{value:"ri-10x",label:"10XL"}]},{type:"color",label:"Color",key:"color"},{type:"event",label:"On click",key:"onClick"}]},navigation={deprecated:!0,name:"Nav Bar",description:"A component for handling the navigation within your app.",icon:"BreadcrumbNavigation",illegalChildren:["section"],hasChildren:!0,settings:[{type:"text",label:"Logo URL",key:"logoUrl"},{type:"boolean",label:"Hide logo",key:"hideLogo",defaultValue:!1}]},link={name:"Link",description:"A basic link component for internal and external links",icon:"Link",editable:!0,size:{width:200,height:30},settings:[{type:"text",label:"Text",key:"text"},{type:"url",label:"URL",key:"url",placeholder:"/screen"},{type:"boolean",label:"New tab",key:"openInNewTab"},{type:"select",label:"Size",key:"size",defaultValue:"M",showInBar:!0,barStyle:"picker",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}]},{type:"color",label:"Color",key:"color",showInBar:!0,barSeparator:!1},{type:"boolean",label:"Bold",key:"bold",showInBar:!0,barIcon:"TagBold",barTitle:"Bold text",barSeparator:!1},{type:"boolean",label:"Italic",key:"italic",showInBar:!0,barIcon:"TagItalic",barTitle:"Italic text",barSeparator:!1},{type:"boolean",label:"Underline",key:"underline",showInBar:!0,barIcon:"TagUnderline",barTitle:"Underline text"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]}]},cardhorizontal={deprecated:!0,name:"Horizontal Card",description:"A basic card component that can contain content and actions.",icon:"ViewRow",settings:[{type:"text",label:"Image",key:"imageUrl"},{type:"text",label:"Heading",key:"heading"},{type:"text",label:"Description",key:"description"},{type:"text",label:"Subtext",key:"subtext"},{type:"text",label:"Link text",key:"linkText"},{type:"text",label:"Link URL",key:"linkUrl",placeholder:"/screen"},{type:"color",label:"Link color",key:"linkColor",defaultValue:"#000"},{type:"color",label:"Hover color",key:"linkHoverColor",defaultValue:"#222"},{type:"select",label:"Card width",key:"cardWidth",options:["24rem","28rem","32rem","40rem","48rem","60rem","100%"],defaultValue:"32rem"},{type:"select",label:"Image width",key:"imageWidth",options:["auto","8rem","12rem","16rem"],defaultValue:"8rem"},{type:"select",label:"Image height",key:"imageHeight",options:["auto","8rem","12rem","16rem","auto"],defaultValue:"auto"}]},cardstat={name:"Stat Card",description:"A card component for displaying numbers.",icon:"Card",size:{width:260,height:143},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title",placeholder:"Total Revenue",defaultValue:"Title"},{type:"text",label:"Value",key:"value",placeholder:"$1,981,983",defaultValue:"Value"},{type:"text",label:"Label",key:"label",placeholder:"Stripe",defaultValue:"Label"}]},embed={name:"Embed",icon:"Code",description:"Embed content from 3rd party sources",styles:["size"],size:{width:400,height:100},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"text",label:"Embed",key:"embed",required:!0}]},bar={documentationLink:"https://docs.budibase.com/docs/bar-chart",name:"Bar Chart",description:"Bar chart",icon:"GraphBarVertical",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!1},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},line={documentationLink:"https://docs.budibase.com/docs/line-chart",name:"Line Chart",description:"Line chart",icon:"GraphTrend",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},area={documentationLink:"https://docs.budibase.com/docs/area-chart",name:"Area Chart",description:"Line chart",icon:"GraphAreaStacked",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!0},{type:"boolean",label:"Gradient",key:"gradient",defaultValue:!1}]},pie={documentationLink:"https://docs.budibase.com/docs/pie-donut-chart",name:"Pie Chart",description:"Pie chart",icon:"GraphPie",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},donut={documentationLink:"https://docs.budibase.com/docs/pie-donut-chart",name:"Donut Chart",description:"Donut chart",icon:"GraphDonut",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data columns",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Legend",key:"legend",defaultValue:!1}]},candlestick={documentationLink:"https://docs.budibase.com/docs/candlestick-chart",name:"Candlestick Chart",description:"Candlestick chart",icon:"GraphBarVerticalStacked",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Date column",key:"dateColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"datetimeLike"}},required:!0},{type:"field",label:"Open column",key:"openColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Close column",key:"closeColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"High column",key:"highColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Low column",key:"lowColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0}]},histogram={documentationLink:"https://docs.budibase.com/docs/histogram-chart",name:"Histogram Chart",description:"Histogram chart",icon:"Histogram",size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataProvider",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Y axis label",key:"yAxisLabel",defaultValue:"Frequency"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"number",label:"Bucket count",key:"bucketCount",defaultValue:10,min:2},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Animate",key:"animate",defaultValue:!0},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1}]},form$2={name:"Form",icon:"Form",hasChildren:!0,illegalChildren:["section","form","formblock"],actions:["ValidateForm","ClearForm","ChangeFormStep","UpdateFieldValue","ScrollTo"],styles:["padding","size","background","border","shadow"],size:{width:400,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"select",label:"Type",key:"actionType",options:["Create","Update"],defaultValue:"Create"},{type:"schema",label:"Schema",key:"dataSource",defaultValue:{name:"Custom",label:"Custom"}},{type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"text",label:"Initial form step",key:"initialFormStep",defaultValue:1}],context:[{type:"static",values:[{label:"Value",key:"__value",type:"object"},{label:"Valid",key:"__valid",type:"boolean"},{label:"Current Step",key:"__currentStep",type:"number"},{label:"Current Step Valid",key:"__currentStepValid",type:"boolean"}]},{type:"form"}]},formstep={name:"Form Step",icon:"AssetsAdded",hasChildren:!0,requiredAncestors:["form"],illegalChildren:["section","form","formstep","formblock"],styles:["size"],size:{width:400,height:400},settings:[{type:"number",label:"Step",key:"step",defaultValue:1,min:1}]},fieldgroup={name:"Field Group",icon:"Group",requiredAncestors:["form"],illegalChildren:["section"],styles:["size"],hasChildren:!0,size:{width:400,height:400},settings:[{type:"select",label:"Labels",key:"labelPosition",defaultValue:"above",options:[{label:"Left",value:"left"},{label:"Above",value:"above"}]},{type:"section",label:"Type",key:"type",defaultValue:"oneColumn",dependsOn:{setting:"labelPosition",value:"above"}}]},labelfield={name:"Text Field",icon:"Text",editable:!0,size:{width:400,height:60},settings:[{type:"plainText",label:"Label",key:"label"},{type:"number",label:"Initial width",key:"width",placeholder:"Auto",min:80,max:9999},{type:"tableConditions",label:"Conditions",key:"conditions"}]},stringfield={name:"Text Field",icon:"Text",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/string",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Alignment",key:"align",defaultValue:"left",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"TextAlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"TextAlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"TextAlignRight",barTitle:"Align right"},{label:"Justify",value:"justify",barIcon:"TextAlignJustify",barTitle:"Justify text"}]},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},numberfield={name:"Number Field",icon:"123",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/number",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/number",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"number"}]}},bigintfield={name:"BigInt Field",icon:"TagBold",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/bigint",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"number"}]}},passwordfield={name:"Password Field",icon:"LockClosed",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/string",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},optionsfield={name:"Options Picker",icon:"Menu",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/options",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Choose an option"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"select",label:"Type",key:"optionsType",defaultValue:"select",placeholder:"Pick an options type",options:[{label:"Select",value:"select"},{label:"Radio buttons",value:"radio"}]},{type:"select",label:"Direction",key:"direction",defaultValue:"vertical",options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],dependsOn:{setting:"optionsType",value:"radio"}},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Autocomplete",key:"autocomplete",defaultValue:!1,dependsOn:{setting:"optionsType",value:"select"}},{type:"boolean",label:"Alphabetical",key:"sort",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Options source",key:"optionsSource",defaultValue:"schema",placeholder:"Pick an options source",options:[{label:"Schema",value:"schema"},{label:"Data provider",value:"provider"},{label:"Custom",value:"custom"}]},{type:"dataProvider",label:"Options provider",key:"dataProvider",required:!0,dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Label column",key:"labelColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Value column",key:"valueColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"options",label:"Custom options",key:"customOptions",dependsOn:{setting:"optionsSource",value:"custom"}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},multifieldselect={name:"Multi-select Picker",icon:"ViewList",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/array",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Choose an option"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Autocomplete",key:"autocomplete",defaultValue:!1,dependsOn:{setting:"optionsType",value:"select"}},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Type",key:"optionsType",defaultValue:"select",placeholder:"Pick an options type",options:[{label:"Select",value:"select"},{label:"Checkboxes",value:"checkbox"}]},{type:"select",label:"Direction",key:"direction",defaultValue:"vertical",options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],dependsOn:{setting:"optionsType",value:"checkbox"}},{type:"select",label:"Options source",key:"optionsSource",defaultValue:"schema",placeholder:"Pick an options source",options:[{label:"Schema",value:"schema"},{label:"Data provider",value:"provider"},{label:"Custom",value:"custom"}]},{type:"dataProvider",label:"Options provider",key:"dataProvider",required:!0,dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Label column",key:"labelColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"field",label:"Value column",key:"valueColumn",dependsOn:{setting:"optionsSource",value:"provider"}},{type:"options",label:"Custom options",key:"customOptions",dependsOn:{setting:"optionsSource",value:"custom"}},{type:"validation/array",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},booleanfield={name:"Checkbox",icon:"SelectBox",editable:!0,size:{width:400,height:60},settings:[{type:"field/boolean",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Text",key:"text"},{type:"select",label:"Size",key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/boolean",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"boolean"}]}},longformfield={name:"Long Form Field",icon:"TextAlignLeft",styles:["size"],editable:!0,size:{width:400,height:100},settings:[{type:"field/longform",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder",placeholder:"Type something..."},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"select",label:"Formatting",key:"format",placeholder:null,options:[{label:"Auto",value:"auto"},{label:"Plain text",value:"plain"},{label:"Rich text (markdown)",value:"rich"}],defaultValue:"auto"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},datetimefield={name:"Date Picker",icon:"Date",styles:["size"],editable:!0,size:{width:400,height:60},settings:[{type:"field/datetime",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"boolean",label:"Show time",key:"enableTime",defaultValue:!0},{type:"boolean",label:"Time only",key:"timeOnly",defaultValue:!1},{type:"boolean",label:"Ignore time zones",key:"ignoreTimezones",defaultValue:!1},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"validation/datetime",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"datetime"}]}},codescanner={name:"Barcode/QR Scanner",icon:"Camera",styles:["size"],size:{width:400,height:60},settings:[{type:"field/barcodeqr",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Button text",key:"scanButtonText"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Manual entry",key:"allowManualEntry",defaultValue:!1},{type:"boolean",label:"Auto confirm",key:"autoConfirm",defaultValue:!1},{type:"boolean",label:"Play sound on scan",key:"beepOnScan",defaultValue:!1},{type:"select",label:"Sound pitch",key:"beepFrequency",dependsOn:"beepOnScan",defaultValue:2637,options:[{label:"Low",value:2096},{label:"Regular",value:2637},{label:"High",value:3136},{label:"Custom",value:"custom"}]},{type:"number",label:"Sound frequency (Hz)",key:"customFrequency",defaultValue:1046,min:20,max:8e3,dependsOn:{setting:"beepFrequency",value:"custom"}},{type:"select",label:"Preferred camera",key:"preferredCamera",defaultValue:"environment",options:[{label:"Front",value:"user"},{label:"Back",value:"environment"}]},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/string",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},signaturesinglefield={name:"Signature",icon:"AnnotatePen",styles:["size"],size:{width:400,height:60},settings:[{type:"field/signature_single",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/signature_single",label:"Validation",key:"validation"}]},embeddedmap={name:"Embedded Map",icon:"Location",styles:["size"],draggable:!1,size:{width:400,height:320},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider"},{type:"field",label:"Latitude key",key:"latitudeKey",dependsOn:"dataProvider"},{type:"field",label:"Longitude key",key:"longitudeKey",dependsOn:"dataProvider"},{type:"field",label:"Title key",key:"titleKey",dependsOn:"dataProvider"},{type:"event",label:"On click marker",key:"onClickMarker",context:[{label:"Clicked marker",key:"marker"}]},{type:"boolean",label:"Enable adding",key:"creationEnabled",defaultValue:!1},{type:"event",label:"On create marker",key:"onCreateMarker",dependsOn:"creationEnabled",context:[{label:"New marker latitude",key:"lat"},{label:"New marker longitude",key:"lng"}]},{type:"boolean",label:"Enable fullscreen",key:"fullScreenEnabled",defaultValue:!0},{type:"boolean",label:"Enable location",key:"locationEnabled",defaultValue:!0},{type:"boolean",label:"Enable zoom",key:"zoomEnabled",defaultValue:!0},{type:"text",label:"Tile URL",key:"tileURL",defaultValue:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"},{type:"text",label:"Default location",key:"defaultLocation",placeholder:"51.5072,-0.1276"},{type:"number",label:"Default zoom (0-100)",key:"zoomLevel",placeholder:50,max:100,min:0},{type:"text",label:"Map attribution",key:"mapAttribution",defaultValue:"OpenStreetMap contributors"}]},attachmentfield={name:"Attachment List",icon:"DocumentFragmentGroup",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:200},settings:[{type:"field/attachment",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"text",label:"Extensions",key:"extensions"},{type:"number",label:"Max attachments",key:"maximum",min:1},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Compact",key:"compact",defaultValue:!1},{type:"boolean",label:"Read only",key:"disabled",defaultValue:!1},{type:"validation/attachment",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},attachmentsinglefield={name:"Single Attachment",icon:"DocumentFragment",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:200},settings:[{type:"field/attachment_single",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Help text",key:"helpText"},{type:"text",label:"Extensions",key:"extensions"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Compact",key:"compact",defaultValue:!1},{type:"boolean",label:"Read only",key:"disabled",defaultValue:!1},{type:"validation/attachment_single",label:"Validation",key:"validation"},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},relationshipfield={name:"Relationship Picker",icon:"TaskList",styles:["size"],requiredAncestors:["form"],editable:!0,size:{width:400,height:60},settings:[{type:"field/link",label:"Field",key:"field",required:!0},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"filter/relationship",label:"Filtering",key:"filter"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}]},jsonfield={name:"JSON Field",icon:"Brackets",styles:["size"],editable:!0,size:{width:400,height:100},settings:[{type:"field/json",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue",supportsConditions:!1},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},s3upload={name:"S3 File Upload",icon:"UploadToCloud",styles:["size"],editable:!0,size:{width:400,height:200},settings:[{type:"field/s3",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"dataSource/s3",label:"S3 datasource",key:"datasourceId",info:"This component can't be used with S3 datasources that use custom endpoints"},{type:"text",label:"Bucket",key:"bucket"},{type:"text",label:"File name",key:"key",nested:!0},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"validation/attachment",label:"Validation",key:"validation"}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},dataprovider={name:"Data Provider",icon:"Data",illegalChildren:["section"],hasChildren:!0,actions:["RefreshDatasource"],size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"filter",label:"Filtering",key:"filter",resetOn:"dataSource"},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending"},{type:"number",label:"Limit",key:"limit",defaultValue:50},{type:"boolean",label:"Paginate",key:"paginate",defaultValue:!0,info:"Pagination is only available for data stored in tables"}],context:{type:"static",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]}},table$1={deprecated:!0,name:"Table",icon:"Table",illegalChildren:["section"],hasChildren:!0,showEmptyState:!1,actions:["ClearRowSelection"],size:{width:600,height:400},settings:[{type:"dataProvider",label:"Data provider",key:"dataProvider",required:!0},{type:"columns",label:"Columns",key:"columns",dependsOn:"dataProvider",nested:!0},{type:"select",label:"Size",key:"size",defaultValue:"spectrum--medium",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}]},{type:"number",label:"Row count",key:"rowCount",defaultValue:8},{type:"boolean",label:"Quiet",key:"quiet"},{type:"boolean",label:"Compact",key:"compact"},{type:"boolean",label:"Row selection",key:"allowSelectRows",defaultValue:!1,info:"Row selection is only compatible with internal or SQL tables"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{section:!0,name:"On Row Click",settings:[{type:"event",key:"onClick",context:[{label:"Clicked row",key:"row"}]}]}],context:[{type:"schema",scope:"local"},{type:"static",values:[{label:"Selected Rows",key:"selectedRows",type:"array"}]}]},daterangepicker={name:"Date Range",icon:"Calendar",styles:["size"],hasChildren:!1,size:{width:200,height:50},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0,info:"Your data provider will be automatically filtered to the given date range."},{type:"field",label:"Date field",key:"field",required:!0},{type:"select",label:"Default range",key:"defaultValue",options:["Last 1 day","Last 7 days","Last 30 days","Last 3 months","Last 6 months","Last 1 year"],defaultValue:"Last 30 days"}]},spectrumcard={name:"Card",icon:"PersonalizationField",styles:["size"],size:{width:300,height:120},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"text",key:"title",label:"Title",defaultValue:"Title"},{type:"text",key:"subtitle",label:"Subtitle",defaultValue:"Subtitle"},{type:"text",key:"description",label:"Description",defaultValue:"Description"},{type:"text",key:"imageURL",label:"Image URL"},{type:"url",key:"linkURL",label:"Link URL"},{type:"boolean",key:"linkPeek",label:"Open in modal"},{type:"boolean",key:"horizontal",label:"Horizontal"},{type:"boolean",label:"Show button",key:"showButton"},{type:"text",key:"buttonText",label:"Button text",dependsOn:"showButton"},{type:"event",label:"Click action",key:"buttonOnClick"}]},dynamicfilter={name:"Dynamic Filter",icon:"Filter",size:{width:100,height:35},grid:{hAlign:"center",vAlign:"center"},settings:[{type:"dataProvider",label:"Provider",key:"dataProvider",required:!0},{type:"columns/basic",label:"Allowed filter columns",key:"allowedFields",dependsOn:"dataProvider"},{type:"select",label:"Button size",showInBar:!0,key:"size",options:[{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"},{label:"Extra large",value:"XL"}],defaultValue:"M"}]},chartblock={documentationLink:"https://docs.budibase.com/docs/chart",block:!0,name:"Chart Block",icon:"GraphPie",hasChildren:!1,size:{width:600,height:420},grid:{hAlign:"stretch",vAlign:"center"},settings:[{type:"select",label:"Chart type",key:"chartType",required:!0,options:[{label:"Pie",value:"pie"},{label:"Bar",value:"bar"},{label:"Histogram",value:"histogram"},{label:"Line",value:"line"},{label:"Donut",value:"donut"},{label:"Candlestick",value:"candlestick"},{label:"Area",value:"area"}]},{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"text",label:"Title",key:"chartTitle"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field",label:"Sort column",key:"sortColumn"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending"},{type:"number",label:"Limit",key:"limit",defaultValue:50},{type:"text",label:"Width",key:"width"},{type:"text",label:"Height",key:"height",defaultValue:"400"},{type:"select",label:"Colors",key:"palette",defaultValue:"Palette 1",options:["Custom","Palette 1","Palette 2","Palette 3","Palette 4","Palette 5","Palette 6","Palette 7","Palette 8","Palette 9","Palette 10"]},{type:"color",label:"C1",key:"c1",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C2",key:"c2",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C3",key:"c3",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C4",key:"c4",dependsOn:{setting:"palette",value:"Custom"}},{type:"color",label:"C5",key:"c5",dependsOn:{setting:"palette",value:"Custom"}},{type:"boolean",label:"Data labels",key:"dataLabels",defaultValue:!1},{type:"boolean",label:"Legend",key:"legend",defaultValue:!0},{type:"boolean",label:"Animate",key:"animate",defaultValue:!1},{section:!0,name:"Pie Chart",icon:"GraphPie",dependsOn:{setting:"chartType",value:"pie"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0}]},{section:!0,name:"Donut Chart",icon:"GraphDonut",dependsOn:{setting:"chartType",value:"donut"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"field",label:"Data column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0}]},{section:!0,name:"Bar Chart",icon:"GraphBarVertical",dependsOn:{setting:"chartType",value:"bar"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!1},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1}]},{section:!0,name:"Histogram Chart",icon:"Histogram",dependsOn:{setting:"chartType",value:"histogram"},settings:[{type:"field",label:"Value column",key:"valueColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"boolean",label:"Horizontal",key:"horizontal",defaultValue:!1},{type:"number",label:"Bucket count",key:"bucketCount",defaultValue:10,min:2}]},{section:!0,name:"Line Chart",icon:"GraphTrend",dependsOn:{setting:"chartType",value:"line"},settings:[{type:"field",label:"Label column",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"}]},{section:!0,name:"Area Chart",icon:"GraphAreaStacked",dependsOn:{setting:"chartType",value:"area"},settings:[{type:"field",label:"Label columns",key:"labelColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"stringLike"}},required:!0},{type:"multifield",label:"Data columns",key:"valueColumns",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"},{type:"select",label:"Curve",key:"curve",options:["Smooth","Straight","Stepline"],defaultValue:"Smooth"},{type:"boolean",label:"Stacked",key:"stacked",defaultValue:!0},{type:"boolean",label:"Gradient",key:"gradient",defaultValue:!1}]},{section:!0,name:"Candlestick Chart",icon:"GraphBarVerticalStacked",dependsOn:{setting:"chartType",value:"candlestick"},settings:[{type:"field",label:"Date column",key:"dateColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"datetimeLike"}},required:!0},{type:"field",label:"Open column",key:"openColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Close column",key:"closeColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"High column",key:"highColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"field",label:"Low column",key:"lowColumn",dependsOn:"dataSource",explanation:{typeSupport:{preset:"numberLike"}},required:!0},{type:"select",label:"Format",key:"yAxisUnits",options:["Default","Thousands","Millions"],defaultValue:"Default"},{type:"text",label:"Y axis label",key:"yAxisLabel"},{type:"text",label:"X axis label",key:"xAxisLabel"}]}]},tableblock={deprecated:!0,block:!0,name:"Table Block",icon:"Table",styles:["size"],size:{width:600,height:400},settings:[{type:"text",label:"Title",key:"title"},{section:!0,name:"Table",settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"columns",label:"Columns",key:"tableColumns",dependsOn:"dataSource",placeholder:"All columns",nested:!0},{type:"field/sortable",label:"Sort by",key:"sortColumn",placeholder:"Default"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Ascending",dependsOn:"sortColumn"},{type:"select",label:"Size",key:"size",defaultValue:"spectrum--medium",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}]},{type:"number",label:"Scroll limit",key:"rowCount",defaultValue:8},{type:"boolean",label:"Paginate",key:"paginate",defaultValue:!0},{type:"boolean",label:"Quiet",key:"quiet"},{type:"boolean",label:"Compact",key:"compact"},{type:"boolean",label:"Row selection",key:"allowSelectRows",info:"Row selection is only compatible with internal or SQL tables"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"searchfield",label:"Search fields",key:"searchColumns",placeholder:"Choose search fields",info:"Only the first 5 fields will be used"}]},{section:!0,name:"On row click",settings:[{label:"Behaviour",labelHidden:!0,type:"radio",key:"clickBehaviour",sendEvents:!0,defaultValue:"actions",info:"Details side panel is only compatible with internal or SQL tables",options:[{label:"Run actions",value:"actions"},{label:"Show details side panel",value:"details"}]},{label:"Actions",labelHidden:!0,type:"event",key:"onClick",nested:!0,dependsOn:{setting:"clickBehaviour",value:"actions"},context:[{label:"Clicked row",key:"row"}]},{label:"",type:"fieldConfiguration",key:"sidePanelFields",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"},resetOn:"dataSource"},{label:"Save button",type:"text",key:"sidePanelSaveLabel",defaultValue:"Save",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"}},{label:"Delete button",type:"text",key:"sidePanelDeleteLabel",defaultValue:"Delete",nested:!0,dependsOn:{setting:"clickBehaviour",value:"details"}},{type:"boolean",label:"Hide notifications",key:"notificationOverride",defaultValue:!1,dependsOn:{setting:"clickBehaviour",value:"details"}}]},{section:!0,name:"Button",settings:[{type:"boolean",key:"showTitleButton",label:"Show button",defaultValue:!1},{type:"text",key:"titleButtonText",label:"Text",defaultValue:"Create row",dependsOn:"showTitleButton"},{type:"radio",key:"titleButtonClickBehaviour",label:"Behaviour",dependsOn:"showTitleButton",defaultValue:"actions",info:"New row side panel is only compatible with internal or SQL tables",options:[{label:"Run actions",value:"actions"},{label:"Show new row side panel",value:"new"}]},{type:"event",label:"On click",key:"onClickTitleButton",nested:!0,dependsOn:{setting:"titleButtonClickBehaviour",value:"actions"}}]}],context:[{type:"static",suffix:"provider",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]},{type:"static",suffix:"table",values:[{label:"Selected Rows",key:"selectedRows",type:"array"}]}]},cardsblock={block:!0,name:"Cards Block",icon:"PersonalizationField",styles:["size"],size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"text",label:"Title",key:"title"},{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"searchfield",label:"Search columns",key:"searchColumns",placeholder:"Choose search columns",info:"Max 5 columns will be used"},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Descending"},{type:"number",label:"Limit",key:"limit",defaultValue:8},{type:"boolean",label:"Paginate",key:"paginate"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{section:!0,name:"Cards",settings:[{type:"text",key:"cardTitle",label:"Title",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardSubtitle",label:"Subtitle",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardDescription",label:"Description",nested:!0,resetOn:"dataSource"},{type:"text",key:"cardImageURL",label:"Image URL",nested:!0,resetOn:"dataSource"},{type:"boolean",key:"linkCardTitle",label:"Link card title"},{type:"boolean",key:"cardPeek",label:"Open in modal"},{type:"url",label:"Link screen",key:"cardURL",nested:!0},{type:"boolean",key:"cardHorizontal",label:"Horizontal"},{type:"boolean",label:"Add button",key:"showCardButton"},{type:"text",key:"cardButtonText",label:"Button text",nested:!0,dependsOn:"showCardButton"},{type:"event",label:"Click action",key:"cardButtonOnClick",nested:!0}]},{section:!0,name:"Title button",settings:[{type:"boolean",key:"showTitleButton",label:"Show button"},{type:"boolean",label:"Open in modal",key:"titleButtonPeek"},{type:"text",key:"titleButtonText",label:"Button text"},{type:"url",label:"Button link",key:"titleButtonURL"}]},{section:!0,name:"Advanced",settings:[{type:"field",label:"ID column",key:"linkColumn",placeholder:"Default"}]}],context:{type:"schema",suffix:"repeater",scope:"local"}},repeaterblock={block:!0,name:"Repeater Block",icon:"ViewList",illegalChildren:["section","rowexplorer"],hasChildren:!0,size:{width:500,height:200},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"filter",label:"Filtering",key:"filter",nested:!0},{type:"field/sortable",label:"Sort column",key:"sortColumn",placeholder:"None"},{type:"select",label:"Sort order",key:"sortOrder",options:["Ascending","Descending"],defaultValue:"Descending"},{type:"number",label:"Limit",key:"limit",defaultValue:10},{type:"boolean",label:"Paginate",key:"paginate"},{section:!0,name:"Layout settings",settings:[{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No rows found"},{type:"select",label:"Direction",key:"direction",showInBar:!0,barStyle:"buttons",options:[{label:"Column",value:"column",barIcon:"TableSelectColumn",barTitle:"Column layout"},{label:"Row",value:"row",barIcon:"TableSelectRow",barTitle:"Row layout"}],defaultValue:"column"},{type:"select",label:"Horiz. align",key:"hAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Left",value:"left",barIcon:"AlignLeft",barTitle:"Align left"},{label:"Center",value:"center",barIcon:"AlignCenter",barTitle:"Align center"},{label:"Right",value:"right",barIcon:"AlignRight",barTitle:"Align right"},{label:"Stretch",value:"stretch",barIcon:"MoveLeftRight",barTitle:"Align stretched horizontally"}],defaultValue:"stretch"},{type:"select",label:"Vert. align",key:"vAlign",showInBar:!0,barStyle:"buttons",options:[{label:"Top",value:"top",barIcon:"AlignTop",barTitle:"Align top"},{label:"Middle",value:"middle",barIcon:"AlignMiddle",barTitle:"Align middle"},{label:"Bottom",value:"bottom",barIcon:"AlignBottom",barTitle:"Align bottom"},{label:"Stretch",value:"stretch",barIcon:"MoveUpDown",barTitle:"Align stretched vertically"}],defaultValue:"top"},{type:"select",label:"Gap",key:"gap",showInBar:!0,barStyle:"picker",options:[{label:"None",value:"N"},{label:"Small",value:"S"},{label:"Medium",value:"M"},{label:"Large",value:"L"}],defaultValue:"M"}]}],context:[{type:"static",suffix:"provider",values:[{label:"Rows",key:"rows",type:"array"},{label:"Extra Info",key:"info",type:"string"},{label:"Rows Length",key:"rowsLength",type:"number"},{label:"Schema",key:"schema",type:"object"},{label:"Page Number",key:"pageNumber",type:"number"}]},{type:"static",suffix:"repeater",values:[{label:"Row Index",key:"index",type:"number"}]},{type:"schema",suffix:"repeater",scope:"local"}]},markdownviewer={name:"Markdown Viewer",icon:"Preview",styles:["size"],size:{width:400,height:100},grid:{hAlign:"stretch",vAlign:"start"},settings:[{type:"text",label:"Markdown",key:"value",required:!0}]},multistepformblock={name:"Multi-step Form Block",icon:"AssetsAdded",block:!0,hasChildren:!1,ejectable:!1,size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"start"},styles:["padding","size","background","border","shadow"],settings:[{type:"table",label:"Data",key:"dataSource"},{type:"radio",label:"Type",key:"actionType",options:["Create","Update","View"],defaultValue:"Create"},{section:!0,dependsOn:{setting:"actionType",value:"Create",invert:!0},name:"Row ID",info:"<a href='https://docs.budibase.com/docs/form-block' target='_blank'>How to pass a row ID using bindings</a>",settings:[{type:"text",label:"Row ID",key:"rowId",nested:!0},{type:"text",label:"No rows found",key:"noRowsMessage",defaultValue:"We couldn't find a row to display",nested:!0}]},{section:!0,name:"Details",settings:[{type:"stepConfiguration",key:"steps",nested:!0,labelHidden:!0,resetOn:["dataSource","actionType"],defaultValue:[{}]}]},{tag:"style",type:"select",label:"Button position",key:"buttonPosition",options:[{label:"Bottom",value:"bottom"},{label:"Top",value:"top"}],defaultValue:"bottom"},{tag:"style",type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"}],actions:[{type:"ValidateForm",suffix:"form"},{type:"ClearForm",suffix:"form"},{type:"UpdateFieldValue",suffix:"form"},{type:"ScrollTo",suffix:"form"},{type:"ChangeFormStep",suffix:"form"},{type:"RefreshDatasource",suffix:"provider"}],context:[{type:"form",suffix:"form"},{type:"schema",suffix:"repeater"},{type:"static",suffix:"form",values:[{label:"Value",key:"__value",type:"object"},{label:"Valid",key:"__valid",type:"boolean"},{label:"Current Step",key:"__currentStep",type:"number"},{label:"Current Step Valid",key:"__currentStepValid",type:"boolean"}]}]},multistepformblockstep={name:"Multi-step Form Block Step",settings:[{type:"formStepControls",label:"Steps",key:"steps"},{type:"text",label:"Title",key:"title",nested:!0},{type:"text",label:"Description",key:"desc",nested:!0},{type:"fieldConfiguration",key:"fields",nested:!0},{type:"buttonConfiguration",label:"Buttons",key:"buttons",wide:!0,nested:!0},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]},formblock={name:"Form Block",icon:"Form",styles:["padding","size","background","border","shadow"],block:!0,info:"Form blocks are only compatible with internal or SQL tables",size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"start"},settings:[{type:"table",label:"Data",key:"dataSource"},{type:"radio",label:"Type",key:"actionType",options:["Create","Update","View"],defaultValue:"Create"},{section:!0,dependsOn:{setting:"actionType",value:"Create",invert:!0},name:"Row ID",info:"<a href='https://docs.budibase.com/docs/form-block' target='_blank'>How to pass a row ID using bindings</a>",settings:[{type:"text",label:"Row ID",key:"rowId",nested:!0},{type:"text",label:"No rows found",key:"noRowsMessage",defaultValue:"We couldn't find a row to display",nested:!0}]},{section:!0,name:"Details",settings:[{type:"text",label:"Title",key:"title",nested:!0},{type:"text",label:"Description",key:"description",nested:!0},{type:"fieldConfiguration",key:"fields",nested:!0,resetOn:"dataSource",selectAllFields:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1}]},{tag:"style",type:"select",label:"Button position",key:"buttonPosition",options:[{label:"Bottom",value:"bottom"},{label:"Top",value:"top"}],defaultValue:"bottom"},{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,resetOn:["actionType","dataSource"]},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]},{tag:"style",type:"select",label:"Size",key:"size",options:[{label:"Medium",value:"spectrum--medium"},{label:"Large",value:"spectrum--large"}],defaultValue:"spectrum--medium"}],actions:[{type:"ValidateForm",suffix:"form"},{type:"ClearForm",suffix:"form"},{type:"UpdateFieldValue",suffix:"form"},{type:"ScrollTo",suffix:"form"},{type:"RefreshDatasource",suffix:"provider"}],context:[{type:"form",suffix:"form"},{type:"schema",suffix:"repeater"}]},sidepanel={name:"Side Panel",icon:"RailRight",hasChildren:!0,ignoresLayout:!0,illegalChildren:["section","sidepanel","modal"],showEmptyState:!1,draggable:!1,info:"Side panels are hidden by default. They will only be revealed when triggered by the 'Open Side Panel' action.",settings:[{type:"boolean",key:"ignoreClicksOutside",label:"Ignore clicks outside",defaultValue:!1},{type:"event",key:"onClose",label:"On close"}]},modal$1={name:"Modal",icon:"MBox",hasChildren:!0,illegalChildren:["section","modal","sidepanel"],ignoresLayout:!0,showEmptyState:!1,draggable:!1,info:"Modals are hidden by default. They will only be revealed when triggered by the 'Open Modal' action.",settings:[{type:"boolean",key:"ignoreClicksOutside",label:"Ignore clicks outside",defaultValue:!1},{type:"event",key:"onClose",label:"On close"},{type:"select",label:"Size",key:"size",defaultValue:"small",options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"Fullscreen",value:"fullscreen"}]}]},rowexplorer={block:!0,name:"Row Explorer Block",icon:"PersonalizationField",size:{width:800,height:426},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"table",label:"Data",key:"dataSource",required:!0},{type:"select",label:"Auto-refresh",key:"autoRefresh",license:"premium",placeholder:"Never",options:[{label:"10 seconds",value:10},{label:"30 seconds",value:30},{label:"1 minute",value:60},{label:"5 minutes",value:300},{label:"10 minutes",value:600}]},{type:"text",label:"Height",key:"height",defaultValue:"426px"},{type:"text",label:"Empty text",key:"noRowsMessage",defaultValue:"No data"},{section:!0,name:"Cards",settings:[{type:"field",label:"Search field",key:"cardSearchField",nested:!0},{type:"text",key:"cardTitle",label:"Title",nested:!0,defaultValue:"Title"},{type:"text",key:"cardSubtitle",label:"Subtitle",nested:!0,defaultValue:"Subtitle"},{type:"text",key:"cardDescription",label:"Description",nested:!0,defaultValue:"Description"},{type:"text",key:"cardImageURL",label:"Image URL",nested:!0}]},{section:!0,name:"Details",settings:[{type:"text",key:"detailTitle",label:"Title"},{type:"multifield",label:"Fields",key:"detailFields",nested:!0,selectAllFields:!0}]}],context:{type:"schema",suffix:"repeater",scope:"local"}},gridblock={name:"Table",icon:"Table",styles:["size"],size:{width:600,height:400},grid:{hAlign:"stretch",vAlign:"stretch"},settings:[{type:"dataSource",label:"Data",key:"table",required:!0},{type:"filter",label:"Filtering",key:"initialFilter",dependsOn:{setting:"table.type",value:"custom",invert:!0}},{type:"field/sortable",label:"Sort column",key:"initialSortColumn",placeholder:"Default",dependsOn:{setting:"table.type",value:"custom",invert:!0}},{type:"select",label:"Sort order",key:"initialSortOrder",options:["Ascending","Descending"],defaultValue:"Ascending",dependsOn:"initialSortColumn"},{type:"select",label:"Row height",key:"fixedRowHeight",placeholder:"Default",options:[{label:"Small",value:36},{label:"Medium",value:64},{label:"Large",value:92}]},{type:"event",label:"On row click",key:"onRowClick",context:[{label:"Clicked row",key:"row"}]},{type:"boolean",label:"Add rows",key:"allowAddRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"Edit rows",key:"allowEditRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"Delete rows",key:"allowDeleteRows",defaultValue:!0,dependsOn:{setting:"table.type",value:["table","viewV2"]}},{type:"boolean",label:"High contrast",key:"stripeRows",defaultValue:!1},{type:"boolean",label:"Quiet",key:"quiet",defaultValue:!1},{section:!0,name:"Columns",settings:[{type:"columns/grid",key:"columns",resetOn:"table"}]},{section:!0,name:"Buttons",settings:[{type:"buttonConfiguration",key:"buttons",nested:!0,context:[{label:"Clicked row",key:"row"}]},{type:"boolean",label:"Collapse",key:"buttonsCollapsed"},{type:"text",label:"Collapsed text",key:"buttonsCollapsedText",dependsOn:"buttonsCollapsed",placeholder:"Action"}]}],context:[{type:"schema",scope:"local"},{type:"static",values:[{label:"Selected rows",key:"selectedRows",type:"array"}]}],actions:["RefreshDatasource"]},bbreferencefield={devComment:"As bb reference is only used for user subtype for now, we are using user for icon and labels",name:"User List Field",icon:"UserGroup",styles:["size"],editable:!0,size:{width:400,height:50},settings:[{type:"field/bb_reference",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue"},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"array"}]}},bbreferencesinglefield={devComment:"As bb reference is only used for user subtype for now, we are using user for icon and labels",name:"User Field",icon:"User",styles:["size"],editable:!0,size:{width:400,height:50},settings:[{type:"field/bb_reference_single",label:"Field",key:"field"},{type:"text",label:"Label",key:"label"},{type:"text",label:"Placeholder",key:"placeholder"},{type:"text",label:"Default value",key:"defaultValue"},{type:"text",label:"Help text",key:"helpText"},{type:"event",label:"On change",key:"onChange",context:[{label:"Field Value",key:"value"}]},{type:"validation/link",label:"Validation",key:"validation"},{type:"boolean",label:"Search",key:"autocomplete",defaultValue:!0},{type:"boolean",label:"Disabled",key:"disabled",defaultValue:!1},{type:"boolean",label:"Read only",key:"readonly",defaultValue:!1,dependsOn:{setting:"disabled",value:!0,invert:!0}},{type:"select",label:"Layout",key:"span",defaultValue:6,hidden:!0,showInBar:!0,barStyle:"buttons",options:[{label:"1 column",value:6,barIcon:"Stop",barTitle:"1 column"},{label:"2 columns",value:3,barIcon:"ColumnTwoA",barTitle:"2 columns"},{label:"3 columns",value:2,barIcon:"ViewColumn",barTitle:"3 columns"}]}],context:{type:"static",values:[{label:"Value",key:"value",type:"string"}]}},clientManifest={features,typeSupportPresets,layout:layout$1,container:container$1,section,screenslot,buttongroup,button,divider,repeater,stackedlist,card,text,heading:heading$1,tag,image,backgroundimage,icon,navigation,link,cardhorizontal,cardstat,embed,bar,line,area,pie,donut,candlestick,histogram,form:form$2,formstep,fieldgroup,labelfield,stringfield,numberfield,bigintfield,passwordfield,optionsfield,multifieldselect,booleanfield,longformfield,datetimefield,codescanner,signaturesinglefield,embeddedmap,attachmentfield,attachmentsinglefield,relationshipfield,jsonfield,s3upload,dataprovider,table:table$1,daterangepicker,spectrumcard,dynamicfilter,chartblock,tableblock,cardsblock,repeaterblock,markdownviewer,multistepformblock,multistepformblockstep,formblock,sidepanel,modal:modal$1,rowexplorer,gridblock,bbreferencefield,bbreferencesinglefield};function findComponentsBySettingsType(to,ue){const eo=Array.isArray(ue)?ue:[ue],no=[];function ro(oo){var so;if(!oo)return;const io=getManifestDefinition(oo),ao="settings"in io&&io.settings.find(lo=>eo.includes(lo.type));ao&&"type"in ao&&no.push({component:oo,setting:{type:ao.type,key:ao.key}}),(so=oo._children)==null||so.forEach(lo=>{ro(lo)})}return ro(to==null?void 0:to.props),no}function getManifestDefinition(to){const ue=to._component.split("/").slice(-1)[0];return clientManifest[ue]}class TableImportError extends Error{constructor(ue){super(),this.name="TableImportError",this.errors=ue}get description(){let ue="";for(const eo in this.errors)ue+=`${eo}: ${this.errors[eo]}
|
|
520
520
|
`;return ue}}class DatasourceStore extends DerivedBudiStore{constructor(){const ue=eo=>derived([eo,tables],([no,ro])=>{var so,lo,co,uo;let oo=(so=no.rawList)==null?void 0:so.find(fo=>fo._id===BUDIBASE_INTERNAL_DB_ID),io=(lo=no.rawList)==null?void 0:lo.filter(fo=>fo._id!==BUDIBASE_INTERNAL_DB_ID);if(oo){const fo=(co=ro.list)==null?void 0:co.filter(po=>po.sourceId===BUDIBASE_INTERNAL_DB_ID&&po._id!==TableNames.USERS);oo={...oo,entities:fo}}let ao=[];return(uo=oo==null?void 0:oo.entities)!=null&&uo.length&&ao.push(oo),ao=ao.concat(io||[]),{...no,list:ao,selected:ao==null?void 0:ao.find(fo=>fo._id===no.selectedDatasourceId),hasDefaultData:ao==null?void 0:ao.some(fo=>fo._id===DEFAULT_BB_DATASOURCE_ID),hasData:(ao==null?void 0:ao.length)>0}});super({rawList:[],selectedDatasourceId:null},ue),this.fetch=this.fetch.bind(this),this.init=this.fetch.bind(this),this.select=this.select.bind(this),this.updateSchema=this.updateSchema.bind(this),this.create=this.create.bind(this),this.delete=this.deleteDatasource.bind(this),this.save=this.save.bind(this),this.replaceDatasource=this.replaceDatasource.bind(this),this.getTableNames=this.getTableNames.bind(this)}async fetch(){const ue=await API.getDatasources();this.store.update(eo=>({...eo,rawList:ue}))}async init(){return this.fetch()}select(ue){this.store.update(eo=>({...eo,selectedDatasourceId:ue}))}updateDatasourceInStore(ue,{ignoreErrors:eo}={}){const{datasource:no,errors:ro}=ue;if(!eo&&ro&&Object.keys(ro).length>0)throw new TableImportError(ro);return this.replaceDatasource(no._id,no),this.select(no._id),no}async updateSchema(ue,eo){const no=await API.buildDatasourceSchema(ue==null?void 0:ue._id,eo);this.updateDatasourceInStore(no)}sourceCount(ue){return get_store_value(this.store).rawList.filter(eo=>eo.source===ue).length}async checkDatasourceValidity(ue,eo){var no;if((no=ue.features)!=null&&no[DatasourceFeature.CONNECTION_CHECKING]){const{connected:ro,error:oo}=await API.validateDatasource(eo);return ro?{valid:!0}:{valid:!1,error:oo}}return{valid:!0}}async create({integration:ue,config:eo}){const no=this.sourceCount(ue.name),ro=no===0?"":` ${no+1}`,oo={type:"datasource",source:ue.name,config:eo,name:`${ue.friendlyName}${ro}`,plus:ue.plus&&ue.name!==IntegrationTypes.REST,isSQL:ue.isSQL},{valid:io,error:ao}=await this.checkDatasourceValidity(ue,oo);if(!io)throw new Error(`Unable to connect - ${ao}`);const so=await API.createDatasource({datasource:oo,fetchSchema:ue.plus});return this.updateDatasourceInStore(so,{ignoreErrors:!0})}async save({integration:ue,datasource:eo}){if(!(await this.checkDatasourceValidity(ue,eo)).valid)throw new Error("Unable to connect");const no=await API.updateDatasource(eo);return this.updateDatasourceInStore(no)}async deleteDatasource(ue){!(ue!=null&&ue._id)||!(ue!=null&&ue._rev)||(await API.deleteDatasource(ue._id,ue._rev),this.replaceDatasource(ue._id))}async delete(ue){return this.deleteDatasource(ue)}replaceDatasource(ue,eo){if(!ue)return;if(!eo){this.store.update(ro=>({...ro,rawList:ro.rawList.filter(oo=>oo._id!==ue)})),tables.removeDatasourceTables(ue),queries.removeDatasourceQueries(ue);return}const no=get_store_value(this.store).rawList.findIndex(ro=>ro._id===eo._id);no===-1?(this.store.update(ro=>({...ro,rawList:[...ro.rawList,eo]})),tables.fetch()):eo&&this.store.update(ro=>(ro.rawList[no]=eo,ro))}async getTableNames(ue){return(await API.fetchInfoForDatasource(ue)).tableNames||[]}}const datasources=new DatasourceStore,INITIAL_STATE={},createIntegrationsStore=()=>{const to=writable(INITIAL_STATE);return{...to,init:async()=>{const eo=await API.getIntegrations(),no=Object.entries(eo).reduce((ro,[oo,io])=>(io&&(ro[oo]=io),ro),{});to.set(no)}}},integrations=createIntegrationsStore(),sortQueries=to=>{to.sort((ue,eo)=>ue.name.localeCompare(eo.name))};class QueryStore extends DerivedBudiStore{constructor(){const ue=eo=>derived(eo,no=>{var ro;return{list:no.list,selectedQueryId:no.selectedQueryId,selected:(ro=no.list)==null?void 0:ro.find(oo=>oo._id===no.selectedQueryId)}});super({list:[],selectedQueryId:null},ue),this.init=this.fetch,this.select=this.select.bind(this)}async fetch(){const ue=await API.getQueries();sortQueries(ue),this.store.update(eo=>({...eo,list:ue}))}async save(ue,eo){const no=get_store_value(integrations),ro=get_store_value(datasources).list.filter(io=>io._id===ue);if(ro.length!==0){const ao=no[ro[0].source].query[eo.queryVerb].readable;ao&&(eo.readable=ao)}eo.datasourceId=ue;const oo=await API.saveQuery(eo);return this.store.update(io=>{const ao=io.list.findIndex(lo=>lo._id===oo._id),so=io.list;return ao>=0?so.splice(ao,1,oo):so.push(oo),sortQueries(so),{list:so,selectedQueryId:oo._id||null}}),oo}async importQueries(ue){return await API.importQueries(ue)}select(ue){this.store.update(eo=>({...eo,selectedQueryId:ue}))}async preview(ue){const eo=await API.previewQuery(ue),no={};for(let[ro,oo]of Object.entries(eo.schema))no[ro]=oo||{type:"string"};return{...eo,schema:no,rows:eo.rows||[]}}async delete(ue){if(!ue._id||!ue._rev)throw new Error("Query ID or Revision is missing");await API.deleteQuery(ue._id,ue._rev),this.store.update(eo=>({...eo,list:eo.list.filter(no=>no._id!==ue._id)}))}async duplicate(ue){let eo=get_store_value(this.store).list;const no={...ue},ro=ue.datasourceId;return delete no._id,delete no._rev,no.name=duplicateName(ue.name,eo.map(oo=>oo.name)),await this.save(ro,no)}removeDatasourceQueries(ue){this.store.update(eo=>({...eo,list:eo.list.filter(no=>no.datasourceId!==ue)}))}}const queries=new QueryStore;class ViewsStore extends DerivedBudiStore{constructor(){const ue=eo=>derived([eo,tables],([no,ro])=>{var io;let oo=[];return(io=ro.list)==null||io.forEach(ao=>{const so=Object.values((ao==null?void 0:ao.views)||{}).filter(lo=>!isV2(lo));oo=oo.concat(so)}),{selectedViewName:no.selectedViewName,list:oo,selected:oo.find(ao=>ao.name===no.selectedViewName)}});super({selectedViewName:null},ue),this.select=eo=>{this.store.update(no=>({...no,selectedViewName:eo}))},this.delete=async eo=>{if(!eo.name)throw new Error("View name is required");await API.deleteView(eo.name),tables.update(no=>{const ro=no.list.find(oo=>oo._id===eo.tableId);return ro!=null&&ro.views&&eo.name&&delete ro.views[eo.name],{...no}})},this.save=async eo=>{if(!eo.name)throw new Error("View name is required");const no=await API.saveView(eo);this.select(eo.name),tables.update(ro=>{const oo=ro.list.find(io=>io._id===eo.tableId);return oo!=null&&oo.views&&eo.name&&(eo.originalName&&delete oo.views[eo.originalName],oo.views[eo.name]=no),{...ro}})},this.select=this.select.bind(this)}}const views=new ViewsStore;function reduceBy(to,ue){return ue.reduce((eo,no)=>({...eo,[no[to]]:no}),{})}const friendlyNameByType={viewV2:"view"},validationKeyByType={table:"tableId",view:"name",viewV2:"id",query:"_id",custom:null,link:"rowId",field:"value",jsonarray:"value"},screenComponentErrors=derived([selectedScreen,tables,views,viewsV2,queries],([to,ue,eo,no,ro])=>{if(!isEnabled("CHECK_SCREEN_COMPONENT_SETTINGS_ERRORS"))return{};function oo(ao,so){const lo={};for(const{component:co,setting:uo}of findComponentsBySettingsType(ao,["table","dataSource"])){const fo=co[uo.key];if(!fo)continue;const{label:po}=fo,ho=fo.type,_o=validationKeyByType[ho];if(!_o)continue;const go=getBindableProperties(to,co._id),bo={...reduceBy("rowId",extractRelationships(go)),...reduceBy("value",extractFields(go)),...reduceBy("value",extractJSONArrayFields(go))},vo=fo[_o];if(!{...so,...bo}[vo]){const yo=friendlyNameByType[ho]??ho;lo[co._id]=[`The ${yo} named "${po}" could not be found`]}}return lo}const io={...reduceBy("_id",ue.list),...reduceBy("name",eo.list),...reduceBy("id",no.list),...reduceBy("_id",ro.list)};return to?oo(to,io):{}});class PermissionStore extends BudiStore{constructor(){super([]),this.save=async ue=>{const{level:eo,role:no,resource:ro}=ue;return await API.updatePermissionForResource(ro,no,eo)},this.remove=async ue=>{const{level:eo,role:no,resource:ro}=ue;return await API.removePermissionFromResource(ro,no,eo)},this.forResource=async ue=>(await API.getPermissionForResource(ue)).permissions,this.forResourceDetailed=async ue=>await API.getPermissionForResource(ue),this.getDependantsInfo=async ue=>await API.getDependants(ue)}}const permissions=new PermissionStore;class RoleStore extends DerivedBudiStore{constructor(){const ue=eo=>derived(eo,no=>no.map(ro=>{var oo,io,ao;return{...ro,uiMetadata:{displayName:((oo=ro.uiMetadata)==null?void 0:oo.displayName)||ro.name,color:((io=ro.uiMetadata)==null?void 0:io.color)||"var(--spectrum-global-color-magenta-400)",description:((ao=ro.uiMetadata)==null?void 0:ao.description)||"Custom role"}}}));super([],ue),this.setRoles=eo=>{this.set(eo.sort((no,ro)=>{var lo,co;const oo=getRolePriority(no._id),io=getRolePriority(ro._id);if(oo!==io)return oo>io?-1:1;const ao=((lo=no.uiMetadata)==null?void 0:lo.displayName)||no.name,so=((co=ro.uiMetadata)==null?void 0:co.displayName)||ro.name;return ao<so?-1:1}))},this.fetch=async()=>{const eo=await API.getRoles();this.setRoles(eo)},this.fetchByAppId=async eo=>{const{roles:no}=await API.getRolesForApp(eo);this.setRoles(no)},this.delete=async eo=>{!eo._id||!eo._rev||(await API.deleteRole(eo._id,eo._rev),await this.fetch())},this.save=async eo=>{const no=await API.saveRole(eo);return await this.fetch(),no},this.replace=(eo,no)=>{if(!eo)return;if(!no){this.update(oo=>oo.filter(io=>io._id!==eo));return}const ro=get_store_value(this).findIndex(oo=>oo._id===no._id);ro===-1?this.update(oo=>[...oo,no]):no&&this.update(oo=>(oo[ro]=no,[...oo]))}}}const roles=new RoleStore,getIntegrationOrder=to=>to?to===DatasourceTypes.API?1:to===DatasourceTypes.RELATIONAL?2:to===DatasourceTypes.NON_RELATIONAL?3:to.charCodeAt(0)+4:Number.MAX_SAFE_INTEGER;class SortedIntegrationStore extends BudiStore{constructor(){super([]);const ue=derived(integrations,eo=>Object.entries(eo).map(([oo,io])=>({name:oo,...io})).sort((oo,io)=>{const ao=getIntegrationOrder(oo.type),so=getIntegrationOrder(io.type);return ao===so?oo.friendlyName.localeCompare(io.friendlyName):ao<so?-1:1}));this.subscribe=ue.subscribe}}const sortedIntegrations=new SortedIntegrationStore,INITIAL_FLAGS_STATE={flags:{}};class FlagsStore extends BudiStore{constructor(){super(INITIAL_FLAGS_STATE),this.fetch=this.fetch.bind(this),this.updateFlag=this.updateFlag.bind(this),this.toggleUiFeature=this.toggleUiFeature.bind(this)}async fetch(){const ue=await API.getFlags();this.update(eo=>({...eo,flags:ue}))}async updateFlag(ue,eo){await API.updateFlag(ue,eo),await this.fetch()}async toggleUiFeature(ue){await API.toggleUiFeature(ue)}}const flags=new FlagsStore;class ComponentTreeNodesStore extends BudiStore{constructor(){super({},{persistence:{type:PersistenceType.SESSION,key:"openNodes"}})}toggleNode(ue){this.update(eo=>(eo[`nodeOpen-${ue}`]=!eo[`nodeOpen-${ue}`],eo))}expandNodes(ue){this.update(eo=>{const no=Object.fromEntries(ue.map(ro=>[`nodeOpen-${ro}`,!0]));return{...eo,...no}})}collapseNodes(ue){this.update(eo=>{const no=Object.fromEntries(ue.map(ro=>[`nodeOpen-${ro}`,!1]));return{...eo,...no}})}makeNodeVisible(ue){const eo=get_store_value(selectedScreen);if(!eo)return console.error("Invalid node "+ue),{};const ro=findComponentPath(eo.props,ue).map(oo=>oo._id);this.update(oo=>{const io=Object.fromEntries(ro.map(ao=>[`nodeOpen-${ao}`,!0]));return{...oo,...io}})}isNodeExpanded(ue){return!!get_store_value(this)[`nodeOpen-${ue}`]}}const componentTreeNodesStore=new ComponentTreeNodesStore,appPublished=derived([appStore,appsStore,deploymentStore],([to,ue,eo])=>{const no=ue.apps.find(oo=>oo.devId===to.appId),ro=eo.filter(oo=>oo.status===DeploymentStatus.SUCCESS);return(no==null?void 0:no.status)==="published"&&ro.length>0}),reset=()=>{appStore.reset(),builderStore.reset(),screenStore.reset(),componentStore.reset(),layoutStore.reset(),navigationStore.reset(),rowActions.reset()},refreshBuilderData=async()=>{await Promise.all([automationStore.actions.fetch(),datasources.init(),integrations.init(),queries.init(),tables.init(),roles.fetch(),flags.fetch()])},resetBuilderHistory=()=>{screenStore.history.reset(),automationHistoryStore.reset()},initialise=async to=>{const{application:ue}=to;appStore.syncAppPackage(to),await Promise.all([appStore.syncAppRoutes(),componentStore.refreshDefinitions(ue==null?void 0:ue.appId)]),builderStore.init(ue),navigationStore.syncAppNavigation(ue==null?void 0:ue.navigation),themeStore.syncAppTheme(ue),snippets$1.syncMetadata(ue),screenStore.syncAppScreens(to),layoutStore.syncAppLayouts(to),resetBuilderHistory(),await refreshBuilderData()},API=createAPIClient({attachHeaders:to=>{let ue=get_store_value(appStore).appId;ue&&(to["x-budibase-app-id"]=ue);const eo=get_store_value(auth).user;eo!=null&&eo.csrfToken&&(to["x-csrf-token"]=eo.csrfToken)},onError:to=>{const{url:ue,message:eo,status:no,method:ro,handled:oo}=to||{};if(!oo){console.error("Unhandled error from API client",to);return}console.warn(`[Builder] HTTP ${no} on ${ro}:${ue}
|
|
521
521
|
${eo}`),no===403&&(removeCookie(Cookies.Auth),!ue.includes("self")&&!ue.includes("login")&&location.reload())},onMigrationDetected:to=>{var eo;const ue=`/builder/app/updating/${to}`;window.location.pathname!==ue&&((eo=get_store_value(navigation$1))==null||eo.goto(`${ue}?returnUrl=${encodeURIComponent(window.location.pathname)}`))}}),Logo$2="/builder/assets/bb-emblem-5d011fde.svg",handleError=to=>{let ue={...to};return Object.keys(ue).reduce((eo,no)=>(ue[no]&&(eo[no]=ue[no]),eo),{})},passwordsMatch=(to,ue)=>{let eo=ue==null?void 0:ue.trim(),no=to==null?void 0:to.trim();return typeof eo=="string"&&typeof no=="string"&&eo==no},index_svelte_svelte_type_style_lang$w="";function create_default_slot_8$F(to){let ue;return{c(){ue=text$1("Create an admin user")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot_7$Q(to){let ue;return{c(){ue=text$1("The admin user has access to everything in Budibase.")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot_6$10(to){let ue,eo,no,ro,oo,io,ao;return ro=new Heading({props:{size:"M",$$slots:{default:[create_default_slot_8$F]},$$scope:{ctx:to}}}),io=new Body({props:{$$slots:{default:[create_default_slot_7$Q]},$$scope:{ctx:to}}}),{c(){ue=element("img"),no=space$1(),create_component(ro.$$.fragment),oo=space$1(),create_component(io.$$.fragment),attr(ue,"alt","logo"),src_url_equal(ue.src,eo=Logo$2)||attr(ue,"src",eo),attr(ue,"class","svelte-1rej6a3")},m(so,lo){insert$1(so,ue,lo),insert$1(so,no,lo),mount_component(ro,so,lo),insert$1(so,oo,lo),mount_component(io,so,lo),ao=!0},p(so,lo){const co={};lo&262144&&(co.$$scope={dirty:lo,ctx:so}),ro.$set(co);const uo={};lo&262144&&(uo.$$scope={dirty:lo,ctx:so}),io.$set(uo)},i(so){ao||(transition_in(ro.$$.fragment,so),transition_in(io.$$.fragment,so),ao=!0)},o(so){transition_out(ro.$$.fragment,so),transition_out(io.$$.fragment,so),ao=!1},d(so){so&&(detach(ue),detach(no),detach(oo)),destroy_component(ro,so),destroy_component(io,so)}}}function create_default_slot_5$1i(to){let ue,eo,no,ro,oo,io;return ue=new FancyInput({props:{label:"Email",value:to[2].email,validate:to[9],disabled:to[3],error:to[1].email}}),ue.$on("change",to[10]),no=new FancyInput({props:{label:"Password",value:to[2].password,type:"password",validate:to[11],error:to[1].password,disabled:to[3]}}),no.$on("change",to[12]),oo=new FancyInput({props:{label:"Repeat Password",value:to[2].confirmationPassword,type:"password",validate:to[13],error:to[1].confirmationPassword,disabled:to[3]}}),oo.$on("change",to[14]),{c(){create_component(ue.$$.fragment),eo=space$1(),create_component(no.$$.fragment),ro=space$1(),create_component(oo.$$.fragment)},m(ao,so){mount_component(ue,ao,so),insert$1(ao,eo,so),mount_component(no,ao,so),insert$1(ao,ro,so),mount_component(oo,ao,so),io=!0},p(ao,so){const lo={};so&4&&(lo.value=ao[2].email),so&6&&(lo.validate=ao[9]),so&8&&(lo.disabled=ao[3]),so&2&&(lo.error=ao[1].email),ue.$set(lo);const co={};so&4&&(co.value=ao[2].password),so&22&&(co.validate=ao[11]),so&2&&(co.error=ao[1].password),so&8&&(co.disabled=ao[3]),no.$set(co);const uo={};so&4&&(uo.value=ao[2].confirmationPassword),so&6&&(uo.validate=ao[13]),so&2&&(uo.error=ao[1].confirmationPassword),so&8&&(uo.disabled=ao[3]),oo.$set(uo)},i(ao){io||(transition_in(ue.$$.fragment,ao),transition_in(no.$$.fragment,ao),transition_in(oo.$$.fragment,ao),io=!0)},o(ao){transition_out(ue.$$.fragment,ao),transition_out(no.$$.fragment,ao),transition_out(oo.$$.fragment,ao),io=!1},d(ao){ao&&(detach(eo),detach(ro)),destroy_component(ue,ao),destroy_component(no,ao),destroy_component(oo,ao)}}}function create_default_slot_4$1H(to){let ue,eo,no={$$slots:{default:[create_default_slot_5$1i]},$$scope:{ctx:to}};return ue=new FancyForm({props:no}),to[15](ue),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){const io={};oo&262174&&(io.$$scope={dirty:oo,ctx:ro}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){to[15](null),destroy_component(ue,ro)}}}function create_default_slot_3$2f(to){let ue;return{c(){ue=text$1("Create super admin user")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot_2$2U(to){let ue,eo;return ue=new Button({props:{cta:!0,size:"L",disabled:Object.keys(to[1]).length>0||to[3],$$slots:{default:[create_default_slot_3$2f]},$$scope:{ctx:to}}}),ue.$on("click",to[5]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&10&&(oo.disabled=Object.keys(no[1]).length>0||no[3]),ro&262144&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$41(to){let ue,eo,no,ro,oo,io;return ue=new Layout$n({props:{justifyItems:"center",noPadding:!0,$$slots:{default:[create_default_slot_6$10]},$$scope:{ctx:to}}}),no=new Layout$n({props:{gap:"S",noPadding:!0,$$slots:{default:[create_default_slot_4$1H]},$$scope:{ctx:to}}}),oo=new Layout$n({props:{gap:"XS",noPadding:!0,justifyItems:"center",$$slots:{default:[create_default_slot_2$2U]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment),eo=space$1(),create_component(no.$$.fragment),ro=space$1(),create_component(oo.$$.fragment)},m(ao,so){mount_component(ue,ao,so),insert$1(ao,eo,so),mount_component(no,ao,so),insert$1(ao,ro,so),mount_component(oo,ao,so),io=!0},p(ao,so){const lo={};so&262144&&(lo.$$scope={dirty:so,ctx:ao}),ue.$set(lo);const co={};so&262175&&(co.$$scope={dirty:so,ctx:ao}),no.$set(co);const uo={};so&262154&&(uo.$$scope={dirty:so,ctx:ao}),oo.$set(uo)},i(ao){io||(transition_in(ue.$$.fragment,ao),transition_in(no.$$.fragment,ao),transition_in(oo.$$.fragment,ao),io=!0)},o(ao){transition_out(ue.$$.fragment,ao),transition_out(no.$$.fragment,ao),transition_out(oo.$$.fragment,ao),io=!1},d(ao){ao&&(detach(eo),detach(ro)),destroy_component(ue,ao),destroy_component(no,ao),destroy_component(oo,ao)}}}function create_default_slot$5K(to){let ue,eo;return ue=new Layout$n({props:{gap:"M",noPadding:!0,$$slots:{default:[create_default_slot_1$41]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&262175&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$9a(to){let ue,eo,no,ro;return ue=new TestimonialPage({props:{$$slots:{default:[create_default_slot$5K]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(oo,io){mount_component(ue,oo,io),eo=!0,no||(ro=listen(window,"keydown",to[6]),no=!0)},p(oo,[io]){const ao={};io&262175&&(ao.$$scope={dirty:io,ctx:oo}),ue.$set(ao)},i(oo){eo||(transition_in(ue.$$.fragment,oo),eo=!0)},o(oo){transition_out(ue.$$.fragment,oo),eo=!1},d(oo){destroy_component(ue,oo),no=!1,ro()}}}function instance$9c(to,ue,eo){let no,ro,oo,io,ao;component_subscribe(to,goto,ko=>eo(17,oo=ko)),component_subscribe(to,admin,ko=>eo(7,io=ko)),component_subscribe(to,auth,ko=>eo(8,ao=ko));let so,lo={},co={},uo=!1;async function fo(){if(so.validate(),!(Object.keys(lo).length>0)){eo(3,uo=!0);try{let ko={...co,tenantId:no};delete ko.confirmationPassword,await API.createAdminUser(ko),notifications.success("Admin user created"),await admin.init(),await auth.login(co==null?void 0:co.email.trim(),co==null?void 0:co.password),oo("../portal")}catch(ko){eo(3,uo=!1),notifications.error(ko.message||"Failed to create admin user")}}}const po=ko=>{ko.key==="Enter"&&fo()},ho=()=>{let ko={email:co.email?void 0:"Please enter a valid email"};eo(1,lo=handleError({...lo,...ko}))},_o=ko=>{eo(2,co={...co,email:ko.detail})},go=()=>{let ko={};co.password?co.password.length<ro?ko.password=`Password must be at least ${ro} characters`:ko.password=void 0:ko.password="Please enter a password",ko.confirmationPassword=!passwordsMatch(co.password,co.confirmationPassword)&&co.confirmationPassword?"Passwords must match":void 0,eo(1,lo=handleError({...lo,...ko}))},bo=ko=>{eo(2,co={...co,password:ko.detail})},vo=()=>{let ko={confirmationPassword:!passwordsMatch(co.password,co.confirmationPassword)&&co.password?"Passwords must match":void 0};eo(1,lo=handleError({...lo,...ko}))},yo=ko=>{eo(2,co={...co,confirmationPassword:ko.detail})};function wo(ko){binding_callbacks[ko?"unshift":"push"](()=>{so=ko,eo(0,so)})}return to.$$.update=()=>{to.$$.dirty&256&&(no=ao.tenantId),to.$$.dirty&128&&eo(4,ro=io.passwordMinLength??12)},[so,lo,co,uo,ro,fo,po,io,ao,ho,_o,go,bo,vo,yo,wo]}class Admin extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9c,create_fragment$9a,safe_not_equal,{})}}function create_if_block$4b(to){let ue;const eo=to[4].default,no=create_slot(eo,to,to[3],null);return{c(){no&&no.c()},m(ro,oo){no&&no.m(ro,oo),ue=!0},p(ro,oo){no&&no.p&&(!ue||oo&8)&&update_slot_base(no,eo,ro,ro[3],ue?get_slot_changes(eo,ro[3],oo,null):get_all_dirty_from_scope(ro[3]),null)},i(ro){ue||(transition_in(no,ro),ue=!0)},o(ro){transition_out(no,ro),ue=!1},d(ro){no&&no.d(ro)}}}function create_fragment$99(to){let ue,eo,no=to[0]&&create_if_block$4b(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){ro[0]?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$4b(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function instance$9b(to,ue,eo){let no,ro,oo,io;component_subscribe(to,redirect,co=>eo(6,oo=co)),component_subscribe(to,admin,co=>eo(2,io=co));let{$$slots:ao={},$$scope:so}=ue,lo=!1;return onMount(()=>{var co,uo;(uo=(co=io==null?void 0:io.checklist)==null?void 0:co.adminUser)!=null&&uo.checked||ro?oo("../"):eo(0,lo=!0)}),to.$$set=co=>{"$$scope"in co&&eo(3,so=co.$$scope)},to.$$.update=()=>{to.$$.dirty&4&&eo(1,no=io.cloud),to.$$.dirty&6&&(ro=no&&!io.disableAccountPortal)},[lo,no,io,so,ao]}let Layout$m=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9b,create_fragment$99,safe_not_equal,{})}};function instance$9a(to,ue,eo){let no;return component_subscribe(to,redirect,ro=>eo(0,no=ro)),no("../design"),[]}class Fallback extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$9a,null,safe_not_equal,{})}}function instance$99(to,ue,eo){let no;return component_subscribe(to,redirect,ro=>eo(0,no=ro)),no("./data"),[]}let U5Bapplicationu5D$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$99,null,safe_not_equal,{})}};function create_fragment$98(to){let ue,eo,no,ro,oo,io;return{c(){ue=svg_element("svg"),eo=svg_element("path"),no=svg_element("path"),ro=svg_element("path"),oo=svg_element("path"),io=svg_element("path"),attr(eo,"d",`M169.341 104.792C168.322 101.71 165.652 99.5637 162.199 99.0487C160.57
|
|
522
522
|
98.8061 158.706 98.9095 156.499 99.3635C152.653 100.156 149.799 100.457
|
|
@@ -885,7 +885,7 @@ and ensure you are accounting for this risk.
|
|
|
885
885
|
</svg>`,buildSectionHeader=(to,ue,eo,no)=>{const ro=document.createElement("div");return ro.classList.add("info-section"),to&&ro.classList.add(to),ro.innerHTML=`${toSpectrumIcon(eo)}<span>${ue}</span>`,{name:ue,header:()=>ro,rank:no}},helpersToCompletion=(to,ue)=>{const{type:eo,name:no,icon:ro}=SECTIONS.HB_HELPER,oo=buildSectionHeader(eo,no,ro,99);return Object.keys(to).flatMap(io=>{let ao=to[io];return{label:io,info:so=>buildHelperInfoNode(so,ao),type:"helper",section:oo,detail:"Function",apply:(so,lo,co,uo)=>{insertBinding(so,co,uo,io,ue)}}})},getHelperCompletions=to=>{const ue=getManifest();return Object.keys(ue).flatMap(eo=>helpersToCompletion(ue[eo],to))},snippetAutoComplete=to=>function(eo){if(!(to!=null&&to.length))return null;const no=eo.matchBefore(/\w*/);return!no||no.from==no.to&&!eo.explicit?null:{from:no.from,options:to.map(ro=>({label:`snippets.${ro.name}`,type:"text",simple:!0,apply:(oo,io,ao,so)=>{insertSnippet(oo,ao,so,io.label)}}))}},bindingFilter=(to,ue)=>to.filter(eo=>{const no=eo.section.name.toLowerCase(),ro=eo.label.toLowerCase(),oo=ue.toLowerCase();return no.includes(oo)||ro.includes(oo)}),hbAutocomplete=to=>{async function ue(eo){let no=eo.matchBefore(EditorModes$1.Handlebars.match),ro=to||[];if(!no)return null;const oo=no.text.match(/{{[\s]*/);if(!oo)return null;const io=no.text.replace(oo[0],"");let ao=bindingFilter(ro,io);return{from:no.from+oo[0].length,filter:!1,options:ao}}return ue},jsAutocomplete=to=>{async function ue(eo){let no=eo.matchBefore(/\$\("[\s\w]*/),ro=to||[];if(no){const oo=no.text.match(/\$\("[\s]*/);if(!oo)return null;const io=no.text.replace(oo[0],"");let ao=bindingFilter(ro,io);return{from:no.from+oo[0].length,filter:!1,options:ao}}return null}return ue},buildBindingInfoNode=(to,ue)=>{if(!ue.valueHTML||ue.value==null)return null;const eo=document.createElement("div");return eo.classList.add("info-bubble"),eo.innerHTML=`<div class="binding__example">${ue.valueHTML}</div>`,eo},hbInsert=(to,ue,eo,no)=>{let ro="";const oo=ue?to.substring(0,ue):"",io=eo?to.substring(eo):"";return!oo.includes("{{")||!io.includes("}}")?ro=`{{ ${no} }}`:ro=` ${no} `,ro};function jsInsert(to,ue,eo,no,{helper:ro,disableWrapping:oo}={}){let io="";const ao=ue?to.substring(0,ue):"",so=eo?to.substring(eo):"";return oo?io=no:ro?io=`helpers.${no}()`:!ao.includes('$("')||!so.includes('")')?io=`$("${no}")`:io=no,io}const insertBinding=(to,ue,eo,no,ro)=>{var co,uo,fo;let oo;if(ro.name=="javascript")oo=jsInsert((co=to.state.doc)==null?void 0:co.toString(),ue,eo,no);else if(ro.name=="handlebars")oo=hbInsert((uo=to.state.doc)==null?void 0:uo.toString(),ue,eo,no);else{console.warn("Unsupported");return}let io=ro.name=="javascript"?/[\s]*"\)/:/[\s]*}}/;const so=((fo=to.state.doc)==null?void 0:fo.toString().slice(eo)).match(io);let lo=ue+oo.length;so&&(lo=ue+oo.length+so[0].length),to.dispatch({changes:{from:ue,to:eo,insert:oo},selection:{anchor:lo}})},insertSnippet=(to,ue,eo,no)=>{let ro=ue+no.length;to.dispatch({changes:{from:ue,to:eo,insert:no},selection:{anchor:ro}})},bindingsToCompletions=(to,ue)=>{const eo=lodashExports.groupBy(to,"category"),no=to==null?void 0:to.reduce((oo,io)=>{var ao;return oo[io.category]=oo[io.category]||{},io.icon&&(oo[io.category].icon=oo[io.category].icon||io.icon),typeof((ao=io.display)==null?void 0:ao.rank)=="number"&&(oo[io.category].rank=oo[io.category].rank||io.display.rank),oo},{});return Object.keys(eo).reduce((oo,io)=>{const{icon:ao,rank:so}=no[io]||{},lo=buildSectionHeader(eo.type,io,ao||"",typeof so=="number"?so:1);return[...oo,...eo[io].reduce((co,uo)=>{var po,ho,_o;let fo=((po=uo.fieldSchema)==null?void 0:po.type)||((ho=uo.display)==null?void 0:ho.type);return co.push({label:((_o=uo.display)==null?void 0:_o.name)||uo.readableBinding||"NO NAME",info:go=>buildBindingInfoNode(go,uo),type:"binding",detail:fo,section:lo,apply:(go,bo,vo,yo)=>{insertBinding(go,vo,yo,uo.readableBinding,ue)}}),co},[])]},[])},CodeEditor_svelte_svelte_type_style_lang="";function create_if_block$49(to){let ue,eo,no;return eo=new Label({props:{size:"S",$$slots:{default:[create_default_slot$5H]},$$scope:{ctx:to}}}),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1|oo[1]&4&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_default_slot$5H(to){let ue;return{c(){ue=text$1(to[0])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no[0]&1&&set_data(ue,eo[0])},d(eo){eo&&detach(ue)}}}function create_fragment$8Q(to){let ue,eo,no,ro,oo,io=to[0]&&create_if_block$49(to);return{c(){var ao;io&&io.c(),ue=space$1(),eo=element("div"),no=element("div"),attr(no,"tabindex","-1"),attr(no,"class","svelte-dqv15e"),attr(eo,"class",ro=null_to_empty(`code-editor ${((ao=to[1])==null?void 0:ao.name)||""}`)+" svelte-dqv15e")},m(ao,so){io&&io.m(ao,so),insert$1(ao,ue,so),insert$1(ao,eo,so),append$2(eo,no),to[19](no),oo=!0},p(ao,so){var lo;ao[0]?io?(io.p(ao,so),so[0]&1&&transition_in(io,1)):(io=create_if_block$49(ao),io.c(),transition_in(io,1),io.m(ue.parentNode,ue)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros()),(!oo||so[0]&2&&ro!==(ro=null_to_empty(`code-editor ${((lo=ao[1])==null?void 0:lo.name)||""}`)+" svelte-dqv15e"))&&attr(eo,"class",ro)},i(ao){oo||(transition_in(io),oo=!0)},o(ao){transition_out(io),oo=!1},d(ao){ao&&(detach(ue),detach(eo)),io&&io.d(ao),to[19](null)}}}function instance$8Q(to,ue,eo){let no;component_subscribe(to,themeStore$1,Zo=>eo(18,no=Zo));let{label:ro=void 0}=ue,{completions:oo=[]}=ue,{mode:io=EditorModes$1.Handlebars}=ue,{value:ao=""}=ue,{placeholder:so=null}=ue,{autocompleteEnabled:lo=!0}=ue,{autofocus:co=!1}=ue,{jsBindingWrapping:uo=!0}=ue,{readonly:fo=!1}=ue,{readonlyLineNumbers:po=!1}=ue;const ho=createEventDispatcher();let _o,go,bo=!1,vo=!1,yo=!1,wo=no==null?void 0:no.theme,ko=!wo.includes("light"),So=new Compartment;const Ao=(Zo,Xo,Yo)=>{if(!Xo||!Yo){yo=!0;return}go&&Zo&&(go.state.doc.toString()!==Zo||yo)&&(go.dispatch({changes:{from:0,to:go.state.doc.length,insert:Zo}}),yo=!1)},Io=()=>{const Zo=go.state.selection.ranges[0];return{start:Zo==null?void 0:Zo.from,end:Zo==null?void 0:Zo.to}},Eo=Zo=>{go.dispatch({changes:{from:Zo.start||go.state.doc.length,to:Zo.end||go.state.doc.length,insert:Zo.value},selection:Zo.cursor?{anchor:Zo.start+Zo.value.length}:void 0})},To=new MatchDecorator({regexp:FIND_ANY_HBS_REGEX,decoration:()=>Decoration.mark({tag:"span",attributes:{class:"binding-wrap"}})}),Mo=ViewPlugin.define(Zo=>({decorations:To.createDeco(Zo),update(Xo){this.decorations=To.updateDeco(Xo,this.decorations)}}),{decorations:Zo=>Zo.decorations}),Vo=new MatchDecorator({regexp:/snippets\.[^\s(]+/g,decoration:()=>Decoration.mark({tag:"span",attributes:{class:"snippet-wrap"}})}),Fo=ViewPlugin.define(Zo=>({decorations:Vo.createDeco(Zo),update(Xo){this.decorations=Vo.updateDeco(Xo,this.decorations)}}),{decorations:Zo=>Zo.decorations}),Po={key:"Tab",run:Zo=>completionStatus(Zo.state)==="active"?(acceptCompletion(Zo),!0):(indentMore(Zo),!0),shift:Zo=>(indentLess(Zo),!0)},Ro=()=>[...closeBracketsKeymap,...defaultKeymap,...historyKeymap,...foldKeymap,...completionKeymap,Po],Do=()=>[drawSelection(),dropCursor(),bracketMatching(),closeBrackets(),syntaxHighlighting(oneDarkHighlightStyle,{fallback:!0}),highlightSpecialChars(),EditorView.lineWrapping,So.of([...ko?[oneDark]:[]])],Uo=Zo=>{let Xo=[...Zo];return lo&&(Xo.push(autocompletion({override:[...oo],closeOnBlur:!0,icons:!1,optionClass:Yo=>"simple"in Yo&&Yo.simple?"autocomplete-option-simple":"autocomplete-option"})),Xo.push(EditorView.inputHandler.of((Yo,Qo,Ko,ra)=>{if(uo&&ra==="$"){let{text:ea}=Yo.state.doc.lineAt(Qo);const ia=Qo?ea.substring(0,Qo):"",Jo=Ko?ea.substring(Ko):"",sa=!ia.includes('$("')||!Jo.includes('")'),Aa=Yo.state.update({changes:[{from:Qo,insert:sa?'$("")':"$"}],selection:{anchor:Qo+(sa?3:1)}},{scrollIntoView:!0,userEvent:"input.type"});return Yo.dispatch(Aa),!0}return!1}))),io.name==="javascript"?(Xo.push(Fo),Xo.push(javascript()),fo||Xo.push(highlightWhitespace())):Xo.push(Mo),so&&Xo.push(placeholder(so)),fo?(Xo.push(EditorState.readOnly.of(!0)),po&&Xo.push(lineNumbers())):Xo=[...Xo,history$1(),highlightActiveLine(),highlightActiveLineGutter(),lineNumbers(),foldGutter(),keymap.of(Ro()),EditorView.domEventHandlers({blur:()=>{ho("blur",go.state.doc.toString())}}),EditorView.updateListener.of(Yo=>{var Ko;const Qo=(Ko=Yo.state.doc)==null?void 0:Ko.toString();Qo!==ao&&ho("change",Qo)})],Xo},qo=()=>{const Zo=Do();eo(13,go=new EditorView({doc:ao==null?void 0:ao.toString(),extensions:Uo(Zo),parent:_o}))};onMount(async()=>{eo(14,bo=!0)}),onDestroy(()=>{go&&go.destroy()});function xo(Zo){binding_callbacks[Zo?"unshift":"push"](()=>{_o=Zo,eo(2,_o)})}return to.$$set=Zo=>{"label"in Zo&&eo(0,ro=Zo.label),"completions"in Zo&&eo(3,oo=Zo.completions),"mode"in Zo&&eo(1,io=Zo.mode),"value"in Zo&&eo(4,ao=Zo.value),"placeholder"in Zo&&eo(5,so=Zo.placeholder),"autocompleteEnabled"in Zo&&eo(6,lo=Zo.autocompleteEnabled),"autofocus"in Zo&&eo(7,co=Zo.autofocus),"jsBindingWrapping"in Zo&&eo(8,uo=Zo.jsBindingWrapping),"readonly"in Zo&&eo(9,fo=Zo.readonly),"readonlyLineNumbers"in Zo&&eo(10,po=Zo.readonlyLineNumbers)},to.$$.update=()=>{to.$$.dirty[0]&49152&&bo&&!vo&&(eo(15,vo=!0),qo()),to.$$.dirty[0]&41088&&co&&vo&&go.focus(),to.$$.dirty[0]&516096&&bo&&vo&&no!=null&&no.theme&&wo!=(no==null?void 0:no.theme)&&(eo(16,wo=no==null?void 0:no.theme),eo(17,ko=!wo.includes("light")),go.dispatch({effects:So.reconfigure([...ko?[oneDark]:[]])})),to.$$.dirty[0]&49168&&Ao(ao,vo,bo)},[ro,io,_o,oo,ao,so,lo,co,uo,fo,po,Io,Eo,go,bo,vo,wo,ko,no,xo]}class CodeEditor extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8Q,create_fragment$8Q,safe_not_equal,{label:0,completions:3,mode:1,value:4,placeholder:5,autocompleteEnabled:6,autofocus:7,jsBindingWrapping:8,readonly:9,readonlyLineNumbers:10,getCaretPosition:11,insertAtPos:12},null,[-1,-1])}get getCaretPosition(){return this.$$.ctx[11]}get insertAtPos(){return this.$$.ctx[12]}}var WeakMap$1=_WeakMap,metaMap$2=WeakMap$1&&new WeakMap$1,_metaMap=metaMap$2,identity$3=identity_1,metaMap$1=_metaMap,baseSetData$2=metaMap$1?function(to,ue){return metaMap$1.set(to,ue),to}:identity$3,_baseSetData=baseSetData$2,isObject$5=isObject_1,objectCreate=Object.create,baseCreate$4=function(){function to(){}return function(ue){if(!isObject$5(ue))return{};if(objectCreate)return objectCreate(ue);to.prototype=ue;var eo=new to;return to.prototype=void 0,eo}}(),_baseCreate=baseCreate$4,baseCreate$3=_baseCreate,isObject$4=isObject_1;function createCtor$4(to){return function(){var ue=arguments;switch(ue.length){case 0:return new to;case 1:return new to(ue[0]);case 2:return new to(ue[0],ue[1]);case 3:return new to(ue[0],ue[1],ue[2]);case 4:return new to(ue[0],ue[1],ue[2],ue[3]);case 5:return new to(ue[0],ue[1],ue[2],ue[3],ue[4]);case 6:return new to(ue[0],ue[1],ue[2],ue[3],ue[4],ue[5]);case 7:return new to(ue[0],ue[1],ue[2],ue[3],ue[4],ue[5],ue[6])}var eo=baseCreate$3(to.prototype),no=to.apply(eo,ue);return isObject$4(no)?no:eo}}var _createCtor=createCtor$4,createCtor$3=_createCtor,root$4=_root,WRAP_BIND_FLAG$6=1;function createBind$1(to,ue,eo){var no=ue&WRAP_BIND_FLAG$6,ro=createCtor$3(to);function oo(){var io=this&&this!==root$4&&this instanceof oo?ro:to;return io.apply(no?eo:this,arguments)}return oo}var _createBind=createBind$1;function apply$3(to,ue,eo){switch(eo.length){case 0:return to.call(ue);case 1:return to.call(ue,eo[0]);case 2:return to.call(ue,eo[0],eo[1]);case 3:return to.call(ue,eo[0],eo[1],eo[2])}return to.apply(ue,eo)}var _apply=apply$3,nativeMax$3=Math.max;function composeArgs$2(to,ue,eo,no){for(var ro=-1,oo=to.length,io=eo.length,ao=-1,so=ue.length,lo=nativeMax$3(oo-io,0),co=Array(so+lo),uo=!no;++ao<so;)co[ao]=ue[ao];for(;++ro<io;)(uo||ro<oo)&&(co[eo[ro]]=to[ro]);for(;lo--;)co[ao++]=to[ro++];return co}var _composeArgs=composeArgs$2,nativeMax$2=Math.max;function composeArgsRight$2(to,ue,eo,no){for(var ro=-1,oo=to.length,io=-1,ao=eo.length,so=-1,lo=ue.length,co=nativeMax$2(oo-ao,0),uo=Array(co+lo),fo=!no;++ro<co;)uo[ro]=to[ro];for(var po=ro;++so<lo;)uo[po+so]=ue[so];for(;++io<ao;)(fo||ro<oo)&&(uo[po+eo[io]]=to[ro++]);return uo}var _composeArgsRight=composeArgsRight$2;function countHolders$1(to,ue){for(var eo=to.length,no=0;eo--;)to[eo]===ue&&++no;return no}var _countHolders=countHolders$1;function baseLodash$3(){}var _baseLodash=baseLodash$3,baseCreate$2=_baseCreate,baseLodash$2=_baseLodash,MAX_ARRAY_LENGTH=4294967295;function LazyWrapper$3(to){this.__wrapped__=to,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=MAX_ARRAY_LENGTH,this.__views__=[]}LazyWrapper$3.prototype=baseCreate$2(baseLodash$2.prototype);LazyWrapper$3.prototype.constructor=LazyWrapper$3;var _LazyWrapper=LazyWrapper$3;function noop$4(){}var noop_1=noop$4,metaMap=_metaMap,noop$3=noop_1,getData$2=metaMap?function(to){return metaMap.get(to)}:noop$3,_getData=getData$2,realNames$1={},_realNames=realNames$1,realNames=_realNames,objectProto$5=Object.prototype,hasOwnProperty$5=objectProto$5.hasOwnProperty;function getFuncName$1(to){for(var ue=to.name+"",eo=realNames[ue],no=hasOwnProperty$5.call(realNames,ue)?eo.length:0;no--;){var ro=eo[no],oo=ro.func;if(oo==null||oo==to)return ro.name}return ue}var _getFuncName=getFuncName$1,baseCreate$1=_baseCreate,baseLodash$1=_baseLodash;function LodashWrapper$2(to,ue){this.__wrapped__=to,this.__actions__=[],this.__chain__=!!ue,this.__index__=0,this.__values__=void 0}LodashWrapper$2.prototype=baseCreate$1(baseLodash$1.prototype);LodashWrapper$2.prototype.constructor=LodashWrapper$2;var _LodashWrapper=LodashWrapper$2;function copyArray$4(to,ue){var eo=-1,no=to.length;for(ue||(ue=Array(no));++eo<no;)ue[eo]=to[eo];return ue}var _copyArray=copyArray$4,LazyWrapper$2=_LazyWrapper,LodashWrapper$1=_LodashWrapper,copyArray$3=_copyArray;function wrapperClone$1(to){if(to instanceof LazyWrapper$2)return to.clone();var ue=new LodashWrapper$1(to.__wrapped__,to.__chain__);return ue.__actions__=copyArray$3(to.__actions__),ue.__index__=to.__index__,ue.__values__=to.__values__,ue}var _wrapperClone=wrapperClone$1,LazyWrapper$1=_LazyWrapper,LodashWrapper=_LodashWrapper,baseLodash=_baseLodash,isArray$7=isArray_1,isObjectLike$5=isObjectLike_1,wrapperClone=_wrapperClone,objectProto$4=Object.prototype,hasOwnProperty$4=objectProto$4.hasOwnProperty;function lodash$1(to){if(isObjectLike$5(to)&&!isArray$7(to)&&!(to instanceof LazyWrapper$1)){if(to instanceof LodashWrapper)return to;if(hasOwnProperty$4.call(to,"__wrapped__"))return wrapperClone(to)}return new LodashWrapper(to)}lodash$1.prototype=baseLodash.prototype;lodash$1.prototype.constructor=lodash$1;var wrapperLodash=lodash$1,LazyWrapper=_LazyWrapper,getData$1=_getData,getFuncName=_getFuncName,lodash=wrapperLodash;function isLaziable$1(to){var ue=getFuncName(to),eo=lodash[ue];if(typeof eo!="function"||!(ue in LazyWrapper.prototype))return!1;if(to===eo)return!0;var no=getData$1(eo);return!!no&&to===no[0]}var _isLaziable=isLaziable$1,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut$2(to){var ue=0,eo=0;return function(){var no=nativeNow(),ro=HOT_SPAN-(no-eo);if(eo=no,ro>0){if(++ue>=HOT_COUNT)return arguments[0]}else ue=0;return to.apply(void 0,arguments)}}var _shortOut=shortOut$2,baseSetData$1=_baseSetData,shortOut$1=_shortOut,setData$2=shortOut$1(baseSetData$1),_setData=setData$2,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /;function getWrapDetails$1(to){var ue=to.match(reWrapDetails);return ue?ue[1].split(reSplitDetails):[]}var _getWrapDetails=getWrapDetails$1,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function insertWrapDetails$1(to,ue){var eo=ue.length;if(!eo)return to;var no=eo-1;return ue[no]=(eo>1?"& ":"")+ue[no],ue=ue.join(eo>2?", ":" "),to.replace(reWrapComment,`{
|
|
886
886
|
/* [wrapped with `+ue+`] */
|
|
887
887
|
`)}var _insertWrapDetails=insertWrapDetails$1;function constant$5(to){return function(){return to}}var constant_1=constant$5,constant$4=constant_1,defineProperty=_defineProperty$1,identity$2=identity_1,baseSetToString$1=defineProperty?function(to,ue){return defineProperty(to,"toString",{configurable:!0,enumerable:!1,value:constant$4(ue),writable:!0})}:identity$2,_baseSetToString=baseSetToString$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$2=shortOut(baseSetToString),_setToString=setToString$2;function arrayEach$2(to,ue){for(var eo=-1,no=to==null?0:to.length;++eo<no&&ue(to[eo],eo,to)!==!1;);return to}var _arrayEach=arrayEach$2;function baseFindIndex$1(to,ue,eo,no){for(var ro=to.length,oo=eo+(no?1:-1);no?oo--:++oo<ro;)if(ue(to[oo],oo,to))return oo;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(to){return to!==to}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(to,ue,eo){for(var no=eo-1,ro=to.length;++no<ro;)if(to[no]===ue)return no;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=_baseFindIndex,baseIsNaN=_baseIsNaN,strictIndexOf=_strictIndexOf;function baseIndexOf$1(to,ue,eo){return ue===ue?strictIndexOf(to,ue,eo):baseFindIndex(to,baseIsNaN,eo)}var _baseIndexOf=baseIndexOf$1,baseIndexOf=_baseIndexOf;function arrayIncludes$1(to,ue){var eo=to==null?0:to.length;return!!eo&&baseIndexOf(to,ue,0)>-1}var _arrayIncludes=arrayIncludes$1,arrayEach$1=_arrayEach,arrayIncludes=_arrayIncludes,WRAP_BIND_FLAG$5=1,WRAP_BIND_KEY_FLAG$4=2,WRAP_CURRY_FLAG$5=8,WRAP_CURRY_RIGHT_FLAG$2=16,WRAP_PARTIAL_FLAG$2=32,WRAP_PARTIAL_RIGHT_FLAG$2=64,WRAP_ARY_FLAG$3=128,WRAP_REARG_FLAG$2=256,WRAP_FLIP_FLAG$1=512,wrapFlags=[["ary",WRAP_ARY_FLAG$3],["bind",WRAP_BIND_FLAG$5],["bindKey",WRAP_BIND_KEY_FLAG$4],["curry",WRAP_CURRY_FLAG$5],["curryRight",WRAP_CURRY_RIGHT_FLAG$2],["flip",WRAP_FLIP_FLAG$1],["partial",WRAP_PARTIAL_FLAG$2],["partialRight",WRAP_PARTIAL_RIGHT_FLAG$2],["rearg",WRAP_REARG_FLAG$2]];function updateWrapDetails$1(to,ue){return arrayEach$1(wrapFlags,function(eo){var no="_."+eo[0];ue&eo[1]&&!arrayIncludes(to,no)&&to.push(no)}),to.sort()}var _updateWrapDetails=updateWrapDetails$1,getWrapDetails=_getWrapDetails,insertWrapDetails=_insertWrapDetails,setToString$1=_setToString,updateWrapDetails=_updateWrapDetails;function setWrapToString$2(to,ue,eo){var no=ue+"";return setToString$1(to,insertWrapDetails(no,updateWrapDetails(getWrapDetails(no),eo)))}var _setWrapToString=setWrapToString$2,isLaziable=_isLaziable,setData$1=_setData,setWrapToString$1=_setWrapToString,WRAP_BIND_FLAG$4=1,WRAP_BIND_KEY_FLAG$3=2,WRAP_CURRY_BOUND_FLAG$1=4,WRAP_CURRY_FLAG$4=8,WRAP_PARTIAL_FLAG$1=32,WRAP_PARTIAL_RIGHT_FLAG$1=64;function createRecurry$2(to,ue,eo,no,ro,oo,io,ao,so,lo){var co=ue&WRAP_CURRY_FLAG$4,uo=co?io:void 0,fo=co?void 0:io,po=co?oo:void 0,ho=co?void 0:oo;ue|=co?WRAP_PARTIAL_FLAG$1:WRAP_PARTIAL_RIGHT_FLAG$1,ue&=~(co?WRAP_PARTIAL_RIGHT_FLAG$1:WRAP_PARTIAL_FLAG$1),ue&WRAP_CURRY_BOUND_FLAG$1||(ue&=~(WRAP_BIND_FLAG$4|WRAP_BIND_KEY_FLAG$3));var _o=[to,ue,ro,po,uo,ho,fo,ao,so,lo],go=eo.apply(void 0,_o);return isLaziable(to)&&setData$1(go,_o),go.placeholder=no,setWrapToString$1(go,to,ue)}var _createRecurry=createRecurry$2;function getHolder$2(to){var ue=to;return ue.placeholder}var _getHolder=getHolder$2,copyArray$2=_copyArray,isIndex=_isIndex,nativeMin$1=Math.min;function reorder$1(to,ue){for(var eo=to.length,no=nativeMin$1(ue.length,eo),ro=copyArray$2(to);no--;){var oo=ue[no];to[no]=isIndex(oo,eo)?ro[oo]:void 0}return to}var _reorder=reorder$1,PLACEHOLDER$1="__lodash_placeholder__";function replaceHolders$3(to,ue){for(var eo=-1,no=to.length,ro=0,oo=[];++eo<no;){var io=to[eo];(io===ue||io===PLACEHOLDER$1)&&(to[eo]=PLACEHOLDER$1,oo[ro++]=eo)}return oo}var _replaceHolders=replaceHolders$3,composeArgs$1=_composeArgs,composeArgsRight$1=_composeArgsRight,countHolders=_countHolders,createCtor$2=_createCtor,createRecurry$1=_createRecurry,getHolder$1=_getHolder,reorder=_reorder,replaceHolders$2=_replaceHolders,root$3=_root,WRAP_BIND_FLAG$3=1,WRAP_BIND_KEY_FLAG$2=2,WRAP_CURRY_FLAG$3=8,WRAP_CURRY_RIGHT_FLAG$1=16,WRAP_ARY_FLAG$2=128,WRAP_FLIP_FLAG=512;function createHybrid$2(to,ue,eo,no,ro,oo,io,ao,so,lo){var co=ue&WRAP_ARY_FLAG$2,uo=ue&WRAP_BIND_FLAG$3,fo=ue&WRAP_BIND_KEY_FLAG$2,po=ue&(WRAP_CURRY_FLAG$3|WRAP_CURRY_RIGHT_FLAG$1),ho=ue&WRAP_FLIP_FLAG,_o=fo?void 0:createCtor$2(to);function go(){for(var bo=arguments.length,vo=Array(bo),yo=bo;yo--;)vo[yo]=arguments[yo];if(po)var wo=getHolder$1(go),ko=countHolders(vo,wo);if(no&&(vo=composeArgs$1(vo,no,ro,po)),oo&&(vo=composeArgsRight$1(vo,oo,io,po)),bo-=ko,po&&bo<lo){var So=replaceHolders$2(vo,wo);return createRecurry$1(to,ue,createHybrid$2,go.placeholder,eo,vo,So,ao,so,lo-bo)}var Ao=uo?eo:this,Io=fo?Ao[to]:to;return bo=vo.length,ao?vo=reorder(vo,ao):ho&&bo>1&&vo.reverse(),co&&so<bo&&(vo.length=so),this&&this!==root$3&&this instanceof go&&(Io=_o||createCtor$2(Io)),Io.apply(Ao,vo)}return go}var _createHybrid=createHybrid$2,apply$2=_apply,createCtor$1=_createCtor,createHybrid$1=_createHybrid,createRecurry=_createRecurry,getHolder=_getHolder,replaceHolders$1=_replaceHolders,root$2=_root;function createCurry$1(to,ue,eo){var no=createCtor$1(to);function ro(){for(var oo=arguments.length,io=Array(oo),ao=oo,so=getHolder(ro);ao--;)io[ao]=arguments[ao];var lo=oo<3&&io[0]!==so&&io[oo-1]!==so?[]:replaceHolders$1(io,so);if(oo-=lo.length,oo<eo)return createRecurry(to,ue,createHybrid$1,ro.placeholder,void 0,io,lo,void 0,void 0,eo-oo);var co=this&&this!==root$2&&this instanceof ro?no:to;return apply$2(co,this,io)}return ro}var _createCurry=createCurry$1,apply$1=_apply,createCtor=_createCtor,root$1=_root,WRAP_BIND_FLAG$2=1;function createPartial$1(to,ue,eo,no){var ro=ue&WRAP_BIND_FLAG$2,oo=createCtor(to);function io(){for(var ao=-1,so=arguments.length,lo=-1,co=no.length,uo=Array(co+so),fo=this&&this!==root$1&&this instanceof io?oo:to;++lo<co;)uo[lo]=no[lo];for(;so--;)uo[lo++]=arguments[++ao];return apply$1(fo,ro?eo:this,uo)}return io}var _createPartial=createPartial$1,composeArgs=_composeArgs,composeArgsRight=_composeArgsRight,replaceHolders=_replaceHolders,PLACEHOLDER="__lodash_placeholder__",WRAP_BIND_FLAG$1=1,WRAP_BIND_KEY_FLAG$1=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG$2=8,WRAP_ARY_FLAG$1=128,WRAP_REARG_FLAG$1=256,nativeMin=Math.min;function mergeData$1(to,ue){var eo=to[1],no=ue[1],ro=eo|no,oo=ro<(WRAP_BIND_FLAG$1|WRAP_BIND_KEY_FLAG$1|WRAP_ARY_FLAG$1),io=no==WRAP_ARY_FLAG$1&&eo==WRAP_CURRY_FLAG$2||no==WRAP_ARY_FLAG$1&&eo==WRAP_REARG_FLAG$1&&to[7].length<=ue[8]||no==(WRAP_ARY_FLAG$1|WRAP_REARG_FLAG$1)&&ue[7].length<=ue[8]&&eo==WRAP_CURRY_FLAG$2;if(!(oo||io))return to;no&WRAP_BIND_FLAG$1&&(to[2]=ue[2],ro|=eo&WRAP_BIND_FLAG$1?0:WRAP_CURRY_BOUND_FLAG);var ao=ue[3];if(ao){var so=to[3];to[3]=so?composeArgs(so,ao,ue[4]):ao,to[4]=so?replaceHolders(to[3],PLACEHOLDER):ue[4]}return ao=ue[5],ao&&(so=to[5],to[5]=so?composeArgsRight(so,ao,ue[6]):ao,to[6]=so?replaceHolders(to[5],PLACEHOLDER):ue[6]),ao=ue[7],ao&&(to[7]=ao),no&WRAP_ARY_FLAG$1&&(to[8]=to[8]==null?ue[8]:nativeMin(to[8],ue[8])),to[9]==null&&(to[9]=ue[9]),to[0]=ue[0],to[1]=ro,to}var _mergeData=mergeData$1,reWhitespace=/\s/;function trimmedEndIndex$1(to){for(var ue=to.length;ue--&&reWhitespace.test(to.charAt(ue)););return ue}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=_trimmedEndIndex,reTrimStart=/^\s+/;function baseTrim$1(to){return to&&to.slice(0,trimmedEndIndex(to)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseTrim=_baseTrim,isObject$3=isObject_1,isSymbol$2=isSymbol_1,NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$1(to){if(typeof to=="number")return to;if(isSymbol$2(to))return NAN;if(isObject$3(to)){var ue=typeof to.valueOf=="function"?to.valueOf():to;to=isObject$3(ue)?ue+"":ue}if(typeof to!="string")return to===0?to:+to;to=baseTrim(to);var eo=reIsBinary.test(to);return eo||reIsOctal.test(to)?freeParseInt(to.slice(2),eo?2:8):reIsBadHex.test(to)?NAN:+to}var toNumber_1=toNumber$1,toNumber=toNumber_1,INFINITY=1/0,MAX_INTEGER=17976931348623157e292;function toFinite$1(to){if(!to)return to===0?to:0;if(to=toNumber(to),to===INFINITY||to===-INFINITY){var ue=to<0?-1:1;return ue*MAX_INTEGER}return to===to?to:0}var toFinite_1=toFinite$1,toFinite=toFinite_1;function toInteger$1(to){var ue=toFinite(to),eo=ue%1;return ue===ue?eo?ue-eo:ue:0}var toInteger_1=toInteger$1,baseSetData=_baseSetData,createBind=_createBind,createCurry=_createCurry,createHybrid=_createHybrid,createPartial=_createPartial,getData=_getData,mergeData=_mergeData,setData=_setData,setWrapToString=_setWrapToString,toInteger=toInteger_1,FUNC_ERROR_TEXT="Expected a function",WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_FLAG$1=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,nativeMax$1=Math.max;function createWrap$3(to,ue,eo,no,ro,oo,io,ao){var so=ue&WRAP_BIND_KEY_FLAG;if(!so&&typeof to!="function")throw new TypeError(FUNC_ERROR_TEXT);var lo=no?no.length:0;if(lo||(ue&=~(WRAP_PARTIAL_FLAG|WRAP_PARTIAL_RIGHT_FLAG),no=ro=void 0),io=io===void 0?io:nativeMax$1(toInteger(io),0),ao=ao===void 0?ao:toInteger(ao),lo-=ro?ro.length:0,ue&WRAP_PARTIAL_RIGHT_FLAG){var co=no,uo=ro;no=ro=void 0}var fo=so?void 0:getData(to),po=[to,ue,eo,no,ro,co,uo,oo,io,ao];if(fo&&mergeData(po,fo),to=po[0],ue=po[1],eo=po[2],no=po[3],ro=po[4],ao=po[9]=po[9]===void 0?so?0:to.length:nativeMax$1(po[9]-lo,0),!ao&&ue&(WRAP_CURRY_FLAG$1|WRAP_CURRY_RIGHT_FLAG)&&(ue&=~(WRAP_CURRY_FLAG$1|WRAP_CURRY_RIGHT_FLAG)),!ue||ue==WRAP_BIND_FLAG)var ho=createBind(to,ue,eo);else ue==WRAP_CURRY_FLAG$1||ue==WRAP_CURRY_RIGHT_FLAG?ho=createCurry(to,ue,ao):(ue==WRAP_PARTIAL_FLAG||ue==(WRAP_BIND_FLAG|WRAP_PARTIAL_FLAG))&&!ro.length?ho=createPartial(to,ue,eo,no):ho=createHybrid.apply(void 0,po);var _o=fo?baseSetData:setData;return setWrapToString(_o(ho,po),to,ue)}var _createWrap=createWrap$3,createWrap$2=_createWrap,WRAP_ARY_FLAG=128;function ary(to,ue,eo){return ue=eo?void 0:ue,ue=to&&ue==null?to.length:ue,createWrap$2(to,WRAP_ARY_FLAG,void 0,void 0,void 0,void 0,ue)}var ary_1=ary,baseAssignValue$1=_baseAssignValue,eq=eq_1,objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function assignValue$2(to,ue,eo){var no=to[ue];(!(hasOwnProperty$3.call(to,ue)&&eq(no,eo))||eo===void 0&&!(ue in to))&&baseAssignValue$1(to,ue,eo)}var _assignValue=assignValue$2,assignValue$1=_assignValue,baseAssignValue=_baseAssignValue;function copyObject$4(to,ue,eo,no){var ro=!eo;eo||(eo={});for(var oo=-1,io=ue.length;++oo<io;){var ao=ue[oo],so=no?no(eo[ao],to[ao],ao,eo,to):void 0;so===void 0&&(so=to[ao]),ro?baseAssignValue(eo,ao,so):assignValue$1(eo,ao,so)}return eo}var _copyObject=copyObject$4,copyObject$3=_copyObject,keys$1=keys_1;function baseAssign$1(to,ue){return to&©Object$3(ue,keys$1(ue),to)}var _baseAssign=baseAssign$1;function nativeKeysIn$1(to){var ue=[];if(to!=null)for(var eo in Object(to))ue.push(eo);return ue}var _nativeKeysIn=nativeKeysIn$1,isObject$2=isObject_1,isPrototype$1=_isPrototype,nativeKeysIn=_nativeKeysIn,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeysIn$1(to){if(!isObject$2(to))return nativeKeysIn(to);var ue=isPrototype$1(to),eo=[];for(var no in to)no=="constructor"&&(ue||!hasOwnProperty$2.call(to,no))||eo.push(no);return eo}var _baseKeysIn=baseKeysIn$1,arrayLikeKeys=_arrayLikeKeys,baseKeysIn=_baseKeysIn,isArrayLike=isArrayLike_1;function keysIn$3(to){return isArrayLike(to)?arrayLikeKeys(to,!0):baseKeysIn(to)}var keysIn_1=keysIn$3,copyObject$2=_copyObject,keysIn$2=keysIn_1;function baseAssignIn$1(to,ue){return to&©Object$2(ue,keysIn$2(ue),to)}var _baseAssignIn=baseAssignIn$1,_cloneBuffer={exports:{}};_cloneBuffer.exports;(function(to,ue){var eo=_root,no=ue&&!ue.nodeType&&ue,ro=no&&!0&&to&&!to.nodeType&&to,oo=ro&&ro.exports===no,io=oo?eo.Buffer:void 0,ao=io?io.allocUnsafe:void 0;function so(lo,co){if(co)return lo.slice();var uo=lo.length,fo=ao?ao(uo):new lo.constructor(uo);return lo.copy(fo),fo}to.exports=so})(_cloneBuffer,_cloneBuffer.exports);var _cloneBufferExports=_cloneBuffer.exports,copyObject$1=_copyObject,getSymbols$1=_getSymbols;function copySymbols$1(to,ue){return copyObject$1(to,getSymbols$1(to),ue)}var _copySymbols=copySymbols$1,overArg=_overArg,getPrototype$3=overArg(Object.getPrototypeOf,Object),_getPrototype=getPrototype$3,arrayPush$1=_arrayPush,getPrototype$2=_getPrototype,getSymbols=_getSymbols,stubArray=stubArray_1,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn$2=nativeGetSymbols?function(to){for(var ue=[];to;)arrayPush$1(ue,getSymbols(to)),to=getPrototype$2(to);return ue}:stubArray,_getSymbolsIn=getSymbolsIn$2,copyObject=_copyObject,getSymbolsIn$1=_getSymbolsIn;function copySymbolsIn$1(to,ue){return copyObject(to,getSymbolsIn$1(to),ue)}var _copySymbolsIn=copySymbolsIn$1,baseGetAllKeys=_baseGetAllKeys,getSymbolsIn=_getSymbolsIn,keysIn$1=keysIn_1;function getAllKeysIn$1(to){return baseGetAllKeys(to,keysIn$1,getSymbolsIn)}var _getAllKeysIn=getAllKeysIn$1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function initCloneArray$1(to){var ue=to.length,eo=new to.constructor(ue);return ue&&typeof to[0]=="string"&&hasOwnProperty$1.call(to,"index")&&(eo.index=to.index,eo.input=to.input),eo}var _initCloneArray=initCloneArray$1,Uint8Array$1=_Uint8Array;function cloneArrayBuffer$3(to){var ue=new to.constructor(to.byteLength);return new Uint8Array$1(ue).set(new Uint8Array$1(to)),ue}var _cloneArrayBuffer=cloneArrayBuffer$3,cloneArrayBuffer$2=_cloneArrayBuffer;function cloneDataView$1(to,ue){var eo=ue?cloneArrayBuffer$2(to.buffer):to.buffer;return new to.constructor(eo,to.byteOffset,to.byteLength)}var _cloneDataView=cloneDataView$1,reFlags=/\w*$/;function cloneRegExp$1(to){var ue=new to.constructor(to.source,reFlags.exec(to));return ue.lastIndex=to.lastIndex,ue}var _cloneRegExp=cloneRegExp$1,Symbol$2=_Symbol,symbolProto=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneSymbol$1(to){return symbolValueOf?Object(symbolValueOf.call(to)):{}}var _cloneSymbol=cloneSymbol$1,cloneArrayBuffer$1=_cloneArrayBuffer;function cloneTypedArray$1(to,ue){var eo=ue?cloneArrayBuffer$1(to.buffer):to.buffer;return new to.constructor(eo,to.byteOffset,to.length)}var _cloneTypedArray=cloneTypedArray$1,cloneArrayBuffer=_cloneArrayBuffer,cloneDataView=_cloneDataView,cloneRegExp=_cloneRegExp,cloneSymbol=_cloneSymbol,cloneTypedArray=_cloneTypedArray,boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag$1(to,ue,eo){var no=to.constructor;switch(ue){case arrayBufferTag$1:return cloneArrayBuffer(to);case boolTag$1:case dateTag$1:return new no(+to);case dataViewTag$1:return cloneDataView(to,eo);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(to,eo);case mapTag$2:return new no;case numberTag$1:case stringTag$1:return new no(to);case regexpTag$1:return cloneRegExp(to);case setTag$2:return new no;case symbolTag$1:return cloneSymbol(to)}}var _initCloneByTag=initCloneByTag$1,baseCreate=_baseCreate,getPrototype$1=_getPrototype,isPrototype=_isPrototype;function initCloneObject$1(to){return typeof to.constructor=="function"&&!isPrototype(to)?baseCreate(getPrototype$1(to)):{}}var _initCloneObject=initCloneObject$1,getTag$3=_getTag,isObjectLike$4=isObjectLike_1,mapTag$1="[object Map]";function baseIsMap$1(to){return isObjectLike$4(to)&&getTag$3(to)==mapTag$1}var _baseIsMap=baseIsMap$1,baseIsMap=_baseIsMap,baseUnary$1=_baseUnary,nodeUtil$1=_nodeUtilExports,nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap$2=nodeIsMap?baseUnary$1(nodeIsMap):baseIsMap,isMap_1=isMap$2,getTag$2=_getTag,isObjectLike$3=isObjectLike_1,setTag$1="[object Set]";function baseIsSet$1(to){return isObjectLike$3(to)&&getTag$2(to)==setTag$1}var _baseIsSet=baseIsSet$1,baseIsSet=_baseIsSet,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet$2=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet_1=isSet$2,Stack=_Stack,arrayEach=_arrayEach,assignValue=_assignValue,baseAssign=_baseAssign,baseAssignIn=_baseAssignIn,cloneBuffer=_cloneBufferExports,copyArray$1=_copyArray,copySymbols=_copySymbols,copySymbolsIn=_copySymbolsIn,getAllKeys=_getAllKeys,getAllKeysIn=_getAllKeysIn,getTag$1=_getTag,initCloneArray=_initCloneArray,initCloneByTag=_initCloneByTag,initCloneObject=_initCloneObject,isArray$6=isArray_1,isBuffer$1=isBufferExports,isMap$1=isMap_1,isObject$1=isObject_1,isSet$1=isSet_1,keys=keys_1,keysIn=keysIn_1,CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$1=4,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag$1="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag$1]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0;cloneableTags[errorTag$1]=cloneableTags[funcTag]=cloneableTags[weakMapTag$1]=!1;function baseClone$2(to,ue,eo,no,ro,oo){var io,ao=ue&CLONE_DEEP_FLAG$1,so=ue&CLONE_FLAT_FLAG,lo=ue&CLONE_SYMBOLS_FLAG$1;if(eo&&(io=ro?eo(to,no,ro,oo):eo(to)),io!==void 0)return io;if(!isObject$1(to))return to;var co=isArray$6(to);if(co){if(io=initCloneArray(to),!ao)return copyArray$1(to,io)}else{var uo=getTag$1(to),fo=uo==funcTag||uo==genTag;if(isBuffer$1(to))return cloneBuffer(to,ao);if(uo==objectTag$1||uo==argsTag||fo&&!ro){if(io=so||fo?{}:initCloneObject(to),!ao)return so?copySymbolsIn(to,baseAssignIn(io,to)):copySymbols(to,baseAssign(io,to))}else{if(!cloneableTags[uo])return ro?to:{};io=initCloneByTag(to,uo,ao)}}oo||(oo=new Stack);var po=oo.get(to);if(po)return po;oo.set(to,io),isSet$1(to)?to.forEach(function(go){io.add(baseClone$2(go,ue,eo,go,to,oo))}):isMap$1(to)&&to.forEach(function(go,bo){io.set(bo,baseClone$2(go,ue,eo,bo,to,oo))});var ho=lo?so?getAllKeysIn:getAllKeys:so?keysIn:keys,_o=co?void 0:ho(to);return arrayEach(_o||to,function(go,bo){_o&&(bo=go,go=to[bo]),assignValue(io,bo,baseClone$2(go,ue,eo,bo,to,oo))}),io}var _baseClone=baseClone$2,baseClone$1=_baseClone,CLONE_SYMBOLS_FLAG=4;function clone(to){return baseClone$1(to,CLONE_SYMBOLS_FLAG)}var clone_1=clone,createWrap$1=_createWrap,WRAP_CURRY_FLAG=8;function curry(to,ue,eo){ue=eo?void 0:ue;var no=createWrap$1(to,WRAP_CURRY_FLAG,void 0,void 0,void 0,void 0,void 0,ue);return no.placeholder=curry.placeholder,no}curry.placeholder={};var curry_1=curry,baseGetTag$1=_baseGetTag,getPrototype=_getPrototype,isObjectLike$2=isObjectLike_1,objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject$1(to){if(!isObjectLike$2(to)||baseGetTag$1(to)!=objectTag)return!1;var ue=getPrototype(to);if(ue===null)return!0;var eo=hasOwnProperty.call(ue,"constructor")&&ue.constructor;return typeof eo=="function"&&eo instanceof eo&&funcToString.call(eo)==objectCtorString}var isPlainObject_1=isPlainObject$1,baseGetTag=_baseGetTag,isObjectLike$1=isObjectLike_1,isPlainObject=isPlainObject_1,domExcTag="[object DOMException]",errorTag="[object Error]";function isError$1(to){if(!isObjectLike$1(to))return!1;var ue=baseGetTag(to);return ue==errorTag||ue==domExcTag||typeof to.message=="string"&&typeof to.name=="string"&&!isPlainObject(to)}var isError_1=isError$1,getTag=_getTag,isObjectLike=isObjectLike_1,weakMapTag="[object WeakMap]";function isWeakMap$1(to){return isObjectLike(to)&&getTag(to)==weakMapTag}var isWeakMap_1=isWeakMap$1,baseClone=_baseClone,baseIteratee=_baseIteratee,CLONE_DEEP_FLAG=1;function iteratee(to){return baseIteratee(typeof to=="function"?to:baseClone(to,CLONE_DEEP_FLAG))}var iteratee_1=iteratee,Symbol$1=_Symbol,isArguments=isArguments_1,isArray$5=isArray_1,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable$1(to){return isArray$5(to)||isArguments(to)||!!(spreadableSymbol&&to&&to[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$1(to,ue,eo,no,ro){var oo=-1,io=to.length;for(eo||(eo=isFlattenable),ro||(ro=[]);++oo<io;){var ao=to[oo];ue>0&&eo(ao)?ue>1?baseFlatten$1(ao,ue-1,eo,no,ro):arrayPush(ro,ao):no||(ro[ro.length]=ao)}return ro}var _baseFlatten=baseFlatten$1,baseFlatten=_baseFlatten;function flatten$1(to){var ue=to==null?0:to.length;return ue?baseFlatten(to,1):[]}var flatten_1=flatten$1,apply=_apply,nativeMax=Math.max;function overRest$1(to,ue,eo){return ue=nativeMax(ue===void 0?to.length-1:ue,0),function(){for(var no=arguments,ro=-1,oo=nativeMax(no.length-ue,0),io=Array(oo);++ro<oo;)io[ro]=no[ue+ro];ro=-1;for(var ao=Array(ue+1);++ro<ue;)ao[ro]=no[ro];return ao[ue]=eo(io),apply(to,this,ao)}}var _overRest=overRest$1,flatten=flatten_1,overRest=_overRest,setToString=_setToString;function flatRest$1(to){return setToString(overRest(to,void 0,flatten),to+"")}var _flatRest=flatRest$1,createWrap=_createWrap,flatRest=_flatRest,WRAP_REARG_FLAG=256,rearg=flatRest(function(to,ue){return createWrap(to,WRAP_REARG_FLAG,void 0,void 0,void 0,ue)}),rearg_1=rearg,arrayMap=_arrayMap,copyArray=_copyArray,isArray$4=isArray_1,isSymbol$1=isSymbol_1,stringToPath$1=_stringToPath,toKey=_toKey,toString$3=toString_1;function toPath(to){return isArray$4(to)?arrayMap(to,toKey):isSymbol$1(to)?[to]:copyArray(stringToPath$1(toString$3(to)))}var toPath_1=toPath,_util={ary:ary_1,assign:_baseAssign,clone:clone_1,curry:curry_1,forEach:_arrayEach,isArray:isArray_1,isError:isError_1,isFunction:isFunction_1,isWeakMap:isWeakMap_1,iteratee:iteratee_1,keys:_baseKeys,rearg:rearg_1,toInteger:toInteger_1,toPath:toPath_1},baseConvert=_baseConvert$1,util$e=_util;function convert$1(to,ue,eo){return baseConvert(util$e,to,ue,eo)}var convert_1=convert$1,_arrayAggregator,hasRequired_arrayAggregator;function require_arrayAggregator(){if(hasRequired_arrayAggregator)return _arrayAggregator;hasRequired_arrayAggregator=1;function to(ue,eo,no,ro){for(var oo=-1,io=ue==null?0:ue.length;++oo<io;){var ao=ue[oo];eo(ro,ao,no(ao),ue)}return ro}return _arrayAggregator=to,_arrayAggregator}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var to=isArrayLike_1;function ue(eo,no){return function(ro,oo){if(ro==null)return ro;if(!to(ro))return eo(ro,oo);for(var io=ro.length,ao=no?io:-1,so=Object(ro);(no?ao--:++ao<io)&&oo(so[ao],ao,so)!==!1;);return ro}}return _createBaseEach=ue,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var to=_baseForOwn,ue=require_createBaseEach(),eo=ue(to);return _baseEach=eo,_baseEach}var _baseAggregator,hasRequired_baseAggregator;function require_baseAggregator(){if(hasRequired_baseAggregator)return _baseAggregator;hasRequired_baseAggregator=1;var to=require_baseEach();function ue(eo,no,ro,oo){return to(eo,function(io,ao,so){no(oo,io,ro(io),so)}),oo}return _baseAggregator=ue,_baseAggregator}var _createAggregator,hasRequired_createAggregator;function require_createAggregator(){if(hasRequired_createAggregator)return _createAggregator;hasRequired_createAggregator=1;var to=require_arrayAggregator(),ue=require_baseAggregator(),eo=_baseIteratee,no=isArray_1;function ro(oo,io){return function(ao,so){var lo=no(ao)?to:ue,co=io?io():{};return lo(ao,oo,eo(so),co)}}return _createAggregator=ro,_createAggregator}var groupBy_1,hasRequiredGroupBy;function requireGroupBy(){if(hasRequiredGroupBy)return groupBy_1;hasRequiredGroupBy=1;var to=_baseAssignValue,ue=require_createAggregator(),eo=Object.prototype,no=eo.hasOwnProperty,ro=ue(function(oo,io,ao){no.call(oo,ao)?oo[ao].push(io):to(oo,ao,[io])});return groupBy_1=ro,groupBy_1}var convert=convert_1,func$K=convert("groupBy",requireGroupBy());func$K.placeholder=placeholder$3;var groupBy=func$K;const groupBy$1=getDefaultExportFromCjs$1(groupBy);function handlebarsCompletions(){const to=getManifest();return Object.keys(to).flatMap(ue=>Object.entries(to[ue]).map(([eo,no])=>({text:eo,path:eo,example:no.example,label:eo,displayText:eo,description:no.description,allowsJs:!no.requiresBlock&&!helpersToRemoveForJs.includes(eo)})))}const BindingSidePanel_svelte_svelte_type_style_lang="";function get_each_context$1I(to,ue,eo){const no=to.slice();return no[37]=ue[eo],no}function get_each_context_1$s(to,ue,eo){const no=to.slice();return no[40]=ue[eo],no}function get_each_context_2$8(to,ue,eo){const no=to.slice();return no[43]=ue[eo],no}function get_each_context_3(to,ue,eo){const no=to.slice();return no[46]=ue[eo],no}function create_if_block_13$2(to){let ue,eo=to[8].description+"";return{c(){ue=element("div")},m(no,ro){insert$1(no,ue,ro),ue.innerHTML=eo},p(no,ro){ro[0]&256&&eo!==(eo=no[8].description+"")&&(ue.innerHTML=eo)},d(no){no&&detach(ue)}}}function create_if_block_12$2(to){let ue,eo=to[8].code+"";return{c(){ue=element("pre"),attr(ue,"class","svelte-jofp16")},m(no,ro){insert$1(no,ue,ro),ue.innerHTML=eo},p(no,ro){ro[0]&256&&eo!==(eo=no[8].code+"")&&(ue.innerHTML=eo)},d(no){no&&detach(ue)}}}function create_default_slot_1$3_(to){let ue,eo,no=to[8].description&&create_if_block_13$2(to),ro=to[8].code&&create_if_block_12$2(to);return{c(){ue=element("div"),no&&no.c(),eo=space$1(),ro&&ro.c(),attr(ue,"class","binding-popover svelte-jofp16"),toggle_class(ue,"helper",to[8].helper)},m(oo,io){insert$1(oo,ue,io),no&&no.m(ue,null),append$2(ue,eo),ro&&ro.m(ue,null)},p(oo,io){oo[8].description?no?no.p(oo,io):(no=create_if_block_13$2(oo),no.c(),no.m(ue,eo)):no&&(no.d(1),no=null),oo[8].code?ro?ro.p(oo,io):(ro=create_if_block_12$2(oo),ro.c(),ro.m(ue,null)):ro&&(ro.d(1),ro=null),io[0]&256&&toggle_class(ue,"helper",oo[8].helper)},d(oo){oo&&detach(ue),no&&no.d(),ro&&ro.d()}}}function create_if_block_11$4(to){let ue,eo,no,ro,oo;return eo=new Icon({props:{name:"BackAndroid",hoverable:!0,size:"S"}}),eo.$on("click",to[26]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),ro=text$1(to[4]),attr(ue,"class","header svelte-jofp16")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,no),append$2(ue,ro),oo=!0},p(io,ao){(!oo||ao[0]&16)&&set_data(ro,io[4])},i(io){oo||(transition_in(eo.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo)}}}function create_if_block_9$d(to){let ue,eo,no,ro;const oo=[create_if_block_10$7,create_else_block_1$p],io=[];function ao(so,lo){return so[5]?0:1}return eo=ao(to),no=io[eo]=oo[eo](to),{c(){ue=element("div"),no.c(),attr(ue,"class","header svelte-jofp16")},m(so,lo){insert$1(so,ue,lo),io[eo].m(ue,null),ro=!0},p(so,lo){let co=eo;eo=ao(so),eo===co?io[eo].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),no=io[eo],no?no.p(so,lo):(no=io[eo]=oo[eo](so),no.c()),transition_in(no,1),no.m(ue,null))},i(so){ro||(transition_in(no),ro=!0)},o(so){transition_out(no),ro=!1},d(so){so&&detach(ue),io[eo].d()}}}function create_else_block_1$p(to){let ue,eo,no,ro;return no=new Icon({props:{size:"S",name:"Search",hoverable:!0,newStyles:!0}}),no.$on("click",to[17]),{c(){ue=element("div"),ue.textContent="Bindings",eo=space$1(),create_component(no.$$.fragment),attr(ue,"class","title svelte-jofp16")},m(oo,io){insert$1(oo,ue,io),insert$1(oo,eo,io),mount_component(no,oo,io),ro=!0},p:noop$6,i(oo){ro||(transition_in(no.$$.fragment,oo),ro=!0)},o(oo){transition_out(no.$$.fragment,oo),ro=!1},d(oo){oo&&(detach(ue),detach(eo)),destroy_component(no,oo)}}}function create_if_block_10$7(to){let ue,eo,no,ro,oo,io;function ao(lo){to[27](lo)}let so={placeholder:"Search for bindings",autocomplete:"off",autofocus:!0};return to[3]!==void 0&&(so.value=to[3]),eo=new Input$5({props:so}),binding_callbacks.push(()=>bind$2(eo,"value",ao)),oo=new Icon({props:{size:"S",name:"Close",hoverable:!0,newStyles:!0}}),oo.$on("click",to[18]),{c(){ue=element("div"),create_component(eo.$$.fragment),ro=space$1(),create_component(oo.$$.fragment),attr(ue,"class","search-input svelte-jofp16")},m(lo,co){insert$1(lo,ue,co),mount_component(eo,ue,null),insert$1(lo,ro,co),mount_component(oo,lo,co),io=!0},p(lo,co){const uo={};!no&&co[0]&8&&(no=!0,uo.value=lo[3],add_flush_callback(()=>no=!1)),eo.$set(uo)},i(lo){io||(transition_in(eo.$$.fragment,lo),transition_in(oo.$$.fragment,lo),io=!0)},o(lo){transition_out(eo.$$.fragment,lo),transition_out(oo.$$.fragment,lo),io=!1},d(lo){lo&&(detach(ue),detach(ro)),destroy_component(eo),destroy_component(oo,lo)}}}function create_if_block_8$g(to){let ue,eo,no=ensure_array_like(to[11]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block_3(get_each_context_3(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){ue=element("ul");for(let io=0;io<ro.length;io+=1)ro[io].c();attr(ue,"class","category-list svelte-jofp16")},m(io,ao){insert$1(io,ue,ao);for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(ue,null);eo=!0},p(io,ao){if(ao[0]&6160){no=ensure_array_like(io[11]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context_3(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block_3(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue,null))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_each_block_3(to){let ue,eo,no,ro,oo=to[46]+"",io,ao,so,lo,co,uo,fo,po;eo=new Icon({props:{size:"S",color:"var(--spectrum-global-color-gray-700)",name:to[12][to[46]]}}),lo=new Icon({props:{name:"ChevronRight"}});function ho(){return to[28](to[46])}return{c(){ue=element("li"),create_component(eo.$$.fragment),no=space$1(),ro=element("span"),io=text$1(oo),ao=space$1(),so=element("span"),create_component(lo.$$.fragment),co=space$1(),attr(ro,"class","category-name svelte-jofp16"),attr(so,"class","category-chevron svelte-jofp16"),attr(ue,"class","svelte-jofp16")},m(_o,go){insert$1(_o,ue,go),mount_component(eo,ue,null),append$2(ue,no),append$2(ue,ro),append$2(ro,io),append$2(ue,ao),append$2(ue,so),mount_component(lo,so,null),append$2(ue,co),uo=!0,fo||(po=listen(ue,"click",ho),fo=!0)},p(_o,go){to=_o;const bo={};go[0]&6144&&(bo.name=to[12][to[46]]),eo.$set(bo),(!uo||go[0]&2048)&&oo!==(oo=to[46]+"")&&set_data(io,oo)},i(_o){uo||(transition_in(eo.$$.fragment,_o),transition_in(lo.$$.fragment,_o),uo=!0)},o(_o){transition_out(eo.$$.fragment,_o),transition_out(lo.$$.fragment,_o),uo=!1},d(_o){_o&&detach(ue),destroy_component(eo),destroy_component(lo),fo=!1,po()}}}function create_if_block$48(to){let ue,eo,no,ro=ensure_array_like(to[10]),oo=[];for(let so=0;so<ro.length;so+=1)oo[so]=create_each_block_1$s(get_each_context_1$s(to,ro,so));const io=so=>transition_out(oo[so],1,1,()=>{oo[so]=null});let ao=(to[4]==="Helpers"||to[3])&&create_if_block_1$2c(to);return{c(){for(let so=0;so<oo.length;so+=1)oo[so].c();ue=space$1(),ao&&ao.c(),eo=empty$2()},m(so,lo){for(let co=0;co<oo.length;co+=1)oo[co]&&oo[co].m(so,lo);insert$1(so,ue,lo),ao&&ao.m(so,lo),insert$1(so,eo,lo),no=!0},p(so,lo){if(lo[0]&46082){ro=ensure_array_like(so[10]);let co;for(co=0;co<ro.length;co+=1){const uo=get_each_context_1$s(so,ro,co);oo[co]?(oo[co].p(uo,lo),transition_in(oo[co],1)):(oo[co]=create_each_block_1$s(uo),oo[co].c(),transition_in(oo[co],1),oo[co].m(ue.parentNode,ue))}for(group_outros(),co=ro.length;co<oo.length;co+=1)io(co);check_outros()}so[4]==="Helpers"||so[3]?ao?ao.p(so,lo):(ao=create_if_block_1$2c(so),ao.c(),ao.m(eo.parentNode,eo)):ao&&(ao.d(1),ao=null)},i(so){if(!no){for(let lo=0;lo<ro.length;lo+=1)transition_in(oo[lo]);no=!0}},o(so){oo=oo.filter(Boolean);for(let lo=0;lo<oo.length;lo+=1)transition_out(oo[lo]);no=!1},d(so){so&&(detach(ue),detach(eo)),destroy_each(oo,so),ao&&ao.d(so)}}}function create_if_block_3$Z(to){let ue,eo,no,ro,oo=to[10].length>1&&create_if_block_7$l(to),io=ensure_array_like(to[40].bindings),ao=[];for(let so=0;so<io.length;so+=1)ao[so]=create_each_block_2$8(get_each_context_2$8(to,io,so));return{c(){ue=element("div"),oo&&oo.c(),eo=space$1(),no=element("ul");for(let so=0;so<ao.length;so+=1)ao[so].c();attr(no,"class","svelte-jofp16"),attr(ue,"class","sub-section svelte-jofp16")},m(so,lo){insert$1(so,ue,lo),oo&&oo.m(ue,null),append$2(ue,eo),append$2(ue,no);for(let co=0;co<ao.length;co+=1)ao[co]&&ao[co].m(no,null);ro=!0},p(so,lo){if(so[10].length>1?oo?(oo.p(so,lo),lo[0]&1024&&transition_in(oo,1)):(oo=create_if_block_7$l(so),oo.c(),transition_in(oo,1),oo.m(ue,eo)):oo&&(group_outros(),transition_out(oo,1,1,()=>{oo=null}),check_outros()),lo[0]&41986){io=ensure_array_like(so[40].bindings);let co;for(co=0;co<io.length;co+=1){const uo=get_each_context_2$8(so,io,co);ao[co]?ao[co].p(uo,lo):(ao[co]=create_each_block_2$8(uo),ao[co].c(),ao[co].m(no,null))}for(;co<ao.length;co+=1)ao[co].d(1);ao.length=io.length}},i(so){ro||(transition_in(oo),ro=!0)},o(so){transition_out(oo),ro=!1},d(so){so&&detach(ue),oo&&oo.d(),destroy_each(ao,so)}}}function create_if_block_7$l(to){let ue,eo,no=to[40].name+"",ro,oo;return eo=new Icon({props:{name:to[12][to[40].name]}}),{c(){ue=element("div"),create_component(eo.$$.fragment),ro=text$1(no),attr(ue,"class","cat-heading svelte-jofp16")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,ro),oo=!0},p(io,ao){const so={};ao[0]&5120&&(so.name=io[12][io[40].name]),eo.$set(so),(!oo||ao[0]&1024)&&no!==(no=io[40].name+"")&&set_data(ro,no)},i(io){oo||(transition_in(eo.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo)}}}function create_else_block$1C(to){let ue=to[43].readableBinding+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&1024&&ue!==(ue=no[43].readableBinding+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_if_block_6$o(to){var no;let ue=((no=to[43].fieldSchema)==null?void 0:no.name)+"",eo;return{c(){eo=text$1(ue)},m(ro,oo){insert$1(ro,eo,oo)},p(ro,oo){var io;oo[0]&1024&&ue!==(ue=((io=ro[43].fieldSchema)==null?void 0:io.name)+"")&&set_data(eo,ue)},d(ro){ro&&detach(eo)}}}function create_if_block_5$w(to){let ue=to[43].display.name+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&1024&&ue!==(ue=no[43].display.name+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_if_block_4$I(to){var oo,io;let ue,eo,no=(((oo=to[43].display)==null?void 0:oo.type)||((io=to[43].fieldSchema)==null?void 0:io.type))+"",ro;return{c(){ue=element("span"),eo=element("span"),ro=text$1(no),attr(eo,"class","binding__type svelte-jofp16"),attr(ue,"class","binding__typeWrap svelte-jofp16")},m(ao,so){insert$1(ao,ue,so),append$2(ue,eo),append$2(eo,ro)},p(ao,so){var lo,co;so[0]&1024&&no!==(no=(((lo=ao[43].display)==null?void 0:lo.type)||((co=ao[43].fieldSchema)==null?void 0:co.type))+"")&&set_data(ro,no)},d(ao){ao&&detach(ue)}}}function create_each_block_2$8(to){var fo,po;let ue,eo,no,ro,oo;function io(ho,_o){var go,bo;return(go=ho[43].display)!=null&&go.name?create_if_block_5$w:(bo=ho[43].fieldSchema)!=null&&bo.name?create_if_block_6$o:create_else_block$1C}let ao=io(to),so=ao(to),lo=(((fo=to[43].display)==null?void 0:fo.type)||((po=to[43].fieldSchema)==null?void 0:po.type))&&create_if_block_4$I(to);function co(...ho){return to[29](to[43],...ho)}function uo(){return to[30](to[43])}return{c(){ue=element("li"),eo=element("span"),so.c(),no=space$1(),lo&&lo.c(),attr(eo,"class","binding__label svelte-jofp16"),attr(ue,"class","binding svelte-jofp16")},m(ho,_o){insert$1(ho,ue,_o),append$2(ue,eo),so.m(eo,null),append$2(ue,no),lo&&lo.m(ue,null),ro||(oo=[listen(ue,"mouseenter",co),listen(ue,"mouseleave",to[15]),listen(ue,"click",uo)],ro=!0)},p(ho,_o){var go,bo;to=ho,ao===(ao=io(to))&&so?so.p(to,_o):(so.d(1),so=ao(to),so&&(so.c(),so.m(eo,null))),(go=to[43].display)!=null&&go.type||(bo=to[43].fieldSchema)!=null&&bo.type?lo?lo.p(to,_o):(lo=create_if_block_4$I(to),lo.c(),lo.m(ue,null)):lo&&(lo.d(1),lo=null)},d(ho){ho&&detach(ue),so.d(),lo&&lo.d(),ro=!1,run_all(oo)}}}function create_each_block_1$s(to){var ro;let ue,eo,no=((ro=to[40].bindings)==null?void 0:ro.length)&&create_if_block_3$Z(to);return{c(){no&&no.c(),ue=empty$2()},m(oo,io){no&&no.m(oo,io),insert$1(oo,ue,io),eo=!0},p(oo,io){var ao;(ao=oo[40].bindings)!=null&&ao.length?no?(no.p(oo,io),io[0]&1024&&transition_in(no,1)):(no=create_if_block_3$Z(oo),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(oo){eo||(transition_in(no),eo=!0)},o(oo){transition_out(no),eo=!1},d(oo){oo&&detach(ue),no&&no.d(oo)}}}function create_if_block_1$2c(to){var no;let ue,eo=((no=to[9])==null?void 0:no.length)&&create_if_block_2$1m(to);return{c(){eo&&eo.c(),ue=empty$2()},m(ro,oo){eo&&eo.m(ro,oo),insert$1(ro,ue,oo)},p(ro,oo){var io;(io=ro[9])!=null&&io.length?eo?eo.p(ro,oo):(eo=create_if_block_2$1m(ro),eo.c(),eo.m(ue.parentNode,ue)):eo&&(eo.d(1),eo=null)},d(ro){ro&&detach(ue),eo&&eo.d(ro)}}}function create_if_block_2$1m(to){let ue,eo,no=ensure_array_like(to[9]),ro=[];for(let oo=0;oo<no.length;oo+=1)ro[oo]=create_each_block$1I(get_each_context$1I(to,no,oo));return{c(){ue=element("div"),eo=element("ul");for(let oo=0;oo<ro.length;oo+=1)ro[oo].c();attr(eo,"class","helpers svelte-jofp16"),attr(ue,"class","sub-section svelte-jofp16")},m(oo,io){insert$1(oo,ue,io),append$2(ue,eo);for(let ao=0;ao<ro.length;ao+=1)ro[ao]&&ro[ao].m(eo,null)},p(oo,io){if(io[0]&49669){no=ensure_array_like(oo[9]);let ao;for(ao=0;ao<no.length;ao+=1){const so=get_each_context$1I(oo,no,ao);ro[ao]?ro[ao].p(so,io):(ro[ao]=create_each_block$1I(so),ro[ao].c(),ro[ao].m(eo,null))}for(;ao<ro.length;ao+=1)ro[ao].d(1);ro.length=no.length}},d(oo){oo&&detach(ue),destroy_each(ro,oo)}}}function create_each_block$1I(to){let ue,eo,no=to[37].displayText+"",ro,oo,io,ao,so,lo;function co(...fo){return to[31](to[37],...fo)}function uo(){return to[32](to[37])}return{c(){ue=element("li"),eo=element("span"),ro=text$1(no),oo=space$1(),io=element("span"),io.innerHTML='<span class="binding__type svelte-jofp16">function</span>',ao=space$1(),attr(eo,"class","binding__label svelte-jofp16"),attr(io,"class","binding__typeWrap svelte-jofp16"),attr(ue,"class","binding svelte-jofp16")},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),append$2(eo,ro),append$2(ue,oo),append$2(ue,io),append$2(ue,ao),so||(lo=[listen(ue,"mouseenter",co),listen(ue,"mouseleave",to[15]),listen(ue,"click",uo)],so=!0)},p(fo,po){to=fo,po[0]&512&&no!==(no=to[37].displayText+"")&&set_data(ro,no)},d(fo){fo&&detach(ue),so=!1,run_all(lo)}}}function create_default_slot$5G(to){let ue,eo,no,ro,oo,io=to[4]&&create_if_block_11$4(to),ao=!to[4]&&create_if_block_9$d(to),so=!to[4]&&!to[3]&&create_if_block_8$g(to),lo=(to[4]||to[3])&&create_if_block$48(to);return{c(){io&&io.c(),ue=space$1(),ao&&ao.c(),eo=space$1(),so&&so.c(),no=space$1(),lo&&lo.c(),ro=empty$2()},m(co,uo){io&&io.m(co,uo),insert$1(co,ue,uo),ao&&ao.m(co,uo),insert$1(co,eo,uo),so&&so.m(co,uo),insert$1(co,no,uo),lo&&lo.m(co,uo),insert$1(co,ro,uo),oo=!0},p(co,uo){co[4]?io?(io.p(co,uo),uo[0]&16&&transition_in(io,1)):(io=create_if_block_11$4(co),io.c(),transition_in(io,1),io.m(ue.parentNode,ue)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros()),co[4]?ao&&(group_outros(),transition_out(ao,1,1,()=>{ao=null}),check_outros()):ao?(ao.p(co,uo),uo[0]&16&&transition_in(ao,1)):(ao=create_if_block_9$d(co),ao.c(),transition_in(ao,1),ao.m(eo.parentNode,eo)),!co[4]&&!co[3]?so?(so.p(co,uo),uo[0]&24&&transition_in(so,1)):(so=create_if_block_8$g(co),so.c(),transition_in(so,1),so.m(no.parentNode,no)):so&&(group_outros(),transition_out(so,1,1,()=>{so=null}),check_outros()),co[4]||co[3]?lo?(lo.p(co,uo),uo[0]&24&&transition_in(lo,1)):(lo=create_if_block$48(co),lo.c(),transition_in(lo,1),lo.m(ro.parentNode,ro)):lo&&(group_outros(),transition_out(lo,1,1,()=>{lo=null}),check_outros())},i(co){oo||(transition_in(io),transition_in(ao),transition_in(so),transition_in(lo),oo=!0)},o(co){transition_out(io),transition_out(ao),transition_out(so),transition_out(lo),oo=!1},d(co){co&&(detach(ue),detach(eo),detach(no),detach(ro)),io&&io.d(co),ao&&ao.d(co),so&&so.d(co),lo&&lo.d(co)}}}function create_fragment$8P(to){let ue,eo,no,ro,oo,io={align:"left-outside",anchor:to[7],minWidth:0,maxWidth:480,maxHeight:480,dismissible:!1,$$slots:{default:[create_default_slot_1$3_]},$$scope:{ctx:to}};return ue=new Popover({props:io}),to[25](ue),ue.$on("mouseenter",to[16]),ue.$on("mouseleave",to[15]),ro=new Layout$n({props:{noPadding:!0,gap:"S",$$slots:{default:[create_default_slot$5G]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment),eo=space$1(),no=element("div"),create_component(ro.$$.fragment),attr(no,"class","binding-side-panel svelte-jofp16")},m(ao,so){mount_component(ue,ao,so),insert$1(ao,eo,so),insert$1(ao,no,so),mount_component(ro,no,null),oo=!0},p(ao,so){const lo={};so[0]&128&&(lo.anchor=ao[7]),so[0]&256|so[1]&262144&&(lo.$$scope={dirty:so,ctx:ao}),ue.$set(lo);const co={};so[0]&7743|so[1]&262144&&(co.$$scope={dirty:so,ctx:ao}),ro.$set(co)},i(ao){oo||(transition_in(ue.$$.fragment,ao),transition_in(ro.$$.fragment,ao),oo=!0)},o(ao){transition_out(ue.$$.fragment,ao),transition_out(ro.$$.fragment,ao),oo=!1},d(ao){ao&&(detach(eo),detach(no)),to[25](null),destroy_component(ue,ao),destroy_component(ro)}}}function instance$8P(to,ue,eo){let no,ro,oo,io,ao,so,lo,{addHelper:co}=ue,{addBinding:uo}=ue,{bindings:fo}=ue,{mode:po}=ue,{allowHelpers:ho}=ue,{context:_o=null}=ue,go="",bo=!1,vo,yo,wo,ko=handlebarsCompletions(),So,Ao;const Io=(Ko,ra)=>{let ea=Ko.example||"";return ra&&(ea=convertToJS(ea).split(`
|
|
888
|
-
`)[0].split("= ")[1],ea==="null;"&&(ea="")),ea||""},Eo=Ko=>{let ra=[...Ko.map(ea=>ea[0])];return ho&&ra.push("Helpers"),ra},To=(Ko,ra)=>{!_o||!Ko.value||Ko.value===""||(Fo(),eo(7,yo=ra),eo(8,wo={helper:!1,code:Ko.valueHTML}),vo.show())},Mo=(Ko,ra)=>{Fo(),!(!Ko.displayText&&Ko.description)&&(eo(7,yo=ra),eo(8,wo={helper:!0,description:Ko.description,code:Io(Ko,po.name==="javascript")}),vo.show())},Vo=()=>{Ao=setTimeout(()=>{vo.hide(),eo(7,yo=null),eo(8,wo=null),Ao=null},100)},Fo=()=>{Ao&&(clearTimeout(Ao),Ao=null)},Po=async()=>{eo(5,bo=!0),eo(3,go="")},Ro=Ko=>{Ko.stopPropagation(),eo(5,bo=!1),eo(3,go="")};function Do(Ko){binding_callbacks[Ko?"unshift":"push"](()=>{vo=Ko,eo(6,vo)})}const Uo=()=>eo(4,So=null);function qo(Ko){go=Ko,eo(3,go)}const xo=Ko=>{eo(4,So=Ko)},Zo=(Ko,ra)=>To(Ko,ra.target),Xo=Ko=>uo(Ko),Yo=(Ko,ra)=>Mo(Ko,ra.target),Qo=Ko=>co(Ko,po.name==="javascript");return to.$$set=Ko=>{"addHelper"in Ko&&eo(0,co=Ko.addHelper),"addBinding"in Ko&&eo(1,uo=Ko.addBinding),"bindings"in Ko&&eo(19,fo=Ko.bindings),"mode"in Ko&&eo(2,po=Ko.mode),"allowHelpers"in Ko&&eo(20,ho=Ko.allowHelpers),"context"in Ko&&eo(21,_o=Ko.context)},to.$$.update=()=>{to.$$.dirty[0]&524288&&eo(24,no=fo==null?void 0:fo.reduce((Ko,ra)=>(ra.icon&&(Ko[ra.category]=Ko[ra.category]||ra.icon),Ko),{})),to.$$.dirty[0]&16777216&&eo(12,ro={...no,Helpers:"MagicWand"}),to.$$.dirty[0]&524288&&eo(23,oo=Object.entries(groupBy$1("category",fo))),to.$$.dirty[0]&8388608&&eo(11,io=Eo(oo)),to.$$.dirty[0]&8&&eo(22,ao=new RegExp(go,"ig")),to.$$.dirty[0]&12582936&&eo(10,so=oo.map(([Ko,ra])=>({name:Ko,bindings:ra==null?void 0:ra.filter(ea=>!go||ea.readableBinding.match(ao))})).filter(Ko=>{var ra;return((ra=Ko.bindings)==null?void 0:ra.length)>0&&(So?So===Ko.name:!0)})),to.$$.dirty[0]&4194316&&eo(9,lo=ko==null?void 0:ko.filter(Ko=>(!go||Ko.label.match(ao)||Ko.description.match(ao))&&(po.name!=="javascript"||Ko.allowsJs)))},[co,uo,po,go,So,bo,vo,yo,wo,lo,so,io,ro,To,Mo,Vo,Fo,Po,Ro,fo,ho,_o,ao,oo,no,Do,Uo,qo,xo,Zo,Xo,Yo,Qo]}class BindingSidePanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8P,create_fragment$8P,safe_not_equal,{addHelper:0,addBinding:1,bindings:19,mode:2,allowHelpers:20,context:21},null,[-1,-1])}}const EvaluationSidePanel_svelte_svelte_type_style_lang="";function get_each_context$1H(to,ue,eo){const no=to.slice();return no[13]=ue[eo],no}function create_else_block_1$o(to){let ue,eo,no,ro,oo,io,ao,so=to[1]&&create_if_block_8$f(),lo=!to[2]&&create_if_block_7$k(to);return{c(){ue=element("div"),ue.textContent="Preview",eo=space$1(),so&&so.c(),no=space$1(),ro=element("span"),oo=space$1(),lo&&lo.c(),io=empty$2(),attr(ro,"class","svelte-15nqcli")},m(co,uo){insert$1(co,ue,uo),insert$1(co,eo,uo),so&&so.m(co,uo),insert$1(co,no,uo),insert$1(co,ro,uo),insert$1(co,oo,uo),lo&&lo.m(co,uo),insert$1(co,io,uo),ao=!0},p(co,uo){co[1]?so?uo&2&&transition_in(so,1):(so=create_if_block_8$f(),so.c(),transition_in(so,1),so.m(no.parentNode,no)):so&&(group_outros(),transition_out(so,1,1,()=>{so=null}),check_outros()),co[2]?lo&&(group_outros(),transition_out(lo,1,1,()=>{lo=null}),check_outros()):lo?(lo.p(co,uo),uo&4&&transition_in(lo,1)):(lo=create_if_block_7$k(co),lo.c(),transition_in(lo,1),lo.m(io.parentNode,io))},i(co){ao||(transition_in(so),transition_in(lo),ao=!0)},o(co){transition_out(so),transition_out(lo),ao=!1},d(co){co&&(detach(ue),detach(eo),detach(no),detach(ro),detach(oo),detach(io)),so&&so.d(co),lo&&lo.d(co)}}}function create_if_block_5$v(to){let ue,eo,no,ro,oo,io,ao,so,lo;ue=new Icon({props:{name:"Alert",color:"var(--error-content)"}});let co=to[1]&&create_if_block_6$n();return so=new Icon({props:{name:"Copy",size:"S",hoverable:!0}}),so.$on("click",to[8]),{c(){create_component(ue.$$.fragment),eo=space$1(),no=element("div"),no.textContent="Error",ro=space$1(),co&&co.c(),oo=space$1(),io=element("span"),ao=space$1(),create_component(so.$$.fragment),attr(io,"class","svelte-15nqcli")},m(uo,fo){mount_component(ue,uo,fo),insert$1(uo,eo,fo),insert$1(uo,no,fo),insert$1(uo,ro,fo),co&&co.m(uo,fo),insert$1(uo,oo,fo),insert$1(uo,io,fo),insert$1(uo,ao,fo),mount_component(so,uo,fo),lo=!0},p(uo,fo){uo[1]?co?fo&2&&transition_in(co,1):(co=create_if_block_6$n(),co.c(),transition_in(co,1),co.m(oo.parentNode,oo)):co&&(group_outros(),transition_out(co,1,1,()=>{co=null}),check_outros())},i(uo){lo||(transition_in(ue.$$.fragment,uo),transition_in(co),transition_in(so.$$.fragment,uo),lo=!0)},o(uo){transition_out(ue.$$.fragment,uo),transition_out(co),transition_out(so.$$.fragment,uo),lo=!1},d(uo){uo&&(detach(eo),detach(no),detach(ro),detach(oo),detach(io),detach(ao)),destroy_component(ue,uo),co&&co.d(uo),destroy_component(so,uo)}}}function create_if_block_8$f(to){let ue,eo,no,ro;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),ro=!0},i(oo){ro||(transition_in(eo.$$.fragment,oo),oo&&add_render_callback(()=>{ro&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!0)),no.run(1))}),ro=!0)},o(oo){transition_out(eo.$$.fragment,oo),oo&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!1)),no.run(0)),ro=!1},d(oo){oo&&detach(ue),destroy_component(eo),oo&&no&&no.end()}}}function create_if_block_7$k(to){let ue,eo;return ue=new Icon({props:{name:"Copy",newStyles:!0,size:"S",hoverable:!0}}),ue.$on("click",to[8]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_6$n(to){let ue,eo,no,ro;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),ro=!0},i(oo){ro||(transition_in(eo.$$.fragment,oo),oo&&add_render_callback(()=>{ro&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!0)),no.run(1))}),ro=!0)},o(oo){transition_out(eo.$$.fragment,oo),oo&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!1)),no.run(0)),ro=!1},d(oo){oo&&detach(ue),destroy_component(eo),oo&&no&&no.end()}}}function create_else_block$1B(to){let ue,eo,no,ro,oo=ensure_array_like(to[4]),io=[];for(let so=0;so<oo.length;so+=1)io[so]=create_each_block$1H(get_each_context$1H(to,oo,so));const ao=so=>transition_out(io[so],1,1,()=>{io[so]=null});return{c(){ue=element("div");for(let so=0;so<io.length;so+=1)io[so].c();eo=space$1(),no=element("div"),attr(no,"class","line svelte-15nqcli"),attr(ue,"class","output-lines svelte-15nqcli")},m(so,lo){insert$1(so,ue,lo);for(let co=0;co<io.length;co+=1)io[co]&&io[co].m(ue,null);append$2(ue,eo),append$2(ue,no),no.innerHTML=to[5],ro=!0},p(so,lo){if(lo&16){oo=ensure_array_like(so[4]);let co;for(co=0;co<oo.length;co+=1){const uo=get_each_context$1H(so,oo,co);io[co]?(io[co].p(uo,lo),transition_in(io[co],1)):(io[co]=create_each_block$1H(uo),io[co].c(),transition_in(io[co],1),io[co].m(ue,eo))}for(group_outros(),co=oo.length;co<io.length;co+=1)ao(co);check_outros()}(!ro||lo&32)&&(no.innerHTML=so[5])},i(so){if(!ro){for(let lo=0;lo<oo.length;lo+=1)transition_in(io[lo]);ro=!0}},o(so){io=io.filter(Boolean);for(let lo=0;lo<io.length;lo+=1)transition_out(io[lo]);ro=!1},d(so){so&&detach(ue),destroy_each(io,so)}}}function create_if_block_1$2b(to){let ue=to[7](to[0])+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro&1&&ue!==(ue=no[7](no[0])+"")&&set_data(eo,ue)},i:noop$6,o:noop$6,d(no){no&&detach(eo)}}}function create_if_block$47(to){let ue;return{c(){ue=text$1("Your expression will be evaluated here")},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}function create_if_block_4$H(to){let ue,eo;return ue=new Icon({props:{size:"XS",name:"Alert",color:"var(--warning-content)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_3$Y(to){let ue,eo;return ue=new Icon({props:{size:"XS",name:"CloseCircle",color:"var(--error-content)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_2$1l(to){let ue,eo,no=to[13].line+"",ro;return{c(){ue=element("span"),eo=text$1(":"),ro=text$1(no),set_style(ue,"color","var(--blue)")},m(oo,io){insert$1(oo,ue,io),append$2(ue,eo),append$2(ue,ro)},p(oo,io){io&16&&no!==(no=oo[13].line+"")&&set_data(ro,no)},d(oo){oo&&detach(ue)}}}function create_each_block$1H(to){let ue,eo,no,ro,oo,io,ao=to[13].log+"",so,lo;const co=[create_if_block_3$Y,create_if_block_4$H],uo=[];function fo(ho,_o){return ho[13].type==="error"?0:ho[13].type==="warn"?1:-1}~(no=fo(to))&&(ro=uo[no]=co[no](to));let po=to[13].line&&create_if_block_2$1l(to);return{c(){ue=element("div"),eo=element("div"),ro&&ro.c(),oo=space$1(),io=element("span"),so=space$1(),po&&po.c(),attr(eo,"class","icon-log svelte-15nqcli"),attr(ue,"class","line svelte-15nqcli"),toggle_class(ue,"error-log",to[13].type==="error"),toggle_class(ue,"warn-log",to[13].type==="warn")},m(ho,_o){insert$1(ho,ue,_o),append$2(ue,eo),~no&&uo[no].m(eo,null),append$2(eo,oo),append$2(eo,io),io.innerHTML=ao,append$2(ue,so),po&&po.m(ue,null),lo=!0},p(ho,_o){let go=no;no=fo(ho),no!==go&&(ro&&(group_outros(),transition_out(uo[go],1,1,()=>{uo[go]=null}),check_outros()),~no?(ro=uo[no],ro||(ro=uo[no]=co[no](ho),ro.c()),transition_in(ro,1),ro.m(eo,oo)):ro=null),(!lo||_o&16)&&ao!==(ao=ho[13].log+"")&&(io.innerHTML=ao),ho[13].line?po?po.p(ho,_o):(po=create_if_block_2$1l(ho),po.c(),po.m(ue,null)):po&&(po.d(1),po=null),(!lo||_o&16)&&toggle_class(ue,"error-log",ho[13].type==="error"),(!lo||_o&16)&&toggle_class(ue,"warn-log",ho[13].type==="warn")},i(ho){lo||(transition_in(ro),lo=!0)},o(ho){transition_out(ro),lo=!1},d(ho){ho&&detach(ue),~no&&uo[no].d(),po&&po.d()}}}function create_fragment$8O(to){let ue,eo,no,ro,oo,io,ao,so,lo,co;const uo=[create_if_block_5$v,create_else_block_1$o],fo=[];function po(bo,vo){return bo[3]?0:1}ro=po(to),oo=fo[ro]=uo[ro](to);const ho=[create_if_block$47,create_if_block_1$2b,create_else_block$1B],_o=[];function go(bo,vo){return bo[2]?0:bo[3]?1:2}return so=go(to),lo=_o[so]=ho[so](to),{c(){ue=element("div"),eo=element("div"),no=element("div"),oo.c(),io=space$1(),ao=element("div"),lo.c(),attr(no,"class","header-content svelte-15nqcli"),attr(eo,"class","header svelte-15nqcli"),toggle_class(eo,"success",to[6]),toggle_class(eo,"error",to[3]),attr(ao,"class","body svelte-15nqcli"),attr(ue,"class","evaluation-side-panel svelte-15nqcli")},m(bo,vo){insert$1(bo,ue,vo),append$2(ue,eo),append$2(eo,no),fo[ro].m(no,null),append$2(ue,io),append$2(ue,ao),_o[so].m(ao,null),co=!0},p(bo,[vo]){let yo=ro;ro=po(bo),ro===yo?fo[ro].p(bo,vo):(group_outros(),transition_out(fo[yo],1,1,()=>{fo[yo]=null}),check_outros(),oo=fo[ro],oo?oo.p(bo,vo):(oo=fo[ro]=uo[ro](bo),oo.c()),transition_in(oo,1),oo.m(no,null)),(!co||vo&64)&&toggle_class(eo,"success",bo[6]),(!co||vo&8)&&toggle_class(eo,"error",bo[3]);let wo=so;so=go(bo),so===wo?_o[so].p(bo,vo):(group_outros(),transition_out(_o[wo],1,1,()=>{_o[wo]=null}),check_outros(),lo=_o[so],lo?lo.p(bo,vo):(lo=_o[so]=ho[so](bo),lo.c()),transition_in(lo,1),lo.m(ao,null))},i(bo){co||(transition_in(oo),transition_in(lo),co=!0)},o(bo){transition_out(oo),transition_out(lo),co=!1},d(bo){bo&&detach(ue),fo[ro].d(),_o[so].d()}}}function instance$8O(to,ue,eo){let no,ro,oo,io,ao,{expressionResult:so=void 0}=ue,{expressionError:lo=void 0}=ue,{expressionLogs:co=[]}=ue,{evaluating:uo=!1}=ue,{expression:fo=null}=ue;const po=go=>go.code===UserScriptError.code?go.userScriptError.toString():go.toString(),ho=go=>{if(go==null)return"";try{go=JSON.stringify(JSON.parse(go),null,2)}catch{}return format$1(go,{keyColor:"#e06c75",numberColor:"#e5c07b",stringColor:"#98c379",trueColor:"#d19a66",falseColor:"#d19a66",nullColor:"#c678dd"})},_o=()=>{let go=so;typeof go=="object"&&(go=JSON.stringify(go,null,2)),copyToClipboard(go),notifications.success("Value copied to clipboard")};return to.$$set=go=>{"expressionResult"in go&&eo(9,so=go.expressionResult),"expressionError"in go&&eo(0,lo=go.expressionError),"expressionLogs"in go&&eo(10,co=go.expressionLogs),"evaluating"in go&&eo(1,uo=go.evaluating),"expression"in go&&eo(11,fo=go.expression)},to.$$.update=()=>{to.$$.dirty&1&&eo(3,no=lo!=null),to.$$.dirty&2048&&eo(2,ro=fo==null||(fo==null?void 0:fo.trim())===""),to.$$.dirty&12&&eo(6,oo=!no&&!ro),to.$$.dirty&512&&eo(5,io=ho(so)),to.$$.dirty&1024&&eo(4,ao=co.map(go=>({log:ho(go.log.join(", ")),line:go.line,type:go.type})))},[lo,uo,ro,no,ao,io,oo,po,_o,so,co,fo]}class EvaluationSidePanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8O,create_fragment$8O,safe_not_equal,{expressionResult:9,expressionError:0,expressionLogs:10,evaluating:1,expression:11})}}const SnippetDrawer_svelte_svelte_type_style_lang="";function create_else_block$1A(to){let ue,eo,no,ro,oo,io,ao;function so(uo){to[15](uo)}let lo={};to[1]!==void 0&&(lo.value=to[1]),ro=new Input$5({props:lo}),binding_callbacks.push(()=>bind$2(ro,"value",so));let co=to[6]&&create_if_block_2$1k(to);return{c(){ue=element("div"),eo=element("span"),eo.textContent="Name",no=space$1(),create_component(ro.$$.fragment),io=space$1(),co&&co.c(),attr(ue,"class","name svelte-8n6wau"),toggle_class(ue,"invalid",to[6]!=null)},m(uo,fo){insert$1(uo,ue,fo),append$2(ue,eo),append$2(ue,no),mount_component(ro,ue,null),append$2(ue,io),co&&co.m(ue,null),ao=!0},p(uo,fo){const po={};!oo&&fo&2&&(oo=!0,po.value=uo[1],add_flush_callback(()=>oo=!1)),ro.$set(po),uo[6]?co?(co.p(uo,fo),fo&64&&transition_in(co,1)):(co=create_if_block_2$1k(uo),co.c(),transition_in(co,1),co.m(ue,null)):co&&(group_outros(),transition_out(co,1,1,()=>{co=null}),check_outros()),(!ao||fo&64)&&toggle_class(ue,"invalid",uo[6]!=null)},i(uo){ao||(transition_in(ro.$$.fragment,uo),transition_in(co),ao=!0)},o(uo){transition_out(ro.$$.fragment,uo),transition_out(co),ao=!1},d(uo){uo&&detach(ue),destroy_component(ro),co&&co.d()}}}function create_if_block_1$2a(to){let ue=to[0].name+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro&1&&ue!==(ue=no[0].name+"")&&set_data(eo,ue)},i:noop$6,o:noop$6,d(no){no&&detach(eo)}}}function create_if_block_2$1k(to){let ue,eo;return ue=new AbsTooltip({props:{text:to[6],type:TooltipType.Negative,$$slots:{default:[create_default_slot_2$2R]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&64&&(oo.text=no[6]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_2$2R(to){let ue,eo;return ue=new Icon({props:{name:"Help",size:"S",color:"var(--spectrum-global-color-red-400)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_title_slot(to){let ue,eo,no,ro;const oo=[create_if_block_1$2a,create_else_block$1A],io=[];function ao(so,lo){return so[0]?0:1}return ue=ao(to),eo=io[ue]=oo[ue](to),{c(){eo.c(),no=empty$2()},m(so,lo){io[ue].m(so,lo),insert$1(so,no,lo),ro=!0},p(so,lo){let co=ue;ue=ao(so),ue===co?io[ue].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),eo=io[ue],eo?eo.p(so,lo):(eo=io[ue]=oo[ue](so),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no))},i(so){ro||(transition_in(eo),ro=!0)},o(so){transition_out(eo),ro=!1},d(so){so&&detach(no),io[ue].d(so)}}}function create_if_block$46(to){let ue,eo;return ue=new Button({props:{warning:!0,disabled:to[4],$$slots:{default:[create_default_slot_1$3Z]},$$scope:{ctx:to}}}),ue.$on("click",function(){is_function(to[5].show)&&to[5].show.apply(this,arguments)}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){to=no;const oo={};ro&16&&(oo.disabled=to[4]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:to}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$3Z(to){let ue;return{c(){ue=text$1("Delete")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot$5F(to){let ue;return{c(){ue=text$1("Save")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_buttons_slot$h(to){let ue,eo,no,ro=to[0]&&create_if_block$46(to);return eo=new Button({props:{cta:!0,disabled:!to[2]||to[4]||to[6],$$slots:{default:[create_default_slot$5F]},$$scope:{ctx:to}}}),eo.$on("click",to[8]),{c(){ro&&ro.c(),ue=space$1(),create_component(eo.$$.fragment)},m(oo,io){ro&&ro.m(oo,io),insert$1(oo,ue,io),mount_component(eo,oo,io),no=!0},p(oo,io){oo[0]?ro?(ro.p(oo,io),io&1&&transition_in(ro,1)):(ro=create_if_block$46(oo),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros());const ao={};io&84&&(ao.disabled=!oo[2]||oo[4]||oo[6]),io&1048576&&(ao.$$scope={dirty:io,ctx:oo}),eo.$set(ao)},i(oo){no||(transition_in(ro),transition_in(eo.$$.fragment,oo),no=!0)},o(oo){transition_out(ro),transition_out(eo.$$.fragment,oo),no=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo),destroy_component(eo,oo)}}}function create_tabs_slot(to){let ue,eo,no;return eo=new Input$5({props:{placeholder:"Name"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"slot","tabs")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p:noop$6,i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_key_block$i(to){let ue,eo;return ue=new BindingPanel({props:{allowHBS:!1,allowJS:!0,allowSnippets:!1,showTabBar:!1,placeholder:"return function(input) ❴ ... ❵",value:to[2],$$slots:{tabs:[create_tabs_slot]},$$scope:{ctx:to}}}),ue.$on("change",to[14]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&4&&(oo.value=no[2]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_body_slot$g(to){let ue=to[7],eo,no,ro=create_key_block$i(to);return{c(){ro.c(),eo=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,eo,io),no=!0},p(oo,io){io&128&&safe_not_equal(ue,ue=oo[7])?(group_outros(),transition_out(ro,1,1,noop$6),check_outros(),ro=create_key_block$i(oo),ro.c(),transition_in(ro,1),ro.m(eo.parentNode,eo)):ro.p(oo,io)},i(oo){no||(transition_in(ro),no=!0)},o(oo){transition_out(ro),no=!1},d(oo){oo&&detach(eo),ro.d(oo)}}}function create_fragment$8N(to){var ao;let ue,eo,no,ro,oo={$$slots:{body:[create_body_slot$g],buttons:[create_buttons_slot$h],title:[create_title_slot]},$$scope:{ctx:to}};ue=new Drawer({props:oo}),to[16](ue);let io={title:"Delete snippet",body:`Are you sure you want to delete ${(ao=to[0])==null?void 0:ao.name}?`,onOk:to[9]};return no=new ConfirmDialog({props:io}),to[17](no),{c(){create_component(ue.$$.fragment),eo=space$1(),create_component(no.$$.fragment)},m(so,lo){mount_component(ue,so,lo),insert$1(so,eo,lo),mount_component(no,so,lo),ro=!0},p(so,[lo]){var fo;const co={};lo&1048823&&(co.$$scope={dirty:lo,ctx:so}),ue.$set(co);const uo={};lo&1&&(uo.body=`Are you sure you want to delete ${(fo=so[0])==null?void 0:fo.name}?`),no.$set(uo)},i(so){ro||(transition_in(ue.$$.fragment,so),transition_in(no.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),transition_out(no.$$.fragment,so),ro=!1},d(so){so&&detach(eo),to[16](null),destroy_component(ue,so),to[17](null),destroy_component(no,so)}}}const firstCharNumberRegex=/^[0-9].*$/;function instance$8N(to,ue,eo){let no,ro,oo,io,ao;component_subscribe(to,snippets$1,Ao=>eo(13,ao=Ao));let{snippet:so}=ue;const lo=()=>uo.show(),co=()=>uo.hide();let uo,fo="",po="",ho=!1,_o;const go=async()=>{eo(4,ho=!0);try{const Ao={name:fo,code:oo};await snippets$1.saveSnippet(Ao),uo.hide(),notifications.success(`Snippet ${Ao.name} saved`)}catch(Ao){notifications.error(Ao.message||"Error saving snippet")}eo(4,ho=!1)},bo=async()=>{eo(4,ho=!0);try{await snippets$1.deleteSnippet(so.name),uo.hide()}catch{notifications.error("Error deleting snippet")}eo(4,ho=!1)},vo=(Ao,Io)=>Ao!=null&&Ao.length?!(so!=null&&so.name)&&Io.some(Eo=>Eo.name===Ao)?"That name is already in use":firstCharNumberRegex.test(Ao)?"Can't start with a number":ValidSnippetNameRegex.test(Ao)?null:"No special characters or spaces":"Name is required",yo=Ao=>eo(2,po=Ao.detail);function wo(Ao){fo=Ao,eo(1,fo),eo(0,so),eo(12,no),eo(13,ao)}function ko(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{uo=Ao,eo(3,uo)})}function So(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{_o=Ao,eo(5,_o)})}return to.$$set=Ao=>{"snippet"in Ao&&eo(0,so=Ao.snippet)},to.$$.update=()=>{to.$$.dirty&8192&&eo(12,no=getSequentialName(ao,"MySnippet",{getName:Ao=>Ao.name})),to.$$.dirty&1&&eo(7,ro=so==null?void 0:so.name),to.$$.dirty&4097&&eo(1,fo=(so==null?void 0:so.name)||no),to.$$.dirty&1&&eo(2,po=so!=null&&so.code?encodeJSBinding(so.code):""),to.$$.dirty&4&&(oo=decodeJSBinding(po)),to.$$.dirty&8194&&eo(6,io=vo(fo,ao))},[so,fo,po,uo,ho,_o,io,ro,go,bo,lo,co,no,ao,yo,wo,ko,So]}class SnippetDrawer extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8N,create_fragment$8N,safe_not_equal,{snippet:0,show:10,hide:11})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[11]}}function create_if_block$45(to){let ue,eo,no,ro,oo;const io=[create_if_block_1$29,create_if_block_2$1j],ao=[];function so(lo,co){var uo,fo;return co&6&&(ue=null),lo[1].cloud&&((fo=(uo=lo[2])==null?void 0:uo.user)!=null&&fo.accountPortalAccess)?0:(ue==null&&(ue=!!(!lo[1].cloud&&isAdmin(lo[2].user))),ue?1:-1)}return~(eo=so(to,-1))&&(no=ao[eo]=io[eo](to)),{c(){no&&no.c(),ro=empty$2()},m(lo,co){~eo&&ao[eo].m(lo,co),insert$1(lo,ro,co),oo=!0},p(lo,co){let uo=eo;eo=so(lo,co),eo===uo?~eo&&ao[eo].p(lo,co):(no&&(group_outros(),transition_out(ao[uo],1,1,()=>{ao[uo]=null}),check_outros()),~eo?(no=ao[eo],no?no.p(lo,co):(no=ao[eo]=io[eo](lo),no.c()),transition_in(no,1),no.m(ro.parentNode,ro)):no=null)},i(lo){oo||(transition_in(no),oo=!0)},o(lo){transition_out(no),oo=!1},d(lo){lo&&detach(ro),~eo&&ao[eo].d(lo)}}}function create_if_block_2$1j(to){let ue,eo;return ue=new Button({props:{cta:!0,size:"M",$$slots:{default:[create_default_slot_1$3Y]},$$scope:{ctx:to}}}),ue.$on("click",to[6]),ue.$on("click",to[7]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$29(to){let ue,eo;return ue=new Button({props:{cta:!0,size:"M",$$slots:{default:[create_default_slot$5E]},$$scope:{ctx:to}}}),ue.$on("click",to[4]),ue.$on("click",to[5]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$3Y(to){let ue;return{c(){ue=text$1("Upgrade")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot$5E(to){let ue;return{c(){ue=text$1("Upgrade")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_fragment$8M(to){let ue,eo,no=!to[0].isEnterprisePlan&&!to[0].isEnterpriseTrial&&create_if_block$45(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){!ro[0].isEnterprisePlan&&!ro[0].isEnterpriseTrial?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$45(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function instance$8M(to,ue,eo){let no,ro,oo,io;component_subscribe(to,licensing,uo=>eo(0,no=uo)),component_subscribe(to,admin,uo=>eo(1,ro=uo)),component_subscribe(to,auth,uo=>eo(2,oo=uo)),component_subscribe(to,goto,uo=>eo(3,io=uo));function ao(uo){bubble.call(this,to,uo)}const so=()=>{window.open(ro.accountPortalUrl+"/portal/upgrade","_blank")},lo=()=>io("/builder/portal/account/upgrade");function co(uo){bubble.call(this,to,uo)}return[no,ro,oo,io,ao,so,lo,co]}class UpgradeButton extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8M,create_fragment$8M,safe_not_equal,{})}}const SnippetSidePanel_svelte_svelte_type_style_lang="";function get_each_context$1G(to,ue,eo){const no=to.slice();return no[27]=ue[eo],no}function create_else_block_3$2(to){let ue,eo,no,ro;return no=new Tags({props:{$$slots:{default:[create_default_slot_4$1F]},$$scope:{ctx:to}}}),{c(){ue=element("div"),eo=text$1(`Snippets
|
|
888
|
+
`)[0].split("= ")[1],ea==="null;"&&(ea="")),ea||""},Eo=Ko=>{let ra=[...Ko.map(ea=>ea[0])];return ho&&ra.push("Helpers"),ra},To=(Ko,ra)=>{!_o||!Ko.value||Ko.value===""||(Fo(),eo(7,yo=ra),eo(8,wo={helper:!1,code:Ko.valueHTML}),vo.show())},Mo=(Ko,ra)=>{Fo(),!(!Ko.displayText&&Ko.description)&&(eo(7,yo=ra),eo(8,wo={helper:!0,description:Ko.description,code:Io(Ko,po.name==="javascript")}),vo.show())},Vo=()=>{Ao=setTimeout(()=>{vo.hide(),eo(7,yo=null),eo(8,wo=null),Ao=null},100)},Fo=()=>{Ao&&(clearTimeout(Ao),Ao=null)},Po=async()=>{eo(5,bo=!0),eo(3,go="")},Ro=Ko=>{Ko.stopPropagation(),eo(5,bo=!1),eo(3,go="")};function Do(Ko){binding_callbacks[Ko?"unshift":"push"](()=>{vo=Ko,eo(6,vo)})}const Uo=()=>eo(4,So=null);function qo(Ko){go=Ko,eo(3,go)}const xo=Ko=>{eo(4,So=Ko)},Zo=(Ko,ra)=>To(Ko,ra.target),Xo=Ko=>uo(Ko),Yo=(Ko,ra)=>Mo(Ko,ra.target),Qo=Ko=>co(Ko,po.name==="javascript");return to.$$set=Ko=>{"addHelper"in Ko&&eo(0,co=Ko.addHelper),"addBinding"in Ko&&eo(1,uo=Ko.addBinding),"bindings"in Ko&&eo(19,fo=Ko.bindings),"mode"in Ko&&eo(2,po=Ko.mode),"allowHelpers"in Ko&&eo(20,ho=Ko.allowHelpers),"context"in Ko&&eo(21,_o=Ko.context)},to.$$.update=()=>{to.$$.dirty[0]&524288&&eo(24,no=fo==null?void 0:fo.reduce((Ko,ra)=>(ra.icon&&(Ko[ra.category]=Ko[ra.category]||ra.icon),Ko),{})),to.$$.dirty[0]&16777216&&eo(12,ro={...no,Helpers:"MagicWand"}),to.$$.dirty[0]&524288&&eo(23,oo=Object.entries(groupBy$1("category",fo))),to.$$.dirty[0]&8388608&&eo(11,io=Eo(oo)),to.$$.dirty[0]&8&&eo(22,ao=new RegExp(go,"ig")),to.$$.dirty[0]&12582936&&eo(10,so=oo.map(([Ko,ra])=>({name:Ko,bindings:ra==null?void 0:ra.filter(ea=>!go||ea.readableBinding.match(ao))})).filter(Ko=>{var ra;return((ra=Ko.bindings)==null?void 0:ra.length)>0&&(So?So===Ko.name:!0)})),to.$$.dirty[0]&4194316&&eo(9,lo=ko==null?void 0:ko.filter(Ko=>(!go||Ko.label.match(ao)||Ko.description.match(ao))&&(po.name!=="javascript"||Ko.allowsJs)))},[co,uo,po,go,So,bo,vo,yo,wo,lo,so,io,ro,To,Mo,Vo,Fo,Po,Ro,fo,ho,_o,ao,oo,no,Do,Uo,qo,xo,Zo,Xo,Yo,Qo]}class BindingSidePanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8P,create_fragment$8P,safe_not_equal,{addHelper:0,addBinding:1,bindings:19,mode:2,allowHelpers:20,context:21},null,[-1,-1])}}const EvaluationSidePanel_svelte_svelte_type_style_lang="";function get_each_context$1H(to,ue,eo){const no=to.slice();return no[13]=ue[eo],no}function create_else_block_1$o(to){let ue,eo,no,ro,oo,io,ao,so=to[1]&&create_if_block_8$f(),lo=!to[2]&&create_if_block_7$k(to);return{c(){ue=element("div"),ue.textContent="Preview",eo=space$1(),so&&so.c(),no=space$1(),ro=element("span"),oo=space$1(),lo&&lo.c(),io=empty$2(),attr(ro,"class","svelte-1ui77vs")},m(co,uo){insert$1(co,ue,uo),insert$1(co,eo,uo),so&&so.m(co,uo),insert$1(co,no,uo),insert$1(co,ro,uo),insert$1(co,oo,uo),lo&&lo.m(co,uo),insert$1(co,io,uo),ao=!0},p(co,uo){co[1]?so?uo&2&&transition_in(so,1):(so=create_if_block_8$f(),so.c(),transition_in(so,1),so.m(no.parentNode,no)):so&&(group_outros(),transition_out(so,1,1,()=>{so=null}),check_outros()),co[2]?lo&&(group_outros(),transition_out(lo,1,1,()=>{lo=null}),check_outros()):lo?(lo.p(co,uo),uo&4&&transition_in(lo,1)):(lo=create_if_block_7$k(co),lo.c(),transition_in(lo,1),lo.m(io.parentNode,io))},i(co){ao||(transition_in(so),transition_in(lo),ao=!0)},o(co){transition_out(so),transition_out(lo),ao=!1},d(co){co&&(detach(ue),detach(eo),detach(no),detach(ro),detach(oo),detach(io)),so&&so.d(co),lo&&lo.d(co)}}}function create_if_block_5$v(to){let ue,eo,no,ro,oo,io,ao,so,lo;ue=new Icon({props:{name:"Alert",color:"var(--error-content)"}});let co=to[1]&&create_if_block_6$n();return so=new Icon({props:{name:"Copy",size:"S",hoverable:!0}}),so.$on("click",to[8]),{c(){create_component(ue.$$.fragment),eo=space$1(),no=element("div"),no.textContent="Error",ro=space$1(),co&&co.c(),oo=space$1(),io=element("span"),ao=space$1(),create_component(so.$$.fragment),attr(io,"class","svelte-1ui77vs")},m(uo,fo){mount_component(ue,uo,fo),insert$1(uo,eo,fo),insert$1(uo,no,fo),insert$1(uo,ro,fo),co&&co.m(uo,fo),insert$1(uo,oo,fo),insert$1(uo,io,fo),insert$1(uo,ao,fo),mount_component(so,uo,fo),lo=!0},p(uo,fo){uo[1]?co?fo&2&&transition_in(co,1):(co=create_if_block_6$n(),co.c(),transition_in(co,1),co.m(oo.parentNode,oo)):co&&(group_outros(),transition_out(co,1,1,()=>{co=null}),check_outros())},i(uo){lo||(transition_in(ue.$$.fragment,uo),transition_in(co),transition_in(so.$$.fragment,uo),lo=!0)},o(uo){transition_out(ue.$$.fragment,uo),transition_out(co),transition_out(so.$$.fragment,uo),lo=!1},d(uo){uo&&(detach(eo),detach(no),detach(ro),detach(oo),detach(io),detach(ao)),destroy_component(ue,uo),co&&co.d(uo),destroy_component(so,uo)}}}function create_if_block_8$f(to){let ue,eo,no,ro;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),ro=!0},i(oo){ro||(transition_in(eo.$$.fragment,oo),oo&&add_render_callback(()=>{ro&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!0)),no.run(1))}),ro=!0)},o(oo){transition_out(eo.$$.fragment,oo),oo&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!1)),no.run(0)),ro=!1},d(oo){oo&&detach(ue),destroy_component(eo),oo&&no&&no.end()}}}function create_if_block_7$k(to){let ue,eo;return ue=new Icon({props:{name:"Copy",newStyles:!0,size:"S",hoverable:!0}}),ue.$on("click",to[8]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_6$n(to){let ue,eo,no,ro;return eo=new ProgressCircle({props:{size:"S"}}),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),ro=!0},i(oo){ro||(transition_in(eo.$$.fragment,oo),oo&&add_render_callback(()=>{ro&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!0)),no.run(1))}),ro=!0)},o(oo){transition_out(eo.$$.fragment,oo),oo&&(no||(no=create_bidirectional_transition(ue,fade,{duration:130},!1)),no.run(0)),ro=!1},d(oo){oo&&detach(ue),destroy_component(eo),oo&&no&&no.end()}}}function create_else_block$1B(to){let ue,eo,no,ro,oo,io=ensure_array_like(to[4]),ao=[];for(let lo=0;lo<io.length;lo+=1)ao[lo]=create_each_block$1H(get_each_context$1H(to,io,lo));const so=lo=>transition_out(ao[lo],1,1,()=>{ao[lo]=null});return{c(){ue=element("div");for(let lo=0;lo<ao.length;lo+=1)ao[lo].c();eo=space$1(),no=element("div"),ro=element("div"),attr(no,"class","line svelte-1ui77vs"),attr(ue,"class","output-lines svelte-1ui77vs")},m(lo,co){insert$1(lo,ue,co);for(let uo=0;uo<ao.length;uo+=1)ao[uo]&&ao[uo].m(ue,null);append$2(ue,eo),append$2(ue,no),append$2(no,ro),ro.innerHTML=to[5],oo=!0},p(lo,co){if(co&16){io=ensure_array_like(lo[4]);let uo;for(uo=0;uo<io.length;uo+=1){const fo=get_each_context$1H(lo,io,uo);ao[uo]?(ao[uo].p(fo,co),transition_in(ao[uo],1)):(ao[uo]=create_each_block$1H(fo),ao[uo].c(),transition_in(ao[uo],1),ao[uo].m(ue,eo))}for(group_outros(),uo=io.length;uo<ao.length;uo+=1)so(uo);check_outros()}(!oo||co&32)&&(ro.innerHTML=lo[5])},i(lo){if(!oo){for(let co=0;co<io.length;co+=1)transition_in(ao[co]);oo=!0}},o(lo){ao=ao.filter(Boolean);for(let co=0;co<ao.length;co+=1)transition_out(ao[co]);oo=!1},d(lo){lo&&detach(ue),destroy_each(ao,lo)}}}function create_if_block_1$2b(to){let ue,eo=to[7](to[0])+"",no;return{c(){ue=element("div"),no=text$1(eo),attr(ue,"class","error-msg svelte-1ui77vs")},m(ro,oo){insert$1(ro,ue,oo),append$2(ue,no)},p(ro,oo){oo&1&&eo!==(eo=ro[7](ro[0])+"")&&set_data(no,eo)},i:noop$6,o:noop$6,d(ro){ro&&detach(ue)}}}function create_if_block$47(to){let ue;return{c(){ue=text$1("Your expression will be evaluated here")},m(eo,no){insert$1(eo,ue,no)},p:noop$6,i:noop$6,o:noop$6,d(eo){eo&&detach(ue)}}}function create_if_block_4$H(to){let ue,eo;return ue=new Icon({props:{size:"XS",name:"Alert",color:"var(--warning-content)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_3$Y(to){let ue,eo;return ue=new Icon({props:{size:"XS",name:"CloseCircle",color:"var(--error-content)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_2$1l(to){let ue,eo,no=to[13].line+"",ro;return{c(){ue=element("span"),eo=text$1(":"),ro=text$1(no),set_style(ue,"color","var(--blue)"),set_style(ue,"overflow-wrap","normal")},m(oo,io){insert$1(oo,ue,io),append$2(ue,eo),append$2(ue,ro)},p(oo,io){io&16&&no!==(no=oo[13].line+"")&&set_data(ro,no)},d(oo){oo&&detach(ue)}}}function create_each_block$1H(to){let ue,eo,no,ro,oo,io,ao=to[13].log+"",so,lo;const co=[create_if_block_3$Y,create_if_block_4$H],uo=[];function fo(ho,_o){return ho[13].type==="error"?0:ho[13].type==="warn"?1:-1}~(no=fo(to))&&(ro=uo[no]=co[no](to));let po=to[13].line&&create_if_block_2$1l(to);return{c(){ue=element("div"),eo=element("div"),ro&&ro.c(),oo=space$1(),io=element("span"),so=space$1(),po&&po.c(),attr(eo,"class","icon-log svelte-1ui77vs"),attr(ue,"class","line svelte-1ui77vs"),toggle_class(ue,"error-log",to[13].type==="error"),toggle_class(ue,"warn-log",to[13].type==="warn")},m(ho,_o){insert$1(ho,ue,_o),append$2(ue,eo),~no&&uo[no].m(eo,null),append$2(eo,oo),append$2(eo,io),io.innerHTML=ao,append$2(ue,so),po&&po.m(ue,null),lo=!0},p(ho,_o){let go=no;no=fo(ho),no!==go&&(ro&&(group_outros(),transition_out(uo[go],1,1,()=>{uo[go]=null}),check_outros()),~no?(ro=uo[no],ro||(ro=uo[no]=co[no](ho),ro.c()),transition_in(ro,1),ro.m(eo,oo)):ro=null),(!lo||_o&16)&&ao!==(ao=ho[13].log+"")&&(io.innerHTML=ao),ho[13].line?po?po.p(ho,_o):(po=create_if_block_2$1l(ho),po.c(),po.m(ue,null)):po&&(po.d(1),po=null),(!lo||_o&16)&&toggle_class(ue,"error-log",ho[13].type==="error"),(!lo||_o&16)&&toggle_class(ue,"warn-log",ho[13].type==="warn")},i(ho){lo||(transition_in(ro),lo=!0)},o(ho){transition_out(ro),lo=!1},d(ho){ho&&detach(ue),~no&&uo[no].d(),po&&po.d()}}}function create_fragment$8O(to){let ue,eo,no,ro,oo,io,ao,so,lo,co;const uo=[create_if_block_5$v,create_else_block_1$o],fo=[];function po(bo,vo){return bo[3]?0:1}ro=po(to),oo=fo[ro]=uo[ro](to);const ho=[create_if_block$47,create_if_block_1$2b,create_else_block$1B],_o=[];function go(bo,vo){return bo[2]?0:bo[3]?1:2}return so=go(to),lo=_o[so]=ho[so](to),{c(){ue=element("div"),eo=element("div"),no=element("div"),oo.c(),io=space$1(),ao=element("div"),lo.c(),attr(no,"class","header-content svelte-1ui77vs"),attr(eo,"class","header svelte-1ui77vs"),toggle_class(eo,"success",to[6]),toggle_class(eo,"error",to[3]),attr(ao,"class","body svelte-1ui77vs"),attr(ue,"class","evaluation-side-panel svelte-1ui77vs")},m(bo,vo){insert$1(bo,ue,vo),append$2(ue,eo),append$2(eo,no),fo[ro].m(no,null),append$2(ue,io),append$2(ue,ao),_o[so].m(ao,null),co=!0},p(bo,[vo]){let yo=ro;ro=po(bo),ro===yo?fo[ro].p(bo,vo):(group_outros(),transition_out(fo[yo],1,1,()=>{fo[yo]=null}),check_outros(),oo=fo[ro],oo?oo.p(bo,vo):(oo=fo[ro]=uo[ro](bo),oo.c()),transition_in(oo,1),oo.m(no,null)),(!co||vo&64)&&toggle_class(eo,"success",bo[6]),(!co||vo&8)&&toggle_class(eo,"error",bo[3]);let wo=so;so=go(bo),so===wo?_o[so].p(bo,vo):(group_outros(),transition_out(_o[wo],1,1,()=>{_o[wo]=null}),check_outros(),lo=_o[so],lo?lo.p(bo,vo):(lo=_o[so]=ho[so](bo),lo.c()),transition_in(lo,1),lo.m(ao,null))},i(bo){co||(transition_in(oo),transition_in(lo),co=!0)},o(bo){transition_out(oo),transition_out(lo),co=!1},d(bo){bo&&detach(ue),fo[ro].d(),_o[so].d()}}}function instance$8O(to,ue,eo){let no,ro,oo,io,ao,{expressionResult:so=void 0}=ue,{expressionError:lo=void 0}=ue,{expressionLogs:co=[]}=ue,{evaluating:uo=!1}=ue,{expression:fo=null}=ue;const po=go=>go.code===UserScriptError.code?go.userScriptError.toString():go.toString(),ho=go=>{if(go==null)return"";try{go=JSON.stringify(JSON.parse(go),null,2)}catch{}return format$1(go,{keyColor:"#e06c75",numberColor:"#e5c07b",stringColor:"#98c379",trueColor:"#d19a66",falseColor:"#d19a66",nullColor:"#c678dd"})},_o=()=>{let go=so;typeof go=="object"&&(go=JSON.stringify(go,null,2)),copyToClipboard(go),notifications.success("Value copied to clipboard")};return to.$$set=go=>{"expressionResult"in go&&eo(9,so=go.expressionResult),"expressionError"in go&&eo(0,lo=go.expressionError),"expressionLogs"in go&&eo(10,co=go.expressionLogs),"evaluating"in go&&eo(1,uo=go.evaluating),"expression"in go&&eo(11,fo=go.expression)},to.$$.update=()=>{to.$$.dirty&1&&eo(3,no=lo!=null),to.$$.dirty&2048&&eo(2,ro=fo==null||(fo==null?void 0:fo.trim())===""),to.$$.dirty&12&&eo(6,oo=!no&&!ro),to.$$.dirty&512&&eo(5,io=ho(so)),to.$$.dirty&1024&&eo(4,ao=co.map(go=>({log:go.log.map(bo=>ho(bo)).join(", "),line:go.line,type:go.type})))},[lo,uo,ro,no,ao,io,oo,po,_o,so,co,fo]}class EvaluationSidePanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8O,create_fragment$8O,safe_not_equal,{expressionResult:9,expressionError:0,expressionLogs:10,evaluating:1,expression:11})}}const SnippetDrawer_svelte_svelte_type_style_lang="";function create_else_block$1A(to){let ue,eo,no,ro,oo,io,ao;function so(uo){to[15](uo)}let lo={};to[1]!==void 0&&(lo.value=to[1]),ro=new Input$5({props:lo}),binding_callbacks.push(()=>bind$2(ro,"value",so));let co=to[6]&&create_if_block_2$1k(to);return{c(){ue=element("div"),eo=element("span"),eo.textContent="Name",no=space$1(),create_component(ro.$$.fragment),io=space$1(),co&&co.c(),attr(ue,"class","name svelte-8n6wau"),toggle_class(ue,"invalid",to[6]!=null)},m(uo,fo){insert$1(uo,ue,fo),append$2(ue,eo),append$2(ue,no),mount_component(ro,ue,null),append$2(ue,io),co&&co.m(ue,null),ao=!0},p(uo,fo){const po={};!oo&&fo&2&&(oo=!0,po.value=uo[1],add_flush_callback(()=>oo=!1)),ro.$set(po),uo[6]?co?(co.p(uo,fo),fo&64&&transition_in(co,1)):(co=create_if_block_2$1k(uo),co.c(),transition_in(co,1),co.m(ue,null)):co&&(group_outros(),transition_out(co,1,1,()=>{co=null}),check_outros()),(!ao||fo&64)&&toggle_class(ue,"invalid",uo[6]!=null)},i(uo){ao||(transition_in(ro.$$.fragment,uo),transition_in(co),ao=!0)},o(uo){transition_out(ro.$$.fragment,uo),transition_out(co),ao=!1},d(uo){uo&&detach(ue),destroy_component(ro),co&&co.d()}}}function create_if_block_1$2a(to){let ue=to[0].name+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro&1&&ue!==(ue=no[0].name+"")&&set_data(eo,ue)},i:noop$6,o:noop$6,d(no){no&&detach(eo)}}}function create_if_block_2$1k(to){let ue,eo;return ue=new AbsTooltip({props:{text:to[6],type:TooltipType.Negative,$$slots:{default:[create_default_slot_2$2R]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&64&&(oo.text=no[6]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_2$2R(to){let ue,eo;return ue=new Icon({props:{name:"Help",size:"S",color:"var(--spectrum-global-color-red-400)"}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_title_slot(to){let ue,eo,no,ro;const oo=[create_if_block_1$2a,create_else_block$1A],io=[];function ao(so,lo){return so[0]?0:1}return ue=ao(to),eo=io[ue]=oo[ue](to),{c(){eo.c(),no=empty$2()},m(so,lo){io[ue].m(so,lo),insert$1(so,no,lo),ro=!0},p(so,lo){let co=ue;ue=ao(so),ue===co?io[ue].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),eo=io[ue],eo?eo.p(so,lo):(eo=io[ue]=oo[ue](so),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no))},i(so){ro||(transition_in(eo),ro=!0)},o(so){transition_out(eo),ro=!1},d(so){so&&detach(no),io[ue].d(so)}}}function create_if_block$46(to){let ue,eo;return ue=new Button({props:{warning:!0,disabled:to[4],$$slots:{default:[create_default_slot_1$3Z]},$$scope:{ctx:to}}}),ue.$on("click",function(){is_function(to[5].show)&&to[5].show.apply(this,arguments)}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){to=no;const oo={};ro&16&&(oo.disabled=to[4]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:to}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$3Z(to){let ue;return{c(){ue=text$1("Delete")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot$5F(to){let ue;return{c(){ue=text$1("Save")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_buttons_slot$h(to){let ue,eo,no,ro=to[0]&&create_if_block$46(to);return eo=new Button({props:{cta:!0,disabled:!to[2]||to[4]||to[6],$$slots:{default:[create_default_slot$5F]},$$scope:{ctx:to}}}),eo.$on("click",to[8]),{c(){ro&&ro.c(),ue=space$1(),create_component(eo.$$.fragment)},m(oo,io){ro&&ro.m(oo,io),insert$1(oo,ue,io),mount_component(eo,oo,io),no=!0},p(oo,io){oo[0]?ro?(ro.p(oo,io),io&1&&transition_in(ro,1)):(ro=create_if_block$46(oo),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros());const ao={};io&84&&(ao.disabled=!oo[2]||oo[4]||oo[6]),io&1048576&&(ao.$$scope={dirty:io,ctx:oo}),eo.$set(ao)},i(oo){no||(transition_in(ro),transition_in(eo.$$.fragment,oo),no=!0)},o(oo){transition_out(ro),transition_out(eo.$$.fragment,oo),no=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo),destroy_component(eo,oo)}}}function create_tabs_slot(to){let ue,eo,no;return eo=new Input$5({props:{placeholder:"Name"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"slot","tabs")},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p:noop$6,i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_key_block$i(to){let ue,eo;return ue=new BindingPanel({props:{allowHBS:!1,allowJS:!0,allowSnippets:!1,showTabBar:!1,placeholder:"return function(input) ❴ ... ❵",value:to[2],$$slots:{tabs:[create_tabs_slot]},$$scope:{ctx:to}}}),ue.$on("change",to[14]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&4&&(oo.value=no[2]),ro&1048576&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_body_slot$g(to){let ue=to[7],eo,no,ro=create_key_block$i(to);return{c(){ro.c(),eo=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,eo,io),no=!0},p(oo,io){io&128&&safe_not_equal(ue,ue=oo[7])?(group_outros(),transition_out(ro,1,1,noop$6),check_outros(),ro=create_key_block$i(oo),ro.c(),transition_in(ro,1),ro.m(eo.parentNode,eo)):ro.p(oo,io)},i(oo){no||(transition_in(ro),no=!0)},o(oo){transition_out(ro),no=!1},d(oo){oo&&detach(eo),ro.d(oo)}}}function create_fragment$8N(to){var ao;let ue,eo,no,ro,oo={$$slots:{body:[create_body_slot$g],buttons:[create_buttons_slot$h],title:[create_title_slot]},$$scope:{ctx:to}};ue=new Drawer({props:oo}),to[16](ue);let io={title:"Delete snippet",body:`Are you sure you want to delete ${(ao=to[0])==null?void 0:ao.name}?`,onOk:to[9]};return no=new ConfirmDialog({props:io}),to[17](no),{c(){create_component(ue.$$.fragment),eo=space$1(),create_component(no.$$.fragment)},m(so,lo){mount_component(ue,so,lo),insert$1(so,eo,lo),mount_component(no,so,lo),ro=!0},p(so,[lo]){var fo;const co={};lo&1048823&&(co.$$scope={dirty:lo,ctx:so}),ue.$set(co);const uo={};lo&1&&(uo.body=`Are you sure you want to delete ${(fo=so[0])==null?void 0:fo.name}?`),no.$set(uo)},i(so){ro||(transition_in(ue.$$.fragment,so),transition_in(no.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),transition_out(no.$$.fragment,so),ro=!1},d(so){so&&detach(eo),to[16](null),destroy_component(ue,so),to[17](null),destroy_component(no,so)}}}const firstCharNumberRegex=/^[0-9].*$/;function instance$8N(to,ue,eo){let no,ro,oo,io,ao;component_subscribe(to,snippets$1,Ao=>eo(13,ao=Ao));let{snippet:so}=ue;const lo=()=>uo.show(),co=()=>uo.hide();let uo,fo="",po="",ho=!1,_o;const go=async()=>{eo(4,ho=!0);try{const Ao={name:fo,code:oo};await snippets$1.saveSnippet(Ao),uo.hide(),notifications.success(`Snippet ${Ao.name} saved`)}catch(Ao){notifications.error(Ao.message||"Error saving snippet")}eo(4,ho=!1)},bo=async()=>{eo(4,ho=!0);try{await snippets$1.deleteSnippet(so.name),uo.hide()}catch{notifications.error("Error deleting snippet")}eo(4,ho=!1)},vo=(Ao,Io)=>Ao!=null&&Ao.length?!(so!=null&&so.name)&&Io.some(Eo=>Eo.name===Ao)?"That name is already in use":firstCharNumberRegex.test(Ao)?"Can't start with a number":ValidSnippetNameRegex.test(Ao)?null:"No special characters or spaces":"Name is required",yo=Ao=>eo(2,po=Ao.detail);function wo(Ao){fo=Ao,eo(1,fo),eo(0,so),eo(12,no),eo(13,ao)}function ko(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{uo=Ao,eo(3,uo)})}function So(Ao){binding_callbacks[Ao?"unshift":"push"](()=>{_o=Ao,eo(5,_o)})}return to.$$set=Ao=>{"snippet"in Ao&&eo(0,so=Ao.snippet)},to.$$.update=()=>{to.$$.dirty&8192&&eo(12,no=getSequentialName(ao,"MySnippet",{getName:Ao=>Ao.name})),to.$$.dirty&1&&eo(7,ro=so==null?void 0:so.name),to.$$.dirty&4097&&eo(1,fo=(so==null?void 0:so.name)||no),to.$$.dirty&1&&eo(2,po=so!=null&&so.code?encodeJSBinding(so.code):""),to.$$.dirty&4&&(oo=decodeJSBinding(po)),to.$$.dirty&8194&&eo(6,io=vo(fo,ao))},[so,fo,po,uo,ho,_o,io,ro,go,bo,lo,co,no,ao,yo,wo,ko,So]}class SnippetDrawer extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8N,create_fragment$8N,safe_not_equal,{snippet:0,show:10,hide:11})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[11]}}function create_if_block$45(to){let ue,eo,no,ro,oo;const io=[create_if_block_1$29,create_if_block_2$1j],ao=[];function so(lo,co){var uo,fo;return co&6&&(ue=null),lo[1].cloud&&((fo=(uo=lo[2])==null?void 0:uo.user)!=null&&fo.accountPortalAccess)?0:(ue==null&&(ue=!!(!lo[1].cloud&&isAdmin(lo[2].user))),ue?1:-1)}return~(eo=so(to,-1))&&(no=ao[eo]=io[eo](to)),{c(){no&&no.c(),ro=empty$2()},m(lo,co){~eo&&ao[eo].m(lo,co),insert$1(lo,ro,co),oo=!0},p(lo,co){let uo=eo;eo=so(lo,co),eo===uo?~eo&&ao[eo].p(lo,co):(no&&(group_outros(),transition_out(ao[uo],1,1,()=>{ao[uo]=null}),check_outros()),~eo?(no=ao[eo],no?no.p(lo,co):(no=ao[eo]=io[eo](lo),no.c()),transition_in(no,1),no.m(ro.parentNode,ro)):no=null)},i(lo){oo||(transition_in(no),oo=!0)},o(lo){transition_out(no),oo=!1},d(lo){lo&&detach(ro),~eo&&ao[eo].d(lo)}}}function create_if_block_2$1j(to){let ue,eo;return ue=new Button({props:{cta:!0,size:"M",$$slots:{default:[create_default_slot_1$3Y]},$$scope:{ctx:to}}}),ue.$on("click",to[6]),ue.$on("click",to[7]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$29(to){let ue,eo;return ue=new Button({props:{cta:!0,size:"M",$$slots:{default:[create_default_slot$5E]},$$scope:{ctx:to}}}),ue.$on("click",to[4]),ue.$on("click",to[5]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&256&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$3Y(to){let ue;return{c(){ue=text$1("Upgrade")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot$5E(to){let ue;return{c(){ue=text$1("Upgrade")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_fragment$8M(to){let ue,eo,no=!to[0].isEnterprisePlan&&!to[0].isEnterpriseTrial&&create_if_block$45(to);return{c(){no&&no.c(),ue=empty$2()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,[oo]){!ro[0].isEnterprisePlan&&!ro[0].isEnterpriseTrial?no?(no.p(ro,oo),oo&1&&transition_in(no,1)):(no=create_if_block$45(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function instance$8M(to,ue,eo){let no,ro,oo,io;component_subscribe(to,licensing,uo=>eo(0,no=uo)),component_subscribe(to,admin,uo=>eo(1,ro=uo)),component_subscribe(to,auth,uo=>eo(2,oo=uo)),component_subscribe(to,goto,uo=>eo(3,io=uo));function ao(uo){bubble.call(this,to,uo)}const so=()=>{window.open(ro.accountPortalUrl+"/portal/upgrade","_blank")},lo=()=>io("/builder/portal/account/upgrade");function co(uo){bubble.call(this,to,uo)}return[no,ro,oo,io,ao,so,lo,co]}class UpgradeButton extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8M,create_fragment$8M,safe_not_equal,{})}}const SnippetSidePanel_svelte_svelte_type_style_lang="";function get_each_context$1G(to,ue,eo){const no=to.slice();return no[27]=ue[eo],no}function create_else_block_3$2(to){let ue,eo,no,ro;return no=new Tags({props:{$$slots:{default:[create_default_slot_4$1F]},$$scope:{ctx:to}}}),{c(){ue=element("div"),eo=text$1(`Snippets
|
|
889
889
|
`),create_component(no.$$.fragment),attr(ue,"class","title svelte-10gqizr")},m(oo,io){insert$1(oo,ue,io),append$2(ue,eo),mount_component(no,ue,null),ro=!0},p(oo,io){const ao={};io&1073741824&&(ao.$$scope={dirty:io,ctx:oo}),no.$set(ao)},i(oo){ro||(transition_in(no.$$.fragment,oo),ro=!0)},o(oo){transition_out(no.$$.fragment,oo),ro=!1},d(oo){oo&&detach(ue),destroy_component(no)}}}function create_if_block_2$1i(to){let ue,eo,no,ro;const oo=[create_if_block_3$X,create_else_block_2$7],io=[];function ao(so,lo){return so[3]?0:1}return ue=ao(to),eo=io[ue]=oo[ue](to),{c(){eo.c(),no=empty$2()},m(so,lo){io[ue].m(so,lo),insert$1(so,no,lo),ro=!0},p(so,lo){let co=ue;ue=ao(so),ue===co?io[ue].p(so,lo):(group_outros(),transition_out(io[co],1,1,()=>{io[co]=null}),check_outros(),eo=io[ue],eo?eo.p(so,lo):(eo=io[ue]=oo[ue](so),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no))},i(so){ro||(transition_in(eo),ro=!0)},o(so){transition_out(eo),ro=!1},d(so){so&&detach(no),io[ue].d(so)}}}function create_default_slot_5$1h(to){let ue;return{c(){ue=text$1("Premium")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot_4$1F(to){let ue,eo;return ue=new Tag$1({props:{icon:"LockClosed",$$slots:{default:[create_default_slot_5$1h]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1073741824&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_else_block_2$7(to){let ue,eo,no,ro,oo,io;return no=new Icon({props:{size:"S",name:"Search",hoverable:!0,newStyles:!0}}),no.$on("click",to[13]),oo=new Icon({props:{size:"S",name:"Add",hoverable:!0,newStyles:!0}}),oo.$on("click",to[15]),{c(){ue=element("div"),ue.textContent="Snippets",eo=space$1(),create_component(no.$$.fragment),ro=space$1(),create_component(oo.$$.fragment),attr(ue,"class","title svelte-10gqizr")},m(ao,so){insert$1(ao,ue,so),insert$1(ao,eo,so),mount_component(no,ao,so),insert$1(ao,ro,so),mount_component(oo,ao,so),io=!0},p:noop$6,i(ao){io||(transition_in(no.$$.fragment,ao),transition_in(oo.$$.fragment,ao),io=!0)},o(ao){transition_out(no.$$.fragment,ao),transition_out(oo.$$.fragment,ao),io=!1},d(ao){ao&&(detach(ue),detach(eo),detach(ro)),destroy_component(no,ao),destroy_component(oo,ao)}}}function create_if_block_3$X(to){let ue,eo,no,ro,oo,io;function ao(lo){to[19](lo)}let so={placeholder:"Search for snippets",autocomplete:"off",autofocus:!0};return to[1]!==void 0&&(so.value=to[1]),eo=new Input$5({props:so}),binding_callbacks.push(()=>bind$2(eo,"value",ao)),oo=new Icon({props:{size:"S",name:"Close",hoverable:!0,newStyles:!0}}),oo.$on("click",to[14]),{c(){ue=element("div"),create_component(eo.$$.fragment),ro=space$1(),create_component(oo.$$.fragment),attr(ue,"class","search-input svelte-10gqizr")},m(lo,co){insert$1(lo,ue,co),mount_component(eo,ue,null),insert$1(lo,ro,co),mount_component(oo,lo,co),io=!0},p(lo,co){const uo={};!no&&co&2&&(no=!0,uo.value=lo[1],add_flush_callback(()=>no=!1)),eo.$set(uo)},i(lo){io||(transition_in(eo.$$.fragment,lo),transition_in(oo.$$.fragment,lo),io=!0)},o(lo){transition_out(eo.$$.fragment,lo),transition_out(oo.$$.fragment,lo),io=!1},d(lo){lo&&(detach(ue),detach(ro)),destroy_component(eo),destroy_component(oo,lo)}}}function create_else_block$1z(to){let ue,eo,no,ro,oo,io;eo=new Body({props:{size:"S",$$slots:{default:[create_default_slot_3$2d]},$$scope:{ctx:to}}});const ao=[create_if_block_1$28,create_else_block_1$n],so=[];function lo(co,uo){return co[2]?0:1}return ro=lo(to),oo=so[ro]=ao[ro](to),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),oo.c(),attr(ue,"class","upgrade svelte-10gqizr")},m(co,uo){insert$1(co,ue,uo),mount_component(eo,ue,null),append$2(ue,no),so[ro].m(ue,null),io=!0},p(co,uo){const fo={};uo&1073741824&&(fo.$$scope={dirty:uo,ctx:co}),eo.$set(fo);let po=ro;ro=lo(co),ro===po?so[ro].p(co,uo):(group_outros(),transition_out(so[po],1,1,()=>{so[po]=null}),check_outros(),oo=so[ro],oo?oo.p(co,uo):(oo=so[ro]=ao[ro](co),oo.c()),transition_in(oo,1),oo.m(ue,null))},i(co){io||(transition_in(eo.$$.fragment,co),transition_in(oo),io=!0)},o(co){transition_out(eo.$$.fragment,co),transition_out(oo),io=!1},d(co){co&&detach(ue),destroy_component(eo),so[ro].d()}}}function create_if_block$44(to){let ue,eo,no=ensure_array_like(to[9]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block$1G(get_each_context$1G(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){for(let io=0;io<ro.length;io+=1)ro[io].c();ue=empty$2()},m(io,ao){for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(io,ao);insert$1(io,ue,ao),eo=!0},p(io,ao){if(ao&69121){no=ensure_array_like(io[9]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context$1G(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block$1G(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue.parentNode,ue))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_default_slot_3$2d(to){let ue;return{c(){ue=text$1(`Snippets let you create reusable JS functions and values that can
|
|
890
890
|
all be managed in one place`)},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_else_block_1$n(to){let ue,eo;return ue=new UpgradeButton({}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$28(to){let ue,eo;return ue=new Button({props:{cta:!0,$$slots:{default:[create_default_slot_2$2Q]},$$scope:{ctx:to}}}),ue.$on("click",to[15]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1073741824&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_2$2Q(to){let ue;return{c(){ue=text$1("Create snippet")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_each_block$1G(to){let ue,eo=to[27].name+"",no,ro,oo,io,ao,so,lo;function co(...po){return to[20](to[27],...po)}oo=new Icon({props:{name:"Edit",hoverable:!0,newStyles:!0,size:"S"}}),oo.$on("click",co);function uo(...po){return to[21](to[27],...po)}function fo(){return to[22](to[27])}return{c(){ue=element("div"),no=text$1(eo),ro=space$1(),create_component(oo.$$.fragment),io=space$1(),attr(ue,"class","snippet svelte-10gqizr")},m(po,ho){insert$1(po,ue,ho),append$2(ue,no),append$2(ue,ro),mount_component(oo,ue,null),append$2(ue,io),ao=!0,so||(lo=[listen(ue,"mouseenter",uo),listen(ue,"mouseleave",to[11]),listen(ue,"click",fo)],so=!0)},p(po,ho){to=po,(!ao||ho&512)&&eo!==(eo=to[27].name+"")&&set_data(no,eo)},i(po){ao||(transition_in(oo.$$.fragment,po),ao=!0)},o(po){transition_out(oo.$$.fragment,po),ao=!1},d(po){po&&detach(ue),destroy_component(oo),so=!1,run_all(lo)}}}function create_default_slot_1$3X(to){let ue,eo,no,ro,oo,io,ao,so;const lo=[create_if_block_2$1i,create_else_block_3$2],co=[];function uo(_o,go){return _o[2]?0:1}eo=uo(to),no=co[eo]=lo[eo](to);const fo=[create_if_block$44,create_else_block$1z],po=[];function ho(_o,go){var bo;return _o[2]&&((bo=_o[9])!=null&&bo.length)?0:1}return io=ho(to),ao=po[io]=fo[io](to),{c(){ue=element("div"),no.c(),ro=space$1(),oo=element("div"),ao.c(),attr(ue,"class","header svelte-10gqizr"),attr(oo,"class","snippet-list svelte-10gqizr")},m(_o,go){insert$1(_o,ue,go),co[eo].m(ue,null),insert$1(_o,ro,go),insert$1(_o,oo,go),po[io].m(oo,null),so=!0},p(_o,go){let bo=eo;eo=uo(_o),eo===bo?co[eo].p(_o,go):(group_outros(),transition_out(co[bo],1,1,()=>{co[bo]=null}),check_outros(),no=co[eo],no?no.p(_o,go):(no=co[eo]=lo[eo](_o),no.c()),transition_in(no,1),no.m(ue,null));let vo=io;io=ho(_o),io===vo?po[io].p(_o,go):(group_outros(),transition_out(po[vo],1,1,()=>{po[vo]=null}),check_outros(),ao=po[io],ao?ao.p(_o,go):(ao=po[io]=fo[io](_o),ao.c()),transition_in(ao,1),ao.m(oo,null))},i(_o){so||(transition_in(no),transition_in(ao),so=!0)},o(_o){transition_out(no),transition_out(ao),so=!1},d(_o){_o&&(detach(ue),detach(ro),detach(oo)),co[eo].d(),po[io].d()}}}function create_key_block$h(to){var no;let ue,eo;return ue=new CodeEditor({props:{value:(no=to[6].code)==null?void 0:no.trim(),mode:EditorModes$1.JS,readonly:!0}}),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){var ao;const io={};oo&64&&(io.value=(ao=ro[6].code)==null?void 0:ao.trim()),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_default_slot$5D(to){let ue,eo=to[6],no,ro=create_key_block$h(to);return{c(){ue=element("div"),ro.c(),attr(ue,"class","snippet-popover svelte-10gqizr")},m(oo,io){insert$1(oo,ue,io),ro.m(ue,null),no=!0},p(oo,io){io&64&&safe_not_equal(eo,eo=oo[6])?(group_outros(),transition_out(ro,1,1,noop$6),check_outros(),ro=create_key_block$h(oo),ro.c(),transition_in(ro,1),ro.m(ue,null)):ro.p(oo,io)},i(oo){no||(transition_in(ro),no=!0)},o(oo){transition_out(ro),no=!1},d(oo){oo&&detach(ue),ro.d(oo)}}}function create_fragment$8L(to){let ue,eo,no,ro,oo,io,ao;eo=new Layout$n({props:{noPadding:!0,gap:"S",$$slots:{default:[create_default_slot_1$3X]},$$scope:{ctx:to}}});let so={align:"left-outside",anchor:to[5],minWidth:0,maxWidth:480,maxHeight:480,dismissible:!1,$$slots:{default:[create_default_slot$5D]},$$scope:{ctx:to}};ro=new Popover({props:so}),to[23](ro),ro.$on("mouseenter",to[12]),ro.$on("mouseleave",to[11]);let lo={snippet:to[8]};return io=new SnippetDrawer({props:lo}),to[24](io),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),oo=space$1(),create_component(io.$$.fragment),attr(ue,"class","snippet-side-panel svelte-10gqizr")},m(co,uo){insert$1(co,ue,uo),mount_component(eo,ue,null),insert$1(co,no,uo),mount_component(ro,co,uo),insert$1(co,oo,uo),mount_component(io,co,uo),ao=!0},p(co,[uo]){const fo={};uo&1073742351&&(fo.$$scope={dirty:uo,ctx:co}),eo.$set(fo);const po={};uo&32&&(po.anchor=co[5]),uo&1073741888&&(po.$$scope={dirty:uo,ctx:co}),ro.$set(po);const ho={};uo&256&&(ho.snippet=co[8]),io.$set(ho)},i(co){ao||(transition_in(eo.$$.fragment,co),transition_in(ro.$$.fragment,co),transition_in(io.$$.fragment,co),ao=!0)},o(co){transition_out(eo.$$.fragment,co),transition_out(ro.$$.fragment,co),transition_out(io.$$.fragment,co),ao=!1},d(co){co&&(detach(ue),detach(no),detach(oo)),destroy_component(eo),to[23](null),destroy_component(ro,co),to[24](null),destroy_component(io,co)}}}function instance$8L(to,ue,eo){let no,ro,oo;component_subscribe(to,licensing,Po=>eo(18,oo=Po));let{addSnippet:io}=ue,{snippets:ao}=ue,so="",lo=!1,co,uo,fo,po,ho,_o;const go=(Po,Ro,Do)=>!Po||!(Ro!=null&&Ro.length)?[]:Do!=null&&Do.length?Ro.filter(Uo=>Uo.name.toLowerCase().includes(Do.toLowerCase())):Ro,bo=(Po,Ro)=>{yo(),eo(5,uo=Ro),eo(6,fo=Po),co.show()},vo=()=>{po=setTimeout(()=>{co.hide(),eo(5,uo=null),eo(6,fo=null),po=null},100)},yo=()=>{po&&(clearTimeout(po),po=null)},wo=()=>{eo(3,lo=!0),eo(1,so="")},ko=()=>{eo(3,lo=!1),eo(1,so="")},So=()=>{eo(8,_o=null),ho.show()},Ao=(Po,Ro)=>{Po.preventDefault(),Po.stopPropagation(),eo(8,_o=Ro),ho.show()};function Io(Po){so=Po,eo(1,so)}const Eo=(Po,Ro)=>Ao(Ro,Po),To=(Po,Ro)=>bo(Po,Ro.target),Mo=Po=>io(Po);function Vo(Po){binding_callbacks[Po?"unshift":"push"](()=>{co=Po,eo(4,co)})}function Fo(Po){binding_callbacks[Po?"unshift":"push"](()=>{ho=Po,eo(7,ho)})}return to.$$set=Po=>{"addSnippet"in Po&&eo(0,io=Po.addSnippet),"snippets"in Po&&eo(17,ao=Po.snippets)},to.$$.update=()=>{to.$$.dirty&262144&&eo(2,no=!oo.isFreePlan),to.$$.dirty&131078&&eo(9,ro=go(no,ao,so))},[io,so,no,lo,co,uo,fo,ho,_o,ro,bo,vo,yo,wo,ko,So,Ao,ao,oo,Io,Eo,To,Mo,Vo,Fo]}class SnippetSidePanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8L,create_fragment$8L,safe_not_equal,{addSnippet:0,snippets:17})}}const BindingType={READABLE:"readableBinding",RUNTIME:"runtimeBinding"};class BindingHelpers{constructor(ue,eo,{disableWrapping:no}={}){this.getCaretPosition=ue,this.insertAtPos=eo,this.disableWrapping=no}onSelectHelper(ue,eo,{js:no,dontDecode:ro}){const oo=this.getCaretPosition(),{start:io,end:ao}=oo;if(no){const so=ro?ue:decodeJSBinding(ue),lo=jsInsert(so,io,ao,eo.text,{helper:!0});this.insertAtPos({start:io,end:ao,value:lo})}else{const so=hbInsert(ue,io,ao,eo.text);this.insertAtPos({start:io,end:ao,value:so})}}onSelectBinding(ue,eo,{js:no,dontDecode:ro,type:oo=BindingType.READABLE}){const{start:io,end:ao}=this.getCaretPosition();if(no){const so=ro?ue:decodeJSBinding(ue),lo=jsInsert(so,io,ao,eo[oo],{disableWrapping:this.disableWrapping});this.insertAtPos({start:io,end:ao,value:lo})}else{const so=hbInsert(ue,io,ao,eo[oo]);this.insertAtPos({start:io,end:ao,value:so})}}onSelectSnippet(ue){const eo=this.getCaretPosition(),{start:no,end:ro}=eo;this.insertAtPos({start:no,end:ro,value:`snippets.${ue.name}`})}}const BindingPanel_svelte_svelte_type_style_lang="";function get_each_context$1F(to,ue,eo){const no=to.slice();return no[61]=ue[eo],no}function get_each_context_1$r(to,ue,eo){const no=to.slice();return no[14]=ue[eo],no}function create_if_block_6$m(to){let ue,eo,no,ro,oo,io=ensure_array_like(to[20]),ao=[];for(let fo=0;fo<io.length;fo+=1)ao[fo]=create_each_block_1$r(get_each_context_1$r(to,io,fo));const so=fo=>transition_out(ao[fo],1,1,()=>{ao[fo]=null});let lo=ensure_array_like(to[12]),co=[];for(let fo=0;fo<lo.length;fo+=1)co[fo]=create_each_block$1F(get_each_context$1F(to,lo,fo));const uo=fo=>transition_out(co[fo],1,1,()=>{co[fo]=null});return{c(){ue=element("div"),eo=element("div");for(let fo=0;fo<ao.length;fo+=1)ao[fo].c();no=space$1(),ro=element("div");for(let fo=0;fo<co.length;fo+=1)co[fo].c();attr(eo,"class","editor-tabs svelte-biform"),attr(ro,"class","side-tabs svelte-biform"),attr(ue,"class","tabs svelte-biform")},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo);for(let ho=0;ho<ao.length;ho+=1)ao[ho]&&ao[ho].m(eo,null);append$2(ue,no),append$2(ue,ro);for(let ho=0;ho<co.length;ho+=1)co[ho]&&co[ho].m(ro,null);oo=!0},p(fo,po){if(po[0]&68157504){io=ensure_array_like(fo[20]);let ho;for(ho=0;ho<io.length;ho+=1){const _o=get_each_context_1$r(fo,io,ho);ao[ho]?(ao[ho].p(_o,po),transition_in(ao[ho],1)):(ao[ho]=create_each_block_1$r(_o),ao[ho].c(),transition_in(ao[ho],1),ao[ho].m(eo,null))}for(group_outros(),ho=io.length;ho<ao.length;ho+=1)so(ho);check_outros()}if(po[0]&268439680){lo=ensure_array_like(fo[12]);let ho;for(ho=0;ho<lo.length;ho+=1){const _o=get_each_context$1F(fo,lo,ho);co[ho]?(co[ho].p(_o,po),transition_in(co[ho],1)):(co[ho]=create_each_block$1F(_o),co[ho].c(),transition_in(co[ho],1),co[ho].m(ro,null))}for(group_outros(),ho=lo.length;ho<co.length;ho+=1)uo(ho);check_outros()}},i(fo){if(!oo){for(let po=0;po<io.length;po+=1)transition_in(ao[po]);for(let po=0;po<lo.length;po+=1)transition_in(co[po]);oo=!0}},o(fo){ao=ao.filter(Boolean);for(let po=0;po<ao.length;po+=1)transition_out(ao[po]);co=co.filter(Boolean);for(let po=0;po<co.length;po+=1)transition_out(co[po]);oo=!1},d(fo){fo&&detach(ue),destroy_each(ao,fo),destroy_each(co,fo)}}}function create_default_slot_6$$(to){let ue=capitalise(to[14])+"",eo,no;return{c(){eo=text$1(ue),no=space$1()},m(ro,oo){insert$1(ro,eo,oo),insert$1(ro,no,oo)},p(ro,oo){oo[0]&1048576&&ue!==(ue=capitalise(ro[14])+"")&&set_data(eo,ue)},d(ro){ro&&(detach(eo),detach(no))}}}function create_each_block_1$r(to){let ue,eo;function no(){return to[41](to[14])}return ue=new ActionButton({props:{size:"M",quiet:!0,selected:to[6]===to[14],$$slots:{default:[create_default_slot_6$$]},$$scope:{ctx:to}}}),ue.$on("click",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro;const io={};oo[0]&1048640&&(io.selected=to[6]===to[14]),oo[0]&1048576|oo[2]&16&&(io.$$scope={dirty:oo,ctx:to}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_default_slot_5$1g(to){let ue,eo,no;return ue=new Icon({props:{name:to[61],size:"S"}}),{c(){create_component(ue.$$.fragment),eo=space$1()},m(ro,oo){mount_component(ue,ro,oo),insert$1(ro,eo,oo),no=!0},p(ro,oo){const io={};oo[0]&4096&&(io.name=ro[61]),ue.$set(io)},i(ro){no||(transition_in(ue.$$.fragment,ro),no=!0)},o(ro){transition_out(ue.$$.fragment,ro),no=!1},d(ro){ro&&detach(eo),destroy_component(ue,ro)}}}function create_each_block$1F(to){let ue,eo;function no(){return to[42](to[61])}return ue=new ActionButton({props:{size:"M",quiet:!0,selected:to[7]===to[61],$$slots:{default:[create_default_slot_5$1g]},$$scope:{ctx:to}}}),ue.$on("click",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro;const io={};oo[0]&4224&&(io.selected=to[7]===to[61]),oo[0]&4096|oo[2]&16&&(io.$$scope={dirty:oo,ctx:to}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_if_block_5$u(to){let ue=to[22],eo,no,ro=create_key_block_1(to);return{c(){ro.c(),eo=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,eo,io),no=!0},p(oo,io){io[0]&4194304&&safe_not_equal(ue,ue=oo[22])?(group_outros(),transition_out(ro,1,1,noop$6),check_outros(),ro=create_key_block_1(oo),ro.c(),transition_in(ro,1),ro.m(eo.parentNode,eo)):ro.p(oo,io)},i(oo){no||(transition_in(ro),no=!0)},o(oo){transition_out(ro),no=!1},d(oo){oo&&detach(eo),ro.d(oo)}}}function create_if_block_4$G(to){let ue=to[23],eo,no,ro=create_key_block$g(to);return{c(){ro.c(),eo=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,eo,io),no=!0},p(oo,io){io[0]&8388608&&safe_not_equal(ue,ue=oo[23])?(group_outros(),transition_out(ro,1,1,noop$6),check_outros(),ro=create_key_block$g(oo),ro.c(),transition_in(ro,1),ro.m(eo.parentNode,eo)):ro.p(oo,io)},i(oo){no||(transition_in(ro),no=!0)},o(oo){transition_out(ro),no=!1},d(oo){oo&&detach(eo),ro.d(oo)}}}function create_key_block_1(to){let ue,eo,no,ro;function oo(so){to[45](so)}function io(so){to[46](so)}let ao={value:to[8]?decodeJSBinding(to[8]):to[8],completions:to[22],mode:EditorModes$1.JS,autofocus:to[3],placeholder:to[4]||"Add bindings by typing $ or use the menu on the right",jsBindingWrapping:!0};return to[10]!==void 0&&(ao.getCaretPosition=to[10]),to[11]!==void 0&&(ao.insertAtPos=to[11]),ue=new CodeEditor({props:ao}),binding_callbacks.push(()=>bind$2(ue,"getCaretPosition",oo)),binding_callbacks.push(()=>bind$2(ue,"insertAtPos",io)),ue.$on("change",to[30]),{c(){create_component(ue.$$.fragment)},m(so,lo){mount_component(ue,so,lo),ro=!0},p(so,lo){const co={};lo[0]&256&&(co.value=so[8]?decodeJSBinding(so[8]):so[8]),lo[0]&4194304&&(co.completions=so[22]),lo[0]&8&&(co.autofocus=so[3]),lo[0]&16&&(co.placeholder=so[4]||"Add bindings by typing $ or use the menu on the right"),!eo&&lo[0]&1024&&(eo=!0,co.getCaretPosition=so[10],add_flush_callback(()=>eo=!1)),!no&&lo[0]&2048&&(no=!0,co.insertAtPos=so[11],add_flush_callback(()=>no=!1)),ue.$set(co)},i(so){ro||(transition_in(ue.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),ro=!1},d(so){destroy_component(ue,so)}}}function create_key_block$g(to){let ue,eo,no,ro;function oo(so){to[43](so)}function io(so){to[44](so)}let ao={value:to[9],completions:to[23],autofocus:to[3],placeholder:to[4]||"Add bindings by typing {{ or use the menu on the right",jsBindingWrapping:!1};return to[10]!==void 0&&(ao.getCaretPosition=to[10]),to[11]!==void 0&&(ao.insertAtPos=to[11]),ue=new CodeEditor({props:ao}),binding_callbacks.push(()=>bind$2(ue,"getCaretPosition",oo)),binding_callbacks.push(()=>bind$2(ue,"insertAtPos",io)),ue.$on("change",to[29]),{c(){create_component(ue.$$.fragment)},m(so,lo){mount_component(ue,so,lo),ro=!0},p(so,lo){const co={};lo[0]&512&&(co.value=so[9]),lo[0]&8388608&&(co.completions=so[23]),lo[0]&8&&(co.autofocus=so[3]),lo[0]&16&&(co.placeholder=so[4]||"Add bindings by typing {{ or use the menu on the right"),!eo&&lo[0]&1024&&(eo=!0,co.getCaretPosition=so[10],add_flush_callback(()=>eo=!1)),!no&&lo[0]&2048&&(no=!0,co.insertAtPos=so[11],add_flush_callback(()=>no=!1)),ue.$set(co)},i(so){ro||(transition_in(ue.$$.fragment,so),ro=!0)},o(so){transition_out(ue.$$.fragment,so),ro=!1},d(so){destroy_component(ue,so)}}}function create_if_block_3$W(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo;return no=new Heading({props:{size:"S",$$slots:{default:[create_default_slot_4$1E]},$$scope:{ctx:to}}}),oo=new Body({props:{$$slots:{default:[create_default_slot_3$2c]},$$scope:{ctx:to}}}),so=new Button({props:{secondary:!0,size:"S",$$slots:{default:[create_default_slot_2$2P]},$$scope:{ctx:to}}}),so.$on("click",to[47]),co=new Button({props:{cta:!0,size:"S",$$slots:{default:[create_default_slot_1$3W]},$$scope:{ctx:to}}}),co.$on("click",to[27]),{c(){ue=element("div"),eo=element("div"),create_component(no.$$.fragment),ro=space$1(),create_component(oo.$$.fragment),io=space$1(),ao=element("div"),create_component(so.$$.fragment),lo=space$1(),create_component(co.$$.fragment),attr(ao,"class","switch-actions svelte-biform"),attr(eo,"class","prompt-body svelte-biform"),attr(ue,"class","mode-overlay svelte-biform")},m(fo,po){insert$1(fo,ue,po),append$2(ue,eo),mount_component(no,eo,null),append$2(eo,ro),mount_component(oo,eo,null),append$2(eo,io),append$2(eo,ao),mount_component(so,ao,null),append$2(ao,lo),mount_component(co,ao,null),uo=!0},p(fo,po){const ho={};po[0]&32768|po[2]&16&&(ho.$$scope={dirty:po,ctx:fo}),no.$set(ho);const _o={};po[2]&16&&(_o.$$scope={dirty:po,ctx:fo}),oo.$set(_o);const go={};po[0]&64|po[2]&16&&(go.$$scope={dirty:po,ctx:fo}),so.$set(go);const bo={};po[0]&64|po[2]&16&&(bo.$$scope={dirty:po,ctx:fo}),co.$set(bo)},i(fo){uo||(transition_in(no.$$.fragment,fo),transition_in(oo.$$.fragment,fo),transition_in(so.$$.fragment,fo),transition_in(co.$$.fragment,fo),uo=!0)},o(fo){transition_out(no.$$.fragment,fo),transition_out(oo.$$.fragment,fo),transition_out(so.$$.fragment,fo),transition_out(co.$$.fragment,fo),uo=!1},d(fo){fo&&detach(ue),destroy_component(no),destroy_component(oo),destroy_component(so),destroy_component(co)}}}function create_default_slot_4$1E(to){let ue,eo,no;return{c(){ue=text$1("Switch to "),eo=text$1(to[15]),no=text$1("?")},m(ro,oo){insert$1(ro,ue,oo),insert$1(ro,eo,oo),insert$1(ro,no,oo)},p(ro,oo){oo[0]&32768&&set_data(eo,ro[15])},d(ro){ro&&(detach(ue),detach(eo),detach(no))}}}function create_default_slot_3$2c(to){let ue;return{c(){ue=text$1("This will discard anything in your binding")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_default_slot_2$2P(to){let ue,eo;return{c(){ue=text$1("No - keep "),eo=text$1(to[6])},m(no,ro){insert$1(no,ue,ro),insert$1(no,eo,ro)},p(no,ro){ro[0]&64&&set_data(eo,no[6])},d(no){no&&(detach(ue),detach(eo))}}}function create_default_slot_1$3W(to){let ue,eo;return{c(){ue=text$1("Yes - discard "),eo=text$1(to[6])},m(no,ro){insert$1(no,ue,ro),insert$1(no,eo,ro)},p(no,ro){ro[0]&64&&set_data(eo,no[6])},d(no){no&&(detach(ue),detach(eo))}}}function create_if_block_2$1h(to){let ue,eo;return ue=new SnippetSidePanel({props:{addSnippet:to[31],snippets:to[2]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&4&&(oo.snippets=no[2]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_1$27(to){let ue,eo;return ue=new EvaluationSidePanel({props:{expressionResult:to[16],expressionError:to[18],expressionLogs:to[17],evaluating:to[19],expression:to[21]?to[21]:""}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&65536&&(oo.expressionResult=no[16]),ro[0]&262144&&(oo.expressionError=no[18]),ro[0]&131072&&(oo.expressionLogs=no[17]),ro[0]&524288&&(oo.evaluating=no[19]),ro[0]&2097152&&(oo.expression=no[21]?no[21]:""),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block$43(to){let ue,eo;return ue=new BindingSidePanel({props:{bindings:to[13],allowHelpers:to[0],context:to[1],addHelper:to[24],addBinding:to[25],mode:to[14]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&8192&&(oo.bindings=no[13]),ro[0]&1&&(oo.allowHelpers=no[0]),ro[0]&2&&(oo.context=no[1]),ro[0]&16384&&(oo.mode=no[14]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot$5C(to){let ue,eo,no,ro,oo,io,ao,so,lo,co,uo,fo,po=to[5]&&create_if_block_6$m(to);const ho=[create_if_block_4$G,create_if_block_5$u],_o=[];function go(ko,So){return ko[6]===BindingMode.Text?0:ko[6]===BindingMode.JavaScript?1:-1}~(oo=go(to))&&(io=_o[oo]=ho[oo](to));let bo=to[15]&&create_if_block_3$W(to);const vo=[create_if_block$43,create_if_block_1$27,create_if_block_2$1h],yo=[];function wo(ko,So){return ko[7]===SidePanel.Bindings?0:ko[7]===SidePanel.Evaluation?1:ko[7]===SidePanel.Snippets?2:-1}return~(co=wo(to))&&(uo=yo[co]=vo[co](to)),{c(){ue=element("div"),eo=element("div"),po&&po.c(),no=space$1(),ro=element("div"),io&&io.c(),ao=space$1(),bo&&bo.c(),so=space$1(),lo=element("div"),uo&&uo.c(),attr(ro,"class","editor svelte-biform"),attr(eo,"class","main svelte-biform"),attr(lo,"class","side svelte-biform"),toggle_class(lo,"visible",!!to[7]),attr(ue,"class","binding-panel svelte-biform")},m(ko,So){insert$1(ko,ue,So),append$2(ue,eo),po&&po.m(eo,null),append$2(eo,no),append$2(eo,ro),~oo&&_o[oo].m(ro,null),append$2(ro,ao),bo&&bo.m(ro,null),append$2(ue,so),append$2(ue,lo),~co&&yo[co].m(lo,null),fo=!0},p(ko,So){ko[5]?po?(po.p(ko,So),So[0]&32&&transition_in(po,1)):(po=create_if_block_6$m(ko),po.c(),transition_in(po,1),po.m(eo,no)):po&&(group_outros(),transition_out(po,1,1,()=>{po=null}),check_outros());let Ao=oo;oo=go(ko),oo===Ao?~oo&&_o[oo].p(ko,So):(io&&(group_outros(),transition_out(_o[Ao],1,1,()=>{_o[Ao]=null}),check_outros()),~oo?(io=_o[oo],io?io.p(ko,So):(io=_o[oo]=ho[oo](ko),io.c()),transition_in(io,1),io.m(ro,ao)):io=null),ko[15]?bo?(bo.p(ko,So),So[0]&32768&&transition_in(bo,1)):(bo=create_if_block_3$W(ko),bo.c(),transition_in(bo,1),bo.m(ro,null)):bo&&(group_outros(),transition_out(bo,1,1,()=>{bo=null}),check_outros());let Io=co;co=wo(ko),co===Io?~co&&yo[co].p(ko,So):(uo&&(group_outros(),transition_out(yo[Io],1,1,()=>{yo[Io]=null}),check_outros()),~co?(uo=yo[co],uo?uo.p(ko,So):(uo=yo[co]=vo[co](ko),uo.c()),transition_in(uo,1),uo.m(lo,null)):uo=null),(!fo||So[0]&128)&&toggle_class(lo,"visible",!!ko[7])},i(ko){fo||(transition_in(po),transition_in(io),transition_in(bo),transition_in(uo),fo=!0)},o(ko){transition_out(po),transition_out(io),transition_out(bo),transition_out(uo),fo=!1},d(ko){ko&&detach(ue),po&&po.d(),~oo&&_o[oo].d(),bo&&bo.d(),~co&&yo[co].d()}}}function create_fragment$8K(to){let ue,eo;return ue=new DrawerContent({props:{padding:!1,$$slots:{default:[create_default_slot$5C]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&16777215|ro[2]&16&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$8K(to,ue,eo){var Fa;let no,ro,oo,io,ao,so,lo,co,uo,fo,po,ho,_o;component_subscribe(to,licensing,Ia=>eo(40,_o=Ia));const go=createEventDispatcher();let{bindings:bo=[]}=ue,{value:vo=""}=ue,{allowHBS:yo=!0}=ue,{allowJS:wo=!1}=ue,{allowHelpers:ko=!0}=ue,{allowSnippets:So=!0}=ue,{context:Ao=null}=ue,{snippets:Io=null}=ue,{autofocusEditor:Eo=!1}=ue,{placeholder:To=null}=ue,{showTabBar:Mo=!0}=ue,Vo,Fo,Po=(Fa=vo==null?void 0:vo.startsWith)==null?void 0:Fa.call(vo,"{{ js "),Ro=Po?vo:null,Do=Po?null:vo,Uo,qo,xo=null,Zo,Xo,Yo,Qo=!1;const Ko=Ia=>[hbAutocomplete([...Ia,...getHelperCompletions(EditorModes$1.Handlebars)])],ra=(Ia,Za,ls)=>{const xa=[jsAutocomplete([...Ia,...getHelperCompletions(EditorModes$1.JS)])];return ls&&Za&&xa.push(snippetAutoComplete(Za)),xa},ea=(Ia,Za)=>{let ls=[];return Ia&&ls.push(BindingMode.Text),Za&&ls.push(BindingMode.JavaScript),ls},ia=(Ia,Za,ls,xa)=>{let bs=[];return Ia!=null&&Ia.length&&bs.push(SidePanel.Bindings),Za&&Object.keys(Za).length>0&&bs.push(SidePanel.Evaluation),ls&&xa===BindingMode.JavaScript&&bs.push(SidePanel.Snippets),bs},Jo=debounce((Ia,Za,ls)=>{try{eo(18,Yo=void 0);const xa=processStringWithLogsSync(Ia||"",{...Za,snippets:ls},{noThrow:!1});eo(16,Zo=xa.result),eo(17,Xo=xa.logs)}catch(xa){eo(16,Zo=void 0),eo(18,Yo=xa)}eo(19,Qo=!1)},260),sa=(Ia,Za,ls)=>{eo(19,Qo=!0),Jo(Ia,Za,ls)},Aa=Ia=>format$1(Ia,{keyColor:"#e06c75",numberColor:"#e5c07b",stringColor:"#98c379",trueColor:"#d19a66",falseColor:"#d19a66",nullColor:"#c678dd"}),pa=(Ia,Za,ls)=>{const xa=Ia.map(Ss=>Ss.runtimeBinding.startsWith('trim "')?`{{ ${Ss.runtimeBinding} }}`:`{{ literal ${Ss.runtimeBinding} }}`),bs=processObjectSync(xa,{...Za,snippets:ls});return Ia.map((Ss,Xa)=>{if(!Za||typeof bs!="object")return Ss;const Bs=JSON.stringify(bs[Xa],null,2);return{...Ss,value:Bs,valueHTML:Aa(Bs)}})},va=Ia=>{const Za=readableToRuntimeBinding(io,Ia);go("change",Ia),sa(Za,Ao,Io)},da=(Ia,Za)=>{fo.onSelectHelper(Za?Ro:Do,Ia,{js:Za,dontDecode:void 0})},Ra=(Ia,{forceJS:Za}={})=>{const ls=ao||Za;fo.onSelectBinding(ls?Ro:Do,Ia,{js:ls,dontDecode:void 0})},Ba=Ia=>{if(xo||Ia===Vo)return;let Za=lo;Vo===BindingMode.JavaScript&&Za&&(Za=decodeJSBinding(Za)),Za!=null&&Za.length?eo(15,xo=Ia):eo(6,Vo=Ia)},Va=()=>{eo(8,Ro=null),eo(9,Do=null),va(null),eo(6,Vo=xo),eo(15,xo=null)},Oa=Ia=>{eo(7,Fo=Ia===Fo?null:Ia)},Pa=Ia=>{eo(9,Do=Ia.detail),va(Do)},ya=Ia=>{var Za;eo(8,Ro=encodeJSBinding(Ia.detail)),(Za=Ia.detail)!=null&&Za.trim()?va(Ro):va(null)},ds=Ia=>fo.onSelectSnippet(Ia);onMount(()=>{const Ia=Po?BindingMode.JavaScript:BindingMode.Text;ro.includes(Ia)?eo(6,Vo=Ia):eo(6,Vo=ro[0]),eo(7,Fo=oo[0])});const Ma=Ia=>Ba(Ia),ga=Ia=>Oa(Ia);function $a(Ia){Uo=Ia,eo(10,Uo)}function fa(Ia){qo=Ia,eo(11,qo)}function ma(Ia){Uo=Ia,eo(10,Uo)}function Da(Ia){qo=Ia,eo(11,qo)}const wa=()=>{eo(15,xo=null)};return to.$$set=Ia=>{"bindings"in Ia&&eo(32,bo=Ia.bindings),"value"in Ia&&eo(33,vo=Ia.value),"allowHBS"in Ia&&eo(34,yo=Ia.allowHBS),"allowJS"in Ia&&eo(35,wo=Ia.allowJS),"allowHelpers"in Ia&&eo(0,ko=Ia.allowHelpers),"allowSnippets"in Ia&&eo(36,So=Ia.allowSnippets),"context"in Ia&&eo(1,Ao=Ia.context),"snippets"in Ia&&eo(2,Io=Ia.snippets),"autofocusEditor"in Ia&&eo(3,Eo=Ia.autofocusEditor),"placeholder"in Ia&&eo(4,To=Ia.placeholder),"showTabBar"in Ia&&eo(5,Mo=Ia.showTabBar)},to.$$.update=()=>{to.$$.dirty[1]&544&&eo(37,no=So&&!_o.isFreePlan),to.$$.dirty[1]&24&&eo(20,ro=ea(yo,wo)),to.$$.dirty[0]&66|to.$$.dirty[1]&34&&eo(12,oo=ia(bo,Ao,So,Vo)),to.$$.dirty[0]&6|to.$$.dirty[1]&2&&eo(13,io=pa(bo,Ao,Io)),to.$$.dirty[0]&64&&(ao=Vo===BindingMode.JavaScript),to.$$.dirty[0]&64&&eo(14,so=Vo===BindingMode.JavaScript?EditorModes$1.JS:EditorModes$1.Handlebars),to.$$.dirty[0]&17152&&eo(21,lo=so===EditorModes$1.JS?Ro:Do),to.$$.dirty[0]&8192|to.$$.dirty[1]&4&&eo(39,co=readableToRuntimeBinding(io,vo)),to.$$.dirty[0]&6|to.$$.dirty[1]&256&&sa(co,Ao,Io),to.$$.dirty[0]&24576&&eo(38,uo=bindingsToCompletions(io,so)),to.$$.dirty[0]&3072&&(fo=new BindingHelpers(Uo,qo)),to.$$.dirty[1]&128&&eo(23,po=Ko(uo)),to.$$.dirty[0]&4|to.$$.dirty[1]&192&&eo(22,ho=ra(uo,Io,no)),to.$$.dirty[0]&4224&&Fo&&!oo.includes(Fo)&&eo(7,Fo=oo[0])},[ko,Ao,Io,Eo,To,Mo,Vo,Fo,Ro,Do,Uo,qo,oo,io,so,xo,Zo,Xo,Yo,Qo,ro,lo,ho,po,da,Ra,Ba,Va,Oa,Pa,ya,ds,bo,vo,yo,wo,So,no,uo,co,_o,Ma,ga,$a,fa,ma,Da,wa]}class BindingPanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8K,create_fragment$8K,safe_not_equal,{bindings:32,value:33,allowHBS:34,allowJS:35,allowHelpers:0,allowSnippets:36,context:1,snippets:2,autofocusEditor:3,placeholder:4,showTabBar:5},null,[-1,-1,-1])}}function create_fragment$8J(to){let ue,eo;return ue=new BindingPanel({props:{bindings:to[6],context:{...to[7].selectedComponentContext,...to[5]},snippets:to[8],value:to[0],allowHBS:to[1],allowJS:to[2],allowHelpers:to[3],autofocusEditor:to[4]}}),ue.$on("change",to[10]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,[ro]){const oo={};ro&64&&(oo.bindings=no[6]),ro&160&&(oo.context={...no[7].selectedComponentContext,...no[5]}),ro&256&&(oo.snippets=no[8]),ro&1&&(oo.value=no[0]),ro&2&&(oo.allowHBS=no[1]),ro&4&&(oo.allowJS=no[2]),ro&8&&(oo.allowHelpers=no[3]),ro&16&&(oo.autofocusEditor=no[4]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function instance$8J(to,ue,eo){let no,ro,oo;component_subscribe(to,previewStore,_o=>eo(7,ro=_o)),component_subscribe(to,snippets$1,_o=>eo(8,oo=_o));let{bindings:io=[]}=ue,{value:ao=""}=ue,{allowHBS:so=!0}=ue,{allowJS:lo=!1}=ue,{allowHelpers:co=!0}=ue,{autofocusEditor:uo=!1}=ue,{context:fo=null}=ue;const po=_o=>_o!=null&&_o.length?_o==null?void 0:_o.map(go=>({...go,type:null})):_o;onMount(previewStore.requestComponentContext);function ho(_o){bubble.call(this,to,_o)}return to.$$set=_o=>{"bindings"in _o&&eo(9,io=_o.bindings),"value"in _o&&eo(0,ao=_o.value),"allowHBS"in _o&&eo(1,so=_o.allowHBS),"allowJS"in _o&&eo(2,lo=_o.allowJS),"allowHelpers"in _o&&eo(3,co=_o.allowHelpers),"autofocusEditor"in _o&&eo(4,uo=_o.autofocusEditor),"context"in _o&&eo(5,fo=_o.context)},to.$$.update=()=>{to.$$.dirty&512&&eo(6,no=po(io))},[ao,so,lo,co,uo,fo,no,ro,oo,io,ho]}class ClientBindingPanel extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8J,create_fragment$8J,safe_not_equal,{bindings:9,value:0,allowHBS:1,allowJS:2,allowHelpers:3,autofocusEditor:4,context:5})}}const DrawerBindableInput_svelte_svelte_type_style_lang="";function create_if_block$42(to){let ue,eo,no,ro,oo;return eo=new Icon({props:{size:"S",name:"FlashOn"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),attr(ue,"class","icon svelte-570cq4")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),no=!0,ro||(oo=listen(ue,"click",to[25]),ro=!0)},p:noop$6,i(io){no||(transition_in(eo.$$.fragment,io),no=!0)},o(io){transition_out(eo.$$.fragment,io),no=!1},d(io){io&&detach(ue),destroy_component(eo),ro=!1,oo()}}}function create_default_slot$5B(to){let ue;return{c(){ue=text$1("Save")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_buttons_slot$g(to){let ue,eo;return ue=new Button({props:{cta:!0,slot:"buttons",$$slots:{default:[create_default_slot$5B]},$$scope:{ctx:to}}}),ue.$on("click",to[19]),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[1]&1&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_body_slot$f(to){let ue,eo,no;var ro=to[0];function oo(io,ao){return{props:{slot:"body",value:io[15],bindings:io[1],allowHBS:io[6],allowJS:io[7],allowHelpers:io[8],context:io[13]}}}return ro&&(ue=construct_svelte_component(ro,oo(to)),ue.$on("change",to[26])),{c(){ue&&create_component(ue.$$.fragment),eo=empty$2()},m(io,ao){ue&&mount_component(ue,io,ao),insert$1(io,eo,ao),no=!0},p(io,ao){if(ao[0]&1&&ro!==(ro=io[0])){if(ue){group_outros();const so=ue;transition_out(so.$$.fragment,1,0,()=>{destroy_component(so,1)}),check_outros()}ro?(ue=construct_svelte_component(ro,oo(io)),ue.$on("change",io[26]),create_component(ue.$$.fragment),transition_in(ue.$$.fragment,1),mount_component(ue,eo.parentNode,eo)):ue=null}else if(ro){const so={};ao[0]&32768&&(so.value=io[15]),ao[0]&2&&(so.bindings=io[1]),ao[0]&64&&(so.allowHBS=io[6]),ao[0]&128&&(so.allowJS=io[7]),ao[0]&256&&(so.allowHelpers=io[8]),ao[0]&8192&&(so.context=io[13]),ue.$set(so)}},i(io){no||(ue&&transition_in(ue.$$.fragment,io),no=!0)},o(io){ue&&transition_out(ue.$$.fragment,io),no=!1},d(io){io&&detach(eo),ue&&destroy_component(ue,io)}}}function create_fragment$8I(to){let ue,eo,no,ro,oo,io;eo=new Input$5({props:{label:to[4],disabled:to[5],readonly:to[18],value:to[18]?"(JavaScript function)":to[15],placeholder:to[3],updateOnChange:to[9],autocomplete:to[14]}}),eo.$on("change",to[24]),eo.$on("blur",to[21]);let ao=!to[5]&&!to[11]&&create_if_block$42(to),so={title:to[2]??to[3]??"Bindings",forceModal:to[12],$$slots:{body:[create_body_slot$f],buttons:[create_buttons_slot$g]},$$scope:{ctx:to}};return oo=new Drawer({props:so}),to[27](oo),oo.$on("drawerHide",to[22]),oo.$on("drawerShow",to[28]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),ao&&ao.c(),ro=space$1(),create_component(oo.$$.fragment),attr(ue,"class","control svelte-570cq4"),toggle_class(ue,"disabled",to[5])},m(lo,co){insert$1(lo,ue,co),mount_component(eo,ue,null),append$2(ue,no),ao&&ao.m(ue,null),insert$1(lo,ro,co),mount_component(oo,lo,co),io=!0},p(lo,co){const uo={};co[0]&16&&(uo.label=lo[4]),co[0]&32&&(uo.disabled=lo[5]),co[0]&262144&&(uo.readonly=lo[18]),co[0]&294912&&(uo.value=lo[18]?"(JavaScript function)":lo[15]),co[0]&8&&(uo.placeholder=lo[3]),co[0]&512&&(uo.updateOnChange=lo[9]),co[0]&16384&&(uo.autocomplete=lo[14]),eo.$set(uo),!lo[5]&&!lo[11]?ao?(ao.p(lo,co),co[0]&2080&&transition_in(ao,1)):(ao=create_if_block$42(lo),ao.c(),transition_in(ao,1),ao.m(ue,null)):ao&&(group_outros(),transition_out(ao,1,1,()=>{ao=null}),check_outros()),(!io||co[0]&32)&&toggle_class(ue,"disabled",lo[5]);const fo={};co[0]&12&&(fo.title=lo[2]??lo[3]??"Bindings"),co[0]&4096&&(fo.forceModal=lo[12]),co[0]&172483|co[1]&1&&(fo.$$scope={dirty:co,ctx:lo}),oo.$set(fo)},i(lo){io||(transition_in(eo.$$.fragment,lo),transition_in(ao),transition_in(oo.$$.fragment,lo),io=!0)},o(lo){transition_out(eo.$$.fragment,lo),transition_out(ao),transition_out(oo.$$.fragment,lo),io=!1},d(lo){lo&&(detach(ue),detach(ro)),destroy_component(eo),ao&&ao.d(),to[27](null),destroy_component(oo,lo)}}}function instance$8I(to,ue,eo){let no,ro,oo,{panel:io=ClientBindingPanel}=ue,{value:ao=""}=ue,{bindings:so=[]}=ue,{title:lo}=ue,{placeholder:co}=ue,{label:uo}=ue,{disabled:fo=!1}=ue,{allowHBS:po=!0}=ue,{allowJS:ho=!0}=ue,{allowHelpers:_o=!0}=ue,{updateOnChange:go=!0}=ue,{key:bo}=ue,{disableBindings:vo=!1}=ue,{forceModal:yo=!1}=ue,{context:wo=null}=ue,{autocomplete:ko}=ue;const So=createEventDispatcher();let Ao,Io=ao;const Eo=()=>{To(ro),Mo(),builderStore.propertyFocus(),Ao.hide()};setContext("binding-drawer-actions",{save:Eo});const To=qo=>{Io=readableToRuntimeBinding(so,qo),So("change",Io)},Mo=()=>{So("blur",Io)},Vo=qo=>{builderStore.propertyFocus(),So("drawerHide",qo.detail)},Fo=qo=>To(qo.detail),Po=()=>{builderStore.propertyFocus(bo),Ao.show()},Ro=qo=>eo(17,ro=qo.detail);function Do(qo){binding_callbacks[qo?"unshift":"push"](()=>{Ao=qo,eo(16,Ao)})}function Uo(qo){bubble.call(this,to,qo)}return to.$$set=qo=>{"panel"in qo&&eo(0,io=qo.panel),"value"in qo&&eo(23,ao=qo.value),"bindings"in qo&&eo(1,so=qo.bindings),"title"in qo&&eo(2,lo=qo.title),"placeholder"in qo&&eo(3,co=qo.placeholder),"label"in qo&&eo(4,uo=qo.label),"disabled"in qo&&eo(5,fo=qo.disabled),"allowHBS"in qo&&eo(6,po=qo.allowHBS),"allowJS"in qo&&eo(7,ho=qo.allowJS),"allowHelpers"in qo&&eo(8,_o=qo.allowHelpers),"updateOnChange"in qo&&eo(9,go=qo.updateOnChange),"key"in qo&&eo(10,bo=qo.key),"disableBindings"in qo&&eo(11,vo=qo.disableBindings),"forceModal"in qo&&eo(12,yo=qo.forceModal),"context"in qo&&eo(13,wo=qo.context),"autocomplete"in qo&&eo(14,ko=qo.autocomplete)},to.$$.update=()=>{to.$$.dirty[0]&8388610&&eo(15,no=runtimeToReadableBinding(so,ao)),to.$$.dirty[0]&32768&&eo(17,ro=no),to.$$.dirty[0]&8388608&&eo(18,oo=isJSBinding(ao))},[io,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,no,Ao,ro,oo,Eo,To,Mo,Vo,ao,Fo,Po,Ro,Do,Uo]}class DrawerBindableInput extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8I,create_fragment$8I,safe_not_equal,{panel:0,value:23,bindings:1,title:2,placeholder:3,label:4,disabled:5,allowHBS:6,allowJS:7,allowHelpers:8,updateOnChange:9,key:10,disableBindings:11,forceModal:12,context:13,autocomplete:14},null,[-1,-1])}}const KeyValueBuilder_svelte_svelte_type_style_lang="";function get_each_context$1E(to,ue,eo){const no=to.slice();return no[39]=ue[eo],no[40]=ue,no[41]=eo,no}function get_each_context_1$q(to,ue,eo){const no=to.slice();return no[42]=ue[eo],no}function create_if_block_2$1g(to){let ue,eo,no,ro=to[4]&&create_if_block_10$6(to),oo=ensure_array_like(to[23]),io=[];for(let so=0;so<oo.length;so+=1)io[so]=create_each_block$1E(get_each_context$1E(to,oo,so));const ao=so=>transition_out(io[so],1,1,()=>{io[so]=null});return{c(){ro&&ro.c(),ue=space$1(),eo=element("div");for(let so=0;so<io.length;so+=1)io[so].c();attr(eo,"class","container svelte-1gk02qa"),toggle_class(eo,"container-active",to[6]),toggle_class(eo,"container-menu",to[13]),toggle_class(eo,"readOnly",to[1]),toggle_class(eo,"readOnly-menu",to[1]&&to[13])},m(so,lo){ro&&ro.m(so,lo),insert$1(so,ue,lo),insert$1(so,eo,lo);for(let co=0;co<io.length;co+=1)io[co]&&io[co].m(eo,null);no=!0},p(so,lo){if(so[4]?ro?(ro.p(so,lo),lo[0]&16&&transition_in(ro,1)):(ro=create_if_block_10$6(so),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros()),lo[0]&128840162){oo=ensure_array_like(so[23]);let co;for(co=0;co<oo.length;co+=1){const uo=get_each_context$1E(so,oo,co);io[co]?(io[co].p(uo,lo),transition_in(io[co],1)):(io[co]=create_each_block$1E(uo),io[co].c(),transition_in(io[co],1),io[co].m(eo,null))}for(group_outros(),co=oo.length;co<io.length;co+=1)ao(co);check_outros()}(!no||lo[0]&64)&&toggle_class(eo,"container-active",so[6]),(!no||lo[0]&8192)&&toggle_class(eo,"container-menu",so[13]),(!no||lo[0]&2)&&toggle_class(eo,"readOnly",so[1]),(!no||lo[0]&8194)&&toggle_class(eo,"readOnly-menu",so[1]&&so[13])},i(so){if(!no){transition_in(ro);for(let lo=0;lo<oo.length;lo+=1)transition_in(io[lo]);no=!0}},o(so){transition_out(ro),io=io.filter(Boolean);for(let lo=0;lo<io.length;lo+=1)transition_out(io[lo]);no=!1},d(so){so&&(detach(ue),detach(eo)),ro&&ro.d(so),destroy_each(io,so)}}}function create_if_block_10$6(to){let ue,eo,no,ro,oo,io;eo=new Label({props:{tooltip:to[11],$$slots:{default:[create_default_slot_5$1f]},$$scope:{ctx:to}}}),ro=new Label({props:{$$slots:{default:[create_default_slot_4$1D]},$$scope:{ctx:to}}});let ao=to[6]&&create_if_block_11$3(to);return{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),oo=space$1(),ao&&ao.c(),attr(ue,"class","container svelte-1gk02qa"),toggle_class(ue,"container-active",to[6])},m(so,lo){insert$1(so,ue,lo),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),append$2(ue,oo),ao&&ao.m(ue,null),io=!0},p(so,lo){const co={};lo[0]&2048&&(co.tooltip=so[11]),lo[0]&1152|lo[1]&16384&&(co.$$scope={dirty:lo,ctx:so}),eo.$set(co);const uo={};lo[0]&768|lo[1]&16384&&(uo.$$scope={dirty:lo,ctx:so}),ro.$set(uo),so[6]?ao?lo[0]&64&&transition_in(ao,1):(ao=create_if_block_11$3(so),ao.c(),transition_in(ao,1),ao.m(ue,null)):ao&&(group_outros(),transition_out(ao,1,1,()=>{ao=null}),check_outros()),(!io||lo[0]&64)&&toggle_class(ue,"container-active",so[6])},i(so){io||(transition_in(eo.$$.fragment,so),transition_in(ro.$$.fragment,so),transition_in(ao),io=!0)},o(so){transition_out(eo.$$.fragment,so),transition_out(ro.$$.fragment,so),transition_out(ao),io=!1},d(so){so&&detach(ue),destroy_component(eo),destroy_component(ro),ao&&ao.d()}}}function create_default_slot_5$1f(to){let ue=(to[10]||to[7])+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&1152&&ue!==(ue=(no[10]||no[7])+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_default_slot_4$1D(to){let ue=(to[9]||to[8])+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&768&&ue!==(ue=(no[9]||no[8])+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_if_block_11$3(to){let ue,eo;return ue=new Label({props:{$$slots:{default:[create_default_slot_3$2b]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_3$2b(to){let ue;return{c(){ue=text$1("Active")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_else_block_2$6(to){let ue,eo,no;function ro(io){to[30](io,to[39])}let oo={readonly:to[1]};return to[39].name!==void 0&&(oo.value=to[39].name),ue=new Input$5({props:oo}),binding_callbacks.push(()=>bind$2(ue,"value",ro)),ue.$on("blur",to[26]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){to=io;const so={};ao[0]&2&&(so.readonly=to[1]),!eo&&ao[0]&8388608&&(eo=!0,so.value=to[39].name,add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_if_block_9$c(to){let ue,eo;function no(...ro){return to[29](to[39],to[40],to[41],...ro)}return ue=new DrawerBindableInput({props:{bindings:to[14],placeholder:to[7],disabled:to[1],value:to[39].name,allowJS:to[19],allowHelpers:to[16],drawerLeft:to[15]}}),ue.$on("blur",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro;const io={};oo[0]&16384&&(io.bindings=to[14]),oo[0]&128&&(io.placeholder=to[7]),oo[0]&2&&(io.disabled=to[1]),oo[0]&8388608&&(io.value=to[39].name),oo[0]&524288&&(io.allowJS=to[19]),oo[0]&65536&&(io.allowHelpers=to[16]),oo[0]&32768&&(io.drawerLeft=to[15]),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_else_block_1$m(to){let ue,eo,no;function ro(io){to[33](io,to[39])}let oo={placeholder:to[8],readonly:to[1]};return to[39].value!==void 0&&(oo.value=to[39].value),ue=new Input$5({props:oo}),binding_callbacks.push(()=>bind$2(ue,"value",ro)),ue.$on("blur",to[26]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){to=io;const so={};ao[0]&256&&(so.placeholder=to[8]),ao[0]&2&&(so.readonly=to[1]),!eo&&ao[0]&8388608&&(eo=!0,so.value=to[39].value,add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_if_block_8$e(to){let ue,eo;function no(...ro){return to[32](to[39],to[40],to[41],...ro)}return ue=new DrawerBindableInput({props:{bindings:to[14],placeholder:to[8],disabled:to[1],value:to[39].value,allowJS:to[19],allowHelpers:to[16],drawerLeft:to[15]}}),ue.$on("blur",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro;const io={};oo[0]&16384&&(io.bindings=to[14]),oo[0]&256&&(io.placeholder=to[8]),oo[0]&2&&(io.disabled=to[1]),oo[0]&8388608&&(io.value=to[39].value),oo[0]&524288&&(io.allowJS=to[19]),oo[0]&65536&&(io.allowHelpers=to[16]),oo[0]&32768&&(io.drawerLeft=to[15]),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_if_block_7$j(to){let ue,eo,no;function ro(io){to[31](io,to[39])}let oo={compare:to[21],options:to[5]};return to[39].value!==void 0&&(oo.value=to[39].value),ue=new Select_1$1({props:oo}),binding_callbacks.push(()=>bind$2(ue,"value",ro)),ue.$on("change",to[26]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){to=io;const so={};ao[0]&2097152&&(so.compare=to[21]),ao[0]&32&&(so.options=to[5]),!eo&&ao[0]&8388608&&(eo=!0,so.value=to[39].value,add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_if_block_6$l(to){let ue,eo;return ue=new Select_1$1({props:{readonly:!0,value:"Array",options:["Array"]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p:noop$6,i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_if_block_5$t(to){let ue,eo,no;function ro(io){to[34](io,to[41])}let oo={};return to[24][to[41]]!==void 0&&(oo.value=to[24][to[41]]),ue=new Toggle({props:oo}),binding_callbacks.push(()=>bind$2(ue,"value",ro)),ue.$on("change",to[26]),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),no=!0},p(io,ao){to=io;const so={};!eo&&ao[0]&16777216&&(eo=!0,so.value=to[24][to[41]],add_flush_callback(()=>eo=!1)),ue.$set(so)},i(io){no||(transition_in(ue.$$.fragment,io),no=!0)},o(io){transition_out(ue.$$.fragment,io),no=!1},d(io){destroy_component(ue,io)}}}function create_if_block_4$F(to){let ue,eo;function no(){return to[35](to[41])}return ue=new Icon({props:{hoverable:!0,name:"Close"}}),ue.$on("click",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_if_block_3$V(to){let ue,eo;return ue=new ActionMenu({props:{$$slots:{control:[create_control_slot$6],default:[create_default_slot_1$3V]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro[0]&8392704|ro[1]&16384&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_2$2O(to){let ue=to[42].text+"",eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&4096&&ue!==(ue=no[42].text+"")&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_each_block_1$q(to){let ue,eo;function no(){return to[36](to[42],to[39])}return ue=new Item$1({props:{$$slots:{default:[create_default_slot_2$2O]},$$scope:{ctx:to}}}),ue.$on("click",no),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,oo){to=ro;const io={};oo[0]&4096|oo[1]&16384&&(io.$$scope={dirty:oo,ctx:to}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}function create_default_slot_1$3V(to){let ue,eo,no=ensure_array_like(to[12]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block_1$q(get_each_context_1$q(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){for(let io=0;io<ro.length;io+=1)ro[io].c();ue=space$1()},m(io,ao){for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(io,ao);insert$1(io,ue,ao),eo=!0},p(io,ao){if(ao[0]&8392704){no=ensure_array_like(io[12]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context_1$q(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block_1$q(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue.parentNode,ue))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_control_slot$6(to){let ue,eo,no,ro;return eo=new Icon({props:{size:"S",hoverable:!0,name:"MoreSmallList"}}),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),attr(ue,"slot","control"),attr(ue,"class","control icon svelte-1gk02qa")},m(oo,io){insert$1(oo,ue,io),mount_component(eo,ue,null),append$2(ue,no),ro=!0},p:noop$6,i(oo){ro||(transition_in(eo.$$.fragment,oo),ro=!0)},o(oo){transition_out(eo.$$.fragment,oo),ro=!1},d(oo){oo&&detach(ue),destroy_component(eo)}}}function create_each_block$1E(to){var ko;let ue,eo,no,ro,oo,io,ao,so,lo,co,uo;const fo=[create_if_block_9$c,create_else_block_2$6],po=[];function ho(So,Ao){return So[18]?0:1}ue=ho(to),eo=po[ue]=fo[ue](to);const _o=[create_if_block_6$l,create_if_block_7$j,create_if_block_8$e,create_else_block_1$m],go=[];function bo(So,Ao){return Ao[0]&8388608&&(ro=null),ro==null&&(ro=!!isJsonArray(So[39].value)),ro?0:So[5]?1:So[14]&&So[14].length?2:3}oo=bo(to,[-1,-1]),io=go[oo]=_o[oo](to);let vo=to[6]&&create_if_block_5$t(to),yo=!to[1]&&create_if_block_4$F(to),wo=((ko=to[12])==null?void 0:ko.length)>0&&to[13]&&create_if_block_3$V(to);return{c(){eo.c(),no=space$1(),io.c(),ao=space$1(),vo&&vo.c(),so=space$1(),yo&&yo.c(),lo=space$1(),wo&&wo.c(),co=empty$2()},m(So,Ao){po[ue].m(So,Ao),insert$1(So,no,Ao),go[oo].m(So,Ao),insert$1(So,ao,Ao),vo&&vo.m(So,Ao),insert$1(So,so,Ao),yo&&yo.m(So,Ao),insert$1(So,lo,Ao),wo&&wo.m(So,Ao),insert$1(So,co,Ao),uo=!0},p(So,Ao){var To;let Io=ue;ue=ho(So),ue===Io?po[ue].p(So,Ao):(group_outros(),transition_out(po[Io],1,1,()=>{po[Io]=null}),check_outros(),eo=po[ue],eo?eo.p(So,Ao):(eo=po[ue]=fo[ue](So),eo.c()),transition_in(eo,1),eo.m(no.parentNode,no));let Eo=oo;oo=bo(So,Ao),oo===Eo?go[oo].p(So,Ao):(group_outros(),transition_out(go[Eo],1,1,()=>{go[Eo]=null}),check_outros(),io=go[oo],io?io.p(So,Ao):(io=go[oo]=_o[oo](So),io.c()),transition_in(io,1),io.m(ao.parentNode,ao)),So[6]?vo?(vo.p(So,Ao),Ao[0]&64&&transition_in(vo,1)):(vo=create_if_block_5$t(So),vo.c(),transition_in(vo,1),vo.m(so.parentNode,so)):vo&&(group_outros(),transition_out(vo,1,1,()=>{vo=null}),check_outros()),So[1]?yo&&(group_outros(),transition_out(yo,1,1,()=>{yo=null}),check_outros()):yo?(yo.p(So,Ao),Ao[0]&2&&transition_in(yo,1)):(yo=create_if_block_4$F(So),yo.c(),transition_in(yo,1),yo.m(lo.parentNode,lo)),((To=So[12])==null?void 0:To.length)>0&&So[13]?wo?(wo.p(So,Ao),Ao[0]&12288&&transition_in(wo,1)):(wo=create_if_block_3$V(So),wo.c(),transition_in(wo,1),wo.m(co.parentNode,co)):wo&&(group_outros(),transition_out(wo,1,1,()=>{wo=null}),check_outros())},i(So){uo||(transition_in(eo),transition_in(io),transition_in(vo),transition_in(yo),transition_in(wo),uo=!0)},o(So){transition_out(eo),transition_out(io),transition_out(vo),transition_out(yo),transition_out(wo),uo=!1},d(So){So&&(detach(no),detach(ao),detach(so),detach(lo),detach(co)),po[ue].d(So),go[oo].d(So),vo&&vo.d(So),yo&&yo.d(So),wo&&wo.d(So)}}}function create_if_block$41(to){let ue,eo,no;return eo=new ActionButton({props:{disabled:to[20],icon:"Add",secondary:!0,thin:!0,outline:!0,$$slots:{default:[create_default_slot$5A]},$$scope:{ctx:to}}}),eo.$on("click",to[22]),{c(){ue=element("div"),create_component(eo.$$.fragment)},m(ro,oo){insert$1(ro,ue,oo),mount_component(eo,ue,null),no=!0},p(ro,oo){const io={};oo[0]&1048576&&(io.disabled=ro[20]),oo[0]&131080|oo[1]&16384&&(io.$$scope={dirty:oo,ctx:ro}),eo.$set(io)},i(ro){no||(transition_in(eo.$$.fragment,ro),no=!0)},o(ro){transition_out(eo.$$.fragment,ro),no=!1},d(ro){ro&&detach(ue),destroy_component(eo)}}}function create_else_block$1y(to){let ue=`Add${to[3]?` ${lowercase(to[3])}`:""}`,eo;return{c(){eo=text$1(ue)},m(no,ro){insert$1(no,eo,ro)},p(no,ro){ro[0]&8&&ue!==(ue=`Add${no[3]?` ${lowercase(no[3])}`:""}`)&&set_data(eo,ue)},d(no){no&&detach(eo)}}}function create_if_block_1$26(to){let ue;return{c(){ue=text$1(to[17])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no[0]&131072&&set_data(ue,eo[17])},d(eo){eo&&detach(ue)}}}function create_default_slot$5A(to){let ue;function eo(oo,io){return oo[17]?create_if_block_1$26:create_else_block$1y}let no=eo(to),ro=no(to);return{c(){ro.c(),ue=empty$2()},m(oo,io){ro.m(oo,io),insert$1(oo,ue,io)},p(oo,io){no===(no=eo(oo))&&ro?ro.p(oo,io):(ro.d(1),ro=no(oo),ro&&(ro.c(),ro.m(ue.parentNode,ue)))},d(oo){oo&&detach(ue),ro.d(oo)}}}function create_fragment$8H(to){let ue=Object.keys(to[0]||{}).length>0,eo,no,ro,oo=ue&&create_if_block_2$1g(to),io=!to[1]&&!to[2]&&create_if_block$41(to);return{c(){oo&&oo.c(),eo=space$1(),io&&io.c(),no=empty$2()},m(ao,so){oo&&oo.m(ao,so),insert$1(ao,eo,so),io&&io.m(ao,so),insert$1(ao,no,so),ro=!0},p(ao,so){so[0]&1&&(ue=Object.keys(ao[0]||{}).length>0),ue?oo?(oo.p(ao,so),so[0]&1&&transition_in(oo,1)):(oo=create_if_block_2$1g(ao),oo.c(),transition_in(oo,1),oo.m(eo.parentNode,eo)):oo&&(group_outros(),transition_out(oo,1,1,()=>{oo=null}),check_outros()),!ao[1]&&!ao[2]?io?(io.p(ao,so),so[0]&6&&transition_in(io,1)):(io=create_if_block$41(ao),io.c(),transition_in(io,1),io.m(no.parentNode,no)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros())},i(ao){ro||(transition_in(oo),transition_in(io),ro=!0)},o(ao){transition_out(oo),transition_out(io),ro=!1},d(ao){ao&&(detach(eo),detach(no)),oo&&oo.d(ao),io&&io.d(ao)}}}function isJsonArray(to){return!to||typeof to=="string"?!1:to.type==="array"?!0:to.type==="json"&&to.subtype==="array"}function instance$8H(to,ue,eo){let no=createEventDispatcher(),{defaults:ro}=ue,{object:oo=ro||{}}=ue,{activity:io={}}=ue,{readOnly:ao}=ue,{noAddButton:so}=ue,{name:lo}=ue,{headings:co=!1}=ue,{options:uo}=ue,{toggle:fo}=ue,{keyPlaceholder:po="Key"}=ue,{valuePlaceholder:ho="Value"}=ue,{valueHeading:_o}=ue,{keyHeading:go}=ue,{tooltip:bo}=ue,{menuItems:vo}=ue,{showMenu:yo=!1}=ue,{bindings:wo=[]}=ue,{bindingDrawerLeft:ko}=ue,{allowHelpers:So=!0}=ue,{customButtonText:Ao=null}=ue,{keyBindings:Io=!1}=ue,{allowJS:Eo=!1}=ue,{actionButtonDisabled:To=!1}=ue,{compare:Mo=(ea,ia)=>ea===ia}=ue,Vo=Object.entries(oo||{}).map(([ea,ia])=>({name:ea,value:ia})),Fo=Po(io);function Po(ea){if(!ea||typeof ea!="object")return[];const ia=Array(Vo.length);for(let[Jo,sa]of Object.entries(ea)){const Aa=Vo.find(va=>va.name===Jo),pa=Vo.indexOf(Aa);ia[pa]=pa!==-1?sa:!0}return ia}function Ro(){eo(23,Vo=[...Vo,{name:"",value:""}]),eo(24,Fo=[...Fo,!0]),Uo()}function Do(ea){Vo.splice(ea,1),Fo.splice(ea,1),Uo()}function Uo(){eo(23,Vo);const ea={};for(let ia=0;ia<Vo.length;ia++){const Jo=Vo[ia].name;Jo&&(ea[Jo]=Fo[ia])}eo(27,io=ea),no("change",Vo)}const qo=(ea,ia,Jo,sa)=>{eo(23,ia[Jo].name=sa.detail,Vo),Uo()};function xo(ea,ia){to.$$.not_equal(ia.name,ea)&&(ia.name=ea,eo(23,Vo))}function Zo(ea,ia){to.$$.not_equal(ia.value,ea)&&(ia.value=ea,eo(23,Vo))}const Xo=(ea,ia,Jo,sa)=>{eo(23,ia[Jo].value=sa.detail,Vo),Uo()};function Yo(ea,ia){to.$$.not_equal(ia.value,ea)&&(ia.value=ea,eo(23,Vo))}function Qo(ea,ia){to.$$.not_equal(Fo[ia],ea)&&(Fo[ia]=ea,eo(24,Fo))}const Ko=ea=>Do(ea),ra=(ea,ia)=>ea.onClick(ia);return to.$$set=ea=>{"defaults"in ea&&eo(28,ro=ea.defaults),"object"in ea&&eo(0,oo=ea.object),"activity"in ea&&eo(27,io=ea.activity),"readOnly"in ea&&eo(1,ao=ea.readOnly),"noAddButton"in ea&&eo(2,so=ea.noAddButton),"name"in ea&&eo(3,lo=ea.name),"headings"in ea&&eo(4,co=ea.headings),"options"in ea&&eo(5,uo=ea.options),"toggle"in ea&&eo(6,fo=ea.toggle),"keyPlaceholder"in ea&&eo(7,po=ea.keyPlaceholder),"valuePlaceholder"in ea&&eo(8,ho=ea.valuePlaceholder),"valueHeading"in ea&&eo(9,_o=ea.valueHeading),"keyHeading"in ea&&eo(10,go=ea.keyHeading),"tooltip"in ea&&eo(11,bo=ea.tooltip),"menuItems"in ea&&eo(12,vo=ea.menuItems),"showMenu"in ea&&eo(13,yo=ea.showMenu),"bindings"in ea&&eo(14,wo=ea.bindings),"bindingDrawerLeft"in ea&&eo(15,ko=ea.bindingDrawerLeft),"allowHelpers"in ea&&eo(16,So=ea.allowHelpers),"customButtonText"in ea&&eo(17,Ao=ea.customButtonText),"keyBindings"in ea&&eo(18,Io=ea.keyBindings),"allowJS"in ea&&eo(19,Eo=ea.allowJS),"actionButtonDisabled"in ea&&eo(20,To=ea.actionButtonDisabled),"compare"in ea&&eo(21,Mo=ea.compare)},to.$$.update=()=>{to.$$.dirty[0]&8388608&&eo(0,oo=Vo.reduce((ea,ia)=>({...ea,[ia.name]:ia.value}),{}))},[oo,ao,so,lo,co,uo,fo,po,ho,_o,go,bo,vo,yo,wo,ko,So,Ao,Io,Eo,To,Mo,Ro,Vo,Fo,Do,Uo,io,ro,qo,xo,Zo,Xo,Yo,Qo,Ko,ra]}class KeyValueBuilder extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8H,create_fragment$8H,safe_not_equal,{defaults:28,object:0,activity:27,readOnly:1,noAddButton:2,name:3,headings:4,options:5,toggle:6,keyPlaceholder:7,valuePlaceholder:8,valueHeading:9,keyHeading:10,tooltip:11,menuItems:12,showMenu:13,bindings:14,bindingDrawerLeft:15,allowHelpers:16,customButtonText:17,keyBindings:18,allowJS:19,actionButtonDisabled:20,compare:21,addEntry:22},null,[-1,-1])}get addEntry(){return this.$$.ctx[22]}}const Object_svelte_svelte_type_style_lang="";function create_default_slot_1$3U(to){let ue;return{c(){ue=text$1(to[0])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&1&&set_data(ue,eo[0])},d(eo){eo&&detach(ue)}}}function create_default_slot$5z(to){let ue;return{c(){ue=text$1("Add")},m(eo,no){insert$1(eo,ue,no)},d(eo){eo&&detach(ue)}}}function create_fragment$8G(to){let ue,eo,no,ro,oo,io,ao;eo=new Label({props:{$$slots:{default:[create_default_slot_1$3U]},$$scope:{ctx:to}}}),ro=new Button({props:{secondary:!0,thin:!0,outline:!0,$$slots:{default:[create_default_slot$5z]},$$scope:{ctx:to}}}),ro.$on("click",function(){is_function(to[2].addEntry())&&to[2].addEntry().apply(this,arguments)});let so={defaults:to[1],noAddButton:!0};return io=new KeyValueBuilder({props:so}),to[3](io),io.$on("change",to[4]),io.$on("blur",to[5]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),oo=space$1(),create_component(io.$$.fragment),attr(ue,"class","form-row ssl svelte-13q83tn")},m(lo,co){insert$1(lo,ue,co),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),insert$1(lo,oo,co),mount_component(io,lo,co),ao=!0},p(lo,[co]){to=lo;const uo={};co&65&&(uo.$$scope={dirty:co,ctx:to}),eo.$set(uo);const fo={};co&64&&(fo.$$scope={dirty:co,ctx:to}),ro.$set(fo);const po={};co&2&&(po.defaults=to[1]),io.$set(po)},i(lo){ao||(transition_in(eo.$$.fragment,lo),transition_in(ro.$$.fragment,lo),transition_in(io.$$.fragment,lo),ao=!0)},o(lo){transition_out(eo.$$.fragment,lo),transition_out(ro.$$.fragment,lo),transition_out(io.$$.fragment,lo),ao=!1},d(lo){lo&&(detach(ue),detach(oo)),destroy_component(eo),destroy_component(ro),to[3](null),destroy_component(io,lo)}}}function instance$8G(to,ue,eo){let{name:no}=ue,{value:ro}=ue,oo;function io(lo){binding_callbacks[lo?"unshift":"push"](()=>{oo=lo,eo(2,oo)})}function ao(lo){bubble.call(this,to,lo)}function so(lo){bubble.call(this,to,lo)}return to.$$set=lo=>{"name"in lo&&eo(0,no=lo.name),"value"in lo&&eo(1,ro=lo.value)},[no,ro,oo,io,ao,so]}let Object$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8G,create_fragment$8G,safe_not_equal,{name:0,value:1})}};const Boolean_svelte_svelte_type_style_lang="";function create_default_slot$5y(to){let ue;return{c(){ue=text$1(to[1])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&2&&set_data(ue,eo[1])},d(eo){eo&&detach(ue)}}}function create_fragment$8F(to){let ue,eo,no,ro,oo;return eo=new Label({props:{$$slots:{default:[create_default_slot$5y]},$$scope:{ctx:to}}}),ro=new Toggle({props:{text:"",value:to[0]}}),ro.$on("blur",to[2]),ro.$on("change",to[3]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),attr(ue,"class","form-row svelte-9sim75")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),oo=!0},p(io,[ao]){const so={};ao&18&&(so.$$scope={dirty:ao,ctx:io}),eo.$set(so);const lo={};ao&1&&(lo.value=io[0]),ro.$set(lo)},i(io){oo||(transition_in(eo.$$.fragment,io),transition_in(ro.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),transition_out(ro.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo),destroy_component(ro)}}}function instance$8F(to,ue,eo){let{value:no}=ue,{name:ro}=ue;function oo(ao){bubble.call(this,to,ao)}function io(ao){bubble.call(this,to,ao)}return to.$$set=ao=>{"value"in ao&&eo(0,no=ao.value),"name"in ao&&eo(1,ro=ao.name)},[no,ro,oo,io]}let Boolean$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8F,create_fragment$8F,safe_not_equal,{value:0,name:1})}};const LongForm_svelte_svelte_type_style_lang="";function create_default_slot$5x(to){let ue;return{c(){ue=text$1(to[1])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&2&&set_data(ue,eo[1])},d(eo){eo&&detach(ue)}}}function create_fragment$8E(to){let ue,eo,no,ro,oo;return eo=new Label({props:{$$slots:{default:[create_default_slot$5x]},$$scope:{ctx:to}}}),ro=new TextArea_1({props:{type:to[0],value:to[2],error:to[3],placeholder:to[4]}}),ro.$on("blur",to[5]),ro.$on("change",to[6]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),attr(ue,"class","form-row svelte-9sim75")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),oo=!0},p(io,[ao]){const so={};ao&130&&(so.$$scope={dirty:ao,ctx:io}),eo.$set(so);const lo={};ao&1&&(lo.type=io[0]),ao&4&&(lo.value=io[2]),ao&8&&(lo.error=io[3]),ao&16&&(lo.placeholder=io[4]),ro.$set(lo)},i(io){oo||(transition_in(eo.$$.fragment,io),transition_in(ro.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),transition_out(ro.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo),destroy_component(ro)}}}function instance$8E(to,ue,eo){let{type:no}=ue,{name:ro}=ue,{value:oo}=ue,{error:io}=ue,{placeholder:ao}=ue;function so(co){bubble.call(this,to,co)}function lo(co){bubble.call(this,to,co)}return to.$$set=co=>{"type"in co&&eo(0,no=co.type),"name"in co&&eo(1,ro=co.name),"value"in co&&eo(2,oo=co.value),"error"in co&&eo(3,io=co.error),"placeholder"in co&&eo(4,ao=co.placeholder)},[no,ro,oo,io,ao,so,lo]}class LongForm extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8E,create_fragment$8E,safe_not_equal,{type:0,name:1,value:2,error:3,placeholder:4})}}function get_each_context$1D(to,ue,eo){const no=to.slice();return no[6]=ue[eo],no}function create_each_block$1D(to){let ue,eo;const no=[to[6]];function ro(...io){return to[4](to[6],...io)}let oo={};for(let io=0;io<no.length;io+=1)oo=assign$1(oo,no[io]);return ue=new ConfigInput({props:oo}),ue.$on("change",ro),{c(){create_component(ue.$$.fragment)},m(io,ao){mount_component(ue,io,ao),eo=!0},p(io,ao){to=io;const so=ao&1?get_spread_update(no,[get_spread_object(to[6])]):{};ue.$set(so)},i(io){eo||(transition_in(ue.$$.fragment,io),eo=!0)},o(io){transition_out(ue.$$.fragment,io),eo=!1},d(io){destroy_component(ue,io)}}}function create_default_slot_1$3T(to){let ue,eo,no=ensure_array_like(to[0]),ro=[];for(let io=0;io<no.length;io+=1)ro[io]=create_each_block$1D(get_each_context$1D(to,no,io));const oo=io=>transition_out(ro[io],1,1,()=>{ro[io]=null});return{c(){for(let io=0;io<ro.length;io+=1)ro[io].c();ue=empty$2()},m(io,ao){for(let so=0;so<ro.length;so+=1)ro[so]&&ro[so].m(io,ao);insert$1(io,ue,ao),eo=!0},p(io,ao){if(ao&9){no=ensure_array_like(io[0]);let so;for(so=0;so<no.length;so+=1){const lo=get_each_context$1D(io,no,so);ro[so]?(ro[so].p(lo,ao),transition_in(ro[so],1)):(ro[so]=create_each_block$1D(lo),ro[so].c(),transition_in(ro[so],1),ro[so].m(ue.parentNode,ue))}for(group_outros(),so=no.length;so<ro.length;so+=1)oo(so);check_outros()}},i(io){if(!eo){for(let ao=0;ao<no.length;ao+=1)transition_in(ro[ao]);eo=!0}},o(io){ro=ro.filter(Boolean);for(let ao=0;ao<ro.length;ao+=1)transition_out(ro[ao]);eo=!1},d(io){io&&detach(ue),destroy_each(ro,io)}}}function create_default_slot$5w(to){let ue,eo;return ue=new Layout$n({props:{gap:"S",$$slots:{default:[create_default_slot_1$3T]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&513&&(oo.$$scope={dirty:ro,ctx:no}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$8D(to){var no;let ue,eo;return ue=new Accordion({props:{initialOpen:((no=to[2])==null?void 0:no.openByDefault)||Object.values(to[0]).some(func$J),header:to[1],$$slots:{default:[create_default_slot$5w]},$$scope:{ctx:to}}}),{c(){create_component(ue.$$.fragment)},m(ro,oo){mount_component(ue,ro,oo),eo=!0},p(ro,[oo]){var ao;const io={};oo&5&&(io.initialOpen=((ao=ro[2])==null?void 0:ao.openByDefault)||Object.values(ro[0]).some(func$J)),oo&2&&(io.header=ro[1]),oo&513&&(io.$$scope={dirty:oo,ctx:ro}),ue.$set(io)},i(ro){eo||(transition_in(ue.$$.fragment,ro),eo=!0)},o(ro){transition_out(ue.$$.fragment,ro),eo=!1},d(ro){destroy_component(ue,ro)}}}const func$J=to=>!!to.value;function instance$8D(to,ue,eo){let{value:no}=ue,{name:ro}=ue,{config:oo}=ue,io=createEventDispatcher();const ao=(lo,co)=>{const uo=no.map(fo=>({key:fo.key,value:fo.key===lo?co:fo.value}));io("change",uo)},so=(lo,co)=>ao(lo.key,co.detail);return to.$$set=lo=>{"value"in lo&&eo(0,no=lo.value),"name"in lo&&eo(1,ro=lo.name),"config"in lo&&eo(2,oo=lo.config)},[no,ro,oo,ao,so]}class FieldGroup extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8D,create_fragment$8D,safe_not_equal,{value:0,name:1,config:2})}}const String_svelte_svelte_type_style_lang="";function create_default_slot$5v(to){let ue;return{c(){ue=text$1(to[1])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&2&&set_data(ue,eo[1])},d(eo){eo&&detach(ue)}}}function create_fragment$8C(to){let ue,eo,no,ro,oo;return eo=new Label({props:{$$slots:{default:[create_default_slot$5v]},$$scope:{ctx:to}}}),ro=new EnvDropdown_1({props:{type:to[0]==="port"?"string":to[0],value:to[2],error:to[3],placeholder:to[4],variables:to[7].variables,environmentVariablesEnabled:to[6].environmentVariablesEnabled,showModal:to[5],handleUpgradePanel:to[8]}}),ro.$on("change",to[9]),ro.$on("blur",to[10]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),attr(ue,"class","form-row svelte-9sim75")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),oo=!0},p(io,[ao]){const so={};ao&2050&&(so.$$scope={dirty:ao,ctx:io}),eo.$set(so);const lo={};ao&1&&(lo.type=io[0]==="port"?"string":io[0]),ao&4&&(lo.value=io[2]),ao&8&&(lo.error=io[3]),ao&16&&(lo.placeholder=io[4]),ao&128&&(lo.variables=io[7].variables),ao&64&&(lo.environmentVariablesEnabled=io[6].environmentVariablesEnabled),ao&32&&(lo.showModal=io[5]),ro.$set(lo)},i(io){oo||(transition_in(eo.$$.fragment,io),transition_in(ro.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),transition_out(ro.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo),destroy_component(ro)}}}function instance$8C(to,ue,eo){let no,ro;component_subscribe(to,licensing,ho=>eo(6,no=ho)),component_subscribe(to,environment,ho=>eo(7,ro=ho));let{type:oo}=ue,{name:io}=ue,{value:ao}=ue,{error:so}=ue,{placeholder:lo}=ue,{showModal:co=()=>{}}=ue;async function uo(){await environment.upgradePanelOpened(),no.goToUpgradePage()}function fo(ho){bubble.call(this,to,ho)}function po(ho){bubble.call(this,to,ho)}return to.$$set=ho=>{"type"in ho&&eo(0,oo=ho.type),"name"in ho&&eo(1,io=ho.name),"value"in ho&&eo(2,ao=ho.value),"error"in ho&&eo(3,so=ho.error),"placeholder"in ho&&eo(4,lo=ho.placeholder),"showModal"in ho&&eo(5,co=ho.showModal)},[oo,io,ao,so,lo,co,no,ro,uo,fo,po]}let String$1=class extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8C,create_fragment$8C,safe_not_equal,{type:0,name:1,value:2,error:3,placeholder:4,showModal:5})}};const Select_svelte_svelte_type_style_lang="";function create_default_slot$5u(to){let ue;return{c(){ue=text$1(to[1])},m(eo,no){insert$1(eo,ue,no)},p(eo,no){no&2&&set_data(ue,eo[1])},d(eo){eo&&detach(ue)}}}function create_fragment$8B(to){let ue,eo,no,ro,oo;return eo=new Label({props:{$$slots:{default:[create_default_slot$5u]},$$scope:{ctx:to}}}),ro=new Select_1$1({props:{options:to[4].options,type:to[0],value:to[2]||void 0,error:to[3],placeholder:to[5]}}),ro.$on("blur",to[6]),ro.$on("change",to[7]),{c(){ue=element("div"),create_component(eo.$$.fragment),no=space$1(),create_component(ro.$$.fragment),attr(ue,"class","form-row svelte-9sim75")},m(io,ao){insert$1(io,ue,ao),mount_component(eo,ue,null),append$2(ue,no),mount_component(ro,ue,null),oo=!0},p(io,[ao]){const so={};ao&258&&(so.$$scope={dirty:ao,ctx:io}),eo.$set(so);const lo={};ao&16&&(lo.options=io[4].options),ao&1&&(lo.type=io[0]),ao&4&&(lo.value=io[2]||void 0),ao&8&&(lo.error=io[3]),ao&32&&(lo.placeholder=io[5]),ro.$set(lo)},i(io){oo||(transition_in(eo.$$.fragment,io),transition_in(ro.$$.fragment,io),oo=!0)},o(io){transition_out(eo.$$.fragment,io),transition_out(ro.$$.fragment,io),oo=!1},d(io){io&&detach(ue),destroy_component(eo),destroy_component(ro)}}}function instance$8B(to,ue,eo){let{type:no}=ue,{name:ro}=ue,{value:oo}=ue,{error:io}=ue,{config:ao}=ue,{placeholder:so}=ue;function lo(uo){bubble.call(this,to,uo)}function co(uo){bubble.call(this,to,uo)}return to.$$set=uo=>{"type"in uo&&eo(0,no=uo.type),"name"in uo&&eo(1,ro=uo.name),"value"in uo&&eo(2,oo=uo.value),"error"in uo&&eo(3,io=uo.error),"config"in uo&&eo(4,ao=uo.config),"placeholder"in uo&&eo(5,so=uo.placeholder)},[no,ro,oo,io,ao,so,lo,co]}class Select_1 extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8B,create_fragment$8B,safe_not_equal,{type:0,name:1,value:2,error:3,config:4,placeholder:5})}}function create_fragment$8A(to){let ue,eo,no;var ro=to[7];function oo(io,ao){return{props:{type:io[0],value:io[1],error:io[2],name:io[3],config:io[4],showModal:io[5],placeholder:io[6]}}}return ro&&(ue=construct_svelte_component(ro,oo(to)),ue.$on("blur",to[8]),ue.$on("change",to[9])),{c(){ue&&create_component(ue.$$.fragment),eo=empty$2()},m(io,ao){ue&&mount_component(ue,io,ao),insert$1(io,eo,ao),no=!0},p(io,[ao]){if(ao&128&&ro!==(ro=io[7])){if(ue){group_outros();const so=ue;transition_out(so.$$.fragment,1,0,()=>{destroy_component(so,1)}),check_outros()}ro?(ue=construct_svelte_component(ro,oo(io)),ue.$on("blur",io[8]),ue.$on("change",io[9]),create_component(ue.$$.fragment),transition_in(ue.$$.fragment,1),mount_component(ue,eo.parentNode,eo)):ue=null}else if(ro){const so={};ao&1&&(so.type=io[0]),ao&2&&(so.value=io[1]),ao&4&&(so.error=io[2]),ao&8&&(so.name=io[3]),ao&16&&(so.config=io[4]),ao&32&&(so.showModal=io[5]),ao&64&&(so.placeholder=io[6]),ue.$set(so)}},i(io){no||(ue&&transition_in(ue.$$.fragment,io),no=!0)},o(io){ue&&transition_out(ue.$$.fragment,io),no=!1},d(io){io&&detach(eo),ue&&destroy_component(ue,io)}}}function instance$8A(to,ue,eo){let no,{type:ro}=ue,{value:oo}=ue,{error:io}=ue,{name:ao}=ue,{config:so}=ue,{showModal:lo=()=>{}}=ue,{placeholder:co}=ue;const uo=ho=>ho==="object"?Object$1:ho==="boolean"?Boolean$1:ho==="longForm"?LongForm:ho==="fieldGroup"?FieldGroup:ho==="select"?Select_1:String$1;function fo(ho){bubble.call(this,to,ho)}function po(ho){bubble.call(this,to,ho)}return to.$$set=ho=>{"type"in ho&&eo(0,ro=ho.type),"value"in ho&&eo(1,oo=ho.value),"error"in ho&&eo(2,io=ho.error),"name"in ho&&eo(3,ao=ho.name),"config"in ho&&eo(4,so=ho.config),"showModal"in ho&&eo(5,lo=ho.showModal),"placeholder"in ho&&eo(6,co=ho.placeholder)},to.$$.update=()=>{to.$$.dirty&1&&eo(7,no=uo(ro))},[ro,oo,io,ao,so,lo,co,no,fo,po]}class ConfigInput extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$8A,create_fragment$8A,safe_not_equal,{type:0,value:1,error:2,name:3,config:4,showModal:5,placeholder:6})}}const toString$2=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(to){return to!=+to?"NaN":to===0&&1/to<0?"-0":""+to}function printSimpleValue(to,ue=!1){if(to==null||to===!0||to===!1)return""+to;const eo=typeof to;if(eo==="number")return printNumber(to);if(eo==="string")return ue?`"${to}"`:to;if(eo==="function")return"[Function "+(to.name||"anonymous")+"]";if(eo==="symbol")return symbolToString.call(to).replace(SYMBOL_REGEXP,"Symbol($1)");const no=toString$2.call(to).slice(8,-1);return no==="Date"?isNaN(to.getTime())?""+to:to.toISOString(to):no==="Error"||to instanceof Error?"["+errorToString.call(to)+"]":no==="RegExp"?regExpToString.call(to):null}function printValue(to,ue){let eo=printSimpleValue(to,ue);return eo!==null?eo:JSON.stringify(to,function(no,ro){let oo=printSimpleValue(this[no],ue);return oo!==null?oo:ro},2)}let mixed={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:to,type:ue,value:eo,originalValue:no})=>{let ro=no!=null&&no!==eo,oo=`${to} must be a \`${ue}\` type, but the final value was: \`${printValue(eo,!0)}\``+(ro?` (cast from the value \`${printValue(no,!0)}\`).`:".");return eo===null&&(oo+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),oo},defined:"${path} must be defined"},string={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object={noUnknown:"${path} field has unspecified keys: ${unknown}"},array$1={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed,string,number,date,object,array:array$1,boolean});const isSchema=to=>to&&to.__isYupSchema__;class Condition{constructor(ue,eo){if(this.fn=void 0,this.refs=ue,this.refs=ue,typeof eo=="function"){this.fn=eo;return}if(!has$7(eo,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!eo.then&&!eo.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:no,then:ro,otherwise:oo}=eo,io=typeof no=="function"?no:(...ao)=>ao.every(so=>so===no);this.fn=function(...ao){let so=ao.pop(),lo=ao.pop(),co=io(...ao)?ro:oo;if(co)return typeof co=="function"?co(lo):lo.concat(co.resolve(so))}}resolve(ue,eo){let no=this.refs.map(oo=>oo.getValue(eo==null?void 0:eo.value,eo==null?void 0:eo.parent,eo==null?void 0:eo.context)),ro=this.fn.apply(ue,no.concat(ue,eo));if(ro===void 0||ro===ue)return ue;if(!isSchema(ro))throw new TypeError("conditions must return a schema object");return ro.resolve(eo)}}function toArray$1(to){return to==null?[]:[].concat(to)}function _extends$3(){return _extends$3=Object.assign||function(to){for(var ue=1;ue<arguments.length;ue++){var eo=arguments[ue];for(var no in eo)Object.prototype.hasOwnProperty.call(eo,no)&&(to[no]=eo[no])}return to},_extends$3.apply(this,arguments)}let strReg=/\$\{\s*(\w+)\s*\}/g;class ValidationError extends Error{static formatError(ue,eo){const no=eo.label||eo.path||"this";return no!==eo.path&&(eo=_extends$3({},eo,{path:no})),typeof ue=="string"?ue.replace(strReg,(ro,oo)=>printValue(eo[oo])):typeof ue=="function"?ue(eo):ue}static isError(ue){return ue&&ue.name==="ValidationError"}constructor(ue,eo,no,ro){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=eo,this.path=no,this.type=ro,this.errors=[],this.inner=[],toArray$1(ue).forEach(oo=>{ValidationError.isError(oo)?(this.errors.push(...oo.errors),this.inner=this.inner.concat(oo.inner.length?oo.inner:oo)):this.errors.push(oo)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}}const once=to=>{let ue=!1;return(...eo)=>{ue||(ue=!0,to(...eo))}};function runTests(to,ue){let{endEarly:eo,tests:no,args:ro,value:oo,errors:io,sort:ao,path:so}=to,lo=once(ue),co=no.length;const uo=[];if(io=io||[],!co)return io.length?lo(new ValidationError(io,oo,so)):lo(null,oo);for(let fo=0;fo<no.length;fo++){const po=no[fo];po(ro,function(_o){if(_o){if(!ValidationError.isError(_o))return lo(_o,oo);if(eo)return _o.value=oo,lo(_o,oo);uo.push(_o)}if(--co<=0){if(uo.length&&(ao&&uo.sort(ao),io.length&&uo.push(...io),io=uo),io.length){lo(new ValidationError(io,oo,so),oo);return}lo(null,oo)}})}}const prefixes$1={context:"$",value:"."};class Reference{constructor(ue,eo={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof ue!="string")throw new TypeError("ref must be a string, got: "+ue);if(this.key=ue.trim(),ue==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===prefixes$1.context,this.isValue=this.key[0]===prefixes$1.value,this.isSibling=!this.isContext&&!this.isValue;let no=this.isContext?prefixes$1.context:this.isValue?prefixes$1.value:"";this.path=this.key.slice(no.length),this.getter=this.path&&propertyExpr.getter(this.path,!0),this.map=eo.map}getValue(ue,eo,no){let ro=this.isContext?no:this.isValue?ue:eo;return this.getter&&(ro=this.getter(ro||{})),this.map&&(ro=this.map(ro)),ro}cast(ue,eo){return this.getValue(ue,eo==null?void 0:eo.parent,eo==null?void 0:eo.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(ue){return ue&&ue.__isYupRef}}Reference.prototype.__isYupRef=!0;function _extends$2(){return _extends$2=Object.assign||function(to){for(var ue=1;ue<arguments.length;ue++){var eo=arguments[ue];for(var no in eo)Object.prototype.hasOwnProperty.call(eo,no)&&(to[no]=eo[no])}return to},_extends$2.apply(this,arguments)}function _objectWithoutPropertiesLoose(to,ue){if(to==null)return{};var eo={},no=Object.keys(to),ro,oo;for(oo=0;oo<no.length;oo++)ro=no[oo],!(ue.indexOf(ro)>=0)&&(eo[ro]=to[ro]);return eo}function createValidation(to){function ue(eo,no){let{value:ro,path:oo="",label:io,options:ao,originalValue:so,sync:lo}=eo,co=_objectWithoutPropertiesLoose(eo,["value","path","label","options","originalValue","sync"]);const{name:uo,test:fo,params:po,message:ho}=to;let{parent:_o,context:go}=ao;function bo(So){return Reference.isRef(So)?So.getValue(ro,_o,go):So}function vo(So={}){const Ao=mapValues$2(_extends$2({value:ro,originalValue:so,label:io,path:So.path||oo},po,So.params),bo),Io=new ValidationError(ValidationError.formatError(So.message||ho,Ao),ro,Ao.path,So.type||uo);return Io.params=Ao,Io}let yo=_extends$2({path:oo,parent:_o,type:uo,createError:vo,resolve:bo,options:ao,originalValue:so},co);if(!lo){try{Promise.resolve(fo.call(yo,ro,yo)).then(So=>{ValidationError.isError(So)?no(So):So?no(null,So):no(vo())}).catch(no)}catch(So){no(So)}return}let wo;try{var ko;if(wo=fo.call(yo,ro,yo),typeof((ko=wo)==null?void 0:ko.then)=="function")throw new Error(`Validation test of type: "${yo.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(So){no(So);return}ValidationError.isError(wo)?no(wo):wo?no(null,wo):no(vo())}return ue.OPTIONS=to,ue}let trim=to=>to.substr(0,to.length-1).substr(1);function getIn(to,ue,eo,no=eo){let ro,oo,io;return ue?(propertyExpr.forEach(ue,(ao,so,lo)=>{let co=so?trim(ao):ao;if(to=to.resolve({context:no,parent:ro,value:eo}),to.innerType){let uo=lo?parseInt(co,10):0;if(eo&&uo>=eo.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${ao}, in the path: ${ue}. because there is no value at that index. `);ro=eo,eo=eo&&eo[uo],to=to.innerType}if(!lo){if(!to.fields||!to.fields[co])throw new Error(`The schema does not contain the path: ${ue}. (failed at: ${io} which is a type: "${to._type}")`);ro=eo,eo=eo&&eo[co],to=to.fields[co]}oo=co,io=so?"["+ao+"]":"."+ao}),{schema:to,parent:ro,parentPath:oo}):{parent:ro,parentPath:ue,schema:to}}class ReferenceSet{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const ue=[];for(const eo of this.list)ue.push(eo);for(const[,eo]of this.refs)ue.push(eo.describe());return ue}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(ue){return this.toArray().reduce((eo,no)=>eo.concat(Reference.isRef(no)?ue(no):no),[])}add(ue){Reference.isRef(ue)?this.refs.set(ue.key,ue):this.list.add(ue)}delete(ue){Reference.isRef(ue)?this.refs.delete(ue.key):this.list.delete(ue)}clone(){const ue=new ReferenceSet;return ue.list=new Set(this.list),ue.refs=new Map(this.refs),ue}merge(ue,eo){const no=this.clone();return ue.list.forEach(ro=>no.add(ro)),ue.refs.forEach(ro=>no.add(ro)),eo.list.forEach(ro=>no.delete(ro)),eo.refs.forEach(ro=>no.delete(ro)),no}}function _extends$1(){return _extends$1=Object.assign||function(to){for(var ue=1;ue<arguments.length;ue++){var eo=arguments[ue];for(var no in eo)Object.prototype.hasOwnProperty.call(eo,no)&&(to[no]=eo[no])}return to},_extends$1.apply(this,arguments)}class BaseSchema{constructor(ue){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new ReferenceSet,this._blacklist=new ReferenceSet,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mixed.notType)}),this.type=(ue==null?void 0:ue.type)||"mixed",this.spec=_extends$1({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},ue==null?void 0:ue.spec)}get _type(){return this.type}_typeCheck(ue){return!0}clone(ue){if(this._mutate)return ue&&Object.assign(this.spec,ue),this;const eo=Object.create(Object.getPrototypeOf(this));return eo.type=this.type,eo._typeError=this._typeError,eo._whitelistError=this._whitelistError,eo._blacklistError=this._blacklistError,eo._whitelist=this._whitelist.clone(),eo._blacklist=this._blacklist.clone(),eo.exclusiveTests=_extends$1({},this.exclusiveTests),eo.deps=[...this.deps],eo.conditions=[...this.conditions],eo.tests=[...this.tests],eo.transforms=[...this.transforms],eo.spec=clone$3(_extends$1({},this.spec,ue)),eo}label(ue){let eo=this.clone();return eo.spec.label=ue,eo}meta(...ue){if(ue.length===0)return this.spec.meta;let eo=this.clone();return eo.spec.meta=Object.assign(eo.spec.meta||{},ue[0]),eo}withMutation(ue){let eo=this._mutate;this._mutate=!0;let no=ue(this);return this._mutate=eo,no}concat(ue){if(!ue||ue===this)return this;if(ue.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${ue.type}`);let eo=this,no=ue.clone();const ro=_extends$1({},eo.spec,no.spec);return no.spec=ro,no._typeError||(no._typeError=eo._typeError),no._whitelistError||(no._whitelistError=eo._whitelistError),no._blacklistError||(no._blacklistError=eo._blacklistError),no._whitelist=eo._whitelist.merge(ue._whitelist,ue._blacklist),no._blacklist=eo._blacklist.merge(ue._blacklist,ue._whitelist),no.tests=eo.tests,no.exclusiveTests=eo.exclusiveTests,no.withMutation(oo=>{ue.tests.forEach(io=>{oo.test(io.OPTIONS)})}),no.transforms=[...eo.transforms,...no.transforms],no}isType(ue){return this.spec.nullable&&ue===null?!0:this._typeCheck(ue)}resolve(ue){let eo=this;if(eo.conditions.length){let no=eo.conditions;eo=eo.clone(),eo.conditions=[],eo=no.reduce((ro,oo)=>oo.resolve(ro,ue),eo),eo=eo.resolve(ue)}return eo}cast(ue,eo={}){let no=this.resolve(_extends$1({value:ue},eo)),ro=no._cast(ue,eo);if(ue!==void 0&&eo.assert!==!1&&no.isType(ro)!==!0){let oo=printValue(ue),io=printValue(ro);throw new TypeError(`The value of ${eo.path||"field"} could not be cast to a value that satisfies the schema type: "${no._type}".
|
|
891
891
|
|