setta 0.0.3.dev6__py3-none-any.whl → 0.0.3.dev7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- setta/__init__.py +1 -1
- setta/static/frontend/assets/{index-1f218da9.js → index-8204c872.js} +1 -1
- setta/static/frontend/index.html +1 -1
- setta/tasks/utils.py +4 -3
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/METADATA +1 -1
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/RECORD +10 -10
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/LICENSE +0 -0
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/WHEEL +0 -0
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/entry_points.txt +0 -0
- {setta-0.0.3.dev6.dist-info → setta-0.0.3.dev7.dist-info}/top_level.txt +0 -0
setta/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.0.3.
|
1
|
+
__version__ = "0.0.3.dev7"
|
@@ -224,7 +224,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
224
224
|
`)),r}function ET(t){const e=t.split(/\r?\n/);return NS(e,0,0).result}function NS(t,e,n){let r=e,i,s=!1,o=!1;for(;r<t.length;){const a=t[r];if(!a.trim()){r++;continue}const l=TT(a);if(l<n)break;const c=a.trim();if(c.indexOf("- ")===0||c==="-"){if(!s&&!o)s=!0,i=[];else if(o)throw new Error("Mixed list and object at same level.");const f=c==="-"?"":c.slice(2).trim();if(!f||f.endsWith(":")||f.endsWith(": |")){const{parsedValue:h,isBlock:d,extraIndent:p}=iRe(f);if(d){const g=NS(t,r+1,n+p);h===void 0?Nx(g.result)?i.push(""):i.push(g.result):Nx(g.result)?i.push({[h]:""}):i.push({[h]:g.result}),r=g.nextIndex}else{const g=NS(t,r+1,l+2);Nx(g.result)?i.push(""):i.push(g.result),r=g.nextIndex}}else i.push(f),r++}else{if(!o&&!s)o=!0,i={};else if(s)throw new Error("Mixed list and object at same level.");const f=c.match(/^([^:]+):\s*(.*)$/);if(!f)throw new Error(`Line doesn't match "key: value": ${c}`);const h=f[1].trim();let d=f[2];if(d==="|"){const{textBlock:p,nextIdx:g}=sRe(t,r+1,l+2);i[h]=p,r=g}else if(d===""){const p=NS(t,r+1,l+2);Nx(p.result)?i[h]="":i[h]=p.result,r=p.nextIndex}else i[h]=d,r++}}return i===void 0&&(i={}),{result:i,nextIndex:r}}function iRe(t){const e=t.match(/^([^:]+):\s*(.*)$/);if(!e)return{parsedValue:void 0,isBlock:!1,extraIndent:2};const n=e[1].trim(),r=e[2].trim();return!r||r==="|"?{parsedValue:n,isBlock:!0,extraIndent:2}:{parsedValue:void 0,isBlock:!1,extraIndent:2}}function sRe(t,e,n){let r="",i=e;for(;i<t.length;){const s=t[i];if(!s.trim()){if(TT(s)<n)break;r+=hF(s,n)+`
|
225
225
|
`,i++;continue}if(TT(s)<n)break;r+=hF(s,n)+`
|
226
226
|
`,i++}return r.endsWith(`
|
227
|
-
`)&&(r=r.slice(0,-1)),{textBlock:r,nextIdx:i}}function Nx(t){return Array.isArray(t)?t.length===0:typeof t=="object"&&t!==null?Object.keys(t).length===0:!1}function TT(t){let e=0;for(let n of t)if(n===" ")e++;else break;return e}function hF(t,e){let n=0,r="";for(let i of t)n<e&&i===" "?n++:r+=i;return r}async function Ene(t,e){const n=await FAe(t,e);if(n.status===200){const{originalObj:r,yamlValue:i}=n.data;Kee.setState({[e]:r}),u_.setState({[e]:i})}}function W$(t){const e=te.getState().x[t].variantId,n=dn(t),r=u_.getState()[e]??"";switch(n){case Y.PARAM_SWEEP:oRe(t,r);break;case Y.GLOBAL_PARAM_SWEEP:lRe(r,e);break;case Y.GLOBAL_VARIABLES:case Y.SECTION:const i=Kee.getState()[e]??{};uRe(t,r,i);break}}function oRe(t,e){const n=te.getState(),r=ky(t,n.x),s=Cne(e).map(c=>c.trim()?ET(c):{}),o=Jo(r,n).children,a=Object.keys(o),l=[];for(const c of s){const u=!Array.isArray(c);let f=null,h;if(u){if(h=Object.keys(c)[0],!h){l.push({selectedItem:null,params:[]});continue}if(f=aRe(h,a,n.codeInfo),!f)continue}const{pathMap:d}=_y({allCodeInfo:n.codeInfo,codeInfoChildren:o,startingId:f});let p=h?c[h]:c;ae.size(p)===0&&(p=[]);const g=[];for(const m of p){const v=Object.keys(m)[0];let y;for(const S of Object.keys(d))if(k$(n.codeInfo,d,S)===v){y=S;break}if(!y)continue;const b=m[v];ae.size(b)>0&&g.push({paramInfoId:y,values:b})}l.push({selectedItem:f,params:g})}te.setState(c=>{Yt(t,c).sweep=l})}function aRe(t,e,n){return e.find(r=>{var i;return((i=n[r])==null?void 0:i.name)===t})}function lRe(t,e){const n=rRe(t)[0].toJS(),r=te.getState(),i=r.x,s=r.variants,o={};for(const[a,l]of Object.entries(n))PT(a,l,i,s,o,null,null);te.setState(a=>{a.variants[e].runGroup=o})}function PT(t,e,n,r,i,s,o){let a=s,l=o;const[c,u]=cRe(t,s,n,r);if(u==="section"?(c in i||(i[c]={}),i[c][o]={selected:!0,versions:{},paramSweeps:{}},a=c):u==="sectionVariant"?(i[s][o].versions[c]=!0,l=c):u==="paramSweep"&&(i[s][o].paramSweeps[c]=!0),e)for(const[f,h]of Object.entries(ae.pickBy(e,(d,p)=>p.startsWith("~"))))PT(f,h,n,r,i,a,l);if(u==="section"&&(!e||!Object.keys(e).some(f=>f.startsWith("@")))&&(l=n[c].variantId,i[c][o].versions[l]=!0),!!e)for(const[f,h]of Object.entries(ae.pickBy(e,(d,p)=>!p.startsWith("~"))))PT(f,h,n,r,i,a,l)}function cRe(t,e,n,r){let i,s;if(e&&t.startsWith("@")){const o=t.slice(1);for(const a of n[e].variantIds)if(r[a].name===o){i=a,s="sectionVariant";break}}else if(e&&t.startsWith("~")){const o=t.slice(1),{paramSweepSectionId:a}=n[e];for(const l of n[a].variantIds)if(r[l].name===o){i=l,s="paramSweep";break}}else if(e){for(const o of r[n[e].variantId].children)if(n[o].name===t){i=o,s="section";break}}else for(const o of Object.values(n))if(o.name===t){i=o.id,s="section";break}return[i,s]}function uRe(t,e,n){var T,C;const r=te.getState(),i=Cne(e);let s=null,o={},a={};i.length===3?[s,o,a]=i:i.length===2?[o,a]=i:[a]=i;try{o=(T=o.trim)!=null&&T.call(o)?ET(o):{},a=(C=a.trim)!=null&&C.call(a)?ET(a):{}}catch{return}const l=gF(Qx(n.pinned),Qx(n.unpinned)),c=gF(Qx(o,!0),Qx(a,!0)),u=[],f=new Set,h=new Set;for(const A of l){if(f.has(A.id))continue;let R=c.filter(Q=>Q.key===A.key&&!h.has(JSON.stringify(Q.keyPath)));R.length>0&&(mF(R,A.keyPath),dF({v:A,matches:R,usedOriginalIds:f,usedPaths:h,output:u}))}for(const A of l){if(f.has(A.id))continue;let R=c.filter(Q=>Q.value===A.value&&!h.has(JSON.stringify(Q.keyPath)));R.length>0&&(mF(R,A.keyPath),dF({v:A,matches:R,usedOriginalIds:f,usedPaths:h,output:u}))}const{jsonSource:d,jsonSourceKeys:p}=r.x[t];for(const A of c){if(h.has(JSON.stringify(A.keyPath)))continue;const R={key:A.key,keyPath:A.keyPath,value:A.value,isPinned:A.isPinned};R.id=_te(R.keyPath,d,p),R.isNewParam=!0,u.push(R)}const g={};for(const[A,R]of c.entries())g[JSON.stringify(R.keyPath)]=A;u.sort((A,R)=>{const Q=g[JSON.stringify(A.keyPath)],L=g[JSON.stringify(R.keyPath)];return Q-L});const{parentCodeInfoId:m}=Ry(t,r),v={[m]:[]};for(const A of u)v[A.id]=[];vF({sectionId:t,idsToChildren:v,output:u,toProcess:u.filter(A=>!(A.isPinned&&!A.isNewParam)),inputParentId:m,insertAtOriginalIdx:!1}),vF({sectionId:t,idsToChildren:v,output:u,toProcess:u.filter(A=>A.isPinned&&!A.isNewParam),inputParentId:m,insertAtOriginalIdx:!0});const y=r.codeInfo,b={},S={},k={},E=Fm().value;for(const A of u)A.id in y?S[A.id]={name:A.key,isPinned:A.isPinned}:b[A.id]=E5({id:A.id,name:A.key,editable:A.editable??!0,rcType:Y.PARAMETER,isPinned:A.isPinned}),A.value!==E&&(k[A.id]=A.value);te.setState(A=>{A.codeInfo={...A.codeInfo,...b};for(const[L,z]of Object.entries(S))for(const[B,q]of Object.entries(z))A.codeInfo[L][B]=q;const R=A.x[t].variantId,Q=A.variants[R];for(const[L,z]of Object.entries(v))F$(Q,A).children[L]=z;for(const[L,z]of Object.entries(k))Z$(R,L,z,A)})}function dF({v:t,matches:e,usedOriginalIds:n,usedPaths:r,output:i}){const s={key:e[0].key,keyPath:e[0].keyPath,value:e[0].value,isPinned:e[0].isPinned};s.id=t.id,s.editable=t.editable,i.push(s),n.add(t.id),r.add(JSON.stringify(s.keyPath))}function Qx(t,e=!1){let n=[];function r(i,s,o,a){if(typeof s=="object"&&!Array.isArray(s)&&s!==null){a.length>0&&n.push({id:i,keyPath:a,value:null,editable:o,key:a[a.length-1]});for(const[l,c]of Object.entries(s)){const u=[...a,l];e?r(null,c,null,u):r(c.id,c.value,c.editable,u)}}else n.push({id:i,keyPath:a,value:s,editable:o,key:a[a.length-1]})}return r(null,t,null,[]),n}function pF(t,e){const n=Math.min(t.length,e.length),r=Math.max(t.length,e.length);let i=0;for(let s=0;s<n&&t[t.length-1-s]===e[e.length-1-s];s++)i++;return i/r*(n/r)}function mF(t,e){return t.sort((n,r)=>{const i=pF(n.keyPath,e);return pF(r.keyPath,e)-i})}function gF(t,e){for(const r of e)r.isPinned=!1;const n=[];for(const r of t)e.find(s=>ae.isEqual(s.keyPath,r.keyPath))||n.push({...r,isPinned:!0});return[...n,...e]}function vF({sectionId:t,idsToChildren:e,output:n,toProcess:r,inputParentId:i,insertAtOriginalIdx:s}){for(const o of r){let a=i;if(o.keyPath.length>1){const l=ae.find(n,c=>ae.isEqual(c.keyPath,o.keyPath.slice(0,-1)));if(l)a=l.id;else continue}if(s){const l=Jo(t).children[a].indexOf(o.id);e[a].splice(l,0,o.id)}else e[a].push(o.id)}}async function Nd(t,e){Pi(t).displayMode===so.YAML&&await Ene(t,e)}async function p_(t=!1){const e=te.getState();for(const[n,r]of Object.entries(e.x)){const i=t?z5(n):r.variantId;await Nd(n,i)}}function Vi(t){pT.setState(e=>{e.timeoutId!==null&&clearTimeout(e.timeoutId);const n=setTimeout(()=>pT.setState({message:""}),3e3);return{message:t,timeoutId:n}})}function Q5({withArtifacts:t=!1,convertYamlToGUI:e=!0}){let n=ae.cloneDeep(te.getState().x);if(n=ae.pickBy(n,d=>!d.isTemporary),e)for(const d of Object.values(n))d.displayMode===so.YAML&&W$(d.id);n=ae.mapValues(n,d=>(d.columnWidth=jm.getState()[d.id],d));const r=t?RAe():{},i=ae.mapValues(te.getState().variants,d=>({...d,children:d.children.filter(p=>p in n)})),s=te.getState().artifactGroups,o=ae.pickBy(te.getState().uiTypes,d=>d.presetType!==Y.PRESET_UI_TYPE_BASE),a=te.getState().uiTypeCols,l=te.getState().codeInfo,c=te.getState().codeInfoCols,u=dRe(),f={};for(const d of mr.getState().x.values())d.id in n&&(f[d.id]={x:d.position.x,y:d.position.y,zIndex:d.zIndex,w:d.width,h:d.height});return u.children=f,{projectConfig:u,sectionVariants:i,artifacts:r,artifactGroups:s,uiTypes:o,uiTypeCols:a,sections:n,codeInfo:l,codeInfoCols:c}}async function j5(){let t;Vi("Saving..."),vo.getState().name===XR?(t=await xAe(Q5({})),t.status===200&&Nt.setState(t.data)):t=await hAe({project:await V$()}),t.status===200&&Vi("Saved!")}async function fRe({newConfigName:t,withRefs:e}){return await Tne({fn:dAe,otherArgs:{newConfigName:t,withRefs:e}})}async function hRe({configName:t}){return await Tne({fn:pAe,otherArgs:{configName:t}})}async function Tne({fn:t,otherArgs:e}){await t({project:await V$(),...e})}function dRe(){const t=vo.getState(),e={id:t.id,name:t.name,previewImgColor:t.previewImgColor};return e.viewport=qe.getState().fitViewOnInit?null:yee(),e}async function V$(){const t=Q5({withArtifacts:!0,convertYamlToGUI:!0});return Nt.getState().backend.saveRenderedValues&&await pRe(t.sections),t}async function pRe(t){for(const e of Object.keys(t))[Y.DRAW,Y.CHART].includes(dn(e))&&(t[e].renderedValue=await Mne(e))}async function mRe(t){return await jt({body:{projects:t},address:Y.ROUTE_UPDATE_INTERACTIVE_CODE})}async function gRe(){const t=Q5({}),e={};for(const n of Object.values(t.sections))dn(n.id)===Y.CODE&&(e[n.id]=v$(n.id,Yt(n.id).code));return await jt({body:{project:t,candidateTemplateVars:e},address:Y.ROUTE_FORMAT_CODE})}async function vRe(){const t=await gRe();t.status===200&&te.setState(e=>{for(const[n,r]of Object.entries(t.data))r!==null&&(Yt(n,e).code=r)})}function Pne(t,e){const n=JSON.stringify(t),r=Gee.getState().dependencies;(r.has(null)||r.has(n))&&Ay({id:Kn(),content:{[n]:e},messageType:"inMemoryFn"})}async function ORe(t){if(t.length===0)return;const e=ti.getState().namePathTypeToId,n=[],r=[];for(const[s,o]of t.entries()){"path"in o||(o.path="");const a=e[S$(o)];a?o.id=a:(n.push(s),r.push(ae.pick(o,["name","path","type"])))}const i=await nAe(r);if(i.status==200)for(const[s,o]of i.data.entries()){const a=n[s];t[a].id=o??Kn()}}async function Ane(t){if(t.length===0)return;const e={},n=ti.getState();for(const r of t)"path"in r||(r.path=""),r.type==="img"&&(r.value=await m$(r.value)),e[r.id??n.namePathTypeToId[S$(r)]]=r;ti.setState(r=>({x:{...r.x,...e}}))}function yRe(t){const{projectConfigId:e,codeSectionId:n,diagnostics:r}=t;if(e!==vo.getState().id)return;const i={};for(const s of r){const{sectionId:o,paramInfoId:a,message:l}=s;te.getState().codeInfo[a].ignoreTypeErrors||(o in i||(i[o]={}),a in i[o]||(i[o][a]=[]),i[o][a].push(l))}gp.getState().userRequested&&Vi(ae.size(i)===0?"No type errors":`Found ${ae.size(i)} type errors`),gp.getState().reset(),gp.setState({errors:i})}function bRe(t,e){for(const n of Object.values(e.errors))t in n&&delete n[t]}function xRe(t){const{connections:e}=t,n=e.filter(r=>r.isCLI);n.map(r=>r.websocketId).includes(Qm.getState().connectedTo)||(n.length>0?AT(n[0].websocketId):AT(null)),wRe(e)}function AT(t){Qm.setState({connectedTo:t})}function wRe(t){Qm.setState({connections:t})}let ro;const Rne=ae.debounce(t=>{U$()||(ro=new WebSocket(`${Hp.WEBSOCKET}${Y.ROUTE_WEBSOCKET_MANAGER}`),ro.addEventListener("open",()=>{$ne(t)}),ro.addEventListener("message",e=>{_Re(e.data)}),ro.addEventListener("error",SRe),ro.addEventListener("close",()=>{ro=null,setTimeout(()=>{Rne(t)},3e3)}))},1e3,{leading:!0});function SRe(){ro&&(ro.close(),ro=null)}function U$(){return ro&&ro.readyState===1}function _Re(t){const e=JSON.parse(t);e.messageType===Y.WS_ALL_CONNECTIONS?xRe(e):e.messageType===Y.WS_LSP_DIAGNOSTICS?yRe(e.content):e.messageType===Y.WS_LSP_STATUS?Vi(`Language Server ${e.content.data}`):e.messageType===Y.WS_ARTIFACT||e.messageType===Y.WS_IN_MEMORY_FN_RETURN?Ane(e.content):e.id&&oO(e.id,e.content)}function $ne(t){U$()&&ro.send(JSON.stringify({location:t}))}async function Ay({content:t,id:e,messageType:n}){const r=Qm.getState().connectedTo;U$()&&r&&ro.send(JSON.stringify({id:e,content:t,toWebsocketId:r,messageType:n}))}function kRe(t){y5.setState(e=>ae.omit(e,[t]),!0)}function oO(t,e){y5.setState({[t]:e})}function q$({id:t,condition:e,fn:n}){return new Promise(r=>{const i=t||Kn(),s=y5.subscribe(o=>o[i],o=>{(!e||e(o))&&(s(),r(o),kRe(i))});n==null||n(i)})}async function im({id:t,messageType:e,content:n,condition:r}){return await q$({id:t,condition:r,fn:s=>Ay({id:s,messageType:e,content:n})})}async function Mne(t){const e=i=>oO(i,!0),n=Ine(t);return await q$({id:n,condition:()=>!0,fn:e})}function Ine(t){return`${t}-base64-request`}function Dne(t,e){const n=Ine(t);return y5.subscribe(i=>i[n],i=>{i===!0&&oO(n,Ete(e.current))})}async function CRe(t){let e=!1;return await q$({id:RT(t),condition:n=>(e=n,!0)}),e}function RT(t){return`${t}-delete-request`}function Pi(t){return te.getState().x[t]}function sm(t){return Pi(t).parentId}function dn(t,e){const n=e??te.getState();return n.uiTypes[n.x[t].uiTypeId].type}function Yt(t,e){const n=e??te.getState();return n.variants[n.x[t].variantId]}function B5(t,e=sm){let n=e(t),r=t;for(;n;)r=n,n=e(n);return r}function X$(t,e){let n=e.x[t].parentId;if(!n)return e.x[t].name;let r=t,i="";for(;n;)dn(n,e)===Y.LIST_ROOT?i=`[${Yt(n,e).children.indexOf(t)}]${i}`:i=`["${e.x[r].name}"]${i}`,r=n,n=e.x[n].parentId;return`${e.x[r].name}${i}`}function ERe(t,e){const n=[t];let r=0;for(;r<n.length;){const i=n[r];n.push(...Yt(i,e).children),r+=1}return n}function TRe(t){te.setState(e=>{e.x[t].isHorizontalOrientation=!e.x[t].isHorizontalOrientation})}function PRe(t){te.setState(e=>{e.x[t].positionAndSizeLocked=!e.x[t].positionAndSizeLocked})}function m_(){qf.getState().update(Y$())}function Lne(){te.setState(t=>{for(const e of Object.values(t.x))e.previewVariantId=null})}function H$({sections:t,sectionVariants:e,uiTypes:n,uiTypeCols:r,codeInfo:i,codeInfoCols:s,state:o}){o.x={...o.x,...t},o.variants={...o.variants,...e},o.uiTypes={...o.uiTypes,...n},o.uiTypeCols={...o.uiTypeCols,...r},o.codeInfo={...o.codeInfo,...i},o.codeInfoCols={...o.codeInfoCols,...s}}function Z$(t,e,n,r){e in r.variants[t].values||(r.variants[t].values[e]=Fm()),r.variants[t].values[e].value=n}function $T(t,e,n,r){Z$(r.x[t].variantId,e,n,r)}function Jo(t,e){const n=e??te.getState(),r=Yt(t,n).codeInfoColId;return r?n.codeInfoCols[r]:k5()}function Nne(t,e){const n=e??te.getState();return n.codeInfoCols[Ll(t,n).codeInfoColId]}function Ll(t,e){const n=e??te.getState();return n.variants[z5(t,n)]}function z5(t,e){const n=e??te.getState();return n.x[t].previewVariantId??n.x[t].variantId}function om(t,e,n){const r=Yt(t,n);r.children=e(r.children)}function Qne(t,e,n){const r=Ll(t,e).children;if(n[t]=r,r)for(const i of r)Qne(i,e,n)}function Y$(t,e=!1){const n={},r=t??te.getState();for(const i of Object.values(r.x))i.parentId||(Qne(i.id,r,n),e&&(null in n||(n[null]=[]),n[null].push(i.id)));return n}function ARe(t){const e={},n=t??te.getState();for(const r of Object.values(n.x))e[r.id]=r.parentId;return e}function RRe(t,e){const n=[];for(const r of e.x[t].variantIds)n.push(...e.variants[r].children);return n}function jne(t,e){const n=[...t];let r=0;for(;r<n.length;){const i=RRe(n[r],e),{paramSweepSectionId:s}=e.x[n[r]];i&&n.push(...i),s&&n.push(s),r+=1}return n}function $Re(t){te.setState(e=>{e.variants[t].isFrozen=!e.variants[t].isFrozen})}function MRe(t,e){te.setState(n=>{n.x[t].defaultVariantId=e})}function Bne(t){te.setState(e=>{for(const n of t){const r=e.x[n];r.variantId=r.defaultVariantId}})}function IRe(){Bne(Object.keys(te.getState().x))}function DRe(t,e){const n=Kn(),r=e.codeInfoCols;return r[n]=ae.cloneDeep(r[t]),n}function LRe(t,e,n,r){const i=Kn(),s=r.variants;return s[i]=ae.cloneDeep(s[t]),s[i].name=e,s[i].codeInfoColId=n,s[i].isFrozen=!1,i}function Ry(t,e,n=null){const r=n?e.variants[n]:Ll(t,e),{codeInfoColId:i}=r,s=r.selectedItem;return{codeInfoChildren:i?e.codeInfoCols[i].children:k5().children,parentCodeInfoId:s}}async function NRe(t,e,n){const r=te.getState(),{jsonSource:i}=r.x[t];if(i){const{name:s}=r.variants[e],o=await vPe(s);o.status==200&&(HPe(o.data),await CRe(o.data)&&OF(t,e,n))}else OF(t,e,n)}function OF(t,e,n){te.setState(r=>{const i=r.x[t];i.variantIds=i.variantIds.filter(s=>s!==e),i.defaultVariantId===e&&(i.defaultVariantId=i.variantIds[0]),n&&(i.variantId=i.variantIds[0]),delete r.variants[e]})}const yF={activeId:null,activeIsTopLevel:!1,overId:null,triggerDistCondition:!1,isSorting:!1,isMovingFree:!1,disabled:{},width:null,height:null,times:{}},cn=qr(vn($d(Sn((t,e)=>({...yF,setActive:({id:n,isTopLevel:r,width:i,height:s})=>t({activeId:n,activeIsTopLevel:r,width:i,height:s}),activateSortingMode:()=>t({isSorting:!0,isMovingFree:!1}),activateMovingFreeMode:()=>{t({isMovingFree:!0,isSorting:!1})},deactivate:()=>{t({...yF,disabled:e().disabled}),m_()},setDisabled:(n,r)=>t(i=>{i.disabled[n]=r}),setTime:n=>t(r=>{r.times[n]=Date.now()})}))))),MT="-TempDND";function $y(t){return`${t}${MT}`}function F5(t){return t.slice(-MT.length)===MT}function zne(){return cn(t=>({isSorting:t.isSorting,isMovingFree:t.isMovingFree}),ae.isEqual)}const qf=qr(vn($d(Sn(t=>({x:{},y:{},addChild:({oldParentId:e,newParentId:n,childId:r,index:i})=>t(s=>{e&&(s.x[e]=s.x[e].filter(o=>o!==r)),s.x[n]=[...s.x[n].slice(0,i),r,...s.x[n].slice(i)],s.y[r]=n}),removeChild:e=>t(n=>{const r=n.y[e];r&&(n.x[r]=n.x[r].filter(i=>i!==e),n.y[e]=void 0)}),replaceWithTemp:e=>t(n=>{const r=n.y[e];if(r){const i=n.x[r].indexOf(e),s=$y(e);n.x[r][i]=s,n.y[s]=r,n.y[e]=void 0}}),update:e=>t(n=>{n.x=e,n.y={};for(const[r,i]of Object.entries(e))for(const s of i)n.y[s]=r})})))));function QRe(t){const e=[],n={};for(const o of Object.keys(t.details))if(t.details[o].isTopLevelAndCanHaveEVRefs)if(t.globalVariableId===o)G$(t,o,null,e,n,"",[],!0);else{const a=t.details[o].name;Fne(t,e,n,o,a,[a.length])}if(e.length===0)return{pattern:Jp(),codeAreaPattern:Jp(),fullNameToInfo:n};const r=`(?<![A-Za-z."'_])(${e.join("|")})(?![A-Za-z"'_])`,i=new RegExp(r,"g"),s=new RegExp(`(?<=.*?\\${Y.TEMPLATE_PREFIX}${Y.SETTA_GENERATED_PYTHON}.*?)${r}`,"gs");return{pattern:i,codeAreaPattern:s,fullNameToInfo:n}}function Fne(t,e,n,r,i,s){const o=t.details[r].sectionTypeName;for(const[u,f]of t.details[r].sectionChildren.entries()){const h=t.details[f].name,d=o===Y.LIST_ROOT?`[${u.toString()}]`:`["${h}"]`,p=`${i}${d}`;Fne(t,e,n,f,p,[...s,p.length])}const a=i,l=`${Y.ARGS_PREFIX}${i}`,c=s.map(u=>u+Y.ARGS_PREFIX.length);G$(t,r,t.details[r].selectedItem,e,n,l,c),e.push(o_(a)),n[a]={sectionId:r,paramInfoId:null,componentIndices:s,isArgsObj:!1},o===Y.SECTION&&(e.push(o_(l)),n[l]={sectionId:r,paramInfoId:null,componentIndices:c,isArgsObj:!0})}function G$(t,e,n,r,i,s,o,a=!1){const c=t.details[e].codeInfoChildren[n].map(u=>t.codeInfo[u]);for(const u of c){if(!u.name||u.rcType!==Y.PARAMETER)continue;const f=a?u.name:`${s}["${u.name}"]`,h=[...o,f.length];G$(t,e,u.id,r,i,f,h),r.push(o_(f)),i[f]={sectionId:e,paramInfoId:u.id,componentIndices:h,isArgsObj:!1}}}function Wne(t={}){const{width:e,height:n,d3Zoom:r,d3Selection:i,fitViewOnInitDone:s,fitViewOnInit:o}=qe.getState(),{minZoom:a,maxZoom:l}=Nt.getState().gui,c=t.initial&&!s&&o;if(r&&i&&(c||!t.initial)){const f=Xm().filter(d=>{var p;return(p=t.nodes)!=null&&p.length?t.nodes.some(g=>g.id===d.id):!0}),h=f.every(d=>d.width&&d.height);if(f.length>0&&h){const d=d5(f),{x:p,y:g,zoom:m}=See(d,e,n,t.minZoom??a,t.maxZoom??l,t.padding??.1),v=ou.translate(p,g).scale(m);return typeof t.duration=="number"&&t.duration>0?r.transform(Id(i,t.duration),v):r.transform(i,v),!0}}return!1}function Vne(){if(qe.getState().fitViewOnInit)return;const t=Nt.getState().gui.transitionDuration;Wne({duration:t}),setTimeout(()=>qe.setState({fitViewOnInit:!0}),t+10)}function K$(t){return!t.fitViewOnInit||t.fitViewOnInitDone}function Xm(t=null){return Array.from(t?t.x.values():mr.getState().x.values())}function J$(t){const e=Qd();for(const n of t)e.set(n.id,n);mr.setState({x:e})}function Une(t){const e=Qd();for(const n of t)e.delete(n);mr.setState({x:e})}function qne(t){const{fitViewOnInit:e,fitViewOnInitDone:n,fitViewOnInitOptions:r,domNode:i}=qe.getState();if(!(i==null?void 0:i.querySelector(".react-flow__viewport")))return;const o=Qd();for(const c of t){const u=o.get(c.id);if(u){const f=aEe(c.nodeElement);!!(f.width&&f.height&&(u.width!==f.width||u.height!==f.height||c.forceUpdate))&&o.set(u.id,{...u,...f})}}mr.setState({x:o});const a=Ut.getState();if(a.numInitializedCodeAreas!==a.numDisplayedCodeAreas)return;const l=n||e&&!n&&Wne({initial:!0,...r});qe.setState({fitViewOnInitDone:l})}function Xne(t){const e=Qd();for(const n of t)e.get(n.id).position=n.position;mr.setState({x:e})}function jRe(t){const e=Qd();for(const[,n]of e)n.tempZIndex=n.zIndex;for(const n of t)e.get(n.id).tempZIndex=e.get(n.id).zIndex+1e3;mr.setState({x:e})}function BRe(t,e){const n=Qd();n.get(t).position=e,mr.setState({x:n})}function Qd(){return ae.cloneDeep(mr.getState().x)}function Hne(t,e){if(e)return t.map(i=>({id:i.target.getAttribute("data-id"),nodeElement:i.target,forceUpdate:!0}));const n=[],r=ka.getState().withNested;return t.forEach(i=>{r[i]&&n.push({id:i,nodeElement:r[i],forceUpdate:!0})}),n}async function zRe(t,e,n){return await jt({body:{codeAreaReplacements:t,codeInfoReplacements:e,paramEVReplacements:n},address:Y.ROUTE_MAKE_EV_REF_TEMPLATE_VAR_REPLACEMENTS})}function FRe(){const t={},e={},n={},r=te.getState(),i=Tte();let s=!1,o=!1;for(const a of Object.keys(te.getState().variants))o=WRe(a,t,e,n,r,i),s||(s=o),o=VRe(a,t,r),s||(s=o);return[t,e,n,s]}function WRe(t,e,n,r,i,s){let o,a,l=!1;const c=i.variants[t];for(const u of c.evRefs)o=Zne(e,t,i),a=$6(u,s,o),l||(l=a);if(c.selectedItem){const u=c.selectedItem;for(const f of i.codeInfo[u].evRefs)o=qRe(n,u,i),a=$6(f,s,o),l||(l=a)}for(const[u,f]of Object.entries(c.values))for(const h of f.evRefs)o=URe(r,t,u,i),a=$6(h,s,o),l||(l=a);return l}function $6(t,e,n){const r=e[Pte(t)];return n.replacements.push({originalEVRef:t,newName:r}),t.keyword!==r}function VRe(t,e,n){let r,i=!1;for(const s of n.variants[t].templateVars)if(r=Zne(e,t,n),s.sectionId){const o=Object.values(n.x).find(a=>a.id===s.sectionId);if(o){const a=aAe(s.keyword),l=`${s$(X$(o.id,n))}${a}`;r.replacements.push({originalTemplateVar:s,newName:l}),s.keyword!==l&&(i=!0)}}else r.replacements.push({originalTemplateVar:s,newName:s.keyword});return i}function eM(t){return{string:t,replacements:[]}}function URe(t,e,n,r){return e in t||(t[e]={}),n in t[e]||(t[e][n]=eM(r.variants[e].values[n].value)),t[e][n]}function qRe(t,e,n){return e in t||(t[e]=eM(n.codeInfo[e].name)),t[e]}function Zne(t,e,n){return e in t||(t[e]=eM(n.variants[e].code)),t[e]}async function XRe(){const t=Nt.getState().backend.renameReferencesOnSectionMoveMode;if(t===G1.NEVER_RENAME)return;const[e,n,r,i]=FRe();i&&(t===G1.ALWAYS_ASK?XPe(e,n,r):t===G1.ALWAYS_RENAME&&await Yne(e,n,r))}async function Yne(t,e,n){const r=await zRe(t,e,n);if(r.status===200){const{newCodeAreaValues:i,newCodeInfoValues:s,newParamEVValues:o}=r.data;te.setState(a=>{let l;for(const[c,u]of Object.entries(i))l=a.variants[c],l.code=u[0],l.evRefs=u[1],l.templateVars=u[2];for(const[c,u]of Object.entries(s))l=a.codeInfo[c],l.name=u[0],l.evRefs=u[1];for(const[c,u]of Object.entries(o))for(const[f,h]of Object.entries(u))l=a.variants[c].values[f],l.value=h[0],l.evRefs=h[1]})}}const tM=[Y.SECTION,Y.LIST_ROOT,Y.DICT_ROOT,Y.GROUP,Y.GLOBAL_VARIABLES,Y.CODE];function Gne(t,e){e.variants[t].runGroup={sections:{}};for(const n of mr.getState().x.keys())tM.includes(dn(n))&&W5(t,n,null,e)}function HRe(t,e){te.setState(n=>{const r=n.x[t].selectedVariantIds;e in r?delete r[e]:r[e]=!0})}function Kne(t,e,n){return{selected:!0,paramSweeps:{},versions:{[e??n.x[t].variantId]:!0}}}function W5(t,e,n,r,i=null){let s=!1;return e in r.variants[t].runGroup||(r.variants[t].runGroup[e]={},Jne(t,i??r.x[e].variantId,r),s=!0),n in r.variants[t].runGroup[e]||(r.variants[t].runGroup[e][n]=Kne(e,i,r),s=!0),s}function Jne(t,e,n){for(const r of n.variants[e].children)W5(t,r,e,n)}function ZRe(t,e,n){for(const[r,i]of e.entries()){const s=r===0?null:e[r-1].variantId;W5(t,i.id,s,n);const o=n.variants[t].runGroup[i.id][s];o.versions[i.variantId]=!0,o.selected=!0}}function YRe(t,e,n){var r;for(const[i,s]of e.entries()){const o=i===0?null:e[i-1].variantId;if(!((r=n.variants[t].runGroup[s.id])!=null&&r[o].versions[s.variantId])||!ere(t,s.id,o,n))return!1}return!0}function ere(t,e,n,r){var i;return(i=r.variants[t].runGroup[e])==null?void 0:i[n].selected}function nM({runGroupId:t,ancestors:e,sectionId:n,attrName:r,attrId:i,parentVariantId:s}){te.setState(o=>{const a=W5(t,n,s,o,r==="versions"?i:null);let l;const c=o.variants[t].runGroup[n][s];if(!a&&YRe(t,e,o)&&(r==="selected"||ere(t,n,s,o))?l=i?!c[r][i]:!c[r]:l=!0,i?c[r][i]=l:c[r]=l,l&&(c.selected=!0,ZRe(t,e,o),r==="selected"||r==="versions")){const u=r==="versions"?i:o.x[n].variantId;Jne(t,u,o)}})}function GRe({id:t,ancestors:e,sectionId:n,parentVariantId:r}){nM({runGroupId:t,ancestors:e,sectionId:n,attrName:"selected",parentVariantId:r})}function KRe({id:t,paramSweepId:e,ancestors:n,sectionId:r,parentVariantId:i}){nM({runGroupId:t,ancestors:n,sectionId:r,attrName:"paramSweeps",attrId:e,parentVariantId:i})}function JRe({id:t,versionId:e,ancestors:n,sectionId:r,parentVariantId:i}){nM({runGroupId:t,ancestors:n,sectionId:r,attrName:"versions",attrId:e,parentVariantId:i})}function e$e(t){return te(e=>{const n=[];for(const r of e.variants[t].children)tM.includes(e.uiTypes[e.x[r].uiTypeId].type)&&n.push({id:r,name:e.x[r].name});return n},ae.isEqual)}function t$e(){return te(t=>{const e=[];for(const[n,r]of Object.entries(t.x))!r.parentId&&tM.includes(t.uiTypes[t.x[n].uiTypeId].type)&&e.push({id:n,name:r.name});return e},ae.isEqual)}function n$e(t,e){te.setState(n=>{const r=n.singletonSections[Y.GLOBAL_PARAM_SWEEP];if(r)for(const[i,s]of Object.entries(t)){if(!(i in e)||s===e[i])continue;const{variantIds:o}=n.x[r];for(const a of o){const l=n.variants[a].runGroup;if(!(i in l))continue;const c=s?n.x[s].variantIds:[null];for(const u of c)l[i][u]=Kne(i,void 0,n)}}})}function r$e(t){const e=[Y.SETTA_GENERATED_PYTHON,Y.SETTA_GENERATED_PYTHON_IMPORTS],n={};for(const a of e)n[a]=null;const r=te.getState();for(const[a,l]of Object.entries(t.templateVarEligibleSections)){const c=X$(a,r);for(const u of l){const f=c+`${Y.TEMPLATE_PREFIX}${u}`;e.push(o_(f)),n[f]=a}}const i=ae.mapKeys(n,(a,l)=>s$(l));if(e.length===0)return{pattern:Jp(),fullNameToSectionId:i};const s=`(?<![A-Za-z."'_])\\${Y.TEMPLATE_PREFIX}(${e.join("|")})(?![A-Za-z"'_])`;return{pattern:new RegExp(s,"g"),fullNameToSectionId:i}}function i$e(){te.subscribe(s$e,t=>{te.setState(e=>{e.singletonSections=t})},{equalityFn:ae.isEqual}),te.subscribe(o$e,t=>{Dd.setState(QRe(t)),O5.setState(r$e(t)),te.getState().shouldRenameReferences&&(te.setState({shouldRenameReferences:!1}),XRe())},{equalityFn:ae.isEqual}),te.subscribe(Y$,t=>{qf.getState().update(t)},{equalityFn:ae.isEqual}),te.subscribe(ARe,(t,e)=>{n$e(t,e)},{equalityFn:ae.isEqual}),qe.subscribe(a$e,(t,e)=>{e.fitViewOnInit&&e.fitViewOnInitDone&&t.fitViewOnInit&&t.fitViewOnInitDone&&qe.setState({fitViewOnInit:!1}),window.reactFlowZoom=t.transform[2]},{equalityFn:ae.isEqual}),Ut.subscribe(l$e,t=>{t&&(qne(Hne(mr.getState().x.keys(),!1)),Ut.setState({requestUpdateNodeDimensions:!1}))},{equalityFn:ae.isEqual}),Ut.subscribe(t=>t.undoOrRedoWasTriggered,t=>{t&&Ut.setState(e=>({updateDrawAreas:e.updateDrawAreas+1,undoOrRedoWasTriggered:!1}))}),ti.subscribe(c$e,t=>{ti.setState(()=>{const e={};for(const[n,r]of Object.entries(t))e[S$(r)]=n;return{namePathTypeToId:e}})},{equalityFn:ae.isEqual})}function s$e(t){var n;const e={[Y.GLOBAL_VARIABLES]:null,[Y.GLOBAL_PARAM_SWEEP]:null,inMemoryFnStdoutTerminal:null};for(const r of Object.values(t.x)){const i=(n=t.uiTypes[r.uiTypeId])==null?void 0:n.type;if(e[Y.GLOBAL_VARIABLES]&&e[Y.GLOBAL_PARAM_SWEEP]&&e.inMemoryFnStdoutTerminal&&e.temporaryTerminalGroup)break;!e[Y.GLOBAL_VARIABLES]&&i===Y.GLOBAL_VARIABLES&&(e[Y.GLOBAL_VARIABLES]=r.id),!e[Y.GLOBAL_PARAM_SWEEP]&&i===Y.GLOBAL_PARAM_SWEEP&&(e[Y.GLOBAL_PARAM_SWEEP]=r.id),!e.inMemoryFnStdoutTerminal&&i===Y.TERMINAL&&r.isReadOnlyTerminal&&(e.inMemoryFnStdoutTerminal=r.id),!e.temporaryTerminalGroup&&i===Y.GROUP&&r.isTemporary&&(e.temporaryTerminalGroup=r.id)}return e}function o$e(t){const e={details:{},codeInfo:ae.mapValues(t.codeInfo,i=>({id:i.id,name:i.name,rcType:i.rcType})),globalVariableId:t.singletonSections[Y.GLOBAL_VARIABLES],templateVarEligibleSections:{}};let n,r;for(const[i,s]of Object.entries(t.x))n=Yt(i,t),r=dn(i,t),e.details[i]={name:s.name,sectionChildren:n.children,codeInfoChildren:Jo(i,t).children,sectionTypeName:r,selectedItem:n.selectedItem,isTopLevelAndCanHaveEVRefs:!s.parentId&&[Y.GLOBAL_VARIABLES,Y.SECTION,Y.LIST_ROOT,Y.DICT_ROOT,Y.GROUP].includes(r)},r===Y.CODE?e.templateVarEligibleSections[i]=[Y.TEMPLATE_VAR_VERSION_SUFFIX,Y.TEMPLATE_VAR_IMPORT_PATH_SUFFIX,Y.TEMPLATE_VAR_FILE_PATH_SUFFIX]:e.templateVarEligibleSections[i]=[Y.TEMPLATE_VAR_VERSION_SUFFIX];return e}function a$e(t){return{transform:t.transform,fitViewOnInit:t.fitViewOnInit,fitViewOnInitDone:t.fitViewOnInitDone}}function l$e(t){return t.undoOrRedoWasTriggered||t.requestUpdateNodeDimensions}function c$e(t){const e={};for(const[n,r]of Object.entries(t.x))e[n]={name:r.name,path:r.path,type:r.type};return e}function Ee(){return Ee=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ee.apply(this,arguments)}function gt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function u$e(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function tre(...t){return e=>t.forEach(n=>u$e(n,e))}function In(...t){return _.useCallback(tre(...t),t)}function Oo(t,e=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(f){const{scope:h,children:d,...p}=f,g=(h==null?void 0:h[t][l])||a,m=_.useMemo(()=>p,Object.values(p));return _.createElement(g.Provider,{value:m},d)}function u(f,h){const d=(h==null?void 0:h[t][l])||a,p=_.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return _.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,f$e(i,...e)]}function f$e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function $a(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Nl({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=h$e({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=$a(n),l=_.useCallback(c=>{if(s){const f=typeof c=="function"?c(t):c;f!==t&&a(f)}else i(c)},[s,t,i,a]);return[o,l]}function h$e({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,i=_.useRef(r),s=$a(e);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function rM(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Pc=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function V5(t){const[e,n]=_.useState(void 0);return Pc(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const am=_.forwardRef((t,e)=>{const{children:n,...r}=t,i=_.Children.toArray(n),s=i.find(p$e);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(IT,Ee({},r,{ref:e}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(IT,Ee({},r,{ref:e}),n)});am.displayName="Slot";const IT=_.forwardRef((t,e)=>{const{children:n,...r}=t;return _.isValidElement(n)?_.cloneElement(n,{...m$e(r,n.props),ref:tre(e,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});IT.displayName="SlotClone";const d$e=({children:t})=>_.createElement(_.Fragment,null,t);function p$e(t){return _.isValidElement(t)&&t.type===d$e}function m$e(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}const g$e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],gn=g$e.reduce((t,e)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?am:e;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,Ee({},o,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function nre(t,e){t&&Qi.flushSync(()=>t.dispatchEvent(e))}const rre="Switch",[v$e,J7t]=Oo(rre),[O$e,y$e]=v$e(rre),b$e=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:c,...u}=t,[f,h]=_.useState(null),d=In(e,y=>h(y)),p=_.useRef(!1),g=f?!!f.closest("form"):!0,[m=!1,v]=Nl({prop:i,defaultProp:s,onChange:c});return _.createElement(O$e,{scope:n,checked:m,disabled:a},_.createElement(gn.button,Ee({type:"button",role:"switch","aria-checked":m,"aria-required":o,"data-state":ire(m),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:d,onClick:gt(t.onClick,y=>{v(b=>!b),g&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),g&&_.createElement(S$e,{control:f,bubbles:!p.current,name:r,value:l,checked:m,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),x$e="SwitchThumb",w$e=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=y$e(x$e,n);return _.createElement(gn.span,Ee({"data-state":ire(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),S$e=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=_.useRef(null),o=rM(n),a=V5(e);return _.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),_.createElement("input",Ee({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ire(t){return t?"checked":"unchecked"}const _$e=b$e,k$e=w$e;function iM(t){const{twRootClasses:e="",twThumbClasses:n="",icon:r,disableBg:i=!1,height:s,width:o,children:a,...l}=t,c=`items-center p-[0.2rem] w-7 min-w-7 ${s||"h-2.5"} bg-setta-400 dark:bg-setta-600 rounded-full relative inline-flex cursor-pointer [-webkit-tap-highlight-color:rgba(0,_0,_0,_0)] focus-visible:shadow-black data-[state='checked']:bg-blue-500 dark:data-[state='checked']:bg-blue-700 focus-visible:ring-2 ${e} disabled:pointer-events-none`,u=`block ${o||"w-2.5"} ${s||"h-2.5"} ${!i&&"bg-white dark:bg-setta-800"} rounded-full transition-all will-change-transform data-[state='checked']:translate-x-4 ${n}`;return x.jsx(_$e,{className:c,...l,children:x.jsx(k$e,{className:u,children:r})})}var sre={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},bF=ke.createContext&&ke.createContext(sre),C$e=["attr","size","title"];function E$e(t,e){if(t==null)return{};var n=T$e(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function T$e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function g_(){return g_=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g_.apply(this,arguments)}function xF(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function v_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xF(Object(n),!0).forEach(function(r){P$e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function P$e(t,e,n){return e=A$e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A$e(t){var e=R$e(t,"string");return typeof e=="symbol"?e:e+""}function R$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ore(t){return t&&t.map((e,n)=>ke.createElement(e.tag,v_({key:n},e.attr),ore(e.child)))}function ft(t){return e=>ke.createElement($$e,g_({attr:v_({},t.attr)},e),ore(t.child))}function $$e(t){var e=n=>{var{attr:r,size:i,title:s}=t,o=E$e(t,C$e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),ke.createElement("svg",g_({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:v_(v_({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&ke.createElement("title",null,s),t.children)};return bF!==void 0?ke.createElement(bF.Consumer,null,n=>e(n)):e(sre)}function M$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"},child:[]}]})(t)}function are(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"},child:[]}]})(t)}function sM(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},child:[]}]})(t)}function I$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"},child:[]}]})(t)}function D$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"},child:[]}]})(t)}function U5(t){return ft({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},child:[]}]})(t)}function L$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.04932 12.9999H7.52725C7.70624 16.2688 8.7574 19.3053 10.452 21.8809C5.98761 21.1871 2.5001 17.5402 2.04932 12.9999ZM2.04932 10.9999C2.5001 6.45968 5.98761 2.81276 10.452 2.11902C8.7574 4.69456 7.70624 7.73111 7.52725 10.9999H2.04932ZM21.9506 10.9999H16.4726C16.2936 7.73111 15.2425 4.69456 13.5479 2.11902C18.0123 2.81276 21.4998 6.45968 21.9506 10.9999ZM21.9506 12.9999C21.4998 17.5402 18.0123 21.1871 13.5479 21.8809C15.2425 19.3053 16.2936 16.2688 16.4726 12.9999H21.9506ZM9.53068 12.9999H14.4692C14.2976 15.7828 13.4146 18.3732 11.9999 20.5915C10.5852 18.3732 9.70229 15.7828 9.53068 12.9999ZM9.53068 10.9999C9.70229 8.21709 10.5852 5.62672 11.9999 3.40841C13.4146 5.62672 14.2976 8.21709 14.4692 10.9999H9.53068Z"},child:[]}]})(t)}function N$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 6H16V8H21C21.5523 8 22 8.44772 22 9V16.5L16 13L16.0359 21.0622L18.2592 18.9129L20.041 22H9C8.44772 22 8 21.5523 8 21V16H6V14H8V9C8 8.44772 8.44772 8 9 8H14V6ZM22 17.338V21C22 21.107 21.9832 21.2101 21.9521 21.3068L19.9913 17.9129L22 17.338ZM4 14V16H2V14H4ZM4 10V12H2V10H4ZM4 6V8H2V6H4ZM4 2V4H2V2H4ZM8 2V4H6V2H8ZM12 2V4H10V2H12ZM16 2V4H14V2H16Z"},child:[]}]})(t)}function lre(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7.75194 5.43872L18.2596 11.5682C18.4981 11.7073 18.5787 12.0135 18.4396 12.252C18.3961 12.3265 18.3341 12.3885 18.2596 12.432L7.75194 18.5615C7.51341 18.7006 7.20725 18.62 7.06811 18.3815C7.0235 18.305 7 18.2181 7 18.1296V5.87061C7 5.59446 7.22386 5.37061 7.5 5.37061C7.58853 5.37061 7.67547 5.39411 7.75194 5.43872Z"},child:[]}]})(t)}function Q$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z"},child:[]}]})(t)}function q5(t){const[e,n]=t;n(!e)}function j$e(){q5(Ot.darkMode.state())}function B$e(){q5(Ot.showMinimap.state())}function z$e(){q5(Ot.projectConfigPreviewEnabled.state())}function F$e(){q5(Ot.snapToGrid.state())}function W$e(){const[t,e]=Ot.showNavBarHelpMessage.hook(),n=Nt(r=>Br(r.shortcuts.showTooltipShortcut));return t&&x.jsx("aside",{className:"ml-auto mr-4 flex items-center gap-2",children:x.jsxs("div",{className:"hidden items-center gap-2 lg:flex",children:[x.jsxs("p",{className:"text-xs font-bold text-setta-400 dark:text-setta-500",children:['Hold down "',n,'" to see tool tips']}),x.jsx("button",{className:"flex cursor-pointer items-center text-setta-300 hover:text-setta-700 dark:text-setta-500 dark:hover:text-setta-400",onClick:()=>e(!1),children:x.jsx("i",{className:"gg-close"})})]})})}function V$e(){const t=U$e();return x.jsxs("div",{className:"flex flex-1 items-center justify-end",children:[x.jsx(W$e,{}),x.jsx(iM,{checked:t,onCheckedChange:j$e,twThumbClasses:"flex",disableBg:!0,height:"h-3",width:"w-3",icon:t?x.jsx(I$e,{className:"h-3 text-blue-200"}):x.jsx(Q$e,{className:"h-3 text-white"})})]})}function U$e(){const[t]=Ot.darkMode.hook();return _.useEffect(()=>{t?document.querySelector("html").classList.add("dark"):document.querySelector("html").classList.remove("dark")},[t]),t}function q$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.105 4.561l-3.43 3.427-1.134-1.12 2.07-2.08h-4.8a2.4 2.4 0 1 0 0 4.8h.89v1.6h-.88a4 4 0 0 1 0-7.991h4.8L6.54 1.13 7.675 0l3.43 3.432v1.13zM16.62 24h-9.6l-.8-.8V10.412l.8-.8h9.6l.8.8V23.2l-.8.8zm-8.8-1.6h8V11.212h-8V22.4zm5.6-20.798h9.6l.8.8v12.786l-.8.8h-4v-1.6h3.2V3.2h-8v4.787h-1.6V2.401l.8-.8zm.8 11.186h-4.8v1.6h4.8v-1.6zm-4.8 3.2h4.8v1.6h-4.8v-1.6zm4.8 3.2h-4.8v1.6h4.8v-1.6zm1.6-14.4h4.8v1.6h-4.8v-1.6zm4.8 6.4h-1.6v1.6h1.6v-1.6zm-3.338-3.176v-.024h3.338v1.6h-1.762l-1.576-1.576z"},child:[]}]})(t)}function wF(t){return ft({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(t)}function cre(t){return ft({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.353 1.146l1.5 1.5L15 3v11.5l-.5.5h-13l-.5-.5v-13l.5-.5H13l.353.146zM2 2v12h12V3.208L12.793 2H11v4H4V2H2zm6 0v3h2V2H8z"},child:[]}]})(t)}function X$e(){const t=pT(e=>e.message);return t&&x.jsxs(x.Fragment,{children:[x.jsx(cre,{className:"ml-4 h-3 w-3 text-setta-400 dark:text-setta-50"}),x.jsx("p",{className:"ml-2 self-center text-xs text-setta-500 dark:text-setta-100",children:t})]})}function Hm(t){const e=t+"CollectionProvider",[n,r]=Oo(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=d=>{const{scope:p,children:g}=d,m=ke.useRef(null),v=ke.useRef(new Map).current;return ke.createElement(i,{scope:p,itemMap:v,collectionRef:m},g)},a=t+"CollectionSlot",l=ke.forwardRef((d,p)=>{const{scope:g,children:m}=d,v=s(a,g),y=In(p,v.collectionRef);return ke.createElement(am,{ref:y},m)}),c=t+"CollectionItemSlot",u="data-radix-collection-item",f=ke.forwardRef((d,p)=>{const{scope:g,children:m,...v}=d,y=ke.useRef(null),b=In(p,y),S=s(c,g);return ke.useEffect(()=>(S.itemMap.set(y,{ref:y,...v}),()=>void S.itemMap.delete(y))),ke.createElement(am,{[u]:"",ref:b},m)});function h(d){const p=s(t+"CollectionConsumer",d);return ke.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const v=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,k)=>v.indexOf(S.ref.current)-v.indexOf(k.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},h,r]}const H$e=_.createContext(void 0);function jd(t){const e=_.useContext(H$e);return t||e||"ltr"}const Z$e=Dp["useId".toString()]||(()=>{});let Y$e=0;function ff(t){const[e,n]=_.useState(Z$e());return Pc(()=>{t||n(r=>r??String(Y$e++))},[t]),t||(e?`radix-${e}`:"")}function G$e(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const DT="dismissableLayer.update",K$e="dismissableLayer.pointerDownOutside",J$e="dismissableLayer.focusOutside";let SF;const eMe=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ure=_.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=t,u=_.useContext(eMe),[f,h]=_.useState(null),d=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),g=In(e,C=>h(C)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=f?m.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,E=tMe(C=>{const A=C.target,R=[...u.branches].some(Q=>Q.contains(A));!k||R||(s==null||s(C),a==null||a(C),C.defaultPrevented||l==null||l())},d),T=nMe(C=>{const A=C.target;[...u.branches].some(Q=>Q.contains(A))||(o==null||o(C),a==null||a(C),C.defaultPrevented||l==null||l())},d);return G$e(C=>{b===u.layers.size-1&&(i==null||i(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},d),_.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(SF=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),_F(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=SF)}},[f,d,r,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),_F())},[f,u]),_.useEffect(()=>{const C=()=>p({});return document.addEventListener(DT,C),()=>document.removeEventListener(DT,C)},[]),_.createElement(gn.div,Ee({},c,{ref:g,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:gt(t.onFocusCapture,T.onFocusCapture),onBlurCapture:gt(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:gt(t.onPointerDownCapture,E.onPointerDownCapture)}))});function tMe(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){fre(K$e,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function nMe(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&fre(J$e,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _F(){const t=new CustomEvent(DT);document.dispatchEvent(t)}function fre(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?nre(i,s):i.dispatchEvent(s)}let M6=0;function hre(){_.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:kF()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:kF()),M6++,()=>{M6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),M6--}},[])}function kF(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const I6="focusScope.autoFocusOnMount",D6="focusScope.autoFocusOnUnmount",CF={bubbles:!1,cancelable:!0},dre=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=_.useState(null),c=$a(i),u=$a(s),f=_.useRef(null),h=In(e,g=>l(g)),d=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(d.paused||!a)return;const S=b.target;a.contains(S)?f.current=S:Eh(f.current,{select:!0})},y=function(b){d.paused||!a||a.contains(b.relatedTarget)||Eh(f.current,{select:!0})};var g=v,m=y;return document.addEventListener("focusin",v),document.addEventListener("focusout",y),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y)}}},[r,a,d.paused]),_.useEffect(()=>{if(a){TF.add(d);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(I6,CF);a.addEventListener(I6,c),a.dispatchEvent(v),v.defaultPrevented||(rMe(lMe(pre(a)),{select:!0}),document.activeElement===g&&Eh(a))}return()=>{a.removeEventListener(I6,c),setTimeout(()=>{const v=new CustomEvent(D6,CF);a.addEventListener(D6,u),a.dispatchEvent(v),v.defaultPrevented||Eh(g??document.body,{select:!0}),a.removeEventListener(D6,u),TF.remove(d)},0)}}},[a,c,u,d]);const p=_.useCallback(g=>{if(!n&&!r||d.paused)return;const m=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(m&&v){const y=g.currentTarget,[b,S]=iMe(y);b&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Eh(b,{select:!0})):g.shiftKey&&v===b&&(g.preventDefault(),n&&Eh(S,{select:!0})):v===y&&g.preventDefault()}},[n,r,d.paused]);return _.createElement(gn.div,Ee({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function rMe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Eh(r,{select:e}),document.activeElement!==n)return}function iMe(t){const e=pre(t),n=EF(e,t),r=EF(e.reverse(),t);return[n,r]}function pre(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function EF(t,e){for(const n of t)if(!sMe(n,{upTo:e}))return n}function sMe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oMe(t){return t instanceof HTMLInputElement&&"select"in t}function Eh(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&oMe(t)&&e&&t.select()}}const TF=aMe();function aMe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=PF(t,e),t.unshift(e)},remove(e){var n;t=PF(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function PF(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function lMe(t){return t.filter(e=>e.tagName!=="A")}function Bd(t){return t.split("-")[0]}function My(t){return t.split("-")[1]}function Zm(t){return["top","bottom"].includes(Bd(t))?"x":"y"}function oM(t){return t==="y"?"height":"width"}function AF(t,e,n){let{reference:r,floating:i}=t;const s=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,a=Zm(e),l=oM(a),c=r[l]/2-i[l]/2,u=a==="x";let f;switch(Bd(e)){case"top":f={x:s,y:r.y-i.height};break;case"bottom":f={x:s,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(My(e)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(n&&u?-1:1)}return f}const cMe=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:u}=AF(l,r,a),f=r,h={},d=0;for(let p=0;p<s.length;p++){const{name:g,fn:m}=s[p],{x:v,y,data:b,reset:S}=await m({x:c,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:l,platform:o,elements:{reference:t,floating:e}});c=v??c,u=y??u,h={...h,[g]:{...h[g],...b}},S&&d<=50&&(d++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(l=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:c,y:u}=AF(l,f,a)),p=-1)}return{x:c,y:u,placement:f,strategy:i,middlewareData:h}};function mre(t){return typeof t!="number"?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(t):{top:t,right:t,bottom:t,left:t}}function O_(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function aO(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=e,p=mre(d),g=a[h?f==="floating"?"reference":"floating":f],m=O_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=O_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...o.floating,x:r,y:i}:o.reference,offsetParent:await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),strategy:l}):o[f]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const uMe=Math.min,Th=Math.max;function LT(t,e,n){return Th(t,uMe(e,n))}const RF=t=>({name:"arrow",options:t,async fn(e){const{element:n,padding:r=0}=t??{},{x:i,y:s,placement:o,rects:a,platform:l}=e;if(n==null)return{};const c=mre(r),u={x:i,y:s},f=Zm(o),h=My(o),d=oM(f),p=await l.getDimensions(n),g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=a.reference[d]+a.reference[f]-u[f]-a.floating[d],y=u[f]-a.reference[f],b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let S=b?f==="y"?b.clientHeight||0:b.clientWidth||0:0;S===0&&(S=a.floating[d]);const k=v/2-y/2,E=c[g],T=S-p[d]-c[m],C=S/2-p[d]/2+k,A=LT(E,C,T),R=(h==="start"?c[g]:c[m])>0&&C!==A&&a.reference[d]<=a.floating[d];return{[f]:u[f]-(R?C<E?E-C:T-C:0),data:{[f]:A,centerOffset:C-A}}}}),fMe={left:"right",right:"left",bottom:"top",top:"bottom"};function y_(t){return t.replace(/left|right|bottom|top/g,e=>fMe[e])}function hMe(t,e,n){n===void 0&&(n=!1);const r=My(t),i=Zm(t),s=oM(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=y_(o)),{main:o,cross:y_(o)}}const dMe={start:"end",end:"start"};function $F(t){return t.replace(/start|end/g,e=>dMe[e])}const gre=["top","right","bottom","left"];gre.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);const pMe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:i,rects:s,initialPlacement:o,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",flipAlignment:d=!0,...p}=t,g=Bd(r),m=f||(g===o||!d?[y_(o)]:function(C){const A=y_(C);return[$F(C),A,$F(A)]}(o)),v=[o,...m],y=await aO(e,p),b=[];let S=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:C,cross:A}=hMe(r,s,await(a.isRTL==null?void 0:a.isRTL(l.floating)));b.push(y[C],y[A])}if(S=[...S,{placement:r,overflows:b}],!b.every(C=>C<=0)){var k,E;const C=((k=(E=i.flip)==null?void 0:E.index)!=null?k:0)+1,A=v[C];if(A)return{data:{index:C,overflows:S},reset:{placement:A}};let R="bottom";switch(h){case"bestFit":{var T;const Q=(T=S.map(L=>[L,L.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((L,z)=>L[1]-z[1])[0])==null?void 0:T[0].placement;Q&&(R=Q);break}case"initialPlacement":R=o}if(r!==R)return{reset:{placement:R}}}return{}}}};function MF(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IF(t){return gre.some(e=>t[e]>=0)}const mMe=function(t){let{strategy:e="referenceHidden",...n}=t===void 0?{}:t;return{name:"hide",async fn(r){const{rects:i}=r;switch(e){case"referenceHidden":{const s=MF(await aO(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:IF(s)}}}case"escaped":{const s=MF(await aO(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:s,escaped:IF(s)}}}default:return{}}}}},gMe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,i=await async function(s,o){const{placement:a,platform:l,elements:c}=s,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Bd(a),h=My(a),d=Zm(a)==="x",p=["left","top"].includes(f)?-1:1,g=u&&d?-1:1,m=typeof o=="function"?o(s):o;let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return h&&typeof b=="number"&&(y=h==="end"?-1*b:b),d?{x:y*g,y:v*p}:{x:v*p,y:y*g}}(e,t);return{x:n+i.x,y:r+i.y,data:i}}}};function vre(t){return t==="x"?"y":"x"}const vMe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=t,c={x:n,y:r},u=await aO(e,l),f=Zm(Bd(i)),h=vre(f);let d=c[f],p=c[h];if(s){const m=f==="y"?"bottom":"right";d=LT(d+u[f==="y"?"top":"left"],d,d-u[m])}if(o){const m=h==="y"?"bottom":"right";p=LT(p+u[h==="y"?"top":"left"],p,p-u[m])}const g=a.fn({...e,[f]:d,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},OMe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=t,u={x:n,y:r},f=Zm(i),h=vre(f);let d=u[f],p=u[h];const g=typeof a=="function"?a({...s,placement:i}):a,m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const k=f==="y"?"height":"width",E=s.reference[f]-s.floating[k]+m.mainAxis,T=s.reference[f]+s.reference[k]-m.mainAxis;d<E?d=E:d>T&&(d=T)}if(c){var v,y,b,S;const k=f==="y"?"width":"height",E=["top","left"].includes(Bd(i)),T=s.reference[h]-s.floating[k]+(E&&(v=(y=o.offset)==null?void 0:y[h])!=null?v:0)+(E?0:m.crossAxis),C=s.reference[h]+s.reference[k]+(E?0:(b=(S=o.offset)==null?void 0:S[h])!=null?b:0)-(E?m.crossAxis:0);p<T?p=T:p>C&&(p=C)}return{[f]:d,[h]:p}}}},yMe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:o,...a}=t,l=await aO(e,a),c=Bd(n),u=My(n);let f,h;c==="top"||c==="bottom"?(f=c,h=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(h=c,f=u==="end"?"top":"bottom");const d=Th(l.left,0),p=Th(l.right,0),g=Th(l.top,0),m=Th(l.bottom,0),v={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(g!==0||m!==0?g+m:Th(l.top,l.bottom)):l[f]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(d!==0||p!==0?d+p:Th(l.left,l.right)):l[h])},y=await i.getDimensions(s.floating);o==null||o({...e,...v});const b=await i.getDimensions(s.floating);return y.width!==b.width||y.height!==b.height?{reset:{rects:!0}}:{}}}};function Ore(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function lu(t){if(t==null)return window;if(!Ore(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function Iy(t){return lu(t).getComputedStyle(t)}function Lc(t){return Ore(t)?"":t?(t.nodeName||"").toLowerCase():""}function yre(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function Tl(t){return t instanceof lu(t).HTMLElement}function _f(t){return t instanceof lu(t).Element}function aM(t){return typeof ShadowRoot>"u"?!1:t instanceof lu(t).ShadowRoot||t instanceof ShadowRoot}function X5(t){const{overflow:e,overflowX:n,overflowY:r}=Iy(t);return/auto|scroll|overlay|hidden/.test(e+r+n)}function bMe(t){return["table","td","th"].includes(Lc(t))}function DF(t){const e=/firefox/i.test(yre()),n=Iy(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&!!n.filter&&n.filter!=="none"}function bre(){return!/^((?!chrome|android).)*safari/i.test(yre())}const LF=Math.min,nv=Math.max,b_=Math.round;function Nc(t,e,n){var r,i,s,o;e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect();let l=1,c=1;e&&Tl(t)&&(l=t.offsetWidth>0&&b_(a.width)/t.offsetWidth||1,c=t.offsetHeight>0&&b_(a.height)/t.offsetHeight||1);const u=_f(t)?lu(t):window,f=!bre()&&n,h=(a.left+(f&&(r=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,d=(a.top+(f&&(s=(o=u.visualViewport)==null?void 0:o.offsetTop)!=null?s:0))/c,p=a.width/l,g=a.height/c;return{width:p,height:g,top:d,right:h+p,bottom:d+g,left:h,x:h,y:d}}function hf(t){return(e=t,(e instanceof lu(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function H5(t){return _f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function xre(t){return Nc(hf(t)).left+H5(t).scrollLeft}function xMe(t,e,n){const r=Tl(e),i=hf(e),s=Nc(t,r&&function(l){const c=Nc(l);return b_(c.width)!==l.offsetWidth||b_(c.height)!==l.offsetHeight}(e),n==="fixed");let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Lc(e)!=="body"||X5(i))&&(o=H5(e)),Tl(e)){const l=Nc(e,!0);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else i&&(a.x=xre(i));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}function wre(t){return Lc(t)==="html"?t:t.assignedSlot||t.parentNode||(aM(t)?t.host:null)||hf(t)}function NF(t){return Tl(t)&&getComputedStyle(t).position!=="fixed"?t.offsetParent:null}function NT(t){const e=lu(t);let n=NF(t);for(;n&&bMe(n)&&getComputedStyle(n).position==="static";)n=NF(n);return n&&(Lc(n)==="html"||Lc(n)==="body"&&getComputedStyle(n).position==="static"&&!DF(n))?e:n||function(r){let i=wre(r);for(aM(i)&&(i=i.host);Tl(i)&&!["html","body"].includes(Lc(i));){if(DF(i))return i;i=i.parentNode}return null}(t)||e}function QF(t){if(Tl(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=Nc(t);return{width:e.width,height:e.height}}function Sre(t){const e=wre(t);return["html","body","#document"].includes(Lc(e))?t.ownerDocument.body:Tl(e)&&X5(e)?e:Sre(e)}function x_(t,e){var n;e===void 0&&(e=[]);const r=Sre(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=lu(r),o=i?[s].concat(s.visualViewport||[],X5(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(x_(o))}function jF(t,e,n){return e==="viewport"?O_(function(r,i){const s=lu(r),o=hf(r),a=s.visualViewport;let l=o.clientWidth,c=o.clientHeight,u=0,f=0;if(a){l=a.width,c=a.height;const h=bre();(h||!h&&i==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}return{width:l,height:c,x:u,y:f}}(t,n)):_f(e)?function(r,i){const s=Nc(r,!1,i==="fixed"),o=s.top+r.clientTop,a=s.left+r.clientLeft;return{top:o,left:a,x:a,y:o,right:a+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(e,n):O_(function(r){var i;const s=hf(r),o=H5(r),a=(i=r.ownerDocument)==null?void 0:i.body,l=nv(s.scrollWidth,s.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),c=nv(s.scrollHeight,s.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let u=-o.scrollLeft+xre(r);const f=-o.scrollTop;return Iy(a||s).direction==="rtl"&&(u+=nv(s.clientWidth,a?a.clientWidth:0)-l),{width:l,height:c,x:u,y:f}}(hf(t)))}function wMe(t){const e=x_(t),n=["absolute","fixed"].includes(Iy(t).position)&&Tl(t)?NT(t):t;return _f(n)?e.filter(r=>_f(r)&&function(i,s){const o=s.getRootNode==null?void 0:s.getRootNode();if(i.contains(s))return!0;if(o&&aM(o)){let a=s;do{if(a&&i===a)return!0;a=a.parentNode||a.host}while(a)}return!1}(r,n)&&Lc(r)!=="body"):[]}const SMe={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?wMe(e):[].concat(n),r],o=s[0],a=s.reduce((l,c)=>{const u=jF(e,c,i);return l.top=nv(u.top,l.top),l.right=LF(u.right,l.right),l.bottom=LF(u.bottom,l.bottom),l.left=nv(u.left,l.left),l},jF(e,o,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Tl(n),s=hf(n);if(n===s)return e;let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((i||!i&&r!=="fixed")&&((Lc(n)!=="body"||X5(s))&&(o=H5(n)),Tl(n))){const l=Nc(n,!0);a.x=l.x+n.clientLeft,a.y=l.y+n.clientTop}return{...e,x:e.x-o.scrollLeft+a.x,y:e.y-o.scrollTop+a.y}},isElement:_f,getDimensions:QF,getOffsetParent:NT,getDocumentElement:hf,getElementRects:t=>{let{reference:e,floating:n,strategy:r}=t;return{reference:xMe(e,NT(n),r),floating:{...QF(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>Iy(t).direction==="rtl"};function _Me(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,l=i&&!a,c=s&&!a,u=l||c?[..._f(t)?x_(t):[],...x_(e)]:[];u.forEach(p=>{l&&p.addEventListener("scroll",n,{passive:!0}),c&&p.addEventListener("resize",n)});let f,h=null;if(o){let p=!0;h=new ResizeObserver(()=>{p||n(),p=!1}),_f(t)&&!a&&h.observe(t),h.observe(e)}let d=a?Nc(t):null;return a&&function p(){const g=Nc(t);!d||g.x===d.x&&g.y===d.y&&g.width===d.width&&g.height===d.height||n(),d=g,f=requestAnimationFrame(p)}(),n(),()=>{var p;u.forEach(g=>{l&&g.removeEventListener("scroll",n),c&&g.removeEventListener("resize",n)}),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(f)}}const kMe=(t,e,n)=>cMe(t,e,{platform:SMe,...n});var QT=typeof document<"u"?_.useLayoutEffect:_.useEffect;function jT(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!jT(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!jT(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function CMe(t){const e=_.useRef(t);return QT(()=>{e.current=t}),e}function EMe(t){let{middleware:e,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=t===void 0?{}:t;const s=_.useRef(null),o=_.useRef(null),a=CMe(i),l=_.useRef(null),[c,u]=_.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[f,h]=_.useState(e);jT(f==null?void 0:f.map(b=>{let{options:S}=b;return S}),e==null?void 0:e.map(b=>{let{options:S}=b;return S}))||h(e);const d=_.useCallback(()=>{!s.current||!o.current||kMe(s.current,o.current,{middleware:f,placement:n,strategy:r}).then(b=>{p.current&&Qi.flushSync(()=>{u(b)})})},[f,n,r]);QT(()=>{p.current&&d()},[d]);const p=_.useRef(!1);QT(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=_.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),s.current&&o.current)if(a.current){const b=a.current(s.current,o.current,d);l.current=b}else d()},[d,a]),m=_.useCallback(b=>{s.current=b,g()},[g]),v=_.useCallback(b=>{o.current=b,g()},[g]),y=_.useMemo(()=>({reference:s,floating:o}),[]);return _.useMemo(()=>({...c,update:d,refs:y,reference:m,floating:v}),[c,d,y,m,v])}const TMe=t=>{const{element:e,padding:n}=t;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){return r(e)?e.current!=null?RF({element:e.current,padding:n}).fn(i):{}:e?RF({element:e,padding:n}).fn(i):{}}}},PMe=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return _.createElement(gn.svg,Ee({},s,{ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:_.createElement("polygon",{points:"0,0 30,0 15,10"}))}),AMe=PMe,_re="Popper",[lM,Z5]=Oo(_re),[RMe,kre]=lM(_re),$Me=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return _.createElement(RMe,{scope:e,anchor:r,onAnchorChange:i},n)},MMe="PopperAnchor",IMe=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=kre(MMe,n),o=_.useRef(null),a=In(e,o);return _.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:_.createElement(gn.div,Ee({},i,{ref:a}))}),w_="PopperContent",[DMe,LMe]=lM(w_),[NMe,QMe]=lM(w_,{hasParent:!1,positionUpdateFns:new Set}),jMe=_.forwardRef((t,e)=>{var n,r,i,s,o,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:h=0,align:d="center",alignOffset:p=0,arrowPadding:g=0,collisionBoundary:m=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:b=!1,avoidCollisions:S=!0,onPlaced:k,...E}=t,T=kre(w_,u),[C,A]=_.useState(null),R=In(e,ze=>A(ze)),[Q,L]=_.useState(null),z=V5(Q),B=(n=z==null?void 0:z.width)!==null&&n!==void 0?n:0,q=(r=z==null?void 0:z.height)!==null&&r!==void 0?r:0,Z=f+(d!=="center"?"-"+d:""),J=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},I=Array.isArray(m)?m:[m],j=I.length>0,M={padding:J,boundary:I.filter(VMe),altBoundary:j},{reference:X,floating:se,strategy:H,x:de,y:fe,placement:ve,middlewareData:F,update:oe}=EMe({strategy:"fixed",placement:Z,whileElementsMounted:_Me,middleware:[UMe(),gMe({mainAxis:h+q,alignmentAxis:p}),S?vMe({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?OMe():void 0,...M}):void 0,Q?TMe({element:Q,padding:g}):void 0,S?pMe({...M}):void 0,yMe({...M,apply:({elements:ze,availableWidth:Ye,availableHeight:we})=>{ze.floating.style.setProperty("--radix-popper-available-width",`${Ye}px`),ze.floating.style.setProperty("--radix-popper-available-height",`${we}px`)}}),qMe({arrowWidth:B,arrowHeight:q}),b?mMe({strategy:"referenceHidden"}):void 0].filter(WMe)});Pc(()=>{X(T.anchor)},[X,T.anchor]);const le=de!==null&&fe!==null,[pe,De]=Cre(ve),xe=$a(k);Pc(()=>{le&&(xe==null||xe())},[le,xe]);const je=(i=F.arrow)===null||i===void 0?void 0:i.x,He=(s=F.arrow)===null||s===void 0?void 0:s.y,nt=((o=F.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[xt,Ze]=_.useState();Pc(()=>{C&&Ze(window.getComputedStyle(C).zIndex)},[C]);const{hasParent:Oe,positionUpdateFns:be}=QMe(w_,u),Re=!Oe;_.useLayoutEffect(()=>{if(!Re)return be.add(oe),()=>{be.delete(oe)}},[Re,be,oe]),Pc(()=>{Re&&le&&Array.from(be).reverse().forEach(ze=>requestAnimationFrame(ze))},[Re,le,be]);const Ke={"data-side":pe,"data-align":De,...E,ref:R,style:{...E.style,animation:le?void 0:"none",opacity:(a=F.hide)!==null&&a!==void 0&&a.referenceHidden?0:void 0}};return _.createElement("div",{ref:se,"data-radix-popper-content-wrapper":"",style:{position:H,left:0,top:0,transform:le?`translate3d(${Math.round(de)}px, ${Math.round(fe)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:xt,["--radix-popper-transform-origin"]:[(l=F.transformOrigin)===null||l===void 0?void 0:l.x,(c=F.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},_.createElement(DMe,{scope:u,placedSide:pe,onArrowChange:L,arrowX:je,arrowY:He,shouldHideArrow:nt},Re?_.createElement(NMe,{scope:u,hasParent:!0,positionUpdateFns:be},_.createElement(gn.div,Ke)):_.createElement(gn.div,Ke)))}),BMe="PopperArrow",zMe={top:"bottom",right:"left",bottom:"top",left:"right"},FMe=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=LMe(BMe,r),o=zMe[s.placedSide];return _.createElement("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0}},_.createElement(AMe,Ee({},i,{ref:n,style:{...i.style,display:"block"}})))});function WMe(t){return t!==void 0}function VMe(t){return t!==null}const UMe=()=>({name:"anchorCssProperties",fn(t){const{rects:e,elements:n}=t,{width:r,height:i}=e.reference;return n.floating.style.setProperty("--radix-popper-anchor-width",`${r}px`),n.floating.style.setProperty("--radix-popper-anchor-height",`${i}px`),{}}}),qMe=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,s,o;const{placement:a,rects:l,middlewareData:c}=e,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=f?0:t.arrowWidth,d=f?0:t.arrowHeight,[p,g]=Cre(a),m={start:"0%",center:"50%",end:"100%"}[g],v=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+h/2,y=((s=(o=c.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+d/2;let b="",S="";return p==="bottom"?(b=f?m:`${v}px`,S=`${-d}px`):p==="top"?(b=f?m:`${v}px`,S=`${l.floating.height+d}px`):p==="right"?(b=`${-d}px`,S=f?m:`${y}px`):p==="left"&&(b=`${l.floating.width+d}px`,S=f?m:`${y}px`),{data:{x:b,y:S}}}});function Cre(t){const[e,n="center"]=t.split("-");return[e,n]}const Ere=$Me,Tre=IMe,Pre=jMe,XMe=FMe,Are=_.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?$R.createPortal(_.createElement(gn.div,Ee({},i,{ref:e})),r):null});function HMe(t,e){return _.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const zd=t=>{const{present:e,children:n}=t,r=ZMe(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=In(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};zd.displayName="Presence";function ZMe(t){const[e,n]=_.useState(),r=_.useRef({}),i=_.useRef(t),s=_.useRef("none"),o=t?"mounted":"unmounted",[a,l]=HMe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=jx(r.current);s.current=a==="mounted"?c:"none"},[a]),Pc(()=>{const c=r.current,u=i.current;if(u!==t){const h=s.current,d=jx(c);t?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Pc(()=>{if(e){const c=f=>{const d=jx(r.current).includes(f.animationName);f.target===e&&d&&Qi.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=jx(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function jx(t){return(t==null?void 0:t.animationName)||"none"}const L6="rovingFocusGroup.onEntryFocus",YMe={bubbles:!1,cancelable:!0},cM="RovingFocusGroup",[BT,Rre,GMe]=Hm(cM),[KMe,Y5]=Oo(cM,[GMe]),[JMe,eIe]=KMe(cM),tIe=_.forwardRef((t,e)=>_.createElement(BT.Provider,{scope:t.__scopeRovingFocusGroup},_.createElement(BT.Slot,{scope:t.__scopeRovingFocusGroup},_.createElement(nIe,Ee({},t,{ref:e}))))),nIe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=t,f=_.useRef(null),h=In(e,f),d=jd(s),[p=null,g]=Nl({prop:o,defaultProp:a,onChange:l}),[m,v]=_.useState(!1),y=$a(c),b=Rre(n),S=_.useRef(!1),[k,E]=_.useState(0);return _.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(L6,y),()=>T.removeEventListener(L6,y)},[y]),_.createElement(JMe,{scope:n,orientation:r,dir:d,loop:i,currentTabStopId:p,onItemFocus:_.useCallback(T=>g(T),[g]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:_.useCallback(()=>E(T=>T-1),[])},_.createElement(gn.div,Ee({tabIndex:m||k===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...t.style},onMouseDown:gt(t.onMouseDown,()=>{S.current=!0}),onFocus:gt(t.onFocus,T=>{const C=!S.current;if(T.target===T.currentTarget&&C&&!m){const A=new CustomEvent(L6,YMe);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=b().filter(q=>q.focusable),Q=R.find(q=>q.active),L=R.find(q=>q.id===p),B=[Q,L,...R].filter(Boolean).map(q=>q.ref.current);$re(B)}}S.current=!1}),onBlur:gt(t.onBlur,()=>v(!1))})))}),rIe="RovingFocusGroupItem",iIe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,a=ff(),l=s||a,c=eIe(rIe,n),u=c.currentTabStopId===l,f=Rre(n),{onFocusableItemAdd:h,onFocusableItemRemove:d}=c;return _.useEffect(()=>{if(r)return h(),()=>d()},[r,h,d]),_.createElement(BT.ItemSlot,{scope:n,id:l,focusable:r,active:i},_.createElement(gn.span,Ee({tabIndex:u?0:-1,"data-orientation":c.orientation},o,{ref:e,onMouseDown:gt(t.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:gt(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:gt(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=aIe(p,c.orientation,c.dir);if(g!==void 0){p.preventDefault();let v=f().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(p.currentTarget);v=c.loop?lIe(v,y+1):v.slice(y+1)}setTimeout(()=>$re(v))}})})))}),sIe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oIe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function aIe(t,e,n){const r=oIe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sIe[r]}function $re(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function lIe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const Mre=tIe,Ire=iIe;var cIe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},x0=new WeakMap,Bx=new WeakMap,zx={},N6=0,Dre=function(t){return t&&(t.host||Dre(t.parentNode))},uIe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Dre(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},fIe=function(t,e,n,r){var i=uIe(e,Array.isArray(t)?t:[t]);zx[n]||(zx[n]=new WeakMap);var s=zx[n],o=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var d=h.getAttribute(r),p=d!==null&&d!=="false",g=(x0.get(h)||0)+1,m=(s.get(h)||0)+1;x0.set(h,g),s.set(h,m),o.push(h),g===1&&p&&Bx.set(h,!0),m===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(e),a.clear(),N6++,function(){o.forEach(function(f){var h=x0.get(f)-1,d=s.get(f)-1;x0.set(f,h),s.set(f,d),h||(Bx.has(f)||f.removeAttribute(r),Bx.delete(f)),d||f.removeAttribute(n)}),N6--,N6||(x0=new WeakMap,x0=new WeakMap,Bx=new WeakMap,zx={})}},G5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=e||cIe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),fIe(r,i,n,"aria-hidden")):function(){return null}},Fr=function(){return Fr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fr.apply(this,arguments)};function uM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ym(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function Gm(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function BF(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function S_(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var rv="right-scroll-bar-position",iv="width-before-scroll-bar",hIe="with-scroll-bars-hidden",dIe="--removed-body-scroll-bar-size";function Q6(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function pIe(t,e){var n=_.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var mIe=typeof window<"u"?_.useLayoutEffect:_.useEffect,zF=new WeakMap;function Lre(t,e){var n=pIe(e||null,function(r){return t.forEach(function(i){return Q6(i,r)})});return mIe(function(){var r=zF.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||Q6(a,null)}),s.forEach(function(a){i.has(a)||Q6(a,o)})}zF.set(n,t)},[t]),n}function gIe(t){return t}function vIe(t,e){e===void 0&&(e=gIe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function Nre(t){t===void 0&&(t={});var e=vIe(null);return e.options=Fr({async:!0,ssr:!1},t),e}var Qre=function(t){var e=t.sideCar,n=uM(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,Fr({},n))};Qre.isSideCarExport=!0;function jre(t,e){return t.useMedium(e),Qre}var Bre=Nre(),j6=function(){},K5=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:j6,onWheelCapture:j6,onTouchMoveCapture:j6}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,d=t.noIsolation,p=t.inert,g=t.allowPinchZoom,m=t.as,v=m===void 0?"div":m,y=uM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,S=Lre([n,e]),k=Fr(Fr({},y),i);return _.createElement(_.Fragment,null,u&&_.createElement(b,{sideCar:Bre,removeScrollBar:c,shards:f,noIsolation:d,inert:p,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),o?_.cloneElement(_.Children.only(a),Fr(Fr({},k),{ref:S})):_.createElement(v,Fr({},k,{className:l,ref:S}),a))});K5.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K5.classNames={fullWidth:iv,zeroRight:rv};var FF,OIe=function(){if(FF)return FF;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yIe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=OIe();return e&&t.setAttribute("nonce",e),t}function bIe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function xIe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var wIe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=yIe())&&(bIe(e,n),xIe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},SIe=function(){var t=wIe();return function(e,n){_.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},fM=function(){var t=SIe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},_Ie={left:0,top:0,right:0,gap:0},B6=function(t){return parseInt(t||"",10)||0},kIe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[B6(n),B6(r),B6(i)]},CIe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return _Ie;var e=kIe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},EIe=fM(),yp="data-scroll-locked",TIe=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
227
|
+
`)&&(r=r.slice(0,-1)),{textBlock:r,nextIdx:i}}function Nx(t){return Array.isArray(t)?t.length===0:typeof t=="object"&&t!==null?Object.keys(t).length===0:!1}function TT(t){let e=0;for(let n of t)if(n===" ")e++;else break;return e}function hF(t,e){let n=0,r="";for(let i of t)n<e&&i===" "?n++:r+=i;return r}async function Ene(t,e){const n=await FAe(t,e);if(n.status===200){const{originalObj:r,yamlValue:i}=n.data;Kee.setState({[e]:r}),u_.setState({[e]:i})}}function W$(t){const e=te.getState().x[t].variantId,n=dn(t),r=u_.getState()[e]??"";switch(n){case Y.PARAM_SWEEP:oRe(t,r);break;case Y.GLOBAL_PARAM_SWEEP:lRe(r,e);break;case Y.GLOBAL_VARIABLES:case Y.SECTION:const i=Kee.getState()[e]??{};uRe(t,r,i);break}}function oRe(t,e){const n=te.getState(),r=ky(t,n.x),s=Cne(e).map(c=>c.trim()?ET(c):{}),o=Jo(r,n).children,a=Object.keys(o),l=[];for(const c of s){const u=!Array.isArray(c);let f=null,h;if(u){if(h=Object.keys(c)[0],!h){l.push({selectedItem:null,params:[]});continue}if(f=aRe(h,a,n.codeInfo),!f)continue}const{pathMap:d}=_y({allCodeInfo:n.codeInfo,codeInfoChildren:o,startingId:f});let p=h?c[h]:c;ae.size(p)===0&&(p=[]);const g=[];for(const m of p){const v=Object.keys(m)[0];let y;for(const S of Object.keys(d))if(k$(n.codeInfo,d,S)===v){y=S;break}if(!y)continue;const b=m[v];ae.size(b)>0&&g.push({paramInfoId:y,values:b})}l.push({selectedItem:f,params:g})}te.setState(c=>{Yt(t,c).sweep=l})}function aRe(t,e,n){return e.find(r=>{var i;return((i=n[r])==null?void 0:i.name)===t})}function lRe(t,e){const n=rRe(t)[0].toJS(),r=te.getState(),i=r.x,s=r.variants,o={};for(const[a,l]of Object.entries(n))PT(a,l,i,s,o,null,null);te.setState(a=>{a.variants[e].runGroup=o})}function PT(t,e,n,r,i,s,o){let a=s,l=o;const[c,u]=cRe(t,s,n,r);if(u==="section"?(c in i||(i[c]={}),i[c][o]={selected:!0,versions:{},paramSweeps:{}},a=c):u==="sectionVariant"?(i[s][o].versions[c]=!0,l=c):u==="paramSweep"&&(i[s][o].paramSweeps[c]=!0),e)for(const[f,h]of Object.entries(ae.pickBy(e,(d,p)=>p.startsWith("~"))))PT(f,h,n,r,i,a,l);if(u==="section"&&(!e||!Object.keys(e).some(f=>f.startsWith("@")))&&(l=n[c].variantId,i[c][o].versions[l]=!0),!!e)for(const[f,h]of Object.entries(ae.pickBy(e,(d,p)=>!p.startsWith("~"))))PT(f,h,n,r,i,a,l)}function cRe(t,e,n,r){let i,s;if(e&&t.startsWith("@")){const o=t.slice(1);for(const a of n[e].variantIds)if(r[a].name===o){i=a,s="sectionVariant";break}}else if(e&&t.startsWith("~")){const o=t.slice(1),{paramSweepSectionId:a}=n[e];for(const l of n[a].variantIds)if(r[l].name===o){i=l,s="paramSweep";break}}else if(e){for(const o of r[n[e].variantId].children)if(n[o].name===t){i=o,s="section";break}}else for(const o of Object.values(n))if(o.name===t){i=o.id,s="section";break}return[i,s]}function uRe(t,e,n){var T,C;const r=te.getState(),i=Cne(e);let s=null,o={},a={};i.length===3?[s,o,a]=i:i.length===2?[o,a]=i:[a]=i;try{o=(T=o.trim)!=null&&T.call(o)?ET(o):{},a=(C=a.trim)!=null&&C.call(a)?ET(a):{}}catch{return}const l=gF(Qx(n.pinned),Qx(n.unpinned)),c=gF(Qx(o,!0),Qx(a,!0)),u=[],f=new Set,h=new Set;for(const A of l){if(f.has(A.id))continue;let R=c.filter(Q=>Q.key===A.key&&!h.has(JSON.stringify(Q.keyPath)));R.length>0&&(mF(R,A.keyPath),dF({v:A,matches:R,usedOriginalIds:f,usedPaths:h,output:u}))}for(const A of l){if(f.has(A.id))continue;let R=c.filter(Q=>Q.value===A.value&&!h.has(JSON.stringify(Q.keyPath)));R.length>0&&(mF(R,A.keyPath),dF({v:A,matches:R,usedOriginalIds:f,usedPaths:h,output:u}))}const{jsonSource:d,jsonSourceKeys:p}=r.x[t];for(const A of c){if(h.has(JSON.stringify(A.keyPath)))continue;const R={key:A.key,keyPath:A.keyPath,value:A.value,isPinned:A.isPinned};R.id=_te(R.keyPath,d,p),R.isNewParam=!0,u.push(R)}const g={};for(const[A,R]of c.entries())g[JSON.stringify(R.keyPath)]=A;u.sort((A,R)=>{const Q=g[JSON.stringify(A.keyPath)],L=g[JSON.stringify(R.keyPath)];return Q-L});const{parentCodeInfoId:m}=Ry(t,r),v={[m]:[]};for(const A of u)v[A.id]=[];vF({sectionId:t,idsToChildren:v,output:u,toProcess:u.filter(A=>!(A.isPinned&&!A.isNewParam)),inputParentId:m,insertAtOriginalIdx:!1}),vF({sectionId:t,idsToChildren:v,output:u,toProcess:u.filter(A=>A.isPinned&&!A.isNewParam),inputParentId:m,insertAtOriginalIdx:!0});const y=r.codeInfo,b={},S={},k={},E=Fm().value;for(const A of u)A.id in y?S[A.id]={name:A.key,isPinned:A.isPinned}:b[A.id]=E5({id:A.id,name:A.key,editable:A.editable??!0,rcType:Y.PARAMETER,isPinned:A.isPinned}),A.value!==E&&(k[A.id]=A.value);te.setState(A=>{A.codeInfo={...A.codeInfo,...b};for(const[L,z]of Object.entries(S))for(const[B,q]of Object.entries(z))A.codeInfo[L][B]=q;const R=A.x[t].variantId,Q=A.variants[R];for(const[L,z]of Object.entries(v))F$(Q,A).children[L]=z;for(const[L,z]of Object.entries(k))Z$(R,L,z,A)})}function dF({v:t,matches:e,usedOriginalIds:n,usedPaths:r,output:i}){const s={key:e[0].key,keyPath:e[0].keyPath,value:e[0].value,isPinned:e[0].isPinned};s.id=t.id,s.editable=t.editable,i.push(s),n.add(t.id),r.add(JSON.stringify(s.keyPath))}function Qx(t,e=!1){let n=[];function r(i,s,o,a){if(typeof s=="object"&&!Array.isArray(s)&&s!==null){a.length>0&&n.push({id:i,keyPath:a,value:null,editable:o,key:a[a.length-1]});for(const[l,c]of Object.entries(s)){const u=[...a,l];e?r(null,c,null,u):r(c.id,c.value,c.editable,u)}}else n.push({id:i,keyPath:a,value:s,editable:o,key:a[a.length-1]})}return r(null,t,null,[]),n}function pF(t,e){const n=Math.min(t.length,e.length),r=Math.max(t.length,e.length);let i=0;for(let s=0;s<n&&t[t.length-1-s]===e[e.length-1-s];s++)i++;return i/r*(n/r)}function mF(t,e){return t.sort((n,r)=>{const i=pF(n.keyPath,e);return pF(r.keyPath,e)-i})}function gF(t,e){for(const r of e)r.isPinned=!1;const n=[];for(const r of t)e.find(s=>ae.isEqual(s.keyPath,r.keyPath))||n.push({...r,isPinned:!0});return[...n,...e]}function vF({sectionId:t,idsToChildren:e,output:n,toProcess:r,inputParentId:i,insertAtOriginalIdx:s}){for(const o of r){let a=i;if(o.keyPath.length>1){const l=ae.find(n,c=>ae.isEqual(c.keyPath,o.keyPath.slice(0,-1)));if(l)a=l.id;else continue}if(s){const l=Jo(t).children[a].indexOf(o.id);e[a].splice(l,0,o.id)}else e[a].push(o.id)}}async function Nd(t,e){Pi(t).displayMode===so.YAML&&await Ene(t,e)}async function p_(t=!1){const e=te.getState();for(const[n,r]of Object.entries(e.x)){const i=t?z5(n):r.variantId;await Nd(n,i)}}function Vi(t){pT.setState(e=>{e.timeoutId!==null&&clearTimeout(e.timeoutId);const n=setTimeout(()=>pT.setState({message:""}),3e3);return{message:t,timeoutId:n}})}function Q5({withArtifacts:t=!1,convertYamlToGUI:e=!0}){let n=ae.cloneDeep(te.getState().x);if(n=ae.pickBy(n,d=>!d.isTemporary),e)for(const d of Object.values(n))d.displayMode===so.YAML&&W$(d.id);n=ae.mapValues(n,d=>(d.columnWidth=jm.getState()[d.id],d));const r=t?RAe():{},i=ae.mapValues(te.getState().variants,d=>({...d,children:d.children.filter(p=>p in n)})),s=te.getState().artifactGroups,o=ae.pickBy(te.getState().uiTypes,d=>d.presetType!==Y.PRESET_UI_TYPE_BASE),a=te.getState().uiTypeCols,l=te.getState().codeInfo,c=te.getState().codeInfoCols,u=dRe(),f={};for(const d of mr.getState().x.values())d.id in n&&(f[d.id]={x:d.position.x,y:d.position.y,zIndex:d.zIndex,w:d.width,h:d.height});return u.children=f,{projectConfig:u,sectionVariants:i,artifacts:r,artifactGroups:s,uiTypes:o,uiTypeCols:a,sections:n,codeInfo:l,codeInfoCols:c}}async function j5(){let t;Vi("Saving..."),vo.getState().name===XR?(t=await xAe(Q5({})),t.status===200&&Nt.setState(t.data)):t=await hAe({project:await V$()}),t.status===200&&Vi("Saved!")}async function fRe({newConfigName:t,withRefs:e}){return await Tne({fn:dAe,otherArgs:{newConfigName:t,withRefs:e}})}async function hRe({configName:t}){return await Tne({fn:pAe,otherArgs:{configName:t}})}async function Tne({fn:t,otherArgs:e}){await t({project:await V$(),...e})}function dRe(){const t=vo.getState(),e={id:t.id,name:t.name,previewImgColor:t.previewImgColor};return e.viewport=qe.getState().fitViewOnInit?null:yee(),e}async function V$(){const t=Q5({withArtifacts:!0,convertYamlToGUI:!0});return Nt.getState().backend.saveRenderedValues&&await pRe(t.sections),t}async function pRe(t){for(const e of Object.keys(t))[Y.DRAW,Y.CHART].includes(dn(e))&&(t[e].renderedValue=await Mne(e))}async function mRe(t){return await jt({body:{projects:t},address:Y.ROUTE_UPDATE_INTERACTIVE_CODE})}async function gRe(){const t=Q5({}),e={};for(const n of Object.values(t.sections))dn(n.id)===Y.CODE&&(e[n.id]=v$(n.id,Yt(n.id).code));return await jt({body:{project:t,candidateTemplateVars:e},address:Y.ROUTE_FORMAT_CODE})}async function vRe(){const t=await gRe();t.status===200&&te.setState(e=>{for(const[n,r]of Object.entries(t.data))r!==null&&(Yt(n,e).code=r)})}function Pne(t,e){const n=JSON.stringify(t),r=Gee.getState().dependencies;(r.has(null)||r.has(n))&&Ay({id:Kn(),content:{[n]:e},messageType:"inMemoryFn"})}async function ORe(t){if(t.length===0)return;const e=ti.getState().namePathTypeToId,n=[],r=[];for(const[s,o]of t.entries()){"path"in o||(o.path="");const a=e[S$(o)];a?o.id=a:(n.push(s),r.push(ae.pick(o,["name","path","type"])))}const i=await nAe(r);if(i.status==200)for(const[s,o]of i.data.entries()){const a=n[s];t[a].id=o??Kn()}}async function Ane(t){if(t.length===0)return;const e={},n=ti.getState();for(const r of t)"path"in r||(r.path=""),r.type==="img"&&(r.value=await m$(r.value)),e[r.id??n.namePathTypeToId[S$(r)]]=r;ti.setState(r=>({x:{...r.x,...e}}))}function yRe(t){const{projectConfigId:e,codeSectionId:n,diagnostics:r}=t;if(e!==vo.getState().id)return;const i={};for(const s of r){const{sectionId:o,paramInfoId:a,message:l}=s;te.getState().codeInfo[a].ignoreTypeErrors||(o in i||(i[o]={}),a in i[o]||(i[o][a]=[]),i[o][a].push(l))}gp.getState().userRequested&&Vi(ae.size(i)===0?"No type errors":`Found ${ae.size(i)} type errors`),gp.getState().reset(),gp.setState({errors:i})}function bRe(t,e){for(const n of Object.values(e.errors))t in n&&delete n[t]}function xRe(t){const{connections:e}=t,n=e.filter(r=>r.isCLI);n.map(r=>r.websocketId).includes(Qm.getState().connectedTo)||(n.length>0?AT(n[0].websocketId):AT(null)),wRe(e)}function AT(t){Qm.setState({connectedTo:t})}function wRe(t){Qm.setState({connections:t})}let ro;const Rne=ae.debounce(t=>{U$()||(ro=new WebSocket(`${Hp.WEBSOCKET}${Y.ROUTE_WEBSOCKET_MANAGER}`),ro.addEventListener("open",()=>{$ne(t)}),ro.addEventListener("message",e=>{_Re(e.data)}),ro.addEventListener("error",SRe),ro.addEventListener("close",()=>{ro=null,setTimeout(()=>{Rne(t)},3e3)}))},1e3,{leading:!0});function SRe(){ro&&(ro.close(),ro=null)}function U$(){return ro&&ro.readyState===1}function _Re(t){const e=JSON.parse(t);e.messageType===Y.WS_ALL_CONNECTIONS?xRe(e):e.messageType===Y.WS_LSP_DIAGNOSTICS?yRe(e.content):e.messageType===Y.WS_LSP_STATUS?Vi(`Language Server ${e.content.data}`):e.messageType===Y.WS_ARTIFACT||e.messageType===Y.WS_IN_MEMORY_FN_RETURN?Ane(e.content):e.id&&oO(e.id,e.content)}function $ne(t){U$()&&ro.send(JSON.stringify({location:t}))}async function Ay({content:t,id:e,messageType:n}){const r=Qm.getState().connectedTo;U$()&&r&&ro.send(JSON.stringify({id:e,content:t,toWebsocketId:r,messageType:n}))}function kRe(t){y5.setState(e=>ae.omit(e,[t]),!0)}function oO(t,e){y5.setState({[t]:e})}function q$({id:t,condition:e,fn:n}){return new Promise(r=>{const i=t||Kn(),s=y5.subscribe(o=>o[i],o=>{(!e||e(o))&&(s(),r(o),kRe(i))});n==null||n(i)})}async function im({id:t,messageType:e,content:n,condition:r}){return await q$({id:t,condition:r,fn:s=>Ay({id:s,messageType:e,content:n})})}async function Mne(t){const e=i=>oO(i,!0),n=Ine(t);return await q$({id:n,condition:()=>!0,fn:e})}function Ine(t){return`${t}-base64-request`}function Dne(t,e){const n=Ine(t);return y5.subscribe(i=>i[n],i=>{i===!0&&oO(n,Ete(e.current))})}async function CRe(t){let e=!1;return await q$({id:RT(t),condition:n=>(e=n,!0)}),e}function RT(t){return`${t}-delete-request`}function Pi(t){return te.getState().x[t]}function sm(t){return Pi(t).parentId}function dn(t,e){const n=e??te.getState();return n.uiTypes[n.x[t].uiTypeId].type}function Yt(t,e){const n=e??te.getState();return n.variants[n.x[t].variantId]}function B5(t,e=sm){let n=e(t),r=t;for(;n;)r=n,n=e(n);return r}function X$(t,e){let n=e.x[t].parentId;if(!n)return e.x[t].name;let r=t,i="";for(;n;)dn(n,e)===Y.LIST_ROOT?i=`[${Yt(n,e).children.indexOf(t)}]${i}`:i=`["${e.x[r].name}"]${i}`,r=n,n=e.x[n].parentId;return`${e.x[r].name}${i}`}function ERe(t,e){const n=[t];let r=0;for(;r<n.length;){const i=n[r];n.push(...Yt(i,e).children),r+=1}return n}function TRe(t){te.setState(e=>{e.x[t].isHorizontalOrientation=!e.x[t].isHorizontalOrientation})}function PRe(t){te.setState(e=>{e.x[t].positionAndSizeLocked=!e.x[t].positionAndSizeLocked})}function m_(){qf.getState().update(Y$())}function Lne(){te.setState(t=>{for(const e of Object.values(t.x))e.previewVariantId=null})}function H$({sections:t,sectionVariants:e,uiTypes:n,uiTypeCols:r,codeInfo:i,codeInfoCols:s,state:o}){o.x={...o.x,...t},o.variants={...o.variants,...e},o.uiTypes={...o.uiTypes,...n},o.uiTypeCols={...o.uiTypeCols,...r},o.codeInfo={...o.codeInfo,...i},o.codeInfoCols={...o.codeInfoCols,...s}}function Z$(t,e,n,r){e in r.variants[t].values||(r.variants[t].values[e]=Fm()),r.variants[t].values[e].value=n}function $T(t,e,n,r){Z$(r.x[t].variantId,e,n,r)}function Jo(t,e){const n=e??te.getState(),r=Yt(t,n).codeInfoColId;return r?n.codeInfoCols[r]:k5()}function Nne(t,e){const n=e??te.getState();return n.codeInfoCols[Ll(t,n).codeInfoColId]}function Ll(t,e){const n=e??te.getState();return n.variants[z5(t,n)]}function z5(t,e){const n=e??te.getState();return n.x[t].previewVariantId??n.x[t].variantId}function om(t,e,n){const r=Yt(t,n);r.children=e(r.children)}function Qne(t,e,n){const r=Ll(t,e).children;if(n[t]=r,r)for(const i of r)Qne(i,e,n)}function Y$(t,e=!1){const n={},r=t??te.getState();for(const i of Object.values(r.x))i.parentId||(Qne(i.id,r,n),e&&(null in n||(n[null]=[]),n[null].push(i.id)));return n}function ARe(t){const e={},n=t??te.getState();for(const r of Object.values(n.x))e[r.id]=r.parentId;return e}function RRe(t,e){const n=[];for(const r of e.x[t].variantIds)n.push(...e.variants[r].children);return n}function jne(t,e){const n=[...t];let r=0;for(;r<n.length;){const i=RRe(n[r],e),{paramSweepSectionId:s}=e.x[n[r]];i&&n.push(...i),s&&n.push(s),r+=1}return n}function $Re(t){te.setState(e=>{e.variants[t].isFrozen=!e.variants[t].isFrozen})}function MRe(t,e){te.setState(n=>{n.x[t].defaultVariantId=e})}function Bne(t){te.setState(e=>{for(const n of t){const r=e.x[n];r.variantId=r.defaultVariantId}})}function IRe(){Bne(Object.keys(te.getState().x))}function DRe(t,e){const n=Kn(),r=e.codeInfoCols;return r[n]=ae.cloneDeep(r[t]),n}function LRe(t,e,n,r){const i=Kn(),s=r.variants;return s[i]=ae.cloneDeep(s[t]),s[i].name=e,s[i].codeInfoColId=n,s[i].isFrozen=!1,i}function Ry(t,e,n=null){const r=n?e.variants[n]:Ll(t,e),{codeInfoColId:i}=r,s=r.selectedItem;return{codeInfoChildren:i?e.codeInfoCols[i].children:k5().children,parentCodeInfoId:s}}async function NRe(t,e,n){const r=te.getState(),{jsonSource:i}=r.x[t];if(i){const{name:s}=r.variants[e],o=await vPe(s);o.status==200&&(HPe(o.data),await CRe(o.data)&&OF(t,e,n))}else OF(t,e,n)}function OF(t,e,n){te.setState(r=>{const i=r.x[t];i.variantIds=i.variantIds.filter(s=>s!==e),i.defaultVariantId===e&&(i.defaultVariantId=i.variantIds[0]),n&&(i.variantId=i.variantIds[0]),delete r.variants[e]})}const yF={activeId:null,activeIsTopLevel:!1,overId:null,triggerDistCondition:!1,isSorting:!1,isMovingFree:!1,disabled:{},width:null,height:null,times:{}},cn=qr(vn($d(Sn((t,e)=>({...yF,setActive:({id:n,isTopLevel:r,width:i,height:s})=>t({activeId:n,activeIsTopLevel:r,width:i,height:s}),activateSortingMode:()=>t({isSorting:!0,isMovingFree:!1}),activateMovingFreeMode:()=>{t({isMovingFree:!0,isSorting:!1})},deactivate:()=>{t({...yF,disabled:e().disabled}),m_()},setDisabled:(n,r)=>t(i=>{i.disabled[n]=r}),setTime:n=>t(r=>{r.times[n]=Date.now()})}))))),MT="-TempDND";function $y(t){return`${t}${MT}`}function F5(t){return t.slice(-MT.length)===MT}function zne(){return cn(t=>({isSorting:t.isSorting,isMovingFree:t.isMovingFree}),ae.isEqual)}const qf=qr(vn($d(Sn(t=>({x:{},y:{},addChild:({oldParentId:e,newParentId:n,childId:r,index:i})=>t(s=>{e&&(s.x[e]=s.x[e].filter(o=>o!==r)),s.x[n]=[...s.x[n].slice(0,i),r,...s.x[n].slice(i)],s.y[r]=n}),removeChild:e=>t(n=>{const r=n.y[e];r&&(n.x[r]=n.x[r].filter(i=>i!==e),n.y[e]=void 0)}),replaceWithTemp:e=>t(n=>{const r=n.y[e];if(r){const i=n.x[r].indexOf(e),s=$y(e);n.x[r][i]=s,n.y[s]=r,n.y[e]=void 0}}),update:e=>t(n=>{n.x=e,n.y={};for(const[r,i]of Object.entries(e))for(const s of i)n.y[s]=r})})))));function QRe(t){const e=[],n={};for(const o of Object.keys(t.details))if(t.details[o].isTopLevelAndCanHaveEVRefs)if(t.globalVariableId===o)G$(t,o,null,e,n,"",[],!0);else{const a=t.details[o].name;Fne(t,e,n,o,a,[a.length])}if(e.length===0)return{pattern:Jp(),codeAreaPattern:Jp(),fullNameToInfo:n};const r=`(?<![A-Za-z."'_])(${e.join("|")})(?![A-Za-z"'_])`,i=new RegExp(r,"g"),s=new RegExp(`(?<=.*?\\${Y.TEMPLATE_PREFIX}${Y.SETTA_GENERATED_PYTHON}.*?)${r}`,"gs");return{pattern:i,codeAreaPattern:s,fullNameToInfo:n}}function Fne(t,e,n,r,i,s){const o=t.details[r].sectionTypeName;for(const[u,f]of t.details[r].sectionChildren.entries()){const h=t.details[f].name,d=o===Y.LIST_ROOT?`[${u.toString()}]`:`["${h}"]`,p=`${i}${d}`;Fne(t,e,n,f,p,[...s,p.length])}const a=i,l=`${Y.ARGS_PREFIX}${i}`,c=s.map(u=>u+Y.ARGS_PREFIX.length);G$(t,r,t.details[r].selectedItem,e,n,l,c),e.push(o_(a)),n[a]={sectionId:r,paramInfoId:null,componentIndices:s,isArgsObj:!1},o===Y.SECTION&&(e.push(o_(l)),n[l]={sectionId:r,paramInfoId:null,componentIndices:c,isArgsObj:!0})}function G$(t,e,n,r,i,s,o,a=!1){const c=t.details[e].codeInfoChildren[n].map(u=>t.codeInfo[u]);for(const u of c){if(!u.name||u.rcType!==Y.PARAMETER)continue;const f=a?u.name:`${s}["${u.name}"]`,h=[...o,f.length];G$(t,e,u.id,r,i,f,h),r.push(o_(f)),i[f]={sectionId:e,paramInfoId:u.id,componentIndices:h,isArgsObj:!1}}}function Wne(t={}){const{width:e,height:n,d3Zoom:r,d3Selection:i,fitViewOnInitDone:s,fitViewOnInit:o}=qe.getState(),{minZoom:a,maxZoom:l}=Nt.getState().gui,c=t.initial&&!s&&o;if(r&&i&&(c||!t.initial)){const f=Xm().filter(d=>{var p;return(p=t.nodes)!=null&&p.length?t.nodes.some(g=>g.id===d.id):!0}),h=f.every(d=>d.width&&d.height);if(f.length>0&&h){const d=d5(f),{x:p,y:g,zoom:m}=See(d,e,n,t.minZoom??a,t.maxZoom??l,t.padding??.1),v=ou.translate(p,g).scale(m);return typeof t.duration=="number"&&t.duration>0?r.transform(Id(i,t.duration),v):r.transform(i,v),!0}}return!1}function Vne(){if(qe.getState().fitViewOnInit)return;const t=Nt.getState().gui.transitionDuration;Wne({duration:t}),setTimeout(()=>qe.setState({fitViewOnInit:!0}),t+10)}function K$(t){return!t.fitViewOnInit||t.fitViewOnInitDone}function Xm(t=null){return Array.from(t?t.x.values():mr.getState().x.values())}function J$(t){const e=Qd();for(const n of t)e.set(n.id,n);mr.setState({x:e})}function Une(t){const e=Qd();for(const n of t)e.delete(n);mr.setState({x:e})}function qne(t){const{fitViewOnInit:e,fitViewOnInitDone:n,fitViewOnInitOptions:r,domNode:i}=qe.getState();if(!(i==null?void 0:i.querySelector(".react-flow__viewport")))return;const o=Qd();for(const c of t){const u=o.get(c.id);if(u){const f=aEe(c.nodeElement);!!(f.width&&f.height&&(u.width!==f.width||u.height!==f.height||c.forceUpdate))&&o.set(u.id,{...u,...f})}}mr.setState({x:o});const a=Ut.getState();if(a.numInitializedCodeAreas!==a.numDisplayedCodeAreas)return;const l=n||e&&!n&&Wne({initial:!0,...r});qe.setState({fitViewOnInitDone:l})}function Xne(t){const e=Qd();for(const n of t)e.get(n.id).position=n.position;mr.setState({x:e})}function jRe(t){const e=Qd();for(const[,n]of e)n.tempZIndex=n.zIndex;for(const n of t)e.get(n.id).tempZIndex=e.get(n.id).zIndex+1e3;mr.setState({x:e})}function BRe(t,e){const n=Qd();n.get(t).position=e,mr.setState({x:n})}function Qd(){return ae.cloneDeep(mr.getState().x)}function Hne(t,e){if(e)return t.map(i=>({id:i.target.getAttribute("data-id"),nodeElement:i.target,forceUpdate:!0}));const n=[],r=ka.getState().withNested;return t.forEach(i=>{r[i]&&n.push({id:i,nodeElement:r[i],forceUpdate:!0})}),n}async function zRe(t,e,n){return await jt({body:{codeAreaReplacements:t,codeInfoReplacements:e,paramEVReplacements:n},address:Y.ROUTE_MAKE_EV_REF_TEMPLATE_VAR_REPLACEMENTS})}function FRe(){const t={},e={},n={},r=te.getState(),i=Tte();let s=!1,o=!1;for(const a of Object.keys(te.getState().variants))o=WRe(a,t,e,n,r,i),s||(s=o),o=VRe(a,t,r),s||(s=o);return[t,e,n,s]}function WRe(t,e,n,r,i,s){let o,a,l=!1;const c=i.variants[t];for(const u of c.evRefs)o=Zne(e,t,i),a=$6(u,s,o),l||(l=a);if(c.selectedItem){const u=c.selectedItem;for(const f of i.codeInfo[u].evRefs)o=qRe(n,u,i),a=$6(f,s,o),l||(l=a)}for(const[u,f]of Object.entries(c.values))for(const h of f.evRefs)o=URe(r,t,u,i),a=$6(h,s,o),l||(l=a);return l}function $6(t,e,n){const r=e[Pte(t)];return n.replacements.push({originalEVRef:t,newName:r}),t.keyword!==r}function VRe(t,e,n){let r,i=!1;for(const s of n.variants[t].templateVars)if(r=Zne(e,t,n),s.sectionId){const o=Object.values(n.x).find(a=>a.id===s.sectionId);if(o){const a=aAe(s.keyword),l=`${s$(X$(o.id,n))}${a}`;r.replacements.push({originalTemplateVar:s,newName:l}),s.keyword!==l&&(i=!0)}}else r.replacements.push({originalTemplateVar:s,newName:s.keyword});return i}function eM(t){return{string:t,replacements:[]}}function URe(t,e,n,r){return e in t||(t[e]={}),n in t[e]||(t[e][n]=eM(r.variants[e].values[n].value)),t[e][n]}function qRe(t,e,n){return e in t||(t[e]=eM(n.codeInfo[e].name)),t[e]}function Zne(t,e,n){return e in t||(t[e]=eM(n.variants[e].code)),t[e]}async function XRe(){const t=Nt.getState().backend.renameReferencesOnSectionMoveMode;if(t===G1.NEVER_RENAME)return;const[e,n,r,i]=FRe();i&&(t===G1.ALWAYS_ASK?XPe(e,n,r):t===G1.ALWAYS_RENAME&&await Yne(e,n,r))}async function Yne(t,e,n){const r=await zRe(t,e,n);if(r.status===200){const{newCodeAreaValues:i,newCodeInfoValues:s,newParamEVValues:o}=r.data;te.setState(a=>{let l;for(const[c,u]of Object.entries(i))l=a.variants[c],l.code=u[0],l.evRefs=u[1],l.templateVars=u[2];for(const[c,u]of Object.entries(s))l=a.codeInfo[c],l.name=u[0],l.evRefs=u[1];for(const[c,u]of Object.entries(o))for(const[f,h]of Object.entries(u))l=a.variants[c].values[f],l.value=h[0],l.evRefs=h[1]})}}const tM=[Y.SECTION,Y.LIST_ROOT,Y.DICT_ROOT,Y.GROUP,Y.GLOBAL_VARIABLES,Y.CODE,Y.DRAW];function Gne(t,e){e.variants[t].runGroup={sections:{}};for(const n of mr.getState().x.keys())tM.includes(dn(n))&&W5(t,n,null,e)}function HRe(t,e){te.setState(n=>{const r=n.x[t].selectedVariantIds;e in r?delete r[e]:r[e]=!0})}function Kne(t,e,n){return{selected:!0,paramSweeps:{},versions:{[e??n.x[t].variantId]:!0}}}function W5(t,e,n,r,i=null){let s=!1;return e in r.variants[t].runGroup||(r.variants[t].runGroup[e]={},Jne(t,i??r.x[e].variantId,r),s=!0),n in r.variants[t].runGroup[e]||(r.variants[t].runGroup[e][n]=Kne(e,i,r),s=!0),s}function Jne(t,e,n){for(const r of n.variants[e].children)W5(t,r,e,n)}function ZRe(t,e,n){for(const[r,i]of e.entries()){const s=r===0?null:e[r-1].variantId;W5(t,i.id,s,n);const o=n.variants[t].runGroup[i.id][s];o.versions[i.variantId]=!0,o.selected=!0}}function YRe(t,e,n){var r;for(const[i,s]of e.entries()){const o=i===0?null:e[i-1].variantId;if(!((r=n.variants[t].runGroup[s.id])!=null&&r[o].versions[s.variantId])||!ere(t,s.id,o,n))return!1}return!0}function ere(t,e,n,r){var i;return(i=r.variants[t].runGroup[e])==null?void 0:i[n].selected}function nM({runGroupId:t,ancestors:e,sectionId:n,attrName:r,attrId:i,parentVariantId:s}){te.setState(o=>{const a=W5(t,n,s,o,r==="versions"?i:null);let l;const c=o.variants[t].runGroup[n][s];if(!a&&YRe(t,e,o)&&(r==="selected"||ere(t,n,s,o))?l=i?!c[r][i]:!c[r]:l=!0,i?c[r][i]=l:c[r]=l,l&&(c.selected=!0,ZRe(t,e,o),r==="selected"||r==="versions")){const u=r==="versions"?i:o.x[n].variantId;Jne(t,u,o)}})}function GRe({id:t,ancestors:e,sectionId:n,parentVariantId:r}){nM({runGroupId:t,ancestors:e,sectionId:n,attrName:"selected",parentVariantId:r})}function KRe({id:t,paramSweepId:e,ancestors:n,sectionId:r,parentVariantId:i}){nM({runGroupId:t,ancestors:n,sectionId:r,attrName:"paramSweeps",attrId:e,parentVariantId:i})}function JRe({id:t,versionId:e,ancestors:n,sectionId:r,parentVariantId:i}){nM({runGroupId:t,ancestors:n,sectionId:r,attrName:"versions",attrId:e,parentVariantId:i})}function e$e(t){return te(e=>{const n=[];for(const r of e.variants[t].children)tM.includes(e.uiTypes[e.x[r].uiTypeId].type)&&n.push({id:r,name:e.x[r].name});return n},ae.isEqual)}function t$e(){return te(t=>{const e=[];for(const[n,r]of Object.entries(t.x))!r.parentId&&tM.includes(t.uiTypes[t.x[n].uiTypeId].type)&&e.push({id:n,name:r.name});return e},ae.isEqual)}function n$e(t,e){te.setState(n=>{const r=n.singletonSections[Y.GLOBAL_PARAM_SWEEP];if(r)for(const[i,s]of Object.entries(t)){if(!(i in e)||s===e[i])continue;const{variantIds:o}=n.x[r];for(const a of o){const l=n.variants[a].runGroup;if(!(i in l))continue;const c=s?n.x[s].variantIds:[null];for(const u of c)l[i][u]=Kne(i,void 0,n)}}})}function r$e(t){const e=[Y.SETTA_GENERATED_PYTHON,Y.SETTA_GENERATED_PYTHON_IMPORTS],n={};for(const a of e)n[a]=null;const r=te.getState();for(const[a,l]of Object.entries(t.templateVarEligibleSections)){const c=X$(a,r);for(const u of l){const f=c+`${Y.TEMPLATE_PREFIX}${u}`;e.push(o_(f)),n[f]=a}}const i=ae.mapKeys(n,(a,l)=>s$(l));if(e.length===0)return{pattern:Jp(),fullNameToSectionId:i};const s=`(?<![A-Za-z."'_])\\${Y.TEMPLATE_PREFIX}(${e.join("|")})(?![A-Za-z"'_])`;return{pattern:new RegExp(s,"g"),fullNameToSectionId:i}}function i$e(){te.subscribe(s$e,t=>{te.setState(e=>{e.singletonSections=t})},{equalityFn:ae.isEqual}),te.subscribe(o$e,t=>{Dd.setState(QRe(t)),O5.setState(r$e(t)),te.getState().shouldRenameReferences&&(te.setState({shouldRenameReferences:!1}),XRe())},{equalityFn:ae.isEqual}),te.subscribe(Y$,t=>{qf.getState().update(t)},{equalityFn:ae.isEqual}),te.subscribe(ARe,(t,e)=>{n$e(t,e)},{equalityFn:ae.isEqual}),qe.subscribe(a$e,(t,e)=>{e.fitViewOnInit&&e.fitViewOnInitDone&&t.fitViewOnInit&&t.fitViewOnInitDone&&qe.setState({fitViewOnInit:!1}),window.reactFlowZoom=t.transform[2]},{equalityFn:ae.isEqual}),Ut.subscribe(l$e,t=>{t&&(qne(Hne(mr.getState().x.keys(),!1)),Ut.setState({requestUpdateNodeDimensions:!1}))},{equalityFn:ae.isEqual}),Ut.subscribe(t=>t.undoOrRedoWasTriggered,t=>{t&&Ut.setState(e=>({updateDrawAreas:e.updateDrawAreas+1,undoOrRedoWasTriggered:!1}))}),ti.subscribe(c$e,t=>{ti.setState(()=>{const e={};for(const[n,r]of Object.entries(t))e[S$(r)]=n;return{namePathTypeToId:e}})},{equalityFn:ae.isEqual})}function s$e(t){var n;const e={[Y.GLOBAL_VARIABLES]:null,[Y.GLOBAL_PARAM_SWEEP]:null,inMemoryFnStdoutTerminal:null};for(const r of Object.values(t.x)){const i=(n=t.uiTypes[r.uiTypeId])==null?void 0:n.type;if(e[Y.GLOBAL_VARIABLES]&&e[Y.GLOBAL_PARAM_SWEEP]&&e.inMemoryFnStdoutTerminal&&e.temporaryTerminalGroup)break;!e[Y.GLOBAL_VARIABLES]&&i===Y.GLOBAL_VARIABLES&&(e[Y.GLOBAL_VARIABLES]=r.id),!e[Y.GLOBAL_PARAM_SWEEP]&&i===Y.GLOBAL_PARAM_SWEEP&&(e[Y.GLOBAL_PARAM_SWEEP]=r.id),!e.inMemoryFnStdoutTerminal&&i===Y.TERMINAL&&r.isReadOnlyTerminal&&(e.inMemoryFnStdoutTerminal=r.id),!e.temporaryTerminalGroup&&i===Y.GROUP&&r.isTemporary&&(e.temporaryTerminalGroup=r.id)}return e}function o$e(t){const e={details:{},codeInfo:ae.mapValues(t.codeInfo,i=>({id:i.id,name:i.name,rcType:i.rcType})),globalVariableId:t.singletonSections[Y.GLOBAL_VARIABLES],templateVarEligibleSections:{}};let n,r;for(const[i,s]of Object.entries(t.x))n=Yt(i,t),r=dn(i,t),e.details[i]={name:s.name,sectionChildren:n.children,codeInfoChildren:Jo(i,t).children,sectionTypeName:r,selectedItem:n.selectedItem,isTopLevelAndCanHaveEVRefs:!s.parentId&&[Y.GLOBAL_VARIABLES,Y.SECTION,Y.LIST_ROOT,Y.DICT_ROOT,Y.GROUP].includes(r)},r===Y.CODE?e.templateVarEligibleSections[i]=[Y.TEMPLATE_VAR_VERSION_SUFFIX,Y.TEMPLATE_VAR_IMPORT_PATH_SUFFIX,Y.TEMPLATE_VAR_FILE_PATH_SUFFIX]:e.templateVarEligibleSections[i]=[Y.TEMPLATE_VAR_VERSION_SUFFIX];return e}function a$e(t){return{transform:t.transform,fitViewOnInit:t.fitViewOnInit,fitViewOnInitDone:t.fitViewOnInitDone}}function l$e(t){return t.undoOrRedoWasTriggered||t.requestUpdateNodeDimensions}function c$e(t){const e={};for(const[n,r]of Object.entries(t.x))e[n]={name:r.name,path:r.path,type:r.type};return e}function Ee(){return Ee=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ee.apply(this,arguments)}function gt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function u$e(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function tre(...t){return e=>t.forEach(n=>u$e(n,e))}function In(...t){return _.useCallback(tre(...t),t)}function Oo(t,e=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(f){const{scope:h,children:d,...p}=f,g=(h==null?void 0:h[t][l])||a,m=_.useMemo(()=>p,Object.values(p));return _.createElement(g.Provider,{value:m},d)}function u(f,h){const d=(h==null?void 0:h[t][l])||a,p=_.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return _.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,f$e(i,...e)]}function f$e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function $a(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Nl({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=h$e({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=$a(n),l=_.useCallback(c=>{if(s){const f=typeof c=="function"?c(t):c;f!==t&&a(f)}else i(c)},[s,t,i,a]);return[o,l]}function h$e({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,i=_.useRef(r),s=$a(e);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function rM(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Pc=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function V5(t){const[e,n]=_.useState(void 0);return Pc(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const am=_.forwardRef((t,e)=>{const{children:n,...r}=t,i=_.Children.toArray(n),s=i.find(p$e);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(IT,Ee({},r,{ref:e}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(IT,Ee({},r,{ref:e}),n)});am.displayName="Slot";const IT=_.forwardRef((t,e)=>{const{children:n,...r}=t;return _.isValidElement(n)?_.cloneElement(n,{...m$e(r,n.props),ref:tre(e,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});IT.displayName="SlotClone";const d$e=({children:t})=>_.createElement(_.Fragment,null,t);function p$e(t){return _.isValidElement(t)&&t.type===d$e}function m$e(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}const g$e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],gn=g$e.reduce((t,e)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?am:e;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,Ee({},o,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function nre(t,e){t&&Qi.flushSync(()=>t.dispatchEvent(e))}const rre="Switch",[v$e,J7t]=Oo(rre),[O$e,y$e]=v$e(rre),b$e=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:c,...u}=t,[f,h]=_.useState(null),d=In(e,y=>h(y)),p=_.useRef(!1),g=f?!!f.closest("form"):!0,[m=!1,v]=Nl({prop:i,defaultProp:s,onChange:c});return _.createElement(O$e,{scope:n,checked:m,disabled:a},_.createElement(gn.button,Ee({type:"button",role:"switch","aria-checked":m,"aria-required":o,"data-state":ire(m),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:d,onClick:gt(t.onClick,y=>{v(b=>!b),g&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),g&&_.createElement(S$e,{control:f,bubbles:!p.current,name:r,value:l,checked:m,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),x$e="SwitchThumb",w$e=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=y$e(x$e,n);return _.createElement(gn.span,Ee({"data-state":ire(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),S$e=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=_.useRef(null),o=rM(n),a=V5(e);return _.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),_.createElement("input",Ee({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ire(t){return t?"checked":"unchecked"}const _$e=b$e,k$e=w$e;function iM(t){const{twRootClasses:e="",twThumbClasses:n="",icon:r,disableBg:i=!1,height:s,width:o,children:a,...l}=t,c=`items-center p-[0.2rem] w-7 min-w-7 ${s||"h-2.5"} bg-setta-400 dark:bg-setta-600 rounded-full relative inline-flex cursor-pointer [-webkit-tap-highlight-color:rgba(0,_0,_0,_0)] focus-visible:shadow-black data-[state='checked']:bg-blue-500 dark:data-[state='checked']:bg-blue-700 focus-visible:ring-2 ${e} disabled:pointer-events-none`,u=`block ${o||"w-2.5"} ${s||"h-2.5"} ${!i&&"bg-white dark:bg-setta-800"} rounded-full transition-all will-change-transform data-[state='checked']:translate-x-4 ${n}`;return x.jsx(_$e,{className:c,...l,children:x.jsx(k$e,{className:u,children:r})})}var sre={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},bF=ke.createContext&&ke.createContext(sre),C$e=["attr","size","title"];function E$e(t,e){if(t==null)return{};var n=T$e(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function T$e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function g_(){return g_=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g_.apply(this,arguments)}function xF(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function v_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xF(Object(n),!0).forEach(function(r){P$e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function P$e(t,e,n){return e=A$e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A$e(t){var e=R$e(t,"string");return typeof e=="symbol"?e:e+""}function R$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ore(t){return t&&t.map((e,n)=>ke.createElement(e.tag,v_({key:n},e.attr),ore(e.child)))}function ft(t){return e=>ke.createElement($$e,g_({attr:v_({},t.attr)},e),ore(t.child))}function $$e(t){var e=n=>{var{attr:r,size:i,title:s}=t,o=E$e(t,C$e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),ke.createElement("svg",g_({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:v_(v_({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&ke.createElement("title",null,s),t.children)};return bF!==void 0?ke.createElement(bF.Consumer,null,n=>e(n)):e(sre)}function M$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"},child:[]}]})(t)}function are(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"},child:[]}]})(t)}function sM(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},child:[]}]})(t)}function I$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"},child:[]}]})(t)}function D$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"},child:[]}]})(t)}function U5(t){return ft({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},child:[]}]})(t)}function L$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.04932 12.9999H7.52725C7.70624 16.2688 8.7574 19.3053 10.452 21.8809C5.98761 21.1871 2.5001 17.5402 2.04932 12.9999ZM2.04932 10.9999C2.5001 6.45968 5.98761 2.81276 10.452 2.11902C8.7574 4.69456 7.70624 7.73111 7.52725 10.9999H2.04932ZM21.9506 10.9999H16.4726C16.2936 7.73111 15.2425 4.69456 13.5479 2.11902C18.0123 2.81276 21.4998 6.45968 21.9506 10.9999ZM21.9506 12.9999C21.4998 17.5402 18.0123 21.1871 13.5479 21.8809C15.2425 19.3053 16.2936 16.2688 16.4726 12.9999H21.9506ZM9.53068 12.9999H14.4692C14.2976 15.7828 13.4146 18.3732 11.9999 20.5915C10.5852 18.3732 9.70229 15.7828 9.53068 12.9999ZM9.53068 10.9999C9.70229 8.21709 10.5852 5.62672 11.9999 3.40841C13.4146 5.62672 14.2976 8.21709 14.4692 10.9999H9.53068Z"},child:[]}]})(t)}function N$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 6H16V8H21C21.5523 8 22 8.44772 22 9V16.5L16 13L16.0359 21.0622L18.2592 18.9129L20.041 22H9C8.44772 22 8 21.5523 8 21V16H6V14H8V9C8 8.44772 8.44772 8 9 8H14V6ZM22 17.338V21C22 21.107 21.9832 21.2101 21.9521 21.3068L19.9913 17.9129L22 17.338ZM4 14V16H2V14H4ZM4 10V12H2V10H4ZM4 6V8H2V6H4ZM4 2V4H2V2H4ZM8 2V4H6V2H8ZM12 2V4H10V2H12ZM16 2V4H14V2H16Z"},child:[]}]})(t)}function lre(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7.75194 5.43872L18.2596 11.5682C18.4981 11.7073 18.5787 12.0135 18.4396 12.252C18.3961 12.3265 18.3341 12.3885 18.2596 12.432L7.75194 18.5615C7.51341 18.7006 7.20725 18.62 7.06811 18.3815C7.0235 18.305 7 18.2181 7 18.1296V5.87061C7 5.59446 7.22386 5.37061 7.5 5.37061C7.58853 5.37061 7.67547 5.39411 7.75194 5.43872Z"},child:[]}]})(t)}function Q$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z"},child:[]}]})(t)}function q5(t){const[e,n]=t;n(!e)}function j$e(){q5(Ot.darkMode.state())}function B$e(){q5(Ot.showMinimap.state())}function z$e(){q5(Ot.projectConfigPreviewEnabled.state())}function F$e(){q5(Ot.snapToGrid.state())}function W$e(){const[t,e]=Ot.showNavBarHelpMessage.hook(),n=Nt(r=>Br(r.shortcuts.showTooltipShortcut));return t&&x.jsx("aside",{className:"ml-auto mr-4 flex items-center gap-2",children:x.jsxs("div",{className:"hidden items-center gap-2 lg:flex",children:[x.jsxs("p",{className:"text-xs font-bold text-setta-400 dark:text-setta-500",children:['Hold down "',n,'" to see tool tips']}),x.jsx("button",{className:"flex cursor-pointer items-center text-setta-300 hover:text-setta-700 dark:text-setta-500 dark:hover:text-setta-400",onClick:()=>e(!1),children:x.jsx("i",{className:"gg-close"})})]})})}function V$e(){const t=U$e();return x.jsxs("div",{className:"flex flex-1 items-center justify-end",children:[x.jsx(W$e,{}),x.jsx(iM,{checked:t,onCheckedChange:j$e,twThumbClasses:"flex",disableBg:!0,height:"h-3",width:"w-3",icon:t?x.jsx(I$e,{className:"h-3 text-blue-200"}):x.jsx(Q$e,{className:"h-3 text-white"})})]})}function U$e(){const[t]=Ot.darkMode.hook();return _.useEffect(()=>{t?document.querySelector("html").classList.add("dark"):document.querySelector("html").classList.remove("dark")},[t]),t}function q$e(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.105 4.561l-3.43 3.427-1.134-1.12 2.07-2.08h-4.8a2.4 2.4 0 1 0 0 4.8h.89v1.6h-.88a4 4 0 0 1 0-7.991h4.8L6.54 1.13 7.675 0l3.43 3.432v1.13zM16.62 24h-9.6l-.8-.8V10.412l.8-.8h9.6l.8.8V23.2l-.8.8zm-8.8-1.6h8V11.212h-8V22.4zm5.6-20.798h9.6l.8.8v12.786l-.8.8h-4v-1.6h3.2V3.2h-8v4.787h-1.6V2.401l.8-.8zm.8 11.186h-4.8v1.6h4.8v-1.6zm-4.8 3.2h4.8v1.6h-4.8v-1.6zm4.8 3.2h-4.8v1.6h4.8v-1.6zm1.6-14.4h4.8v1.6h-4.8v-1.6zm4.8 6.4h-1.6v1.6h1.6v-1.6zm-3.338-3.176v-.024h3.338v1.6h-1.762l-1.576-1.576z"},child:[]}]})(t)}function wF(t){return ft({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(t)}function cre(t){return ft({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.353 1.146l1.5 1.5L15 3v11.5l-.5.5h-13l-.5-.5v-13l.5-.5H13l.353.146zM2 2v12h12V3.208L12.793 2H11v4H4V2H2zm6 0v3h2V2H8z"},child:[]}]})(t)}function X$e(){const t=pT(e=>e.message);return t&&x.jsxs(x.Fragment,{children:[x.jsx(cre,{className:"ml-4 h-3 w-3 text-setta-400 dark:text-setta-50"}),x.jsx("p",{className:"ml-2 self-center text-xs text-setta-500 dark:text-setta-100",children:t})]})}function Hm(t){const e=t+"CollectionProvider",[n,r]=Oo(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=d=>{const{scope:p,children:g}=d,m=ke.useRef(null),v=ke.useRef(new Map).current;return ke.createElement(i,{scope:p,itemMap:v,collectionRef:m},g)},a=t+"CollectionSlot",l=ke.forwardRef((d,p)=>{const{scope:g,children:m}=d,v=s(a,g),y=In(p,v.collectionRef);return ke.createElement(am,{ref:y},m)}),c=t+"CollectionItemSlot",u="data-radix-collection-item",f=ke.forwardRef((d,p)=>{const{scope:g,children:m,...v}=d,y=ke.useRef(null),b=In(p,y),S=s(c,g);return ke.useEffect(()=>(S.itemMap.set(y,{ref:y,...v}),()=>void S.itemMap.delete(y))),ke.createElement(am,{[u]:"",ref:b},m)});function h(d){const p=s(t+"CollectionConsumer",d);return ke.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const v=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,k)=>v.indexOf(S.ref.current)-v.indexOf(k.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},h,r]}const H$e=_.createContext(void 0);function jd(t){const e=_.useContext(H$e);return t||e||"ltr"}const Z$e=Dp["useId".toString()]||(()=>{});let Y$e=0;function ff(t){const[e,n]=_.useState(Z$e());return Pc(()=>{t||n(r=>r??String(Y$e++))},[t]),t||(e?`radix-${e}`:"")}function G$e(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const DT="dismissableLayer.update",K$e="dismissableLayer.pointerDownOutside",J$e="dismissableLayer.focusOutside";let SF;const eMe=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ure=_.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=t,u=_.useContext(eMe),[f,h]=_.useState(null),d=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),g=In(e,C=>h(C)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=f?m.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,E=tMe(C=>{const A=C.target,R=[...u.branches].some(Q=>Q.contains(A));!k||R||(s==null||s(C),a==null||a(C),C.defaultPrevented||l==null||l())},d),T=nMe(C=>{const A=C.target;[...u.branches].some(Q=>Q.contains(A))||(o==null||o(C),a==null||a(C),C.defaultPrevented||l==null||l())},d);return G$e(C=>{b===u.layers.size-1&&(i==null||i(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},d),_.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(SF=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),_F(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=SF)}},[f,d,r,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),_F())},[f,u]),_.useEffect(()=>{const C=()=>p({});return document.addEventListener(DT,C),()=>document.removeEventListener(DT,C)},[]),_.createElement(gn.div,Ee({},c,{ref:g,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:gt(t.onFocusCapture,T.onFocusCapture),onBlurCapture:gt(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:gt(t.onPointerDownCapture,E.onPointerDownCapture)}))});function tMe(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){fre(K$e,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function nMe(t,e=globalThis==null?void 0:globalThis.document){const n=$a(t),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&fre(J$e,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _F(){const t=new CustomEvent(DT);document.dispatchEvent(t)}function fre(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?nre(i,s):i.dispatchEvent(s)}let M6=0;function hre(){_.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:kF()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:kF()),M6++,()=>{M6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),M6--}},[])}function kF(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const I6="focusScope.autoFocusOnMount",D6="focusScope.autoFocusOnUnmount",CF={bubbles:!1,cancelable:!0},dre=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=_.useState(null),c=$a(i),u=$a(s),f=_.useRef(null),h=In(e,g=>l(g)),d=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(d.paused||!a)return;const S=b.target;a.contains(S)?f.current=S:Eh(f.current,{select:!0})},y=function(b){d.paused||!a||a.contains(b.relatedTarget)||Eh(f.current,{select:!0})};var g=v,m=y;return document.addEventListener("focusin",v),document.addEventListener("focusout",y),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y)}}},[r,a,d.paused]),_.useEffect(()=>{if(a){TF.add(d);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(I6,CF);a.addEventListener(I6,c),a.dispatchEvent(v),v.defaultPrevented||(rMe(lMe(pre(a)),{select:!0}),document.activeElement===g&&Eh(a))}return()=>{a.removeEventListener(I6,c),setTimeout(()=>{const v=new CustomEvent(D6,CF);a.addEventListener(D6,u),a.dispatchEvent(v),v.defaultPrevented||Eh(g??document.body,{select:!0}),a.removeEventListener(D6,u),TF.remove(d)},0)}}},[a,c,u,d]);const p=_.useCallback(g=>{if(!n&&!r||d.paused)return;const m=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(m&&v){const y=g.currentTarget,[b,S]=iMe(y);b&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Eh(b,{select:!0})):g.shiftKey&&v===b&&(g.preventDefault(),n&&Eh(S,{select:!0})):v===y&&g.preventDefault()}},[n,r,d.paused]);return _.createElement(gn.div,Ee({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function rMe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Eh(r,{select:e}),document.activeElement!==n)return}function iMe(t){const e=pre(t),n=EF(e,t),r=EF(e.reverse(),t);return[n,r]}function pre(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function EF(t,e){for(const n of t)if(!sMe(n,{upTo:e}))return n}function sMe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oMe(t){return t instanceof HTMLInputElement&&"select"in t}function Eh(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&oMe(t)&&e&&t.select()}}const TF=aMe();function aMe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=PF(t,e),t.unshift(e)},remove(e){var n;t=PF(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function PF(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function lMe(t){return t.filter(e=>e.tagName!=="A")}function Bd(t){return t.split("-")[0]}function My(t){return t.split("-")[1]}function Zm(t){return["top","bottom"].includes(Bd(t))?"x":"y"}function oM(t){return t==="y"?"height":"width"}function AF(t,e,n){let{reference:r,floating:i}=t;const s=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,a=Zm(e),l=oM(a),c=r[l]/2-i[l]/2,u=a==="x";let f;switch(Bd(e)){case"top":f={x:s,y:r.y-i.height};break;case"bottom":f={x:s,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(My(e)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(n&&u?-1:1)}return f}const cMe=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:u}=AF(l,r,a),f=r,h={},d=0;for(let p=0;p<s.length;p++){const{name:g,fn:m}=s[p],{x:v,y,data:b,reset:S}=await m({x:c,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:l,platform:o,elements:{reference:t,floating:e}});c=v??c,u=y??u,h={...h,[g]:{...h[g],...b}},S&&d<=50&&(d++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(l=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:c,y:u}=AF(l,f,a)),p=-1)}return{x:c,y:u,placement:f,strategy:i,middlewareData:h}};function mre(t){return typeof t!="number"?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(t):{top:t,right:t,bottom:t,left:t}}function O_(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function aO(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=e,p=mre(d),g=a[h?f==="floating"?"reference":"floating":f],m=O_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=O_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...o.floating,x:r,y:i}:o.reference,offsetParent:await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),strategy:l}):o[f]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const uMe=Math.min,Th=Math.max;function LT(t,e,n){return Th(t,uMe(e,n))}const RF=t=>({name:"arrow",options:t,async fn(e){const{element:n,padding:r=0}=t??{},{x:i,y:s,placement:o,rects:a,platform:l}=e;if(n==null)return{};const c=mre(r),u={x:i,y:s},f=Zm(o),h=My(o),d=oM(f),p=await l.getDimensions(n),g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=a.reference[d]+a.reference[f]-u[f]-a.floating[d],y=u[f]-a.reference[f],b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let S=b?f==="y"?b.clientHeight||0:b.clientWidth||0:0;S===0&&(S=a.floating[d]);const k=v/2-y/2,E=c[g],T=S-p[d]-c[m],C=S/2-p[d]/2+k,A=LT(E,C,T),R=(h==="start"?c[g]:c[m])>0&&C!==A&&a.reference[d]<=a.floating[d];return{[f]:u[f]-(R?C<E?E-C:T-C:0),data:{[f]:A,centerOffset:C-A}}}}),fMe={left:"right",right:"left",bottom:"top",top:"bottom"};function y_(t){return t.replace(/left|right|bottom|top/g,e=>fMe[e])}function hMe(t,e,n){n===void 0&&(n=!1);const r=My(t),i=Zm(t),s=oM(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=y_(o)),{main:o,cross:y_(o)}}const dMe={start:"end",end:"start"};function $F(t){return t.replace(/start|end/g,e=>dMe[e])}const gre=["top","right","bottom","left"];gre.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);const pMe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:i,rects:s,initialPlacement:o,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",flipAlignment:d=!0,...p}=t,g=Bd(r),m=f||(g===o||!d?[y_(o)]:function(C){const A=y_(C);return[$F(C),A,$F(A)]}(o)),v=[o,...m],y=await aO(e,p),b=[];let S=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:C,cross:A}=hMe(r,s,await(a.isRTL==null?void 0:a.isRTL(l.floating)));b.push(y[C],y[A])}if(S=[...S,{placement:r,overflows:b}],!b.every(C=>C<=0)){var k,E;const C=((k=(E=i.flip)==null?void 0:E.index)!=null?k:0)+1,A=v[C];if(A)return{data:{index:C,overflows:S},reset:{placement:A}};let R="bottom";switch(h){case"bestFit":{var T;const Q=(T=S.map(L=>[L,L.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((L,z)=>L[1]-z[1])[0])==null?void 0:T[0].placement;Q&&(R=Q);break}case"initialPlacement":R=o}if(r!==R)return{reset:{placement:R}}}return{}}}};function MF(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IF(t){return gre.some(e=>t[e]>=0)}const mMe=function(t){let{strategy:e="referenceHidden",...n}=t===void 0?{}:t;return{name:"hide",async fn(r){const{rects:i}=r;switch(e){case"referenceHidden":{const s=MF(await aO(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:IF(s)}}}case"escaped":{const s=MF(await aO(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:s,escaped:IF(s)}}}default:return{}}}}},gMe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,i=await async function(s,o){const{placement:a,platform:l,elements:c}=s,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Bd(a),h=My(a),d=Zm(a)==="x",p=["left","top"].includes(f)?-1:1,g=u&&d?-1:1,m=typeof o=="function"?o(s):o;let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return h&&typeof b=="number"&&(y=h==="end"?-1*b:b),d?{x:y*g,y:v*p}:{x:v*p,y:y*g}}(e,t);return{x:n+i.x,y:r+i.y,data:i}}}};function vre(t){return t==="x"?"y":"x"}const vMe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=t,c={x:n,y:r},u=await aO(e,l),f=Zm(Bd(i)),h=vre(f);let d=c[f],p=c[h];if(s){const m=f==="y"?"bottom":"right";d=LT(d+u[f==="y"?"top":"left"],d,d-u[m])}if(o){const m=h==="y"?"bottom":"right";p=LT(p+u[h==="y"?"top":"left"],p,p-u[m])}const g=a.fn({...e,[f]:d,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},OMe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=t,u={x:n,y:r},f=Zm(i),h=vre(f);let d=u[f],p=u[h];const g=typeof a=="function"?a({...s,placement:i}):a,m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const k=f==="y"?"height":"width",E=s.reference[f]-s.floating[k]+m.mainAxis,T=s.reference[f]+s.reference[k]-m.mainAxis;d<E?d=E:d>T&&(d=T)}if(c){var v,y,b,S;const k=f==="y"?"width":"height",E=["top","left"].includes(Bd(i)),T=s.reference[h]-s.floating[k]+(E&&(v=(y=o.offset)==null?void 0:y[h])!=null?v:0)+(E?0:m.crossAxis),C=s.reference[h]+s.reference[k]+(E?0:(b=(S=o.offset)==null?void 0:S[h])!=null?b:0)-(E?m.crossAxis:0);p<T?p=T:p>C&&(p=C)}return{[f]:d,[h]:p}}}},yMe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:o,...a}=t,l=await aO(e,a),c=Bd(n),u=My(n);let f,h;c==="top"||c==="bottom"?(f=c,h=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(h=c,f=u==="end"?"top":"bottom");const d=Th(l.left,0),p=Th(l.right,0),g=Th(l.top,0),m=Th(l.bottom,0),v={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(g!==0||m!==0?g+m:Th(l.top,l.bottom)):l[f]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(d!==0||p!==0?d+p:Th(l.left,l.right)):l[h])},y=await i.getDimensions(s.floating);o==null||o({...e,...v});const b=await i.getDimensions(s.floating);return y.width!==b.width||y.height!==b.height?{reset:{rects:!0}}:{}}}};function Ore(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function lu(t){if(t==null)return window;if(!Ore(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function Iy(t){return lu(t).getComputedStyle(t)}function Lc(t){return Ore(t)?"":t?(t.nodeName||"").toLowerCase():""}function yre(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function Tl(t){return t instanceof lu(t).HTMLElement}function _f(t){return t instanceof lu(t).Element}function aM(t){return typeof ShadowRoot>"u"?!1:t instanceof lu(t).ShadowRoot||t instanceof ShadowRoot}function X5(t){const{overflow:e,overflowX:n,overflowY:r}=Iy(t);return/auto|scroll|overlay|hidden/.test(e+r+n)}function bMe(t){return["table","td","th"].includes(Lc(t))}function DF(t){const e=/firefox/i.test(yre()),n=Iy(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&!!n.filter&&n.filter!=="none"}function bre(){return!/^((?!chrome|android).)*safari/i.test(yre())}const LF=Math.min,nv=Math.max,b_=Math.round;function Nc(t,e,n){var r,i,s,o;e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect();let l=1,c=1;e&&Tl(t)&&(l=t.offsetWidth>0&&b_(a.width)/t.offsetWidth||1,c=t.offsetHeight>0&&b_(a.height)/t.offsetHeight||1);const u=_f(t)?lu(t):window,f=!bre()&&n,h=(a.left+(f&&(r=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,d=(a.top+(f&&(s=(o=u.visualViewport)==null?void 0:o.offsetTop)!=null?s:0))/c,p=a.width/l,g=a.height/c;return{width:p,height:g,top:d,right:h+p,bottom:d+g,left:h,x:h,y:d}}function hf(t){return(e=t,(e instanceof lu(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function H5(t){return _f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function xre(t){return Nc(hf(t)).left+H5(t).scrollLeft}function xMe(t,e,n){const r=Tl(e),i=hf(e),s=Nc(t,r&&function(l){const c=Nc(l);return b_(c.width)!==l.offsetWidth||b_(c.height)!==l.offsetHeight}(e),n==="fixed");let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Lc(e)!=="body"||X5(i))&&(o=H5(e)),Tl(e)){const l=Nc(e,!0);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else i&&(a.x=xre(i));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}function wre(t){return Lc(t)==="html"?t:t.assignedSlot||t.parentNode||(aM(t)?t.host:null)||hf(t)}function NF(t){return Tl(t)&&getComputedStyle(t).position!=="fixed"?t.offsetParent:null}function NT(t){const e=lu(t);let n=NF(t);for(;n&&bMe(n)&&getComputedStyle(n).position==="static";)n=NF(n);return n&&(Lc(n)==="html"||Lc(n)==="body"&&getComputedStyle(n).position==="static"&&!DF(n))?e:n||function(r){let i=wre(r);for(aM(i)&&(i=i.host);Tl(i)&&!["html","body"].includes(Lc(i));){if(DF(i))return i;i=i.parentNode}return null}(t)||e}function QF(t){if(Tl(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=Nc(t);return{width:e.width,height:e.height}}function Sre(t){const e=wre(t);return["html","body","#document"].includes(Lc(e))?t.ownerDocument.body:Tl(e)&&X5(e)?e:Sre(e)}function x_(t,e){var n;e===void 0&&(e=[]);const r=Sre(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=lu(r),o=i?[s].concat(s.visualViewport||[],X5(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(x_(o))}function jF(t,e,n){return e==="viewport"?O_(function(r,i){const s=lu(r),o=hf(r),a=s.visualViewport;let l=o.clientWidth,c=o.clientHeight,u=0,f=0;if(a){l=a.width,c=a.height;const h=bre();(h||!h&&i==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}return{width:l,height:c,x:u,y:f}}(t,n)):_f(e)?function(r,i){const s=Nc(r,!1,i==="fixed"),o=s.top+r.clientTop,a=s.left+r.clientLeft;return{top:o,left:a,x:a,y:o,right:a+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(e,n):O_(function(r){var i;const s=hf(r),o=H5(r),a=(i=r.ownerDocument)==null?void 0:i.body,l=nv(s.scrollWidth,s.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),c=nv(s.scrollHeight,s.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let u=-o.scrollLeft+xre(r);const f=-o.scrollTop;return Iy(a||s).direction==="rtl"&&(u+=nv(s.clientWidth,a?a.clientWidth:0)-l),{width:l,height:c,x:u,y:f}}(hf(t)))}function wMe(t){const e=x_(t),n=["absolute","fixed"].includes(Iy(t).position)&&Tl(t)?NT(t):t;return _f(n)?e.filter(r=>_f(r)&&function(i,s){const o=s.getRootNode==null?void 0:s.getRootNode();if(i.contains(s))return!0;if(o&&aM(o)){let a=s;do{if(a&&i===a)return!0;a=a.parentNode||a.host}while(a)}return!1}(r,n)&&Lc(r)!=="body"):[]}const SMe={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?wMe(e):[].concat(n),r],o=s[0],a=s.reduce((l,c)=>{const u=jF(e,c,i);return l.top=nv(u.top,l.top),l.right=LF(u.right,l.right),l.bottom=LF(u.bottom,l.bottom),l.left=nv(u.left,l.left),l},jF(e,o,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Tl(n),s=hf(n);if(n===s)return e;let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((i||!i&&r!=="fixed")&&((Lc(n)!=="body"||X5(s))&&(o=H5(n)),Tl(n))){const l=Nc(n,!0);a.x=l.x+n.clientLeft,a.y=l.y+n.clientTop}return{...e,x:e.x-o.scrollLeft+a.x,y:e.y-o.scrollTop+a.y}},isElement:_f,getDimensions:QF,getOffsetParent:NT,getDocumentElement:hf,getElementRects:t=>{let{reference:e,floating:n,strategy:r}=t;return{reference:xMe(e,NT(n),r),floating:{...QF(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>Iy(t).direction==="rtl"};function _Me(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,l=i&&!a,c=s&&!a,u=l||c?[..._f(t)?x_(t):[],...x_(e)]:[];u.forEach(p=>{l&&p.addEventListener("scroll",n,{passive:!0}),c&&p.addEventListener("resize",n)});let f,h=null;if(o){let p=!0;h=new ResizeObserver(()=>{p||n(),p=!1}),_f(t)&&!a&&h.observe(t),h.observe(e)}let d=a?Nc(t):null;return a&&function p(){const g=Nc(t);!d||g.x===d.x&&g.y===d.y&&g.width===d.width&&g.height===d.height||n(),d=g,f=requestAnimationFrame(p)}(),n(),()=>{var p;u.forEach(g=>{l&&g.removeEventListener("scroll",n),c&&g.removeEventListener("resize",n)}),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(f)}}const kMe=(t,e,n)=>cMe(t,e,{platform:SMe,...n});var QT=typeof document<"u"?_.useLayoutEffect:_.useEffect;function jT(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!jT(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!jT(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function CMe(t){const e=_.useRef(t);return QT(()=>{e.current=t}),e}function EMe(t){let{middleware:e,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=t===void 0?{}:t;const s=_.useRef(null),o=_.useRef(null),a=CMe(i),l=_.useRef(null),[c,u]=_.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[f,h]=_.useState(e);jT(f==null?void 0:f.map(b=>{let{options:S}=b;return S}),e==null?void 0:e.map(b=>{let{options:S}=b;return S}))||h(e);const d=_.useCallback(()=>{!s.current||!o.current||kMe(s.current,o.current,{middleware:f,placement:n,strategy:r}).then(b=>{p.current&&Qi.flushSync(()=>{u(b)})})},[f,n,r]);QT(()=>{p.current&&d()},[d]);const p=_.useRef(!1);QT(()=>(p.current=!0,()=>{p.current=!1}),[]);const g=_.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),s.current&&o.current)if(a.current){const b=a.current(s.current,o.current,d);l.current=b}else d()},[d,a]),m=_.useCallback(b=>{s.current=b,g()},[g]),v=_.useCallback(b=>{o.current=b,g()},[g]),y=_.useMemo(()=>({reference:s,floating:o}),[]);return _.useMemo(()=>({...c,update:d,refs:y,reference:m,floating:v}),[c,d,y,m,v])}const TMe=t=>{const{element:e,padding:n}=t;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:t,fn(i){return r(e)?e.current!=null?RF({element:e.current,padding:n}).fn(i):{}:e?RF({element:e,padding:n}).fn(i):{}}}},PMe=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return _.createElement(gn.svg,Ee({},s,{ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:_.createElement("polygon",{points:"0,0 30,0 15,10"}))}),AMe=PMe,_re="Popper",[lM,Z5]=Oo(_re),[RMe,kre]=lM(_re),$Me=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return _.createElement(RMe,{scope:e,anchor:r,onAnchorChange:i},n)},MMe="PopperAnchor",IMe=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=kre(MMe,n),o=_.useRef(null),a=In(e,o);return _.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:_.createElement(gn.div,Ee({},i,{ref:a}))}),w_="PopperContent",[DMe,LMe]=lM(w_),[NMe,QMe]=lM(w_,{hasParent:!1,positionUpdateFns:new Set}),jMe=_.forwardRef((t,e)=>{var n,r,i,s,o,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:h=0,align:d="center",alignOffset:p=0,arrowPadding:g=0,collisionBoundary:m=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:b=!1,avoidCollisions:S=!0,onPlaced:k,...E}=t,T=kre(w_,u),[C,A]=_.useState(null),R=In(e,ze=>A(ze)),[Q,L]=_.useState(null),z=V5(Q),B=(n=z==null?void 0:z.width)!==null&&n!==void 0?n:0,q=(r=z==null?void 0:z.height)!==null&&r!==void 0?r:0,Z=f+(d!=="center"?"-"+d:""),J=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},I=Array.isArray(m)?m:[m],j=I.length>0,M={padding:J,boundary:I.filter(VMe),altBoundary:j},{reference:X,floating:se,strategy:H,x:de,y:fe,placement:ve,middlewareData:F,update:oe}=EMe({strategy:"fixed",placement:Z,whileElementsMounted:_Me,middleware:[UMe(),gMe({mainAxis:h+q,alignmentAxis:p}),S?vMe({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?OMe():void 0,...M}):void 0,Q?TMe({element:Q,padding:g}):void 0,S?pMe({...M}):void 0,yMe({...M,apply:({elements:ze,availableWidth:Ye,availableHeight:we})=>{ze.floating.style.setProperty("--radix-popper-available-width",`${Ye}px`),ze.floating.style.setProperty("--radix-popper-available-height",`${we}px`)}}),qMe({arrowWidth:B,arrowHeight:q}),b?mMe({strategy:"referenceHidden"}):void 0].filter(WMe)});Pc(()=>{X(T.anchor)},[X,T.anchor]);const le=de!==null&&fe!==null,[pe,De]=Cre(ve),xe=$a(k);Pc(()=>{le&&(xe==null||xe())},[le,xe]);const je=(i=F.arrow)===null||i===void 0?void 0:i.x,He=(s=F.arrow)===null||s===void 0?void 0:s.y,nt=((o=F.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[xt,Ze]=_.useState();Pc(()=>{C&&Ze(window.getComputedStyle(C).zIndex)},[C]);const{hasParent:Oe,positionUpdateFns:be}=QMe(w_,u),Re=!Oe;_.useLayoutEffect(()=>{if(!Re)return be.add(oe),()=>{be.delete(oe)}},[Re,be,oe]),Pc(()=>{Re&&le&&Array.from(be).reverse().forEach(ze=>requestAnimationFrame(ze))},[Re,le,be]);const Ke={"data-side":pe,"data-align":De,...E,ref:R,style:{...E.style,animation:le?void 0:"none",opacity:(a=F.hide)!==null&&a!==void 0&&a.referenceHidden?0:void 0}};return _.createElement("div",{ref:se,"data-radix-popper-content-wrapper":"",style:{position:H,left:0,top:0,transform:le?`translate3d(${Math.round(de)}px, ${Math.round(fe)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:xt,["--radix-popper-transform-origin"]:[(l=F.transformOrigin)===null||l===void 0?void 0:l.x,(c=F.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},_.createElement(DMe,{scope:u,placedSide:pe,onArrowChange:L,arrowX:je,arrowY:He,shouldHideArrow:nt},Re?_.createElement(NMe,{scope:u,hasParent:!0,positionUpdateFns:be},_.createElement(gn.div,Ke)):_.createElement(gn.div,Ke)))}),BMe="PopperArrow",zMe={top:"bottom",right:"left",bottom:"top",left:"right"},FMe=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=LMe(BMe,r),o=zMe[s.placedSide];return _.createElement("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0}},_.createElement(AMe,Ee({},i,{ref:n,style:{...i.style,display:"block"}})))});function WMe(t){return t!==void 0}function VMe(t){return t!==null}const UMe=()=>({name:"anchorCssProperties",fn(t){const{rects:e,elements:n}=t,{width:r,height:i}=e.reference;return n.floating.style.setProperty("--radix-popper-anchor-width",`${r}px`),n.floating.style.setProperty("--radix-popper-anchor-height",`${i}px`),{}}}),qMe=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,s,o;const{placement:a,rects:l,middlewareData:c}=e,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=f?0:t.arrowWidth,d=f?0:t.arrowHeight,[p,g]=Cre(a),m={start:"0%",center:"50%",end:"100%"}[g],v=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+h/2,y=((s=(o=c.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+d/2;let b="",S="";return p==="bottom"?(b=f?m:`${v}px`,S=`${-d}px`):p==="top"?(b=f?m:`${v}px`,S=`${l.floating.height+d}px`):p==="right"?(b=`${-d}px`,S=f?m:`${y}px`):p==="left"&&(b=`${l.floating.width+d}px`,S=f?m:`${y}px`),{data:{x:b,y:S}}}});function Cre(t){const[e,n="center"]=t.split("-");return[e,n]}const Ere=$Me,Tre=IMe,Pre=jMe,XMe=FMe,Are=_.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?$R.createPortal(_.createElement(gn.div,Ee({},i,{ref:e})),r):null});function HMe(t,e){return _.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const zd=t=>{const{present:e,children:n}=t,r=ZMe(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=In(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};zd.displayName="Presence";function ZMe(t){const[e,n]=_.useState(),r=_.useRef({}),i=_.useRef(t),s=_.useRef("none"),o=t?"mounted":"unmounted",[a,l]=HMe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=jx(r.current);s.current=a==="mounted"?c:"none"},[a]),Pc(()=>{const c=r.current,u=i.current;if(u!==t){const h=s.current,d=jx(c);t?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Pc(()=>{if(e){const c=f=>{const d=jx(r.current).includes(f.animationName);f.target===e&&d&&Qi.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=jx(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function jx(t){return(t==null?void 0:t.animationName)||"none"}const L6="rovingFocusGroup.onEntryFocus",YMe={bubbles:!1,cancelable:!0},cM="RovingFocusGroup",[BT,Rre,GMe]=Hm(cM),[KMe,Y5]=Oo(cM,[GMe]),[JMe,eIe]=KMe(cM),tIe=_.forwardRef((t,e)=>_.createElement(BT.Provider,{scope:t.__scopeRovingFocusGroup},_.createElement(BT.Slot,{scope:t.__scopeRovingFocusGroup},_.createElement(nIe,Ee({},t,{ref:e}))))),nIe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=t,f=_.useRef(null),h=In(e,f),d=jd(s),[p=null,g]=Nl({prop:o,defaultProp:a,onChange:l}),[m,v]=_.useState(!1),y=$a(c),b=Rre(n),S=_.useRef(!1),[k,E]=_.useState(0);return _.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(L6,y),()=>T.removeEventListener(L6,y)},[y]),_.createElement(JMe,{scope:n,orientation:r,dir:d,loop:i,currentTabStopId:p,onItemFocus:_.useCallback(T=>g(T),[g]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:_.useCallback(()=>E(T=>T-1),[])},_.createElement(gn.div,Ee({tabIndex:m||k===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...t.style},onMouseDown:gt(t.onMouseDown,()=>{S.current=!0}),onFocus:gt(t.onFocus,T=>{const C=!S.current;if(T.target===T.currentTarget&&C&&!m){const A=new CustomEvent(L6,YMe);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=b().filter(q=>q.focusable),Q=R.find(q=>q.active),L=R.find(q=>q.id===p),B=[Q,L,...R].filter(Boolean).map(q=>q.ref.current);$re(B)}}S.current=!1}),onBlur:gt(t.onBlur,()=>v(!1))})))}),rIe="RovingFocusGroupItem",iIe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,a=ff(),l=s||a,c=eIe(rIe,n),u=c.currentTabStopId===l,f=Rre(n),{onFocusableItemAdd:h,onFocusableItemRemove:d}=c;return _.useEffect(()=>{if(r)return h(),()=>d()},[r,h,d]),_.createElement(BT.ItemSlot,{scope:n,id:l,focusable:r,active:i},_.createElement(gn.span,Ee({tabIndex:u?0:-1,"data-orientation":c.orientation},o,{ref:e,onMouseDown:gt(t.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:gt(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:gt(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=aIe(p,c.orientation,c.dir);if(g!==void 0){p.preventDefault();let v=f().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(p.currentTarget);v=c.loop?lIe(v,y+1):v.slice(y+1)}setTimeout(()=>$re(v))}})})))}),sIe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oIe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function aIe(t,e,n){const r=oIe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sIe[r]}function $re(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function lIe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const Mre=tIe,Ire=iIe;var cIe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},x0=new WeakMap,Bx=new WeakMap,zx={},N6=0,Dre=function(t){return t&&(t.host||Dre(t.parentNode))},uIe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Dre(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},fIe=function(t,e,n,r){var i=uIe(e,Array.isArray(t)?t:[t]);zx[n]||(zx[n]=new WeakMap);var s=zx[n],o=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var d=h.getAttribute(r),p=d!==null&&d!=="false",g=(x0.get(h)||0)+1,m=(s.get(h)||0)+1;x0.set(h,g),s.set(h,m),o.push(h),g===1&&p&&Bx.set(h,!0),m===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(e),a.clear(),N6++,function(){o.forEach(function(f){var h=x0.get(f)-1,d=s.get(f)-1;x0.set(f,h),s.set(f,d),h||(Bx.has(f)||f.removeAttribute(r),Bx.delete(f)),d||f.removeAttribute(n)}),N6--,N6||(x0=new WeakMap,x0=new WeakMap,Bx=new WeakMap,zx={})}},G5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=e||cIe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),fIe(r,i,n,"aria-hidden")):function(){return null}},Fr=function(){return Fr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fr.apply(this,arguments)};function uM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ym(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function Gm(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function BF(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function S_(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var rv="right-scroll-bar-position",iv="width-before-scroll-bar",hIe="with-scroll-bars-hidden",dIe="--removed-body-scroll-bar-size";function Q6(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function pIe(t,e){var n=_.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var mIe=typeof window<"u"?_.useLayoutEffect:_.useEffect,zF=new WeakMap;function Lre(t,e){var n=pIe(e||null,function(r){return t.forEach(function(i){return Q6(i,r)})});return mIe(function(){var r=zF.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||Q6(a,null)}),s.forEach(function(a){i.has(a)||Q6(a,o)})}zF.set(n,t)},[t]),n}function gIe(t){return t}function vIe(t,e){e===void 0&&(e=gIe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function Nre(t){t===void 0&&(t={});var e=vIe(null);return e.options=Fr({async:!0,ssr:!1},t),e}var Qre=function(t){var e=t.sideCar,n=uM(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,Fr({},n))};Qre.isSideCarExport=!0;function jre(t,e){return t.useMedium(e),Qre}var Bre=Nre(),j6=function(){},K5=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:j6,onWheelCapture:j6,onTouchMoveCapture:j6}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,d=t.noIsolation,p=t.inert,g=t.allowPinchZoom,m=t.as,v=m===void 0?"div":m,y=uM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,S=Lre([n,e]),k=Fr(Fr({},y),i);return _.createElement(_.Fragment,null,u&&_.createElement(b,{sideCar:Bre,removeScrollBar:c,shards:f,noIsolation:d,inert:p,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),o?_.cloneElement(_.Children.only(a),Fr(Fr({},k),{ref:S})):_.createElement(v,Fr({},k,{className:l,ref:S}),a))});K5.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K5.classNames={fullWidth:iv,zeroRight:rv};var FF,OIe=function(){if(FF)return FF;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yIe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=OIe();return e&&t.setAttribute("nonce",e),t}function bIe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function xIe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var wIe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=yIe())&&(bIe(e,n),xIe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},SIe=function(){var t=wIe();return function(e,n){_.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},fM=function(){var t=SIe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},_Ie={left:0,top:0,right:0,gap:0},B6=function(t){return parseInt(t||"",10)||0},kIe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[B6(n),B6(r),B6(i)]},CIe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return _Ie;var e=kIe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},EIe=fM(),yp="data-scroll-locked",TIe=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
228
228
|
.`.concat(hIe,` {
|
229
229
|
overflow: hidden `).concat(r,`;
|
230
230
|
padding-right: `).concat(a,"px ").concat(r,`;
|
setta/static/frontend/index.html
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
<title>setta.dev</title>
|
18
|
-
<script type="module" crossorigin src="/static/assets/index-
|
18
|
+
<script type="module" crossorigin src="/static/assets/index-8204c872.js"></script>
|
19
19
|
<link rel="stylesheet" href="/static/assets/index-af271c9f.css">
|
20
20
|
</head>
|
21
21
|
<body>
|
setta/tasks/utils.py
CHANGED
@@ -22,8 +22,9 @@ def import_code_from_string(code_string, module_name=None, add_to_sys_modules=Tr
|
|
22
22
|
module_name = f"setta_dynamic_module_{uuid.uuid4().hex}"
|
23
23
|
|
24
24
|
# Add current directory to sys.path if it's not already there
|
25
|
-
|
26
|
-
|
25
|
+
current_dir = str(CWD)
|
26
|
+
if current_dir not in sys.path:
|
27
|
+
sys.path.insert(0, current_dir)
|
27
28
|
|
28
29
|
spec = importlib.util.spec_from_loader(module_name, loader=None)
|
29
30
|
|
@@ -207,7 +208,7 @@ class SettaInMemoryFnSubprocess:
|
|
207
208
|
stdout_data = self.stdout_parent_conn.recv()
|
208
209
|
self.stdout_queue.put(stdout_data) # simple put, no async needed
|
209
210
|
except Exception as e:
|
210
|
-
if self.
|
211
|
+
if self.stop_event.is_set():
|
211
212
|
break
|
212
213
|
logger.debug(f"Error in stdout listener: {e}")
|
213
214
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
setta/__init__.py,sha256=
|
1
|
+
setta/__init__.py,sha256=cV5ZJ0nKQ0BD5ipgUnvoF_BQ4MrFlNUviVmsg_xgKWE,27
|
2
2
|
setta/server.py,sha256=P78BMFvcCokVhjnVlNIKcmpCSvmzSqt-33bx4bhOe6Y,4626
|
3
3
|
setta/start.py,sha256=jEeSiocLeBitvg48fa6k1CpLnPI63JHkQ8O-WVM6ch8,3078
|
4
4
|
setta/cli/__init__.py,sha256=UxZG_VOMuF6lEBT3teUgTS9ulsK3wt3Gu3BbAQiAmt8,47
|
@@ -108,7 +108,7 @@ setta/static/frontend/browserconfig.xml,sha256=w0iw1t89kA7-965LTfyLYrFzewTQnUWE_
|
|
108
108
|
setta/static/frontend/favicon-16x16.png,sha256=q67Crpy8s3wryu7Y3kffPeysN99Lt4XeFygXhPKize8,740
|
109
109
|
setta/static/frontend/favicon-32x32.png,sha256=4NKXYticYdMrRHmVveHjxqnBU1HWgBT5JyJG8lx3BNE,1027
|
110
110
|
setta/static/frontend/favicon.ico,sha256=02qhEBLsvsgBTZX6dcZElMyivlvrR7Yr6wB8ItEZFsc,15086
|
111
|
-
setta/static/frontend/index.html,sha256=
|
111
|
+
setta/static/frontend/index.html,sha256=6pKKvUKghX6IJ3Osmo1icsm9NVQaqwUXVSKZRfh2noo,1296
|
112
112
|
setta/static/frontend/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
|
113
113
|
setta/static/frontend/mstile-144x144.png,sha256=wQqckmRWre2NCCevevI3rv4j0tcduVMkpYr2tPj73cs,2692
|
114
114
|
setta/static/frontend/mstile-150x150.png,sha256=FUwy6PipTofnhmJB5CdXWYgwy-2inq_sIOdOwdDklcY,2674
|
@@ -184,7 +184,7 @@ setta/static/frontend/assets/cormorant-garamond-latin-700-italic-0bc53e12.woff2,
|
|
184
184
|
setta/static/frontend/assets/cormorant-garamond-latin-ext-700-italic-525738e0.woff2,sha256=Ulc44CPXdUiI5dY86W76HLk7801Fm9_QywCV-8GRtFU,17240
|
185
185
|
setta/static/frontend/assets/cormorant-garamond-vietnamese-700-italic-99563037.woff2,sha256=mVYwN54qI0RLXqyrDGPUNpBHWSJDKjgUyBRWa2FJ_ao,5248
|
186
186
|
setta/static/frontend/assets/erase-5e0448ea.svg,sha256=XgRI6pChr392LJ-pGbwqqkN8OWcJMEtRGX-Gv-90qjw,872
|
187
|
-
setta/static/frontend/assets/index-
|
187
|
+
setta/static/frontend/assets/index-8204c872.js,sha256=3vVnv6_MeYW0qxkfUH5ecJwXxeb4lJevbvhWT60vXxQ,2847453
|
188
188
|
setta/static/frontend/assets/index-af271c9f.css,sha256=ryccn_uul30_aMdIhgzMlq6GcE0D6x8fyfneCdgaY9o,232608
|
189
189
|
setta/static/frontend/assets/inter-all-400-normal-054f12d0.woff,sha256=BU8S0GmcIMyYte4ESEdQJO-WvL2Rb-38m1n0ujdbYxI,128624
|
190
190
|
setta/static/frontend/assets/inter-all-600-normal-c03769e5.woff,sha256=wDdp5VNyQL_IbxcPThD2qI-ETg_QKj7AmCwMCjqDfLE,139072
|
@@ -233,7 +233,7 @@ setta/static/seed/examples/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7x
|
|
233
233
|
setta/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
234
234
|
setta/tasks/task_runner.py,sha256=gMXpfZWFMQbix2MfrHVCKB7BxQCjO8JH2P8cxUmt1ms,849
|
235
235
|
setta/tasks/tasks.py,sha256=dR02kybZnwiGKt3YhlfWgx0fDUPCoDeslrnm8mJcr74,5956
|
236
|
-
setta/tasks/utils.py,sha256=
|
236
|
+
setta/tasks/utils.py,sha256=SFUn2reG9DjinBrdJ84W8CPGqt0XhEQhz5kIS-pNai4,8587
|
237
237
|
setta/tasks/fns/__init__.py,sha256=JhGzzQGaT9BWtF3pOmguh6pzIF9kdG3jdDNLyYZ2w7g,461
|
238
238
|
setta/tasks/fns/codeAreaAutocomplete.py,sha256=gJ5JbjkWDyTothr-UF-YlOxrbVzj2iyOVK7XD3lfhSQ,6416
|
239
239
|
setta/tasks/fns/codeAreaFindTemplateVars.py,sha256=vD9rY8VNPavv6VKa1bnxRPPRDNvFQy6mPIZRl-_3GnY,3708
|
@@ -254,9 +254,9 @@ setta/utils/generate_new_filename.py,sha256=KBLX6paDmTvXR-027TpqQkfijIXc7mCfhen-
|
|
254
254
|
setta/utils/section_contents.py,sha256=V2HQPik6DfSXw4j7IalbP5AZ3OEGCbtL5ub3xL-Q_Qo,4141
|
255
255
|
setta/utils/utils.py,sha256=KjzcvgM3Ab3IcE8vaWYtgBpwzPLKg0LmblnHLoYZJHM,9164
|
256
256
|
setta/utils/websocket_manager.py,sha256=S2lEGZsc2OhW0yKLW9VEcH7wi7ppzTfDMQa_hxf3ovc,3772
|
257
|
-
setta-0.0.3.
|
258
|
-
setta-0.0.3.
|
259
|
-
setta-0.0.3.
|
260
|
-
setta-0.0.3.
|
261
|
-
setta-0.0.3.
|
262
|
-
setta-0.0.3.
|
257
|
+
setta-0.0.3.dev7.dist-info/LICENSE,sha256=us9fuCq9wmiZVzayjKxNZ2iJYF6dROe0Qp57ToCO7XU,11361
|
258
|
+
setta-0.0.3.dev7.dist-info/METADATA,sha256=beIeRi8Q_iwJ0_AwxUYOoSuVtT8QdDeeDz2-DG71-BA,829
|
259
|
+
setta-0.0.3.dev7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
260
|
+
setta-0.0.3.dev7.dist-info/entry_points.txt,sha256=P0qCESy9fWF2q1EQ9JufGldCSnPHplDPn8J6Bgk5hB0,42
|
261
|
+
setta-0.0.3.dev7.dist-info/top_level.txt,sha256=8G4lmRzVOnJ11_DescPVHE6MQZH-o06A0nGsDDV2ngY,6
|
262
|
+
setta-0.0.3.dev7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|