@texturehq/edges 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.manifest.json +32 -4
- package/dist/generated/tailwind-tokens-dark.css +120 -87
- package/dist/generated/tailwind-tokens-light.css +117 -87
- package/dist/generated/viz-runtime.css +193 -0
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +285 -4
- package/dist/index.d.ts +285 -4
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/{server-C1hypeJ9.d.cts → server-Utz6Sv9w.d.cts} +469 -165
- package/dist/{server-C1hypeJ9.d.ts → server-Utz6Sv9w.d.ts} +469 -165
- package/dist/server.cjs +2 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/styles.css +352 -158
- package/dist/theme.css +6 -0
- package/dist/utilities.manifest.json +111 -13
- package/package.json +1 -1
- package/scripts/copy-assets.js +1 -0
- package/scripts/generate-viz-runtime.js +95 -0
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
'use strict';var dt=require('react'),jsxRuntime=require('react/jsx-runtime'),luxon=require('luxon'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Sd=require('@phosphor-icons/react'),reactStately=require('react-stately'),lucideReact=require('lucide-react'),zp=require('react-ace');require('ace-builds/src-noconflict/mode-json'),require('ace-builds/src-noconflict/mode-javascript'),require('ace-builds/src-noconflict/mode-typescript'),require('ace-builds/src-noconflict/mode-html'),require('ace-builds/src-noconflict/mode-css'),require('ace-builds/src-noconflict/mode-markdown'),require('ace-builds/src-noconflict/mode-yaml'),require('ace-builds/src-noconflict/mode-xml'),require('ace-builds/src-noconflict/mode-python'),require('ace-builds/src-noconflict/mode-sql'),require('ace-builds/src-noconflict/theme-github_dark'),require('ace-builds/src-noconflict/theme-github'),require('ace-builds/src-noconflict/ext-language_tools');var curve=require('@visx/curve'),shape=require('@visx/shape'),framerMotion=require('framer-motion'),axis=require('@visx/axis'),scale=require('@visx/scale'),d3Array=require('d3-array'),responsive=require('@visx/responsive'),fileSaver=require('file-saver'),xm=require('papaparse'),Lg=require('react-map-gl');require('mapbox-gl/dist/mapbox-gl.css');var reactDom=require('react-dom'),Vb=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),Ob=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var dt__namespace=/*#__PURE__*/_interopNamespace(dt);var Sd__namespace=/*#__PURE__*/_interopNamespace(Sd);var zp__default=/*#__PURE__*/_interopDefault(zp);var xm__default=/*#__PURE__*/_interopDefault(xm);var Lg__default=/*#__PURE__*/_interopDefault(Lg);var Vb__default=/*#__PURE__*/_interopDefault(Vb);var Ob__default=/*#__PURE__*/_interopDefault(Ob);var Oc=Object.defineProperty;var Hc=(e,t,r)=>t in e?Oc(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var ir=(e,t,r)=>Hc(e,typeof t!="symbol"?t+"":t,r);function Dr(e,t=300){let[r,o]=dt.useState(e);return dt.useEffect(()=>{let n=setTimeout(()=>o(e),t);return ()=>clearTimeout(n)},[e,t]),r}function Ia(e,t){let[r,o]=dt.useState(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.error(`Error reading localStorage key "${e}":`,s),t}});dt.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(r));}catch(s){console.error(`Error writing to localStorage key "${e}":`,s);}},[e,r]);let n=dt.useCallback(s=>{try{o(l=>s instanceof Function?s(l):s);}catch(l){console.error(`Error setting value for localStorage key "${e}":`,l);}},[e]),a=dt.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e),o(t);}catch(s){console.error(`Error removing localStorage key "${e}":`,s);}},[e,t]);return [r,n,a]}var $o=class{constructor(){ir(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},N=new $o;var Xe=(e,t="Yes",r="No")=>e==null?null:e?t:r,Kc=e=>Xe(e,"Enabled","Disabled"),Zc=e=>Xe(e,"On","Off"),Xc=e=>Xe(e,"Active","Inactive"),jc=e=>Xe(e,"True","False"),qc=e=>Xe(e,"\u2713","\u2717"),je=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},Ea=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=je(e);return r===null?t.nullText??null:Xe(r,t.trueText??"Yes",t.falseText??"No")};N.register("boolean",(e,t,r)=>{let o=je(e);return o!==null?Xe(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});N.register("yesNo",e=>{let t=je(e);return t!==null?Xe(t,"Yes","No"):null});N.register("enabledDisabled",e=>{let t=je(e);return t!==null?Kc(t):null});N.register("onOff",e=>{let t=je(e);return t!==null?Zc(t):null});N.register("activeInactive",e=>{let t=je(e);return t!==null?Xc(t):null});N.register("trueFalse",e=>{let t=je(e);return t!==null?jc(t):null});N.register("checkmark",e=>{let t=je(e);return t!==null?qc(t):null});function cr({value:e,formatter:t,emptyClassName:r="text-text-muted",emptyText:o="\u2014"}){if(e==null)return jsxRuntime.jsx("span",{className:r,children:o});if(typeof t=="function")return t(e);if(t&&typeof t=="object"){let n=lr(e,t);return e instanceof Date&&n?jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n}):n||jsxRuntime.jsx("span",{className:r,children:o})}if(!t){if(typeof e=="string")return e;if(e instanceof Date){let n=lr(e,{type:"date"});return jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n})}if(typeof e=="number")return lr(e,{type:"number"});if(typeof e=="boolean")return lr(e,{type:"boolean"})}return String(e)}function ah(e,t,r){return dt__namespace.default.useCallback(o=>cr({value:o,formatter:e,emptyClassName:t,emptyText:r}),[e,t,r])}var E=e=>e==null,Jc=(e,t=0)=>E(e)?null:`${e.toFixed(t)}%`,Qc=e=>E(e)?null:Math.round(e).toString(),ed=(e,t=1)=>E(e)?null:e.toFixed(t),td=(e,t,r=true)=>{if(E(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},rd=(e,t="short")=>E(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),od=(e,t=2)=>E(e)?null:e.toExponential(t),Da=(e,t="USD",r)=>{if(E(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Aa=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},Va=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Da(r,t.currency,t)};N.register("percentage",(e,t)=>typeof e=="number"?Jc(e,typeof t=="number"?t:0):null);N.register("integer",e=>typeof e=="number"?Qc(e):null);N.register("float",(e,t)=>typeof e=="number"?ed(e,typeof t=="number"?t:1):null);N.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:td(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});N.register("compact",(e,t)=>typeof e=="number"?rd(e,t==="long"?"long":"short"):null);N.register("scientific",(e,t)=>typeof e=="number"?od(e,typeof t=="number"?t:2):null);N.register("currency",(e,t,r)=>typeof e=="number"?Da(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);var zo=(e,t=0)=>{if(E(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mA`:`${r.toFixed(t)} mA`},Vr=(e,t=1)=>E(e)?null:`${e.toFixed(t)} A`,Oo=(e,t=2)=>E(e)?null:`${(e/1e3).toFixed(t)} kA`,nd=(e,t)=>{if(E(e))return null;let r=Math.abs(e);return r>=1e3?Oo(e,t??2):r<1?zo(e,t??0):Vr(e,t??1)},Ho=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kA":return Oo(r,o??2);case "mA":return zo(r,o??0);case "A":return Vr(r,o??1)}return t.autoScale!==false?nd(r,o):Vr(r,o??1)};N.register("current",Ho);var ph=zo,mh=Vr,fh=Oo;var it=e=>{if(e==null)return null;if(e instanceof Date)return luxon.DateTime.fromJSDate(e);if(typeof e=="string"){let t=luxon.DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=luxon.DateTime.fromMillis(e);return t.isValid?t:null}return null},ad=(e,t=false,r)=>{if(!e)return null;let o=it(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(luxon.DateTime.DATETIME_SHORT):n.toLocaleString(luxon.DateTime.DATE_SHORT)},sd=e=>{if(!e)return null;let t=it(e);return t?t.toRelative():"Invalid Date"},id=(e,t)=>{if(!e)return null;let r=it(e);return r?(t?r.setZone(t):r).toLocaleString(luxon.DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},ld=e=>{if(!e)return null;let t=it(e);return t?t.toISO():null},cd=(e,t,r)=>{if(!e)return null;let o=it(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},hh=e=>{let t=it(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},Ba=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=it(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=luxon.DateTime.DATE_SHORT;break;case "medium":n.date=luxon.DateTime.DATE_MED;break;case "long":n.date=luxon.DateTime.DATE_FULL;break;case "full":n.date=luxon.DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=luxon.DateTime.TIME_SIMPLE;break;case "medium":n.time=luxon.DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=luxon.DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(luxon.DateTime.DATETIME_SHORT)};N.register("date",(e,t,r)=>ad(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));N.register("relativeTime",e=>sd(e));N.register("fullDateTime",(e,t)=>id(e,typeof t=="string"?t:void 0));N.register("isoString",e=>ld(e));N.register("customDateFormat",(e,t,r)=>typeof t=="string"?cd(e,t,typeof r=="string"?r:void 0):null);var Go=(e,t=1)=>E(e)?null:`${e.toFixed(t)} m`,dd=(e,t=1)=>E(e)?null:`${(e*100).toFixed(t)} cm`,ud=(e,t=0)=>E(e)?null:`${(e*1e3).toFixed(t)} mm`,_o=(e,t=1)=>E(e)?null:`${(e/1e3).toFixed(t)} km`,Wo=(e,t=0)=>E(e)?null:`${e.toFixed(t)} ft`,pd=(e,t=1)=>E(e)?null:`${e.toFixed(t)} in`,Uo=(e,t=1)=>E(e)?null:`${e.toFixed(t)} mi`,Ko=(e,t=0)=>E(e)?null:`${e.toFixed(t)} yd`,Sh=(e,t=1)=>E(e)?null:`${e.toFixed(t)} nm`,Nh=e=>e*3.28084,wh=e=>e/3.28084,Ph=e=>e*1.60934,Th=e=>e/1.60934,kh=e=>e/5280,$a=e=>e*5280,Rh=e=>e/1609.34,Fh=e=>e*1609.34,Lh=e=>e*.9144,Mh=e=>e/.9144,Ih=e=>e*2.54,Eh=e=>e/2.54,za=(e,t=false,r=1)=>{if(E(e))return null;let o=Math.abs(e);return t?o>=1e3?_o(e,r):o<.01?ud(e*1e3,0):o<1?dd(e*100,r):Go(e,r):o<.01?Wo($a(e),0):o<.1?Ko($a(e)/3,0):Uo(e,r)},Oa=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return za(r,n,o)}switch(t.unit){case "km":return _o(r,o);case "ft":return Wo(r,o);case "mi":return Uo(r,o);case "yd":return Ko(r,o);case "m":default:return Go(r,o)}};N.register("miles",(e,t)=>typeof e=="number"?Uo(e,typeof t=="number"?t:1):null);N.register("kilometers",(e,t)=>typeof e=="number"?_o(e,typeof t=="number"?t:1):null);N.register("meters",(e,t)=>typeof e=="number"?Go(e,typeof t=="number"?t:1):null);N.register("feet",(e,t)=>typeof e=="number"?Wo(e,typeof t=="number"?t:0):null);N.register("yards",(e,t)=>typeof e=="number"?Ko(e,typeof t=="number"?t:0):null);N.register("inches",(e,t)=>typeof e=="number"?pd(e,typeof t=="number"?t:1):null);N.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?za(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var Zo=(e,t=1)=>E(e)?null:`${e.toFixed(t)} Wh`,Xo=(e,t=1)=>E(e)?null:`${(e/1e3).toFixed(t)} kWh`,Ha=(e,t=1)=>E(e)?null:`${(e/1e6).toFixed(t)} MWh`,Ga=(e,t=1)=>E(e)?null:`${(e/1e9).toFixed(t)} GWh`,_a=(e,t=1)=>{if(E(e))return null;let r=Math.abs(e);return r>=1e9?Ga(e,t):r>=1e6?Ha(e,t):r>=1e3?Xo(e,t):Zo(e,t)},jo=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.unit)switch(t.unit){case "GWh":return Ga(r,o);case "MWh":return Ha(r,o);case "kWh":return Xo(r,o);case "Wh":return Zo(r,o)}return t.autoScale!==false?_a(r,o):Zo(r,o)};N.register("kWh",e=>typeof e=="number"?Xo(e):null);N.register("autoScaleEnergy",(e,t)=>typeof e=="number"?_a(e,typeof t=="number"?t:1):null);N.register("energy",jo);var Br=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},qo=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():Br(e)},Wa=e=>e?e.startsWith("+")||e.length>11?qo(e):Br(e):null,Ua=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return qo(r);switch(t.country){case "US":case "CA":return Br(r);default:return Wa(r)}};N.register("phoneNumber",e=>typeof e=="string"?Wa(e):null);N.register("usPhone",e=>typeof e=="string"?Br(e):null);N.register("internationalPhone",e=>typeof e=="string"?qo(e):null);var $r=(e,t=0)=>E(e)?null:t===0?`${Math.round(e)} W`:`${e.toFixed(t)} W`,Yo=(e,t=1)=>E(e)?null:`${(e/1e3).toFixed(t)} kW`,Jo=(e,t=1)=>E(e)?null:`${(e/1e6).toFixed(t)} MW`,Qo=(e,t=2)=>E(e)?null:`${(e/1e9).toFixed(t)} GW`,md=(e,t)=>{if(E(e))return null;let r=Math.abs(e);return r>=1e9?Qo(e,t??2):r>=1e6?Jo(e,t??1):r>=1e3?Yo(e,t??1):$r(e,t??0)},en=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "GW":return Qo(r,o??2);case "MW":return Jo(r,o??1);case "kW":return Yo(r,o??1);case "W":return $r(r,o??0)}return t.autoScale!==false?md(r,o):$r(r,o??0)};N.register("power",en);var Gh=$r,_h=Yo,Wh=Jo,Uh=Qo;var tn=(e,t=1)=>E(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`,zr=(e,t=1)=>E(e)?null:`${e.toFixed(t)} \u03A9`,Ka=(e,t=1)=>E(e)?null:`${(e/1e3).toFixed(t)} k\u03A9`,Za=(e,t=2)=>E(e)?null:`${(e/1e6).toFixed(t)} M\u03A9`,fd=(e,t)=>{if(E(e))return null;let r=Math.abs(e);return r>=1e6?Za(e,t??2):r>=1e3?Ka(e,t??1):r<1?tn(e,t??1):zr(e,t??1)},rn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "M\u03A9":return Za(r,o??2);case "k\u03A9":return Ka(r,o??1);case "m\u03A9":return tn(r,o??1);case "\u03A9":return zr(r,o??1)}return t.autoScale!==false?fd(r,o):zr(r,o??1)};N.register("resistance",rn);N.register("ohms",e=>typeof e=="number"?zr(e):null);N.register("milliohms",e=>typeof e=="number"?tn(e):null);var Xa=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},ja=(e,t=0)=>E(e)?null:`${e.toFixed(t)}\xB0F`,qa=(e,t=true,r=0)=>E(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,Ya=(e,t=true,r=0)=>E(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,gd=e=>e*9/5+32,bd=e=>(e-32)*(5/9),Jh=e=>e+273.15,xd=e=>e-273.15,Qh=e=>bd(e)+273.15,e0=e=>gd(xd(e)),Ja=(e,t="F",r=0)=>{if(E(e))return null;switch(typeof t=="string"&&t.length>1?Xa(t):t){case "C":return qa(e,true,r);case "K":return Ya(e,true,r);case "F":default:return ja(e,r)}},Qa=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?Xa(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);case "F":default:return r.toFixed(o)}return Ja(r,n,o)};N.register("temperature",(e,t,r)=>typeof e=="number"?Ja(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);N.register("fahrenheit",(e,t)=>typeof e=="number"?ja(e,typeof t=="number"?t:0):null);N.register("celsius",(e,t,r)=>typeof e=="number"?qa(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);N.register("kelvin",(e,t,r)=>typeof e=="number"?Ya(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var hd=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),es=e=>e?.toUpperCase()??"",ts=e=>e?.toLowerCase()??"",rs=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",os=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},ns=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",as=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",ss=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",is=e=>e?e.toLowerCase().split("_").map(t=>as(t)).join(" "):"",yd=e=>e?e.includes("_")?is(e):e.toUpperCase()===e?as(e.toLowerCase()):ss(e):"",ls=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},cs=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",ds=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",vd=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},us=(e,t)=>{if(hd(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=es(r);break;case "lowercase":r=ts(r);break;case "capitalize":r=ns(r);break;case "titleCase":r=os(r);break;case "sentenceCase":r=rs(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=cs(r,o);break;case "middle":r=ls(r,o);break;case "end":r=ds(r,o,a);break}}return r};N.register("uppercase",e=>es(String(e)));N.register("lowercase",e=>ts(String(e)));N.register("sentenceCase",e=>rs(String(e)));N.register("titleCase",e=>os(String(e)));N.register("capitalize",e=>ns(String(e)));N.register("camelCaseToWords",e=>ss(String(e)));N.register("snakeCaseToWords",e=>is(String(e)));N.register("enumToSentenceCase",e=>yd(String(e)));N.register("truncateMiddle",(e,t)=>ls(String(e),typeof t=="number"?t:16));N.register("truncateStart",(e,t)=>cs(String(e),typeof t=="number"?t:8));N.register("truncateEnd",(e,t,r)=>ds(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));N.register("secret",e=>vd(String(e)));var on=(e,t=0)=>{if(E(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mV`:`${r.toFixed(t)} mV`},Or=(e,t=0)=>E(e)?null:t===0?`${Math.round(e)} V`:`${e.toFixed(t)} V`,nn=(e,t=1)=>E(e)?null:`${(e/1e3).toFixed(t)} kV`,Cd=(e,t)=>{if(E(e))return null;let r=Math.abs(e);return r>=1e3?nn(e,t??1):r<1?on(e,t??0):Or(e,t??0)},an=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kV":return nn(r,o??1);case "mV":return on(r,o??0);case "V":return Or(r,o??0)}return t.autoScale!==false?Cd(r,o):Or(r,o??0)};N.register("voltage",an);var s0=on,i0=Or,l0=nn;var lr=(e,t)=>{switch(t.type){case "text":return us(e,t);case "number":return Aa(e,t);case "currency":return Va(e,t);case "date":return Ba(e,t);case "boolean":return Ea(e,t);case "energy":return jo(e,t);case "power":return en(e,t);case "voltage":return an(e,t);case "current":return Ho(e,t);case "resistance":return rn(e,t);case "temperature":return Qa(e,t);case "distance":return Oa(e,t);case "phone":return Ua(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}},S0=(e,t)=>({type:e,...t});var At={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},x=dt.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...s})=>{let l=Sd__namespace[e];if(!l)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let i=typeof t=="string"&&t in At?At[t]:t,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(l,{...s,size:i,color:r,weight:o,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});x.displayName="Icon";var fs=dt.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:s,color:l,weight:i,ariaLabel:c,ref:p,...d})=>{let u=typeof n=="string"&&n in At?At[n]:n,m=r?typeof r=="string"&&r in At?At[r]:r:u*1.75,g=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:g,style:{width:m,height:m},children:jsxRuntime.jsx(x,{...d,name:s,size:n,color:l,weight:i,className:a,ariaLabel:c})})});fs.displayName="IconWithContainer";function bs({children:e,items:t,className:r,align:o="left",textAlign:n="left",size:a="md",onAction:s}){return jsxRuntime.jsx("div",{className:r,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(reactAriaComponents.Popover,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-md border border-border-default","bg-background-surface p-1 shadow-lg","entering:animate-in entering:fade-in entering:zoom-in-95","exiting:animate-out exiting:fade-out exiting:zoom-out-95"),placement:o==="right"?"bottom end":"bottom start",children:jsxRuntime.jsx(reactAriaComponents.Menu,{className:"outline-none",children:t.map(l=>jsxRuntime.jsx(kd,{id:l.id,onAction:()=>l.onAction?.()||s?.(l),textAlign:n,size:a,iconName:l.iconName,isDisabled:l.disabled,variant:l.variant,"data-testid":l.testId,children:l.name},l.id))})})]})})}function kd({textAlign:e="left",iconName:t,size:r="md",isDisabled:o,children:n,variant:a="default",...s}){let l={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base"},i={default:"text-text-body hover:bg-background-hover focus:bg-background-hover",destructive:"text-feedback-error-text hover:bg-feedback-error-background focus:bg-feedback-error-background"};return jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...s,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",l[r],i[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(x,{name:t,size:r==="sm"?16:20,className:"mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:n}),t&&e==="right"&&jsxRuntime.jsx(x,{name:t,size:r==="sm"?16:20,className:"ml-2 flex-shrink-0"})]})}var Hr=({className:e,showWordmark:t=true,width:r,fill:o})=>{let n,a;if(o?o.startsWith("fill-")?a=o:n=o:e?a=e:n="var(--color-text-body)",t){let i=r||270,c=i/270*80;return jsxRuntime.jsxs("svg",{width:i,height:c,viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]})}let s=r||80;return jsxRuntime.jsxs("svg",{width:s,height:s,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Gr=({topItems:e=[],bottomItems:t=[],logo:r,showLogo:o=true,linkComponent:n="a",className:a="",mobileMenuId:s="app-mobile-menu",sidebarCollapseId:l="app-sidebar-collapse"})=>{let i=u=>u.length>0&&"items"in u[0],c=u=>i(u)?u:[{id:"default-section",items:u}],p=(u,m,g)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[u.title&&jsxRuntime.jsx("div",{className:"px-6 py-2 text-xs font-medium text-text-subtle uppercase tracking-wider","data-collapse-hide":"",children:u.title}),jsxRuntime.jsx("div",{className:"space-y-1",children:u.items.map(f=>d(f))}),m<g-1&&jsxRuntime.jsx("div",{className:"border-b border-border-subtle mx-6 my-4","data-collapse-hide":""})]},u.id),d=(u,m=false)=>{if(u.children&&u.children.length>0){let b=`category-${u.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:b,className:"peer/category hidden",defaultChecked:u.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:b,className:"flex items-center gap-3 px-6 py-1 text-text-body hover:bg-background-hover hover:text-text-heading cursor-pointer transition-all duration-200","data-collapse-center":"",children:[u.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200","data-collapse-icon":"",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.label}),jsxRuntime.jsx("span",{className:"flex-1","data-collapse-hide":""}),jsxRuntime.jsx("svg",{className:"w-4 h-4 transform transition-transform duration-200 peer-checked/category:rotate-180 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-collapse-hide":"",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsx("div",{className:"hidden peer-checked/category:block bg-background-subtle border-l-2 border-border-subtle ml-6","data-collapse-hide-category":"",children:u.children.map(h=>d(h,true))})]},u.id)}let g={href:u.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${m?"pl-8 pr-6 py-1 text-sm":"px-6 py-1"} ${u.isActive?"bg-action-primary-light text-action-primary border-l-2 border-action-primary":"text-text-body hover:text-text-heading"}`,"aria-current":u.isActive?"page":void 0,"data-collapse-center":m?void 0:""},f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u.icon&&!m&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200","data-collapse-icon":"",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.label})]});return n==="a"?jsxRuntime.jsx("a",{...g,children:f},u.id):jsxRuntime.jsx(n,{...g,children:f},u.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${a}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[o&&jsxRuntime.jsx("div",{className:"transition-all duration-200","data-collapse-hide":"",children:r||jsxRuntime.jsx(Hr,{showWordmark:true,width:120})}),jsxRuntime.jsx("label",{htmlFor:l,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200","aria-label":"Toggle sidebar","data-collapse-toggle":"",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),jsxRuntime.jsx("label",{htmlFor:s,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("nav",{className:"flex-1 flex flex-col overflow-hidden",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto pb-4 scrollbar-hide",children:c(e).map((u,m,g)=>p(u,m,g.length))}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t bg-background-muted/30",children:jsxRuntime.jsx("div",{className:"mt-4 pb-4 space-y-1",children:t.map(u=>d(u))})})]})]})};var dr=({rightContent:e,showMobileMenu:t=true,avatar:r,showColorModeSwitcher:o=false,toggleTheme:n,isDarkThemeEnabled:a=false,actions:s,className:l="",mobileMenuId:i="app-mobile-menu"})=>jsxRuntime.jsx("header",{className:`h-[60px] bg-background-surface border-b ${l}`,children:jsxRuntime.jsxs("div",{className:"flex h-full items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center h-full",children:t&&jsxRuntime.jsx("label",{htmlFor:i,className:"md:hidden cursor-pointer","aria-label":"Open menu",children:jsxRuntime.jsx("div",{className:"flex h-full w-14 flex-col items-center justify-center border-r hover:bg-background-hover transition-colors",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 px-4",children:[e,o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),s,r&&jsxRuntime.jsx("div",{className:"flex items-center",children:r}),!r&&o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})]})]})});function ys({sideNav:e,topNav:t,children:r,contentPaddingX:o="px-4 md:px-6",contentPaddingY:n="py-4 md:py-6",showSidebarBorder:a=true,mainClassName:s,enableJsEnhancements:l=false}){let i="app-mobile-menu",c="app-sidebar-collapse";return jsxRuntime.jsxs("div",{className:"min-h-screen bg-background text-text-body relative",children:[jsxRuntime.jsx("input",{type:"checkbox",id:c,className:"sr-only peer/sidebar","aria-hidden":"true"}),jsxRuntime.jsx("a",{href:"#app-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 z-50 rounded px-3 py-2 bg-background-surface shadow",children:"Skip to content"}),jsxRuntime.jsx(dr,{...t,mobileMenuId:i,className:["sticky top-0 flex-shrink-0 z-30 md:hidden",t?.className].filter(Boolean).join(" ")}),jsxRuntime.jsxs("div",{className:"flex w-full h-[calc(100vh-60px)] md:h-screen relative overflow-hidden",children:[jsxRuntime.jsx("input",{type:"checkbox",id:i,className:"sr-only peer/mobile","aria-hidden":"true"}),jsxRuntime.jsx("label",{htmlFor:i,className:"fixed inset-0 bg-black/50 z-40 opacity-0 pointer-events-none peer-checked/mobile:opacity-100 peer-checked/mobile:pointer-events-auto transition-opacity md:hidden","aria-label":"Close menu"}),jsxRuntime.jsx("aside",{id:"app-sidebar",className:["bg-background-surface","border-r border-border-default","transition-all duration-300 ease-in-out","fixed md:relative","left-0 top-0 bottom-0","z-50","w-80 md:w-64","h-screen md:h-full","-translate-x-full","peer-checked/mobile:translate-x-0","md:translate-x-0",a?"":"!border-r-0",e?.className||""].filter(Boolean).join(" "),children:jsxRuntime.jsx(Gr,{...e,mobileMenuId:i,sidebarCollapseId:c,className:"h-full"})}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:[jsxRuntime.jsx("div",{className:"sticky top-0 flex-shrink-0 hidden md:block z-20",children:jsxRuntime.jsx(dr,{...t,className:t?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto bg-background-body",o,n,s||""].join(" "),role:"main",children:r})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
1
|
+
'use strict';var lt=require('react'),jsxRuntime=require('react/jsx-runtime'),luxon=require('luxon'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Yc=require('@phosphor-icons/react'),reactStately=require('react-stately'),lucideReact=require('lucide-react'),bp=require('react-ace');require('ace-builds/src-noconflict/mode-json'),require('ace-builds/src-noconflict/mode-javascript'),require('ace-builds/src-noconflict/mode-typescript'),require('ace-builds/src-noconflict/mode-html'),require('ace-builds/src-noconflict/mode-css'),require('ace-builds/src-noconflict/mode-markdown'),require('ace-builds/src-noconflict/mode-yaml'),require('ace-builds/src-noconflict/mode-xml'),require('ace-builds/src-noconflict/mode-python'),require('ace-builds/src-noconflict/mode-sql'),require('ace-builds/src-noconflict/theme-github_dark'),require('ace-builds/src-noconflict/theme-github'),require('ace-builds/src-noconflict/ext-language_tools');var curve=require('@visx/curve'),shape=require('@visx/shape'),framerMotion=require('framer-motion'),axis=require('@visx/axis'),scale=require('@visx/scale'),d3Array=require('d3-array'),responsive=require('@visx/responsive'),fileSaver=require('file-saver'),jp=require('papaparse'),Cg=require('react-map-gl');require('mapbox-gl/dist/mapbox-gl.css');var reactDom=require('react-dom'),vb=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),wb=require('@tiptap/starter-kit');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var lt__namespace=/*#__PURE__*/_interopNamespace(lt);var Yc__namespace=/*#__PURE__*/_interopNamespace(Yc);var bp__default=/*#__PURE__*/_interopDefault(bp);var jp__default=/*#__PURE__*/_interopDefault(jp);var Cg__default=/*#__PURE__*/_interopDefault(Cg);var vb__default=/*#__PURE__*/_interopDefault(vb);var wb__default=/*#__PURE__*/_interopDefault(wb);var gc=Object.defineProperty;var bc=(e,t,r)=>t in e?gc(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var ir=(e,t,r)=>bc(e,typeof t!="symbol"?t+"":t,r);function $r(e,t=300){let[r,o]=lt.useState(e);return lt.useEffect(()=>{let n=setTimeout(()=>o(e),t);return ()=>clearTimeout(n)},[e,t]),r}function Ra(e,t){let[r,o]=lt.useState(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.error(`Error reading localStorage key "${e}":`,i),t}});lt.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(r));}catch(i){console.error(`Error writing to localStorage key "${e}":`,i);}},[e,r]);let n=lt.useCallback(i=>{try{o(l=>i instanceof Function?i(l):i);}catch(l){console.error(`Error setting value for localStorage key "${e}":`,l);}},[e]),a=lt.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e),o(t);}catch(i){console.error(`Error removing localStorage key "${e}":`,i);}},[e,t]);return [r,n,a]}var zo=class{constructor(){ir(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},P=new zo;var Ke=(e,t="Yes",r="No")=>e==null?null:e?t:r,Cc=e=>Ke(e,"Enabled","Disabled"),Nc=e=>Ke(e,"On","Off"),Sc=e=>Ke(e,"Active","Inactive"),wc=e=>Ke(e,"True","False"),Pc=e=>Ke(e,"\u2713","\u2717"),_e=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},La=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=_e(e);return r===null?t.nullText??null:Ke(r,t.trueText??"Yes",t.falseText??"No")};P.register("boolean",(e,t,r)=>{let o=_e(e);return o!==null?Ke(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});P.register("yesNo",e=>{let t=_e(e);return t!==null?Ke(t,"Yes","No"):null});P.register("enabledDisabled",e=>{let t=_e(e);return t!==null?Cc(t):null});P.register("onOff",e=>{let t=_e(e);return t!==null?Nc(t):null});P.register("activeInactive",e=>{let t=_e(e);return t!==null?Sc(t):null});P.register("trueFalse",e=>{let t=_e(e);return t!==null?wc(t):null});P.register("checkmark",e=>{let t=_e(e);return t!==null?Pc(t):null});function lr({value:e,formatter:t,emptyClassName:r="text-text-muted",emptyText:o="\u2014"}){if(e==null)return jsxRuntime.jsx("span",{className:r,children:o});if(typeof t=="function")return t(e);if(t&&typeof t=="object"){let n=sr(e,t);return e instanceof Date&&n?jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n}):n||jsxRuntime.jsx("span",{className:r,children:o})}if(!t){if(typeof e=="string")return e;if(e instanceof Date){let n=sr(e,{type:"date"});return jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n})}if(typeof e=="number")return sr(e,{type:"number"});if(typeof e=="boolean")return sr(e,{type:"boolean"})}return String(e)}function Vx(e,t,r){return lt__namespace.default.useCallback(o=>lr({value:o,formatter:e,emptyClassName:t,emptyText:r}),[e,t,r])}var D=e=>e==null,Tc=(e,t=0)=>D(e)?null:`${e.toFixed(t)}%`,Rc=e=>D(e)?null:Math.round(e).toString(),Lc=(e,t=1)=>D(e)?null:e.toFixed(t),Fc=(e,t,r=true)=>{if(D(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},Mc=(e,t="short")=>D(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),Ic=(e,t=2)=>D(e)?null:e.toExponential(t),Fa=(e,t="USD",r)=>{if(D(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Ma=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},Ia=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Fa(r,t.currency,t)};P.register("percentage",(e,t)=>typeof e=="number"?Tc(e,typeof t=="number"?t:0):null);P.register("integer",e=>typeof e=="number"?Rc(e):null);P.register("float",(e,t)=>typeof e=="number"?Lc(e,typeof t=="number"?t:1):null);P.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:Fc(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});P.register("compact",(e,t)=>typeof e=="number"?Mc(e,t==="long"?"long":"short"):null);P.register("scientific",(e,t)=>typeof e=="number"?Ic(e,typeof t=="number"?t:2):null);P.register("currency",(e,t,r)=>typeof e=="number"?Fa(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);var Ho=(e,t=0)=>{if(D(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mA`:`${r.toFixed(t)} mA`},Vr=(e,t=1)=>D(e)?null:`${e.toFixed(t)} A`,Go=(e,t=2)=>D(e)?null:`${(e/1e3).toFixed(t)} kA`,Ec=(e,t)=>{if(D(e))return null;let r=Math.abs(e);return r>=1e3?Go(e,t??2):r<1?Ho(e,t??0):Vr(e,t??1)},Oo=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kA":return Go(r,o??2);case "mA":return Ho(r,o??0);case "A":return Vr(r,o??1)}return t.autoScale!==false?Ec(r,o):Vr(r,o??1)};P.register("current",Oo);var _x=Ho,Zx=Vr,Ux=Go;var at=e=>{if(e==null)return null;if(e instanceof Date)return luxon.DateTime.fromJSDate(e);if(typeof e=="string"){let t=luxon.DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=luxon.DateTime.fromMillis(e);return t.isValid?t:null}return null},Dc=(e,t=false,r)=>{if(!e)return null;let o=at(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(luxon.DateTime.DATETIME_SHORT):n.toLocaleString(luxon.DateTime.DATE_SHORT)},Ac=e=>{if(!e)return null;let t=at(e);return t?t.toRelative():"Invalid Date"},$c=(e,t)=>{if(!e)return null;let r=at(e);return r?(t?r.setZone(t):r).toLocaleString(luxon.DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},Bc=e=>{if(!e)return null;let t=at(e);return t?t.toISO():null},Vc=(e,t,r)=>{if(!e)return null;let o=at(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},Yx=e=>{let t=at(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},Ea=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=at(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=luxon.DateTime.DATE_SHORT;break;case "medium":n.date=luxon.DateTime.DATE_MED;break;case "long":n.date=luxon.DateTime.DATE_FULL;break;case "full":n.date=luxon.DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=luxon.DateTime.TIME_SIMPLE;break;case "medium":n.time=luxon.DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=luxon.DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(luxon.DateTime.DATETIME_SHORT)};P.register("date",(e,t,r)=>Dc(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));P.register("relativeTime",e=>Ac(e));P.register("fullDateTime",(e,t)=>$c(e,typeof t=="string"?t:void 0));P.register("isoString",e=>Bc(e));P.register("customDateFormat",(e,t,r)=>typeof t=="string"?Vc(e,t,typeof r=="string"?r:void 0):null);var Wo=(e,t=1)=>D(e)?null:`${e.toFixed(t)} m`,zc=(e,t=1)=>D(e)?null:`${(e*100).toFixed(t)} cm`,Hc=(e,t=0)=>D(e)?null:`${(e*1e3).toFixed(t)} mm`,Ko=(e,t=1)=>D(e)?null:`${(e/1e3).toFixed(t)} km`,_o=(e,t=0)=>D(e)?null:`${e.toFixed(t)} ft`,Gc=(e,t=1)=>D(e)?null:`${e.toFixed(t)} in`,Zo=(e,t=1)=>D(e)?null:`${e.toFixed(t)} mi`,Uo=(e,t=0)=>D(e)?null:`${e.toFixed(t)} yd`,th=(e,t=1)=>D(e)?null:`${e.toFixed(t)} nm`,rh=e=>e*3.28084,oh=e=>e/3.28084,nh=e=>e*1.60934,ah=e=>e/1.60934,ih=e=>e/5280,Da=e=>e*5280,sh=e=>e/1609.34,lh=e=>e*1609.34,ch=e=>e*.9144,dh=e=>e/.9144,uh=e=>e*2.54,ph=e=>e/2.54,Aa=(e,t=false,r=1)=>{if(D(e))return null;let o=Math.abs(e);return t?o>=1e3?Ko(e,r):o<.01?Hc(e*1e3,0):o<1?zc(e*100,r):Wo(e,r):o<.01?_o(Da(e),0):o<.1?Uo(Da(e)/3,0):Zo(e,r)},$a=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return Aa(r,n,o)}switch(t.unit){case "km":return Ko(r,o);case "ft":return _o(r,o);case "mi":return Zo(r,o);case "yd":return Uo(r,o);case "m":default:return Wo(r,o)}};P.register("miles",(e,t)=>typeof e=="number"?Zo(e,typeof t=="number"?t:1):null);P.register("kilometers",(e,t)=>typeof e=="number"?Ko(e,typeof t=="number"?t:1):null);P.register("meters",(e,t)=>typeof e=="number"?Wo(e,typeof t=="number"?t:1):null);P.register("feet",(e,t)=>typeof e=="number"?_o(e,typeof t=="number"?t:0):null);P.register("yards",(e,t)=>typeof e=="number"?Uo(e,typeof t=="number"?t:0):null);P.register("inches",(e,t)=>typeof e=="number"?Gc(e,typeof t=="number"?t:1):null);P.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?Aa(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var jo=(e,t=1)=>D(e)?null:`${e.toFixed(t)} Wh`,qo=(e,t=1)=>D(e)?null:`${(e/1e3).toFixed(t)} kWh`,Ba=(e,t=1)=>D(e)?null:`${(e/1e6).toFixed(t)} MWh`,Va=(e,t=1)=>D(e)?null:`${(e/1e9).toFixed(t)} GWh`,za=(e,t=1)=>{if(D(e))return null;let r=Math.abs(e);return r>=1e9?Va(e,t):r>=1e6?Ba(e,t):r>=1e3?qo(e,t):jo(e,t)},Xo=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.unit)switch(t.unit){case "GWh":return Va(r,o);case "MWh":return Ba(r,o);case "kWh":return qo(r,o);case "Wh":return jo(r,o)}return t.autoScale!==false?za(r,o):jo(r,o)};P.register("kWh",e=>typeof e=="number"?qo(e):null);P.register("autoScaleEnergy",(e,t)=>typeof e=="number"?za(e,typeof t=="number"?t:1):null);P.register("energy",Xo);var zr=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},Yo=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():zr(e)},Ha=e=>e?e.startsWith("+")||e.length>11?Yo(e):zr(e):null,Ga=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return Yo(r);switch(t.country){case "US":case "CA":return zr(r);default:return Ha(r)}};P.register("phoneNumber",e=>typeof e=="string"?Ha(e):null);P.register("usPhone",e=>typeof e=="string"?zr(e):null);P.register("internationalPhone",e=>typeof e=="string"?Yo(e):null);var Hr=(e,t=0)=>D(e)?null:t===0?`${Math.round(e)} W`:`${e.toFixed(t)} W`,Jo=(e,t=1)=>D(e)?null:`${(e/1e3).toFixed(t)} kW`,Qo=(e,t=1)=>D(e)?null:`${(e/1e6).toFixed(t)} MW`,en=(e,t=2)=>D(e)?null:`${(e/1e9).toFixed(t)} GW`,Oc=(e,t)=>{if(D(e))return null;let r=Math.abs(e);return r>=1e9?en(e,t??2):r>=1e6?Qo(e,t??1):r>=1e3?Jo(e,t??1):Hr(e,t??0)},tn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "GW":return en(r,o??2);case "MW":return Qo(r,o??1);case "kW":return Jo(r,o??1);case "W":return Hr(r,o??0)}return t.autoScale!==false?Oc(r,o):Hr(r,o??0)};P.register("power",tn);var Ch=Hr,Nh=Jo,Sh=Qo,wh=en;var rn=(e,t=1)=>D(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`,Gr=(e,t=1)=>D(e)?null:`${e.toFixed(t)} \u03A9`,Oa=(e,t=1)=>D(e)?null:`${(e/1e3).toFixed(t)} k\u03A9`,Wa=(e,t=2)=>D(e)?null:`${(e/1e6).toFixed(t)} M\u03A9`,Wc=(e,t)=>{if(D(e))return null;let r=Math.abs(e);return r>=1e6?Wa(e,t??2):r>=1e3?Oa(e,t??1):r<1?rn(e,t??1):Gr(e,t??1)},on=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "M\u03A9":return Wa(r,o??2);case "k\u03A9":return Oa(r,o??1);case "m\u03A9":return rn(r,o??1);case "\u03A9":return Gr(r,o??1)}return t.autoScale!==false?Wc(r,o):Gr(r,o??1)};P.register("resistance",on);P.register("ohms",e=>typeof e=="number"?Gr(e):null);P.register("milliohms",e=>typeof e=="number"?rn(e):null);var Ka=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},_a=(e,t=0)=>D(e)?null:`${e.toFixed(t)}\xB0F`,Za=(e,t=true,r=0)=>D(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,Ua=(e,t=true,r=0)=>D(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,Kc=e=>e*9/5+32,_c=e=>(e-32)*(5/9),Mh=e=>e+273.15,Zc=e=>e-273.15,Ih=e=>_c(e)+273.15,Eh=e=>Kc(Zc(e)),ja=(e,t="F",r=0)=>{if(D(e))return null;switch(typeof t=="string"&&t.length>1?Ka(t):t){case "C":return Za(e,true,r);case "K":return Ua(e,true,r);case "F":default:return _a(e,r)}},qa=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?Ka(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);case "F":default:return r.toFixed(o)}return ja(r,n,o)};P.register("temperature",(e,t,r)=>typeof e=="number"?ja(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);P.register("fahrenheit",(e,t)=>typeof e=="number"?_a(e,typeof t=="number"?t:0):null);P.register("celsius",(e,t,r)=>typeof e=="number"?Za(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);P.register("kelvin",(e,t,r)=>typeof e=="number"?Ua(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var Uc=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),Xa=e=>e?.toUpperCase()??"",Ya=e=>e?.toLowerCase()??"",Ja=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",Qa=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},ei=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",ti=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",ri=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",oi=e=>e?e.toLowerCase().split("_").map(t=>ti(t)).join(" "):"",jc=e=>e?e.includes("_")?oi(e):e.toUpperCase()===e?ti(e.toLowerCase()):ri(e):"",ni=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},ai=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",ii=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",qc=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},si=(e,t)=>{if(Uc(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=Xa(r);break;case "lowercase":r=Ya(r);break;case "capitalize":r=ei(r);break;case "titleCase":r=Qa(r);break;case "sentenceCase":r=Ja(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=ai(r,o);break;case "middle":r=ni(r,o);break;case "end":r=ii(r,o,a);break}}return r};P.register("uppercase",e=>Xa(String(e)));P.register("lowercase",e=>Ya(String(e)));P.register("sentenceCase",e=>Ja(String(e)));P.register("titleCase",e=>Qa(String(e)));P.register("capitalize",e=>ei(String(e)));P.register("camelCaseToWords",e=>ri(String(e)));P.register("snakeCaseToWords",e=>oi(String(e)));P.register("enumToSentenceCase",e=>jc(String(e)));P.register("truncateMiddle",(e,t)=>ni(String(e),typeof t=="number"?t:16));P.register("truncateStart",(e,t)=>ai(String(e),typeof t=="number"?t:8));P.register("truncateEnd",(e,t,r)=>ii(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));P.register("secret",e=>qc(String(e)));var nn=(e,t=0)=>{if(D(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mV`:`${r.toFixed(t)} mV`},Or=(e,t=0)=>D(e)?null:t===0?`${Math.round(e)} V`:`${e.toFixed(t)} V`,an=(e,t=1)=>D(e)?null:`${(e/1e3).toFixed(t)} kV`,Xc=(e,t)=>{if(D(e))return null;let r=Math.abs(e);return r>=1e3?an(e,t??1):r<1?nn(e,t??0):Or(e,t??0)},sn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kV":return an(r,o??1);case "mV":return nn(r,o??0);case "V":return Or(r,o??0)}return t.autoScale!==false?Xc(r,o):Or(r,o??0)};P.register("voltage",sn);var zh=nn,Hh=Or,Gh=an;var sr=(e,t)=>{switch(t.type){case "text":return si(e,t);case "number":return Ma(e,t);case "currency":return Ia(e,t);case "date":return Ea(e,t);case "boolean":return La(e,t);case "energy":return Xo(e,t);case "power":return tn(e,t);case "voltage":return sn(e,t);case "current":return Oo(e,t);case "resistance":return on(e,t);case "temperature":return qa(e,t);case "distance":return $a(e,t);case "phone":return Ga(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}},ty=(e,t)=>({type:e,...t});var It={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},v=lt.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let l=Yc__namespace[e];if(!l)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let s=typeof t=="string"&&t in It?It[t]:t,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(l,{...i,size:s,color:r,weight:o,className:d,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});v.displayName="Icon";var di=lt.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:l,weight:s,ariaLabel:d,ref:p,...c})=>{let u=typeof n=="string"&&n in It?It[n]:n,m=r?typeof r=="string"&&r in It?It[r]:r:u*1.75,b=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:b,style:{width:m,height:m},children:jsxRuntime.jsx(v,{...c,name:i,size:n,color:l,weight:s,className:a,ariaLabel:d})})});di.displayName="IconWithContainer";function pi({children:e,items:t,className:r,align:o="left",textAlign:n="left",size:a="md",onAction:i}){return jsxRuntime.jsx("div",{className:r,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(reactAriaComponents.Popover,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-md border border-border-default","bg-background-surface p-1 shadow-lg","entering:animate-in entering:fade-in entering:zoom-in-95","exiting:animate-out exiting:fade-out exiting:zoom-out-95"),placement:o==="right"?"bottom end":"bottom start",children:jsxRuntime.jsx(reactAriaComponents.Menu,{className:"outline-none",children:t.map(l=>jsxRuntime.jsx(rd,{id:l.id,onAction:()=>l.onAction?.()||i?.(l),textAlign:n,size:a,iconName:l.iconName,isDisabled:l.disabled,variant:l.variant,"data-testid":l.testId,children:l.name},l.id))})})]})})}function rd({textAlign:e="left",iconName:t,size:r="md",isDisabled:o,children:n,variant:a="default",...i}){let l={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base"},s={default:"text-text-body hover:bg-background-hover focus:bg-background-hover",destructive:"text-feedback-error-text hover:bg-feedback-error-background focus:bg-feedback-error-background"};return jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...i,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",l[r],s[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(v,{name:t,size:r==="sm"?16:20,className:"mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:n}),t&&e==="right"&&jsxRuntime.jsx(v,{name:t,size:r==="sm"?16:20,className:"ml-2 flex-shrink-0"})]})}var Wr=({className:e,showWordmark:t=true,width:r,fill:o})=>{let n,a;if(o?o.startsWith("fill-")?a=o:n=o:e?a=e:n="var(--color-text-body)",t){let s=r||270,d=s/270*80;return jsxRuntime.jsxs("svg",{width:s,height:d,viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]})}let i=r||80;return jsxRuntime.jsxs("svg",{width:i,height:i,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Kr=({topItems:e=[],bottomItems:t=[],logo:r,showLogo:o=true,linkComponent:n="a",className:a="",mobileMenuId:i="app-mobile-menu",sidebarCollapseId:l="app-sidebar-collapse"})=>{let s=u=>u.length>0&&"items"in u[0],d=u=>s(u)?u:[{id:"default-section",items:u}],p=(u,m,b)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[u.title&&jsxRuntime.jsx("div",{className:"px-6 py-2 text-xs font-medium text-text-subtle uppercase tracking-wider","data-collapse-hide":"",children:u.title}),jsxRuntime.jsx("div",{className:"space-y-1",children:u.items.map(f=>c(f))}),m<b-1&&jsxRuntime.jsx("div",{className:"border-b border-border-subtle mx-6 my-4","data-collapse-hide":""})]},u.id),c=(u,m=false)=>{if(u.children&&u.children.length>0){let x=`category-${u.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:x,className:"peer/category hidden",defaultChecked:u.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:x,className:"flex items-center gap-3 px-6 py-1 text-text-body hover:bg-background-hover hover:text-text-heading cursor-pointer transition-all duration-200","data-collapse-center":"",children:[u.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200","data-collapse-icon":"",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.label}),jsxRuntime.jsx("span",{className:"flex-1","data-collapse-hide":""}),jsxRuntime.jsx("svg",{className:"w-4 h-4 transform transition-transform duration-200 peer-checked/category:rotate-180 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-collapse-hide":"",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsx("div",{className:"hidden peer-checked/category:block bg-background-subtle border-l-2 border-border-subtle ml-6","data-collapse-hide-category":"",children:u.children.map(h=>c(h,true))})]},u.id)}let b={href:u.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${m?"pl-8 pr-6 py-1 text-sm":"px-6 py-1"} ${u.isActive?"bg-action-primary-light text-action-primary border-l-2 border-action-primary":"text-text-body hover:text-text-heading"}`,"aria-current":u.isActive?"page":void 0,"data-collapse-center":m?void 0:""},f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u.icon&&!m&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200","data-collapse-icon":"",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.label})]});return n==="a"?jsxRuntime.jsx("a",{...b,children:f},u.id):jsxRuntime.jsx(n,{...b,children:f},u.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${a}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[o&&jsxRuntime.jsx("div",{className:"transition-all duration-200","data-collapse-hide":"",children:r||jsxRuntime.jsx(Wr,{showWordmark:true,width:120})}),jsxRuntime.jsx("label",{htmlFor:l,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200","aria-label":"Toggle sidebar","data-collapse-toggle":"",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),jsxRuntime.jsx("label",{htmlFor:i,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("nav",{className:"flex-1 flex flex-col overflow-hidden",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto pb-4 scrollbar-hide",children:d(e).map((u,m,b)=>p(u,m,b.length))}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t bg-background-muted/30",children:jsxRuntime.jsx("div",{className:"mt-4 pb-4 space-y-1",children:t.map(u=>c(u))})})]})]})};var cr=({rightContent:e,showMobileMenu:t=true,avatar:r,showColorModeSwitcher:o=false,toggleTheme:n,isDarkThemeEnabled:a=false,actions:i,className:l="",mobileMenuId:s="app-mobile-menu"})=>jsxRuntime.jsx("header",{className:`h-[60px] bg-background-surface border-b ${l}`,children:jsxRuntime.jsxs("div",{className:"flex h-full items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center h-full",children:t&&jsxRuntime.jsx("label",{htmlFor:s,className:"md:hidden cursor-pointer","aria-label":"Open menu",children:jsxRuntime.jsx("div",{className:"flex h-full w-14 flex-col items-center justify-center border-r hover:bg-background-hover transition-colors",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 px-4",children:[e,o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),i,r&&jsxRuntime.jsx("div",{className:"flex items-center",children:r}),!r&&o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})]})]})});function gi({sideNav:e,topNav:t,children:r,contentPaddingX:o="px-6 lg:px-10",contentPaddingY:n="py-6 lg:py-10",showSidebarBorder:a=true,mainClassName:i,enableJsEnhancements:l=false}){let s="app-mobile-menu",d="app-sidebar-collapse";return jsxRuntime.jsxs("div",{className:"min-h-screen bg-background text-text-body relative",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,className:"sr-only peer/sidebar","aria-hidden":"true"}),jsxRuntime.jsx("a",{href:"#app-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 z-50 rounded px-3 py-2 bg-background-surface shadow",children:"Skip to content"}),jsxRuntime.jsx(cr,{...t,mobileMenuId:s,className:["sticky top-0 flex-shrink-0 z-30 md:hidden",t?.className].filter(Boolean).join(" ")}),jsxRuntime.jsxs("div",{className:"flex w-full h-[calc(100vh-60px)] md:h-screen relative overflow-hidden",children:[jsxRuntime.jsx("input",{type:"checkbox",id:s,className:"sr-only peer/mobile","aria-hidden":"true"}),jsxRuntime.jsx("label",{htmlFor:s,className:"fixed inset-0 bg-black/50 z-40 opacity-0 pointer-events-none peer-checked/mobile:opacity-100 peer-checked/mobile:pointer-events-auto transition-opacity md:hidden","aria-label":"Close menu"}),jsxRuntime.jsx("aside",{id:"app-sidebar",className:["bg-background-surface","border-r border-border-default","transition-all duration-300 ease-in-out","fixed md:relative","left-0 top-0 bottom-0","z-50","w-80 md:w-64","h-screen md:h-full","-translate-x-full","peer-checked/mobile:translate-x-0","md:translate-x-0",a?"":"!border-r-0",e?.className||""].filter(Boolean).join(" "),children:jsxRuntime.jsx(Kr,{...e,mobileMenuId:s,sidebarCollapseId:d,className:"h-full"})}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:[jsxRuntime.jsx("div",{className:"sticky top-0 flex-shrink-0 hidden md:block z-20",children:jsxRuntime.jsx(cr,{...t,className:t?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto bg-background-body",o,n,i||""].join(" "),role:"main",children:r})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
2
2
|
@media (min-width: 768px) {
|
|
3
3
|
/* Collapse sidebar width */
|
|
4
|
-
#${
|
|
4
|
+
#${d}:checked ~ * #app-sidebar {
|
|
5
5
|
width: 4rem !important;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/* Collapse sidebar text */
|
|
9
|
-
#${
|
|
9
|
+
#${d}:checked ~ * [data-collapse-hide] {
|
|
10
10
|
display: none !important;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/* Center nav items */
|
|
14
|
-
#${
|
|
14
|
+
#${d}:checked ~ * [data-collapse-center] {
|
|
15
15
|
justify-content: center;
|
|
16
16
|
padding-left: 0;
|
|
17
17
|
padding-right: 0;
|
|
@@ -19,24 +19,24 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* Increase icon size when collapsed */
|
|
22
|
-
#${
|
|
22
|
+
#${d}:checked ~ * [data-collapse-icon] {
|
|
23
23
|
width: 1.5rem !important;
|
|
24
24
|
height: 1.5rem !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/* Scale SVG icons inside the icon container */
|
|
28
|
-
#${
|
|
28
|
+
#${d}:checked ~ * [data-collapse-icon] > svg {
|
|
29
29
|
width: 1.5rem !important;
|
|
30
30
|
height: 1.5rem !important;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/* Rotate toggle icon */
|
|
34
|
-
#${
|
|
34
|
+
#${d}:checked ~ * [data-collapse-toggle] {
|
|
35
35
|
transform: scaleX(-1);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/* Hide category expansions */
|
|
39
|
-
#${
|
|
39
|
+
#${d}:checked ~ * [data-collapse-hide-category] {
|
|
40
40
|
display: none;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
// Close mobile menu on Escape key
|
|
46
46
|
document.addEventListener('keydown', function(e) {
|
|
47
47
|
if (e.key === 'Escape') {
|
|
48
|
-
var menuToggle = document.getElementById('${
|
|
48
|
+
var menuToggle = document.getElementById('${s}');
|
|
49
49
|
if (menuToggle) menuToggle.checked = false;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
// Save sidebar collapse preference to localStorage
|
|
54
|
-
var sidebarToggle = document.getElementById('${
|
|
54
|
+
var sidebarToggle = document.getElementById('${d}');
|
|
55
55
|
if (sidebarToggle) {
|
|
56
56
|
// Restore from localStorage
|
|
57
57
|
var saved = localStorage.getItem('sidebar-collapsed');
|
|
@@ -66,20 +66,20 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// Prevent body scroll when mobile menu is open
|
|
69
|
-
var mobileToggle = document.getElementById('${
|
|
69
|
+
var mobileToggle = document.getElementById('${s}');
|
|
70
70
|
if (mobileToggle) {
|
|
71
71
|
mobileToggle.addEventListener('change', function() {
|
|
72
72
|
document.body.style.overflow = this.checked ? 'hidden' : '';
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
})();
|
|
76
|
-
`}})]})}var _r={prefix:String(Math.round(Math.random()*1e10)),current:0},vs=dt__namespace.default.createContext(_r),Md=dt__namespace.default.createContext(false);var Id=!!(typeof window<"u"&&window.document&&window.document.createElement),dn=new WeakMap;function Ed(e=false){let t=dt.useContext(vs),r=dt.useRef(null);if(r.current===null&&!e){var o,n;let a=(n=dt__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(o=n.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(a){let s=dn.get(a);s==null?dn.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==s.state&&(t.current=s.id,dn.delete(a));}r.current=++t.current;}return r.current}function Dd(e){let t=dt.useContext(vs);t===_r&&!Id&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Ed(!!e),o=t===_r&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${r}`}function Ad(e){let t=dt__namespace.default.useId(),[r]=dt.useState(Wr()),o=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${_r.prefix}`;return e||`${o}-${t}`}typeof dt__namespace.default.useId=="function"?Ad:Dd;function Bd(){return false}function $d(){return true}function zd(e){return ()=>{}}function Wr(){return typeof dt__namespace.default.useSyncExternalStore=="function"?dt__namespace.default.useSyncExternalStore(zd,Bd,$d):dt.useContext(Md)}var Od=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Hd=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function pn(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),o=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(o)return o.direction==="rtl";if(r.script)return Od.has(r.script)}let t=e.split("-")[0];return Hd.has(t)}var Wd=Symbol.for("react-aria.i18n.locale");function Ss(){let e=typeof window<"u"&&window[Wd]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:pn(e)?"rtl":"ltr"}}var mn=Ss(),ur=new Set;function Cs(){mn=Ss();for(let e of ur)e(mn);}function Ns(){let e=Wr(),[t,r]=dt.useState(mn);return dt.useEffect(()=>(ur.size===0&&window.addEventListener("languagechange",Cs),ur.add(r),()=>{ur.delete(r),ur.size===0&&window.removeEventListener("languagechange",Cs);}),[]),e?{locale:"en-US",direction:"ltr"}:t}var Zd=dt__namespace.default.createContext(null);function fn(){let e=Ns();return dt.useContext(Zd)||e}var gn=new Map;function bn(e){let{locale:t}=fn(),r=t+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(gn.has(r))return gn.get(r);let o=new Intl.Collator(t,e);return gn.set(r,o),o}function Ur(e){let t=bn({usage:"search",...e}),r=dt.useCallback((a,s)=>s.length===0?true:(a=a.normalize("NFC"),s=s.normalize("NFC"),t.compare(a.slice(0,s.length),s)===0),[t]),o=dt.useCallback((a,s)=>s.length===0?true:(a=a.normalize("NFC"),s=s.normalize("NFC"),t.compare(a.slice(-s.length),s)===0),[t]),n=dt.useCallback((a,s)=>{if(s.length===0)return true;a=a.normalize("NFC"),s=s.normalize("NFC");let l=0,i=s.length;for(;l+i<=a.length;l++){let c=a.slice(l,l+i);if(t.compare(s,c)===0)return true}return false},[t]);return dt.useMemo(()=>({startsWith:r,endsWith:o,contains:n}),[r,o,n])}var hn=dt.createContext({colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),Vt=()=>dt.useContext(hn),Ps=({children:e})=>{let[t,r]=dt.useState("light"),o=t==="dark";dt.useEffect(()=>{let a=localStorage.getItem("theme"),s=document.body.classList.contains("theme-dark"),l=window.matchMedia("(prefers-color-scheme: dark)"),i=a||(s?"dark":null)||(l.matches?"dark":"light");r(i),i==="dark"&&document.body.classList.add("theme-dark");let c=u=>{if(!localStorage.getItem("theme")){let m=u.matches?"dark":"light";r(m),m==="dark"?document.body.classList.add("theme-dark"):document.body.classList.remove("theme-dark");}},p=()=>{let m=document.body.classList.contains("theme-dark")?"dark":"light";localStorage.getItem("theme")||r(m);};l.addEventListener("change",c);let d=new MutationObserver(u=>{u.forEach(m=>{m.type==="attributes"&&m.attributeName==="class"&&p();});});return d.observe(document.body,{attributes:true,attributeFilter:["class"]}),()=>{l.removeEventListener("change",c),d.disconnect();}},[]);let n=dt.useCallback(()=>{r(a=>{let s=a==="light"?"dark":"light";return localStorage.setItem("theme",s),s==="dark"?document.body.classList.add("theme-dark"):document.body.classList.remove("theme-dark"),s});},[]);return jsxRuntime.jsx(hn.Provider,{value:{colorMode:t,isDarkTheme:o,toggleTheme:n},children:e})};function de(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-border-focus focus:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus focus-visible:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function j(e,t){return reactAriaComponents.composeRenderProps(e,r=>tailwindMerge.twMerge(t,r))}var Z={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function qe(){let[e,t]=dt__namespace.default.useState(false),r=dt__namespace.default.useCallback((n,a)=>{t(true),a?.(n);},[]),o=dt__namespace.default.useCallback((n,a)=>{t(false),a?.(n);},[]);return {isFocused:e,handleFocus:r,handleBlur:o}}function Ye({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",t),children:e})}function Ts({onClick:e,size:t="md",className:r}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",r),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(x,{name:"X",size:t==="sm"?16:20})})}function Bt(e){let{isInvalid:t,isDisabled:r,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] ";return r?`${n} border-border-muted focus:outline-none`:t&&o?`${n} border-feedback-error-border outline-[1.5px] outline-[var(--control-focus-ring-color-error)]`:t?`${n} border-feedback-error-border`:o?`${n} !outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]`:`${n}`}function Kr(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Ge(e){let{isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:a="md",className:s}=e;return tailwindMerge.twMerge("w-full",Bt({isInvalid:t,isDisabled:r,isFocused:o}),Kr({transparent:n,isDisabled:r}),Z[a].text,Z[a].height,Z[a].padding,s)}function pr(e){let{size:t="md",isFocusWithin:r,isInvalid:o,isDisabled:n,transparent:a,className:s}=e;return tailwindMerge.twMerge("group flex items-center rounded-sm overflow-hidden",Kr({transparent:a,isDisabled:n}),Z[t].height,Bt({isFocused:r,isInvalid:o,isDisabled:n}),s)}function Y({children:e,size:t="md",tooltip:r,isRequired:o,className:n,htmlFor:a}){return jsxRuntime.jsxs("label",{htmlFor:a,className:tailwindMerge.twMerge(Z[t].text,"!text-text-caption flex items-center gap-1",n),children:[e,o&&jsxRuntime.jsx("span",{children:"*"}),r&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(x,{name:"Info",size:t==="sm"?16:20})})]})}function te({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-muted",Z[e].text,t),children:r})}function q({children:e,size:t="md",className:r}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(Z[t].text,"text-feedback-error-text",r),children:e})}function ks({size:e="md",isInvalid:t,isDisabled:r,isFocused:o,transparent:n,className:a,...s}){return jsxRuntime.jsx("input",{className:Ge({isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:e,className:a}),...s})}function Zr(e){let{children:t,...r}=e;return jsxRuntime.jsx("div",{...r,className:pr(e),children:typeof t=="function"?t(e):t})}var su={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},iu={sm:"text-controlElementSm",md:"text-controlElementMd",lg:"text-controlElementLg",xl:"text-controlElementXl"};function pt({size:e="md",className:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...r,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium",su[e],iu[e],t)})}function fu({isEntering:e,isExiting:t,className:r=""}){let o=["bg-white","dark:bg-zinc-900/70","dark:backdrop-blur-2xl","dark:backdrop-saturate-200","forced-colors:bg-[Canvas]","shadow-md","rounded-md","overflow-hidden","bg-clip-padding","border","border-gray-100","dark:border-white/5","dark:text-zinc-300"].join(" "),n=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",a=t?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [o,n,a,r].filter(Boolean).join(" ")}function mt({children:e,showArrow:t,className:r,...o}){let a=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",s=t?12:8;return s=a?s-6:s,jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:s,...o,className:reactAriaComponents.composeRenderProps(r,(l,i)=>fu({...i,className:l})),children:[t&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{className:"group",children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-white stroke-black/10 stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-[#1f1f21] dark:stroke-zinc-600 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]})}var wu={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Pu={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},Rs={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function Tu(){let e=dt__namespace.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var Nn=(e,t,r)=>{if(e==null||e==="")return "";let n=(r?r.flatMap(a=>a.items):t||[]).find(a=>a.id===e);return n?n.name:""};async function ku(e,t,r){try{let o=e.url.replace("{q}",t),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([i,c])=>{n.append(i,c.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,s=await fetch(a,{method:"GET",headers:e.headers,signal:r});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);let l=await s.json();return {items:e.transformResponse(l)}}catch(o){console.error("Error in REST request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function Ru(e,t,r){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:r});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((s,l)=>s?.[l],a)),{items:e.transformResponse(a)}}catch(o){console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function Xr({label:e,staticItems:t=[],sections:r,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:s,defaultFilter:l,placeholder:i,errorMessage:c,description:p,size:d="md",tooltip:u,isRequired:m,isDisabled:g,isInvalid:f,validationResult:b,showErrors:h=true,renderItem:w,renderLeftIcon:S,renderSection:C,autoFocus:P=false}){let R=dt__namespace.default.useRef(null),[L,v]=dt__namespace.default.useState(),[D,B]=dt.useState(()=>Nn(o||n,t,r)),[_,y]=dt.useState(false),V=Dr(D),{contains:oe}=Ur({sensitivity:"base"}),[U,ue]=dt.useState(),ge=Z[d].text,Me=Z[d].height,F=null;dt.useEffect(()=>{P&&y(true);},[P]),dt.useEffect(()=>{let k=()=>{R.current&&v(R.current.offsetWidth);};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),dt.useEffect(()=>{F&&F.setFilterText(V);},[V,F]),s&&(F=reactStately.useAsyncList({async load({signal:k,filterText:T=""}){if(!s.url||s.shouldLoad&&!s.shouldLoad(T))return {items:[]};try{let M;return s.requestType==="GraphQL"?M=await Ru(s,T,k):M=await ku(s,T,k),ue(M.error),{items:M.items}}catch(M){return console.error("Error loading items:",M),ue(M instanceof Error?M.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),V===""&&(F=null);let O=k=>{let T=Nn(k,t,r);B(T),a&&a(k);},K=k=>{B(k);let T=Nn(o,t,r);o!=null&&k!==T&&a&&a(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:O,selectedKey:o||void 0,defaultSelectedKey:n||void 0,defaultItems:r?r.flatMap(k=>k.items):t,items:F?F.items:void 0,className:j("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:g,isInvalid:f||!!c,inputValue:D,onInputChange:K,autoFocus:P,defaultFilter:l||oe,"aria-label":e||i||"Autocomplete",children:k=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:d,tooltip:u,isRequired:m,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:R,className:pr({size:d,isInvalid:f||!!c,isDisabled:g,isFocusWithin:_||k.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||i||"Autocomplete",style:{position:"relative"},children:[S?jsxRuntime.jsx("div",{className:"absolute left-3",children:S(!!F?.isLoading)}):jsxRuntime.jsx(x,{name:"MagnifyingGlass",className:`${wu[d]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${Pu[d]} ${ge} ${Me} ${g?"bg-background-muted":"bg-background-input"}`,placeholder:i,disabled:g,onFocus:()=>y(true),onBlur:()=>y(false)}),D&&!g&&jsxRuntime.jsx(Tu,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${ge} ${Me} ${g?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:g,children:({isPressed:T})=>jsxRuntime.jsx(x,{name:T?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),p&&jsxRuntime.jsx(te,{size:d,children:p}),h&&U&&jsxRuntime.jsx(q,{size:d,className:"text-feedback-error-text",children:U}),h&&typeof c=="string"&&jsxRuntime.jsx(q,{size:d,className:"text-feedback-error-text",children:c}),h&&typeof c=="function"&&b&&jsxRuntime.jsx(q,{size:d,className:"text-feedback-error-text",children:c(b)}),jsxRuntime.jsx(mt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5",style:{minWidth:L?`${L}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${ge}`,children:r?r.map(T=>{let M=T.items.map(I=>jsxRuntime.jsx(pt,{id:I.id,textValue:I.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Rs[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(I):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[I.name,jsxRuntime.jsx(x,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},I.id));return C?C(T,M):jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:T.name}),M]},T.name)}):T=>jsxRuntime.jsx(pt,{id:T.id,textValue:T.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Rs[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(T):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[T.name,jsxRuntime.jsx(x,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},T.id)})})]})})}function Is({src:e,alt:t,firstName:r,lastName:o,fullName:n,onClick:a,size:s="md",shape:l="circle",variant:i="user",className:c,status:p,bordered:d=false}){let u={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},m={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},g={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},f={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-muted border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},b={user:"bg-action-primary/10 text-action-primary",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},h=l==="circle"?"rounded-full":"rounded-md",w=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity",u[s],h,a&&"cursor-pointer hover:opacity-80",d&&"ring-2 ring-background-surface",c),C=(()=>{if(r||o){let L=r?.[0]||"",v=o?.[0]||"";return (L+v).toUpperCase()}if(n){let L=n.split(" "),v=L[0]?.[0]||"",D=L[L.length-1]?.[0]||"";return v===D?v.toUpperCase():(v+D).toUpperCase()}return ""})(),P=()=>{let L={xs:14,sm:16,md:20,lg:24,xl:32}[s];switch(i){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:L});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:L});default:return jsxRuntime.jsx(lucideReact.User,{size:L})}},R=()=>e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{src:e,alt:t||n||"Avatar",className:"h-full w-full object-cover",style:{fontSize:0}}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center -z-10",children:C?jsxRuntime.jsx("span",{className:"font-semibold",children:C}):P()})]}):C?jsxRuntime.jsx("span",{className:"font-semibold",children:C}):P();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(w,e?"":b[i]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:R()}),p&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",h,m[s],g[s],f[p]),"aria-label":`Status: ${p}`})]})}var Eu={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary",secondary:"bg-action-secondary/10 text-action-secondary",neutral:"bg-background-muted text-text-muted"},Du={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-base"},Au={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},Vu={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function $t({children:e,variant:t="default",size:r="sm",shape:o="square",dot:n=false,dotPosition:a="left",className:s}){let l=n&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",Vu[r]),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",Du[r],Au[o],Eu[t],s),children:[n&&a==="left"&&l,e,n&&a==="right"&&l]})}var Tn=({href:e,children:t,className:r="",external:o=false,title:n,variant:a="default",onClick:s,asButton:l=false,onPress:i,showArrow:c=false})=>{let p=o?{target:"_blank",rel:"noopener noreferrer"}:{},m=`hover:underline hover:decoration-1 hover:underline-offset-4 cursor-pointer ${{default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-muted hover:text-text-muted visited:text-text-muted"}[a]} ${r}`,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,c&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return l?jsxRuntime.jsx("button",{type:"button",className:m,onClick:i,title:n,children:g}):jsxRuntime.jsx("a",{href:e||"#",className:m,...p,title:n,onClick:s,children:g})};function qr(e){return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...e,className:tailwindMerge.twMerge("flex gap-1",e.className)})}function Yr(e){let{className:t,children:r,href:o,...n}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:j(t,"flex items-center gap-1"),...n,children:a=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tn,{variant:"muted",href:o,children:typeof r=="function"?r(a):r}),o&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3 w-3 text-text-muted"})]})})}var ju="flex font-medium justify-center items-center gap-2 text-center transition rounded-sm whitespace-nowrap box-border",qu={default:"bg-neutral-black text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",primary:"bg-action-primary text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-action-destructive border-2 border-border-muted hover:bg-action-destructive/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-2 flex-shrink-0",unstyled:"bg-transparent"},Vs={full:"w-full",default:"w-fit"},Yu="opacity-control-hover cursor-not-allowed pointer-events-none grayscale",Ju="opacity-100 cursor-pointer",Qu={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},ep={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function tp(e){let{variant:t="default",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,s=t==="unstyled"?"":`${ju} ${qu[t]}`;return t!=="unstyled"&&(s+=` ${Z[r].text} ${Z[r].height} ${Z[r].padding} ${Z[r].gap}`),o||a?s+=` ${Yu}`:s+=` ${Ju}`,n?s+=` ${Vs.full}`:s+=` ${Vs.default}`,`${s} ${de()}`}function A(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:l="left",iconWeight:i,href:c,className:p,badgeNumber:d,badgeVariant:u="primary",badgePosition:m="top-right",style:g,target:f,rel:b,...h}=e,w=t?jsxRuntime.jsx(x,{name:t,className:`icon-[--control-icon-size-${s}]`,weight:i}):null,S=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,typeof r=="function"?null:r,l==="right"&&w]}),C=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(x,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${s}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:S}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),P=tailwindMerge.twMerge(tp(e),p,o?"aria-busy":""),R=c?{href:c,target:f,rel:b,...h}:{};if(c){let{onPress:v,onPressStart:D,onPressEnd:B,onPressChange:_,onPressUp:y,onAuxClick:V,onContextMenu:oe,onDoubleClick:U,...ue}=h;Object.assign(R,ue);}let L=c?jsxRuntime.jsx(reactAriaComponents.Link,{...R,style:g,className:P,children:o?C:typeof r=="function"?(function(v){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,r(v),l==="right"&&w]})}):S}):jsxRuntime.jsx(reactAriaComponents.Button,{...h,style:g,className:P,children:o?C:typeof r=="function"?(function(v){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,r(v),l==="right"&&w]})}):S});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[L,jsxRuntime.jsx("span",{className:`absolute ${Qu[m]} flex h-5 w-5 items-center justify-center rounded-full ${ep[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):L}function up({isSelected:e,isDisabled:t}){let r=[de,"w-9 h-9 text-base cursor-default rounded-full flex items-center justify-center forced-color-adjust-none"];return t?r.push("text-gray-300 dark:text-zinc-600 forced-colors:text-[GrayText]"):e?r.push("bg-blue-600 invalid:bg-red-600 text-white forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):r.push("text-zinc-900 dark:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 pressed:bg-gray-200 dark:pressed:bg-zinc-600"),r.join(" ")}function Jr({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(Qr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{children:[jsxRuntime.jsx(eo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:({isSelected:o,isDisabled:n})=>up({isSelected:o,isDisabled:n})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Qr(){let{direction:e}=reactAriaComponents.useLocale(),t=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(A,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(x,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(x,{name:"CaretLeft","aria-hidden":true,size:t})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx(A,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(x,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(x,{name:"CaretRight","aria-hidden":true,size:t})})]})}function eo(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}var mp={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},fp={page:"h-16 leading-[62px]"};function Ee({tag:e="h1",size:t="lg",height:r,className:o="",children:n}){let a=mp[t],s=r?fp[r]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,s,o),children:n})}var z=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:s,responsive:l,delay:i=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:p,className:d,"data-testid":u})=>{let[m,g]=dt.useState(i===0);if(dt.useEffect(()=>{if(i>0){let P=setTimeout(()=>g(true),i);return ()=>clearTimeout(P)}},[i]),!m)return null;let f=n?"bg-gradient-to-r from-[var(--skeleton-base)] via-[var(--skeleton-highlight)] to-[var(--skeleton-base)]":"bg-[var(--skeleton-base)]",b=c&&e?(()=>{let P=typeof e=="number"?e:parseFloat(String(e));return isNaN(P)?"":`animation-duration-[${Math.max(.8,P/100)}s]`})():"",h=o==="pulse"?`animate-pulse ${b}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--skeleton-wave)] before:to-transparent before:animate-wave ${b}`:"",w="rounded-sm";r==="circle"&&(w="rounded-full"),r==="text"&&(w="h-4 w-full rounded-sm");let S=a?"flex-1 min-w-0":"",C=l?Object.entries(l).map(([P,R])=>`${P}:w-[${R}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":u,children:s.map((P,R)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,h,w,S,C,d),style:{width:P,height:t}},R))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,h,w,S,C,d),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":u})};var hp={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},yp="rounded-lg",Ln={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},vp={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Ae({variant:e="outlined",className:t,children:r,isLoading:o=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",hp[e],yp,t),"data-testid":"card",children:o?jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(z,{width:"100%",height:200})}):r})}function $s({title:e,subtitle:t,actions:r,className:o,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(z,{width:120,height:20}),jsxRuntime.jsx(z,{width:24,height:24})]}),t&&jsxRuntime.jsx(z,{width:200,height:16})]}):!e&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(Ee,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),t&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function zs({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",Ln[r],o),children:jsxRuntime.jsx(z,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Ln[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Ln[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Os({className:e,children:t,isLoading:r=false}){return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(z,{width:"100%",height:16}),jsxRuntime.jsx(z,{width:"80%",height:16}),jsxRuntime.jsx(z,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function Hs({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(z,{width:80,height:32}),jsxRuntime.jsx(z,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",vp[r],e),children:t}):null}Ae.Header=$s;Ae.Media=zs;Ae.Content=Os;Ae.Footer=Hs;function Tp(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:j(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(Y,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(te,{children:e.description}),jsxRuntime.jsx(q,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function kp({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function Rp({isSelected:e,isInvalid:t,isDisabled:r,isIndeterminate:o}){let n="w-5 h-5 flex-shrink-0 rounded flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2 focus:ring-border-focus",a="";return r?a="border-border-muted bg-background-muted":t?a="border-feedback-error-border bg-feedback-error-background":e||o?a="bg-action-primary border-action-primary hover:bg-action-primary-hover hover:border-action-primary-hover":a="bg-background-input border-border-input hover:border-border-focus",`${n} ${a}`}var Gs="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function We(e){let{children:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(o,n)=>`${kp(n)} ${o||""}`),children:o=>{let{isSelected:n,isIndeterminate:a,...s}=o,l=jsxRuntime.jsx("div",{className:Rp({isSelected:n,isIndeterminate:a,...s}),children:a?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Gs}):n?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Gs}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof t=="function"?t(o):t]})}})}var Mp={default:"bg-background-muted text-text-body border border-border-muted hover:bg-background-hover",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-background-input text-text-body border border-border-input hover:bg-background-hover"},Ip={sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},Ep="opacity-75 cursor-not-allowed pointer-events-none";function Ws(e){let{variant:t,size:r,isDisabled:o,isClickable:n,className:a}=e;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",Ip[r],Z[r].text,Mp[t],n&&!o&&"cursor-pointer",o&&Ep,a)}function to({children:e,onRemove:t,size:r="md",variant:o="default",isRemovable:n=true,isDisabled:a=false,className:s,onClick:l}){let i=!!l&&!a,c=n&&t&&!a,p=m=>{m.stopPropagation(),m.preventDefault(),t&&!a&&t();},d=()=>{l&&!a&&l();},u=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),c&&jsxRuntime.jsx("button",{type:"button",onClick:p,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(x,{name:"X",size:r==="sm"?12:r==="md"?14:16,className:"text-current opacity-70 hover:opacity-100"})})]});return i?jsxRuntime.jsx("button",{type:"button",onClick:d,className:Ws({variant:o,size:r,isDisabled:a,isClickable:i,className:s}),disabled:a,children:u}):jsxRuntime.jsx("span",{className:Ws({variant:o,size:r,isDisabled:a,isClickable:i,className:s}),children:u})}function Ks({value:e,readOnly:t=false,onChange:r,language:o="json",theme:n="github_dark",height:a,width:s="100%",className:l,lineHeight:i=19,minLines:c=3,maxLines:p=50,showLineNumbers:d=true,showGutter:u=true,fontSize:m=14,wrapEnabled:g=false}){let f=dt.useRef(null),b=dt.useMemo(()=>{if(a)return a;let h=(e.match(/\n/g)||[]).length+1;return `${Math.max(c,Math.min(h,p))*i+10}px`},[e,a,i,c,p]);return dt.useEffect(()=>{f.current?.editor&&f.current.editor.resize();},[b]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",l),style:{width:s,height:b},children:jsxRuntime.jsx(zp__default.default,{ref:f,mode:o,theme:n,value:e,onChange:r,readOnly:t,width:"100%",height:"100%",fontSize:m,showPrintMargin:false,showGutter:u,highlightActiveLine:!t,setOptions:{useWorker:true,showLineNumbers:d,tabSize:2,enableBasicAutocompletion:!t,enableLiveAutocompletion:!t,enableSnippets:!t,showFoldWidgets:true,wrap:g},editorProps:{$blockScrolling:true}})})}var Up=({isEntering:e,isExiting:t,className:r})=>["max-w-[200px] group bg-slate-700 dark:bg-slate-600 border border-slate-800 dark:border-white/10 shadow-[inset_0_1px_0_0_theme(colors.gray.600)] dark:shadow-none text-white text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",t?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",r].filter(Boolean).join(" ");function In({children:e,content:t,...r}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...r,offset:10,className:reactAriaComponents.composeRenderProps(r.className,(o,n)=>Up({...n,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-slate-700 stroke-gray-800 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-slate-600 dark:stroke-white/10 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})]})}function ro({value:e,children:t,className:r,size:o="sm"}){let[n,a]=dt.useState(false),i=jsxRuntime.jsx(A,{variant:"icon",size:o,onPress:()=>{let c=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(c),a(true),setTimeout(()=>{a(false);},2e3);},className:"!px-2",children:jsxRuntime.jsx(x,{name:"Copy",size:o==="sm"?14:16})});return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1",r),children:[t,n?jsxRuntime.jsx(In,{content:"Copied!",children:i}):i]})}var Xs={duration:.5,ease:"easeInOut"},oo=dt.createContext(null),gt=()=>{let e=dt.useContext(oo);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};var Ot=({data:e,color:t="#6b7280"})=>{let r=dt.useId(),o=dt.useId(),{xScale:n,yScale:a,animationSettings:s}=gt(),l=n.range(),i=a.range();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:t,stopOpacity:.1}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:0})]}),jsxRuntime.jsx("clipPath",{id:o,children:jsxRuntime.jsx("rect",{x:l[0],y:i[1],width:l[1]-l[0],height:i[0]-i[1]})})]}),jsxRuntime.jsx("g",{clipPath:`url(#${o})`,children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:s.duration,ease:s.ease},style:{transformOrigin:`0 ${i[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:[jsxRuntime.jsx(shape.AreaClosed,{data:e,x:c=>n(c.xValue),y:c=>a(c.yValue),yScale:a,fill:`url(#${r})`,curve:curve.curveLinear}),jsxRuntime.jsx(shape.LinePath,{data:e,x:c=>n(c.xValue),y:c=>a(c.yValue),stroke:t,strokeWidth:3,curve:curve.curveLinear})]})})]})};var Gt=({data:e,color:t="#6b7280",opacity:r=1,categoryColors:o={}})=>{let{xScale:n,yScale:a,animationSettings:s}=gt(),l=dt.useId(),i=n.range(),c=a.range(),p=[...e].sort((m,g)=>m.xValue.getTime()-g.xValue.getTime()),d=p.length>1?p[1].xValue.getTime()-p[0].xValue.getTime():15*6e4,u=Math.abs(n(new Date(p[0].xValue.getTime()+d))-n(p[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:l,children:jsxRuntime.jsx("rect",{x:i[0],y:c[1],width:i[1]-i[0],height:c[0]-c[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${l})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:s.duration,ease:s.ease},style:{transformOrigin:`0 ${c[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:p.map((m,g)=>{let f=n(m.xValue),b=a(m.yValue),h=c[0]-b,w=p[g+1],S=w?Math.abs(n(w.xValue)-f):u,C=m.category&&o[m.category]?o[m.category]:t;return jsxRuntime.jsx(shape.Bar,{x:f-S/2,y:b,width:S,height:h,fill:C,opacity:r,rx:1},m.xValue.getTime())})})})]})};var ne={top:20,right:20,bottom:50,left:60};function _t(e,t="$"){let r=(o,n)=>o==null?"-":n(o);switch(e){case "number":return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())};case "percent":return {format:o=>r(o,n=>`${n.toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}%`),min:0,max:100,tickInterval:20};case "kWh":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kWh`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "kW":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kW`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "amperes":return {format:o=>r(o,n=>`${n.toFixed(1)} A`),tickFormat:o=>r(o,n=>`${n.toFixed(1)} A`)};case "temperature":return {format:o=>r(o,n=>`${n.toFixed(1)}\xB0`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}\xB0`)};case "percentageChange":return {format:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(0)}%`),min:-100,max:100};case "decimal":return {format:o=>r(o,n=>n.toFixed(2)),tickFormat:o=>r(o,n=>n.toFixed(1))};case "currency":return {format:o=>r(o,n=>`${t}${n.toLocaleString()}`),tickFormat:o=>r(o,n=>`${t}${n.toLocaleString()}`)};case "scientific":return {format:o=>r(o,n=>n.toExponential(2)),tickFormat:o=>r(o,n=>n.toExponential(1))};case "integer":return {format:o=>r(o,n=>Math.round(n).toLocaleString()),tickFormat:o=>r(o,n=>Math.round(n).toLocaleString())};case "logarithmic":return {format:o=>r(o,n=>n.toExponential(1)),tickFormat:o=>r(o,n=>n.toExponential(0)),min:1,tickInterval:10};case "timeDuration":return {format:o=>r(o,n=>`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")} min`),tickFormat:o=>r(o,n=>`${Math.floor(n/60)}m`),min:0};case "compact":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n))};case "si":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:2}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(n))};case "bytes":return {format:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],s=0,l=n;for(;l>=1024&&s<a.length-1;)l/=1024,s++;return `${l.toFixed(1)} ${a[s]}`}),tickFormat:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],s=0,l=n;for(;l>=1024&&s<a.length-1;)l/=1024,s++;return `${l.toFixed(0)} ${a[s]}`}),min:0};case "rate":return {format:o=>r(o,n=>`${n.toFixed(1)} req/sec`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}/s`)};case "ordinal":return {format:o=>r(o,n=>{let a=["th","st","nd","rd"],s=n%100;return n+(a[(s-20)%10]||a[s]||a[0])}),tickFormat:o=>r(o,n=>n.toString()),min:1};case "date":return {format:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"medium"}).format(new Date(n))),tickFormat:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"short"}).format(new Date(n))),min:0};case "largeCurrency":return {format:o=>r(o,n=>`${t}${(n/1e6).toFixed(2)}M`),tickFormat:o=>r(o,n=>`${t}${(n/1e6).toFixed(0)}M`)};case "coordinates":return {format:o=>r(o,n=>`${Math.abs(n).toFixed(3)}\xB0 ${n>=0?"N":"S"}`),tickFormat:o=>r(o,n=>`${Math.abs(n).toFixed(1)}\xB0 ${n>=0?"N":"S"}`),min:-90,max:90};case "ranked":return {format:o=>r(o,n=>`Rank: ${n}`),tickFormat:o=>r(o,n=>n.toString()),min:1};default:return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())}}}var Dn=(e,t)=>{let r=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[ne.left,t-ne.right],domain:r,nice:true})},An=(e,t,r)=>{let o=_t(r),n=d3Array.min(e,i=>i.yValue)||0,a=d3Array.max(e,i=>i.yValue)||0,s=o.min!==void 0?o.min:n>=0?0:n*1.1,l=o.max!==void 0?o.max:a<=0?0:a*1.1;return scale.scaleLinear({range:[t-ne.bottom,ne.top],domain:[s,l],nice:true})};var um=({top:e,scale:t,width:r})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:Math.min(6,Math.floor(r/100)),tickFormat:o=>{let n=o;return new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(n)},stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"middle"})}),pm=({left:e,scale:t,yFormatType:r})=>{let o=_t(r);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:5,tickFormat:n=>(o.tickFormat||o.format)(n),stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"end",dy:"0.33em"})})},br={Bottom:um,Left:pm};var bm=({items:e})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:e.map(t=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-sm",style:{backgroundColor:t.fill}}),jsxRuntime.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.category})]},t.category))}),ao=({items:e,onExport:t})=>{let[r,o]=dt__namespace.default.useState(false),[n,a]=dt__namespace.default.useState(null),s=dt__namespace.default.useCallback(async l=>{let i=l;o(true),a(i);try{await t(i);}catch(c){console.error("Export failed:",c);}finally{o(false),a(null);}},[t]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between overflow-y-hidden",children:[jsxRuntime.jsx(bm,{items:e}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(A,{variant:"secondary",size:"sm",isDisabled:r,children:[jsxRuntime.jsx(x,{name:"Export",size:16}),r?"Exporting...":"Export"]}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top end",className:"min-w-48 p-1 bg-white dark:bg-gray-800 rounded-lg shadow-xl ring-1 ring-gray-200 dark:ring-gray-700",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:s,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(x,{name:"List",size:14}),n==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(x,{name:"Code",size:14}),n==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(x,{name:"DownloadSimple",size:14}),n==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})};function zn(e,t,r=true){let o=e||"chart";if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}async function On(e,t,r={},o){let n=Array.isArray(t[0])?t:[t];try{switch(e){case "csv":await hm(n,r);break;case "svg":await ym(o,r);break;case "png":await vm(o,r);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(a){throw console.error("Export failed:",a),new Error(`Failed to export chart as ${e}: ${a instanceof Error?a.message:"Unknown error"}`)}}async function hm(e,t){try{let r=new Map;e.forEach(i=>{i.forEach(c=>{let p=c.xValue.getTime();r.has(p)||r.set(p,c.xValue);});});let n=Array.from(r.values()).sort((i,c)=>i.getTime()-c.getTime()).map(i=>{let c={[t.xLabel||"Date"]:i.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return e.forEach((p,d)=>{let u=t.seriesLabels?.[d]||`Series ${d+1}`,m=p.find(g=>g.xValue.getTime()===i.getTime());c[u]=m?m.yValue:"",m?.category&&(c[`${u} Category`]=m.category);}),c}),a=xm__default.default.unparse(n,{header:!0,skipEmptyLines:!0}),s=new Blob([a],{type:"text/csv;charset=utf-8;"}),l=zn(t.filename||"chart-data","csv",t.timestamp!==!1);fileSaver.saveAs(s,l);}catch(r){throw new Error(`CSV export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function ym(e,t){if(!e.current)throw new Error("SVG element not found");try{let o=e.current.cloneNode(!0);if(!o.querySelector("rect[data-background]")){let c=document.createElementNS("http://www.w3.org/2000/svg","rect");c.setAttribute("width",o.getAttribute("width")||"100%"),c.setAttribute("height",o.getAttribute("height")||"100%"),c.setAttribute("fill","white"),c.setAttribute("data-background","true"),o.insertBefore(c,o.firstChild);}let s=new XMLSerializer().serializeToString(o);s.includes("<?xml")||(s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
77
|
-
`+s),s.includes("xmlns=")||(s=s.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let l=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),i=zn(t.filename||"chart","svg",t.timestamp!==!1);fileSaver.saveAs(l,i);}catch(r){throw new Error(`SVG export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function vm(e,t,r=2){if(!e.current)throw new Error("SVG element not found");let o="";try{let n=e.current,a=n.getBoundingClientRect(),s=n.cloneNode(!0);s.setAttribute("width",String(a.width)),s.setAttribute("height",String(a.height)),s.removeAttribute("transform");let l=s.getElementsByTagName("text");Array.from(l).forEach(u=>{u.style.fontFamily||(u.style.fontFamily="system-ui, -apple-system, sans-serif"),u.style.fontSize||(u.style.fontSize="12px");});let i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.setAttribute("width",String(a.width)),i.setAttribute("height",String(a.height)),i.setAttribute("fill","white"),s.insertBefore(i,s.firstChild);let p=new XMLSerializer().serializeToString(s);p.includes("xmlns=")||(p=p.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let d=new Blob([p],{type:"image/svg+xml;charset=utf-8"});return o=URL.createObjectURL(d),new Promise((u,m)=>{let g=new Image,f=setTimeout(()=>{o&&URL.revokeObjectURL(o),m(new Error("Image loading timeout"));},1e4);g.onload=()=>{clearTimeout(f);try{let b=document.createElement("canvas");b.width=a.width*r,b.height=a.height*r;let h=b.getContext("2d");if(!h)throw new Error("Canvas context not available");h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.scale(r,r),h.fillStyle="white",h.fillRect(0,0,a.width,a.height),h.drawImage(g,0,0,a.width,a.height),b.toBlob(w=>{if(w){let S=zn(t.filename||"chart","png",t.timestamp!==!1);fileSaver.saveAs(w,S),u();}else m(new Error("Failed to create PNG blob"));o&&URL.revokeObjectURL(o);},"image/png",1);}catch(b){o&&URL.revokeObjectURL(o),m(b);}},g.onerror=()=>{clearTimeout(f),o&&URL.revokeObjectURL(o),m(new Error("Failed to load SVG as image"));},g.src=o;})}catch(n){throw o&&URL.revokeObjectURL(o),new Error(`PNG export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function Cm(e){if(typeof window>"u")return false;switch(e){case "csv":return true;case "svg":return typeof XMLSerializer<"u";case "png":return typeof HTMLCanvasElement<"u"&&typeof HTMLCanvasElement.prototype.toBlob=="function";default:return false}}function Sm(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}var xr=new Map,Q=(e,t="#000000")=>{if(typeof window>"u")return t;let r=e.startsWith("var(")?e.slice(4,-1):e.startsWith("--")?e:`--${e}`;if(xr.has(r))return xr.get(r);try{let o=document.documentElement,a=getComputedStyle(o).getPropertyValue(r).trim();if(a)return xr.set(r,a),a;let s=document.createElement("div");s.style.color=`var(${r})`,document.body.appendChild(s);let l=getComputedStyle(s).color;return document.body.removeChild(s),l&&l!=="rgb(0, 0, 0)"?(xr.set(r,l),l):t}catch(o){return console.warn(`Failed to resolve color for ${e}:`,o),t}},Nm=()=>{xr.clear();},so=()=>{let e=[];for(let t=1;t<=6;t++){let r=Q(`--color-data-categorical-${t}`);r&&e.push(r);}return e.length===0?Qs():e},Qs=()=>["#444ae1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#f97316","#14b8a6","#6366f1"],Hn=()=>Q("--color-data-default","#444ae1");var wm=(e,t)=>{let r={},o=so();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r};var ei=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},Pm=e=>ei(e)?Q("--text-body","#333333"):Q("--neutral-white","#ffffff");var io=({data:e,formatType:t})=>{if(!e)return null;let r=_t(t),o=dt__namespace.default.useRef(null),[n,a]=dt__namespace.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});dt__namespace.default.useEffect(()=>{if(!o.current)return;let i=o.current.getBoundingClientRect(),c=window.innerHeight,p=e.x,d=e.y,u=e.position==="left"?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";d-i.height/2<0?d=i.height/2:d+i.height/2>c&&(d=c-i.height/2),a({x:p,y:d,translate:u});},[e.x,e.y,e.position]);let s=l=>new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}).format(l);return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:o,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-white p-4 text-sm shadow-xl ring-1 ring-gray-200 dark:bg-gray-800 dark:ring-gray-700",style:{left:n.x,top:n.y,transform:n.translate},children:[jsxRuntime.jsx("time",{className:"mb-1 font-medium text-gray-900 dark:text-gray-100",children:s(e.xValue)}),jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(l=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l.color}}),jsxRuntime.jsxs("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:[l.label,":"]}),jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.format(l.value)})]},l.label))})]})})};var Wt=({data:e,color:t="#6b7280",strokeWidth:r=3,strokeDasharray:o})=>{let{xScale:n,yScale:a,animationSettings:s}=gt(),l=a.range();return jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:s.duration,ease:s.ease},style:{transformOrigin:`0 ${l[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:jsxRuntime.jsx(shape.LinePath,{data:e,x:i=>n(i.xValue),y:i=>a(i.yValue),stroke:t,strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear})})};var Vm=d3Array.bisector(e=>e.xValue).left,Bm=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-gray-500",children:"No data available"})}),$m=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(z,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(z,{className:"h-4 w-24"}),jsxRuntime.jsx(z,{className:"h-4 w-24"})]})]}),zm=({parentWidth:e,parentHeight:t,yFormatType:r="number",isLoading:o=false,children:n})=>{let[a,s]=dt.useState(null),l=dt.useRef(null),i=dt.useRef(0),c=dt.useMemo(()=>so(),[]),p=dt.useMemo(()=>Hn(),[]),{datasets:d,seriesMetadata:u}=dt.useMemo(()=>{let v=[],D=[],B=0,_=dt.Children.toArray(n).filter(y=>dt.isValidElement(y)&&(y.type===Ot||y.type===Wt||y.type===Gt)&&y.props.data).length;return dt.Children.forEach(n,y=>{if(dt.isValidElement(y)&&(y.type===Ot||y.type===Wt||y.type===Gt)&&y.props.data){v.push(y.props.data);let V=y.props.color||(_===1?p:c[B%c.length]);D.push({label:y.props.label||`Series ${v.length}`,color:V}),B++;}}),{datasets:v,seriesMetadata:D}},[n]),m=e,g=t-60,f=dt.useMemo(()=>d.flat(),[d]),b=dt.useMemo(()=>Dn(f,m),[f,m]),h=dt.useMemo(()=>An(f,g,r),[f,g,r]),w=dt.useCallback(v=>{let{left:D}=l.current?.getBoundingClientRect()||{left:0},B=v.clientX-D;if(v.timeStamp-(i.current||0)<16)return;i.current=v.timeStamp;let _=b.invert(B),y=d.map((U,ue)=>{if(!U||U.length===0)return null;let ge=Vm(U,_,1);if(ge===0)return {point:U[0],datasetIndex:ue};if(ge>=U.length)return {point:U[U.length-1],datasetIndex:ue};let Me=U[ge-1],F=U[ge];if(!Me||!F)return null;let O=Math.abs(Me.xValue.getTime()-_.getTime()),K=Math.abs(F.xValue.getTime()-_.getTime());return {point:O<K?Me:F,datasetIndex:ue}}).filter(U=>U!==null&&u[U.datasetIndex]!==void 0).map(({point:U,datasetIndex:ue})=>({label:u[ue].label,value:U.yValue,color:u[ue].color,point:U}));if(y.length===0){s(null);return}let V=b(y[0].point.xValue),oe=V>(m-ne.right-ne.left)/2+ne.left;s({xValue:y[0].point.xValue,series:y.map(({label:U,value:ue,color:ge})=>({label:U,value:ue,color:ge})),x:V,y:h(y[0].value),position:oe?"left":"right"});},[d,u,b,h,m]),S=()=>{s(null);},C={width:m,height:g,xScale:b,yScale:h,yFormatType:r,animationSettings:Xs,tooltip:{data:a,show:s,hide:()=>s(null)}},P=dt.Children.map(n,(v,D)=>dt.isValidElement(v)&&(v.type===Ot||v.type===Wt||v.type===Gt)?dt__namespace.default.cloneElement(v,{...v.props,color:u[D]?.color}):v),R=u.map(v=>({category:v.label,fill:v.color})),L=dt.useCallback(async v=>{try{await On(v,d,{xLabel:"Date",yLabel:"Value",seriesLabels:u.map(D=>D.label),timestamp:!0},l);}catch(D){console.error("Export failed:",D);}},[d,u]);return o?jsxRuntime.jsx($m,{}):d.length===0?jsxRuntime.jsx(Bm,{}):jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(oo.Provider,{value:C,children:[jsxRuntime.jsxs("svg",{width:m,height:g,className:"overflow-visible",ref:l,children:[jsxRuntime.jsx("g",{children:h.ticks(5).map(v=>jsxRuntime.jsx(shape.Line,{from:{x:ne.left,y:h(v)},to:{x:m-ne.right,y:h(v)},stroke:"#e5e7eb",strokeWidth:1},`grid-line-${v}`))}),P,jsxRuntime.jsx(br.Bottom,{top:g-ne.bottom,scale:b,width:m-ne.left-ne.right}),jsxRuntime.jsx(br.Left,{left:ne.left,scale:h,yFormatType:r}),a?.series.map(v=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:b(a.xValue),cy:h(v.value),r:8,fill:"white",stroke:v.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:b(a.xValue),cy:h(v.value),r:4,fill:v.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${v.label}`)),jsxRuntime.jsx("rect",{x:ne.left,y:ne.top,width:m-ne.left-ne.right,height:g-ne.top-ne.bottom,fill:"transparent",style:{cursor:"crosshair"},onMouseMove:w,onMouseLeave:S})]}),jsxRuntime.jsx(io,{data:a,formatType:r}),jsxRuntime.jsx(ao,{onExport:L,items:R})]})})},ni=responsive.withParentSize(zm);function Kn(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function Ve(e="normal",t){return tailwindMerge.twMerge({high:"font-semibold text-text-body",normal:"text-text-body",low:"text-text-muted"}[e],t&&"hover:text-action-primary cursor-pointer transition-colors")}function ce(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1",Kn(e),t)}function co(e,t="\u2014"){return e==null||e===""?t:String(e)}var xt={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function Be(e="normal"){return {high:xt.lg,normal:xt.md,low:xt.sm}[e]}function we(e,t){return typeof e=="function"?e(t):e}function ai(e="neutral",t="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",t==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-green-100 text-green-800",error:"bg-red-100 text-red-800",warning:"bg-yellow-100 text-yellow-800",info:"bg-blue-100 text-blue-800",neutral:"bg-gray-100 text-gray-800"}[e])}function si(e){return e?"success":"neutral"}function uo(e,t=false){return t?e>0?"text-green-600":e<0?"text-red-600":"text-text-body":"text-text-body"}function ii(e="hover"){switch(e){case "visible":return "text-action-primary underline hover:text-action-primary-hover cursor-pointer";case "hover":return "hover:underline hover:text-action-primary cursor-pointer transition-colors";case "none":return "cursor-pointer";default:return ""}}function ht(e,t,r,o="hover",n){if(!t)return e;let a=typeof t=="function"&&r?t(r):t,s=ii(o);return jsxRuntime.jsx("a",{href:a,className:tailwindMerge.twMerge(s,n),onClick:l=>{l.metaKey||l.ctrlKey;},children:e})}function li({row:e,context:t,actions:r,align:o="right",size:n="sm"}){let{isLoading:a}=t;if(a)return jsxRuntime.jsx(z,{className:xt.sm});let s=r.filter(i=>!we(i.hidden,e));if(s.length===0)return null;let l=ce(o);return jsxRuntime.jsx("div",{className:l,children:s.map(i=>{let c=we(i.disabled,e);return i.variant==="icon"||!i.label?jsxRuntime.jsx(A,{variant:"icon",size:n,onPress:()=>{i.onClick(e);},isDisabled:c,"aria-label":i.label||i.id,children:jsxRuntime.jsx(x,{name:i.icon||"DotsThree",size:n==="sm"?16:20})},i.id):jsxRuntime.jsxs(A,{variant:i.variant||"secondary",size:n,onPress:()=>{i.onClick(e);},isDisabled:c,children:[i.icon&&jsxRuntime.jsx(x,{name:i.icon,size:n==="sm"?14:16}),i.label]},i.id)})})}function ci({value:e,context:t,format:r="icon",trueText:o="Yes",falseText:n="No",trueIcon:a="Check",falseIcon:s="X",showFalse:l=true,align:i="center",emphasis:c="normal"}){let{isLoading:p}=t;if(p)return jsxRuntime.jsx(z,{className:Be(c)});let d=!!e;if(!d&&!l)return jsxRuntime.jsx("div",{className:ce(i)});let u=ce(i);switch(r){case "icon":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(x,{name:d?a:s,size:16,className:d?"text-green-600":"text-gray-400"})});case "text":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx("span",{className:Ve(c),children:d?o:n})});case "badge":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx($t,{variant:d?"success":"neutral",size:"sm",children:d?o:n})});default:return null}}function di({value:e,row:t,context:r,format:o="date",customFormat:n,emptyText:a="\u2014",align:s="left",emphasis:l="normal",href:i,linkBehavior:c="hover"}){let{isLoading:p}=r;if(p)return jsxRuntime.jsx(z,{className:Be(l)});if(!e)return jsxRuntime.jsx("div",{className:ce(s,"text-text-muted"),children:a});let d=e instanceof Date?e:new Date(e);if(isNaN(d.getTime()))return jsxRuntime.jsx("div",{className:ce(s,"text-text-muted"),children:a});let u;switch(o){case "date":u=d.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":u=d.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":u=d.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":u=Gm(d);break;case "custom":u=n?d.toLocaleString("en-US",n):d.toISOString();break;default:u=d.toLocaleDateString();}let m=ce(s,Ve(l)),g=we(i,t);return g?jsxRuntime.jsx("div",{className:m,children:ht(u,g,t,c)}):jsxRuntime.jsx("div",{className:m,children:u})}function Gm(e){let r=new Date().getTime()-e.getTime(),o=Math.floor(r/1e3),n=Math.floor(o/60),a=Math.floor(n/60),s=Math.floor(a/24);return o<60?"just now":n<60?`${n} minute${n!==1?"s":""} ago`:a<24?`${a} hour${a!==1?"s":""} ago`:s<7?`${s} day${s!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function ui({value:e,row:t,context:r,format:o="number",decimals:n=0,prefix:a,suffix:s,emptyText:l="\u2014",align:i="right",emphasis:c="normal",href:p,linkBehavior:d="hover",showPositiveSign:u=false,colorCode:m=false}){let{isLoading:g}=r;if(g)return jsxRuntime.jsx(z,{className:Be(c)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:ce(i,"text-text-muted"),children:l});let f=Number(e),b;switch(o){case "currency":b=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(f);break;case "percent":b=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(f/100);break;case "compact":b=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:n>0?1:0,maximumFractionDigits:n}).format(f);break;default:b=new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(f);}let w=`${u&&f>0?"+":""}${b}`,S=m?uo(f,true):Ve(c),C=ce(i,S),P=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("span",{className:"text-text-muted",children:a}),jsxRuntime.jsx("span",{children:w}),s&&jsxRuntime.jsx("span",{className:"text-text-muted",children:s})]}),R=we(p,t);return R?jsxRuntime.jsx("div",{className:C,children:ht(P,R,t,d)}):jsxRuntime.jsx("div",{className:C,children:P})}function pi({row:e,context:t,isSelected:r=false,onSelect:o,isDisabled:n=false,align:a="center"}){let{isLoading:s}=t;if(s)return jsxRuntime.jsx("div",{className:ce(a),children:jsxRuntime.jsx(z,{className:"h-4 w-4 rounded"})});let l=we(n,e),i=ce(a);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx(We,{isSelected:r,onChange:c=>{o?.(e,c);},isDisabled:l,"aria-label":"Select row"})})}function mi({value:e,row:t,context:r,prefix:o,suffix:n,emptyText:a="\u2014",href:s,linkBehavior:l="visible",emphasis:i="normal",truncate:c=true,align:p="left"}){let{isLoading:d}=r;if(d)return jsxRuntime.jsx(z,{className:Be(i)});let u=co(e,a),m=we(s,t),g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-muted",children:o}),jsxRuntime.jsx("span",{className:c?"truncate":"",children:u}),n&&jsxRuntime.jsx("span",{className:"text-text-muted",children:n})]}),f=ce(p,Ve(i));return m?jsxRuntime.jsx("div",{className:f,children:ht(g,m,t,l)}):jsxRuntime.jsx("div",{className:f,children:g})}var Zm={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},Xm={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function mo(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function fo(e,t,r,o){if(r.cell){let n=r.cell,a=typeof r.cellProps=="function"?r.cellProps(e,t):r.cellProps;return jsxRuntime.jsx(n,{value:e,row:t,context:o,...a})}return r.render?r.render(e,t,o):e?.toString()??"\u2014"}function bo({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(d=>d.mobile!==false).map(d=>{let u=d.mobile===false?null:d.mobile;return {...d,mobilePriority:u?.priority??2,mobileFormat:u?.format??"secondary",showLabel:u?.label??u?.format==="secondary",icon:u?.icon}}).sort((d,u)=>d.mobilePriority-u.mobilePriority),s=a.filter(d=>d.mobilePriority===1||d.mobileFormat==="primary"),l=a.filter(d=>d.mobilePriority===2&&d.mobileFormat!=="primary"),i=a.filter(d=>d.mobileFormat==="badge"),c={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:[s.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:s.map(d=>{let u=mo(e,d);return jsxRuntime.jsx("div",{className:"font-medium text-text-body [&>*]:!justify-start [&>*]:!text-left",children:fo(u,e,d,c)},d.id)})}),i.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:i.map(d=>{let u=mo(e,d);return jsxRuntime.jsx("div",{className:"inline-flex",children:fo(u,e,d,c)},d.id)})})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:l.map(d=>{let u=mo(e,d),m=d.showLabel&&d.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-muted",children:[d.icon&&jsxRuntime.jsx(x,{name:d.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),m&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[d.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:fo(u,e,d,c)})]},d.id)})})]})}function xo({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(i=>i.mobile!==false),s={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:a.map((i,c)=>{let p=mo(e,i),d=c===0;return jsxRuntime.jsxs("div",{children:[!d&&jsxRuntime.jsx("div",{className:"text-xs text-text-muted",children:i.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(d?"font-medium text-text-body":"text-sm text-text-body","[&>*]:!justify-start [&>*]:!text-left"),children:fo(p,e,i,s)})]},i.id)})})})}function fi(e="md"){return {mobile:Zm[e],desktop:Xm[e]}}function gi({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var Xn={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},jn={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},qm={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},Ym={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function qn(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function Jm(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Qm({column:e,sortConfig:t,onSort:r,stickyHeader:o,density:n="default"}){let a=t?.columnId===e.id,s=a?t.direction:null;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-default bg-background-surface font-medium text-text-muted",Xn[n],jn[e.align||"left"],o&&"sticky top-0 z-10",e.sortable&&"cursor-pointer hover:bg-background-hover"),onClick:()=>e.sortable&&r(e.id),role:"columnheader","aria-sort":a?s==="asc"?"ascending":"descending":"none",style:qn(e),children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(x,{name:s==="asc"?"CaretUp":s==="desc"?"CaretDown":"CaretUp",size:12,className:a?"text-text-body":"text-text-muted opacity-50"})})]})}function ef({column:e,row:t,rowIndex:r,columnIndex:o,isHovered:n,density:a="default",className:s}){let l=Jm(t,e),i={isLoading:false,isHovered:n,rowIndex:r,columnIndex:o,density:a},c;if(e.cell){let p=e.cell,d=typeof e.cellProps=="function"?e.cellProps(l,t):e.cellProps;c=jsxRuntime.jsx(p,{value:l,row:t,context:i,...d});}else e.render?c=e.render(l,t,i):c=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",Xn[a],jn[e.align||"left"],s),role:"cell",style:qn(e),children:c})}function tf({column:e,rowIndex:t,columnIndex:r,density:o="default"}){let n={isLoading:true,rowIndex:t,columnIndex:r,density:o},a;if(e.cell){let s=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;a=jsxRuntime.jsx(s,{value:null,row:{},context:n,...l});}else e.render?a=e.render(null,{},n):a=jsxRuntime.jsx(z,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",Xn[o],jn[e.align||"left"]),role:"cell",style:qn(e),children:a})}function rf({columns:e,row:t,rowIndex:r,density:o="default",onClick:n}){let[a,s]=dt.useState(false),l=dt.useCallback(()=>{n&&n(t);},[n,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",n&&"cursor-pointer"),role:"row",onClick:l,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e.map((i,c)=>jsxRuntime.jsx(ef,{column:i,row:t,rowIndex:r,columnIndex:c,isHovered:a,density:o,className:n?"group-hover:bg-background-hover":""},i.id))})}function of({columns:e,rowIndex:t,density:r="default"}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((o,n)=>jsxRuntime.jsx(tf,{column:o,rowIndex:t,columnIndex:n,density:r},o.id))})}function hi({columns:e,data:t,className:r,density:o="default",width:n="full",height:a,maxHeight:s,layout:l="auto",mobileRenderer:i="auto",customMobileRowRender:c,mobileBreakpoint:p="md",isLoading:d=false,loadingRowCount:u=5,stickyHeader:m=false,onRowClick:g,getRowId:f,hideHeader:b=false,onSort:h,"aria-label":w}){let[S,C]=dt.useState(null),P=dt.useMemo(()=>e.map(y=>{if(y.width)return typeof y.width=="number"?`${y.width}px`:y.width;if(y.flex)return `${y.flex}fr`;if(y.minWidth&&y.maxWidth){let V=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth,oe=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth;return `minmax(${V}, ${oe})`}return y.minWidth?`minmax(${typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth}, 1fr)`:y.maxWidth?`minmax(0, ${typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth})`:"1fr"}).join(" "),[e]),R=dt.useCallback(y=>{if(!e.find(U=>U.id===y)?.sortable)return;let oe=null;S?.columnId===y?S.direction==="asc"?oe={columnId:y,direction:"desc"}:oe=null:oe={columnId:y,direction:"asc"},C(oe),h?.(oe);},[e,S,h]),L={};a&&(L.height=typeof a=="number"?`${a}px`:a,L.overflowY="auto"),s&&(L.maxHeight=typeof s=="number"?`${s}px`:s,L.overflowY="auto");let v=tailwindMerge.twMerge(qm[n],l==="responsive"?"overflow-x-auto":"overflow-auto",r),D=fi(p),B=i!=="none",_=(y,V)=>B?i==="custom"&&c?c(y,V):jsxRuntime.jsx(i==="cards"?xo:bo,{row:y,columns:e,density:o,isLoading:d,onClick:g?()=>g(y):void 0}):null;return jsxRuntime.jsxs("div",{className:v,style:L,children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",Ym[l],n==="auto"?"inline-grid w-auto":"w-full",B&&D.desktop),role:"table","aria-label":w,style:{gridTemplateColumns:P},children:[!b&&jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:e.map(y=>jsxRuntime.jsx(Qm,{column:y,sortConfig:S,onSort:R,stickyHeader:m,density:o},y.id))}),jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:d?Array.from({length:u}).map((y,V)=>jsxRuntime.jsx(of,{columns:e,rowIndex:V,density:o},`loading-${V}`)):t.length>0?t.map((y,V)=>{let oe=f?f(y):`row-${V}`;return jsxRuntime.jsx(rf,{columns:e,row:y,rowIndex:V,density:o,onClick:g},oe)}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-muted",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),B&&jsxRuntime.jsx("div",{className:D.mobile,children:d?Array.from({length:u}).map((y,V)=>jsxRuntime.jsx(gi,{density:o},`mobile-loading-${V}`)):t.length>0?t.map((y,V)=>{let oe=f?f(y):`mobile-row-${V}`;return jsxRuntime.jsx("div",{children:_(y,V)},oe)}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-muted",children:"No data available"})})]})}function yi({label:e,description:t,errorMessage:r,showCalendar:o=false,...n}){let[a,s]=dt.useState(false),l=i=>{n.onChange&&i&&n.onChange(i),s(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...n,className:j(n.className,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{children:e}),o?jsxRuntime.jsxs(Zr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(Xt,{className:"min-w-[150px] flex-1"}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:a,onOpenChange:s,children:[jsxRuntime.jsx(A,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})}),jsxRuntime.jsx(reactAriaComponents.Popover,{children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4",children:jsxRuntime.jsx(Jr,{value:n.value,onChange:l,minValue:n.minValue,maxValue:n.maxValue,isDisabled:n.isDisabled,isReadOnly:n.isReadOnly,isDateUnavailable:n.isDateUnavailable})})})]})]}):jsxRuntime.jsx(Xt,{}),t&&jsxRuntime.jsx(te,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null]})}function mf({isPlaceholder:e,isDisabled:t}){return ["inline box-content px-0.5 -my-0.5 rounded outline-none tabular-nums text-center transition-colors",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text","hover:bg-text-body/5","data-[focused]:!outline-[1.5px] data-[focused]:!outline-[var(--control-focus-ring-color)] data-[focused]:![--tw-outline-style:solid]"].filter(Boolean).join(" ")}function Xt(e){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:t=>pr({...t,className:typeof e.className=="string"?e.className:"min-w-[150px] px-2 py-1.5 text-sm flex items-center gap-0.5"}),...e,children:t=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:t,className:mf({isPlaceholder:t.isPlaceholder,isDisabled:!t.isEditable})})})}function jt(e){return jsxRuntime.jsx(reactAriaComponents.Dialog,{...e,className:tailwindMerge.twMerge("relative h-auto max-h-[inherit] overflow-auto outline-none [[data-placement]>&]:p-4",e.className),role:"dialog"})}function Sf({selectionState:e,isDisabled:t}){let r=`${de} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,o={none:"text-text-body group-hover:bg-gray-200 group-pressed:bg-gray-200",middle:["group-hover:bg-gray-300 forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-red-200 forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-blue-300 forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-red-300 forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:" group-invalid:bg-red-600 forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] text-white forced-colors:text-white !bg-neutral-black"},n=t?"text-textFaint dark:text-zinc-600 forced-colors:text-textFaint font-light":"";return [r,o[e],n].filter(Boolean).join(" ")}function ho({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(Qr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full [&_td]:px-0",children:[jsxRuntime.jsx(eo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:"selection-start:rounded-s-end selection-end:rounded-e-end [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm outline-none outside-month:text-gray-300 selected:bg-background-selected invalid:selected:bg-red-100 forced-colors:selected:bg-[Highlight] forced-colors:selected:text-white forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full",children:({formattedDate:o,isSelected:n,isSelectionStart:a,isSelectionEnd:s,isFocusVisible:l,isDisabled:i})=>jsxRuntime.jsx("span",{className:Sf({selectionState:n&&(a||s)?"cap":n?"middle":"none",isDisabled:i}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Si({label:e,description:t,errorMessage:r,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:j(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{children:e}),jsxRuntime.jsxs(Zr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(Xt,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-gray-800 group-disabled:text-gray-200 dark:text-zinc-200 group-disabled:dark:text-zinc-600 forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(Xt,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(A,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),t&&jsxRuntime.jsx(te,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null,jsxRuntime.jsx(mt,{children:jsxRuntime.jsx(jt,{children:jsxRuntime.jsx(ho,{})})})]})}var Yt=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:s})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full items-center justify-between border-b px-4",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(A,{variant:"unstyled",onPress:a,className:"absolute left-4",children:jsxRuntime.jsx(x,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Ee,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx(A,{variant:"unstyled",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(x,{name:"X","data-testid":"close-button"})})]})]});var Jt=class extends dt.Component{constructor(){super(...arguments);ir(this,"state",{hasError:false});ir(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Ae,{children:[this.props.title&&jsxRuntime.jsx(Ae.Header,{title:this.props.title}),jsxRuntime.jsx(Ae.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-red-500",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var Qn=({children:e,title:t,headerContent:r,isOpen:o,slideInFrom:n="right",transparentOverlay:a=false,onClose:s,className:l,primaryAction:i,secondaryAction:c,footerContent:p,contentPadding:d=true,maxWidth:u="400px"})=>{let[m,g]=dt.useState(false);if(dt.useEffect(()=>{if(o){let h=setTimeout(()=>g(true),10);return ()=>clearTimeout(h)}else g(false);},[o]),!o)return null;let f=i||c,b=f||p;return jsxRuntime.jsx(Jt,{children:jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isOpen:o,onOpenChange:s,isDismissable:true,className:`fixed inset-0 z-50 ${a?"bg-transparent":"bg-black/50"}`,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",isDismissable:true,children:jsxRuntime.jsxs(jt,{className:`fixed bottom-0 top-0 z-50 flex w-full flex-col bg-background-surface shadow-xl duration-300 h-full min-h-0 overflow-hidden dark:bg-gray-800 ${m?n==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":""} ${l||""}`,style:{[n==="right"?"right":"left"]:0,maxWidth:u,transform:m?void 0:n==="right"?"translateX(100%)":"translateX(-100%)"},children:[(t||r)&&jsxRuntime.jsx(Yt,{title:t,headerContent:r,onClose:s||(()=>{})}),jsxRuntime.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain ${d?"p-6":"p-0"}`,children:e}),b&&jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[p&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:p}),f&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[c&&jsxRuntime.jsx(A,{size:c.size||"lg",fullWidth:true,variant:c.variant||"secondary",onPress:c.onPress,isLoading:c.isLoading,isDisabled:c.isDisabled,children:c.label}),i&&jsxRuntime.jsx(A,{size:i.size||"lg",fullWidth:true,onPress:i.onPress,isLoading:i.isLoading,isDisabled:i.isDisabled,children:i.label})]})]})]})})})})};Qn.displayName="Drawer";function Ti({value:e,onChange:t,onUrlChange:r,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:s,className:l,showPreview:i=true,placeholder:c="Drop files here or click to browse"}){let[p,d]=dt.useState(false),[u,m]=dt.useState(false),[g,f]=dt.useState(null),[b,h]=dt.useState(e),w=dt.useRef(null),S=async R=>{if(f(null),n&&R.size>n){f(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(i&&R.type.startsWith("image/")){let L=new FileReader;L.onloadend=()=>{h(L.result);},L.readAsDataURL(R);}if(s){m(true);try{let L=await s(R);h(L),r?.(L);}catch(L){f("Failed to upload file"),console.error("Upload error:",L);}finally{m(false);}}t?.(R,b);},C=R=>{let L=R.items;if(L.length>0){let v=L[0];if(v.kind==="file"){let D=v.getAsFile();D&&S(D);}}d(false);},P=()=>{h(void 0),f(null),t?.(null),r?.(""),w.current&&(w.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",l),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",p?"border-action-primary bg-action-primary/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",g&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:C,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[b?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[i&&b.startsWith("data:image")?jsxRuntime.jsx("img",{src:b,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(A,{variant:"icon",size:"sm",onPress:P,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:c}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:R=>{let L=Array.from(R||[]);L.length>0&&S(L[0]);},children:jsxRuntime.jsx(A,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),u&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-primary border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),g&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:g})]})}function ki(e){return jsxRuntime.jsx(reactAriaComponents.Form,{...e,className:tailwindMerge.twMerge("flex flex-col gap-4",e.className)})}var Hf={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12",none:"grid-cols-none"},Gf={sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12",none:"sm:grid-cols-none"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12",none:"md:grid-cols-none"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12",none:"lg:grid-cols-none"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6",7:"xl:grid-cols-7",8:"xl:grid-cols-8",9:"xl:grid-cols-9",10:"xl:grid-cols-10",11:"xl:grid-cols-11",12:"xl:grid-cols-12",none:"xl:grid-cols-none"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",5:"2xl:grid-cols-5",6:"2xl:grid-cols-6",7:"2xl:grid-cols-7",8:"2xl:grid-cols-8",9:"2xl:grid-cols-9",10:"2xl:grid-cols-10",11:"2xl:grid-cols-11",12:"2xl:grid-cols-12",none:"2xl:grid-cols-none"}},_f={none:"gap-0",xs:"gap-x-2 gap-y-1",sm:"gap-x-3 gap-y-2",md:"gap-x-4 gap-y-3",lg:"gap-x-6 gap-y-4",xl:"gap-x-8 gap-y-6","2xl":"gap-x-12 gap-y-8"},Wf={none:"gap-x-0",xs:"gap-x-2",sm:"gap-x-3",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},Uf={none:"gap-y-0",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-3",lg:"gap-y-4",xl:"gap-y-6","2xl":"gap-y-8"},Kf={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Zf={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Xf={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"},jf={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",full:"col-span-full",auto:"col-auto"},qf={sm:{1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",full:"sm:col-span-full",auto:"sm:col-auto"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",full:"md:col-span-full",auto:"md:col-auto"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",full:"lg:col-span-full",auto:"lg:col-auto"},xl:{1:"xl:col-span-1",2:"xl:col-span-2",3:"xl:col-span-3",4:"xl:col-span-4",5:"xl:col-span-5",6:"xl:col-span-6",7:"xl:col-span-7",8:"xl:col-span-8",9:"xl:col-span-9",10:"xl:col-span-10",11:"xl:col-span-11",12:"xl:col-span-12",full:"xl:col-span-full",auto:"xl:col-auto"},"2xl":{1:"2xl:col-span-1",2:"2xl:col-span-2",3:"2xl:col-span-3",4:"2xl:col-span-4",5:"2xl:col-span-5",6:"2xl:col-span-6",7:"2xl:col-span-7",8:"2xl:col-span-8",9:"2xl:col-span-9",10:"2xl:col-span-10",11:"2xl:col-span-11",12:"2xl:col-span-12",full:"2xl:col-span-full",auto:"2xl:col-auto"}};function Fi(e,t,r){if(!e)return "";if(typeof e!="object")return t[e]||"";let o=[];return "base"in e&&e.base!==void 0&&o.push(t[e.base]),Object.entries(r).forEach(([n,a])=>{let s=e[n];s!==void 0&&o.push(a[s]);}),o.join(" ")}function ea({cols:e=1,gap:t="md",gapX:r,gapY:o,align:n="stretch",justify:a="start",flow:s="row",autoFit:l,autoFill:i,className:c,children:p}){let d=tailwindMerge.twMerge("grid",l||i?"":Fi(e,Hf,Gf),!r&&!o&&_f[t],r&&Wf[r],o&&Uf[o],Kf[n],Zf[a],Xf[s],c),u={};return l?u.gridTemplateColumns=`repeat(auto-fit, minmax(${l}, 1fr))`:i&&(u.gridTemplateColumns=`repeat(auto-fill, minmax(${i}, 1fr))`),jsxRuntime.jsx("div",{className:d,style:u,children:p})}function Li({span:e,className:t,children:r}){let o=tailwindMerge.twMerge(Fi(e,jf,qf),t);return jsxRuntime.jsx("div",{className:o,children:r})}ea.Item=Li;function Yf(e,t){return cr({value:e,formatter:t,emptyClassName:"text-text-muted",emptyText:"\u2014"})}function Jf(e,t="upIsGood"){if(e===0)return "text-text-muted";let r=e>0;return t==="upIsGood"?r?"text-feedback-success":"text-feedback-error":r?"text-feedback-error":"text-feedback-success"}function Qf({points:e,className:t,ariaLabel:r}){let s=e.map(m=>typeof m.y=="number"?m.y:0);if(s.length===0)return null;let l=Math.min(...s),c=Math.max(...s)-l,p=m=>c===0?20/2:18-(m-l)/c*16,d=60/Math.max(e.length-1,1),u=e.map((m,g)=>{let f=2+g*d,b=p(typeof m.y=="number"?m.y:0);return `${g===0?"M":"L"} ${f} ${b}`}).join(" ");return jsxRuntime.jsx("svg",{width:64,height:20,role:"img","aria-label":r,className:tailwindMerge.twMerge("overflow-visible",t),children:jsxRuntime.jsx("path",{d:u,fill:"none",strokeWidth:"1.5",className:"stroke-border-muted"})})}function Ii({label:e,value:t,formatter:r,delta:o,deltaPeriodLabel:n,deltaIntent:a="upIsGood",trend:s,status:l,helpText:i,size:c="md",orientation:p="vertical",loading:d,empty:u,error:m,onClick:g,className:f,renderValue:b,renderDelta:h,renderTrend:w}){let C={sm:{label:"text-xs",value:"text-base",delta:"text-xs",gap:"gap-1"},md:{label:"text-sm",value:"text-xl",delta:"text-sm",gap:"gap-2"},lg:{label:"text-base",value:"text-2xl",delta:"text-base",gap:"gap-3"}}[c],P=d?jsxRuntime.jsx(z,{className:"h-7 w-20"}):u?jsxRuntime.jsx("span",{className:"text-text-muted",children:"\u2014"}):m?jsxRuntime.jsx("span",{className:"text-feedback-error text-sm",children:typeof m=="string"?m:"Error"}):b?b(t):Yf(t,r),R=h?h(o):o!==void 0&&!d&&!u&&!m?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(C.delta,Jf(o,a),"flex items-center gap-1"),children:[o>0&&jsxRuntime.jsx(x,{name:"ArrowUp",size:12}),o<0&&jsxRuntime.jsx(x,{name:"ArrowDown",size:12}),o===0&&jsxRuntime.jsx(x,{name:"Minus",size:12}),jsxRuntime.jsxs("span",{children:[o>0?"+":"",Math.abs(o).toFixed(1),"%"]}),n&&jsxRuntime.jsxs("span",{className:"text-text-muted",children:["\xB7 ",n]})]}):d?jsxRuntime.jsx(z,{className:"h-4 w-24"}):null,L=w?w(s):s&&s.length>0&&!d&&!m?jsxRuntime.jsx(Qf,{points:s,ariaLabel:`${e} trend`,className:u?"opacity-30":""}):d?jsxRuntime.jsx(z,{className:"h-5 w-16"}):null;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("flex min-w-0",p==="horizontal"?`items-center ${C.gap}`:`flex-col ${C.gap}`,g&&"cursor-pointer hover:bg-background-muted rounded-lg px-3 py-2 -mx-3 -my-2 transition-colors",f),"aria-labelledby":`kpi-${e}`,onClick:g,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h3",{id:`kpi-${e}`,className:tailwindMerge.twMerge(C.label,"font-medium text-text-caption truncate"),children:d?jsxRuntime.jsx(z,{className:"h-4 w-24"}):e}),i&&!d&&jsxRuntime.jsx(x,{name:"Question",size:12,className:"text-text-muted cursor-help","aria-label":"Help"})]}),jsxRuntime.jsxs("div",{className:"flex items-baseline gap-2",children:[jsxRuntime.jsx("output",{className:tailwindMerge.twMerge(C.value,"font-semibold",m?"text-feedback-error":"text-text-heading"),"aria-label":`Value: ${P}`,children:P}),l&&!d&&!m&&jsxRuntime.jsx($t,{variant:l.tone||"neutral",size:"sm",children:l.value})]}),(R||L)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[R,L]})]})}var eg={xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-6",xl:"gap-8"},tg={start:"items-start",center:"items-center",stretch:"items-stretch"};function rg(e){if(typeof e=="number")return `grid-cols-${e}`;let t=[];return e.base!==void 0&&t.push(`grid-cols-${e.base}`),e.sm!==void 0&&t.push(`sm:grid-cols-${e.sm}`),e.md!==void 0&&t.push(`md:grid-cols-${e.md}`),e.lg!==void 0&&t.push(`lg:grid-cols-${e.lg}`),e.xl!==void 0&&t.push(`xl:grid-cols-${e.xl}`),e["2xl"]!==void 0&&t.push(`2xl:grid-cols-${e["2xl"]}`),t.join(" ")}function ra({children:e,cols:t={base:1,sm:2,md:3,lg:4},gap:r="md",align:o="stretch",equalizeHeights:n=true,header:a,loading:s,className:l}){let i=s?dt__namespace.default.Children.map(e,c=>dt__namespace.default.isValidElement(c)&&c.type&&typeof c.type!="string"&&"displayName"in c.type?dt__namespace.default.cloneElement(c,{loading:true}):c):e;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("w-full",l),"aria-label":"Key metrics",children:[a&&jsxRuntime.jsx("div",{className:"mb-4",children:a}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",rg(t),eg[r],tg[o],n&&"auto-rows-fr","w-full"),children:i})]})}ra.displayName="KpiGroup";function ag({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:j(t.className,"outline-0"),children:e})}var Vi=({className:e,size:t=24,color:r="text-action-primary"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",r,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var Bi="./neutral-dark-ULOPSLHN.png";var $i="./neutral-light-IAPUNYDO.png";var zi="./satelite-light-CU3QG3IP.png";var Oi="./streets-dark-47NJZQUE.png";var Hi="./streets-light-YXBEDGBR.png";var gg=e=>[{id:"streets",name:"Streets",description:"Standard street map with traffic data",preview:e?Oi:Hi},{id:"satellite",name:"Satellite",description:"Aerial imagery with street labels",preview:zi},{id:"neutral",name:"Neutral",description:"Clean design with light/dark variants",preview:e?Bi:$i}];function Gi({position:e="bottom-left",className:t,style:r,currentTheme:o="streets",onThemeChange:n,isoRtoVisible:a=false,onIsoRtoToggle:s,vermontSubstationsVisible:l=false,onVermontSubstationsToggle:i,transformersVisible:c=false,onTransformersToggle:p,feedersVisible:d=false,onFeedersToggle:u,spansVisible:m=false,onSpansToggle:g}){let{isDarkTheme:f}=Vt(),b=gg(f),h=C=>{n?.(C);},w=()=>{switch(e){case "top-left":return "absolute top-4 left-4";case "top-right":return "absolute top-4 right-4";case "bottom-left":return "absolute bottom-4 left-4";case "bottom-right":return "absolute bottom-4 right-4";default:return "absolute bottom-4 left-4"}},S=tailwindMerge.twMerge("h-10 w-10 p-0","bg-background-surface hover:bg-background-hover shadow-lg border border-border");return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(w(),"z-10",t),style:r,children:jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsx(A,{className:tailwindMerge.twMerge(S,"focus:outline-none focus:ring-0"),variant:"secondary",size:"sm",children:jsxRuntime.jsx(x,{name:"Stack",size:20,className:"text-text-primary"})}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top start",className:"p-4 min-w-80 bg-background-surface border border-border rounded-lg shadow-xl focus:outline-none focus:ring-0",children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-text-body mb-3",children:"Map type"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:b.map(C=>jsxRuntime.jsxs("button",{onClick:()=>h(C.id),className:tailwindMerge.twMerge("flex flex-col items-center space-y-2 p-3 rounded-lg text-center","hover:bg-background-muted transition-colors border border-transparent",o===C.id?"bg-background-muted border-border":"hover:border-border"),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-12 h-12 rounded-lg overflow-hidden","bg-background-surface border",o===C.id?"border-action-secondary":"border-border"),children:jsxRuntime.jsx("img",{src:C.preview,alt:`${C.name} map preview`,className:"w-full h-full object-cover"})}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm",o===C.id?"font-bold text-text-body":"font-normal text-text-faint"),children:C.name})]},C.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-text-body mb-3",children:"Map details"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(We,{isSelected:a,onChange:C=>s?.(C),children:jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:"ISO RTO regions"})}),jsxRuntime.jsx(We,{isSelected:l,onChange:C=>i?.(C),children:jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:"Substations"})}),jsxRuntime.jsx(We,{isSelected:c,onChange:C=>p?.(C),children:jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:"Transformers"})}),jsxRuntime.jsx(We,{isSelected:d,onChange:C=>u?.(C),children:jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:"Feeders"})}),jsxRuntime.jsx(We,{isSelected:m,onChange:C=>g?.(C),children:jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:"Spans"})})]})]})]})})]})})})}function Wi({position:e="top-right",className:t,style:r,onToggle:o,isOpen:n=false,showListPanel:a=true,items:s=[]}){let[l,i]=dt.useState(false),c=()=>{let m=!l;i(m),o?.(m);},p=()=>{switch(e){case "top-left":return "absolute top-4 left-4";case "top-right":return "absolute top-4 right-4";case "bottom-left":return "absolute bottom-4 left-4";case "bottom-right":return "absolute bottom-4 right-4";default:return "absolute top-4 right-4"}},d=tailwindMerge.twMerge("h-10 w-10 p-0","bg-background-surface hover:bg-background-hover shadow-lg border border-border"),u=n!==void 0?n:l;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p(),"z-10",t),style:r,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(A,{className:d,onPress:c,variant:"secondary",size:"sm",children:jsxRuntime.jsx(x,{name:"ListDashes",size:20,className:"text-text-primary"})}),u&&a&&s.length>0&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("absolute top-12 right-0 min-w-48 max-w-80","bg-background-surface border border-border rounded-lg shadow-xl p-3"),children:[jsxRuntime.jsx("div",{className:"text-sm font-medium text-text-primary mb-2",children:"List Items"}),jsxRuntime.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:s.map(m=>jsxRuntime.jsx("button",{onClick:m.onClick,className:tailwindMerge.twMerge("w-full text-left px-3 py-2 text-sm rounded hover:bg-background-muted","text-text-primary hover:text-text-primary"),children:m.name},m.id))})]})]})})}function Ui({mapRef:e,position:t="top-right",className:r,style:o,showCompass:n=true,showGeolocate:a=true,onCompassClick:s,onGeolocateClick:l}){let[i,c]=dt.useState(false),p=()=>{s?s():e.current&&e.current.easeTo({bearing:0,duration:500});},d=()=>{if(l)l();else {if(!navigator.geolocation){console.warn("Geolocation is not supported by this browser.");return}c(true),navigator.geolocation.getCurrentPosition(g=>{let{latitude:f,longitude:b}=g.coords;e.current&&e.current.flyTo({center:[b,f],zoom:15,duration:2e3}),c(false);},g=>{switch(console.warn("Error getting location:",g),g.code){case g.PERMISSION_DENIED:console.warn("Location access denied. Please enable location services in your browser settings.");break;case g.POSITION_UNAVAILABLE:console.warn("Location information unavailable.");break;case g.TIMEOUT:console.warn("Location request timed out.");break;default:console.warn("Unknown location error occurred.");break}c(false);},{enableHighAccuracy:true,timeout:1e4,maximumAge:3e5});}},u=()=>{switch(t){case "top-left":return "absolute top-4 left-4";case "top-right":return "absolute top-4 right-4";case "bottom-left":return "absolute bottom-4 left-4";case "bottom-right":return "absolute bottom-4 right-4";default:return "absolute top-4 right-4"}},m=tailwindMerge.twMerge("h-10 w-10 p-0","bg-background-surface hover:bg-background-hover shadow-lg border border-border");return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(u(),"z-10 flex flex-col",r),style:o,children:[n&&jsxRuntime.jsx("div",{className:"block lg:hidden",children:jsxRuntime.jsx(A,{className:tailwindMerge.twMerge(m,"rounded-b-none"),onPress:p,variant:"secondary",size:"sm",children:jsxRuntime.jsx(x,{name:"Compass",size:20,className:"text-text-primary"})})}),a&&jsxRuntime.jsx(A,{className:tailwindMerge.twMerge(m,n?"rounded-t-none border-t-0 lg:rounded-t-none":"rounded-t-none"),onPress:d,variant:"secondary",size:"sm",isDisabled:i,children:jsxRuntime.jsx(x,{name:i?"Spinner":"NavigationArrow",size:20,className:tailwindMerge.twMerge("text-text-primary",i&&"animate-spin")})})]})}function Xi({position:e="top-left",className:t,style:r,onSearch:o,placeholder:n="Search places...",showSearchInput:a=true}){let[s,l]=dt.useState(false),[i,c]=dt.useState(""),p=()=>{a?l(!s):o&&o("");},d=f=>{f.preventDefault(),o&&i.trim()&&(o(i.trim()),l(false));},u=f=>{f.key==="Escape"&&l(false);},m=()=>{switch(e){case "top-left":return "absolute top-4 left-4";case "top-right":return "absolute top-4 right-4";case "bottom-left":return "absolute bottom-4 left-4";case "bottom-right":return "absolute bottom-4 right-4";default:return "absolute top-4 left-4"}},g=tailwindMerge.twMerge("h-10 w-10 p-0","bg-background-surface hover:bg-background-hover shadow-lg border border-border");return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(m(),"z-10",t),style:r,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(A,{className:g,onPress:p,variant:"secondary",size:"sm",children:jsxRuntime.jsx(x,{name:"MagnifyingGlass",size:20,className:"text-text-primary"})}),s&&a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute top-12 left-0 min-w-64","bg-background-surface border border-border rounded-lg shadow-xl p-3"),children:jsxRuntime.jsx("form",{onSubmit:d,children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"text",value:i,onChange:f=>c(f.target.value),onKeyDown:u,placeholder:n,className:tailwindMerge.twMerge("flex-1 px-3 py-2 text-sm rounded border","bg-background border-border text-text-primary placeholder-text-muted","focus:outline-none focus:ring-2 focus:ring-action-primary"),autoFocus:true}),jsxRuntime.jsx(A,{type:"submit",variant:"primary",size:"sm",className:"px-3 py-2",children:"Search"})]})})})]})})}function ji(e){return {type:"FeatureCollection",features:e.map(({longitude:t,latitude:r,id:o})=>({type:"Feature",properties:{id:o},geometry:{type:"Point",coordinates:[t,r]}}))}}function yg(e,t,r){let o={height:256,width:256},n=14,a=f=>{let b=Math.sin(f*Math.PI/180),h=Math.log((1+b)/(1-b))/2;return Math.max(Math.min(h,Math.PI),-Math.PI)/2},s=(f,b,h)=>Math.floor(Math.log(f/b/h)/Math.LN2),l=[e[2],e[3]],i=[e[0],e[1]],c=(a(l[1])-a(i[1]))/Math.PI,p=l[0]-i[0],d=(p<0?p+360:p)/360,u=s(r,o.height,c),m=s(t,o.width,d),g=Math.min(u,m,n)-1;return Math.max(g,3)}function No(e,t=800,r=600){if(e.length===0)return {latitude:39.8283,longitude:-98.5795,zoom:3,bearing:0,pitch:0,padding:{top:0,bottom:0,left:0,right:0}};let o=e[0].latitude,n=e[0].latitude,a=e[0].longitude,s=e[0].longitude;for(let d of e)o=Math.min(o,d.latitude),n=Math.max(n,d.latitude),a=Math.min(a,d.longitude),s=Math.max(s,d.longitude);let l=[a,o,s,n],i=(o+n)/2,c=(a+s)/2,p=yg(l,t,r);return {latitude:i,longitude:c,zoom:p,bearing:0,pitch:0,padding:{top:80,bottom:80,left:80,right:80}}}function oa(e){if(e)return {city:e.city?Array.isArray(e.city)?e.city:[e.city]:void 0,state:e.state?Array.isArray(e.state)?e.state:[e.state]:void 0,search:e.search?.trim()||void 0}}var vg="pk.eyJ1IjoidmljdG9yLXRleHR1cmUiLCJhIjoiY20yNTNnY2FhMG1nNTJqcG5xd2F4a2FncCJ9.lIo-qhEyJzlaMFSYHzv2lw";function qi(){return typeof process<"u"&&process.env?.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN?process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN:typeof window<"u"&&window.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN?window.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN:vg}function Yi({isOpen:e,onClose:t,children:r}){return e?jsxRuntime.jsxs("div",{className:"absolute right-0 top-0 z-10 flex h-full w-[400px] translate-x-0 flex-col overflow-y-auto bg-background-surface p-5 shadow-3xl transition-transform duration-300 ease-in-out animate-in slide-in-from-right",children:[jsxRuntime.jsx("div",{className:"flex h-10 w-full justify-end",children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("rounded-full p-2 transition-colors duration-200","cursor-pointer hover:bg-background-hover"),onClick:t,children:jsxRuntime.jsx(x,{name:"X",size:24,weight:"bold",className:"text-text-heading"})})}),r]}):null}var Ji=[0,5],rr={light:{clusters:{small:"#000000",medium:"#000000",large:"#000000"},shadow:{color:"rgba(0, 0, 0, 0.3)",blur:.5},unclusteredPoint:{fill:"#000000",stroke:"#FFFFFF",shadow:"rgba(0, 0, 0, 0.3)"},text:{onCluster:"#FFFFFF"}},dark:{clusters:{small:"#000000",medium:"#000000",large:"#000000"},shadow:{color:"rgba(0, 0, 0, 0.5)",blur:.5},unclusteredPoint:{fill:"#000000",stroke:"#FFFFFF",shadow:"rgba(0, 0, 0, 0.5)"},text:{onCluster:"#FFFFFF"}}},Qi=e=>{let t=e?rr.dark:rr.light;return [{threshold:30,radius:20,color:t.clusters.small},{threshold:50,radius:30,color:t.clusters.medium},{threshold:100,radius:40,color:t.clusters.large}]},el=e=>["step",["get","point_count"],e[0].radius,...e.flatMap(({threshold:t,radius:r})=>[t,r])],tl=e=>["step",["get","point_count"],e[0].radius*1.25,...e.flatMap(({threshold:t,radius:r})=>[t,r*1.25])],rl=(e,t)=>{let r=t?rr.dark:rr.light,o=Qi(t),n={id:"cluster-shadows",type:"circle",source:"locations",filter:["has","point_count"],layout:{},paint:{"circle-radius":tl(o),"circle-color":r.shadow.color,"circle-blur":r.shadow.blur,"circle-translate":[0,8]}},a={id:"unclustered-points-shadow",type:"circle",source:"locations",filter:["all",["!",["has","point_count"]],["!=",["get","id"],e||"selected"]],paint:{"circle-radius":12.6,"circle-color":r.unclusteredPoint.shadow,"circle-blur":.2,"circle-translate":Ji}},s={id:"clusters",type:"circle",source:"locations",filter:["has","point_count"],paint:{"circle-radius":el(o),"circle-color":["step",["get","point_count"],o[0].color,...o.flatMap(({threshold:p,color:d})=>[p,d])]}},l={id:"cluster-count",type:"symbol",source:"locations",filter:["has","point_count"],layout:{"text-field":"{point_count}","text-font":["DIN Pro Medium","Arial Unicode MS Bold"],"text-size":14,"text-offset":[0,.1]},paint:{"text-color":r.text.onCluster}},i={id:"unclustered-points",type:"circle",source:"locations",filter:["all",["!",["has","point_count"]],["!=",["get","id"],e||"selected"]],paint:{"circle-radius":9,"circle-color":r.unclusteredPoint.fill,"circle-stroke-width":3,"circle-stroke-color":r.unclusteredPoint.stroke}};return [n,a,s,l,i,{id:"selected-point",type:"symbol",source:"locations",filter:["==",["get","id"],e||"selected"],layout:{"icon-image":"pin-icon","icon-size":36,"icon-offset":[0,-15]}}]},ol=(e,t)=>{let r=t?rr.dark:rr.light,o=Qi(t),n={id:"mvt-cluster-shadows",type:"circle",source:"mvt-locations","source-layer":"sites",filter:["==",["get","cluster"],true],layout:{},paint:{"circle-radius":tl(o),"circle-color":r.shadow.color,"circle-blur":r.shadow.blur,"circle-translate":[0,8]}},a={id:"mvt-points-shadow",type:"circle",source:"mvt-locations","source-layer":"sites",filter:["all",["!=",["get","cluster"],true],["!=",["get","id"],e||"selected"]],paint:{"circle-radius":12.6,"circle-color":r.unclusteredPoint.shadow,"circle-blur":.2,"circle-translate":Ji}},s={id:"mvt-clusters",type:"circle",source:"mvt-locations","source-layer":"sites",filter:["==",["get","cluster"],true],paint:{"circle-radius":el(o),"circle-color":["step",["get","point_count"],o[0].color,...o.flatMap(({threshold:p,color:d})=>[p,d])]}},l={id:"mvt-cluster-count",type:"symbol",source:"mvt-locations","source-layer":"sites",filter:["==",["get","cluster"],true],layout:{"text-field":["case",["has","point_count_abbreviated"],["get","point_count_abbreviated"],["to-string",["get","point_count"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Bold"],"text-size":14,"text-offset":[0,.1]},paint:{"text-color":r.text.onCluster}},i={id:"mvt-points",type:"circle",source:"mvt-locations","source-layer":"sites",filter:["all",["!=",["get","cluster"],true],["!=",["get","id"],e||"selected"]],paint:{"circle-radius":9,"circle-color":r.unclusteredPoint.fill,"circle-stroke-width":3,"circle-stroke-color":r.unclusteredPoint.stroke}};return [n,a,s,l,i,{id:"mvt-selected-point",type:"symbol",source:"mvt-locations","source-layer":"sites",filter:["==",["get","id"],e||"selected"],layout:{"icon-image":"pin-icon","icon-size":36,"icon-offset":[0,-15]}}]};var Ng={streets:"mapbox://styles/mapbox/streets-v12",satellite:"mapbox://styles/mapbox/satellite-streets-v12",neutral:"mapbox://styles/mapbox/light-v11"},aa=(e,t)=>{let r=Ng[e];return e==="neutral"?t?"mapbox://styles/mapbox/dark-v11":"mapbox://styles/mapbox/light-v11":e==="satellite"?"mapbox://styles/mapbox/satellite-streets-v12":e==="streets"?t?"mapbox://styles/victor-texture/clzwxtrng005s01p93rtr04op":"mapbox://styles/mapbox/streets-v12":r},nl=e=>e.includes("victor-texture");var sa=1e3,wg=400;function al({onPointClick:e,onCloseDrawer:t,selectedPointId:r,mapRef:o}){let n=dt.useCallback(c=>{let p=c.features?.[0];if(p?.geometry.type==="Point"&&p.properties?.id&&e&&o.current&&(e(p.properties.id),p.geometry.coordinates)){let d=p.geometry.coordinates;o.current.flyTo({center:d,zoom:14,duration:sa,padding:{top:0,bottom:0,left:0,right:wg}});}},[e,o]),a=dt.useCallback(c=>{let p=c.properties?.cluster_id;if(p){let d=o.current?.getSource("locations");d&&d.getClusterExpansionZoom(p,(u,m)=>{if(!u&&c.geometry.type==="Point"){let g=c.geometry.coordinates;o.current&&o.current.flyTo({center:g,zoom:m,duration:sa});}});}else if(c.properties?.cluster===true&&c.geometry.type==="Point"&&o.current){let d=c.geometry.coordinates,u=o.current.getZoom(),m=Math.min(u+3,18);o.current.flyTo({center:d,zoom:m,duration:sa});}},[o]),s=dt.useCallback(c=>{let p=c.features?.[0];if(!p&&r&&t){c.preventDefault?.(),t();return}if(p?.properties?.cluster||p?.properties?.cluster_id){a(p);return}n(c);},[n,a,r,t]),l=dt.useCallback(()=>{o.current&&(o.current.getCanvas().style.cursor="pointer");},[o]),i=dt.useCallback(()=>{o.current&&(o.current.getCanvas().style.cursor="");},[o]);return {handleMapClick:s,handleMouseEnter:l,handleMouseLeave:i}}var cl=1e3,ia=.1,kg=400,la=e=>({longitude:e.longitude,latitude:e.latitude,zoom:14,bearing:0,pitch:0,padding:{top:0,bottom:0,left:0,right:kg}});function dl({data:e,initialViewState:t,onViewStateChange:r,mapRef:o,containerDimensions:n}){let a=dt.useRef(true),[s,l]=dt.useState(false),i=dt.useRef(null),c=dt.useMemo(()=>!n||n.width===0||n.height===0?{longitude:-98.5795,latitude:39.8283,zoom:3,bearing:0,pitch:0,padding:{top:100,bottom:100,left:100,right:100}}:e.length===1?la(e[0]):No(e,n.width,n.height),[e,n]),p=t??c,d=dt.useMemo(()=>e.length===0||!n||n.width===0||n.height===0?p:e.length===1?la(e[0]):No(e,n.width,n.height),[e,p,n]),u=(f,b)=>Math.abs(f.longitude-b.longitude)>ia||Math.abs(f.latitude-b.latitude)>ia||Math.abs(f.zoom-b.zoom)>ia,m=dt.useCallback(f=>{r?.(f),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{let b=u(f,d);l(b);},100);},[r,d]),g=()=>{if(o.current){let f=d;o.current.flyTo({center:[f.longitude,f.latitude],zoom:f.zoom,duration:cl});}};return dt.useEffect(()=>{if(!o.current||!n||n.width===0||n.height===0||e.length===0)return;let f=e.length===1?la(e[0]):No(e,n.width,n.height);a.current?(o.current.jumpTo({center:[f.longitude,f.latitude],zoom:f.zoom}),a.current=false):o.current.flyTo({center:[f.longitude,f.latitude],zoom:f.zoom,duration:cl});},[e,n,o]),dt.useEffect(()=>()=>{i.current&&clearTimeout(i.current);},[]),{effectiveInitialViewState:p,showResetButton:s,handleViewStateChange:m,handleResetView:g}}var Ig=process.env.NEXT_PUBLIC_SITE_DOMAIN_BASE_URL||"http://localhost:3005",Eg=40,pl=(e,t)=>{let r=`${Ig}/tiles/${e}/{z}/{x}/{y}.mvt`;if(!t||!t.city?.length&&!t.state?.length&&!t.search)return r;let o=new URLSearchParams;return t.city?.length&&t.city.forEach(n=>o.append("city",n)),t.state?.length&&t.state.forEach(n=>o.append("state",n)),t.search?.trim()&&o.append("search",t.search.trim()),`${r}?${o.toString()}`};function ml({data:e=[],initialViewState:t,onViewStateChange:r,onPointClick:o,selectedPointId:n,onCloseDrawer:a,drawerComponent:s,scrollEnabled:l=true,className:i,previewMode:c=false,previewModeCta:p,onPreviewModePress:d,workspaceId:u,mapFilters:m,serverSideClusteringEnabled:g=false,theme:f,mapboxAccessToken:b=qi(),transformRequest:h,isLoading:w=false,controls:S={navigation:true,layers:false,search:false,list:false,resetZoom:true},mapLayers:C=[],listItems:P=[],onSearch:R,onListToggle:L,onThemeChange:v,isoRtoVisible:D,onIsoRtoToggle:B,vermontSubstationsVisible:_,onVermontSubstationsToggle:y,transformersVisible:V,onTransformersToggle:oe,feedersVisible:U,onFeedersToggle:ue,spansVisible:ge,onSpansToggle:Me,substationsMinZoom:F=8,transformersMinZoom:O=12,feedersMinZoom:K=12,spansMinZoom:k=12,searchPlaceholder:T="Search places...",controlStyles:M,customTileset:I}){let{isDarkTheme:$,colorMode:se}=Vt(),[He,be]=dt.useState(false);dt.useEffect(()=>{let H=()=>{let Fa=document.body.classList.contains("theme-dark");be(Fa===(se==="dark"));};H();let ye=new MutationObserver(H);return ye.observe(document.body,{attributes:true,attributeFilter:["class"]}),()=>ye.disconnect()},[se]);let ie=f||"streets",Ze=dt.useRef(null),st=dt.useRef(null),[gc,bc]=dt.useState(null),[xc,hc]=dt.useState(false),Sa=D!==void 0?D:xc,[yc,vc]=dt.useState(false),Na=_!==void 0?_:yc,[Cc,Sc]=dt.useState(false),wa=V!==void 0?V:Cc,[Nc,wc]=dt.useState(false),Pa=U!==void 0?U:Nc,[Pc,Tc]=dt.useState(false),Ta=ge!==void 0?ge:Pc,kc=B||hc,Rc=y||vc,Fc=oe||Sc,Lc=ue||wc,Mc=Me||Tc;dt.useEffect(()=>{if(st.current){let H=()=>{bc({width:st.current?.clientWidth??0,height:st.current?.clientHeight??0});};H();let ye=new ResizeObserver(H);return ye.observe(st.current),()=>ye.disconnect()}},[]);let Bo=dt.useMemo(()=>{if(!n)return null;let H=e.find(ye=>ye.id===n);return H?[H.longitude,H.latitude]:null},[n,e]),{effectiveInitialViewState:Ic,showResetButton:Ec,handleViewStateChange:Dc,handleResetView:Ac}=dl({data:e,initialViewState:t,onViewStateChange:r,mapRef:Ze,containerDimensions:gc}),{handleMapClick:Vc,handleMouseEnter:Bc,handleMouseLeave:$c}=al({onPointClick:o,onCloseDrawer:a,selectedPointId:n,mapRef:Ze}),ka=dt.useMemo(()=>g?ol(n,$):rl(n,$),[n,$,g]);dt.useEffect(()=>{if(Ze.current){let H=Ze.current.getMap(),ye=aa(ie,$);if(nl(ye))(async()=>{try{if((await fetch(ye)).ok){H.setStyle(ye);let Dt=()=>{H.triggerRepaint();};H.isStyleLoaded()?Dt():H.once("style.load",Dt);}else {console.warn("Custom style failed to load, falling back to default");let Dt=ie==="satellite"?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12";H.setStyle(Dt);}}catch(La){console.warn("Custom style loading error, falling back to default:",La);let Dt=ie==="satellite"?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12";H.setStyle(Dt);}})();else {H.setStyle(ye);let Er=()=>{H.triggerRepaint();};H.isStyleLoaded()?Er():H.once("style.load",Er);}}},[$,ie]);let Ra=dt.useMemo(()=>ji(e),[e]),zc=(H,ye)=>h?h(H,ye):{url:H};return w||!He?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative flex h-full w-full overflow-hidden",i),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg",style:{backgroundColor:"var(--color-skeleton-base)"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom right, var(--color-skeleton-base), var(--color-skeleton-highlight))"}}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-pulse rounded-full",style:{backgroundColor:"var(--color-skeleton-base)"}}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-16 animate-pulse rounded",style:{backgroundColor:"var(--color-skeleton-base)"}}),jsxRuntime.jsx("div",{className:"h-2 w-12 animate-pulse rounded",style:{backgroundColor:"var(--color-skeleton-highlight)"}})]})]})}),jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20",children:jsxRuntime.jsx("div",{className:"h-full w-full",style:{backgroundImage:`
|
|
76
|
+
`}})]})}var _r={prefix:String(Math.round(Math.random()*1e10)),current:0},bi=lt__namespace.default.createContext(_r),id=lt__namespace.default.createContext(false);var sd=!!(typeof window<"u"&&window.document&&window.document.createElement),un=new WeakMap;function ld(e=false){let t=lt.useContext(bi),r=lt.useRef(null);if(r.current===null&&!e){var o,n;let a=(n=lt__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(o=n.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(a){let i=un.get(a);i==null?un.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==i.state&&(t.current=i.id,un.delete(a));}r.current=++t.current;}return r.current}function cd(e){let t=lt.useContext(bi);t===_r&&!sd&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=ld(!!e),o=t===_r&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${r}`}function dd(e){let t=lt__namespace.default.useId(),[r]=lt.useState(Zr()),o=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${_r.prefix}`;return e||`${o}-${t}`}typeof lt__namespace.default.useId=="function"?dd:cd;function pd(){return false}function md(){return true}function fd(e){return ()=>{}}function Zr(){return typeof lt__namespace.default.useSyncExternalStore=="function"?lt__namespace.default.useSyncExternalStore(fd,pd,md):lt.useContext(id)}var gd=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bd=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function mn(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),o=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(o)return o.direction==="rtl";if(r.script)return gd.has(r.script)}let t=e.split("-")[0];return bd.has(t)}var yd=Symbol.for("react-aria.i18n.locale");function hi(){let e=typeof window<"u"&&window[yd]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:mn(e)?"rtl":"ltr"}}var fn=hi(),dr=new Set;function xi(){fn=hi();for(let e of dr)e(fn);}function yi(){let e=Zr(),[t,r]=lt.useState(fn);return lt.useEffect(()=>(dr.size===0&&window.addEventListener("languagechange",xi),dr.add(r),()=>{dr.delete(r),dr.size===0&&window.removeEventListener("languagechange",xi);}),[]),e?{locale:"en-US",direction:"ltr"}:t}var Nd=lt__namespace.default.createContext(null);function gn(){let e=yi();return lt.useContext(Nd)||e}var bn=new Map;function xn(e){let{locale:t}=gn(),r=t+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(bn.has(r))return bn.get(r);let o=new Intl.Collator(t,e);return bn.set(r,o),o}function Ur(e){let t=xn({usage:"search",...e}),r=lt.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(0,i.length),i)===0),[t]),o=lt.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(-i.length),i)===0),[t]),n=lt.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let l=0,s=i.length;for(;l+s<=a.length;l++){let d=a.slice(l,l+s);if(t.compare(i,d)===0)return true}return false},[t]);return lt.useMemo(()=>({startsWith:r,endsWith:o,contains:n}),[r,o,n])}var ur=new Map,ct=(e,t="#000000")=>{if(typeof window>"u")return t;let r=e.startsWith("var(")?e.slice(4,-1):e.startsWith("--")?e:`--${e}`;if(!e.startsWith("--")&&!e.startsWith("var(")&&!r.startsWith("--color-")&&(r=`--color-${r.slice(2)}`),ur.has(r))return ur.get(r);try{let o=document.body||document.documentElement,a=getComputedStyle(o).getPropertyValue(r).trim();if(a)return ur.set(r,a),a;let i=document.createElement("div");i.style.color=`var(${r})`,document.body.appendChild(i);let l=getComputedStyle(i).color;return document.body.removeChild(i),l&&l!=="rgb(0, 0, 0)"?(ur.set(r,l),l):t}catch(o){return console.warn(`Failed to resolve color for ${e}:`,o),t}},Et=()=>{ur.clear();},jr=()=>{let e=[];for(let t=1;t<=6;t++){let r=ct(`--color-viz-categorical-${t}`);r&&e.push(r);}return e.length===0?vi():e},vi=()=>["#444ae1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#f97316","#14b8a6","#6366f1"],yn=()=>ct("--color-viz-default","#444ae1"),wd=(e,t)=>{let r={},o=jr();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r};var Ci=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},Pd=e=>Ci(e)?ct("--text-body","#333333"):ct("--neutral-white","#ffffff");var Cn=lt.createContext({colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),Re=()=>lt.useContext(Cn);function vn(){if(typeof window>"u")return "light";let e=localStorage.getItem("theme");return e==="dark"||e==="light"?e:document.body.classList.contains("theme-dark")||document.documentElement.classList.contains("theme-dark")||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Si=({children:e})=>{let[t,r]=lt.useState(vn),o=t==="dark";lt.useEffect(()=>{Et();let a=()=>{let c=vn();c!==t&&r(c);};a();let i=setTimeout(a,100),l=window.matchMedia("(prefers-color-scheme: dark)"),s=c=>{localStorage.getItem("theme")||(Et(),r(c.matches?"dark":"light"));},d=()=>{let c=vn();c!==t&&(Et(),r(c));};l.addEventListener("change",s);let p=new MutationObserver(d);return p.observe(document.body,{attributes:true,attributeFilter:["class"]}),p.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>{clearTimeout(i),l.removeEventListener("change",s),p.disconnect();}},[t]);let n=lt.useCallback(()=>{r(a=>{let i=a==="light"?"dark":"light";return localStorage.setItem("theme",i),i==="dark"?document.body.classList.add("theme-dark"):document.body.classList.remove("theme-dark"),Et(),i});},[]);return jsxRuntime.jsx(Cn.Provider,{value:{colorMode:t,isDarkTheme:o,toggleTheme:n},children:e})};function ae(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-border-focus focus:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus focus-visible:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function j(e,t){return reactAriaComponents.composeRenderProps(e,r=>tailwindMerge.twMerge(t,r))}var _={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function Ze(){let[e,t]=lt__namespace.default.useState(false),r=lt__namespace.default.useCallback((n,a)=>{t(true),a?.(n);},[]),o=lt__namespace.default.useCallback((n,a)=>{t(false),a?.(n);},[]);return {isFocused:e,handleFocus:r,handleBlur:o}}function Ue({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",t),children:e})}function wi({onClick:e,size:t="md",className:r}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",r),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(v,{name:"X",size:t==="sm"?16:20})})}function Dt(e){let{isInvalid:t,isDisabled:r,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] ";return r?`${n} border-border-muted focus:outline-none`:t&&o?`${n} border-feedback-error-border outline-[1.5px] outline-[var(--control-focus-ring-color-error)]`:t?`${n} border-feedback-error-border`:o?`${n} !outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]`:`${n}`}function qr(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Oe(e){let{isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",Dt({isInvalid:t,isDisabled:r,isFocused:o}),qr({transparent:n,isDisabled:r}),_[a].text,_[a].height,_[a].padding,i)}function pr(e){let{size:t="md",isFocusWithin:r,isInvalid:o,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-sm overflow-hidden",qr({transparent:a,isDisabled:n}),_[t].height,Dt({isFocused:r,isInvalid:o,isDisabled:n}),i)}function Y({children:e,size:t="md",tooltip:r,isRequired:o,className:n,htmlFor:a}){return jsxRuntime.jsxs("label",{htmlFor:a,className:tailwindMerge.twMerge(_[t].text,"!text-text-caption flex items-center gap-1",n),children:[e,o&&jsxRuntime.jsx("span",{children:"*"}),r&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(v,{name:"Info",size:t==="sm"?16:20})})]})}function ee({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-muted",_[e].text,t),children:r})}function q({children:e,size:t="md",className:r}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(_[t].text,"text-feedback-error-text",r),children:e})}function Pi({size:e="md",isInvalid:t,isDisabled:r,isFocused:o,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:Oe({isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:e,className:a}),...i})}function Xr(e){let{children:t,...r}=e;return jsxRuntime.jsx("div",{...r,className:pr(e),children:typeof t=="function"?t(e):t})}var Bd={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},Vd={sm:"text-controlElementSm",md:"text-controlElementMd",lg:"text-controlElementLg",xl:"text-controlElementXl"};function ut({size:e="md",className:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...r,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium",Bd[e],Vd[e],t)})}function _d({isEntering:e,isExiting:t,className:r=""}){let o=["bg-white","dark:bg-zinc-900/70","dark:backdrop-blur-2xl","dark:backdrop-saturate-200","forced-colors:bg-[Canvas]","shadow-md","rounded-md","overflow-hidden","bg-clip-padding","border","border-gray-100","dark:border-white/5","dark:text-zinc-300"].join(" "),n=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",a=t?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [o,n,a,r].filter(Boolean).join(" ")}function pt({children:e,showArrow:t,className:r,...o}){let a=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",i=t?12:8;return i=a?i-6:i,jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:i,...o,className:reactAriaComponents.composeRenderProps(r,(l,s)=>_d({...s,className:l})),children:[t&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{className:"group",children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-white stroke-black/10 stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-[#1f1f21] dark:stroke-zinc-600 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]})}var tu={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},ru={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},ki={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function ou(){let e=lt__namespace.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var kn=(e,t,r)=>{if(e==null||e==="")return "";let n=(r?r.flatMap(a=>a.items):t||[]).find(a=>a.id===e);return n?n.name:""};async function nu(e,t,r){try{let o=e.url.replace("{q}",t),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([s,d])=>{n.append(s,d.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:r});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let l=await i.json();return {items:e.transformResponse(l)}}catch(o){console.error("Error in REST request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function au(e,t,r){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:r});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,l)=>i?.[l],a)),{items:e.transformResponse(a)}}catch(o){console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function Yr({label:e,staticItems:t=[],sections:r,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:l,placeholder:s,errorMessage:d,description:p,size:c="md",tooltip:u,isRequired:m,isDisabled:b,isInvalid:f,validationResult:x,showErrors:h=true,renderItem:y,renderLeftIcon:S,renderSection:F,autoFocus:w=false}){let T=lt__namespace.default.useRef(null),[L,C]=lt__namespace.default.useState(),[k,I]=lt.useState(()=>kn(o||n,t,r)),[A,g]=lt.useState(false),N=$r(k),{contains:K}=Ur({sensitivity:"base"}),[B,U]=lt.useState(),re=_[c].text,ne=_[c].height,E=null;lt.useEffect(()=>{w&&g(true);},[w]),lt.useEffect(()=>{let M=()=>{T.current&&C(T.current.offsetWidth);};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),lt.useEffect(()=>{E&&E.setFilterText(N);},[N,E]),i&&(E=reactStately.useAsyncList({async load({signal:M,filterText:R=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(R))return {items:[]};try{let $;return i.requestType==="GraphQL"?$=await au(i,R,M):$=await nu(i,R,M),U($.error),{items:$.items}}catch($){return console.error("Error loading items:",$),U($ instanceof Error?$.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),N===""&&(E=null);let G=M=>{let R=kn(M,t,r);I(R),a&&a(M);},X=M=>{I(M);let R=kn(o,t,r);o!=null&&M!==R&&a&&a(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:G,selectedKey:o||void 0,defaultSelectedKey:n||void 0,defaultItems:r?r.flatMap(M=>M.items):t,items:E?E.items:void 0,className:j("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:b,isInvalid:f||!!d,inputValue:k,onInputChange:X,autoFocus:w,defaultFilter:l||K,"aria-label":e||s||"Autocomplete",children:M=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:c,tooltip:u,isRequired:m,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:T,className:pr({size:c,isInvalid:f||!!d,isDisabled:b,isFocusWithin:A||M.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||s||"Autocomplete",style:{position:"relative"},children:[S?jsxRuntime.jsx("div",{className:"absolute left-3",children:S(!!E?.isLoading)}):jsxRuntime.jsx(v,{name:"MagnifyingGlass",className:`${tu[c]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${ru[c]} ${re} ${ne} ${b?"bg-background-muted":"bg-background-input"}`,placeholder:s,disabled:b,onFocus:()=>g(true),onBlur:()=>g(false)}),k&&!b&&jsxRuntime.jsx(ou,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${re} ${ne} ${b?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:b,children:({isPressed:R})=>jsxRuntime.jsx(v,{name:R?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),p&&jsxRuntime.jsx(ee,{size:c,children:p}),h&&B&&jsxRuntime.jsx(q,{size:c,className:"text-feedback-error-text",children:B}),h&&typeof d=="string"&&jsxRuntime.jsx(q,{size:c,className:"text-feedback-error-text",children:d}),h&&typeof d=="function"&&x&&jsxRuntime.jsx(q,{size:c,className:"text-feedback-error-text",children:d(x)}),jsxRuntime.jsx(pt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5",style:{minWidth:L?`${L}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${re}`,children:r?r.map(R=>{let $=R.items.map(V=>jsxRuntime.jsx(ut,{id:V.id,textValue:V.name,size:c,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${ki[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:y?y(V):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V.name,jsxRuntime.jsx(v,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},V.id));return F?F(R,$):jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:R.name}),$]},R.name)}):R=>jsxRuntime.jsx(ut,{id:R.id,textValue:R.name,size:c,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${ki[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:y?y(R):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[R.name,jsxRuntime.jsx(v,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},R.id)})})]})})}function Fi({src:e,alt:t,firstName:r,lastName:o,fullName:n,onClick:a,size:i="md",shape:l="circle",variant:s="user",className:d,status:p,bordered:c=false}){let u={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},m={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},b={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},f={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-muted border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},x={user:"bg-action-primary/10 text-action-primary",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},h=l==="circle"?"rounded-full":"rounded-md",y=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity",u[i],h,a&&"cursor-pointer hover:opacity-80",c&&"ring-2 ring-background-surface",d),F=(()=>{if(r||o){let L=r?.[0]||"",C=o?.[0]||"";return (L+C).toUpperCase()}if(n){let L=n.split(" "),C=L[0]?.[0]||"",k=L[L.length-1]?.[0]||"";return C===k?C.toUpperCase():(C+k).toUpperCase()}return ""})(),w=()=>{let L={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(s){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:L});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:L});default:return jsxRuntime.jsx(lucideReact.User,{size:L})}},T=()=>e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{src:e,alt:t||n||"Avatar",className:"h-full w-full object-cover",style:{fontSize:0}}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center -z-10",children:F?jsxRuntime.jsx("span",{className:"font-semibold",children:F}):w()})]}):F?jsxRuntime.jsx("span",{className:"font-semibold",children:F}):w();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(y,e?"":x[s]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:T()}),p&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",h,m[i],b[i],f[p]),"aria-label":`Status: ${p}`})]})}var du={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary",secondary:"bg-action-secondary/10 text-action-secondary",neutral:"bg-background-muted text-text-muted"},uu={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-base"},pu={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},mu={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function At({children:e,variant:t="default",size:r="sm",shape:o="square",dot:n=false,dotPosition:a="left",className:i}){let l=n&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",mu[r]),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",uu[r],pu[o],du[t],i),children:[n&&a==="left"&&l,e,n&&a==="right"&&l]})}var Ln=({href:e,children:t,className:r="",external:o=false,title:n,variant:a="default",onClick:i,asButton:l=false,onPress:s,showArrow:d=false})=>{let p=o?{target:"_blank",rel:"noopener noreferrer"}:{},m=`hover:underline hover:decoration-1 hover:underline-offset-4 cursor-pointer ${{default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-muted hover:text-text-muted visited:text-text-muted"}[a]} ${r}`,b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,d&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return l?jsxRuntime.jsx("button",{type:"button",className:m,onClick:s,title:n,children:b}):jsxRuntime.jsx("a",{href:e||"#",className:m,...p,title:n,onClick:i,children:b})};function Qr(e){return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...e,className:tailwindMerge.twMerge("flex gap-1",e.className)})}function eo(e){let{className:t,children:r,href:o,...n}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:j(t,"flex items-center gap-1"),...n,children:a=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ln,{variant:"muted",href:o,children:typeof r=="function"?r(a):r}),o&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3 w-3 text-text-muted"})]})})}var ku="flex font-medium justify-center items-center gap-2 text-center transition rounded-sm whitespace-nowrap box-border",Tu={default:"bg-neutral-black text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",primary:"bg-action-primary text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-action-destructive border-2 border-border-muted hover:bg-action-destructive/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-2 flex-shrink-0",unstyled:"bg-transparent"},Di={full:"w-full",default:"w-fit"},Ru="opacity-control-hover cursor-not-allowed pointer-events-none grayscale",Lu="opacity-100 cursor-pointer",Fu={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Mu={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function Iu(e){let{variant:t="default",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=t==="unstyled"?"":`${ku} ${Tu[t]}`;return t!=="unstyled"&&(i+=` ${_[r].text} ${_[r].height} ${_[r].padding} ${_[r].gap}`),o||a?i+=` ${Ru}`:i+=` ${Lu}`,n?i+=` ${Di.full}`:i+=` ${Di.default}`,`${i} ${ae()}`}function H(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:l="left",iconWeight:s,href:d,className:p,badgeNumber:c,badgeVariant:u="primary",badgePosition:m="top-right",style:b,target:f,rel:x,...h}=e,y=t?jsxRuntime.jsx(v,{name:t,className:`icon-[--control-icon-size-${i}]`,weight:s}):null,S=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&y,typeof r=="function"?null:r,l==="right"&&y]}),F=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(v,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${i}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:S}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),w=tailwindMerge.twMerge(Iu(e),p,o?"aria-busy":""),T=d?{href:d,target:f,rel:x,...h}:{};if(d){let{onPress:C,onPressStart:k,onPressEnd:I,onPressChange:A,onPressUp:g,onAuxClick:N,onContextMenu:K,onDoubleClick:B,...U}=h;Object.assign(T,U);}let L=d?jsxRuntime.jsx(reactAriaComponents.Link,{...T,style:b,className:w,children:o?F:typeof r=="function"?(function(C){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&y,r(C),l==="right"&&y]})}):S}):jsxRuntime.jsx(reactAriaComponents.Button,{...h,style:b,className:w,children:o?F:typeof r=="function"?(function(C){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&y,r(C),l==="right"&&y]})}):S});return c&&c>0?jsxRuntime.jsxs("div",{className:"relative",children:[L,jsxRuntime.jsx("span",{className:`absolute ${Fu[m]} flex h-5 w-5 items-center justify-center rounded-full ${Mu[u]} text-xs`,"aria-label":`${c} items`,children:c})]}):L}function Ou({isSelected:e,isDisabled:t}){let r=[ae,"w-9 h-9 text-base cursor-default rounded-full flex items-center justify-center forced-color-adjust-none"];return t?r.push("text-gray-300 dark:text-zinc-600 forced-colors:text-[GrayText]"):e?r.push("bg-blue-600 invalid:bg-red-600 text-white forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):r.push("text-zinc-900 dark:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 pressed:bg-gray-200 dark:pressed:bg-zinc-600"),r.join(" ")}function to({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(ro,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{children:[jsxRuntime.jsx(oo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:({isSelected:o,isDisabled:n})=>Ou({isSelected:o,isDisabled:n})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function ro(){let{direction:e}=reactAriaComponents.useLocale(),t=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(H,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(v,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(v,{name:"CaretLeft","aria-hidden":true,size:t})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx(H,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(v,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(v,{name:"CaretRight","aria-hidden":true,size:t})})]})}function oo(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}var Ku={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},_u={page:"h-16 leading-[62px]"};function Ee({tag:e="h1",size:t="lg",height:r,className:o="",children:n}){let a=Ku[t],i=r?_u[r]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,i,o),children:n})}var z=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:i,responsive:l,delay:s=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:p,className:c,"data-testid":u})=>{let[m,b]=lt.useState(s===0);if(lt.useEffect(()=>{if(s>0){let w=setTimeout(()=>b(true),s);return ()=>clearTimeout(w)}},[s]),!m)return null;let f=n?"bg-gradient-to-r from-[var(--skeleton-base)] via-[var(--skeleton-highlight)] to-[var(--skeleton-base)]":"bg-[var(--skeleton-base)]",x=d&&e?(()=>{let w=typeof e=="number"?e:parseFloat(String(e));return isNaN(w)?"":`animation-duration-[${Math.max(.8,w/100)}s]`})():"",h=o==="pulse"?`animate-pulse ${x}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--skeleton-wave)] before:to-transparent before:animate-wave ${x}`:"",y="rounded-sm";r==="circle"&&(y="rounded-full"),r==="text"&&(y="h-4 w-full rounded-sm");let S=a?"flex-1 min-w-0":"",F=l?Object.entries(l).map(([w,T])=>`${w}:w-[${T}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":u,children:i.map((w,T)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,h,y,S,F,c),style:{width:w,height:t}},T))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,h,y,S,F,c),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":u})},$i=({count:e=1,children:t,className:r,"data-testid":o})=>jsxRuntime.jsx("div",{className:r,"data-testid":o,children:Array.from({length:e}).map((n,a)=>jsxRuntime.jsx("div",{children:t},a))});var qu={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Xu="rounded-lg",In={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Yu={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Ae({variant:e="outlined",className:t,children:r,isLoading:o=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",qu[e],Xu,t),"data-testid":"card",children:o?jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(z,{width:"100%",height:200})}):r})}function Bi({title:e,subtitle:t,actions:r,className:o,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(z,{width:120,height:20}),jsxRuntime.jsx(z,{width:24,height:24})]}),t&&jsxRuntime.jsx(z,{width:200,height:16})]}):!e&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(Ee,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),t&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function Vi({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",In[r],o),children:jsxRuntime.jsx(z,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",In[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",In[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function zi({className:e,children:t,isLoading:r=false}){return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(z,{width:"100%",height:16}),jsxRuntime.jsx(z,{width:"80%",height:16}),jsxRuntime.jsx(z,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function Hi({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(z,{width:80,height:32}),jsxRuntime.jsx(z,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Yu[r],e),children:t}):null}Ae.Header=Bi;Ae.Media=Vi;Ae.Content=zi;Ae.Footer=Hi;function op(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:j(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(Y,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(ee,{children:e.description}),jsxRuntime.jsx(q,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function np({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function ap({isSelected:e,isInvalid:t,isDisabled:r,isIndeterminate:o}){let n="w-5 h-5 flex-shrink-0 rounded flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2 focus:ring-border-focus",a="";return r?a="border-border-muted bg-background-muted":t?a="border-feedback-error-border bg-feedback-error-background":e||o?a="bg-action-primary border-action-primary hover:bg-action-primary-hover hover:border-action-primary-hover":a="bg-background-input border-border-input hover:border-border-focus",`${n} ${a}`}var Gi="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function br(e){let{children:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(o,n)=>`${np(n)} ${o||""}`),children:o=>{let{isSelected:n,isIndeterminate:a,...i}=o,l=jsxRuntime.jsx("div",{className:ap({isSelected:n,isIndeterminate:a,...i}),children:a?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Gi}):n?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Gi}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof t=="function"?t(o):t]})}})}var lp={default:"bg-background-muted text-text-body border border-border-muted hover:bg-background-hover",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-background-input text-text-body border border-border-input hover:bg-background-hover"},cp={sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},dp="opacity-75 cursor-not-allowed pointer-events-none";function Wi(e){let{variant:t,size:r,isDisabled:o,isClickable:n,className:a}=e;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",cp[r],_[r].text,lp[t],n&&!o&&"cursor-pointer",o&&dp,a)}function Bt({children:e,onRemove:t,size:r="md",variant:o="default",isRemovable:n=true,isDisabled:a=false,className:i,onClick:l}){let s=!!l&&!a,d=n&&t&&!a,p=m=>{m.stopPropagation(),m.preventDefault(),t&&!a&&t();},c=()=>{l&&!a&&l();},u=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),d&&jsxRuntime.jsx("button",{type:"button",onClick:p,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(v,{name:"X",size:r==="sm"?12:r==="md"?14:16,className:"text-current opacity-70 hover:opacity-100"})})]});return s?jsxRuntime.jsx("button",{type:"button",onClick:c,className:Wi({variant:o,size:r,isDisabled:a,isClickable:s,className:i}),disabled:a,children:u}):jsxRuntime.jsx("span",{className:Wi({variant:o,size:r,isDisabled:a,isClickable:s,className:i}),children:u})}function _i({value:e,readOnly:t=false,onChange:r,language:o="json",theme:n="github_dark",height:a,width:i="100%",className:l,lineHeight:s=19,minLines:d=3,maxLines:p=50,showLineNumbers:c=true,showGutter:u=true,fontSize:m=14,wrapEnabled:b=false}){let f=lt.useRef(null),x=lt.useMemo(()=>{if(a)return a;let h=(e.match(/\n/g)||[]).length+1;return `${Math.max(d,Math.min(h,p))*s+10}px`},[e,a,s,d,p]);return lt.useEffect(()=>{f.current?.editor&&f.current.editor.resize();},[x]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",l),style:{width:i,height:x},children:jsxRuntime.jsx(bp__default.default,{ref:f,mode:o,theme:n,value:e,onChange:r,readOnly:t,width:"100%",height:"100%",fontSize:m,showPrintMargin:false,showGutter:u,highlightActiveLine:!t,setOptions:{useWorker:true,showLineNumbers:c,tabSize:2,enableBasicAutocompletion:!t,enableLiveAutocompletion:!t,enableSnippets:!t,showFoldWidgets:true,wrap:b},editorProps:{$blockScrolling:true}})})}var Np=({isEntering:e,isExiting:t,className:r})=>["max-w-[200px] group bg-slate-700 dark:bg-slate-600 border border-slate-800 dark:border-white/10 shadow-[inset_0_1px_0_0_theme(colors.gray.600)] dark:shadow-none text-white text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",t?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",r].filter(Boolean).join(" ");function Dn({children:e,content:t,...r}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...r,offset:10,className:reactAriaComponents.composeRenderProps(r.className,(o,n)=>Np({...n,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-slate-700 stroke-gray-800 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-slate-600 dark:stroke-white/10 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})]})}function no({value:e,children:t,className:r,size:o="sm"}){let[n,a]=lt.useState(false),s=jsxRuntime.jsx(H,{variant:"icon",size:o,onPress:()=>{let d=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(d),a(true),setTimeout(()=>{a(false);},2e3);},className:"!px-2",children:jsxRuntime.jsx(v,{name:"Copy",size:o==="sm"?14:16})});return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1",r),children:[t,n?jsxRuntime.jsx(Dn,{content:"Copied!",children:s}):s]})}var Ui={duration:.5,ease:"easeInOut"},ao=lt.createContext(null),ft=()=>{let e=lt.useContext(ao);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};var Vt=({data:e,color:t="#6b7280"})=>{let r=lt.useId(),o=lt.useId(),{xScale:n,yScale:a,animationSettings:i}=ft(),l=n.range(),s=a.range();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:r,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:t,stopOpacity:.1}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:0})]}),jsxRuntime.jsx("clipPath",{id:o,children:jsxRuntime.jsx("rect",{x:l[0],y:s[1],width:l[1]-l[0],height:s[0]-s[1]})})]}),jsxRuntime.jsx("g",{clipPath:`url(#${o})`,children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${s[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:[jsxRuntime.jsx(shape.AreaClosed,{data:e,x:d=>n(d.xValue),y:d=>a(d.yValue),yScale:a,fill:`url(#${r})`,curve:curve.curveLinear}),jsxRuntime.jsx(shape.LinePath,{data:e,x:d=>n(d.xValue),y:d=>a(d.yValue),stroke:t,strokeWidth:3,curve:curve.curveLinear})]})})]})};var Ht=({data:e,color:t="#6b7280",opacity:r=1,categoryColors:o={}})=>{let{xScale:n,yScale:a,animationSettings:i}=ft(),l=lt.useId(),s=n.range(),d=a.range(),p=[...e].sort((m,b)=>m.xValue.getTime()-b.xValue.getTime()),c=p.length>1?p[1].xValue.getTime()-p[0].xValue.getTime():15*6e4,u=Math.abs(n(new Date(p[0].xValue.getTime()+c))-n(p[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:l,children:jsxRuntime.jsx("rect",{x:s[0],y:d[1],width:s[1]-s[0],height:d[0]-d[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${l})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${d[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:p.map((m,b)=>{let f=n(m.xValue),x=a(m.yValue),h=d[0]-x,y=p[b+1],S=y?Math.abs(n(y.xValue)-f):u,F=m.category&&o[m.category]?o[m.category]:t;return jsxRuntime.jsx(shape.Bar,{x:f-S/2,y:x,width:S,height:h,fill:F,opacity:r,rx:1},m.xValue.getTime())})})})]})};var oe={top:20,right:20,bottom:50,left:60};function Gt(e,t="$"){let r=(o,n)=>o==null?"-":n(o);switch(e){case "number":return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())};case "percent":return {format:o=>r(o,n=>`${n.toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}%`),min:0,max:100,tickInterval:20};case "kWh":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kWh`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "kW":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kW`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "amperes":return {format:o=>r(o,n=>`${n.toFixed(1)} A`),tickFormat:o=>r(o,n=>`${n.toFixed(1)} A`)};case "temperature":return {format:o=>r(o,n=>`${n.toFixed(1)}\xB0`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}\xB0`)};case "percentageChange":return {format:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(0)}%`),min:-100,max:100};case "decimal":return {format:o=>r(o,n=>n.toFixed(2)),tickFormat:o=>r(o,n=>n.toFixed(1))};case "currency":return {format:o=>r(o,n=>`${t}${n.toLocaleString()}`),tickFormat:o=>r(o,n=>`${t}${n.toLocaleString()}`)};case "scientific":return {format:o=>r(o,n=>n.toExponential(2)),tickFormat:o=>r(o,n=>n.toExponential(1))};case "integer":return {format:o=>r(o,n=>Math.round(n).toLocaleString()),tickFormat:o=>r(o,n=>Math.round(n).toLocaleString())};case "logarithmic":return {format:o=>r(o,n=>n.toExponential(1)),tickFormat:o=>r(o,n=>n.toExponential(0)),min:1,tickInterval:10};case "timeDuration":return {format:o=>r(o,n=>`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")} min`),tickFormat:o=>r(o,n=>`${Math.floor(n/60)}m`),min:0};case "compact":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n))};case "si":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:2}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(n))};case "bytes":return {format:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],i=0,l=n;for(;l>=1024&&i<a.length-1;)l/=1024,i++;return `${l.toFixed(1)} ${a[i]}`}),tickFormat:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],i=0,l=n;for(;l>=1024&&i<a.length-1;)l/=1024,i++;return `${l.toFixed(0)} ${a[i]}`}),min:0};case "rate":return {format:o=>r(o,n=>`${n.toFixed(1)} req/sec`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}/s`)};case "ordinal":return {format:o=>r(o,n=>{let a=["th","st","nd","rd"],i=n%100;return n+(a[(i-20)%10]||a[i]||a[0])}),tickFormat:o=>r(o,n=>n.toString()),min:1};case "date":return {format:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"medium"}).format(new Date(n))),tickFormat:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"short"}).format(new Date(n))),min:0};case "largeCurrency":return {format:o=>r(o,n=>`${t}${(n/1e6).toFixed(2)}M`),tickFormat:o=>r(o,n=>`${t}${(n/1e6).toFixed(0)}M`)};case "coordinates":return {format:o=>r(o,n=>`${Math.abs(n).toFixed(3)}\xB0 ${n>=0?"N":"S"}`),tickFormat:o=>r(o,n=>`${Math.abs(n).toFixed(1)}\xB0 ${n>=0?"N":"S"}`),min:-90,max:90};case "ranked":return {format:o=>r(o,n=>`Rank: ${n}`),tickFormat:o=>r(o,n=>n.toString()),min:1};default:return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())}}}var $n=(e,t)=>{let r=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[oe.left,t-oe.right],domain:r,nice:true})},Bn=(e,t,r)=>{let o=Gt(r),n=d3Array.min(e,s=>s.yValue)||0,a=d3Array.max(e,s=>s.yValue)||0,i=o.min!==void 0?o.min:n>=0?0:n*1.1,l=o.max!==void 0?o.max:a<=0?0:a*1.1;return scale.scaleLinear({range:[t-oe.bottom,oe.top],domain:[i,l],nice:true})};var Op=({top:e,scale:t,width:r})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:Math.min(6,Math.floor(r/100)),tickFormat:o=>{let n=o;return new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(n)},stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"middle"})}),Wp=({left:e,scale:t,yFormatType:r})=>{let o=Gt(r);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:5,tickFormat:n=>(o.tickFormat||o.format)(n),stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"end",dy:"0.33em"})})},hr={Bottom:Op,Left:Wp};var Up=({items:e})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:e.map(t=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-sm",style:{backgroundColor:t.fill}}),jsxRuntime.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.category})]},t.category))}),so=({items:e,onExport:t})=>{let[r,o]=lt__namespace.default.useState(false),[n,a]=lt__namespace.default.useState(null),i=lt__namespace.default.useCallback(async l=>{let s=l;o(true),a(s);try{await t(s);}catch(d){console.error("Export failed:",d);}finally{o(false),a(null);}},[t]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between overflow-y-hidden",children:[jsxRuntime.jsx(Up,{items:e}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(H,{variant:"secondary",size:"sm",isDisabled:r,children:[jsxRuntime.jsx(v,{name:"Export",size:16}),r?"Exporting...":"Export"]}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top end",className:"min-w-48 p-1 bg-white dark:bg-gray-800 rounded-lg shadow-xl ring-1 ring-gray-200 dark:ring-gray-700",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:i,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(v,{name:"List",size:14}),n==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(v,{name:"Code",size:14}),n==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(v,{name:"DownloadSimple",size:14}),n==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})};function Gn(e,t,r=true){let o=e||"chart";if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}async function On(e,t,r={},o){let n=Array.isArray(t[0])?t:[t];try{switch(e){case "csv":await qp(n,r);break;case "svg":await Xp(o,r);break;case "png":await Yp(o,r);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(a){throw console.error("Export failed:",a),new Error(`Failed to export chart as ${e}: ${a instanceof Error?a.message:"Unknown error"}`)}}async function qp(e,t){try{let r=new Map;e.forEach(s=>{s.forEach(d=>{let p=d.xValue.getTime();r.has(p)||r.set(p,d.xValue);});});let n=Array.from(r.values()).sort((s,d)=>s.getTime()-d.getTime()).map(s=>{let d={[t.xLabel||"Date"]:s.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return e.forEach((p,c)=>{let u=t.seriesLabels?.[c]||`Series ${c+1}`,m=p.find(b=>b.xValue.getTime()===s.getTime());d[u]=m?m.yValue:"",m?.category&&(d[`${u} Category`]=m.category);}),d}),a=jp__default.default.unparse(n,{header:!0,skipEmptyLines:!0}),i=new Blob([a],{type:"text/csv;charset=utf-8;"}),l=Gn(t.filename||"chart-data","csv",t.timestamp!==!1);fileSaver.saveAs(i,l);}catch(r){throw new Error(`CSV export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function Xp(e,t){if(!e.current)throw new Error("SVG element not found");try{let o=e.current.cloneNode(!0);if(!o.querySelector("rect[data-background]")){let d=document.createElementNS("http://www.w3.org/2000/svg","rect");d.setAttribute("width",o.getAttribute("width")||"100%"),d.setAttribute("height",o.getAttribute("height")||"100%"),d.setAttribute("fill","white"),d.setAttribute("data-background","true"),o.insertBefore(d,o.firstChild);}let i=new XMLSerializer().serializeToString(o);i.includes("<?xml")||(i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
77
|
+
`+i),i.includes("xmlns=")||(i=i.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let l=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),s=Gn(t.filename||"chart","svg",t.timestamp!==!1);fileSaver.saveAs(l,s);}catch(r){throw new Error(`SVG export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function Yp(e,t,r=2){if(!e.current)throw new Error("SVG element not found");let o="";try{let n=e.current,a=n.getBoundingClientRect(),i=n.cloneNode(!0);i.setAttribute("width",String(a.width)),i.setAttribute("height",String(a.height)),i.removeAttribute("transform");let l=i.getElementsByTagName("text");Array.from(l).forEach(u=>{u.style.fontFamily||(u.style.fontFamily="system-ui, -apple-system, sans-serif"),u.style.fontSize||(u.style.fontSize="12px");});let s=document.createElementNS("http://www.w3.org/2000/svg","rect");s.setAttribute("width",String(a.width)),s.setAttribute("height",String(a.height)),s.setAttribute("fill","white"),i.insertBefore(s,i.firstChild);let p=new XMLSerializer().serializeToString(i);p.includes("xmlns=")||(p=p.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let c=new Blob([p],{type:"image/svg+xml;charset=utf-8"});return o=URL.createObjectURL(c),new Promise((u,m)=>{let b=new Image,f=setTimeout(()=>{o&&URL.revokeObjectURL(o),m(new Error("Image loading timeout"));},1e4);b.onload=()=>{clearTimeout(f);try{let x=document.createElement("canvas");x.width=a.width*r,x.height=a.height*r;let h=x.getContext("2d");if(!h)throw new Error("Canvas context not available");h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.scale(r,r),h.fillStyle="white",h.fillRect(0,0,a.width,a.height),h.drawImage(b,0,0,a.width,a.height),x.toBlob(y=>{if(y){let S=Gn(t.filename||"chart","png",t.timestamp!==!1);fileSaver.saveAs(y,S),u();}else m(new Error("Failed to create PNG blob"));o&&URL.revokeObjectURL(o);},"image/png",1);}catch(x){o&&URL.revokeObjectURL(o),m(x);}},b.onerror=()=>{clearTimeout(f),o&&URL.revokeObjectURL(o),m(new Error("Failed to load SVG as image"));},b.src=o;})}catch(n){throw o&&URL.revokeObjectURL(o),new Error(`PNG export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function Jp(e){if(typeof window>"u")return false;switch(e){case "csv":return true;case "svg":return typeof XMLSerializer<"u";case "png":return typeof HTMLCanvasElement<"u"&&typeof HTMLCanvasElement.prototype.toBlob=="function";default:return false}}function Qp(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}var lo=({data:e,formatType:t})=>{if(!e)return null;let r=Gt(t),o=lt__namespace.default.useRef(null),[n,a]=lt__namespace.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});lt__namespace.default.useEffect(()=>{if(!o.current)return;let s=o.current.getBoundingClientRect(),d=window.innerHeight,p=e.x,c=e.y,u=e.position==="left"?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";c-s.height/2<0?c=s.height/2:c+s.height/2>d&&(c=d-s.height/2),a({x:p,y:c,translate:u});},[e.x,e.y,e.position]);let i=l=>new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}).format(l);return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:o,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-white p-4 text-sm shadow-xl ring-1 ring-gray-200 dark:bg-gray-800 dark:ring-gray-700",style:{left:n.x,top:n.y,transform:n.translate},children:[jsxRuntime.jsx("time",{className:"mb-1 font-medium text-gray-900 dark:text-gray-100",children:i(e.xValue)}),jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(l=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l.color}}),jsxRuntime.jsxs("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:[l.label,":"]}),jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.format(l.value)})]},l.label))})]})})};var Ot=({data:e,color:t="#6b7280",strokeWidth:r=3,strokeDasharray:o})=>{let{xScale:n,yScale:a,animationSettings:i}=ft(),l=a.range();return jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${l[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:jsxRuntime.jsx(shape.LinePath,{data:e,x:s=>n(s.xValue),y:s=>a(s.yValue),stroke:t,strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear})})};var dm=d3Array.bisector(e=>e.xValue).left,um=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-gray-500",children:"No data available"})}),pm=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(z,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(z,{className:"h-4 w-24"}),jsxRuntime.jsx(z,{className:"h-4 w-24"})]})]}),mm=({parentWidth:e,parentHeight:t,yFormatType:r="number",isLoading:o=false,children:n})=>{let[a,i]=lt.useState(null),l=lt.useRef(null),s=lt.useRef(0),d=lt.useMemo(()=>jr(),[]),p=lt.useMemo(()=>yn(),[]),{datasets:c,seriesMetadata:u}=lt.useMemo(()=>{let C=[],k=[],I=0,A=lt.Children.toArray(n).filter(g=>lt.isValidElement(g)&&(g.type===Vt||g.type===Ot||g.type===Ht)&&g.props.data).length;return lt.Children.forEach(n,g=>{if(lt.isValidElement(g)&&(g.type===Vt||g.type===Ot||g.type===Ht)&&g.props.data){C.push(g.props.data);let N=g.props.color||(A===1?p:d[I%d.length]);k.push({label:g.props.label||`Series ${C.length}`,color:N}),I++;}}),{datasets:C,seriesMetadata:k}},[n]),m=e,b=t-60,f=lt.useMemo(()=>c.flat(),[c]),x=lt.useMemo(()=>$n(f,m),[f,m]),h=lt.useMemo(()=>Bn(f,b,r),[f,b,r]),y=lt.useCallback(C=>{let{left:k}=l.current?.getBoundingClientRect()||{left:0},I=C.clientX-k;if(C.timeStamp-(s.current||0)<16)return;s.current=C.timeStamp;let A=x.invert(I),g=c.map((B,U)=>{if(!B||B.length===0)return null;let re=dm(B,A,1);if(re===0)return {point:B[0],datasetIndex:U};if(re>=B.length)return {point:B[B.length-1],datasetIndex:U};let ne=B[re-1],E=B[re];if(!ne||!E)return null;let G=Math.abs(ne.xValue.getTime()-A.getTime()),X=Math.abs(E.xValue.getTime()-A.getTime());return {point:G<X?ne:E,datasetIndex:U}}).filter(B=>B!==null&&u[B.datasetIndex]!==void 0).map(({point:B,datasetIndex:U})=>({label:u[U].label,value:B.yValue,color:u[U].color,point:B}));if(g.length===0){i(null);return}let N=x(g[0].point.xValue),K=N>(m-oe.right-oe.left)/2+oe.left;i({xValue:g[0].point.xValue,series:g.map(({label:B,value:U,color:re})=>({label:B,value:U,color:re})),x:N,y:h(g[0].value),position:K?"left":"right"});},[c,u,x,h,m]),S=()=>{i(null);},F={width:m,height:b,xScale:x,yScale:h,yFormatType:r,animationSettings:Ui,tooltip:{data:a,show:i,hide:()=>i(null)}},w=lt.Children.map(n,(C,k)=>lt.isValidElement(C)&&(C.type===Vt||C.type===Ot||C.type===Ht)?lt__namespace.default.cloneElement(C,{...C.props,color:u[k]?.color}):C),T=u.map(C=>({category:C.label,fill:C.color})),L=lt.useCallback(async C=>{try{await On(C,c,{xLabel:"Date",yLabel:"Value",seriesLabels:u.map(k=>k.label),timestamp:!0},l);}catch(k){console.error("Export failed:",k);}},[c,u]);return o?jsxRuntime.jsx(pm,{}):c.length===0?jsxRuntime.jsx(um,{}):jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(ao.Provider,{value:F,children:[jsxRuntime.jsxs("svg",{width:m,height:b,className:"overflow-visible",ref:l,children:[jsxRuntime.jsx("g",{children:h.ticks(5).map(C=>jsxRuntime.jsx(shape.Line,{from:{x:oe.left,y:h(C)},to:{x:m-oe.right,y:h(C)},stroke:"#e5e7eb",strokeWidth:1},`grid-line-${C}`))}),w,jsxRuntime.jsx(hr.Bottom,{top:b-oe.bottom,scale:x,width:m-oe.left-oe.right}),jsxRuntime.jsx(hr.Left,{left:oe.left,scale:h,yFormatType:r}),a?.series.map(C=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:x(a.xValue),cy:h(C.value),r:8,fill:"white",stroke:C.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:x(a.xValue),cy:h(C.value),r:4,fill:C.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${C.label}`)),jsxRuntime.jsx("rect",{x:oe.left,y:oe.top,width:m-oe.left-oe.right,height:b-oe.top-oe.bottom,fill:"transparent",style:{cursor:"crosshair"},onMouseMove:y,onMouseLeave:S})]}),jsxRuntime.jsx(lo,{data:a,formatType:r}),jsxRuntime.jsx(so,{onExport:L,items:T})]})})},ts=responsive.withParentSize(mm);function Un(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function $e(e="normal",t){return tailwindMerge.twMerge({high:"font-semibold text-text-body",normal:"text-text-body",low:"text-text-muted"}[e],t&&"hover:text-action-primary cursor-pointer transition-colors")}function se(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1",Un(e),t)}function uo(e,t="\u2014"){return e==null||e===""?t:String(e)}var bt={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function Be(e="normal"){return {high:bt.lg,normal:bt.md,low:bt.sm}[e]}function Ce(e,t){return typeof e=="function"?e(t):e}function rs(e="neutral",t="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",t==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-green-100 text-green-800",error:"bg-red-100 text-red-800",warning:"bg-yellow-100 text-yellow-800",info:"bg-blue-100 text-blue-800",neutral:"bg-gray-100 text-gray-800"}[e])}function os(e){return e?"success":"neutral"}function po(e,t=false){return t?e>0?"text-green-600":e<0?"text-red-600":"text-text-body":"text-text-body"}function ns(e="hover"){switch(e){case "visible":return "text-action-primary underline hover:text-action-primary-hover cursor-pointer";case "hover":return "hover:underline hover:text-action-primary cursor-pointer transition-colors";case "none":return "cursor-pointer";default:return ""}}function xt(e,t,r,o="hover",n){if(!t)return e;let a=typeof t=="function"&&r?t(r):t,i=ns(o);return jsxRuntime.jsx("a",{href:a,className:tailwindMerge.twMerge(i,n),onClick:l=>{l.metaKey||l.ctrlKey;},children:e})}function as({row:e,context:t,actions:r,align:o="right",size:n="sm"}){let{isLoading:a}=t;if(a)return jsxRuntime.jsx(z,{className:bt.sm});let i=r.filter(s=>!Ce(s.hidden,e));if(i.length===0)return null;let l=se(o);return jsxRuntime.jsx("div",{className:l,children:i.map(s=>{let d=Ce(s.disabled,e);return s.variant==="icon"||!s.label?jsxRuntime.jsx(H,{variant:"icon",size:n,onPress:()=>{s.onClick(e);},isDisabled:d,"aria-label":s.label||s.id,children:jsxRuntime.jsx(v,{name:s.icon||"DotsThree",size:n==="sm"?16:20})},s.id):jsxRuntime.jsxs(H,{variant:s.variant||"secondary",size:n,onPress:()=>{s.onClick(e);},isDisabled:d,children:[s.icon&&jsxRuntime.jsx(v,{name:s.icon,size:n==="sm"?14:16}),s.label]},s.id)})})}function is({value:e,context:t,format:r="icon",trueText:o="Yes",falseText:n="No",trueIcon:a="Check",falseIcon:i="X",showFalse:l=true,align:s="center",emphasis:d="normal"}){let{isLoading:p}=t;if(p)return jsxRuntime.jsx(z,{className:Be(d)});let c=!!e;if(!c&&!l)return jsxRuntime.jsx("div",{className:se(s)});let u=se(s);switch(r){case "icon":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(v,{name:c?a:i,size:16,className:c?"text-green-600":"text-gray-400"})});case "text":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx("span",{className:$e(d),children:c?o:n})});case "badge":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(At,{variant:c?"success":"neutral",size:"sm",children:c?o:n})});default:return null}}function ss({value:e,row:t,context:r,format:o="date",customFormat:n,emptyText:a="\u2014",align:i="left",emphasis:l="normal",href:s,linkBehavior:d="hover"}){let{isLoading:p}=r;if(p)return jsxRuntime.jsx(z,{className:Be(l)});if(!e)return jsxRuntime.jsx("div",{className:se(i,"text-text-muted"),children:a});let c=e instanceof Date?e:new Date(e);if(isNaN(c.getTime()))return jsxRuntime.jsx("div",{className:se(i,"text-text-muted"),children:a});let u;switch(o){case "date":u=c.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":u=c.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":u=c.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":u=bm(c);break;case "custom":u=n?c.toLocaleString("en-US",n):c.toISOString();break;default:u=c.toLocaleDateString();}let m=se(i,$e(l)),b=Ce(s,t);return b?jsxRuntime.jsx("div",{className:m,children:xt(u,b,t,d)}):jsxRuntime.jsx("div",{className:m,children:u})}function bm(e){let r=new Date().getTime()-e.getTime(),o=Math.floor(r/1e3),n=Math.floor(o/60),a=Math.floor(n/60),i=Math.floor(a/24);return o<60?"just now":n<60?`${n} minute${n!==1?"s":""} ago`:a<24?`${a} hour${a!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function ls({value:e,row:t,context:r,format:o="number",decimals:n=0,prefix:a,suffix:i,emptyText:l="\u2014",align:s="right",emphasis:d="normal",href:p,linkBehavior:c="hover",showPositiveSign:u=false,colorCode:m=false}){let{isLoading:b}=r;if(b)return jsxRuntime.jsx(z,{className:Be(d)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:se(s,"text-text-muted"),children:l});let f=Number(e),x;switch(o){case "currency":x=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(f);break;case "percent":x=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(f/100);break;case "compact":x=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:n>0?1:0,maximumFractionDigits:n}).format(f);break;default:x=new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(f);}let y=`${u&&f>0?"+":""}${x}`,S=m?po(f,true):$e(d),F=se(s,S),w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("span",{className:"text-text-muted",children:a}),jsxRuntime.jsx("span",{children:y}),i&&jsxRuntime.jsx("span",{className:"text-text-muted",children:i})]}),T=Ce(p,t);return T?jsxRuntime.jsx("div",{className:F,children:xt(w,T,t,c)}):jsxRuntime.jsx("div",{className:F,children:w})}function cs({row:e,context:t,isSelected:r=false,onSelect:o,isDisabled:n=false,align:a="center"}){let{isLoading:i}=t;if(i)return jsxRuntime.jsx("div",{className:se(a),children:jsxRuntime.jsx(z,{className:"h-4 w-4 rounded"})});let l=Ce(n,e),s=se(a);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx(br,{isSelected:r,onChange:d=>{o?.(e,d);},isDisabled:l,"aria-label":"Select row"})})}function ds({value:e,row:t,context:r,prefix:o,suffix:n,emptyText:a="\u2014",href:i,linkBehavior:l="visible",emphasis:s="normal",truncate:d=true,align:p="left"}){let{isLoading:c}=r;if(c)return jsxRuntime.jsx(z,{className:Be(s)});let u=uo(e,a),m=Ce(i,t),b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-muted",children:o}),jsxRuntime.jsx("span",{className:d?"truncate":"",children:u}),n&&jsxRuntime.jsx("span",{className:"text-text-muted",children:n})]}),f=se(p,$e(s));return m?jsxRuntime.jsx("div",{className:f,children:xt(b,m,t,l)}):jsxRuntime.jsx("div",{className:f,children:b})}var Cm={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},Nm={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function fo(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function go(e,t,r,o){if(r.cell){let n=r.cell,a=typeof r.cellProps=="function"?r.cellProps(e,t):r.cellProps;return jsxRuntime.jsx(n,{value:e,row:t,context:o,...a})}return r.render?r.render(e,t,o):e?.toString()??"\u2014"}function xo({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(c=>c.mobile!==false).map(c=>{let u=c.mobile===false?null:c.mobile;return {...c,mobilePriority:u?.priority??2,mobileFormat:u?.format??"secondary",showLabel:u?.label??u?.format==="secondary",icon:u?.icon}}).sort((c,u)=>c.mobilePriority-u.mobilePriority),i=a.filter(c=>c.mobilePriority===1||c.mobileFormat==="primary"),l=a.filter(c=>c.mobilePriority===2&&c.mobileFormat!=="primary"),s=a.filter(c=>c.mobileFormat==="badge"),d={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:[i.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:i.map(c=>{let u=fo(e,c);return jsxRuntime.jsx("div",{className:"font-medium text-text-body [&>*]:!justify-start [&>*]:!text-left",children:go(u,e,c,d)},c.id)})}),s.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:s.map(c=>{let u=fo(e,c);return jsxRuntime.jsx("div",{className:"inline-flex",children:go(u,e,c,d)},c.id)})})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:l.map(c=>{let u=fo(e,c),m=c.showLabel&&c.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-muted",children:[c.icon&&jsxRuntime.jsx(v,{name:c.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),m&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[c.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:go(u,e,c,d)})]},c.id)})})]})}function ho({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(s=>s.mobile!==false),i={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:a.map((s,d)=>{let p=fo(e,s),c=d===0;return jsxRuntime.jsxs("div",{children:[!c&&jsxRuntime.jsx("div",{className:"text-xs text-text-muted",children:s.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(c?"font-medium text-text-body":"text-sm text-text-body","[&>*]:!justify-start [&>*]:!text-left"),children:go(p,e,s,i)})]},s.id)})})})}function us(e="md"){return {mobile:Cm[e],desktop:Nm[e]}}function ps({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var qn={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},Xn={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},wm={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},Pm={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function Yn(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function km(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Tm({column:e,sortConfig:t,onSort:r,stickyHeader:o,density:n="default"}){let a=t?.columnId===e.id,i=a?t.direction:null;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-default bg-background-surface font-medium text-text-muted",qn[n],Xn[e.align||"left"],o&&"sticky top-0 z-10",e.sortable&&"cursor-pointer hover:bg-background-hover"),onClick:()=>e.sortable&&r(e.id),role:"columnheader","aria-sort":a?i==="asc"?"ascending":"descending":"none",style:Yn(e),children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(v,{name:i==="asc"?"CaretUp":i==="desc"?"CaretDown":"CaretUp",size:12,className:a?"text-text-body":"text-text-muted opacity-50"})})]})}function Rm({column:e,row:t,rowIndex:r,columnIndex:o,isHovered:n,density:a="default",className:i}){let l=km(t,e),s={isLoading:false,isHovered:n,rowIndex:r,columnIndex:o,density:a},d;if(e.cell){let p=e.cell,c=typeof e.cellProps=="function"?e.cellProps(l,t):e.cellProps;d=jsxRuntime.jsx(p,{value:l,row:t,context:s,...c});}else e.render?d=e.render(l,t,s):d=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",qn[a],Xn[e.align||"left"],i),role:"cell",style:Yn(e),children:d})}function Lm({column:e,rowIndex:t,columnIndex:r,density:o="default"}){let n={isLoading:true,rowIndex:t,columnIndex:r,density:o},a;if(e.cell){let i=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;a=jsxRuntime.jsx(i,{value:null,row:{},context:n,...l});}else e.render?a=e.render(null,{},n):a=jsxRuntime.jsx(z,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",qn[o],Xn[e.align||"left"]),role:"cell",style:Yn(e),children:a})}function Fm({columns:e,row:t,rowIndex:r,density:o="default",onClick:n}){let[a,i]=lt.useState(false),l=lt.useCallback(()=>{n&&n(t);},[n,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",n&&"cursor-pointer"),role:"row",onClick:l,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),children:e.map((s,d)=>jsxRuntime.jsx(Rm,{column:s,row:t,rowIndex:r,columnIndex:d,isHovered:a,density:o,className:n?"group-hover:bg-background-hover":""},s.id))})}function Mm({columns:e,rowIndex:t,density:r="default"}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((o,n)=>jsxRuntime.jsx(Lm,{column:o,rowIndex:t,columnIndex:n,density:r},o.id))})}function gs({columns:e,data:t,className:r,density:o="default",width:n="full",height:a,maxHeight:i,layout:l="auto",mobileRenderer:s="auto",customMobileRowRender:d,mobileBreakpoint:p="md",isLoading:c=false,loadingRowCount:u=5,stickyHeader:m=false,onRowClick:b,getRowId:f,hideHeader:x=false,onSort:h,"aria-label":y}){let[S,F]=lt.useState(null),w=lt.useMemo(()=>e.map(g=>{if(g.width)return typeof g.width=="number"?`${g.width}px`:g.width;if(g.flex)return `${g.flex}fr`;if(g.minWidth&&g.maxWidth){let N=typeof g.minWidth=="number"?`${g.minWidth}px`:g.minWidth,K=typeof g.maxWidth=="number"?`${g.maxWidth}px`:g.maxWidth;return `minmax(${N}, ${K})`}return g.minWidth?`minmax(${typeof g.minWidth=="number"?`${g.minWidth}px`:g.minWidth}, 1fr)`:g.maxWidth?`minmax(0, ${typeof g.maxWidth=="number"?`${g.maxWidth}px`:g.maxWidth})`:"1fr"}).join(" "),[e]),T=lt.useCallback(g=>{if(!e.find(B=>B.id===g)?.sortable)return;let K=null;S?.columnId===g?S.direction==="asc"?K={columnId:g,direction:"desc"}:K=null:K={columnId:g,direction:"asc"},F(K),h?.(K);},[e,S,h]),L={};a&&(L.height=typeof a=="number"?`${a}px`:a,L.overflowY="auto"),i&&(L.maxHeight=typeof i=="number"?`${i}px`:i,L.overflowY="auto");let C=tailwindMerge.twMerge(wm[n],l==="responsive"?"overflow-x-auto":"overflow-auto",r),k=us(p),I=s!=="none",A=(g,N)=>I?s==="custom"&&d?d(g,N):jsxRuntime.jsx(s==="cards"?ho:xo,{row:g,columns:e,density:o,isLoading:c,onClick:b?()=>b(g):void 0}):null;return jsxRuntime.jsxs("div",{className:C,style:L,children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",Pm[l],n==="auto"?"inline-grid w-auto":"w-full",I&&k.desktop),role:"table","aria-label":y,style:{gridTemplateColumns:w},children:[!x&&jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:e.map(g=>jsxRuntime.jsx(Tm,{column:g,sortConfig:S,onSort:T,stickyHeader:m,density:o},g.id))}),jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:c?Array.from({length:u}).map((g,N)=>jsxRuntime.jsx(Mm,{columns:e,rowIndex:N,density:o},`loading-${N}`)):t.length>0?t.map((g,N)=>{let K=f?f(g):`row-${N}`;return jsxRuntime.jsx(Fm,{columns:e,row:g,rowIndex:N,density:o,onClick:b},K)}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-muted",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),I&&jsxRuntime.jsx("div",{className:k.mobile,children:c?Array.from({length:u}).map((g,N)=>jsxRuntime.jsx(ps,{density:o},`mobile-loading-${N}`)):t.length>0?t.map((g,N)=>{let K=f?f(g):`mobile-row-${N}`;return jsxRuntime.jsx("div",{children:A(g,N)},K)}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-muted",children:"No data available"})})]})}function bs({label:e,description:t,errorMessage:r,showCalendar:o=false,...n}){let[a,i]=lt.useState(false),l=s=>{n.onChange&&s&&n.onChange(s),i(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...n,className:j(n.className,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{children:e}),o?jsxRuntime.jsxs(Xr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(Zt,{className:"min-w-[150px] flex-1"}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:a,onOpenChange:i,children:[jsxRuntime.jsx(H,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})}),jsxRuntime.jsx(reactAriaComponents.Popover,{children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4",children:jsxRuntime.jsx(to,{value:n.value,onChange:l,minValue:n.minValue,maxValue:n.maxValue,isDisabled:n.isDisabled,isReadOnly:n.isReadOnly,isDateUnavailable:n.isDateUnavailable})})})]})]}):jsxRuntime.jsx(Zt,{}),t&&jsxRuntime.jsx(ee,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null]})}function Hm({isPlaceholder:e,isDisabled:t}){return ["inline box-content px-0.5 -my-0.5 rounded outline-none tabular-nums text-center transition-colors",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text","hover:bg-text-body/5","data-[focused]:!outline-[1.5px] data-[focused]:!outline-[var(--control-focus-ring-color)] data-[focused]:![--tw-outline-style:solid]"].filter(Boolean).join(" ")}function Zt(e){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:t=>pr({...t,className:typeof e.className=="string"?e.className:"min-w-[150px] px-2 py-1.5 text-sm flex items-center gap-0.5"}),...e,children:t=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:t,className:Hm({isPlaceholder:t.isPlaceholder,isDisabled:!t.isEditable})})})}function Ut(e){return jsxRuntime.jsx(reactAriaComponents.Dialog,{...e,className:tailwindMerge.twMerge("relative h-auto max-h-[inherit] overflow-auto outline-none [[data-placement]>&]:p-4",e.className),role:"dialog"})}function qm({selectionState:e,isDisabled:t}){let r=`${ae} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,o={none:"text-text-body group-hover:bg-gray-200 group-pressed:bg-gray-200",middle:["group-hover:bg-gray-300 forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-red-200 forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-blue-300 forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-red-300 forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:" group-invalid:bg-red-600 forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] text-white forced-colors:text-white !bg-neutral-black"},n=t?"text-textFaint dark:text-zinc-600 forced-colors:text-textFaint font-light":"";return [r,o[e],n].filter(Boolean).join(" ")}function yo({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(ro,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full [&_td]:px-0",children:[jsxRuntime.jsx(oo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:"selection-start:rounded-s-end selection-end:rounded-e-end [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm outline-none outside-month:text-gray-300 selected:bg-background-selected invalid:selected:bg-red-100 forced-colors:selected:bg-[Highlight] forced-colors:selected:text-white forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full",children:({formattedDate:o,isSelected:n,isSelectionStart:a,isSelectionEnd:i,isFocusVisible:l,isDisabled:s})=>jsxRuntime.jsx("span",{className:qm({selectionState:n&&(a||i)?"cap":n?"middle":"none",isDisabled:s}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function ys({label:e,description:t,errorMessage:r,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:j(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{children:e}),jsxRuntime.jsxs(Xr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(Zt,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-gray-800 group-disabled:text-gray-200 dark:text-zinc-200 group-disabled:dark:text-zinc-600 forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(Zt,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(H,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),t&&jsxRuntime.jsx(ee,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null,jsxRuntime.jsx(pt,{children:jsxRuntime.jsx(Ut,{children:jsxRuntime.jsx(yo,{})})})]})}var qt=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full items-center justify-between border-b px-4",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(H,{variant:"unstyled",onPress:a,className:"absolute left-4",children:jsxRuntime.jsx(v,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Ee,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx(H,{variant:"unstyled",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(v,{name:"X","data-testid":"close-button"})})]})]});var Xt=class extends lt.Component{constructor(){super(...arguments);ir(this,"state",{hasError:false});ir(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Ae,{children:[this.props.title&&jsxRuntime.jsx(Ae.Header,{title:this.props.title}),jsxRuntime.jsx(Ae.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-red-500",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var ea=({children:e,title:t,headerContent:r,isOpen:o,slideInFrom:n="right",transparentOverlay:a=false,onClose:i,className:l,primaryAction:s,secondaryAction:d,footerContent:p,contentPadding:c=true,maxWidth:u="400px"})=>{let[m,b]=lt.useState(false);if(lt.useEffect(()=>{if(o){let h=setTimeout(()=>b(true),10);return ()=>clearTimeout(h)}else b(false);},[o]),!o)return null;let f=s||d,x=f||p;return jsxRuntime.jsx(Xt,{children:jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isOpen:o,onOpenChange:i,isDismissable:true,className:`fixed inset-0 z-50 ${a?"bg-transparent":"bg-black/50"}`,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",isDismissable:true,children:jsxRuntime.jsxs(Ut,{className:`fixed bottom-0 top-0 z-50 flex w-full flex-col bg-background-surface shadow-xl duration-300 h-full min-h-0 overflow-hidden dark:bg-gray-800 ${m?n==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":""} ${l||""}`,style:{[n==="right"?"right":"left"]:0,maxWidth:u,transform:m?void 0:n==="right"?"translateX(100%)":"translateX(-100%)"},children:[(t||r)&&jsxRuntime.jsx(qt,{title:t,headerContent:r,onClose:i||(()=>{})}),jsxRuntime.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain ${c?"p-6":"p-0"}`,children:e}),x&&jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[p&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:p}),f&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[d&&jsxRuntime.jsx(H,{size:d.size||"lg",fullWidth:true,variant:d.variant||"secondary",onPress:d.onPress,isLoading:d.isLoading,isDisabled:d.isDisabled,children:d.label}),s&&jsxRuntime.jsx(H,{size:s.size||"lg",fullWidth:true,onPress:s.onPress,isLoading:s.isLoading,isDisabled:s.isDisabled,children:s.label})]})]})]})})})})};ea.displayName="Drawer";function Ss({value:e,onChange:t,onUrlChange:r,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:l,showPreview:s=true,placeholder:d="Drop files here or click to browse"}){let[p,c]=lt.useState(false),[u,m]=lt.useState(false),[b,f]=lt.useState(null),[x,h]=lt.useState(e),y=lt.useRef(null),S=async T=>{if(f(null),n&&T.size>n){f(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(s&&T.type.startsWith("image/")){let L=new FileReader;L.onloadend=()=>{h(L.result);},L.readAsDataURL(T);}if(i){m(true);try{let L=await i(T);h(L),r?.(L);}catch(L){f("Failed to upload file"),console.error("Upload error:",L);}finally{m(false);}}t?.(T,x);},F=T=>{let L=T.items;if(L.length>0){let C=L[0];if(C.kind==="file"){let k=C.getAsFile();k&&S(k);}}c(false);},w=()=>{h(void 0),f(null),t?.(null),r?.(""),y.current&&(y.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",l),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",p?"border-action-primary bg-action-primary/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",b&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:F,onDropEnter:()=>c(true),onDropExit:()=>c(false),children:[x?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[s&&x.startsWith("data:image")?jsxRuntime.jsx("img",{src:x,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(H,{variant:"icon",size:"sm",onPress:w,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:d}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:T=>{let L=Array.from(T||[]);L.length>0&&S(L[0]);},children:jsxRuntime.jsx(H,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),u&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-primary border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),b&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:b})]})}function ws(e){return jsxRuntime.jsx(reactAriaComponents.Form,{...e,className:tailwindMerge.twMerge("flex flex-col gap-4",e.className)})}var gf={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12",none:"grid-cols-none"},bf={sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12",none:"sm:grid-cols-none"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12",none:"md:grid-cols-none"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12",none:"lg:grid-cols-none"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6",7:"xl:grid-cols-7",8:"xl:grid-cols-8",9:"xl:grid-cols-9",10:"xl:grid-cols-10",11:"xl:grid-cols-11",12:"xl:grid-cols-12",none:"xl:grid-cols-none"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",5:"2xl:grid-cols-5",6:"2xl:grid-cols-6",7:"2xl:grid-cols-7",8:"2xl:grid-cols-8",9:"2xl:grid-cols-9",10:"2xl:grid-cols-10",11:"2xl:grid-cols-11",12:"2xl:grid-cols-12",none:"2xl:grid-cols-none"}},xf={none:"gap-0",xs:"gap-x-2 gap-y-1",sm:"gap-x-3 gap-y-2",md:"gap-x-4 gap-y-3",lg:"gap-x-6 gap-y-4",xl:"gap-x-8 gap-y-6","2xl":"gap-x-12 gap-y-8"},hf={none:"gap-x-0",xs:"gap-x-2",sm:"gap-x-3",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},yf={none:"gap-y-0",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-3",lg:"gap-y-4",xl:"gap-y-6","2xl":"gap-y-8"},vf={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Cf={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Nf={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"},Sf={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",full:"col-span-full",auto:"col-auto"},wf={sm:{1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",full:"sm:col-span-full",auto:"sm:col-auto"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",full:"md:col-span-full",auto:"md:col-auto"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",full:"lg:col-span-full",auto:"lg:col-auto"},xl:{1:"xl:col-span-1",2:"xl:col-span-2",3:"xl:col-span-3",4:"xl:col-span-4",5:"xl:col-span-5",6:"xl:col-span-6",7:"xl:col-span-7",8:"xl:col-span-8",9:"xl:col-span-9",10:"xl:col-span-10",11:"xl:col-span-11",12:"xl:col-span-12",full:"xl:col-span-full",auto:"xl:col-auto"},"2xl":{1:"2xl:col-span-1",2:"2xl:col-span-2",3:"2xl:col-span-3",4:"2xl:col-span-4",5:"2xl:col-span-5",6:"2xl:col-span-6",7:"2xl:col-span-7",8:"2xl:col-span-8",9:"2xl:col-span-9",10:"2xl:col-span-10",11:"2xl:col-span-11",12:"2xl:col-span-12",full:"2xl:col-span-full",auto:"2xl:col-auto"}};function ks(e,t,r){if(!e)return "";if(typeof e!="object")return t[e]||"";let o=[];return "base"in e&&e.base!==void 0&&o.push(t[e.base]),Object.entries(r).forEach(([n,a])=>{let i=e[n];i!==void 0&&o.push(a[i]);}),o.join(" ")}function ta({cols:e=1,gap:t="md",gapX:r,gapY:o,align:n="stretch",justify:a="start",flow:i="row",autoFit:l,autoFill:s,className:d,children:p}){let c=tailwindMerge.twMerge("grid",l||s?"":ks(e,gf,bf),!r&&!o&&xf[t],r&&hf[r],o&&yf[o],vf[n],Cf[a],Nf[i],d),u={};return l?u.gridTemplateColumns=`repeat(auto-fit, minmax(${l}, 1fr))`:s&&(u.gridTemplateColumns=`repeat(auto-fill, minmax(${s}, 1fr))`),jsxRuntime.jsx("div",{className:c,style:u,children:p})}function Ts({span:e,className:t,children:r}){let o=tailwindMerge.twMerge(ks(e,Sf,wf),t);return jsxRuntime.jsx("div",{className:o,children:r})}ta.Item=Ts;function Pf(e,t){return lr({value:e,formatter:t,emptyClassName:"text-text-muted",emptyText:"\u2014"})}function kf(e,t="upIsGood"){if(e===0)return "text-text-muted";let r=e>0;return t==="upIsGood"?r?"text-feedback-success":"text-feedback-error":r?"text-feedback-error":"text-feedback-success"}function Tf({points:e,className:t,ariaLabel:r}){let i=e.map(m=>typeof m.y=="number"?m.y:0);if(i.length===0)return null;let l=Math.min(...i),d=Math.max(...i)-l,p=m=>d===0?20/2:18-(m-l)/d*16,c=60/Math.max(e.length-1,1),u=e.map((m,b)=>{let f=2+b*c,x=p(typeof m.y=="number"?m.y:0);return `${b===0?"M":"L"} ${f} ${x}`}).join(" ");return jsxRuntime.jsx("svg",{width:64,height:20,role:"img","aria-label":r,className:tailwindMerge.twMerge("overflow-visible",t),children:jsxRuntime.jsx("path",{d:u,fill:"none",strokeWidth:"1.5",className:"stroke-border-muted"})})}function Ls({label:e,value:t,formatter:r,delta:o,deltaPeriodLabel:n,deltaIntent:a="upIsGood",trend:i,status:l,helpText:s,size:d="md",orientation:p="vertical",loading:c,empty:u,error:m,onClick:b,className:f,renderValue:x,renderDelta:h,renderTrend:y}){let F={sm:{label:"text-xs",value:"text-base",delta:"text-xs",gap:"gap-1"},md:{label:"text-sm",value:"text-xl",delta:"text-sm",gap:"gap-2"},lg:{label:"text-base",value:"text-2xl",delta:"text-base",gap:"gap-3"}}[d],w=c?jsxRuntime.jsx(z,{className:"h-7 w-20"}):u?jsxRuntime.jsx("span",{className:"text-text-muted",children:"\u2014"}):m?jsxRuntime.jsx("span",{className:"text-feedback-error text-sm",children:typeof m=="string"?m:"Error"}):x?x(t):Pf(t,r),T=h?h(o):o!==void 0&&!c&&!u&&!m?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(F.delta,kf(o,a),"flex items-center gap-1"),children:[o>0&&jsxRuntime.jsx(v,{name:"ArrowUp",size:12}),o<0&&jsxRuntime.jsx(v,{name:"ArrowDown",size:12}),o===0&&jsxRuntime.jsx(v,{name:"Minus",size:12}),jsxRuntime.jsxs("span",{children:[o>0?"+":"",Math.abs(o).toFixed(1),"%"]}),n&&jsxRuntime.jsxs("span",{className:"text-text-muted",children:["\xB7 ",n]})]}):c?jsxRuntime.jsx(z,{className:"h-4 w-24"}):null,L=y?y(i):i&&i.length>0&&!c&&!m?jsxRuntime.jsx(Tf,{points:i,ariaLabel:`${e} trend`,className:u?"opacity-30":""}):c?jsxRuntime.jsx(z,{className:"h-5 w-16"}):null;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("flex min-w-0",p==="horizontal"?`items-center ${F.gap}`:`flex-col ${F.gap}`,b&&"cursor-pointer hover:bg-background-muted rounded-lg px-3 py-2 -mx-3 -my-2 transition-colors",f),"aria-labelledby":`kpi-${e}`,onClick:b,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h3",{id:`kpi-${e}`,className:tailwindMerge.twMerge(F.label,"font-medium text-text-caption truncate"),children:c?jsxRuntime.jsx(z,{className:"h-4 w-24"}):e}),s&&!c&&jsxRuntime.jsx(v,{name:"Question",size:12,className:"text-text-muted cursor-help","aria-label":"Help"})]}),jsxRuntime.jsxs("div",{className:"flex items-baseline gap-2",children:[jsxRuntime.jsx("output",{className:tailwindMerge.twMerge(F.value,"font-semibold",m?"text-feedback-error":"text-text-heading"),"aria-label":`Value: ${w}`,children:w}),l&&!c&&!m&&jsxRuntime.jsx(At,{variant:l.tone||"neutral",size:"sm",children:l.value})]}),(T||L)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[T,L]})]})}var Rf={xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-6",xl:"gap-8"},Lf={start:"items-start",center:"items-center",stretch:"items-stretch"};function Ff(e){if(typeof e=="number")return `grid-cols-${e}`;let t=[];return e.base!==void 0&&t.push(`grid-cols-${e.base}`),e.sm!==void 0&&t.push(`sm:grid-cols-${e.sm}`),e.md!==void 0&&t.push(`md:grid-cols-${e.md}`),e.lg!==void 0&&t.push(`lg:grid-cols-${e.lg}`),e.xl!==void 0&&t.push(`xl:grid-cols-${e.xl}`),e["2xl"]!==void 0&&t.push(`2xl:grid-cols-${e["2xl"]}`),t.join(" ")}function oa({children:e,cols:t={base:1,sm:2,md:3,lg:4},gap:r="md",align:o="stretch",equalizeHeights:n=true,header:a,loading:i,className:l}){let s=i?lt__namespace.default.Children.map(e,d=>lt__namespace.default.isValidElement(d)&&d.type&&typeof d.type!="string"&&"displayName"in d.type?lt__namespace.default.cloneElement(d,{loading:true}):d):e;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("w-full",l),"aria-label":"Key metrics",children:[a&&jsxRuntime.jsx("div",{className:"mb-4",children:a}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",Ff(t),Rf[r],Lf[o],n&&"auto-rows-fr","w-full"),children:s})]})}oa.displayName="KpiGroup";function Ds({items:e,renderItem:t,selectedId:r,onSelect:o,onHoverChange:n,isLoading:a=false,error:i=null,emptyMessage:l="No results found.",variant:s="relaxed",showDividers:d=true,"aria-label":p,className:c="",style:u}){let[m,b]=lt.useState(null),f=lt.useRef(null),x=lt.useRef(new Map),h=lt.useCallback((k,I)=>{o?.(k,I);},[o]),y=lt.useCallback((k,I)=>{b(k),n?.(k,I);},[n]),S=lt.useCallback((k,I)=>{let A=k?.id;return typeof A=="string"&&A?A:`item-${I}`},[]),F=lt.useCallback(k=>{if(!f.current||e.length===0)return;let I=document.activeElement,A=e.findIndex((B,U)=>{let re=S(B,U),ne=x.current.get(re);return ne&&(ne===I||ne.contains(I))}),g=A;switch(k.key){case "ArrowDown":k.preventDefault(),g=A===-1?0:Math.min(A+1,e.length-1);break;case "ArrowUp":k.preventDefault(),g=A===-1?0:Math.max(A-1,0);break;case "Home":k.preventDefault(),g=0;break;case "End":k.preventDefault(),g=e.length-1;break;default:return}let N=S(e[g],g);x.current.get(N)?.focus();},[e,S]),w=["flex flex-col","bg-background-surface","border border-border-muted rounded-sm","focus:outline-none focus:ring-2 focus:ring-border-focus focus:ring-offset-2"],T={dense:"gap-0",relaxed:"gap-0"},L=d?"divide-y divide-border-muted":"",C=[...w,T[s],L,c].filter(Boolean).join(" ");return a?jsxRuntime.jsx("div",{ref:f,className:C,style:u,role:"listbox","aria-label":p,"aria-busy":"true","aria-live":"polite",children:jsxRuntime.jsx($i,{count:5,className:"space-y-0",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[jsxRuntime.jsx(z,{width:16,height:16,variant:"circle"}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-2",children:[jsxRuntime.jsx(z,{width:"75%",height:16}),jsxRuntime.jsx(z,{width:"50%",height:14})]}),jsxRuntime.jsx(z,{width:60,height:20})]})})}):i?jsxRuntime.jsx("div",{ref:f,className:C,style:u,role:"listbox","aria-label":p,"aria-live":"polite",children:jsxRuntime.jsx("div",{className:"p-4 text-center text-action-destructive",children:i})}):e.length===0?jsxRuntime.jsx("div",{ref:f,className:C,style:u,role:"listbox","aria-label":p,"aria-live":"polite",children:jsxRuntime.jsx("div",{className:"p-4 text-center text-text-muted",children:l})}):jsxRuntime.jsx("div",{ref:f,className:C,style:u,role:"listbox","aria-label":p,"aria-live":"polite",onKeyDown:F,tabIndex:0,children:e.map((k,I)=>{let A=S(k,I),g=r===A,N=m===A,K={id:A,role:"option","aria-selected":g,"aria-current":g?"page":void 0,tabIndex:g||r==null&&I===0?0:-1,onClick:B=>h(B,k),onMouseEnter:B=>y(B,k),onMouseLeave:B=>y(null),onFocus:B=>y(B,k),onBlur:B=>y(null),ref:B=>{B?x.current.set(A,B):x.current.delete(A);}};return jsxRuntime.jsx("div",{children:t({item:k,index:I,isSelected:g,isHovered:N,rowProps:K})},A)})})}function Df({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:j(t.className,"outline-0"),children:e})}function zf(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder ${_[e].text}`}function Hf(){let e=lt__namespace.default.useCallback((r,o)=>{o?.(r);},[]),t=lt__namespace.default.useCallback((r,o)=>{o?.(r);},[]);return {handleFocus:e,handleBlur:t}}function So({label:e,description:t,errorMessage:r,children:o,items:n,renderItem:a,size:i="md",selectedKey:l,defaultSelectedKey:s,onSelectionChange:d,placeholder:p,showErrors:c=false,tooltip:u,isRequired:m,transparent:b,...f}){let[x,h]=lt.useState(null),[y,S]=lt.useState(null),F=l??x??s,{handleFocus:w,handleBlur:T}=Hf(),L=I=>{d&&I!==null&&d(I),d||h(I);},C=lt.useRef(null),k=lt.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...f,selectedKey:F,defaultSelectedKey:s,onSelectionChange:L,placeholder:p,className:j(f.className,"group flex w-full flex-col"),ref:C,onOpenChange:I=>{I&&k.current?S(k.current.offsetWidth):I||C.current?.blur();},children:({isDisabled:I,isInvalid:A,isOpen:g})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:i,tooltip:u,isRequired:m,children:e}),jsxRuntime.jsx(Ue,{children:jsxRuntime.jsx("div",{ref:k,children:jsxRuntime.jsxs(H,{variant:"unstyled",className:tailwindMerge.twMerge(Oe({isInvalid:A||c&&!!r,isDisabled:I,isFocused:g,transparent:b,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:N=>w(N,f.onFocus),onBlur:N=>T(N,f.onBlur),"data-open":g,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:zf(i)}),jsxRuntime.jsx(v,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",g&&"rotate-180")})]})})}),t&&jsxRuntime.jsx(ee,{size:i,className:"mt-3",children:t}),c&&jsxRuntime.jsx(q,{size:i,className:"mt-3 text-feedback-error-text",children:typeof r=="function"&&f.validationResult?r(f.validationResult):typeof r=="string"?r:null}),jsxRuntime.jsx(pt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm",style:{minWidth:y?`${y}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?N=>jsxRuntime.jsx(ut,{id:N.id,textValue:N.label,size:i,children:a(N)},N.id):o})})]})})}var Kf=e=>{let t=Oe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,r,e.className)};function Yt({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:l,isClearable:s,onClear:d,type:p,validationResult:c,...u}){let[m,b]=lt__namespace.default.useState(false),{isFocused:f,handleFocus:x,handleBlur:h}=Ze(),y=p==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...u,isRequired:a,className:j(u.className,"group flex flex-col"),children:({isDisabled:S,isInvalid:F})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsxs(Ue,{children:[l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform",children:jsxRuntime.jsx(v,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(Pi,{size:o,disabled:S,type:y?m?"text":"password":p,value:u.value,defaultValue:u.defaultValue,placeholder:u.placeholder,onFocus:w=>x(w,u.onFocus),onBlur:w=>h(w,u.onBlur),onChange:w=>u.onChange?.(w.target.value),className:Kf({isInvalid:F,isDisabled:S,isFocused:f,size:o,transparent:i,showSearchIcon:l,isClearable:s,hasValue:!!u.value,isPassword:y,className:typeof u.className=="string"?u.className:void 0})}),s&&u.value&&!S&&jsxRuntime.jsx(wi,{onClick:()=>{d?d():u.onChange&&u.onChange("");},size:o}),y&&!S&&jsxRuntime.jsx("button",{type:"button",onClick:()=>b(!m),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":m?"Hide password":"Show password",onMouseDown:w=>{w.preventDefault(),w.stopPropagation();},children:jsxRuntime.jsx(v,{name:m?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-body"})})]}),t&&jsxRuntime.jsx(ee,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&c&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(c)})]})})}function Gs({title:e,search:t,filters:r=[],sort:o,actions:n,onClearAll:a,variant:i="spacious",className:l="",style:s}){let d=["flex flex-col gap-3","bg-background-surface","border-b border-border-muted","px-4 py-3"],p={compact:"px-3 py-2",spacious:"px-4 py-3"},c=[...d,p[i],l].filter(Boolean).join(" ");return jsxRuntime.jsxs("div",{className:c,style:s,children:[(e||n)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e&&jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-text-body truncate",children:e}),n&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:n})]}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4 flex-1 min-w-0",children:[t&&jsxRuntime.jsx("div",{className:"flex-1 min-w-0 sm:max-w-sm",children:jsxRuntime.jsx(Yt,{value:t.value,placeholder:t.placeholder||"Search...",onChange:t.onChange,showSearchIcon:true,isClearable:!!t.value&&!!t.onClear,onClear:t.onClear,size:"sm"})}),r.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.map(m=>jsxRuntime.jsxs(Bt,{variant:"secondary",size:"sm",onRemove:()=>m.onRemove(m.id),children:[m.label,": ",m.value]},m.id)),a&&jsxRuntime.jsx(H,{variant:"ghost",size:"sm",onClick:a,className:"text-text-muted hover:text-text-body",children:"Clear all"})]})]}),o&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-text-muted whitespace-nowrap",children:"Sort by:"}),jsxRuntime.jsx(So,{selectedKey:o.value,onSelectionChange:m=>o.onChange(m),size:"sm",className:"min-w-32",items:o.options.map(m=>({id:m.value,label:m.label,value:m.value})),renderItem:m=>m.label})]})]})]})}function Os({id:e,title:t,subtitle:r,meta:o,leading:n,trailing:a,isSelected:i=false,isHovered:l=false,disabled:s=false,href:d,onClick:p,onMouseEnter:c,onMouseLeave:u,className:m="",style:b}){let f=()=>{!s&&p&&p(e);},x=()=>{!s&&c&&c(e);},h=()=>{!s&&u&&u(e);},y=["flex items-center gap-3 w-full text-left transition-all duration-200 ease-in-out","px-4 py-3","border-l-2 border-l-transparent","rounded-sm",ae()],S=[l&&!i&&"bg-background-hover",i&&"bg-action-primary/5 border-l-action-primary shadow-sm",s&&"opacity-50 cursor-not-allowed",!s&&!i&&"hover:bg-background-hover"],F=[...y,...S,m].filter(Boolean).join(" "),w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("div",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center",children:n}),jsxRuntime.jsx("div",{className:"flex-1 min-w-0",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-text-body font-medium truncate",title:typeof t=="string"?t:void 0,children:t}),r&&jsxRuntime.jsx("div",{className:"text-text-muted text-sm truncate",title:typeof r=="string"?r:void 0,children:r})]}),o&&jsxRuntime.jsx("div",{className:"flex-shrink-0 text-text-muted text-sm",children:o})]})}),a&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:a})]});return d?jsxRuntime.jsx("a",{href:d,className:F,style:b,onMouseEnter:x,onMouseLeave:h,"aria-selected":i,"aria-current":i?"page":void 0,tabIndex:s?-1:0,children:w}):jsxRuntime.jsx("button",{type:"button",className:F,style:b,onClick:f,onMouseEnter:x,onMouseLeave:h,disabled:s,"aria-selected":i,tabIndex:s?-1:0,children:w})}function Ws({header:e,children:t,footer:r,width:o="md",tone:n="neutral",elevation:a="sm",showDivider:i=true,"aria-label":l,"aria-labelledby":s,className:d="",style:p}){let c={sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]","2xl":"w-[32rem]",auto:"w-auto"},u={neutral:"bg-background-surface",subtle:"bg-background-subtle",brand:"bg-background-brand"},m={none:"",sm:"shadow-sm",md:"shadow-md"},b=tailwindMerge.twMerge("flex flex-col h-full",c[o],u[n],m[a],i&&"border-r border-border-muted",d);return jsxRuntime.jsxs("div",{className:b,style:p,role:"complementary","aria-label":l,"aria-labelledby":s,children:[e&&jsxRuntime.jsx("div",{className:"flex-shrink-0 sticky top-0 z-10 bg-inherit border-b border-border-muted",children:e}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:t}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t border-border-muted bg-inherit",children:r})]})}var _s=({className:e,size:t=24,color:r="text-action-primary"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",r,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var ia=[{type:"navigation",position:"bottom-right",showCompass:true,showGeolocate:true,showResetZoom:true}];var Zs="./neutral-dark-ULOPSLHN.png";var Us="./neutral-light-IAPUNYDO.png";var js="./satelite-light-CU3QG3IP.png";var qs="./streets-dark-47NJZQUE.png";var Xs="./streets-light-YXBEDGBR.png";function Ys(e="top-right"){switch(e){case "top-left":return "absolute top-4 left-4 z-10";case "top-right":return "absolute top-4 right-4 z-10";case "bottom-left":return "absolute bottom-4 left-4 z-10";case "bottom-right":return "absolute bottom-4 right-4 z-10";default:return "absolute top-4 right-4 z-10"}}var tg="h-10 w-10 p-0 bg-background-surface hover:bg-background-hover shadow-lg border border-border";function Js(e){return tailwindMerge.twMerge(tg,e)}function Qe({position:e="top-right",className:t,style:r,children:o}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(Ys(e),t),style:r,children:o})}function Ve({icon:e,iconSize:t=20,onPress:r,isDisabled:o=false,className:n,iconClassName:a="text-text-primary",variant:i="secondary",isActive:l=false,ariaLabel:s,iconWeight:d="regular",...p}){let c=tailwindMerge.twMerge(Js(),l&&"bg-action-primary hover:bg-action-primary-hover border-action-primary",n),u=tailwindMerge.twMerge(a,l&&"text-text-onPrimary");return jsxRuntime.jsx(H,{...p,className:c,onPress:r,variant:i,size:"sm",isDisabled:o,"aria-label":s,"aria-pressed":l||void 0,type:"button",children:jsxRuntime.jsx(v,{name:e,size:t,className:u,weight:d})})}var sg=e=>[{id:"streets",name:"Streets",description:"Standard street map with traffic data",preview:e?qs:Xs},{id:"satellite",name:"Satellite",description:"Aerial imagery with street labels",preview:js},{id:"neutral",name:"Neutral",description:"Clean design with light/dark variants",preview:e?Zs:Us}];function lg({type:e,color:t}){let r="inline-block",o=t?{backgroundColor:t}:{};switch(e){case "dot":return jsxRuntime.jsx("span",{className:`${r} h-3 w-3 rounded-full border border-border`,style:o});case "line":return jsxRuntime.jsx("span",{className:`${r} h-0.5 w-6 rounded-full`,style:o});case "polygon":return jsxRuntime.jsx("span",{className:`${r} h-3 w-4 rounded-sm border border-border`,style:o});case "pin":return jsxRuntime.jsx("span",{className:`${r} h-3 w-3 rounded-full rounded-bl-none border border-border transform rotate-45`,style:o});default:return null}}function tl({position:e="bottom-left",className:t,style:r,currentMapType:o="streets",onMapTypeChange:n,layers:a=[],onLayerToggle:i}){let{isDarkTheme:l}=Re(),s=sg(l),d=c=>{n?.(c);},p=a.filter(c=>c.legend);return jsxRuntime.jsx(Qe,{position:e,className:t,style:r,children:jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsx(Ve,{icon:"Stack",ariaLabel:"Map layers and settings"}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top start",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{"aria-label":"Map layers and settings",className:"p-4 min-w-80 bg-background-surface border border-border rounded-lg shadow-xl focus:outline-none focus:ring-0",children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-text-body mb-3",children:"Map type"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:s.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>d(c.id),className:"flex flex-col items-center space-y-2 p-3 rounded-lg text-center hover:bg-background-muted transition-colors border border-transparent "+(o===c.id?"bg-background-muted border-border":"hover:border-border"),children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-lg overflow-hidden bg-background-surface "+(o===c.id?"border-2 border-action-secondary":"border border-border-default"),children:jsxRuntime.jsx("img",{src:c.preview,alt:`${c.name} map preview`,className:"w-full h-full object-cover"})}),jsxRuntime.jsx("div",{className:"text-sm "+(o===c.id?"font-bold text-text-body":"font-normal text-text-muted"),children:c.name})]},c.id))})]}),p.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-text-body mb-3",children:"Map details"}),jsxRuntime.jsx("div",{className:"space-y-2",children:p.map(c=>jsxRuntime.jsx(br,{isSelected:c.visible!==false,onChange:()=>i?.(c.id),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[c.legend&&jsxRuntime.jsx(lg,{type:c.legend.swatch,color:c.legend.color}),jsxRuntime.jsx("span",{className:"text-sm text-text-body",children:c.legend?.label})]})},c.id))})]})]})})})]})})})}function ol({position:e="top-right",className:t,style:r,onToggle:o,isActive:n=false}){return jsxRuntime.jsx(Qe,{position:e,className:t,style:r,children:jsxRuntime.jsx(Ve,{icon:"ListDashes",onPress:o,isActive:n,ariaLabel:n?"Hide list view":"Show list view"})})}var dg={sm:"gap-2",md:"gap-4",lg:"gap-6"};function wo({position:e="top-right",className:t,style:r,children:o,orientation:n="vertical",spacing:a="md"}){return jsxRuntime.jsx(Qe,{position:e,style:r,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex",n==="vertical"?"flex-col":"flex-row",dg[a],t),children:o})})}function al({mapRef:e,position:t="bottom-right",className:r,style:o,showCompass:n=true,showGeolocate:a=true,showResetZoom:i=false,onResetZoom:l,onCompassClick:s,onGeolocateClick:d}){let[p,c]=lt.useState(false),u=()=>{s?s():e.current&&e.current.easeTo({bearing:0,duration:500});},m=()=>{if(d)d();else {if(!navigator.geolocation){console.warn("Geolocation is not supported by this browser.");return}c(true),navigator.geolocation.getCurrentPosition(y=>{let{latitude:S,longitude:F}=y.coords;e.current&&e.current.flyTo({center:[F,S],zoom:15,duration:2e3}),c(false);},y=>{switch(console.warn("Error getting location:",y),y.code){case y.PERMISSION_DENIED:console.warn("Location access denied. Please enable location services in your browser settings.");break;case y.POSITION_UNAVAILABLE:console.warn("Location information unavailable.");break;case y.TIMEOUT:console.warn("Location request timed out.");break;default:console.warn("Unknown location error occurred.");break}c(false);},{enableHighAccuracy:true,timeout:1e4,maximumAge:3e5});}};if(!n&&!a&&!i)return null;let b=!i&&n,f=!i&&!n&&a,x=!a&&n;return jsxRuntime.jsxs(wo,{position:t,className:r,style:o,spacing:"sm",children:[i&&jsxRuntime.jsx(Ve,{icon:"ArrowsOut",onPress:l,ariaLabel:"Reset zoom to show all points",className:tailwindMerge.twMerge(!(!a&&!n&&i)&&"rounded-b-none",n&&"border-b-0 lg:border-b")}),n&&jsxRuntime.jsx("div",{className:"block lg:hidden",children:jsxRuntime.jsx(Ve,{icon:"Compass",onPress:u,ariaLabel:"Reset map orientation",className:tailwindMerge.twMerge(!b&&"rounded-t-none border-t-0",!x&&"rounded-b-none border-b-0")})}),a&&jsxRuntime.jsx(Ve,{icon:p?"Spinner":"NavigationArrow",onPress:m,isDisabled:p,ariaLabel:"Go to my location",iconClassName:tailwindMerge.twMerge("text-text-primary",p&&"animate-spin"),className:tailwindMerge.twMerge(!f&&"rounded-t-none border-t-0",!f&&n&&"lg:rounded-t lg:border-t")})]})}function cl({position:e="top-left",className:t,style:r,onSearch:o,placeholder:n="Search places...",showSearchInput:a=true}){let[i,l]=lt.useState(false),[s,d]=lt.useState(""),p=()=>{a?l(!i):o&&o("");},c=m=>{m.preventDefault(),o&&s.trim()&&(o(s.trim()),l(false));},u=m=>{m.key==="Escape"&&l(false);};return jsxRuntime.jsx(Qe,{position:e,className:t,style:r,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Ve,{icon:"MagnifyingGlass",onPress:p,ariaLabel:"Search"}),i&&a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute top-12 left-0 min-w-64","bg-background-surface border border-border rounded-lg shadow-xl p-3"),children:jsxRuntime.jsx("form",{onSubmit:c,children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"text",value:s,onChange:m=>d(m.target.value),onKeyDown:u,placeholder:n,className:tailwindMerge.twMerge("flex-1 px-3 py-2 text-sm rounded border","bg-background border-border text-text-primary placeholder-text-muted","focus:outline-none focus:ring-2 focus:ring-action-primary"),autoFocus:true}),jsxRuntime.jsx(H,{type:"submit",variant:"primary",size:"sm",className:"px-3 py-2",children:"Search"})]})})})]})})}var mg={navigation:"bottom-right",layers:"bottom-left",search:"top-left",list:"top-right",custom:"top-right"};function sa(e){return e.position??mg[e.type]}function dl(e,t,r){let o=sa(e),n=e.id??`${e.type}-${t}`;switch(e.type){case "navigation":{let a=e.showResetZoom&&r.showResetButton;return jsxRuntime.jsx(al,{mapRef:r.mapRef,position:o,showCompass:e.showCompass,showGeolocate:e.showGeolocate,showResetZoom:a,onResetZoom:e.onResetZoom,onCompassClick:e.onCompassClick,onGeolocateClick:e.onGeolocateClick,style:e.style,className:e.className},n)}case "layers":return jsxRuntime.jsx(tl,{position:o,currentMapType:e.currentMapType,onMapTypeChange:e.onMapTypeChange,layers:e.layers??r.layers,onLayerToggle:e.onLayerToggle,style:e.style,className:e.className},n);case "search":return jsxRuntime.jsx(cl,{position:o,onSearch:e.onSearch,placeholder:e.placeholder,showSearchInput:e.showSearchInput,style:e.style,className:e.className},n);case "list":return jsxRuntime.jsx(ol,{position:o,onToggle:e.onToggle,isActive:e.isActive,style:e.style,className:e.className},n);case "custom":return jsxRuntime.jsx("div",{children:e.render(r)},n);default:return null}}function la(e,t){let r=e.reduce((n,a,i)=>{let l=sa(a);return n[l]||(n[l]=[]),n[l].push({control:a,index:i}),n},{}),o=[];for(let[n,a]of Object.entries(r)){if(a.length===1){o.push(dl(a[0].control,a[0].index,t));continue}o.push(jsxRuntime.jsx(wo,{position:n,spacing:"sm",children:a.map(({control:i,index:l})=>dl(i,l,t))},`group-${n}`));}return o}function To(){if(typeof process<"u"){if(process.env?.MAPBOX_ACCESS_TOKEN)return process.env.MAPBOX_ACCESS_TOKEN;if(process.env?.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN)return process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN}if(typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) })<"u"){let e=({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) });if(e.env?.VITE_MAPBOX_ACCESS_TOKEN)return e.env.VITE_MAPBOX_ACCESS_TOKEN}throw new Error("Mapbox access token not found. Set MAPBOX_ACCESS_TOKEN, NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN, or VITE_MAPBOX_ACCESS_TOKEN in your environment.")}var ca={vector:e=>({kind:"vector",...e}),geojson:e=>({kind:"geojson",...e}),customPins:e=>({kind:"customPins",...e}),raster:e=>({kind:"raster",...e})};function da(e){return e.kind==="vector"}function ua(e){return e.kind==="geojson"}function pa(e){return e.kind==="customPins"}function ma(e){return e.kind==="raster"}function kr(e){let t=[...e].sort((r,o)=>(r.z??0)-(o.z??0));return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(r=>{if(!r.visible&&r.visible!==void 0)return null;switch(r.kind){case "vector":return jsxRuntime.jsx(gg,{spec:r},r.id);case "geojson":return jsxRuntime.jsx(bg,{spec:r},r.id);case "customPins":return jsxRuntime.jsx(xg,{spec:r},r.id);case "raster":return jsxRuntime.jsx(hg,{spec:r},r.id);default:return console.warn("[Layers] Unknown layer kind:",r.kind),null}})})}function gg({spec:e}){let{colorMode:t}=Re(),r=lt.useMemo(()=>ml(e.style,e.renderAs),[e.style,e.renderAs,t]),o=lt.useMemo(()=>({visibility:e.visible===false?"none":"visible"}),[e.visible]),n={id:e.id,type:pl(e.renderAs),"source-layer":e.sourceLayer,paint:r,layout:o};return e.filter!==void 0&&(n.filter=e.filter),e.minZoom!==void 0&&(n.minzoom=e.minZoom),e.maxZoom!==void 0&&(n.maxzoom=e.maxZoom),jsxRuntime.jsx(Cg.Source,{id:`${e.id}-source`,type:"vector",url:e.tileset,children:jsxRuntime.jsx(Cg.Layer,{...n})})}function bg({spec:e}){let{colorMode:t}=Re(),r=lt.useMemo(()=>ml(e.style,e.renderAs),[e.style,e.renderAs,t]),o=lt.useMemo(()=>({visibility:e.visible===false?"none":"visible"}),[e.visible]),n=lt.useMemo(()=>(typeof e.data=="string",e.data),[e.data]),a={id:`${e.id}-source`,type:"geojson",data:n};e.cluster?.enabled&&(a.cluster=true,a.clusterRadius=e.cluster.radius??50,a.clusterMaxZoom=e.cluster.maxZoom??14);let i={id:e.id,type:pl(e.renderAs),paint:r,layout:o};return e.minZoom!==void 0&&(i.minzoom=e.minZoom),e.maxZoom!==void 0&&(i.maxzoom=e.maxZoom),jsxRuntime.jsx(Cg.Source,{...a,children:jsxRuntime.jsx(Cg.Layer,{...i})})}function xg({spec:e}){let t=e.pin;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.data.map((r,o)=>{let[n,a]=e.getPosition(r),i=e.pinProps?e.pinProps(r):{};return jsxRuntime.jsx(Cg.Marker,{longitude:n,latitude:a,anchor:"bottom",children:jsxRuntime.jsx(t,{...i})},`${e.id}-${o}`)})})}function hg({spec:e}){let t=lt.useMemo(()=>{if(!e.style)return {};let n={};return e.style.opacity!==void 0&&(n["raster-opacity"]=e.style.opacity),e.style.brightnessMin!==void 0&&(n["raster-brightness-min"]=e.style.brightnessMin),e.style.brightnessMax!==void 0&&(n["raster-brightness-max"]=e.style.brightnessMax),e.style.contrast!==void 0&&(n["raster-contrast"]=e.style.contrast),e.style.saturation!==void 0&&(n["raster-saturation"]=e.style.saturation),e.style.hueRotate!==void 0&&(n["raster-hue-rotate"]=e.style.hueRotate),e.style.fadeDuration!==void 0&&(n["raster-fade-duration"]=e.style.fadeDuration),n},[e.style]),r={id:`${e.id}-source`,type:"raster",tiles:[e.tileset]};e.tileSize&&(r.tileSize=e.tileSize);let o={id:e.id,type:"raster",paint:t};return e.minZoom!==void 0&&(o.minzoom=e.minZoom),e.maxZoom!==void 0&&(o.maxzoom=e.maxZoom),jsxRuntime.jsx(Cg.Source,{...r,children:jsxRuntime.jsx(Cg.Layer,{...o})})}function pl(e){switch(e){case "line":return "line";case "fill":return "fill";case "circle":return "circle";case "symbol":return "symbol";case "heatmap":return "heatmap";default:return "circle"}}function ml(e,t,r){if(!e)return {};let o={};if(e.color){let n=Pr(e.color);switch(t){case "line":o["line-color"]=n;break;case "fill":o["fill-color"]=n;break;case "circle":o["circle-color"]=n;break}}if(e.width&&t==="line"&&(o["line-width"]=ul(e.width)),e.radius&&t==="circle"&&(o["circle-radius"]=ul(e.radius)),e.opacity!==void 0)switch(t){case "line":o["line-opacity"]=e.opacity;break;case "fill":o["fill-opacity"]=e.opacity;break;case "circle":o["circle-opacity"]=e.opacity;break}return e.fillOpacity!==void 0&&t==="fill"&&(o["fill-opacity"]=e.fillOpacity),t==="fill"&&e.borderWidth&&(o["fill-outline-color"]=e.borderColor?Pr(e.borderColor):Pr(e.color||"#000")),t==="circle"&&e.borderWidth&&(o["circle-stroke-width"]=e.borderWidth,o["circle-stroke-color"]=e.borderColor?Pr(e.borderColor):"#fff"),o}function yg(e,t){let r=e.by,o=e.mapping,n=["match",["get",r]];for(let[a,i]of Object.entries(o))n.push(a),n.push(Pr(i));return n.push("#666"),n}function Pr(e,t){return typeof e=="string"?e:"token"in e?ct(e.token)||e.token:"hex"in e?e.hex:"by"in e?yg(e):"#666"}function ul(e){return typeof e=="number"?e:"byZoom"in e?["interpolate",["linear"],["zoom"],...e.byZoom.flatMap(([t,r])=>[t,r])]:e}var gl={streets:"streets",satellite:"satellite",neutral:"neutral"};function Tr(e,t){switch(e){case "streets":return t?"mapbox://styles/victor-texture/clzwxtrng005s01p93rtr04op":"mapbox://styles/mapbox/streets-v12";case "satellite":return "mapbox://styles/mapbox/satellite-streets-v12";case "neutral":return t?"mapbox://styles/mapbox/dark-v11":"mapbox://styles/mapbox/light-v11";default:return t?"mapbox://styles/victor-texture/clzwxtrng005s01p93rtr04op":"mapbox://styles/mapbox/streets-v12"}}function hl({initialViewState:e,viewState:t,onViewStateChange:r,scrollEnabled:o=true,className:n,previewMode:a=false,previewModeCta:i,onPreviewModePress:l,mapType:s="streets",layers:d=[],mapboxAccessToken:p=To(),transformRequest:c,isLoading:u=false,controls:m="default"}){let{isDarkTheme:b}=Re(),f=lt.useRef(null),x=lt.useRef(null),[h,y]=lt.useState(null),S=lt.useMemo(()=>m===false||m===null?[]:m==="default"||m===void 0?ia:m,[m]),F=lt.useMemo(()=>a?null:la(S,{mapRef:f,layers:d}),[S,f,a,d]),w=lt.useMemo(()=>d.filter(g=>g.events?.onClick||g.events?.onMouseEnter||g.events?.onMouseLeave||g.tooltip).map(g=>g.id),[d]),T=lt.useMemo(()=>{let g=new Map;return d.forEach(N=>{N.events&&g.set(N.id,N.events);}),g},[d]),L=lt.useMemo(()=>{let g=new Map;return d.forEach(N=>{N.tooltip&&g.set(N.id,N.tooltip);}),g},[d]),C=lt.useCallback(g=>{if(a)return;let N=g.features?.[0];if(!N||!N.layer)return;let K=N.layer.id,B=T.get(K),U=L.get(K),re;N.geometry.type==="Point"?re=N.geometry.coordinates:re=[g.lngLat.lng,g.lngLat.lat];let ne={id:N.id,lngLat:re,properties:N.properties||{},layerId:K};if(B?.onClick&&B.onClick(ne),U&&U.trigger==="click"){let E=typeof U.content=="function"?U.content(ne):U.content;y({feature:ne,content:E});}},[T,L,a]),k=lt.useCallback(g=>{if(a)return;let N=g.features?.[0];if(!N||!N.layer)return;let K=N.layer.id,B=T.get(K),U=L.get(K),re;N.geometry.type==="Point"?re=N.geometry.coordinates:re=[g.lngLat.lng,g.lngLat.lat];let ne={id:N.id,lngLat:re,properties:N.properties||{},layerId:K};if(B?.onMouseEnter&&B.onMouseEnter(ne),U&&U.trigger==="hover"){let E=typeof U.content=="function"?U.content(ne):U.content;y({feature:ne,content:E});}f.current&&(f.current.getCanvas().style.cursor="pointer");},[T,L,a,f]),I=lt.useCallback(()=>{a||(T.forEach(g=>{g.onMouseLeave?.();}),h&&d.find(N=>N.id===h.feature.layerId)?.tooltip?.trigger==="hover"&&y(null),f.current&&(f.current.getCanvas().style.cursor=""));},[T,a,f,h,d]),A=(g,N)=>c?c(g,N):{url:g};return u?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative flex h-full w-full overflow-hidden",n),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg",style:{backgroundColor:"var(--color-skeleton-base)"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom right, var(--color-skeleton-base), var(--color-skeleton-highlight))"}}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-pulse rounded-full",style:{backgroundColor:"var(--color-skeleton-base)"}}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-16 animate-pulse rounded",style:{backgroundColor:"var(--color-skeleton-base)"}}),jsxRuntime.jsx("div",{className:"h-2 w-12 animate-pulse rounded",style:{backgroundColor:"var(--color-skeleton-highlight)"}})]})]})}),jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20",children:jsxRuntime.jsx("div",{className:"h-full w-full",style:{backgroundImage:`
|
|
78
78
|
linear-gradient(rgba(0,0,0,0.15) 1px, transparent 1px),
|
|
79
79
|
linear-gradient(90deg, rgba(0,0,0,0.15) 1px, transparent 1px)
|
|
80
|
-
`,backgroundSize:"30px 30px"}})})]})}):jsxRuntime.jsxs("div",{ref:st,className:tailwindMerge.twMerge("relative flex h-full w-full overflow-hidden",c&&"cursor-pointer",i),onClick:c?d:void 0,children:[jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsxs(Lg__default.default,{ref:Ze,initialViewState:Ic,style:{width:"100%",height:"100%"},mapStyle:aa(ie,$),mapboxAccessToken:b,transformRequest:zc,onMove:c?void 0:H=>Dc(H.viewState),onClick:c?void 0:Vc,interactiveLayerIds:c?[]:g?["mvt-points","mvt-clusters"]:["unclustered-points","clusters"],onMouseEnter:c?void 0:Bc,onMouseLeave:c?void 0:$c,scrollZoom:c?false:l,dragPan:!c,dragRotate:!c,doubleClickZoom:!c,interactive:!c,children:[!c&&S.search&&jsxRuntime.jsx(Xi,{position:"top-left",onSearch:R,placeholder:T,style:M?.search}),!c&&S.list&&jsxRuntime.jsx(Wi,{position:"top-right",items:P,onToggle:L,style:M?.list}),!c&&S.navigation&&jsxRuntime.jsx(Ui,{mapRef:Ze,position:"bottom-right",showCompass:true,showGeolocate:true,style:{bottom:"16px",right:"16px",...M?.navigation}}),!c&&Ec&&S.resetZoom&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute right-4 z-10",S.navigation?"bottom-[108px] sm:bottom-[72px] lg:bottom-[64px]":"bottom-4"),children:jsxRuntime.jsx(A,{className:tailwindMerge.twMerge("h-10 w-10 p-0","bg-background-surface hover:bg-background-hover shadow-lg border border-border"),onPress:Ac,variant:"secondary",size:"sm",children:jsxRuntime.jsx(x,{name:"ArrowsOut",size:20,className:"text-text-primary"})})}),!c&&S.layers&&jsxRuntime.jsx(Gi,{position:"bottom-left",layers:C,showLayersPanel:C.length>0,currentTheme:ie,onThemeChange:v,isoRtoVisible:Sa,onIsoRtoToggle:kc,vermontSubstationsVisible:Na,onVermontSubstationsToggle:Rc,transformersVisible:wa,onTransformersToggle:Fc,feedersVisible:Pa,onFeedersToggle:Lc,spansVisible:Ta,onSpansToggle:Mc,style:M?.layers}),g&&u?jsxRuntime.jsx(Lg.Source,{id:"mvt-locations",type:"vector",tiles:[pl(u,oa(m))],minzoom:0,maxzoom:22,children:ka.map(H=>jsxRuntime.jsx(Lg.Layer,{...H},H.id))},pl(u,oa(m))):Ra&&jsxRuntime.jsx(Lg.Source,{id:"locations",type:"geojson",data:Ra,cluster:true,clusterMaxZoom:14,clusterRadius:50,children:ka.map(H=>jsxRuntime.jsx(Lg.Layer,{...H},H.id))}),Sa&&jsxRuntime.jsxs(Lg.Source,{id:"iso-rto-regions",type:"vector",url:"mapbox://victor-texture.06v0fhln",children:[jsxRuntime.jsx(Lg.Layer,{id:"iso-rto-regions-fill",type:"fill","source-layer":"validISOGeoJson",paint:{"fill-color":["case",["==",["get","state"],"CA"],Q("--color-data-categorical-1","#a3eae4"),["==",["get","state"],"TX"],Q("--color-data-categorical-2","#91a0ff"),["==",["get","state"],"FL"],Q("--color-data-categorical-3","#ffd1a3"),["==",["get","state"],"NY"],Q("--color-data-categorical-4","#ffabc8"),["==",["get","state"],"IL"],Q("--color-data-categorical-5","#c1b8ff"),["==",["get","state"],"PA"],Q("--color-data-categorical-6","#e0ffb8"),["==",["get","state"],"OH"],Q("--color-data-categorical-1","#a3eae4"),["==",["get","state"],"GA"],Q("--color-data-categorical-2","#91a0ff"),["==",["get","state"],"NC"],Q("--color-data-categorical-3","#ffd1a3"),["==",["get","state"],"MI"],Q("--color-data-categorical-4","#ffabc8"),["==",["get","state"],"NJ"],Q("--color-data-categorical-5","#c1b8ff"),["==",["get","state"],"VA"],Q("--color-data-categorical-6","#e0ffb8"),["==",["get","state"],"WA"],Q("--color-data-categorical-1","#a3eae4"),["==",["get","state"],"AZ"],Q("--color-data-categorical-2","#91a0ff"),["==",["get","state"],"MA"],Q("--color-data-categorical-3","#ffd1a3"),["==",["get","state"],"TN"],Q("--color-data-categorical-4","#ffabc8"),["==",["get","state"],"IN"],Q("--color-data-categorical-5","#c1b8ff"),["==",["get","state"],"MO"],Q("--color-data-categorical-6","#e0ffb8"),Q("--color-data-default","#444ae1")],"fill-opacity":.7},layout:{visibility:"visible"}}),jsxRuntime.jsx(Lg.Layer,{id:"iso-rto-regions-outline",type:"line","source-layer":"validISOGeoJson",paint:{"line-color":"#ffffff","line-width":2},layout:{visibility:"visible"}})]}),wa&&jsxRuntime.jsx(Lg.Source,{id:"vermont-transformers",type:"vector",url:"mapbox://victor-texture.9w5xhwpr",children:jsxRuntime.jsx(Lg.Layer,{id:"vermont-transformers-circles",type:"circle","source-layer":"vermont_transformers-1t5l77",minzoom:O,paint:{"circle-color":["case",["has","voltage_level"],["match",["get","voltage_level"],"high","#16a34a","medium","#22c55e","low","#4ade80","#16a34a"],"#16a34a"],"circle-radius":["interpolate",["linear"],["zoom"],O,3,14,4,18,5],"circle-opacity":.8,"circle-stroke-color":"#ffffff","circle-stroke-width":1},layout:{visibility:"visible"}})}),Pa&&jsxRuntime.jsx(Lg.Source,{id:"vermont-feeders",type:"vector",url:"mapbox://victor-texture.0mmwweva",children:jsxRuntime.jsx(Lg.Layer,{id:"vermont-feeders-circles",type:"circle","source-layer":"vermont_feeders-cx4fbg",minzoom:K,paint:{"circle-color":["case",["has","voltage_level"],["match",["get","voltage_level"],"high","#dc2626","medium","#ea580c","low","#f97316","#dc2626"],"#dc2626"],"circle-radius":["interpolate",["linear"],["zoom"],K,5,14,6,18,7],"circle-opacity":.8,"circle-stroke-color":"#ffffff","circle-stroke-width":1},layout:{visibility:"visible"}})}),Ta&&jsxRuntime.jsx(Lg.Source,{id:"vermont-spans",type:"vector",url:"mapbox://victor-texture.8ztoxpib",children:jsxRuntime.jsx(Lg.Layer,{id:"vermont-spans-lines",type:"line","source-layer":"vermont_spans_lines-c2t1aa",minzoom:k,paint:{"line-color":["case",["has","voltage_level"],["match",["get","voltage_level"],"high","#7c3aed","medium","#a855f7","low","#c084fc","#7c3aed"],"#7c3aed"],"line-width":["interpolate",["linear"],["zoom"],k,1,14,2,18,3],"line-opacity":.8},layout:{"line-join":"round","line-cap":"round",visibility:"visible"}})}),Na&&jsxRuntime.jsx(Lg.Source,{id:"vermont-substations",type:"vector",url:"mapbox://victor-texture.5knxioeq",children:jsxRuntime.jsx(Lg.Layer,{id:"vermont-substations-circles",type:"circle","source-layer":"vermont_substations-0j4qve",minzoom:F,paint:{"circle-color":["case",["has","voltage_level"],["match",["get","voltage_level"],"high","#2563eb","medium","#3b82f6","low","#60a5fa","#2563eb"],"#2563eb"],"circle-radius":["interpolate",["linear"],["zoom"],F,8,12,10,16,12],"circle-opacity":.8,"circle-stroke-color":"#ffffff","circle-stroke-width":1},layout:{visibility:"visible"}})}),I&&jsxRuntime.jsx(Lg.Source,{id:I.id,type:"vector",url:I.url,children:I.layers?.map(H=>jsxRuntime.jsx(Lg.Layer,{id:H.id,type:H.type,"source-layer":I.sourceLayer,paint:H.paint,layout:H.layout},H.id))}),Bo&&jsxRuntime.jsx(Lg.Marker,{latitude:Bo[1],longitude:Bo[0],children:jsxRuntime.jsx(x,{name:"MapPin",className:"relative bottom-6 left-[5px]",size:Eg,color:"currentColor",weight:"fill"})})]},`map-${ie}`),c&&p&&jsxRuntime.jsx("div",{className:"absolute bottom-8 right-8 z-10",children:p})]}),!c&&jsxRuntime.jsx(Yi,{isOpen:!!n,onClose:a,children:s})]})}var ua={dark:"mapbox://styles/mapbox/dark-v11",light:"mapbox://styles/mapbox/light-v11",streets:"mapbox://styles/mapbox/streets-v12",satellite:"mapbox://styles/mapbox/satellite-streets-v12"};function gl({width:e="100%",height:t="100%",initialViewState:r={longitude:-122.4194,latitude:37.7749,zoom:14},isLoading:o=false,theme:n="streets",mapboxAccessToken:a,showMarker:s=true,className:l}){let i={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t};return o?jsxRuntime.jsx("div",{style:i,className:l,children:jsxRuntime.jsx(z,{width:i.width,height:i.height})}):a?jsxRuntime.jsx("div",{style:i,className:l,children:jsxRuntime.jsxs(Lg__default.default,{mapboxAccessToken:a,initialViewState:r,style:i,mapStyle:ua[n],scrollZoom:false,dragPan:false,dragRotate:false,doubleClickZoom:false,touchZoomRotate:false,attributionControl:false,interactive:false,children:[s&&jsxRuntime.jsx(Lg.Marker,{longitude:r.longitude,latitude:r.latitude,anchor:"bottom",children:jsxRuntime.jsx(x,{name:"MapPin",size:36,className:"text-action-primary",weight:"fill"})}),jsxRuntime.jsx(Lg.AttributionControl,{compact:true,position:"bottom-right"})]})}):jsxRuntime.jsx("div",{style:i,className:`flex items-center justify-center bg-background-muted text-text-muted ${l}`,children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(x,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}var zg={sm:{bar:"h-1.5 w-48",text:"text-xs",icon:"h-3 w-3"},md:{bar:"h-2 w-64",text:"text-sm",icon:"h-4 w-4"},lg:{bar:"h-3 w-80",text:"text-base",icon:"h-5 w-5"}};function bl({label:e,size:t="md",variant:r="default",showWarningIndicator:o=true,warningThreshold:n=80,className:a,...s}){let l=zg[t];return jsxRuntime.jsx(reactAriaComponents.Meter,{...s,className:j(a,"flex flex-col gap-1"),children:({percentage:i,valueText:c})=>{let p=o&&i>=n,d=r==="default"?Og(i):r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2",children:[e&&jsxRuntime.jsx(Y,{children:e}),jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(l.text,p?"text-feedback-error-text":"text-text-muted"),children:[p&&jsxRuntime.jsx(lucideReact.AlertTriangle,{"aria-label":"Warning: High value",className:tailwindMerge.twMerge("inline-block align-text-bottom mr-1",l.icon)}),c]})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative rounded-full bg-background-muted","ring-1 ring-inset ring-border-muted",l.bar),children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute left-0 top-0 h-full rounded-full transition-all duration-300","forced-colors:bg-[Highlight]",Hg(d)),style:{width:`${Math.min(100,Math.max(0,i))}%`},role:"presentation","aria-hidden":"true"})})]})}})}function Og(e){return e<50?"success":e<70?"info":e<90?"warning":"error"}function Hg(e){switch(e){case "success":return "bg-feedback-success-text";case "warning":return "bg-feedback-warning-text";case "error":return "bg-feedback-error-text";case "info":return "bg-feedback-info-text";default:return "bg-action-primary-background"}}var Yg={success:{container:"bg-feedback-success-background border-feedback-success-border text-feedback-success-text",icon:lucideReact.CheckCircle},error:{container:"bg-feedback-error-background border-feedback-error-border text-feedback-error-text",icon:lucideReact.XCircle},warning:{container:"bg-feedback-warning-background border-feedback-warning-border text-feedback-warning-text",icon:lucideReact.AlertCircle},info:{container:"bg-feedback-info-background border-feedback-info-border text-feedback-info-text",icon:lucideReact.Info}};function ko({id:e,message:t,variant:r="info",duration:o=5e3,dismissible:n=true,onDismiss:a,className:s}){let{container:l,icon:i}=Yg[r];return dt.useEffect(()=>{if(o>0){let c=setTimeout(()=>{a?.();},o);return ()=>clearTimeout(c)}},[o,a]),jsxRuntime.jsxs(framerMotion.motion.div,{layout:true,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.2}},className:tailwindMerge.twMerge("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg",l,s),children:[jsxRuntime.jsx(i,{className:"h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 text-sm font-medium",children:t}),n&&jsxRuntime.jsx("button",{onClick:a,className:"flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10","aria-label":"Dismiss notification",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var nb={"top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end"};function Ro({notices:e,onDismiss:t,position:r="top-right",className:o}){let[n,a]=dt.useState(false);if(dt.useEffect(()=>{a(true);},[]),!n)return null;let s=jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none fixed z-50 flex flex-col gap-2",nb[r],o),"aria-live":"polite","aria-atomic":"true",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(l=>jsxRuntime.jsx(ko,{id:l.id,message:l.message,variant:l.variant,duration:l.duration,dismissible:l.dismissible,onDismiss:()=>t(l.id)},l.id))})});return reactDom.createPortal(s,document.body)}var xl=dt.createContext(void 0);function hl({children:e,position:t="top-right",maxNotices:r=5,defaultDuration:o=5e3,defaultDismissible:n=true}){let[a,s]=dt.useState([]),l=dt.useCallback((d,u)=>{let m=`notice-${Date.now()}-${Math.random()}`,g={id:m,message:d,variant:u?.variant||"info",duration:u?.duration??o,dismissible:u?.dismissible??n};return s(f=>{let b=[...f,g];return b.length>r?b.slice(-r):b}),m},[r,o,n]),i=dt.useCallback(d=>{s(u=>u.filter(m=>m.id!==d));},[]),c=dt.useCallback(()=>{s([]);},[]),p={notices:a,addNotice:l,removeNotice:i,clearNotices:c};return jsxRuntime.jsxs(xl.Provider,{value:p,children:[e,jsxRuntime.jsx(Ro,{notices:a,onDismiss:i,position:t})]})}function yl(){let e=dt.useContext(xl);if(!e)throw new Error("useNoticeContext must be used within a NoticeProvider");return e}function vl(){let{addNotice:e,removeNotice:t,clearNotices:r}=yl(),o=dt.useCallback((i,c)=>e(i,c),[e]),n=dt.useCallback((i,c)=>e(i,{...c,variant:"success"}),[e]),a=dt.useCallback((i,c)=>e(i,{...c,variant:"error"}),[e]),s=dt.useCallback((i,c)=>e(i,{...c,variant:"warning"}),[e]),l=dt.useCallback((i,c)=>e(i,{...c,variant:"info"}),[e]);return {show:o,success:n,error:a,warning:s,info:l,dismiss:t,clear:r}}var gb=e=>tailwindMerge.twMerge(Bt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),e.transparent?"bg-transparent":"bg-background-input","pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className);function Sl({label:e,description:t,errorMessage:r,size:o,tooltip:n,isRequired:a,transparent:s,validationResult:l,...i}){let c=dt.useId();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...i,id:c,isRequired:a,className:j(i.className,"group flex flex-col gap-1"),step:i.step??1,onChange:p=>{typeof p=="number"&&(i.maxValue!=null&&p>i.maxValue?i.onChange?.(i.maxValue):i.minValue!=null&&p<i.minValue?i.onChange?.(i.minValue):i.onChange?.(p));},isInvalid:!!r||typeof i.value=="number"&&(i.maxValue!=null&&i.value>i.maxValue||i.minValue!=null&&i.value<i.minValue),children:({isDisabled:p,isInvalid:d})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,htmlFor:c,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:gb({isInvalid:d||!!r,isDisabled:p,transparent:s,className:typeof i.className=="string"?i.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[1px] right-[1px] flex flex-col divide-y border-l overflow-hidden rounded-r-[calc(var(--control-border-radius)-1px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(x,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(x,{name:"CaretDown",size:14})})]})]})}),t&&jsxRuntime.jsx(te,{size:o,className:"mt-3",children:t}),r&&jsxRuntime.jsx(q,{size:o,className:"mt-3",children:typeof r=="function"?r(l):r})]})})}var Fo=dt__namespace.createContext({variant:"default"});function vb({orientation:e,className:t=""}){return `flex flex-col w-full ${{horizontal:"",vertical:"flex-row"}[e]||""} ${t}`.trim()}function Mo({variant:e="default",...t}){return jsxRuntime.jsx(Fo.Provider,{value:{variant:e},children:jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(reactAriaComponents.Tabs,{...t,className:reactAriaComponents.composeRenderProps(t.className,(r,o)=>vb({...o,className:r}))})})})}function Cb({orientation:e,className:t=""}){return `flex gap-10 relative after:absolute after:bottom-0 after:left-0 after:right-0 after:h-[2px] after:bg-border-muted ${{horizontal:"flex-row w-full",vertical:"flex-col items-start"}[e]||""} ${t}`.trim()}function Io({variant:e,...t}){let r=dt__namespace.useContext(Fo),o=e??r.variant;return jsxRuntime.jsx(Fo.Provider,{value:{variant:o},children:jsxRuntime.jsx(reactAriaComponents.TabList,{...t,className:reactAriaComponents.composeRenderProps(t.className,(n,a)=>Cb({...a,className:n||""}))})})}function Sb({isSelected:e,isDisabled:t,variant:r,className:o=""}){let n="flex items-center cursor-default px-1 py-2 font-medium transition-all hover:cursor-pointer relative",a=de(),s="";return t?s="text-text-disabled forced-colors:text-[GrayText] cursor-not-allowed":e?r==="accent"?s="text-action-primary border-b-2 border-action-primary z-10 forced-colors:bg-[Highlight]":s="text-text-heading border-b-2 border-text-heading z-10 forced-colors:bg-[Highlight]":s="text-text-placeholder hover:text-text-muted",`${n} ${a} ${s} ${o}`.trim()}function Eo(e){let{variant:t}=dt__namespace.useContext(Fo);return jsxRuntime.jsx(reactAriaComponents.Tab,{...e,"data-testid":e.id?`tab-${e.id}`:void 0,className:reactAriaComponents.composeRenderProps(e.className,(r,o)=>Sb({...o,className:r,isSelected:o.isSelected,variant:t}))})}function Nb({className:e=""}){let t="block w-full mt-4 text-text-body",r=de();return `${t} ${r} ${e}`.trim()}function Nl(e){return jsxRuntime.jsx(reactAriaComponents.TabPanel,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>Nb({...r,className:t||""}))})}function ot({children:e,maxWidth:t=1400,paddingXClass:r="px-4 md:px-6",paddingYClass:o="py-4 md:py-6",className:n}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(`w-full ${r} ${o}`,n),style:{marginInline:"auto",maxWidth:t},children:e})}function wl({title:e,subtitle:t,breadcrumbs:r,breadcrumbsNode:o,meta:n,headingAs:a,className:s}){return jsxRuntime.jsxs("header",{className:tailwindMerge.twMerge("mb-4 md:mb-6",s),"aria-labelledby":"page-title",children:[o?jsxRuntime.jsx("div",{className:"mb-2",children:o}):r?.length?jsxRuntime.jsx("div",{className:"mb-2",children:jsxRuntime.jsx(qr,{children:r.map((l,i)=>jsxRuntime.jsx(Yr,{...l.href?{href:l.href}:{},children:l.label},`${l.label}-${i}`))})}):null,jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("div",{id:"page-title",children:jsxRuntime.jsx(Ee,{tag:a||"h1",size:"xl",children:e})}),t?jsxRuntime.jsx("p",{className:"mt-1 text-text-muted",children:t}):null]}),n?jsxRuntime.jsx("div",{className:"shrink-0",children:n}):null]})]})}function Pl({primary:e,secondary:t,children:r,align:o="end",className:n}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(`mb-3 md:mb-4 flex items-center gap-2 ${o==="end"?"justify-end":"justify-start"}`,n),children:[r,jsxRuntime.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t,e]})]})}function Tl({children:e,className:t,ariaLabel:r="Filters"}){return jsxRuntime.jsx("section",{"aria-label":r,className:tailwindMerge.twMerge("mb-4 md:mb-6 flex flex-wrap items-center gap-2",t),children:e})}function kl({tabs:e,value:t,defaultValue:r,onChange:o,className:n,children:a}){let s=l=>{o?.(l);};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("mb-3 md:mb-4",n),children:jsxRuntime.jsxs(Mo,{selectedKey:t,defaultSelectedKey:r||e[0]?.id,onSelectionChange:s,children:[jsxRuntime.jsx(Io,{children:e.map(l=>jsxRuntime.jsx(Eo,{id:l.id,isDisabled:l.disabled,children:l.label},l.id))}),a]})})}function Rl({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full",t),children:e})}function Fl({children:e,sticky:t=true,className:r}){return jsxRuntime.jsx("aside",{className:tailwindMerge.twMerge(t?"lg:sticky lg:top-20":"",r),children:e})}ot.Header=wl;ot.Actions=Pl;ot.Filters=Tl;ot.Tabs=kl;ot.Content=Rl;ot.Aside=Fl;function wb(e){return typeof e=="object"&&e!==null&&"features"in e&&Array.isArray(e.features)&&"type"in e&&typeof e.type=="string"}var Pb=process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN||"";function Il({label:e="Search for a place",selectedKey:t,defaultSelectedKey:r,onSelectionChange:o,placeholder:n="Enter a location...",errorMessage:a,description:s,size:l="md",tooltip:i,isRequired:c,isDisabled:p,showErrors:d=true,autoFocus:u=false,onSelect:m,searchTypes:g=["place","address"],defaultFilter:f,validationResult:b,countryRestrictions:h,proximity:w="ip"}){let S=dt.useRef(new WeakMap),C=dt.useRef([]),P={requestType:"REST",method:"GET",url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{q}.json",extraParams:{access_token:Pb,types:g.join(","),limit:"5",...h?.length?{country:h.join(",").toLowerCase()}:{},...w?{proximity:w==="ip"?"ip":w.join(",")}:{}},shouldLoad:v=>v.length>0,transformResponse:v=>{if(!wb(v))return [];let D=v.features.map(B=>{let _={id:B.id,name:B.place_name};return S.current.set(_,{type:B.place_type[0],center:B.center}),_});return D.length>0&&(C.current=D),D}},R=v=>{let D=S.current.get(v),B=v.name.split(", "),_=B[0],y=B.slice(1).join(", ");return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 py-0.5",children:[jsxRuntime.jsx(x,{name:D?.type==="address"?"MapPin":D?.type==="place"?"Buildings":D?.type==="region"?"MapPinArea":D?.type==="country"?"Flag":"Circle",className:"h-5 w-5 flex-shrink-0 text-text-muted"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:"truncate font-medium text-text-body",children:_}),y&&jsxRuntime.jsx("span",{className:"truncate text-sm text-text-muted",children:y})]})]})},L=v=>v?jsxRuntime.jsx(x,{name:"CircleNotch",className:"h-4 w-4 animate-spin text-text-muted"}):jsxRuntime.jsx(x,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"});return jsxRuntime.jsx(Xr,{"data-testid":"autocomplete","data-config":JSON.stringify({types:g.join(","),country:h?.join(",").toLowerCase(),proximity:w==="ip"?"ip":w?.join(",")}),label:e,selectedKey:t,defaultSelectedKey:r,onSelectionChange:v=>{if(o?.(v),v){let B=C.current.find(_=>_.id===v);if(B){let _=S.current.get(B);_&&m({id:B.id,place_name:B.name,place_type:[_.type],center:_.center});}}},requestConfig:P,placeholder:n,errorMessage:a,description:s,size:l,tooltip:i,isRequired:c,isDisabled:p,showErrors:d,autoFocus:u,renderItem:R,renderLeftIcon:L,defaultFilter:f,validationResult:b})}function Dl({label:e,rightLabel:t,progressWidth:r=64,hideLabels:o=false,...n}){return jsxRuntime.jsx(reactAriaComponents.ProgressBar,{...n,className:j(n.className,"flex flex-col gap-1"),children:({percentage:a,valueText:s,isIndeterminate:l})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!o&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:e}),jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:t||s})]}),jsxRuntime.jsx("div",{className:`relative h-2 w-${r} overflow-hidden rounded-full bg-background-muted outline-none`,children:jsxRuntime.jsx("div",{className:`absolute top-0 h-full rounded-full bg-blue-600 dark:bg-blue-500 forced-colors:bg-[Highlight] ${l?"left-full duration-1000 ease-out animate-in slide-out-to-right-full repeat-infinite [--tw-enter-translate-x:calc(-16rem-100%)]":"left-0"}`,style:{width:(l?40:a)+"%"}})})]})})}function Al(e){return jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...e,className:j(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(Y,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(te,{children:e.description}),jsxRuntime.jsx(q,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})}function Lb({isSelected:e,isInvalid:t,isDisabled:r}){let o=[de(),"w-5 h-5 rounded-full border-2 bg-background-surface transition-all"];return r?o.push("border-border-muted forced-colors:!border-[GrayText]"):t?o.push("border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]"):e?o.push("border-[7px] border-action-primary forced-colors:!border-[Highlight] group-pressed:border-action-primary-hover dark:group-pressed:border-action-primary-hover"):o.push("border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus"),o.join(" ")}function Vl(e){return jsxRuntime.jsx(reactAriaComponents.Radio,{...e,className:j(e.className,"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]"),children:t=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Lb(t)}),e.children]})})}var Ab=e=>{let t=Ge({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,r,e.className)};function Do({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:s,showSearchIcon:l,isClearable:i,onClear:c,type:p,validationResult:d,...u}){let[m,g]=dt__namespace.default.useState(false),{isFocused:f,handleFocus:b,handleBlur:h}=qe(),w=p==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...u,isRequired:a,className:j(u.className,"group flex flex-col"),children:({isDisabled:S,isInvalid:C})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsxs(Ye,{children:[l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform",children:jsxRuntime.jsx(x,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(ks,{size:o,disabled:S,type:w?m?"text":"password":p,value:u.value,defaultValue:u.defaultValue,placeholder:u.placeholder,onFocus:P=>b(P,u.onFocus),onBlur:P=>h(P,u.onBlur),onChange:P=>u.onChange?.(P.target.value),className:Ab({isInvalid:C,isDisabled:S,isFocused:f,size:o,transparent:s,showSearchIcon:l,isClearable:i,hasValue:!!u.value,isPassword:w,className:typeof u.className=="string"?u.className:void 0})}),i&&u.value&&!S&&jsxRuntime.jsx(Ts,{onClick:()=>{c?c():u.onChange&&u.onChange("");},size:o}),w&&!S&&jsxRuntime.jsx("button",{type:"button",onClick:()=>g(!m),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":m?"Hide password":"Show password",onMouseDown:P=>{P.preventDefault(),P.stopPropagation();},children:jsxRuntime.jsx(x,{name:m?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-body"})})]}),t&&jsxRuntime.jsx(te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&d&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(d)})]})})}var Rt=({isActive:e=false,onPress:t,children:r})=>jsxRuntime.jsx(A,{variant:e?"secondary":"ghost",size:"sm",onPress:t,className:"p-1",children:r});function Wb({initialUrl:e,isOpen:t,onClose:r,onSubmit:o}){let[n,a]=dt.useState(e);return dt__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,isOpen:t,onOpenChange:l=>!l&&r(),children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative",children:jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),o(n),r();},children:[jsxRuntime.jsx(Yt,{title:"Insert Link",onClose:r}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Do,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(A,{variant:"secondary",onPress:r,children:"Cancel"}),jsxRuntime.jsx(A,{type:"submit",children:"Save"})]})]})})})}function Ol({initialContent:e="",onChange:t,className:r,isDisabled:o=false,placeholder:n="Start typing..."}){let[a,s]=dt.useState(false),l=react.useEditor({extensions:[Ob__default.default.configure({heading:{levels:[1,2]}}),Vb__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!o,onUpdate:({editor:p})=>{t?.(p.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge("prose prose-sm max-w-none","focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),i=()=>{s(true);},c=p=>{p===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:p}).run();};return l?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input",o&&"opacity-50",r),children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:p})=>p.isActive("link")&&!a,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(A,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let p=l.getAttributes("link").href;window.open(p,"_blank");},children:[jsxRuntime.jsx(x,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(A,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:i,children:[jsxRuntime.jsx(x,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(A,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(x,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(Wb,{isOpen:a,onClose:()=>s(false),onSubmit:c,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 border-b border-border-input p-2",children:[jsxRuntime.jsx(Rt,{isActive:l.isActive("heading",{level:1}),onPress:()=>l.chain().focus().toggleHeading({level:1}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H1"})}),jsxRuntime.jsx(Rt,{isActive:l.isActive("heading",{level:2}),onPress:()=>l.chain().focus().toggleHeading({level:2}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H2"})}),jsxRuntime.jsx(Rt,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(Rt,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Rt,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(x,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(Rt,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(x,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Rt,{isActive:l.isActive("link"),onPress:i,children:jsxRuntime.jsx(x,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full",children:[jsxRuntime.jsx(react.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full p-4","[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none","[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold","[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold","[&_.ProseMirror_p]:mb-2","[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal","[&_.ProseMirror_li]:mb-1","[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",o&&"pointer-events-none")}),l.isEmpty&&!o&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-4 top-4 text-text-muted",children:n})]})]}):null}var Zb={plain:"",contained:"bg-background-surface rounded-lg border border-border-default p-6",bordered:"border-y border-border-default py-6"},Xb={none:"",sm:"my-4",md:"my-6 md:my-8",lg:"my-8 md:my-12"};function Gl({title:e,description:t,actions:r,variant:o="plain",spacing:n="md",withDivider:a=false,headingAs:s="h2",className:l,children:i}){let c=dt__namespace.default.useId(),p=e||t||r;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge(Xb[n],Zb[o],l),"aria-labelledby":e?c:void 0,children:[p&&jsxRuntime.jsxs("header",{id:c,className:tailwindMerge.twMerge("flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",a&&"border-b border-border-default pb-4 mb-6",!a&&i&&"mb-4"),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx(Ee,{tag:s,size:"md",className:"text-text-heading",children:e}),t&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]}),i&&jsxRuntime.jsx("div",{className:"",children:i})]})}var qb={sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base",xl:"h-14 text-lg"},Yb={sm:14,md:16,lg:18,xl:20},Jb=({isSelected:e,isFirst:t,isLast:r,isDisabled:o})=>tailwindMerge.twMerge(de(),"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-selected text-text-body font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-muted hover:bg-background-hover pressed:bg-background-selected forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed");function Ul({options:e,value:t,onChange:r,size:o="md",className:n,isDisabled:a,"aria-label":s}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-md border-2 border-border-muted",qb[o],n),role:"group","aria-label":s,children:e.map((l,i)=>jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>r(l.id),className:Jb({isSelected:t===l.id,isFirst:i===0,isLast:i===e.length-1,isDisabled:a}),isDisabled:a,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(x,{name:l.icon,size:Yb[o]}),l.label]},l.id))})}function ox(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder ${Z[e].text}`}function nx(){let e=dt__namespace.default.useCallback((r,o)=>{o?.(r);},[]),t=dt__namespace.default.useCallback((r,o)=>{o?.(r);},[]);return {handleFocus:e,handleBlur:t}}function Yl({label:e,description:t,errorMessage:r,children:o,items:n,renderItem:a,size:s="md",selectedKey:l,defaultSelectedKey:i,onSelectionChange:c,placeholder:p,showErrors:d=false,tooltip:u,isRequired:m,transparent:g,...f}){let[b,h]=dt.useState(null),[w,S]=dt.useState(null),C=l??b??i,{handleFocus:P,handleBlur:R}=nx(),L=B=>{c&&B!==null&&c(B),c||h(B);},v=dt.useRef(null),D=dt.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...f,selectedKey:C,defaultSelectedKey:i,onSelectionChange:L,placeholder:p,className:j(f.className,"group flex w-full flex-col"),ref:v,onOpenChange:B=>{B&&D.current?S(D.current.offsetWidth):B||v.current?.blur();},children:({isDisabled:B,isInvalid:_,isOpen:y})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:s,tooltip:u,isRequired:m,children:e}),jsxRuntime.jsx(Ye,{children:jsxRuntime.jsx("div",{ref:D,children:jsxRuntime.jsxs(A,{variant:"unstyled",className:tailwindMerge.twMerge(Ge({isInvalid:_||d&&!!r,isDisabled:B,isFocused:y,transparent:g,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:V=>P(V,f.onFocus),onBlur:V=>R(V,f.onBlur),"data-open":y,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:ox(s)}),jsxRuntime.jsx(x,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",y&&"rotate-180")})]})})}),t&&jsxRuntime.jsx(te,{size:s,className:"mt-3",children:t}),d&&jsxRuntime.jsx(q,{size:s,className:"mt-3 text-feedback-error-text",children:typeof r=="function"&&f.validationResult?r(f.validationResult):typeof r=="string"?r:null}),jsxRuntime.jsx(mt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm",style:{minWidth:w?`${w}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?V=>jsxRuntime.jsx(pt,{id:V.id,textValue:V.label,size:s,children:a(V)},V.id):o})})]})})}function Jl({label:e,description:t,tooltip:r,errorMessage:o,size:n="md",className:a,value:s,defaultValue:l=0,onChange:i,min:c=0,max:p=100,step:d=1,disabled:u,showValue:m=true}){let g=typeof s=="number",[f,b]=dt__namespace.default.useState(l),h=g?s:f,w=Math.min(Math.max(h,c),p),S=Math.max(p-c,1e-5),C=(w-c)/S*100;return jsxRuntime.jsxs("div",{className:j(a,"group flex w-full flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{size:n,tooltip:r,className:"mb-1",children:e}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"relative w-full select-none",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full rounded-full bg-background-muted"}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-action-primary",style:{width:`${C}%`},"aria-hidden":true}),jsxRuntime.jsx("input",{type:"range",min:c,max:p,step:d,value:h,disabled:u,"aria-invalid":!!o,onChange:P=>{let R=Number(P.currentTarget.value);g||b(R),i?.(R);},className:tailwindMerge.twMerge("absolute inset-0 w-full cursor-pointer appearance-none bg-transparent outline-none","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-background-input [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-border-input","hover:[&::-webkit-slider-thumb]:shadow-sm focus-visible:[&::-webkit-slider-thumb]:outline-2 focus-visible:[&::-webkit-slider-thumb]:outline-border-focus","[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-background-input [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-border-input","hover:[&::-moz-range-thumb]:shadow-sm focus-visible:[&::-moz-range-thumb]:outline-2 focus-visible:[&::-moz-range-thumb]:outline-border-focus",u?"cursor-not-allowed opacity-60":void 0)})]}),m&&jsxRuntime.jsx("div",{className:"min-w-10 text-right text-sm text-text-heading tabular-nums",children:Math.round(w)})]}),t&&jsxRuntime.jsx(te,{className:"mt-2 text-text-muted",children:t}),o&&jsxRuntime.jsx(q,{className:"mt-1",children:o})]})}var cx=dt__namespace.default.createContext({orientation:"horizontal",isResizing:false});function Vo({defaultSize:e=.7,minSize:t=240,maxSize:r=600,orientation:o="horizontal",resizable:n=true,onResize:a,className:s,children:l}){let i=dt.useRef(null),[c,p]=dt.useState(false),[d,u]=dt.useState(e>1?.7:e),m=dt.useCallback(S=>{if(!i.current||!c)return;let C=i.current.getBoundingClientRect(),P=o==="horizontal"?C.width:C.height,R=o==="horizontal"?C.left:C.top,v=(o==="horizontal"?S.clientX:S.clientY)-R,D=P-v;if(D<t||D>r)return;let B=v/P;u(B),a?.(B);},[c,o,t,r,a]),g=dt.useCallback(()=>{p(false);},[]),f=dt.useCallback(S=>{S.preventDefault(),S.stopPropagation(),p(true);},[]);dt.useEffect(()=>{if(c)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",g),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g),document.body.style.cursor="",document.body.style.userSelect="";}},[c,m,g,o]);let b=dt__namespace.default.Children.toArray(l).find(S=>dt__namespace.default.isValidElement(S)&&S.type===tc),h=dt__namespace.default.Children.toArray(l).find(S=>dt__namespace.default.isValidElement(S)&&S.type===rc),w=`${d*100}%`;return jsxRuntime.jsx(cx.Provider,{value:{orientation:o,isResizing:c},children:jsxRuntime.jsxs("div",{ref:i,className:tailwindMerge.twMerge("flex w-full h-full",o==="horizontal"?"flex-row":"flex-col",s),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto",o==="horizontal"?"h-full":"w-full"),style:{[o==="horizontal"?"width":"height"]:w},children:b}),n&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative group",o==="horizontal"?"w-2 -mx-1 cursor-col-resize":"h-2 -my-1 cursor-row-resize"),onMouseDown:f,role:"separator","aria-orientation":o,"aria-label":"Resize divider",tabIndex:0,onKeyDown:S=>{if(o==="horizontal"){if(S.key==="ArrowLeft"&&d>.3){let P=Math.max(.3,d-.01);u(P),a?.(P);}else if(S.key==="ArrowRight"&&d<.8){let P=Math.min(.8,d+.01);u(P),a?.(P);}}},children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute bg-border-default transition-all",o==="horizontal"?"left-1/2 -translate-x-1/2 w-px h-full group-hover:w-1":"top-1/2 -translate-y-1/2 h-px w-full group-hover:h-1","group-hover:bg-action-primary/50",c&&"bg-action-primary",c&&(o==="horizontal"?"w-1":"h-1"))}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute",o==="horizontal"?"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1 h-8":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-1","bg-border-muted rounded-full opacity-0 group-hover:opacity-100 transition-opacity")})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto flex-1",o==="horizontal"?"h-full":"w-full"),children:h})]})})}function tc({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}function rc({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}Vo.Main=tc;Vo.Aside=rc;function ux(e,t){return cr({value:e,formatter:t,emptyClassName:"text-text-muted",emptyText:"\u2014"})}function px(e){if(e.thresholds&&e.value!==null&&e.value!==void 0){for(let t of e.thresholds)if(t.when(e.value))return t.tone}return e.tone}var mx={neutral:"text-text-body",success:"text-feedback-success",warning:"text-feedback-warning",error:"text-feedback-error",info:"text-feedback-info"};function fx({item:e,dense:t,valueAlign:r}){let o=px(e),n=o?mx[o]:"",a=ux(e.value,e.formatter),s=typeof e.copyable=="function"?e.copyable(e.value):String(e.value),l=jsxRuntime.jsx("span",{className:e.href?"hover:underline cursor-pointer":"",children:a}),i=jsxRuntime.jsxs("dd",{className:tailwindMerge.twMerge(t?"text-sm":"text-base","font-medium",r==="start"?"text-left":"text-right",n,e.disabled&&"opacity-50"),children:[e.copyable?jsxRuntime.jsxs(ro,{value:s,size:"sm",className:"flex items-center gap-1",children:[l,e.iconRight]}):jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[l,e.iconRight]}),e.meta&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-xs text-text-muted mt-0.5",r==="start"?"text-left":"text-right"),children:e.meta})]}),c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("dt",{className:tailwindMerge.twMerge(t?"text-xs":"text-sm","text-text-caption truncate","flex items-center gap-1",e.disabled&&"opacity-50"),children:[e.iconLeft,jsxRuntime.jsx("span",{title:typeof e.label=="string"?e.label:void 0,children:e.label}),e.tooltip&&jsxRuntime.jsx(x,{name:"Question",size:10,className:"text-text-muted","aria-label":"More information"})]}),e.href?jsxRuntime.jsx("a",{href:e.href,onClick:e.onAction,className:"block",children:i}):i]});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid grid-cols-[1fr_auto] items-start",t?"gap-x-2":"gap-x-4"),children:c})}function oc({items:e,layout:t="one-column",dense:r=false,valueAlign:o="end",showDividers:n=false,skeleton:a=false,empty:s=false,error:l,className:i}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",i),children:Array.from({length:e.length||4}).map((c,p)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-start gap-x-4",children:[jsxRuntime.jsx(z,{className:"h-4 w-24"}),jsxRuntime.jsx(z,{className:"h-5 w-16"})]},p))}):l?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-feedback-error",i),children:l}):s||!e.length?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-text-muted",i),children:"No data available"}):jsxRuntime.jsx("dl",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",i),children:e.map((c,p)=>jsxRuntime.jsxs(dt__namespace.default.Fragment,{children:[n&&p>0&&t==="one-column"&&jsxRuntime.jsx("div",{className:"col-span-full border-t border-border-default -mt-1 mb-1"}),jsxRuntime.jsx(fx,{item:c,dense:r,valueAlign:o})]},c.id))})}function xx({isSelected:e,isDisabled:t}){return ["flex h-4 w-7 px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",de,e?"bg-gray-700 dark:bg-zinc-300 forced-colors:!bg-[Highlight] group-pressed:bg-gray-800 dark:group-pressed:bg-zinc-200":"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",t?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function hx({isSelected:e,isDisabled:t}){return ["h-3 w-3 transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",e?"translate-x-[100%]":"translate-x-0",t?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function nc({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...t,className:j(t.className,"group flex items-center gap-2 text-sm text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]"),children:r=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:xx(r),children:jsxRuntime.jsx("span",{className:hx(r)})}),e]})})}var Sx=e=>{let t=Ge({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":"resize-y"}`;return tailwindMerge.twMerge(t,r,e.className)};function ac({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:s,isInvalid:l,isDisabled:i,className:c,validationResult:p,...d}){let{isFocused:u,handleFocus:m,handleBlur:g}=qe();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Ye,{children:jsxRuntime.jsx("textarea",{...d,required:a,onFocus:f=>{d.onFocus&&d.onFocus(f),m(f);},onBlur:f=>{d.onBlur&&d.onBlur(f),g(f);},className:Sx({isInvalid:l,isDisabled:i,isFocused:u,size:o,transparent:s,className:c}),disabled:i})}),t&&jsxRuntime.jsx(te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&p&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(p)})]})})}function cc({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:s,isInvalid:l,isDisabled:i,className:c,validationResult:p,value:d="",onChange:u,chips:m=[],onChipsChange:g,triggerPattern:f="{{",onTriggerDetected:b,onTriggerDismissed:h,renderChip:w,chipVariant:S="primary",chipSize:C,...P}){let R=dt.useRef(null),{isFocused:L,handleFocus:v,handleBlur:D}=qe(),B=C||"sm",_=dt.useRef(null),y=dt.useCallback(F=>{let O="",K=k=>{if(k.nodeType===Node.TEXT_NODE){if(!k.parentElement?.closest("[data-chip-id]")){let M=k.textContent||"";O+=M;}}else if(k.nodeType===Node.ELEMENT_NODE){let T=k;if(T.hasAttribute("data-chip-id")){let M=T.getAttribute("data-chip-id");O+=`{{${M}}}`;return}else if(T.tagName==="BR"){O+=`
|
|
81
|
-
`;return}else
|
|
82
|
-
`)?
|
|
83
|
-
`).map((
|
|
84
|
-
`).length-1&&jsxRuntime.jsx("br",{})]},`line-${K}-${M}`)):O}):null;return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Ye,{children:jsxRuntime.jsx("div",{ref:R,contentEditable:!i,suppressContentEditableWarning:true,onInput:F=>{if(i)return;let O=F.target,K=O.querySelector("[data-chip-id]")!==null,k;if(K?(k=y(O),k=k.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):k=O.textContent||"",k===""){try{let I=document.createRange();I.selectNodeContents(O),I.collapse(!0);let $=window.getSelection();$?.removeAllRanges(),$?.addRange(I),_.current=0;}catch{}oe("",0);return}if(k===d)return;let T=window.getSelection(),M=0;if(T&&T.rangeCount>0)try{let I=T.getRangeAt(0);if(K){let $=0,se=!1,He=be=>{if(se)return !0;if(be===I.startContainer)return $+=I.startOffset,se=!0,!0;if(be.nodeType===Node.TEXT_NODE){if(!be.parentElement?.closest("[data-chip-id]")){if(be.contains(I.startContainer))return $+=I.startOffset,se=!0,!0;$+=(be.textContent||"").length;}}else if(be.nodeType===Node.ELEMENT_NODE){let ie=be;if(ie.hasAttribute("data-chip-id")){if(ie.contains(I.startContainer)||ie===I.startContainer){let st=ie.getAttribute("data-chip-id");return $+=`{{${st}}}`.length,se=!0,!0}let Ze=ie.getAttribute("data-chip-id");return $+=`{{${Ze}}}`.length,!1}else if(ie.tagName==="BR")return ie===I.startContainer?(se=!0,!0):($+=1,!1)}for(let ie=0;ie<be.childNodes.length;ie++)if(He(be.childNodes[ie]))return !0;return !1};He(O),M=$;}else {let $=document.createRange();$.setStart(O,0),$.setEnd(I.startContainer,I.startOffset),M=$.toString().length;}}catch{M=k.length;}_.current=M,oe(k,M);},onKeyDown:F=>{if(i)return;let O=window.getSelection();if(!(!O||O.rangeCount===0))try{let K=O.getRangeAt(0),k=K.commonAncestorContainer;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){let T=k.nodeType===Node.TEXT_NODE?k.parentElement?.closest("[data-chip-id]"):k.closest("[data-chip-id]");if(T){F.preventDefault();try{let M=document.createRange(),I=window.getSelection();F.key==="ArrowLeft"?M.setStartBefore(T):M.setStartAfter(T),M.collapse(!0),I?.removeAllRanges(),I?.addRange(M);}catch{}}}if(F.key==="Backspace"){let T=null;if(T=(k.nodeType===Node.TEXT_NODE?k.parentElement?.closest("[data-chip-id]"):k.closest("[data-chip-id]"))||null,!T)if(k.nodeType===Node.TEXT_NODE){let M=k;if(K.startOffset===0&&M.parentElement){let I=M.previousSibling;if(I&&I.nodeType===Node.ELEMENT_NODE){let $=I.closest("[data-chip-id]");$&&(T=$);}}}else {let M=k;if(K.startOffset>0){let I=M.childNodes[K.startOffset-1];if(I&&I.nodeType===Node.ELEMENT_NODE){let $=I.closest("[data-chip-id]");$&&(T=$);}}}if(T){F.preventDefault(),F.stopPropagation();let M=T.getAttribute("data-chip-id");if(!M)return;let I=`{{${M}}}`,$=d.indexOf(I);if($!==-1){let se=d.slice(0,$)+d.slice($+I.length),He=m.filter(be=>be.id!==M);_.current=$;try{window.getSelection()?.removeAllRanges();}catch{}g?.(He),u?.(se);}}}}catch{}},onFocus:F=>{i||(P.onFocus&&P.onFocus(F),v(F));},onBlur:F=>{i||(P.onBlur&&P.onBlur(F),D(F));},className:ge(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...P.style},"data-placeholder":P.placeholder,children:Me()},d===""?"empty":"content")}),t&&jsxRuntime.jsx(te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&p&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(p)})]})})}var Ex=e=>tailwindMerge.twMerge("w-full",Bt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),Kr({transparent:e.transparent,isDisabled:e.isDisabled}),Z[e.size||"md"].text,Z[e.size||"md"].height,Z[e.size||"md"].padding,"pl-[var(--control-padding-sm)]","flex items-center gap-0.5",e.className),Dx=({isPlaceholder:e,isDisabled:t,isFocused:r,size:o="md"})=>tailwindMerge.twMerge("outline-none rounded transition-colors box-content tabular-nums text-center",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text",Z[o].text,"px-0.5 -my-0.5",r&&"!outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]",!t&&!r&&"hover:bg-text-body/[0.05]");function uc({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:s,validationResult:l,...i}){let{isFocused:c}=qe(),[p,d]=dt.useState(null),u=dt.useRef(null);return dt.useEffect(()=>{let m=b=>{let h=b.target;h.hasAttribute("data-type")&&d(h.getAttribute("data-type"));},g=()=>{d(null);},f=u.current;return f&&(f.addEventListener("focusin",m),f.addEventListener("focusout",g)),()=>{f&&(f.removeEventListener("focusin",m),f.removeEventListener("focusout",g));}},[]),jsxRuntime.jsx(reactAriaComponents.TimeField,{...i,children:({isDisabled:m,isInvalid:g})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Y,{isRequired:a,tooltip:n,children:e}),jsxRuntime.jsx(reactAriaComponents.DateInput,{ref:u,className:Ex({size:o,transparent:s,isDisabled:m,isInvalid:g,isFocused:c}),children:f=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:f,className:Dx({isPlaceholder:f.isPlaceholder,isDisabled:!f.isEditable,isFocused:p===f.type,size:o})})}),t&&jsxRuntime.jsx(te,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null]})})}var $x="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",pc={default:{selected:"bg-text-body text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"},primary:{selected:"bg-action-primary text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},zx="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",Ox="opacity-100 cursor-pointer",Hx={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Gx={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function _x(e){let{variant:t="default",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:s,borderLeft:l}=e,i=`${$x} ${n?pc[t].selected:pc[t].unselected}`;return i+=` ${Z[r].text} ${Z[r].height} ${Z[r].padding} ${Z[r].gap}`,i+=` ${o?zx:Ox}`,a==="left"&&(i+=" rounded-l-sm"),a==="right"&&(i+=" rounded-r-sm"),s&&(i+=" border-r"),l&&(i+=" border-l"),i+=` ${de()}`,tailwindMerge.twMerge(i)}function fc(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:s,isLoading:l=false,loadingText:i,loadingIndicator:c,size:p="md",badgeNumber:d,badgeVariant:u="primary",badgePosition:m="top-right",...g}=e,f=n?jsxRuntime.jsx(x,{name:n,className:`icon-[--control-icon-size-${p}]`,weight:s}):null,b=()=>{let w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return l?jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c||jsxRuntime.jsx(x,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${p}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:w}),i&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:i})]}):w},h=jsxRuntime.jsx(reactAriaComponents.ToggleButton,{onPress:o,...g,className:tailwindMerge.twMerge(_x(e),t),"aria-busy":l,children:b()});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[h,jsxRuntime.jsx("span",{className:`absolute ${Hx[m]} flex h-5 w-5 items-center justify-center rounded-full ${Gx[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):h}exports.ActionCell=li;exports.ActionMenu=bs;exports.AppShell=ys;exports.AreaSeries=Ot;exports.AutoMobileRenderer=bo;exports.Autocomplete=Xr;exports.Avatar=Is;exports.Badge=$t;exports.BarSeries=Gt;exports.BooleanCell=ci;exports.Breadcrumb=Yr;exports.Breadcrumbs=qr;exports.Button=A;exports.Calendar=Jr;exports.Card=Ae;exports.CardMobileRenderer=xo;exports.ChartAxis=br;exports.ChartBottomBar=ao;exports.ChartContainer=ni;exports.ChartContext=oo;exports.ChartTooltip=io;exports.Checkbox=We;exports.CheckboxGroup=Tp;exports.Chip=to;exports.ClearButton=Ts;exports.CodeEditor=Ks;exports.ColorModeProvider=Ps;exports.CopyToClipboard=ro;exports.DataTable=hi;exports.DateCell=di;exports.DateField=yi;exports.DateRangePicker=Si;exports.Description=te;exports.Dialog=jt;exports.DialogHeader=Yt;exports.Drawer=Qn;exports.ErrorBoundary=Jt;exports.FieldError=q;exports.FieldGroup=Zr;exports.FileUpload=Ti;exports.Form=ki;exports.FormatRegistry=N;exports.Grid=ea;exports.Heading=Ee;exports.Icon=x;exports.Input=ks;exports.InputWrapper=Ye;exports.InteractiveMap=ml;exports.Kpi=Ii;exports.KpiGroup=ra;exports.Label=Y;exports.LineSeries=Wt;exports.ListBox=ag;exports.ListBoxItem=pt;exports.Loader=Vi;exports.Logo=Hr;exports.MAPBOX_THEMES=ua;exports.Meter=bl;exports.Notice=ko;exports.NoticeContainer=Ro;exports.NoticeProvider=hl;exports.NumberCell=ui;exports.NumberField=Sl;exports.PageLayout=ot;exports.PlaceSearch=Il;exports.Popover=mt;exports.ProgressBar=Dl;exports.Radio=Vl;exports.RadioGroup=Al;exports.RangeCalendar=ho;exports.RichTextEditor=Ol;exports.SKELETON_SIZES=xt;exports.Section=Gl;exports.SegmentedControl=Ul;exports.Select=Yl;exports.SelectCell=pi;exports.SideNav=Gr;exports.Skeleton=z;exports.Slider=Jl;exports.SplitPane=Vo;exports.StatList=oc;exports.StaticMap=gl;exports.Switch=nc;exports.Tab=Eo;exports.TabList=Io;exports.TabPanel=Nl;exports.Tabs=Mo;exports.TextArea=ac;exports.TextAreaWithChips=cc;exports.TextCell=mi;exports.TextField=Do;exports.TextLink=Tn;exports.TimeField=uc;exports.ToggleButton=fc;exports.Tooltip=In;exports.TopNav=dr;exports.autoScaleCurrent=nd;exports.autoScaleDistance=za;exports.autoScaleEnergy=_a;exports.autoScalePower=md;exports.autoScaleResistance=fd;exports.autoScaleVoltage=Cd;exports.camelCaseToWords=ss;exports.capitalize=ns;exports.celsiusToFahrenheit=gd;exports.celsiusToKelvin=Jh;exports.centimetersToInches=Eh;exports.clearColorCache=Nm;exports.createCategoryColorMap=wm;exports.createFormat=S0;exports.createXScale=Dn;exports.createYScale=An;exports.defaultMargin=ne;exports.enumToSentenceCase=yd;exports.exportChart=On;exports.fahrenheitToCelsius=bd;exports.fahrenheitToKelvin=Qh;exports.feetToMeters=wh;exports.feetToMiles=kh;exports.formatBoolean=Ea;exports.formatComponentValue=cr;exports.formatCurrency=Va;exports.formatCurrent=Ho;exports.formatDate=Ba;exports.formatDistance=Oa;exports.formatEmptyValue=co;exports.formatEnergy=jo;exports.formatFieldValue=lr;exports.formatInternationalPhone=qo;exports.formatNumber=Aa;exports.formatPhone=Ua;exports.formatPhoneNumber=Wa;exports.formatPower=en;exports.formatResistance=rn;exports.formatTemperature=Qa;exports.formatText=us;exports.formatUSPhone=Br;exports.formatVoltage=an;exports.getBadgeClasses=ai;exports.getBooleanBadgeVariant=si;exports.getCellAlignmentClasses=Kn;exports.getCellContainerClasses=ce;exports.getCellTextClasses=Ve;exports.getContrastingTextColor=Pm;exports.getDateParts=hh;exports.getDefaultChartColor=Hn;exports.getDefaultColors=Qs;exports.getExportFormatName=Sm;exports.getFieldGroupStyles=pr;exports.getInputBackgroundStyles=Kr;exports.getInputBaseStyles=Ge;exports.getInputStateStyles=Bt;exports.getNumericColorClasses=uo;exports.getResolvedColor=Q;exports.getSkeletonSize=Be;exports.getThemeCategoricalColors=so;exports.getYFormatSettings=_t;exports.inchesToCentimeters=Ih;exports.isExportSupported=Cm;exports.isLightColor=ei;exports.isNil=E;exports.kelvinToCelsius=xd;exports.kelvinToFahrenheit=e0;exports.kilometersToMiles=Th;exports.metersToFeet=Nh;exports.metersToMiles=Rh;exports.metersToYards=Mh;exports.milesToFeet=$a;exports.milesToKilometers=Ph;exports.milesToMeters=Fh;exports.parseBoolean=je;exports.resolveValue=we;exports.snakeCaseToWords=is;exports.temperatureStringToSymbol=Xa;exports.toA=mh;exports.toActiveInactive=Xc;exports.toAmps=Vr;exports.toBoolean=Xe;exports.toCelsius=qa;exports.toCentimeters=dd;exports.toCheckmark=qc;exports.toCompactNumber=rd;exports.toCurrency=Da;exports.toCustomDateFormat=cd;exports.toDateString=ad;exports.toEnabledDisabled=Kc;exports.toFahrenheit=ja;exports.toFeet=Wo;exports.toFloat=ed;exports.toFormattedNumber=td;exports.toFullDateTime=id;exports.toGW=Uh;exports.toGWh=Ga;exports.toGigawatts=Qo;exports.toISOString=ld;exports.toInches=pd;exports.toInteger=Qc;exports.toKA=fh;exports.toKV=l0;exports.toKW=_h;exports.toKelvin=Ya;exports.toKiloamps=Oo;exports.toKilohms=Ka;exports.toKilometers=_o;exports.toKilovolts=nn;exports.toKilowatts=Yo;exports.toLowerCase=ts;exports.toMA=ph;exports.toMV=s0;exports.toMW=Wh;exports.toMWh=Ha;exports.toMegawatts=Jo;exports.toMegohms=Za;exports.toMeters=Go;exports.toMiles=Uo;exports.toMilliamps=zo;exports.toMillimeters=ud;exports.toMilliohms=tn;exports.toMillivolts=on;exports.toNauticalMiles=Sh;exports.toOhms=zr;exports.toOnOff=Zc;exports.toPercentage=Jc;exports.toRelativeTime=sd;exports.toScientificNotation=od;exports.toSecret=vd;exports.toSentenceCase=rs;exports.toTemperature=Ja;exports.toTitleCase=os;exports.toTrueFalse=jc;exports.toUpperCase=es;exports.toV=i0;exports.toVolts=Or;exports.toW=Gh;exports.toWatts=$r;exports.toWh=Zo;exports.toYards=Ko;exports.tokWh=Xo;exports.truncateEnd=ds;exports.truncateMiddle=ls;exports.truncateStart=cs;exports.ucFirst=as;exports.useChartContext=gt;exports.useColorMode=Vt;exports.useComponentFormatter=ah;exports.useDebounce=Dr;exports.useInputFocus=qe;exports.useLocalStorage=Ia;exports.useNotice=vl;exports.yardsToMeters=Lh;//# sourceMappingURL=index.cjs.map
|
|
80
|
+
`,backgroundSize:"30px 30px"}})})]})}):jsxRuntime.jsx("div",{ref:x,className:tailwindMerge.twMerge("relative flex h-full w-full overflow-hidden",a&&"cursor-pointer",n),onClick:a?l:void 0,children:jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsxs(Cg__default.default,{ref:f,initialViewState:e,...t&&{longitude:t.longitude,latitude:t.latitude,zoom:t.zoom},style:{width:"100%",height:"100%"},mapStyle:Tr(s,b),mapboxAccessToken:p,transformRequest:A,onMove:a?void 0:g=>r?.(g.viewState),onClick:a?void 0:C,onMouseEnter:a?void 0:k,onMouseLeave:a?void 0:I,interactiveLayerIds:a?[]:w,scrollZoom:a?false:o,dragPan:!a,dragRotate:!a,doubleClickZoom:!a,interactive:!a,children:[F,kr(d),h&&jsxRuntime.jsx(Cg.Marker,{longitude:h.feature.lngLat[0],latitude:h.feature.lngLat[1],anchor:"bottom",offset:[0,-15],children:jsxRuntime.jsx("div",{className:"pointer-events-none rounded-lg border border-border-default bg-background-surface px-4 py-3 shadow-xl",children:h.content})})]},`map-${s}`),a&&i&&jsxRuntime.jsx("div",{className:"absolute bottom-8 right-8 z-10",children:i})]})})}function vl({width:e="100%",height:t="100%",initialViewState:r={longitude:-122.4194,latitude:37.7749,zoom:14},isLoading:o=false,mapType:n="streets",layers:a=[],mapboxAccessToken:i=To(),showMarker:l=true,className:s}){let{isDarkTheme:d}=Re(),p={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t};return o?jsxRuntime.jsx("div",{style:p,className:s,children:jsxRuntime.jsx(z,{width:p.width,height:p.height})}):i?jsxRuntime.jsx("div",{style:p,className:s,children:jsxRuntime.jsxs(Cg__default.default,{mapboxAccessToken:i,initialViewState:r,style:p,mapStyle:Tr(n,d),scrollZoom:false,dragPan:false,dragRotate:false,doubleClickZoom:false,touchZoomRotate:false,interactive:false,children:[kr(a),l&&r.longitude!==void 0&&r.latitude!==void 0&&jsxRuntime.jsx(Cg.Marker,{longitude:r.longitude,latitude:r.latitude,anchor:"bottom",children:jsxRuntime.jsx(v,{name:"MapPin",size:36,className:"text-action-primary",weight:"fill"})})]})}):jsxRuntime.jsx("div",{style:p,className:`flex items-center justify-center bg-background-muted text-text-muted ${s}`,children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(v,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}var Tg={sm:{bar:"h-1.5 w-48",text:"text-xs",icon:"h-3 w-3"},md:{bar:"h-2 w-64",text:"text-sm",icon:"h-4 w-4"},lg:{bar:"h-3 w-80",text:"text-base",icon:"h-5 w-5"}};function Cl({label:e,size:t="md",variant:r="default",showWarningIndicator:o=true,warningThreshold:n=80,className:a,...i}){let l=Tg[t];return jsxRuntime.jsx(reactAriaComponents.Meter,{...i,className:j(a,"flex flex-col gap-1"),children:({percentage:s,valueText:d})=>{let p=o&&s>=n,c=r==="default"?Rg(s):r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2",children:[e&&jsxRuntime.jsx(Y,{children:e}),jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(l.text,p?"text-feedback-error-text":"text-text-muted"),children:[p&&jsxRuntime.jsx(lucideReact.AlertTriangle,{"aria-label":"Warning: High value",className:tailwindMerge.twMerge("inline-block align-text-bottom mr-1",l.icon)}),d]})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative rounded-full bg-background-muted","ring-1 ring-inset ring-border-muted",l.bar),children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute left-0 top-0 h-full rounded-full transition-all duration-300","forced-colors:bg-[Highlight]",Lg(c)),style:{width:`${Math.min(100,Math.max(0,s))}%`},role:"presentation","aria-hidden":"true"})})]})}})}function Rg(e){return e<50?"success":e<70?"info":e<90?"warning":"error"}function Lg(e){switch(e){case "success":return "bg-feedback-success-text";case "warning":return "bg-feedback-warning-text";case "error":return "bg-feedback-error-text";case "info":return "bg-feedback-info-text";default:return "bg-action-primary-background"}}var zg={success:{container:"bg-feedback-success-background border-feedback-success-border text-feedback-success-text",icon:lucideReact.CheckCircle},error:{container:"bg-feedback-error-background border-feedback-error-border text-feedback-error-text",icon:lucideReact.XCircle},warning:{container:"bg-feedback-warning-background border-feedback-warning-border text-feedback-warning-text",icon:lucideReact.AlertCircle},info:{container:"bg-feedback-info-background border-feedback-info-border text-feedback-info-text",icon:lucideReact.Info}};function Fo({id:e,message:t,variant:r="info",duration:o=5e3,dismissible:n=true,onDismiss:a,className:i}){let{container:l,icon:s}=zg[r];return lt.useEffect(()=>{if(o>0){let d=setTimeout(()=>{a?.();},o);return ()=>clearTimeout(d)}},[o,a]),jsxRuntime.jsxs(framerMotion.motion.div,{layout:true,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.2}},className:tailwindMerge.twMerge("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg",l,i),children:[jsxRuntime.jsx(s,{className:"h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 text-sm font-medium",children:t}),n&&jsxRuntime.jsx("button",{onClick:a,className:"flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10","aria-label":"Dismiss notification",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var Zg={"top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end"};function Mo({notices:e,onDismiss:t,position:r="top-right",className:o}){let[n,a]=lt.useState(false);if(lt.useEffect(()=>{a(true);},[]),!n)return null;let i=jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none fixed z-50 flex flex-col gap-2",Zg[r],o),"aria-live":"polite","aria-atomic":"true",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(l=>jsxRuntime.jsx(Fo,{id:l.id,message:l.message,variant:l.variant,duration:l.duration,dismissible:l.dismissible,onDismiss:()=>t(l.id)},l.id))})});return reactDom.createPortal(i,document.body)}var Nl=lt.createContext(void 0);function Sl({children:e,position:t="top-right",maxNotices:r=5,defaultDuration:o=5e3,defaultDismissible:n=true}){let[a,i]=lt.useState([]),l=lt.useCallback((c,u)=>{let m=`notice-${Date.now()}-${Math.random()}`,b={id:m,message:c,variant:u?.variant||"info",duration:u?.duration??o,dismissible:u?.dismissible??n};return i(f=>{let x=[...f,b];return x.length>r?x.slice(-r):x}),m},[r,o,n]),s=lt.useCallback(c=>{i(u=>u.filter(m=>m.id!==c));},[]),d=lt.useCallback(()=>{i([]);},[]),p={notices:a,addNotice:l,removeNotice:s,clearNotices:d};return jsxRuntime.jsxs(Nl.Provider,{value:p,children:[e,jsxRuntime.jsx(Mo,{notices:a,onDismiss:s,position:t})]})}function wl(){let e=lt.useContext(Nl);if(!e)throw new Error("useNoticeContext must be used within a NoticeProvider");return e}function Pl(){let{addNotice:e,removeNotice:t,clearNotices:r}=wl(),o=lt.useCallback((s,d)=>e(s,d),[e]),n=lt.useCallback((s,d)=>e(s,{...d,variant:"success"}),[e]),a=lt.useCallback((s,d)=>e(s,{...d,variant:"error"}),[e]),i=lt.useCallback((s,d)=>e(s,{...d,variant:"warning"}),[e]),l=lt.useCallback((s,d)=>e(s,{...d,variant:"info"}),[e]);return {show:o,success:n,error:a,warning:i,info:l,dismiss:t,clear:r}}var ob=e=>tailwindMerge.twMerge(Dt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),e.transparent?"bg-transparent":"bg-background-input","pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className);function Tl({label:e,description:t,errorMessage:r,size:o,tooltip:n,isRequired:a,transparent:i,validationResult:l,...s}){let d=lt.useId();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...s,id:d,isRequired:a,className:j(s.className,"group flex flex-col gap-1"),step:s.step??1,onChange:p=>{typeof p=="number"&&(s.maxValue!=null&&p>s.maxValue?s.onChange?.(s.maxValue):s.minValue!=null&&p<s.minValue?s.onChange?.(s.minValue):s.onChange?.(p));},isInvalid:!!r||typeof s.value=="number"&&(s.maxValue!=null&&s.value>s.maxValue||s.minValue!=null&&s.value<s.minValue),children:({isDisabled:p,isInvalid:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,htmlFor:d,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:ob({isInvalid:c||!!r,isDisabled:p,transparent:i,className:typeof s.className=="string"?s.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[1px] right-[1px] flex flex-col divide-y border-l overflow-hidden rounded-r-[calc(var(--control-border-radius)-1px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(v,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(v,{name:"CaretDown",size:14})})]})]})}),t&&jsxRuntime.jsx(ee,{size:o,className:"mt-3",children:t}),r&&jsxRuntime.jsx(q,{size:o,className:"mt-3",children:typeof r=="function"?r(l):r})]})})}var Io=lt__namespace.createContext({variant:"default"});function lb({orientation:e,className:t=""}){return `flex flex-col w-full ${{horizontal:"",vertical:"flex-row"}[e]||""} ${t}`.trim()}function Do({variant:e="default",...t}){return jsxRuntime.jsx(Io.Provider,{value:{variant:e},children:jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(reactAriaComponents.Tabs,{...t,className:reactAriaComponents.composeRenderProps(t.className,(r,o)=>lb({...o,className:r}))})})})}function cb({orientation:e,className:t=""}){return `flex gap-10 relative after:absolute after:bottom-0 after:left-0 after:right-0 after:h-[2px] after:bg-border-muted ${{horizontal:"flex-row w-full",vertical:"flex-col items-start"}[e]||""} ${t}`.trim()}function Ao({variant:e,...t}){let r=lt__namespace.useContext(Io),o=e??r.variant;return jsxRuntime.jsx(Io.Provider,{value:{variant:o},children:jsxRuntime.jsx(reactAriaComponents.TabList,{...t,className:reactAriaComponents.composeRenderProps(t.className,(n,a)=>cb({...a,className:n||""}))})})}function db({isSelected:e,isDisabled:t,variant:r,className:o=""}){let n="flex items-center cursor-default px-1 py-2 font-medium transition-all hover:cursor-pointer relative",a=ae(),i="";return t?i="text-text-disabled forced-colors:text-[GrayText] cursor-not-allowed":e?r==="accent"?i="text-action-primary border-b-2 border-action-primary z-10 forced-colors:bg-[Highlight]":i="text-text-heading border-b-2 border-text-heading z-10 forced-colors:bg-[Highlight]":i="text-text-placeholder hover:text-text-muted",`${n} ${a} ${i} ${o}`.trim()}function $o(e){let{variant:t}=lt__namespace.useContext(Io);return jsxRuntime.jsx(reactAriaComponents.Tab,{...e,"data-testid":e.id?`tab-${e.id}`:void 0,className:reactAriaComponents.composeRenderProps(e.className,(r,o)=>db({...o,className:r,isSelected:o.isSelected,variant:t}))})}function ub({className:e=""}){let t="block w-full mt-4 text-text-body",r=ae();return `${t} ${r} ${e}`.trim()}function Rl(e){return jsxRuntime.jsx(reactAriaComponents.TabPanel,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>ub({...r,className:t||""}))})}function tt({children:e,maxWidth:t=1400,paddingXClass:r="px-4 md:px-6",paddingYClass:o="py-4 md:py-6",className:n}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(`w-full ${r} ${o}`,n),style:{marginInline:"auto",maxWidth:t},children:e})}function Ll({title:e,subtitle:t,breadcrumbs:r,breadcrumbsNode:o,meta:n,headingAs:a,className:i}){return jsxRuntime.jsxs("header",{className:tailwindMerge.twMerge("mb-4 md:mb-6",i),"aria-labelledby":"page-title",children:[o?jsxRuntime.jsx("div",{className:"mb-2",children:o}):r?.length?jsxRuntime.jsx("div",{className:"mb-2",children:jsxRuntime.jsx(Qr,{children:r.map((l,s)=>jsxRuntime.jsx(eo,{...l.href?{href:l.href}:{},children:l.label},`${l.label}-${s}`))})}):null,jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("div",{id:"page-title",children:jsxRuntime.jsx(Ee,{tag:a||"h1",size:"xl",children:e})}),t?jsxRuntime.jsx("p",{className:"mt-1 text-text-muted",children:t}):null]}),n?jsxRuntime.jsx("div",{className:"shrink-0",children:n}):null]})]})}function Fl({primary:e,secondary:t,children:r,align:o="end",className:n}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(`mb-3 md:mb-4 flex items-center gap-2 ${o==="end"?"justify-end":"justify-start"}`,n),children:[r,jsxRuntime.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t,e]})]})}function Ml({children:e,className:t,ariaLabel:r="Filters"}){return jsxRuntime.jsx("section",{"aria-label":r,className:tailwindMerge.twMerge("mb-4 md:mb-6 flex flex-wrap items-center gap-2",t),children:e})}function Il({tabs:e,value:t,defaultValue:r,onChange:o,className:n,children:a}){let i=l=>{o?.(l);};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("mb-3 md:mb-4",n),children:jsxRuntime.jsxs(Do,{selectedKey:t,defaultSelectedKey:r||e[0]?.id,onSelectionChange:i,children:[jsxRuntime.jsx(Ao,{children:e.map(l=>jsxRuntime.jsx($o,{id:l.id,isDisabled:l.disabled,children:l.label},l.id))}),a]})})}function El({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full",t),children:e})}function Dl({children:e,sticky:t=true,className:r}){return jsxRuntime.jsx("aside",{className:tailwindMerge.twMerge(t?"lg:sticky lg:top-20":"",r),children:e})}tt.Header=Ll;tt.Actions=Fl;tt.Filters=Ml;tt.Tabs=Il;tt.Content=El;tt.Aside=Dl;function pb(e){return typeof e=="object"&&e!==null&&"features"in e&&Array.isArray(e.features)&&"type"in e&&typeof e.type=="string"}var mb=process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN||"";function Bl({label:e="Search for a place",selectedKey:t,defaultSelectedKey:r,onSelectionChange:o,placeholder:n="Enter a location...",errorMessage:a,description:i,size:l="md",tooltip:s,isRequired:d,isDisabled:p,showErrors:c=true,autoFocus:u=false,onSelect:m,searchTypes:b=["place","address"],defaultFilter:f,validationResult:x,countryRestrictions:h,proximity:y="ip"}){let S=lt.useRef(new WeakMap),F=lt.useRef([]),w={requestType:"REST",method:"GET",url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{q}.json",extraParams:{access_token:mb,types:b.join(","),limit:"5",...h?.length?{country:h.join(",").toLowerCase()}:{},...y?{proximity:y==="ip"?"ip":y.join(",")}:{}},shouldLoad:C=>C.length>0,transformResponse:C=>{if(!pb(C))return [];let k=C.features.map(I=>{let A={id:I.id,name:I.place_name};return S.current.set(A,{type:I.place_type[0],center:I.center}),A});return k.length>0&&(F.current=k),k}},T=C=>{let k=S.current.get(C),I=C.name.split(", "),A=I[0],g=I.slice(1).join(", ");return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 py-0.5",children:[jsxRuntime.jsx(v,{name:k?.type==="address"?"MapPin":k?.type==="place"?"Buildings":k?.type==="region"?"MapPinArea":k?.type==="country"?"Flag":"Circle",className:"h-5 w-5 flex-shrink-0 text-text-muted"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:"truncate font-medium text-text-body",children:A}),g&&jsxRuntime.jsx("span",{className:"truncate text-sm text-text-muted",children:g})]})]})},L=C=>C?jsxRuntime.jsx(v,{name:"CircleNotch",className:"h-4 w-4 animate-spin text-text-muted"}):jsxRuntime.jsx(v,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"});return jsxRuntime.jsx(Yr,{"data-testid":"autocomplete","data-config":JSON.stringify({types:b.join(","),country:h?.join(",").toLowerCase(),proximity:y==="ip"?"ip":y?.join(",")}),label:e,selectedKey:t,defaultSelectedKey:r,onSelectionChange:C=>{if(o?.(C),C){let I=F.current.find(A=>A.id===C);if(I){let A=S.current.get(I);A&&m({id:I.id,place_name:I.name,place_type:[A.type],center:A.center});}}},requestConfig:w,placeholder:n,errorMessage:a,description:i,size:l,tooltip:s,isRequired:d,isDisabled:p,showErrors:c,autoFocus:u,renderItem:T,renderLeftIcon:L,defaultFilter:f,validationResult:x})}function zl({label:e,rightLabel:t,progressWidth:r=64,hideLabels:o=false,...n}){return jsxRuntime.jsx(reactAriaComponents.ProgressBar,{...n,className:j(n.className,"flex flex-col gap-1"),children:({percentage:a,valueText:i,isIndeterminate:l})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!o&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:e}),jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:t||i})]}),jsxRuntime.jsx("div",{className:`relative h-2 w-${r} overflow-hidden rounded-full bg-background-muted outline-none`,children:jsxRuntime.jsx("div",{className:`absolute top-0 h-full rounded-full bg-blue-600 dark:bg-blue-500 forced-colors:bg-[Highlight] ${l?"left-full duration-1000 ease-out animate-in slide-out-to-right-full repeat-infinite [--tw-enter-translate-x:calc(-16rem-100%)]":"left-0"}`,style:{width:(l?40:a)+"%"}})})]})})}function Hl(e){return jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...e,className:j(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(Y,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(ee,{children:e.description}),jsxRuntime.jsx(q,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})}function hb({isSelected:e,isInvalid:t,isDisabled:r}){let o=[ae(),"w-5 h-5 rounded-full border-2 bg-background-surface transition-all"];return r?o.push("border-border-muted forced-colors:!border-[GrayText]"):t?o.push("border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]"):e?o.push("border-[7px] border-action-primary forced-colors:!border-[Highlight] group-pressed:border-action-primary-hover dark:group-pressed:border-action-primary-hover"):o.push("border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus"),o.join(" ")}function Gl(e){return jsxRuntime.jsx(reactAriaComponents.Radio,{...e,className:j(e.className,"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]"),children:t=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:hb(t)}),e.children]})})}var kt=({isActive:e=false,onPress:t,children:r})=>jsxRuntime.jsx(H,{variant:e?"secondary":"ghost",size:"sm",onPress:t,className:"p-1",children:r});function Rb({initialUrl:e,isOpen:t,onClose:r,onSubmit:o}){let[n,a]=lt.useState(e);return lt__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,isOpen:t,onOpenChange:l=>!l&&r(),children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative",children:jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),o(n),r();},children:[jsxRuntime.jsx(qt,{title:"Insert Link",onClose:r}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Yt,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(H,{variant:"secondary",onPress:r,children:"Cancel"}),jsxRuntime.jsx(H,{type:"submit",children:"Save"})]})]})})})}function Kl({initialContent:e="",onChange:t,className:r,isDisabled:o=false,placeholder:n="Start typing..."}){let[a,i]=lt.useState(false),l=react.useEditor({extensions:[wb__default.default.configure({heading:{levels:[1,2]}}),vb__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!o,onUpdate:({editor:p})=>{t?.(p.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge("prose prose-sm max-w-none","focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),s=()=>{i(true);},d=p=>{p===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:p}).run();};return l?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input",o&&"opacity-50",r),children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:p})=>p.isActive("link")&&!a,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(H,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let p=l.getAttributes("link").href;window.open(p,"_blank");},children:[jsxRuntime.jsx(v,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(H,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:s,children:[jsxRuntime.jsx(v,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(H,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(v,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(Rb,{isOpen:a,onClose:()=>i(false),onSubmit:d,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 border-b border-border-input p-2",children:[jsxRuntime.jsx(kt,{isActive:l.isActive("heading",{level:1}),onPress:()=>l.chain().focus().toggleHeading({level:1}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H1"})}),jsxRuntime.jsx(kt,{isActive:l.isActive("heading",{level:2}),onPress:()=>l.chain().focus().toggleHeading({level:2}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H2"})}),jsxRuntime.jsx(kt,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(kt,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(kt,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(v,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(kt,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(v,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(kt,{isActive:l.isActive("link"),onPress:s,children:jsxRuntime.jsx(v,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full",children:[jsxRuntime.jsx(react.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full p-4","[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none","[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold","[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold","[&_.ProseMirror_p]:mb-2","[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal","[&_.ProseMirror_li]:mb-1","[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",o&&"pointer-events-none")}),l.isEmpty&&!o&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-4 top-4 text-text-muted",children:n})]})]}):null}var Mb={plain:"",contained:"bg-background-surface rounded-lg border border-border-default p-6",bordered:"border-y border-border-default py-6"},Ib={none:"",sm:"my-4",md:"my-6 md:my-8",lg:"my-8 md:my-12"};function Zl({title:e,description:t,actions:r,variant:o="plain",spacing:n="md",withDivider:a=false,headingAs:i="h2",className:l,children:s}){let d=lt__namespace.default.useId(),p=e||t||r;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge(Ib[n],Mb[o],l),"aria-labelledby":e?d:void 0,children:[p&&jsxRuntime.jsxs("header",{id:d,className:tailwindMerge.twMerge("flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",a&&"border-b border-border-default pb-4 mb-6",!a&&s&&"mb-4"),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx(Ee,{tag:i,size:"md",className:"text-text-heading",children:e}),t&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]}),s&&jsxRuntime.jsx("div",{className:"",children:s})]})}var Db={sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base",xl:"h-14 text-lg"},Ab={sm:14,md:16,lg:18,xl:20},$b=({isSelected:e,isFirst:t,isLast:r,isDisabled:o})=>tailwindMerge.twMerge(ae(),"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-selected text-text-body font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-muted hover:bg-background-hover pressed:bg-background-selected forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed");function ql({options:e,value:t,onChange:r,size:o="md",className:n,isDisabled:a,"aria-label":i}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-md border-2 border-border-muted",Db[o],n),role:"group","aria-label":i,children:e.map((l,s)=>jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>r(l.id),className:$b({isSelected:t===l.id,isFirst:s===0,isLast:s===e.length-1,isDisabled:a}),isDisabled:a,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(v,{name:l.icon,size:Ab[o]}),l.label]},l.id))})}function Xl({label:e,description:t,tooltip:r,errorMessage:o,size:n="md",className:a,value:i,defaultValue:l=0,onChange:s,min:d=0,max:p=100,step:c=1,disabled:u,showValue:m=true}){let b=typeof i=="number",[f,x]=lt__namespace.default.useState(l),h=b?i:f,y=Math.min(Math.max(h,d),p),S=Math.max(p-d,1e-5),F=(y-d)/S*100;return jsxRuntime.jsxs("div",{className:j(a,"group flex w-full flex-col gap-1"),children:[e&&jsxRuntime.jsx(Y,{size:n,tooltip:r,className:"mb-1",children:e}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"relative w-full select-none",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full rounded-full bg-background-muted"}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-action-primary",style:{width:`${F}%`},"aria-hidden":true}),jsxRuntime.jsx("input",{type:"range",min:d,max:p,step:c,value:h,disabled:u,"aria-invalid":!!o,onChange:w=>{let T=Number(w.currentTarget.value);b||x(T),s?.(T);},className:tailwindMerge.twMerge("absolute inset-0 w-full cursor-pointer appearance-none bg-transparent outline-none","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-background-input [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-border-input","hover:[&::-webkit-slider-thumb]:shadow-sm focus-visible:[&::-webkit-slider-thumb]:outline-2 focus-visible:[&::-webkit-slider-thumb]:outline-border-focus","[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-background-input [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-border-input","hover:[&::-moz-range-thumb]:shadow-sm focus-visible:[&::-moz-range-thumb]:outline-2 focus-visible:[&::-moz-range-thumb]:outline-border-focus",u?"cursor-not-allowed opacity-60":void 0)})]}),m&&jsxRuntime.jsx("div",{className:"min-w-10 text-right text-sm text-text-heading tabular-nums",children:Math.round(y)})]}),t&&jsxRuntime.jsx(ee,{className:"mt-2 text-text-muted",children:t}),o&&jsxRuntime.jsx(q,{className:"mt-1",children:o})]})}var Ob=lt__namespace.default.createContext({orientation:"horizontal",isResizing:false});function Vo({defaultSize:e=.7,minSize:t=240,maxSize:r=600,orientation:o="horizontal",resizable:n=true,onResize:a,className:i,children:l}){let s=lt.useRef(null),[d,p]=lt.useState(false),[c,u]=lt.useState(e>1?.7:e),m=lt.useCallback(S=>{if(!s.current||!d)return;let F=s.current.getBoundingClientRect(),w=o==="horizontal"?F.width:F.height,T=o==="horizontal"?F.left:F.top,C=(o==="horizontal"?S.clientX:S.clientY)-T,k=w-C;if(k<t||k>r)return;let I=C/w;u(I),a?.(I);},[d,o,t,r,a]),b=lt.useCallback(()=>{p(false);},[]),f=lt.useCallback(S=>{S.preventDefault(),S.stopPropagation(),p(true);},[]);lt.useEffect(()=>{if(d)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),document.body.style.cursor="",document.body.style.userSelect="";}},[d,m,b,o]);let x=lt__namespace.default.Children.toArray(l).find(S=>lt__namespace.default.isValidElement(S)&&S.type===Ql),h=lt__namespace.default.Children.toArray(l).find(S=>lt__namespace.default.isValidElement(S)&&S.type===ec),y=`${c*100}%`;return jsxRuntime.jsx(Ob.Provider,{value:{orientation:o,isResizing:d},children:jsxRuntime.jsxs("div",{ref:s,className:tailwindMerge.twMerge("flex w-full h-full",o==="horizontal"?"flex-row":"flex-col",i),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto",o==="horizontal"?"h-full":"w-full"),style:{[o==="horizontal"?"width":"height"]:y},children:x}),n&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative group",o==="horizontal"?"w-2 -mx-1 cursor-col-resize":"h-2 -my-1 cursor-row-resize"),onMouseDown:f,role:"separator","aria-orientation":o,"aria-label":"Resize divider",tabIndex:0,onKeyDown:S=>{if(o==="horizontal"){if(S.key==="ArrowLeft"&&c>.3){let w=Math.max(.3,c-.01);u(w),a?.(w);}else if(S.key==="ArrowRight"&&c<.8){let w=Math.min(.8,c+.01);u(w),a?.(w);}}},children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute bg-border-default transition-all",o==="horizontal"?"left-1/2 -translate-x-1/2 w-px h-full group-hover:w-1":"top-1/2 -translate-y-1/2 h-px w-full group-hover:h-1","group-hover:bg-action-primary/50",d&&"bg-action-primary",d&&(o==="horizontal"?"w-1":"h-1"))}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute",o==="horizontal"?"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1 h-8":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-1","bg-border-muted rounded-full opacity-0 group-hover:opacity-100 transition-opacity")})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto flex-1",o==="horizontal"?"h-full":"w-full"),children:h})]})})}function Ql({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}function ec({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}Vo.Main=Ql;Vo.Aside=ec;function Kb(e,t){return lr({value:e,formatter:t,emptyClassName:"text-text-muted",emptyText:"\u2014"})}function _b(e){if(e.thresholds&&e.value!==null&&e.value!==void 0){for(let t of e.thresholds)if(t.when(e.value))return t.tone}return e.tone}var Zb={neutral:"text-text-body",success:"text-feedback-success",warning:"text-feedback-warning",error:"text-feedback-error",info:"text-feedback-info"};function Ub({item:e,dense:t,valueAlign:r}){let o=_b(e),n=o?Zb[o]:"",a=Kb(e.value,e.formatter),i=typeof e.copyable=="function"?e.copyable(e.value):String(e.value),l=jsxRuntime.jsx("span",{className:e.href?"hover:underline cursor-pointer":"",children:a}),s=jsxRuntime.jsxs("dd",{className:tailwindMerge.twMerge(t?"text-sm":"text-base","font-medium",r==="start"?"text-left":"text-right",n,e.disabled&&"opacity-50"),children:[e.copyable?jsxRuntime.jsxs(no,{value:i,size:"sm",className:"flex items-center gap-1",children:[l,e.iconRight]}):jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[l,e.iconRight]}),e.meta&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-xs text-text-muted mt-0.5",r==="start"?"text-left":"text-right"),children:e.meta})]}),d=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("dt",{className:tailwindMerge.twMerge(t?"text-xs":"text-sm","text-text-caption truncate","flex items-center gap-1",e.disabled&&"opacity-50"),children:[e.iconLeft,jsxRuntime.jsx("span",{title:typeof e.label=="string"?e.label:void 0,children:e.label}),e.tooltip&&jsxRuntime.jsx(v,{name:"Question",size:10,className:"text-text-muted","aria-label":"More information"})]}),e.href?jsxRuntime.jsx("a",{href:e.href,onClick:e.onAction,className:"block",children:s}):s]});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid grid-cols-[1fr_auto] items-start",t?"gap-x-2":"gap-x-4"),children:d})}function tc({items:e,layout:t="one-column",dense:r=false,valueAlign:o="end",showDividers:n=false,skeleton:a=false,empty:i=false,error:l,className:s}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",s),children:Array.from({length:e.length||4}).map((d,p)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-start gap-x-4",children:[jsxRuntime.jsx(z,{className:"h-4 w-24"}),jsxRuntime.jsx(z,{className:"h-5 w-16"})]},p))}):l?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-feedback-error",s),children:l}):i||!e.length?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-text-muted",s),children:"No data available"}):jsxRuntime.jsx("dl",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",s),children:e.map((d,p)=>jsxRuntime.jsxs(lt__namespace.default.Fragment,{children:[n&&p>0&&t==="one-column"&&jsxRuntime.jsx("div",{className:"col-span-full border-t border-border-default -mt-1 mb-1"}),jsxRuntime.jsx(Ub,{item:d,dense:r,valueAlign:o})]},d.id))})}function Xb({isSelected:e,isDisabled:t}){return ["flex h-4 w-7 px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",ae,e?"bg-gray-700 dark:bg-zinc-300 forced-colors:!bg-[Highlight] group-pressed:bg-gray-800 dark:group-pressed:bg-zinc-200":"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",t?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function Yb({isSelected:e,isDisabled:t}){return ["h-3 w-3 transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",e?"translate-x-[100%]":"translate-x-0",t?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function rc({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...t,className:j(t.className,"group flex items-center gap-2 text-sm text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]"),children:r=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Xb(r),children:jsxRuntime.jsx("span",{className:Yb(r)})}),e]})})}var tx=e=>{let t=Oe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":"resize-y"}`;return tailwindMerge.twMerge(t,r,e.className)};function oc({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:i,isInvalid:l,isDisabled:s,className:d,validationResult:p,...c}){let{isFocused:u,handleFocus:m,handleBlur:b}=Ze();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Ue,{children:jsxRuntime.jsx("textarea",{...c,required:a,onFocus:f=>{c.onFocus&&c.onFocus(f),m(f);},onBlur:f=>{c.onBlur&&c.onBlur(f),b(f);},className:tx({isInvalid:l,isDisabled:s,isFocused:u,size:o,transparent:i,className:d}),disabled:s})}),t&&jsxRuntime.jsx(ee,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&p&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(p)})]})})}function sc({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:i,isInvalid:l,isDisabled:s,className:d,validationResult:p,value:c="",onChange:u,chips:m=[],onChipsChange:b,triggerPattern:f="{{",onTriggerDetected:x,onTriggerDismissed:h,renderChip:y,chipVariant:S="primary",chipSize:F,...w}){let T=lt.useRef(null),{isFocused:L,handleFocus:C,handleBlur:k}=Ze(),I=F||"sm",A=lt.useRef(null),g=lt.useCallback(E=>{let G="",X=M=>{if(M.nodeType===Node.TEXT_NODE){if(!M.parentElement?.closest("[data-chip-id]")){let $=M.textContent||"";G+=$;}}else if(M.nodeType===Node.ELEMENT_NODE){let R=M;if(R.hasAttribute("data-chip-id")){let $=R.getAttribute("data-chip-id");G+=`{{${$}}}`;return}else if(R.tagName==="BR"){G+=`
|
|
81
|
+
`;return}else R.tagName;}for(let R=0;R<M.childNodes.length;R++)X(M.childNodes[R]);};return X(E),G},[]),N=lt.useCallback((E,G)=>{let X=document.createTreeWalker(E,NodeFilter.SHOW_TEXT,{acceptNode:O=>{let ce=O.parentElement;return ce&&ce.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),M=X.nextNode(),R=Math.max(0,G);for(;M;){let O=M.nodeValue||"";if(O.length>=R){let ce=document.createRange();ce.setStart(M,R),ce.collapse(true);let nt=window.getSelection();nt?.removeAllRanges(),nt?.addRange(ce);return}R-=O.length,M=X.nextNode();}let $=window.getSelection(),V=document.createRange();V.selectNodeContents(E),V.collapse(false),$?.removeAllRanges(),$?.addRange(V);},[]);lt.useEffect(()=>{T.current&&!c&&T.current.textContent!==""&&(T.current.textContent="");},[c]),lt.useLayoutEffect(()=>{if(T.current){if(c===""){if(L)try{T.current.focus({preventScroll:!0}),N(T.current,0);}catch{}return}if(A.current!=null)try{N(T.current,A.current);}finally{A.current=null;}}},[c,N,L]);let K=lt.useCallback((E,G)=>{if(u?.(E),E===""){h?.();return}if(f&&x&&G!==void 0){let X=E.slice(0,G),M=typeof f=="string"?new RegExp(`\\${f}([^\\s]*)$`):f,R=X.match(M);if(R){let $=R[1]||"",V=G-R[0].length;x({query:$,position:G,startIndex:V});}else h?.();}},[u,f,x,h]),B=lt.useCallback(E=>{if(!b||!u)return;let G=m.filter(M=>M.id!==E);b(G);let X=c.replace(new RegExp(`\\{\\{${E}\\}\\}`,"g"),"");u(X);},[m,b,c,u]),U=lt.useCallback(E=>y?y(E,()=>B(E.id)):jsxRuntime.jsx(Bt,{variant:S,size:I,onRemove:s?void 0:()=>B(E.id),isDisabled:s,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:E.label},E.id),[y,S,I,B,s]),re=()=>{let E=Oe({isInvalid:l,isDisabled:s,isFocused:L,transparent:i,size:o}),G=`min-h-[100px] py-2 px-3 ${s?"resize-none":"resize-y"}`,X=tailwindMerge.twMerge("focus:outline-none overflow-auto","[&_[data-chip-id]::selection]:bg-action-primary/20","[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-text-placeholder [&:empty]:before:pointer-events-none");return tailwindMerge.twMerge(E,G,X,d)},ne=()=>c?c.split(/(\{\{[^}]+\}\})/g).map((G,X)=>{let M=G.match(/\{\{([^}]+)\}\}/);if(M){let R=M[1],$=m.find(V=>V.id===R);if($)return jsxRuntime.jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":R,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:V=>{V.preventDefault();let O=window.getSelection(),ce=document.createRange();ce.selectNode(V.currentTarget),O?.removeAllRanges(),O?.addRange(ce);},children:U($)},`chip-${R}-${X}`)}return G.includes(`
|
|
82
|
+
`)?G.split(`
|
|
83
|
+
`).map((R,$)=>jsxRuntime.jsxs(lt__namespace.default.Fragment,{children:[R,$<G.split(`
|
|
84
|
+
`).length-1&&jsxRuntime.jsx("br",{})]},`line-${X}-${$}`)):G}):null;return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Y,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(Ue,{children:jsxRuntime.jsx("div",{ref:T,contentEditable:!s,suppressContentEditableWarning:true,onInput:E=>{if(s)return;let G=E.target,X=G.querySelector("[data-chip-id]")!==null,M;if(X?(M=g(G),M=M.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):M=G.textContent||"",M===""){try{let V=document.createRange();V.selectNodeContents(G),V.collapse(!0);let O=window.getSelection();O?.removeAllRanges(),O?.addRange(V),A.current=0;}catch{}K("",0);return}if(M===c)return;let R=window.getSelection(),$=0;if(R&&R.rangeCount>0)try{let V=R.getRangeAt(0);if(X){let O=0,ce=!1,nt=ve=>{if(ce)return !0;if(ve===V.startContainer)return O+=V.startOffset,ce=!0,!0;if(ve.nodeType===Node.TEXT_NODE){if(!ve.parentElement?.closest("[data-chip-id]")){if(ve.contains(V.startContainer))return O+=V.startOffset,ce=!0,!0;O+=(ve.textContent||"").length;}}else if(ve.nodeType===Node.ELEMENT_NODE){let Ne=ve;if(Ne.hasAttribute("data-chip-id")){if(Ne.contains(V.startContainer)||Ne===V.startContainer){let fc=Ne.getAttribute("data-chip-id");return O+=`{{${fc}}}`.length,ce=!0,!0}let mc=Ne.getAttribute("data-chip-id");return O+=`{{${mc}}}`.length,!1}else if(Ne.tagName==="BR")return Ne===V.startContainer?(ce=!0,!0):(O+=1,!1)}for(let Ne=0;Ne<ve.childNodes.length;Ne++)if(nt(ve.childNodes[Ne]))return !0;return !1};nt(G),$=O;}else {let O=document.createRange();O.setStart(G,0),O.setEnd(V.startContainer,V.startOffset),$=O.toString().length;}}catch{$=M.length;}A.current=$,K(M,$);},onKeyDown:E=>{if(s)return;let G=window.getSelection();if(!(!G||G.rangeCount===0))try{let X=G.getRangeAt(0),M=X.commonAncestorContainer;if(E.key==="ArrowLeft"||E.key==="ArrowRight"){let R=M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]");if(R){E.preventDefault();try{let $=document.createRange(),V=window.getSelection();E.key==="ArrowLeft"?$.setStartBefore(R):$.setStartAfter(R),$.collapse(!0),V?.removeAllRanges(),V?.addRange($);}catch{}}}if(E.key==="Backspace"){let R=null;if(R=(M.nodeType===Node.TEXT_NODE?M.parentElement?.closest("[data-chip-id]"):M.closest("[data-chip-id]"))||null,!R)if(M.nodeType===Node.TEXT_NODE){let $=M;if(X.startOffset===0&&$.parentElement){let V=$.previousSibling;if(V&&V.nodeType===Node.ELEMENT_NODE){let O=V.closest("[data-chip-id]");O&&(R=O);}}}else {let $=M;if(X.startOffset>0){let V=$.childNodes[X.startOffset-1];if(V&&V.nodeType===Node.ELEMENT_NODE){let O=V.closest("[data-chip-id]");O&&(R=O);}}}if(R){E.preventDefault(),E.stopPropagation();let $=R.getAttribute("data-chip-id");if(!$)return;let V=`{{${$}}}`,O=c.indexOf(V);if(O!==-1){let ce=c.slice(0,O)+c.slice(O+V.length),nt=m.filter(ve=>ve.id!==$);A.current=O;try{window.getSelection()?.removeAllRanges();}catch{}b?.(nt),u?.(ce);}}}}catch{}},onFocus:E=>{s||(w.onFocus&&w.onFocus(E),C(E));},onBlur:E=>{s||(w.onBlur&&w.onBlur(E),k(E));},className:re(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...w.style},"data-placeholder":w.placeholder,children:ne()},c===""?"empty":"content")}),t&&jsxRuntime.jsx(ee,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r}),typeof r=="function"&&p&&jsxRuntime.jsx(q,{size:o,className:"mt-1",children:r(p)})]})})}var px=e=>tailwindMerge.twMerge("w-full",Dt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),qr({transparent:e.transparent,isDisabled:e.isDisabled}),_[e.size||"md"].text,_[e.size||"md"].height,_[e.size||"md"].padding,"pl-[var(--control-padding-sm)]","flex items-center gap-0.5",e.className),mx=({isPlaceholder:e,isDisabled:t,isFocused:r,size:o="md"})=>tailwindMerge.twMerge("outline-none rounded transition-colors box-content tabular-nums text-center",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text",_[o].text,"px-0.5 -my-0.5",r&&"!outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]",!t&&!r&&"hover:bg-text-body/[0.05]");function cc({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,validationResult:l,...s}){let{isFocused:d}=Ze(),[p,c]=lt.useState(null),u=lt.useRef(null);return lt.useEffect(()=>{let m=x=>{let h=x.target;h.hasAttribute("data-type")&&c(h.getAttribute("data-type"));},b=()=>{c(null);},f=u.current;return f&&(f.addEventListener("focusin",m),f.addEventListener("focusout",b)),()=>{f&&(f.removeEventListener("focusin",m),f.removeEventListener("focusout",b));}},[]),jsxRuntime.jsx(reactAriaComponents.TimeField,{...s,children:({isDisabled:m,isInvalid:b})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Y,{isRequired:a,tooltip:n,children:e}),jsxRuntime.jsx(reactAriaComponents.DateInput,{ref:u,className:px({size:o,transparent:i,isDisabled:m,isInvalid:b,isFocused:d}),children:f=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:f,className:mx({isPlaceholder:f.isPlaceholder,isDisabled:!f.isEditable,isFocused:p===f.type,size:o})})}),t&&jsxRuntime.jsx(ee,{children:t}),typeof r=="string"?jsxRuntime.jsx(q,{children:r}):null]})})}var xx="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",dc={default:{selected:"bg-text-body text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"},primary:{selected:"bg-action-primary text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},hx="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",yx="opacity-100 cursor-pointer",vx={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Cx={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function Nx(e){let{variant:t="default",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:l}=e,s=`${xx} ${n?dc[t].selected:dc[t].unselected}`;return s+=` ${_[r].text} ${_[r].height} ${_[r].padding} ${_[r].gap}`,s+=` ${o?hx:yx}`,a==="left"&&(s+=" rounded-l-sm"),a==="right"&&(s+=" rounded-r-sm"),i&&(s+=" border-r"),l&&(s+=" border-l"),s+=` ${ae()}`,tailwindMerge.twMerge(s)}function pc(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:l=false,loadingText:s,loadingIndicator:d,size:p="md",badgeNumber:c,badgeVariant:u="primary",badgePosition:m="top-right",...b}=e,f=n?jsxRuntime.jsx(v,{name:n,className:`icon-[--control-icon-size-${p}]`,weight:i}):null,x=()=>{let y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return l?jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d||jsxRuntime.jsx(v,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${p}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),s&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:s})]}):y},h=jsxRuntime.jsx(reactAriaComponents.ToggleButton,{onPress:o,...b,className:tailwindMerge.twMerge(Nx(e),t),"aria-busy":l,children:x()});return c&&c>0?jsxRuntime.jsxs("div",{className:"relative",children:[h,jsxRuntime.jsx("span",{className:`absolute ${vx[m]} flex h-5 w-5 items-center justify-center rounded-full ${Cx[u]} text-xs`,"aria-label":`${c} items`,children:c})]}):h}exports.ActionCell=as;exports.ActionMenu=pi;exports.AppShell=gi;exports.AreaSeries=Vt;exports.AutoMobileRenderer=xo;exports.Autocomplete=Yr;exports.Avatar=Fi;exports.Badge=At;exports.BarSeries=Ht;exports.BooleanCell=is;exports.Breadcrumb=eo;exports.Breadcrumbs=Qr;exports.Button=H;exports.Calendar=to;exports.Card=Ae;exports.CardMobileRenderer=ho;exports.ChartAxis=hr;exports.ChartBottomBar=so;exports.ChartContainer=ts;exports.ChartContext=ao;exports.ChartTooltip=lo;exports.Checkbox=br;exports.CheckboxGroup=op;exports.Chip=Bt;exports.ClearButton=wi;exports.CodeEditor=_i;exports.ColorModeProvider=Si;exports.CopyToClipboard=no;exports.DataTable=gs;exports.DateCell=ss;exports.DateField=bs;exports.DateRangePicker=ys;exports.Description=ee;exports.Dialog=Ut;exports.DialogHeader=qt;exports.Drawer=ea;exports.ErrorBoundary=Xt;exports.FieldError=q;exports.FieldGroup=Xr;exports.FileUpload=Ss;exports.Form=ws;exports.FormatRegistry=P;exports.Grid=ta;exports.Heading=Ee;exports.Icon=v;exports.Input=Pi;exports.InputWrapper=Ue;exports.InteractiveMap=hl;exports.Kpi=Ls;exports.KpiGroup=oa;exports.Label=Y;exports.LineSeries=Ot;exports.List=Ds;exports.ListBox=Df;exports.ListBoxItem=ut;exports.ListHeader=Gs;exports.ListItem=Os;exports.ListPane=Ws;exports.Loader=_s;exports.Logo=Wr;exports.MAP_TYPES=gl;exports.Meter=Cl;exports.Notice=Fo;exports.NoticeContainer=Mo;exports.NoticeProvider=Sl;exports.NumberCell=ls;exports.NumberField=Tl;exports.PageLayout=tt;exports.PlaceSearch=Bl;exports.Popover=pt;exports.ProgressBar=zl;exports.Radio=Gl;exports.RadioGroup=Hl;exports.RangeCalendar=yo;exports.RichTextEditor=Kl;exports.SKELETON_SIZES=bt;exports.Section=Zl;exports.SegmentedControl=ql;exports.Select=So;exports.SelectCell=cs;exports.SideNav=Kr;exports.Skeleton=z;exports.Slider=Xl;exports.SplitPane=Vo;exports.StatList=tc;exports.StaticMap=vl;exports.Switch=rc;exports.Tab=$o;exports.TabList=Ao;exports.TabPanel=Rl;exports.Tabs=Do;exports.TextArea=oc;exports.TextAreaWithChips=sc;exports.TextCell=ds;exports.TextField=Yt;exports.TextLink=Ln;exports.TimeField=cc;exports.ToggleButton=pc;exports.Tooltip=Dn;exports.TopNav=cr;exports.autoScaleCurrent=Ec;exports.autoScaleDistance=Aa;exports.autoScaleEnergy=za;exports.autoScalePower=Oc;exports.autoScaleResistance=Wc;exports.autoScaleVoltage=Xc;exports.camelCaseToWords=ri;exports.capitalize=ei;exports.celsiusToFahrenheit=Kc;exports.celsiusToKelvin=Mh;exports.centimetersToInches=ph;exports.clearColorCache=Et;exports.createCategoryColorMap=wd;exports.createFormat=ty;exports.createXScale=$n;exports.createYScale=Bn;exports.defaultMargin=oe;exports.enumToSentenceCase=jc;exports.exportChart=On;exports.fahrenheitToCelsius=_c;exports.fahrenheitToKelvin=Ih;exports.feetToMeters=oh;exports.feetToMiles=ih;exports.formatBoolean=La;exports.formatComponentValue=lr;exports.formatCurrency=Ia;exports.formatCurrent=Oo;exports.formatDate=Ea;exports.formatDistance=$a;exports.formatEmptyValue=uo;exports.formatEnergy=Xo;exports.formatFieldValue=sr;exports.formatInternationalPhone=Yo;exports.formatNumber=Ma;exports.formatPhone=Ga;exports.formatPhoneNumber=Ha;exports.formatPower=tn;exports.formatResistance=on;exports.formatTemperature=qa;exports.formatText=si;exports.formatUSPhone=zr;exports.formatVoltage=sn;exports.getBadgeClasses=rs;exports.getBooleanBadgeVariant=os;exports.getCellAlignmentClasses=Un;exports.getCellContainerClasses=se;exports.getCellTextClasses=$e;exports.getContrastingTextColor=Pd;exports.getDateParts=Yx;exports.getDefaultChartColor=yn;exports.getDefaultColors=vi;exports.getExportFormatName=Qp;exports.getFieldGroupStyles=pr;exports.getInputBackgroundStyles=qr;exports.getInputBaseStyles=Oe;exports.getInputStateStyles=Dt;exports.getNumericColorClasses=po;exports.getResolvedColor=ct;exports.getSkeletonSize=Be;exports.getThemeCategoricalColors=jr;exports.getYFormatSettings=Gt;exports.inchesToCentimeters=uh;exports.isCustomPinsLayer=pa;exports.isExportSupported=Jp;exports.isGeoJsonLayer=ua;exports.isLightColor=Ci;exports.isNil=D;exports.isRasterLayer=ma;exports.isVectorLayer=da;exports.kelvinToCelsius=Zc;exports.kelvinToFahrenheit=Eh;exports.kilometersToMiles=ah;exports.layer=ca;exports.metersToFeet=rh;exports.metersToMiles=sh;exports.metersToYards=dh;exports.milesToFeet=Da;exports.milesToKilometers=nh;exports.milesToMeters=lh;exports.parseBoolean=_e;exports.resolveValue=Ce;exports.snakeCaseToWords=oi;exports.temperatureStringToSymbol=Ka;exports.toA=Zx;exports.toActiveInactive=Sc;exports.toAmps=Vr;exports.toBoolean=Ke;exports.toCelsius=Za;exports.toCentimeters=zc;exports.toCheckmark=Pc;exports.toCompactNumber=Mc;exports.toCurrency=Fa;exports.toCustomDateFormat=Vc;exports.toDateString=Dc;exports.toEnabledDisabled=Cc;exports.toFahrenheit=_a;exports.toFeet=_o;exports.toFloat=Lc;exports.toFormattedNumber=Fc;exports.toFullDateTime=$c;exports.toGW=wh;exports.toGWh=Va;exports.toGigawatts=en;exports.toISOString=Bc;exports.toInches=Gc;exports.toInteger=Rc;exports.toKA=Ux;exports.toKV=Gh;exports.toKW=Nh;exports.toKelvin=Ua;exports.toKiloamps=Go;exports.toKilohms=Oa;exports.toKilometers=Ko;exports.toKilovolts=an;exports.toKilowatts=Jo;exports.toLowerCase=Ya;exports.toMA=_x;exports.toMV=zh;exports.toMW=Sh;exports.toMWh=Ba;exports.toMegawatts=Qo;exports.toMegohms=Wa;exports.toMeters=Wo;exports.toMiles=Zo;exports.toMilliamps=Ho;exports.toMillimeters=Hc;exports.toMilliohms=rn;exports.toMillivolts=nn;exports.toNauticalMiles=th;exports.toOhms=Gr;exports.toOnOff=Nc;exports.toPercentage=Tc;exports.toRelativeTime=Ac;exports.toScientificNotation=Ic;exports.toSecret=qc;exports.toSentenceCase=Ja;exports.toTemperature=ja;exports.toTitleCase=Qa;exports.toTrueFalse=wc;exports.toUpperCase=Xa;exports.toV=Hh;exports.toVolts=Or;exports.toW=Ch;exports.toWatts=Hr;exports.toWh=jo;exports.toYards=Uo;exports.tokWh=qo;exports.truncateEnd=ii;exports.truncateMiddle=ni;exports.truncateStart=ai;exports.ucFirst=ti;exports.useChartContext=ft;exports.useColorMode=Re;exports.useComponentFormatter=Vx;exports.useDebounce=$r;exports.useInputFocus=Ze;exports.useLocalStorage=Ra;exports.useNotice=Pl;exports.yardsToMeters=ch;//# sourceMappingURL=index.cjs.map
|
|
85
85
|
//# sourceMappingURL=index.cjs.map
|