feature_map 1.2.6 → 1.2.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20d96ad4e61fb28fc9891cf32dd7e6102dbfb6d48d4a114973390cb5fc2fc805
4
- data.tar.gz: 951a84a6a993a8b03b7899c51b5e55e3ab3fcf356f90e122574658a3696da5cd
3
+ metadata.gz: 00c14ab0325750314e2ba3d4106396c2cf8eaa9e66677ad35a90db4d264119b2
4
+ data.tar.gz: 99907c175bdd0a1b2e6e45f43ee7f4bf05c4a79e451d8d7908f18cceb2af1e76
5
5
  SHA512:
6
- metadata.gz: 3256049f99d24a887bc0644cbb64a1c7bcd8a305b23b019a864d68f84c101b342e742d236dfe85d1739cbc88dc4a42130b7fc25e5fc4de744a939f2ea3a77934
7
- data.tar.gz: 57f6b8091fa32823b5f199c0f0cad7fa8b0be3b15eabb9ecee7f16e2357be7234cd2931a8f2a6ecf984792b7a56103f9956a3241c2cae9130c0cfe48e9baf7da
6
+ metadata.gz: 663ed0b8debf95d4af7cc2248834a2333979dd3f1c6f9a7ef6be4e41370a126b69653c19b8374e3472d10a6a5dc862bb10bdf3647ca2ab50f966aa250f9a2148
7
+ data.tar.gz: 22ad967c5af673d779a851a0422852d543eb5d0e811a862ca2c078677578189acaeb97d7d3470952d949448547bad2ae87c2ddae96e6d7c4d909e2475311f631
@@ -73,6 +73,9 @@ module FeatureMap
73
73
  end
74
74
 
75
75
  class Feature
76
+ LABEL_PREFIX = 'Feature '
77
+ LABEL_LIMIT = 50
78
+
76
79
  def self.from_yml(config_yml)
77
80
  hash = YAML.load_file(config_yml)
78
81
 
@@ -101,6 +104,13 @@ module FeatureMap
101
104
  Plugins::Identity.for(self).identity.name
102
105
  end
103
106
 
107
+ def label
108
+ # NOTE: Certain uses of feature labels have character
109
+ # limits. This allows us to stay comfortably within
110
+ # most without overly complex configuration.
111
+ "#{LABEL_PREFIX}#{name}"[0...LABEL_LIMIT]
112
+ end
113
+
104
114
  def to_tag
105
115
  CodeFeatures.tag_value_for(name)
106
116
  end
@@ -269,7 +269,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
269
269
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(d=>` - ${d}`).join(`
270
270
  `)].join(`
271
271
  `))}else{let d=c.props,p=d==null?void 0:d.className,h=typeof p=="function"?(...y)=>gg(p(...y),s.className):gg(p,s.className),m=h?{className:h}:{},w=hA(c.props,Fr(Rh(s,["ref"])));for(let y in f)y in w&&delete f[y];return b.cloneElement(c,Object.assign({},w,f,u,{ref:i(fle(c),u.ref)},m))}return b.createElement(a,Object.assign({},Rh(s,["ref"]),a!==b.Fragment&&u,a!==b.Fragment&&f),c)}function ule(){let e=b.useRef([]),t=b.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function cle(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function hA(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var a;return(a=i==null?void 0:i.preventDefault)==null?void 0:a.call(i)}]);for(let r in n)Object.assign(t,{[r](i,...a){let o=n[r];for(let l of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;l(i,...a)}}});return t}function dp(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];for(let r in n)Object.assign(t,{[r](...i){let a=n[r];for(let o of a)o==null||o(...i)}});return t}function Ee(e){var t;return Object.assign(b.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Fr(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Rh(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function fle(e){return j.version.split(".")[0]>="19"?e.props.ref:e.ref}function dle(e,t,n){let[r,i]=b.useState(n),a=e!==void 0,o=b.useRef(a),l=b.useRef(!1),s=b.useRef(!1);return a&&!o.current&&!l.current?(l.current=!0,o.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&o.current&&!s.current&&(s.current=!0,o.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Q(u=>(a||i(u),t==null?void 0:t(u)))]}function ple(e){let[t]=b.useState(e);return t}function mA(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))gA(n,vA(t,r),i);return n}function vA(e,t){return e?e+"["+t+"]":t}function gA(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())gA(e,vA(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):mA(n,t,e)}function hle(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let i of r.elements)if(i!==e&&(i.tagName==="INPUT"&&i.type==="submit"||i.tagName==="BUTTON"&&i.type==="submit"||i.nodeName==="INPUT"&&i.type==="image")){i.click();return}(n=r.requestSubmit)==null||n.call(r)}}let mle="span";var ea=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ea||{});function vle(e,t){var n;let{features:r=1,...i}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Re()({ourProps:a,theirProps:i,slot:{},defaultTag:mle,name:"Hidden"})}let So=Ee(vle),yA=b.createContext(null);function gle(e){let[t,n]=b.useState(null);return j.createElement(yA.Provider,{value:{target:t}},e.children,j.createElement(So,{features:ea.Hidden,ref:n}))}function yle({children:e}){let t=b.useContext(yA);if(!t)return j.createElement(j.Fragment,null,e);let{target:n}=t;return n?Ht.createPortal(j.createElement(j.Fragment,null,e),n):null}function xle({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[a,o]=b.useState(null),l=sa();return b.useEffect(()=>{if(r&&a)return l.addEventListener(a,"reset",r)},[a,t,r]),j.createElement(yle,null,j.createElement(ble,{setForm:o,formId:t}),mA(e).map(([s,u])=>j.createElement(So,{features:ea.Hidden,...Fr({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:u,...i})})))}function ble({setForm:e,formId:t}){return b.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:j.createElement(So,{features:ea.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xA=b.createContext(void 0);function bA(){return b.useContext(xA)}function wle({id:e,children:t}){return j.createElement(xA.Provider,{value:e},t)}function G0(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&_le(n)?!1:r}function _le(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let wA=Symbol();function Sle(e,t=!0){return Object.assign(e,{[wA]:t})}function ot(...e){let t=b.useRef(e);b.useEffect(()=>{t.current=e},[e]);let n=Q(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[wA]))?void 0:n}let pp=b.createContext(null);pp.displayName="DescriptionContext";function _A(){let e=b.useContext(pp);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,_A),t}return e}function Ele(){var e,t;return(t=(e=b.useContext(pp))==null?void 0:e.value)!=null?t:void 0}function cu(){let[e,t]=b.useState([]);return[e.length>0?e.join(" "):void 0,b.useMemo(()=>function(n){let r=Q(a=>(t(o=>[...o,a]),()=>t(o=>{let l=o.slice(),s=l.indexOf(a);return s!==-1&&l.splice(s,1),l}))),i=b.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return j.createElement(pp.Provider,{value:i},n.children)},[t])]}let Ole="p";function $le(e,t){let n=b.useId(),r=uu(),{id:i=`headlessui-description-${n}`,...a}=e,o=_A(),l=ot(t);he(()=>o.register(i),[i,o.register]);let s=r||!1,u=b.useMemo(()=>({...o.slot,disabled:s}),[o.slot,s]),c={ref:l,...o.props,id:i};return Re()({ourProps:c,theirProps:a,slot:u,defaultTag:Ole,name:o.name||"Description"})}let Ple=Ee($le),SA=Object.assign(Ple,{});var Ne=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ne||{});let hp=b.createContext(null);hp.displayName="LabelContext";function q0(){let e=b.useContext(hp);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,q0),t}return e}function EA(e){var t,n,r;let i=(n=(t=b.useContext(hp))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[i,...e].filter(Boolean).join(" "):i}function fu({inherit:e=!1}={}){let t=EA(),[n,r]=b.useState([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,b.useMemo(()=>function(a){let o=Q(s=>(r(u=>[...u,s]),()=>r(u=>{let c=u.slice(),f=c.indexOf(s);return f!==-1&&c.splice(f,1),c}))),l=b.useMemo(()=>({register:o,slot:a.slot,name:a.name,props:a.props,value:a.value}),[o,a.slot,a.name,a.props,a.value]);return j.createElement(hp.Provider,{value:l},a.children)},[r])]}let jle="label";function Tle(e,t){var n;let r=b.useId(),i=q0(),a=bA(),o=uu(),{id:l=`headlessui-label-${r}`,htmlFor:s=a??((n=i.props)==null?void 0:n.htmlFor),passive:u=!1,...c}=e,f=ot(t);he(()=>i.register(l),[l,i.register]);let d=Q(w=>{let y=w.currentTarget;if(y instanceof HTMLLabelElement&&w.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(w),y instanceof HTMLLabelElement){let g=document.getElementById(y.htmlFor);if(g){let x=g.getAttribute("disabled");if(x==="true"||x==="")return;let E=g.getAttribute("aria-disabled");if(E==="true"||E==="")return;(g instanceof HTMLInputElement&&(g.type==="radio"||g.type==="checkbox")||g.role==="radio"||g.role==="checkbox"||g.role==="switch")&&g.click(),g.focus({preventScroll:!0})}}}),p=o||!1,h=b.useMemo(()=>({...i.slot,disabled:p}),[i.slot,p]),m={ref:f,...i.props,id:l,htmlFor:s,onClick:d};return u&&("onClick"in m&&(delete m.htmlFor,delete m.onClick),"onClick"in c&&delete c.onClick),Re()({ourProps:m,theirProps:c,slot:h,defaultTag:s?jle:"div",name:i.name||"Label"})}let Ale=Ee(Tle),Cle=Object.assign(Ale,{}),kle=b.createContext(()=>{});function Nle({value:e,children:t}){return j.createElement(kle.Provider,{value:e},t)}function Mle(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Ile(e=Mle){return b.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Rle(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Lle(e,t=!1){let[n,r]=b.useReducer(()=>({}),{}),i=b.useMemo(()=>Rle(e),[e,n]);return he(()=>{if(!e)return;let a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect()}},[e]),t?{width:`${i.width}px`,height:`${i.height}px`}:i}let Dle=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function OA(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...a){let o=t[i].call(n,...a);o&&(n=o,r.forEach(l=>l()))}}}function $A(e){return b.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Fle=new Dle(()=>OA(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function Wo(e,t){let n=Fle.get(t),r=b.useId(),i=$A(n);if(he(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let a=i.indexOf(r),o=i.length;return a===-1&&(a=o,o+=1),a===o-1}let yg=new Map,Rl=new Map;function XS(e){var t;let n=(t=Rl.get(e))!=null?t:0;return Rl.set(e,n+1),n!==0?()=>YS(e):(yg.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>YS(e))}function YS(e){var t;let n=(t=Rl.get(e))!=null?t:1;if(n===1?Rl.delete(e):Rl.set(e,n-1),n!==1)return;let r=yg.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,yg.delete(e))}function PA(e,{allowed:t,disallowed:n}={}){let r=Wo(e,"inert-others");he(()=>{var i,a;if(!r)return;let o=Zn();for(let s of(i=n==null?void 0:n())!=null?i:[])s&&o.add(XS(s));let l=(a=t==null?void 0:t())!=null?a:[];for(let s of l){if(!s)continue;let u=vi(s);if(!u)continue;let c=s.parentElement;for(;c&&c!==u.body;){for(let f of c.children)l.some(d=>f.contains(d))||o.add(XS(f));c=c.parentElement}}return o.dispose},[r,t,n])}function jA(e,t,n){let r=Nr(i=>{let a=i.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&n()});b.useEffect(()=>{if(!e)return;let i=t===null?null:t instanceof HTMLElement?t:t.current;if(!i)return;let a=Zn();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(i));o.observe(i),a.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(i));o.observe(i),a.add(()=>o.disconnect())}return()=>a.dispose()},[t,r,e])}let Kf=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Ble=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _t=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(_t||{}),Ds=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ds||{}),zle=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zle||{});function TA(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Kf)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ule(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ble)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var X0=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(X0||{});function Y0(e,t=0){var n;return e===((n=vi(e))==null?void 0:n.body)?!1:jn(t,{0(){return e.matches(Kf)},1(){let r=e;for(;r!==null;){if(r.matches(Kf))return!0;r=r.parentElement}return!1}})}function AA(e){let t=vi(e);Zn().nextFrame(()=>{t&&!Y0(t.activeElement,0)&&Gn(e)})}var Hle=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Hle||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Gn(e){e==null||e.focus({preventScroll:!0})}let Wle=["textarea","input"].join(",");function Vle(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Wle))!=null?n:!1}function Q0(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Kle(e,t){return ii(TA(),t,{relativeTo:e})}function ii(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?Q0(e):e:t&64?Ule(e):TA(e);i.length>0&&o.length>1&&(o=o.filter(p=>!i.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===p:h===p))),r=r??a.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},c=0,f=o.length,d;do{if(c>=f||c+f<=0)return 0;let p=s+c;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}d=o[p],d==null||d.focus(u),c+=l}while(d!==a.activeElement);return t&6&&Vle(d)&&d.select(),2}function CA(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Gle(){return/Android/gi.test(window.navigator.userAgent)}function qle(){return CA()||Gle()}function fl(e,t,n,r){let i=Nr(n);b.useEffect(()=>{if(!e)return;function a(o){i.current(o)}return document.addEventListener(t,a,r),()=>document.removeEventListener(t,a,r)},[e,t,r])}function kA(e,t,n,r){let i=Nr(n);b.useEffect(()=>{if(!e)return;function a(o){i.current(o)}return window.addEventListener(t,a,r),()=>window.removeEventListener(t,a,r)},[e,t,r])}const QS=30;function NA(e,t,n){let r=Wo(e,"outside-click"),i=Nr(n),a=b.useCallback(function(s,u){if(s.defaultPrevented)return;let c=u(s);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let f=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of f)if(d!==null&&(d.contains(c)||s.composed&&s.composedPath().includes(d)))return;return!Y0(c,X0.Loose)&&c.tabIndex!==-1&&s.preventDefault(),i.current(s,c)},[i,t]),o=b.useRef(null);fl(r,"pointerdown",s=>{var u,c;o.current=((c=(u=s.composedPath)==null?void 0:u.call(s))==null?void 0:c[0])||s.target},!0),fl(r,"mousedown",s=>{var u,c;o.current=((c=(u=s.composedPath)==null?void 0:u.call(s))==null?void 0:c[0])||s.target},!0),fl(r,"click",s=>{qle()||o.current&&(a(s,()=>o.current),o.current=null)},!0);let l=b.useRef({x:0,y:0});fl(r,"touchstart",s=>{l.current.x=s.touches[0].clientX,l.current.y=s.touches[0].clientY},!0),fl(r,"touchend",s=>{let u={x:s.changedTouches[0].clientX,y:s.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=QS||Math.abs(u.y-l.current.y)>=QS))return a(s,()=>s.target instanceof HTMLElement?s.target:null)},!0),kA(r,"blur",s=>a(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Vo(...e){return b.useMemo(()=>vi(...e),[...e])}function MA(e,t,n,r){let i=Nr(n);b.useEffect(()=>{e=e??window;function a(o){i.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Xle(e,t){return b.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Yle(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=(n=t.defaultView)!=null?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,"paddingRight",`${a}px`)}}}function Qle(){return CA()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(a=>a()).some(a=>a.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Zn();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let s=l.target.closest("a");if(!s)return;let{hash:u}=new URL(s.href),c=e.querySelector(u);c&&!r(c)&&(o=c)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(r(l.target)){let s=l.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement){if(l.target.tagName==="INPUT")return;if(r(l.target)){let s=l.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let s=(l=window.scrollY)!=null?l:window.pageYOffset;a!==s&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Zle(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Jle(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ri=OA(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Zn(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Jle(n)},i=[Qle(),Yle(),Zle()];i.forEach(({before:a})=>a==null?void 0:a(r)),i.forEach(({after:a})=>a==null?void 0:a(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ri.subscribe(()=>{let e=Ri.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&Ri.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ri.dispatch("TEARDOWN",n)}});function ese(e,t,n=()=>({containers:[]})){let r=$A(Ri),i=t?r.get(t):void 0,a=i?i.count>0:!1;return he(()=>{if(!(!t||!e))return Ri.dispatch("PUSH",t,n),()=>Ri.dispatch("POP",t,n)},[e,t]),a}function IA(e,t,n=()=>[document.body]){let r=Wo(e,"scroll-lock");ese(r,t,i=>{var a;return{containers:[...(a=i.containers)!=null?a:[],n]}})}function ZS(e){return[e.screenX,e.screenY]}function tse(){let e=b.useRef([-1,-1]);return{wasMoved(t){let n=ZS(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=ZS(t)}}}function nse(e=0){let[t,n]=b.useState(e),r=b.useCallback(s=>n(s),[t]),i=b.useCallback(s=>n(u=>u|s),[t]),a=b.useCallback(s=>(t&s)===s,[t]),o=b.useCallback(s=>n(u=>u&~s),[n]),l=b.useCallback(s=>n(u=>u^s),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:l}}var rse={},JS,eE;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((JS=process==null?void 0:rse)==null?void 0:JS.NODE_ENV)==="test"&&typeof((eE=Element==null?void 0:Element.prototype)==null?void 0:eE.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
272
- `)),[]});var ise=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ise||{});function RA(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function LA(e,t,n,r){let[i,a]=b.useState(n),{hasFlag:o,addFlag:l,removeFlag:s}=nse(e&&i?3:0),u=b.useRef(!1),c=b.useRef(!1),f=sa();return he(()=>{var d;if(e){if(n&&a(!0),!t){n&&l(3);return}return(d=r==null?void 0:r.start)==null||d.call(r,n),ase(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(l(3),s(4)):(l(4),s(2)))},run(){c.current?n?(s(3),l(4)):(s(4),l(3)):n?s(1):l(1)},done(){var p;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,s(7),n||a(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,f]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ase(e,{prepare:t,run:n,done:r,inFlight:i}){let a=Zn();return lse(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(ose(e,r))})}),a.dispose}function ose(e,t){var n,r;let i=Zn();if(!e)return i.dispose;let a=!1;i.add(()=>{a=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),i.dispose):(Promise.allSettled(o.map(l=>l.finished)).then(()=>{a||t()}),i.dispose)}function lse(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function sse(e,{container:t,accept:n,walk:r}){let i=b.useRef(n),a=b.useRef(r);b.useEffect(()=>{i.current=n,a.current=r},[n,r]),he(()=>{if(!t||!e)return;let o=vi(t);if(!o)return;let l=i.current,s=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),c=o.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)s(c.currentNode)},[t,e,i,a])}function Z0(e,t){let n=b.useRef([]),r=Q(e);b.useEffect(()=>{let i=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let l=r(t,i);return n.current=t,l}},[r,...t])}function use(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const DA={...mc},cse=DA.useInsertionEffect,fse=cse||(e=>e());function FA(e){const t=b.useRef(()=>{});return fse(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var xg=typeof document<"u"?b.useLayoutEffect:b.useEffect;let tE=!1,dse=0;const nE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dse++;function pse(){const[e,t]=b.useState(()=>tE?nE():void 0);return xg(()=>{e==null&&t(nE())},[]),b.useEffect(()=>{tE=!0},[]),e}const hse=DA.useId,mse=hse||pse;function vse(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const gse=b.createContext(null),yse=b.createContext(null),xse=()=>{var e;return((e=b.useContext(gse))==null?void 0:e.id)||null},bse=()=>b.useContext(yse),wse="data-floating-ui-focusable";function _se(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=mse(),a=b.useRef({}),[o]=b.useState(()=>vse()),l=xse()!=null,[s,u]=b.useState(r.reference),c=FA((p,h,m)=>{a.current.openEvent=p?h:void 0,o.emit("openchange",{open:p,event:h,reason:m,nested:l}),n==null||n(p,h,m)}),f=b.useMemo(()=>({setPositionReference:u}),[]),d=b.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return b.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:d,events:o,floatingId:i,refs:f}),[t,c,d,o,i,f])}function Sse(e){e===void 0&&(e={});const{nodeId:t}=e,n=_se({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=b.useState(null),[l,s]=b.useState(null),c=(i==null?void 0:i.domReference)||a,f=b.useRef(null),d=bse();xg(()=>{c&&(f.current=c)},[c]);const p=YT({...e,elements:{...i,...l&&{reference:l}}}),h=b.useCallback(x=>{const E=de(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;s(E),p.refs.setReference(E)},[p.refs]),m=b.useCallback(x=>{(de(x)||x===null)&&(f.current=x,o(x)),(de(p.refs.reference.current)||p.refs.reference.current===null||x!==null&&!de(x))&&p.refs.setReference(x)},[p.refs]),w=b.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:f}),[p.refs,m,h]),y=b.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),g=b.useMemo(()=>({...p,...r,refs:w,elements:y,nodeId:t}),[p,w,y,t,r]);return xg(()=>{r.dataRef.current.floatingContext=g;const x=d==null?void 0:d.nodesRef.current.find(E=>E.id===t);x&&(x.context=g)}),b.useMemo(()=>({...p,context:g,refs:w,elements:y}),[p,w,y,g])}const rE="active",iE="selected";function Lh(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[rE]:o,[iE]:l,...s}=e;a=s}return{...n==="floating"&&{tabIndex:-1,[wse]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(s=>{let[u,c]=s;if(!(i&&[rE,iE].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),o[u]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];return(d=r.get(u))==null?void 0:d.map(w=>w(...h)).find(w=>w!==void 0)}}}else o[u]=c}),o),{})}}function Ese(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),i=b.useCallback(l=>Lh(l,e,"reference"),t),a=b.useCallback(l=>Lh(l,e,"floating"),n),o=b.useCallback(l=>Lh(l,e,"item"),r);return b.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}function aE(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Ose=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:a=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:u,...c}=la(e,t),{rects:f,elements:{floating:d}}=t,p=n.current[o],h=(u==null?void 0:u.current)||d,m=d.clientTop||h.clientTop,w=d.clientTop!==0,y=h.clientTop!==0,g=d===h;if(!p)return{};const x={...t,...await B0(-p.offsetTop-d.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(t)},E=await Ph(aE(x,h.scrollHeight+m+d.clientTop),c),_=await Ph(x,{...c,elementContext:"reference"}),S=vt(0,E.top),O=x.y+S,C=(h.scrollHeight>h.clientHeight?A=>A:Rs)(vt(0,h.scrollHeight+(w&&g||y?m*2:0)-S-vt(0,E.bottom)));if(h.style.maxHeight=C+"px",h.scrollTop=S,i){const A=h.offsetHeight<p.offsetHeight*Xi(l,n.current.length)-1||_.top>=-s||_.bottom>=-s;Ht.flushSync(()=>i(A))}return r&&(r.current=await Ph(aE({...x,y:O},h.offsetHeight+m+d.clientTop),c)),{y:O}}});function $se(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:a,scrollRef:o,onChange:l}=t,s=FA(l),u=b.useRef(!1),c=b.useRef(null),f=b.useRef(null);b.useEffect(()=>{if(!i)return;function p(m){if(m.ctrlKey||!h||a.current==null)return;const w=m.deltaY,y=a.current.top>=-.5,g=a.current.bottom>=-.5,x=h.scrollHeight-h.clientHeight,E=w<0?-1:1,_=w<0?"max":"min";h.scrollHeight<=h.clientHeight||(!y&&w>0||!g&&w<0?(m.preventDefault(),Ht.flushSync(()=>{s(S=>S+Math[_](w,x*E))})):/firefox/i.test(use())&&(h.scrollTop+=w))}const h=(o==null?void 0:o.current)||r.floating;if(n&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=h.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,h.removeEventListener("wheel",p)}},[i,n,r.floating,a,o,s]);const d=b.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(o==null?void 0:o.current)||r.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const h=p.scrollTop-c.current;(a.current.bottom<-.5&&h<-1||a.current.top<-.5&&h>1)&&Ht.flushSync(()=>s(m=>m+h))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[r.floating,s,a,o]);return b.useMemo(()=>i?{floating:d}:{},[i,d])}let Ko=b.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Ko.displayName="FloatingContext";let J0=b.createContext(null);J0.displayName="PlacementContext";function Pse(e){return b.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function jse(){return b.useContext(Ko).setReference}function Tse(){return b.useContext(Ko).getReferenceProps}function Ase(){let{getFloatingProps:e,slot:t}=b.useContext(Ko);return b.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Cse(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=b.useContext(J0),n=b.useMemo(()=>e,[JSON.stringify(e,(i,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);he(()=>{t==null||t(n??null)},[t,n]);let r=b.useContext(Ko);return b.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let oE=4;function kse({children:e,enabled:t=!0}){let[n,r]=b.useState(null),[i,a]=b.useState(0),o=b.useRef(null),[l,s]=b.useState(null);Nse(l);let u=t&&n!==null&&l!==null,{to:c="bottom",gap:f=0,offset:d=0,padding:p=0,inner:h}=Mse(n,l),[m,w="center"]=c.split(" ");he(()=>{u&&a(0)},[u]);let{refs:y,floatingStyles:g,context:x}=Sse({open:u,placement:m==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${m}`:`${m}-${w}`,strategy:"absolute",transform:!1,middleware:[B0({mainAxis:m==="selection"?0:f,crossAxis:d}),QT({padding:p}),m!=="selection"&&ooe({padding:p}),m==="selection"&&h?Ose({...h,padding:p,overflowRef:o,offset:i,minItemsVisible:oE,referenceOverflowThreshold:p,onFallbackChange(A){var N,I;if(!A)return;let D=x.elements.floating;if(!D)return;let M=parseFloat(getComputedStyle(D).scrollPaddingBottom)||0,F=Math.min(oE,D.childElementCount),R=0,P=0;for(let k of(I=(N=x.elements.floating)==null?void 0:N.childNodes)!=null?I:[])if(k instanceof HTMLElement){let B=k.offsetTop,L=B+k.clientHeight+M,U=D.scrollTop,V=U+D.clientHeight;if(B>=U&&L<=V)F--;else{P=Math.max(0,Math.min(L,V)-Math.max(B,U)),R=k.clientHeight;break}}F>=1&&a(k=>{let B=R*F-P+M;return k>=B?k:B})}}):null,loe({padding:p,apply({availableWidth:A,availableHeight:N,elements:I}){Object.assign(I.floating.style,{overflow:"auto",maxWidth:`${A}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:qT}),[E=m,_=w]=x.placement.split("-");m==="selection"&&(E="selection");let S=b.useMemo(()=>({anchor:[E,_].filter(Boolean).join(" ")}),[E,_]),O=$se(x,{overflowRef:o,onChange:a}),{getReferenceProps:$,getFloatingProps:T}=Ese([O]),C=Q(A=>{s(A),y.setFloating(A)});return b.createElement(J0.Provider,{value:r},b.createElement(Ko.Provider,{value:{setFloating:C,setReference:y.setReference,styles:g,getReferenceProps:$,getFloatingProps:T,slot:S}},e))}function Nse(e){he(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Mse(e,t){var n,r,i;let a=Dh((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=Dh((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=Dh((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function Dh(e,t,n=void 0){let r=sa(),i=Q((s,u)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!u)return[n,null];let c=lE(s,u);return[c,f=>{let d=BA(s);{let p=d.map(h=>window.getComputedStyle(u).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[y,g]of d.entries()){let x=window.getComputedStyle(u).getPropertyValue(g);if(p[y]!==x){p[y]=x,m=!0;break}}if(!m)return;let w=lE(s,u);c!==w&&(f(w),c=w)})}return r.dispose}]}return[n,null]}),a=b.useMemo(()=>i(e,t)[0],[e,t]),[o=a,l]=b.useState();return he(()=>{let[s,u]=i(e,t);if(l(s),!!u)return u(l)},[e,t]),o}function BA(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...BA(i)]:[r]}return[]}function lE(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let mp=b.createContext(null);mp.displayName="OpenClosedContext";var Et=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Et||{});function du(){return b.useContext(mp)}function zA({value:e,children:t}){return j.createElement(mp.Provider,{value:e},t)}function Ise({children:e}){return j.createElement(mp.Provider,{value:null},e)}function Rse(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ur=[];Rse(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Ur[0]===t.target)return;let n=t.target;n=n.closest(Kf),Ur.unshift(n??t.target),Ur=Ur.filter(r=>r!=null&&r.isConnected),Ur.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Lse(e){throw new Error("Unexpected object: "+e)}var gt=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(gt||{});function Fh(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 1:{i===-1&&(i=n.length);for(let a=i-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 2:{for(let a=i+1;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 3:{for(let a=n.length-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 4:{for(let a=0;a<n.length;++a)if(t.resolveId(n[a],a,n)===e.id)return a;return r}case 5:return null;default:Lse(e)}}function UA(e){let t=Q(e),n=b.useRef(!1);b.useEffect(()=>(n.current=!1,()=>{n.current=!0,fp(()=>{n.current&&t()})}),[t])}function Dse(){let e=typeof document>"u";return"useSyncExternalStore"in mc?(t=>t.useSyncExternalStore)(mc)(()=>()=>{},()=>!1,()=>!e):!1}function pu(){let e=Dse(),[t,n]=b.useState(zi.isHandoffComplete);return t&&zi.isHandoffComplete===!1&&n(!1),b.useEffect(()=>{t!==!0&&n(!0)},[t]),b.useEffect(()=>zi.handoff(),[]),e?!1:t}let HA=b.createContext(!1);function Fse(){return b.useContext(HA)}function sE(e){return j.createElement(HA.Provider,{value:e.force},e.children)}function Bse(e){let t=Fse(),n=b.useContext(VA),r=Vo(e),[i,a]=b.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(zi.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return b.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),b.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),i}let WA=b.Fragment,zse=Ee(function(e,t){let n=e,r=b.useRef(null),i=ot(Sle(f=>{r.current=f}),t),a=Vo(r),o=Bse(r),[l]=b.useState(()=>{var f;return zi.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),s=b.useContext(bg),u=pu();he(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),he(()=>{if(l&&s)return s.register(l)},[s,l]),UA(()=>{var f;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let c=Re();return u?!o||!l?null:Ht.createPortal(c({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:WA,name:"Portal"}),l):null});function Use(e,t){let n=ot(t),{enabled:r=!0,...i}=e,a=Re();return r?j.createElement(zse,{...i,ref:n}):a({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:WA,name:"Portal"})}let Hse=b.Fragment,VA=b.createContext(null);function Wse(e,t){let{target:n,...r}=e,i={ref:ot(t)},a=Re();return j.createElement(VA.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Hse,name:"Popover.Group"}))}let bg=b.createContext(null);function Vse(){let e=b.useContext(bg),t=b.useRef([]),n=Q(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Q(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=b.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,b.useMemo(()=>function({children:a}){return j.createElement(bg.Provider,{value:i},a)},[i])]}let Kse=Ee(Use),KA=Ee(Wse),GA=Object.assign(Kse,{Group:KA});function Gse(e,t=typeof document<"u"?document.defaultView:null,n){let r=Wo(e,"escape");MA(t,"keydown",i=>{r&&(i.defaultPrevented||i.key===Ne.Escape&&n(i))})}function qse(){var e;let[t]=b.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=b.useState((e=t==null?void 0:t.matches)!=null?e:!1);return he(()=>{if(!t)return;function i(a){r(a.matches)}return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[t]),n}function Xse({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=Vo(n),i=Q(()=>{var a,o;let l=[];for(let s of e)s!==null&&(s instanceof HTMLElement?l.push(s):"current"in s&&s.current instanceof HTMLElement&&l.push(s.current));if(t!=null&&t.current)for(let s of t.current)l.push(s);for(let s of(a=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?a:[])s!==document.body&&s!==document.head&&s instanceof HTMLElement&&s.id!=="headlessui-portal-root"&&(n&&(s.contains(n)||s.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||l.some(u=>s.contains(u))||l.push(s));return l});return{resolveContainers:i,contains:Q(a=>i().some(o=>o.contains(a)))}}let qA=b.createContext(null);function uE({children:e,node:t}){let[n,r]=b.useState(null),i=XA(t??n);return j.createElement(qA.Provider,{value:i},e,i===null&&j.createElement(So,{features:ea.Hidden,ref:a=>{var o,l;if(a){for(let s of(l=(o=vi(a))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?l:[])if(s!==document.body&&s!==document.head&&s instanceof HTMLElement&&s!=null&&s.contains(a)){r(s);break}}}}))}function XA(e=null){var t;return(t=b.useContext(qA))!=null?t:e}function ex(){let e=b.useRef(!1);return he(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var xl=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(xl||{});function Yse(){let e=b.useRef(0);return kA(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function YA(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let Qse="div";var ji=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(ji||{});function Zse(e,t){let n=b.useRef(null),r=ot(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:l=15,...s}=e;pu()||(l=0);let u=Vo(n);nue(l,{ownerDocument:u});let c=rue(l,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:a});iue(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:c});let f=Yse(),d=Q(g=>{let x=n.current;x&&(E=>E())(()=>{jn(f.current,{[xl.Forwards]:()=>{ii(x,_t.First,{skipElements:[g.relatedTarget,a]})},[xl.Backwards]:()=>{ii(x,_t.Last,{skipElements:[g.relatedTarget,a]})}})})}),p=Wo(!!(l&2),"focus-trap#tab-lock"),h=sa(),m=b.useRef(!1),w={ref:r,onKeyDown(g){g.key=="Tab"&&(m.current=!0,h.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){if(!(l&4))return;let x=YA(o);n.current instanceof HTMLElement&&x.add(n.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(QA(x,E)||(m.current?ii(n.current,jn(f.current,{[xl.Forwards]:()=>_t.Next,[xl.Backwards]:()=>_t.Previous})|_t.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Gn(g.target)))}},y=Re();return j.createElement(j.Fragment,null,p&&j.createElement(So,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:ea.Focusable}),y({ourProps:w,theirProps:s,defaultTag:Qse,name:"FocusTrap"}),p&&j.createElement(So,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:ea.Focusable}))}let Jse=Ee(Zse),eue=Object.assign(Jse,{features:ji});function tue(e=!0){let t=b.useRef(Ur.slice());return Z0(([n],[r])=>{r===!0&&n===!1&&fp(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Ur.slice())},[e,Ur,t]),Q(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function nue(e,{ownerDocument:t}){let n=!!(e&8),r=tue(n);Z0(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&Gn(r())},[n]),UA(()=>{n&&Gn(r())})}function rue(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=b.useRef(null),o=Wo(!!(e&1),"focus-trap#initial-focus"),l=ex();return Z0(()=>{if(e===0)return;if(!o){i!=null&&i.current&&Gn(i.current);return}let s=n.current;s&&fp(()=>{if(!l.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){a.current=u;return}}else if(s.contains(u)){a.current=u;return}if(r!=null&&r.current)Gn(r.current);else{if(e&16){if(ii(s,_t.First|_t.AutoFocus)!==Ds.Error)return}else if(ii(s,_t.First)!==Ds.Error)return;if(i!=null&&i.current&&(Gn(i.current),(t==null?void 0:t.activeElement)===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t==null?void 0:t.activeElement})},[i,o,e]),a}function iue(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=ex(),o=!!(e&4);MA(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let s=YA(r);n.current instanceof HTMLElement&&s.add(n.current);let u=i.current;if(!u)return;let c=l.target;c&&c instanceof HTMLElement?QA(s,c)?(i.current=c,Gn(c)):(l.preventDefault(),l.stopPropagation(),Gn(u)):Gn(i.current)},!0)}function QA(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function ZA(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:eC)!==b.Fragment||j.Children.count(e.children)===1}let vp=b.createContext(null);vp.displayName="TransitionContext";var aue=(e=>(e.Visible="visible",e.Hidden="hidden",e))(aue||{});function oue(){let e=b.useContext(vp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function lue(){let e=b.useContext(gp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let gp=b.createContext(null);gp.displayName="NestingContext";function yp(e){return"children"in e?yp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function JA(e,t){let n=Nr(e),r=b.useRef([]),i=ex(),a=sa(),o=Q((p,h=Kr.Hidden)=>{let m=r.current.findIndex(({el:w})=>w===p);m!==-1&&(jn(h,{[Kr.Unmount](){r.current.splice(m,1)},[Kr.Hidden](){r.current[m].state="hidden"}}),a.microTask(()=>{var w;!yp(r)&&i.current&&((w=n.current)==null||w.call(n))}))}),l=Q(p=>{let h=r.current.find(({el:m})=>m===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>o(p,Kr.Unmount)}),s=b.useRef([]),u=b.useRef(Promise.resolve()),c=b.useRef({enter:[],leave:[]}),f=Q((p,h,m)=>{s.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([w])=>w!==p)),t==null||t.chains.current[h].push([p,new Promise(w=>{s.current.push(w)})]),t==null||t.chains.current[h].push([p,new Promise(w=>{Promise.all(c.current[h].map(([y,g])=>g)).then(()=>w())})]),h==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),d=Q((p,h,m)=>{Promise.all(c.current[h].splice(0).map(([w,y])=>y)).then(()=>{var w;(w=s.current.shift())==null||w()}).then(()=>m(h))});return b.useMemo(()=>({children:r,register:l,unregister:o,onStart:f,onStop:d,wait:u,chains:c}),[l,o,r,f,d,c,u])}let eC=b.Fragment,tC=_o.RenderStrategy;function sue(e,t){var n,r;let{transition:i=!0,beforeEnter:a,afterEnter:o,beforeLeave:l,afterLeave:s,enter:u,enterFrom:c,enterTo:f,entered:d,leave:p,leaveFrom:h,leaveTo:m,...w}=e,[y,g]=b.useState(null),x=b.useRef(null),E=ZA(e),_=ot(...E?[x,t,g]:t===null?[]:[t]),S=(n=w.unmount)==null||n?Kr.Unmount:Kr.Hidden,{show:O,appear:$,initial:T}=oue(),[C,A]=b.useState(O?"visible":"hidden"),N=lue(),{register:I,unregister:D}=N;he(()=>I(x),[I,x]),he(()=>{if(S===Kr.Hidden&&x.current){if(O&&C!=="visible"){A("visible");return}return jn(C,{hidden:()=>D(x),visible:()=>I(x)})}},[C,x,I,D,O,S]);let M=pu();he(()=>{if(E&&M&&C==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,C,M,E]);let F=T&&!$,R=$&&O&&T,P=b.useRef(!1),k=JA(()=>{P.current||(A("hidden"),D(x))},N),B=Q(Ce=>{P.current=!0;let Oe=Ce?"enter":"leave";k.onStart(x,Oe,K=>{K==="enter"?a==null||a():K==="leave"&&(l==null||l())})}),L=Q(Ce=>{let Oe=Ce?"enter":"leave";P.current=!1,k.onStop(x,Oe,K=>{K==="enter"?o==null||o():K==="leave"&&(s==null||s())}),Oe==="leave"&&!yp(k)&&(A("hidden"),D(x))});b.useEffect(()=>{E&&i||(B(O),L(O))},[O,E,i]);let U=!(!i||!E||!M||F),[,V]=LA(U,y,O,{start:B,end:L}),re=Fr({ref:_,className:((r=gg(w.className,R&&u,R&&c,V.enter&&u,V.enter&&V.closed&&c,V.enter&&!V.closed&&f,V.leave&&p,V.leave&&!V.closed&&h,V.leave&&V.closed&&m,!V.transition&&O&&d))==null?void 0:r.trim())||void 0,...RA(V)}),ie=0;C==="visible"&&(ie|=Et.Open),C==="hidden"&&(ie|=Et.Closed),V.enter&&(ie|=Et.Opening),V.leave&&(ie|=Et.Closing);let J=Re();return j.createElement(gp.Provider,{value:k},j.createElement(zA,{value:ie},J({ourProps:re,theirProps:w,defaultTag:eC,features:tC,visible:C==="visible",name:"Transition.Child"})))}function uue(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=b.useRef(null),l=ZA(e),s=ot(...l?[o,t]:t===null?[]:[t]);pu();let u=du();if(n===void 0&&u!==null&&(n=(u&Et.Open)===Et.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=b.useState(n?"visible":"hidden"),d=JA(()=>{n||f("hidden")}),[p,h]=b.useState(!0),m=b.useRef([n]);he(()=>{p!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let w=b.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);he(()=>{n?f("visible"):!yp(d)&&o.current!==null&&f("hidden")},[n,d]);let y={unmount:i},g=Q(()=>{var _;p&&h(!1),(_=e.beforeEnter)==null||_.call(e)}),x=Q(()=>{var _;p&&h(!1),(_=e.beforeLeave)==null||_.call(e)}),E=Re();return j.createElement(gp.Provider,{value:d},j.createElement(vp.Provider,{value:w},E({ourProps:{...y,as:b.Fragment,children:j.createElement(nC,{ref:s,...y,...a,beforeEnter:g,beforeLeave:x})},theirProps:{},defaultTag:b.Fragment,features:tC,visible:c==="visible",name:"Transition"})))}function cue(e,t){let n=b.useContext(vp)!==null,r=du()!==null;return j.createElement(j.Fragment,null,!n&&r?j.createElement(wg,{ref:t,...e}):j.createElement(nC,{ref:t,...e}))}let wg=Ee(uue),nC=Ee(sue),xp=Ee(cue),fue=Object.assign(wg,{Child:xp,Root:wg});var due=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(due||{}),pue=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(pue||{});let hue={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},tx=b.createContext(null);tx.displayName="DialogContext";function bp(e){let t=b.useContext(tx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bp),n}return t}function mue(e,t){return jn(t.type,hue,e,t)}let cE=Ee(function(e,t){let n=b.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:l="dialog",autoFocus:s=!0,__demoMode:u=!1,unmount:c=!1,...f}=e,d=b.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(d.current||(d.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=du();i===void 0&&p!==null&&(i=(p&Et.Open)===Et.Open);let h=b.useRef(null),m=ot(h,t),w=Vo(h),y=i?0:1,[g,x]=b.useReducer(mue,{titleId:null,descriptionId:null,panelRef:b.createRef()}),E=Q(()=>a(!1)),_=Q(L=>x({type:0,id:L})),S=pu()?y===0:!1,[O,$]=Vse(),T={get current(){var L;return(L=g.panelRef.current)!=null?L:h.current}},C=XA(),{resolveContainers:A}=Xse({mainTreeNode:C,portals:O,defaultContainers:[T]}),N=p!==null?(p&Et.Closing)===Et.Closing:!1;PA(u||N?!1:S,{allowed:Q(()=>{var L,U;return[(U=(L=h.current)==null?void 0:L.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:Q(()=>{var L;return[(L=C==null?void 0:C.closest("body > *:not(#headlessui-portal-root)"))!=null?L:null]})}),NA(S,A,L=>{L.preventDefault(),E()}),Gse(S,w==null?void 0:w.defaultView,L=>{L.preventDefault(),L.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),E()}),IA(u||N?!1:S,w,A),jA(S,h,E);let[I,D]=cu(),M=b.useMemo(()=>[{dialogState:y,close:E,setTitleId:_,unmount:c},g],[y,g,E,_,c]),F=b.useMemo(()=>({open:y===0}),[y]),R={ref:m,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:y===0?!0:void 0,"aria-labelledby":g.titleId,"aria-describedby":I,unmount:c},P=!qse(),k=ji.None;S&&!u&&(k|=ji.RestoreFocus,k|=ji.TabLock,s&&(k|=ji.AutoFocus),P&&(k|=ji.InitialFocus));let B=Re();return j.createElement(Ise,null,j.createElement(sE,{force:!0},j.createElement(GA,null,j.createElement(tx.Provider,{value:M},j.createElement(KA,{target:h},j.createElement(sE,{force:!1},j.createElement(D,{slot:F},j.createElement($,null,j.createElement(eue,{initialFocus:o,initialFocusFallback:h,containers:A,features:k},j.createElement(Nle,{value:E},B({ourProps:R,theirProps:f,slot:F,defaultTag:vue,features:gue,visible:y===0,name:"Dialog"})))))))))))}),vue="div",gue=_o.RenderStrategy|_o.Static;function yue(e,t){let{transition:n=!1,open:r,...i}=e,a=du(),o=e.hasOwnProperty("open")||a!==null,l=e.hasOwnProperty("onClose");if(!o&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?j.createElement(uE,null,j.createElement(fue,{show:r,transition:n,unmount:i.unmount},j.createElement(cE,{ref:t,...i}))):j.createElement(uE,null,j.createElement(cE,{ref:t,open:r,...i}))}let xue="div";function bue(e,t){let n=b.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:l},s]=bp("Dialog.Panel"),u=ot(t,s.panelRef),c=b.useMemo(()=>({open:o===0}),[o]),f=Q(w=>{w.stopPropagation()}),d={ref:u,id:r,onClick:f},p=i?xp:b.Fragment,h=i?{unmount:l}:{},m=Re();return j.createElement(p,{...h},m({ourProps:d,theirProps:a,slot:c,defaultTag:xue,name:"Dialog.Panel"}))}let wue="div";function _ue(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=bp("Dialog.Backdrop"),o=b.useMemo(()=>({open:i===0}),[i]),l={ref:t,"aria-hidden":!0},s=n?xp:b.Fragment,u=n?{unmount:a}:{},c=Re();return j.createElement(s,{...u},c({ourProps:l,theirProps:r,slot:o,defaultTag:wue,name:"Dialog.Backdrop"}))}let Sue="h2";function Eue(e,t){let n=b.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=bp("Dialog.Title"),l=ot(t);b.useEffect(()=>(o(r),()=>o(null)),[r,o]);let s=b.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return Re()({ourProps:u,theirProps:i,slot:s,defaultTag:Sue,name:"Dialog.Title"})}let Oue=Ee(yue),rC=Ee(bue),$ue=Ee(_ue),Pue=Ee(Eue),jue=Object.assign(Oue,{Panel:rC,Title:Pue,Description:SA}),Tue="div";function Aue(e,t){let n=`headlessui-control-${b.useId()}`,[r,i]=fu(),[a,o]=cu(),l=uu(),{disabled:s=l||!1,...u}=e,c=b.useMemo(()=>({disabled:s}),[s]),f={ref:t,disabled:s||void 0,"aria-disabled":s||void 0},d=Re();return j.createElement(lle,{value:s},j.createElement(i,{value:r},j.createElement(o,{value:a},j.createElement(wle,{id:n},d({ourProps:f,theirProps:{...u,children:j.createElement(gle,null,typeof u.children=="function"?u.children(c):u.children)},slot:c,defaultTag:Tue,name:"Field"})))))}let Cue=Ee(Aue);function kue(e,t){let n=b.useRef({left:0,top:0});if(he(()=>{if(!t)return;let i=t.getBoundingClientRect();i&&(n.current=i)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let fE=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function dE(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let a=!1;for(let l of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let o=a?(n=i.innerText)!=null?n:"":r;return fE.test(o)&&(o=o.replace(fE,"")),o}function Nue(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let a=document.getElementById(i);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():dE(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return dE(e).trim()}function Mue(e){let t=b.useRef(""),n=b.useRef("");return Q(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let a=Nue(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var Iue=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Iue||{}),Rue=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Rue||{}),Lue=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(Lue||{});function Bh(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=Q0(t(e.items.slice()),a=>a.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}let Due={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n,r,i,a,o;if(e.menuState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===gt.Nothing)return{...l,activeItemIndex:null};if(t.focus===gt.Specific)return{...l,activeItemIndex:e.items.findIndex(c=>c.id===t.id)};if(t.focus===gt.Previous){let c=e.activeItemIndex;if(c!==null){let f=e.items[c].dataRef.current.domRef,d=Fh(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.items[d].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===p.current||((i=p.current)==null?void 0:i.previousElementSibling)===null)return{...l,activeItemIndex:d}}}}else if(t.focus===gt.Next){let c=e.activeItemIndex;if(c!==null){let f=e.items[c].dataRef.current.domRef,d=Fh(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.items[d].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((o=p.current)==null?void 0:o.nextElementSibling)===null)return{...l,activeItemIndex:d}}}}let s=Bh(e),u=Fh(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...l,...s,activeItemIndex:u}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(r))&&!o.dataRef.current.disabled}),a=i?e.items.indexOf(i):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=Bh(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Bh(e,r=>{let i=r.findIndex(a=>a.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},nx=b.createContext(null);nx.displayName="MenuContext";function wp(e){let t=b.useContext(nx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wp),n}return t}function Fue(e,t){return jn(t.type,Due,e,t)}let Bue=b.Fragment;function zue(e,t){let{__demoMode:n=!1,...r}=e,i=b.useReducer(Fue,{__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsElement:o,buttonElement:l},s]=i,u=ot(t);NA(a===0,[l,o],(h,m)=>{s({type:1}),Y0(m,X0.Loose)||(h.preventDefault(),l==null||l.focus())});let c=Q(()=>{s({type:1})}),f=b.useMemo(()=>({open:a===0,close:c}),[a,c]),d={ref:u},p=Re();return j.createElement(kse,null,j.createElement(nx.Provider,{value:i},j.createElement(zA,{value:jn(a,{0:Et.Open,1:Et.Closed})},p({ourProps:d,theirProps:r,slot:f,defaultTag:Bue,name:"Menu"}))))}let Uue="button";function Hue(e,t){var n;let r=b.useId(),{id:i=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[s,u]=wp("Menu.Button"),c=Tse(),f=ot(t,jse(),Q(O=>u({type:7,element:O}))),d=Q(O=>{switch(O.key){case Ne.Space:case Ne.Enter:case Ne.ArrowDown:O.preventDefault(),O.stopPropagation(),Ht.flushSync(()=>u({type:0})),u({type:2,focus:gt.First});break;case Ne.ArrowUp:O.preventDefault(),O.stopPropagation(),Ht.flushSync(()=>u({type:0})),u({type:2,focus:gt.Last});break}}),p=Q(O=>{switch(O.key){case Ne.Space:O.preventDefault();break}}),h=Q(O=>{var $;if(G0(O.currentTarget))return O.preventDefault();a||(s.menuState===0?(Ht.flushSync(()=>u({type:1})),($=s.buttonElement)==null||$.focus({preventScroll:!0})):(O.preventDefault(),u({type:0})))}),{isFocusVisible:m,focusProps:w}=K0({autoFocus:o}),{isHovered:y,hoverProps:g}=V0({isDisabled:a}),{pressed:x,pressProps:E}=ole({disabled:a}),_=b.useMemo(()=>({open:s.menuState===0,active:x||s.menuState===0,disabled:a,hover:y,focus:m,autofocus:o}),[s,y,m,x,a,o]),S=dp(c(),{ref:f,id:i,type:Xle(e,s.buttonElement),"aria-haspopup":"menu","aria-controls":(n=s.itemsElement)==null?void 0:n.id,"aria-expanded":s.menuState===0,disabled:a||void 0,autoFocus:o,onKeyDown:d,onKeyUp:p,onClick:h},w,g,E);return Re()({ourProps:S,theirProps:l,slot:_,defaultTag:Uue,name:"Menu.Button"})}let Wue="div",Vue=_o.RenderStrategy|_o.Static;function Kue(e,t){var n,r;let i=b.useId(),{id:a=`headlessui-menu-items-${i}`,anchor:o,portal:l=!1,modal:s=!0,transition:u=!1,...c}=e,f=Pse(o),[d,p]=wp("Menu.Items"),[h,m]=Cse(f),w=Ase(),[y,g]=b.useState(null),x=ot(t,f?h:null,Q(P=>p({type:8,element:P})),g),E=Vo(d.itemsElement);f&&(l=!0);let _=du(),[S,O]=LA(u,y,_!==null?(_&Et.Open)===Et.Open:d.menuState===0);jA(S,d.buttonElement,()=>{p({type:1})});let $=d.__demoMode?!1:s&&d.menuState===0;IA($,E);let T=d.__demoMode?!1:s&&d.menuState===0;PA(T,{allowed:b.useCallback(()=>[d.buttonElement,d.itemsElement],[d.buttonElement,d.itemsElement])});let C=d.menuState!==0,A=kue(C,d.buttonElement)?!1:S;b.useEffect(()=>{let P=d.itemsElement;P&&d.menuState===0&&P!==(E==null?void 0:E.activeElement)&&P.focus({preventScroll:!0})},[d.menuState,d.itemsElement,E]),sse(d.menuState===0,{container:d.itemsElement,accept(P){return P.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:P.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(P){P.setAttribute("role","none")}});let N=sa(),I=Q(P=>{var k,B,L;switch(N.dispose(),P.key){case Ne.Space:if(d.searchQuery!=="")return P.preventDefault(),P.stopPropagation(),p({type:3,value:P.key});case Ne.Enter:if(P.preventDefault(),P.stopPropagation(),p({type:1}),d.activeItemIndex!==null){let{dataRef:U}=d.items[d.activeItemIndex];(B=(k=U.current)==null?void 0:k.domRef.current)==null||B.click()}AA(d.buttonElement);break;case Ne.ArrowDown:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Next});case Ne.ArrowUp:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Previous});case Ne.Home:case Ne.PageUp:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.First});case Ne.End:case Ne.PageDown:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Last});case Ne.Escape:P.preventDefault(),P.stopPropagation(),Ht.flushSync(()=>p({type:1})),(L=d.buttonElement)==null||L.focus({preventScroll:!0});break;case Ne.Tab:P.preventDefault(),P.stopPropagation(),Ht.flushSync(()=>p({type:1})),Kle(d.buttonElement,P.shiftKey?_t.Previous:_t.Next);break;default:P.key.length===1&&(p({type:3,value:P.key}),N.setTimeout(()=>p({type:4}),350));break}}),D=Q(P=>{switch(P.key){case Ne.Space:P.preventDefault();break}}),M=b.useMemo(()=>({open:d.menuState===0}),[d.menuState]),F=dp(f?w():{},{"aria-activedescendant":d.activeItemIndex===null||(n=d.items[d.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=d.buttonElement)==null?void 0:r.id,id:a,onKeyDown:I,onKeyUp:D,role:"menu",tabIndex:d.menuState===0?0:void 0,ref:x,style:{...c.style,...m,"--button-width":Lle(d.buttonElement,!0).width},...RA(O)}),R=Re();return j.createElement(GA,{enabled:l?e.static||S:!1},R({ourProps:F,theirProps:c,slot:M,defaultTag:Wue,features:Vue,visible:A,name:"Menu.Items"}))}let Gue=b.Fragment;function que(e,t){let n=b.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:i=!1,...a}=e,[o,l]=wp("Menu.Item"),s=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=b.useRef(null),c=ot(t,u);he(()=>{if(!o.__demoMode&&o.menuState===0&&s&&o.activationTrigger!==0)return Zn().requestAnimationFrame(()=>{var A,N;(N=(A=u.current)==null?void 0:A.scrollIntoView)==null||N.call(A,{block:"nearest"})})},[o.__demoMode,u,s,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=Mue(u),d=b.useRef({disabled:i,domRef:u,get textValue(){return f()}});he(()=>{d.current.disabled=i},[d,i]),he(()=>(l({type:5,id:r,dataRef:d}),()=>l({type:6,id:r})),[d,r]);let p=Q(()=>{l({type:1})}),h=Q(A=>{if(i)return A.preventDefault();l({type:1}),AA(o.buttonElement)}),m=Q(()=>{if(i)return l({type:2,focus:gt.Nothing});l({type:2,focus:gt.Specific,id:r})}),w=tse(),y=Q(A=>{w.update(A),!i&&(s||l({type:2,focus:gt.Specific,id:r,trigger:0}))}),g=Q(A=>{w.wasMoved(A)&&(i||s||l({type:2,focus:gt.Specific,id:r,trigger:0}))}),x=Q(A=>{w.wasMoved(A)&&(i||s&&l({type:2,focus:gt.Nothing}))}),[E,_]=fu(),[S,O]=cu(),$=b.useMemo(()=>({active:s,focus:s,disabled:i,close:p}),[s,i,p]),T={id:r,ref:c,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-labelledby":E,"aria-describedby":S,disabled:void 0,onClick:h,onFocus:m,onPointerEnter:y,onMouseEnter:y,onPointerMove:g,onMouseMove:g,onPointerLeave:x,onMouseLeave:x},C=Re();return j.createElement(_,null,j.createElement(O,null,C({ourProps:T,theirProps:a,slot:$,defaultTag:Gue,name:"Menu.Item"})))}let Xue="div";function Yue(e,t){let[n,r]=fu(),i=e,a={ref:t,"aria-labelledby":n,role:"group"},o=Re();return j.createElement(r,null,o({ourProps:a,theirProps:i,slot:{},defaultTag:Xue,name:"Menu.Section"}))}let Que="header";function Zue(e,t){let n=b.useId(),{id:r=`headlessui-menu-heading-${n}`,...i}=e,a=q0();he(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return Re()({ourProps:o,theirProps:i,slot:{},defaultTag:Que,name:"Menu.Heading"})}let Jue="div";function ece(e,t){let n=e,r={ref:t,role:"separator"};return Re()({ourProps:r,theirProps:n,slot:{},defaultTag:Jue,name:"Menu.Separator"})}let tce=Ee(zue),iC=Ee(Hue),aC=Ee(Kue),oC=Ee(que),nce=Ee(Yue),rce=Ee(Zue),ice=Ee(ece),ace=Object.assign(tce,{Button:iC,Items:aC,Item:oC,Section:nce,Heading:rce,Separator:ice});var oce=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(oce||{});let lce={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Q0(n,r=>r.element.current)}},1(e,t){let n=e.options.slice(),r=e.options.findIndex(i=>i.id===t.id);return r===-1?e:(n.splice(r,1),{...e,options:n})}},rx=b.createContext(null);rx.displayName="RadioGroupDataContext";function ix(e){let t=b.useContext(rx);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ix),n}return t}let ax=b.createContext(null);ax.displayName="RadioGroupActionsContext";function ox(e){let t=b.useContext(ax);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ox),n}return t}function sce(e,t){return jn(t.type,lce,e,t)}let uce="div";function cce(e,t){let n=b.useId(),r=uu(),{id:i=`headlessui-radiogroup-${n}`,value:a,form:o,name:l,onChange:s,by:u,disabled:c=r||!1,defaultValue:f,...d}=e,p=Ile(u),[h,m]=b.useReducer(sce,{options:[]}),w=h.options,[y,g]=fu(),[x,E]=cu(),_=b.useRef(null),S=ot(_,t),O=ple(f),[$,T]=dle(a,s,O),C=b.useMemo(()=>w.find(L=>!L.propsRef.current.disabled),[w]),A=b.useMemo(()=>w.some(L=>p(L.propsRef.current.value,$)),[w,$]),N=Q(L=>{var U;if(c||p(L,$))return!1;let V=(U=w.find(re=>p(re.propsRef.current.value,L)))==null?void 0:U.propsRef.current;return V!=null&&V.disabled?!1:(T==null||T(L),!0)}),I=Q(L=>{let U=_.current;if(!U)return;let V=vi(U),re=w.filter(ie=>ie.propsRef.current.disabled===!1).map(ie=>ie.element.current);switch(L.key){case Ne.Enter:hle(L.currentTarget);break;case Ne.ArrowLeft:case Ne.ArrowUp:if(L.preventDefault(),L.stopPropagation(),ii(re,_t.Previous|_t.WrapAround)===Ds.Success){let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break;case Ne.ArrowRight:case Ne.ArrowDown:if(L.preventDefault(),L.stopPropagation(),ii(re,_t.Next|_t.WrapAround)===Ds.Success){let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break;case Ne.Space:{L.preventDefault(),L.stopPropagation();let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break}}),D=Q(L=>(m({type:0,...L}),()=>m({type:1,id:L.id}))),M=b.useMemo(()=>({value:$,firstOption:C,containsCheckedOption:A,disabled:c,compare:p,...h}),[$,C,A,c,p,h]),F=b.useMemo(()=>({registerOption:D,change:N}),[D,N]),R={ref:S,id:i,role:"radiogroup","aria-labelledby":y,"aria-describedby":x,onKeyDown:I},P=b.useMemo(()=>({value:$}),[$]),k=b.useCallback(()=>{if(O!==void 0)return N(O)},[N,O]),B=Re();return j.createElement(E,{name:"RadioGroup.Description"},j.createElement(g,{name:"RadioGroup.Label"},j.createElement(ax.Provider,{value:F},j.createElement(rx.Provider,{value:M},l!=null&&j.createElement(xle,{disabled:c,data:{[l]:$||"on"},overrides:{type:"radio",checked:$!=null},form:o,onReset:k}),B({ourProps:R,theirProps:d,slot:P,defaultTag:uce,name:"RadioGroup"})))))}let fce="div";function dce(e,t){var n;let r=ix("RadioGroup.Option"),i=ox("RadioGroup.Option"),a=b.useId(),{id:o=`headlessui-radiogroup-option-${a}`,value:l,disabled:s=r.disabled||!1,autoFocus:u=!1,...c}=e,f=b.useRef(null),d=ot(f,t),[p,h]=fu(),[m,w]=cu(),y=Nr({value:l,disabled:s});he(()=>i.registerOption({id:o,element:f,propsRef:y}),[o,i,f,y]);let g=Q(N=>{var I;if(G0(N.currentTarget))return N.preventDefault();i.change(l)&&((I=f.current)==null||I.focus())}),x=((n=r.firstOption)==null?void 0:n.id)===o,{isFocusVisible:E,focusProps:_}=K0({autoFocus:u}),{isHovered:S,hoverProps:O}=V0({isDisabled:s}),$=r.compare(r.value,l),T=dp({ref:d,id:o,role:"radio","aria-checked":$?"true":"false","aria-labelledby":p,"aria-describedby":m,"aria-disabled":s?!0:void 0,tabIndex:s?-1:$||!r.containsCheckedOption&&x?0:-1,onClick:s?void 0:g,autoFocus:u},_,O),C=b.useMemo(()=>({checked:$,disabled:s,active:E,hover:S,focus:E,autofocus:u}),[$,s,S,E,u]),A=Re();return j.createElement(w,{name:"RadioGroup.Description"},j.createElement(h,{name:"RadioGroup.Label"},A({ourProps:T,theirProps:c,slot:C,defaultTag:fce,name:"RadioGroup.Option"})))}let pce="span";function hce(e,t){var n;let r=ix("Radio"),i=ox("Radio"),a=b.useId(),o=bA(),l=uu(),{id:s=o||`headlessui-radio-${a}`,value:u,disabled:c=r.disabled||l||!1,autoFocus:f=!1,...d}=e,p=b.useRef(null),h=ot(p,t),m=EA(),w=Ele(),y=Nr({value:u,disabled:c});he(()=>i.registerOption({id:s,element:p,propsRef:y}),[s,i,p,y]);let g=Q(A=>{var N;if(G0(A.currentTarget))return A.preventDefault();i.change(u)&&((N=p.current)==null||N.focus())}),{isFocusVisible:x,focusProps:E}=K0({autoFocus:f}),{isHovered:_,hoverProps:S}=V0({isDisabled:c}),O=((n=r.firstOption)==null?void 0:n.id)===s,$=r.compare(r.value,u),T=dp({ref:h,id:s,role:"radio","aria-checked":$?"true":"false","aria-labelledby":m,"aria-describedby":w,"aria-disabled":c?!0:void 0,tabIndex:c?-1:$||!r.containsCheckedOption&&O?0:-1,autoFocus:f,onClick:c?void 0:g},E,S),C=b.useMemo(()=>({checked:$,disabled:c,hover:_,focus:x,autofocus:f}),[$,c,_,x,f]);return Re()({ourProps:T,theirProps:d,slot:C,defaultTag:pce,name:"Radio"})}let mce=Ee(cce),vce=Ee(dce),lC=Ee(hce),gce=Cle,yce=SA,xce=Object.assign(mce,{Option:vce,Radio:lC,Label:gce,Description:yce});const lx=({items:e,selectedItem:t,onItemSelect:n,size:r="sm"})=>v.jsx("div",{className:"relative h-full",children:v.jsxs(ace,{children:[v.jsxs(iC,{className:`inline-flex h-full w-48 justify-between items-center gap-x-1.5 rounded-md bg-white px-3 text-${r} font-medium text-gray-900 shadow-xs ring-1 ring-gray-300 hover:bg-gray-50`,children:[t,v.jsx(G$,{className:"size-4 text-gray-400","aria-hidden":"true"})]}),v.jsx(aC,{className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden",children:v.jsx("div",{className:"py-1",children:e.map(i=>v.jsx(oC,{children:v.jsx("button",{onClick:()=>n(i),className:`block w-full px-4 py-2 text-left text-${r} data-focus:bg-gray-100 data-focus:text-gray-900 text-gray-700`,children:i})},i))})})]})}),bce=({items:e,selectedItem:t,onItemSelect:n,size:r="sm"})=>v.jsx(xce,{value:t,onChange:n,className:`inline-flex justify-between items-center rounded-md bg-white text-${r} font-medium text-gray-900 shadow-xs ring-1 ring-gray-300`,children:e.map(i=>v.jsx(Cue,{className:"flex h-full first:rounded-l-md last:rounded-r-md overflow-hidden",children:v.jsx(lC,{value:i,className:"cursor-pointer h-full data-checked:bg-gray-200 hover:bg-gray-50 flex items-center px-4 shadow-xs",children:i})},i))});function wce({onSearch:e}){return v.jsxs("div",{className:"relative w-full md:w-[26rem] rounded-md",children:[v.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-gray-400",children:v.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})})}),v.jsx("input",{type:"text",className:"block w-full pl-10 px-3 py-3 text-sm font-medium bg-white text-gray-900 shadow-xs rounded-md outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 w-",placeholder:"Search features...",onChange:t=>e(t.target.value)})]})}const _ce=({features:e})=>{const[t,n]=b.useState("All Teams"),[r,i]=b.useState(""),a=b.useMemo(()=>{const l=new Set;return l.add("All Teams"),Object.values(e).forEach(s=>{var u;(u=s.assignments)!=null&&u.teams&&s.assignments.teams.forEach(c=>l.add(c))}),Array.from(l)},[e]),o=b.useMemo(()=>t==="All Teams"?e:Object.fromEntries(Object.entries(e).filter(([l,s])=>{var u,c;return(c=(u=s.assignments)==null?void 0:u.teams)==null?void 0:c.includes(t)})),[e,t]);return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-8 p-4 md:p-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Dashboard"}),v.jsx(lx,{items:a,selectedItem:t,onItemSelect:n})]}),v.jsx("div",{children:v.jsxs("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6",children:[v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Ioe,{features:o})}),v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Roe,{features:o})}),v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Loe,{features:o})})]})}),v.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-scroll",children:[v.jsxs("div",{className:"flex items-center justify-between gap-12",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"w-5 h-5 text-gray-600","aria-hidden":"true"}),v.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:["Features: ",Object.entries(o).length]})]}),v.jsx("div",{children:v.jsx(wce,{onSearch:i})})]}),v.jsx(Doe,{features:o,searchTerm:r,teamContext:t!=="All Teams"?t:null})]})]})},Sce=({features:e})=>{const t=Object.values(e).reduce((r,i)=>{const a=i.additional_metrics.health.overall;if(a!=null){const o=rA(a);r[o]++}return r},{needsAttention:0,needsImprovement:0,healthy:0}),n=Object.entries(t).map(([r,i],a)=>({name:r,value:i,fill:[wt(rt.needsAttention).hex,wt(rt.needsImprovement).hex,wt(rt.healthy).hex][a]})).filter(({value:r})=>r>0);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(Ey,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Health Score"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Health Score distribution by category: shows how many features fall into each level from low (needs attention) to good (healthy)"})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative size-48",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx(nu,{children:v.jsx(qt,{data:n,dataKey:"value",nameKey:"name",innerRadius:"70%",outerRadius:"100%",paddingAngle:2})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.needsAttention).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.needsAttention})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Features needing attention"})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.needsImprovement).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.needsImprovement})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Features needing improvement"})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.healthy).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.healthy})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Healthy Features"})]})]})]})]})},Ece=({features:e})=>{const t=Object.values(e).reduce((i,a)=>{const o=a.additional_metrics.test_coverage.score;if(o!=null){const l=PT(o);i[l]++}return i},{poor:0,fair:0,good:0}),{minimum_thresholds:n}=wr.project.documentation_site.test_coverage,r=Object.entries(t).map(([i,a],o)=>({name:i,value:a,fill:[bt(n.poor).hex,bt(n.fair).hex,bt(n.good).hex][o]})).filter(({value:i})=>i>0);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(_y,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Test Coverage"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Test Coverage distribution by category: shows how many features fall into each level from poor to good"})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative size-48",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx(nu,{children:v.jsx(qt,{data:r,dataKey:"value",nameKey:"name",innerRadius:"70%",outerRadius:"100%",paddingAngle:2})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.poor).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.poor})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," poor coverage"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.fair).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.fair})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," fair coverage"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.good).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.good})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," good coverage"]})]})]})]})]})},Oce=({features:e})=>{const t=Object.entries(e).reduce((r,[i,a])=>{const{integration_count:o,integration_pending:l,regression_count:s,regression_pending:u,unit_count:c,unit_pending:f}=a.test_pyramid||{};return{unit_count:r.unit_count+(c||0),unit_pending:r.unit_pending+(f||0),integration_count:r.integration_count+(o||0),integration_pending:r.integration_pending+(l||0),regression_count:r.regression_count+(s||0),regression_pending:r.regression_pending+(u||0)}},{unit_count:0,unit_pending:0,integration_count:0,integration_pending:0,regression_count:0,regression_pending:0}),n=[{value:Math.max(Math.log(t.unit_count+t.unit_pending),0),fill:"#1d4ed8"},{value:Math.max(Math.log(t.integration_count+t.integration_pending),0),fill:"#2563eb"},{value:Math.max(Math.log(t.regression_count+t.regression_pending),0),fill:"#3b82f6"}];return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(X$,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Test Pyramid"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Test pyramid distribution by category: shows features which are missing coverage in a given level of the pyramid, or which have a large number of pending tests."})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative h-48 w-72",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx($T,{width:730,height:250,children:v.jsx(kr,{dataKey:"value",data:n,reversed:!0,children:v.jsx(Un,{position:"right",fill:"#000",stroke:"none",dataKey:"name"})})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 size-x-12 flex items-center justify-center bg-blue-500",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.regression_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Regression Tests (",t.regression_pending," pending)"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 flex items-center justify-center bg-blue-600",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.integration_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Integration Tests (",t.integration_pending," pending)"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 flex items-center justify-center bg-blue-700",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.unit_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Unit Tests (",t.unit_pending," pending)"]})]})]})]})]})},Qu=({title:e})=>v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsx("div",{className:"flex items-center gap-x-2",children:e})}),pE=({features:e,metric:t,sortDirection:n="ASC"})=>Object.entries(e).sort(([r,i],[a,o])=>{const l=i.test_pyramid&&i.test_pyramid[t]||0,s=o.test_pyramid&&o.test_pyramid[t]||0;return l===s?o.additional_metrics.feature_size.score-i.additional_metrics.feature_size.score:n==="ASC"?l-s:s-l}).slice(0,5).map(([r,i])=>({featureName:r,score:i.test_pyramid&&i.test_pyramid[t]||0,feature:i})),hE=["Regression","Integration","Unit"],mE=["Missing","Pending"],vE={Pending:{Unit:"unit_pending",Integration:"integration_pending",Regression:"regression_pending"},Missing:{Unit:"unit_count",Integration:"integration_count",Regression:"regression_count"}},$ce={Pending:{Unit:"Top 5 features with pending unit tests",Integration:"Top 5 features with pending integration tests",Regression:"Top 5 features with pending regression tests"},Missing:{Unit:"Bottom 5 features missing unit test coverage",Integration:"Bottom 5 features missing integration tests",Regression:"Bottom 5 features missing regression tests"}},Pce=({features:e})=>{const[t,n]=b.useState(mE[0]),[r,i]=b.useState(hE[0]),[a,o]=b.useState(pE({features:e,metric:vE[t][r],sortDirection:t==="Missing"?"ASC":""}));return b.useEffect(()=>{o(pE({features:e,metric:vE[t][r],sortDirection:t==="Missing"?"ASC":""}))},[e,t,r]),v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:[v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:$ce[t][r]}),v.jsxs("div",{className:"flex h-8",children:[v.jsx(bce,{items:mE,selectedItem:t,onItemSelect:n,size:"xs"}),v.jsx("span",{className:"mx-2"}),v.jsx(lx,{items:hE,selectedItem:r,onItemSelect:i,size:"xs"})]})]}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(Qu,{title:"Feature"}),v.jsx(Qu,{title:"Team"}),v.jsx(Qu,{title:"Size"}),v.jsx(Qu,{title:t==="Missing"?`${r} Test Count`:"Pending Test Count"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:a.map(({featureName:l,feature:s,score:u})=>{const c=s.additional_metrics.feature_size.percent_of_max,f=xo(c);return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:l})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(c)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:f})]})}),v.jsx("td",{className:"px-4 py-4 text-sm",children:v.jsx("div",{className:"flex items-center gap-x-2",children:u})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(l)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},l)})})]})})})})]})};function jce({features:e}){const[t,n]=b.useState("All Teams"),r=b.useMemo(()=>{const s=new Set;return s.add("All Teams"),Object.values(e).forEach(u=>{var c;(c=u.assignments)!=null&&c.teams&&u.assignments.teams.forEach(f=>s.add(f))}),Array.from(s)},[e]),i=b.useMemo(()=>t==="All Teams"?e:Object.fromEntries(Object.entries(e).filter(([s,u])=>{var c,f;return(f=(c=u.assignments)==null?void 0:c.teams)==null?void 0:f.includes(t)})),[e,t]),a=b.useMemo(()=>Object.entries(i).map(([s,u])=>({name:s,data:u||0,health:u.additional_metrics.health.overall||0})).sort((s,u)=>s.health-u.health).slice(0,5),[i]),o=b.useMemo(()=>Object.entries(i).map(([s,u])=>({name:s,data:u||0,score:u.additional_metrics.test_coverage.score||0})).sort((s,u)=>s.score-u.score).slice(0,5),[i]),l=({title:s})=>v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsx("div",{className:"flex items-center gap-x-2",children:s})});return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-8 p-4 md:p-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Digest"}),v.jsx(lx,{items:r,selectedItem:t,onItemSelect:n})]}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg h-full",children:v.jsx("div",{className:"px-4 py-6 h-fit",children:v.jsx(Sce,{features:i})})}),v.jsxs("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:[v.jsx("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:"Bottom 5 Features by Health Score"})}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(l,{title:"Feature"}),v.jsx(l,{title:"Team"}),v.jsx(l,{title:"Size"}),v.jsx(l,{title:"Health Score"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:a.map(s=>{const u=s.data.additional_metrics.feature_size.percent_of_max,c=xo(u),f=s.data.additional_metrics.health.overall||0;return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:s.name})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.data.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(u)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:c})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`w-4 h-4 rounded-full flex items-center justify-center ${iA(f)}`,children:v.jsx("div",{className:`w-2 h-2 rounded-full ${wt(f).class}`})}),v.jsxs("span",{className:"text-gray-600",children:[f.toFixed(0),"%"]})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(s.name)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},s.name)})})]})})})})]})]})}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx("div",{className:"px-4 py-6",children:v.jsx(Ece,{features:i})})}),v.jsxs("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:[v.jsx("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:"Bottom 5 Features by Test Coverage"})}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(l,{title:"Feature"}),v.jsx(l,{title:"Team"}),v.jsx(l,{title:"Size"}),v.jsx(l,{title:"Test Coverage"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:o.map(s=>{const u=s.data.additional_metrics.feature_size.percent_of_max,c=xo(u),f=s.data.additional_metrics.test_coverage.score||0;return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:s.name})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.data.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(u)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:c})]})}),v.jsx("td",{className:"px-4 py-4 text-sm",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"grow h-2 rounded-full bg-gray-100 overflow-hidden",children:v.jsx("div",{className:`h-full rounded-full ${bt(f).class}`,style:{width:`${f}%`}})}),v.jsx("span",{className:"text-sm text-gray-500",children:f?`${f.toFixed(0)}%`:"No Data"})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(s.name)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},s.name)})})]})})})})]})]})}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx("div",{className:"px-4 py-6",children:v.jsx(Oce,{features:i})})}),v.jsx("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:v.jsx(Pce,{features:i})})]})})]})}const Tce=({files:e})=>{const{project:t,environment:n}=wr,r=`${t.repository.url}/blob/${n.git_ref}`,{fileTree:i,directoryCounts:a}=b.useMemo(()=>{const g={},x={};return e.forEach(E=>{const _=E.split("/");let S=g;_.forEach((O,$)=>{if($===_.length-1){S[O]={type:"file",path:E};let T="";_.slice(0,-1).forEach(C=>{T=T?`${T}/${C}`:C,x[T]=(x[T]||0)+1})}else S[O]=S[O]||{type:"directory",children:{}},S=S[O].children})}),{fileTree:g,directoryCounts:x}},[e]),o=b.useMemo(()=>{const g=new Set;return e.forEach(x=>{const E=x.split("/");let _="";E.slice(0,-1).forEach(S=>{_=_?`${_}/${S}`:S,g.add(_)})}),g},[e]),[l,s]=b.useState("tree"),[u,c]=b.useState(o),[f,d]=b.useState({key:null,direction:"asc"}),p=b.useMemo(()=>[...e].sort((g,x)=>f.key?g<x?f.direction==="asc"?-1:1:g>x?f.direction==="asc"?1:-1:0:0),[e,f]),h=g=>{c(x=>{const E=new Set(x);return E.has(g)?E.delete(g):E.add(g),E})},m=g=>{d(x=>({key:g,direction:x.key===g&&x.direction==="asc"?"desc":"asc"}))},w=(g,x="",E=0)=>g?Object.entries(g).map(([_,S])=>{const O=x?`${x}/${_}`:_,$=u.has(O),T=a[O]||0;return S.type==="directory"?v.jsxs(j.Fragment,{children:[v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-2 text-sm text-gray-900",children:v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("button",{onClick:()=>h(O),className:"flex items-center group gap-x-2",style:{paddingLeft:`${E*16}px`},children:[v.jsxs("div",{className:"flex items-center group",children:[$?v.jsx(G$,{className:"size-4 text-gray-400 mr-1 shrink-0"}):v.jsx(SI,{className:"size-4 text-gray-400 mr-1 shrink-0"}),v.jsx($I,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("span",{className:"font-medium text-gray-600 group-hover:text-gray-900",children:_})]}),v.jsx("span",{className:"flex items-center justify-center text-xs font-medium text-gray-500 bg-gray-200 rounded-full h-5 w-5",children:T})]})})})}),$&&w(S.children,O,E+1)]},O):v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-2 text-sm text-gray-900",children:v.jsxs("div",{className:"flex items-center",style:{paddingLeft:`${E*16+20}px`},children:[v.jsx(Rm,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("a",{href:`${r}/${O}`,className:"truncate underline",target:"_blank",rel:"noopener noreferrer",children:_})]})})},O)}):null,y=({title:g,sortKey:x,className:E=""})=>v.jsx("th",{scope:"col",className:`px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider cursor-pointer ${E}`,onClick:()=>m(x),children:v.jsxs("div",{className:"flex items-center gap-x-2 group",children:[g,v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"size-4 text-gray-400 group-hover:text-gray-600",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"})})]})});return v.jsx("div",{className:"bg-white rounded-lg border border-gray-200",children:v.jsx("div",{className:"overflow-hidden rounded-lg",children:v.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[v.jsx("thead",{className:"bg-gray-50",children:v.jsxs("tr",{children:[v.jsx(y,{title:l==="tree"?"File Path":"Name",sortKey:"path"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-center text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[v.jsx("button",{onClick:()=>s("tree"),className:`p-1 rounded ${l==="tree"?"text-blue-600 bg-blue-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:v.jsx(Sy,{className:"size-4"})}),v.jsx("button",{onClick:()=>s("list"),className:`p-1 rounded ${l==="list"?"text-blue-600 bg-blue-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:v.jsx(AI,{className:"size-4"})})]})})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200",children:l==="list"?p.map(g=>v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-3 text-sm font-medium text-gray-900 flex-1",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx(Rm,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("a",{href:`${r}/${g}`,className:"truncate underline",target:"_blank",rel:"noopener noreferrer",children:g})]})})},g)):w(i)})]})})})};function Ace({name:e,feature:t}){const{project:n}=wr,i=`is:pr label:"${`Feature ${e}`}"`,a=encodeURIComponent(i),o=`${n.repository.url}/pulls?q=${a}`;return v.jsxs("div",{className:"bg-white p-4 rounded-lg border border-gray-200 h-fit",children:[v.jsxs("div",{className:"mb-6",children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Description"}),t.description&&v.jsx("p",{className:"text-sm md:text-base text-gray-600",children:t.description})]}),v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Metrics"}),v.jsxs("ul",{className:"mb-6 space-y-2",children:[v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Sy,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[t.assignments.files?t.assignments.files.length:0," Total Files"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(kI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[(t.metrics.abc_size||0).toFixed(2)," ABC Size"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Rm,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[t.metrics.lines_of_code||0," Lines of Code"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(PI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[t.metrics.cyclomatic_complexity||0," Cyclomatic Complexity"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(jI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[t.metrics.todo_locations?Object.keys(t.metrics.todo_locations).length:0," ","TODO Comments"]})]})]}),v.jsx("div",{className:"space-y-4 mb-6",children:v.jsxs("div",{children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Teams"}),v.jsx("ul",{className:"flex flex-col gap-y-1",children:t.assignments.teams?t.assignments.teams.map(l=>v.jsxs("li",{className:"text-sm text-gray-700 flex gap-2",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0",children:v.jsx(Gi,{className:"size-4 text-gray-500"})}),l]},l)):v.jsxs("li",{className:"text-sm text-gray-700 flex gap-2",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0",children:v.jsx(Gi,{className:"size-4 text-gray-500"})}),v.jsx("span",{className:"text-gray-400 italic text-sm",children:"No teams assigned"})]})})]})}),v.jsxs("div",{className:"mb",children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Resources"}),v.jsxs("ul",{className:"mb-6 space-y-2",children:[v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),v.jsx("a",{href:o,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"Feature Pull Requests"})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),t.documentation_link?v.jsx("a",{href:t.documentation_link,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"Feature Documentation"}):v.jsx("span",{className:"text-gray-400 italic text-sm",children:"Missing documentation link"})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),t.dashboard_link?v.jsx("a",{href:t.dashboard_link,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"New Relic Dashboard"}):v.jsx("span",{className:"text-gray-400 italic text-sm",children:"Missing New Relic Dashboard"})]})]})]})]})}const Cce=({value:e,suffix:t="",color:n="#ef4444"})=>{const r=e===0?"transparent":n;return v.jsxs("div",{className:"relative h-20 w-20",children:[v.jsxs("svg",{className:"h-full w-full -rotate-90",viewBox:"0 0 36 36",children:[v.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"#eee",strokeWidth:"2"}),v.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:r,strokeWidth:"2",strokeDasharray:`${e}, 100`})]}),v.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[v.jsx("span",{className:"text-2xl font-bold",children:Math.round(e)}),v.jsx("span",{className:"text-sm",children:t})]})]})},gE=({children:e,title:t,value:n,suffix:r="",icon:i,tooltip:a,color:o})=>v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:i}),v.jsx("span",{className:"flex pl-2",children:t})]}),a&&v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:a})]})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Cce,{value:n,suffix:r,color:o}),v.jsx("div",{className:"flex flex-col flex-1",children:e})]})]}),kce=({feature:e})=>{const{integration_count:t=0,integration_pending:n=0,regression_count:r=0,regression_pending:i=0,unit_count:a=0,unit_pending:o=0}=(e==null?void 0:e.test_pyramid)||{},l=[{type:"Unit Tests",count:a,pending:o,color:"blue-700",fill:"#1d4ed8"},{type:"Integration Tests",count:t,pending:n,color:"blue-500",fill:"#3b82f6"},{type:"Regression Tests",count:r,pending:i,color:"blue-300",fill:"#93c5fd"}],s=l.map(u=>({value:Math.max(Math.log(u.count+u.pending),0),fill:u.fill}));return v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"relative h-20 w-20",children:s.every(u=>u.value===0)?v.jsx("div",{className:"flex flex-col shrink-0 items-center justify-center size-full bg-gray-100 rounded-full shadow-sm text-gray-500 mb-4",children:v.jsx(NI,{})}):v.jsx("div",{className:"absolute left-[-31px] top-0 bottom-0",children:v.jsx($T,{width:150,height:80,children:v.jsx(kr,{dataKey:"value",data:s,reversed:!0,isAnimationActive:!1,children:v.jsx(Un,{position:"right",fill:"#000",stroke:"none",dataKey:"name"})})})})}),v.jsx("ul",{className:"flex flex-col flex-1 gap-y-1",children:l.reverse().map((u,c)=>v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`w-3 h-3 rounded-full bg-${u.color}`}),v.jsxs("p",{className:"text-xs text-gray-500",children:[u.type,": ",v.jsx("span",{className:"font-medium",children:u.count})," (",u.pending," ","pending)"]})]},c))})]})};function Nce({features:e}){const{name:t}=wM(),n=e[t];if(!n)return v.jsx("div",{className:"max-w-7xl mx-auto p-4 md:p-8",children:v.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6",children:[v.jsx("h1",{className:"text-xl font-bold text-red-600",children:"Feature Not Found"}),v.jsxs("p",{className:"mt-2",children:["Could not find feature: ",t]}),v.jsx(br,{to:"/",className:"text-blue-600 hover:text-blue-800 mt-4 inline-block",children:"← Back to Features"})]})});const r=n.additional_metrics.health.overall,i=n.additional_metrics.feature_size.percent_of_max,a=Is(i);return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-6 py-4 md:py-8",children:[v.jsx("div",{className:"flex justify-between items-center",children:v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:t})}),v.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-6",children:[v.jsx("div",{className:"col-span-1 xl:col-span-3",children:v.jsx(Ace,{name:t,feature:n})}),v.jsxs("div",{className:"col-span-1 xl:col-span-9",children:[v.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6 mb-8",children:[v.jsx(gE,{title:"Health Score",value:r.toFixed(0),suffix:"%",tooltip:"Feature health is determined by combining a weighted score for test coverage, code complexity, and encapsulation into a composite score from 0-100%. Each feature is then grouped into a categories ranging from low (needs attention) to good (healthy), which can be managed via `.feature_map/config.yml`.",icon:v.jsx(Ey,{}),color:wt(r).hex,children:v.jsxs("ul",{className:"flex flex-col gap-y-1",children:[v.jsxs("li",{className:"text-xs text-gray-500",children:["Coverage:"," ",n.additional_metrics.health.test_coverage_component.health_score.toFixed(0)," ","/ ",n.additional_metrics.health.test_coverage_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Complexity:"," ",n.additional_metrics.health.cyclomatic_complexity_component.health_score.toFixed(0)," ","/"," ",n.additional_metrics.health.cyclomatic_complexity_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Encapsulation:"," ",n.additional_metrics.health.encapsulation_component.health_score.toFixed(0)," ","/ ",n.additional_metrics.health.encapsulation_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Todos:"," ",n.additional_metrics.health.todo_count_component.health_score.toFixed(0)," /"," ",n.additional_metrics.health.todo_count_component.awardable_points]})]})}),v.jsx(gE,{title:"Test Coverage",value:n.additional_metrics.test_coverage.score,suffix:"%",tooltip:"Test coverage is determined by using CodeCov data (lines, hits, misses) to calculate a percentage score, from 0-100%, relative to the other features in the codebase. A qualitative coverage ranking is assigned to each feature, which can be managed which can be managed via `.feature_map/config.yml`.",icon:v.jsx(_y,{}),color:bt(n.additional_metrics.test_coverage.score).hex,children:v.jsxs("ul",{className:"flex flex-col gap-y-1",children:[v.jsxs("li",{className:"text-xs text-gray-500",children:["Hits: ",n.test_coverage?n.test_coverage.hits:0]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Lines: ",n.test_coverage?n.test_coverage.lines:0]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Misses: ",n.test_coverage?n.test_coverage.misses:0]})]})}),v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(q$,{})}),v.jsx("span",{className:"flex pl-2",children:"Feature Size"})]}),v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:"Feature size is determined by analyzing the total number of files and lines of code associated with each feature. Each feature is then grouped into different size bins, which can be configured in the config.yaml file."})]})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"relative h-20 flex items-center",children:v.jsx("div",{className:"text-2xl font-bold uppercase",children:xo(i)})}),v.jsx("div",{className:"flex flex-col gap-y-2",children:v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(o=>v.jsx("div",{className:`h-6 w-1.5 rounded-sm ${o<=a?"bg-blue-500":"bg-gray-300"}`},o))})}),v.jsxs("div",{children:[v.jsxs("div",{className:"text-[10px] text-gray-500",children:[n.assignments.files?n.assignments.files.length:0," files"]}),v.jsxs("div",{className:"text-[10px] text-gray-500",children:[Xie(n.metrics.lines_of_code)," lines"]})]})]})]}),v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(X$,{})}),v.jsx("span",{className:"flex pl-2",children:"Test Pyramid"})]}),v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:"Test pyramid distribution by category: shows features which are missing coverage in a given level of the pyramid, or which have a large number of pending tests."})]})]}),v.jsx(kce,{feature:n})]})]}),n.assignments.files&&n.assignments.files.length>0?v.jsx(v.Fragment,{children:v.jsx(Tce,{files:n.assignments.files})}):v.jsx("div",{className:"h-[300px] bg-white rounded-lg border border-gray-200 shadow-xs mb-8",children:v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0 h-16 w-16 bg-gray-100 rounded-full shadow-sm text-gray-500 mb-4",children:v.jsx(Sy,{})}),v.jsx("p",{children:"No files found for this feature"})]})})]})]})]})}const Mce=[{name:"Dashboard",pathname:"",icon:TI},{name:"Digest",pathname:"Digest",icon:OI}];function pa(...e){return e.filter(Boolean).join(" ")}function yE(){const e=Tr(),{linked_sites:t,title:n}=wr.project.documentation_site,{internal_resources:r}=wr.project.documentation_site;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex h-16 shrink-0 items-center",children:v.jsx(br,{to:"/",children:"Feature Documentation"})}),v.jsx("nav",{className:"flex flex-1 flex-col",children:v.jsxs("ul",{role:"list",className:"flex flex-1 flex-col gap-y-7",children:[v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:n}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:Mce.map(i=>v.jsx("li",{children:v.jsxs(br,{to:i.pathname,className:pa(e.pathname===`/${i.pathname}`?"text-blue-600":"text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),children:[v.jsx(i.icon,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]}),t&&t.length>0&&v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:"Linked Feature Documentation"}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:t.map(i=>v.jsx("li",{children:v.jsxs("a",{href:i.url,target:"_blank",className:pa("text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),rel:"noreferrer",children:[v.jsx(Tl,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]}),r&&r.length>0&&v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:"Internal Resources"}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:r.map(i=>v.jsx("li",{children:v.jsxs("a",{href:i.url,target:"_blank",className:pa("text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),rel:"noreferrer",children:[v.jsx(Tl,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]})]})})]})}function Ice(){const[e,t]=b.useState(!1);return v.jsxs("div",{children:[v.jsxs(jue,{open:e,onClose:t,className:"relative z-50 lg:hidden",children:[v.jsx($ue,{transition:!0,className:"fixed inset-0 bg-gray-900/80 transition-opacity duration-300 ease-linear data-closed:opacity-0"}),v.jsx("div",{className:"fixed inset-0 flex",children:v.jsxs(rC,{transition:!0,className:"relative mr-16 flex w-full max-w-xs flex-1 transform transition duration-300 ease-in-out data-closed:-translate-x-full",children:[v.jsx(xp,{children:v.jsx("div",{className:"absolute left-full top-0 flex w-16 justify-center pt-5 duration-300 ease-in-out data-closed:opacity-0",children:v.jsxs("button",{type:"button",onClick:()=>t(!1),className:"-m-2.5 p-2.5",children:[v.jsx("span",{className:"sr-only",children:"Close sidebar"}),v.jsx(EI,{"aria-hidden":"true",className:"size-6 text-white"})]})})}),v.jsx("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-4",children:v.jsx(yE,{})})]})})]}),v.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col",children:v.jsx("div",{className:"flex grow flex-col overflow-y-auto border-r border-gray-200 bg-white px-6 pb-4",children:v.jsx(yE,{})})}),v.jsxs("div",{className:"lg:pl-72",children:[v.jsx("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white lg:hidden px-4 shadow-xs sm:gap-x-6 sm:px-6 lg:px-8",children:v.jsxs("button",{type:"button",onClick:()=>t(!0),className:"-m-2.5 p-2.5 text-gray-700 lg:hidden",children:[v.jsx("span",{className:"sr-only",children:"Open sidebar"}),v.jsx(CI,{"aria-hidden":"true",className:"size-6"})]})}),v.jsx("main",{className:"",children:v.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:v.jsx(IM,{})})})]})]})}function Rce(){const{features:e}=wr,t=Tr();return b.useEffect(()=>{window.scrollTo(0,0)},[t]),v.jsx(LM,{children:v.jsxs(vl,{element:v.jsx(Ice,{}),children:[v.jsx(vl,{path:"",element:v.jsx(_ce,{features:e})}),v.jsx(vl,{path:"digest",element:v.jsx(jce,{features:e})}),v.jsx(vl,{path:":name",element:v.jsx(Nce,{features:e})})]})})}zh.createRoot(document.getElementById("root")).render(v.jsx(j.StrictMode,{children:v.jsx(lI,{children:v.jsx(Rce,{})})}));
272
+ `)),[]});var ise=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ise||{});function RA(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function LA(e,t,n,r){let[i,a]=b.useState(n),{hasFlag:o,addFlag:l,removeFlag:s}=nse(e&&i?3:0),u=b.useRef(!1),c=b.useRef(!1),f=sa();return he(()=>{var d;if(e){if(n&&a(!0),!t){n&&l(3);return}return(d=r==null?void 0:r.start)==null||d.call(r,n),ase(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(l(3),s(4)):(l(4),s(2)))},run(){c.current?n?(s(3),l(4)):(s(4),l(3)):n?s(1):l(1)},done(){var p;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,s(7),n||a(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,f]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ase(e,{prepare:t,run:n,done:r,inFlight:i}){let a=Zn();return lse(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(ose(e,r))})}),a.dispose}function ose(e,t){var n,r;let i=Zn();if(!e)return i.dispose;let a=!1;i.add(()=>{a=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),i.dispose):(Promise.allSettled(o.map(l=>l.finished)).then(()=>{a||t()}),i.dispose)}function lse(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function sse(e,{container:t,accept:n,walk:r}){let i=b.useRef(n),a=b.useRef(r);b.useEffect(()=>{i.current=n,a.current=r},[n,r]),he(()=>{if(!t||!e)return;let o=vi(t);if(!o)return;let l=i.current,s=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),c=o.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)s(c.currentNode)},[t,e,i,a])}function Z0(e,t){let n=b.useRef([]),r=Q(e);b.useEffect(()=>{let i=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let l=r(t,i);return n.current=t,l}},[r,...t])}function use(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const DA={...mc},cse=DA.useInsertionEffect,fse=cse||(e=>e());function FA(e){const t=b.useRef(()=>{});return fse(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var xg=typeof document<"u"?b.useLayoutEffect:b.useEffect;let tE=!1,dse=0;const nE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dse++;function pse(){const[e,t]=b.useState(()=>tE?nE():void 0);return xg(()=>{e==null&&t(nE())},[]),b.useEffect(()=>{tE=!0},[]),e}const hse=DA.useId,mse=hse||pse;function vse(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const gse=b.createContext(null),yse=b.createContext(null),xse=()=>{var e;return((e=b.useContext(gse))==null?void 0:e.id)||null},bse=()=>b.useContext(yse),wse="data-floating-ui-focusable";function _se(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=mse(),a=b.useRef({}),[o]=b.useState(()=>vse()),l=xse()!=null,[s,u]=b.useState(r.reference),c=FA((p,h,m)=>{a.current.openEvent=p?h:void 0,o.emit("openchange",{open:p,event:h,reason:m,nested:l}),n==null||n(p,h,m)}),f=b.useMemo(()=>({setPositionReference:u}),[]),d=b.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return b.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:d,events:o,floatingId:i,refs:f}),[t,c,d,o,i,f])}function Sse(e){e===void 0&&(e={});const{nodeId:t}=e,n=_se({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=b.useState(null),[l,s]=b.useState(null),c=(i==null?void 0:i.domReference)||a,f=b.useRef(null),d=bse();xg(()=>{c&&(f.current=c)},[c]);const p=YT({...e,elements:{...i,...l&&{reference:l}}}),h=b.useCallback(x=>{const E=de(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;s(E),p.refs.setReference(E)},[p.refs]),m=b.useCallback(x=>{(de(x)||x===null)&&(f.current=x,o(x)),(de(p.refs.reference.current)||p.refs.reference.current===null||x!==null&&!de(x))&&p.refs.setReference(x)},[p.refs]),w=b.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:f}),[p.refs,m,h]),y=b.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),g=b.useMemo(()=>({...p,...r,refs:w,elements:y,nodeId:t}),[p,w,y,t,r]);return xg(()=>{r.dataRef.current.floatingContext=g;const x=d==null?void 0:d.nodesRef.current.find(E=>E.id===t);x&&(x.context=g)}),b.useMemo(()=>({...p,context:g,refs:w,elements:y}),[p,w,y,g])}const rE="active",iE="selected";function Lh(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[rE]:o,[iE]:l,...s}=e;a=s}return{...n==="floating"&&{tabIndex:-1,[wse]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(s=>{let[u,c]=s;if(!(i&&[rE,iE].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),o[u]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];return(d=r.get(u))==null?void 0:d.map(w=>w(...h)).find(w=>w!==void 0)}}}else o[u]=c}),o),{})}}function Ese(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),i=b.useCallback(l=>Lh(l,e,"reference"),t),a=b.useCallback(l=>Lh(l,e,"floating"),n),o=b.useCallback(l=>Lh(l,e,"item"),r);return b.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}function aE(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Ose=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:a=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:u,...c}=la(e,t),{rects:f,elements:{floating:d}}=t,p=n.current[o],h=(u==null?void 0:u.current)||d,m=d.clientTop||h.clientTop,w=d.clientTop!==0,y=h.clientTop!==0,g=d===h;if(!p)return{};const x={...t,...await B0(-p.offsetTop-d.clientTop-f.reference.height/2-p.offsetHeight/2-a).fn(t)},E=await Ph(aE(x,h.scrollHeight+m+d.clientTop),c),_=await Ph(x,{...c,elementContext:"reference"}),S=vt(0,E.top),O=x.y+S,C=(h.scrollHeight>h.clientHeight?A=>A:Rs)(vt(0,h.scrollHeight+(w&&g||y?m*2:0)-S-vt(0,E.bottom)));if(h.style.maxHeight=C+"px",h.scrollTop=S,i){const A=h.offsetHeight<p.offsetHeight*Xi(l,n.current.length)-1||_.top>=-s||_.bottom>=-s;Ht.flushSync(()=>i(A))}return r&&(r.current=await Ph(aE({...x,y:O},h.offsetHeight+m+d.clientTop),c)),{y:O}}});function $se(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:a,scrollRef:o,onChange:l}=t,s=FA(l),u=b.useRef(!1),c=b.useRef(null),f=b.useRef(null);b.useEffect(()=>{if(!i)return;function p(m){if(m.ctrlKey||!h||a.current==null)return;const w=m.deltaY,y=a.current.top>=-.5,g=a.current.bottom>=-.5,x=h.scrollHeight-h.clientHeight,E=w<0?-1:1,_=w<0?"max":"min";h.scrollHeight<=h.clientHeight||(!y&&w>0||!g&&w<0?(m.preventDefault(),Ht.flushSync(()=>{s(S=>S+Math[_](w,x*E))})):/firefox/i.test(use())&&(h.scrollTop+=w))}const h=(o==null?void 0:o.current)||r.floating;if(n&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=h.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{c.current=null,f.current=null,h.removeEventListener("wheel",p)}},[i,n,r.floating,a,o,s]);const d=b.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(o==null?void 0:o.current)||r.floating;if(!(!a.current||!p||!u.current)){if(c.current!==null){const h=p.scrollTop-c.current;(a.current.bottom<-.5&&h<-1||a.current.top<-.5&&h>1)&&Ht.flushSync(()=>s(m=>m+h))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[r.floating,s,a,o]);return b.useMemo(()=>i?{floating:d}:{},[i,d])}let Ko=b.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Ko.displayName="FloatingContext";let J0=b.createContext(null);J0.displayName="PlacementContext";function Pse(e){return b.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function jse(){return b.useContext(Ko).setReference}function Tse(){return b.useContext(Ko).getReferenceProps}function Ase(){let{getFloatingProps:e,slot:t}=b.useContext(Ko);return b.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Cse(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=b.useContext(J0),n=b.useMemo(()=>e,[JSON.stringify(e,(i,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);he(()=>{t==null||t(n??null)},[t,n]);let r=b.useContext(Ko);return b.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let oE=4;function kse({children:e,enabled:t=!0}){let[n,r]=b.useState(null),[i,a]=b.useState(0),o=b.useRef(null),[l,s]=b.useState(null);Nse(l);let u=t&&n!==null&&l!==null,{to:c="bottom",gap:f=0,offset:d=0,padding:p=0,inner:h}=Mse(n,l),[m,w="center"]=c.split(" ");he(()=>{u&&a(0)},[u]);let{refs:y,floatingStyles:g,context:x}=Sse({open:u,placement:m==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${m}`:`${m}-${w}`,strategy:"absolute",transform:!1,middleware:[B0({mainAxis:m==="selection"?0:f,crossAxis:d}),QT({padding:p}),m!=="selection"&&ooe({padding:p}),m==="selection"&&h?Ose({...h,padding:p,overflowRef:o,offset:i,minItemsVisible:oE,referenceOverflowThreshold:p,onFallbackChange(A){var N,I;if(!A)return;let D=x.elements.floating;if(!D)return;let M=parseFloat(getComputedStyle(D).scrollPaddingBottom)||0,F=Math.min(oE,D.childElementCount),R=0,P=0;for(let k of(I=(N=x.elements.floating)==null?void 0:N.childNodes)!=null?I:[])if(k instanceof HTMLElement){let B=k.offsetTop,L=B+k.clientHeight+M,U=D.scrollTop,V=U+D.clientHeight;if(B>=U&&L<=V)F--;else{P=Math.max(0,Math.min(L,V)-Math.max(B,U)),R=k.clientHeight;break}}F>=1&&a(k=>{let B=R*F-P+M;return k>=B?k:B})}}):null,loe({padding:p,apply({availableWidth:A,availableHeight:N,elements:I}){Object.assign(I.floating.style,{overflow:"auto",maxWidth:`${A}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:qT}),[E=m,_=w]=x.placement.split("-");m==="selection"&&(E="selection");let S=b.useMemo(()=>({anchor:[E,_].filter(Boolean).join(" ")}),[E,_]),O=$se(x,{overflowRef:o,onChange:a}),{getReferenceProps:$,getFloatingProps:T}=Ese([O]),C=Q(A=>{s(A),y.setFloating(A)});return b.createElement(J0.Provider,{value:r},b.createElement(Ko.Provider,{value:{setFloating:C,setReference:y.setReference,styles:g,getReferenceProps:$,getFloatingProps:T,slot:S}},e))}function Nse(e){he(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Mse(e,t){var n,r,i;let a=Dh((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=Dh((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=Dh((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function Dh(e,t,n=void 0){let r=sa(),i=Q((s,u)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!u)return[n,null];let c=lE(s,u);return[c,f=>{let d=BA(s);{let p=d.map(h=>window.getComputedStyle(u).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[y,g]of d.entries()){let x=window.getComputedStyle(u).getPropertyValue(g);if(p[y]!==x){p[y]=x,m=!0;break}}if(!m)return;let w=lE(s,u);c!==w&&(f(w),c=w)})}return r.dispose}]}return[n,null]}),a=b.useMemo(()=>i(e,t)[0],[e,t]),[o=a,l]=b.useState();return he(()=>{let[s,u]=i(e,t);if(l(s),!!u)return u(l)},[e,t]),o}function BA(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...BA(i)]:[r]}return[]}function lE(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let mp=b.createContext(null);mp.displayName="OpenClosedContext";var Et=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Et||{});function du(){return b.useContext(mp)}function zA({value:e,children:t}){return j.createElement(mp.Provider,{value:e},t)}function Ise({children:e}){return j.createElement(mp.Provider,{value:null},e)}function Rse(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ur=[];Rse(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Ur[0]===t.target)return;let n=t.target;n=n.closest(Kf),Ur.unshift(n??t.target),Ur=Ur.filter(r=>r!=null&&r.isConnected),Ur.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Lse(e){throw new Error("Unexpected object: "+e)}var gt=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(gt||{});function Fh(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 1:{i===-1&&(i=n.length);for(let a=i-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 2:{for(let a=i+1;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 3:{for(let a=n.length-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 4:{for(let a=0;a<n.length;++a)if(t.resolveId(n[a],a,n)===e.id)return a;return r}case 5:return null;default:Lse(e)}}function UA(e){let t=Q(e),n=b.useRef(!1);b.useEffect(()=>(n.current=!1,()=>{n.current=!0,fp(()=>{n.current&&t()})}),[t])}function Dse(){let e=typeof document>"u";return"useSyncExternalStore"in mc?(t=>t.useSyncExternalStore)(mc)(()=>()=>{},()=>!1,()=>!e):!1}function pu(){let e=Dse(),[t,n]=b.useState(zi.isHandoffComplete);return t&&zi.isHandoffComplete===!1&&n(!1),b.useEffect(()=>{t!==!0&&n(!0)},[t]),b.useEffect(()=>zi.handoff(),[]),e?!1:t}let HA=b.createContext(!1);function Fse(){return b.useContext(HA)}function sE(e){return j.createElement(HA.Provider,{value:e.force},e.children)}function Bse(e){let t=Fse(),n=b.useContext(VA),r=Vo(e),[i,a]=b.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(zi.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return b.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),b.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),i}let WA=b.Fragment,zse=Ee(function(e,t){let n=e,r=b.useRef(null),i=ot(Sle(f=>{r.current=f}),t),a=Vo(r),o=Bse(r),[l]=b.useState(()=>{var f;return zi.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),s=b.useContext(bg),u=pu();he(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),he(()=>{if(l&&s)return s.register(l)},[s,l]),UA(()=>{var f;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let c=Re();return u?!o||!l?null:Ht.createPortal(c({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:WA,name:"Portal"}),l):null});function Use(e,t){let n=ot(t),{enabled:r=!0,...i}=e,a=Re();return r?j.createElement(zse,{...i,ref:n}):a({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:WA,name:"Portal"})}let Hse=b.Fragment,VA=b.createContext(null);function Wse(e,t){let{target:n,...r}=e,i={ref:ot(t)},a=Re();return j.createElement(VA.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Hse,name:"Popover.Group"}))}let bg=b.createContext(null);function Vse(){let e=b.useContext(bg),t=b.useRef([]),n=Q(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Q(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=b.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,b.useMemo(()=>function({children:a}){return j.createElement(bg.Provider,{value:i},a)},[i])]}let Kse=Ee(Use),KA=Ee(Wse),GA=Object.assign(Kse,{Group:KA});function Gse(e,t=typeof document<"u"?document.defaultView:null,n){let r=Wo(e,"escape");MA(t,"keydown",i=>{r&&(i.defaultPrevented||i.key===Ne.Escape&&n(i))})}function qse(){var e;let[t]=b.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=b.useState((e=t==null?void 0:t.matches)!=null?e:!1);return he(()=>{if(!t)return;function i(a){r(a.matches)}return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[t]),n}function Xse({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=Vo(n),i=Q(()=>{var a,o;let l=[];for(let s of e)s!==null&&(s instanceof HTMLElement?l.push(s):"current"in s&&s.current instanceof HTMLElement&&l.push(s.current));if(t!=null&&t.current)for(let s of t.current)l.push(s);for(let s of(a=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?a:[])s!==document.body&&s!==document.head&&s instanceof HTMLElement&&s.id!=="headlessui-portal-root"&&(n&&(s.contains(n)||s.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||l.some(u=>s.contains(u))||l.push(s));return l});return{resolveContainers:i,contains:Q(a=>i().some(o=>o.contains(a)))}}let qA=b.createContext(null);function uE({children:e,node:t}){let[n,r]=b.useState(null),i=XA(t??n);return j.createElement(qA.Provider,{value:i},e,i===null&&j.createElement(So,{features:ea.Hidden,ref:a=>{var o,l;if(a){for(let s of(l=(o=vi(a))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?l:[])if(s!==document.body&&s!==document.head&&s instanceof HTMLElement&&s!=null&&s.contains(a)){r(s);break}}}}))}function XA(e=null){var t;return(t=b.useContext(qA))!=null?t:e}function ex(){let e=b.useRef(!1);return he(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var xl=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(xl||{});function Yse(){let e=b.useRef(0);return kA(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function YA(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let Qse="div";var ji=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(ji||{});function Zse(e,t){let n=b.useRef(null),r=ot(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:l=15,...s}=e;pu()||(l=0);let u=Vo(n);nue(l,{ownerDocument:u});let c=rue(l,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:a});iue(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:c});let f=Yse(),d=Q(g=>{let x=n.current;x&&(E=>E())(()=>{jn(f.current,{[xl.Forwards]:()=>{ii(x,_t.First,{skipElements:[g.relatedTarget,a]})},[xl.Backwards]:()=>{ii(x,_t.Last,{skipElements:[g.relatedTarget,a]})}})})}),p=Wo(!!(l&2),"focus-trap#tab-lock"),h=sa(),m=b.useRef(!1),w={ref:r,onKeyDown(g){g.key=="Tab"&&(m.current=!0,h.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){if(!(l&4))return;let x=YA(o);n.current instanceof HTMLElement&&x.add(n.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(QA(x,E)||(m.current?ii(n.current,jn(f.current,{[xl.Forwards]:()=>_t.Next,[xl.Backwards]:()=>_t.Previous})|_t.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Gn(g.target)))}},y=Re();return j.createElement(j.Fragment,null,p&&j.createElement(So,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:ea.Focusable}),y({ourProps:w,theirProps:s,defaultTag:Qse,name:"FocusTrap"}),p&&j.createElement(So,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:ea.Focusable}))}let Jse=Ee(Zse),eue=Object.assign(Jse,{features:ji});function tue(e=!0){let t=b.useRef(Ur.slice());return Z0(([n],[r])=>{r===!0&&n===!1&&fp(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Ur.slice())},[e,Ur,t]),Q(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function nue(e,{ownerDocument:t}){let n=!!(e&8),r=tue(n);Z0(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&Gn(r())},[n]),UA(()=>{n&&Gn(r())})}function rue(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=b.useRef(null),o=Wo(!!(e&1),"focus-trap#initial-focus"),l=ex();return Z0(()=>{if(e===0)return;if(!o){i!=null&&i.current&&Gn(i.current);return}let s=n.current;s&&fp(()=>{if(!l.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){a.current=u;return}}else if(s.contains(u)){a.current=u;return}if(r!=null&&r.current)Gn(r.current);else{if(e&16){if(ii(s,_t.First|_t.AutoFocus)!==Ds.Error)return}else if(ii(s,_t.First)!==Ds.Error)return;if(i!=null&&i.current&&(Gn(i.current),(t==null?void 0:t.activeElement)===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t==null?void 0:t.activeElement})},[i,o,e]),a}function iue(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=ex(),o=!!(e&4);MA(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let s=YA(r);n.current instanceof HTMLElement&&s.add(n.current);let u=i.current;if(!u)return;let c=l.target;c&&c instanceof HTMLElement?QA(s,c)?(i.current=c,Gn(c)):(l.preventDefault(),l.stopPropagation(),Gn(u)):Gn(i.current)},!0)}function QA(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function ZA(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:eC)!==b.Fragment||j.Children.count(e.children)===1}let vp=b.createContext(null);vp.displayName="TransitionContext";var aue=(e=>(e.Visible="visible",e.Hidden="hidden",e))(aue||{});function oue(){let e=b.useContext(vp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function lue(){let e=b.useContext(gp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let gp=b.createContext(null);gp.displayName="NestingContext";function yp(e){return"children"in e?yp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function JA(e,t){let n=Nr(e),r=b.useRef([]),i=ex(),a=sa(),o=Q((p,h=Kr.Hidden)=>{let m=r.current.findIndex(({el:w})=>w===p);m!==-1&&(jn(h,{[Kr.Unmount](){r.current.splice(m,1)},[Kr.Hidden](){r.current[m].state="hidden"}}),a.microTask(()=>{var w;!yp(r)&&i.current&&((w=n.current)==null||w.call(n))}))}),l=Q(p=>{let h=r.current.find(({el:m})=>m===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>o(p,Kr.Unmount)}),s=b.useRef([]),u=b.useRef(Promise.resolve()),c=b.useRef({enter:[],leave:[]}),f=Q((p,h,m)=>{s.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([w])=>w!==p)),t==null||t.chains.current[h].push([p,new Promise(w=>{s.current.push(w)})]),t==null||t.chains.current[h].push([p,new Promise(w=>{Promise.all(c.current[h].map(([y,g])=>g)).then(()=>w())})]),h==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),d=Q((p,h,m)=>{Promise.all(c.current[h].splice(0).map(([w,y])=>y)).then(()=>{var w;(w=s.current.shift())==null||w()}).then(()=>m(h))});return b.useMemo(()=>({children:r,register:l,unregister:o,onStart:f,onStop:d,wait:u,chains:c}),[l,o,r,f,d,c,u])}let eC=b.Fragment,tC=_o.RenderStrategy;function sue(e,t){var n,r;let{transition:i=!0,beforeEnter:a,afterEnter:o,beforeLeave:l,afterLeave:s,enter:u,enterFrom:c,enterTo:f,entered:d,leave:p,leaveFrom:h,leaveTo:m,...w}=e,[y,g]=b.useState(null),x=b.useRef(null),E=ZA(e),_=ot(...E?[x,t,g]:t===null?[]:[t]),S=(n=w.unmount)==null||n?Kr.Unmount:Kr.Hidden,{show:O,appear:$,initial:T}=oue(),[C,A]=b.useState(O?"visible":"hidden"),N=lue(),{register:I,unregister:D}=N;he(()=>I(x),[I,x]),he(()=>{if(S===Kr.Hidden&&x.current){if(O&&C!=="visible"){A("visible");return}return jn(C,{hidden:()=>D(x),visible:()=>I(x)})}},[C,x,I,D,O,S]);let M=pu();he(()=>{if(E&&M&&C==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,C,M,E]);let F=T&&!$,R=$&&O&&T,P=b.useRef(!1),k=JA(()=>{P.current||(A("hidden"),D(x))},N),B=Q(Ce=>{P.current=!0;let Oe=Ce?"enter":"leave";k.onStart(x,Oe,K=>{K==="enter"?a==null||a():K==="leave"&&(l==null||l())})}),L=Q(Ce=>{let Oe=Ce?"enter":"leave";P.current=!1,k.onStop(x,Oe,K=>{K==="enter"?o==null||o():K==="leave"&&(s==null||s())}),Oe==="leave"&&!yp(k)&&(A("hidden"),D(x))});b.useEffect(()=>{E&&i||(B(O),L(O))},[O,E,i]);let U=!(!i||!E||!M||F),[,V]=LA(U,y,O,{start:B,end:L}),re=Fr({ref:_,className:((r=gg(w.className,R&&u,R&&c,V.enter&&u,V.enter&&V.closed&&c,V.enter&&!V.closed&&f,V.leave&&p,V.leave&&!V.closed&&h,V.leave&&V.closed&&m,!V.transition&&O&&d))==null?void 0:r.trim())||void 0,...RA(V)}),ie=0;C==="visible"&&(ie|=Et.Open),C==="hidden"&&(ie|=Et.Closed),V.enter&&(ie|=Et.Opening),V.leave&&(ie|=Et.Closing);let J=Re();return j.createElement(gp.Provider,{value:k},j.createElement(zA,{value:ie},J({ourProps:re,theirProps:w,defaultTag:eC,features:tC,visible:C==="visible",name:"Transition.Child"})))}function uue(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=b.useRef(null),l=ZA(e),s=ot(...l?[o,t]:t===null?[]:[t]);pu();let u=du();if(n===void 0&&u!==null&&(n=(u&Et.Open)===Et.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=b.useState(n?"visible":"hidden"),d=JA(()=>{n||f("hidden")}),[p,h]=b.useState(!0),m=b.useRef([n]);he(()=>{p!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let w=b.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);he(()=>{n?f("visible"):!yp(d)&&o.current!==null&&f("hidden")},[n,d]);let y={unmount:i},g=Q(()=>{var _;p&&h(!1),(_=e.beforeEnter)==null||_.call(e)}),x=Q(()=>{var _;p&&h(!1),(_=e.beforeLeave)==null||_.call(e)}),E=Re();return j.createElement(gp.Provider,{value:d},j.createElement(vp.Provider,{value:w},E({ourProps:{...y,as:b.Fragment,children:j.createElement(nC,{ref:s,...y,...a,beforeEnter:g,beforeLeave:x})},theirProps:{},defaultTag:b.Fragment,features:tC,visible:c==="visible",name:"Transition"})))}function cue(e,t){let n=b.useContext(vp)!==null,r=du()!==null;return j.createElement(j.Fragment,null,!n&&r?j.createElement(wg,{ref:t,...e}):j.createElement(nC,{ref:t,...e}))}let wg=Ee(uue),nC=Ee(sue),xp=Ee(cue),fue=Object.assign(wg,{Child:xp,Root:wg});var due=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(due||{}),pue=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(pue||{});let hue={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},tx=b.createContext(null);tx.displayName="DialogContext";function bp(e){let t=b.useContext(tx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,bp),n}return t}function mue(e,t){return jn(t.type,hue,e,t)}let cE=Ee(function(e,t){let n=b.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:l="dialog",autoFocus:s=!0,__demoMode:u=!1,unmount:c=!1,...f}=e,d=b.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(d.current||(d.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=du();i===void 0&&p!==null&&(i=(p&Et.Open)===Et.Open);let h=b.useRef(null),m=ot(h,t),w=Vo(h),y=i?0:1,[g,x]=b.useReducer(mue,{titleId:null,descriptionId:null,panelRef:b.createRef()}),E=Q(()=>a(!1)),_=Q(L=>x({type:0,id:L})),S=pu()?y===0:!1,[O,$]=Vse(),T={get current(){var L;return(L=g.panelRef.current)!=null?L:h.current}},C=XA(),{resolveContainers:A}=Xse({mainTreeNode:C,portals:O,defaultContainers:[T]}),N=p!==null?(p&Et.Closing)===Et.Closing:!1;PA(u||N?!1:S,{allowed:Q(()=>{var L,U;return[(U=(L=h.current)==null?void 0:L.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:Q(()=>{var L;return[(L=C==null?void 0:C.closest("body > *:not(#headlessui-portal-root)"))!=null?L:null]})}),NA(S,A,L=>{L.preventDefault(),E()}),Gse(S,w==null?void 0:w.defaultView,L=>{L.preventDefault(),L.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),E()}),IA(u||N?!1:S,w,A),jA(S,h,E);let[I,D]=cu(),M=b.useMemo(()=>[{dialogState:y,close:E,setTitleId:_,unmount:c},g],[y,g,E,_,c]),F=b.useMemo(()=>({open:y===0}),[y]),R={ref:m,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:y===0?!0:void 0,"aria-labelledby":g.titleId,"aria-describedby":I,unmount:c},P=!qse(),k=ji.None;S&&!u&&(k|=ji.RestoreFocus,k|=ji.TabLock,s&&(k|=ji.AutoFocus),P&&(k|=ji.InitialFocus));let B=Re();return j.createElement(Ise,null,j.createElement(sE,{force:!0},j.createElement(GA,null,j.createElement(tx.Provider,{value:M},j.createElement(KA,{target:h},j.createElement(sE,{force:!1},j.createElement(D,{slot:F},j.createElement($,null,j.createElement(eue,{initialFocus:o,initialFocusFallback:h,containers:A,features:k},j.createElement(Nle,{value:E},B({ourProps:R,theirProps:f,slot:F,defaultTag:vue,features:gue,visible:y===0,name:"Dialog"})))))))))))}),vue="div",gue=_o.RenderStrategy|_o.Static;function yue(e,t){let{transition:n=!1,open:r,...i}=e,a=du(),o=e.hasOwnProperty("open")||a!==null,l=e.hasOwnProperty("onClose");if(!o&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?j.createElement(uE,null,j.createElement(fue,{show:r,transition:n,unmount:i.unmount},j.createElement(cE,{ref:t,...i}))):j.createElement(uE,null,j.createElement(cE,{ref:t,open:r,...i}))}let xue="div";function bue(e,t){let n=b.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:l},s]=bp("Dialog.Panel"),u=ot(t,s.panelRef),c=b.useMemo(()=>({open:o===0}),[o]),f=Q(w=>{w.stopPropagation()}),d={ref:u,id:r,onClick:f},p=i?xp:b.Fragment,h=i?{unmount:l}:{},m=Re();return j.createElement(p,{...h},m({ourProps:d,theirProps:a,slot:c,defaultTag:xue,name:"Dialog.Panel"}))}let wue="div";function _ue(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=bp("Dialog.Backdrop"),o=b.useMemo(()=>({open:i===0}),[i]),l={ref:t,"aria-hidden":!0},s=n?xp:b.Fragment,u=n?{unmount:a}:{},c=Re();return j.createElement(s,{...u},c({ourProps:l,theirProps:r,slot:o,defaultTag:wue,name:"Dialog.Backdrop"}))}let Sue="h2";function Eue(e,t){let n=b.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=bp("Dialog.Title"),l=ot(t);b.useEffect(()=>(o(r),()=>o(null)),[r,o]);let s=b.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return Re()({ourProps:u,theirProps:i,slot:s,defaultTag:Sue,name:"Dialog.Title"})}let Oue=Ee(yue),rC=Ee(bue),$ue=Ee(_ue),Pue=Ee(Eue),jue=Object.assign(Oue,{Panel:rC,Title:Pue,Description:SA}),Tue="div";function Aue(e,t){let n=`headlessui-control-${b.useId()}`,[r,i]=fu(),[a,o]=cu(),l=uu(),{disabled:s=l||!1,...u}=e,c=b.useMemo(()=>({disabled:s}),[s]),f={ref:t,disabled:s||void 0,"aria-disabled":s||void 0},d=Re();return j.createElement(lle,{value:s},j.createElement(i,{value:r},j.createElement(o,{value:a},j.createElement(wle,{id:n},d({ourProps:f,theirProps:{...u,children:j.createElement(gle,null,typeof u.children=="function"?u.children(c):u.children)},slot:c,defaultTag:Tue,name:"Field"})))))}let Cue=Ee(Aue);function kue(e,t){let n=b.useRef({left:0,top:0});if(he(()=>{if(!t)return;let i=t.getBoundingClientRect();i&&(n.current=i)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let fE=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function dE(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let a=!1;for(let l of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let o=a?(n=i.innerText)!=null?n:"":r;return fE.test(o)&&(o=o.replace(fE,"")),o}function Nue(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let a=document.getElementById(i);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():dE(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return dE(e).trim()}function Mue(e){let t=b.useRef(""),n=b.useRef("");return Q(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let a=Nue(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var Iue=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Iue||{}),Rue=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Rue||{}),Lue=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(Lue||{});function Bh(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=Q0(t(e.items.slice()),a=>a.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}let Due={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n,r,i,a,o;if(e.menuState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===gt.Nothing)return{...l,activeItemIndex:null};if(t.focus===gt.Specific)return{...l,activeItemIndex:e.items.findIndex(c=>c.id===t.id)};if(t.focus===gt.Previous){let c=e.activeItemIndex;if(c!==null){let f=e.items[c].dataRef.current.domRef,d=Fh(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.items[d].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===p.current||((i=p.current)==null?void 0:i.previousElementSibling)===null)return{...l,activeItemIndex:d}}}}else if(t.focus===gt.Next){let c=e.activeItemIndex;if(c!==null){let f=e.items[c].dataRef.current.domRef,d=Fh(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.items[d].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===p.current||((o=p.current)==null?void 0:o.nextElementSibling)===null)return{...l,activeItemIndex:d}}}}let s=Bh(e),u=Fh(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...l,...s,activeItemIndex:u}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(r))&&!o.dataRef.current.disabled}),a=i?e.items.indexOf(i):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=Bh(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Bh(e,r=>{let i=r.findIndex(a=>a.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},nx=b.createContext(null);nx.displayName="MenuContext";function wp(e){let t=b.useContext(nx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wp),n}return t}function Fue(e,t){return jn(t.type,Due,e,t)}let Bue=b.Fragment;function zue(e,t){let{__demoMode:n=!1,...r}=e,i=b.useReducer(Fue,{__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsElement:o,buttonElement:l},s]=i,u=ot(t);NA(a===0,[l,o],(h,m)=>{s({type:1}),Y0(m,X0.Loose)||(h.preventDefault(),l==null||l.focus())});let c=Q(()=>{s({type:1})}),f=b.useMemo(()=>({open:a===0,close:c}),[a,c]),d={ref:u},p=Re();return j.createElement(kse,null,j.createElement(nx.Provider,{value:i},j.createElement(zA,{value:jn(a,{0:Et.Open,1:Et.Closed})},p({ourProps:d,theirProps:r,slot:f,defaultTag:Bue,name:"Menu"}))))}let Uue="button";function Hue(e,t){var n;let r=b.useId(),{id:i=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[s,u]=wp("Menu.Button"),c=Tse(),f=ot(t,jse(),Q(O=>u({type:7,element:O}))),d=Q(O=>{switch(O.key){case Ne.Space:case Ne.Enter:case Ne.ArrowDown:O.preventDefault(),O.stopPropagation(),Ht.flushSync(()=>u({type:0})),u({type:2,focus:gt.First});break;case Ne.ArrowUp:O.preventDefault(),O.stopPropagation(),Ht.flushSync(()=>u({type:0})),u({type:2,focus:gt.Last});break}}),p=Q(O=>{switch(O.key){case Ne.Space:O.preventDefault();break}}),h=Q(O=>{var $;if(G0(O.currentTarget))return O.preventDefault();a||(s.menuState===0?(Ht.flushSync(()=>u({type:1})),($=s.buttonElement)==null||$.focus({preventScroll:!0})):(O.preventDefault(),u({type:0})))}),{isFocusVisible:m,focusProps:w}=K0({autoFocus:o}),{isHovered:y,hoverProps:g}=V0({isDisabled:a}),{pressed:x,pressProps:E}=ole({disabled:a}),_=b.useMemo(()=>({open:s.menuState===0,active:x||s.menuState===0,disabled:a,hover:y,focus:m,autofocus:o}),[s,y,m,x,a,o]),S=dp(c(),{ref:f,id:i,type:Xle(e,s.buttonElement),"aria-haspopup":"menu","aria-controls":(n=s.itemsElement)==null?void 0:n.id,"aria-expanded":s.menuState===0,disabled:a||void 0,autoFocus:o,onKeyDown:d,onKeyUp:p,onClick:h},w,g,E);return Re()({ourProps:S,theirProps:l,slot:_,defaultTag:Uue,name:"Menu.Button"})}let Wue="div",Vue=_o.RenderStrategy|_o.Static;function Kue(e,t){var n,r;let i=b.useId(),{id:a=`headlessui-menu-items-${i}`,anchor:o,portal:l=!1,modal:s=!0,transition:u=!1,...c}=e,f=Pse(o),[d,p]=wp("Menu.Items"),[h,m]=Cse(f),w=Ase(),[y,g]=b.useState(null),x=ot(t,f?h:null,Q(P=>p({type:8,element:P})),g),E=Vo(d.itemsElement);f&&(l=!0);let _=du(),[S,O]=LA(u,y,_!==null?(_&Et.Open)===Et.Open:d.menuState===0);jA(S,d.buttonElement,()=>{p({type:1})});let $=d.__demoMode?!1:s&&d.menuState===0;IA($,E);let T=d.__demoMode?!1:s&&d.menuState===0;PA(T,{allowed:b.useCallback(()=>[d.buttonElement,d.itemsElement],[d.buttonElement,d.itemsElement])});let C=d.menuState!==0,A=kue(C,d.buttonElement)?!1:S;b.useEffect(()=>{let P=d.itemsElement;P&&d.menuState===0&&P!==(E==null?void 0:E.activeElement)&&P.focus({preventScroll:!0})},[d.menuState,d.itemsElement,E]),sse(d.menuState===0,{container:d.itemsElement,accept(P){return P.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:P.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(P){P.setAttribute("role","none")}});let N=sa(),I=Q(P=>{var k,B,L;switch(N.dispose(),P.key){case Ne.Space:if(d.searchQuery!=="")return P.preventDefault(),P.stopPropagation(),p({type:3,value:P.key});case Ne.Enter:if(P.preventDefault(),P.stopPropagation(),p({type:1}),d.activeItemIndex!==null){let{dataRef:U}=d.items[d.activeItemIndex];(B=(k=U.current)==null?void 0:k.domRef.current)==null||B.click()}AA(d.buttonElement);break;case Ne.ArrowDown:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Next});case Ne.ArrowUp:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Previous});case Ne.Home:case Ne.PageUp:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.First});case Ne.End:case Ne.PageDown:return P.preventDefault(),P.stopPropagation(),p({type:2,focus:gt.Last});case Ne.Escape:P.preventDefault(),P.stopPropagation(),Ht.flushSync(()=>p({type:1})),(L=d.buttonElement)==null||L.focus({preventScroll:!0});break;case Ne.Tab:P.preventDefault(),P.stopPropagation(),Ht.flushSync(()=>p({type:1})),Kle(d.buttonElement,P.shiftKey?_t.Previous:_t.Next);break;default:P.key.length===1&&(p({type:3,value:P.key}),N.setTimeout(()=>p({type:4}),350));break}}),D=Q(P=>{switch(P.key){case Ne.Space:P.preventDefault();break}}),M=b.useMemo(()=>({open:d.menuState===0}),[d.menuState]),F=dp(f?w():{},{"aria-activedescendant":d.activeItemIndex===null||(n=d.items[d.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=d.buttonElement)==null?void 0:r.id,id:a,onKeyDown:I,onKeyUp:D,role:"menu",tabIndex:d.menuState===0?0:void 0,ref:x,style:{...c.style,...m,"--button-width":Lle(d.buttonElement,!0).width},...RA(O)}),R=Re();return j.createElement(GA,{enabled:l?e.static||S:!1},R({ourProps:F,theirProps:c,slot:M,defaultTag:Wue,features:Vue,visible:A,name:"Menu.Items"}))}let Gue=b.Fragment;function que(e,t){let n=b.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:i=!1,...a}=e,[o,l]=wp("Menu.Item"),s=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=b.useRef(null),c=ot(t,u);he(()=>{if(!o.__demoMode&&o.menuState===0&&s&&o.activationTrigger!==0)return Zn().requestAnimationFrame(()=>{var A,N;(N=(A=u.current)==null?void 0:A.scrollIntoView)==null||N.call(A,{block:"nearest"})})},[o.__demoMode,u,s,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=Mue(u),d=b.useRef({disabled:i,domRef:u,get textValue(){return f()}});he(()=>{d.current.disabled=i},[d,i]),he(()=>(l({type:5,id:r,dataRef:d}),()=>l({type:6,id:r})),[d,r]);let p=Q(()=>{l({type:1})}),h=Q(A=>{if(i)return A.preventDefault();l({type:1}),AA(o.buttonElement)}),m=Q(()=>{if(i)return l({type:2,focus:gt.Nothing});l({type:2,focus:gt.Specific,id:r})}),w=tse(),y=Q(A=>{w.update(A),!i&&(s||l({type:2,focus:gt.Specific,id:r,trigger:0}))}),g=Q(A=>{w.wasMoved(A)&&(i||s||l({type:2,focus:gt.Specific,id:r,trigger:0}))}),x=Q(A=>{w.wasMoved(A)&&(i||s&&l({type:2,focus:gt.Nothing}))}),[E,_]=fu(),[S,O]=cu(),$=b.useMemo(()=>({active:s,focus:s,disabled:i,close:p}),[s,i,p]),T={id:r,ref:c,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-labelledby":E,"aria-describedby":S,disabled:void 0,onClick:h,onFocus:m,onPointerEnter:y,onMouseEnter:y,onPointerMove:g,onMouseMove:g,onPointerLeave:x,onMouseLeave:x},C=Re();return j.createElement(_,null,j.createElement(O,null,C({ourProps:T,theirProps:a,slot:$,defaultTag:Gue,name:"Menu.Item"})))}let Xue="div";function Yue(e,t){let[n,r]=fu(),i=e,a={ref:t,"aria-labelledby":n,role:"group"},o=Re();return j.createElement(r,null,o({ourProps:a,theirProps:i,slot:{},defaultTag:Xue,name:"Menu.Section"}))}let Que="header";function Zue(e,t){let n=b.useId(),{id:r=`headlessui-menu-heading-${n}`,...i}=e,a=q0();he(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return Re()({ourProps:o,theirProps:i,slot:{},defaultTag:Que,name:"Menu.Heading"})}let Jue="div";function ece(e,t){let n=e,r={ref:t,role:"separator"};return Re()({ourProps:r,theirProps:n,slot:{},defaultTag:Jue,name:"Menu.Separator"})}let tce=Ee(zue),iC=Ee(Hue),aC=Ee(Kue),oC=Ee(que),nce=Ee(Yue),rce=Ee(Zue),ice=Ee(ece),ace=Object.assign(tce,{Button:iC,Items:aC,Item:oC,Section:nce,Heading:rce,Separator:ice});var oce=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(oce||{});let lce={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Q0(n,r=>r.element.current)}},1(e,t){let n=e.options.slice(),r=e.options.findIndex(i=>i.id===t.id);return r===-1?e:(n.splice(r,1),{...e,options:n})}},rx=b.createContext(null);rx.displayName="RadioGroupDataContext";function ix(e){let t=b.useContext(rx);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ix),n}return t}let ax=b.createContext(null);ax.displayName="RadioGroupActionsContext";function ox(e){let t=b.useContext(ax);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ox),n}return t}function sce(e,t){return jn(t.type,lce,e,t)}let uce="div";function cce(e,t){let n=b.useId(),r=uu(),{id:i=`headlessui-radiogroup-${n}`,value:a,form:o,name:l,onChange:s,by:u,disabled:c=r||!1,defaultValue:f,...d}=e,p=Ile(u),[h,m]=b.useReducer(sce,{options:[]}),w=h.options,[y,g]=fu(),[x,E]=cu(),_=b.useRef(null),S=ot(_,t),O=ple(f),[$,T]=dle(a,s,O),C=b.useMemo(()=>w.find(L=>!L.propsRef.current.disabled),[w]),A=b.useMemo(()=>w.some(L=>p(L.propsRef.current.value,$)),[w,$]),N=Q(L=>{var U;if(c||p(L,$))return!1;let V=(U=w.find(re=>p(re.propsRef.current.value,L)))==null?void 0:U.propsRef.current;return V!=null&&V.disabled?!1:(T==null||T(L),!0)}),I=Q(L=>{let U=_.current;if(!U)return;let V=vi(U),re=w.filter(ie=>ie.propsRef.current.disabled===!1).map(ie=>ie.element.current);switch(L.key){case Ne.Enter:hle(L.currentTarget);break;case Ne.ArrowLeft:case Ne.ArrowUp:if(L.preventDefault(),L.stopPropagation(),ii(re,_t.Previous|_t.WrapAround)===Ds.Success){let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break;case Ne.ArrowRight:case Ne.ArrowDown:if(L.preventDefault(),L.stopPropagation(),ii(re,_t.Next|_t.WrapAround)===Ds.Success){let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break;case Ne.Space:{L.preventDefault(),L.stopPropagation();let ie=w.find(J=>J.element.current===(V==null?void 0:V.activeElement));ie&&N(ie.propsRef.current.value)}break}}),D=Q(L=>(m({type:0,...L}),()=>m({type:1,id:L.id}))),M=b.useMemo(()=>({value:$,firstOption:C,containsCheckedOption:A,disabled:c,compare:p,...h}),[$,C,A,c,p,h]),F=b.useMemo(()=>({registerOption:D,change:N}),[D,N]),R={ref:S,id:i,role:"radiogroup","aria-labelledby":y,"aria-describedby":x,onKeyDown:I},P=b.useMemo(()=>({value:$}),[$]),k=b.useCallback(()=>{if(O!==void 0)return N(O)},[N,O]),B=Re();return j.createElement(E,{name:"RadioGroup.Description"},j.createElement(g,{name:"RadioGroup.Label"},j.createElement(ax.Provider,{value:F},j.createElement(rx.Provider,{value:M},l!=null&&j.createElement(xle,{disabled:c,data:{[l]:$||"on"},overrides:{type:"radio",checked:$!=null},form:o,onReset:k}),B({ourProps:R,theirProps:d,slot:P,defaultTag:uce,name:"RadioGroup"})))))}let fce="div";function dce(e,t){var n;let r=ix("RadioGroup.Option"),i=ox("RadioGroup.Option"),a=b.useId(),{id:o=`headlessui-radiogroup-option-${a}`,value:l,disabled:s=r.disabled||!1,autoFocus:u=!1,...c}=e,f=b.useRef(null),d=ot(f,t),[p,h]=fu(),[m,w]=cu(),y=Nr({value:l,disabled:s});he(()=>i.registerOption({id:o,element:f,propsRef:y}),[o,i,f,y]);let g=Q(N=>{var I;if(G0(N.currentTarget))return N.preventDefault();i.change(l)&&((I=f.current)==null||I.focus())}),x=((n=r.firstOption)==null?void 0:n.id)===o,{isFocusVisible:E,focusProps:_}=K0({autoFocus:u}),{isHovered:S,hoverProps:O}=V0({isDisabled:s}),$=r.compare(r.value,l),T=dp({ref:d,id:o,role:"radio","aria-checked":$?"true":"false","aria-labelledby":p,"aria-describedby":m,"aria-disabled":s?!0:void 0,tabIndex:s?-1:$||!r.containsCheckedOption&&x?0:-1,onClick:s?void 0:g,autoFocus:u},_,O),C=b.useMemo(()=>({checked:$,disabled:s,active:E,hover:S,focus:E,autofocus:u}),[$,s,S,E,u]),A=Re();return j.createElement(w,{name:"RadioGroup.Description"},j.createElement(h,{name:"RadioGroup.Label"},A({ourProps:T,theirProps:c,slot:C,defaultTag:fce,name:"RadioGroup.Option"})))}let pce="span";function hce(e,t){var n;let r=ix("Radio"),i=ox("Radio"),a=b.useId(),o=bA(),l=uu(),{id:s=o||`headlessui-radio-${a}`,value:u,disabled:c=r.disabled||l||!1,autoFocus:f=!1,...d}=e,p=b.useRef(null),h=ot(p,t),m=EA(),w=Ele(),y=Nr({value:u,disabled:c});he(()=>i.registerOption({id:s,element:p,propsRef:y}),[s,i,p,y]);let g=Q(A=>{var N;if(G0(A.currentTarget))return A.preventDefault();i.change(u)&&((N=p.current)==null||N.focus())}),{isFocusVisible:x,focusProps:E}=K0({autoFocus:f}),{isHovered:_,hoverProps:S}=V0({isDisabled:c}),O=((n=r.firstOption)==null?void 0:n.id)===s,$=r.compare(r.value,u),T=dp({ref:h,id:s,role:"radio","aria-checked":$?"true":"false","aria-labelledby":m,"aria-describedby":w,"aria-disabled":c?!0:void 0,tabIndex:c?-1:$||!r.containsCheckedOption&&O?0:-1,autoFocus:f,onClick:c?void 0:g},E,S),C=b.useMemo(()=>({checked:$,disabled:c,hover:_,focus:x,autofocus:f}),[$,c,_,x,f]);return Re()({ourProps:T,theirProps:d,slot:C,defaultTag:pce,name:"Radio"})}let mce=Ee(cce),vce=Ee(dce),lC=Ee(hce),gce=Cle,yce=SA,xce=Object.assign(mce,{Option:vce,Radio:lC,Label:gce,Description:yce});const lx=({items:e,selectedItem:t,onItemSelect:n,size:r="sm"})=>v.jsx("div",{className:"relative h-full",children:v.jsxs(ace,{children:[v.jsxs(iC,{className:`inline-flex h-full w-48 justify-between items-center gap-x-1.5 rounded-md bg-white px-3 text-${r} font-medium text-gray-900 shadow-xs ring-1 ring-gray-300 hover:bg-gray-50`,children:[t,v.jsx(G$,{className:"size-4 text-gray-400","aria-hidden":"true"})]}),v.jsx(aC,{className:"absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden",children:v.jsx("div",{className:"py-1",children:e.map(i=>v.jsx(oC,{children:v.jsx("button",{onClick:()=>n(i),className:`block w-full px-4 py-2 text-left text-${r} data-focus:bg-gray-100 data-focus:text-gray-900 text-gray-700`,children:i})},i))})})]})}),bce=({items:e,selectedItem:t,onItemSelect:n,size:r="sm"})=>v.jsx(xce,{value:t,onChange:n,className:`inline-flex justify-between items-center rounded-md bg-white text-${r} font-medium text-gray-900 shadow-xs ring-1 ring-gray-300`,children:e.map(i=>v.jsx(Cue,{className:"flex h-full first:rounded-l-md last:rounded-r-md overflow-hidden",children:v.jsx(lC,{value:i,className:"cursor-pointer h-full data-checked:bg-gray-200 hover:bg-gray-50 flex items-center px-4 shadow-xs",children:i})},i))});function wce({onSearch:e}){return v.jsxs("div",{className:"relative w-full md:w-[26rem] rounded-md",children:[v.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-gray-400",children:v.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})})}),v.jsx("input",{type:"text",className:"block w-full pl-10 px-3 py-3 text-sm font-medium bg-white text-gray-900 shadow-xs rounded-md outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 w-",placeholder:"Search features...",onChange:t=>e(t.target.value)})]})}const _ce=({features:e})=>{const[t,n]=b.useState("All Teams"),[r,i]=b.useState(""),a=b.useMemo(()=>{const l=new Set;return l.add("All Teams"),Object.values(e).forEach(s=>{var u;(u=s.assignments)!=null&&u.teams&&s.assignments.teams.forEach(c=>l.add(c))}),Array.from(l)},[e]),o=b.useMemo(()=>t==="All Teams"?e:Object.fromEntries(Object.entries(e).filter(([l,s])=>{var u,c;return(c=(u=s.assignments)==null?void 0:u.teams)==null?void 0:c.includes(t)})),[e,t]);return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-8 p-4 md:p-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Dashboard"}),v.jsx(lx,{items:a,selectedItem:t,onItemSelect:n})]}),v.jsx("div",{children:v.jsxs("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6",children:[v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Ioe,{features:o})}),v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Roe,{features:o})}),v.jsx("li",{className:"px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx(Loe,{features:o})})]})}),v.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-scroll",children:[v.jsxs("div",{className:"flex items-center justify-between gap-12",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"w-5 h-5 text-gray-600","aria-hidden":"true"}),v.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:["Features: ",Object.entries(o).length]})]}),v.jsx("div",{children:v.jsx(wce,{onSearch:i})})]}),v.jsx(Doe,{features:o,searchTerm:r,teamContext:t!=="All Teams"?t:null})]})]})},Sce=({features:e})=>{const t=Object.values(e).reduce((r,i)=>{const a=i.additional_metrics.health.overall;if(a!=null){const o=rA(a);r[o]++}return r},{needsAttention:0,needsImprovement:0,healthy:0}),n=Object.entries(t).map(([r,i],a)=>({name:r,value:i,fill:[wt(rt.needsAttention).hex,wt(rt.needsImprovement).hex,wt(rt.healthy).hex][a]})).filter(({value:r})=>r>0);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(Ey,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Health Score"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Health Score distribution by category: shows how many features fall into each level from low (needs attention) to good (healthy)"})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative size-48",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx(nu,{children:v.jsx(qt,{data:n,dataKey:"value",nameKey:"name",innerRadius:"70%",outerRadius:"100%",paddingAngle:2})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.needsAttention).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.needsAttention})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Features needing attention"})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.needsImprovement).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.needsImprovement})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Features needing improvement"})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${wt(rt.healthy).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.healthy})}),v.jsx("p",{className:"text-sm text-gray-500",children:"Healthy Features"})]})]})]})]})},Ece=({features:e})=>{const t=Object.values(e).reduce((i,a)=>{const o=a.additional_metrics.test_coverage.score;if(o!=null){const l=PT(o);i[l]++}return i},{poor:0,fair:0,good:0}),{minimum_thresholds:n}=wr.project.documentation_site.test_coverage,r=Object.entries(t).map(([i,a],o)=>({name:i,value:a,fill:[bt(n.poor).hex,bt(n.fair).hex,bt(n.good).hex][o]})).filter(({value:i})=>i>0);return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(_y,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Test Coverage"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Test Coverage distribution by category: shows how many features fall into each level from poor to good"})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative size-48",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx(nu,{children:v.jsx(qt,{data:r,dataKey:"value",nameKey:"name",innerRadius:"70%",outerRadius:"100%",paddingAngle:2})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.poor).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.poor})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," poor coverage"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.fair).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.fair})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," fair coverage"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`shrink-0 rounded-sm size-6 flex items-center justify-center ${bt(n.good).class}`,children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.good})}),v.jsxs("p",{className:"text-sm text-gray-500",children:[v.jsx("span",{className:"",children:"Features with"})," good coverage"]})]})]})]})]})},Oce=({features:e})=>{const t=Object.entries(e).reduce((r,[i,a])=>{const{integration_count:o,integration_pending:l,regression_count:s,regression_pending:u,unit_count:c,unit_pending:f}=a.test_pyramid||{};return{unit_count:r.unit_count+(c||0),unit_pending:r.unit_pending+(f||0),integration_count:r.integration_count+(o||0),integration_pending:r.integration_pending+(l||0),regression_count:r.regression_count+(s||0),regression_pending:r.regression_pending+(u||0)}},{unit_count:0,unit_pending:0,integration_count:0,integration_pending:0,regression_count:0,regression_pending:0}),n=[{value:Math.max(Math.log(t.unit_count+t.unit_pending),0),fill:"#1d4ed8"},{value:Math.max(Math.log(t.integration_count+t.integration_pending),0),fill:"#2563eb"},{value:Math.max(Math.log(t.regression_count+t.regression_pending),0),fill:"#3b82f6"}];return v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(X$,{className:"size-5"})}),v.jsx("span",{className:"flex pl-2",children:"Test Pyramid"})]}),v.jsxs("div",{className:"relative shrink-0 group",children:[v.jsx(_r,{className:"size-4 text-gray-400"}),v.jsx("div",{className:"absolute whitespace-wrap bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-700 text-white text-xs rounded-sm py-1 px-2 w-48",children:"Test pyramid distribution by category: shows features which are missing coverage in a given level of the pyramid, or which have a large number of pending tests."})]})]}),v.jsxs("div",{className:"flex flex-col items-center gap-6",children:[v.jsx("div",{className:"relative h-48 w-72",children:v.jsx(Do,{width:"100%",height:"100%",children:v.jsx($T,{width:730,height:250,children:v.jsx(kr,{dataKey:"value",data:n,reversed:!0,children:v.jsx(Un,{position:"right",fill:"#000",stroke:"none",dataKey:"name"})})})})}),v.jsxs("ul",{className:"flex flex-col flex-1 gap-y-2",children:[v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 size-x-12 flex items-center justify-center bg-blue-500",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.regression_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Regression Tests (",t.regression_pending," pending)"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 flex items-center justify-center bg-blue-600",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.integration_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Integration Tests (",t.integration_pending," pending)"]})]}),v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"shrink-0 rounded-sm h-6 w-16 flex items-center justify-center bg-blue-700",children:v.jsx("span",{className:"font-semibold text-white text-sm",children:t.unit_count})}),v.jsxs("p",{className:"text-sm text-gray-500",children:["Unit Tests (",t.unit_pending," pending)"]})]})]})]})]})},Qu=({title:e})=>v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsx("div",{className:"flex items-center gap-x-2",children:e})}),pE=({features:e,metric:t,sortDirection:n="ASC"})=>Object.entries(e).sort(([r,i],[a,o])=>{const l=i.test_pyramid&&i.test_pyramid[t]||0,s=o.test_pyramid&&o.test_pyramid[t]||0;return l===s?o.additional_metrics.feature_size.score-i.additional_metrics.feature_size.score:n==="ASC"?l-s:s-l}).slice(0,5).map(([r,i])=>({featureName:r,score:i.test_pyramid&&i.test_pyramid[t]||0,feature:i})),hE=["Regression","Integration","Unit"],mE=["Missing","Pending"],vE={Pending:{Unit:"unit_pending",Integration:"integration_pending",Regression:"regression_pending"},Missing:{Unit:"unit_count",Integration:"integration_count",Regression:"regression_count"}},$ce={Pending:{Unit:"Top 5 features with pending unit tests",Integration:"Top 5 features with pending integration tests",Regression:"Top 5 features with pending regression tests"},Missing:{Unit:"Bottom 5 features missing unit test coverage",Integration:"Bottom 5 features missing integration tests",Regression:"Bottom 5 features missing regression tests"}},Pce=({features:e})=>{const[t,n]=b.useState(mE[0]),[r,i]=b.useState(hE[0]),[a,o]=b.useState(pE({features:e,metric:vE[t][r],sortDirection:t==="Missing"?"ASC":""}));return b.useEffect(()=>{o(pE({features:e,metric:vE[t][r],sortDirection:t==="Missing"?"ASC":""}))},[e,t,r]),v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:[v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:$ce[t][r]}),v.jsxs("div",{className:"flex h-8",children:[v.jsx(bce,{items:mE,selectedItem:t,onItemSelect:n,size:"xs"}),v.jsx("span",{className:"mx-2"}),v.jsx(lx,{items:hE,selectedItem:r,onItemSelect:i,size:"xs"})]})]}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(Qu,{title:"Feature"}),v.jsx(Qu,{title:"Team"}),v.jsx(Qu,{title:"Size"}),v.jsx(Qu,{title:t==="Missing"?`${r} Test Count`:"Pending Test Count"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:a.map(({featureName:l,feature:s,score:u})=>{const c=s.additional_metrics.feature_size.percent_of_max,f=xo(c);return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:l})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(c)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:f})]})}),v.jsx("td",{className:"px-4 py-4 text-sm",children:v.jsx("div",{className:"flex items-center gap-x-2",children:u})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(l)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},l)})})]})})})})]})};function jce({features:e}){const[t,n]=b.useState("All Teams"),r=b.useMemo(()=>{const s=new Set;return s.add("All Teams"),Object.values(e).forEach(u=>{var c;(c=u.assignments)!=null&&c.teams&&u.assignments.teams.forEach(f=>s.add(f))}),Array.from(s)},[e]),i=b.useMemo(()=>t==="All Teams"?e:Object.fromEntries(Object.entries(e).filter(([s,u])=>{var c,f;return(f=(c=u.assignments)==null?void 0:c.teams)==null?void 0:f.includes(t)})),[e,t]),a=b.useMemo(()=>Object.entries(i).map(([s,u])=>({name:s,data:u||0,health:u.additional_metrics.health.overall||0})).sort((s,u)=>s.health-u.health).slice(0,5),[i]),o=b.useMemo(()=>Object.entries(i).map(([s,u])=>({name:s,data:u||0,score:u.additional_metrics.test_coverage.score||0})).sort((s,u)=>s.score-u.score).slice(0,5),[i]),l=({title:s})=>v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsx("div",{className:"flex items-center gap-x-2",children:s})});return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-8 p-4 md:p-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Digest"}),v.jsx(lx,{items:r,selectedItem:t,onItemSelect:n})]}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg h-full",children:v.jsx("div",{className:"px-4 py-6 h-fit",children:v.jsx(Sce,{features:i})})}),v.jsxs("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:[v.jsx("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:"Bottom 5 Features by Health Score"})}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(l,{title:"Feature"}),v.jsx(l,{title:"Team"}),v.jsx(l,{title:"Size"}),v.jsx(l,{title:"Health Score"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:a.map(s=>{const u=s.data.additional_metrics.feature_size.percent_of_max,c=xo(u),f=s.data.additional_metrics.health.overall||0;return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:s.name})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.data.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(u)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:c})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`w-4 h-4 rounded-full flex items-center justify-center ${iA(f)}`,children:v.jsx("div",{className:`w-2 h-2 rounded-full ${wt(f).class}`})}),v.jsxs("span",{className:"text-gray-600",children:[f.toFixed(0),"%"]})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(s.name)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},s.name)})})]})})})})]})]})}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx("div",{className:"px-4 py-6",children:v.jsx(Ece,{features:i})})}),v.jsxs("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:[v.jsx("div",{className:"flex items-center justify-between px-4 py-6 bg-gray-50 rounded-md",children:v.jsx("h3",{className:"flex items-center text-xs font-semibold text-gray-800 uppercase h-8",children:"Bottom 5 Features by Test Coverage"})}),v.jsx("div",{className:"flow-root",children:v.jsx("div",{className:"min-w-full align-middle",children:v.jsx("div",{className:"overflow-hidden rounded-md",children:v.jsxs("table",{className:"min-w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:v.jsxs("tr",{children:[v.jsx(l,{title:"Feature"}),v.jsx(l,{title:"Team"}),v.jsx(l,{title:"Size"}),v.jsx(l,{title:"Test Coverage"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider"})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:o.map(s=>{const u=s.data.additional_metrics.feature_size.percent_of_max,c=xo(u),f=s.data.additional_metrics.test_coverage.score||0;return v.jsxs("tr",{children:[v.jsx("td",{className:"w-full max-w-0 py-4 px-4 text-sm font-medium text-gray-900 sm:w-auto sm:max-w-none",children:v.jsx("div",{className:"",children:s.name})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Gi,{className:"size-4 text-gray-500"}),Lf(s.data.assignments.teams)]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(d=>v.jsx("div",{className:`h-5 w-1.5 rounded ${d<=Is(u)?"bg-blue-500":"bg-gray-200"}`},d))}),v.jsx("span",{className:"text-xs text-gray-500 uppercase",children:c})]})}),v.jsx("td",{className:"px-4 py-4 text-sm",children:v.jsxs("div",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:"grow h-2 rounded-full bg-gray-100 overflow-hidden",children:v.jsx("div",{className:`h-full rounded-full ${bt(f).class}`,style:{width:`${f}%`}})}),v.jsx("span",{className:"text-sm text-gray-500",children:f?`${f.toFixed(0)}%`:"No Data"})]})}),v.jsx("td",{className:"px-4 py-4 text-sm text-gray-500",children:v.jsx("div",{className:"flex items-center gap-x-3",children:v.jsx("div",{children:v.jsx(br,{to:`/${encodeURIComponent(s.name)}`,className:"flex items-center justify-center shrink-0 font-medium text-gray-900 text-sm mb-1 hover:bg-gray-100 rounded-full h-6 w-6",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5",children:v.jsx("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})})})]},s.name)})})]})})})})]})]})}),v.jsx("div",{className:"flow-root",children:v.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[v.jsx("div",{className:"col-span-1 border border-gray-200 shadow-xs bg-white rounded-lg",children:v.jsx("div",{className:"px-4 py-6",children:v.jsx(Oce,{features:i})})}),v.jsx("div",{className:"col-span-2 h-full shadow-xs border border-gray-200 rounded-lg bg-white",children:v.jsx(Pce,{features:i})})]})})]})}const Tce=({files:e})=>{const{project:t,environment:n}=wr,r=`${t.repository.url}/blob/${n.git_ref}`,{fileTree:i,directoryCounts:a}=b.useMemo(()=>{const g={},x={};return e.forEach(E=>{const _=E.split("/");let S=g;_.forEach((O,$)=>{if($===_.length-1){S[O]={type:"file",path:E};let T="";_.slice(0,-1).forEach(C=>{T=T?`${T}/${C}`:C,x[T]=(x[T]||0)+1})}else S[O]=S[O]||{type:"directory",children:{}},S=S[O].children})}),{fileTree:g,directoryCounts:x}},[e]),o=b.useMemo(()=>{const g=new Set;return e.forEach(x=>{const E=x.split("/");let _="";E.slice(0,-1).forEach(S=>{_=_?`${_}/${S}`:S,g.add(_)})}),g},[e]),[l,s]=b.useState("tree"),[u,c]=b.useState(o),[f,d]=b.useState({key:null,direction:"asc"}),p=b.useMemo(()=>[...e].sort((g,x)=>f.key?g<x?f.direction==="asc"?-1:1:g>x?f.direction==="asc"?1:-1:0:0),[e,f]),h=g=>{c(x=>{const E=new Set(x);return E.has(g)?E.delete(g):E.add(g),E})},m=g=>{d(x=>({key:g,direction:x.key===g&&x.direction==="asc"?"desc":"asc"}))},w=(g,x="",E=0)=>g?Object.entries(g).map(([_,S])=>{const O=x?`${x}/${_}`:_,$=u.has(O),T=a[O]||0;return S.type==="directory"?v.jsxs(j.Fragment,{children:[v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-2 text-sm text-gray-900",children:v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("button",{onClick:()=>h(O),className:"flex items-center group gap-x-2",style:{paddingLeft:`${E*16}px`},children:[v.jsxs("div",{className:"flex items-center group",children:[$?v.jsx(G$,{className:"size-4 text-gray-400 mr-1 shrink-0"}):v.jsx(SI,{className:"size-4 text-gray-400 mr-1 shrink-0"}),v.jsx($I,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("span",{className:"font-medium text-gray-600 group-hover:text-gray-900",children:_})]}),v.jsx("span",{className:"flex items-center justify-center text-xs font-medium text-gray-500 bg-gray-200 rounded-full h-5 w-5",children:T})]})})})}),$&&w(S.children,O,E+1)]},O):v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-2 text-sm text-gray-900",children:v.jsxs("div",{className:"flex items-center",style:{paddingLeft:`${E*16+20}px`},children:[v.jsx(Rm,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("a",{href:`${r}/${O}`,className:"truncate underline",target:"_blank",rel:"noopener noreferrer",children:_})]})})},O)}):null,y=({title:g,sortKey:x,className:E=""})=>v.jsx("th",{scope:"col",className:`px-4 py-3 text-left text-xs font-medium text-gray-800 uppercase tracking-wider cursor-pointer ${E}`,onClick:()=>m(x),children:v.jsxs("div",{className:"flex items-center gap-x-2 group",children:[g,v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"size-4 text-gray-400 group-hover:text-gray-600",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"})})]})});return v.jsx("div",{className:"bg-white rounded-lg border border-gray-200",children:v.jsx("div",{className:"overflow-hidden rounded-lg",children:v.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[v.jsx("thead",{className:"bg-gray-50",children:v.jsxs("tr",{children:[v.jsx(y,{title:l==="tree"?"File Path":"Name",sortKey:"path"}),v.jsx("th",{scope:"col",className:"px-4 py-3 text-center text-xs font-medium text-gray-800 uppercase tracking-wider",children:v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[v.jsx("button",{onClick:()=>s("tree"),className:`p-1 rounded ${l==="tree"?"text-blue-600 bg-blue-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:v.jsx(Sy,{className:"size-4"})}),v.jsx("button",{onClick:()=>s("list"),className:`p-1 rounded ${l==="list"?"text-blue-600 bg-blue-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:v.jsx(AI,{className:"size-4"})})]})})]})}),v.jsx("tbody",{className:"divide-y divide-gray-200",children:l==="list"?p.map(g=>v.jsx("tr",{className:"hover:bg-gray-50",children:v.jsx("td",{className:"px-4 py-3 text-sm font-medium text-gray-900 flex-1",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx(Rm,{className:"size-4 text-gray-400 mr-2 shrink-0"}),v.jsx("a",{href:`${r}/${g}`,className:"truncate underline",target:"_blank",rel:"noopener noreferrer",children:g})]})})},g)):w(i)})]})})})};function Ace({feature:e}){const{project:t}=wr,n=`is:pr label:"${e.label}"`,r=encodeURIComponent(n),i=`${t.repository.url}/pulls?q=${r}`;return v.jsxs("div",{className:"bg-white p-4 rounded-lg border border-gray-200 h-fit",children:[v.jsxs("div",{className:"mb-6",children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Description"}),e.description&&v.jsx("p",{className:"text-sm md:text-base text-gray-600",children:e.description})]}),v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Metrics"}),v.jsxs("ul",{className:"mb-6 space-y-2",children:[v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Sy,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[e.assignments.files?e.assignments.files.length:0," Total Files"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(kI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[(e.metrics.abc_size||0).toFixed(2)," ABC Size"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Rm,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[e.metrics.lines_of_code||0," Lines of Code"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(PI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[e.metrics.cyclomatic_complexity||0," Cyclomatic Complexity"]})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(jI,{className:"size-4 text-gray-500"})}),v.jsxs("p",{className:"text-sm text-gray-700",children:[e.metrics.todo_locations?Object.keys(e.metrics.todo_locations).length:0," ","TODO Comments"]})]})]}),v.jsx("div",{className:"space-y-4 mb-6",children:v.jsxs("div",{children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Teams"}),v.jsx("ul",{className:"flex flex-col gap-y-1",children:e.assignments.teams?e.assignments.teams.map(a=>v.jsxs("li",{className:"text-sm text-gray-700 flex gap-2",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0",children:v.jsx(Gi,{className:"size-4 text-gray-500"})}),a]},a)):v.jsxs("li",{className:"text-sm text-gray-700 flex gap-2",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0",children:v.jsx(Gi,{className:"size-4 text-gray-500"})}),v.jsx("span",{className:"text-gray-400 italic text-sm",children:"No teams assigned"})]})})]})}),v.jsxs("div",{className:"mb",children:[v.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-3",children:"Resources"}),v.jsxs("ul",{className:"mb-6 space-y-2",children:[v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),v.jsx("a",{href:i,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"Feature Pull Requests"})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),e.documentation_link?v.jsx("a",{href:e.documentation_link,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"Feature Documentation"}):v.jsx("span",{className:"text-gray-400 italic text-sm",children:"Missing documentation link"})]}),v.jsxs("li",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"shrink-0",children:v.jsx(Tl,{className:"size-4 text-gray-500"})}),e.dashboard_link?v.jsx("a",{href:e.dashboard_link,target:"_blank",className:"text-sm text-gray-700 hover:underline",rel:"noreferrer",children:"New Relic Dashboard"}):v.jsx("span",{className:"text-gray-400 italic text-sm",children:"Missing New Relic Dashboard"})]})]})]})]})}const Cce=({value:e,suffix:t="",color:n="#ef4444"})=>{const r=e===0?"transparent":n;return v.jsxs("div",{className:"relative h-20 w-20",children:[v.jsxs("svg",{className:"h-full w-full -rotate-90",viewBox:"0 0 36 36",children:[v.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"#eee",strokeWidth:"2"}),v.jsx("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:r,strokeWidth:"2",strokeDasharray:`${e}, 100`})]}),v.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[v.jsx("span",{className:"text-2xl font-bold",children:Math.round(e)}),v.jsx("span",{className:"text-sm",children:t})]})]})},gE=({children:e,title:t,value:n,suffix:r="",icon:i,tooltip:a,color:o})=>v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:i}),v.jsx("span",{className:"flex pl-2",children:t})]}),a&&v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:a})]})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Cce,{value:n,suffix:r,color:o}),v.jsx("div",{className:"flex flex-col flex-1",children:e})]})]}),kce=({feature:e})=>{const{integration_count:t=0,integration_pending:n=0,regression_count:r=0,regression_pending:i=0,unit_count:a=0,unit_pending:o=0}=(e==null?void 0:e.test_pyramid)||{},l=[{type:"Unit Tests",count:a,pending:o,color:"blue-700",fill:"#1d4ed8"},{type:"Integration Tests",count:t,pending:n,color:"blue-500",fill:"#3b82f6"},{type:"Regression Tests",count:r,pending:i,color:"blue-300",fill:"#93c5fd"}],s=l.map(u=>({value:Math.max(Math.log(u.count+u.pending),0),fill:u.fill}));return v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"relative h-20 w-20",children:s.every(u=>u.value===0)?v.jsx("div",{className:"flex flex-col shrink-0 items-center justify-center size-full bg-gray-100 rounded-full shadow-sm text-gray-500 mb-4",children:v.jsx(NI,{})}):v.jsx("div",{className:"absolute left-[-31px] top-0 bottom-0",children:v.jsx($T,{width:150,height:80,children:v.jsx(kr,{dataKey:"value",data:s,reversed:!0,isAnimationActive:!1,children:v.jsx(Un,{position:"right",fill:"#000",stroke:"none",dataKey:"name"})})})})}),v.jsx("ul",{className:"flex flex-col flex-1 gap-y-1",children:l.reverse().map((u,c)=>v.jsxs("li",{className:"flex items-center gap-x-2",children:[v.jsx("div",{className:`w-3 h-3 rounded-full bg-${u.color}`}),v.jsxs("p",{className:"text-xs text-gray-500",children:[u.type,": ",v.jsx("span",{className:"font-medium",children:u.count})," (",u.pending," ","pending)"]})]},c))})]})};function Nce({features:e}){const{name:t}=wM(),n=e[t];if(!n)return v.jsx("div",{className:"max-w-7xl mx-auto p-4 md:p-8",children:v.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6",children:[v.jsx("h1",{className:"text-xl font-bold text-red-600",children:"Feature Not Found"}),v.jsxs("p",{className:"mt-2",children:["Could not find feature: ",t]}),v.jsx(br,{to:"/",className:"text-blue-600 hover:text-blue-800 mt-4 inline-block",children:"← Back to Features"})]})});const r=n.additional_metrics.health.overall,i=n.additional_metrics.feature_size.percent_of_max,a=Is(i);return v.jsxs("div",{className:"h-screen max-w-7xl mx-auto flex flex-col gap-6 py-4 md:py-8",children:[v.jsx("div",{className:"flex justify-between items-center",children:v.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:t})}),v.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-6",children:[v.jsx("div",{className:"col-span-1 xl:col-span-3",children:v.jsx(Ace,{feature:n})}),v.jsxs("div",{className:"col-span-1 xl:col-span-9",children:[v.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6 mb-8",children:[v.jsx(gE,{title:"Health Score",value:r.toFixed(0),suffix:"%",tooltip:"Feature health is determined by combining a weighted score for test coverage, code complexity, and encapsulation into a composite score from 0-100%. Each feature is then grouped into a categories ranging from low (needs attention) to good (healthy), which can be managed via `.feature_map/config.yml`.",icon:v.jsx(Ey,{}),color:wt(r).hex,children:v.jsxs("ul",{className:"flex flex-col gap-y-1",children:[v.jsxs("li",{className:"text-xs text-gray-500",children:["Coverage:"," ",n.additional_metrics.health.test_coverage_component.health_score.toFixed(0)," ","/ ",n.additional_metrics.health.test_coverage_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Complexity:"," ",n.additional_metrics.health.cyclomatic_complexity_component.health_score.toFixed(0)," ","/"," ",n.additional_metrics.health.cyclomatic_complexity_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Encapsulation:"," ",n.additional_metrics.health.encapsulation_component.health_score.toFixed(0)," ","/ ",n.additional_metrics.health.encapsulation_component.awardable_points]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Todos:"," ",n.additional_metrics.health.todo_count_component.health_score.toFixed(0)," /"," ",n.additional_metrics.health.todo_count_component.awardable_points]})]})}),v.jsx(gE,{title:"Test Coverage",value:n.additional_metrics.test_coverage.score,suffix:"%",tooltip:"Test coverage is determined by using CodeCov data (lines, hits, misses) to calculate a percentage score, from 0-100%, relative to the other features in the codebase. A qualitative coverage ranking is assigned to each feature, which can be managed which can be managed via `.feature_map/config.yml`.",icon:v.jsx(_y,{}),color:bt(n.additional_metrics.test_coverage.score).hex,children:v.jsxs("ul",{className:"flex flex-col gap-y-1",children:[v.jsxs("li",{className:"text-xs text-gray-500",children:["Hits: ",n.test_coverage?n.test_coverage.hits:0]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Lines: ",n.test_coverage?n.test_coverage.lines:0]}),v.jsxs("li",{className:"text-xs text-gray-500",children:["Misses: ",n.test_coverage?n.test_coverage.misses:0]})]})}),v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(q$,{})}),v.jsx("span",{className:"flex pl-2",children:"Feature Size"})]}),v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:"Feature size is determined by analyzing the total number of files and lines of code associated with each feature. Each feature is then grouped into different size bins, which can be configured in the config.yaml file."})]})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"relative h-20 flex items-center",children:v.jsx("div",{className:"text-2xl font-bold uppercase",children:xo(i)})}),v.jsx("div",{className:"flex flex-col gap-y-2",children:v.jsx("div",{className:"flex gap-1.5 items-center",children:[1,2,3,4,5].map(o=>v.jsx("div",{className:`h-6 w-1.5 rounded-sm ${o<=a?"bg-blue-500":"bg-gray-300"}`},o))})}),v.jsxs("div",{children:[v.jsxs("div",{className:"text-[10px] text-gray-500",children:[n.assignments.files?n.assignments.files.length:0," files"]}),v.jsxs("div",{className:"text-[10px] text-gray-500",children:[Xie(n.metrics.lines_of_code)," lines"]})]})]})]}),v.jsxs("div",{className:"flex flex-col gap-6 px-4 py-6 border border-gray-200 shadow-xs bg-white rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h3",{className:"flex items-center text-xs font-medium text-gray-600 uppercase",children:[v.jsx("div",{className:"shrink-0 bg-gray-100 rounded-md h-8 w-8 flex items-center justify-center",children:v.jsx(X$,{})}),v.jsx("span",{className:"flex pl-2",children:"Test Pyramid"})]}),v.jsxs(wo,{children:[v.jsx(si,{children:v.jsx(_r,{className:"size-4 text-gray-400"})}),v.jsx(Zi,{children:"Test pyramid distribution by category: shows features which are missing coverage in a given level of the pyramid, or which have a large number of pending tests."})]})]}),v.jsx(kce,{feature:n})]})]}),n.assignments.files&&n.assignments.files.length>0?v.jsx(v.Fragment,{children:v.jsx(Tce,{files:n.assignments.files})}):v.jsx("div",{className:"h-[300px] bg-white rounded-lg border border-gray-200 shadow-xs mb-8",children:v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx("div",{className:"flex items-center justify-center shrink-0 h-16 w-16 bg-gray-100 rounded-full shadow-sm text-gray-500 mb-4",children:v.jsx(Sy,{})}),v.jsx("p",{children:"No files found for this feature"})]})})]})]})]})}const Mce=[{name:"Dashboard",pathname:"",icon:TI},{name:"Digest",pathname:"Digest",icon:OI}];function pa(...e){return e.filter(Boolean).join(" ")}function yE(){const e=Tr(),{linked_sites:t,title:n}=wr.project.documentation_site,{internal_resources:r}=wr.project.documentation_site;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex h-16 shrink-0 items-center",children:v.jsx(br,{to:"/",children:"Feature Documentation"})}),v.jsx("nav",{className:"flex flex-1 flex-col",children:v.jsxs("ul",{role:"list",className:"flex flex-1 flex-col gap-y-7",children:[v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:n}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:Mce.map(i=>v.jsx("li",{children:v.jsxs(br,{to:i.pathname,className:pa(e.pathname===`/${i.pathname}`?"text-blue-600":"text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),children:[v.jsx(i.icon,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]}),t&&t.length>0&&v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:"Linked Feature Documentation"}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:t.map(i=>v.jsx("li",{children:v.jsxs("a",{href:i.url,target:"_blank",className:pa("text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),rel:"noreferrer",children:[v.jsx(Tl,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]}),r&&r.length>0&&v.jsxs("li",{children:[v.jsx("div",{className:"text-xs/6 font-semibold text-gray-400",children:"Internal Resources"}),v.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-2",children:r.map(i=>v.jsx("li",{children:v.jsxs("a",{href:i.url,target:"_blank",className:pa("text-gray-700 hover:text-blue-600","group flex gap-x-3 rounded-md px-2 text-sm/6 font-semibold items-center"),rel:"noreferrer",children:[v.jsx(Tl,{"aria-hidden":"true",className:pa("text-gray-400 group-hover:text-blue-600","size-5 shrink-0")}),i.name]})},i.name))})]})]})})]})}function Ice(){const[e,t]=b.useState(!1);return v.jsxs("div",{children:[v.jsxs(jue,{open:e,onClose:t,className:"relative z-50 lg:hidden",children:[v.jsx($ue,{transition:!0,className:"fixed inset-0 bg-gray-900/80 transition-opacity duration-300 ease-linear data-closed:opacity-0"}),v.jsx("div",{className:"fixed inset-0 flex",children:v.jsxs(rC,{transition:!0,className:"relative mr-16 flex w-full max-w-xs flex-1 transform transition duration-300 ease-in-out data-closed:-translate-x-full",children:[v.jsx(xp,{children:v.jsx("div",{className:"absolute left-full top-0 flex w-16 justify-center pt-5 duration-300 ease-in-out data-closed:opacity-0",children:v.jsxs("button",{type:"button",onClick:()=>t(!1),className:"-m-2.5 p-2.5",children:[v.jsx("span",{className:"sr-only",children:"Close sidebar"}),v.jsx(EI,{"aria-hidden":"true",className:"size-6 text-white"})]})})}),v.jsx("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-4",children:v.jsx(yE,{})})]})})]}),v.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col",children:v.jsx("div",{className:"flex grow flex-col overflow-y-auto border-r border-gray-200 bg-white px-6 pb-4",children:v.jsx(yE,{})})}),v.jsxs("div",{className:"lg:pl-72",children:[v.jsx("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white lg:hidden px-4 shadow-xs sm:gap-x-6 sm:px-6 lg:px-8",children:v.jsxs("button",{type:"button",onClick:()=>t(!0),className:"-m-2.5 p-2.5 text-gray-700 lg:hidden",children:[v.jsx("span",{className:"sr-only",children:"Open sidebar"}),v.jsx(CI,{"aria-hidden":"true",className:"size-6"})]})}),v.jsx("main",{className:"",children:v.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:v.jsx(IM,{})})})]})]})}function Rce(){const{features:e}=wr,t=Tr();return b.useEffect(()=>{window.scrollTo(0,0)},[t]),v.jsx(LM,{children:v.jsxs(vl,{element:v.jsx(Ice,{}),children:[v.jsx(vl,{path:"",element:v.jsx(_ce,{features:e})}),v.jsx(vl,{path:"digest",element:v.jsx(jce,{features:e})}),v.jsx(vl,{path:":name",element:v.jsx(Nce,{features:e})})]})})}zh.createRoot(document.getElementById("root")).render(v.jsx(j.StrictMode,{children:v.jsx(lI,{children:v.jsx(Rce,{})})}));
273
273
  </script>
274
274
  </body>
275
275
  </html>
@@ -81,6 +81,7 @@ module FeatureMap
81
81
  feature_definition = CodeFeatures.find(feature_name)
82
82
  hash[feature_name] = feature_definition&.raw_hash&.slice(*FETAURE_DEFINITION_KEYS_TO_INCLUDE) || {}
83
83
  hash[feature_name].merge!(
84
+ label: feature_definition.label,
84
85
  assignments: feature_assignments[feature_name],
85
86
  metrics: feature_metrics[feature_name],
86
87
  test_coverage: feature_test_coverage[feature_name],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beyond Finance
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-20 00:00:00.000000000 Z
11
+ date: 2025-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership