sqlmesh 0.181.2.dev7__py3-none-any.whl → 0.181.2.dev9__py3-none-any.whl

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.
Files changed (52) hide show
  1. sqlmesh/_version.py +2 -2
  2. sqlmesh/lsp/api.py +61 -0
  3. sqlmesh/lsp/main.py +25 -0
  4. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/METADATA +1 -1
  5. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/RECORD +51 -50
  6. web/client/dist/assets/{Audits-4U9LnWyN.js → Audits-DRkR6sg0.js} +1 -1
  7. web/client/dist/assets/{Banner-DfF4HK9_.js → Banner-BXisqtMu.js} +1 -1
  8. web/client/dist/assets/{ChevronDownIcon-DhkdL7W7.js → ChevronDownIcon-D8CFPQ96.js} +1 -1
  9. web/client/dist/assets/{ChevronRightIcon-CknBR_Ye.js → ChevronRightIcon-BpRv8ZN4.js} +1 -1
  10. web/client/dist/assets/{Content-T59G6CRd.js → Content-KG4KSDDO.js} +1 -1
  11. web/client/dist/assets/{Content-DfnWzoRW.js → Content-pMJLtxGr.js} +1 -1
  12. web/client/dist/assets/{Data-Dvs4EVTS.js → Data-D-rZnh8x.js} +1 -1
  13. web/client/dist/assets/{DataCatalog-CsA-vDbc.js → DataCatalog-BJTDeU-_.js} +1 -1
  14. web/client/dist/assets/{Editor-DsU0OwIl.js → Editor-C8-1rqZ2.js} +1 -1
  15. web/client/dist/assets/{Editor-DgIo0RbF.js → Editor-Cpn7iBcm.js} +1 -1
  16. web/client/dist/assets/{Errors-BOLt2obm.js → Errors-DyDRdQyq.js} +1 -1
  17. web/client/dist/assets/{FileExplorer-CIj2pM9u.js → FileExplorer-CmdsG4yG.js} +3 -3
  18. web/client/dist/assets/{Footer--bTxQCKB.js → Footer-D4ok48Gm.js} +1 -1
  19. web/client/dist/assets/{Header-DmcDkHFL.js → Header-BVwdhMQQ.js} +1 -1
  20. web/client/dist/assets/{Input-CJirBrKe.js → Input-CxOCLTNw.js} +1 -1
  21. web/client/dist/assets/Lineage-ZXdxdqzl.js +1 -0
  22. web/client/dist/assets/{ListboxShow-C0DBUX71.js → ListboxShow-YBO3HIHQ.js} +1 -1
  23. web/client/dist/assets/{ModelLineage-B8hv0xJ-.js → ModelLineage-BFuK5Bgk.js} +1 -1
  24. web/client/dist/assets/{Models-CCm5MLTD.js → Models-Dn2xoUA7.js} +1 -1
  25. web/client/dist/assets/{Page-WrN3RYDT.js → Page-kOwPk8A6.js} +1 -1
  26. web/client/dist/assets/{Plan-CFJZVnkR.js → Plan-BQe3-3RL.js} +1 -1
  27. web/client/dist/assets/{PlusCircleIcon-CcC2lSkc.js → PlusCircleIcon-CXYicjof.js} +1 -1
  28. web/client/dist/assets/{ReportErrors-BK8N5y1z.js → ReportErrors-DaAC3YF4.js} +1 -1
  29. web/client/dist/assets/{Root-DSGcTlxk.js → Root-BIGZcS_U.js} +1 -1
  30. web/client/dist/assets/{SearchList-B9NnvRod.js → SearchList-Lag39srv.js} +1 -1
  31. web/client/dist/assets/{SelectEnvironment-CJsiOTlU.js → SelectEnvironment-0MCV04NI.js} +1 -1
  32. web/client/dist/assets/{SourceList-FVjgH2xJ.js → SourceList-CTL41Fia.js} +1 -1
  33. web/client/dist/assets/{SourceListItem-BDqqo5jo.js → SourceListItem-6mIYlySR.js} +1 -1
  34. web/client/dist/assets/{SplitPane-BSlIdmc8.js → SplitPane-7_khUxNG.js} +1 -1
  35. web/client/dist/assets/{Tests-DAbOEH7t.js → Tests-DSsKelgd.js} +1 -1
  36. web/client/dist/assets/{Welcome-c37SRGFq.js → Welcome-C0F3fb3h.js} +1 -1
  37. web/client/dist/assets/{context-APidk_GA.js → context-B0V9EzWJ.js} +13 -13
  38. web/client/dist/assets/{context-DmjvuTWz.js → context-pytQSsK4.js} +1 -1
  39. web/client/dist/assets/{editor-B2GioI_r.js → editor-CmeEFdEz.js} +1 -1
  40. web/client/dist/assets/{file-C7afm_LM.js → file-DY5SRTK1.js} +1 -1
  41. web/client/dist/assets/{help-C_umCstj.js → help-Bm8ph9oI.js} +1 -1
  42. web/client/dist/assets/{index-CK4fdw8q.js → index-BWibl-Ee.js} +1 -1
  43. web/client/dist/assets/{index-COnjINWU.js → index-C22hdM_h.js} +2 -2
  44. web/client/dist/assets/{plan-BwAtu9hd.js → plan-BUTy2uM-.js} +1 -1
  45. web/client/dist/assets/{project-CWUUCZWT.js → project-CtAE3tsj.js} +1 -1
  46. web/client/dist/assets/{transition-DjPYSO2n.js → transition-CiMBgn_Y.js} +1 -1
  47. web/client/dist/index.html +1 -1
  48. web/client/dist/assets/Lineage-BbLp8RL_.js +0 -1
  49. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/WHEEL +0 -0
  50. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/entry_points.txt +0 -0
  51. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/licenses/LICENSE +0 -0
  52. {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{R as P,r as n,a2 as H}from"./index-COnjINWU.js";import{U as E,y as S,S as A,o as R,H as Z,u as I,k,C as D,I as U,V as B,j as K,T as V,G as N,x as L,z as x,A as W}from"./transition-DjPYSO2n.js";import{c as G}from"./_commonjs-dynamic-modules-TDtrdbi3.js";var q;let Q=(q=P.startTransition)!=null?q:function(e){e()};var Y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Y||{}),_=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(_||{});let J={0:e=>({...e,disclosureState:I(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},4(e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},5(e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},2(e,s){return e.buttonId===s.buttonId?e:{...e,buttonId:s.buttonId}},3(e,s){return e.panelId===s.panelId?e:{...e,panelId:s.panelId}}},z=n.createContext(null);z.displayName="DisclosureContext";function T(e){let s=n.useContext(z);if(s===null){let l=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,T),l}return s}let O=n.createContext(null);O.displayName="DisclosureAPIContext";function F(e){let s=n.useContext(O);if(s===null){let l=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,F),l}return s}let j=n.createContext(null);j.displayName="DisclosurePanelContext";function X(){return n.useContext(j)}function ee(e,s){return I(s.type,J,e,s)}let te=n.Fragment;function ae(e,s){let{defaultOpen:l=!1,...u}=e,v=n.useRef(null),i=S(s,A(a=>{v.current=a},e.as===void 0||e.as===n.Fragment)),c=n.useRef(null),$=n.useRef(null),f=n.useReducer(ee,{disclosureState:l?0:1,linkedPanel:!1,buttonRef:$,panelRef:c,buttonId:null,panelId:null}),[{disclosureState:g,buttonId:h},y]=f,m=R(a=>{y({type:1});let d=N(v);if(!d||!h)return;let r=a?a instanceof HTMLElement?a:a.current instanceof HTMLElement?a.current:d.getElementById(h):d.getElementById(h);r==null||r.focus()}),b=n.useMemo(()=>({close:m}),[m]),o=n.useMemo(()=>({open:g===0,close:m}),[g,m]),t={ref:i};return P.createElement(z.Provider,{value:f},P.createElement(O.Provider,{value:b},P.createElement(Z,{value:I(g,{0:k.Open,1:k.Closed})},D({ourProps:t,theirProps:u,slot:o,defaultTag:te,name:"Disclosure"}))))}let re="button";function se(e,s){let l=U(),{id:u=`headlessui-disclosure-button-${l}`,...v}=e,[i,c]=T("Disclosure.Button"),$=X(),f=$===null?!1:$===i.panelId,g=n.useRef(null),h=S(g,s,f?null:i.buttonRef),y=B();n.useEffect(()=>{if(!f)return c({type:2,buttonId:u}),()=>{c({type:2,buttonId:null})}},[u,c,f]);let m=R(r=>{var p;if(f){if(i.disclosureState===1)return;switch(r.key){case x.Space:case x.Enter:r.preventDefault(),r.stopPropagation(),c({type:0}),(p=i.buttonRef.current)==null||p.focus();break}}else switch(r.key){case x.Space:case x.Enter:r.preventDefault(),r.stopPropagation(),c({type:0});break}}),b=R(r=>{switch(r.key){case x.Space:r.preventDefault();break}}),o=R(r=>{var p;W(r.currentTarget)||e.disabled||(f?(c({type:0}),(p=i.buttonRef.current)==null||p.focus()):c({type:0}))}),t=n.useMemo(()=>({open:i.disclosureState===0}),[i]),a=V(e,g),d=f?{ref:h,type:a,onKeyDown:m,onClick:o}:{ref:h,id:u,type:a,"aria-expanded":i.disclosureState===0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:m,onKeyUp:b,onClick:o};return D({mergeRefs:y,ourProps:d,theirProps:v,slot:t,defaultTag:re,name:"Disclosure.Button"})}let ne="div",ie=L.RenderStrategy|L.Static;function oe(e,s){let l=U(),{id:u=`headlessui-disclosure-panel-${l}`,...v}=e,[i,c]=T("Disclosure.Panel"),{close:$}=F("Disclosure.Panel"),f=B(),g=S(s,i.panelRef,o=>{Q(()=>c({type:o?4:5}))});n.useEffect(()=>(c({type:3,panelId:u}),()=>{c({type:3,panelId:null})}),[u,c]);let h=K(),y=h!==null?(h&k.Open)===k.Open:i.disclosureState===0,m=n.useMemo(()=>({open:i.disclosureState===0,close:$}),[i,$]),b={ref:g,id:u};return P.createElement(j.Provider,{value:i.panelId},D({mergeRefs:f,ourProps:b,theirProps:v,slot:m,defaultTag:ne,features:ie,visible:y,name:"Disclosure.Panel"}))}let le=E(ae),ue=E(se),ce=E(oe),ye=Object.assign(le,{Button:ue,Panel:ce});var C={exports:{}},pe=C.exports,M;function de(){return M||(M=1,function(e,s){(function(l,u){typeof G=="function"?e.exports=u():l.pluralize=u()})(pe,function(){var l=[],u=[],v={},i={},c={};function $(t){return typeof t=="string"?new RegExp("^"+t+"$","i"):t}function f(t,a){return t===a?a:t===t.toLowerCase()?a.toLowerCase():t===t.toUpperCase()?a.toUpperCase():t[0]===t[0].toUpperCase()?a.charAt(0).toUpperCase()+a.substr(1).toLowerCase():a.toLowerCase()}function g(t,a){return t.replace(/\$(\d{1,2})/g,function(d,r){return a[r]||""})}function h(t,a){return t.replace(a[0],function(d,r){var p=g(a[1],arguments);return f(d===""?t[r-1]:d,p)})}function y(t,a,d){if(!t.length||v.hasOwnProperty(t))return a;for(var r=d.length;r--;){var p=d[r];if(p[0].test(a))return h(a,p)}return a}function m(t,a,d){return function(r){var p=r.toLowerCase();return a.hasOwnProperty(p)?f(r,p):t.hasOwnProperty(p)?f(r,t[p]):y(p,r,d)}}function b(t,a,d,r){return function(p){var w=p.toLowerCase();return a.hasOwnProperty(w)?!0:t.hasOwnProperty(w)?!1:y(w,w,d)===w}}function o(t,a,d){var r=a===1?o.singular(t):o.plural(t);return(d?a+" ":"")+r}return o.plural=m(c,i,l),o.isPlural=b(c,i,l),o.singular=m(i,c,u),o.isSingular=b(i,c,u),o.addPluralRule=function(t,a){l.push([$(t),a])},o.addSingularRule=function(t,a){u.push([$(t),a])},o.addUncountableRule=function(t){if(typeof t=="string"){v[t.toLowerCase()]=!0;return}o.addPluralRule(t,"$0"),o.addSingularRule(t,"$0")},o.addIrregularRule=function(t,a){a=a.toLowerCase(),t=t.toLowerCase(),c[t]=a,i[a]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return o.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return o.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return o.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(o.addUncountableRule),o})}(C)),C.exports}var fe=de();const be=H(fe);function me({title:e,titleId:s,...l},u){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:u,"aria-labelledby":s},l),e?n.createElement("title",{id:s},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const we=n.forwardRef(me);function he({title:e,titleId:s,...l},u){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:u,"aria-labelledby":s},l),e?n.createElement("title",{id:s},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const xe=n.forwardRef(he);export{ye as A,we as F,xe as a,be as p};
1
+ import{R as P,r as n,a2 as H}from"./index-C22hdM_h.js";import{U as E,y as S,S as A,o as R,H as Z,u as I,k,C as D,I as U,V as B,j as K,T as V,G as N,x as L,z as x,A as W}from"./transition-CiMBgn_Y.js";import{c as G}from"./_commonjs-dynamic-modules-TDtrdbi3.js";var q;let Q=(q=P.startTransition)!=null?q:function(e){e()};var Y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Y||{}),_=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(_||{});let J={0:e=>({...e,disclosureState:I(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},4(e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},5(e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},2(e,s){return e.buttonId===s.buttonId?e:{...e,buttonId:s.buttonId}},3(e,s){return e.panelId===s.panelId?e:{...e,panelId:s.panelId}}},z=n.createContext(null);z.displayName="DisclosureContext";function T(e){let s=n.useContext(z);if(s===null){let l=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,T),l}return s}let O=n.createContext(null);O.displayName="DisclosureAPIContext";function F(e){let s=n.useContext(O);if(s===null){let l=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,F),l}return s}let j=n.createContext(null);j.displayName="DisclosurePanelContext";function X(){return n.useContext(j)}function ee(e,s){return I(s.type,J,e,s)}let te=n.Fragment;function ae(e,s){let{defaultOpen:l=!1,...u}=e,v=n.useRef(null),i=S(s,A(a=>{v.current=a},e.as===void 0||e.as===n.Fragment)),c=n.useRef(null),$=n.useRef(null),f=n.useReducer(ee,{disclosureState:l?0:1,linkedPanel:!1,buttonRef:$,panelRef:c,buttonId:null,panelId:null}),[{disclosureState:g,buttonId:h},y]=f,m=R(a=>{y({type:1});let d=N(v);if(!d||!h)return;let r=a?a instanceof HTMLElement?a:a.current instanceof HTMLElement?a.current:d.getElementById(h):d.getElementById(h);r==null||r.focus()}),b=n.useMemo(()=>({close:m}),[m]),o=n.useMemo(()=>({open:g===0,close:m}),[g,m]),t={ref:i};return P.createElement(z.Provider,{value:f},P.createElement(O.Provider,{value:b},P.createElement(Z,{value:I(g,{0:k.Open,1:k.Closed})},D({ourProps:t,theirProps:u,slot:o,defaultTag:te,name:"Disclosure"}))))}let re="button";function se(e,s){let l=U(),{id:u=`headlessui-disclosure-button-${l}`,...v}=e,[i,c]=T("Disclosure.Button"),$=X(),f=$===null?!1:$===i.panelId,g=n.useRef(null),h=S(g,s,f?null:i.buttonRef),y=B();n.useEffect(()=>{if(!f)return c({type:2,buttonId:u}),()=>{c({type:2,buttonId:null})}},[u,c,f]);let m=R(r=>{var p;if(f){if(i.disclosureState===1)return;switch(r.key){case x.Space:case x.Enter:r.preventDefault(),r.stopPropagation(),c({type:0}),(p=i.buttonRef.current)==null||p.focus();break}}else switch(r.key){case x.Space:case x.Enter:r.preventDefault(),r.stopPropagation(),c({type:0});break}}),b=R(r=>{switch(r.key){case x.Space:r.preventDefault();break}}),o=R(r=>{var p;W(r.currentTarget)||e.disabled||(f?(c({type:0}),(p=i.buttonRef.current)==null||p.focus()):c({type:0}))}),t=n.useMemo(()=>({open:i.disclosureState===0}),[i]),a=V(e,g),d=f?{ref:h,type:a,onKeyDown:m,onClick:o}:{ref:h,id:u,type:a,"aria-expanded":i.disclosureState===0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:m,onKeyUp:b,onClick:o};return D({mergeRefs:y,ourProps:d,theirProps:v,slot:t,defaultTag:re,name:"Disclosure.Button"})}let ne="div",ie=L.RenderStrategy|L.Static;function oe(e,s){let l=U(),{id:u=`headlessui-disclosure-panel-${l}`,...v}=e,[i,c]=T("Disclosure.Panel"),{close:$}=F("Disclosure.Panel"),f=B(),g=S(s,i.panelRef,o=>{Q(()=>c({type:o?4:5}))});n.useEffect(()=>(c({type:3,panelId:u}),()=>{c({type:3,panelId:null})}),[u,c]);let h=K(),y=h!==null?(h&k.Open)===k.Open:i.disclosureState===0,m=n.useMemo(()=>({open:i.disclosureState===0,close:$}),[i,$]),b={ref:g,id:u};return P.createElement(j.Provider,{value:i.panelId},D({mergeRefs:f,ourProps:b,theirProps:v,slot:m,defaultTag:ne,features:ie,visible:y,name:"Disclosure.Panel"}))}let le=E(ae),ue=E(se),ce=E(oe),ye=Object.assign(le,{Button:ue,Panel:ce});var C={exports:{}},pe=C.exports,M;function de(){return M||(M=1,function(e,s){(function(l,u){typeof G=="function"?e.exports=u():l.pluralize=u()})(pe,function(){var l=[],u=[],v={},i={},c={};function $(t){return typeof t=="string"?new RegExp("^"+t+"$","i"):t}function f(t,a){return t===a?a:t===t.toLowerCase()?a.toLowerCase():t===t.toUpperCase()?a.toUpperCase():t[0]===t[0].toUpperCase()?a.charAt(0).toUpperCase()+a.substr(1).toLowerCase():a.toLowerCase()}function g(t,a){return t.replace(/\$(\d{1,2})/g,function(d,r){return a[r]||""})}function h(t,a){return t.replace(a[0],function(d,r){var p=g(a[1],arguments);return f(d===""?t[r-1]:d,p)})}function y(t,a,d){if(!t.length||v.hasOwnProperty(t))return a;for(var r=d.length;r--;){var p=d[r];if(p[0].test(a))return h(a,p)}return a}function m(t,a,d){return function(r){var p=r.toLowerCase();return a.hasOwnProperty(p)?f(r,p):t.hasOwnProperty(p)?f(r,t[p]):y(p,r,d)}}function b(t,a,d,r){return function(p){var w=p.toLowerCase();return a.hasOwnProperty(w)?!0:t.hasOwnProperty(w)?!1:y(w,w,d)===w}}function o(t,a,d){var r=a===1?o.singular(t):o.plural(t);return(d?a+" ":"")+r}return o.plural=m(c,i,l),o.isPlural=b(c,i,l),o.singular=m(i,c,u),o.isSingular=b(i,c,u),o.addPluralRule=function(t,a){l.push([$(t),a])},o.addSingularRule=function(t,a){u.push([$(t),a])},o.addUncountableRule=function(t){if(typeof t=="string"){v[t.toLowerCase()]=!0;return}o.addPluralRule(t,"$0"),o.addSingularRule(t,"$0")},o.addIrregularRule=function(t,a){a=a.toLowerCase(),t=t.toLowerCase(),c[t]=a,i[a]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return o.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return o.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return o.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(o.addUncountableRule),o})}(C)),C.exports}var fe=de();const be=H(fe);function me({title:e,titleId:s,...l},u){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:u,"aria-labelledby":s},l),e?n.createElement("title",{id:s},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const we=n.forwardRef(me);function he({title:e,titleId:s,...l},u){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:u,"aria-labelledby":s},l),e?n.createElement("title",{id:s},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const xe=n.forwardRef(he);export{ye as A,we as F,xe as a,be as p};
@@ -1 +1 @@
1
- import{d as f,r as i,j as e,c as u,B as j,n as p,m as b,a as g,w,i as d,Q as v,a5 as N,I as y}from"./index-COnjINWU.js";import{p as k,A as n,F as x,a as m}from"./PlusCircleIcon-CcC2lSkc.js";import{S as z}from"./SplitPane-BSlIdmc8.js";import{B as h,D as E}from"./transition-DjPYSO2n.js";function B(){const{errors:l,clearErrors:a}=f(),[t,c]=i.useState(!1);i.useEffect(()=>{l.size<1&&c(!1)},[l]);const r=l.size>0;return e.jsx(h,{onMouseEnter:()=>{c(r)},onMouseLeave:()=>{c(!1)},className:"flex",children:()=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:u("block ml-1 px-3 py-1 first-child:ml-0 rounded-full whitespace-nowrap font-bold text-xs text-center",r?"text-danger-500 bg-danger-10 dark:bg-danger-20 cursor-pointer":"bg-neutral-5 dark:bg-neutral-20 cursor-default text-neutral-500 dark:text-neutral-300"),children:r?e.jsxs("span",{children:[l.size," ",k("Error",l.size)]}):e.jsx("span",{children:"No Errors"})}),e.jsx(E,{show:t,as:i.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:e.jsxs(h.Panel,{className:"absolute top-10 right-2 z-[1000] flex flex-col rounded-md bg-light transform text-danger-700 shadow-2xl w-[90vw] max-h-[80vh]",children:[e.jsx("div",{className:"flex justify-end mx-1 mt-2",children:e.jsx(j,{size:b.sm,variant:p.Neutral,onClick:()=>a(),children:"Clear"})}),e.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(s=>e.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:e.jsx(D,{scope:s.key,error:s})},s.id))})]})})]})})}function D({error:l,scope:a,withSplitPane:t=!1}){const{removeError:c}=f(),r=g(s=>s.version);return e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[w(l.traceback)?e.jsx(o,{version:r,scope:a,error:l}):t?e.jsxs(z,{direction:"vertical",sizes:[50,50],minSize:100,snapOffset:0,className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsx(j,{variant:p.Neutral,size:b.sm,onClick:s=>{s.stopPropagation(),c(l)},children:"Dismiss"})})]})}function o({error:l,scope:a,version:t}){return e.jsxs("div",{className:"flex w-full overflow-hidden mb-2",children:[e.jsxs("div",{className:"w-[20rem] h-full",children:[e.jsxs("div",{className:"flex aline-center mb-2",children:[e.jsx("small",{className:"block mr-3",children:e.jsx("small",{className:"py-0.5 px-2 bg-danger-500 text-danger-100 rounded-md text-xs",children:l.status??"UI"})}),e.jsx("small",{className:"block",children:a})]}),e.jsxs("div",{className:u("text-sm px-2"),children:[e.jsx("small",{className:"block text-xs font-mono",children:v(N(l.timestamp),"yyyy-mm-dd hh-mm-ss",!1)}),e.jsx("p",{children:l.message})]})]}),e.jsxs("div",{className:"flex flex-col w-full px-4",children:[d(t)&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Version"}),": ",t]}),l.type!=null&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Type"}),": ",l.type]}),l.origin!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Origin"}),": ",l.origin]}),l.trigger!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Trigger"}),": ",l.trigger]}),e.jsx(y,{}),e.jsx("div",{className:"pt-4 h-full overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.jsx("p",{className:"flex text-sm ",children:l.description})})]})]})}export{D,B as R};
1
+ import{d as f,r as i,j as e,c as u,B as j,n as p,m as b,a as g,w,i as d,Q as v,a5 as N,I as y}from"./index-C22hdM_h.js";import{p as k,A as n,F as x,a as m}from"./PlusCircleIcon-CXYicjof.js";import{S as z}from"./SplitPane-7_khUxNG.js";import{B as h,D as E}from"./transition-CiMBgn_Y.js";function B(){const{errors:l,clearErrors:a}=f(),[t,c]=i.useState(!1);i.useEffect(()=>{l.size<1&&c(!1)},[l]);const r=l.size>0;return e.jsx(h,{onMouseEnter:()=>{c(r)},onMouseLeave:()=>{c(!1)},className:"flex",children:()=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:u("block ml-1 px-3 py-1 first-child:ml-0 rounded-full whitespace-nowrap font-bold text-xs text-center",r?"text-danger-500 bg-danger-10 dark:bg-danger-20 cursor-pointer":"bg-neutral-5 dark:bg-neutral-20 cursor-default text-neutral-500 dark:text-neutral-300"),children:r?e.jsxs("span",{children:[l.size," ",k("Error",l.size)]}):e.jsx("span",{children:"No Errors"})}),e.jsx(E,{show:t,as:i.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:e.jsxs(h.Panel,{className:"absolute top-10 right-2 z-[1000] flex flex-col rounded-md bg-light transform text-danger-700 shadow-2xl w-[90vw] max-h-[80vh]",children:[e.jsx("div",{className:"flex justify-end mx-1 mt-2",children:e.jsx(j,{size:b.sm,variant:p.Neutral,onClick:()=>a(),children:"Clear"})}),e.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(s=>e.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:e.jsx(D,{scope:s.key,error:s})},s.id))})]})})]})})}function D({error:l,scope:a,withSplitPane:t=!1}){const{removeError:c}=f(),r=g(s=>s.version);return e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[w(l.traceback)?e.jsx(o,{version:r,scope:a,error:l}):t?e.jsxs(z,{direction:"vertical",sizes:[50,50],minSize:100,snapOffset:0,className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsx(j,{variant:p.Neutral,size:b.sm,onClick:s=>{s.stopPropagation(),c(l)},children:"Dismiss"})})]})}function o({error:l,scope:a,version:t}){return e.jsxs("div",{className:"flex w-full overflow-hidden mb-2",children:[e.jsxs("div",{className:"w-[20rem] h-full",children:[e.jsxs("div",{className:"flex aline-center mb-2",children:[e.jsx("small",{className:"block mr-3",children:e.jsx("small",{className:"py-0.5 px-2 bg-danger-500 text-danger-100 rounded-md text-xs",children:l.status??"UI"})}),e.jsx("small",{className:"block",children:a})]}),e.jsxs("div",{className:u("text-sm px-2"),children:[e.jsx("small",{className:"block text-xs font-mono",children:v(N(l.timestamp),"yyyy-mm-dd hh-mm-ss",!1)}),e.jsx("p",{children:l.message})]})]}),e.jsxs("div",{className:"flex flex-col w-full px-4",children:[d(t)&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Version"}),": ",t]}),l.type!=null&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Type"}),": ",l.type]}),l.origin!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Origin"}),": ",l.origin]}),l.trigger!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Trigger"}),": ",l.trigger]}),e.jsx(y,{}),e.jsx("div",{className:"pt-4 h-full overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.jsx("p",{className:"flex text-sm ",children:l.description})})]})]})}export{D,B as R};
@@ -1 +1 @@
1
- var en=Object.defineProperty;var tn=(e,t,n)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>tn(e,typeof t!="symbol"?t+"":t,n);import{r as s,j as o,N as nn,c as _,b as V,d as Lt,a as E,e as Y,R as C,f as Qe,g as Le,h as le,k as it,l as ct,B as et,m as St,n as tt,o as $t,L as rn,S as nt,p as an,q as sn,s as on,t as Dt,v as Ot,w as S,x as ln,i as $,y as cn,z as un,A as dn,C as qe,D as fn,F as mn,G as Et,H as hn,I as yt,O as pn}from"./index-COnjINWU.js";import{R as vn}from"./ReportErrors-BK8N5y1z.js";import{u as y,M as gn,a as rt,E as ce}from"./plan-BwAtu9hd.js";import{G as wn,w as xn,E as B,P as jt,S as bn}from"./SelectEnvironment-CJsiOTlU.js";import{o as U,U as de,y as fe,l as Ht,n as Bt,a as En,u as be,s as Te,O as Me,M as ue,p as yn,b as Ct,c as kt,C as me,d as jn,e as ne,f as Zt,E as It,t as zt,N as Cn,g as kn,h as _t,i as ut,I as Ee,j as Rn,k as Fe,m as An,q as Nn,r as Pn,v as at,w as st,x as Rt,z as Tn,A as Fn,B as At,D as ot}from"./transition-DjPYSO2n.js";import{F as Mn}from"./ChevronRightIcon-CknBR_Ye.js";import{u as X,M as Ue}from"./project-CWUUCZWT.js";import{M as Nt}from"./file-C7afm_LM.js";import{u as ee,c as Ln}from"./editor-B2GioI_r.js";import{EnumFileExplorerChange as Ge}from"./context-DmjvuTWz.js";import"./PlusCircleIcon-CcC2lSkc.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./SplitPane-BSlIdmc8.js";import"./context-APidk_GA.js";import"./Input-CJirBrKe.js";import"./help-6Q7f7fjd.js";import"./SourceList-FVjgH2xJ.js";import"./index-CK4fdw8q.js";import"./ModelLineage-B8hv0xJ-.js";import"./ListboxShow-C0DBUX71.js";import"./SearchList-B9NnvRod.js";import"./ChevronDownIcon-DhkdL7W7.js";function Sn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))}const $n=s.forwardRef(Sn);function Dn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const On=s.forwardRef(Dn);function Hn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Zm10.857 5.691a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 0 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Bn=s.forwardRef(Hn);function Zn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",clipRule:"evenodd"}))}const In=s.forwardRef(Zn);function zn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const _n=s.forwardRef(zn);function Vn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z"}))}const Wn=s.forwardRef(Vn);function Yn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm6.39-2.908a.75.75 0 0 1 .766.027l3.5 2.25a.75.75 0 0 1 0 1.262l-3.5 2.25A.75.75 0 0 1 8 12.25v-4.5a.75.75 0 0 1 .39-.658Z",clipRule:"evenodd"}))}const Vt=s.forwardRef(Yn);function qn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M9.661 2.237a.531.531 0 0 1 .678 0 11.947 11.947 0 0 0 7.078 2.749.5.5 0 0 1 .479.425c.069.52.104 1.05.104 1.59 0 5.162-3.26 9.563-7.834 11.256a.48.48 0 0 1-.332 0C5.26 16.564 2 12.163 2 7c0-.538.035-1.069.104-1.589a.5.5 0 0 1 .48-.425 11.947 11.947 0 0 0 7.077-2.75Zm4.196 5.954a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Un=s.forwardRef(qn);function Gn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M15.98 1.804a1 1 0 0 0-1.96 0l-.24 1.192a1 1 0 0 1-.784.785l-1.192.238a1 1 0 0 0 0 1.962l1.192.238a1 1 0 0 1 .785.785l.238 1.192a1 1 0 0 0 1.962 0l.238-1.192a1 1 0 0 1 .785-.785l1.192-.238a1 1 0 0 0 0-1.962l-1.192-.238a1 1 0 0 1-.785-.785l-.238-1.192ZM6.949 5.684a1 1 0 0 0-1.898 0l-.683 2.051a1 1 0 0 1-.633.633l-2.051.683a1 1 0 0 0 0 1.898l2.051.684a1 1 0 0 1 .633.632l.683 2.051a1 1 0 0 0 1.898 0l.683-2.051a1 1 0 0 1 .633-.633l2.051-.683a1 1 0 0 0 0-1.898l-2.051-.683a1 1 0 0 1-.633-.633L6.95 5.684ZM13.949 13.684a1 1 0 0 0-1.898 0l-.184.551a1 1 0 0 1-.632.633l-.551.183a1 1 0 0 0 0 1.898l.551.183a1 1 0 0 1 .633.633l.183.551a1 1 0 0 0 1.898 0l.184-.551a1 1 0 0 1 .632-.633l.551-.183a1 1 0 0 0 0-1.898l-.551-.184a1 1 0 0 1-.633-.632l-.183-.551Z"}))}const Pt=s.forwardRef(Gn);function Kn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M.99 5.24A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25l.01 9.5A2.25 2.25 0 0 1 16.76 17H3.26A2.267 2.267 0 0 1 1 14.74l-.01-9.5Zm8.26 9.52v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75v.615c0 .414.336.75.75.75h5.373a.75.75 0 0 0 .627-.74Zm1.5 0a.75.75 0 0 0 .627.74h5.373a.75.75 0 0 0 .75-.75v-.615a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75v.625Zm6.75-3.63v-.625a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75v.625c0 .414.336.75.75.75h5.25a.75.75 0 0 0 .75-.75Zm-8.25 0v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75v.625c0 .414.336.75.75.75H8.5a.75.75 0 0 0 .75-.75ZM17.5 7.5v-.625a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75V7.5c0 .414.336.75.75.75h5.25a.75.75 0 0 0 .75-.75Zm-8.25 0v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75V7.5c0 .414.336.75.75.75H8.5a.75.75 0 0 0 .75-.75Z",clipRule:"evenodd"}))}const Tt=s.forwardRef(Kn);function Jn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}))}const Xn=s.forwardRef(Jn);function Qn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const er=s.forwardRef(Qn);function tr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const nr=s.forwardRef(tr);function rr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const ar=s.forwardRef(rr);function sr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"}))}const Wt=s.forwardRef(sr);function or({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const lr=s.forwardRef(or);function q({title:e,to:t,icon:n,iconActive:r,classActive:i="px-2 bg-neutral-10",disabled:l=!1,children:u,before:c,className:d}){return o.jsx(nn,{title:e,to:t,className:({isActive:v})=>_("flex items-center",l&&"opacity-50 cursor-not-allowed",v&&V(l)&&i,d),style:({isActive:v})=>v||l?{pointerEvents:"none"}:{},children:({isActive:v})=>o.jsxs("span",{className:_("flex items-center",v?"font-bold":"font-normal"),children:[c,v?r:n,u]})})}function ir({className:e}){const{errors:t}=Lt(),n=E(l=>l.models),r=E(l=>l.modules),i=Array.from(new Set(n.values())).length;return o.jsxs("div",{className:e,children:[r.hasEditor&&o.jsx(q,{title:"File Explorer",to:Y.Editor,className:"px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-primary-500 rounded-xl my-1",classActive:"bg-primary-10 text-primary-500",icon:o.jsx(ar,{className:"min-w-6 w-6"}),iconActive:o.jsx(Wn,{className:"min-w-6 w-6"})}),r.hasDataCatalog&&o.jsx(q,{title:"Data Catalog",to:Y.DataCatalog,icon:o.jsx(er,{className:"min-w-6 w-6"}),iconActive:o.jsx(In,{className:"min-w-6 w-6"}),className:"relative rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-600 dark:text-neutral-300",children:o.jsx("span",{className:"min-w-[1rem] px-1 h-4 py-0.5 text-center text-[9px] absolute bottom-0 right-0 font-black rounded-full bg-primary-500 text-primary-100",children:i})}),r.hasErrors&&o.jsx(q,{title:"Errors",to:Y.Errors,className:_("relative px-2 py-1 rounded-xl my-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10",t.size>0?"text-danger-500":"text-neutral-600"),classActive:"px-2 bg-danger-10 text-danger-500",icon:o.jsx(nr,{className:"w-6"}),iconActive:o.jsx(_n,{className:"w-6"}),disabled:t.size===0,children:t.size>0&&o.jsx("span",{className:"min-w-[1rem] px-1 h-4 py-0.5 text-center text-[9px] absolute bottom-0 right-0 font-black rounded-full bg-danger-500 text-danger-100",children:t.size})}),r.hasPlans&&o.jsx(q,{title:"Plan",to:Y.Plan,className:"px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-success-500 rounded-xl my-1",classActive:"bg-success-10 text-success-500",icon:o.jsx(Wt,{className:"w-6"}),iconActive:o.jsx(Vt,{className:"w-6"})}),r.hasTests&&o.jsx(q,{title:"Tests",to:Y.Tests,icon:o.jsx(Xn,{className:"w-6"}),iconActive:o.jsx(Bn,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10"}),r.hasAudits&&o.jsx(q,{title:"Audits",to:Y.Audits,icon:o.jsx(lr,{className:"w-6"}),iconActive:o.jsx(Un,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10"}),r.hasData&&o.jsx(q,{title:"Data",to:Y.Data,icon:o.jsx(Tt,{className:"w-6"}),iconActive:o.jsx(Tt,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-500 dark:text-neutral-300"}),r.hasLineage&&o.jsx(q,{title:"Lineage",to:Y.Lineage,icon:o.jsx(Pt,{className:"w-6"}),iconActive:o.jsx(Pt,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-500 dark:text-neutral-300"})]})}function dt(e,t){let n=s.useRef([]),r=U(e);s.useEffect(()=>{let i=[...n.current];for(let[l,u]of t.entries())if(n.current[l]!==u){let c=r(t,i);return n.current=t,c}},[r,...t])}function cr(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Q=[];cr(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Q[0]!==t.target&&(Q.unshift(t.target),Q=Q.filter(n=>n!=null&&n.isConnected),Q.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Yt(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let ur="div";var qt=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(qt||{});function dr(e,t){let n=s.useRef(null),r=fe(n,t),{initialFocus:i,containers:l,features:u=30,...c}=e;Ht()||(u=1);let d=Bt(n);hr({ownerDocument:d},!!(u&16));let v=pr({ownerDocument:d,container:n,initialFocus:i},!!(u&2));vr({ownerDocument:d,container:n,containers:l,previousActiveElement:v},!!(u&8));let w=En(),Z=U(A=>{let f=n.current;f&&(N=>N())(()=>{be(w.current,{[Te.Forwards]:()=>{Me(f,ue.First,{skipElements:[A.relatedTarget]})},[Te.Backwards]:()=>{Me(f,ue.Last,{skipElements:[A.relatedTarget]})}})})}),G=yn(),P=s.useRef(!1),R={ref:r,onKeyDown(A){A.key=="Tab"&&(P.current=!0,G.requestAnimationFrame(()=>{P.current=!1}))},onBlur(A){let f=Yt(l);n.current instanceof HTMLElement&&f.add(n.current);let N=A.relatedTarget;N instanceof HTMLElement&&N.dataset.headlessuiFocusGuard!=="true"&&(Ut(f,N)||(P.current?Me(n.current,be(w.current,{[Te.Forwards]:()=>ue.Next,[Te.Backwards]:()=>ue.Previous})|ue.WrapAround,{relativeTo:A.target}):A.target instanceof HTMLElement&&ne(A.target)))}};return C.createElement(C.Fragment,null,!!(u&4)&&C.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Z,features:kt.Focusable}),me({ourProps:R,theirProps:c,defaultTag:ur,name:"FocusTrap"}),!!(u&4)&&C.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Z,features:kt.Focusable}))}let fr=de(dr),ge=Object.assign(fr,{features:qt});function mr(e=!0){let t=s.useRef(Q.slice());return dt(([n],[r])=>{r===!0&&n===!1&&zt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Q.slice())},[e,Q,t]),U(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function hr({ownerDocument:e},t){let n=mr(t);dt(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ne(n())},[t]),jn(()=>{t&&ne(n())})}function pr({ownerDocument:e,container:t,initialFocus:n},r){let i=s.useRef(null),l=Zt();return dt(()=>{if(!r)return;let u=t.current;u&&zt(()=>{if(!l.current)return;let c=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===c){i.current=c;return}}else if(u.contains(c)){i.current=c;return}n!=null&&n.current?ne(n.current):Me(u,ue.First)===Cn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[r]),i}function vr({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let l=Zt();It(e==null?void 0:e.defaultView,"focus",u=>{if(!i||!l.current)return;let c=Yt(n);t.current instanceof HTMLElement&&c.add(t.current);let d=r.current;if(!d)return;let v=u.target;v&&v instanceof HTMLElement?Ut(c,v)?(r.current=v,ne(v)):(u.preventDefault(),u.stopPropagation(),ne(d)):ne(r.current)},!0)}function Ut(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function gr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const wr=typeof Object.is=="function"?Object.is:gr,{useState:xr,useEffect:br,useLayoutEffect:Er,useDebugValue:yr}=Qe;function jr(e,t,n){const r=t(),[{inst:i},l]=xr({inst:{value:r,getSnapshot:t}});return Er(()=>{i.value=r,i.getSnapshot=t,Ke(i)&&l({inst:i})},[e,r,t]),br(()=>(Ke(i)&&l({inst:i}),e(()=>{Ke(i)&&l({inst:i})})),[e]),yr(r),r}function Ke(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!wr(n,r)}catch{return!0}}function Cr(e,t,n){return t()}const kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rr=!kr,Ar=Rr?Cr:jr,Nr="useSyncExternalStore"in Qe?(e=>e.useSyncExternalStore)(Qe):Ar;function Pr(e){return Nr(e.subscribe,e.getSnapshot,e.getSnapshot)}function Tr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...l){let u=t[i].call(n,...l);u&&(n=u,r.forEach(c=>c()))}}}function Fr(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,i=r.clientWidth-r.offsetWidth,l=e-i;n.style(r,"paddingRight",`${l}px`)}}}function Mr(){return kn()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(l=>l()).some(l=>l.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=_t();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let l=(i=window.scrollY)!=null?i:window.pageYOffset,u=null;t.addEventListener(e,"click",c=>{if(c.target instanceof HTMLElement)try{let d=c.target.closest("a");if(!d)return;let{hash:v}=new URL(d.href),w=e.querySelector(v);w&&!r(w)&&(u=w)}catch{}},!0),t.addEventListener(e,"touchstart",c=>{if(c.target instanceof HTMLElement)if(r(c.target)){let d=c.target;for(;d.parentElement&&r(d.parentElement);)d=d.parentElement;t.style(d,"overscrollBehavior","contain")}else t.style(c.target,"touchAction","none")}),t.addEventListener(e,"touchmove",c=>{if(c.target instanceof HTMLElement)if(r(c.target)){let d=c.target;for(;d.parentElement&&d.dataset.headlessuiPortal!==""&&!(d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth);)d=d.parentElement;d.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()},{passive:!1}),t.add(()=>{var c;let d=(c=window.scrollY)!=null?c:window.pageYOffset;l!==d&&window.scrollTo(0,l),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function Lr(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Sr(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let te=Tr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:_t(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Sr(n)},i=[Mr(),Fr(),Lr()];i.forEach(({before:l})=>l==null?void 0:l(r)),i.forEach(({after:l})=>l==null?void 0:l(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});te.subscribe(()=>{let e=te.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&te.dispatch("TEARDOWN",n)}});function $r(e,t,n){let r=Pr(te),i=e?r.get(e):void 0,l=i?i.count>0:!1;return ut(()=>{if(!(!e||!t))return te.dispatch("PUSH",e,n),()=>te.dispatch("POP",e,n)},[t,e]),l}let Je=new Map,we=new Map;function Ft(e,t=!0){ut(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function i(){var u;if(!r)return;let c=(u=we.get(r))!=null?u:1;if(c===1?we.delete(r):we.set(r,c-1),c!==1)return;let d=Je.get(r);d&&(d["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",d["aria-hidden"]),r.inert=d.inert,Je.delete(r))}let l=(n=we.get(r))!=null?n:0;return we.set(r,l+1),l!==0||(Je.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),i},[e,t])}let ft=s.createContext(()=>{});ft.displayName="StackContext";var lt=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(lt||{});function Dr(){return s.useContext(ft)}function Or({children:e,onUpdate:t,type:n,element:r,enabled:i}){let l=Dr(),u=U((...c)=>{t==null||t(...c),l(...c)});return ut(()=>{let c=i===void 0||i===!0;return c&&u(0,n,r),()=>{c&&u(1,n,r)}},[u,n,r,i]),C.createElement(ft.Provider,{value:u},e)}var Hr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hr||{}),Br=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Br||{});let Zr={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Se=s.createContext(null);Se.displayName="DialogContext";function ye(e){let t=s.useContext(Se);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ye),n}return t}function Ir(e,t,n=()=>[document.body]){$r(e,t,r=>{var i;return{containers:[...(i=r.containers)!=null?i:[],n]}})}function zr(e,t){return be(t.type,Zr,e,t)}let _r="div",Vr=Rt.RenderStrategy|Rt.Static;function Wr(e,t){let n=Ee(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:l,initialFocus:u,role:c="dialog",__demoMode:d=!1,...v}=e,[w,Z]=s.useState(0),G=s.useRef(!1);c=function(){return c==="dialog"||c==="alertdialog"?c:(G.current||(G.current=!0,console.warn(`Invalid role [${c}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let P=Rn();i===void 0&&P!==null&&(i=(P&Fe.Open)===Fe.Open);let R=s.useRef(null),A=fe(R,t),f=Bt(R),N=e.hasOwnProperty("open")||P!==null,p=e.hasOwnProperty("onClose");if(!N&&!p)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!N)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!p)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let j=i?0:1,[re,$e]=s.useReducer(zr,{titleId:null,descriptionId:null,panelRef:s.createRef()}),K=U(()=>l(!1)),je=U(b=>$e({type:0,id:b})),I=Ht()?d?!1:j===0:!1,ae=w>1,Ce=s.useContext(Se)!==null,[De,ke]=An(),he={get current(){var b;return(b=re.panelRef.current)!=null?b:R.current}},{resolveContainers:pe,mainTreeNodeRef:se,MainTreeNode:Re}=Nn({portals:De,defaultContainers:[he]}),Oe=ae?"parent":"leaf",ve=P!==null?(P&Fe.Closing)===Fe.Closing:!1,He=Ce||ve?!1:I,Be=s.useCallback(()=>{var b,O;return(O=Array.from((b=f==null?void 0:f.querySelectorAll("body > *"))!=null?b:[]).find(T=>T.id==="headlessui-portal-root"?!1:T.contains(se.current)&&T instanceof HTMLElement))!=null?O:null},[se]);Ft(Be,He);let Ze=ae?!0:I,Ie=s.useCallback(()=>{var b,O;return(O=Array.from((b=f==null?void 0:f.querySelectorAll("[data-headlessui-portal]"))!=null?b:[]).find(T=>T.contains(se.current)&&T instanceof HTMLElement))!=null?O:null},[se]);Ft(Ie,Ze),Pn(pe,b=>{b.preventDefault(),K()},!(!I||ae));let ze=!(ae||j!==0);It(f==null?void 0:f.defaultView,"keydown",b=>{ze&&(b.defaultPrevented||b.key===Tn.Escape&&(b.preventDefault(),b.stopPropagation(),K()))}),Ir(f,!(ve||j!==0||Ce),pe),s.useEffect(()=>{if(j!==0||!R.current)return;let b=new ResizeObserver(O=>{for(let T of O){let z=T.target.getBoundingClientRect();z.x===0&&z.y===0&&z.width===0&&z.height===0&&K()}});return b.observe(R.current),()=>b.disconnect()},[j,R,K]);let[Ae,_e]=xn(),Ve=s.useMemo(()=>[{dialogState:j,close:K,setTitleId:je},re],[j,re,K,je]),Ne=s.useMemo(()=>({open:j===0}),[j]),Pe={ref:A,id:r,role:c,"aria-modal":j===0?!0:void 0,"aria-labelledby":re.titleId,"aria-describedby":Ae};return C.createElement(Or,{type:"Dialog",enabled:j===0,element:R,onUpdate:U((b,O)=>{O==="Dialog"&&be(b,{[lt.Add]:()=>Z(T=>T+1),[lt.Remove]:()=>Z(T=>T-1)})})},C.createElement(at,{force:!0},C.createElement(st,null,C.createElement(Se.Provider,{value:Ve},C.createElement(st.Group,{target:R},C.createElement(at,{force:!1},C.createElement(_e,{slot:Ne,name:"Dialog.Description"},C.createElement(ge,{initialFocus:u,containers:pe,features:I?be(Oe,{parent:ge.features.RestoreFocus,leaf:ge.features.All&~ge.features.FocusLock}):ge.features.None},C.createElement(ke,null,me({ourProps:Pe,theirProps:v,slot:Ne,defaultTag:_r,features:Vr,visible:j===0,name:"Dialog"}))))))))),C.createElement(Re,null))}let Yr="div";function qr(e,t){let n=Ee(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=e,[{dialogState:l,close:u}]=ye("Dialog.Overlay"),c=fe(t),d=U(w=>{if(w.target===w.currentTarget){if(Fn(w.currentTarget))return w.preventDefault();w.preventDefault(),w.stopPropagation(),u()}}),v=s.useMemo(()=>({open:l===0}),[l]);return me({ourProps:{ref:c,id:r,"aria-hidden":!0,onClick:d},theirProps:i,slot:v,defaultTag:Yr,name:"Dialog.Overlay"})}let Ur="div";function Gr(e,t){let n=Ee(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=e,[{dialogState:l},u]=ye("Dialog.Backdrop"),c=fe(t);s.useEffect(()=>{if(u.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[u.panelRef]);let d=s.useMemo(()=>({open:l===0}),[l]);return C.createElement(at,{force:!0},C.createElement(st,null,me({ourProps:{ref:c,id:r,"aria-hidden":!0},theirProps:i,slot:d,defaultTag:Ur,name:"Dialog.Backdrop"})))}let Kr="div";function Jr(e,t){let n=Ee(),{id:r=`headlessui-dialog-panel-${n}`,...i}=e,[{dialogState:l},u]=ye("Dialog.Panel"),c=fe(t,u.panelRef),d=s.useMemo(()=>({open:l===0}),[l]),v=U(w=>{w.stopPropagation()});return me({ourProps:{ref:c,id:r,onClick:v},theirProps:i,slot:d,defaultTag:Kr,name:"Dialog.Panel"})}let Xr="h2";function Qr(e,t){let n=Ee(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:l,setTitleId:u}]=ye("Dialog.Title"),c=fe(t);s.useEffect(()=>(u(r),()=>u(null)),[r,u]);let d=s.useMemo(()=>({open:l===0}),[l]);return me({ourProps:{ref:c,id:r},theirProps:i,slot:d,defaultTag:Xr,name:"Dialog.Title"})}let ea=de(Wr),ta=de(Gr),na=de(Jr),ra=de(qr),aa=de(Qr),Gt=Object.assign(ea,{Backdrop:ta,Panel:na,Overlay:ra,Title:aa,Description:wn});function ie({headline:e,type:t,changes:n,className:r}){const[i,l]=s.useState(!1);return o.jsx(At,{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},className:"relative flex",children:()=>o.jsxs(o.Fragment,{children:[o.jsx("span",{className:_("transition-all flex min-w-[1rem] h-4 text-center mx-0.5 px-1 rounded-full text-[10px] font-black text-neutral-100 cursor-default border border-inherit",t===B.Add&&"bg-success-500 border-success-500",t===B.Remove&&"bg-danger-500 border-danger-500",t===B.Direct&&"bg-secondary-500 border-secondary-500",t===B.Indirect&&"bg-warning-500 border-warning-500",t===B.Metadata&&"bg-neutral-400 border-neutral-400",t===B.Default&&"bg-neutral-600 border-neutral-600",r),children:n.length}),o.jsx(ot,{show:i,as:s.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:o.jsx(At.Panel,{className:"absolute top-6 right-0 z-10 transform flex p-2 bg-theme-lighter shadow-xl focus:ring-2 ring-opacity-5 rounded-lg ",children:o.jsx(jt,{headline:e,type:t,className:"w-full h-full max-w-[50vw] max-h-[40vh] overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:o.jsx(jt.Default,{type:t,changes:n})})})})]})})}function sa(){const e=y(i=>i.planOverview),[t,n]=s.useState(e);return s.useEffect(()=>{V(e.isEmpty)&&e.isFinished&&n(new gn(e))},[e]),(V(e.isLatest)||e.isFetching)&&t.hasUpdates?o.jsxs("span",{className:"flex group items-center bg-neutral-5 dark:bg-neutral-20 px-1 py-1 rounded-full",children:[(Le(t.hasChanges)||Le(t.hasBackfills))&&o.jsx(Mt,{className:"mr-2",children:"Changes"}),le(t.added)&&o.jsx(ie,{headline:"Added",type:B.Add,changes:t.added,className:"-mr-2 group-hover:mr-0 z-[5]"}),le(t.direct)&&o.jsx(ie,{headline:"Directly Modified",type:B.Direct,changes:t.direct,className:"-mr-2 group-hover:mr-0 z-[4]"}),le(t.indirect)&&o.jsx(ie,{headline:"Indirectly Modified",type:B.Indirect,changes:t.indirect,className:"-mr-2 group-hover:mr-0 z-[3]"}),le(t.metadata)&&o.jsx(ie,{headline:"Metadata",type:B.Metadata,changes:t.metadata,className:"-mr-2 group-hover:mr-0 z-[2]"}),le(t.removed)&&o.jsx(ie,{headline:"Removed",type:B.Remove,changes:t.removed,className:"-mr-2 group-hover:mr-0 z-[1]"}),le(t.backfills)?o.jsx(ie,{headline:"Backfills",type:B.Default,changes:t.backfills,className:"ml-4 group-hover:ml-2 z-[6]"}):o.jsx("div",{className:"ml-2 group-hover:ml-2 z-[6]"})]}):o.jsx(Mt,{className:"pr-2 pl-0.5 py-1 rounded-full bg-neutral-5 dark:bg-neutral-20 text-neutral-500 dark:text-neutral-300",children:"No Changes"})}function Mt({className:e,children:t}){const n=E(d=>d.environment),r=E(d=>d.addRemoteEnvironments),i=y(d=>d.planAction),{refetch:l}=it(),{refetch:u}=ct(n.name,{planOptions:{skip_tests:!0,include_unmodified:!0}});function c(d){const{environments:v,default_target_environment:w,pinned_environments:Z}=d??{};$t(v)&&r(Object.values(v),w,Z)}return o.jsxs("p",{className:_("flex items-center text-xs text-neutral-600 dark:text-neutral-300 font-bold text-center whitespace-nowrap",e),children:[o.jsx(et,{className:"w-5 h-5 !p-0 !m-0 !ml-0.5 !mr-1 border-none !rounded-full bg-neutral-10 dark:bg-neutral-20",variant:tt.Info,size:St.sm,disabled:i.isProcessing,onClick:d=>{d.stopPropagation(),l().then(({data:v})=>{u(),c(v)})},children:o.jsx($n,{className:"text-neutral-500 dark:text-neutral-300 w-4 h-4"})}),t]})}function Kt({children:e}){return o.jsxs(rn,{className:"inline-block",children:[o.jsx(nt,{className:"w-3 h-3 border border-neutral-10 mr-2"}),o.jsx("span",{className:"inline-block text-xs whitespace-nowrap",children:e})]})}let Xe;function oa(){const e=E(p=>p.modules),t=E(p=>p.environment),n=E(p=>p.models),r=y(p=>p.planAction),i=y(p=>p.planApply),l=y(p=>p.planOverview),u=y(p=>p.planCancel),c=y(p=>p.setPlanApply),d=y(p=>p.setPlanOverview),v=y(p=>p.setPlanCancel),w=y(p=>p.setPlanAction),Z=y(p=>p.resetPlanTrackers),G=y(p=>p.clearPlanApply),{isFetching:P}=an(t.name),{isFetching:R}=sn(),{isFetching:A}=it(),{refetch:f,isFetching:N}=ct(t.name,{planOptions:{skip_tests:!0,include_unmodified:!0}});return s.useEffect(()=>{n.size>0&&V(r.isProcessing)&&V(r.isRunningTask)&&(Z(),G(),f())},[n,t]),s.useEffect(()=>{N&&(l.isFetching=!0,d(l)),P&&(i.isFetching=!0,c(i)),R&&(u.isFetching=!0,v(u))},[N,P,R]),s.useEffect(()=>{clearTimeout(Xe);const p=rt.getPlanAction({planOverview:l,planApply:i,planCancel:u});p===ce.Done&&r.isRunningTask||p===r.value||(Xe=setTimeout(()=>{w(new rt({value:p})),Xe=void 0},on([ce.Running,ce.RunningTask,ce.Cancelling,ce.Applying],p)?0:500))},[l,i,u]),o.jsx("div",{className:"min-h-8 max-h-8 flex w-full items-center justify-end text-neutral-500",children:A?o.jsx(Kt,{children:"Loading Environments..."}):o.jsxs(o.Fragment,{children:[V(e.hasOnlyPlans)&&V(e.hasOnlyPlansAndErrors)&&o.jsx(q,{title:r.isProcessing?r.displayStatus(l):"Plan",to:Y.Plan,icon:r.isProcessing?o.jsx(nt,{variant:tt.Success,className:"w-3 py-1"}):o.jsx(Wt,{className:_("w-5",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100")}),iconActive:r.isProcessing?o.jsx(nt,{variant:tt.Success,className:"w-3 py-1"}):o.jsx(Vt,{className:_("w-5",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100")}),before:o.jsx("p",{className:_("block mx-1 text-xs font-bold whitespace-nowrap",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100"),children:r.isProcessing?r.displayStatus(l):"Plan"}),className:_("px-2 rounded-full py-0.5 mr-1",l.isFailed?"bg-danger-10 dark:bg-danger-500":"bg-success-500"),classActive:_(l.isFailed?"bg-danger-10 dark:bg-danger-500":"bg-success-500")}),o.jsx("div",{className:"flex justify-center items-center min-w-[6rem] max-w-full",children:o.jsx(bn,{className:"border-none mx-2 w-full",size:St.sm,showAddEnvironment:!0,disabled:N||r.isProcessing||t.isInitialProd})}),o.jsx(sa,{})]})})}function la(){const e=Dt();return o.jsxs("div",{className:"flex",children:[o.jsx("button",{onClick:()=>e(-1),className:"inline-block text-neutral-700 dark:text-neutral-300 text-xs hover:bg-neutral-5 dark:hover:bg-neutral-10 px-1 py-1 rounded-full",children:o.jsx(On,{className:"min-w-4 h-4"})}),o.jsx("button",{onClick:()=>e(1),className:"inline-block text-neutral-700 dark:text-neutral-300 text-xs hover:bg-neutral-5 dark:hover:bg-neutral-10 px-1 py-1 rounded-full",children:o.jsx(Mn,{className:"min-w-4 h-4"})})]})}function ia(){const e=E(n=>n.modules),{isFetching:t}=Ot();return o.jsxs("div",{className:_("relative min-w-[10rem] px-2 min-h-[2rem] max-h-[2rem] w-full flex items-center",e.showHistoryNavigation?"justify-between":"justify-end",t&&"overflow-hidden"),children:[e.showHistoryNavigation&&o.jsx(la,{}),t&&o.jsx("div",{className:"absolute w-full h-full flex justify-center items-center z-10 bg-transparent-20 backdrop-blur-lg",children:o.jsx(Kt,{children:"Loading Models..."})}),e.hasPlans&&o.jsx(oa,{}),e.hasErrors&&o.jsx(vn,{})]})}function ca({show:e,children:t,afterLeave:n,onClose:r=()=>{}}){return o.jsx(ot,{appear:!0,show:e,as:s.Fragment,afterLeave:n,children:o.jsxs(Gt,{as:"div",className:"relative z-50",onClose:r,children:[o.jsx("div",{className:"fixed inset-0 bg-overlay opacity-90"}),o.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:o.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:o.jsx(ot.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:t})})})]})})}function D({show:e,children:t,onClose:n,afterLeave:r}){return o.jsx(ca,{show:e,onClose:n,afterLeave:r,children:o.jsx(Gt.Panel,{className:"min-w-[20rem] max-w-[50rem] transform rounded-xl bg-theme text-left align-middle shadow-xl transition-all overflow-hidden",children:t})})}function ua({children:e}){return o.jsx("div",{className:"py-4 px-5 m-2",children:e})}function da({children:e}){return o.jsx("h2",{className:"font-bold text-xl mb-2",children:e})}function fa({children:e}){return o.jsx("h4",{className:"font-bold",children:e})}function ma({children:e}){return o.jsx("p",{className:"text-sm",children:e})}function ha({children:e}){return o.jsx("div",{className:"flex justify-end items-center py-3 px-3",children:e})}function pa({details:e}){return o.jsx("ul",{className:"my-2 p-4 bg-warning-10 rounded-md max-h-[20vh] overflow-y-auto hover:scrollbar scrollbar--vertical",children:e.map(t=>o.jsx("li",{className:"text-sm",children:t},t))})}D.Headline=da;D.Tagline=fa;D.Description=ma;D.Actions=ha;D.Main=ua;D.Details=pa;const va=2e4,ga=3e3;class wa{constructor(t,n){oe(this,"channels",new Map);oe(this,"eventSource");oe(this,"timerId");oe(this,"source");oe(this,"delay",va);this.source=t,this.delay=n??this.delay,this.setEventSource()}listen(t){t.addEventListener("error",n=>{this.reconnect(ga)}),t.addEventListener("ping",n=>{this.reconnect(this.delay)})}cleanup(){var t;this.channels.forEach((n,r)=>{var i;$(n)&&((i=this.eventSource)==null||i.removeEventListener(r,n))}),(t=this.eventSource)==null||t.close(),this.eventSource=void 0}resubscribe(){this.channels.forEach((t,n)=>{var r;$(t)&&((r=this.eventSource)==null||r.addEventListener(n,t))})}reconnect(t){clearTimeout(this.timerId),this.timerId=setTimeout(()=>{console.log(`Reconnecting Event Source ${this.source}`),this.cleanup(),this.setEventSource(),this.resubscribe()},t)}getEventSource(){return new EventSource(this.source,{withCredentials:!0})}setEventSource(){this.eventSource=this.getEventSource(),this.listen(this.eventSource)}addChannel(t,n){var i;const r=this.getChannelHandler(t,n);(i=this.eventSource)==null||i.addEventListener(t,r),this.channels.set(t,r)}removeChannel(t){var r;const n=this.getChannel(t);$(n)&&((r=this.eventSource)==null||r.removeEventListener(t,n),this.channels.delete(t))}hasChannel(t){return $(this.getChannel(t))}getChannel(t){return this.channels.get(t)}getChannelHandler(t,n){return r=>{if(this.reconnect(this.delay),!(S(t)||S(n)||S(r.data)))try{n(JSON.parse(r.data))}catch(i){console.warn(i)}}}}let xe;function xa(){return S(xe)&&(xe=new wa(ln("/api/events"))),(e,t)=>({subscribe(){$(e)&&$(t)&&V(xe.hasChannel(e))&&xe.addChannel(e,t)},unsubscribe(){xe.removeChannel(e)}})}function _a({content:e}){const t=cn(),n=Dt(),{removeError:r,addError:i}=Lt(),l=E(a=>a.modules),u=E(a=>a.environment),c=E(a=>a.environments),d=E(a=>a.showConfirmation),v=E(a=>a.confirmations),w=E(a=>a.setShowConfirmation),Z=E(a=>a.removeConfirmation),G=E(a=>a.setModels),P=E(a=>a.addRemoteEnvironments),R=E(a=>a.addLocalEnvironment),A=E(a=>a.setEnvironment);let f;V(l.hasOnlyDataCatalog)&&(f=xa());const N=y(a=>a.planApply),p=y(a=>a.planOverview),j=y(a=>a.planCancel),re=y(a=>a.setPlanApply),$e=y(a=>a.setPlanOverview),K=y(a=>a.setPlanCancel),je=y(a=>a.setPlanAction),I=X(a=>a.files),ae=X(a=>a.selectedFile),Ce=X(a=>a.setProject),De=X(a=>a.setFiles),ke=X(a=>a.refreshFiles),he=X(a=>a.findArtifactByPath),pe=X(a=>a.setTests),se=X(a=>a.setActiveRange),Re=ee(a=>a.storedTabs),Oe=ee(a=>a.storedTabId),ve=ee(a=>a.selectTab),He=ee(a=>a.createTab),Be=ee(a=>a.addTabs),Ze=ee(a=>a.closeTab),Ie=ee(a=>a.inTabs),mt=E(a=>a.setVersion),{refetch:ze,cancel:ht}=un(),{refetch:Ae,cancel:_e}=Ot(),{refetch:Ve,cancel:Ne}=dn(),{refetch:Pe,cancel:b}=it(),{refetch:O,cancel:T}=ct(u.name,{planOptions:{skip_tests:!0,include_unmodified:!0}}),z=s.useCallback(function(m){const x=Array.from(c).find(g=>g.name===m);S(x)?R(m):A(x)},[c]),pt=s.useCallback(function(m){p.update(m),m.environment!==u.name&&z(m.environment),$e(p)},[z,u]),vt=s.useCallback(function(m){var g,L;N.update(m,p),m.environment!==u.name&&z(m.environment),re(N);const x=Le((g=m.meta)==null?void 0:g.done)&&((L=m.meta)==null?void 0:L.status)!==qe.init;j.isFinished||j.isRunning||V(x)||Pe().then(({data:k})=>{O(),bt(k)})},[j,p,z,u]),gt=s.useCallback(function(m){var x,g;j.update(m),m.environment!==u.name&&z(m.environment),K(j),!(fn((x=m.meta)==null?void 0:x.done)||((g=m.meta)==null?void 0:g.status)===qe.init)&&O()},[z,u]),wt=s.useCallback(function({changes:m,directories:x}){var g,L;m.sort(k=>k.change===Ge.Deleted?-1:1),m.forEach(({change:k,path:J,file:F})=>{var M,W;if(k===Ge.Modified){const H=I.get(J);if(S(H)||S(F))return;H.update(F)}if(k===Ge.Deleted){const H=he(J)??I.get(J);if(S(H))return;H instanceof Ue&&((M=H.parent)==null||M.removeDirectory(H)),H instanceof Nt&&((W=H.parent)==null||W.removeFile(H),Ie(H)&&Ze(H))}});for(const k in x){const J=x[k],F=he(k);S(F)||((g=J.directories)==null||g.forEach(M=>{const W=he(M.path);S(W)&&F.addDirectory(new Ue(M,F))}),(L=J.files)==null||L.forEach(M=>{const W=I.get(M.path);S(W)&&F.addFile(new Nt(M,F))}),F.directories.sort((M,W)=>M.name>W.name?1:-1),F.files.sort((M,W)=>M.name>W.name?1:-1))}ke(),se(),Ae().then(({data:k})=>We(k))},[I]),xt=s.useCallback(function(m){const x=I.get(m.path);$(x)&&(x.isFormatted=m.status===qe.success,ke())},[I]),Jt=s.useCallback(function(m){if(mn(Re))return;const x=Re.map(({id:L,content:k})=>{const J=m.find(M=>M.id===L)??Ln(L),F=He(J);return F.file.content=k??F.file.content??"",F}),g=x.find(L=>L.file.id===Oe);Be(x),$(g)&&S(ae)&&ve(g)},[ve]);s.useEffect(()=>{ze().then(({data:g})=>{mt(g==null?void 0:g.version),Le(g==null?void 0:g.has_running_task)&&je(new rt({value:ce.RunningTask}))}),Ae().then(({data:g})=>We(g));const a=f==null?void 0:f("errors",Xt),m=f==null?void 0:f("tests",Qt),x=f==null?void 0:f("models",We);return x==null||x.subscribe(),l.hasPlans&&(m==null||m.subscribe(),Pe().then(({data:g})=>bt(g))),l.hasErrors&&(a==null||a.subscribe()),l.hasFiles&&Ve().then(({data:g})=>{if(S(g))return;const L=new Ue(g),k=L.allFiles;Jt(k),De(k),Ce(L)}),()=>{ht(),_e(),x==null||x.unsubscribe(),l.hasPlans&&(b(),T()),l.hasErrors&&(a==null||a.unsubscribe()),l.hasTests&&(m==null||m.unsubscribe()),l.hasFiles&&Ne()}},[l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-apply",vt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[vt,l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-overview",pt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[pt,l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-cancel",gt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[gt,l]),s.useEffect(()=>{const a=f==null?void 0:f("file",wt);return a==null||a.subscribe(),()=>{a==null||a.unsubscribe()}},[wt]),s.useEffect(()=>{const a=f==null?void 0:f("format-file",xt);return a==null||a.subscribe(),()=>{a==null||a.unsubscribe()}},[xt]),s.useEffect(()=>{(V(l.isEmpty)&&t.pathname===Y.Home||t.pathname==="")&&n(l.defaultNavigationRoute(),{replace:!0})},[t,l]),s.useEffect(()=>{w(v.length>0)},[v]);function We(a){$(a)&&(r(Et.Models),G(a))}function Xt(a){i(Et.General,a)}function Qt(a){pe(a)}function bt(a){const{environments:m,default_target_environment:x,pinned_environments:g}=a??{};$t(m)&&P(Object.values(m),x,g)}function Ye(a){var m;(m=a==null?void 0:a.cancel)==null||m.call(a),w(!1)}const h=v[0];return o.jsxs(hn.Page,{layout:"horizontal",children:[l.showModuleNavigation&&o.jsxs(o.Fragment,{children:[o.jsx(ir,{className:"overflow-hidden py-1 px-2 flex flex-col items-center"}),o.jsx(yt,{orientation:"vertical"})]}),o.jsxs("div",{className:"flex flex-col overflow-hidden w-full h-full",children:[l.showNavigation&&o.jsxs(o.Fragment,{children:[o.jsx(ia,{}),o.jsx(yt,{})]}),e??o.jsx(pn,{}),o.jsxs(D,{show:d,onClose:()=>{Ye(h)},afterLeave:()=>{Z()},onKeyDown:a=>{a.key==="Escape"&&Ye(h)},children:[o.jsxs(D.Main,{children:[$(h==null?void 0:h.headline)&&o.jsx(D.Headline,{children:h==null?void 0:h.headline}),$(h==null?void 0:h.tagline)&&o.jsx(D.Tagline,{children:h==null?void 0:h.tagline}),$(h==null?void 0:h.details)&&o.jsx(D.Details,{details:h==null?void 0:h.details}),$(h==null?void 0:h.description)&&o.jsx(D.Description,{children:h==null?void 0:h.description}),h==null?void 0:h.children]}),o.jsxs(D.Actions,{children:[o.jsx(et,{className:"font-bold",size:"md",variant:"danger",onClick:a=>{var m;a.stopPropagation(),(m=h==null?void 0:h.action)==null||m.call(h),w(!1)},children:(h==null?void 0:h.yesText)??"Confirm"}),o.jsx(et,{size:"md",variant:"alternative",onClick:a=>{a.stopPropagation(),Ye(h)},children:(h==null?void 0:h.noText)??"Cancel"})]})]})]})]})}export{_a as default};
1
+ var en=Object.defineProperty;var tn=(e,t,n)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>tn(e,typeof t!="symbol"?t+"":t,n);import{r as s,j as o,N as nn,c as _,b as V,d as Lt,a as E,e as Y,R as C,f as Qe,g as Le,h as le,k as it,l as ct,B as et,m as St,n as tt,o as $t,L as rn,S as nt,p as an,q as sn,s as on,t as Dt,v as Ot,w as S,x as ln,i as $,y as cn,z as un,A as dn,C as qe,D as fn,F as mn,G as Et,H as hn,I as yt,O as pn}from"./index-C22hdM_h.js";import{R as vn}from"./ReportErrors-DaAC3YF4.js";import{u as y,M as gn,a as rt,E as ce}from"./plan-BUTy2uM-.js";import{G as wn,w as xn,E as B,P as jt,S as bn}from"./SelectEnvironment-0MCV04NI.js";import{o as U,U as de,y as fe,l as Ht,n as Bt,a as En,u as be,s as Te,O as Me,M as ue,p as yn,b as Ct,c as kt,C as me,d as jn,e as ne,f as Zt,E as It,t as zt,N as Cn,g as kn,h as _t,i as ut,I as Ee,j as Rn,k as Fe,m as An,q as Nn,r as Pn,v as at,w as st,x as Rt,z as Tn,A as Fn,B as At,D as ot}from"./transition-CiMBgn_Y.js";import{F as Mn}from"./ChevronRightIcon-BpRv8ZN4.js";import{u as X,M as Ue}from"./project-CtAE3tsj.js";import{M as Nt}from"./file-DY5SRTK1.js";import{u as ee,c as Ln}from"./editor-CmeEFdEz.js";import{EnumFileExplorerChange as Ge}from"./context-pytQSsK4.js";import"./PlusCircleIcon-CXYicjof.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./SplitPane-7_khUxNG.js";import"./context-B0V9EzWJ.js";import"./Input-CxOCLTNw.js";import"./help-6Q7f7fjd.js";import"./SourceList-CTL41Fia.js";import"./index-BWibl-Ee.js";import"./ModelLineage-BFuK5Bgk.js";import"./ListboxShow-YBO3HIHQ.js";import"./SearchList-Lag39srv.js";import"./ChevronDownIcon-D8CFPQ96.js";function Sn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))}const $n=s.forwardRef(Sn);function Dn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const On=s.forwardRef(Dn);function Hn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Zm10.857 5.691a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 0 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Bn=s.forwardRef(Hn);function Zn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",clipRule:"evenodd"}))}const In=s.forwardRef(Zn);function zn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const _n=s.forwardRef(zn);function Vn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z"}))}const Wn=s.forwardRef(Vn);function Yn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm6.39-2.908a.75.75 0 0 1 .766.027l3.5 2.25a.75.75 0 0 1 0 1.262l-3.5 2.25A.75.75 0 0 1 8 12.25v-4.5a.75.75 0 0 1 .39-.658Z",clipRule:"evenodd"}))}const Vt=s.forwardRef(Yn);function qn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M9.661 2.237a.531.531 0 0 1 .678 0 11.947 11.947 0 0 0 7.078 2.749.5.5 0 0 1 .479.425c.069.52.104 1.05.104 1.59 0 5.162-3.26 9.563-7.834 11.256a.48.48 0 0 1-.332 0C5.26 16.564 2 12.163 2 7c0-.538.035-1.069.104-1.589a.5.5 0 0 1 .48-.425 11.947 11.947 0 0 0 7.077-2.75Zm4.196 5.954a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Un=s.forwardRef(qn);function Gn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M15.98 1.804a1 1 0 0 0-1.96 0l-.24 1.192a1 1 0 0 1-.784.785l-1.192.238a1 1 0 0 0 0 1.962l1.192.238a1 1 0 0 1 .785.785l.238 1.192a1 1 0 0 0 1.962 0l.238-1.192a1 1 0 0 1 .785-.785l1.192-.238a1 1 0 0 0 0-1.962l-1.192-.238a1 1 0 0 1-.785-.785l-.238-1.192ZM6.949 5.684a1 1 0 0 0-1.898 0l-.683 2.051a1 1 0 0 1-.633.633l-2.051.683a1 1 0 0 0 0 1.898l2.051.684a1 1 0 0 1 .633.632l.683 2.051a1 1 0 0 0 1.898 0l.683-2.051a1 1 0 0 1 .633-.633l2.051-.683a1 1 0 0 0 0-1.898l-2.051-.683a1 1 0 0 1-.633-.633L6.95 5.684ZM13.949 13.684a1 1 0 0 0-1.898 0l-.184.551a1 1 0 0 1-.632.633l-.551.183a1 1 0 0 0 0 1.898l.551.183a1 1 0 0 1 .633.633l.183.551a1 1 0 0 0 1.898 0l.184-.551a1 1 0 0 1 .632-.633l.551-.183a1 1 0 0 0 0-1.898l-.551-.184a1 1 0 0 1-.633-.632l-.183-.551Z"}))}const Pt=s.forwardRef(Gn);function Kn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M.99 5.24A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25l.01 9.5A2.25 2.25 0 0 1 16.76 17H3.26A2.267 2.267 0 0 1 1 14.74l-.01-9.5Zm8.26 9.52v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75v.615c0 .414.336.75.75.75h5.373a.75.75 0 0 0 .627-.74Zm1.5 0a.75.75 0 0 0 .627.74h5.373a.75.75 0 0 0 .75-.75v-.615a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75v.625Zm6.75-3.63v-.625a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75v.625c0 .414.336.75.75.75h5.25a.75.75 0 0 0 .75-.75Zm-8.25 0v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75v.625c0 .414.336.75.75.75H8.5a.75.75 0 0 0 .75-.75ZM17.5 7.5v-.625a.75.75 0 0 0-.75-.75H11.5a.75.75 0 0 0-.75.75V7.5c0 .414.336.75.75.75h5.25a.75.75 0 0 0 .75-.75Zm-8.25 0v-.625a.75.75 0 0 0-.75-.75H3.25a.75.75 0 0 0-.75.75V7.5c0 .414.336.75.75.75H8.5a.75.75 0 0 0 .75-.75Z",clipRule:"evenodd"}))}const Tt=s.forwardRef(Kn);function Jn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}))}const Xn=s.forwardRef(Jn);function Qn({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const er=s.forwardRef(Qn);function tr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const nr=s.forwardRef(tr);function rr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const ar=s.forwardRef(rr);function sr({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"}))}const Wt=s.forwardRef(sr);function or({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const lr=s.forwardRef(or);function q({title:e,to:t,icon:n,iconActive:r,classActive:i="px-2 bg-neutral-10",disabled:l=!1,children:u,before:c,className:d}){return o.jsx(nn,{title:e,to:t,className:({isActive:v})=>_("flex items-center",l&&"opacity-50 cursor-not-allowed",v&&V(l)&&i,d),style:({isActive:v})=>v||l?{pointerEvents:"none"}:{},children:({isActive:v})=>o.jsxs("span",{className:_("flex items-center",v?"font-bold":"font-normal"),children:[c,v?r:n,u]})})}function ir({className:e}){const{errors:t}=Lt(),n=E(l=>l.models),r=E(l=>l.modules),i=Array.from(new Set(n.values())).length;return o.jsxs("div",{className:e,children:[r.hasEditor&&o.jsx(q,{title:"File Explorer",to:Y.Editor,className:"px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-primary-500 rounded-xl my-1",classActive:"bg-primary-10 text-primary-500",icon:o.jsx(ar,{className:"min-w-6 w-6"}),iconActive:o.jsx(Wn,{className:"min-w-6 w-6"})}),r.hasDataCatalog&&o.jsx(q,{title:"Data Catalog",to:Y.DataCatalog,icon:o.jsx(er,{className:"min-w-6 w-6"}),iconActive:o.jsx(In,{className:"min-w-6 w-6"}),className:"relative rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-600 dark:text-neutral-300",children:o.jsx("span",{className:"min-w-[1rem] px-1 h-4 py-0.5 text-center text-[9px] absolute bottom-0 right-0 font-black rounded-full bg-primary-500 text-primary-100",children:i})}),r.hasErrors&&o.jsx(q,{title:"Errors",to:Y.Errors,className:_("relative px-2 py-1 rounded-xl my-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10",t.size>0?"text-danger-500":"text-neutral-600"),classActive:"px-2 bg-danger-10 text-danger-500",icon:o.jsx(nr,{className:"w-6"}),iconActive:o.jsx(_n,{className:"w-6"}),disabled:t.size===0,children:t.size>0&&o.jsx("span",{className:"min-w-[1rem] px-1 h-4 py-0.5 text-center text-[9px] absolute bottom-0 right-0 font-black rounded-full bg-danger-500 text-danger-100",children:t.size})}),r.hasPlans&&o.jsx(q,{title:"Plan",to:Y.Plan,className:"px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-success-500 rounded-xl my-1",classActive:"bg-success-10 text-success-500",icon:o.jsx(Wt,{className:"w-6"}),iconActive:o.jsx(Vt,{className:"w-6"})}),r.hasTests&&o.jsx(q,{title:"Tests",to:Y.Tests,icon:o.jsx(Xn,{className:"w-6"}),iconActive:o.jsx(Bn,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10"}),r.hasAudits&&o.jsx(q,{title:"Audits",to:Y.Audits,icon:o.jsx(lr,{className:"w-6"}),iconActive:o.jsx(Un,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10"}),r.hasData&&o.jsx(q,{title:"Data",to:Y.Data,icon:o.jsx(Tt,{className:"w-6"}),iconActive:o.jsx(Tt,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-500 dark:text-neutral-300"}),r.hasLineage&&o.jsx(q,{title:"Lineage",to:Y.Lineage,icon:o.jsx(Pt,{className:"w-6"}),iconActive:o.jsx(Pt,{className:"w-6"}),className:"rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-500 dark:text-neutral-300"})]})}function dt(e,t){let n=s.useRef([]),r=U(e);s.useEffect(()=>{let i=[...n.current];for(let[l,u]of t.entries())if(n.current[l]!==u){let c=r(t,i);return n.current=t,c}},[r,...t])}function cr(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Q=[];cr(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Q[0]!==t.target&&(Q.unshift(t.target),Q=Q.filter(n=>n!=null&&n.isConnected),Q.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Yt(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let ur="div";var qt=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(qt||{});function dr(e,t){let n=s.useRef(null),r=fe(n,t),{initialFocus:i,containers:l,features:u=30,...c}=e;Ht()||(u=1);let d=Bt(n);hr({ownerDocument:d},!!(u&16));let v=pr({ownerDocument:d,container:n,initialFocus:i},!!(u&2));vr({ownerDocument:d,container:n,containers:l,previousActiveElement:v},!!(u&8));let w=En(),Z=U(A=>{let f=n.current;f&&(N=>N())(()=>{be(w.current,{[Te.Forwards]:()=>{Me(f,ue.First,{skipElements:[A.relatedTarget]})},[Te.Backwards]:()=>{Me(f,ue.Last,{skipElements:[A.relatedTarget]})}})})}),G=yn(),P=s.useRef(!1),R={ref:r,onKeyDown(A){A.key=="Tab"&&(P.current=!0,G.requestAnimationFrame(()=>{P.current=!1}))},onBlur(A){let f=Yt(l);n.current instanceof HTMLElement&&f.add(n.current);let N=A.relatedTarget;N instanceof HTMLElement&&N.dataset.headlessuiFocusGuard!=="true"&&(Ut(f,N)||(P.current?Me(n.current,be(w.current,{[Te.Forwards]:()=>ue.Next,[Te.Backwards]:()=>ue.Previous})|ue.WrapAround,{relativeTo:A.target}):A.target instanceof HTMLElement&&ne(A.target)))}};return C.createElement(C.Fragment,null,!!(u&4)&&C.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Z,features:kt.Focusable}),me({ourProps:R,theirProps:c,defaultTag:ur,name:"FocusTrap"}),!!(u&4)&&C.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Z,features:kt.Focusable}))}let fr=de(dr),ge=Object.assign(fr,{features:qt});function mr(e=!0){let t=s.useRef(Q.slice());return dt(([n],[r])=>{r===!0&&n===!1&&zt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Q.slice())},[e,Q,t]),U(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function hr({ownerDocument:e},t){let n=mr(t);dt(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ne(n())},[t]),jn(()=>{t&&ne(n())})}function pr({ownerDocument:e,container:t,initialFocus:n},r){let i=s.useRef(null),l=Zt();return dt(()=>{if(!r)return;let u=t.current;u&&zt(()=>{if(!l.current)return;let c=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===c){i.current=c;return}}else if(u.contains(c)){i.current=c;return}n!=null&&n.current?ne(n.current):Me(u,ue.First)===Cn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[r]),i}function vr({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let l=Zt();It(e==null?void 0:e.defaultView,"focus",u=>{if(!i||!l.current)return;let c=Yt(n);t.current instanceof HTMLElement&&c.add(t.current);let d=r.current;if(!d)return;let v=u.target;v&&v instanceof HTMLElement?Ut(c,v)?(r.current=v,ne(v)):(u.preventDefault(),u.stopPropagation(),ne(d)):ne(r.current)},!0)}function Ut(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function gr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const wr=typeof Object.is=="function"?Object.is:gr,{useState:xr,useEffect:br,useLayoutEffect:Er,useDebugValue:yr}=Qe;function jr(e,t,n){const r=t(),[{inst:i},l]=xr({inst:{value:r,getSnapshot:t}});return Er(()=>{i.value=r,i.getSnapshot=t,Ke(i)&&l({inst:i})},[e,r,t]),br(()=>(Ke(i)&&l({inst:i}),e(()=>{Ke(i)&&l({inst:i})})),[e]),yr(r),r}function Ke(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!wr(n,r)}catch{return!0}}function Cr(e,t,n){return t()}const kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rr=!kr,Ar=Rr?Cr:jr,Nr="useSyncExternalStore"in Qe?(e=>e.useSyncExternalStore)(Qe):Ar;function Pr(e){return Nr(e.subscribe,e.getSnapshot,e.getSnapshot)}function Tr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...l){let u=t[i].call(n,...l);u&&(n=u,r.forEach(c=>c()))}}}function Fr(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,i=r.clientWidth-r.offsetWidth,l=e-i;n.style(r,"paddingRight",`${l}px`)}}}function Mr(){return kn()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(l=>l()).some(l=>l.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=_t();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let l=(i=window.scrollY)!=null?i:window.pageYOffset,u=null;t.addEventListener(e,"click",c=>{if(c.target instanceof HTMLElement)try{let d=c.target.closest("a");if(!d)return;let{hash:v}=new URL(d.href),w=e.querySelector(v);w&&!r(w)&&(u=w)}catch{}},!0),t.addEventListener(e,"touchstart",c=>{if(c.target instanceof HTMLElement)if(r(c.target)){let d=c.target;for(;d.parentElement&&r(d.parentElement);)d=d.parentElement;t.style(d,"overscrollBehavior","contain")}else t.style(c.target,"touchAction","none")}),t.addEventListener(e,"touchmove",c=>{if(c.target instanceof HTMLElement)if(r(c.target)){let d=c.target;for(;d.parentElement&&d.dataset.headlessuiPortal!==""&&!(d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth);)d=d.parentElement;d.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()},{passive:!1}),t.add(()=>{var c;let d=(c=window.scrollY)!=null?c:window.pageYOffset;l!==d&&window.scrollTo(0,l),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function Lr(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Sr(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let te=Tr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:_t(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Sr(n)},i=[Mr(),Fr(),Lr()];i.forEach(({before:l})=>l==null?void 0:l(r)),i.forEach(({after:l})=>l==null?void 0:l(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});te.subscribe(()=>{let e=te.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&te.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&te.dispatch("TEARDOWN",n)}});function $r(e,t,n){let r=Pr(te),i=e?r.get(e):void 0,l=i?i.count>0:!1;return ut(()=>{if(!(!e||!t))return te.dispatch("PUSH",e,n),()=>te.dispatch("POP",e,n)},[t,e]),l}let Je=new Map,we=new Map;function Ft(e,t=!0){ut(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function i(){var u;if(!r)return;let c=(u=we.get(r))!=null?u:1;if(c===1?we.delete(r):we.set(r,c-1),c!==1)return;let d=Je.get(r);d&&(d["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",d["aria-hidden"]),r.inert=d.inert,Je.delete(r))}let l=(n=we.get(r))!=null?n:0;return we.set(r,l+1),l!==0||(Je.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),i},[e,t])}let ft=s.createContext(()=>{});ft.displayName="StackContext";var lt=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(lt||{});function Dr(){return s.useContext(ft)}function Or({children:e,onUpdate:t,type:n,element:r,enabled:i}){let l=Dr(),u=U((...c)=>{t==null||t(...c),l(...c)});return ut(()=>{let c=i===void 0||i===!0;return c&&u(0,n,r),()=>{c&&u(1,n,r)}},[u,n,r,i]),C.createElement(ft.Provider,{value:u},e)}var Hr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hr||{}),Br=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Br||{});let Zr={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Se=s.createContext(null);Se.displayName="DialogContext";function ye(e){let t=s.useContext(Se);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ye),n}return t}function Ir(e,t,n=()=>[document.body]){$r(e,t,r=>{var i;return{containers:[...(i=r.containers)!=null?i:[],n]}})}function zr(e,t){return be(t.type,Zr,e,t)}let _r="div",Vr=Rt.RenderStrategy|Rt.Static;function Wr(e,t){let n=Ee(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:l,initialFocus:u,role:c="dialog",__demoMode:d=!1,...v}=e,[w,Z]=s.useState(0),G=s.useRef(!1);c=function(){return c==="dialog"||c==="alertdialog"?c:(G.current||(G.current=!0,console.warn(`Invalid role [${c}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let P=Rn();i===void 0&&P!==null&&(i=(P&Fe.Open)===Fe.Open);let R=s.useRef(null),A=fe(R,t),f=Bt(R),N=e.hasOwnProperty("open")||P!==null,p=e.hasOwnProperty("onClose");if(!N&&!p)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!N)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!p)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let j=i?0:1,[re,$e]=s.useReducer(zr,{titleId:null,descriptionId:null,panelRef:s.createRef()}),K=U(()=>l(!1)),je=U(b=>$e({type:0,id:b})),I=Ht()?d?!1:j===0:!1,ae=w>1,Ce=s.useContext(Se)!==null,[De,ke]=An(),he={get current(){var b;return(b=re.panelRef.current)!=null?b:R.current}},{resolveContainers:pe,mainTreeNodeRef:se,MainTreeNode:Re}=Nn({portals:De,defaultContainers:[he]}),Oe=ae?"parent":"leaf",ve=P!==null?(P&Fe.Closing)===Fe.Closing:!1,He=Ce||ve?!1:I,Be=s.useCallback(()=>{var b,O;return(O=Array.from((b=f==null?void 0:f.querySelectorAll("body > *"))!=null?b:[]).find(T=>T.id==="headlessui-portal-root"?!1:T.contains(se.current)&&T instanceof HTMLElement))!=null?O:null},[se]);Ft(Be,He);let Ze=ae?!0:I,Ie=s.useCallback(()=>{var b,O;return(O=Array.from((b=f==null?void 0:f.querySelectorAll("[data-headlessui-portal]"))!=null?b:[]).find(T=>T.contains(se.current)&&T instanceof HTMLElement))!=null?O:null},[se]);Ft(Ie,Ze),Pn(pe,b=>{b.preventDefault(),K()},!(!I||ae));let ze=!(ae||j!==0);It(f==null?void 0:f.defaultView,"keydown",b=>{ze&&(b.defaultPrevented||b.key===Tn.Escape&&(b.preventDefault(),b.stopPropagation(),K()))}),Ir(f,!(ve||j!==0||Ce),pe),s.useEffect(()=>{if(j!==0||!R.current)return;let b=new ResizeObserver(O=>{for(let T of O){let z=T.target.getBoundingClientRect();z.x===0&&z.y===0&&z.width===0&&z.height===0&&K()}});return b.observe(R.current),()=>b.disconnect()},[j,R,K]);let[Ae,_e]=xn(),Ve=s.useMemo(()=>[{dialogState:j,close:K,setTitleId:je},re],[j,re,K,je]),Ne=s.useMemo(()=>({open:j===0}),[j]),Pe={ref:A,id:r,role:c,"aria-modal":j===0?!0:void 0,"aria-labelledby":re.titleId,"aria-describedby":Ae};return C.createElement(Or,{type:"Dialog",enabled:j===0,element:R,onUpdate:U((b,O)=>{O==="Dialog"&&be(b,{[lt.Add]:()=>Z(T=>T+1),[lt.Remove]:()=>Z(T=>T-1)})})},C.createElement(at,{force:!0},C.createElement(st,null,C.createElement(Se.Provider,{value:Ve},C.createElement(st.Group,{target:R},C.createElement(at,{force:!1},C.createElement(_e,{slot:Ne,name:"Dialog.Description"},C.createElement(ge,{initialFocus:u,containers:pe,features:I?be(Oe,{parent:ge.features.RestoreFocus,leaf:ge.features.All&~ge.features.FocusLock}):ge.features.None},C.createElement(ke,null,me({ourProps:Pe,theirProps:v,slot:Ne,defaultTag:_r,features:Vr,visible:j===0,name:"Dialog"}))))))))),C.createElement(Re,null))}let Yr="div";function qr(e,t){let n=Ee(),{id:r=`headlessui-dialog-overlay-${n}`,...i}=e,[{dialogState:l,close:u}]=ye("Dialog.Overlay"),c=fe(t),d=U(w=>{if(w.target===w.currentTarget){if(Fn(w.currentTarget))return w.preventDefault();w.preventDefault(),w.stopPropagation(),u()}}),v=s.useMemo(()=>({open:l===0}),[l]);return me({ourProps:{ref:c,id:r,"aria-hidden":!0,onClick:d},theirProps:i,slot:v,defaultTag:Yr,name:"Dialog.Overlay"})}let Ur="div";function Gr(e,t){let n=Ee(),{id:r=`headlessui-dialog-backdrop-${n}`,...i}=e,[{dialogState:l},u]=ye("Dialog.Backdrop"),c=fe(t);s.useEffect(()=>{if(u.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[u.panelRef]);let d=s.useMemo(()=>({open:l===0}),[l]);return C.createElement(at,{force:!0},C.createElement(st,null,me({ourProps:{ref:c,id:r,"aria-hidden":!0},theirProps:i,slot:d,defaultTag:Ur,name:"Dialog.Backdrop"})))}let Kr="div";function Jr(e,t){let n=Ee(),{id:r=`headlessui-dialog-panel-${n}`,...i}=e,[{dialogState:l},u]=ye("Dialog.Panel"),c=fe(t,u.panelRef),d=s.useMemo(()=>({open:l===0}),[l]),v=U(w=>{w.stopPropagation()});return me({ourProps:{ref:c,id:r,onClick:v},theirProps:i,slot:d,defaultTag:Kr,name:"Dialog.Panel"})}let Xr="h2";function Qr(e,t){let n=Ee(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:l,setTitleId:u}]=ye("Dialog.Title"),c=fe(t);s.useEffect(()=>(u(r),()=>u(null)),[r,u]);let d=s.useMemo(()=>({open:l===0}),[l]);return me({ourProps:{ref:c,id:r},theirProps:i,slot:d,defaultTag:Xr,name:"Dialog.Title"})}let ea=de(Wr),ta=de(Gr),na=de(Jr),ra=de(qr),aa=de(Qr),Gt=Object.assign(ea,{Backdrop:ta,Panel:na,Overlay:ra,Title:aa,Description:wn});function ie({headline:e,type:t,changes:n,className:r}){const[i,l]=s.useState(!1);return o.jsx(At,{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},className:"relative flex",children:()=>o.jsxs(o.Fragment,{children:[o.jsx("span",{className:_("transition-all flex min-w-[1rem] h-4 text-center mx-0.5 px-1 rounded-full text-[10px] font-black text-neutral-100 cursor-default border border-inherit",t===B.Add&&"bg-success-500 border-success-500",t===B.Remove&&"bg-danger-500 border-danger-500",t===B.Direct&&"bg-secondary-500 border-secondary-500",t===B.Indirect&&"bg-warning-500 border-warning-500",t===B.Metadata&&"bg-neutral-400 border-neutral-400",t===B.Default&&"bg-neutral-600 border-neutral-600",r),children:n.length}),o.jsx(ot,{show:i,as:s.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:o.jsx(At.Panel,{className:"absolute top-6 right-0 z-10 transform flex p-2 bg-theme-lighter shadow-xl focus:ring-2 ring-opacity-5 rounded-lg ",children:o.jsx(jt,{headline:e,type:t,className:"w-full h-full max-w-[50vw] max-h-[40vh] overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:o.jsx(jt.Default,{type:t,changes:n})})})})]})})}function sa(){const e=y(i=>i.planOverview),[t,n]=s.useState(e);return s.useEffect(()=>{V(e.isEmpty)&&e.isFinished&&n(new gn(e))},[e]),(V(e.isLatest)||e.isFetching)&&t.hasUpdates?o.jsxs("span",{className:"flex group items-center bg-neutral-5 dark:bg-neutral-20 px-1 py-1 rounded-full",children:[(Le(t.hasChanges)||Le(t.hasBackfills))&&o.jsx(Mt,{className:"mr-2",children:"Changes"}),le(t.added)&&o.jsx(ie,{headline:"Added",type:B.Add,changes:t.added,className:"-mr-2 group-hover:mr-0 z-[5]"}),le(t.direct)&&o.jsx(ie,{headline:"Directly Modified",type:B.Direct,changes:t.direct,className:"-mr-2 group-hover:mr-0 z-[4]"}),le(t.indirect)&&o.jsx(ie,{headline:"Indirectly Modified",type:B.Indirect,changes:t.indirect,className:"-mr-2 group-hover:mr-0 z-[3]"}),le(t.metadata)&&o.jsx(ie,{headline:"Metadata",type:B.Metadata,changes:t.metadata,className:"-mr-2 group-hover:mr-0 z-[2]"}),le(t.removed)&&o.jsx(ie,{headline:"Removed",type:B.Remove,changes:t.removed,className:"-mr-2 group-hover:mr-0 z-[1]"}),le(t.backfills)?o.jsx(ie,{headline:"Backfills",type:B.Default,changes:t.backfills,className:"ml-4 group-hover:ml-2 z-[6]"}):o.jsx("div",{className:"ml-2 group-hover:ml-2 z-[6]"})]}):o.jsx(Mt,{className:"pr-2 pl-0.5 py-1 rounded-full bg-neutral-5 dark:bg-neutral-20 text-neutral-500 dark:text-neutral-300",children:"No Changes"})}function Mt({className:e,children:t}){const n=E(d=>d.environment),r=E(d=>d.addRemoteEnvironments),i=y(d=>d.planAction),{refetch:l}=it(),{refetch:u}=ct(n.name,{planOptions:{skip_tests:!0,include_unmodified:!0}});function c(d){const{environments:v,default_target_environment:w,pinned_environments:Z}=d??{};$t(v)&&r(Object.values(v),w,Z)}return o.jsxs("p",{className:_("flex items-center text-xs text-neutral-600 dark:text-neutral-300 font-bold text-center whitespace-nowrap",e),children:[o.jsx(et,{className:"w-5 h-5 !p-0 !m-0 !ml-0.5 !mr-1 border-none !rounded-full bg-neutral-10 dark:bg-neutral-20",variant:tt.Info,size:St.sm,disabled:i.isProcessing,onClick:d=>{d.stopPropagation(),l().then(({data:v})=>{u(),c(v)})},children:o.jsx($n,{className:"text-neutral-500 dark:text-neutral-300 w-4 h-4"})}),t]})}function Kt({children:e}){return o.jsxs(rn,{className:"inline-block",children:[o.jsx(nt,{className:"w-3 h-3 border border-neutral-10 mr-2"}),o.jsx("span",{className:"inline-block text-xs whitespace-nowrap",children:e})]})}let Xe;function oa(){const e=E(p=>p.modules),t=E(p=>p.environment),n=E(p=>p.models),r=y(p=>p.planAction),i=y(p=>p.planApply),l=y(p=>p.planOverview),u=y(p=>p.planCancel),c=y(p=>p.setPlanApply),d=y(p=>p.setPlanOverview),v=y(p=>p.setPlanCancel),w=y(p=>p.setPlanAction),Z=y(p=>p.resetPlanTrackers),G=y(p=>p.clearPlanApply),{isFetching:P}=an(t.name),{isFetching:R}=sn(),{isFetching:A}=it(),{refetch:f,isFetching:N}=ct(t.name,{planOptions:{skip_tests:!0,include_unmodified:!0}});return s.useEffect(()=>{n.size>0&&V(r.isProcessing)&&V(r.isRunningTask)&&(Z(),G(),f())},[n,t]),s.useEffect(()=>{N&&(l.isFetching=!0,d(l)),P&&(i.isFetching=!0,c(i)),R&&(u.isFetching=!0,v(u))},[N,P,R]),s.useEffect(()=>{clearTimeout(Xe);const p=rt.getPlanAction({planOverview:l,planApply:i,planCancel:u});p===ce.Done&&r.isRunningTask||p===r.value||(Xe=setTimeout(()=>{w(new rt({value:p})),Xe=void 0},on([ce.Running,ce.RunningTask,ce.Cancelling,ce.Applying],p)?0:500))},[l,i,u]),o.jsx("div",{className:"min-h-8 max-h-8 flex w-full items-center justify-end text-neutral-500",children:A?o.jsx(Kt,{children:"Loading Environments..."}):o.jsxs(o.Fragment,{children:[V(e.hasOnlyPlans)&&V(e.hasOnlyPlansAndErrors)&&o.jsx(q,{title:r.isProcessing?r.displayStatus(l):"Plan",to:Y.Plan,icon:r.isProcessing?o.jsx(nt,{variant:tt.Success,className:"w-3 py-1"}):o.jsx(Wt,{className:_("w-5",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100")}),iconActive:r.isProcessing?o.jsx(nt,{variant:tt.Success,className:"w-3 py-1"}):o.jsx(Vt,{className:_("w-5",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100")}),before:o.jsx("p",{className:_("block mx-1 text-xs font-bold whitespace-nowrap",l.isFailed?"text-danger-500 dark:text-danger-100":"text-success-100"),children:r.isProcessing?r.displayStatus(l):"Plan"}),className:_("px-2 rounded-full py-0.5 mr-1",l.isFailed?"bg-danger-10 dark:bg-danger-500":"bg-success-500"),classActive:_(l.isFailed?"bg-danger-10 dark:bg-danger-500":"bg-success-500")}),o.jsx("div",{className:"flex justify-center items-center min-w-[6rem] max-w-full",children:o.jsx(bn,{className:"border-none mx-2 w-full",size:St.sm,showAddEnvironment:!0,disabled:N||r.isProcessing||t.isInitialProd})}),o.jsx(sa,{})]})})}function la(){const e=Dt();return o.jsxs("div",{className:"flex",children:[o.jsx("button",{onClick:()=>e(-1),className:"inline-block text-neutral-700 dark:text-neutral-300 text-xs hover:bg-neutral-5 dark:hover:bg-neutral-10 px-1 py-1 rounded-full",children:o.jsx(On,{className:"min-w-4 h-4"})}),o.jsx("button",{onClick:()=>e(1),className:"inline-block text-neutral-700 dark:text-neutral-300 text-xs hover:bg-neutral-5 dark:hover:bg-neutral-10 px-1 py-1 rounded-full",children:o.jsx(Mn,{className:"min-w-4 h-4"})})]})}function ia(){const e=E(n=>n.modules),{isFetching:t}=Ot();return o.jsxs("div",{className:_("relative min-w-[10rem] px-2 min-h-[2rem] max-h-[2rem] w-full flex items-center",e.showHistoryNavigation?"justify-between":"justify-end",t&&"overflow-hidden"),children:[e.showHistoryNavigation&&o.jsx(la,{}),t&&o.jsx("div",{className:"absolute w-full h-full flex justify-center items-center z-10 bg-transparent-20 backdrop-blur-lg",children:o.jsx(Kt,{children:"Loading Models..."})}),e.hasPlans&&o.jsx(oa,{}),e.hasErrors&&o.jsx(vn,{})]})}function ca({show:e,children:t,afterLeave:n,onClose:r=()=>{}}){return o.jsx(ot,{appear:!0,show:e,as:s.Fragment,afterLeave:n,children:o.jsxs(Gt,{as:"div",className:"relative z-50",onClose:r,children:[o.jsx("div",{className:"fixed inset-0 bg-overlay opacity-90"}),o.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:o.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:o.jsx(ot.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:t})})})]})})}function D({show:e,children:t,onClose:n,afterLeave:r}){return o.jsx(ca,{show:e,onClose:n,afterLeave:r,children:o.jsx(Gt.Panel,{className:"min-w-[20rem] max-w-[50rem] transform rounded-xl bg-theme text-left align-middle shadow-xl transition-all overflow-hidden",children:t})})}function ua({children:e}){return o.jsx("div",{className:"py-4 px-5 m-2",children:e})}function da({children:e}){return o.jsx("h2",{className:"font-bold text-xl mb-2",children:e})}function fa({children:e}){return o.jsx("h4",{className:"font-bold",children:e})}function ma({children:e}){return o.jsx("p",{className:"text-sm",children:e})}function ha({children:e}){return o.jsx("div",{className:"flex justify-end items-center py-3 px-3",children:e})}function pa({details:e}){return o.jsx("ul",{className:"my-2 p-4 bg-warning-10 rounded-md max-h-[20vh] overflow-y-auto hover:scrollbar scrollbar--vertical",children:e.map(t=>o.jsx("li",{className:"text-sm",children:t},t))})}D.Headline=da;D.Tagline=fa;D.Description=ma;D.Actions=ha;D.Main=ua;D.Details=pa;const va=2e4,ga=3e3;class wa{constructor(t,n){oe(this,"channels",new Map);oe(this,"eventSource");oe(this,"timerId");oe(this,"source");oe(this,"delay",va);this.source=t,this.delay=n??this.delay,this.setEventSource()}listen(t){t.addEventListener("error",n=>{this.reconnect(ga)}),t.addEventListener("ping",n=>{this.reconnect(this.delay)})}cleanup(){var t;this.channels.forEach((n,r)=>{var i;$(n)&&((i=this.eventSource)==null||i.removeEventListener(r,n))}),(t=this.eventSource)==null||t.close(),this.eventSource=void 0}resubscribe(){this.channels.forEach((t,n)=>{var r;$(t)&&((r=this.eventSource)==null||r.addEventListener(n,t))})}reconnect(t){clearTimeout(this.timerId),this.timerId=setTimeout(()=>{console.log(`Reconnecting Event Source ${this.source}`),this.cleanup(),this.setEventSource(),this.resubscribe()},t)}getEventSource(){return new EventSource(this.source,{withCredentials:!0})}setEventSource(){this.eventSource=this.getEventSource(),this.listen(this.eventSource)}addChannel(t,n){var i;const r=this.getChannelHandler(t,n);(i=this.eventSource)==null||i.addEventListener(t,r),this.channels.set(t,r)}removeChannel(t){var r;const n=this.getChannel(t);$(n)&&((r=this.eventSource)==null||r.removeEventListener(t,n),this.channels.delete(t))}hasChannel(t){return $(this.getChannel(t))}getChannel(t){return this.channels.get(t)}getChannelHandler(t,n){return r=>{if(this.reconnect(this.delay),!(S(t)||S(n)||S(r.data)))try{n(JSON.parse(r.data))}catch(i){console.warn(i)}}}}let xe;function xa(){return S(xe)&&(xe=new wa(ln("/api/events"))),(e,t)=>({subscribe(){$(e)&&$(t)&&V(xe.hasChannel(e))&&xe.addChannel(e,t)},unsubscribe(){xe.removeChannel(e)}})}function _a({content:e}){const t=cn(),n=Dt(),{removeError:r,addError:i}=Lt(),l=E(a=>a.modules),u=E(a=>a.environment),c=E(a=>a.environments),d=E(a=>a.showConfirmation),v=E(a=>a.confirmations),w=E(a=>a.setShowConfirmation),Z=E(a=>a.removeConfirmation),G=E(a=>a.setModels),P=E(a=>a.addRemoteEnvironments),R=E(a=>a.addLocalEnvironment),A=E(a=>a.setEnvironment);let f;V(l.hasOnlyDataCatalog)&&(f=xa());const N=y(a=>a.planApply),p=y(a=>a.planOverview),j=y(a=>a.planCancel),re=y(a=>a.setPlanApply),$e=y(a=>a.setPlanOverview),K=y(a=>a.setPlanCancel),je=y(a=>a.setPlanAction),I=X(a=>a.files),ae=X(a=>a.selectedFile),Ce=X(a=>a.setProject),De=X(a=>a.setFiles),ke=X(a=>a.refreshFiles),he=X(a=>a.findArtifactByPath),pe=X(a=>a.setTests),se=X(a=>a.setActiveRange),Re=ee(a=>a.storedTabs),Oe=ee(a=>a.storedTabId),ve=ee(a=>a.selectTab),He=ee(a=>a.createTab),Be=ee(a=>a.addTabs),Ze=ee(a=>a.closeTab),Ie=ee(a=>a.inTabs),mt=E(a=>a.setVersion),{refetch:ze,cancel:ht}=un(),{refetch:Ae,cancel:_e}=Ot(),{refetch:Ve,cancel:Ne}=dn(),{refetch:Pe,cancel:b}=it(),{refetch:O,cancel:T}=ct(u.name,{planOptions:{skip_tests:!0,include_unmodified:!0}}),z=s.useCallback(function(m){const x=Array.from(c).find(g=>g.name===m);S(x)?R(m):A(x)},[c]),pt=s.useCallback(function(m){p.update(m),m.environment!==u.name&&z(m.environment),$e(p)},[z,u]),vt=s.useCallback(function(m){var g,L;N.update(m,p),m.environment!==u.name&&z(m.environment),re(N);const x=Le((g=m.meta)==null?void 0:g.done)&&((L=m.meta)==null?void 0:L.status)!==qe.init;j.isFinished||j.isRunning||V(x)||Pe().then(({data:k})=>{O(),bt(k)})},[j,p,z,u]),gt=s.useCallback(function(m){var x,g;j.update(m),m.environment!==u.name&&z(m.environment),K(j),!(fn((x=m.meta)==null?void 0:x.done)||((g=m.meta)==null?void 0:g.status)===qe.init)&&O()},[z,u]),wt=s.useCallback(function({changes:m,directories:x}){var g,L;m.sort(k=>k.change===Ge.Deleted?-1:1),m.forEach(({change:k,path:J,file:F})=>{var M,W;if(k===Ge.Modified){const H=I.get(J);if(S(H)||S(F))return;H.update(F)}if(k===Ge.Deleted){const H=he(J)??I.get(J);if(S(H))return;H instanceof Ue&&((M=H.parent)==null||M.removeDirectory(H)),H instanceof Nt&&((W=H.parent)==null||W.removeFile(H),Ie(H)&&Ze(H))}});for(const k in x){const J=x[k],F=he(k);S(F)||((g=J.directories)==null||g.forEach(M=>{const W=he(M.path);S(W)&&F.addDirectory(new Ue(M,F))}),(L=J.files)==null||L.forEach(M=>{const W=I.get(M.path);S(W)&&F.addFile(new Nt(M,F))}),F.directories.sort((M,W)=>M.name>W.name?1:-1),F.files.sort((M,W)=>M.name>W.name?1:-1))}ke(),se(),Ae().then(({data:k})=>We(k))},[I]),xt=s.useCallback(function(m){const x=I.get(m.path);$(x)&&(x.isFormatted=m.status===qe.success,ke())},[I]),Jt=s.useCallback(function(m){if(mn(Re))return;const x=Re.map(({id:L,content:k})=>{const J=m.find(M=>M.id===L)??Ln(L),F=He(J);return F.file.content=k??F.file.content??"",F}),g=x.find(L=>L.file.id===Oe);Be(x),$(g)&&S(ae)&&ve(g)},[ve]);s.useEffect(()=>{ze().then(({data:g})=>{mt(g==null?void 0:g.version),Le(g==null?void 0:g.has_running_task)&&je(new rt({value:ce.RunningTask}))}),Ae().then(({data:g})=>We(g));const a=f==null?void 0:f("errors",Xt),m=f==null?void 0:f("tests",Qt),x=f==null?void 0:f("models",We);return x==null||x.subscribe(),l.hasPlans&&(m==null||m.subscribe(),Pe().then(({data:g})=>bt(g))),l.hasErrors&&(a==null||a.subscribe()),l.hasFiles&&Ve().then(({data:g})=>{if(S(g))return;const L=new Ue(g),k=L.allFiles;Jt(k),De(k),Ce(L)}),()=>{ht(),_e(),x==null||x.unsubscribe(),l.hasPlans&&(b(),T()),l.hasErrors&&(a==null||a.unsubscribe()),l.hasTests&&(m==null||m.unsubscribe()),l.hasFiles&&Ne()}},[l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-apply",vt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[vt,l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-overview",pt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[pt,l]),s.useEffect(()=>{const a=f==null?void 0:f("plan-cancel",gt);return l.hasPlans&&(a==null||a.subscribe()),()=>{l.hasPlans&&(a==null||a.unsubscribe())}},[gt,l]),s.useEffect(()=>{const a=f==null?void 0:f("file",wt);return a==null||a.subscribe(),()=>{a==null||a.unsubscribe()}},[wt]),s.useEffect(()=>{const a=f==null?void 0:f("format-file",xt);return a==null||a.subscribe(),()=>{a==null||a.unsubscribe()}},[xt]),s.useEffect(()=>{(V(l.isEmpty)&&t.pathname===Y.Home||t.pathname==="")&&n(l.defaultNavigationRoute(),{replace:!0})},[t,l]),s.useEffect(()=>{w(v.length>0)},[v]);function We(a){$(a)&&(r(Et.Models),G(a))}function Xt(a){i(Et.General,a)}function Qt(a){pe(a)}function bt(a){const{environments:m,default_target_environment:x,pinned_environments:g}=a??{};$t(m)&&P(Object.values(m),x,g)}function Ye(a){var m;(m=a==null?void 0:a.cancel)==null||m.call(a),w(!1)}const h=v[0];return o.jsxs(hn.Page,{layout:"horizontal",children:[l.showModuleNavigation&&o.jsxs(o.Fragment,{children:[o.jsx(ir,{className:"overflow-hidden py-1 px-2 flex flex-col items-center"}),o.jsx(yt,{orientation:"vertical"})]}),o.jsxs("div",{className:"flex flex-col overflow-hidden w-full h-full",children:[l.showNavigation&&o.jsxs(o.Fragment,{children:[o.jsx(ia,{}),o.jsx(yt,{})]}),e??o.jsx(pn,{}),o.jsxs(D,{show:d,onClose:()=>{Ye(h)},afterLeave:()=>{Z()},onKeyDown:a=>{a.key==="Escape"&&Ye(h)},children:[o.jsxs(D.Main,{children:[$(h==null?void 0:h.headline)&&o.jsx(D.Headline,{children:h==null?void 0:h.headline}),$(h==null?void 0:h.tagline)&&o.jsx(D.Tagline,{children:h==null?void 0:h.tagline}),$(h==null?void 0:h.details)&&o.jsx(D.Details,{details:h==null?void 0:h.details}),$(h==null?void 0:h.description)&&o.jsx(D.Description,{children:h==null?void 0:h.description}),h==null?void 0:h.children]}),o.jsxs(D.Actions,{children:[o.jsx(et,{className:"font-bold",size:"md",variant:"danger",onClick:a=>{var m;a.stopPropagation(),(m=h==null?void 0:h.action)==null||m.call(h),w(!1)},children:(h==null?void 0:h.yesText)??"Confirm"}),o.jsx(et,{size:"md",variant:"alternative",onClick:a=>{a.stopPropagation(),Ye(h)},children:(h==null?void 0:h.noText)??"Cancel"})]})]})]})]})}export{_a as default};
@@ -1,4 +1,4 @@
1
- import{r as ue,R as Rt,t as ty,j as Ht,c as Xr,m as Ze,F as ey,w as ks,i as ry,W as ny,D as iy}from"./index-COnjINWU.js";import{I as Pu}from"./Input-CJirBrKe.js";import{E as co,f as oy,h as Mu}from"./help-6Q7f7fjd.js";import{B as Ss,D as ay}from"./transition-DjPYSO2n.js";function Ou({nativeEvent:r}){return window.TouchEvent?r instanceof TouchEvent:"touches"in r}function Ru(r){return r.nativeEvent instanceof MouseEvent}function sy(r){const n=ue.useRef(null),i=ue.useRef(r);return ue.useLayoutEffect(()=>{i.current=r}),ue.useEffect(()=>{const s=c=>{const u=n.current;u&&!u.contains(c.target)&&i.current(c)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),n}function nk(r,n={}){const{threshold:i=400,onStart:s,onFinish:c,onCancel:u}=n,f=ue.useRef(!1),m=ue.useRef(!1),g=ue.useRef();return ue.useMemo(()=>{if(typeof r!="function")return{};const w=x=>{!Ru(x)&&!Ou(x)||(s&&s(x),m.current=!0,g.current=setTimeout(()=>{r(x),f.current=!0},i))},S=x=>{!Ru(x)&&!Ou(x)||(f.current?c&&c(x):m.current&&u&&u(x),f.current=!1,m.current=!1,g.current&&window.clearTimeout(g.current))};return{...{onMouseDown:w,onMouseUp:S,onMouseLeave:S},...{onTouchStart:w,onTouchEnd:S}}},[r,i,u,c,s])}/**
1
+ import{r as ue,R as Rt,t as ty,j as Ht,c as Xr,m as Ze,F as ey,w as ks,i as ry,W as ny,D as iy}from"./index-C22hdM_h.js";import{I as Pu}from"./Input-CxOCLTNw.js";import{E as co,f as oy,h as Mu}from"./help-6Q7f7fjd.js";import{B as Ss,D as ay}from"./transition-CiMBgn_Y.js";function Ou({nativeEvent:r}){return window.TouchEvent?r instanceof TouchEvent:"touches"in r}function Ru(r){return r.nativeEvent instanceof MouseEvent}function sy(r){const n=ue.useRef(null),i=ue.useRef(r);return ue.useLayoutEffect(()=>{i.current=r}),ue.useEffect(()=>{const s=c=>{const u=n.current;u&&!u.contains(c.target)&&i.current(c)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),n}function nk(r,n={}){const{threshold:i=400,onStart:s,onFinish:c,onCancel:u}=n,f=ue.useRef(!1),m=ue.useRef(!1),g=ue.useRef();return ue.useMemo(()=>{if(typeof r!="function")return{};const w=x=>{!Ru(x)&&!Ou(x)||(s&&s(x),m.current=!0,g.current=setTimeout(()=>{r(x),f.current=!0},i))},S=x=>{!Ru(x)&&!Ou(x)||(f.current?c&&c(x):m.current&&u&&u(x),f.current=!1,m.current=!1,g.current&&window.clearTimeout(g.current))};return{...{onMouseDown:w,onMouseUp:S,onMouseLeave:S},...{onTouchStart:w,onTouchEnd:S}}},[r,i,u,c,s])}/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,2 +1,2 @@
1
- import{r as i,R as O,j as n,K as oe,i as ne,c as k,W as et,a as L,h as Ee,I as ue,X as tt,w as De,J as rt,m as te,B as me,n as re,d as at,Y as nt,b as je,Z as st,$ as it,G as ot}from"./index-COnjINWU.js";import{L as lt}from"./context-APidk_GA.js";import ct from"./ModelLineage-B8hv0xJ-.js";import{i as K,G as Me,U as B,o as b,I as W,y as G,C as U,r as dt,H as ut,u as xe,h as pe,n as mt,p as ve,j as pt,k as ae,T as ft,J as xt,K as vt,z as h,A as fe,x as ke,_ as gt,M as Q,L as $e,P as Oe,O as Ne,N as Pe,b as ht,F as bt,c as wt,Q as yt,R as Rt,D as Et}from"./transition-DjPYSO2n.js";import{s as jt,u as kt,c as S,f as Nt,T as Pt,p as It,e as Ct}from"./ListboxShow-C0DBUX71.js";import{A as le}from"./PlusCircleIcon-CcC2lSkc.js";import{I as Ie}from"./Input-CJirBrKe.js";import{F as Dt}from"./ChevronDownIcon-DhkdL7W7.js";function Mt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 4.5c1.215 0 2.417.055 3.604.162a.68.68 0 0 1 .615.597c.124 1.038.208 2.088.25 3.15l-1.689-1.69a.75.75 0 0 0-1.06 1.061l2.999 3a.75.75 0 0 0 1.06 0l3.001-3a.75.75 0 1 0-1.06-1.06l-1.748 1.747a41.31 41.31 0 0 0-.264-3.386 2.18 2.18 0 0 0-1.97-1.913 41.512 41.512 0 0 0-7.477 0 2.18 2.18 0 0 0-1.969 1.913 41.16 41.16 0 0 0-.16 1.61.75.75 0 1 0 1.495.12c.041-.52.093-1.038.154-1.552a.68.68 0 0 1 .615-.597A40.012 40.012 0 0 1 10 4.5ZM5.281 9.22a.75.75 0 0 0-1.06 0l-3.001 3a.75.75 0 1 0 1.06 1.06l1.748-1.747c.042 1.141.13 2.27.264 3.386a2.18 2.18 0 0 0 1.97 1.913 41.533 41.533 0 0 0 7.477 0 2.18 2.18 0 0 0 1.969-1.913c.064-.534.117-1.071.16-1.61a.75.75 0 1 0-1.495-.12c-.041.52-.093 1.037-.154 1.552a.68.68 0 0 1-.615.597 40.013 40.013 0 0 1-7.208 0 .68.68 0 0 1-.615-.597 39.785 39.785 0 0 1-.25-3.15l1.689 1.69a.75.75 0 0 0 1.06-1.061l-2.999-3Z",clipRule:"evenodd"}))}const Te=i.forwardRef(Mt);function $t({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Ot=i.forwardRef($t);function Tt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM6.75 9.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",clipRule:"evenodd"}))}const Fe=i.forwardRef(Tt);function Ft({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M4 10a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10Z",clipRule:"evenodd"}))}const St=i.forwardRef(Ft);function At({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-11.25a.75.75 0 0 0-1.5 0v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5Z",clipRule:"evenodd"}))}const _t=i.forwardRef(At);function Lt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const Bt=i.forwardRef(Lt);function Gt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10.868 2.884c-.321-.772-1.415-.772-1.736 0l-1.83 4.401-4.753.381c-.833.067-1.171 1.107-.536 1.651l3.62 3.102-1.106 4.637c-.194.813.691 1.456 1.405 1.02L10 15.591l4.069 2.485c.713.436 1.598-.207 1.404-1.02l-1.106-4.637 3.62-3.102c.635-.544.297-1.584-.536-1.65l-4.752-.382-1.831-4.401Z",clipRule:"evenodd"}))}const Ut=i.forwardRef(Gt);function Se({container:e,accept:t,walk:r,enabled:a=!0}){let c=i.useRef(t),o=i.useRef(r);i.useEffect(()=>{c.current=t,o.current=r},[t,r]),K(()=>{if(!e||!a)return;let l=Me(e);if(!l)return;let s=c.current,u=o.current,x=Object.assign(y=>s(y),{acceptNode:s}),v=l.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,x,!1);for(;v.nextNode();)u(v.currentNode)},[e,a,c,o])}let Ae=i.createContext(null);function _e(){let e=i.useContext(Ae);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,_e),t}return e}function Le(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let a=b(o=>(t(l=>[...l,o]),()=>t(l=>{let s=l.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),c=i.useMemo(()=>({register:a,slot:r.slot,name:r.name,props:r.props}),[a,r.slot,r.name,r.props]);return O.createElement(Ae.Provider,{value:c},r.children)},[t])]}let zt="p";function Vt(e,t){let r=W(),{id:a=`headlessui-description-${r}`,...c}=e,o=_e(),l=G(t);K(()=>o.register(a),[a,o.register]);let s={ref:l,...o.props,id:a};return U({ourProps:s,theirProps:c,slot:o.slot||{},defaultTag:zt,name:o.name||"Description"})}let Zt=B(Vt),Kt=Object.assign(Zt,{});var Wt=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Wt||{}),Qt=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Qt||{}),Ht=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Ht||{});function ce(e,t=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,a=Oe(t(e.items.slice()),o=>o.dataRef.current.domRef.current),c=r?a.indexOf(r):null;return c===-1&&(c=null),{items:a,activeItemIndex:c}}let qt={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var r;let a=ce(e),c=Nt(t,{resolveItems:()=>a.items,resolveActiveIndex:()=>a.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...a,searchQuery:"",activeItemIndex:c,activationTrigger:(r=t.trigger)!=null?r:1}},3:(e,t)=>{let r=e.searchQuery!==""?0:1,a=e.searchQuery+t.value.toLowerCase(),c=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+r).concat(e.items.slice(0,e.activeItemIndex+r)):e.items).find(l=>{var s;return((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(a))&&!l.dataRef.current.disabled}),o=c?e.items.indexOf(c):-1;return o===-1||o===e.activeItemIndex?{...e,searchQuery:a}:{...e,searchQuery:a,activeItemIndex:o,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let r=ce(e,a=>[...a,{id:t.id,dataRef:t.dataRef}]);return{...e,...r}},6:(e,t)=>{let r=ce(e,a=>{let c=a.findIndex(o=>o.id===t.id);return c!==-1&&a.splice(c,1),a});return{...e,...r,activationTrigger:1}}},ge=i.createContext(null);ge.displayName="MenuContext";function se(e){let t=i.useContext(ge);if(t===null){let r=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,se),r}return t}function Jt(e,t){return xe(t.type,qt,e,t)}let Yt=i.Fragment;function Xt(e,t){let{__demoMode:r=!1,...a}=e,c=i.useReducer(Jt,{__demoMode:r,menuState:r?0:1,buttonRef:i.createRef(),itemsRef:i.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:l,buttonRef:s},u]=c,x=G(t);dt([s,l],(R,p)=>{var d;u({type:1}),xt(p,vt.Loose)||(R.preventDefault(),(d=s.current)==null||d.focus())},o===0);let v=b(()=>{u({type:1})}),y=i.useMemo(()=>({open:o===0,close:v}),[o,v]),g={ref:x};return O.createElement(ge.Provider,{value:c},O.createElement(ut,{value:xe(o,{0:ae.Open,1:ae.Closed})},U({ourProps:g,theirProps:a,slot:y,defaultTag:Yt,name:"Menu"})))}let er="button";function tr(e,t){var r;let a=W(),{id:c=`headlessui-menu-button-${a}`,...o}=e,[l,s]=se("Menu.Button"),u=G(l.buttonRef,t),x=ve(),v=b(d=>{switch(d.key){case h.Space:case h.Enter:case h.ArrowDown:d.preventDefault(),d.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:S.First}));break;case h.ArrowUp:d.preventDefault(),d.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:S.Last}));break}}),y=b(d=>{switch(d.key){case h.Space:d.preventDefault();break}}),g=b(d=>{if(fe(d.currentTarget))return d.preventDefault();e.disabled||(l.menuState===0?(s({type:1}),x.nextFrame(()=>{var E;return(E=l.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})})):(d.preventDefault(),s({type:0})))}),R=i.useMemo(()=>({open:l.menuState===0}),[l]),p={ref:u,id:c,type:ft(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":(r=l.itemsRef.current)==null?void 0:r.id,"aria-expanded":l.menuState===0,onKeyDown:v,onKeyUp:y,onClick:g};return U({ourProps:p,theirProps:o,slot:R,defaultTag:er,name:"Menu.Button"})}let rr="div",ar=ke.RenderStrategy|ke.Static;function nr(e,t){var r,a;let c=W(),{id:o=`headlessui-menu-items-${c}`,...l}=e,[s,u]=se("Menu.Items"),x=G(s.itemsRef,t),v=mt(s.itemsRef),y=ve(),g=pt(),R=g!==null?(g&ae.Open)===ae.Open:s.menuState===0;i.useEffect(()=>{let m=s.itemsRef.current;m&&s.menuState===0&&m!==(v==null?void 0:v.activeElement)&&m.focus({preventScroll:!0})},[s.menuState,s.itemsRef,v]),Se({container:s.itemsRef.current,enabled:s.menuState===0,accept(m){return m.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});let p=b(m=>{var $,T;switch(y.dispose(),m.key){case h.Space:if(s.searchQuery!=="")return m.preventDefault(),m.stopPropagation(),u({type:3,value:m.key});case h.Enter:if(m.preventDefault(),m.stopPropagation(),u({type:1}),s.activeItemIndex!==null){let{dataRef:w}=s.items[s.activeItemIndex];(T=($=w.current)==null?void 0:$.domRef.current)==null||T.click()}$e(s.buttonRef.current);break;case h.ArrowDown:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Next});case h.ArrowUp:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Previous});case h.Home:case h.PageUp:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.First});case h.End:case h.PageDown:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Last});case h.Escape:m.preventDefault(),m.stopPropagation(),u({type:1}),pe().nextFrame(()=>{var w;return(w=s.buttonRef.current)==null?void 0:w.focus({preventScroll:!0})});break;case h.Tab:m.preventDefault(),m.stopPropagation(),u({type:1}),pe().nextFrame(()=>{gt(s.buttonRef.current,m.shiftKey?Q.Previous:Q.Next)});break;default:m.key.length===1&&(u({type:3,value:m.key}),y.setTimeout(()=>u({type:4}),350));break}}),d=b(m=>{switch(m.key){case h.Space:m.preventDefault();break}}),E=i.useMemo(()=>({open:s.menuState===0}),[s]),N={"aria-activedescendant":s.activeItemIndex===null||(r=s.items[s.activeItemIndex])==null?void 0:r.id,"aria-labelledby":(a=s.buttonRef.current)==null?void 0:a.id,id:o,onKeyDown:p,onKeyUp:d,role:"menu",tabIndex:0,ref:x};return U({ourProps:N,theirProps:l,slot:E,defaultTag:rr,features:ar,visible:R,name:"Menu.Items"})}let sr=i.Fragment;function ir(e,t){let r=W(),{id:a=`headlessui-menu-item-${r}`,disabled:c=!1,...o}=e,[l,s]=se("Menu.Item"),u=l.activeItemIndex!==null?l.items[l.activeItemIndex].id===a:!1,x=i.useRef(null),v=G(t,x);K(()=>{if(l.__demoMode||l.menuState!==0||!u||l.activationTrigger===0)return;let w=pe();return w.requestAnimationFrame(()=>{var P,z;(z=(P=x.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})}),w.dispose},[l.__demoMode,x,u,l.menuState,l.activationTrigger,l.activeItemIndex]);let y=jt(x),g=i.useRef({disabled:c,domRef:x,get textValue(){return y()}});K(()=>{g.current.disabled=c},[g,c]),K(()=>(s({type:5,id:a,dataRef:g}),()=>s({type:6,id:a})),[g,a]);let R=b(()=>{s({type:1})}),p=b(w=>{if(c)return w.preventDefault();s({type:1}),$e(l.buttonRef.current)}),d=b(()=>{if(c)return s({type:2,focus:S.Nothing});s({type:2,focus:S.Specific,id:a})}),E=kt(),N=b(w=>E.update(w)),m=b(w=>{E.wasMoved(w)&&(c||u||s({type:2,focus:S.Specific,id:a,trigger:0}))}),$=b(w=>{E.wasMoved(w)&&(c||u&&s({type:2,focus:S.Nothing}))}),T=i.useMemo(()=>({active:u,disabled:c,close:R}),[u,c,R]);return U({ourProps:{id:a,ref:v,role:"menuitem",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,disabled:void 0,onClick:p,onFocus:d,onPointerEnter:N,onMouseEnter:N,onPointerMove:m,onMouseMove:m,onPointerLeave:$,onMouseLeave:$},theirProps:o,slot:T,defaultTag:sr,name:"Menu.Item"})}let or=B(Xt),lr=B(tr),cr=B(nr),dr=B(ir),X=Object.assign(or,{Button:lr,Items:cr,Item:dr}),Be=i.createContext(null);function Ge(){let e=i.useContext(Be);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ge),t}return e}function Ue(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let a=b(o=>(t(l=>[...l,o]),()=>t(l=>{let s=l.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),c=i.useMemo(()=>({register:a,slot:r.slot,name:r.name,props:r.props}),[a,r.slot,r.name,r.props]);return O.createElement(Be.Provider,{value:c},r.children)},[t])]}let ur="label";function mr(e,t){let r=W(),{id:a=`headlessui-label-${r}`,passive:c=!1,...o}=e,l=Ge(),s=G(t);K(()=>l.register(a),[a,l.register]);let u={ref:s,...l.props,id:a};return c&&("onClick"in u&&(delete u.htmlFor,delete u.onClick),"onClick"in o&&delete o.onClick),U({ourProps:u,theirProps:o,slot:l.slot||{},defaultTag:ur,name:l.name||"Label"})}let pr=B(mr),fr=Object.assign(pr,{});var xr=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(xr||{});let vr={0(e,t){let r=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Oe(r,a=>a.element.current)}},1(e,t){let r=e.options.slice(),a=e.options.findIndex(c=>c.id===t.id);return a===-1?e:(r.splice(a,1),{...e,options:r})}},he=i.createContext(null);he.displayName="RadioGroupDataContext";function ze(e){let t=i.useContext(he);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ze),r}return t}let be=i.createContext(null);be.displayName="RadioGroupActionsContext";function Ve(e){let t=i.useContext(be);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ve),r}return t}function gr(e,t){return xe(t.type,vr,e,t)}let hr="div";function br(e,t){let r=W(),{id:a=`headlessui-radiogroup-${r}`,value:c,defaultValue:o,form:l,name:s,onChange:u,by:x=(f,M)=>f===M,disabled:v=!1,...y}=e,g=b(typeof x=="string"?(f,M)=>{let C=x;return(f==null?void 0:f[C])===(M==null?void 0:M[C])}:x),[R,p]=i.useReducer(gr,{options:[]}),d=R.options,[E,N]=Ue(),[m,$]=Le(),T=i.useRef(null),w=G(T,t),[P,z]=Pt(c,u,o),F=i.useMemo(()=>d.find(f=>!f.propsRef.current.disabled),[d]),V=i.useMemo(()=>d.some(f=>g(f.propsRef.current.value,P)),[d,P]),A=b(f=>{var M;if(v||g(f,P))return!1;let C=(M=d.find(Z=>g(Z.propsRef.current.value,f)))==null?void 0:M.propsRef.current;return C!=null&&C.disabled?!1:(z==null||z(f),!0)});Se({container:T.current,accept(f){return f.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let ie=b(f=>{let M=T.current;if(!M)return;let C=Me(M),Z=d.filter(I=>I.propsRef.current.disabled===!1).map(I=>I.element.current);switch(f.key){case h.Enter:It(f.currentTarget);break;case h.ArrowLeft:case h.ArrowUp:if(f.preventDefault(),f.stopPropagation(),Ne(Z,Q.Previous|Q.WrapAround)===Pe.Success){let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break;case h.ArrowRight:case h.ArrowDown:if(f.preventDefault(),f.stopPropagation(),Ne(Z,Q.Next|Q.WrapAround)===Pe.Success){let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break;case h.Space:{f.preventDefault(),f.stopPropagation();let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break}}),_=b(f=>(p({type:0,...f}),()=>p({type:1,id:f.id}))),J=i.useMemo(()=>({value:P,firstOption:F,containsCheckedOption:V,disabled:v,compare:g,...R}),[P,F,V,v,g,R]),qe=i.useMemo(()=>({registerOption:_,change:A}),[_,A]),Je={ref:w,id:a,role:"radiogroup","aria-labelledby":E,"aria-describedby":m,onKeyDown:ie},Ye=i.useMemo(()=>({value:P}),[P]),Y=i.useRef(null),Xe=ve();return i.useEffect(()=>{Y.current&&o!==void 0&&Xe.addEventListener(Y.current,"reset",()=>{A(o)})},[Y,A]),O.createElement($,{name:"RadioGroup.Description"},O.createElement(N,{name:"RadioGroup.Label"},O.createElement(be.Provider,{value:qe},O.createElement(he.Provider,{value:J},s!=null&&P!=null&&Ct({[s]:P}).map(([f,M],C)=>O.createElement(ht,{features:wt.Hidden,ref:C===0?Z=>{var I;Y.current=(I=Z==null?void 0:Z.closest("form"))!=null?I:null}:void 0,...bt({key:f,as:"input",type:"radio",checked:M!=null,hidden:!0,readOnly:!0,form:l,disabled:v,name:f,value:M})})),U({ourProps:Je,theirProps:y,slot:Ye,defaultTag:hr,name:"RadioGroup"})))))}var wr=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(wr||{});let yr="div";function Rr(e,t){var r;let a=W(),{id:c=`headlessui-radiogroup-option-${a}`,value:o,disabled:l=!1,...s}=e,u=i.useRef(null),x=G(u,t),[v,y]=Ue(),[g,R]=Le(),{addFlag:p,removeFlag:d,hasFlag:E}=yt(1),N=Rt({value:o,disabled:l}),m=ze("RadioGroup.Option"),$=Ve("RadioGroup.Option");K(()=>$.registerOption({id:c,element:u,propsRef:N}),[c,$,u,N]);let T=b(_=>{var J;if(fe(_.currentTarget))return _.preventDefault();$.change(o)&&(p(2),(J=u.current)==null||J.focus())}),w=b(_=>{if(fe(_.currentTarget))return _.preventDefault();p(2)}),P=b(()=>d(2)),z=((r=m.firstOption)==null?void 0:r.id)===c,F=m.disabled||l,V=m.compare(m.value,o),A={ref:x,id:c,role:"radio","aria-checked":V?"true":"false","aria-labelledby":v,"aria-describedby":g,"aria-disabled":F?!0:void 0,tabIndex:F?-1:V||!m.containsCheckedOption&&z?0:-1,onClick:F?void 0:T,onFocus:F?void 0:w,onBlur:F?void 0:P},ie=i.useMemo(()=>({checked:V,disabled:F,active:E(2)}),[V,F,E]);return O.createElement(R,{name:"RadioGroup.Description"},O.createElement(y,{name:"RadioGroup.Label"},U({ourProps:A,theirProps:s,slot:ie,defaultTag:yr,name:"RadioGroup.Option"})))}let Er=B(br),jr=B(Rr),ee=Object.assign(Er,{Option:jr,Label:fr,Description:Kt});const D={ResetPlanOptions:"reset-plan-options",ResetPlanDates:"reset-plan-dates",ResetCategories:"reset-categories",PlanOptions:"plan-options",Dates:"dates",DateStart:"date-start",DateEnd:"date-end",Category:"category",External:"external",ResetTestsReport:"reset-tests-report",TestsReportErrors:"tests-report-errors",TestsReportMessages:"tests-report-messages"},j={Add:"add",Remove:"remove",Direct:"direct",Indirect:"indirect",Metadata:"metadata",Default:"default"},de={Breaking:"breaking",NonBreaking:"non-breaking",ForwardOnly:"forward-only"},[kr,Nr]=Dr(),Ze={skip_tests:!1,no_gaps:!1,skip_backfill:!1,forward_only:!1,auto_apply:!1,no_auto_categorization:!1,include_unmodified:!0,restate_models:void 0,create_from:"prod"},Ke={start:void 0,end:void 0},we={...Ke,...Ze,categories:Nr,defaultCategory:kr,change_categorization:new Map,virtualUpdateDescription:"All changes and their downstream dependencies can be fully previewed before they get promoted. If during plan creation no data gaps have been detected and only references to new model versions need to be updated, then such an update is referred to as a Virtual Update. Virtual Updates impose no additional runtime overhead or cost.",isInitialPlanRun:!1,errors:[],testsReportErrors:void 0,testsReportMessages:void 0},We=i.createContext(we),Qe=i.createContext(()=>{});function Vr({children:e}){const[t,r]=i.useReducer(Ir,Object.assign(we));return n.jsx(We.Provider,{value:Object.assign(t),children:n.jsx(Qe.Provider,{value:r,children:e})})}function ye(){return i.useContext(We)}function Pr(){return i.useContext(Qe)}function Ir(e,t){return t=Array.isArray(t)?t:[t],t.reduce(Cr,e)}function Cr(e=we,{type:t,...r}){switch(t){case D.ResetCategories:return Object.assign({},e,{change_categorization:new Map});case D.ResetPlanDates:return Object.assign({},e,Ke);case D.ResetPlanOptions:return Object.assign({},e,Ze);case D.ResetTestsReport:return Object.assign({},e,{testsReportErrors:void 0,testsReportMessages:void 0});case D.PlanOptions:return Object.assign({},e,r);case D.Dates:return Object.assign({},e,{start:r.start,end:r.end});case D.External:return Object.assign({},e,{isInitialPlanRun:r.isInitialPlanRun??!1});case D.DateStart:return Object.assign({},e,{start:r.start});case D.DateEnd:return Object.assign({},e,{end:r.end});case D.TestsReportErrors:return Object.assign({},e,{testsReportErrors:r.testsReportErrors});case D.TestsReportMessages:return Object.assign({},e,{testsReportMessages:r.testsReportMessages});case D.Category:{const{change:a,category:c}=r;return ne(a==null?void 0:a.name)&&e.change_categorization.set(a.name,{category:c,change:a}),Object.assign({},e,{change_categorization:new Map(e.change_categorization)})}default:return Object.assign({},e)}}function Dr(){const e={id:de.Breaking,name:"Breaking Change",description:"It will rebuild all models",value:oe.NUMBER_1},t=[e,{id:de.NonBreaking,name:"Non-Breaking Change",description:"It will exclude all indirect models caused by this change",value:oe.NUMBER_2},{id:de.ForwardOnly,name:"Forward-Only Change",description:"The change requires no rebuilding",value:oe.NUMBER_3}];return[e,t]}function q({children:e,headline:t,type:r,className:a}){return n.jsxs("div",{className:k("flex flex-col rounded-md p-4 text-xs",r===j.Add&&"bg-success-5",r===j.Remove&&"bg-danger-5",r===j.Direct&&"bg-secondary-5",r===j.Indirect&&"bg-warning-5",r===j.Default&&"bg-neutral-5",a),children:[ne(t)&&n.jsx("h4",{className:k("mb-2 font-bold whitespace-nowrap",r===j.Add&&"text-success-600 dark:text-success-300",r===j.Remove&&"text-danger-600 dark:text-danger-300",r===j.Direct&&"text-secondary-600 dark:text-secondary-300",r===j.Indirect&&"text-warning-600 dark:text-warning-300",r===j.Default&&"text-neutral-600 dark:text-neutral-300"),children:t}),e]})}function Mr({changes:e=[],type:t}){return n.jsx("ul",{children:e.map(r=>n.jsxs("li",{className:k("flex items-center",t===j.Add&&"text-success-600 dark:text-success-300",t===j.Remove&&"text-danger-600 dark:text-danger-300",t===j.Direct&&"text-secondary-600 dark:text-secondary-300",t===j.Indirect&&"text-warning-600 dark:text-warning-300",t===j.Default&&"text-neutral-600 dark:text-neutral-300"),children:[t===j.Add?n.jsx(Bt,{className:"h-3 mr-2"}):t===j.Remove?n.jsx(St,{className:"h-3 mr-2"}):n.jsx(Te,{className:"h-4 mr-2"}),n.jsx("span",{title:r.displayViewName,className:"w-full whitespace-nowrap text-ellipsis overflow-hidden",children:et(r.displayViewName,50,25)})]},r.name))})}function $r({changes:e=[],disabled:t=!1}){const r=Pr(),{categories:a}=ye(),c=L(o=>o.models);return i.useEffect(()=>{r(e.map(o=>({type:D.Category,category:a.find(({value:l})=>l===o.change_category),change:o})))},[e]),n.jsx("ul",{children:e.map(o=>n.jsx("li",{className:"text-secondary-500 dark:text-primary-500 mt-1",children:n.jsx(le,{children:({open:l})=>n.jsxs(n.Fragment,{children:[n.jsxs(le.Button,{className:"flex items-center w-full justify-between rounded-lg text-left",children:[n.jsx(Re,{className:"w-full",change:o}),(()=>{const s=l?Fe:_t;return n.jsx(s,{className:"max-h-[1rem] min-w-[1rem] dark:text-primary-500"})})()]}),n.jsxs(le.Panel,{className:"px-4 mb-4 overflow-hidden",children:[Ee(o.direct)&&n.jsx(Ce,{type:"direct",models:o.direct,className:"mt-2 ml-4"}),Ee(o.indirect)&&n.jsx(Ce,{type:"indirect",models:o.indirect,className:"ml-4"}),n.jsx(ue,{className:"border-secondary-20 mt-2"}),n.jsx(Or,{change:o,disabled:t,onChange:s=>{r({type:D.Category,category:a.find(({value:u})=>u===s),change:o})}}),n.jsx(ue,{className:"border-secondary-20 mt-2"}),n.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:[ne(o)&&tt(o.diff)&&n.jsx(He,{diff:o.diff}),(()=>{var u,x;const s=c.get(o.name);return De(s)?n.jsx(n.Fragment,{}):n.jsx("div",{className:"h-[16rem] bg-theme-lighter rounded-2xl overflow-hidden my-4",children:n.jsx(lt,{showColumns:!1,showConnected:!1,showControls:!1,children:n.jsx(ct,{model:s,highlightedNodes:{"border-4 border-warning-500 bg-warning-500 text-warning-500":((u=o.indirect)==null?void 0:u.map(v=>v.name))??[],"border-4 border-secondary-500 dark:border-primary-500 bg-secondary-500 dark:bg-primary-500 text-bg-secondary-500 dark:bg-primary-500 ring-8 ring-brand-50":[o.name],"border-4 border-secondary-500 dark:border-primary-500 bg-secondary-500 dark:bg-primary-500 text-bg-secondary-500 dark:bg-primary-500":((x=o.direct)==null?void 0:x.map(v=>v.name))??[],"*":["border-4 border-neutral-500 bg-neutral-500 text-neutral-600 dark:text-light"]}})})})})()]})]})]})})},o.name))})}function Or({change:e,disabled:t=!1,onChange:r}){var o,l;const{change_categorization:a,categories:c}=ye();return n.jsx(ee,{className:k("flex flex-col mt-2",t&&"pointer-events-none opacity-50 cursor-not-allowed"),disabled:t,defaultValue:((l=(o=a.get(e.name))==null?void 0:o.category)==null?void 0:l.value)??e.change_category,onChange:r,children:c.map(s=>n.jsx(ee.Option,{value:s.value,className:()=>k("relative flex rounded-md"),children:({checked:u})=>n.jsxs("div",{className:k("text-sm flex items-center px-2 py-1 w-full rounded-lg",u?"text-secondary-500 dark:text-primary-300":"text-prose"),children:[n.jsx("div",{className:"mt-[0.125rem] mr-2 border-2 border-neutral-400 min-w-[1rem] h-4 rounded-full flex justify-center items-center",children:u&&n.jsx("span",{className:"inline-block w-2 h-2 bg-secondary-500 dark:bg-primary-300 rounded-full"})}),n.jsxs("div",{children:[n.jsx(ee.Label,{as:"p",children:s.name}),n.jsx(ee.Description,{as:"span",className:"text-xs text-neutral-500",children:s.description})]})]})},s.name))})}function Tr({changes:e=[]}){return n.jsx("ul",{children:e.map(t=>n.jsx("li",{className:"text-warning-700 dark:text-warning-500",children:n.jsx(Re,{change:t})},t.name))})}function Re({change:e,className:t}){var c;const{change_categorization:r}=ye(),a=(c=r.get(e.name))==null?void 0:c.category;return n.jsxs("div",{className:k("flex items-center font-bold",t),children:[n.jsxs("span",{className:"flex w-full whitespace-nowrap text-ellipsis overflow-hidden",children:[n.jsx(Te,{className:"h-4 mr-2"}),e.displayViewName]}),De(a)?ne(e.indirect)&&n.jsx("span",{className:"ml-2 px-1 bg-warning-500 text-warning-100 dark:bg-warning-400 dark:text-warning-800 rounded whitespace-nowrap mr-2",children:"Categorize Manually"}):n.jsx("span",{className:"ml-2 px-1 bg-neutral-400 text-neutral-100 dark:bg-neutral-400 dark:text-neutral-800 rounded whitespace-nowrap mr-2",children:a.name})]})}function Ce({type:e,models:t,className:r}){return n.jsx("ul",{className:k(e==="indirect"&&"text-warning-700 dark:text-warning-500",e==="direct"&&"text-secondary-500 dark:text-primary-500",r),children:t.map(a=>n.jsxs("li",{className:"flex",children:[n.jsx("span",{className:"h-3 w-3 border-l-2 border-b-2 inline-block mr-2"}),a.displayViewName]},a.name))})}function He({diff:e}){return n.jsx("div",{className:"my-4 bg-dark-lighter rounded-2xl overflow-hidden",children:n.jsx("pre",{className:"p-4 text-primary-100 max-h-[30vh] text-xs overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.split(`
1
+ import{r as i,R as O,j as n,K as oe,i as ne,c as k,W as et,a as L,h as Ee,I as ue,X as tt,w as De,J as rt,m as te,B as me,n as re,d as at,Y as nt,b as je,Z as st,$ as it,G as ot}from"./index-C22hdM_h.js";import{L as lt}from"./context-B0V9EzWJ.js";import ct from"./ModelLineage-BFuK5Bgk.js";import{i as K,G as Me,U as B,o as b,I as W,y as G,C as U,r as dt,H as ut,u as xe,h as pe,n as mt,p as ve,j as pt,k as ae,T as ft,J as xt,K as vt,z as h,A as fe,x as ke,_ as gt,M as Q,L as $e,P as Oe,O as Ne,N as Pe,b as ht,F as bt,c as wt,Q as yt,R as Rt,D as Et}from"./transition-CiMBgn_Y.js";import{s as jt,u as kt,c as S,f as Nt,T as Pt,p as It,e as Ct}from"./ListboxShow-YBO3HIHQ.js";import{A as le}from"./PlusCircleIcon-CXYicjof.js";import{I as Ie}from"./Input-CxOCLTNw.js";import{F as Dt}from"./ChevronDownIcon-D8CFPQ96.js";function Mt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 4.5c1.215 0 2.417.055 3.604.162a.68.68 0 0 1 .615.597c.124 1.038.208 2.088.25 3.15l-1.689-1.69a.75.75 0 0 0-1.06 1.061l2.999 3a.75.75 0 0 0 1.06 0l3.001-3a.75.75 0 1 0-1.06-1.06l-1.748 1.747a41.31 41.31 0 0 0-.264-3.386 2.18 2.18 0 0 0-1.97-1.913 41.512 41.512 0 0 0-7.477 0 2.18 2.18 0 0 0-1.969 1.913 41.16 41.16 0 0 0-.16 1.61.75.75 0 1 0 1.495.12c.041-.52.093-1.038.154-1.552a.68.68 0 0 1 .615-.597A40.012 40.012 0 0 1 10 4.5ZM5.281 9.22a.75.75 0 0 0-1.06 0l-3.001 3a.75.75 0 1 0 1.06 1.06l1.748-1.747c.042 1.141.13 2.27.264 3.386a2.18 2.18 0 0 0 1.97 1.913 41.533 41.533 0 0 0 7.477 0 2.18 2.18 0 0 0 1.969-1.913c.064-.534.117-1.071.16-1.61a.75.75 0 1 0-1.495-.12c-.041.52-.093 1.037-.154 1.552a.68.68 0 0 1-.615.597 40.013 40.013 0 0 1-7.208 0 .68.68 0 0 1-.615-.597 39.785 39.785 0 0 1-.25-3.15l1.689 1.69a.75.75 0 0 0 1.06-1.061l-2.999-3Z",clipRule:"evenodd"}))}const Te=i.forwardRef(Mt);function $t({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Ot=i.forwardRef($t);function Tt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM6.75 9.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",clipRule:"evenodd"}))}const Fe=i.forwardRef(Tt);function Ft({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M4 10a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10Z",clipRule:"evenodd"}))}const St=i.forwardRef(Ft);function At({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-11.25a.75.75 0 0 0-1.5 0v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5Z",clipRule:"evenodd"}))}const _t=i.forwardRef(At);function Lt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const Bt=i.forwardRef(Lt);function Gt({title:e,titleId:t,...r},a){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10.868 2.884c-.321-.772-1.415-.772-1.736 0l-1.83 4.401-4.753.381c-.833.067-1.171 1.107-.536 1.651l3.62 3.102-1.106 4.637c-.194.813.691 1.456 1.405 1.02L10 15.591l4.069 2.485c.713.436 1.598-.207 1.404-1.02l-1.106-4.637 3.62-3.102c.635-.544.297-1.584-.536-1.65l-4.752-.382-1.831-4.401Z",clipRule:"evenodd"}))}const Ut=i.forwardRef(Gt);function Se({container:e,accept:t,walk:r,enabled:a=!0}){let c=i.useRef(t),o=i.useRef(r);i.useEffect(()=>{c.current=t,o.current=r},[t,r]),K(()=>{if(!e||!a)return;let l=Me(e);if(!l)return;let s=c.current,u=o.current,x=Object.assign(y=>s(y),{acceptNode:s}),v=l.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,x,!1);for(;v.nextNode();)u(v.currentNode)},[e,a,c,o])}let Ae=i.createContext(null);function _e(){let e=i.useContext(Ae);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,_e),t}return e}function Le(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let a=b(o=>(t(l=>[...l,o]),()=>t(l=>{let s=l.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),c=i.useMemo(()=>({register:a,slot:r.slot,name:r.name,props:r.props}),[a,r.slot,r.name,r.props]);return O.createElement(Ae.Provider,{value:c},r.children)},[t])]}let zt="p";function Vt(e,t){let r=W(),{id:a=`headlessui-description-${r}`,...c}=e,o=_e(),l=G(t);K(()=>o.register(a),[a,o.register]);let s={ref:l,...o.props,id:a};return U({ourProps:s,theirProps:c,slot:o.slot||{},defaultTag:zt,name:o.name||"Description"})}let Zt=B(Vt),Kt=Object.assign(Zt,{});var Wt=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Wt||{}),Qt=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Qt||{}),Ht=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Ht||{});function ce(e,t=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,a=Oe(t(e.items.slice()),o=>o.dataRef.current.domRef.current),c=r?a.indexOf(r):null;return c===-1&&(c=null),{items:a,activeItemIndex:c}}let qt={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var r;let a=ce(e),c=Nt(t,{resolveItems:()=>a.items,resolveActiveIndex:()=>a.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...a,searchQuery:"",activeItemIndex:c,activationTrigger:(r=t.trigger)!=null?r:1}},3:(e,t)=>{let r=e.searchQuery!==""?0:1,a=e.searchQuery+t.value.toLowerCase(),c=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+r).concat(e.items.slice(0,e.activeItemIndex+r)):e.items).find(l=>{var s;return((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(a))&&!l.dataRef.current.disabled}),o=c?e.items.indexOf(c):-1;return o===-1||o===e.activeItemIndex?{...e,searchQuery:a}:{...e,searchQuery:a,activeItemIndex:o,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let r=ce(e,a=>[...a,{id:t.id,dataRef:t.dataRef}]);return{...e,...r}},6:(e,t)=>{let r=ce(e,a=>{let c=a.findIndex(o=>o.id===t.id);return c!==-1&&a.splice(c,1),a});return{...e,...r,activationTrigger:1}}},ge=i.createContext(null);ge.displayName="MenuContext";function se(e){let t=i.useContext(ge);if(t===null){let r=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,se),r}return t}function Jt(e,t){return xe(t.type,qt,e,t)}let Yt=i.Fragment;function Xt(e,t){let{__demoMode:r=!1,...a}=e,c=i.useReducer(Jt,{__demoMode:r,menuState:r?0:1,buttonRef:i.createRef(),itemsRef:i.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:l,buttonRef:s},u]=c,x=G(t);dt([s,l],(R,p)=>{var d;u({type:1}),xt(p,vt.Loose)||(R.preventDefault(),(d=s.current)==null||d.focus())},o===0);let v=b(()=>{u({type:1})}),y=i.useMemo(()=>({open:o===0,close:v}),[o,v]),g={ref:x};return O.createElement(ge.Provider,{value:c},O.createElement(ut,{value:xe(o,{0:ae.Open,1:ae.Closed})},U({ourProps:g,theirProps:a,slot:y,defaultTag:Yt,name:"Menu"})))}let er="button";function tr(e,t){var r;let a=W(),{id:c=`headlessui-menu-button-${a}`,...o}=e,[l,s]=se("Menu.Button"),u=G(l.buttonRef,t),x=ve(),v=b(d=>{switch(d.key){case h.Space:case h.Enter:case h.ArrowDown:d.preventDefault(),d.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:S.First}));break;case h.ArrowUp:d.preventDefault(),d.stopPropagation(),s({type:0}),x.nextFrame(()=>s({type:2,focus:S.Last}));break}}),y=b(d=>{switch(d.key){case h.Space:d.preventDefault();break}}),g=b(d=>{if(fe(d.currentTarget))return d.preventDefault();e.disabled||(l.menuState===0?(s({type:1}),x.nextFrame(()=>{var E;return(E=l.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})})):(d.preventDefault(),s({type:0})))}),R=i.useMemo(()=>({open:l.menuState===0}),[l]),p={ref:u,id:c,type:ft(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":(r=l.itemsRef.current)==null?void 0:r.id,"aria-expanded":l.menuState===0,onKeyDown:v,onKeyUp:y,onClick:g};return U({ourProps:p,theirProps:o,slot:R,defaultTag:er,name:"Menu.Button"})}let rr="div",ar=ke.RenderStrategy|ke.Static;function nr(e,t){var r,a;let c=W(),{id:o=`headlessui-menu-items-${c}`,...l}=e,[s,u]=se("Menu.Items"),x=G(s.itemsRef,t),v=mt(s.itemsRef),y=ve(),g=pt(),R=g!==null?(g&ae.Open)===ae.Open:s.menuState===0;i.useEffect(()=>{let m=s.itemsRef.current;m&&s.menuState===0&&m!==(v==null?void 0:v.activeElement)&&m.focus({preventScroll:!0})},[s.menuState,s.itemsRef,v]),Se({container:s.itemsRef.current,enabled:s.menuState===0,accept(m){return m.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});let p=b(m=>{var $,T;switch(y.dispose(),m.key){case h.Space:if(s.searchQuery!=="")return m.preventDefault(),m.stopPropagation(),u({type:3,value:m.key});case h.Enter:if(m.preventDefault(),m.stopPropagation(),u({type:1}),s.activeItemIndex!==null){let{dataRef:w}=s.items[s.activeItemIndex];(T=($=w.current)==null?void 0:$.domRef.current)==null||T.click()}$e(s.buttonRef.current);break;case h.ArrowDown:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Next});case h.ArrowUp:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Previous});case h.Home:case h.PageUp:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.First});case h.End:case h.PageDown:return m.preventDefault(),m.stopPropagation(),u({type:2,focus:S.Last});case h.Escape:m.preventDefault(),m.stopPropagation(),u({type:1}),pe().nextFrame(()=>{var w;return(w=s.buttonRef.current)==null?void 0:w.focus({preventScroll:!0})});break;case h.Tab:m.preventDefault(),m.stopPropagation(),u({type:1}),pe().nextFrame(()=>{gt(s.buttonRef.current,m.shiftKey?Q.Previous:Q.Next)});break;default:m.key.length===1&&(u({type:3,value:m.key}),y.setTimeout(()=>u({type:4}),350));break}}),d=b(m=>{switch(m.key){case h.Space:m.preventDefault();break}}),E=i.useMemo(()=>({open:s.menuState===0}),[s]),N={"aria-activedescendant":s.activeItemIndex===null||(r=s.items[s.activeItemIndex])==null?void 0:r.id,"aria-labelledby":(a=s.buttonRef.current)==null?void 0:a.id,id:o,onKeyDown:p,onKeyUp:d,role:"menu",tabIndex:0,ref:x};return U({ourProps:N,theirProps:l,slot:E,defaultTag:rr,features:ar,visible:R,name:"Menu.Items"})}let sr=i.Fragment;function ir(e,t){let r=W(),{id:a=`headlessui-menu-item-${r}`,disabled:c=!1,...o}=e,[l,s]=se("Menu.Item"),u=l.activeItemIndex!==null?l.items[l.activeItemIndex].id===a:!1,x=i.useRef(null),v=G(t,x);K(()=>{if(l.__demoMode||l.menuState!==0||!u||l.activationTrigger===0)return;let w=pe();return w.requestAnimationFrame(()=>{var P,z;(z=(P=x.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})}),w.dispose},[l.__demoMode,x,u,l.menuState,l.activationTrigger,l.activeItemIndex]);let y=jt(x),g=i.useRef({disabled:c,domRef:x,get textValue(){return y()}});K(()=>{g.current.disabled=c},[g,c]),K(()=>(s({type:5,id:a,dataRef:g}),()=>s({type:6,id:a})),[g,a]);let R=b(()=>{s({type:1})}),p=b(w=>{if(c)return w.preventDefault();s({type:1}),$e(l.buttonRef.current)}),d=b(()=>{if(c)return s({type:2,focus:S.Nothing});s({type:2,focus:S.Specific,id:a})}),E=kt(),N=b(w=>E.update(w)),m=b(w=>{E.wasMoved(w)&&(c||u||s({type:2,focus:S.Specific,id:a,trigger:0}))}),$=b(w=>{E.wasMoved(w)&&(c||u&&s({type:2,focus:S.Nothing}))}),T=i.useMemo(()=>({active:u,disabled:c,close:R}),[u,c,R]);return U({ourProps:{id:a,ref:v,role:"menuitem",tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,disabled:void 0,onClick:p,onFocus:d,onPointerEnter:N,onMouseEnter:N,onPointerMove:m,onMouseMove:m,onPointerLeave:$,onMouseLeave:$},theirProps:o,slot:T,defaultTag:sr,name:"Menu.Item"})}let or=B(Xt),lr=B(tr),cr=B(nr),dr=B(ir),X=Object.assign(or,{Button:lr,Items:cr,Item:dr}),Be=i.createContext(null);function Ge(){let e=i.useContext(Be);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ge),t}return e}function Ue(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let a=b(o=>(t(l=>[...l,o]),()=>t(l=>{let s=l.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),c=i.useMemo(()=>({register:a,slot:r.slot,name:r.name,props:r.props}),[a,r.slot,r.name,r.props]);return O.createElement(Be.Provider,{value:c},r.children)},[t])]}let ur="label";function mr(e,t){let r=W(),{id:a=`headlessui-label-${r}`,passive:c=!1,...o}=e,l=Ge(),s=G(t);K(()=>l.register(a),[a,l.register]);let u={ref:s,...l.props,id:a};return c&&("onClick"in u&&(delete u.htmlFor,delete u.onClick),"onClick"in o&&delete o.onClick),U({ourProps:u,theirProps:o,slot:l.slot||{},defaultTag:ur,name:l.name||"Label"})}let pr=B(mr),fr=Object.assign(pr,{});var xr=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(xr||{});let vr={0(e,t){let r=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Oe(r,a=>a.element.current)}},1(e,t){let r=e.options.slice(),a=e.options.findIndex(c=>c.id===t.id);return a===-1?e:(r.splice(a,1),{...e,options:r})}},he=i.createContext(null);he.displayName="RadioGroupDataContext";function ze(e){let t=i.useContext(he);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ze),r}return t}let be=i.createContext(null);be.displayName="RadioGroupActionsContext";function Ve(e){let t=i.useContext(be);if(t===null){let r=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ve),r}return t}function gr(e,t){return xe(t.type,vr,e,t)}let hr="div";function br(e,t){let r=W(),{id:a=`headlessui-radiogroup-${r}`,value:c,defaultValue:o,form:l,name:s,onChange:u,by:x=(f,M)=>f===M,disabled:v=!1,...y}=e,g=b(typeof x=="string"?(f,M)=>{let C=x;return(f==null?void 0:f[C])===(M==null?void 0:M[C])}:x),[R,p]=i.useReducer(gr,{options:[]}),d=R.options,[E,N]=Ue(),[m,$]=Le(),T=i.useRef(null),w=G(T,t),[P,z]=Pt(c,u,o),F=i.useMemo(()=>d.find(f=>!f.propsRef.current.disabled),[d]),V=i.useMemo(()=>d.some(f=>g(f.propsRef.current.value,P)),[d,P]),A=b(f=>{var M;if(v||g(f,P))return!1;let C=(M=d.find(Z=>g(Z.propsRef.current.value,f)))==null?void 0:M.propsRef.current;return C!=null&&C.disabled?!1:(z==null||z(f),!0)});Se({container:T.current,accept(f){return f.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let ie=b(f=>{let M=T.current;if(!M)return;let C=Me(M),Z=d.filter(I=>I.propsRef.current.disabled===!1).map(I=>I.element.current);switch(f.key){case h.Enter:It(f.currentTarget);break;case h.ArrowLeft:case h.ArrowUp:if(f.preventDefault(),f.stopPropagation(),Ne(Z,Q.Previous|Q.WrapAround)===Pe.Success){let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break;case h.ArrowRight:case h.ArrowDown:if(f.preventDefault(),f.stopPropagation(),Ne(Z,Q.Next|Q.WrapAround)===Pe.Success){let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break;case h.Space:{f.preventDefault(),f.stopPropagation();let I=d.find(H=>H.element.current===(C==null?void 0:C.activeElement));I&&A(I.propsRef.current.value)}break}}),_=b(f=>(p({type:0,...f}),()=>p({type:1,id:f.id}))),J=i.useMemo(()=>({value:P,firstOption:F,containsCheckedOption:V,disabled:v,compare:g,...R}),[P,F,V,v,g,R]),qe=i.useMemo(()=>({registerOption:_,change:A}),[_,A]),Je={ref:w,id:a,role:"radiogroup","aria-labelledby":E,"aria-describedby":m,onKeyDown:ie},Ye=i.useMemo(()=>({value:P}),[P]),Y=i.useRef(null),Xe=ve();return i.useEffect(()=>{Y.current&&o!==void 0&&Xe.addEventListener(Y.current,"reset",()=>{A(o)})},[Y,A]),O.createElement($,{name:"RadioGroup.Description"},O.createElement(N,{name:"RadioGroup.Label"},O.createElement(be.Provider,{value:qe},O.createElement(he.Provider,{value:J},s!=null&&P!=null&&Ct({[s]:P}).map(([f,M],C)=>O.createElement(ht,{features:wt.Hidden,ref:C===0?Z=>{var I;Y.current=(I=Z==null?void 0:Z.closest("form"))!=null?I:null}:void 0,...bt({key:f,as:"input",type:"radio",checked:M!=null,hidden:!0,readOnly:!0,form:l,disabled:v,name:f,value:M})})),U({ourProps:Je,theirProps:y,slot:Ye,defaultTag:hr,name:"RadioGroup"})))))}var wr=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(wr||{});let yr="div";function Rr(e,t){var r;let a=W(),{id:c=`headlessui-radiogroup-option-${a}`,value:o,disabled:l=!1,...s}=e,u=i.useRef(null),x=G(u,t),[v,y]=Ue(),[g,R]=Le(),{addFlag:p,removeFlag:d,hasFlag:E}=yt(1),N=Rt({value:o,disabled:l}),m=ze("RadioGroup.Option"),$=Ve("RadioGroup.Option");K(()=>$.registerOption({id:c,element:u,propsRef:N}),[c,$,u,N]);let T=b(_=>{var J;if(fe(_.currentTarget))return _.preventDefault();$.change(o)&&(p(2),(J=u.current)==null||J.focus())}),w=b(_=>{if(fe(_.currentTarget))return _.preventDefault();p(2)}),P=b(()=>d(2)),z=((r=m.firstOption)==null?void 0:r.id)===c,F=m.disabled||l,V=m.compare(m.value,o),A={ref:x,id:c,role:"radio","aria-checked":V?"true":"false","aria-labelledby":v,"aria-describedby":g,"aria-disabled":F?!0:void 0,tabIndex:F?-1:V||!m.containsCheckedOption&&z?0:-1,onClick:F?void 0:T,onFocus:F?void 0:w,onBlur:F?void 0:P},ie=i.useMemo(()=>({checked:V,disabled:F,active:E(2)}),[V,F,E]);return O.createElement(R,{name:"RadioGroup.Description"},O.createElement(y,{name:"RadioGroup.Label"},U({ourProps:A,theirProps:s,slot:ie,defaultTag:yr,name:"RadioGroup.Option"})))}let Er=B(br),jr=B(Rr),ee=Object.assign(Er,{Option:jr,Label:fr,Description:Kt});const D={ResetPlanOptions:"reset-plan-options",ResetPlanDates:"reset-plan-dates",ResetCategories:"reset-categories",PlanOptions:"plan-options",Dates:"dates",DateStart:"date-start",DateEnd:"date-end",Category:"category",External:"external",ResetTestsReport:"reset-tests-report",TestsReportErrors:"tests-report-errors",TestsReportMessages:"tests-report-messages"},j={Add:"add",Remove:"remove",Direct:"direct",Indirect:"indirect",Metadata:"metadata",Default:"default"},de={Breaking:"breaking",NonBreaking:"non-breaking",ForwardOnly:"forward-only"},[kr,Nr]=Dr(),Ze={skip_tests:!1,no_gaps:!1,skip_backfill:!1,forward_only:!1,auto_apply:!1,no_auto_categorization:!1,include_unmodified:!0,restate_models:void 0,create_from:"prod"},Ke={start:void 0,end:void 0},we={...Ke,...Ze,categories:Nr,defaultCategory:kr,change_categorization:new Map,virtualUpdateDescription:"All changes and their downstream dependencies can be fully previewed before they get promoted. If during plan creation no data gaps have been detected and only references to new model versions need to be updated, then such an update is referred to as a Virtual Update. Virtual Updates impose no additional runtime overhead or cost.",isInitialPlanRun:!1,errors:[],testsReportErrors:void 0,testsReportMessages:void 0},We=i.createContext(we),Qe=i.createContext(()=>{});function Vr({children:e}){const[t,r]=i.useReducer(Ir,Object.assign(we));return n.jsx(We.Provider,{value:Object.assign(t),children:n.jsx(Qe.Provider,{value:r,children:e})})}function ye(){return i.useContext(We)}function Pr(){return i.useContext(Qe)}function Ir(e,t){return t=Array.isArray(t)?t:[t],t.reduce(Cr,e)}function Cr(e=we,{type:t,...r}){switch(t){case D.ResetCategories:return Object.assign({},e,{change_categorization:new Map});case D.ResetPlanDates:return Object.assign({},e,Ke);case D.ResetPlanOptions:return Object.assign({},e,Ze);case D.ResetTestsReport:return Object.assign({},e,{testsReportErrors:void 0,testsReportMessages:void 0});case D.PlanOptions:return Object.assign({},e,r);case D.Dates:return Object.assign({},e,{start:r.start,end:r.end});case D.External:return Object.assign({},e,{isInitialPlanRun:r.isInitialPlanRun??!1});case D.DateStart:return Object.assign({},e,{start:r.start});case D.DateEnd:return Object.assign({},e,{end:r.end});case D.TestsReportErrors:return Object.assign({},e,{testsReportErrors:r.testsReportErrors});case D.TestsReportMessages:return Object.assign({},e,{testsReportMessages:r.testsReportMessages});case D.Category:{const{change:a,category:c}=r;return ne(a==null?void 0:a.name)&&e.change_categorization.set(a.name,{category:c,change:a}),Object.assign({},e,{change_categorization:new Map(e.change_categorization)})}default:return Object.assign({},e)}}function Dr(){const e={id:de.Breaking,name:"Breaking Change",description:"It will rebuild all models",value:oe.NUMBER_1},t=[e,{id:de.NonBreaking,name:"Non-Breaking Change",description:"It will exclude all indirect models caused by this change",value:oe.NUMBER_2},{id:de.ForwardOnly,name:"Forward-Only Change",description:"The change requires no rebuilding",value:oe.NUMBER_3}];return[e,t]}function q({children:e,headline:t,type:r,className:a}){return n.jsxs("div",{className:k("flex flex-col rounded-md p-4 text-xs",r===j.Add&&"bg-success-5",r===j.Remove&&"bg-danger-5",r===j.Direct&&"bg-secondary-5",r===j.Indirect&&"bg-warning-5",r===j.Default&&"bg-neutral-5",a),children:[ne(t)&&n.jsx("h4",{className:k("mb-2 font-bold whitespace-nowrap",r===j.Add&&"text-success-600 dark:text-success-300",r===j.Remove&&"text-danger-600 dark:text-danger-300",r===j.Direct&&"text-secondary-600 dark:text-secondary-300",r===j.Indirect&&"text-warning-600 dark:text-warning-300",r===j.Default&&"text-neutral-600 dark:text-neutral-300"),children:t}),e]})}function Mr({changes:e=[],type:t}){return n.jsx("ul",{children:e.map(r=>n.jsxs("li",{className:k("flex items-center",t===j.Add&&"text-success-600 dark:text-success-300",t===j.Remove&&"text-danger-600 dark:text-danger-300",t===j.Direct&&"text-secondary-600 dark:text-secondary-300",t===j.Indirect&&"text-warning-600 dark:text-warning-300",t===j.Default&&"text-neutral-600 dark:text-neutral-300"),children:[t===j.Add?n.jsx(Bt,{className:"h-3 mr-2"}):t===j.Remove?n.jsx(St,{className:"h-3 mr-2"}):n.jsx(Te,{className:"h-4 mr-2"}),n.jsx("span",{title:r.displayViewName,className:"w-full whitespace-nowrap text-ellipsis overflow-hidden",children:et(r.displayViewName,50,25)})]},r.name))})}function $r({changes:e=[],disabled:t=!1}){const r=Pr(),{categories:a}=ye(),c=L(o=>o.models);return i.useEffect(()=>{r(e.map(o=>({type:D.Category,category:a.find(({value:l})=>l===o.change_category),change:o})))},[e]),n.jsx("ul",{children:e.map(o=>n.jsx("li",{className:"text-secondary-500 dark:text-primary-500 mt-1",children:n.jsx(le,{children:({open:l})=>n.jsxs(n.Fragment,{children:[n.jsxs(le.Button,{className:"flex items-center w-full justify-between rounded-lg text-left",children:[n.jsx(Re,{className:"w-full",change:o}),(()=>{const s=l?Fe:_t;return n.jsx(s,{className:"max-h-[1rem] min-w-[1rem] dark:text-primary-500"})})()]}),n.jsxs(le.Panel,{className:"px-4 mb-4 overflow-hidden",children:[Ee(o.direct)&&n.jsx(Ce,{type:"direct",models:o.direct,className:"mt-2 ml-4"}),Ee(o.indirect)&&n.jsx(Ce,{type:"indirect",models:o.indirect,className:"ml-4"}),n.jsx(ue,{className:"border-secondary-20 mt-2"}),n.jsx(Or,{change:o,disabled:t,onChange:s=>{r({type:D.Category,category:a.find(({value:u})=>u===s),change:o})}}),n.jsx(ue,{className:"border-secondary-20 mt-2"}),n.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:[ne(o)&&tt(o.diff)&&n.jsx(He,{diff:o.diff}),(()=>{var u,x;const s=c.get(o.name);return De(s)?n.jsx(n.Fragment,{}):n.jsx("div",{className:"h-[16rem] bg-theme-lighter rounded-2xl overflow-hidden my-4",children:n.jsx(lt,{showColumns:!1,showConnected:!1,showControls:!1,children:n.jsx(ct,{model:s,highlightedNodes:{"border-4 border-warning-500 bg-warning-500 text-warning-500":((u=o.indirect)==null?void 0:u.map(v=>v.name))??[],"border-4 border-secondary-500 dark:border-primary-500 bg-secondary-500 dark:bg-primary-500 text-bg-secondary-500 dark:bg-primary-500 ring-8 ring-brand-50":[o.name],"border-4 border-secondary-500 dark:border-primary-500 bg-secondary-500 dark:bg-primary-500 text-bg-secondary-500 dark:bg-primary-500":((x=o.direct)==null?void 0:x.map(v=>v.name))??[],"*":["border-4 border-neutral-500 bg-neutral-500 text-neutral-600 dark:text-light"]}})})})})()]})]})]})})},o.name))})}function Or({change:e,disabled:t=!1,onChange:r}){var o,l;const{change_categorization:a,categories:c}=ye();return n.jsx(ee,{className:k("flex flex-col mt-2",t&&"pointer-events-none opacity-50 cursor-not-allowed"),disabled:t,defaultValue:((l=(o=a.get(e.name))==null?void 0:o.category)==null?void 0:l.value)??e.change_category,onChange:r,children:c.map(s=>n.jsx(ee.Option,{value:s.value,className:()=>k("relative flex rounded-md"),children:({checked:u})=>n.jsxs("div",{className:k("text-sm flex items-center px-2 py-1 w-full rounded-lg",u?"text-secondary-500 dark:text-primary-300":"text-prose"),children:[n.jsx("div",{className:"mt-[0.125rem] mr-2 border-2 border-neutral-400 min-w-[1rem] h-4 rounded-full flex justify-center items-center",children:u&&n.jsx("span",{className:"inline-block w-2 h-2 bg-secondary-500 dark:bg-primary-300 rounded-full"})}),n.jsxs("div",{children:[n.jsx(ee.Label,{as:"p",children:s.name}),n.jsx(ee.Description,{as:"span",className:"text-xs text-neutral-500",children:s.description})]})]})},s.name))})}function Tr({changes:e=[]}){return n.jsx("ul",{children:e.map(t=>n.jsx("li",{className:"text-warning-700 dark:text-warning-500",children:n.jsx(Re,{change:t})},t.name))})}function Re({change:e,className:t}){var c;const{change_categorization:r}=ye(),a=(c=r.get(e.name))==null?void 0:c.category;return n.jsxs("div",{className:k("flex items-center font-bold",t),children:[n.jsxs("span",{className:"flex w-full whitespace-nowrap text-ellipsis overflow-hidden",children:[n.jsx(Te,{className:"h-4 mr-2"}),e.displayViewName]}),De(a)?ne(e.indirect)&&n.jsx("span",{className:"ml-2 px-1 bg-warning-500 text-warning-100 dark:bg-warning-400 dark:text-warning-800 rounded whitespace-nowrap mr-2",children:"Categorize Manually"}):n.jsx("span",{className:"ml-2 px-1 bg-neutral-400 text-neutral-100 dark:bg-neutral-400 dark:text-neutral-800 rounded whitespace-nowrap mr-2",children:a.name})]})}function Ce({type:e,models:t,className:r}){return n.jsx("ul",{className:k(e==="indirect"&&"text-warning-700 dark:text-warning-500",e==="direct"&&"text-secondary-500 dark:text-primary-500",r),children:t.map(a=>n.jsxs("li",{className:"flex",children:[n.jsx("span",{className:"h-3 w-3 border-l-2 border-b-2 inline-block mr-2"}),a.displayViewName]},a.name))})}function He({diff:e}){return n.jsx("div",{className:"my-4 bg-dark-lighter rounded-2xl overflow-hidden",children:n.jsx("pre",{className:"p-4 text-primary-100 max-h-[30vh] text-xs overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.split(`
2
2
  `).map((t,r)=>n.jsx("p",{className:k(t.startsWith("+")&&"text-success-500 bg-success-500/10 px-2",t.startsWith("-")&&"text-danger-500 bg-danger-500/10 px-2",t.startsWith("@@")&&"text-primary-300 my-5 px-2"),children:t},`${t}-${r}`))})})}q.Default=Mr;q.Direct=$r;q.Indirect=Tr;q.Diff=He;q.Title=Re;function Fr({onAdd:e,className:t,label:r="Add",size:a=te.sm}){const c=L(p=>p.getNextEnvironment),o=L(p=>p.isExistingEnvironment),l=L(p=>p.addLocalEnvironment),[s,u]=i.useState(""),[x,v]=i.useState(c().name);function y(p){p.stopPropagation(),l(s,x),u(""),v(c().name),e==null||e()}function g(p){p.stopPropagation(),u(p.target.value)}const R=rt(s)||o(s);return n.jsxs("div",{className:k("flex w-full items-center bg-secondary-5",t),children:[n.jsx(Ie,{className:"my-0 mx-0 mr-4 min-w-[10rem] w-full",size:a,children:({className:p})=>n.jsx(Ie.Textfield,{className:k(p,"w-full"),placeholder:"Environment",value:s,onInput:g})}),n.jsx(me,{className:"my-0 mx-0 font-bold",variant:re.Secondary,size:a,disabled:R,onClick:y,children:r})]})}function Zr({disabled:e=!1,className:t,showAddEnvironment:r=!0,size:a=te.sm,onSelect:c}){const{addError:o}=at(),l=L(p=>p.environment),s=L(p=>p.environments),u=L(p=>p.setEnvironment),x=L(p=>p.removeLocalEnvironment),v=nt(X.Button);function y(p,d){p.stopPropagation(),u(d),c==null||c()}function g(p,d){p.stopPropagation(),x(d)}function R(p,d){p.stopPropagation(),it(d.name).then(()=>{x(d)}).catch(E=>{o(ot.Environments,E)})}return n.jsx(X,{as:"div",className:k("flex relative",t),children:({close:p})=>n.jsxs(n.Fragment,{children:[n.jsxs(v,{variant:re.Info,size:a,disabled:e,className:"flex justify-between w-full mx-0 pr-1",children:[n.jsxs("span",{className:k("block overflow-hidden truncate",(l.isLocal||e)&&"text-neutral-500",l.isRemote?"text-primary-600 dark:text-primary-300":"text-neutral-600 dark:text-neutral-200"),children:[n.jsx("span",{className:"text-xs text-neutral-300 dark:text-neutral-500 mr-1",children:"Environment:"}),n.jsx("span",{children:l.name})]}),n.jsx("span",{className:"pointer-events-none inset-y-0 right-0 flex items-center pl-1",children:n.jsx(Dt,{className:k("w-4",e?"text-neutral-400 dark:text-neutral-200":"text-neutral-800 dark:text-neutral-200"),"aria-hidden":"true"})})]}),n.jsx(Et,{as:i.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:n.jsx("div",{className:"!mx-0 absolute top-10 right-0 min-w-[16rem] max-w-[100%] overflow-hidden shadow-2xl bg-theme border-0 border-neutral-100 dark:border-neutral-800 rounded-md flex flex-col z-50",children:n.jsxs(X.Items,{className:"mx-0 overflow-auto max-h-80 hover:scrollbar scrollbar--vertical",children:[Array.from(s).map(d=>n.jsx(X.Item,{disabled:d===l,children:({active:E})=>n.jsxs("div",{onClick:N=>y(N,d),className:k("flex justify-between items-center pl-2 pr-1 py-1 overflow-auto",E?"text-neutral-600 bg-neutral-10":"text-neutral-400",d===l?"cursor-default bg-neutral-5":"cursor-pointer"),children:[n.jsxs("div",{className:"flex items-start",children:[n.jsx(Ot,{className:k("w-4 h-4 mt-[6px]",d===l?"opacity-100 text-primary-500":"opacity-0")}),n.jsxs("span",{className:"block",children:[n.jsxs("span",{className:"flex items-baseline",children:[n.jsx("span",{className:k("block truncate ml-2",d.isRemote&&"text-primary-500"),children:d.name}),n.jsxs("small",{className:"block ml-2",children:["(",d.type,")"]})]}),d.isProd&&n.jsx("span",{className:"flex ml-2",children:n.jsx("small",{className:"text-xs text-neutral-500",children:"Production Environment"})}),d.isDefault&&n.jsx("span",{className:"flex ml-2",children:n.jsx("small",{className:"text-xs text-neutral-500",children:"Default Environment"})})]})]}),n.jsxs("div",{className:"flex items-center",children:[d.isPinned&&n.jsx(Ut,{title:"Pinned",className:"w-4 text-primary-500 dark:text-primary-100 mx-1"}),je(d.isPinned)&&d.isLocal&&d!==l&&n.jsx(me,{className:"!m-0 !px-1 bg-transparent hover:bg-transparent border-none",size:te.xs,format:st.Ghost,variant:re.Neutral,onClick:N=>g(N,d),children:n.jsx(Fe,{className:"w-4 text-neutral-500 dark:text-neutral-100"})}),je(d.isPinned)&&d.isRemote&&d!==l&&n.jsx(me,{className:"!px-2 !my-0",size:te.xs,variant:re.Danger,onClick:N=>R(N,d),children:"Delete"})]})]})},d.name)),r&&n.jsxs(n.Fragment,{children:[n.jsx(ue,{}),n.jsx(Fr,{onAdd:p,className:"p-2 pb-2"})]})]})})})]})})}export{Fr as A,fr as B,j as E,Ue as F,Kt as G,q as P,Zr as S,Pr as a,D as b,Vr as c,ye as u,Le as w};
@@ -1 +1 @@
1
- import{r as f,i as V,J as k,j as s,c as v,m as y,B as q,n as A,F as G,w as H}from"./index-COnjINWU.js";import{I as F}from"./Input-CJirBrKe.js";import{u as K}from"./index-CK4fdw8q.js";function W({items:c=[],keyId:d="id",keyName:N="",keyDescription:x="",to:L="",disabled:S=!1,withCounter:T=!0,withFilter:$=!0,types:a,className:B,isActive:m,listItem:h}){var I;const O=f.useRef(null),[r,C]=f.useState(""),j=f.useRef(null),[o,u]=f.useMemo(()=>{let t=-1;const e=[];return c.forEach((l,p)=>{const w=n(l[d]),g=n(l[x]),M=n(l[N]),Y=n(a==null?void 0:a[w]);(M.includes(r)||g.includes(r)||Y.includes(r))&&e.push(l),V(m)&&m(l[d])&&(t=p)}),[t,e]},[c,r,m]),i=K({count:u.length,getScrollElement:()=>j.current,estimateSize:()=>32+(x.length>0?16:0)}),b=({itemIndex:t,isSmoothScroll:e=!0})=>{i.scrollToIndex(t,{align:"center",behavior:e?"smooth":"auto"})},E=({itemIndex:t,range:e})=>V(e)&&(e.startIndex>t||(e==null?void 0:e.endIndex)<t),J=k(r)&&o>-1&&E({range:i.range,itemIndex:o});f.useEffect(()=>{o>-1&&E({range:i.range,itemIndex:o})&&b({itemIndex:o,isSmoothScroll:!1})},[o]);const z=i.getVirtualItems(),R=i.getTotalSize();return s.jsxs("div",{ref:O,className:v("flex flex-col w-full h-full text-sm text-neutral-600 dark:text-neutral-300",B),style:{contain:"strict"},children:[$&&s.jsxs("div",{className:"p-1 w-full flex justify-between",children:[s.jsx(F,{className:"w-full !m-0",size:y.sm,children:({className:t})=>s.jsx(F.Textfield,{className:v(t,"w-full"),value:r,placeholder:"Filter items",type:"search",onInput:e=>{C(e.target.value)}})}),T&&s.jsx("div",{className:"ml-1 px-3 bg-primary-10 text-primary-500 rounded-full text-xs flex items-center",children:u.length})]}),s.jsxs("div",{className:"w-full h-full relative p-1",children:[J&&s.jsx(q,{className:"absolute left-[50%] translate-x-[-50%] -top-2 z-10 text-ellipsis !block overflow-hidden no-wrap max-w-[90%] !border-neutral-20 shadow-md !bg-theme !hover:bg-theme text-neutral-500 dark:text-neutral-300 !focus:ring-2 !focus:ring-theme-500 !focus:ring-offset-2 !focus:ring-offset-theme-50 !focus:ring-opacity-50 !focus:outline-none !focus:ring-offset-transparent !focus:ring-offset-0 !focus:ring",onClick:()=>b({itemIndex:o}),size:y.sm,variant:A.Secondary,children:"Scroll to selected"}),s.jsx("div",{ref:j,className:"w-full h-full relative overflow-hidden overflow-y-auto hover:scrollbar scrollbar--horizontal scrollbar--vertical",style:{contain:"strict"},children:s.jsx("div",{className:"relative w-full",style:{height:R>0?`${R}px`:"100%"},children:s.jsxs("ul",{className:"w-full absolute top-0 left-0",style:{transform:`translateY(${((I=z[0])==null?void 0:I.start)??0}px)`},children:[G(u)&&s.jsx("li",{className:"px-2 py-0.5 text-center whitespace-nowrap overflow-ellipsis overflow-hidden",children:r.length>0?"No Results Found":"Empty List"},"not-found"),z.map(t=>{const e=u[t.index],l=n(e[d]),p=n(e[x]),w=n(e[N]),g=n(a==null?void 0:a[l]);return s.jsx("li",{"data-index":t.index,ref:i.measureElement,className:v("font-normal w-full",S&&"cursor-not-allowed"),tabIndex:l===r?-1:0,children:h==null?void 0:h({id:l,to:`${L}/${l}`,name:w,description:p,text:g,disabled:S,item:u[t.index]})},t.key)})]})})})]})]})}function n(c){return H(c)?"":String(c)}export{W as S};
1
+ import{r as f,i as V,J as k,j as s,c as v,m as y,B as q,n as A,F as G,w as H}from"./index-C22hdM_h.js";import{I as F}from"./Input-CxOCLTNw.js";import{u as K}from"./index-BWibl-Ee.js";function W({items:c=[],keyId:d="id",keyName:N="",keyDescription:x="",to:L="",disabled:S=!1,withCounter:T=!0,withFilter:$=!0,types:a,className:B,isActive:m,listItem:h}){var I;const O=f.useRef(null),[r,C]=f.useState(""),j=f.useRef(null),[o,u]=f.useMemo(()=>{let t=-1;const e=[];return c.forEach((l,p)=>{const w=n(l[d]),g=n(l[x]),M=n(l[N]),Y=n(a==null?void 0:a[w]);(M.includes(r)||g.includes(r)||Y.includes(r))&&e.push(l),V(m)&&m(l[d])&&(t=p)}),[t,e]},[c,r,m]),i=K({count:u.length,getScrollElement:()=>j.current,estimateSize:()=>32+(x.length>0?16:0)}),b=({itemIndex:t,isSmoothScroll:e=!0})=>{i.scrollToIndex(t,{align:"center",behavior:e?"smooth":"auto"})},E=({itemIndex:t,range:e})=>V(e)&&(e.startIndex>t||(e==null?void 0:e.endIndex)<t),J=k(r)&&o>-1&&E({range:i.range,itemIndex:o});f.useEffect(()=>{o>-1&&E({range:i.range,itemIndex:o})&&b({itemIndex:o,isSmoothScroll:!1})},[o]);const z=i.getVirtualItems(),R=i.getTotalSize();return s.jsxs("div",{ref:O,className:v("flex flex-col w-full h-full text-sm text-neutral-600 dark:text-neutral-300",B),style:{contain:"strict"},children:[$&&s.jsxs("div",{className:"p-1 w-full flex justify-between",children:[s.jsx(F,{className:"w-full !m-0",size:y.sm,children:({className:t})=>s.jsx(F.Textfield,{className:v(t,"w-full"),value:r,placeholder:"Filter items",type:"search",onInput:e=>{C(e.target.value)}})}),T&&s.jsx("div",{className:"ml-1 px-3 bg-primary-10 text-primary-500 rounded-full text-xs flex items-center",children:u.length})]}),s.jsxs("div",{className:"w-full h-full relative p-1",children:[J&&s.jsx(q,{className:"absolute left-[50%] translate-x-[-50%] -top-2 z-10 text-ellipsis !block overflow-hidden no-wrap max-w-[90%] !border-neutral-20 shadow-md !bg-theme !hover:bg-theme text-neutral-500 dark:text-neutral-300 !focus:ring-2 !focus:ring-theme-500 !focus:ring-offset-2 !focus:ring-offset-theme-50 !focus:ring-opacity-50 !focus:outline-none !focus:ring-offset-transparent !focus:ring-offset-0 !focus:ring",onClick:()=>b({itemIndex:o}),size:y.sm,variant:A.Secondary,children:"Scroll to selected"}),s.jsx("div",{ref:j,className:"w-full h-full relative overflow-hidden overflow-y-auto hover:scrollbar scrollbar--horizontal scrollbar--vertical",style:{contain:"strict"},children:s.jsx("div",{className:"relative w-full",style:{height:R>0?`${R}px`:"100%"},children:s.jsxs("ul",{className:"w-full absolute top-0 left-0",style:{transform:`translateY(${((I=z[0])==null?void 0:I.start)??0}px)`},children:[G(u)&&s.jsx("li",{className:"px-2 py-0.5 text-center whitespace-nowrap overflow-ellipsis overflow-hidden",children:r.length>0?"No Results Found":"Empty List"},"not-found"),z.map(t=>{const e=u[t.index],l=n(e[d]),p=n(e[x]),w=n(e[N]),g=n(a==null?void 0:a[l]);return s.jsx("li",{"data-index":t.index,ref:i.measureElement,className:v("font-normal w-full",S&&"cursor-not-allowed"),tabIndex:l===r?-1:0,children:h==null?void 0:h({id:l,to:`${L}/${l}`,name:w,description:p,text:g,disabled:S,item:u[t.index]})},t.key)})]})})})]})]})}function n(c){return H(c)?"":String(c)}export{W as S};
@@ -1 +1 @@
1
- import{j as t,N as c,i as l,c as u,n as i}from"./index-COnjINWU.js";function f({name:o,description:a,to:p,text:n,variant:s,disabled:x=!1,handleDelete:r}){function d(e){(e.key==="Delete"||e.key==="Backspace")&&(e.preventDefault(),e.stopPropagation(),r==null||r())}return t.jsxs(c,{onKeyUp:d,to:p,className:({isActive:e})=>u("block overflow-hidden px-2 py-1.5 rounded-md w-full font-semibold",x&&"opacity-50 pointer-events-none",e?s===i.Primary?"text-primary-500 bg-primary-10":s===i.Danger?"text-danger-500 bg-danger-5":"text-neutral-600 dark:text-neutral-100 bg-neutral-10":"hover:bg-neutral-5 text-neutral-500 dark:text-neutral-400"),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"whitespace-nowrap overflow-ellipsis overflow-hidden min-w-10",children:o}),l(n)&&t.jsx("span",{className:" ml-2 px-2 rounded-md leading-0 text-[0.5rem] bg-neutral-10 text-neutral-700 dark:text-neutral-200",children:n})]}),l(a)&&t.jsx("p",{className:"text-xs overflow-hidden whitespace-nowrap overflow-ellipsis text-neutral-300 dark:text-neutral-500",children:a})]})}export{f as S};
1
+ import{j as t,N as c,i as l,c as u,n as i}from"./index-C22hdM_h.js";function f({name:o,description:a,to:p,text:n,variant:s,disabled:x=!1,handleDelete:r}){function d(e){(e.key==="Delete"||e.key==="Backspace")&&(e.preventDefault(),e.stopPropagation(),r==null||r())}return t.jsxs(c,{onKeyUp:d,to:p,className:({isActive:e})=>u("block overflow-hidden px-2 py-1.5 rounded-md w-full font-semibold",x&&"opacity-50 pointer-events-none",e?s===i.Primary?"text-primary-500 bg-primary-10":s===i.Danger?"text-danger-500 bg-danger-5":"text-neutral-600 dark:text-neutral-100 bg-neutral-10":"hover:bg-neutral-5 text-neutral-500 dark:text-neutral-400"),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"whitespace-nowrap overflow-ellipsis overflow-hidden min-w-10",children:o}),l(n)&&t.jsx("span",{className:" ml-2 px-2 rounded-md leading-0 text-[0.5rem] bg-neutral-10 text-neutral-700 dark:text-neutral-200",children:n})]}),l(a)&&t.jsx("p",{className:"text-xs overflow-hidden whitespace-nowrap overflow-ellipsis text-neutral-300 dark:text-neutral-500",children:a})]})}export{f as S};