glotfile 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/cli.js +144 -185
- package/dist/server/server.js +365 -426
- package/dist/ui/assets/{index-B1UwtMSs.js → index-BGtqXjLQ.js} +293 -117
- package/dist/ui/assets/index-BrgUMyDW.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-DPfAS4pJ.css +0 -1
|
@@ -4,7 +4,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
4
4
|
`);s=t.pop()??``;for(let e of t){if(e.startsWith(`event:`)){c=e.slice(6).trim();continue}e.startsWith(`data:`)&&(yield{...JSON.parse(e.slice(5).trim()),type:c},c=`message`)}}}finally{a.cancel().catch(()=>{})}}async function*Jd(e,t){let n;try{n=await fetch(`/api/context/build`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t})}catch(e){if(e.name===`AbortError`)return;throw e}if(!n.ok||!n.body)throw Error(n.statusText);let r=n.body.getReader(),i=new TextDecoder,a=``,o=`message`;try{for(;;){let e;try{e=await r.read()}catch(e){if(e.name===`AbortError`)return;throw e}if(e.done)break;a+=i.decode(e.value,{stream:!0});let t=a.split(`
|
|
5
5
|
`);a=t.pop()??``;for(let e of t){if(e.startsWith(`event:`)){o=e.slice(6).trim();continue}if(e.startsWith(`data:`)){let t=JSON.parse(e.slice(5).trim());if(o===`error`)throw Error(t.error??`Unknown error`);yield{...t,type:o},o=`message`}}}}finally{r.cancel().catch(()=>{})}}var Yd=()=>fetch(`/api/scan`,{method:`POST`}).then(e=>Y(e)),Xd=()=>fetch(`/api/scan`).then(e=>Y(e)),Zd=e=>fetch(`/api/scan/usage?key=${encodeURIComponent(e)}`).then(e=>Y(e)),Qd=()=>fetch(`/api/scan/used`).then(e=>Y(e)),$d=e=>fetch(`/api/config`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(Y),ef=()=>fetch(`/api/ui-prefs`).then(e=>Y(e)),tf=e=>fetch(`/api/ui-prefs`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(Y),nf=()=>fetch(`/api/local-settings`).then(e=>Y(e)),rf=e=>fetch(`/api/local-settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(Y),af=()=>fetch(`/api/ai-profiles`).then(e=>Y(e)),of=(e,t)=>fetch(`/api/ai-profiles/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(Y),sf=e=>fetch(`/api/ai-profiles/${encodeURIComponent(e)}`,{method:`DELETE`}).then(Y),cf=e=>fetch(`/api/ai-profiles/active`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e})}).then(Y),lf=e=>fetch(`/api/dictionary`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({word:e})}).then(Y),uf=()=>fetch(`/api/glossary`).then(e=>Y(e)),df=e=>fetch(`/api/glossary`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(Y),ff=e=>fetch(`/api/glossary/${encodeURIComponent(e)}`,{method:`DELETE`}).then(Y),pf=(e,t)=>{let n=new FormData;return n.append(`file`,t),fetch(`/api/keys/${encodeURIComponent(e)}/screenshot`,{method:`POST`,body:n}).then(Y)},mf=e=>fetch(`/api/keys/${encodeURIComponent(e)}/screenshot`,{method:`DELETE`}).then(Y),hf=(e,t)=>fetch(`/api/keys/${encodeURIComponent(e)}/notes`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:t})}).then(e=>Y(e)),gf=(e,t,n)=>fetch(`/api/keys/${encodeURIComponent(e)}/notes/${encodeURIComponent(t)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({text:n})}).then(Y),_f=(e,t)=>fetch(`/api/keys/${encodeURIComponent(e)}/notes/${encodeURIComponent(t)}`,{method:`DELETE`}).then(Y),vf=()=>fetch(`/api/log`).then(e=>Y(e)),yf=()=>fetch(`/api/export/preview`).then(e=>Y(e)),bf=()=>fetch(`/api/export`,{method:`POST`}).then(e=>Y(e)),xf=()=>fetch(`/api/file`).then(e=>Y(e)),Sf=()=>fetch(`/api/files`).then(e=>Y(e)),Cf=e=>fetch(`/api/file`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e})}).then(e=>Y(e)),wf=e=>e.length===0?Promise.resolve({issues:[],spellPending:!1}):fetch(`/api/checks?checks=${e.join(`,`)}`).then(e=>Y(e)),Tf=(e={})=>fetch(`/api/lint${e.includeSuppressed?`?includeSuppressed=1`:``}`).then(e=>Y(e)),Ef=(e,t,n)=>fetch(`/api/keys/${encodeURIComponent(e)}/suppressions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({rule:t,locale:n})}).then(Y),Df=(e,t,n)=>fetch(`/api/keys/${encodeURIComponent(e)}/suppressions?rule=${encodeURIComponent(t)}&locale=${encodeURIComponent(n)}`,{method:`DELETE`}).then(Y),Of=(e={})=>fetch(`/api/lint/accept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(e=>Y(e)),kf=()=>fetch(`/api/import/detect`).then(e=>Y(e)),Af=e=>fetch(`/api/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(e=>Y(e));function jf(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function Mf(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Nf(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Pf=(e,t)=>Math.abs(e-t)<1.01,Ff=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},If,Lf=()=>{if(If!==void 0)return If;if(typeof navigator>`u`)return If=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return If=!0;let e=navigator.maxTouchPoints;return If=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Rf=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},zf=e=>e,Bf=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Vf=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Rf(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Rf(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Hf={passive:!0},Uf=typeof window>`u`?!0:`onscrollend`in window,Wf=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Uf,o=0,s=a?null:Ff(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Hf),a&&r.addEventListener(`scrollend`,u,Hf),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Gf=(e,t)=>Wf(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Kf=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},qf=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},Jf=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zf,rangeExtractor:Bf,onChange:()=>{},measureElement:Kf,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Mf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Lf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Hf),e.addEventListener(`touchend`,n,Hf),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Lf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Mf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=Mf(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=jf(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Mf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Xf({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Mf(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=Mf(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return Nf(t[Yf(0,t.length-1,r?e=>n[e*2]:e=>Nf(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Lf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Pf(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Yf=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Xf({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=Yf(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}function Zf(e){let t=new Jf(j(e)),n=fn(t),r=t._didMount();return N(()=>j(e).getScrollElement(),e=>{e&&t._willUpdate()},{immediate:!0}),N(()=>j(e),e=>{t.setOptions({...e,onChange:(t,r)=>{var i;hn(n),(i=e.onChange)==null||i.call(e,t,r)}}),t._willUpdate(),hn(n)},{immediate:!0}),Ie(r),n}function Qf(e){return Zf(K(()=>({observeElementRect:Vf,observeElementOffset:Gf,scrollToFn:qf,...j(e)})))}function $f(e,t){let n=e.values[t];return n?e.plural?(n.forms?.other??``).trim()===``:(n.value??``).trim()===``:!0}function ep(e,t,n,r){return n===`missing`?r?$f(t,r):e.config.locales.some(n=>n!==e.config.sourceLocale&&$f(t,n)):r?t.values[r]?.state===n:Object.values(t.values).some(e=>e.state===n)}function tp(e){try{return new RegExp(e,`i`)}catch{return null}}function np(e,t,n,r){let i=t.text.trim(),a=i.length>=2&&i.startsWith(`"`)&&i.endsWith(`"`)?i.slice(1,-1).toLowerCase():null,o=a===null&&i.startsWith(`^`)?tp(i):null,s=i.toLowerCase();return Object.keys(e.keys).sort().filter(c=>{let l=e.keys[c];if(t.tag&&!(l.tags??[]).includes(t.tag)||t.needsAttention&&(n?.get(c)?.length??0)===0||t.aiContextUnreviewed&&l.contextSource!==`ai`||t.emptySource&&!$f(l,e.config.sourceLocale)||t.noUsages&&r&&r.has(c)||t.skipTranslate&&!l.skipTranslate)return!1;if(t.plurality?.length){let e=l.plural?`plural`:`single`;if(!t.plurality.includes(e))return!1}if(t.states.length&&!t.states.some(n=>ep(e,l,n,t.locale)))return!1;if(t.issues.length){let e=(n?.get(c)??[]).filter(e=>!t.locale||e.locale===t.locale),r=new Set(e.map(e=>e.check));if(!t.issues.some(e=>r.has(e)))return!1}if(i){if(a!==null){if(c.toLowerCase()!==a)return!1}else if(i.startsWith(`^`)){if(!o||!o.test(c))return!1}else if(!(c+` `+(l.context??``)+` `+(l.tags??[]).join(` `)+` `+Object.values(l.values).map(e=>e.value).join(` `)).toLowerCase().includes(s))return!1}return!0})}var rp=[`untranslated`,`placeholder`,`spelling`,`length`,`glossary`],ip=[`untranslated`,`placeholder`,`length`,`glossary`],ap=[`missing`,`machine`,`needs-review`,`reviewed`],op=[`plural`,`single`],sp={untranslated:`Untranslated`,placeholder:`Placeholder mismatch`,spelling:`Spelling`,length:`Too long`,glossary:`Glossary`},cp={missing:`Missing`,machine:`Machine`,reviewed:`Reviewed`,"needs-review":`Needs review`},lp={plural:`Plural`,single:`Single`};function up(e){let t=new Map;for(let n of e){let e=t.get(n.key);e?e.push(n):t.set(n.key,[n])}return t}var dp=[`key-asc`,`key-desc`,`created`,`updated`],fp=[`multilingual`,`bilingual`],pp={text:``,states:[],issues:[],plurality:[],tag:``,needsAttention:!1,emptySource:!1,aiContextUnreviewed:!1,noUsages:!1,skipTranslate:!1};function mp(e){let t=e.get(`q`)??``,n=e.get(`tag`)??``,r=(e.get(`states`)??``).split(`,`).map(e=>e.trim()).filter(e=>ap.includes(e)),i=(e.get(`issues`)??``).split(`,`).map(e=>e.trim()).filter(e=>rp.includes(e)),a=(e.get(`plurality`)??``).split(`,`).map(e=>e.trim()).filter(e=>op.includes(e)),o=e.get(`sort`)??``,s=dp.includes(o)?o:`key-asc`,c=e.get(`view`)??``,l=fp.includes(c)?c:`multilingual`,u=e.get(`locale`)??``;return{filter:{...pp,text:t,tag:n,states:r,issues:i,plurality:a,needsAttention:e.get(`attention`)===`1`,emptySource:e.get(`emptySource`)===`1`,aiContextUnreviewed:e.get(`aiContext`)===`1`,noUsages:e.get(`noUsages`)===`1`,skipTranslate:e.get(`skipTranslate`)===`1`},sort:s,view:l,locale:u}}function hp(e){let t=new URLSearchParams,{filter:n,sort:r,view:i,locale:a}=e;return n.text&&t.set(`q`,n.text),n.tag&&t.set(`tag`,n.tag),n.states.length&&t.set(`states`,n.states.join(`,`)),n.issues.length&&t.set(`issues`,n.issues.join(`,`)),n.plurality.length&&t.set(`plurality`,n.plurality.join(`,`)),n.needsAttention&&t.set(`attention`,`1`),n.emptySource&&t.set(`emptySource`,`1`),n.aiContextUnreviewed&&t.set(`aiContext`,`1`),n.noUsages&&t.set(`noUsages`,`1`),n.skipTranslate&&t.set(`skipTranslate`,`1`),r!==`key-asc`&&t.set(`sort`,r),i!==`multilingual`&&t.set(`view`,i),i===`bilingual`&&a&&t.set(`locale`,a),t}var gp=[`editor`,`analytics`,`glossary`,`screenshots`,`settings`,`activity`,`docs`];function _p(){let e=location.hash.replace(/^#\/?/,``),t=e.indexOf(`?`),n=t===-1?e:e.slice(0,t),r=t===-1?``:e.slice(t+1);return{route:gp.includes(n)?n:`editor`,search:r}}var vp=A(_p().route);window.addEventListener(`hashchange`,()=>{vp.value=_p().route});var yp=null;function bp(e){yp=e}function xp(e){yp&&!yp(e)||(location.hash=e)}function Sp(){return $t(vp)}function Cp(){return new URLSearchParams(_p().search)}function wp(e){let t=e.toString(),n=`#${_p().route}${t?`?${t}`:``}`;history.replaceState(null,``,n)}var Tp=A(null);function Ep(e){Tp.value=e,xp(`editor`)}var Dp=A(null);function Op(e){Dp.value=e,Ep({text:e})}function kp(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=kp(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ap(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=kp(e))&&(r&&(r+=` `),r+=t);return r}var jp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Mp=Ap,Np=(e,t)=>n=>{if(t?.variants==null)return Mp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=jp(t)||jp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Mp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Pp(e){return typeof e==`string`?`'${e}'`:new Fp().serialize(e)}var Fp=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function Ip(e,t){return e===t||Pp(e)===Pp(t)}function Lp(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Rp(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=xr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(br(r,e),e)]}function zp(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Bp(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function Vp(e){return e==null}function Hp(e,t){let n=fn();return Tr(()=>{n.value=e()},{...t,flush:t?.flush??`sync`}),$t(n)}function Up(e,t){return Fe()?(Ie(e,t),!0):!1}function Wp(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return Up(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function Gp(e){let t=!1,n,r=Pe(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Kp=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var qp=e=>e!==void 0,Jp=Object.prototype.toString,Yp=e=>Jp.call(e)===`[object Object]`,Xp=Zp();function Zp(){var e,t;return Kp&&!!(!((e=window)==null||(e=e.navigator)==null)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Qp(e){return Array.isArray(e)?e:[e]}function $p(e){return e||Ds()}function em(e){if(!Kp)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=Pe(!0),n=r.run(()=>e(...a))),Up(i),n))}function tm(e){return Zt(dn(e)?new Proxy({},{get(t,n,r){return j(Reflect.get(e.value,n,r))},set(t,n,r){return dn(e.value[n])&&!dn(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function nm(e){return tm(K(e))}function rm(e,...t){let n=t.flat(),r=n[0];return nm(()=>Object.fromEntries(typeof r==`function`?Object.entries(xn(e)).filter(([e,t])=>!r(gn(t),e)):Object.entries(xn(e)).filter(e=>!n.includes(e[0]))))}function im(e,t=1e4){return bn((n,r)=>{let i=gn(e),a,o=()=>setTimeout(()=>{i=gn(e),r()},gn(t));return Up(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function am(e,t){$p(t)&&Yi(e,t)}function om(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=fn(!1),o;function s(){o&&=(clearTimeout(o),void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},gn(t))}return r&&(a.value=!0,Kp&&l()),Up(c),{isPending:en(a),start:l,stop:c}}function sm(e,t,n){return N(e,t,{...n,immediate:!0})}var cm=Kp?window:void 0;Kp&&window.document,Kp&&window.navigator,Kp&&window.location;function lm(e){let t=gn(e);return t?.$el??t}function um(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=K(()=>{let t=Qp(gn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return sm(()=>[n.value?.map(e=>lm(e))??[cm].filter(e=>e!=null),Qp(gn(n.value?e[1]:e[0])),Qp(j(n.value?e[2]:e[1])),gn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Yp(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function dm(){let e=fn(!1),t=Ds();return t&&Ki(()=>{e.value=!0},t),e}function fm(e){let t=dm();return K(()=>(t.value,!!e()))}function pm(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function mm(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=cm,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=pm(t);return um(i,a,e=>{e.repeat&&gn(s)||c(e)&&n(e)},o)}function hm(e){return JSON.parse(JSON.stringify(e))}function gm(e,t,n={}){let{window:r=cm,...i}=n,a,o=fm(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=N(K(()=>{let t=gn(e);return Array.isArray(t)?t.map(e=>lm(e)):[lm(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return Up(l),{isSupported:o,stop:l}}function _m(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Ds(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):hm(e):e,g=()=>qp(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=A(g()),r=!1;return N(()=>e[t],e=>{r||(r=!0,n.value=h(e),er(()=>r=!1))}),N(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}else return K({get(){return g()},set(e){_(e)}})}function vm(e){return e?e.flatMap(e=>e.type===L?vm(e.children):[e]):[]}var ym=[`INPUT`,`TEXTAREA`];function bm(e,t,n,r={}){if(!t||r.enableIgnoredElement&&ym.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=xm(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function xm(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?xm(e,o,n,r):o:null}var[Sm,Cm]=Rp(`ConfigProvider`);function wm(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Tm(e,t,n=`.`,r){if(!wm(t))return Tm(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:wm(a)&&wm(i[t])?i[t]=Tm(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Em(e){return(...t)=>t.reduce((t,n)=>Tm(t,n,``,e),{})}var Dm=Em(),Om=em(()=>{let e=A(new Map),t=A(),n=K(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=Sm({scrollBody:A(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,document.body.style.pointerEvents=``,document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Xp&&i?.(),t.value=void 0};return N(n,(e,o)=>{if(!Kp)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?Dm({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),Xp&&(i=um(document,`touchmove`,e=>jm(e),{passive:!1})),er(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function km(e){let t=Math.random().toString(36).substring(2,7),n=Om();n.value.set(t,e??!1);let r=K({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return am(()=>{n.value.delete(t)}),r}function Am(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth<e.scrollWidth||t.overflowY===`auto`&&e.clientHeight<e.scrollHeight)return!0;{let t=e.parentNode;return!(t instanceof Element)||t.tagName===`BODY`?!1:Am(t)}}function jm(e){let t=e||window.event,n=t.target;return n instanceof Element&&Am(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Mm(e){let t=Sm({dir:A(`ltr`)});return K(()=>e?.value||t.dir?.value||`ltr`)}function Nm(e){let t=Ds(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[ce(ie(t))]=(...n)=>e(t,...n)}),r}var Pm=0;function Fm(){Tr(e=>{if(!Kp)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Im()),document.body.insertAdjacentElement(`beforeend`,t[1]??Im()),Pm++,e(()=>{Pm===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),Pm--})})}function Im(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Lm(e){return K(()=>gn(e)?!!lm(e)?.closest(`form`):!0)}function Rm(){let e=Ds(),t=A(),n=K(()=>r());Ji(()=>{n.value!==r()&&hn(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:lm(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function zm(e){let t=Ds(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=wn(e);return K(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[ie(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function Bm(e,t){let n=zm(e),r=t?Nm(t):{};return K(()=>({...n.value,...r}))}function Vm(e,t){let n=im(!1,300);Up(()=>{n.value=!1});let r=A(null),i=Wp();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Um(a,Hm(a,i.getBoundingClientRect()),1),s=Wm(t.getBoundingClientRect());r.value=Km([...o,...s]),n.value=!0}return Tr(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),Tr(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!Gm(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Hm(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Um(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Wm(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Gm(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Km(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),qm(t)}function qm(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Jm=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ym=new WeakMap,Xm=new WeakMap,Zm={},Qm=0,$m=function(e){return e&&(e.host||$m(e.parentNode))},eh=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$m(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},th=function(e,t,n,r){var i=eh(t,Array.isArray(e)?e:[e]);Zm[n]||(Zm[n]=new WeakMap);var a=Zm[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ym.get(e)||0)+1,l=(a.get(e)||0)+1;Ym.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Xm.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Qm++,function(){o.forEach(function(e){var t=Ym.get(e)-1,i=a.get(e)-1;Ym.set(e,t),a.set(e,i),t||(Xm.has(e)||e.removeAttribute(r),Xm.delete(e)),i||e.removeAttribute(n)}),Qm--,Qm||(Ym=new WeakMap,Ym=new WeakMap,Xm=new WeakMap,Zm={})}},nh=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Jm(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),th(r,i,n,`aria-hidden`)):function(){return null}};function rh(e){let t;N(()=>lm(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=nh(e):t&&t()}),Xi(()=>{t&&t()})}var ih=0;function ah(e,t=`reka`){if(e)return e;let n;return n=`useId`in uu?oi?.():Sm({useId:void 0}).useId?.()??`${++ih}`,t?`${t}-${n}`:n}function oh(e){let t=A(),n=K(()=>t.value?.width??0),r=K(()=>t.value?.height??0);return Ki(()=>{let n=lm(e);if(n){t.value={width:n.offsetWidth,height:n.offsetHeight};let e=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}});return e.observe(n,{box:`border-box`}),()=>e.unobserve(n)}else t.value=void 0}),{width:n,height:r}}function sh(e,t){let n=A(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function ch(e){let t=im(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=zp(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=uh(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function lh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uh(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=lh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function dh(e,t){let n=A({}),r=A(`none`),i=A(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??cm,{state:c,dispatch:l}=sh(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(Kp){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};N(e,async(e,i)=>{let a=i!==e;if(await er(),a){let a=r.value,o=fh(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{let n=fh(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(e.target===t.value&&r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}e.target===t.value&&n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=fh(t.value))},p=N(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=N(c,()=>{let e=fh(t.value);r.value=c.value===`mounted`?e:`none`});return Xi(()=>{p(),m()}),{isPresent:K(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function fh(e){return e&&getComputedStyle(e).animationName||`none`}var ph=P({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=xn(e),a=A(),{isPresent:o}=dh(r,a);n({present:o});let s=t.default({present:o.value});s=vm(s||[]);let c=Ds();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(`
|
|
6
6
|
`)].join(`
|
|
7
|
-
`))}return()=>i.value||r.value||o.value?qs(t.default({present:o.value})[0],{ref:e=>{let t=lm(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),mh=P({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=vm(n.default()),r=e.findIndex(e=>e.type!==ns);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?G(t,i.props):t,o=_s({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),hh=[`area`,`img`,`input`],gh=P({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&hh.includes(r)?()=>qs(r,t):r===`template`?()=>qs(mh,t,{default:n.default}):()=>qs(e.as,t,{default:n.default})}});function _h(){let e=A();return{primitiveElement:e,currentElement:K(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:lm(e))}}var[vh,yh]=Rp(`DialogRoot`),bh=P({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=_m(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=A(),a=A(),{modal:o}=xn(n);return yh({open:r,modal:o,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>I(e.$slots,`default`,{open:j(r),close:()=>r.value=!1})}}),xh=P({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Rm();let n=vh();return(e,r)=>(R(),B(j(gh),G(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>j(n).onOpenChange(!1)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`type`]))}}),Sh=`dismissableLayer.pointerDownOutside`,Ch=`dismissableLayer.focusOutside`;function wh(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function Th(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=A(!1),a=A(()=>{});return Tr(o=>{if(!Kp||!gn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(wh(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Bp(Sh,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{gn(n)&&(i.value=!0)}}}function Eh(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=A(!1);return Tr(a=>{if(!Kp||!gn(n))return;let o=async n=>{if(!t?.value)return;await er(),await er();let r=n.target;!t.value||!r||wh(t.value,r)||n.target&&!i.value&&Bp(Ch,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{gn(n)&&(i.value=!0)},onBlurCapture:()=>{gn(n)&&(i.value=!1)}}}var Dh=Zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set}),Oh=P({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Rm(),o=K(()=>a.value?.ownerDocument??globalThis.document),s=K(()=>Dh.layersRoot),c=K(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=K(()=>Dh.layersWithOutsidePointerEventsDisabled.size>0),u=K(()=>{let e=Array.from(s.value),[t]=[...Dh.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Th(async e=>{let t=[...Dh.branches].some(t=>t?.contains(e.target));!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await er(),e.defaultPrevented||r(`dismiss`))},a),f=Eh(e=>{[...Dh.branches].some(t=>t?.contains(e.target))||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return mm(`Escape`,e=>{c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Tr(e=>{a.value&&(n.disableOutsidePointerEvents&&(Dh.layersWithOutsidePointerEventsDisabled.size===0&&(Dh.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),Dh.layersWithOutsidePointerEventsDisabled.add(a.value)),s.value.add(a.value),e(()=>{n.disableOutsidePointerEvents&&Dh.layersWithOutsidePointerEventsDisabled.size===1&&!Vp(Dh.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=Dh.originalBodyPointerEvents)}))}),Tr(e=>{e(()=>{a.value&&(s.value.delete(a.value),Dh.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(R(),B(j(gh),{ref:j(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:ge({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:j(f).onFocusCapture,onBlurCapture:j(f).onBlurCapture,onPointerdownCapture:j(d).onPointerDownCapture},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),kh=Gp(()=>A([]));function Ah(){let e=kh();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=jh(e.value,t),e.value.unshift(t)},remove(t){e.value=jh(e.value,t),e.value[0]?.resume()}}}function jh(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var Mh=`focusScope.autoFocusOnMount`,Nh=`focusScope.autoFocusOnUnmount`,Ph={bubbles:!1,cancelable:!0};function Fh(e,{select:t=!1}={}){let n=zp();for(let r of e)if(Vh(r,{select:t}),zp()!==n)return!0}function Ih(e){let t=Lh(e);return[Rh(t,e),Rh(t.reverse(),e)]}function Lh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Rh(e,t){for(let n of e)if(!zh(n,{upTo:t}))return n}function zh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Bh(e){return e instanceof HTMLInputElement&&`select`in e}function Vh(e,{select:t=!1}={}){if(e&&e.focus){let n=zp();e.focus({preventScroll:!0}),e!==n&&Bh(e)&&t&&e.select()}}var Hh=P({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=Rm(),o=A(null),s=Ah(),c=Zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Tr(e=>{if(!Kp)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Vh(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Vh(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||Vh(t))}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})}),Tr(async e=>{let t=a.value;if(await er(),!t)return;s.add(c);let n=zp();if(!t.contains(n)){let e=new CustomEvent(Mh,Ph);t.addEventListener(Mh,e=>r(`mountAutoFocus`,e)),t.dispatchEvent(e),e.defaultPrevented||(Fh(Lh(t),{select:!0}),zp()===n&&Vh(t))}e(()=>{t.removeEventListener(Mh,e=>r(`mountAutoFocus`,e));let e=new CustomEvent(Nh,Ph),i=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Nh,i),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Vh(n??document.body,{select:!0}),t.removeEventListener(Nh,i),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})});function l(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=zp();if(t&&r){let t=e.currentTarget,[i,a]=Ih(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Vh(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Vh(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(R(),B(j(gh),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:l},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Uh=`menu.itemSelect`,Wh=[`Enter`,` `],Gh=[`ArrowDown`,`PageUp`,`Home`],Kh=[`ArrowUp`,`PageDown`,`End`],qh=[...Gh,...Kh];[...Wh],[...Wh];function Jh(e){return e?`open`:`closed`}function Yh(e){let t=zp();for(let n of e)if(n===t||(n.focus(),zp()!==t))return}function Xh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Zh(e,t){return t?Xh({x:e.clientX,y:e.clientY},t):!1}function Qh(e){return e.pointerType===`mouse`}var $h=P({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),{forwardRef:a,currentElement:o}=Rm();return i.titleId||=ah(void 0,`reka-dialog-title`),i.descriptionId||=ah(void 0,`reka-dialog-description`),Ki(()=>{i.contentElement=o,zp()!==document.body&&(i.triggerElement.value=zp())}),(e,t)=>(R(),B(j(Hh),{"as-child":``,loop:``,trapped:n.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),G({id:j(i).contentId,ref:j(a),as:e.as,"as-child":e.asChild,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":j(i).descriptionId,"aria-labelledby":j(i).titleId,"data-state":j(Jh)(j(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>j(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`]))}}),eg=P({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),a=Nm(r),{forwardRef:o,currentElement:s}=Rm();return rh(s),(e,t)=>(R(),B($h,G({...n,...j(a)},{ref:j(o),"trap-focus":j(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),j(i).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),tg=P({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Nm(t);Rm();let i=vh(),a=A(!1),o=A(!1);return(e,t)=>(R(),B($h,G({...n,...j(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||j(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;j(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ng=P({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),a=Nm(r),{forwardRef:o}=Rm();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[j(i).modal.value?(R(),B(eg,G({key:0,ref:j(o)},{...n,...j(a),...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(tg,G({key:1,ref:j(o)},{...n,...j(a),...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),rg=P({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;Rm();let n=vh();return(e,r)=>(R(),B(j(gh),G(t,{id:j(n).descriptionId}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),ig=P({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=vh();return km(!0),Rm(),(e,n)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,"data-state":j(t).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:n[0]||=q(()=>{},[`left`,`self`,`prevent`])},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),ag=P({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=vh(),{forwardRef:n}=Rm();return(e,r)=>j(t)?.modal.value?(R(),B(j(ph),{key:0,present:e.forceMount||j(t).open.value},{default:M(()=>[H(ig,G(e.$attrs,{ref:j(n),as:e.as,"as-child":e.asChild}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as`,`as-child`])]),_:3},8,[`present`])):W(`v-if`,!0)}}),og=P({__name:`Teleport`,props:{to:{type:null,required:!1,default:`body`},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=dm();return(e,n)=>j(t)||e.forceMount?(R(),B(Hr,{key:0,to:e.to,disabled:e.disabled,defer:e.defer},[I(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):W(`v-if`,!0)}}),sg=P({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),cg=P({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=vh();return Rm(),(e,r)=>(R(),B(j(gh),G(t,{id:j(n).titleId}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),lg=`data-reka-collection-item`;function ug(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:A(),itemMap:A(new Map)},br(r,i)):i=xr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${lg}]`)),r=Array.from(i.itemMap.value.values()).sort((e,t)=>n.indexOf(e.ref)-n.indexOf(t.ref));return e?r:r.filter(e=>e.ref.dataset.disabled!==``)},o=P({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=_h();return N(a,()=>{i.collectionRef.value=a.value}),()=>qs(mh,{ref:r,...n},t)}}),s=P({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=_h();return Tr(t=>{if(a.value){let n=cn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>qs(mh,{...n,[lg]:``,ref:r},t)}});return{getItems:a,reactiveItems:K(()=>Array.from(i.itemMap.value.values())),itemMapSize:K(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var dg=P({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),fg=P({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=_h();return N(K(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(R(),B(dg,G({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),pg=P({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=K(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=K(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(R(),z(L,null,[W(` We render single input if it's required `),n.value?(R(),B(fg,G({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(R(!0),z(L,{key:1},F(r.value,n=>(R(),B(fg,G({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),mg=`rovingFocusGroup.onEntryFocus`,hg={bubbles:!1,cancelable:!0},gg={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function _g(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function vg(e,t,n){let r=_g(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return gg[r]}function yg(e,t=!1){let n=zp();for(let r of e)if(r===n||(r.focus({preventScroll:t}),zp()!==n))return}function bg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[xg,Sg]=Rp(`PopperRoot`),Cg=P({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=A();return Sg({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>I(e.$slots,`default`)}}),wg=P({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Rm(),i=xg();return Er(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(R(),B(j(gh),{ref:j(n),as:e.as,"as-child":e.asChild},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function Tg(e){return e!==null}function Eg(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Dg(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}}function Dg(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Og=[`top`,`right`,`bottom`,`left`],kg=Math.min,Ag=Math.max,jg=Math.round,Mg=Math.floor,Ng=e=>({x:e,y:e}),Pg={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fg(e,t,n){return Ag(e,kg(t,n))}function Ig(e,t){return typeof e==`function`?e(t):e}function Lg(e){return e.split(`-`)[0]}function Rg(e){return e.split(`-`)[1]}function zg(e){return e===`x`?`y`:`x`}function Bg(e){return e===`y`?`height`:`width`}function Vg(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Hg(e){return zg(Vg(e))}function Ug(e,t,n){n===void 0&&(n=!1);let r=Rg(e),i=Hg(e),a=Bg(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Qg(o)),[o,Qg(o)]}function Wg(e){let t=Qg(e);return[Gg(e),t,Gg(t)]}function Gg(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Kg=[`left`,`right`],qg=[`right`,`left`],Jg=[`top`,`bottom`],Yg=[`bottom`,`top`];function Xg(e,t,n){switch(e){case`top`:case`bottom`:return n?t?qg:Kg:t?Kg:qg;case`left`:case`right`:return t?Jg:Yg;default:return[]}}function Zg(e,t,n,r){let i=Rg(e),a=Xg(Lg(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Gg)))),a}function Qg(e){let t=Lg(e);return Pg[t]+e.slice(t.length)}function $g(e){return{top:0,right:0,bottom:0,left:0,...e}}function e_(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$g(e)}function t_(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function n_(e,t,n){let{reference:r,floating:i}=e,a=Vg(t),o=Hg(t),s=Bg(o),c=Lg(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Rg(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function r_(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ig(t,e),p=e_(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=t_(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=t_(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var i_=50,a_=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:r_},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=n_(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<i_&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=n_(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},o_=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ig(e,t)||{};if(l==null)return{};let d=e_(u),f={x:n,y:r},p=Hg(i),m=Bg(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=kg(d[_],T),E=kg(d[v],T),te=ee,ne=C-h[m]-E,re=C/2-h[m]/2+w,ie=Fg(te,re,ne),ae=!c.arrow&&Rg(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?ee:E)-h[m]/2<0,oe=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+oe,data:{[p]:ie,centerOffset:re-ie-oe,...ae&&{alignmentOffset:oe}},reset:ae}}}),s_=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ig(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Lg(r),_=Vg(o),v=Lg(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Qg(o)]:Wg(o)),x=p!==`none`;!d&&x&&b.push(...Zg(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ug(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Vg(t))||T.every(e=>Vg(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Vg(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function c_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function l_(e){return Og.some(t=>e[t]>=0)}var u_=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ig(e,t);switch(i){case`referenceHidden`:{let e=c_(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:l_(e)}}}case`escaped`:{let e=c_(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:l_(e)}}}default:return{}}}}},d_=new Set([`left`,`top`]);async function f_(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lg(n),s=Rg(n),c=Vg(n)===`y`,l=d_.has(o)?-1:1,u=a&&c?-1:1,d=Ig(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var p_=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await f_(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},m_=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ig(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Vg(Lg(i)),p=zg(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Fg(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Fg(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},h_=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ig(e,t),u={x:n,y:r},d=Vg(i),f=zg(d),p=u[f],m=u[d],h=Ig(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=d_.has(Lg(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},g_=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ig(e,t),u=await o.detectOverflow(t,l),d=Lg(i),f=Rg(i),p=Vg(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kg(h-u[g],v),x=kg(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ag(u.left,0),t=Ag(u.right,0),n=Ag(u.top,0),r=Ag(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ag(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ag(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function __(){return typeof window<`u`}function v_(e){return x_(e)?(e.nodeName||``).toLowerCase():`#document`}function y_(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function b_(e){return((x_(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function x_(e){return __()?e instanceof Node||e instanceof y_(e).Node:!1}function S_(e){return __()?e instanceof Element||e instanceof y_(e).Element:!1}function C_(e){return __()?e instanceof HTMLElement||e instanceof y_(e).HTMLElement:!1}function w_(e){return!__()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof y_(e).ShadowRoot}function T_(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function E_(e){return/^(table|td|th)$/.test(v_(e))}function D_(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var O_=/transform|translate|scale|rotate|perspective|filter/,k_=/paint|layout|strict|content/,A_=e=>!!e&&e!==`none`,j_;function M_(e){let t=S_(e)?I_(e):e;return A_(t.transform)||A_(t.translate)||A_(t.scale)||A_(t.rotate)||A_(t.perspective)||!P_()&&(A_(t.backdropFilter)||A_(t.filter))||O_.test(t.willChange||``)||k_.test(t.contain||``)}function N_(e){let t=R_(e);for(;C_(t)&&!F_(t);){if(M_(t))return t;if(D_(t))return null;t=R_(t)}return null}function P_(){return j_??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),j_}function F_(e){return/^(html|body|#document)$/.test(v_(e))}function I_(e){return y_(e).getComputedStyle(e)}function L_(e){return S_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R_(e){if(v_(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||w_(e)&&e.host||b_(e);return w_(t)?t.host:t}function z_(e){let t=R_(e);return F_(t)?e.ownerDocument?e.ownerDocument.body:e.body:C_(t)&&T_(t)?t:z_(t)}function B_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=z_(e),i=r===e.ownerDocument?.body,a=y_(r);if(i){let e=V_(a);return t.concat(a,a.visualViewport||[],T_(r)?r:[],e&&n?B_(e):[])}else return t.concat(r,B_(r,[],n))}function V_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H_(e){let t=I_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=C_(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jg(n)!==a||jg(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function U_(e){return S_(e)?e:e.contextElement}function W_(e){let t=U_(e);if(!C_(t))return Ng(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=H_(t),o=(a?jg(n.width):n.width)/r,s=(a?jg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var G_=Ng(0);function K_(e){let t=y_(e);return!P_()||!t.visualViewport?G_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function q_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==y_(e)?!1:t}function J_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=U_(e),o=Ng(1);t&&(r?S_(r)&&(o=W_(r)):o=W_(e));let s=q_(a,n,r)?K_(a):Ng(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=y_(a),t=r&&S_(r)?y_(r):r,n=e,i=V_(n);for(;i&&r&&t!==n;){let e=W_(i),t=i.getBoundingClientRect(),r=I_(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=y_(i),i=V_(n)}}return t_({width:u,height:d,x:c,y:l})}function Y_(e,t){let n=L_(e).scrollLeft;return t?t.left+n:J_(b_(e)).left+n}function X_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Y_(e,n),y:n.top+t.scrollTop}}function Z_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=b_(r),s=t?D_(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ng(1),u=Ng(0),d=C_(r);if((d||!d&&!a)&&((v_(r)!==`body`||T_(o))&&(c=L_(r)),d)){let e=J_(r);l=W_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?X_(o,c):Ng(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Q_(e){return Array.from(e.getClientRects())}function $_(e){let t=b_(e),n=L_(e),r=e.ownerDocument.body,i=Ag(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ag(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Y_(e),s=-n.scrollTop;return I_(r).direction===`rtl`&&(o+=Ag(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ev=25;function tv(e,t){let n=y_(e),r=b_(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P_();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Y_(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ev&&(a-=o)}else l<=ev&&(a+=l);return{width:a,height:o,x:s,y:c}}function nv(e,t){let n=J_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=C_(e)?W_(e):Ng(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rv(e,t,n){let r;if(t===`viewport`)r=tv(e,n);else if(t===`document`)r=$_(b_(e));else if(S_(t))r=nv(t,n);else{let n=K_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return t_(r)}function iv(e,t){let n=R_(e);return n===t||!S_(n)||F_(n)?!1:I_(n).position===`fixed`||iv(n,t)}function av(e,t){let n=t.get(e);if(n)return n;let r=B_(e,[],!1).filter(e=>S_(e)&&v_(e)!==`body`),i=null,a=I_(e).position===`fixed`,o=a?R_(e):e;for(;S_(o)&&!F_(o);){let t=I_(o),n=M_(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||T_(o)&&!n&&iv(e,o))?r=r.filter(e=>e!==o):i=t,o=R_(o)}return t.set(e,r),r}function ov(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?D_(t)?[]:av(t,this._c):[].concat(n),r],o=rv(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=rv(t,a[e],i);s=Ag(n.top,s),c=kg(n.right,c),l=kg(n.bottom,l),u=Ag(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function sv(e){let{width:t,height:n}=H_(e);return{width:t,height:n}}function cv(e,t,n){let r=C_(t),i=b_(t),a=n===`fixed`,o=J_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ng(0);function l(){c.x=Y_(i)}if(r||!r&&!a)if((v_(t)!==`body`||T_(i))&&(s=L_(t)),r){let e=J_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?X_(i,s):Ng(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function lv(e){return I_(e).position===`static`}function uv(e,t){if(!C_(e)||I_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return b_(e)===n&&(n=n.ownerDocument.body),n}function dv(e,t){let n=y_(e);if(D_(e))return n;if(!C_(e)){let t=R_(e);for(;t&&!F_(t);){if(S_(t)&&!lv(t))return t;t=R_(t)}return n}let r=uv(e,t);for(;r&&E_(r)&&lv(r);)r=uv(r,t);return r&&F_(r)&&lv(r)&&!M_(r)?n:r||N_(e)||n}var fv=async function(e){let t=this.getOffsetParent||dv,n=this.getDimensions,r=await n(e.floating);return{reference:cv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pv(e){return I_(e).direction===`rtl`}var mv={convertOffsetParentRelativeRectToViewportRelativeRect:Z_,getDocumentElement:b_,getClippingRect:ov,getOffsetParent:dv,getElementRects:fv,getClientRects:Q_,getDimensions:sv,getScale:W_,isElement:S_,isRTL:pv};function hv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gv(e,t){let n=null,r,i=b_(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mg(d),h=Mg(i.clientWidth-(u+f)),g=Mg(i.clientHeight-(d+p)),_=Mg(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ag(0,kg(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!hv(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function _v(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=U_(e),u=i||a?[...l?B_(l):[],...t?B_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?gv(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?J_(e):null;c&&g();function g(){let t=J_(e);h&&!hv(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var vv=p_,yv=m_,bv=s_,xv=g_,Sv=u_,Cv=o_,wv=h_,Tv=(e,t,n)=>{let r=new Map,i={platform:mv,...n},a={...i.platform,_c:r};return a_(e,t,{...i,platform:a})};function Ev(e){return typeof e==`object`&&!!e&&`$el`in e}function Dv(e){if(Ev(e)){let t=e.$el;return x_(t)&&v_(t)===`#comment`?null:t}return e}function Ov(e){return typeof e==`function`?e():j(e)}function kv(e){return{name:`arrow`,options:e,fn(t){let n=Dv(Ov(e.element));return n==null?{}:Cv({element:n,padding:e.padding}).fn(t)}}}function Av(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jv(e,t){let n=Av(e);return Math.round(t*n)/n}function Mv(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=K(()=>Ov(n.open)??!0),a=K(()=>Ov(n.middleware)),o=K(()=>Ov(n.placement)??`bottom`),s=K(()=>Ov(n.strategy)??`absolute`),c=K(()=>Ov(n.transform)??!0),l=K(()=>Dv(e.value)),u=K(()=>Dv(t.value)),d=A(0),f=A(0),p=A(s.value),m=A(o.value),h=fn({}),g=A(!1),_=K(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=jv(u.value,d.value),n=jv(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Av(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;Tv(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return N([a,o,s,i],y,{flush:`sync`}),N([l,u],x,{flush:`sync`}),N(i,S,{flush:`sync`}),Fe()&&Ie(b),{x:en(d),y:en(f),strategy:en(p),placement:en(m),middlewareData:en(h),isPositioned:en(g),floatingStyles:_,update:y}}var Nv={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[Pv,Fv]=Rp(`PopperContent`),Iv=P({inheritAttrs:!1,__name:`PopperContent`,props:Oa({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Nv}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=xg(),{forwardRef:a,currentElement:o}=Rm(),s=A(),c=A(),{width:l,height:u}=oh(c),d=K(()=>n.side+(n.align===`center`?``:`-${n.align}`)),f=K(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),p=K(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),m=K(()=>({padding:f.value,boundary:p.value.filter(Tg),altBoundary:p.value.length>0})),h=K(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=Hp(()=>[vv({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bv({...m.value,...h.value}),n.avoidCollisions&&yv({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?wv():void 0,...m.value}),!n.prioritizePosition&&n.avoidCollisions&&bv({...m.value,...h.value}),xv({...m.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),c.value&&kv({element:c.value,padding:n.arrowPadding}),Eg({arrowWidth:l.value,arrowHeight:u.value}),n.hideWhenDetached&&Sv({strategy:`referenceHidden`,...m.value})]),{floatingStyles:_,placement:v,isPositioned:y,middlewareData:b,update:x}=Mv(K(()=>n.reference??i.anchor.value),s,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...e)=>_v(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:g}),S=K(()=>Dg(v.value)[0]),C=K(()=>Dg(v.value)[1]);Er(()=>{y.value&&r(`placed`)});let w=K(()=>{let e=b.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),T=A(``);return Tr(()=>{o.value&&(T.value=window.getComputedStyle(o.value).zIndex)}),Fv({placedSide:S,onArrowChange:e=>c.value=e,arrowX:K(()=>b.value.arrow?.x??0),arrowY:K(()=>b.value.arrow?.y??0),shouldHideArrow:w}),(e,t)=>(R(),z(`div`,{ref_key:`floatingRef`,ref:s,"data-reka-popper-content-wrapper":``,style:ge({...j(_),transform:j(y)?j(_).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:T.value,"--reka-popper-transform-origin":[j(b).transformOrigin?.x,j(b).transformOrigin?.y].join(` `),...j(b).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[H(j(gh),G({ref:j(a)},e.$attrs,{"as-child":n.asChild,as:e.as,"data-side":S.value,"data-align":C.value,style:{animation:j(y)?void 0:`none`}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])],4))}});function Lv(e){let t=Sm({nonce:A()});return K(()=>e?.value||t.nonce?.value)}var[Rv,zv]=Rp(`RovingFocusGroup`),Bv=P({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:s}=xn(r),c=Mm(s),l=_m(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=A(!1),d=A(!1),f=A(0),{getItems:p,CollectionSlot:m}=ug({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(mg,hg);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);yg([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===l.value),...e].filter(Boolean),r.preventScrollOnEntryFocus)}}d.value=!1}function g(){setTimeout(()=>{d.value=!1},1)}return t({getItems:p}),zv({loop:a,dir:c,orientation:o,currentTabStopId:l,onItemFocus:e=>{l.value=e},onItemShiftTab:()=>{u.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(e,t)=>(R(),B(j(m),null,{default:M(()=>[H(j(gh),{tabindex:u.value||f.value===0?-1:0,"data-orientation":j(o),as:e.as,"as-child":e.asChild,dir:j(c),style:{outline:`none`},onMousedown:t[0]||=e=>d.value=!0,onMouseup:g,onFocus:h,onBlur:t[1]||=e=>u.value=!1},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),Vv=P({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Rv(),r=ah(),i=K(()=>t.tabStopId||r),a=K(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=ug();Ki(()=>{t.focusable&&n.onFocusableItemAdd()}),Xi(()=>{t.focusable&&n.onFocusableItemRemove()});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=vg(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?bg(i,t+1):i.slice(t+1)}er(()=>yg(i))}}return(e,t)=>(R(),B(j(s),null,{default:M(()=>[H(j(gh),{tabindex:a.value?0:-1,"data-orientation":j(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?j(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>j(n).onItemFocus(i.value),onKeydown:c},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),Hv=P({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(wg),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}});function Uv(){let e=A(!1);return Ki(()=>{um(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),um([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var Wv=em(Uv),[Gv,Kv]=Rp([`MenuRoot`,`MenuSub`],`MenuContext`),[qv,Jv]=Rp(`MenuRoot`),Yv=P({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=xn(n),o=Mm(a),s=_m(n,`open`,r),c=A(),l=Wv();return Kv({open:s,onOpenChange:e=>{s.value=e},content:c,onContentChange:e=>{c.value=e}}),Jv({onClose:()=>{s.value=!1},isUsingKeyboardRef:l,dir:o,modal:i}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`)]),_:3}))}}),[Xv,Zv]=Rp(`MenuContent`),Qv=P({__name:`MenuContentImpl`,props:Oa({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Nv}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Gv(),a=qv(),{trapFocus:o,disableOutsidePointerEvents:s,loop:c}=xn(n);Fm(),km(s.value);let l=A(``),u=A(0),d=A(0),f=A(null),p=A(`right`),m=A(0),h=A(null),g=A(),{forwardRef:_,currentElement:v}=Rm(),{handleTypeaheadSearch:y}=ch(),b=A();function x(e){let t=bm(e,b.value||zp(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(b.value=t,t.scrollIntoView({block:`nearest`}))}function S(){b.value&&b.value.click()}let C=A(),w=A();N(b,e=>{w.value&&(e===void 0||e!==w.value.trigger.value)&&(w.value.onOpenChange(!1),w.value=void 0)}),N(v,e=>{i.onContentChange(e)}),Xi(()=>{window.clearTimeout(u.value)});function T(e){return p.value===f.value?.side&&Zh(e,f.value?.area)}async function ee(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),v.value?.focus({preventScroll:!0}))}function E(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,s=bm(e,zp(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(s)return s?.focus();if(e.code===`Space`)return;let l=g.value?.getItems()??[];if(n&&(e.key===`Tab`&&e.preventDefault(),!i&&o&&!r&&y(e.key,l)),e.target!==v.value||!qh.includes(e.key))return;e.preventDefault();let u=[...l.map(e=>e.ref)];Kh.includes(e.key)&&u.reverse(),Yh(u)}function te(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(u.value),l.value=``)}function ne(e){if(!Qh(e))return;let t=e.target,n=m.value!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(p.value=e.clientX>m.value?`right`:`left`,m.value=e.clientX)}function re(e){Qh(e)&&C.value&&C.value.focus()}return Zv({onItemEnter:e=>!!T(e),onItemLeave:e=>T(e)?!0:([`INPUT`,`TEXTAREA`].includes(zp()?.tagName||``)||v.value?.focus(),h.value=null,!1),onTriggerLeave:e=>!!T(e),searchRef:l,highlightedElement:b,onKeydownNavigation:x,onKeydownEnter:S,filterElement:C,onFilterElementChange:e=>{C.value=e},activeSubmenuContext:w,pointerGraceTimerRef:d,onPointerGraceIntentChange:e=>{f.value=e}}),(e,t)=>(R(),B(j(Hh),{"as-child":``,trapped:j(o),onMountAutoFocus:ee,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":j(s),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:M(()=>[H(j(Bv),{ref_key:`rovingFocusGroupRef`,ref:g,"current-tab-stop-id":h.value,"onUpdate:currentTabStopId":t[0]||=e=>h.value=e,"as-child":``,orientation:`vertical`,dir:j(a).dir.value,loop:j(c),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),j(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:M(()=>[H(j(Iv),{ref:j(_),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":j(Jh)(j(i).open.value),dir:j(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:E,onBlur:te,onPointermove:ne,onPointerenter:re},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),$v=P({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Xv(),{forwardRef:r,currentElement:i}=Rm(),{CollectionItem:a}=ug(),o=A(!1),s=K(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function c(e){if(!(e.defaultPrevented||!Qh(e))){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(zp()?.tagName||``)||t.focus({preventScroll:!0})}}}async function l(e){await er(),!e.defaultPrevented&&Qh(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(R(),B(j(a),{value:{textValue:e.textValue}},{default:M(()=>[H(j(gh),G({ref:j(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:c,onPointerleave:l,onFocus:t[0]||=async t=>{await er(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,j(n).highlightedElement.value=t.currentTarget)},onBlur:t[1]||=async e=>{await er(),!e.defaultPrevented&&(o.value=!1)}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),ey=P({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Rm(),o=qv(),s=Xv(),c=A(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Uh,{bubbles:!0,cancelable:!0});r(`select`,e),await er(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(R(),B($v,G(n,{ref:j(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await er(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=j(s).searchRef.value!==``;e.disabled||n&&t.key===` `||j(Wh).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ty=P({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Bm(n,r),a=Gv(),{forwardRef:o,currentElement:s}=Rm();return rh(s),(e,t)=>(R(),B(Qv,G(j(i),{ref:j(o),"trap-focus":j(a).open.value,"disable-outside-pointer-events":j(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>j(a).onOpenChange(!1),onFocusOutside:t[1]||=q(e=>r(`focusOutside`,e),[`prevent`])}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),ny=P({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t),r=Gv();return(e,t)=>(R(),B(Qv,G(j(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>j(r).onOpenChange(!1)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ry=P({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t),r=Gv(),i=qv();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(r).open.value},{default:M(()=>[j(i).modal.value?(R(),B(ty,xe(G({key:0},{...e.$attrs,...j(n)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(ny,xe(G({key:1},{...e.$attrs,...j(n)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),[iy,ay]=Rp(`MenuGroup`),oy=P({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=iy({id:``});return(e,r)=>(R(),B(j(gh),G(t,{id:j(n).id||void 0}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),sy=P({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),cy=P({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(gh),G(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),[ly,uy]=Rp(`PopoverRoot`),dy=P({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=xn(n),a=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return uy({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:A(),hasCustomAnchor:A(!1)}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{open:j(a),close:()=>a.value=!1})]),_:3}))}}),fy=P({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=zm(rm(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=Rm(),o=ly();return Fm(),(e,t)=>(R(),B(j(Hh),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>j(o).onOpenChange(!1)},{default:M(()=>[H(j(Iv),G(j(i),{id:j(o).contentId,ref:j(a),"data-state":j(o).open.value?`open`:`closed`,"aria-labelledby":j(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),py=P({__name:`PopoverContentModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=A(!1);km(!0);let o=Bm(n,r),{forwardRef:s,currentElement:c}=Rm();return rh(c),(e,t)=>(R(),B(fy,G(j(o),{ref:j(s),"trap-focus":j(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=q(e=>{r(`closeAutoFocus`,e),a.value||j(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.value=t.button===2||n},onFocusOutside:t[2]||=q(()=>{},[`prevent`])}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),my=P({__name:`PopoverContentNonModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=A(!1),o=A(!1),s=Bm(n,r);return(e,t)=>(R(),B(fy,G(j(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||j(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;j(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),hy=P({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=Bm(n,r),{forwardRef:o}=Rm();return i.contentId||=ah(void 0,`reka-popover-content`),(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[j(i).modal.value?(R(),B(py,G({key:0},j(a),{ref:j(o)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(my,G({key:1},j(a),{ref:j(o)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),gy=P({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),_y=P({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=ly(),{forwardRef:r,currentElement:i}=Rm();return n.triggerId||=ah(void 0,`reka-popover-trigger`),Ki(()=>{n.triggerElement.value=i.value}),(e,i)=>(R(),B(aa(j(n).hasCustomAnchor.value?j(gh):j(wg)),{"as-child":``},{default:M(()=>[H(j(gh),{id:j(n).triggerId,ref:j(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":j(n).open.value,"aria-controls":j(n).contentId,"data-state":j(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:j(n).onOpenToggle},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),[vy,yy]=Rp(`DropdownMenuRoot`),by=P({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Rm();let i=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=A(),{modal:o,dir:s}=xn(n),c=Mm(s);return yy({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:o,dir:c}),(e,t)=>(R(),B(j(Yv),{open:j(i),"onUpdate:open":t[0]||=e=>dn(i)?i.value=e:null,dir:j(c),modal:j(o)},{default:M(()=>[I(e.$slots,`default`,{open:j(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),xy=P({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t);Rm();let r=vy(),i=A(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=ah(void 0,`reka-dropdown-menu-content`),(e,t)=>(R(),B(j(ry),G(j(n),{id:j(r).contentId,"aria-labelledby":j(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!j(r).modal.value||a)&&(i.value=!0),j(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Sy=P({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=Nm(t);return Rm(),(e,t)=>(R(),B(j(ey),xe(gs({...n,...j(r)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Cy=P({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(oy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),wy=P({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(sy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Ty=P({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(cy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Ey=P({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=vy(),{forwardRef:r,currentElement:i}=Rm();return Ki(()=>{n.triggerElement=i}),n.triggerId||=ah(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(R(),B(j(Hv),{"as-child":``},{default:M(()=>[H(j(gh),{id:j(n).triggerId,ref:j(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":j(n).open.value,"aria-controls":j(n).open.value?j(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":j(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(j(n)?.onOpenToggle(),await er(),j(n).open.value&&t.preventDefault())},onKeydown:i[1]||=Xl(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&j(n).onOpenToggle(),t.key===`ArrowDown`&&j(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Dy=P({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(gh),G(t,{onMousedown:n[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Oy=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ky=[` `,`Enter`];function Ay(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>jy(e,t,n)):jy(e,t,n)}function jy(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Ip(e,t)}function My(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Ny={key:0,value:``},[Py,Fy]=Rp(`SelectRoot`),Iy=P({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=xn(n),c=_m(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=A(),d=A(),f=A({x:0,y:0}),p=K(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Vp(c.value));ug({isProvider:!0});let m=Mm(s),h=Lm(u),g=A(new Set),_=K(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>jy(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Ay(e,t.value,n.by))}return Fy({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{modelValue:j(c),open:j(l)}),j(h)&&e.name?(R(),B(Ly,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:j(o),required:j(i),name:e.name,autocomplete:e.autocomplete,disabled:j(a),value:j(c)},{default:M(()=>[j(Vp)(j(c))?(R(),z(`option`,Ny)):W(`v-if`,!0),(R(!0),z(L,null,F(Array.from(g.value),e=>(R(),z(`option`,G({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):W(`v-if`,!0)]),_:3}))}}),Ly=P({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=A(),r=Py();N(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(R(),B(j(dg),{"as-child":``},{default:M(()=>[V(`select`,G({ref_key:`selectElement`,ref:n},t,{onInput:i}),[I(e.$slots,`default`)],16)]),_:3}))}}),Ry=P({__name:`SelectPopperPosition`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=zm(e);return(e,n)=>(R(),B(j(Iv),G(j(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),zy={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[By,Vy]=Rp(`SelectContent`),Hy=P({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Py();Fm(),km(n.bodyLock);let{CollectionSlot:a,getItems:o}=ug(),s=A();rh(s);let{search:c,handleTypeaheadSearch:l}=ch(),u=A(),d=A(),f=A(),p=A(!1),m=A(!1),h=A(!1);function g(){d.value&&s.value&&Yh([d.value,s.value])}N(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;Tr(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Yh(t)),e.preventDefault()}}let b=zm(K(()=>n.position===`popper`?n:{}).value);return Vy({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=Ay(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else (a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(Ay(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(R(),B(j(a),null,{default:M(()=>[H(j(Hh),{"as-child":``,onMountAutoFocus:t[6]||=q(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(j(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=q(()=>{},[`prevent`]),onDismiss:t[3]||=e=>j(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:M(()=>[(R(),B(aa(e.position===`popper`?Ry:Gy),G({...e.$attrs,...j(b)},{id:j(i).contentId,ref:e=>{if(!e)return;let t=j(lm)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":j(i).open.value?`open`:`closed`,dir:j(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=q(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[Uy,Wy]=Rp(`SelectItemAlignedPosition`),Gy=P({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=ug(),a=Py(),o=By(),s=A(!1),c=A(!0),l=A(),{forwardRef:u,currentElement:d}=Rm(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=Lp(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=Lp(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),ee=e.top+e.height/2-10,E=u-ee,te=p.value.offsetHeight/2,ne=p.value.offsetTop+te,re=_+v+ne,ie=x-re;if(re<=ee){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=re+Math.max(E,te+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(ee,_+f.value.offsetTop+(e?w:0)+te)+ie;l.value.style.height=`${t}px`,f.value.scrollTop=re-ee+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=A(``);Ki(async()=>{await er(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return gm(a.triggerElement,()=>{g()}),Wy({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(R(),z(`div`,{ref_key:`contentWrapperElement`,ref:l,style:ge({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[H(j(gh),G({ref:j(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)],4))}}),Ky=P({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return Fy(e.context),Vy(zy),(e,t)=>I(e.$slots,`default`)}}),qy={key:1},Jy=P({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t),i=Py(),a=A();Ki(()=>{a.value=new DocumentFragment});let o=A(),s=K(()=>n.forceMount||i.open.value),c=A(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return N(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),Xi(u),(e,t)=>s.value||c.value||o.value?.present?(R(),B(j(ph),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:M(()=>[H(Hy,xe(gs({...j(r),...e.$attrs})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(R(),z(`div`,qy,[(R(),B(Hr,{to:a.value},[H(Ky,{context:j(i)},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):W(`v-if`,!0)}}),Yy=P({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(R(),B(j(gh),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:M(()=>[I(e.$slots,`default`,{},()=>[t[0]||=U(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[Xy,Zy]=Rp(`SelectItem`),Qy=P({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=xn(n),a=Py(),o=By(),{forwardRef:s,currentElement:c}=Rm(),{CollectionItem:l}=ug(),u=K(()=>Ay(a.modelValue?.value,n.value,a.by)),d=A(!1),f=A(n.textValue??``),p=ah(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||Bp(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await er(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await er(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await er(),!e.defaultPrevented&&e.currentTarget===zp()&&o.onItemLeave?.()}async function v(e){await er(),!e.defaultPrevented&&(o.searchRef?.value!==``&&e.key===` `||(ky.includes(e.key)&&m(e),e.key===` `&&e.preventDefault()))}if(n.value===``)throw Error(`A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Ki(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),Zy({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(R(),B(j(l),{value:{textValue:f.value}},{default:M(()=>[H(j(gh),{ref:j(s),role:`option`,"aria-labelledby":j(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":j(i)||void 0,"data-disabled":j(i)?``:void 0,tabindex:j(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=q(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),$y=P({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Xy();return(e,r)=>j(n).isSelected.value?(R(),B(j(gh),G({key:0,"aria-hidden":`true`},t),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):W(`v-if`,!0)}}),eb=P({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Py(),r=By(),i=Xy(),{forwardRef:a,currentElement:o}=Rm(),s=K(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??``}));return Ki(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(s.value))}),Xi(()=>{n.onOptionRemove(s.value)}),(e,n)=>(R(),B(j(gh),G({id:j(i).textId,ref:j(a)},{...t,...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),tb=P({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),nb=P({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Py(),{forwardRef:r,currentElement:i}=Rm(),a=K(()=>n.disabled?.value||t.disabled);n.contentId||=ah(void 0,`reka-select-content`),Ki(()=>{n.onTriggerChange(i.value)});let{getItems:o}=ug(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=ch();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}return(e,t)=>(R(),B(j(wg),{"as-child":``,reference:e.reference},{default:M(()=>[H(j(gh),{ref:j(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":j(n).contentId,"aria-expanded":j(n).open.value||!1,"aria-required":j(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:j(n)?.dir.value,"data-state":j(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":j(My)(j(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:t[0]||=e=>{(e?.currentTarget)?.focus()},onPointerdown:t[1]||=e=>{if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(d(e),e.preventDefault())},onPointerup:t[2]||=q(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[3]||=e=>{let t=j(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(j(c)(e.key,j(o)()),j(Oy).includes(e.key)&&(u(),e.preventDefault()))}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),rb=P({__name:`SelectValue`,props:{placeholder:{type:String,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Rm(),i=Py();Ki(()=>{i.valueElement=r});let a=K(()=>{let e=[],t=Array.from(i.optionsSet.value),n=e=>t.find(t=>Ay(e,t.value,i.by));return e=Array.isArray(i.modelValue.value)?i.modelValue.value.map(e=>n(e)?.textContent??``):[n(i.modelValue.value)?.textContent??``],e.filter(Boolean)}),o=K(()=>a.value.length?a.value.join(`, `):t.placeholder);return(e,r)=>(R(),B(j(gh),{ref:j(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`},"data-placeholder":a.value.length?void 0:t.placeholder},{default:M(()=>[I(e.$slots,`default`,{selectedLabel:a.value,modelValue:j(i).modelValue.value},()=>[U(k(o.value),1)])]),_:3},8,[`as`,`as-child`,`data-placeholder`]))}}),ib=P({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=xn(t),r=Lv(n),i=By(),a=i.position===`item-aligned`?Uy():void 0,{forwardRef:o,currentElement:s}=Rm();Ki(()=>{i?.onViewportChange(s.value)});let c=A(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o<n){let i=o+e,a=Math.min(n,i),s=i-a;r.value.style.height=`${a}px`,r.value.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(R(),z(L,null,[H(j(gh),G({ref:j(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16),H(j(gh),{as:`style`,nonce:j(r)},{default:M(()=>n[0]||=[U(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[ab,ob]=Rp(`SwitchRoot`),sb=P({__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=xn(n),a=_m(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),o=K(()=>a.value===n.trueValue);function s(){i.value||(a.value=o.value?n.falseValue:n.trueValue)}let{forwardRef:c,currentElement:l}=Rm(),u=Lm(l),d=K(()=>n.id&&l.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return ob({checked:o,toggleCheck:s,disabled:i}),(e,t)=>(R(),B(j(gh),G(e.$attrs,{id:e.id,ref:j(c),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||d.value,"aria-checked":o.value,"aria-required":e.required,"data-state":o.value?`checked`:`unchecked`,"data-disabled":j(i)?``:void 0,"as-child":e.asChild,as:e.as,disabled:j(i),onClick:s,onKeydown:Xl(q(s,[`prevent`]),[`enter`])}),{default:M(()=>[I(e.$slots,`default`,{modelValue:j(a),checked:o.value}),j(u)&&e.name?(R(),B(j(pg),{key:0,type:`checkbox`,name:e.name,disabled:j(i),required:e.required,value:e.value,checked:o.value},null,8,[`name`,`disabled`,`required`,`value`,`checked`])):W(`v-if`,!0)]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]))}}),cb=P({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=ab();return Rm(),(e,n)=>(R(),B(j(gh),{"data-state":j(t).checked.value?`checked`:`unchecked`,"data-disabled":j(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),[lb,ub]=Rp(`TabsRoot`),db=P({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{orientation:i,unmountOnHide:a,dir:o}=xn(n),s=Mm(o);Rm();let c=_m(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),l=A(),u=fn(new Set);return ub({modelValue:c,changeModelValue:e=>{c.value=e},orientation:i,dir:s,unmountOnHide:a,activationMode:n.activationMode,baseId:ah(void 0,`reka-tabs`),tabsList:l,contentIds:u,registerContent:e=>{u.value=new Set([...u.value,e])},unregisterContent:e=>{let t=new Set(u.value);t.delete(e),u.value=t}}),(e,t)=>(R(),B(j(gh),{dir:j(s),"data-orientation":j(i),"as-child":e.asChild,as:e.as},{default:M(()=>[I(e.$slots,`default`,{modelValue:j(c)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function fb(e,t){return`${e}-trigger-${t}`}function pb(e,t){return`${e}-content-${t}`}var mb=P({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=xn(e),{forwardRef:n,currentElement:r}=Rm(),i=lb();return i.tabsList=r,(e,r)=>(R(),B(j(Bv),{"as-child":``,orientation:j(i).orientation.value,dir:j(i).dir.value,loop:j(t)},{default:M(()=>[H(j(gh),{ref:j(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":j(i).orientation.value},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),hb=P({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=Rm(),r=lb(),i=K(()=>fb(r.baseId,t.value)),a=K(()=>r.contentIds.value.has(t.value)?pb(r.baseId,t.value):void 0),o=K(()=>t.value===r.modelValue.value);return(e,t)=>(R(),B(j(Vv),{"as-child":``,focusable:!e.disabled,active:o.value},{default:M(()=>[H(j(gh),{id:i.value,ref:j(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":j(r).orientation.value,onMousedown:t[0]||=q(t=>{!e.disabled&&t.ctrlKey===!1?j(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=Xl(t=>j(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=j(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&j(r).changeModelValue(e.value)}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),[gb,_b]=Rp(`TooltipProvider`),vb=P({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=xn(e);Rm();let c=A(!0),l=A(!1),{start:u,stop:d}=om(()=>{c.value=!0},n,{immediate:!1});return _b({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>I(e.$slots,`default`)}}),yb=`tooltip.open`,[bb,xb]=Rp(`TooltipRoot`),Sb=P({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Rm();let i=gb(),a=K(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=K(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=K(()=>n.disabled??i.disabled.value),c=K(()=>n.delayDuration??i.delayDuration.value),l=K(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});N(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(yb))):i.onClose())});let d=A(!1),f=A(),p=K(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=om(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return xb({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{open:j(u)})]),_:3}))}}),Cb=P({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=bb(),a=gb(),{forwardRef:o,currentElement:s}=Rm(),c=K(()=>n.ariaLabel||s.value?.textContent),l=K(()=>{let{ariaLabel:e,...t}=n;return Dm(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return Ki(()=>{um(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),um(window,yb,i.onClose)}),(e,t)=>(R(),B(j(Oh),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{j(i).disableClosingTrigger.value&&j(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=q(()=>{},[`prevent`]),onDismiss:t[3]||=e=>j(i).onClose()},{default:M(()=>[H(j(Iv),G({ref:j(o),"data-state":j(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:M(()=>[I(e.$slots,`default`),H(j(dg),{id:j(i).contentId,role:`tooltip`},{default:M(()=>[U(k(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),wb=P({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=zm(e),{forwardRef:n,currentElement:r}=Rm(),{trigger:i,onClose:a}=bb(),o=gb(),{isPointerInTransit:s,onPointerExit:c}=Vm(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(R(),B(Cb,G({ref:j(n)},j(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Tb=P({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=bb(),a=Bm(n,r),{forwardRef:o}=Rm();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[(R(),B(aa(j(i).disableHoverableContent.value?Cb:wb),G({ref:j(o)},j(a)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Eb=P({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Db=P({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=bb(),r=gb();n.contentId||=ah(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Rm(),o=A(!1),s=A(!1),c=K(()=>n.disabled.value?{}:{click:h,focus:p,pointermove:d,pointerleave:f,pointerdown:u,blur:m});Ki(()=>{n.onTriggerChange(a.value)});function l(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener(`pointerup`,l,{once:!0})}function d(e){e.pointerType!==`touch`&&!s.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function f(){n.onTriggerLeave(),s.value=!1}function p(e){o.value||n.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||n.onOpen()}function m(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(R(),B(j(wg),{"as-child":``,reference:e.reference},{default:M(()=>[H(j(gh),G({ref:j(i),"aria-describedby":j(n).open.value?j(n).contentId:void 0,"data-state":j(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},da(c.value)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),Ob=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kb=(e,t)=>({classGroupId:e,validator:t}),Ab=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),jb=`-`,Mb=[],Nb=`arbitrary..`,Pb=e=>{let t=Lb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ib(e);let n=e.split(jb);return Fb(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ob(i,t):t:i||Mb}return n[e]||Mb}}},Fb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Fb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(jb):e.slice(t).join(jb),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ib=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Nb+r:void 0})(),Lb=e=>{let{theme:t,classGroups:n}=e;return Rb(n,t)},Rb=(e,t)=>{let n=Ab();for(let r in e){let i=e[r];zb(i,n,r,t)}return n},zb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Bb(i,t,n,r)}},Bb=(e,t,n,r)=>{if(typeof e==`string`){Vb(e,t,n);return}if(typeof e==`function`){Hb(e,t,n,r);return}Ub(e,t,n,r)},Vb=(e,t,n)=>{let r=e===``?t:Wb(t,e);r.classGroupId=n},Hb=(e,t,n,r)=>{if(Gb(e)){zb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kb(n,e))},Ub=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];zb(o,Wb(t,a),n,r)}},Wb=(e,t)=>{let n=e,r=t.split(jb),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ab(),n.nextPart.set(t,i)),n=i}return n},Gb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Kb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},qb=`!`,Jb=`:`,Yb=[],Xb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Zb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Jb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(qb)?(c=s.slice(0,-1),l=!0):s.startsWith(qb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Xb(t,l,c,u)};if(t){let e=t+Jb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Xb(Yb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Qb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},$b=e=>({cache:Kb(e.cacheSize),parseClassName:Zb(e),sortModifiers:Qb(e),postfixLookupClassGroupIds:ex(e),...Pb(e)}),ex=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},tx=/\s+/,nx=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(tx),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+qb:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},rx=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ix(n))&&(i&&(i+=` `),i+=r);return i},ix=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ix(e[r]))&&(n&&(n+=` `),n+=t);return n},ax=(e,...t)=>{let n,r,i,a,o=o=>(n=$b(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=nx(e,n);return i(e,a),a};return a=o,(...e)=>a(rx(...e))},ox=[],sx=e=>{let t=t=>t[e]||ox;return t.isThemeGetter=!0,t},cx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ux=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,px=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gx=e=>ux.test(e),_x=e=>!!e&&!Number.isNaN(Number(e)),vx=e=>!!e&&Number.isInteger(Number(e)),yx=e=>e.endsWith(`%`)&&_x(e.slice(0,-1)),bx=e=>dx.test(e),xx=()=>!0,Sx=e=>fx.test(e)&&!px.test(e),Cx=()=>!1,wx=e=>mx.test(e),Tx=e=>hx.test(e),Ex=e=>!X(e)&&!Z(e),Dx=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ox=e=>Ux(e,qx,Cx),X=e=>cx.test(e),kx=e=>Ux(e,Jx,Sx),Ax=e=>Ux(e,Yx,_x),jx=e=>Ux(e,Zx,xx),Mx=e=>Ux(e,Xx,Cx),Nx=e=>Ux(e,Gx,Cx),Px=e=>Ux(e,Kx,Tx),Fx=e=>Ux(e,Qx,wx),Z=e=>lx.test(e),Ix=e=>Wx(e,Jx),Lx=e=>Wx(e,Xx),Rx=e=>Wx(e,Gx),zx=e=>Wx(e,qx),Bx=e=>Wx(e,Kx),Vx=e=>Wx(e,Qx,!0),Hx=e=>Wx(e,Zx,!0),Ux=(e,t,n)=>{let r=cx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Wx=(e,t,n=!1)=>{let r=lx.exec(e);return r?r[1]?t(r[1]):n:!1},Gx=e=>e===`position`||e===`percentage`,Kx=e=>e===`image`||e===`url`,qx=e=>e===`length`||e===`size`||e===`bg-size`,Jx=e=>e===`length`,Yx=e=>e===`number`,Xx=e=>e===`family-name`,Zx=e=>e===`number`||e===`weight`,Qx=e=>e===`shadow`,$x=ax(()=>{let e=sx(`color`),t=sx(`font`),n=sx(`text`),r=sx(`font-weight`),i=sx(`tracking`),a=sx(`leading`),o=sx(`breakpoint`),s=sx(`container`),c=sx(`spacing`),l=sx(`radius`),u=sx(`shadow`),d=sx(`inset-shadow`),f=sx(`text-shadow`),p=sx(`drop-shadow`),m=sx(`blur`),h=sx(`perspective`),g=sx(`aspect`),_=sx(`ease`),v=sx(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[gx,`full`,`auto`,...w()],ee=()=>[vx,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,vx,Z,X]},vx,Z,X],te=()=>[vx,`auto`,Z,X],ne=()=>[`auto`,`min`,`max`,`fr`,Z,X],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[gx,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[gx,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[gx,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,Z,X],le=()=>[...b(),Rx,Nx,{position:[Z,X]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,zx,Ox,{size:[Z,X]}],fe=()=>[yx,Ix,kx],pe=()=>[``,`none`,`full`,l,Z,X],me=()=>[``,_x,Ix,kx],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[_x,yx,Rx,Nx],ve=()=>[``,`none`,m,Z,X],ye=()=>[`none`,_x,Z,X],be=()=>[`none`,_x,Z,X],O=()=>[_x,Z,X],xe=()=>[gx,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[bx],breakpoint:[bx],color:[xx],container:[bx],"drop-shadow":[bx],ease:[`in`,`out`,`in-out`],font:[Ex],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[bx],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[bx],shadow:[bx],spacing:[`px`,_x],text:[bx],"text-shadow":[bx],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,gx,X,Z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[Dx],columns:[{columns:[_x,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[vx,`auto`,Z,X]}],basis:[{basis:[gx,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[_x,gx,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,_x,Z,X]}],shrink:[{shrink:[``,_x,Z,X]}],order:[{order:[vx,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,Ix,kx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Hx,jx]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,yx,X]}],"font-family":[{font:[Lx,Mx,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[_x,`none`,Z,Ax]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[_x,`from-font`,`auto`,Z,kx]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[_x,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[vx,Z,X]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},vx,Z,X],radial:[``,Z,X],conic:[vx,Z,X]},Bx,Px]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[_x,Z,X]}],"outline-w":[{outline:[``,_x,Ix,kx]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,Vx,Fx]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,Vx,Fx]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[_x,kx]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,Vx,Fx]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[_x,Z,X]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[_x]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[_x]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:ve()}],brightness:[{brightness:[_x,Z,X]}],contrast:[{contrast:[_x,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Vx,Fx]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,_x,Z,X]}],"hue-rotate":[{"hue-rotate":[_x,Z,X]}],invert:[{invert:[``,_x,Z,X]}],saturate:[{saturate:[_x,Z,X]}],sepia:[{sepia:[``,_x,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[_x,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[_x,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,_x,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_x,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,_x,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[_x,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[_x,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,_x,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[_x,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[_x,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[vx,Z,X]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[_x,Ix,kx,Ax]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function eS(...e){return $x(Ap(e))}async function tS(e){if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-9999px;left:-9999px;opacity:0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}var Q=P({__name:`Button`,props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return(n,r)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,class:O(j(eS)(j(nS)({variant:e.variant,size:e.size}),t.class))},{default:M(()=>[I(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),nS=Np(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,destructive:`bg-destructive text-white hover:bg-destructive/90`},size:{sm:`h-8 rounded-md px-3 text-xs`,default:`h-9 px-4 py-2`,icon:`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),rS=P({__name:`Input`,props:ka({class:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Za(e,`modelValue`);return(e,n)=>vr((R(),z(`input`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,class:O(j(eS)(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e.$props.class))},null,2)),[[Fl,t.value]])}}),iS=P({__name:`SelectTrigger`,props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(nb),G(j(n),{class:j(eS)(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,t.class)}),{default:M(()=>[I(e.$slots,`default`),H(j(Yy),{"as-child":``},{default:M(()=>[H(j(Ou),{class:`size-4 opacity-50`})]),_:1})]),_:3},16,[`class`]))}}),aS=P({__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`popper`},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(t,i)=>(R(),B(j(tb),null,{default:M(()=>[H(j(Jy),G(j(r),{class:j(eS)(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,n.class)}),{default:M(()=>[H(j(ib),{class:O(j(eS)(`p-1`,e.position===`popper`&&`h-[var(--reka-select-trigger-height)] w-full min-w-[var(--reka-select-trigger-width)]`))},{default:M(()=>[I(t.$slots,`default`)]),_:3},8,[`class`])]),_:3},16,[`class`])]),_:3}))}}),oS={class:`absolute left-2 flex size-3.5 items-center justify-center`},sS=P({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(Qy),G(j(n),{class:j(eS)(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t.class)}),{default:M(()=>[V(`span`,oS,[H(j($y),null,{default:M(()=>[H(j(Du),{class:`size-4`})]),_:1})]),H(j(eb),null,{default:M(()=>[I(e.$slots,`default`)]),_:3})]),_:3},16,[`class`]))}}),cS=P({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(mb),G(t,{class:j(eS)(`inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),lS=P({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(hb),G(j(n),{class:j(eS)(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),uS=P({__name:`PopoverContent`,props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(gy),null,{default:M(()=>[H(j(hy),G(j(r),{class:j(eS)(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),dS=P({__name:`Badge`,props:{variant:{},class:{}},setup(e){return(t,n)=>(R(),z(`span`,{class:O(j(eS)(j(fS)({variant:e.variant}),t.$props.class))},[I(t.$slots,`default`)],2))}}),fS=Np(`inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground`,outline:`text-foreground`,destructive:`border-transparent bg-destructive text-white`,source:`border-transparent bg-state-source/15 text-state-source`,machine:`border-transparent bg-state-machine/15 text-state-machine`,reviewed:`border-transparent bg-state-reviewed/15 text-state-reviewed`,"needs-review":`border-transparent bg-state-needs-review/15 text-state-needs-review`}},defaultVariants:{variant:`default`}}),pS=P({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(sb),G(j(r),{class:j(eS)(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,n.class)}),{default:M(()=>[H(j(cb),{class:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`})]),_:1},16,[`class`]))}}),mS={class:`flex flex-col gap-3`},hS=[`aria-checked`,`onClick`],gS=[`aria-checked`],_S=[`aria-checked`,`disabled`],vS={key:0,class:`ml-[30px] text-[11px] text-muted-foreground`},yS=[`aria-checked`],bS={class:`border-t pt-2`},xS=[`aria-checked`,`onClick`],SS={class:`border-t pt-2`},CS=[`aria-checked`],wS={class:`border-t pt-2`},TS=[`aria-checked`,`disabled`,`onClick`],ES={class:`truncate`},DS=P({__name:`FilterMenu`,props:{states:{},issues:{},enabled:{},plurality:{},emptySource:{type:Boolean},aiContextUnreviewed:{type:Boolean},noUsages:{type:Boolean},skipTranslate:{type:Boolean},scanIndexed:{type:Boolean}},emits:[`update:states`,`update:issues`,`update:enabled`,`update:plurality`,`update:emptySource`,`update:aiContextUnreviewed`,`update:noUsages`,`update:skipTranslate`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>new Set(n.enabled));function a(e){r(`update:states`,n.states.includes(e)?n.states.filter(t=>t!==e):[...n.states,e])}function o(e){r(`update:plurality`,n.plurality.includes(e)?n.plurality.filter(t=>t!==e):[...n.plurality,e])}function s(e){i.value.has(e)&&r(`update:issues`,n.issues.includes(e)?n.issues.filter(t=>t!==e):[...n.issues,e])}function c(e,t){t?i.value.has(e)||r(`update:enabled`,[...n.enabled,e]):(r(`update:enabled`,n.enabled.filter(t=>t!==e)),n.issues.includes(e)&&r(`update:issues`,n.issues.filter(t=>t!==e)))}return(t,n)=>(R(),z(`div`,mS,[V(`div`,null,[n[7]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Status`,-1),(R(!0),z(L,null,F(j(ap),t=>(R(),z(`button`,{key:t,type:`button`,role:`checkbox`,"aria-checked":e.states.includes(t),class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:e=>a(t)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.states.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.states.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),U(` `+k(j(cp)[t]),1)],8,hS))),128)),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.emptySource,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[0]||=t=>r(`update:emptySource`,!e.emptySource)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.emptySource?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.emptySource?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[4]||=U(` Empty source `,-1)],8,gS),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.noUsages,disabled:!e.scanIndexed,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm enabled:hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50`,onClick:n[1]||=t=>r(`update:noUsages`,!e.noUsages)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.noUsages?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.noUsages?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[5]||=U(` Unused `,-1)],8,_S),e.scanIndexed?W(``,!0):(R(),z(`p`,vS,`Run a scan first`)),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.skipTranslate,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[2]||=t=>r(`update:skipTranslate`,!e.skipTranslate)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.skipTranslate?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.skipTranslate?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[6]||=U(` Skip-translate `,-1)],8,yS)]),V(`div`,bS,[n[8]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Type`,-1),(R(!0),z(L,null,F(j(op),t=>(R(),z(`button`,{key:t,type:`button`,role:`checkbox`,"aria-checked":e.plurality.includes(t),class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:e=>o(t)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.plurality.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.plurality.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),U(` `+k(j(lp)[t]),1)],8,xS))),128))]),V(`div`,SS,[n[10]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Context`,-1),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.aiContextUnreviewed,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[3]||=t=>r(`update:aiContextUnreviewed`,!e.aiContextUnreviewed)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.aiContextUnreviewed?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.aiContextUnreviewed?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),H(j(vd),{class:`size-3.5 text-muted-foreground`}),n[9]||=U(` AI context (unreviewed) `,-1)],8,CS)]),V(`div`,wS,[n[11]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Issues`,-1),n[12]||=V(`p`,{class:`mb-1.5 text-[11px] text-muted-foreground`},`Toggle a check to run it; tick its box to filter by it.`,-1),(R(!0),z(L,null,F(j(rp),t=>(R(),z(`div`,{key:t,class:`flex items-center gap-2 py-0.5`},[V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.issues.includes(t),class:`flex min-w-0 flex-1 items-center gap-2 rounded px-1.5 py-1 text-sm disabled:opacity-50 enabled:hover:bg-accent`,disabled:!i.value.has(t),onClick:e=>s(t)},[V(`span`,{class:O([`flex size-4 shrink-0 items-center justify-center rounded border transition-colors`,e.issues.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.issues.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),V(`span`,ES,k(j(sp)[t]),1)],8,TS),H(j(pS),{"model-value":i.value.has(t),"aria-label":`Enable ${j(sp)[t]} check`,"onUpdate:modelValue":e=>c(t,e)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])]))),128))])]))}}),OS={class:`pointer-events-none fixed bottom-4 right-4 z-[200] flex w-80 flex-col gap-2`},kS=[`onClick`],AS=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(P({__name:`Toaster`,setup(e){let t=FS();return(e,n)=>(R(),B(Hr,{to:`body`},[V(`div`,OS,[H(wl,{name:`toast`},{default:M(()=>[(R(!0),z(L,null,F(j(t).toasts,e=>(R(),z(`button`,{key:e.id,type:`button`,class:O(j(eS)(`pointer-events-auto flex items-center rounded-md border bg-card px-4 py-3 text-left text-sm text-card-foreground shadow-lg`,e.variant===`success`&&`border-state-reviewed/50 text-state-reviewed`,e.variant===`error`&&`border-destructive/50 text-destructive`)),onClick:t=>j(PS)(e.id)},k(e.message),11,kS))),128))]),_:1})])]))}}),[[`__scopeId`,`data-v-e9967100`]]),jS=Zt({toasts:[]}),MS=0;function NS(e,t,n=4e3){let r=MS++;jS.toasts.push({id:r,message:e,variant:t}),window.setTimeout(()=>PS(r),n)}function PS(e){let t=jS.toasts.findIndex(t=>t.id===e);t!==-1&&jS.toasts.splice(t,1)}var $=Object.assign(e=>NS(e,`default`),{success:e=>NS(e,`success`),error:e=>NS(e,`error`),info:e=>NS(e,`default`)});function FS(){return jS}var IS=P({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Dy),{for:t.for,class:O(j(eS)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`for`,`class`]))}}),LS=P({__name:`DialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(sg),null,{default:M(()=>[H(j(ag),{class:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),H(j(ng),G(j(r),{class:j(eS)(`fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,n.class)}),{default:M(()=>[I(e.$slots,`default`),H(j(xh),{class:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`},{default:M(()=>[H(j(kd),{class:`size-4`}),t[0]||=V(`span`,{class:`sr-only`},`Close`,-1)]),_:1})]),_:3},16,[`class`])]),_:3}))}}),RS=P({__name:`DialogHeader`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`div`,{class:O(j(eS)(`flex flex-col gap-1.5 text-center sm:text-left`,e.$props.class))},[I(e.$slots,`default`)],2))}}),zS=P({__name:`DialogFooter`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`div`,{class:O(j(eS)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e.$props.class))},[I(e.$slots,`default`)],2))}}),BS=P({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(cg),{class:O(j(eS)(`text-lg font-semibold leading-none tracking-tight`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),VS=P({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(rg),{class:O(j(eS)(`text-sm text-muted-foreground`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),HS=P({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(wy),null,{default:M(()=>[H(j(xy),G(j(r),{class:j(eS)(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),US=P({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(Sy),G(j(n),{class:j(eS)(`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),WS=P({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Cy),{class:O(j(eS)(`px-2 py-1.5 text-sm font-semibold`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),GS=P({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Ty),{class:O(j(eS)(`-mx-1 my-1 h-px bg-border`,t.class))},null,8,[`class`]))}}),KS={class:`flex flex-wrap items-center gap-2`},qS={class:`grid gap-2`},JS={class:`flex flex-wrap gap-2`},YS=P({__name:`SelectionBar`,props:{keys:{},locales:{},scopeLabel:{},tagsOnSelection:{}},emits:[`changed`,`clear`,`translate`,`build-context`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A(!1),o=A(!1),s=A(!1),c=A(!1),l=A(``);N(s,e=>{e||(l.value=``)});async function u(e,t,n=!1){i.value=!0;try{await e(),$.success(t),r(`changed`),n&&r(`clear`),a.value=!1,o.value=!1,s.value=!1,c.value=!1}catch(e){$.error(e.message||`Bulk action failed`)}finally{i.value=!1}}let d=()=>u(()=>Pd(n.keys,n.locales),`Cleared translations for ${n.keys.length} key${n.keys.length===1?``:`s`}`),f=()=>u(()=>Fd(n.keys),`Deleted ${n.keys.length} key${n.keys.length===1?``:`s`}`,!0),p=e=>u(()=>Id(n.keys,n.locales,e),`Marked ${n.keys.length} key${n.keys.length===1?``:`s`} ${e}`),m=e=>u(()=>Ld(n.keys,{skipTranslate:e}),e?`Marked skip-translate`:`Cleared skip-translate`),h=()=>u(()=>Ld(n.keys,{clearContext:!0}),`Cleared context for ${n.keys.length} key${n.keys.length===1?``:`s`}`),g=()=>{let e=l.value.trim();if(!(!e||i.value))return u(()=>Ld(n.keys,{addTags:[e]}),`Added tag "${e}"`).then(()=>l.value=``)},_=e=>u(()=>Ld(n.keys,{removeTags:[e]}),`Removed tag "${e}"`);return(t,n)=>(R(),z(`div`,KS,[H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-clear-trigger`,disabled:i.value||!e.keys.length,onClick:n[0]||=e=>a.value=!0},{default:M(()=>[H(j(Ru),{class:`size-4`}),n[19]||=U(` Clear translations `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-translate`,disabled:i.value||!e.keys.length,onClick:n[1]||=e=>r(`translate`)},{default:M(()=>[H(j(vd),{class:`size-4`}),n[20]||=U(` Translate `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-build-context`,disabled:i.value||!e.keys.length,onClick:n[2]||=e=>r(`build-context`)},{default:M(()=>[H(j(Od),{class:`size-4`}),n[21]||=U(` Build context `,-1)]),_:1},8,[`disabled`]),H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-set-trigger`,disabled:i.value||!e.keys.length},{default:M(()=>[n[22]||=U(` Set `,-1),H(j(Ou),{class:`size-4`})]),_:1},8,[`disabled`])]),_:1}),H(j(HS),{align:`end`,class:`w-52`},{default:M(()=>[H(j(WS),null,{default:M(()=>[U(`Status · `+k(e.scopeLabel),1)]),_:1}),H(j(US),{"data-testid":`bulk-mark-reviewed`,onSelect:n[3]||=e=>p(`reviewed`)},{default:M(()=>[...n[23]||=[U(`Mark reviewed`,-1)]]),_:1}),H(j(US),{"data-testid":`bulk-mark-needs-review`,onSelect:n[4]||=e=>p(`needs-review`)},{default:M(()=>[...n[24]||=[U(`Mark needs-review`,-1)]]),_:1}),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[25]||=[U(`Tags · key`,-1)]]),_:1}),H(j(US),{onSelect:n[5]||=e=>s.value=!0},{default:M(()=>[...n[26]||=[U(`Add tag…`,-1)]]),_:1}),H(j(US),{disabled:!e.tagsOnSelection.length,onSelect:n[6]||=e=>c.value=!0},{default:M(()=>[...n[27]||=[U(`Remove tag…`,-1)]]),_:1},8,[`disabled`]),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[28]||=[U(`Context · key`,-1)]]),_:1}),H(j(US),{onSelect:h},{default:M(()=>[...n[29]||=[U(`Clear context`,-1)]]),_:1}),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[30]||=[U(`Translation · key`,-1)]]),_:1}),H(j(US),{onSelect:n[7]||=e=>m(!0)},{default:M(()=>[...n[31]||=[U(`Skip translate`,-1)]]),_:1}),H(j(US),{onSelect:n[8]||=e=>m(!1)},{default:M(()=>[...n[32]||=[U(`Don't skip`,-1)]]),_:1})]),_:1})]),_:1}),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5 text-destructive hover:bg-destructive/10 hover:text-destructive`,"data-testid":`bulk-delete-trigger`,disabled:i.value||!e.keys.length,onClick:n[9]||=e=>o.value=!0},{default:M(()=>[H(j(wd),{class:`size-4`}),n[33]||=U(` Delete `,-1)]),_:1},8,[`disabled`]),H(j(bh),{open:a.value,"onUpdate:open":n[11]||=e=>a.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[34]||=[U(`Clear translations`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(` Clear translations for `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+` in `+k(e.scopeLabel)+`? Source strings are kept. This cannot be undone. `,1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[10]||=e=>a.value=!1},{default:M(()=>[...n[35]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:i.value,"data-testid":`bulk-clear-confirm`,onClick:d},{default:M(()=>[...n[36]||=[U(`Clear translations`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:o.value,"onUpdate:open":n[13]||=e=>o.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[37]||=[U(`Delete keys`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(` Delete `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+` and all their translations? This cannot be undone. `,1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[12]||=e=>o.value=!1},{default:M(()=>[...n[38]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:i.value,"data-testid":`bulk-delete-confirm`,onClick:f},{default:M(()=>[...n[39]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:s.value,"onUpdate:open":n[16]||=e=>s.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[40]||=[U(`Add tag`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(`Add a tag to `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+`.`,1)]),_:1})]),_:1}),V(`div`,qS,[H(j(IS),{for:`bulk-add-tag`},{default:M(()=>[...n[41]||=[U(`Tag`,-1)]]),_:1}),H(j(rS),{id:`bulk-add-tag`,modelValue:l.value,"onUpdate:modelValue":n[14]||=e=>l.value=e,disabled:i.value,onKeydown:Xl(q(g,[`prevent`]),[`enter`])},null,8,[`modelValue`,`disabled`,`onKeydown`])]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[15]||=e=>s.value=!1},{default:M(()=>[...n[42]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:i.value||!l.value.trim(),onClick:g},{default:M(()=>[...n[43]||=[U(`Add`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:c.value,"onUpdate:open":n[18]||=e=>c.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[44]||=[U(`Remove tag`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...n[45]||=[U(`Remove a tag from the selected keys.`,-1)]]),_:1})]),_:1}),V(`div`,JS,[(R(!0),z(L,null,F(e.tagsOnSelection,e=>(R(),B(j(Q),{key:e,variant:`outline`,size:`sm`,disabled:i.value,onClick:t=>_(e)},{default:M(()=>[U(k(e),1)]),_:2},1032,[`disabled`,`onClick`]))),128))]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[17]||=e=>c.value=!1},{default:M(()=>[...n[46]||=[U(`Close`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]))}});function XS(){let e=A(new Set),t=null;function n(t){return e.value.has(t)}function r(n){e.value.has(n)?e.value.delete(n):e.value.add(n),t=n}function i(n,i){if(t===null)return r(n);let a=i.indexOf(t),o=i.indexOf(n);if(a===-1||o===-1)return r(n);let[s,c]=a<o?[a,o]:[o,a];for(let t=s;t<=c;t++)e.value.add(i[t]);t=n}function a(n){for(let t of n)e.value.add(t);t=n.length?n[n.length-1]:null}function o(){e.value.clear(),t=null}function s(n){let r=new Set(n);for(let t of[...e.value])r.has(t)||e.value.delete(t);t!==null&&!r.has(t)&&(t=null)}return{has:n,toggle:r,toggleRange:i,selectAll:a,clear:o,pruneTo:s,keys:()=>[...e.value],count:K(()=>e.value.size),allSelected:t=>t.length>0&&t.every(t=>e.value.has(t)),someSelected:t=>t.some(t=>e.value.has(t))}}var ZS=P({__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(Eb),null,{default:M(()=>[H(j(Tb),G(j(r),{class:j(eS)(`z-50 overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-xs text-background shadow-md data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),QS=[`zero`,`one`,`two`,`few`,`many`,`other`];function $S(e){let t;try{t=new Intl.PluralRules(e.replace(/_/g,`-`),{type:`cardinal`}).resolvedOptions().pluralCategories}catch{t=[`other`]}let n=new Set(t);return QS.filter(e=>n.has(e))}function eC(e,t,n){if(t===n)return!1;let r=e.values[n];if(e.plural){if(!r?.forms?.other)return!1;let n=e.values[t]?.forms??{};return $S(t).some(e=>(n[e]??``)===``)}return r?.value?!e.values[t]?.value:!1}function tC(e,t,n){return t.filter(t=>eC(e,t,n))}function nC(e,t,n){return t.filter(t=>{if(t===n)return!1;let r=e.values[t];return!r||r.state!==`needs-review`?!1:r.value?r.value.length>0:Object.keys(r.forms??{}).length>0})}var rC=new Intl.DisplayNames([`en`],{type:`language`}),iC=new Map;function aC(e){if(!iC.has(e)){let t;try{t=new Intl.DisplayNames([e],{type:`language`}).of(e)??void 0}catch{t=void 0}iC.set(e,t)}return iC.get(e)}function oC(e){return e.split(`-`).slice(1).some(e=>/^[a-zA-Z]{5,8}$/.test(e)||/^[0-9][a-zA-Z0-9]{3}$/.test(e))}var sC=new Set([`ar`,`he`,`iw`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`,`ks`,`nqo`,`rhg`]);function cC(e){let t=e.split(/[-_]/)[0]?.toLowerCase()??``;return sC.has(t)}function lC(e,t){let n=e.replace(/_/g,`-`),r=n,i=!1;try{r=Intl.getCanonicalLocales(n)[0]??n,oC(r)&&(i=!0)}catch{i=!0}let a=e;t?.name===void 0?i||(a=rC.of(r)??e):a=t.name;let o;return o=t&&t.flag!==void 0?t.flag:i?null:r===`en`?`en`:new Intl.Locale(r).maximize().region??null,{code:e,bcp47:r,name:a,endonym:i?void 0:aC(r),flagRegion:o,isCustom:i,rtl:cC(e)}}var uC=[`aria-label`],dC=`inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11.5px] font-medium leading-none whitespace-nowrap min-w-[132px]`,fC=P({__name:`StateBadge`,props:{state:{},editable:{type:Boolean}},emits:[`setState`],setup(e,{emit:t}){let n=e,r=t,i=[`machine`,`reviewed`,`needs-review`],a={source:`Source`,machine:`Machine`,reviewed:`Reviewed`,"needs-review":`Needs review`},o={source:`bg-accent text-muted-foreground border-border-soft`,machine:`bg-machine-soft text-machine border-transparent`,reviewed:`bg-review-soft text-review border-transparent`,"needs-review":`bg-muted text-muted-foreground border-border`},s={source:`bg-muted-foreground`,machine:`bg-machine`,reviewed:`bg-review`,"needs-review":`bg-muted-foreground`};return(t,c)=>!e.editable||e.state===`source`?(R(),z(`span`,{key:0,class:O(j(eS)(dC,o[e.state],`cursor-default`)),"data-testid":`state-badge`},[e.state===`reviewed`?(R(),B(j(Du),{key:0,class:`size-3 shrink-0`})):(R(),z(`span`,{key:1,class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e.state]))},null,2)),U(` `+k(a[e.state]),1)],2)):(R(),B(j(by),{key:1},{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:O(j(eS)(dC,o[e.state],`transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`)),"aria-label":`${a[e.state]} — change state`,"data-testid":`state-badge`},[e.state===`reviewed`?(R(),B(j(Du),{key:0,class:`size-3 shrink-0`})):(R(),z(`span`,{key:1,class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e.state]))},null,2)),U(` `+k(a[e.state])+` `,1),H(j(Ou),{class:`ml-auto size-3 opacity-50`})],10,uC)]),_:1}),H(j(HS),{align:`end`,class:`min-w-[10rem]`},{default:M(()=>[(R(),z(L,null,F(i,e=>H(j(US),{key:e,onSelect:t=>r(`setState`,e)},{default:M(()=>[V(`span`,{class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e]))},null,2),U(` `+k(a[e])+` `,1),H(j(Du),{class:O(j(eS)(`ml-auto size-4`,e===n.state?`opacity-100`:`opacity-0`))},null,8,[`class`])]),_:2},1032,[`onSelect`])),64))]),_:1})]),_:1}))}}),pC=new RegExp([`\\{\\s*[A-Za-z0-9_]+\\s*,\\s*(?:plural|select|selectordinal)\\s*,(?:[^{}]|\\{[^{}]*\\})*\\}`,`\\{\\s*[A-Za-z0-9_.]+\\s*\\}`].join(`|`),`g`);function mC(e){let t=[];if(!e.includes(`'`))return t;for(let n=0;n<e.length;){if(e[n]===`'`){let r=e[n+1];if(r===`'`){n+=2;continue}if(r===`{`||r===`}`||r===`#`||r===`|`){let r=n;for(n+=2;n<e.length&&e[n]!==`'`;)n++;let i=n<e.length?n+1:n;t.push([r,i]),n=i;continue}}n++}return t}function hC(e){if(!e)return[];let t=mC(e),n=e=>t.some(([t,n])=>e>=t&&e<n),r=[],i=0;pC.lastIndex=0;let a;for(;(a=pC.exec(e))!==null;){if(a[0].length===0){pC.lastIndex++;continue}n(a.index)||(a.index>i&&r.push({text:e.slice(i,a.index),placeholder:!1}),r.push({text:a[0],placeholder:!0}),i=a.index+a[0].length)}return i<e.length&&r.push({text:e.slice(i),placeholder:!1}),r}var gC=P({__name:`Textarea`,props:ka({class:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Za(e,`modelValue`);return(e,n)=>vr((R(),z(`textarea`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,class:O(j(eS)(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e.$props.class))},null,2)),[[Fl,t.value]])}}),_C={class:`min-w-0`},vC={key:0,class:`flex flex-col gap-1`},yC={class:`whitespace-pre-wrap break-words`},bC={key:0,class:`rounded bg-ph-bg px-1 font-mono text-[0.85em] font-semibold text-ph-fg`},xC=P({__name:`ValueEditor`,props:{keyName:{},locale:{},sourceLocale:{},value:{},maxLength:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A(``),o=A(!1),s=A(null),c=K(()=>n.locale===n.sourceLocale),l=K(()=>hC(n.value)),u=K(()=>n.maxLength!==void 0&&n.value.length>n.maxLength);function d(e){e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`)}async function f(){a.value=n.value,i.value=!0,await er();let e=s.value?.$el;e?.focus(),e?.select(),d(e)}function p(){i.value=!1}async function m(){if(!i.value)return;i.value=!1;let e=a.value;if(e!==n.value){o.value=!0;try{c.value?await Rd(n.keyName,{source:e}):await zd(n.keyName,n.locale,e),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`),r(`changed`)}finally{o.value=!1}}}return(t,n)=>(R(),z(`div`,_C,[i.value?(R(),z(`div`,vC,[H(j(gC),{ref_key:`textareaEl`,ref:s,modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e,rows:`1`,maxlength:e.maxLength,class:`max-w-[560px] resize-none rounded-lg border-2 border-primary text-sm shadow-[0_0_0_3px_var(--ring)]`,onInput:n[1]||=e=>d(e.target),onBlur:m,onKeydown:[Xl(q(p,[`prevent`]),[`escape`]),Xl(q(m,[`exact`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`maxlength`,`onKeydown`]),n[2]||=V(`span`,{class:`text-[10.5px] text-muted-foreground`},[V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`↵`),U(` save · `),V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`esc`),U(` cancel `)],-1)])):e.value?(R(),z(`button`,{key:1,type:`button`,class:O(j(eS)(`group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 -mx-2 -my-1 text-left text-sm leading-relaxed hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,u.value&&`text-destructive`)),onClick:q(f,[`stop`])},[V(`span`,yC,[(R(!0),z(L,null,F(l.value,(e,t)=>(R(),z(L,{key:t},[e.placeholder?(R(),z(`span`,bC,k(e.text),1)):(R(),z(L,{key:1},[U(k(e.text),1)],64))],64))),128))]),H(j(ad),{"aria-hidden":`true`,class:`size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-60`})],2)):(R(),z(`button`,{key:2,type:`button`,"data-testid":`empty-marker`,class:`group inline-flex items-center gap-1.5 rounded-md border border-dashed border-input px-2.5 py-1 text-[12.5px] font-medium italic text-muted-foreground transition-colors hover:border-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:q(f,[`stop`])},[n[3]||=U(` Empty `,-1),H(j(ad),{class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})]))]))}}),SC={class:`flex min-w-0 flex-col gap-2`},CC={class:`min-w-0 flex-1`},wC={key:0,class:`flex flex-col gap-1`},TC={class:`font-mono text-[10px] font-semibold uppercase tracking-wide text-primary`},EC=[`onClick`],DC={class:`whitespace-pre-wrap break-words`},OC={key:0,class:`rounded bg-ph-bg px-1 font-mono text-[0.85em] font-semibold text-ph-fg`},kC=[`onClick`],AC=P({__name:`PluralValueEditor`,props:{keyName:{},locale:{},sourceLocale:{},arg:{},forms:{},sourceForms:{},maxLength:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>n.locale===n.sourceLocale),a=K(()=>[...Object.keys(n.forms).filter(e=>/^=\d+$/.test(e)).sort((e,t)=>Number(e.slice(1))-Number(t.slice(1))),...$S(n.locale)]),o=A(null),s=A(``),c=A(!1),l=A(null);function u(e){l.value=e}function d(e){return n.forms[e]??``}function f(e){return hC(d(e))}function p(e){return n.maxLength!==void 0&&d(e).length>n.maxLength}function m(e){e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`)}async function h(e){s.value=d(e),o.value=e,await er();let t=l.value?.$el;t?.focus(),t?.select(),m(t)}function g(){o.value=null}async function _(){let e=o.value;if(!e)return;o.value=null;let t=s.value;if(t!==d(e)){c.value=!0;try{let i={};for(let[e,t]of Object.entries(n.forms))i[e]=t??``;i[e]=t,await Hd(n.keyName,n.locale,i),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`),r(`changed`)}finally{c.value=!1}}}return(t,n)=>(R(),z(`div`,SC,[(R(!0),z(L,null,F(a.value,t=>(R(),z(`div`,{key:t,"data-testid":`plural-field`,class:`flex items-start gap-2.5`},[V(`span`,{class:O(j(eS)(`mt-0.5 min-w-[46px] shrink-0 rounded border border-border px-1.5 py-1 text-center font-mono text-[9.5px] font-semibold uppercase tracking-wide text-muted-foreground`,!i.value&&!d(t)&&`opacity-55`))},k(t),3),V(`div`,CC,[o.value===t?(R(),z(`div`,wC,[V(`span`,TC,`Plural: `+k(t),1),H(j(gC),{ref_for:!0,ref:u,modelValue:s.value,"onUpdate:modelValue":n[0]||=e=>s.value=e,rows:`1`,maxlength:e.maxLength,class:`max-w-[560px] resize-none rounded-lg border-2 border-primary text-sm shadow-[0_0_0_3px_var(--ring)]`,onInput:n[1]||=e=>m(e.target),onBlur:_,onKeydown:[Xl(q(g,[`prevent`]),[`escape`]),Xl(q(_,[`exact`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`maxlength`,`onKeydown`]),n[2]||=V(`span`,{class:`text-[10.5px] text-muted-foreground`},[V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`↵`),U(` save · `),V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`esc`),U(` cancel `)],-1)])):d(t)?(R(),z(`button`,{key:1,type:`button`,class:O(j(eS)(`group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 -mx-2 -my-1 text-left text-sm leading-relaxed hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,p(t)&&`text-destructive`)),onClick:q(e=>h(t),[`stop`])},[V(`span`,DC,[(R(!0),z(L,null,F(f(t),(e,t)=>(R(),z(L,{key:t},[e.placeholder?(R(),z(`span`,OC,k(e.text),1)):(R(),z(L,{key:1},[U(k(e.text),1)],64))],64))),128))]),H(j(ad),{class:`size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})],10,EC)):(R(),z(`button`,{key:2,type:`button`,"data-testid":`empty-marker`,class:`group inline-flex items-center gap-1.5 rounded-md border border-dashed border-input px-2.5 py-1 text-[12.5px] font-medium italic text-muted-foreground transition-colors hover:border-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:q(e=>h(t),[`stop`])},[n[3]||=U(` Empty `,-1),H(j(ad),{class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})],8,kC))])]))),128))]))}}),jC=Object.assign({"./assets/flags/ad.svg":`/assets/ad-B18i8NGa.svg`,"./assets/flags/ae.svg":`/assets/ae-CZRtWSox.svg`,"./assets/flags/af.svg":`/assets/af-C77Rf6cE.svg`,"./assets/flags/ag.svg":`/assets/ag-C8MykuG2.svg`,"./assets/flags/ai.svg":`/assets/ai-Dmedkf4v.svg`,"./assets/flags/al.svg":`/assets/al-10QRkakw.svg`,"./assets/flags/am.svg":`/assets/am-DMt4_dd4.svg`,"./assets/flags/ao.svg":`/assets/ao-tXuRa6vm.svg`,"./assets/flags/aq.svg":`/assets/aq-CF5jO-0h.svg`,"./assets/flags/ar.svg":`/assets/ar-Be8Ju1cG.svg`,"./assets/flags/arab.svg":`/assets/arab-C4CYPgyC.svg`,"./assets/flags/as.svg":`/assets/as-Dekqy8Of.svg`,"./assets/flags/asean.svg":`/assets/asean-WMtZ-US_.svg`,"./assets/flags/at.svg":`/assets/at-DGA_6m5E.svg`,"./assets/flags/au.svg":`/assets/au-DAHDIuPI.svg`,"./assets/flags/aw.svg":`/assets/aw-W0PWLK5p.svg`,"./assets/flags/ax.svg":`/assets/ax-DvLIy84U.svg`,"./assets/flags/az.svg":`/assets/az-Bk-bYNxy.svg`,"./assets/flags/ba.svg":`/assets/ba-WdDiSMvP.svg`,"./assets/flags/bb.svg":`/assets/bb-DJxbaxmT.svg`,"./assets/flags/bd.svg":`/assets/bd-BF9t1-60.svg`,"./assets/flags/be.svg":`/assets/be-CLLkK3PN.svg`,"./assets/flags/bf.svg":`/assets/bf-YclsoDuF.svg`,"./assets/flags/bg.svg":`/assets/bg-GUQenraa.svg`,"./assets/flags/bh.svg":`/assets/bh-BQqEGq6F.svg`,"./assets/flags/bi.svg":`/assets/bi-CRmKY6RQ.svg`,"./assets/flags/bj.svg":`/assets/bj-14PhO9bM.svg`,"./assets/flags/bl.svg":`/assets/bl-4CI2YcwX.svg`,"./assets/flags/bm.svg":`/assets/bm-BeYgB2z9.svg`,"./assets/flags/bn.svg":`/assets/bn-B6T3O78g.svg`,"./assets/flags/bo.svg":`/assets/bo-CcUiMqkJ.svg`,"./assets/flags/bq.svg":`/assets/bq-BYpdxEeT.svg`,"./assets/flags/br.svg":`/assets/br-Cu5YU29T.svg`,"./assets/flags/bs.svg":`/assets/bs-7Gd_oriM.svg`,"./assets/flags/bt.svg":`/assets/bt-BTo4qm10.svg`,"./assets/flags/bv.svg":`/assets/bv-wM9JLv4R.svg`,"./assets/flags/bw.svg":`/assets/bw-n5ZaAnGL.svg`,"./assets/flags/by.svg":`/assets/by-C621sBpd.svg`,"./assets/flags/bz.svg":`/assets/bz-BCKHR4_q.svg`,"./assets/flags/ca.svg":`/assets/ca-PYUrLVUV.svg`,"./assets/flags/cc.svg":`/assets/cc-BNT6Xjzk.svg`,"./assets/flags/cd.svg":`/assets/cd-BGclsrP6.svg`,"./assets/flags/cefta.svg":`/assets/cefta-2dDBYygd.svg`,"./assets/flags/cf.svg":`/assets/cf-DRetLmp-.svg`,"./assets/flags/cg.svg":`/assets/cg-CwIyG6SE.svg`,"./assets/flags/ch.svg":`/assets/ch-sfriZoF1.svg`,"./assets/flags/ci.svg":`/assets/ci-C8Q8IYTn.svg`,"./assets/flags/ck.svg":`/assets/ck-DfXMUOTo.svg`,"./assets/flags/cl.svg":`/assets/cl-BgYYb4qP.svg`,"./assets/flags/cm.svg":`/assets/cm-D4yjdmKT.svg`,"./assets/flags/cn.svg":`/assets/cn-DifnnI3t.svg`,"./assets/flags/co.svg":`/assets/co-DV591zMm.svg`,"./assets/flags/cp.svg":`/assets/cp-K_ay05Q_.svg`,"./assets/flags/cr.svg":`/assets/cr-BlYVN-_Q.svg`,"./assets/flags/cu.svg":`/assets/cu-L6XVZNgo.svg`,"./assets/flags/cv.svg":`/assets/cv-CPsfcOfk.svg`,"./assets/flags/cw.svg":`/assets/cw-BbrnximR.svg`,"./assets/flags/cx.svg":`/assets/cx-DpYD6n6U.svg`,"./assets/flags/cy.svg":`/assets/cy-bZuP8hmf.svg`,"./assets/flags/cz.svg":`/assets/cz-WWBC5Aeb.svg`,"./assets/flags/de.svg":`/assets/de-B-2o-4Z9.svg`,"./assets/flags/dg.svg":`/assets/dg-CJPJrjiZ.svg`,"./assets/flags/dj.svg":`/assets/dj-hp_BwbmO.svg`,"./assets/flags/dk.svg":`/assets/dk-DmS9BCZB.svg`,"./assets/flags/dm.svg":`/assets/dm-Cbhezfe1.svg`,"./assets/flags/do.svg":`/assets/do-B86d445t.svg`,"./assets/flags/dz.svg":`/assets/dz-Dytc1TFu.svg`,"./assets/flags/eac.svg":`/assets/eac-CwGQsyAM.svg`,"./assets/flags/ec.svg":`/assets/ec-CaVOFQ3t.svg`,"./assets/flags/ee.svg":`/assets/ee-DufrxGIR.svg`,"./assets/flags/eg.svg":`/assets/eg-YC70hswZ.svg`,"./assets/flags/eh.svg":`/assets/eh-0awM4TVj.svg`,"./assets/flags/en.svg":`/assets/en-BZRN_IpI.svg`,"./assets/flags/er.svg":`/assets/er-X83uml6t.svg`,"./assets/flags/es-ct.svg":`/assets/es-ct-CVyhLp7O.svg`,"./assets/flags/es-ga.svg":`/assets/es-ga-D9xG2hYr.svg`,"./assets/flags/es-pv.svg":`/assets/es-pv-CO3NM2SE.svg`,"./assets/flags/es.svg":`/assets/es-d5m8M5h8.svg`,"./assets/flags/et.svg":`/assets/et-DwdlzOIx.svg`,"./assets/flags/eu.svg":`/assets/eu-Brdgz8ab.svg`,"./assets/flags/fi.svg":`/assets/fi-DWUIkfjL.svg`,"./assets/flags/fj.svg":`/assets/fj-DEAVMg38.svg`,"./assets/flags/fk.svg":`/assets/fk-nuUF_Ak3.svg`,"./assets/flags/fm.svg":`/assets/fm-B4Z83GL0.svg`,"./assets/flags/fo.svg":`/assets/fo-DFjwyWur.svg`,"./assets/flags/fr.svg":`/assets/fr-DVvUyOqI.svg`,"./assets/flags/ga.svg":`/assets/ga-BklUhLH_.svg`,"./assets/flags/gb-eng.svg":`/assets/gb-eng-C8iDhGHN.svg`,"./assets/flags/gb-nir.svg":`/assets/gb-nir-D4gikpNq.svg`,"./assets/flags/gb-sct.svg":`/assets/gb-sct-fW5q01ek.svg`,"./assets/flags/gb-wls.svg":`/assets/gb-wls-Bxz9hxvX.svg`,"./assets/flags/gb.svg":`/assets/gb-DTXiLQoe.svg`,"./assets/flags/gd.svg":`/assets/gd-CO-whzUe.svg`,"./assets/flags/ge.svg":`/assets/ge-B2RiL-Ih.svg`,"./assets/flags/gf.svg":`/assets/gf-DWl5zcw0.svg`,"./assets/flags/gg.svg":`/assets/gg-jdOQS2nU.svg`,"./assets/flags/gh.svg":`/assets/gh-r3LP_X7q.svg`,"./assets/flags/gi.svg":`/assets/gi-BJKE9SzW.svg`,"./assets/flags/gl.svg":`/assets/gl-CHaBnMib.svg`,"./assets/flags/gm.svg":`/assets/gm-Bu99atwn.svg`,"./assets/flags/gn.svg":`/assets/gn-1dJNy9oQ.svg`,"./assets/flags/gp.svg":`/assets/gp-DNyt_wTA.svg`,"./assets/flags/gq.svg":`/assets/gq-Cag8QTk2.svg`,"./assets/flags/gr.svg":`/assets/gr-C5PU0p9p.svg`,"./assets/flags/gs.svg":`/assets/gs-DiiNa0F5.svg`,"./assets/flags/gt.svg":`/assets/gt-CJo5DI-7.svg`,"./assets/flags/gu.svg":`/assets/gu-Di1JYREk.svg`,"./assets/flags/gw.svg":`/assets/gw-D249VY33.svg`,"./assets/flags/gy.svg":`/assets/gy-CcVYUM2E.svg`,"./assets/flags/hk.svg":`/assets/hk-CUNIaSX0.svg`,"./assets/flags/hm.svg":`/assets/hm-Dh6t_Tj3.svg`,"./assets/flags/hn.svg":`/assets/hn-CRjyS_bm.svg`,"./assets/flags/hr.svg":`/assets/hr-fzLfaANM.svg`,"./assets/flags/ht.svg":`/assets/ht-DIMg4gti.svg`,"./assets/flags/hu.svg":`/assets/hu-7Q5wwIIi.svg`,"./assets/flags/ic.svg":`/assets/ic-CSo4d8tH.svg`,"./assets/flags/id.svg":`/assets/id-DiSP6Fmm.svg`,"./assets/flags/ie.svg":`/assets/ie-ChAXClx3.svg`,"./assets/flags/il.svg":`/assets/il-_56OEGLa.svg`,"./assets/flags/im.svg":`/assets/im--VPIqfkF.svg`,"./assets/flags/in.svg":`/assets/in-Cdwu6Bq7.svg`,"./assets/flags/io.svg":`/assets/io-13HOfeJD.svg`,"./assets/flags/iq.svg":`/assets/iq-Dp8HDzo2.svg`,"./assets/flags/ir.svg":`/assets/ir-cCIgaNf6.svg`,"./assets/flags/is.svg":`/assets/is-CZjefTNV.svg`,"./assets/flags/it.svg":`/assets/it-Br7q0Zh6.svg`,"./assets/flags/je.svg":`/assets/je-DyWbhIiC.svg`,"./assets/flags/jm.svg":`/assets/jm-CItSr3iX.svg`,"./assets/flags/jo.svg":`/assets/jo-BAF1FGbm.svg`,"./assets/flags/jp.svg":`/assets/jp-BIMmfxpO.svg`,"./assets/flags/ke.svg":`/assets/ke-C8foqndp.svg`,"./assets/flags/kg.svg":`/assets/kg-B0FsxZiL.svg`,"./assets/flags/kh.svg":`/assets/kh-BeWfuE30.svg`,"./assets/flags/ki.svg":`/assets/ki-p_fAQGbS.svg`,"./assets/flags/km.svg":`/assets/km-B5tqtGG7.svg`,"./assets/flags/kn.svg":`/assets/kn-DVPxDkNY.svg`,"./assets/flags/kp.svg":`/assets/kp-CrDKzoxe.svg`,"./assets/flags/kr.svg":`/assets/kr-BCXH1Hao.svg`,"./assets/flags/kw.svg":`/assets/kw-fSBzmd30.svg`,"./assets/flags/ky.svg":`/assets/ky-Dpsu1myA.svg`,"./assets/flags/kz.svg":`/assets/kz-CwKXYZ8s.svg`,"./assets/flags/la.svg":`/assets/la-CuJflhIW.svg`,"./assets/flags/lb.svg":`/assets/lb-BSjpYEoo.svg`,"./assets/flags/lc.svg":`/assets/lc-CNvab8Ae.svg`,"./assets/flags/li.svg":`/assets/li-CHdhvNcr.svg`,"./assets/flags/lk.svg":`/assets/lk-DUkgV9Tq.svg`,"./assets/flags/lr.svg":`/assets/lr-B84vu3Ds.svg`,"./assets/flags/ls.svg":`/assets/ls-5Xk3Mxq5.svg`,"./assets/flags/lt.svg":`/assets/lt-DoukV-Sm.svg`,"./assets/flags/lu.svg":`/assets/lu-DOI02Msy.svg`,"./assets/flags/lv.svg":`/assets/lv-C-KfY8Yc.svg`,"./assets/flags/ly.svg":`/assets/ly-BWpTK3ux.svg`,"./assets/flags/ma.svg":`/assets/ma-BTRNTRUj.svg`,"./assets/flags/mc.svg":`/assets/mc-PK078JHl.svg`,"./assets/flags/md.svg":`/assets/md-DRlxvNwm.svg`,"./assets/flags/me.svg":`/assets/me-Cv4Gwqah.svg`,"./assets/flags/mf.svg":`/assets/mf-BaAGWwAq.svg`,"./assets/flags/mg.svg":`/assets/mg-C168LHXW.svg`,"./assets/flags/mh.svg":`/assets/mh-gxuIp6Wk.svg`,"./assets/flags/mk.svg":`/assets/mk-D9SIMr-a.svg`,"./assets/flags/ml.svg":`/assets/ml-DVf6ujpi.svg`,"./assets/flags/mm.svg":`/assets/mm-lwT09MQ0.svg`,"./assets/flags/mn.svg":`/assets/mn-CgXyw0O9.svg`,"./assets/flags/mo.svg":`/assets/mo-BAtCjuYA.svg`,"./assets/flags/mp.svg":`/assets/mp-CrOApEqW.svg`,"./assets/flags/mq.svg":`/assets/mq-BFnJ22KI.svg`,"./assets/flags/mr.svg":`/assets/mr-D6G1wpeZ.svg`,"./assets/flags/ms.svg":`/assets/ms-DxciGbUu.svg`,"./assets/flags/mt.svg":`/assets/mt-YqzKx9xl.svg`,"./assets/flags/mu.svg":`/assets/mu-mcq7cUFl.svg`,"./assets/flags/mv.svg":`/assets/mv-BynAllfM.svg`,"./assets/flags/mw.svg":`/assets/mw-C15nc1xZ.svg`,"./assets/flags/mx.svg":`/assets/mx-Cc8Ccfe8.svg`,"./assets/flags/my.svg":`/assets/my-Co4JeeyE.svg`,"./assets/flags/mz.svg":`/assets/mz-Drlr_USV.svg`,"./assets/flags/na.svg":`/assets/na-D79ffb4Z.svg`,"./assets/flags/nc.svg":`/assets/nc-5j7wEmDR.svg`,"./assets/flags/ne.svg":`/assets/ne-B1jPOYkl.svg`,"./assets/flags/nf.svg":`/assets/nf-Dl00mlk2.svg`,"./assets/flags/ng.svg":`/assets/ng-su4NM9If.svg`,"./assets/flags/ni.svg":`/assets/ni-CcFCSQxm.svg`,"./assets/flags/nl.svg":`/assets/nl-BnOa6UiA.svg`,"./assets/flags/no.svg":`/assets/no-qf2JPO73.svg`,"./assets/flags/np.svg":`/assets/np-CIuq5GKd.svg`,"./assets/flags/nr.svg":`/assets/nr-DERIdzkN.svg`,"./assets/flags/nu.svg":`/assets/nu-BfgWvGcd.svg`,"./assets/flags/nz.svg":`/assets/nz-5vODdBjz.svg`,"./assets/flags/om.svg":`/assets/om-DcqxRdQL.svg`,"./assets/flags/pa.svg":`/assets/pa-BLNN9G2-.svg`,"./assets/flags/pc.svg":`/assets/pc-BJpYiA9b.svg`,"./assets/flags/pe.svg":`/assets/pe-BLqhuu1C.svg`,"./assets/flags/pf.svg":`/assets/pf-C8ahG68q.svg`,"./assets/flags/pg.svg":`/assets/pg-BAYpbp9Z.svg`,"./assets/flags/ph.svg":`/assets/ph-BEzTn62K.svg`,"./assets/flags/pk.svg":`/assets/pk-CWMEc3ad.svg`,"./assets/flags/pl.svg":`/assets/pl-o38JROoc.svg`,"./assets/flags/pm.svg":`/assets/pm-CHiP5UmZ.svg`,"./assets/flags/pn.svg":`/assets/pn-DgxdtieE.svg`,"./assets/flags/pr.svg":`/assets/pr-B4tMV0xm.svg`,"./assets/flags/ps.svg":`/assets/ps-DO8YKYeS.svg`,"./assets/flags/pt.svg":`/assets/pt-DZ2ADgIR.svg`,"./assets/flags/pw.svg":`/assets/pw-CQP52WMX.svg`,"./assets/flags/py.svg":`/assets/py-mNzh0mZC.svg`,"./assets/flags/qa.svg":`/assets/qa-Dkmpc78M.svg`,"./assets/flags/re.svg":`/assets/re-Bk4ipYK1.svg`,"./assets/flags/ro.svg":`/assets/ro-CoSeqKY1.svg`,"./assets/flags/rs.svg":`/assets/rs-BfwKwXtn.svg`,"./assets/flags/ru.svg":`/assets/ru-D-4tNwXt.svg`,"./assets/flags/rw.svg":`/assets/rw-D7nbSYKI.svg`,"./assets/flags/sa.svg":`/assets/sa-Dh79zbT9.svg`,"./assets/flags/sb.svg":`/assets/sb-BDTYjcbk.svg`,"./assets/flags/sc.svg":`/assets/sc-CRNsSLg9.svg`,"./assets/flags/sd.svg":`/assets/sd-ClziNjGr.svg`,"./assets/flags/se.svg":`/assets/se-8C923vhy.svg`,"./assets/flags/sg.svg":`/assets/sg-DGYIMG0G.svg`,"./assets/flags/sh-ac.svg":`/assets/sh-ac-FjwY7RYr.svg`,"./assets/flags/sh-hl.svg":`/assets/sh-hl-CqtQPzWZ.svg`,"./assets/flags/sh-ta.svg":`/assets/sh-ta-CPJublpi.svg`,"./assets/flags/sh.svg":`/assets/sh-DNImvbrE.svg`,"./assets/flags/si.svg":`/assets/si-BMKT-Tec.svg`,"./assets/flags/sj.svg":`/assets/sj-BFFEGknm.svg`,"./assets/flags/sk.svg":`/assets/sk-K9BNIYAO.svg`,"./assets/flags/sl.svg":`/assets/sl-DxLJY5vJ.svg`,"./assets/flags/sm.svg":`/assets/sm-DGBIRFB_.svg`,"./assets/flags/sn.svg":`/assets/sn-S8ipNF1U.svg`,"./assets/flags/so.svg":`/assets/so-DlzA2Fco.svg`,"./assets/flags/sr.svg":`/assets/sr-Co7OKBh3.svg`,"./assets/flags/ss.svg":`/assets/ss-CxVEpdPD.svg`,"./assets/flags/st.svg":`/assets/st-C1Nd1c3V.svg`,"./assets/flags/sv.svg":`/assets/sv-CJIHhYwF.svg`,"./assets/flags/sx.svg":`/assets/sx-nDhIaDNb.svg`,"./assets/flags/sy.svg":`/assets/sy-DwSud114.svg`,"./assets/flags/sz.svg":`/assets/sz-qxMwa2gs.svg`,"./assets/flags/tc.svg":`/assets/tc-dtelpZmc.svg`,"./assets/flags/td.svg":`/assets/td-BsuVhZpT.svg`,"./assets/flags/tf.svg":`/assets/tf-Co33RhQH.svg`,"./assets/flags/tg.svg":`/assets/tg-CP1-sc35.svg`,"./assets/flags/th.svg":`/assets/th-tzq84hgd.svg`,"./assets/flags/tj.svg":`/assets/tj-b-aWfOTb.svg`,"./assets/flags/tk.svg":`/assets/tk-CDucsEss.svg`,"./assets/flags/tl.svg":`/assets/tl-wpo93AGk.svg`,"./assets/flags/tm.svg":`/assets/tm-C_WSgUcv.svg`,"./assets/flags/tn.svg":`/assets/tn-BcKCZULf.svg`,"./assets/flags/to.svg":`/assets/to-D8uVsoxb.svg`,"./assets/flags/tr.svg":`/assets/tr-Cd6FO9Bg.svg`,"./assets/flags/tt.svg":`/assets/tt-CTnr7aY5.svg`,"./assets/flags/tv.svg":`/assets/tv-DDqkVT-n.svg`,"./assets/flags/tw.svg":`/assets/tw-d-Mf-0VT.svg`,"./assets/flags/tz.svg":`/assets/tz-BjLtHeil.svg`,"./assets/flags/ua.svg":`/assets/ua-Bq0XgQqK.svg`,"./assets/flags/ug.svg":`/assets/ug-ByL2ejGl.svg`,"./assets/flags/um.svg":`/assets/um-Bhke9Eic.svg`,"./assets/flags/un.svg":`/assets/un-Bqg4Cbbh.svg`,"./assets/flags/us.svg":`/assets/us-C73uVeEr.svg`,"./assets/flags/uy.svg":`/assets/uy-DD6peej-.svg`,"./assets/flags/uz.svg":`/assets/uz-C2f-Cubn.svg`,"./assets/flags/va.svg":`/assets/va-B9-hqIE-.svg`,"./assets/flags/vc.svg":`/assets/vc-COpmFovN.svg`,"./assets/flags/ve.svg":`/assets/ve-BSqnIB9l.svg`,"./assets/flags/vg.svg":`/assets/vg-C7xY6pic.svg`,"./assets/flags/vi.svg":`/assets/vi-BC_zcciE.svg`,"./assets/flags/vn.svg":`/assets/vn-BEAEijd0.svg`,"./assets/flags/vu.svg":`/assets/vu-D6k0NQlg.svg`,"./assets/flags/wf.svg":`/assets/wf-DrxpOO_G.svg`,"./assets/flags/ws.svg":`/assets/ws-vzJNwdVm.svg`,"./assets/flags/xk.svg":`/assets/xk-Bj15g7cp.svg`,"./assets/flags/xx.svg":`/assets/xx-zm_JmrXl.svg`,"./assets/flags/ye.svg":`/assets/ye-BwST9gXC.svg`,"./assets/flags/yt.svg":`/assets/yt-DIfEG0ex.svg`,"./assets/flags/za.svg":`/assets/za-Jz40JTrv.svg`,"./assets/flags/zm.svg":`/assets/zm-BmsW91ne.svg`,"./assets/flags/zw.svg":`/assets/zw-U0m7oJ5e.svg`}),MC=new Map;for(let[e,t]of Object.entries(jC)){let n=e.match(/\/([^/]+)\.svg$/);n&&MC.set(n[1].toLowerCase(),t)}function NC(e){return MC.get(e.toLowerCase())}var PC=[`src`,`alt`,`width`,`height`],FC=P({__name:`Flag`,props:{code:{},override:{},size:{default:16}},setup(e){let t=e,n=K(()=>lC(t.code,t.override)),r=K(()=>n.value.flagRegion?NC(n.value.flagRegion):void 0),i=K(()=>Math.round(t.size*4/3));return(t,a)=>r.value?(R(),z(`img`,{key:0,src:r.value,alt:n.value.name,width:i.value,height:e.size,class:`inline-block shrink-0 rounded-[2px] object-cover ring-1 ring-black/10`,style:ge({width:`${i.value}px`,height:`${e.size}px`})},null,12,PC)):(R(),B(j(qu),{key:1,class:`inline-block shrink-0 text-muted-foreground`,style:ge({width:`${e.size}px`,height:`${e.size}px`}),"aria-hidden":`true`},null,8,[`style`]))}}),IC={class:`inline-flex min-w-0 items-start gap-2`},LC={class:`flex min-w-0 flex-col leading-tight`},RC={class:`flex items-center gap-1.5`},zC={class:`font-mono text-[11.5px] font-semibold tracking-wide`},BC={key:0,class:`truncate text-[11px] text-muted-foreground`},VC={class:`inline-flex min-w-0 items-center gap-1.5`},HC={key:0,class:`truncate`},UC=P({__name:`LanguageLabel`,props:{code:{},override:{},showName:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},size:{default:16},codeMinChars:{},layout:{default:`inline`}},setup(e){let t=e,n=K(()=>lC(t.code,t.override));return(t,r)=>e.layout===`stacked`?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,IC,[H(FC,{code:e.code,override:e.override,size:e.size,class:`mt-0.5 shrink-0`},null,8,[`code`,`override`,`size`]),V(`span`,LC,[V(`span`,RC,[V(`span`,zC,k(e.code.toUpperCase()),1),n.value.rtl?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[...r[0]||=[V(`span`,{class:`rounded border border-border px-1 text-[9px] font-bold uppercase tracking-wide text-muted-foreground`},`RTL`,-1)]]),_:1}),H(j(ZS),null,{default:M(()=>[...r[1]||=[U(`Right-to-left`,-1)]]),_:1})]),_:1})):W(``,!0)]),e.showName?(R(),z(`span`,BC,k(n.value.name),1)):W(``,!0)])])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(n.value.name),1)]),_:1})]),_:1})):(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,VC,[H(FC,{code:e.code,override:e.override,size:e.size},null,8,[`code`,`override`,`size`]),e.showName?(R(),z(`span`,HC,k(n.value.name),1)):W(``,!0),e.showCode?(R(),z(`span`,{key:1,class:`font-mono text-xs`,style:ge(e.codeMinChars==null?void 0:{minWidth:`${e.codeMinChars}ch`})},k(e.code.toUpperCase()),5)):W(``,!0)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(n.value.name),1)]),_:1})]),_:1}))}}),WC=[`data-state`],GC={class:`flex flex-wrap items-start gap-2 pt-0.5`},KC={key:0,class:`rounded-md border border-border-soft bg-accent px-1.5 py-0.5 text-[10.5px] font-semibold uppercase tracking-wide text-muted-foreground`},qC=[`dir`],JC={key:0,"data-testid":`filling-hint`,class:`flex items-center gap-1.5 text-sm italic text-muted-foreground`},YC={key:0,class:`flex items-center justify-end gap-1.5 pt-0.5`},XC={type:`button`,class:`flex size-7 items-center justify-center rounded-md bg-destructive-soft text-destructive transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Show issues`},ZC={class:`flex flex-col gap-1`},QC={key:0,class:`mt-2 border-t pt-2`},$C={class:`flex flex-wrap gap-1`},ew=[`onClick`],tw=[`disabled`],nw=P({__name:`TranslationRow`,props:{keyName:{},locale:{},sourceLocale:{},value:{},maxLength:{},issues:{},labelChars:{},plural:{},sourceForms:{},filling:{type:Boolean}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>n.locale===n.sourceLocale),a=K(()=>n.value?.state??(i.value?`source`:`needs-review`)),o=K(()=>n.value?.value??``),s=K(()=>!!n.plural),c=K(()=>n.value?.forms??{}),l=K(()=>cC(n.locale)),u=K(()=>!i.value&&(s.value?Object.keys(c.value).length>0:!!n.value?.value)),d=K(()=>(n.issues?.length??0)>0),f=K(()=>[...new Set((n.issues??[]).filter(e=>e.check===`spelling`).flatMap(e=>e.detail??[]))]);async function p(e){try{await lf(e),$.success(`Added "${e}" to the dictionary`),r(`changed`)}catch(e){$.error(`Could not add word: ${e.message}`)}}let m=A(!1);async function h(){try{await Vd(n.keyName,n.locale),$.success(`Cleared`),r(`changed`)}catch(e){$.error(e.message)}}async function g(e){try{await Bd(n.keyName,n.locale,e),r(`changed`)}catch(e){$.error(`Could not update state: ${e.message}`)}}async function _(){m.value=!0;try{let e=await Gd({onlyMissing:!1,locales:[n.locale],keyGlob:n.keyName,force:!0});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Translated ${n.locale.toUpperCase()} (${e.written} written)`),r(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{m.value=!1}}return(t,n)=>(R(),z(`div`,{class:O(j(eS)(`grid grid-cols-[172px_minmax(0,1fr)_232px] items-start gap-[18px] border-b border-border-soft py-[11px] pl-4 pr-[18px] last:border-b-0 max-[1080px]:grid-cols-[150px_minmax(0,1fr)_200px] max-[1080px]:gap-3`,i.value&&`bg-foreground/[0.015] dark:bg-foreground/[0.025]`)),"data-state":a.value},[V(`div`,GC,[H(UC,{code:e.locale,layout:`stacked`,"show-name":``,size:15},null,8,[`code`]),i.value?(R(),z(`span`,KC,`Source`)):W(``,!0)]),V(`div`,{class:`flex min-w-0 flex-col gap-2`,dir:l.value?`rtl`:`ltr`},[e.filling?(R(),z(`div`,JC,[H(j($u),{class:`size-3.5 shrink-0 animate-spin`}),n[2]||=U(` filling… `,-1)])):s.value?(R(),B(AC,{key:1,"key-name":e.keyName,locale:e.locale,"source-locale":e.sourceLocale,arg:e.plural.arg,forms:c.value,"source-forms":e.sourceForms,"max-length":e.maxLength,onChanged:n[0]||=e=>r(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`arg`,`forms`,`source-forms`,`max-length`])):(R(),B(xC,{key:2,"key-name":e.keyName,locale:e.locale,"source-locale":e.sourceLocale,value:o.value,"max-length":e.maxLength,onChanged:n[1]||=e=>r(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`value`,`max-length`]))],8,qC),i.value?W(``,!0):(R(),z(`div`,YC,[d.value?(R(),B(j(dy),{key:0},{default:M(()=>[H(j(_y),{"as-child":``},{default:M(()=>[V(`button`,XC,[H(j(Td),{class:`size-3.5`})])]),_:1}),H(j(uS),{align:`end`,class:`w-fit max-w-xs text-xs`},{default:M(()=>[V(`ul`,ZC,[(R(!0),z(L,null,F(e.issues,(e,t)=>(R(),z(`li`,{key:t,class:`whitespace-pre-line text-foreground/80`},k(e.message),1))),128))]),f.value.length?(R(),z(`div`,QC,[n[3]||=V(`p`,{class:`mb-1 text-[11px] font-medium text-muted-foreground`},`Add to dictionary`,-1),V(`div`,$C,[(R(!0),z(L,null,F(f.value,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`inline-flex items-center gap-0.5 rounded border border-amber-500/40 px-1.5 py-0.5 text-[11px] text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300`,onClick:t=>p(e)},[H(j(od),{class:`size-3`}),U(k(e),1)],8,ew)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(`Add '`+k(e)+`' to the custom dictionary`,1)]),_:2},1024)]),_:2},1024))),128))])])):W(``,!0)]),_:1})]),_:1})):W(``,!0),u.value?(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,"aria-label":`Clear translation`,onClick:q(h,[`stop`])},[H(j(Ru),{class:`size-4`})])]),_:1}),H(j(ZS),null,{default:M(()=>[...n[4]||=[U(`Clear translation`,-1)]]),_:1})]),_:1})):W(``,!0),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-primary-soft hover:text-primary disabled:opacity-50`,disabled:m.value||e.filling,"aria-label":`AI translate this cell`,onClick:q(_,[`stop`])},[m.value||e.filling?(R(),B(j($u),{key:0,class:`size-4 animate-spin`})):(R(),B(j(Zu),{key:1,class:`size-4`}))],8,tw)]),_:1}),H(j(ZS),null,{default:M(()=>[...n[5]||=[U(`AI translate`,-1)]]),_:1})]),_:1}),H(fC,{state:a.value,editable:!0,onSetState:g},null,8,[`state`])]))],10,WC))}}),rw=[`aria-pressed`],iw={key:0,class:`pointer-events-none absolute inset-0 z-[3] border-2 border-primary`,"aria-hidden":`true`},aw={key:1,class:`pointer-events-none absolute inset-y-0 left-0 z-[4] w-1 bg-primary`,"aria-hidden":`true`},ow={class:`sticky top-3`},sw=[`aria-checked`],cw={class:`absolute right-0 top-0`},lw=[`disabled`],uw=[`innerHTML`],dw={key:0,class:`mt-1.5 flex flex-wrap items-center gap-1.5 pl-6`},fw={key:0,class:`inline-flex items-center gap-1 rounded-md border border-primary-border bg-primary/[0.09] px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-primary`},pw={class:`font-medium normal-case text-muted-foreground`},mw={"data-testid":`issue-badge`,class:`inline-flex items-center gap-1 rounded-md bg-destructive-soft px-1.5 py-0.5 text-[11.5px] font-bold text-destructive`},hw={key:1,class:`mt-2 flex flex-wrap gap-1.5 pl-6`},gw=[`onClick`],_w=[`data-testid`,`disabled`],vw={key:3,"data-testid":`translating-missing`,class:`ml-6 mt-2.5 inline-flex items-center gap-1 text-[11px] text-primary`},yw=[`disabled`],bw={class:`min-w-0 flex-1 [&>*:nth-child(even)]:bg-zebra`},xw={class:`grid gap-2`},Sw={class:`break-all rounded bg-muted px-1 py-0.5 font-mono text-sm`},Cw=P({__name:`KeyRow`,props:{keyName:{},entry:{},sourceLocale:{},locales:{},selected:{type:Boolean},checked:{type:Boolean},issues:{}},emits:[`changed`,`select`,`toggle-select`,`renamed`,`filter-tag`],setup(e,{emit:t}){let n=e,r=K(()=>n.keyName.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\./g,`.<wbr>`)),i=K(()=>{let e=new Map;for(let t of n.issues??[]){let n=e.get(t.locale);n?n.push(t):e.set(t.locale,[t])}return e}),a=t,o=A(!1),s=A(``),c=A(!1),l=A(!1),u=A(!1),d=A(!1),f=K(()=>tC(n.entry,n.locales,n.sourceLocale)),p=K(()=>nC(n.entry,n.locales,n.sourceLocale));async function m(){d.value=!0;try{let e=await Gd({onlyMissing:!1,force:!0,keyGlob:n.keyName,locales:p.value});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Re-translated ${e.written} stale value${e.written===1?``:`s`}`),a(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{d.value=!1}}async function h(){u.value=!0;try{let e=await Gd({onlyMissing:!0,keyGlob:n.keyName});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Translated ${e.written} missing value${e.written===1?``:`s`}`),a(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{u.value=!1}}function g(e){a(`toggle-select`,{shift:e.shiftKey})}function _(e){e.target?.closest(`button, input, textarea, select, a, [contenteditable="true"]`)||a(`select`)}async function v(){let e=!n.entry.skipTranslate;l.value=!0;try{await Ld([n.keyName],{skipTranslate:e}),$.success(e?`Excluded from translation`:`Included in translation`),a(`changed`)}catch(e){$.error(`Update failed: ${e.message}`)}finally{l.value=!1}}function y(){s.value=n.keyName,o.value=!0}async function b(){let e=s.value.trim();if(!e||e===n.keyName){o.value=!1;return}l.value=!0;try{await Rd(n.keyName,{rename:e}),o.value=!1,$.success(`Renamed to ${e}`),a(`renamed`,e)}catch(e){$.error(`Rename failed: ${e.message}`)}finally{l.value=!1}}async function x(){l.value=!0;try{await Nd(n.keyName),c.value=!1,$.success(`Deleted ${n.keyName}`),a(`changed`)}catch(e){$.error(`Delete failed: ${e.message}`)}finally{l.value=!1}}return(t,n)=>(R(),z(`div`,{class:O(j(eS)(`relative flex border-b-2 border-border bg-card`,e.selected&&`z-[1]`)),role:`button`,"aria-pressed":e.selected,"aria-label":`Select key`,onClick:_},[e.selected?(R(),z(`span`,iw)):W(``,!0),e.selected?(R(),z(`span`,aw)):W(``,!0),V(`div`,{class:O(j(eS)(`relative w-[var(--key-col-width,272px)] shrink-0 border-r border-border-soft p-[14px_16px_14px_18px]`,e.selected&&`bg-primary-soft/60`))},[V(`div`,ow,[V(`button`,{type:`button`,role:`checkbox`,"aria-checked":!!e.checked,"data-testid":`row-select`,class:O([`absolute left-0 top-0.5 flex size-4 items-center justify-center rounded border transition-colors`,e.checked?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`]),"aria-label":`Select key`,onClick:q(g,[`stop`])},[e.checked?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],10,sw),V(`div`,cw,[H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Key actions`,disabled:u.value,onClick:n[0]||=q(()=>{},[`stop`])},[H(j(Lu),{class:`size-4`})],8,lw)]),_:1}),H(j(HS),{align:`end`},{default:M(()=>[f.value.length>0?(R(),B(j(US),{key:0,disabled:u.value,onSelect:h},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` Translate missing (`+k(f.value.length)+`) `,1)]),_:1},8,[`disabled`])):W(``,!0),H(j(US),{onSelect:y},{default:M(()=>[H(j(ad),{class:`size-4`}),n[9]||=U(` Rename `,-1)]),_:1}),H(j(US),{"data-testid":`toggle-skip`,disabled:l.value,onSelect:v},{default:M(()=>[H(j(Zu),{class:`size-4`}),U(` `+k(e.entry.skipTranslate?`Include in translation`:`Skip translation`),1)]),_:1},8,[`disabled`]),H(j(US),{class:`text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive`,onSelect:n[1]||=e=>c.value=!0},{default:M(()=>[H(j(wd),{class:`size-4`}),n[10]||=U(` Delete `,-1)]),_:1})]),_:1})]),_:1})]),V(`div`,{class:`break-words pl-6 pr-7 font-mono text-[13.5px] font-semibold tracking-tight cursor-pointer`,onClick:n[2]||=q(e=>g(e),[`stop`])},[V(`span`,{innerHTML:r.value},null,8,uw),e.entry.screenshot?(R(),B(j(Yu),{key:0,class:`ml-1.5 inline size-3.5 align-[-2px] text-muted-foreground`,"aria-label":`Has screenshot`})):W(``,!0)]),e.entry.plural||e.entry.skipTranslate||(e.issues?.length??0)>0?(R(),z(`div`,dw,[e.entry.plural?(R(),z(`span`,fw,[n[11]||=U(`PLURAL`,-1),V(`span`,pw,`· `+k(e.entry.plural.arg),1)])):W(``,!0),e.entry.skipTranslate?(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[...n[12]||=[V(`span`,{"data-testid":`skip-badge`,class:`inline-flex items-center gap-1 rounded-md border border-warning-border bg-warning-bg px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-warning`},`SKIP`,-1)]]),_:1}),H(j(ZS),null,{default:M(()=>[...n[13]||=[U(`Excluded from translation`,-1)]]),_:1})]),_:1})):W(``,!0),(e.issues?.length??0)>0?(R(),B(j(Sb),{key:2},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,mw,[H(j(Td),{class:`size-3`}),U(k(e.issues.length),1)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(e.issues.length)+` issue`+k(e.issues.length===1?``:`s`),1)]),_:1})]),_:1})):W(``,!0)])):W(``,!0),(e.entry.tags??[]).length?(R(),z(`div`,hw,[(R(!0),z(L,null,F(e.entry.tags,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`inline-flex h-[22px] items-center gap-1.5 rounded-full border border-primary-border bg-transparent px-[9px] text-xs font-medium text-foreground transition-colors hover:border-primary hover:bg-primary/[0.07]`,onClick:q(t=>a(`filter-tag`,e),[`stop`])},[H(j(Sd),{class:`size-3 text-primary`}),U(k(e),1)],8,gw)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(`Filter by tag: `+k(e),1)]),_:2},1024)]),_:2},1024))),128))])):W(``,!0),f.value.length>0?(R(),B(j(Sb),{key:2},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-testid":u.value?`translating-missing`:`translate-missing-btn`,disabled:u.value,class:`ml-6 mt-2.5 inline-flex items-center gap-1.5 rounded-lg border border-primary-border bg-primary-soft px-2.5 py-1.5 text-[11.5px] font-semibold text-primary transition hover:brightness-95 disabled:opacity-80`,onClick:q(h,[`stop`])},[u.value?(R(),B(j($u),{key:0,class:`size-3 animate-spin`})):(R(),B(j(vd),{key:1,class:`size-3`})),U(` `+k(u.value?`Translating…`:`Translate ${f.value.length} missing`),1)],8,_w)]),_:1}),H(j(ZS),null,{default:M(()=>[U(`Translate the `+k(f.value.length)+` missing language`+k(f.value.length>1?`s`:``)+` for this key`,1)]),_:1})]),_:1})):u.value?(R(),z(`span`,vw,[H(j($u),{class:`size-3 animate-spin`}),n[14]||=U(` Translating… `,-1)])):W(``,!0),p.value.length>0?(R(),B(j(Sb),{key:4},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-testid":`retranslate-stale-btn`,disabled:d.value,class:`ml-6 mt-2.5 inline-flex items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-[11.5px] font-semibold text-amber-700 transition hover:brightness-95 disabled:opacity-80 dark:text-amber-300`,onClick:q(m,[`stop`])},[d.value?(R(),B(j($u),{key:0,class:`size-3 animate-spin`})):(R(),B(j(sd),{key:1,class:`size-3`})),U(` `+k(d.value?`Re-translating…`:`Re-translate ${p.value.length} stale`),1)],8,yw)]),_:1}),H(j(ZS),null,{default:M(()=>[U(`Re-translate the `+k(p.value.length)+` stale language`+k(p.value.length>1?`s`:``)+` for this key`,1)]),_:1})]),_:1})):W(``,!0)])],2),V(`div`,bw,[(R(!0),z(L,null,F(e.locales,t=>(R(),B(nw,{key:t,"key-name":e.keyName,locale:t,"source-locale":e.sourceLocale,value:e.entry.values[t],"max-length":e.entry.maxLength,issues:i.value.get(t)??[],plural:e.entry.plural,"source-forms":e.entry.values[e.sourceLocale]?.forms,filling:u.value&&f.value.includes(t)||d.value&&p.value.includes(t),onChanged:n[3]||=e=>a(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`value`,`max-length`,`issues`,`plural`,`source-forms`,`filling`]))),128))]),H(j(bh),{open:o.value,"onUpdate:open":n[6]||=e=>o.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[15]||=[U(`Rename key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...n[16]||=[U(`Use dot notation, e.g. `,-1),V(`span`,{class:`font-mono`},`home.title`,-1),U(`.`,-1)]]),_:1})]),_:1}),V(`div`,xw,[H(j(IS),{for:`rename-key`},{default:M(()=>[...n[17]||=[U(`New key`,-1)]]),_:1}),H(j(rS),{id:`rename-key`,modelValue:s.value,"onUpdate:modelValue":n[4]||=e=>s.value=e,class:`font-mono`,onKeydown:Xl(q(b,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:l.value,onClick:n[5]||=e=>o.value=!1},{default:M(()=>[...n[18]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:l.value,onClick:b},{default:M(()=>[...n[19]||=[U(`Rename`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:c.value,"onUpdate:open":n[8]||=e=>c.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[20]||=[U(`Delete key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[n[21]||=U(` Delete `,-1),V(`code`,Sw,k(e.keyName),1),n[22]||=U(` and all its translations? This cannot be undone. `,-1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:l.value,onClick:n[7]||=e=>c.value=!1},{default:M(()=>[...n[23]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:l.value,onClick:x},{default:M(()=>[...n[24]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])],10,rw))}}),ww=[{id:`phpstorm`,label:`PhpStorm`,buildUrl:e=>`phpstorm://open?file=${encodeURIComponent(e.abs)}&line=${e.line}`},{id:`vscode`,label:`VS Code`,buildUrl:e=>`vscode://file${e.abs}:${e.line}:${e.col}`},{id:`zed`,label:`Zed`,buildUrl:e=>`zed://file${e.abs}:${e.line}:${e.col}`}],Tw=`vscode`,Ew=e=>ww.some(t=>t.id===e),Dw=A(Tw);function Ow(e){Ew(e)&&(Dw.value=e,rf({editor:e}).catch(()=>{}))}async function kw(){try{let{editor:e}=await nf();Ew(e)&&(Dw.value=e)}catch{}}function Aw(e,t){return(ww.find(e=>e.id===Dw.value)??ww[0]).buildUrl(e,t)}function jw(){return{dirs:new Map,files:new Map}}function Mw(e){let t=jw();for(let n of e){let e=n.file.split(`/`).filter(Boolean),r=e.pop()??n.file,i=t;for(let t of e){let e=i.dirs.get(t);e||(e=jw(),i.dirs.set(t,e)),i=e}let a=i.files.get(r)??[];a.push({line:n.line,url:n.url}),i.files.set(r,a)}let n=[],r=(e,t)=>{for(let i of[...e.dirs.keys()].sort()){let a=i,o=e.dirs.get(i);for(;o.files.size===0&&o.dirs.size===1;){let e=[...o.dirs.keys()][0];a+=`/`+e,o=o.dirs.get(e)}n.push({kind:`dir`,depth:t,label:a}),r(o,t+1)}for(let r of[...e.files.keys()].sort()){let i=e.files.get(r).slice().sort((e,t)=>e.line-t.line);n.push({kind:`file`,depth:t,name:r,refs:i})}};return r(t,0),n}var Nw={class:`flex flex-col gap-2`},Pw={class:`flex items-center gap-1.5`},Fw={key:0,class:`flex flex-col gap-2`},Iw={class:`mt-1 flex gap-2`},Lw={class:`flex items-center justify-between`},Rw={class:`font-mono text-[10px] text-muted-foreground`},zw={class:`flex gap-1.5`},Bw=[`onClick`],Vw=[`onClick`],Hw={class:`whitespace-pre-wrap break-words text-[12.5px] leading-snug`},Uw=P({__name:`NotesEditor`,props:{keyName:{},notes:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=e=>new Date(e).toLocaleString(),a=A(``),o=A(!1);async function s(){let e=a.value.trim();if(e){o.value=!0;try{await hf(n.keyName,e),a.value=``,r(`changed`)}catch(e){$.error(`Could not add note: ${e.message}`)}finally{o.value=!1}}}let c=A(null),l=A(``),u=A(!1);function d(e){c.value=e.id,l.value=e.text}function f(){c.value=null,l.value=``}async function p(e){let t=l.value.trim();if(t){u.value=!0;try{await gf(n.keyName,e,t),f(),r(`changed`)}catch(e){$.error(`Could not save note: ${e.message}`)}finally{u.value=!1}}}async function m(e){try{await _f(n.keyName,e),r(`changed`)}catch(e){$.error(`Could not delete note: ${e.message}`)}}return(t,n)=>(R(),z(`div`,Nw,[V(`div`,Pw,[H(j(bd),{class:`size-3.5 text-muted-foreground`}),n[2]||=V(`p`,{class:`text-[13px] font-semibold`},`Notes`,-1)]),n[6]||=V(`p`,{class:`-mt-1 text-[11.5px] text-muted-foreground`},`Internal notes — never sent to the AI or exported.`,-1),e.notes.length?(R(),z(`ul`,Fw,[(R(!0),z(L,null,F(e.notes,e=>(R(),z(`li`,{key:e.id,class:`flex flex-col gap-1 rounded-lg border border-border-soft bg-background p-2.5 text-sm`},[c.value===e.id?(R(),z(L,{key:0},[H(j(gC),{modelValue:l.value,"onUpdate:modelValue":n[0]||=e=>l.value=e,rows:`2`,onKeydown:Xl(q(f,[`prevent`]),[`escape`])},null,8,[`modelValue`,`onKeydown`]),V(`div`,Iw,[H(j(Q),{size:`sm`,disabled:u.value||!l.value.trim(),onClick:t=>p(e.id)},{default:M(()=>[...n[3]||=[U(`Save`,-1)]]),_:1},8,[`disabled`,`onClick`]),H(j(Q),{size:`sm`,variant:`ghost`,onClick:f},{default:M(()=>[...n[4]||=[U(`Cancel`,-1)]]),_:1})])],64)):(R(),z(L,{key:1},[V(`div`,Lw,[V(`span`,Rw,k(i(e.at)),1),V(`span`,zw,[V(`button`,{type:`button`,"aria-label":`Edit note`,class:`text-muted-foreground hover:text-foreground`,onClick:t=>d(e)},[H(j(ad),{class:`size-3.5`})],8,Bw),V(`button`,{type:`button`,"aria-label":`Delete note`,class:`text-muted-foreground hover:text-destructive`,onClick:t=>m(e.id)},[H(j(wd),{class:`size-3.5`})],8,Vw)])]),V(`p`,Hw,k(e.text),1)],64))]))),128))])):W(``,!0),H(j(gC),{"data-testid":`new-note`,modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e,rows:`2`,placeholder:`Add an internal note…`},null,8,[`modelValue`]),H(j(Q),{"data-testid":`add-note`,variant:`outline`,class:`w-full text-muted-foreground`,disabled:o.value||!a.value.trim(),onClick:s},{default:M(()=>[...n[5]||=[U(` Add note `,-1)]]),_:1},8,[`disabled`])]))}}),Ww={class:`flex shrink-0 flex-col overflow-y-auto border-l border-border bg-card max-[1080px]:hidden`},Gw={key:0,class:`flex flex-1 flex-col items-center justify-center gap-2.5 p-10 text-center text-muted-foreground`},Kw={key:1,class:`flex flex-col gap-4 px-5 pb-10 pt-[18px]`},qw={class:`flex flex-col gap-0.5`},Jw=[`innerHTML`],Yw={class:`flex flex-wrap items-center gap-2`},Xw={key:0,class:`rounded-md border border-primary-border bg-primary-soft px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-primary`},Zw={key:1,class:`rounded-md border border-border-soft bg-accent px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-muted-foreground`},Qw=[`disabled`],$w=[`disabled`],eT={key:0,class:`flex flex-col gap-1.5`},tT={class:`flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-wide text-destructive`},nT={class:`font-mono text-[11px] font-semibold`},rT={class:`ml-auto rounded border border-destructive px-1.5 py-0.5 text-[10.5px] font-semibold text-destructive`},iT=[`disabled`,`onClick`],aT={key:1,class:`flex flex-col gap-1.5`},oT={class:`flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-wide text-muted-foreground`},sT={class:`font-mono text-[11px] font-semibold`},cT={class:`flex flex-col gap-1.5`},lT={class:`flex items-center gap-1.5`},uT={key:0,class:`ml-auto text-[11.5px] text-muted-foreground`},dT={key:0,class:`text-[12px] text-muted-foreground`},fT={key:0,class:`rounded-md border border-border-soft bg-accent px-2 py-1.5 text-[12px] text-muted-foreground`},pT={key:1,class:`flex flex-col gap-0.5 text-[11.5px]`},mT={class:`min-w-0 truncate font-mono`,style:{direction:`rtl`,"text-align":`left`}},hT=[`href`],gT={key:1,class:`min-w-0 shrink truncate font-mono text-foreground`},_T={class:`flex min-w-0 flex-wrap items-baseline gap-x-1.5 gap-y-0.5`},vT=[`href`],yT={key:1,class:`shrink-0 font-mono text-muted-foreground`},bT={key:2,class:`flex flex-col gap-1`},xT={class:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground`},ST={class:`flex flex-col gap-1`},CT={class:`min-w-0 flex-1 truncate font-mono`,style:{direction:`rtl`,"text-align":`left`}},wT={class:`shrink-0 rounded border border-dashed border-border-soft px-1 font-mono text-[10px]`},TT={class:`shrink-0 font-mono`},ET={class:`flex flex-col gap-1.5`},DT={class:`flex items-center gap-1.5`},OT={class:`ml-0.5 flex items-center gap-0.5 rounded border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] font-semibold text-primary`},kT=[`disabled`],AT={class:`flex flex-col gap-1.5`},jT={class:`flex items-center gap-1.5`},MT={class:`flex flex-col gap-1.5`},NT={class:`flex items-center gap-1.5`},PT={class:`flex flex-col gap-2`},FT={class:`flex items-center gap-1.5`},IT={key:0,class:`flex flex-col gap-2`},LT=[`src`,`alt`],RT={class:`flex gap-2`},zT=[`disabled`],BT={class:`flex flex-col gap-1.5 text-[11.5px] text-muted-foreground`},VT={class:`flex items-center justify-between gap-3`},HT={class:`font-mono text-[11px] text-foreground`},UT={class:`flex items-center justify-between gap-3`},WT={class:`font-mono text-[11px] text-foreground`},GT=P({__name:`DetailPanel`,props:{keyName:{},entry:{},issues:{},locales:{},sourceLocale:{},usageRevision:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=e=>e?new Date(e).toLocaleString():`—`,a=K(()=>n.keyName?n.keyName.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\./g,`.<wbr>`):``),o=K(()=>{let e=``;for(let t of Object.values(n.entry?.values??{}))t.updatedAt&&t.updatedAt>e&&(e=t.updatedAt);return e||void 0}),s=K(()=>!!n.entry?.plural),c={placeholder:`Placeholder`,spelling:`Spelling`,length:`Length`,glossary:`Glossary`},l=K(()=>(n.issues??[]).filter(e=>e.check!==`untranslated`)),u={spelling:`spelling`,length:`max-length`},d=A(!1);async function f(e){let t=u[e.check];if(!(!t||!n.keyName||d.value)){d.value=!0;try{await Ef(n.keyName,t,e.locale),$.success(`Dismissed until the source text changes`),r(`changed`)}catch(e){$.error(e.message)}finally{d.value=!1}}}let p=K(()=>{let e=n.entry,t=n.sourceLocale;return!e||!t?[]:(n.locales??[]).filter(n=>eC(e,n,t))}),m=A(null),h=A(!1),g=A(!1);function _(){m.value?.click()}async function v(e){let t=e.target,i=t.files?.[0];if(t.value=``,!(!i||!n.keyName)){h.value=!0;try{await pf(n.keyName,i),$.success(`Screenshot uploaded`),r(`changed`)}catch(e){$.error(`Upload failed: ${e.message}`)}finally{h.value=!1}}}async function y(){if(n.keyName){g.value=!0;try{await mf(n.keyName),$.success(`Screenshot removed`),r(`changed`)}catch(e){$.error(`Could not remove: ${e.message}`)}finally{g.value=!1}}}let b=Zt({context:``,tags:``,maxLength:void 0}),x=A(!1),S=A(!1);async function C(){if(n.keyName){S.value=!0;try{let e=0,t=[];for await(let r of Jd({keyGlob:n.keyName,all:!0,force:!0}))r.type===`done`&&(e=r.written,t=r.errors);e>0?($.success(`Context suggested and saved — review it below`),r(`changed`)):t.length>0?$.error(t[0].error):$.info(`No usage found — add a code snippet or type context manually`)}catch(e){$.error(`Could not suggest: ${e.message}`)}finally{S.value=!1}}}N(()=>[n.keyName,n.entry],()=>{b.context=n.entry?.context??``,b.tags=(n.entry?.tags??[]).join(`, `),b.maxLength=n.entry?.maxLength},{immediate:!0});let w=A(null),T=A(6);async function ee(){let e=n.keyName;if(!e){w.value=null;return}try{w.value=await Zd(e)}catch{w.value=null}}N(()=>n.keyName,async()=>{w.value=null,T.value=6,await ee()},{immediate:!0}),N(()=>n.usageRevision,ee);let E=e=>Aw(e,w.value?.project??``),te=K(()=>(w.value?.refs??[]).map(e=>({...e,url:E(e)}))),ne=K(()=>(w.value?.prefixRefs??[]).map(e=>({...e,url:E(e)}))),re=K(()=>Mw(te.value.slice(0,T.value))),ie=e=>e.find(e=>e.url)?.url??null,ae=A(`count`),oe=A(!1);N(()=>[n.keyName,n.entry],()=>{ae.value=n.entry?.plural?.arg??`count`},{immediate:!0});async function se(){if(!n.keyName)return;let e=ae.value.trim()||`count`;oe.value=!0;try{await Ud(n.keyName,e),$.success(`Converted to plural`),r(`changed`)}catch(e){$.error(`Could not convert: ${e.message}`)}finally{oe.value=!1}}async function ce(){if(n.keyName){oe.value=!0;try{await Wd(n.keyName),$.success(`Converted to a single string`),r(`changed`)}catch(e){$.error(`Could not convert: ${e.message}`)}finally{oe.value=!1}}}async function D(){let e=ae.value.trim();if(!(!n.keyName||!e||e===n.entry?.plural?.arg))try{await Rd(n.keyName,{pluralArg:e}),$.success(`Renamed count variable`),r(`changed`)}catch(e){$.error(`Could not rename: ${e.message}`)}}async function le(){if(n.keyName){x.value=!0;try{await Rd(n.keyName,{metadata:{context:b.context.trim(),tags:b.tags.split(`,`).map(e=>e.trim()).filter(Boolean),maxLength:b.maxLength?Number(b.maxLength):null}}),$.success(`Metadata saved`),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`)}finally{x.value=!1}}}return(t,n)=>(R(),z(`aside`,Ww,[!e.keyName||!e.entry?(R(),z(`div`,Gw,[H(j(Uu),{class:`size-5`}),n[7]||=V(`p`,{class:`max-w-[200px] text-sm leading-relaxed`},`Select a key to view and edit its details.`,-1)])):(R(),z(`div`,Kw,[V(`div`,qw,[n[9]||=V(`span`,{class:`text-[10.5px] font-bold uppercase tracking-wide text-muted-foreground`},`Key`,-1),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,{class:`inline-block w-fit break-words cursor-pointer font-mono text-base font-semibold tracking-tight`,innerHTML:a.value,onClick:n[0]||=t=>j(tS)(e.keyName).then(()=>j($).success(`Copied`)).catch(()=>{})},null,8,Jw)]),_:1}),H(j(ZS),null,{default:M(()=>[...n[8]||=[U(`Click to copy`,-1)]]),_:1})]),_:1})]),V(`div`,Yw,[s.value?(R(),z(`span`,Xw,`PLURAL`)):(R(),z(`span`,Zw,`SINGLE`)),s.value?(R(),z(L,{key:2},[n[10]||=V(`span`,{class:`text-[11.5px] text-muted-foreground`},`arg`,-1),H(j(rS),{modelValue:ae.value,"onUpdate:modelValue":n[1]||=e=>ae.value=e,class:`h-7 w-24 font-mono text-xs`,"aria-label":`Number variable name`,onBlur:D,onKeydown:Xl(q(D,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),V(`button`,{type:`button`,class:`ml-auto rounded-md px-2 py-1 text-[12px] font-semibold text-primary transition-colors hover:bg-primary-soft disabled:opacity-50`,disabled:oe.value,onClick:ce},`Make single`,8,Qw)],64)):(R(),z(`button`,{key:3,type:`button`,class:`ml-auto rounded-md px-2 py-1 text-[12px] font-semibold text-primary transition-colors hover:bg-primary-soft disabled:opacity-50`,disabled:oe.value,onClick:se},`Make plural`,8,$w))]),l.value.length||p.value.length?(R(),z(`div`,{key:0,class:O(j(eS)(`flex flex-col gap-3 rounded-xl border border-border bg-background p-3`,l.value.length&&`border-primary-border`))},[l.value.length?(R(),z(`div`,eT,[V(`div`,tT,[H(j(Td),{class:`size-3.5`}),U(` `+k(l.value.length)+` issue`+k(l.value.length===1?``:`s`),1)]),(R(!0),z(L,null,F(l.value,(e,t)=>(R(),z(`div`,{key:t,class:`group flex items-center gap-2 text-[12.5px]`},[H(FC,{code:e.locale,size:14},null,8,[`code`]),V(`span`,nT,k(e.locale.toUpperCase()),1),V(`span`,rT,k(c[e.check]??e.check),1),u[e.check]?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-[20px] items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100`,disabled:d.value,"aria-label":`Dismiss until the source changes`,onClick:t=>f(e)},[H(j(Su),{class:`size-3`})],8,iT)]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[11]||=[U(`Dismiss until the source text changes`,-1)]]),_:1})]),_:2},1024)):W(``,!0)]))),128))])):W(``,!0),p.value.length?(R(),z(`div`,aT,[V(`div`,oT,[n[12]||=V(`span`,{class:`size-[7px] rounded-full bg-muted-foreground`},null,-1),U(` `+k(p.value.length)+` untranslated `,1)]),(R(!0),z(L,null,F(p.value,e=>(R(),z(`div`,{key:e,class:`flex items-center gap-2 text-[12.5px]`},[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,sT,k(e.toUpperCase()),1),n[13]||=V(`span`,{class:`ml-auto rounded border border-border-soft bg-accent px-1.5 py-0.5 text-[10.5px] font-semibold italic text-muted-foreground`},`Empty`,-1)]))),128))])):W(``,!0)],2)):W(``,!0),V(`div`,cT,[V(`div`,lT,[H(j(Fu),{class:`size-3.5 text-muted-foreground`}),n[14]||=V(`span`,{class:`text-[13px] font-semibold`},`Usage`,-1),w.value?.indexed?(R(),z(`span`,uT,k(w.value.count)+` reference`+k(w.value.count===1?``:`s`),1)):W(``,!0)]),!w.value||!w.value.indexed?(R(),z(`p`,dT,` Run a scan to find where this key is used in your code. `)):(R(),z(L,{key:1},[w.value.count===0&&ne.value.length===0?(R(),z(`p`,fT,` Not referenced in the last scan — this key may be unused. `)):W(``,!0),te.value.length?(R(),z(`div`,pT,[(R(!0),z(L,null,F(re.value,(e,t)=>(R(),z(L,{key:t},[e.kind===`dir`?(R(),z(`div`,{key:0,class:`flex items-center gap-1 text-muted-foreground`,style:ge({paddingLeft:`${e.depth*12}px`})},[H(j(Ku),{class:`size-3 shrink-0`}),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,mT,k(e.label),1)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.label),1)]),_:2},1024)]),_:2},1024)],4)):(R(),z(`div`,{key:1,class:`flex items-baseline gap-1.5`,style:ge({paddingLeft:`${e.depth*12+16}px`})},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[ie(e.refs)?(R(),z(`a`,{key:0,href:ie(e.refs),class:`min-w-0 shrink truncate rounded px-0.5 font-mono text-foreground hover:bg-accent hover:text-primary`},k(e.name),9,hT)):(R(),z(`span`,gT,k(e.name),1))]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(ie(e.refs)?`Open ${e.name}`:e.name),1)]),_:2},1024)]),_:2},1024),V(`span`,_T,[(R(!0),z(L,null,F(e.refs,(t,n)=>(R(),z(L,{key:n},[t.url?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`a`,{href:t.url,class:`shrink-0 rounded px-0.5 font-mono text-muted-foreground hover:bg-accent hover:text-primary`},`:`+k(t.line),9,vT)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(`Open `+k(e.name)+`:`+k(t.line),1)]),_:2},1024)]),_:2},1024)):(R(),z(`span`,yT,`:`+k(t.line),1))],64))),128))])],4))],64))),128)),w.value.count>T.value?(R(),z(`button`,{key:0,type:`button`,class:`mt-0.5 self-start text-[11.5px] text-primary hover:underline`,onClick:n[2]||=e=>T.value=w.value.count},` + `+k(w.value.count-T.value)+` more `,1)):W(``,!0)])):W(``,!0),ne.value.length?(R(),z(`div`,bT,[V(`p`,xT,[H(j(xu),{class:`size-3`}),n[15]||=U(` Possible usage (dynamic keys) `,-1)]),V(`ul`,ST,[(R(!0),z(L,null,F(ne.value,(e,t)=>(R(),z(`li`,{key:t,class:`text-[11.5px]`},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[(R(),B(aa(e.url?`a`:`div`),{href:e.url||void 0,class:O([`group flex items-baseline gap-2 text-muted-foreground`,e.url?`hover:text-primary`:``])},{default:M(()=>[V(`span`,CT,k(e.file),1),V(`span`,wT,k(e.prefix)+`*`,1),V(`span`,TT,`:`+k(e.line),1),e.url?(R(),B(j(zu),{key:0,class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`})):W(``,!0)]),_:2},1032,[`href`,`class`]))]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.url?`Open ${e.file}:${e.line}`:`${e.file}:${e.line}`),1)]),_:2},1024)]),_:2},1024)]))),128))])])):W(``,!0)],64))]),V(`div`,ET,[V(`div`,DT,[H(j(Xu),{class:`size-3.5 text-muted-foreground`}),n[17]||=V(`label`,{for:`detail-context`,class:`text-[13px] font-semibold`},`Context`,-1),e.entry.contextSource===`ai`?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,OT,[H(j(vd),{class:`size-2.5`}),n[16]||=U(` AI `,-1)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(e.entry.contextAt?`AI-generated ${i(e.entry.contextAt)}`:`AI-generated`),1)]),_:1})]),_:1})):W(``,!0),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,disabled:S.value,onClick:C},[H(j(vd),{class:`size-3`}),U(` `+k(S.value?`Suggesting…`:`Suggest`),1)],8,kT)]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(S.value?`Suggesting…`:`Suggest context with AI`),1)]),_:1})]),_:1})]),H(j(gC),{id:`detail-context`,modelValue:b.context,"onUpdate:modelValue":n[3]||=e=>b.context=e,rows:`5`,class:`min-h-28`,placeholder:`Where/how this string is used…`},null,8,[`modelValue`])]),V(`div`,AT,[V(`div`,jT,[H(j(Cd),{class:`size-3.5 text-muted-foreground`}),n[18]||=V(`label`,{for:`detail-tags`,class:`text-[13px] font-semibold`},`Tags`,-1)]),H(j(rS),{id:`detail-tags`,modelValue:b.tags,"onUpdate:modelValue":n[4]||=e=>b.tags=e,placeholder:`comma, separated`},null,8,[`modelValue`])]),V(`div`,MT,[V(`div`,NT,[H(j(ld),{class:`size-3.5 text-muted-foreground`}),n[19]||=V(`label`,{for:`detail-maxlen`,class:`text-[13px] font-semibold`},`Max length`,-1)]),H(j(rS),{id:`detail-maxlen`,modelValue:b.maxLength,"onUpdate:modelValue":n[5]||=e=>b.maxLength=e,modelModifiers:{number:!0},type:`number`,min:`0`,placeholder:`—`,class:`font-mono`},null,8,[`modelValue`])]),H(j(Q),{class:`w-full`,disabled:x.value,onClick:le},{default:M(()=>[...n[20]||=[U(`Save details`,-1)]]),_:1},8,[`disabled`]),n[26]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),e.keyName?(R(),B(Uw,{key:1,"key-name":e.keyName,notes:e.entry.notes??[],onChanged:n[6]||=e=>r(`changed`)},null,8,[`key-name`,`notes`])):W(``,!0),n[27]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),V(`div`,PT,[V(`div`,FT,[H(j(Yu),{class:`size-3.5 text-muted-foreground`}),n[21]||=V(`span`,{class:`text-[13px] font-semibold`},`Screenshot`,-1)]),V(`input`,{ref_key:`fileInput`,ref:m,type:`file`,accept:`image/*`,class:`hidden`,onChange:v},null,544),e.entry.screenshot?(R(),z(`div`,IT,[V(`img`,{src:`/`+e.entry.screenshot,alt:`Screenshot for ${e.keyName}`,class:`max-h-48 w-full rounded-lg border border-border object-contain`},null,8,LT),V(`div`,RT,[H(j(Q),{variant:`outline`,size:`sm`,disabled:h.value,onClick:_},{default:M(()=>[H(j(sd),{class:`size-4`}),n[22]||=U(` Replace `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`outline`,size:`sm`,class:`text-muted-foreground hover:text-destructive`,disabled:g.value,onClick:y},{default:M(()=>[H(j(wd),{class:`size-4`}),n[23]||=U(` Remove `,-1)]),_:1},8,[`disabled`])])])):(R(),z(`button`,{key:1,type:`button`,class:`flex w-full flex-col items-center gap-2 rounded-xl border-[1.5px] border-dashed border-input p-[22px] text-center text-[12.5px] font-medium text-muted-foreground transition-colors hover:border-primary-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60`,disabled:h.value,onClick:_},[H(j(Dd),{class:`size-5`}),U(` `+k(h.value?`Uploading…`:`Upload screenshot`),1)],8,zT))]),n[28]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),V(`div`,BT,[V(`div`,VT,[n[24]||=V(`span`,null,`Created`,-1),V(`span`,HT,k(i(e.entry.createdAt)),1)]),V(`div`,UT,[n[25]||=V(`span`,null,`Last updated`,-1),V(`span`,WT,k(i(o.value)),1)])])]))]))}}),KT={class:`grid gap-3`},qT={class:`grid gap-1.5`},JT={class:`grid gap-1.5`},YT={class:`flex items-center justify-between gap-2 rounded-md border p-2.5`},XT={class:`flex flex-col`},ZT={key:0,class:`grid gap-1.5`},QT={key:1,class:`text-sm text-destructive`},$T=P({__name:`AddKeyDialog`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:ka([`created`],[`update:open`]),setup(e,{emit:t}){let n=Za(e,`open`),r=t,i=A(``),a=A(``),o=A(``),s=A(!1),c=A(!1),l=A(`count`);N(n,e=>{e&&(i.value=``,a.value=``,o.value=``,c.value=!1,l.value=`count`)});async function u(){let e=i.value.trim();if(!e){o.value=`Key is required.`;return}if(!a.value.trim()){o.value=`Source value is required.`;return}s.value=!0,o.value=``;try{c.value?await Md(e,a.value,{arg:l.value.trim()||`count`}):await Md(e,a.value),$.success(`Added ${e}`),n.value=!1,r(`created`,e)}catch(e){o.value=e.message}finally{s.value=!1}}return(e,t)=>(R(),B(j(bh),{open:n.value,"onUpdate:open":t[5]||=e=>n.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[6]||=[U(`Add key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...t[7]||=[U(`Create a new translation key using dot notation.`,-1)]]),_:1})]),_:1}),V(`div`,KT,[V(`div`,qT,[H(j(IS),{for:`add-key`},{default:M(()=>[...t[8]||=[U(`Key `,-1),V(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),H(j(rS),{id:`add-key`,modelValue:i.value,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:`font-mono`,placeholder:`home.title`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),V(`div`,JT,[H(j(IS),{for:`add-value`},{default:M(()=>[U(k(c.value?`Source value (other form)`:`Source value`)+` `,1),t[9]||=V(`span`,{class:`text-destructive`},`*`,-1)]),_:1}),H(j(rS),{id:`add-value`,modelValue:a.value,"onUpdate:modelValue":t[1]||=e=>a.value=e,placeholder:c.value?`{count} items`:`Welcome home`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])]),V(`div`,YT,[V(`div`,XT,[H(j(IS),{for:`add-plural`,class:`cursor-pointer`},{default:M(()=>[...t[10]||=[U(`Plural`,-1)]]),_:1}),t[11]||=V(`span`,{class:`text-xs text-muted-foreground`},`One form per CLDR category, by locale.`,-1)]),H(j(pS),{id:`add-plural`,modelValue:c.value,"onUpdate:modelValue":t[2]||=e=>c.value=e},null,8,[`modelValue`])]),c.value?(R(),z(`div`,ZT,[H(j(IS),{for:`add-plural-arg`},{default:M(()=>[...t[12]||=[U(`Count argument`,-1)]]),_:1}),H(j(rS),{id:`add-plural-arg`,modelValue:l.value,"onUpdate:modelValue":t[3]||=e=>l.value=e,class:`font-mono`,placeholder:`count`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])])):W(``,!0),o.value?(R(),z(`p`,QT,k(o.value),1)):W(``,!0)]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:s.value,onClick:t[4]||=e=>n.value=!1},{default:M(()=>[...t[13]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:s.value||!i.value.trim()||!a.value.trim(),onClick:u},{default:M(()=>[...t[14]||=[U(`Add key`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),eE={key:0,class:`flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-400`},tE={key:1,class:`text-sm text-destructive`},nE={key:2,class:`flex flex-1 items-center justify-center py-12 text-sm text-muted-foreground`},rE={key:0,class:`flex flex-col gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-400`},iE={class:`flex items-center gap-1.5 font-medium`},aE={class:`list-inside list-disc pl-1`},oE={class:`grid min-h-0 flex-1 grid-cols-[16rem_1fr] gap-3 overflow-hidden`},sE={class:`min-h-0 overflow-y-auto rounded-md border`},cE=[`onClick`],lE={key:0,class:`px-3 py-2 text-xs text-muted-foreground`},uE={key:0,class:`min-h-0 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs leading-relaxed [tab-size:2]`},dE={key:1,class:`flex min-h-0 items-center justify-center rounded-md border text-sm text-muted-foreground`},fE=P({__name:`ExportDialog`,props:ka({exportLocales:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:[`update:open`],setup(e){let t=Za(e,`open`),n=e,r=K(()=>(n.exportLocales?.length??0)>0),i=A(!1),a=A(!1),o=A(``),s=A([]),c=A([]),l=A(null),u=K(()=>s.value.find(e=>e.path===l.value)??null);async function d(){i.value=!0,o.value=``,s.value=[],c.value=[],l.value=null;try{let e=await yf();s.value=[...e.files].sort((e,t)=>e.path.localeCompare(t.path)),c.value=e.warnings,l.value=s.value[0]?.path??null}catch(e){o.value=e.message}finally{i.value=!1}}N(t,e=>{e&&d()},{immediate:!0});async function f(){a.value=!0;try{let e=await bf();$.success(`Wrote ${e.files} file${e.files===1?``:`s`}`),t.value=!1}catch(e){$.error(`Export failed: ${e.message}`)}finally{a.value=!1}}return(e,d)=>(R(),B(j(bh),{open:t.value,"onUpdate:open":d[1]||=e=>t.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] w-full max-w-5xl flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...d[2]||=[U(`Export preview`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...d[3]||=[U(`Review the files that will be written to disk.`,-1)]]),_:1})]),_:1}),r.value?(R(),z(`p`,eE,[H(j(Td),{class:`size-3.5 shrink-0`}),U(` Export is limited to `+k(n.exportLocales.length)+` language`+k(n.exportLocales.length===1?``:`s`)+` (Settings → Export targets). `,1)])):W(``,!0),o.value?(R(),z(`p`,tE,k(o.value),1)):W(``,!0),i.value?(R(),z(`div`,nE,` Generating preview… `)):o.value?W(``,!0):(R(),z(L,{key:3},[c.value.length?(R(),z(`div`,rE,[V(`p`,iE,[H(j(Td),{class:`size-4`}),U(` `+k(c.value.length)+` warning`+k(c.value.length===1?``:`s`),1)]),V(`ul`,aE,[(R(!0),z(L,null,F(c.value,(e,t)=>(R(),z(`li`,{key:t},k(e),1))),128))])])):W(``,!0),V(`div`,oE,[V(`ul`,sE,[(R(!0),z(L,null,F(s.value,e=>(R(),z(`li`,{key:e.path},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:O(j(eS)(`w-full truncate px-3 py-1.5 text-left font-mono text-xs transition-colors`,e.path===l.value?`bg-accent text-accent-foreground`:`hover:bg-muted/60`)),onClick:t=>l.value=e.path},k(e.path),11,cE)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.path),1)]),_:2},1024)]),_:2},1024)]))),128)),s.value.length===0?(R(),z(`li`,lE,` No files to write. `)):W(``,!0)]),u.value?(R(),z(`pre`,uE,k(u.value.contents),1)):(R(),z(`div`,dE,` Select a file to preview its contents. `))])],64)),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:a.value,onClick:d[0]||=e=>t.value=!1},{default:M(()=>[...d[4]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:i.value||a.value||s.value.length===0,onClick:f},{default:M(()=>[H(j(Hu),{class:`size-4`}),U(` `+k(a.value?`Writing…`:`Write ${s.value.length} file${s.value.length===1?``:`s`}`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),pE={class:`relative h-2 w-full overflow-hidden rounded-full bg-muted`},mE=P({__name:`Progress`,props:{modelValue:{}},setup(e){return(t,n)=>(R(),z(`div`,pE,[V(`div`,{class:`h-full bg-primary transition-all`,style:ge({width:`${Math.min(100,Math.max(0,e.modelValue??0))}%`})},null,4)]))}}),hE={key:0,class:`rounded-md border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`},gE={class:`font-medium text-foreground`},_E={key:0,class:`mt-0.5`},vE={key:1,class:`mt-1`},yE={class:`mt-1`},bE={key:1,class:`flex min-h-0 flex-col gap-1.5`},xE={class:`flex justify-between text-xs text-muted-foreground`},SE={key:0},CE={key:0,class:`mt-1 flex max-h-56 min-h-0 flex-col overflow-y-auto rounded-md border text-sm`},wE={key:2,class:`flex flex-col gap-1 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive`},TE={class:`flex items-center gap-1.5 font-medium`},EE={key:3,class:`flex min-h-0 flex-col gap-1.5`},DE={class:`flex items-center gap-1.5 text-sm font-medium text-amber-700 dark:text-amber-400`},OE={class:`min-h-0 flex-1 overflow-y-auto rounded-md border text-sm`},kE={class:`inline-flex items-center gap-1.5 font-mono text-xs`},AE={class:`text-muted-foreground`},jE=P({__name:`TranslateDialog`,props:ka({state:{},filteredKeys:{},targetLocale:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`changed`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=A(!1),o=A(``),s=A([]),c=A(0),l=A(0),u=null,d=A([]),f=e=>d.value.find(t=>t.locale===e),p=K(()=>d.value.filter(e=>e.status===`active`).length),m={active:0,queued:1,done:2},h=K(()=>[...d.value].sort((e,t)=>m[e.status]-m[t.status])),g=e=>e===`active`?$u:e===`done`?Du:Nu,_=K(()=>{let e=n.state;return e?n.targetLocale?[n.targetLocale]:e.config.locales.filter(t=>t!==e.config.sourceLocale):[]}),v=K(()=>{let e=n.state;if(!e)return 0;let t=n.filteredKeys?new Set(n.filteredKeys):null,r=0;for(let[n,i]of Object.entries(e.keys))if(!(t&&!t.has(n))&&!i.skipTranslate)for(let t of _.value)eC(i,t,e.config.sourceLocale)&&r++;return r}),y=A(null),b=K(()=>y.value??v.value),x=A(null),S=e=>e>=1e4?`${Math.round(e/1e3)}k`:e.toLocaleString(),C=e=>e>=.1?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`;async function w(){x.value=null;try{x.value=await Kd({keys:n.filteredKeys?.length?n.filteredKeys:void 0,locales:n.targetLocale?[n.targetLocale]:void 0})}catch{}}N(r,e=>{e&&(o.value=``,s.value=[],c.value=0,l.value=0,d.value=[],y.value=null,w())},{immediate:!0});function T(){u?.abort()}async function ee(){u=new AbortController,a.value=!0,o.value=``,s.value=[],c.value=0,d.value=[],y.value=v.value,l.value=y.value;try{let e=u.signal,t=0,a=n.filteredKeys?.length?n.filteredKeys:void 0,o=n.targetLocale?[n.targetLocale]:void 0,p=o?[e,a,o]:a?[e,a]:[e];for await(let e of qd(...p))if(e.type===`start`)l.value=e.total,d.value=e.locales.map(e=>({locale:e.locale,total:e.total,done:0,status:`queued`}));else if(e.type===`locale-start`){let t=f(e.locale);t&&(t.status=`active`)}else if(e.type===`progress`){c.value=e.done,l.value=e.total;let t=f(e.locale);t&&(t.done=e.localeDone,t.status===`queued`&&(t.status=`active`)),i(`changed`)}else if(e.type===`locale-done`){let t=f(e.locale);t&&(t.status=`done`,t.done=t.total)}else e.type===`done`&&(t=e.written,s.value=e.errors,c.value=l.value,i(`changed`));e.aborted||($.success(`Translated ${t} string${t===1?``:`s`}`),s.value.length===0&&(r.value=!1))}catch(e){e.name!==`AbortError`&&(o.value=e.message)}finally{a.value=!1,u=null}}return(e,t)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":t[1]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] max-w-lg flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[2]||=[U(`Translate missing strings`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[b.value===0?(R(),z(L,{key:0},[U(`Nothing missing — all translations are filled.`)],64)):(R(),z(L,{key:1},[U(` Translate `+k(b.value.toLocaleString())+` missing string`+k(b.value===1?``:`s`)+` across `+k(_.value.length)+` language`+k(_.value.length===1?``:`s`)+` with Claude? This sends source strings + context to the AI provider. `,1)],64))]),_:1})]),_:1}),x.value&&x.value.requests>0&&b.value>0&&!a.value&&c.value===0?(R(),z(`div`,hE,[V(`p`,null,[U(` ≈ `+k(x.value.requests.toLocaleString())+` requests · `+k(x.value.batches.toLocaleString())+` batch`+k(x.value.batches===1?``:`es`)+` · ~`+k(S(x.value.inputTokens))+` in / ~`+k(S(x.value.outputTokens))+` out tokens`,1),x.value.estimatedCost===null?W(``,!0):(R(),z(L,{key:0},[t[3]||=U(` · `,-1),V(`span`,gE,`≈ `+k(C(x.value.estimatedCost)),1),t[4]||=U(` (±20%)`,-1)],64))]),x.value.pricing?W(``,!0):(R(),z(`p`,_E,` No pricing known for this model — set a price in Settings → AI for a dollar estimate. `)),x.value.perLocale.length>1?(R(),z(`details`,vE,[t[5]||=V(`summary`,{class:`cursor-pointer select-none`},`Per-language breakdown`,-1),V(`ul`,yE,[(R(!0),z(L,null,F(x.value.perLocale,e=>(R(),z(`li`,{key:e.locale,class:`flex justify-between font-mono tabular-nums`},[V(`span`,null,k(e.locale),1),V(`span`,null,k(e.requests.toLocaleString())+` req · ~`+k(S(e.inputTokens))+` / ~`+k(S(e.outputTokens)),1)]))),128))])])):W(``,!0)])):W(``,!0),a.value||c.value>0?(R(),z(`div`,bE,[V(`div`,xE,[V(`span`,null,k(c.value.toLocaleString())+` / `+k(l.value.toLocaleString())+` translated`,1),a.value&&d.value.length?(R(),z(`span`,SE,k(p.value)+` of `+k(d.value.length)+` language`+k(d.value.length===1?``:`s`)+` active`,1)):W(``,!0)]),H(j(mE),{"model-value":l.value>0?c.value/l.value*100:0},null,8,[`model-value`]),d.value.length?(R(),z(`ul`,CE,[(R(!0),z(L,null,F(h.value,e=>(R(),z(`li`,{key:e.locale,class:O([`flex items-center gap-2 border-b px-3 py-1.5 last:border-b-0`,e.status===`queued`&&`opacity-55`])},[(R(),B(aa(g(e.status)),{class:O([`size-3.5 shrink-0`,e.status===`active`?`animate-spin text-primary`:e.status===`done`?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`])},null,8,[`class`])),H(UC,{code:e.locale,size:14,"show-name":``},null,8,[`code`]),V(`span`,{class:O([`ml-auto font-mono text-xs tabular-nums`,e.status===`active`?`text-foreground`:`text-muted-foreground`])},k(e.done.toLocaleString())+` / `+k(e.total.toLocaleString()),3)],2))),128))])):W(``,!0)])):W(``,!0),o.value?(R(),z(`div`,wE,[V(`p`,TE,[H(j(Td),{class:`size-4`}),t[6]||=U(` Translation failed `,-1)]),V(`p`,null,k(o.value),1)])):W(``,!0),s.value.length?(R(),z(`div`,EE,[V(`p`,DE,[H(j(Td),{class:`size-4`}),U(` `+k(s.value.length)+` string`+k(s.value.length===1?``:`s`)+` could not be translated `,1)]),V(`ul`,OE,[(R(!0),z(L,null,F(s.value,(e,t)=>(R(),z(`li`,{key:`${e.key}-${e.locale}-${t}`,class:`border-b px-3 py-1.5 last:border-b-0`},[V(`span`,kE,[U(k(e.key)+` @ `,1),H(UC,{code:e.locale,size:12},null,8,[`code`])]),V(`span`,AE,` — `+k(e.error),1)]))),128))])])):W(``,!0),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,onClick:t[0]||=e=>a.value?T():r.value=!1},{default:M(()=>[U(k(a.value?`Cancel`:`Close`),1)]),_:1}),b.value>0?(R(),B(j(Q),{key:0,disabled:a.value,onClick:ee},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` `+k(a.value?`Translating…`:`Translate`),1)]),_:1},8,[`disabled`])):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),ME={key:0,class:`flex flex-col gap-1.5`},NE={class:`flex justify-between text-xs text-muted-foreground`},PE={key:1,class:`flex flex-col gap-1 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive`},FE={class:`flex items-center gap-1.5 font-medium`},IE={key:2,class:`flex min-h-0 flex-col gap-1.5`},LE={class:`flex items-center gap-1.5 text-sm font-medium text-amber-700 dark:text-amber-400`},RE={class:`min-h-0 flex-1 overflow-y-auto rounded-md border text-sm`},zE={class:`font-mono text-xs`},BE={class:`text-muted-foreground`},VE=P({__name:`ContextDialog`,props:ka({state:{},keys:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`changed`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=A(!1),o=A(null),s=A(``),c=A([]),l=A(0),u=A(0),d=K(()=>{let e=n.state;return e?n.keys.filter(t=>e.keys[t]&&!e.keys[t].context).length:0});N(r,e=>{e?(s.value=``,c.value=[],l.value=0,u.value=0):o.value?.abort()});function f(){o.value?.abort()}async function p(){a.value=!0,s.value=``,c.value=[],l.value=0,u.value=0,o.value=new AbortController;let e=!1;try{for await(let t of Jd({keys:n.keys},o.value.signal))t.type===`start`?u.value=t.total:t.type===`progress`?(l.value=t.done,u.value=t.total):t.type===`done`&&(e=!0,l.value=u.value,c.value=t.errors,i(`changed`),$.success(`Built context for ${t.written} key${t.written===1?``:`s`}`),t.errors.length===0&&(r.value=!1))}catch(e){s.value=e.message}finally{!e&&o.value?.signal.aborted&&(i(`changed`),$(`Build cancelled after ${l.value} of ${u.value} keys`)),o.value=null,a.value=!1}}return(e,t)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":t[1]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] max-w-lg flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[2]||=[U(`Build context`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[d.value===0?(R(),z(L,{key:0},[U(` All selected keys already have context — nothing to build. `)],64)):(R(),z(L,{key:1},[U(` Build AI context notes for `+k(d.value)+` selected key`+k(d.value===1?``:`s`)+` that currently have none? The AI will scan call-site code snippets to write a short translator hint for each key. `,1)],64))]),_:1})]),_:1}),a.value||l.value>0?(R(),z(`div`,ME,[V(`div`,NE,[V(`span`,null,k(l.value.toLocaleString())+` / `+k(u.value.toLocaleString())+` built`,1)]),H(j(mE),{"model-value":u.value>0?l.value/u.value*100:0},null,8,[`model-value`])])):W(``,!0),s.value?(R(),z(`div`,PE,[V(`p`,FE,[H(j(Td),{class:`size-4`}),t[3]||=U(` Build failed `,-1)]),V(`p`,null,k(s.value),1)])):W(``,!0),c.value.length?(R(),z(`div`,IE,[V(`p`,LE,[H(j(Td),{class:`size-4`}),U(` `+k(c.value.length)+` key`+k(c.value.length===1?``:`s`)+` could not be processed `,1)]),V(`ul`,RE,[(R(!0),z(L,null,F(c.value,(e,t)=>(R(),z(`li`,{key:`${e.key}-${t}`,class:`border-b px-3 py-1.5 last:border-b-0`},[V(`span`,zE,k(e.key),1),V(`span`,BE,` — `+k(e.error),1)]))),128))])])):W(``,!0),H(j(zS),null,{default:M(()=>[a.value?(R(),B(j(Q),{key:0,variant:`outline`,onClick:f},{default:M(()=>[...t[4]||=[U(`Cancel`,-1)]]),_:1})):(R(),B(j(Q),{key:1,variant:`outline`,onClick:t[0]||=e=>r.value=!1},{default:M(()=>[...t[5]||=[U(`Close`,-1)]]),_:1})),d.value>0?(R(),B(j(Q),{key:2,disabled:a.value,onClick:p},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` `+k(a.value?`Building…`:`Build context`),1)]),_:1},8,[`disabled`])):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),HE={class:`relative w-0 shrink-0`},UE=[`aria-valuenow`,`aria-valuemin`,`aria-valuemax`],WE=P({__name:`ResizeHandle`,props:{side:{},width:{},min:{},max:{}},emits:[`update:width`,`commit`,`reset`],setup(e,{emit:t}){let n=e,r=t,i=A(!1);function a(e){if(e.button!==0)return;let t=e.currentTarget,a=e.clientX,o=n.width,s=n.side===`right`?1:-1;i.value=!0,t.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let c=e=>Math.min(n.max,Math.max(n.min,Math.round(e))),l=e=>{r(`update:width`,c(o+s*(e.clientX-a)))},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),document.body.style.cursor=``,document.body.style.userSelect=``,i.value=!1,r(`commit`)};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u)}return(t,n)=>(R(),z(`div`,HE,[V(`div`,{class:O(j(eS)(`absolute inset-y-0 -left-1 z-10 w-2 cursor-col-resize transition-colors hover:bg-primary/20`,i.value&&`bg-primary/30`)),role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":e.width,"aria-valuemin":e.min,"aria-valuemax":e.max,"aria-label":`Resize panel (double-click to reset)`,onPointerdown:a,onDblclick:n[0]||=e=>r(`reset`)},null,42,UE)]))}});function GE(e,t,n,r){let i=`glotfile-${e}`,a=e=>Math.min(r,Math.max(n,Math.round(e))),o=A((()=>{let e=Number(localStorage.getItem(i));return Number.isFinite(e)&&e>0?a(e):t})()),s=()=>{localStorage.setItem(i,String(o.value)),tf({[e]:o.value}).catch(()=>{})};return{width:o,min:n,max:r,set:e=>{o.value=a(e)},commit:s,reset:()=>{o.value=t,s()},syncValue:e=>{typeof e==`number`&&Number.isFinite(e)&&(o.value=a(e),localStorage.setItem(i,String(o.value)))}}}var KE=GE(`keyColumnWidth`,272,180,560),qE=GE(`detailPanelWidth`,420,320,720);async function JE(e){try{let t=e??await ef();KE.syncValue(t.keyColumnWidth),qE.syncValue(t.detailPanelWidth)}catch{}}var YE={class:`flex min-h-0 flex-1 flex-col`},XE={class:`flex shrink-0 flex-wrap items-center gap-2 border-b px-4 py-2`},ZE={class:`relative`},QE={key:0,class:`rounded bg-primary px-1.5 text-xs text-primary-foreground`},$E=[`aria-label`],eD={key:0},tD={class:`ml-auto flex items-center gap-2`},nD={class:`mr-1 text-xs text-muted-foreground tabular-nums`},rD={key:2},iD={key:3},aD={key:4},oD={key:0,class:`flex shrink-0 flex-wrap items-center gap-1.5 border-b px-4 py-1.5`},sD=[`aria-label`,`onClick`],cD=[`aria-label`,`onClick`],lD=[`aria-label`,`onClick`],uD={key:1,class:`sticky top-0 z-20 flex h-11 shrink-0 items-center gap-2 border-b bg-background pl-[18px] pr-4`},dD=[`aria-checked`,`aria-label`],fD={class:`text-sm font-medium tabular-nums`},pD={class:`text-sm text-muted-foreground`},mD={key:1,for:`select-all-checkbox`,class:`cursor-pointer select-none text-sm text-muted-foreground`},hD={class:`relative min-w-0 flex-1 overflow-hidden`},gD={key:0,class:`flex h-full items-center justify-center gap-2 p-8 text-sm text-muted-foreground`},_D={key:1,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},vD=[`data-index`],yD=`glotfile:enabledChecks`,bD=P({__name:`EditorView`,setup(e){let t=KE.width,n=qE.width,r=fn(null),{filter:i,sort:a,view:o,locale:s}=mp(Cp()),c=A(i),l=XS();function u(){try{let e=localStorage.getItem(yD);if(e){let t=JSON.parse(e);return rp.filter(e=>t.includes(e))}}catch{}return[...ip]}let d=A(u()),f=A(new Map),p=A(null),m=A(!1),h=A(0);async function g(){try{let e=await Qd();m.value=e.indexed,p.value=e.indexed?new Set(e.used):null}catch{m.value=!1,p.value=null}h.value++}let _=A(!1),v=0;async function y(){if(d.value.length===0){f.value=new Map,_.value=!1;return}try{let e=await wf(d.value);f.value=up(e.issues),_.value=e.spellPending,e.spellPending&&v<6?(v++,setTimeout(y,800)):v=0}catch{f.value=new Map}}N(d,e=>{localStorage.setItem(yD,JSON.stringify(e)),v=0,y()},{deep:!0});let b=A(a),x=A(o),S=A(s),C=null;N([b,x,S,()=>({...c.value,text:void 0})],()=>{wp(hp({filter:c.value,sort:b.value,view:x.value,locale:S.value}))},{deep:!0}),N(()=>c.value.text,()=>{C&&clearTimeout(C),C=setTimeout(()=>{wp(hp({filter:c.value,sort:b.value,view:x.value,locale:S.value}))},300)});let w=K(()=>c.value.states.length+c.value.issues.length+c.value.plurality.length+ +!!c.value.emptySource+ +!!c.value.aiContextUnreviewed+ +!!c.value.noUsages+ +!!c.value.skipTranslate),T=K(()=>{let e=0;for(let t of f.value.values())e+=t.length;return e});function ee(e){c.value.states=c.value.states.filter(t=>t!==e)}function E(e){c.value.issues=c.value.issues.filter(t=>t!==e)}function te(e){c.value.plurality=c.value.plurality.filter(t=>t!==e)}if(Tp.value){let e=Tp.value;c.value={text:``,states:[],issues:[],plurality:[],tag:``,needsAttention:!1,emptySource:!1,aiContextUnreviewed:!1,noUsages:!1,skipTranslate:!1,...e},e.locale&&(x.value=`bilingual`,S.value=e.locale),Tp.value=null}let ne=A(null);Dp.value&&=(ne.value=Dp.value,null);let re=A(!1),ie=A(!1),ae=A(!1),oe=A(!1),se=A(!1),ce=A(null),D=A(null),le=A(!0),ue=A(!1);async function de(){r.value=await jd(),y()}let fe=setTimeout(()=>{le.value&&(ue.value=!0)},250);de().finally(()=>{le.value=!1,ue.value=!1,clearTimeout(fe)});let pe=K(()=>r.value?.config.sourceLocale??``),me=K(()=>r.value?.config.locales??[]),he=K(()=>me.value.filter(e=>e!==pe.value));N(he,e=>{!S.value&&e.length>0&&(S.value=e[0])},{immediate:!0});let _e=K(()=>{if(x.value===`bilingual`)return S.value?[pe.value,S.value]:[pe.value];let e=me.value.filter(e=>e!==pe.value);return[pe.value,...e]}),ve=K(()=>{let e=r.value;if(!e)return[];let t=x.value===`bilingual`&&S.value?S.value:void 0;return np(e,{...c.value,locale:t},f.value,p.value??void 0)}),ye=K(()=>{let e=r.value,t=ve.value;if(b.value===`key-desc`)return[...t].reverse();if(b.value===`created`){let n=t=>{let n=e?.keys[t]?.createdAt;return n?Date.parse(n):0};return[...t].sort((e,t)=>n(t)-n(e))}if(b.value===`updated`){let n=t=>{let n=Object.values(e?.keys[t]?.values??{}),r=0;for(let e of n){let t=e.updatedAt?Date.parse(e.updatedAt):0;t>r&&(r=t)}return r};return[...t].sort((e,t)=>n(t)-n(e))}return t}),be=K(()=>x.value===`bilingual`?S.value?[S.value]:[]:he.value),xe=K(()=>x.value===`bilingual`?S.value||`—`:`all ${he.value.length} targets`),Se=K(()=>l.keys()),Ce=K(()=>l.count.value),we=K(()=>l.allSelected(ye.value)),Te=K(()=>l.someSelected(ye.value)),Ee=K(()=>{let e=r.value;if(!e)return[];let t=new Set;for(let n of l.keys())for(let r of e.keys[n]?.tags??[])t.add(r);return[...t].sort()});function De(){l.allSelected(ye.value)?l.clear():l.selectAll(ye.value)}function Oe(e,t){t?l.toggleRange(e,ye.value):l.toggle(e)}N(ye,e=>l.pruneTo(e));let ke=K(()=>r.value&&ne.value?r.value.keys[ne.value]??null:null),Ae=Qf(K(()=>({count:ye.value.length,getScrollElement:()=>D.value,estimateSize:()=>56,overscan:8,getItemKey:e=>ye.value[e]??e}))),je=K(()=>Ae.value.getVirtualItems()),Me=K(()=>Ae.value.getTotalSize());function Ne(e){ne.value=e}let Pe=A(null);function Fe(){let e=Pe.value?.$el;e?.focus?.(),e?.select?.()}function Ie(e){let t=e.target,n=!!(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)),r=!!document.querySelector(`[role="listbox"],[role="menu"],[role="dialog"]`);if(e.key===`/`&&!n&&!r&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault(),Fe();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`||n||r)return;let i=ye.value;if(i.length===0)return;e.preventDefault();let a=ne.value?i.indexOf(ne.value):-1,o=Math.max(0,Math.min(i.length-1,e.key===`ArrowDown`?a+1:a-1)),s=i[o];s&&(ne.value=s,Ae.value.scrollToIndex(o,{align:`auto`}))}Ki(()=>window.addEventListener(`keydown`,Ie)),Xi(()=>{window.removeEventListener(`keydown`,Ie),C&&clearTimeout(C)}),Ki(async()=>{try{let e=await Xd();e.indexed&&!ce.value&&!se.value&&(ce.value=`${e.files.toLocaleString()} files · ${e.refs.toLocaleString()} refs`)}catch{}g()});async function Le(e,t){ne.value===e&&(ne.value=t),await de()}async function Re(e){await de(),ne.value=e,c.value.text=`"${e}"`}async function ze(){se.value=!0,ce.value=null;try{let e=await Yd();ce.value=`${e.files.toLocaleString()} files · ${e.refs.toLocaleString()} refs`,await g()}catch{ce.value=`Scan failed`}finally{se.value=!1}}return(e,i)=>(R(),B(j(vb),{"delay-duration":400},{default:M(()=>[V(`div`,YE,[V(`div`,XE,[V(`div`,ZE,[H(j(pd),{class:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),H(j(rS),{ref_key:`searchInput`,ref:Pe,modelValue:c.value.text,"onUpdate:modelValue":i[0]||=e=>c.value.text=e,placeholder:`Search keys, values, context…`,class:`h-8 w-64 pl-8 pr-8`,onKeydown:i[1]||=Xl(e=>c.value.text=``,[`esc`])},null,8,[`modelValue`]),c.value.text?(R(),z(`button`,{key:0,type:`button`,class:`absolute right-1.5 top-1/2 grid size-5 -translate-y-1/2 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,"aria-label":`Clear search`,onClick:i[2]||=e=>c.value.text=``},[H(j(kd),{class:`size-3.5`})])):W(``,!0)]),H(j(dy),null,{default:M(()=>[H(j(_y),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`outline`,size:`sm`,class:`h-8 gap-1.5`},{default:M(()=>[H(j(Qu),{class:`size-4 opacity-60`}),i[29]||=U(` Filter `,-1),w.value?(R(),z(`span`,QE,k(w.value),1)):W(``,!0)]),_:1})]),_:1}),H(j(uS),{align:`start`,class:`w-64`},{default:M(()=>[H(DS,{states:c.value.states,"onUpdate:states":i[3]||=e=>c.value.states=e,issues:c.value.issues,"onUpdate:issues":i[4]||=e=>c.value.issues=e,enabled:d.value,"onUpdate:enabled":i[5]||=e=>d.value=e,plurality:c.value.plurality,"onUpdate:plurality":i[6]||=e=>c.value.plurality=e,"empty-source":c.value.emptySource,"onUpdate:emptySource":i[7]||=e=>c.value.emptySource=e,"ai-context-unreviewed":c.value.aiContextUnreviewed,"onUpdate:aiContextUnreviewed":i[8]||=e=>c.value.aiContextUnreviewed=e,"no-usages":c.value.noUsages,"onUpdate:noUsages":i[9]||=e=>c.value.noUsages=e,"skip-translate":c.value.skipTranslate,"onUpdate:skipTranslate":i[10]||=e=>c.value.skipTranslate=e,"scan-indexed":m.value},null,8,[`states`,`issues`,`enabled`,`plurality`,`empty-source`,`ai-context-unreviewed`,`no-usages`,`skip-translate`,`scan-indexed`])]),_:1})]),_:1}),H(j(Q),{variant:c.value.needsAttention?`default`:`outline`,size:`sm`,class:`h-8 gap-1.5`,role:`switch`,"aria-checked":c.value.needsAttention,onClick:i[11]||=e=>c.value.needsAttention=!c.value.needsAttention},{default:M(()=>[H(j(Td),{class:O([`size-4`,c.value.needsAttention?``:`opacity-60`])},null,8,[`class`]),i[30]||=U(` Needs attention `,-1),T.value?(R(),z(`span`,{key:0,class:`ml-0.5 rounded-full bg-destructive-soft px-1.5 text-[11px] font-bold text-destructive tabular-nums`,"aria-label":`${T.value} issue${T.value===1?``:`s`}`},k(T.value.toLocaleString()),9,$E)):W(``,!0)]),_:1},8,[`variant`,`aria-checked`]),H(j(Iy),{modelValue:b.value,"onUpdate:modelValue":i[12]||=e=>b.value=e},{default:M(()=>[H(j(iS),{class:`h-8 w-[160px]`},{default:M(()=>[H(j(rb),{placeholder:`Sort`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`key-asc`},{default:M(()=>[...i[31]||=[U(`Key A→Z`,-1)]]),_:1}),H(j(sS),{value:`key-desc`},{default:M(()=>[...i[32]||=[U(`Key Z→A`,-1)]]),_:1}),H(j(sS),{value:`created`},{default:M(()=>[...i[33]||=[U(`Recently created`,-1)]]),_:1}),H(j(sS),{value:`updated`},{default:M(()=>[...i[34]||=[U(`Recently updated`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),H(j(db),{modelValue:x.value,"onUpdate:modelValue":i[13]||=e=>x.value=e},{default:M(()=>[H(j(cS),{class:`h-8`},{default:M(()=>[H(j(lS),{value:`bilingual`,class:`text-xs`},{default:M(()=>[...i[35]||=[U(`Bilingual`,-1)]]),_:1}),H(j(lS),{value:`multilingual`,class:`text-xs`},{default:M(()=>[...i[36]||=[U(`Multilingual`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),x.value===`bilingual`?(R(),B(j(Iy),{key:0,modelValue:S.value,"onUpdate:modelValue":i[14]||=e=>S.value=e},{default:M(()=>[H(j(iS),{class:`h-8 w-[150px]`},{default:M(()=>[S.value?(R(),z(`span`,eD,[H(UC,{code:S.value,"show-name":``,"show-code":!1,size:14},null,8,[`code`])])):(R(),B(j(rb),{key:1,placeholder:`Locale`}))]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(he.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[H(UC,{code:e,"show-name":``,"show-code":!1,size:14},null,8,[`code`])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])):W(``,!0),V(`div`,tD,[V(`span`,nD,k(ye.value.length.toLocaleString())+` keys`,1),H(j(Q),{size:`sm`,variant:`outline`,onClick:i[15]||=e=>ie.value=!0},{default:M(()=>[H(j(Hu),{class:`size-4`}),i[37]||=U(` Export `,-1)]),_:1}),H(j(Q),{size:`sm`,variant:`outline`,disabled:se.value,onClick:ze},{default:M(()=>[se.value?(R(),B(j($u),{key:0,class:`size-4 animate-spin`})):(R(),B(j(dd),{key:1,class:`size-4`})),se.value?(R(),z(`span`,rD,`Scanning…`)):ce.value?(R(),z(`span`,iD,k(ce.value),1)):(R(),z(`span`,aD,`Scan`))]),_:1},8,[`disabled`]),H(j(Q),{size:`sm`,onClick:i[16]||=e=>re.value=!0},{default:M(()=>[H(j(od),{class:`size-4`}),i[38]||=U(` Add key `,-1)]),_:1})])]),c.value.states.length||c.value.issues.length||c.value.plurality.length||c.value.emptySource||c.value.aiContextUnreviewed||c.value.noUsages||c.value.skipTranslate?(R(),z(`div`,oD,[(R(!0),z(L,null,F(c.value.states,e=>(R(),B(j(dS),{key:`s-${e}`,variant:`secondary`,class:`gap-1`},{default:M(()=>[U(k(j(cp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(cp)[e]} filter`,onClick:t=>ee(e)},[H(j(kd),{class:`size-3`})],8,sD)]),_:2},1024))),128)),(R(!0),z(L,null,F(c.value.plurality,e=>(R(),B(j(dS),{key:`p-${e}`,variant:`secondary`,class:`gap-1`},{default:M(()=>[U(k(j(lp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(lp)[e]} filter`,onClick:t=>te(e)},[H(j(kd),{class:`size-3`})],8,cD)]),_:2},1024))),128)),c.value.emptySource?(R(),B(j(dS),{key:0,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[39]||=U(` Empty source `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Empty source filter`,onClick:i[17]||=e=>c.value.emptySource=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),(R(!0),z(L,null,F(c.value.issues,e=>(R(),B(j(dS),{key:`i-${e}`,variant:`outline`,class:`gap-1`},{default:M(()=>[U(k(j(sp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(sp)[e]} filter`,onClick:t=>E(e)},[H(j(kd),{class:`size-3`})],8,lD)]),_:2},1024))),128)),c.value.aiContextUnreviewed?(R(),B(j(dS),{key:1,variant:`secondary`,class:`gap-1`},{default:M(()=>[H(j(vd),{class:`size-3`}),i[40]||=U(` AI context (unreviewed) `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove AI context filter`,onClick:i[18]||=e=>c.value.aiContextUnreviewed=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),c.value.noUsages?(R(),B(j(dS),{key:2,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[41]||=U(` Unused `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Unused filter`,onClick:i[19]||=e=>c.value.noUsages=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),c.value.skipTranslate?(R(),B(j(dS),{key:3,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[42]||=U(` Skip-translate `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Skip-translate filter`,onClick:i[20]||=e=>c.value.skipTranslate=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0)])):W(``,!0),ye.value.length?(R(),z(`div`,uD,[V(`button`,{id:`select-all-checkbox`,type:`button`,role:`checkbox`,"aria-checked":we.value?`true`:Te.value?`mixed`:`false`,"data-testid":`select-all`,class:O([`flex size-4 items-center justify-center rounded border transition-colors`,we.value||Te.value?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`]),"aria-label":we.value?`Deselect all`:`Select all`,onClick:De},[we.value?(R(),B(j(Du),{key:0,class:`size-3`})):Te.value?(R(),B(j(td),{key:1,class:`size-3`})):W(``,!0)],10,dD),Ce.value?(R(),z(L,{key:0},[V(`span`,fD,k(Ce.value.toLocaleString())+` selected`,1),V(`span`,pD,`· `+k(xe.value),1)],64)):(R(),z(`label`,mD,`Select all`)),Ce.value?(R(),B(YS,{key:2,class:`ml-auto`,keys:Se.value,locales:be.value,"scope-label":xe.value,"tags-on-selection":Ee.value,onChanged:de,onClear:i[21]||=e=>j(l).clear(),onTranslate:i[22]||=e=>ae.value=!0,onBuildContext:i[23]||=e=>oe.value=!0},null,8,[`keys`,`locales`,`scope-label`,`tags-on-selection`])):W(``,!0)])):W(``,!0),V(`div`,{class:`flex min-h-0 flex-1 overflow-hidden`,style:ge({"--key-col-width":`${j(t)}px`})},[V(`div`,hD,[V(`div`,{ref_key:`parent`,ref:D,class:`h-full overflow-auto`},[ue.value?(R(),z(`div`,gD,[H(j($u),{class:`size-4 animate-spin`}),i[43]||=U(` Loading… `,-1)])):!le.value&&ye.value.length===0?(R(),z(`div`,_D,` No keys match the current filter. `)):(R(),z(`div`,{key:2,style:ge({height:`${Me.value}px`,position:`relative`,width:`100%`})},[(R(!0),z(L,null,F(je.value,e=>(R(),z(`div`,{key:e.key,ref_for:!0,ref:e=>j(Ae).measureElement(e),"data-index":e.index,style:ge({position:`absolute`,top:`${e.start}px`,left:`0`,width:`100%`})},[r.value&&ye.value[e.index]?(R(),B(Cw,{key:0,"key-name":ye.value[e.index],entry:r.value.keys[ye.value[e.index]],"source-locale":pe.value,locales:_e.value,selected:ne.value===ye.value[e.index],issues:f.value.get(ye.value[e.index])??[],checked:j(l).has(ye.value[e.index]),onSelect:t=>Ne(ye.value[e.index]),onChanged:de,onRenamed:t=>Le(ye.value[e.index],t),onFilterTag:i[24]||=e=>c.value.text=e,onToggleSelect:t=>Oe(ye.value[e.index],t.shift)},null,8,[`key-name`,`entry`,`source-locale`,`locales`,`selected`,`issues`,`checked`,`onSelect`,`onRenamed`,`onToggleSelect`])):W(``,!0)],12,vD))),128))],4))],512),ye.value.length?(R(),z(`div`,{key:0,class:`absolute inset-y-0`,style:ge({left:`${j(t)}px`})},[H(WE,{side:`right`,class:`h-full`,width:j(t),min:j(KE).min,max:j(KE).max,"onUpdate:width":j(KE).set,onCommit:j(KE).commit,onReset:j(KE).reset},null,8,[`width`,`min`,`max`,`onUpdate:width`,`onCommit`,`onReset`])],4)):W(``,!0)]),H(WE,{side:`left`,class:`max-[1080px]:hidden`,width:j(n),min:j(qE).min,max:j(qE).max,"onUpdate:width":j(qE).set,onCommit:j(qE).commit,onReset:j(qE).reset},null,8,[`width`,`min`,`max`,`onUpdate:width`,`onCommit`,`onReset`]),H(GT,{"key-name":ne.value,entry:ke.value,issues:ne.value?f.value.get(ne.value)??[]:[],locales:me.value,"source-locale":pe.value,"usage-revision":h.value,style:ge({width:`${j(n)}px`}),onChanged:de},null,8,[`key-name`,`entry`,`issues`,`locales`,`source-locale`,`usage-revision`,`style`])],4),H($T,{open:re.value,"onUpdate:open":i[25]||=e=>re.value=e,onCreated:Re},null,8,[`open`]),H(fE,{open:ie.value,"onUpdate:open":i[26]||=e=>ie.value=e,"export-locales":r.value?.config.exportLocales??[]},null,8,[`open`,`export-locales`]),H(jE,{open:ae.value,"onUpdate:open":i[27]||=e=>ae.value=e,state:r.value,"filtered-keys":Se.value,"target-locale":x.value===`bilingual`?S.value:void 0,onChanged:de},null,8,[`open`,`state`,`filtered-keys`,`target-locale`]),H(VE,{open:oe.value,"onUpdate:open":i[28]||=e=>oe.value=e,state:r.value,keys:Se.value,onChanged:de},null,8,[`open`,`state`,`keys`])])]),_:1}))}}),xD={"empty-source":`Empty source`,"empty-translation":`Untranslated`,"placeholder-mismatch":`Placeholder mismatch`,"icu-mismatch":`ICU mismatch`,"glossary-violation":`Glossary`,"max-length":`Too long`,"identical-to-source":`Identical to source`,whitespace:`Whitespace`,spelling:`Spelling`,"output-stale":`Outputs out of date`},SD={"empty-translation":`untranslated`,"placeholder-mismatch":`placeholder`,"glossary-violation":`glossary`,"max-length":`length`,spelling:`spelling`};function CD(e){if(e.ruleId===`empty-translation`)return{text:e.key,states:[`missing`]};if(e.ruleId===`output-stale`)return{};let t=SD[e.ruleId],n=e.locale?{locale:e.locale}:{};return t?{...n,issues:[t]}:{...n,text:e.key}}function wD(e,t){let n=e.values[t];return n?e.plural?(n.forms?.other??``).trim()!==``:(n.value??``).trim()!==``:!1}function TD(e,t){if(!wD(e,t))return`missing`;let n=e.values[t].state;return n===`reviewed`?`reviewed`:n===`needs-review`?`needsReview`:`machine`}function ED(e,t){let n=e.values[t];return n?e.plural?n.forms?.other??``:n.value??``:``}function DD(e){let t=e.trim();return t===``?0:t.split(/\s+/).length}function OD(e,t){return`${e} ${t}${e===1?``:`s`}`}function kD(e,t){let{sourceLocale:n,locales:r}=e.config,i=r.filter(e=>e!==n),a=Object.keys(e.keys).filter(t=>!e.keys[t].skipTranslate),o=t.findings.filter(e=>e.locale===``),s=o.filter(e=>e.severity===`error`).length,c=new Map;for(let e of t.findings){if(e.locale===``)continue;let t=c.get(e.locale);t?t.push(e):c.set(e.locale,[e])}let l=i.map(t=>{let n={reviewed:0,needsReview:0,machine:0,missing:0},r=[];for(let i of a){let a=TD(e.keys[i],t);n[a]++,a===`needsReview`&&r.push(i)}let i=c.get(t)??[],o=[...new Set(i.filter(e=>e.ruleId===`empty-translation`).map(e=>e.key))],s=i.filter(e=>e.severity===`error`&&e.ruleId!==`empty-translation`),l=i.filter(e=>e.severity===`warn`),u=a.length,d=n.reviewed+n.needsReview+n.machine,f;f=o.length>0||s.length>0?`blocked`:r.length>0?`almost`:`ready`;let p=[];o.length&&p.push(`${o.length} missing`),s.length&&p.push(`${s.length} breaking`),r.length&&p.push(`${r.length} stale`);let m=[];return l.length&&m.push(OD(l.length,`warning`)),{locale:t,total:u,translated:d,pct:u?Math.round(d/u*100):0,counts:n,missingKeys:o,staleKeys:r,errors:s,warnings:l,breaking:s.length,warning:l.length,verdict:f,blockers:p,notes:m}}),u=a.length*i.length,d=0,f=0;for(let e of l)d+=e.translated,f+=e.counts.reviewed;let p=a.reduce((t,r)=>t+DD(ED(e.keys[r],n)),0),m={breaking:[],warning:[]};for(let e of t.findings)e.ruleId!==`empty-translation`&&m[e.severity===`error`?`breaking`:`warning`].push(e);return{totals:{keys:Object.keys(e.keys).length,locales:i.length,translatedPct:u?Math.round(d/u*1e3)/10:0,reviewedPct:u?Math.round(f/u*1e3)/10:0,sourceWords:p,openIssues:m.breaking.length+m.warning.length,ready:l.filter(e=>e.verdict===`ready`).length,almost:l.filter(e=>e.verdict===`almost`).length,blocked:l.filter(e=>e.verdict===`blocked`).length,breaking:m.breaking.length,missing:l.reduce((e,t)=>e+t.missingKeys.length,0),stale:l.reduce((e,t)=>e+t.staleKeys.length,0)},project:o,projectErrors:s,locales:l,risk:m,worklist:AD(l,m)}}function AD(e,t){let n=[];for(let e of t.breaking)n.push({id:`b:${e.locale}:${e.key}:${e.ruleId}`,priority:`breaking`,title:`Fix ${xD[e.ruleId].toLowerCase()}`,where:e.locale?`${e.locale.toUpperCase()} · ${e.key}`:e.key,detail:e.message,filter:e.ruleId===`output-stale`?void 0:CD(e),count:1});let r=new Map;for(let t of e)for(let e of t.missingKeys){let n=r.get(e);n?n.push(t.locale):r.set(e,[t.locale])}for(let[e,t]of r)n.push({id:`m:${e}`,priority:`missing`,title:`Translate ${OD(t.length,`missing string`)}`,where:e,detail:`Missing in ${t.map(e=>e.toUpperCase()).join(`, `)}`,filter:{text:e,states:[`missing`]},count:t.length});let i=[];for(let t of e)for(let e of t.staleKeys)i.push({locale:t.locale,key:e});i.length&&n.push({id:`s:all`,priority:`stale`,title:`Refresh ${OD(i.length,`stale translation`)}`,where:`source changed since translated`,detail:i.map(e=>`${e.locale.toUpperCase()} · ${e.key}`).join(` · `),filter:{states:[`needs-review`]},count:i.length});let a=new Map;for(let e of t.warning){let t=a.get(e.ruleId);t?t.push(e):a.set(e.ruleId,[e])}for(let[e,t]of a)n.push({id:`w:${e}`,priority:`warning`,title:`Review ${OD(t.length,`${xD[e].toLowerCase()} warning`)}`,where:[...new Set(t.map(e=>e.locale.toUpperCase()||e.key))].join(`, `),detail:t.map(e=>`${e.locale?e.locale.toUpperCase():`—`} · ${e.key}`).join(` · `),filter:CD(t[0]),count:t.length});return n}var jD={class:`min-h-0 flex-1 overflow-y-auto p-6`},MD={key:0,class:`mt-8 text-center text-sm text-muted-foreground`},ND={key:1,class:`mt-8 text-center text-sm text-muted-foreground`},PD={key:2,class:`mx-auto flex max-w-[1080px] flex-col gap-4`},FD={class:`flex flex-wrap divide-x rounded-xl border bg-card px-2 py-3 shadow-sm`},ID={class:`flex flex-col px-5`},LD={class:`text-lg font-semibold tabular-nums`},RD={class:`flex flex-col px-5`},zD={class:`text-lg font-semibold tabular-nums`},BD={class:`flex flex-col px-5`},VD={class:`text-lg font-semibold tabular-nums`},HD={class:`flex flex-col px-5`},UD={class:`text-lg font-semibold tabular-nums`},WD=[`disabled`],GD={class:`flex flex-col px-5`},KD={class:`text-lg font-semibold tabular-nums`},qD={class:`flex flex-wrap items-start justify-between gap-6`},JD={class:`min-w-0`},YD={class:`mt-1.5 flex items-center gap-2.5 text-2xl font-semibold tracking-tight`},XD={class:`mt-1.5 text-sm text-muted-foreground`},ZD={class:`text-emerald-600 dark:text-emerald-400`},QD={class:`text-amber-600 dark:text-amber-400`},$D={class:`text-red-600 dark:text-red-400`},eO={key:0,class:`mt-2 flex flex-col gap-1`},tO={class:`font-semibold`},nO={class:`font-mono text-muted-foreground`},rO={class:`text-muted-foreground`},iO={class:`flex gap-2`},aO={class:`text-[11px] uppercase tracking-wide text-muted-foreground`},oO={class:`mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t pt-3.5`},sO={class:`flex items-center gap-1 text-xs text-muted-foreground`},cO={class:`flex items-center gap-1 text-xs text-muted-foreground`},lO={class:`flex items-center gap-1 text-xs text-muted-foreground`},uO={class:`flex items-center gap-1 text-xs text-muted-foreground`},dO={class:`rounded-2xl border bg-card p-5 shadow-sm`},fO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},pO={key:1,class:`grid grid-cols-[repeat(auto-fill,minmax(218px,1fr))] gap-3`},mO=[`data-test`,`onClick`],hO={class:`flex items-start justify-between gap-2`},gO={class:`flex min-w-0 flex-col`},_O={class:`truncate font-mono text-xs font-semibold uppercase`},vO=[`title`],yO={class:`text-2xl font-semibold tabular-nums leading-none`},bO={class:`flex h-[7px] w-full overflow-hidden rounded-full bg-muted`},xO={class:`flex min-h-[20px] items-center gap-1.5 text-xs text-muted-foreground`},SO={class:`truncate`},CO={class:`rounded-2xl border bg-card p-5 shadow-sm`},wO={class:`mb-4`},TO={class:`mt-0.5 text-sm text-muted-foreground`},EO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},DO={key:1,class:`flex flex-col gap-2`},OO=[`disabled`,`onClick`],kO={class:`flex min-w-0 flex-col gap-0.5`},AO={class:`flex items-center gap-2 text-sm font-semibold`},jO={class:`truncate font-mono text-xs text-muted-foreground`},MO={key:0,class:`grid grid-cols-1 gap-4 lg:grid-cols-2`},NO={class:`rounded-2xl border bg-card p-5 shadow-sm`},PO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},FO={key:1,class:`flex flex-col gap-2.5`},IO=[`disabled`,`onClick`],LO={class:`flex flex-1 flex-col`},RO={class:`text-sm font-semibold`},zO={class:`text-xs text-muted-foreground`},BO={key:0,class:`border-t`},VO={class:`flex items-center justify-between gap-2 border-b bg-muted/40 px-3.5 py-1.5`},HO={class:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`},UO=[`disabled`,`title`,`onClick`],WO=[`onClick`,`onKeydown`],GO=[`title`],KO={class:`truncate font-medium`},qO={class:`font-mono text-muted-foreground`},JO={class:`truncate text-muted-foreground`},YO={class:`flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100`},XO=[`disabled`,`title`,`onClick`],ZO=[`disabled`,`onClick`],QO={key:2,class:`mt-3 overflow-hidden rounded-xl border`},$O={key:0,class:`border-t`},ek={class:`font-mono font-semibold uppercase`},tk={class:`truncate`},nk={class:`font-mono`},rk={class:`truncate`},ik=[`disabled`,`onClick`],ak={class:`rounded-2xl border bg-card p-5 shadow-sm`},ok=[`onClick`],sk={class:`flex min-w-0 items-center gap-2`},ck={class:`flex min-w-0 flex-col`},lk={class:`whitespace-nowrap font-mono uppercase leading-tight`},uk=[`title`],dk={class:`text-center font-mono tabular-nums`},fk={key:1,class:`rounded-2xl border bg-card p-5 shadow-sm`},pk={class:`flex items-center gap-3 rounded-xl bg-muted p-4`},mk=P({__name:`AnalyticsView`,setup(e){let t=A(null),n=A({findings:[],counts:{error:0,warn:0,suppressed:0},ok:!0}),r=A(!0),i=K(()=>({...n.value,findings:n.value.findings.filter(e=>!e.suppressed)})),a=K(()=>n.value.findings.filter(e=>e.suppressed)),o=K(()=>t.value?kD(t.value,i.value):null),s=K(()=>!!o.value&&(o.value.totals.keys===0||o.value.totals.locales===0)),c=K(()=>!!o.value&&o.value.totals.translatedPct===0);async function l(){let[e,r]=await Promise.all([jd(),Tf({includeSuppressed:!0}).catch(()=>null)]);t.value=e,r&&(n.value=r)}Ki(async()=>{try{await l()}catch(e){$.error(e.message)}finally{r.value=!1}});let u=A(!1),d=A(!1);function f(e){return e.ruleId===`spelling`?/"([^"]+)"/.exec(e.message)?.[1]:void 0}async function p(e,t){if(!d.value){d.value=!0;try{await t(),await l(),$.success(e)}catch(e){$.error(e.message)}finally{d.value=!1}}}let m=e=>p(`Dismissed until the source of ${e.key} changes`,()=>Ef(e.key,e.ruleId,e.locale)),h=e=>p(`Restored ${xD[e.ruleId].toLowerCase()} on ${e.key}`,()=>Df(e.key,e.ruleId,e.locale)),g=(e,t)=>p(`Dismissed ${t} warning${t===1?``:`s`}`,()=>Of({rules:[e]})),_=e=>{let t=f(e);t&&p(`Added "${t}" to the dictionary`,()=>lf(t))};function v(e){let t=new Map;for(let n of o.value.risk[e]){let e=t.get(n.ruleId);e?e.push(n):t.set(n.ruleId,[n])}return[...t.entries()].map(([e,t])=>({ruleId:e,findings:t}))}let y={ready:{label:`Ready`,icon:ju,text:`text-emerald-600 dark:text-emerald-400`,border:`border-l-emerald-500`,bar:`bg-emerald-500`,soft:`bg-emerald-500/10`},almost:{label:`Almost`,icon:Pu,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,bar:`bg-amber-500`,soft:`bg-amber-500/10`},blocked:{label:`Blocked`,icon:id,text:`text-red-600 dark:text-red-400`,border:`border-l-red-500`,bar:`bg-red-500`,soft:`bg-red-500/10`},none:{label:`Not started`,icon:gd,text:`text-muted-foreground`,border:`border-l-border`,bar:`bg-muted-foreground/40`,soft:`bg-muted`}},b={breaking:{label:`Breaking`,icon:id,text:`text-red-600 dark:text-red-400`,border:`border-l-red-500`,soft:`bg-red-500/10`},missing:{label:`Missing`,icon:Nu,text:`text-muted-foreground`,border:`border-l-muted-foreground/40`,soft:`bg-muted`},stale:{label:`Stale`,icon:Pu,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,soft:`bg-amber-500/10`},warning:{label:`Warning`,icon:Td,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,soft:`bg-amber-500/10`}},x=[{key:`breaking`,label:`Breaking`,blurb:"Lint errors — `glotfile check` fails on these. Ship-blocking.",text:`text-red-600 dark:text-red-400`,bar:`bg-red-500`},{key:`warning`,label:`Warning`,blurb:`Lint warnings — worth a look, won't block a release.`,text:`text-amber-600 dark:text-amber-400`,bar:`bg-amber-500`}],S=K(()=>{let e=o.value;return c.value?`none`:e.projectErrors>0?`blocked`:e.totals.ready===e.totals.locales&&e.totals.locales>0?`ready`:`blocked`}),C=K(()=>S.value===`none`?`Nothing to ship yet`:S.value===`ready`?`Ready to ship`:`Not ready to ship`);function w(e){return e.verdict===`ready`?e.notes.length?e.notes.join(` · `):`Clean — clears the gate`:e.blockers.join(` · `)}function T(e){return e.missingKeys.length?{locale:e.locale,states:[`missing`]}:e.errors.length?{locale:e.locale,...CD(e.errors[0])}:e.staleKeys.length?{locale:e.locale,states:[`needs-review`]}:{locale:e.locale}}function ee(e){return lC(e).name}function E(e,t){return(t?e/t*100:0)+`%`}function te(e){let t=[...new Set(o.value.risk[e].flatMap(e=>CD(e).issues??[]))];return t.length?{issues:t}:{needsAttention:!0}}return(e,t)=>(R(),z(`div`,jD,[r.value?(R(),z(`div`,MD,`Loading analytics…`)):s.value?(R(),z(`div`,ND,` No keys yet — add keys in the Editor to see analytics. `)):o.value?(R(),z(`div`,PD,[V(`section`,FD,[V(`div`,ID,[V(`span`,LD,k(o.value.totals.keys),1),t[2]||=V(`span`,{class:`text-xs text-muted-foreground`},`keys`,-1)]),V(`div`,RD,[V(`span`,zD,k(o.value.totals.locales),1),t[3]||=V(`span`,{class:`text-xs text-muted-foreground`},`locales`,-1)]),V(`div`,BD,[V(`span`,VD,k(o.value.totals.translatedPct)+`%`,1),t[4]||=V(`span`,{class:`text-xs text-muted-foreground`},`translated`,-1)]),V(`div`,HD,[V(`span`,UD,k(o.value.totals.reviewedPct)+`%`,1),t[5]||=V(`span`,{class:`text-xs text-muted-foreground`},`reviewed`,-1)]),V(`button`,{type:`button`,class:`group flex flex-col px-5 text-left`,"data-test":`open-issues`,disabled:!o.value.totals.openIssues,onClick:t[0]||=e=>j(Ep)({needsAttention:!0})},[V(`span`,{class:O([`text-lg font-semibold tabular-nums`,o.value.totals.breaking?`text-red-600 dark:text-red-400`:``])},k(o.value.totals.openIssues),3),t[6]||=V(`span`,{class:`text-xs text-muted-foreground group-hover:text-foreground`},`open issues`,-1)],8,WD),V(`div`,GD,[V(`span`,KD,k(o.value.totals.sourceWords),1),t[7]||=V(`span`,{class:`text-xs text-muted-foreground`},`source words`,-1)])]),V(`section`,{class:O([`rounded-2xl border border-l-4 bg-card p-6 shadow-sm`,y[S.value].border])},[V(`div`,qD,[V(`div`,JD,[t[12]||=V(`div`,{class:`font-mono text-[11px] uppercase tracking-wider text-muted-foreground`},`Can I ship?`,-1),V(`h1`,YD,[(R(),B(aa(y[S.value].icon),{class:O([`size-6`,y[S.value].text])},null,8,[`class`])),U(` `+k(C.value),1)]),V(`p`,XD,[c.value?(R(),z(L,{key:0},[U(`Add translations to get started — run a sync to let the AI fill them in.`)],64)):(R(),z(L,{key:1},[V(`strong`,ZD,k(o.value.totals.ready),1),U(` of `+k(o.value.totals.locales)+` locales ready`,1),o.value.totals.almost?(R(),z(L,{key:0},[t[8]||=U(` · `,-1),V(`strong`,QD,k(o.value.totals.almost),1),t[9]||=U(` need a refresh`,-1)],64)):W(``,!0),o.value.totals.blocked?(R(),z(L,{key:1},[t[10]||=U(` · `,-1),V(`strong`,$D,k(o.value.totals.blocked),1),t[11]||=U(` blocked`,-1)],64)):W(``,!0)],64))]),o.value.project.length?(R(),z(`ul`,eO,[(R(!0),z(L,null,F(o.value.project,e=>(R(),z(`li`,{key:`${e.ruleId}:${e.key}`,class:O([`flex items-center gap-1.5 text-xs`,e.severity===`error`?`text-red-600 dark:text-red-400`:`text-amber-600 dark:text-amber-400`])},[e.severity===`error`?(R(),B(j(id),{key:0,class:`size-3 shrink-0`})):(R(),B(j(Td),{key:1,class:`size-3 shrink-0`})),V(`span`,tO,k(j(xD)[e.ruleId]),1),V(`span`,nO,k(e.key),1),V(`span`,rO,k(e.message),1)],2))),128))])):W(``,!0)]),V(`div`,iO,[(R(!0),z(L,null,F([{n:o.value.totals.ready,label:`ready`,cls:`text-emerald-600 dark:text-emerald-400`},{n:o.value.totals.almost,label:`almost`,cls:`text-amber-600 dark:text-amber-400`},{n:o.value.totals.blocked,label:`blocked`,cls:`text-red-600 dark:text-red-400`}],e=>(R(),z(`div`,{key:e.label,class:`flex min-w-[66px] flex-col items-center rounded-xl border px-4 py-2`},[V(`span`,{class:O([`text-2xl font-semibold tabular-nums`,e.n?e.cls:`text-muted-foreground/50`])},k(e.n),3),V(`span`,aO,k(e.label),1)]))),128))])]),V(`div`,oO,[t[17]||=V(`span`,{class:`font-mono text-[10px] uppercase tracking-wider text-muted-foreground`},`Release gate`,-1),V(`span`,sO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[13]||=U(` 100% translated`,-1)]),V(`span`,cO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[14]||=U(` 0 lint errors`,-1)]),V(`span`,lO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[15]||=U(` outputs exported`,-1)]),V(`span`,uO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[16]||=U(` nothing stale`,-1)]),t[18]||=V(`span`,{class:`ml-auto text-[11px] italic text-muted-foreground`},[U(`same rules as `),V(`code`,{class:`font-mono not-italic`},`glotfile check`),U(` · skip via `),V(`code`,{class:`font-mono not-italic`},`config.lint.rules`)],-1)])],2),V(`section`,dO,[t[21]||=V(`header`,{class:`mb-4`},[V(`h2`,{class:`text-base font-semibold`},`Release readiness`),V(`p`,{class:`mt-0.5 text-sm text-muted-foreground`},`Per-locale status against the release gate. Click any locale to drill in.`)],-1),c.value?(R(),z(`div`,fO,[H(j(Wu),{class:`size-5 text-muted-foreground`}),t[19]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No locale is ready yet.`),V(`span`,{class:`text-sm text-muted-foreground`},`Translate your strings, then locales appear here as they clear the gate.`)],-1)])):(R(),z(`div`,pO,[(R(!0),z(L,null,F(o.value.locales,e=>(R(),z(`button`,{key:e.locale,type:`button`,"data-test":`rcard-${e.locale}`,class:O([`flex flex-col gap-2 rounded-xl border border-l-[3px] p-3.5 text-left transition hover:-translate-y-0.5 hover:bg-muted/50`,y[e.verdict].border]),onClick:t=>j(Ep)(T(e))},[V(`div`,hO,[V(`span`,gO,[V(`span`,_O,k(e.locale),1),V(`span`,{class:`truncate text-[11px] text-muted-foreground`,title:ee(e.locale)},k(ee(e.locale)),9,vO)]),V(`span`,{class:O([`flex items-center gap-1 text-[11px] font-semibold`,y[e.verdict].text])},[(R(),B(aa(y[e.verdict].icon),{class:`size-3`})),U(k(y[e.verdict].label),1)],2)]),V(`div`,yO,[U(k(e.pct),1),t[20]||=V(`span`,{class:`ml-0.5 text-xs text-muted-foreground`},`%`,-1)]),V(`div`,bO,[V(`span`,{class:`h-full bg-emerald-500`,style:ge({width:E(e.counts.reviewed,e.total)})},null,4),V(`span`,{class:`h-full bg-amber-500`,style:ge({width:E(e.counts.needsReview,e.total)})},null,4),V(`span`,{class:`h-full bg-sky-500`,style:ge({width:E(e.counts.machine,e.total)})},null,4)]),V(`div`,xO,[e.verdict===`ready`?W(``,!0):(R(),B(aa(y[e.verdict].icon),{key:0,class:O([`size-3 shrink-0`,y[e.verdict].text])},null,8,[`class`])),V(`span`,SO,k(w(e)),1)])],10,mO))),128))]))]),V(`section`,CO,[V(`header`,wO,[t[22]||=V(`h2`,{class:`text-base font-semibold`},`Needs attention`,-1),V(`p`,TO,k(c.value?`Your prioritized worklist will fill in as the AI translates.`:`Prioritized — fix the top item first. Each opens the matching strings.`),1)]),o.value.worklist.length?(R(),z(`ol`,DO,[(R(!0),z(L,null,F(o.value.worklist,(e,t)=>(R(),z(`li`,{key:e.id},[V(`button`,{type:`button`,class:O([`grid w-full grid-cols-[30px_1fr_auto_16px] items-center gap-3 rounded-xl border border-l-[3px] px-3.5 py-3 text-left transition enabled:hover:bg-muted/50`,[b[e.priority].border,t===0?b[e.priority].soft:``]]),disabled:!e.filter,onClick:t=>e.filter&&j(Ep)(e.filter)},[V(`span`,{class:O([`flex size-[30px] items-center justify-center rounded-lg`,[b[e.priority].soft,b[e.priority].text]])},[(R(),B(aa(b[e.priority].icon),{class:`size-4`}))],2),V(`span`,kO,[V(`span`,AO,[U(k(e.title)+` `,1),t===0?(R(),z(`span`,{key:0,class:O([`rounded-full px-2 py-0.5 font-mono text-[9.5px] font-semibold uppercase tracking-wide text-white`,b[e.priority].text.includes(`red`)?`bg-red-500`:b[e.priority].text.includes(`amber`)?`bg-amber-500`:`bg-muted-foreground`])},`Start here`,2)):W(``,!0)]),V(`span`,jO,k(e.where),1)]),V(`span`,{class:O([`rounded-full px-2.5 py-1 text-[11px] font-semibold`,[b[e.priority].soft,b[e.priority].text]])},k(b[e.priority].label),3),H(j(ku),{class:`size-4 text-muted-foreground`})],10,OO)]))),128))])):(R(),z(`div`,EO,[H(j(ju),{class:`size-5 text-emerald-500`}),t[23]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`Nothing needs attention.`),V(`span`,{class:`text-sm text-muted-foreground`},`Every translated string clears its checks and is up to date.`)],-1)]))]),c.value?(R(),z(`section`,fk,[t[32]||=V(`h2`,{class:`mb-4 text-base font-semibold`},`Quality`,-1),V(`div`,pk,[H(j(Mu),{class:`size-5 text-muted-foreground`}),t[31]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No checks run yet.`),V(`span`,{class:`text-sm text-muted-foreground`},`Quality checks appear once strings are translated.`)],-1)])])):(R(),z(`div`,MO,[V(`section`,NO,[t[29]||=V(`header`,{class:`mb-4`},[V(`h2`,{class:`text-base font-semibold`},`Quality`),V(`p`,{class:`mt-0.5 text-sm text-muted-foreground`},`Grouped by risk — a broken placeholder is not a typo.`)],-1),o.value.totals.openIssues?(R(),z(`div`,FO,[(R(),z(L,null,F(x,e=>V(`div`,{key:e.key,class:`overflow-hidden rounded-xl border`},[V(`button`,{type:`button`,class:`flex w-full items-center gap-3 px-3.5 py-3 text-left enabled:hover:bg-muted/50`,disabled:!o.value.risk[e.key].length,onClick:t=>j(Ep)(te(e.key))},[V(`span`,{class:O([`w-1 self-stretch rounded-full`,e.bar])},null,2),V(`span`,{class:O([`min-w-[22px] text-xl font-semibold tabular-nums`,e.text])},k(o.value.risk[e.key].length),3),V(`span`,LO,[V(`span`,RO,k(e.label),1),V(`span`,zO,k(e.blurb),1)]),o.value.risk[e.key].length?(R(),B(j(ku),{key:0,class:`size-4 text-muted-foreground`})):W(``,!0)],8,IO),o.value.risk[e.key].length?(R(),z(`div`,BO,[(R(!0),z(L,null,F(v(e.key),n=>(R(),z(L,{key:n.ruleId},[V(`div`,VO,[V(`span`,HO,k(j(xD)[n.ruleId])+` · `+k(n.findings.length),1),e.key===`warning`?(R(),z(`button`,{key:0,type:`button`,class:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Hide all ${n.findings.length} until each key's source changes`,onClick:e=>g(n.ruleId,n.findings.length)},[H(j(Su),{class:`size-3`}),t[25]||=U(` Dismiss all `,-1)],8,UO)):W(``,!0)]),(R(!0),z(L,null,F(n.findings,(e,n)=>(R(),z(`div`,{key:n,role:`button`,tabindex:`0`,class:`group grid w-full cursor-pointer grid-cols-[42px_minmax(90px,1fr)_1.4fr_auto] items-center gap-2.5 border-b px-3.5 py-2.5 text-left text-xs last:border-b-0 hover:bg-muted/50`,onClick:t=>j(Ep)(j(CD)(e)),onKeydown:Xl(t=>j(Ep)(j(CD)(e)),[`enter`])},[V(`span`,{class:`font-mono font-semibold uppercase text-muted-foreground`,title:e.locale?ee(e.locale):`project-wide`},k(e.locale||`—`),9,GO),V(`span`,KO,[V(`span`,qO,k(e.key),1)]),V(`span`,JO,k(e.message),1),V(`span`,YO,[f(e)?(R(),z(`button`,{key:0,type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Never flag "${f(e)}" again`,onClick:q(t=>_(e),[`stop`])},[H(j(wu),{class:`size-3`}),t[26]||=U(` Add word `,-1)],8,XO)):W(``,!0),e.severity===`warn`?(R(),z(`button`,{key:1,type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Hide until this key's source changes`,onClick:q(t=>m(e),[`stop`])},[H(j(Su),{class:`size-3`}),t[27]||=U(` Dismiss `,-1)],8,ZO)):W(``,!0)])],40,WO))),128))],64))),128))])):W(``,!0)])),64))])):(R(),z(`div`,PO,[H(j(ju),{class:`size-5 text-emerald-500`}),t[24]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No issues found.`),V(`span`,{class:`text-sm text-muted-foreground`},`All translated strings pass their checks.`)],-1)])),a.value.length?(R(),z(`div`,QO,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-xs text-muted-foreground hover:bg-muted/50`,onClick:t[1]||=e=>u.value=!u.value},[(R(),B(aa(u.value?j(Ou):j(ku)),{class:`size-3.5`})),H(j(Su),{class:`size-3.5`}),U(` Suppressed (`+k(a.value.length)+`) — hidden until each key's source changes `,1)]),u.value?(R(),z(`div`,$O,[(R(!0),z(L,null,F(a.value,(e,n)=>(R(),z(`div`,{key:n,class:`grid w-full grid-cols-[42px_minmax(90px,1fr)_1.4fr_auto] items-center gap-2.5 border-b px-3.5 py-2.5 text-left text-xs text-muted-foreground last:border-b-0`},[V(`span`,ek,k(e.locale||`—`),1),V(`span`,tk,[U(k(j(xD)[e.ruleId])+` · `,1),V(`span`,nk,k(e.key),1)]),V(`span`,rk,k(e.message),1),V(`button`,{type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,onClick:t=>h(e)},[H(j(cd),{class:`size-3`}),t[28]||=U(` Restore `,-1)],8,ik)]))),128))])):W(``,!0)])):W(``,!0)]),V(`section`,ak,[t[30]||=vs(`<header class="mb-4"><h2 class="text-base font-semibold">By locale</h2><p class="mt-0.5 text-sm text-muted-foreground">Full breakdown.</p></header><div class="grid grid-cols-[minmax(96px,1.4fr)_52px_64px_50px_72px_72px_16px] gap-2 border-b pb-2 font-mono text-[11px] uppercase tracking-wide text-muted-foreground"><span>Locale</span><span class="text-center">Done</span><span class="text-center">Missing</span><span class="text-center">Stale</span><span class="text-center">Breaking</span><span class="text-center">Warnings</span><span></span></div>`,2),(R(!0),z(L,null,F(o.value.locales,e=>(R(),z(`button`,{key:e.locale,type:`button`,class:`grid w-full grid-cols-[minmax(96px,1.4fr)_52px_64px_50px_72px_72px_16px] items-center gap-2 border-b py-2.5 text-left text-sm last:border-b-0 hover:bg-muted/50`,onClick:t=>j(Ep)(T(e))},[V(`span`,sk,[V(`span`,{class:O([`size-2 shrink-0 rounded-full`,y[e.verdict].bar])},null,2),V(`span`,ck,[V(`span`,lk,k(e.locale),1),V(`span`,{class:`truncate text-xs leading-tight text-muted-foreground`,title:ee(e.locale)},k(ee(e.locale)),9,uk)])]),V(`span`,dk,k(e.pct)+`%`,1),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.missingKeys.length?``:`text-muted-foreground`])},k(e.missingKeys.length||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.staleKeys.length?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`])},k(e.staleKeys.length||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.breaking?`text-red-600 dark:text-red-400`:`text-muted-foreground`])},k(e.breaking||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.warning?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`])},k(e.warning||`—`),3),H(j(ku),{class:`size-3.5 text-muted-foreground`})],8,ok))),128))])]))])):W(``,!0)]))}});function hk(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.term.toLowerCase().includes(n)||(e.notes??``).toLowerCase().includes(n)?!0:Object.entries(e.translations??{}).some(([e,t])=>e.toLowerCase().includes(n)||t.toLowerCase().includes(n)))}var gk={class:`grid gap-4`},_k={class:`grid gap-1.5`},vk={key:0,class:`text-xs text-muted-foreground`},yk={class:`flex items-center justify-between`},bk={class:`flex items-center justify-between`},xk={class:`grid gap-1.5`},Sk={key:0,class:`grid gap-2 border-t pt-3`},Ck={key:1,class:`text-sm text-destructive`},wk=P({__name:`GlossaryEntryDialog`,props:ka({entry:{},targetLocales:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`saved`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=Zt({term:``,doNotTranslate:!1,caseSensitive:!1,notes:``,translations:{}}),o=A(!1),s=A(``),c=A(!1);N(r,e=>{if(!e)return;let t=n.entry;c.value=t!==null,a.term=t?.term??``,a.doNotTranslate=t?.doNotTranslate??!1,a.caseSensitive=t?.caseSensitive??!1,a.notes=t?.notes??``,a.translations={};for(let e of n.targetLocales)a.translations[e]=t?.translations?.[e]??``;s.value=``},{immediate:!0});async function l(){let e=a.term.trim();if(!e){s.value=`Term is required.`;return}let t={};for(let[e,n]of Object.entries(a.translations)){let r=n.trim();r&&(t[e]=r)}let n={term:e};a.doNotTranslate&&(n.doNotTranslate=!0),a.caseSensitive&&(n.caseSensitive=!0),a.notes.trim()&&(n.notes=a.notes.trim()),Object.keys(t).length>0&&(n.translations=t),o.value=!0,s.value=``;try{await df(n),$.success(c.value?`Updated ${e}`:`Added ${e}`),r.value=!1,i(`saved`)}catch(e){s.value=e.message}finally{o.value=!1}}return(t,n)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":n[5]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`max-h-[85vh] max-w-lg overflow-y-auto`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[U(k(c.value?`Edit term`:`Add term`),1)]),_:1}),H(j(VS),null,{default:M(()=>[...n[6]||=[U(` Guide AI translations with do-not-translate terms and forced translations. `,-1)]]),_:1})]),_:1}),V(`div`,gk,[V(`div`,_k,[H(j(IS),{for:`glossary-term`},{default:M(()=>[...n[7]||=[U(`Term`,-1)]]),_:1}),H(j(rS),{id:`glossary-term`,modelValue:a.term,"onUpdate:modelValue":n[0]||=e=>a.term=e,class:`font-mono`,placeholder:`Sign in`,disabled:c.value,onKeydown:Xl(q(l,[`prevent`]),[`enter`])},null,8,[`modelValue`,`disabled`,`onKeydown`]),c.value?(R(),z(`p`,vk,` The term is the entry's identity and can't be changed. `)):W(``,!0)]),V(`div`,yk,[V(`div`,null,[H(j(IS),{for:`glossary-dnt`},{default:M(()=>[...n[8]||=[U(`Do not translate`,-1)]]),_:1}),n[9]||=V(`p`,{class:`text-xs text-muted-foreground`},`Keep this term verbatim in every language.`,-1)]),H(j(pS),{id:`glossary-dnt`,modelValue:a.doNotTranslate,"onUpdate:modelValue":n[1]||=e=>a.doNotTranslate=e},null,8,[`modelValue`])]),V(`div`,bk,[V(`div`,null,[H(j(IS),{for:`glossary-cs`},{default:M(()=>[...n[10]||=[U(`Case sensitive`,-1)]]),_:1}),n[11]||=V(`p`,{class:`text-xs text-muted-foreground`},`Only match the exact casing.`,-1)]),H(j(pS),{id:`glossary-cs`,modelValue:a.caseSensitive,"onUpdate:modelValue":n[2]||=e=>a.caseSensitive=e},null,8,[`modelValue`])]),V(`div`,xk,[H(j(IS),{for:`glossary-notes`},{default:M(()=>[...n[12]||=[U(`Notes`,-1)]]),_:1}),H(j(gC),{id:`glossary-notes`,modelValue:a.notes,"onUpdate:modelValue":n[3]||=e=>a.notes=e,rows:`5`,class:`min-h-24 resize-y`,placeholder:`Optional guidance for translators.`},null,8,[`modelValue`])]),e.targetLocales.length>0?(R(),z(`div`,Sk,[n[13]||=V(`p`,{class:`text-sm font-medium`},`Forced translations`,-1),(R(!0),z(L,null,F(e.targetLocales,e=>(R(),z(`div`,{key:e,class:`grid gap-1.5`},[H(j(IS),{for:`glossary-tr-${e}`,class:`text-xs text-muted-foreground`},{default:M(()=>[H(UC,{code:e,"show-name":``,"show-code":!1,size:12},null,8,[`code`])]),_:2},1032,[`for`]),H(j(rS),{id:`glossary-tr-${e}`,modelValue:a.translations[e],"onUpdate:modelValue":t=>a.translations[e]=t,placeholder:`Forced translation for ${e}`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`placeholder`])]))),128))])):W(``,!0),s.value?(R(),z(`p`,Ck,k(s.value),1)):W(``,!0)]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:o.value,onClick:n[4]||=e=>r.value=!1},{default:M(()=>[...n[14]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:o.value,onClick:l},{default:M(()=>[U(k(c.value?`Save`:`Add term`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),Tk={class:`min-h-0 flex-1 overflow-y-auto`},Ek={key:0,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},Dk={key:1,class:`mx-auto flex max-w-3xl flex-col gap-4 p-6`},Ok={class:`flex items-center justify-between`},kk={class:`relative`},Ak={key:0,class:`rounded-lg border border-dashed p-10 text-center text-sm text-muted-foreground`},jk={key:1,class:`rounded-lg border border-dashed p-10 text-center text-sm text-muted-foreground`},Mk={key:2,class:`flex flex-col gap-2`},Nk={class:`min-w-0 flex-1`},Pk={class:`flex flex-wrap items-center gap-2`},Fk={class:`font-mono text-sm font-medium`},Ik={key:0,class:`mt-1 text-sm text-muted-foreground`},Lk={key:1,class:`mt-2 flex flex-wrap gap-1.5`},Rk={class:`flex shrink-0 items-center gap-1`},zk={class:`font-mono`},Bk=P({__name:`GlossaryView`,setup(e){let t=A([]),n=A(``),r=A([]),i=A(!1),a=A(!1),o=A(null),s=A(null),c=A(!1),l=A(``),u=K(()=>hk(t.value,l.value)),d=K(()=>r.value.filter(e=>e!==n.value));async function f(){let[e,a]=await Promise.all([uf(),jd()]);t.value=e,n.value=a.config.sourceLocale,r.value=a.config.locales,i.value=!0}f();function p(){o.value=null,a.value=!0}function m(e){o.value=e,a.value=!0}function h(e){return Object.entries(e.translations??{}).map(([e,t])=>`${e}: ${t}`)}async function g(){let e=s.value;if(e){c.value=!0;try{await ff(e.term),$.success(`Deleted ${e.term}`),s.value=null,await f()}catch(e){$.error(`Delete failed: ${e.message}`)}finally{c.value=!1}}}return(e,n)=>(R(),z(`div`,Tk,[i.value?(R(),z(`div`,Dk,[V(`div`,Ok,[n[7]||=V(`div`,null,[V(`h2`,{class:`text-base font-semibold`},`Glossary`),V(`p`,{class:`text-sm text-muted-foreground`},`Do-not-translate terms and forced translations.`)],-1),H(j(Q),{onClick:p},{default:M(()=>[H(j(od),{class:`size-4`}),n[6]||=U(` Add term `,-1)]),_:1})]),V(`div`,kk,[H(j(pd),{class:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),H(j(rS),{modelValue:l.value,"onUpdate:modelValue":n[0]||=e=>l.value=e,placeholder:`Search terms, notes, translations…`,class:`h-8 w-full pl-8 pr-8`,onKeydown:n[1]||=Xl(e=>l.value=``,[`esc`])},null,8,[`modelValue`]),l.value?(R(),z(`button`,{key:0,class:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":`Clear search`,onClick:n[2]||=e=>l.value=``},[H(j(kd),{class:`size-4`})])):W(``,!0)]),t.value.length===0?(R(),z(`div`,Ak,` No glossary terms yet — add do-not-translate terms and forced translations to guide AI. `)):u.value.length===0?(R(),z(`div`,jk,` No terms match your search. `)):(R(),z(`ul`,Mk,[(R(!0),z(L,null,F(u.value,e=>(R(),z(`li`,{key:e.term,class:`flex items-start gap-3 rounded-lg border bg-card p-3 text-card-foreground shadow-sm`},[V(`div`,Nk,[V(`div`,Pk,[V(`span`,Fk,k(e.term),1),e.doNotTranslate?(R(),B(j(dS),{key:0,variant:`secondary`},{default:M(()=>[...n[8]||=[U(`Do-not-translate`,-1)]]),_:1})):W(``,!0),e.caseSensitive?(R(),B(j(dS),{key:1,variant:`outline`},{default:M(()=>[...n[9]||=[U(`Case-sensitive`,-1)]]),_:1})):W(``,!0)]),e.notes?(R(),z(`p`,Ik,k(e.notes),1)):W(``,!0),h(e).length?(R(),z(`div`,Lk,[(R(!0),z(L,null,F(h(e),e=>(R(),z(`span`,{key:e,class:`inline-flex items-center rounded-md border bg-background px-2 py-0.5 font-mono text-xs`},k(e),1))),128))])):W(``,!0)]),V(`div`,Rk,[H(j(Q),{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.term}`,onClick:t=>m(e)},{default:M(()=>[H(j(ad),{class:`size-4`})]),_:1},8,[`aria-label`,`onClick`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`text-muted-foreground hover:text-destructive`,"aria-label":`Delete ${e.term}`,onClick:t=>s.value=e},{default:M(()=>[H(j(wd),{class:`size-4`})]),_:1},8,[`aria-label`,`onClick`])])]))),128))]))])):(R(),z(`div`,Ek,` Loading glossary… `)),H(wk,{open:a.value,"onUpdate:open":n[3]||=e=>a.value=e,entry:o.value,"target-locales":d.value,onSaved:f},null,8,[`open`,`entry`,`target-locales`]),H(j(bh),{open:s.value!==null,"onUpdate:open":n[5]||=e=>{e||(s.value=null)}},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[10]||=[U(`Delete term`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[n[11]||=U(` Delete `,-1),V(`span`,zk,k(s.value?.term),1),n[12]||=U(` from the glossary? This cannot be undone. `,-1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:c.value,onClick:n[4]||=e=>s.value=null},{default:M(()=>[...n[13]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:c.value,onClick:g},{default:M(()=>[...n[14]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]))}}),Vk=[{id:`empty-source`,label:`Empty source`,description:`The source text itself is empty.`,default:`error`},{id:`empty-translation`,label:`Untranslated`,description:`A target translation is missing or blank.`,default:`error`},{id:`placeholder-mismatch`,label:`Placeholder mismatch`,description:`Placeholders differ between source and translation.`,default:`error`},{id:`icu-mismatch`,label:`ICU mismatch`,description:`ICU plural/select structure differs from the source.`,default:`error`},{id:`glossary-violation`,label:`Glossary`,description:`A glossary term is missing or translated incorrectly.`,default:`error`},{id:`max-length`,label:`Too long`,description:`The translation exceeds the key's maximum length.`,default:`warn`},{id:`identical-to-source`,label:`Identical to source`,description:`The translation is exactly the source text.`,default:`warn`},{id:`whitespace`,label:`Whitespace`,description:`Leading/trailing whitespace differs from the source.`,default:`warn`},{id:`spelling`,label:`Spelling`,description:`A word isn't in the locale's dictionary, the glossary, or your custom dictionary.`,default:`warn`}],Hk=Object.fromEntries(Vk.map(e=>[e.id,e.default]));function Uk(e,t){if(typeof e==`string`&&e.trim()===``)return t;let n=typeof e==`number`?e:Number(e);return Number.isFinite(n)?n:t}function Wk(e){return{sourceLocale:e.sourceLocale,locales:[...e.locales],outputs:e.outputs.map(e=>({adapter:e.adapter,path:e.path,emptyAs:e.emptyAs,style:e.style===`flat`?`flat`:`nested`,indent:e.indent??null,finalNewline:e.finalNewline??null,includeLocale:e.includeLocale??!0,localeAliases:e.localeAliases?structuredClone(e.localeAliases):{},localeCase:e.localeCase,localeMap:e.localeMap?structuredClone(e.localeMap):{}})),indent:e.format.indent,sortKeys:e.format.sortKeys,finalNewline:e.format.finalNewline,autoExport:e.autoExport??!0,exportLocales:[...e.exportLocales??[]],customWords:[...e.spelling?.customWords??[]],lintRules:{...Hk,...e.lint?.rules},lintIgnore:[...e.lint?.ignore??[]],scanAccessors:[...e.scan?.accessors??[]],scanPatterns:[...e.scan?.patterns??[]],scanInclude:[...e.scan?.include??[]],scanExclude:[...e.scan?.exclude??[]]}}function Gk(e,t){let n=e.outputs.map(e=>{let t={adapter:e.adapter.trim(),path:e.path.trim()};if(e.style===`flat`&&(t.style=`flat`),e.emptyAs&&(t.emptyAs=e.emptyAs),e.indent!=null&&(t.indent=e.indent),e.finalNewline!=null&&(t.finalNewline=e.finalNewline),e.includeLocale||(t.includeLocale=!1),e.localeAliases&&Object.keys(e.localeAliases).length&&(t.localeAliases=Object.fromEntries(Object.entries(e.localeAliases).filter(([,e])=>e.length>0)),Object.keys(t.localeAliases).length===0&&delete t.localeAliases),e.localeCase&&(t.localeCase=e.localeCase),e.localeMap){let n=Object.fromEntries(Object.entries(e.localeMap).filter(([,e])=>e.trim()!==``));Object.keys(n).length&&(t.localeMap=n)}return t}).filter(e=>e.adapter||e.path),r={};e.scanAccessors.length&&(r.accessors=[...e.scanAccessors]),e.scanPatterns.length&&(r.patterns=[...e.scanPatterns]),e.scanInclude.length&&(r.include=[...e.scanInclude]),e.scanExclude.length&&(r.exclude=[...e.scanExclude]);let i={sourceLocale:e.sourceLocale,locales:[...e.locales],outputs:n,format:{indent:Uk(e.indent,2),sortKeys:e.sortKeys,finalNewline:e.finalNewline},autoExport:e.autoExport,...e.exportLocales.length?{exportLocales:[...e.exportLocales]}:{},spelling:{customWords:[...e.customWords]},...Object.keys(r).length?{scan:r}:{}},a=Object.fromEntries(Object.entries(e.lintRules).filter(([e,t])=>Hk[e]!==void 0&&t!==Hk[e])),o={};return Object.keys(a).length&&(o.rules=a),e.lintIgnore.length&&(o.ignore=[...e.lintIgnore]),t?.lint?.spelling!==void 0&&(o.spelling=t.lint.spelling),Object.keys(o).length&&(i.lint=o),t?.storage!==void 0&&(i.storage=t.storage),i}var Kk=A(0),qk={class:`flex items-center gap-2 p-2`},Jk=[`aria-label`],Yk={class:`!flex items-center gap-2`},Xk={class:`truncate font-medium`},Zk={class:`flex items-center gap-2`},Qk={key:0,class:`grid gap-5 border-t border-border p-4`},$k={key:0,class:`grid gap-1.5`},eA={class:`mt-1 inline-flex w-fit rounded-md border border-input p-0.5`},tA=[`onClick`],nA={key:1,class:`grid gap-1.5`},rA={class:`mt-1 inline-flex w-fit rounded-md border border-input p-0.5`},iA=[`onClick`],aA={key:2,class:`grid gap-1.5`},oA={class:`flex items-center gap-2`},sA={key:0,class:`text-xs text-muted-foreground`},cA={class:`flex items-center gap-2`},lA={key:3,class:`grid gap-1.5`},uA={class:`flex items-center gap-2`},dA={key:0,class:`text-xs text-muted-foreground`},fA={class:`flex items-center gap-2`},pA={class:`text-xs text-muted-foreground`},mA={key:4,class:`grid gap-1.5`},hA={class:`flex items-center gap-2`},gA={class:`text-xs text-muted-foreground`},_A={class:`grid gap-1.5`},vA={class:`flex w-full items-center justify-between gap-4`},yA={class:`font-mono text-xs text-muted-foreground`},bA={class:`grid gap-1.5`},xA={class:`mt-1 grid gap-2`},SA={key:0,class:`text-xs text-muted-foreground`},CA={class:`w-24 shrink-0 font-mono text-xs font-semibold`},wA={key:1},TA={class:`!flex items-center gap-1.5`},EA={class:`border-t border-border pt-4`},DA={class:`mt-2 grid gap-2`},OA={key:0,class:`text-xs text-muted-foreground`},kA={class:`flex h-8 shrink-0 items-center gap-1.5`},AA={class:`font-mono text-xs font-semibold`},jA={class:`flex flex-1 flex-wrap items-center gap-1.5`},MA=[`onClick`],NA={key:1},PA={class:`!flex items-center gap-1.5`},FA=P({__name:`OutputEditor`,props:{output:{},formatIndent:{},formatFinalNewline:{type:Boolean},locales:{},adapters:{}},emits:[`update:output`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A({}),o={"laravel-php":[`emptyAs`,`indent`,`finalNewline`],"vue-i18n-json":[`emptyAs`,`style`,`indent`,`finalNewline`],"flutter-arb":[`emptyAs`,`indent`,`finalNewline`,`includeLocale`],"angular-xliff":[`emptyAs`],"rails-yaml":[`emptyAs`,`indent`,`finalNewline`],"apple-strings":[`emptyAs`]};function s(e){return o[e]??[`emptyAs`,`indent`,`finalNewline`]}function c(e){return s(n.output.adapter).includes(e)}let l=[{value:`source`,label:`Fill source`},{value:`empty`,label:`Leave empty`},{value:`omit`,label:`Omit`}],u=[{value:`lower-hyphen`,label:`lower-hyphen`,example:`en-us`},{value:`lower-underscore`,label:`lower-underscore`,example:`en_us`},{value:`bcp47-hyphen`,label:`bcp47-hyphen`,example:`en-US`},{value:`bcp47-underscore`,label:`bcp47-underscore`,example:`en_US`}];function d(e){return e===`flutter-arb`?`Default (Flutter: en_US)`:e===`angular-xliff`?`Default (Angular: en-US)`:e===`rails-yaml`?`Default (Rails: en-US)`:e===`apple-strings`?`Default (Apple: en-US)`:`Default (en-us)`}let f=K(()=>n.output.localeCase??`default`);function p(e){v({localeCase:e==="default"?void 0:e})}let m={"laravel-php":`Laravel PHP`,"vue-i18n-json":`Vue i18n JSON`,"flutter-arb":`Flutter ARB`,"angular-xliff":`Angular XLIFF`,"rails-yaml":`Rails YAML`,"apple-strings":`Apple .strings`};function h(e){return m[e]??e}let g={"laravel-php":Vu,"vue-i18n-json":Bu,"flutter-arb":_d,"angular-xliff":Vu,"rails-yaml":Vu,"apple-strings":_d};function _(e){return g[e]??Uu}function v(e){r(`update:output`,{...n.output,...e})}function y(e){return e===`flutter-arb`?`omit`:`source`}function b(e){v({adapter:e,emptyAs:y(e),style:e===`vue-i18n-json`?`nested`:n.output.style,includeLocale:!0})}let x=K(()=>n.output.emptyAs??y(n.output.adapter)),S=K(()=>n.output.finalNewline??n.formatFinalNewline),C=K(()=>n.output.indent!=null),w=K(()=>n.output.finalNewline!=null),T=K(()=>n.output.localeAliases??{}),ee=K(()=>Object.keys(T.value)),E=K(()=>n.locales.filter(e=>!ee.value.includes(e)));function te(e){v({localeAliases:e})}function ne(e){te({...T.value,[e]:[]})}function re(e){let t={...T.value};delete t[e],te(t)}function ie(e){let t=(a.value[e]??``).trim();if(!t)return;let n=T.value[e]??[];n.includes(t)||(te({...T.value,[e]:[...n,t]}),a.value={...a.value,[e]:``})}function ae(e,t){te({...T.value,[e]:(T.value[e]??[]).filter(e=>e!==t)})}let oe=K(()=>n.output.localeMap??{}),se=K(()=>Object.keys(oe.value)),ce=K(()=>n.locales.filter(e=>!se.value.includes(e)));function D(e){v({localeMap:e})}function le(e){D({...oe.value,[e]:e})}function ue(e){let t={...oe.value};delete t[e],D(t)}function de(e,t){D({...oe.value,[e]:t})}return(t,n)=>(R(),z(`div`,{class:O([`rounded-lg border`,i.value?`border-input`:`border-border`])},[V(`div`,qk,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":i.value?`Collapse`:`Expand options`,onClick:n[0]||=e=>i.value=!i.value},[H(j(ku),{class:O([`size-4 transition-transform`,i.value?`rotate-90`:``])},null,8,[`class`])],8,Jk)]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(i.value?`Collapse`:`Expand options`),1)]),_:1})]),_:1}),H(j(Iy),{"model-value":e.output.adapter,"onUpdate:modelValue":b},{default:M(()=>[H(j(iS),{class:`w-44 shrink-0`},{default:M(()=>[V(`span`,Yk,[(R(),B(aa(_(e.output.adapter)),{class:`size-3.5 shrink-0 text-primary`})),V(`span`,Xk,k(h(e.output.adapter)),1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(e.adapters,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[V(`span`,Zk,[(R(),B(aa(_(e)),{class:`size-3.5 text-primary`})),U(` `+k(h(e)),1)])]),_:2},1032,[`value`]))),128)),e.output.adapter&&!e.adapters.includes(e.output.adapter)?(R(),B(j(sS),{key:0,value:e.output.adapter},{default:M(()=>[U(k(e.output.adapter),1)]),_:1},8,[`value`])):W(``,!0)]),_:1})]),_:1},8,[`model-value`]),H(j(rS),{"model-value":e.output.path,class:`flex-1 font-mono text-sm`,placeholder:`lib/l10n/app_{locale}.arb`,spellcheck:`false`,"aria-label":`Output path`,"onUpdate:modelValue":n[1]||=e=>v({path:String(e)})},null,8,[`model-value`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove output`,onClick:n[2]||=e=>r(`remove`)},{default:M(()=>[H(j(wd),{class:`size-4`})]),_:1})]),i.value?(R(),z(`div`,Qk,[c(`emptyAs`)?(R(),z(`div`,$k,[H(j(IS),null,{default:M(()=>[...n[8]||=[U(`Empty keys`,-1)]]),_:1}),n[9]||=V(`p`,{class:`text-xs text-muted-foreground`},`What to write when a translation is missing.`,-1),V(`div`,eA,[(R(),z(L,null,F(l,e=>V(`button`,{key:e.value,type:`button`,class:O([`rounded-[5px] px-2.5 py-1 text-xs font-medium transition-colors`,x.value===e.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`]),onClick:t=>v({emptyAs:e.value})},k(e.label),11,tA)),64))])])):W(``,!0),c(`style`)?(R(),z(`div`,nA,[H(j(IS),null,{default:M(()=>[...n[10]||=[U(`Nesting`,-1)]]),_:1}),n[11]||=V(`p`,{class:`text-xs text-muted-foreground`},`Expand dotted keys into nested objects.`,-1),V(`div`,rA,[(R(),z(L,null,F([`nested`,`flat`],t=>V(`button`,{key:t,type:`button`,class:O([`rounded-[5px] px-2.5 py-1 text-xs font-medium capitalize transition-colors`,(e.output.style??`nested`)===t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`]),onClick:e=>v({style:t})},k(t),11,iA)),64))])])):W(``,!0),c(`indent`)?(R(),z(`div`,aA,[V(`div`,oA,[H(j(IS),null,{default:M(()=>[...n[12]||=[U(`Indent`,-1)]]),_:1}),C.value?(R(),z(`button`,{key:1,type:`button`,class:`text-xs text-primary hover:underline`,onClick:n[3]||=e=>v({indent:null})},`Reset`)):(R(),z(`span`,sA,`Inherited · `+k(e.formatIndent),1))]),V(`div`,cA,[H(j(rS),{type:`number`,min:`0`,max:`8`,class:O([`w-20`,C.value?`border-primary`:``]),"model-value":e.output.indent??``,placeholder:String(e.formatIndent),"onUpdate:modelValue":n[4]||=e=>v({indent:e===``?null:Math.max(0,parseInt(String(e),10)||0)})},null,8,[`class`,`model-value`,`placeholder`]),n[13]||=V(`span`,{class:`text-xs text-muted-foreground`},`spaces`,-1)])])):W(``,!0),c(`finalNewline`)?(R(),z(`div`,lA,[V(`div`,uA,[H(j(IS),null,{default:M(()=>[...n[14]||=[U(`Final newline`,-1)]]),_:1}),w.value?(R(),z(`button`,{key:1,type:`button`,class:`text-xs text-primary hover:underline`,onClick:n[5]||=e=>v({finalNewline:null})},`Reset`)):(R(),z(`span`,dA,`Inherited · `+k(e.formatFinalNewline?`on`:`off`),1))]),V(`div`,fA,[H(j(pS),{"model-value":S.value,"onUpdate:modelValue":n[6]||=e=>v({finalNewline:e})},null,8,[`model-value`]),V(`span`,pA,k(S.value?`Enabled`:`Disabled`),1)])])):W(``,!0),c(`includeLocale`)?(R(),z(`div`,mA,[H(j(IS),{class:`flex items-center gap-1.5`},{default:M(()=>[...n[15]||=[U(`Include `,-1),V(`code`,{class:`font-mono text-xs`},`@@locale`,-1)]]),_:1}),n[16]||=V(`p`,{class:`text-xs text-muted-foreground`},`Write the locale marker into each file. Standard for Flutter.`,-1),V(`div`,hA,[H(j(pS),{"model-value":e.output.includeLocale??!0,"onUpdate:modelValue":n[7]||=e=>v({includeLocale:e})},null,8,[`model-value`]),V(`span`,gA,k(e.output.includeLocale??!0?`Enabled`:`Disabled`),1)])])):W(``,!0),V(`div`,_A,[H(j(IS),null,{default:M(()=>[...n[17]||=[U(`Locale code format`,-1)]]),_:1}),n[18]||=V(`p`,{class:`text-xs text-muted-foreground`},[U(`How the `),V(`code`,{class:`font-mono text-xs`},`{locale}`),U(` token is rendered in file names (and the in-file marker for ARB).`)],-1),H(j(Iy),{"model-value":f.value,"onUpdate:modelValue":p},{default:M(()=>[H(j(iS),{class:`w-72`,"aria-label":`Locale code format`},{default:M(()=>[H(j(rb))]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`default`},{default:M(()=>[U(k(d(e.output.adapter)),1)]),_:1}),(R(),z(L,null,F(u,e=>H(j(sS),{key:e.value,value:e.value},{default:M(()=>[V(`span`,vA,[V(`span`,null,k(e.label),1),V(`span`,yA,k(e.example),1)])]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`model-value`])]),V(`div`,bA,[H(j(IS),null,{default:M(()=>[...n[19]||=[U(`Locale overrides`,-1)]]),_:1}),n[21]||=V(`p`,{class:`text-xs text-muted-foreground`},`Force a specific export code for one locale — wins over the format above.`,-1),V(`div`,xA,[se.value.length===0?(R(),z(`p`,SA,`No overrides.`)):W(``,!0),(R(!0),z(L,null,F(se.value,e=>(R(),z(`div`,{key:e,class:`flex items-center gap-2`},[V(`span`,CA,k(e),1),H(j(bu),{class:`size-3 shrink-0 text-muted-foreground`}),H(j(rS),{class:`h-8 flex-1 font-mono text-xs`,"aria-label":`Export code for `+e,placeholder:`export code`,"model-value":oe.value[e]??``,"onUpdate:modelValue":t=>de(e,String(t))},null,8,[`aria-label`,`model-value`,`onUpdate:modelValue`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`size-8 shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove override `+e,onClick:t=>ue(e)},{default:M(()=>[H(j(wd),{class:`size-3.5`})]),_:1},8,[`aria-label`,`onClick`])]))),128)),ce.value.length>0?(R(),z(`div`,wA,[H(j(Iy),{"model-value":``,"onUpdate:modelValue":le},{default:M(()=>[H(j(iS),{class:`w-56 text-muted-foreground`,"aria-label":`Add locale override`},{default:M(()=>[V(`span`,TA,[H(j(od),{class:`size-3.5`}),n[20]||=U(` Add override…`,-1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(ce.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})])):W(``,!0)])]),V(`div`,EA,[n[25]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Advanced · Locale aliases`,-1),n[26]||=V(`p`,{class:`mt-1.5 text-xs text-muted-foreground`},[U(` Write one catalog locale to additional file codes — e.g. `),V(`span`,{class:`font-mono`},`zh-Hans`),U(` also as `),V(`span`,{class:`font-mono`},`zh, zh_CN`),U(`. `)],-1),V(`div`,DA,[ee.value.length===0?(R(),z(`p`,OA,`No aliases. The locale's own code is used as the file name.`)):W(``,!0),(R(!0),z(L,null,F(ee.value,e=>(R(),z(`div`,{key:e,class:`flex items-start gap-2`},[V(`div`,kA,[V(`span`,AA,k(e),1),H(j(bu),{class:`size-3 text-muted-foreground`})]),V(`div`,jA,[(R(!0),z(L,null,F(T.value[e]??[],t=>(R(),z(`span`,{key:t,class:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-xs`},[U(k(t)+` `,1),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`text-muted-foreground hover:text-destructive`,"aria-label":`Remove`,onClick:n=>ae(e,t)},[H(j(kd),{class:`size-3`})],8,MA)]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[22]||=[U(`Remove`,-1)]]),_:1})]),_:2},1024)]))),128)),H(j(rS),{class:`h-8 w-28 font-mono text-xs`,placeholder:`add code…`,"model-value":a.value[e]??``,"onUpdate:modelValue":t=>a.value={...a.value,[e]:String(t)},onKeydown:Xl(q(t=>ie(e),[`prevent`]),[`enter`])},null,8,[`model-value`,`onUpdate:modelValue`,`onKeydown`])]),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`ghost`,size:`icon`,class:`size-8 shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove alias`,onClick:t=>re(e)},{default:M(()=>[H(j(wd),{class:`size-3.5`})]),_:1},8,[`onClick`])]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[23]||=[U(`Remove alias`,-1)]]),_:1})]),_:2},1024)]))),128)),E.value.length>0?(R(),z(`div`,NA,[H(j(Iy),{"model-value":``,"onUpdate:modelValue":ne},{default:M(()=>[H(j(iS),{class:`w-56 text-muted-foreground`},{default:M(()=>[V(`span`,PA,[H(j(od),{class:`size-3.5`}),n[24]||=U(` Add locale alias…`,-1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(E.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})])):W(``,!0)])])])):W(``,!0)],2))}}),IA={class:`grid gap-1.5`},LA={class:`flex flex-wrap gap-2`},RA=[`aria-label`,`onClick`],zA={key:0,class:`text-sm text-muted-foreground`},BA={class:`flex max-w-sm gap-2`},VA={key:0,class:`flex items-center gap-1.5 text-xs text-destructive`},HA=P({__name:`ScanListField`,props:{label:{},items:{},placeholder:{},mono:{type:Boolean},addLabel:{},validate:{type:Function}},emits:[`update:items`],setup(e,{emit:t}){let n=e,r=t,i=A(``),a=A(``);function o(){let e=i.value.trim();if(!e)return;if(n.items.includes(e)){a.value=`"${e}" is already listed`;return}let t=n.validate?.(e)??null;if(t){a.value=t;return}a.value=``,r(`update:items`,[...n.items,e]),i.value=``}function s(e){r(`update:items`,n.items.filter(t=>t!==e))}return(t,n)=>(R(),z(`div`,IA,[H(j(IS),null,{default:M(()=>[U(k(e.label),1)]),_:1}),I(t.$slots,`help`),V(`div`,LA,[(R(!0),z(L,null,F(e.items,t=>(R(),z(`span`,{key:t,class:O([`inline-flex items-center gap-1.5 rounded-lg border bg-accent px-2.5 py-1.5 text-sm`,e.mono&&`font-mono`])},[U(k(t)+` `,1),V(`button`,{type:`button`,class:`flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${t}`,onClick:e=>s(t)},[H(j(kd),{class:`size-3`})],8,RA)],2))),128)),e.items.length===0?(R(),z(`p`,zA,`None — auto-detect.`)):W(``,!0)]),V(`div`,BA,[H(j(rS),{modelValue:i.value,"onUpdate:modelValue":n[0]||=e=>i.value=e,class:O(e.mono?`font-mono`:void 0),placeholder:e.placeholder,onKeydown:Xl(q(o,[`prevent`]),[`enter`]),onInput:n[1]||=e=>a.value=``},null,8,[`modelValue`,`class`,`placeholder`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:o},{default:M(()=>[H(j(od),{class:`size-4`}),U(` `+k(e.addLabel??`Add`),1)]),_:1})]),a.value?(R(),z(`p`,VA,[H(j(Td),{class:`size-3.5`}),U(` `+k(a.value),1)])):W(``,!0)]))}}),UA={key:0,class:`flex flex-1 items-center justify-center text-sm text-muted-foreground`},WA={key:1,class:`flex min-h-0 flex-1 overflow-hidden`},GA={class:`flex w-60 shrink-0 flex-col gap-1 overflow-y-auto border-r bg-muted p-3`},KA=[`onClick`],qA={class:`min-w-0 flex-1`},JA={class:`block text-[13px] font-[570] leading-tight`},YA={class:`mt-0.5 block truncate text-[11px] opacity-70`},XA={key:0,class:`size-2 shrink-0 rounded-full bg-primary ring-2 ring-primary/25`},ZA={key:1,class:`shrink-0 rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wide text-emerald-600 dark:text-emerald-400`},QA=[`onClick`],$A={class:`min-w-0 flex-1`},ej={class:`block text-[13px] font-[570] leading-tight`},tj={class:`mt-0.5 block truncate text-[11px] opacity-70`},nj={class:`relative flex min-w-0 flex-1 flex-col`},rj={class:`flex-1 overflow-y-auto px-8 pb-28 pt-7`},ij={class:`max-w-[680px]`},aj={class:`mb-6`},oj={class:`flex items-center gap-2.5 text-[21px] font-bold tracking-tight`},sj={key:0,class:`size-2 rounded-full bg-primary ring-2 ring-primary/25`},cj={key:0,class:`mt-1.5 text-sm text-muted-foreground`},lj={key:1,class:`mt-1.5 text-sm text-muted-foreground`},uj={key:2,class:`mt-1.5 text-sm text-muted-foreground`},dj={key:3,class:`mt-1.5 text-sm text-muted-foreground`},fj={key:4,class:`mt-1.5 text-sm text-muted-foreground`},pj={key:5,class:`mt-1.5 text-sm text-muted-foreground`},mj={key:6,class:`mt-1.5 text-sm text-muted-foreground`},hj={key:7,class:`mt-2 flex items-center gap-1.5 text-sm text-muted-foreground`},gj={key:0,class:`flex flex-col gap-5`},_j={class:`grid max-w-sm gap-1.5`},vj={key:0},yj={class:`grid gap-1.5`},bj={class:`ml-1.5 font-normal text-muted-foreground`},xj={class:`flex flex-wrap gap-2`},Sj={key:0,class:`font-mono text-[10px] italic text-muted-foreground`},Cj=[`aria-label`,`onClick`],wj={class:`mt-1 flex items-center gap-1.5 text-xs text-destructive`},Tj={class:`grid max-w-sm gap-1.5`},Ej={class:`flex gap-2`},Dj={key:0,class:`flex items-center gap-1.5 text-xs text-muted-foreground`},Oj={key:1,class:`flex flex-col gap-6`},kj={class:`flex items-center justify-between gap-4 rounded-lg border p-3.5`},Aj={class:`flex items-start gap-2.5`},jj={class:`grid size-8 shrink-0 place-items-center rounded-md border border-primary/25 bg-primary/10 text-primary`},Mj={class:`rounded-lg border p-3.5`},Nj={class:`flex items-center justify-between gap-4`},Pj={class:`flex items-start gap-2.5`},Fj={class:`grid size-8 shrink-0 place-items-center rounded-md border border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`},Ij={key:0,class:`mt-3 border-t pt-3`},Lj={class:`flex flex-wrap gap-2`},Rj=[`aria-checked`,`onClick`],zj={class:`mt-2 flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400`},Bj={class:`mt-2 divide-y rounded-lg border`},Vj={class:`flex items-center justify-between gap-4 p-3.5`},Hj={class:`flex items-center gap-2`},Uj={class:`flex items-center justify-between gap-4 p-3.5`},Wj={class:`flex items-center gap-2 text-sm font-medium`},Gj={class:`inline-flex items-center gap-1 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`},Kj={class:`inline-flex shrink-0 items-center gap-1 rounded-md border border-primary/25 bg-primary/10 px-2 py-1 text-xs font-medium text-primary`},qj={class:`flex items-center justify-between gap-4 p-3.5`},Jj={class:`mt-2 flex flex-col gap-2.5`},Yj={key:0,class:`text-sm text-muted-foreground`},Xj={key:2,class:`flex flex-col gap-4`},Zj={class:`flex items-center gap-2 rounded-lg border p-3`},Qj={key:1,class:`flex-1 text-sm text-muted-foreground`},$j={class:`grid max-w-sm gap-4`},eM={class:`grid gap-1.5`},tM={class:`flex items-center gap-2`},nM={key:0,class:`flex items-center gap-1 text-xs leading-none text-emerald-600 dark:text-emerald-400`},rM={class:`text-xs text-muted-foreground`},iM={class:`grid gap-1.5`},aM={key:0,class:`text-xs text-muted-foreground`},oM=[`onClick`],sM={key:0},cM={key:0,class:`grid gap-1.5`},lM={key:1,class:`grid gap-1.5`},uM={key:0,class:`text-xs text-muted-foreground`},dM={key:1,class:`text-xs text-muted-foreground`},fM={class:`grid gap-1.5`},pM={class:`grid gap-1.5`},mM={class:`grid gap-1.5`},hM={class:`grid gap-1.5`},gM={class:`grid gap-1.5`},_M={class:`grid gap-1.5`},vM={key:2,class:`flex items-center gap-3`},yM={class:`grid gap-0.5`},bM={key:3,class:`grid gap-1.5`},xM={key:3,class:`flex flex-col gap-6`},SM={key:4,class:`flex flex-col gap-6`},CM={class:`mt-2 divide-y rounded-lg border`},wM={class:`min-w-0`},TM={class:`flex items-center gap-2 text-sm font-medium`},EM={class:`rounded border bg-muted px-1 py-0.5 font-mono text-[10px] text-muted-foreground`},DM={class:`mt-0.5 text-xs text-muted-foreground`},OM={key:5,class:`flex flex-col gap-4`},kM={class:`flex flex-wrap gap-2`},AM=[`aria-label`,`onClick`],jM={key:0,class:`text-sm text-muted-foreground`},MM={class:`grid max-w-sm gap-1.5`},NM={class:`flex gap-2`},PM={key:6,class:`flex flex-col gap-4`},FM={class:`grid max-w-sm gap-1.5`},IM={class:`flex items-center gap-2`},LM={key:0,class:`flex items-center gap-1 text-xs leading-none text-emerald-600 dark:text-emerald-400`},RM={class:`flex items-center gap-1.5 text-sm text-muted-foreground`},zM={class:`inline-grid h-5 min-w-[20px] shrink-0 place-items-center rounded-full bg-primary px-1.5 text-[11px] font-bold tabular-nums text-primary-foreground`},BM={class:`font-semibold`},VM={class:`relative`},HM={key:0,class:`absolute bottom-full left-1/2 z-50 mb-2.5 w-64 -translate-x-1/2 rounded-xl border bg-card p-3.5 shadow-lg`},UM={class:`mt-1 text-xs leading-relaxed text-muted-foreground`},WM={class:`mt-3 flex justify-end gap-2`},GM={role:`dialog`,"aria-modal":`true`,"aria-labelledby":`leave-warning-title`,class:`w-full max-w-md rounded-2xl border bg-card p-5 shadow-xl`},KM={id:`leave-warning-title`,class:`flex items-center gap-2 text-[15px] font-semibold`},qM={class:`mt-1.5 text-[13px] leading-relaxed text-muted-foreground`},JM={class:`font-medium text-foreground`},YM={class:`block`},XM={class:`mt-4 flex items-center gap-2`},ZM={key:0,class:`fixed left-1/2 top-4 z-[80] flex -translate-x-1/2 items-center gap-2 rounded-[11px] bg-foreground px-4 py-2.5 text-[12.5px] font-medium text-background shadow-lg`},QM=P({__name:`SettingsView`,setup(e){let t=[`languages`,`outputs`,`ai`,`scan`,`quality`,`dictionary`,`editor`],n=[`flutter-arb`,`laravel-php`,`vue-i18n-json`,`angular-xliff`,`rails-yaml`,`apple-strings`],r=[{value:`anthropic`,label:`Anthropic`},{value:`bedrock`,label:`AWS Bedrock`},{value:`claude-code`,label:`Claude Code`},{value:`ollama`,label:`Ollama`},{value:`openai`,label:`OpenAI`},{value:`openrouter`,label:`OpenRouter`}],i={anthropic:[`claude-opus-4-8`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`],openai:[`gpt-4o-mini`,`gpt-4o`,`gpt-4.1`],bedrock:[`amazon.nova-pro-v1:0`,`anthropic.claude-3-5-sonnet-20241022-v2:0`,`meta.llama3-1-70b-instruct-v1:0`],openrouter:[`anthropic/claude-3.5-haiku`,`openai/gpt-4o-mini`,`google/gemini-2.0-flash-001`],ollama:[`translategemma:4b`,`translategemma:12b`,`qwen3.5:9b`],"claude-code":[`claude-opus-4-8`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`]},a={anthropic:`Set ANTHROPIC_API_KEY in your environment (or a .env file).`,openai:`Set OPENAI_API_KEY in your environment (or a .env file).`,bedrock:`Uses your AWS credentials (env vars, AWS_PROFILE, or an instance/SSO role).`,openrouter:`Set OPENROUTER_API_KEY in your environment (or a .env file).`,ollama:`Runs locally — no API key needed. Set OLLAMA_API_KEY only for a secured/remote server.`,"claude-code":`Uses your local Claude Code session — no separate API key needed. Requires the claude CLI to be installed.`},o=A(null),s=A(null),c=Zt({sourceLocale:``,locales:[],outputs:[],indent:2,sortKeys:!0,finalNewline:!0,autoExport:!0,exportLocales:[],customWords:[],lintRules:{},lintIgnore:[],scanAccessors:[],scanPatterns:[],scanInclude:[],scanExclude:[]}),l=A(!1),u=A(!1),d=A(p()),f=A(!1);function p(){let e=Cp().get(`section`)??``;return t.includes(e)?e:`languages`}function m(e){d.value=e,location.hash=`settings?section=${e}`}function h(){d.value=p()}let g=A(null),_=A(!1),v=null;function y(e){c.sourceLocale=e.sourceLocale,c.locales=[...e.locales],c.outputs=e.outputs.map(e=>({...e})),c.indent=e.indent,c.sortKeys=e.sortKeys,c.finalNewline=e.finalNewline,c.autoExport=e.autoExport,c.exportLocales=[...e.exportLocales],c.customWords=[...e.customWords],c.lintRules={...e.lintRules},c.lintIgnore=[...e.lintIgnore],c.scanAccessors=[...e.scanAccessors],c.scanPatterns=[...e.scanPatterns],c.scanInclude=[...e.scanInclude],c.scanExclude=[...e.scanExclude]}function b(){o.value={sourceLocale:c.sourceLocale,locales:[...c.locales],outputs:c.outputs.map(e=>({...e})),indent:c.indent,sortKeys:c.sortKeys,finalNewline:c.finalNewline,autoExport:c.autoExport,exportLocales:[...c.exportLocales],customWords:[...c.customWords],lintRules:{...c.lintRules},lintIgnore:[...c.lintIgnore],scanAccessors:[...c.scanAccessors],scanPatterns:[...c.scanPatterns],scanInclude:[...c.scanInclude],scanExclude:[...c.scanExclude]}}async function x(){let e=await jd();s.value=e.config,y(Wk(e.config)),b(),await re(),l.value=!0}x();let S=A({}),C=A(null),w=A(``),T=Zt({provider:`anthropic`,model:``,endpoint:``,region:``,batchSize:25,concurrency:``,contextBatchSize:``,contextConcurrency:``,vision:!1,promptStyle:``,inputPricePerMTok:``,outputPricePerMTok:``}),ee=A(!1),E=null,te=null,ne=``;async function re(){let[e,t]=await Promise.all([nf(),af()]);S.value=t.profiles,C.value=t.activeProfile,w.value=t.activeProfile??``,ie(C.value?t.profiles[C.value]??e.ai:e.ai),ne=JSON.stringify(ae())}function ie(e){T.provider=e.provider,T.model=e.model,T.endpoint=e.endpoint??``,T.region=e.region??``,T.batchSize=e.batchSize,T.concurrency=e.concurrency??``,T.contextBatchSize=e.contextBatchSize??``,T.contextConcurrency=e.contextConcurrency??``,T.vision=e.vision??!1,T.promptStyle=e.promptStyle??``,T.inputPricePerMTok=e.inputPricePerMTok??``,T.outputPricePerMTok=e.outputPricePerMTok??``,ne=JSON.stringify(ae())}function ae(){let e=String(T.endpoint).trim(),t=String(T.region).trim(),n=Number(T.batchSize),r=Number(T.concurrency),i=Number(T.contextBatchSize),a=Number(T.contextConcurrency),o=Number(T.inputPricePerMTok),s=Number(T.outputPricePerMTok);return{provider:T.provider.trim(),model:T.model.trim(),endpoint:e===``?null:e,region:t===``?null:t,batchSize:Number.isFinite(n)&&n>0?n:25,concurrency:Number.isFinite(r)&&r>0?r:void 0,contextBatchSize:Number.isFinite(i)&&i>0?i:void 0,contextConcurrency:Number.isFinite(a)&&a>0?a:void 0,vision:T.vision||void 0,promptStyle:T.promptStyle||void 0,inputPricePerMTok:T.inputPricePerMTok!==``&&Number.isFinite(o)&&o>=0?o:void 0,outputPricePerMTok:T.outputPricePerMTok!==``&&Number.isFinite(s)&&s>=0?s:void 0}}N(T,()=>{JSON.stringify(ae())!==ne&&(te&&clearTimeout(te),te=setTimeout(async()=>{let e=ae();try{C.value?(await of(C.value,e),S.value={...S.value,[C.value]:e}):await rf({ai:e}),ne=JSON.stringify(e),ee.value=!0,E&&clearTimeout(E),E=setTimeout(()=>{ee.value=!1},1700)}catch(e){$.error(e.message)}},500))},{deep:!0});let oe=[`languages`,`outputs`,`scan`,`quality`,`dictionary`],se=[`ai`,`editor`];function ce(e){if(!o.value)return!0;let t=c,n=o.value;return e===`languages`?JSON.stringify(t.locales)===JSON.stringify(n.locales)&&t.sourceLocale===n.sourceLocale:e===`outputs`?JSON.stringify(t.outputs)===JSON.stringify(n.outputs)&&String(t.indent)===String(n.indent)&&t.finalNewline===n.finalNewline&&t.autoExport===n.autoExport&&JSON.stringify(t.exportLocales)===JSON.stringify(n.exportLocales):e===`scan`?JSON.stringify(t.scanAccessors)===JSON.stringify(n.scanAccessors)&&JSON.stringify(t.scanPatterns)===JSON.stringify(n.scanPatterns)&&JSON.stringify(t.scanInclude)===JSON.stringify(n.scanInclude)&&JSON.stringify(t.scanExclude)===JSON.stringify(n.scanExclude):e===`quality`?JSON.stringify(t.lintRules)===JSON.stringify(n.lintRules)&&JSON.stringify(t.lintIgnore)===JSON.stringify(n.lintIgnore):e===`dictionary`?JSON.stringify(t.customWords)===JSON.stringify(n.customWords):!0}let D=K(()=>oe.filter(e=>!ce(e))),le=K(()=>D.value.length),ue=K(()=>D.value.map(e=>he[e].title));N(le,e=>{Kk.value=e},{immediate:!0}),Xi(()=>{Kk.value=0});let de=K(()=>ww.find(e=>e.id===Dw.value)?.label??`VS Code`),fe=A(!1),pe=null;function me(e){Ow(e),fe.value=!0,pe&&clearTimeout(pe),pe=setTimeout(()=>{fe.value=!1},1700)}let he={languages:{title:`Languages`},outputs:{title:`Export targets`},ai:{title:`AI`},scan:{title:`Scan`},quality:{title:`Quality checks`},dictionary:{title:`Custom dictionary`},editor:{title:`Editor`}},ge=[{id:`languages`,title:`Languages`},{id:`outputs`,title:`Export targets`},{id:`scan`,title:`Scan`},{id:`quality`,title:`Quality checks`},{id:`dictionary`,title:`Custom dictionary`}];function _e(e){if(e===`languages`)return`${c.locales.length} language${c.locales.length===1?``:`s`}`;if(e===`outputs`)return`${c.outputs.length} target${c.outputs.length===1?``:`s`}${c.autoExport?` · auto`:``}${c.exportLocales.length?` · limited`:``}`;if(e===`ai`)return C.value?`${C.value} · ${T.model}`:`${T.provider} · ${T.model}`;if(e===`scan`){let e=c.scanAccessors.length,t=c.scanPatterns.length,n=[e&&`${e} accessor${e===1?``:`s`}`,t&&`${t} pattern${t===1?``:`s`}`].filter(Boolean);return n.length?n.join(` · `):`Auto-detect`}if(e===`quality`){let e=Object.entries(c.lintRules).filter(([,e])=>e===`off`).length,t=Object.entries(c.lintRules).filter(([e,t])=>Hk[e]!==void 0&&t!==Hk[e]).length;return!t&&!c.lintIgnore.length?`Defaults`:[t&&`${t} adjusted${e?` (${e} off)`:``}`,c.lintIgnore.length&&`${c.lintIgnore.length} ignored`].filter(Boolean).join(` · `)}return e===`dictionary`?c.customWords.length?`${c.customWords.length} word${c.customWords.length===1?``:`s`}`:`No custom words`:``}async function ve(){if(le.value!==0){u.value=!0;try{await $d(Gk(c,s.value??void 0)),b(),_.value=!0,v&&clearTimeout(v),v=setTimeout(()=>{_.value=!1},1700)}catch(e){$.error(e.message)}finally{u.value=!1}}}function ye(){o.value&&y(o.value),f.value=!1}function be(e){return e===`settings`||le.value===0?!0:(g.value=e,!1)}function xe(e){g.value=null,xp(e)}function Se(){g.value=null}function Ce(){let e=g.value;ye(),e&&xe(e)}async function we(){let e=g.value;await ve(),e&&le.value===0&&xe(e)}function Te(e){le.value>0&&(e.preventDefault(),e.returnValue=``)}function Ee(e){if(e.key===`Escape`&&g.value){e.preventDefault(),Se();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),ve())}Ki(()=>{window.addEventListener(`keydown`,Ee),window.addEventListener(`beforeunload`,Te),window.addEventListener(`hashchange`,h),bp(be)}),Xi(()=>{window.removeEventListener(`keydown`,Ee),window.removeEventListener(`beforeunload`,Te),window.removeEventListener(`hashchange`,h),bp(null)});let De=A(``);function Oe(){let e=De.value.trim().toLowerCase();if(e){if(c.locales.some(t=>t.toLowerCase()===e)){$.error(`${e} is already in the list`);return}c.locales.push(e),De.value=``}}function ke(e){e!==c.sourceLocale&&(c.locales=c.locales.filter(t=>t!==e))}function Ae(){c.outputs.push({adapter:`flutter-arb`,path:``,emptyAs:`omit`,style:`nested`,indent:null,finalNewline:null,includeLocale:!0,localeAliases:{}})}function je(e){c.outputs.splice(e,1)}let Me=K(()=>c.exportLocales.length>0);function Ne(e){c.exportLocales=e?[...c.locales]:[]}function Pe(e){c.exportLocales=c.exportLocales.includes(e)?c.exportLocales.filter(t=>t!==e):[...c.exportLocales,e]}let Fe=K(()=>T.provider===`bedrock`),Ie=K(()=>T.provider===`ollama`),Le=K(()=>a[T.provider]??``),Re=K(()=>i[T.provider]??[]),ze=K(()=>Re.value[0]??``);async function Be(e){C.value=e,w.value=e??``,await cf(e),ie(e?S.value[e]??ae():(await nf()).ai)}async function Ve(){let e=`Profile ${Object.keys(S.value).length+1}`,t=ae();await of(e,t),S.value={...S.value,[e]:t},await Be(e)}async function He(e,t){let n=t.trim();if(!n||n===e){w.value=e;return}if(n in S.value){$.error(`A profile with that name already exists`),w.value=e;return}let r=S.value[e];await of(n,r),await sf(e);let i={...S.value};delete i[e],i[n]=r,S.value=i,await Be(n)}async function Ue(){if(!C.value)return;let e=C.value;await sf(e);let t={...S.value};delete t[e],S.value=t,await Be(null)}let We=A(``);function Ge(){let e=We.value.trim();if(e){if(c.customWords.includes(e)){$.error(`${e} is already in the dictionary`);return}c.customWords=[...c.customWords,e].sort(),We.value=``}}function Ke(e){c.customWords=c.customWords.filter(t=>t!==e)}function qe(e){try{return new RegExp(e),null}catch(e){return`Invalid regex: ${e.message}`}}return(e,t)=>(R(),z(L,null,[l.value?(R(),z(`div`,WA,[V(`nav`,GA,[t[29]||=V(`p`,{class:`px-2.5 pb-2 pt-1 text-[10.5px] font-bold uppercase tracking-widest text-muted-foreground`},` Settings `,-1),(R(),z(L,null,F(ge,e=>V(`button`,{key:e.id,type:`button`,class:O([`flex w-full items-center gap-2.5 rounded-[10px] border px-2.5 py-2.5 text-left transition-colors`,d.value===e.id?`border-border bg-card text-foreground shadow-sm`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`]),onClick:t=>m(e.id)},[V(`span`,{class:O([`flex size-[30px] shrink-0 items-center justify-center rounded-lg border`,d.value===e.id?`border-primary/30 bg-primary/10 text-primary`:`border-border/60 bg-background text-muted-foreground`])},[e.id===`languages`?(R(),B(j(qu),{key:0,class:`size-4`})):e.id===`outputs`?(R(),B(j(Uu),{key:1,class:`size-4`})):e.id===`ai`?(R(),B(j(Iu),{key:2,class:`size-4`})):e.id===`scan`?(R(),B(j(dd),{key:3,class:`size-4`})):e.id===`quality`?(R(),B(j(hd),{key:4,class:`size-4`})):(R(),B(j(Cu),{key:5,class:`size-4`}))],2),V(`span`,qA,[V(`span`,JA,k(e.title),1),V(`span`,YA,k(_e(e.id)),1)]),!e.autosave&&D.value.includes(e.id)?(R(),z(`span`,XA)):W(``,!0),e.autosave?(R(),z(`span`,ZA,`Auto`)):W(``,!0)],10,KA)),64)),t[30]||=V(`p`,{class:`mt-4 border-t px-2.5 pb-2 pt-3 text-[10.5px] font-bold uppercase tracking-widest text-muted-foreground`},` Local (not committed) `,-1),(R(),z(L,null,F(se,e=>V(`button`,{key:e,type:`button`,class:O([`flex w-full items-center gap-2.5 rounded-[10px] border px-2.5 py-2.5 text-left transition-colors`,d.value===e?`border-border bg-card text-foreground shadow-sm`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`]),onClick:t=>m(e)},[V(`span`,{class:O([`flex size-[30px] shrink-0 items-center justify-center rounded-lg border`,d.value===e?`border-primary/30 bg-primary/10 text-primary`:`border-border/60 bg-background text-muted-foreground`])},[e===`ai`?(R(),B(j(Iu),{key:0,class:`size-4`})):(R(),B(j(Fu),{key:1,class:`size-4`}))],2),V(`span`,$A,[V(`span`,ej,k(he[e].title),1),V(`span`,tj,k(e===`editor`?de.value:_e(e)),1)])],10,QA)),64))]),V(`div`,nj,[V(`div`,rj,[V(`div`,ij,[V(`div`,aj,[V(`h2`,oj,[U(k(he[d.value].title)+` `,1),D.value.includes(d.value)?(R(),z(`span`,sj)):W(``,!0)]),d.value===`languages`?(R(),z(`p`,cj,` The source language is translated into every other language. `)):d.value===`outputs`?(R(),z(`p`,lj,[...t[31]||=[U(` Where compiled translation files are written. Use `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`{locale}`,-1),U(` and `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`{namespace}`,-1),U(` placeholders in the path. `,-1)]])):d.value===`ai`?(R(),z(`p`,uj,[...t[32]||=[U(` The provider and model used for machine translation. Stored locally in `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),U(`, not shared with your team. `,-1)]])):d.value===`scan`?(R(),z(`p`,dj,` How the usage scanner finds where keys are referenced in code. Auto-detection handles most projects — these settings are for the cases it can't infer. `)):d.value===`quality`?(R(),z(`p`,fj,[...t[33]||=[U(` Which checks run and how severe they are — in the editor, the Analytics release gate, and `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`glotfile lint`,-1),U(` alike. Errors block a release; warnings don't. `,-1)]])):d.value===`dictionary`?(R(),z(`p`,pj,` Words the spell checker should never flag. Added here or from a cell's warning. `)):d.value===`editor`?(R(),z(`p`,mj,[...t[34]||=[U(` Which editor opens when you click a key's code usage. Stored locally in `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),U(`, not shared with your team. `,-1)]])):W(``,!0),se.includes(d.value)?(R(),z(`p`,hj,[H(j(Ad),{class:`size-3.5`}),t[35]||=U(` Changes here save automatically. `,-1)])):W(``,!0)]),d.value===`languages`?(R(),z(`div`,gj,[V(`div`,_j,[H(j(IS),{for:`source-locale`},{default:M(()=>[...t[36]||=[U(`Source language`,-1)]]),_:1}),H(j(Iy),{modelValue:c.sourceLocale,"onUpdate:modelValue":t[0]||=e=>c.sourceLocale=e},{default:M(()=>[H(j(iS),{id:`source-locale`},{default:M(()=>[c.sourceLocale?(R(),z(`span`,vj,[H(UC,{code:c.sourceLocale,"show-name":``,size:14},null,8,[`code`])])):(R(),B(j(rb),{key:1,placeholder:`Select source`}))]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(c.locales,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[H(UC,{code:e,"show-name":``,size:14},null,8,[`code`])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),V(`div`,yj,[H(j(IS),null,{default:M(()=>[t[37]||=U(` Languages `,-1),V(`span`,bj,k(c.locales.length),1)]),_:1}),V(`div`,xj,[(R(!0),z(L,null,F(c.locales,e=>(R(),z(`span`,{key:e,class:O([`inline-flex items-center gap-1.5 rounded-[9px] border px-2.5 py-1.5 text-sm transition-colors`,e===c.sourceLocale?`border-border/60 bg-accent`:`border-border bg-background`])},[H(UC,{code:e,"show-name":``,size:14},null,8,[`code`]),e===c.sourceLocale?(R(),z(`span`,Sj,`source`)):(R(),z(`button`,{key:1,type:`button`,class:`ml-0.5 flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${e}`,onClick:t=>ke(e)},[H(j(kd),{class:`size-3`})],8,Cj))],2))),128))]),V(`p`,wj,[H(j(Td),{class:`size-3.5`}),t[38]||=U(` Removing a language deletes its translations. `,-1)])]),V(`div`,Tj,[H(j(IS),{for:`add-locale`},{default:M(()=>[...t[39]||=[U(`Add language`,-1)]]),_:1}),V(`div`,Ej,[H(j(rS),{id:`add-locale`,modelValue:De.value,"onUpdate:modelValue":t[1]||=e=>De.value=e,class:`font-mono`,placeholder:`es`,onKeydown:Xl(q(Oe,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:Oe},{default:M(()=>[H(j(od),{class:`size-4`}),t[40]||=U(` Add`,-1)]),_:1})]),De.value.trim()?(R(),z(`p`,Dj,[t[41]||=U(` Preview: `,-1),H(UC,{code:De.value.trim(),"show-name":``,size:14},null,8,[`code`])])):W(``,!0)])])):d.value===`outputs`?(R(),z(`div`,Oj,[V(`div`,kj,[V(`div`,Aj,[V(`span`,jj,[H(j(Ad),{class:`size-4`})]),t[42]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Auto-export on save`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Write locale files to your project automatically as you edit, so your running app picks them up immediately.`)],-1)]),H(j(pS),{modelValue:c.autoExport,"onUpdate:modelValue":t[2]||=e=>c.autoExport=e},null,8,[`modelValue`])]),V(`div`,Mj,[V(`div`,Nj,[V(`div`,Pj,[V(`span`,Fj,[H(j(Zu),{class:`size-4`})]),t[43]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Limit export languages`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Only the selected languages are written to disk, including auto-export. Off exports all languages.`)],-1)]),H(j(pS),{"model-value":Me.value,"onUpdate:modelValue":Ne},null,8,[`model-value`])]),Me.value?(R(),z(`div`,Ij,[V(`div`,Lj,[(R(!0),z(L,null,F(c.locales,e=>(R(),z(`button`,{key:e,type:`button`,role:`checkbox`,"aria-checked":c.exportLocales.includes(e),class:O([`inline-flex items-center gap-1.5 rounded-[9px] border px-2.5 py-1.5 text-sm transition-colors`,c.exportLocales.includes(e)?`border-primary/40 bg-primary/10`:`border-border bg-background text-muted-foreground hover:bg-accent`]),onClick:t=>Pe(e)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,c.exportLocales.includes(e)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[c.exportLocales.includes(e)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),H(UC,{code:e,"show-name":``,size:14},null,8,[`code`])],10,Rj))),128))]),V(`p`,zj,[H(j(Td),{class:`size-3.5`}),U(` Export limited to `+k(c.exportLocales.length)+` of `+k(c.locales.length)+` languages. `,1)])])):W(``,!0)]),V(`div`,null,[t[51]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Format defaults`,-1),t[52]||=V(`p`,{class:`mt-1 text-xs text-muted-foreground`},`Export targets inherit these. Indent and Final newline can be overridden per target.`,-1),V(`div`,Bj,[V(`div`,Vj,[t[45]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Indent`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Spaces per nesting level.`)],-1),V(`div`,Hj,[H(j(rS),{modelValue:c.indent,"onUpdate:modelValue":t[3]||=e=>c.indent=e,modelModifiers:{number:!0},type:`number`,min:`0`,max:`8`,class:`w-20`},null,8,[`modelValue`]),t[44]||=V(`span`,{class:`text-xs text-muted-foreground`},`spaces`,-1)])]),V(`div`,Uj,[V(`div`,null,[V(`div`,Wj,[t[47]||=U(` Sort keys `,-1),V(`span`,Gj,[H(j(ed),{class:`size-2.5`}),t[46]||=U(` Locked`,-1)])]),t[48]||=V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Keys are always written alphabetically so output is deterministic and diffs stay clean.`,-1)]),V(`span`,Kj,[H(j(Du),{class:`size-3`}),t[49]||=U(` Always alphabetical`,-1)])]),V(`div`,qj,[t[50]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Final newline`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Append a trailing newline at the end of every file.`)],-1),H(j(pS),{modelValue:c.finalNewline,"onUpdate:modelValue":t[4]||=e=>c.finalNewline=e},null,8,[`modelValue`])])])]),V(`div`,null,[t[54]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Export targets`,-1),V(`div`,Jj,[(R(!0),z(L,null,F(c.outputs,(e,t)=>(R(),B(FA,{key:t,output:e,"format-indent":Number(c.indent)||0,"format-final-newline":c.finalNewline,locales:c.locales,adapters:n,"onUpdate:output":e=>c.outputs.splice(t,1,e),onRemove:e=>je(t)},null,8,[`output`,`format-indent`,`format-final-newline`,`locales`,`onUpdate:output`,`onRemove`]))),128)),c.outputs.length===0?(R(),z(`p`,Yj,`No export targets configured.`)):W(``,!0),V(`div`,null,[H(j(Q),{variant:`ghost`,size:`sm`,class:`mt-1 pl-2`,onClick:Ae},{default:M(()=>[H(j(od),{class:`size-4`}),t[53]||=U(` Add export target `,-1)]),_:1})])])])])):d.value===`ai`?(R(),z(`div`,Xj,[V(`div`,Zj,[H(j(Iy),{"model-value":C.value??`__none__`,"onUpdate:modelValue":t[5]||=e=>Be(e===`__none__`?null:e)},{default:M(()=>[H(j(iS),{class:`w-44`},{default:M(()=>[H(j(rb),{placeholder:`No profile`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`__none__`},{default:M(()=>[...t[55]||=[U(`No profile`,-1)]]),_:1}),(R(!0),z(L,null,F(Object.keys(S.value),e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]),C.value?(R(),B(j(rS),{key:0,modelValue:w.value,"onUpdate:modelValue":t[6]||=e=>w.value=e,class:`flex-1 font-medium`,placeholder:`Profile name`,onBlur:t[7]||=e=>He(C.value,w.value),onKeydown:t[8]||=Xl(q(e=>He(C.value,w.value),[`prevent`]),[`enter`])},null,8,[`modelValue`])):(R(),z(`span`,Qj,`Using default settings`)),H(j(Q),{variant:`outline`,size:`sm`,class:`shrink-0`,onClick:Ve},{default:M(()=>[H(j(od),{class:`size-4`}),t[56]||=U(` New `,-1)]),_:1}),H(j(Q),{variant:`ghost`,size:`sm`,class:`shrink-0 text-destructive hover:bg-destructive/10 hover:text-destructive`,disabled:!C.value,onClick:Ue},{default:M(()=>[H(j(kd),{class:`size-4`})]),_:1},8,[`disabled`])]),V(`div`,$j,[V(`div`,eM,[V(`div`,tM,[H(j(IS),{for:`ai-provider`},{default:M(()=>[...t[57]||=[U(`Provider`,-1)]]),_:1}),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0 translate-y-0.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-300 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0`},{default:M(()=>[ee.value?(R(),z(`span`,nM,[H(j(Du),{class:`size-3`}),t[58]||=U(` Saved `,-1)])):W(``,!0)]),_:1})]),H(j(Iy),{modelValue:T.provider,"onUpdate:modelValue":t[9]||=e=>T.provider=e},{default:M(()=>[H(j(iS),{id:`ai-provider`},{default:M(()=>[H(j(rb),{placeholder:`Select provider`})]),_:1}),H(j(aS),null,{default:M(()=>[(R(),z(L,null,F(r,e=>H(j(sS),{key:e.value,value:e.value},{default:M(()=>[U(k(e.label),1)]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`modelValue`]),V(`p`,rM,k(Le.value),1)]),V(`div`,iM,[H(j(IS),{for:`ai-model`},{default:M(()=>[...t[59]||=[U(`Model`,-1)]]),_:1}),H(j(rS),{id:`ai-model`,modelValue:T.model,"onUpdate:modelValue":t[10]||=e=>T.model=e,class:`font-mono`,placeholder:ze.value},null,8,[`modelValue`,`placeholder`]),Re.value.length?(R(),z(`p`,aM,[t[60]||=U(` Examples: `,-1),(R(!0),z(L,null,F(Re.value,(e,t)=>(R(),z(L,{key:e},[V(`button`,{type:`button`,class:`font-mono underline-offset-2 hover:text-foreground hover:underline`,onClick:t=>T.model=e},k(e),9,oM),t<Re.value.length-1?(R(),z(`span`,sM,` · `)):W(``,!0)],64))),128))])):W(``,!0)]),Fe.value?(R(),z(`div`,cM,[H(j(IS),{for:`ai-region`},{default:M(()=>[...t[61]||=[U(`Region`,-1)]]),_:1}),H(j(rS),{id:`ai-region`,modelValue:T.region,"onUpdate:modelValue":t[11]||=e=>T.region=e,class:`font-mono`,placeholder:`us-east-1`},null,8,[`modelValue`]),t[62]||=V(`p`,{class:`text-xs text-muted-foreground`},[U(`AWS region for Bedrock. Falls back to `),V(`code`,{class:`font-mono`},`AWS_REGION`),U(` if empty.`)],-1)])):(R(),z(`div`,lM,[H(j(IS),{for:`ai-endpoint`},{default:M(()=>[...t[63]||=[U(`Endpoint`,-1)]]),_:1}),H(j(rS),{id:`ai-endpoint`,modelValue:T.endpoint,"onUpdate:modelValue":t[12]||=e=>T.endpoint=e,class:`font-mono`,placeholder:Ie.value?`http://localhost:11434/v1`:`Default (leave empty)`},null,8,[`modelValue`,`placeholder`]),Ie.value?(R(),z(`p`,uM,[...t[64]||=[U(`Defaults to the local Ollama server. Override only for a remote instance — include the `,-1),V(`code`,{class:`font-mono`},`/v1`,-1),U(` suffix.`,-1)]])):(R(),z(`p`,dM,`Optional — for an in-region or self-hosted / OpenAI-compatible gateway.`))])),t[82]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Translation`,-1),V(`div`,fM,[H(j(IS),{for:`ai-batch`},{default:M(()=>[...t[65]||=[U(`Batch size`,-1)]]),_:1}),H(j(rS),{id:`ai-batch`,modelValue:T.batchSize,"onUpdate:modelValue":t[13]||=e=>T.batchSize=e,modelModifiers:{number:!0},type:`number`,min:`1`,class:`w-28`},null,8,[`modelValue`]),t[66]||=V(`p`,{class:`text-xs text-muted-foreground`},`Strings sent per request.`,-1)]),V(`div`,pM,[H(j(IS),{for:`ai-concurrency`},{default:M(()=>[...t[67]||=[U(`Parallel locales`,-1)]]),_:1}),H(j(rS),{id:`ai-concurrency`,modelValue:T.concurrency,"onUpdate:modelValue":t[14]||=e=>T.concurrency=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:`3`,class:`w-28`},null,8,[`modelValue`]),t[68]||=V(`p`,{class:`text-xs text-muted-foreground`},`How many locales to translate at once.`,-1)]),V(`div`,mM,[H(j(IS),{for:`ai-price-in`},{default:M(()=>[...t[69]||=[U(`Input price ($ / 1M tokens)`,-1)]]),_:1}),H(j(rS),{id:`ai-price-in`,modelValue:T.inputPricePerMTok,"onUpdate:modelValue":t[15]||=e=>T.inputPricePerMTok=e,modelModifiers:{number:!0},type:`number`,min:`0`,step:`0.01`,placeholder:`Auto for Claude models`,class:`w-44`},null,8,[`modelValue`])]),V(`div`,hM,[H(j(IS),{for:`ai-price-out`},{default:M(()=>[...t[70]||=[U(`Output price ($ / 1M tokens)`,-1)]]),_:1}),H(j(rS),{id:`ai-price-out`,modelValue:T.outputPricePerMTok,"onUpdate:modelValue":t[16]||=e=>T.outputPricePerMTok=e,modelModifiers:{number:!0},type:`number`,min:`0`,step:`0.01`,placeholder:`Auto for Claude models`,class:`w-44`},null,8,[`modelValue`]),t[71]||=V(`p`,{class:`text-xs text-muted-foreground`},`Used for the pre-translate cost estimate. Set both to override the built-in Claude prices or to price other models.`,-1)]),t[83]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Context build`,-1),V(`div`,gM,[H(j(IS),{for:`ai-context-batch`},{default:M(()=>[...t[72]||=[U(`Batch size`,-1)]]),_:1}),H(j(rS),{id:`ai-context-batch`,modelValue:T.contextBatchSize,"onUpdate:modelValue":t[17]||=e=>T.contextBatchSize=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:String(T.batchSize||25),class:`w-28`},null,8,[`modelValue`,`placeholder`]),t[73]||=V(`p`,{class:`text-xs text-muted-foreground`},`Keys per request. Defaults to translation batch size.`,-1)]),V(`div`,_M,[H(j(IS),{for:`ai-context-concurrency`},{default:M(()=>[...t[74]||=[U(`Concurrency`,-1)]]),_:1}),H(j(rS),{id:`ai-context-concurrency`,modelValue:T.contextConcurrency,"onUpdate:modelValue":t[18]||=e=>T.contextConcurrency=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:String(T.concurrency||3),class:`w-28`},null,8,[`modelValue`,`placeholder`]),t[75]||=V(`p`,{class:`text-xs text-muted-foreground`},`Parallel context requests. Defaults to parallel locales.`,-1)]),Ie.value?(R(),z(`div`,vM,[H(j(pS),{id:`ai-vision`,modelValue:T.vision,"onUpdate:modelValue":t[19]||=e=>T.vision=e},null,8,[`modelValue`]),V(`div`,yM,[H(j(IS),{for:`ai-vision`},{default:M(()=>[...t[76]||=[U(`Vision`,-1)]]),_:1}),t[77]||=V(`p`,{class:`text-xs text-muted-foreground`},`Enable for models that support image input (e.g. translategemma, llava).`,-1)])])):W(``,!0),Ie.value?(R(),z(`div`,bM,[H(j(IS),{for:`ai-prompt-style`},{default:M(()=>[...t[78]||=[U(`Prompt style`,-1)]]),_:1}),H(j(Iy),{"model-value":T.promptStyle||`__default__`,"onUpdate:modelValue":t[20]||=e=>T.promptStyle=e===`__default__`?``:e},{default:M(()=>[H(j(iS),{id:`ai-prompt-style`},{default:M(()=>[H(j(rb),{placeholder:`Default`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`__default__`},{default:M(()=>[...t[79]||=[U(`Default`,-1)]]),_:1}),H(j(sS),{value:`translategemma`},{default:M(()=>[...t[80]||=[U(`TranslateGemma`,-1)]]),_:1})]),_:1})]),_:1},8,[`model-value`]),t[81]||=V(`p`,{class:`text-xs text-muted-foreground`},`TranslateGemma uses a role-based system prompt and plain-text output instead of JSON batching.`,-1)])):W(``,!0)])])):d.value===`scan`?(R(),z(`div`,xM,[H(HA,{label:`Flutter accessors`,items:c.scanAccessors,mono:``,placeholder:`translations`,"onUpdate:items":t[21]||=e=>c.scanAccessors=e},{help:M(()=>[...t[84]||=[V(`p`,{class:`text-xs text-muted-foreground`},[U(` Accessors assigned from `),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-[11px]`},`AppLocalizations.of(...)`),U(` are detected automatically. Add a name only if yours isn't found. `)],-1)]]),_:1},8,[`items`]),H(HA,{label:`Custom patterns`,items:c.scanPatterns,mono:``,placeholder:`LocaleKeys\\.(\\w+)\\.tr\\(\\)`,validate:qe,"onUpdate:items":t[22]||=e=>c.scanPatterns=e},{help:M(()=>[...t[85]||=[V(`p`,{class:`text-xs text-muted-foreground`},` Regex applied to every scanned file — capture group 1 is the key. `,-1)]]),_:1},8,[`items`]),H(HA,{label:`Include globs`,items:c.scanInclude,mono:``,placeholder:`lib/**`,"onUpdate:items":t[23]||=e=>c.scanInclude=e},{help:M(()=>[...t[86]||=[V(`p`,{class:`text-xs text-muted-foreground`},`Limit the scan to these globs. Empty scans everything.`,-1)]]),_:1},8,[`items`]),H(HA,{label:`Exclude globs`,items:c.scanExclude,mono:``,placeholder:`**/*.g.dart`,"onUpdate:items":t[24]||=e=>c.scanExclude=e},{help:M(()=>[...t[87]||=[V(`p`,{class:`text-xs text-muted-foreground`},`Skipped on top of always-excluded dirs (node_modules, build, …).`,-1)]]),_:1},8,[`items`])])):d.value===`quality`?(R(),z(`div`,SM,[V(`div`,null,[t[89]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Rules`,-1),V(`div`,CM,[(R(!0),z(L,null,F(j(Vk),e=>(R(),z(`div`,{key:e.id,class:`flex items-center justify-between gap-4 p-3.5`},[V(`div`,wM,[V(`div`,TM,[U(k(e.label)+` `,1),V(`code`,EM,k(e.id),1)]),V(`div`,DM,k(e.description),1)]),H(j(Iy),{"model-value":c.lintRules[e.id]??e.default,"onUpdate:modelValue":t=>c.lintRules={...c.lintRules,[e.id]:t}},{default:M(()=>[H(j(iS),{class:O([`w-32 shrink-0`,c.lintRules[e.id]===`off`?`text-muted-foreground`:``])},{default:M(()=>[H(j(rb))]),_:1},8,[`class`]),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`error`},{default:M(()=>[U(`Error`+k(e.default===`error`?` ·`:``),1)]),_:2},1024),H(j(sS),{value:`warn`},{default:M(()=>[U(`Warning`+k(e.default===`warn`?` ·`:``),1)]),_:2},1024),H(j(sS),{value:`off`},{default:M(()=>[...t[88]||=[U(`Off`,-1)]]),_:1})]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])]))),128))]),t[90]||=V(`p`,{class:`mt-2 text-xs text-muted-foreground`},`· marks the built-in default.`,-1)]),H(HA,{label:`Ignore keys`,items:c.lintIgnore,mono:``,placeholder:`legacy.*`,"onUpdate:items":t[25]||=e=>c.lintIgnore=e},{help:M(()=>[...t[91]||=[V(`p`,{class:`text-xs text-muted-foreground`},` Key globs excluded from every check — for legacy or generated keys you don't maintain. `,-1)]]),_:1},8,[`items`])])):d.value===`dictionary`?(R(),z(`div`,OM,[V(`div`,kM,[(R(!0),z(L,null,F(c.customWords,e=>(R(),z(`span`,{key:e,class:`inline-flex items-center gap-1.5 rounded-lg border bg-accent px-2.5 py-1.5 font-mono text-sm`},[U(k(e)+` `,1),V(`button`,{type:`button`,class:`flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${e}`,onClick:t=>Ke(e)},[H(j(kd),{class:`size-3`})],8,AM)]))),128)),c.customWords.length===0?(R(),z(`p`,jM,`No custom words yet.`)):W(``,!0)]),V(`div`,MM,[H(j(IS),{for:`add-word`},{default:M(()=>[...t[92]||=[U(`Add word`,-1)]]),_:1}),V(`div`,NM,[H(j(rS),{id:`add-word`,modelValue:We.value,"onUpdate:modelValue":t[26]||=e=>We.value=e,class:`font-mono`,placeholder:`Glotfile`,onKeydown:Xl(q(Ge,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:Ge},{default:M(()=>[H(j(od),{class:`size-4`}),t[93]||=U(` Add`,-1)]),_:1})])])])):d.value===`editor`?(R(),z(`div`,PM,[V(`div`,FM,[V(`div`,IM,[H(j(IS),{for:`editor-select`},{default:M(()=>[...t[94]||=[U(`Editor`,-1)]]),_:1}),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0 translate-y-0.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-300 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0`},{default:M(()=>[fe.value?(R(),z(`span`,LM,[H(j(Du),{class:`size-3`}),t[95]||=U(` Saved `,-1)])):W(``,!0)]),_:1})]),H(j(Iy),{"model-value":j(Dw),"onUpdate:modelValue":me},{default:M(()=>[H(j(iS),{id:`editor-select`},{default:M(()=>[H(j(rb),{placeholder:`Select editor`})]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(j(ww),e=>(R(),B(j(sS),{key:e.id,value:e.id},{default:M(()=>[U(k(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])]),V(`p`,RM,[H(j(ed),{class:`size-3.5`}),t[96]||=U(` Stored locally in `,-1),t[97]||=V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),t[98]||=U(` — clicking a usage opens the file via its URL scheme. `,-1)])])):W(``,!0)])]),se.includes(d.value)?W(``,!0):(R(),z(`div`,{key:0,class:O([`absolute bottom-5 left-1/2 flex min-w-[400px] max-w-[calc(100%-3.5rem)] -translate-x-1/2 items-center gap-3 rounded-[14px] border bg-card px-4 py-2.5 shadow-lg transition-[border-color,box-shadow]`,le.value>0?`border-primary/40 shadow-primary/10`:`border-border`])},[V(`span`,{class:O([`flex min-w-0 flex-1 items-center gap-2 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,le.value>0?`text-foreground`:`text-muted-foreground`])},[le.value>0?(R(),z(L,{key:0},[V(`span`,zM,k(le.value),1),U(` Unsaved `+k(le.value===1?`change`:`changes`)+` in `,1),V(`strong`,BM,k(ue.value.join(`, `)),1)],64)):(R(),z(L,{key:1},[H(j(Du),{class:`size-3.5 shrink-0`}),t[99]||=U(` All changes saved `,-1)],64))],2),V(`div`,VM,[H(j(Q),{variant:`ghost`,size:`sm`,disabled:le.value===0,onClick:t[27]||=e=>f.value=!f.value},{default:M(()=>[H(j(Ed),{class:`size-4`}),t[100]||=U(` Discard `,-1)]),_:1},8,[`disabled`]),f.value?(R(),z(`div`,HM,[t[103]||=V(`p`,{class:`text-[13px] font-semibold`},`Discard all changes?`,-1),V(`p`,UM,` Reverts every unsaved edit in `+k(ue.value.join(`, `))+`. `,1),V(`div`,WM,[H(j(Q),{size:`sm`,variant:`outline`,onClick:t[28]||=e=>f.value=!1},{default:M(()=>[...t[101]||=[U(`Keep editing`,-1)]]),_:1}),H(j(Q),{size:`sm`,variant:`destructive`,onClick:ye},{default:M(()=>[...t[102]||=[U(`Discard`,-1)]]),_:1})])])):W(``,!0)]),H(j(Q),{size:`sm`,disabled:le.value===0||u.value,onClick:ve},{default:M(()=>[H(j(ud),{class:`size-4`}),t[104]||=U(` Save changes `,-1)]),_:1},8,[`disabled`])],2))])])):(R(),z(`div`,UA,` Loading settings… `)),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-100 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:M(()=>[g.value?(R(),z(`div`,{key:0,class:`fixed inset-0 z-[70] flex items-center justify-center bg-background/70 p-6 backdrop-blur-sm`,onClick:q(Se,[`self`])},[V(`div`,GM,[V(`h3`,KM,[H(j(Td),{class:`size-4 text-amber-500`}),t[105]||=U(` Unsaved changes `,-1)]),V(`p`,qM,[U(` You have `+k(le.value)+` unsaved `+k(le.value===1?`change`:`changes`)+` in `,1),V(`strong`,JM,k(ue.value.join(`, `)),1),t[106]||=U(`. `,-1),V(`span`,YM,`Leaving now discards `+k(le.value===1?`it`:`them`)+`.`,1)]),V(`div`,XM,[H(j(Q),{size:`sm`,variant:`outline`,class:`mr-auto`,onClick:Se},{default:M(()=>[...t[107]||=[U(`Keep editing`,-1)]]),_:1}),H(j(Q),{size:`sm`,variant:`destructive`,onClick:Ce},{default:M(()=>[H(j(Ed),{class:`size-4`}),t[108]||=U(` Discard & leave `,-1)]),_:1}),H(j(Q),{size:`sm`,disabled:u.value,onClick:we},{default:M(()=>[H(j(ud),{class:`size-4`}),t[109]||=U(` Save & leave `,-1)]),_:1},8,[`disabled`])])])])):W(``,!0)]),_:1}),H(gc,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0 -translate-y-1.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0 -translate-y-1.5`},{default:M(()=>[_.value?(R(),z(`div`,ZM,[H(j(Du),{class:`size-3.5`}),t[110]||=U(` Settings saved `,-1)])):W(``,!0)]),_:1})],64))}}),$M={class:`min-h-0 flex-1 overflow-y-auto`},eN={key:0,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},tN={key:1,class:`flex h-full items-center justify-center p-8`},nN={class:`flex max-w-md flex-col items-center gap-3 text-center text-muted-foreground`},rN={key:2,class:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-3 p-6`},iN=[`onClick`],aN={class:`flex aspect-video items-center justify-center overflow-hidden border-b bg-muted/30`},oN=[`src`,`alt`],sN={class:`flex flex-col gap-0.5 p-2.5`},cN={class:`truncate font-mono text-xs font-medium`},lN={class:`truncate text-xs text-muted-foreground`},uN={key:1,class:`truncate text-xs text-muted-foreground`},dN={class:`flex max-h-[70vh] items-center justify-center overflow-auto rounded-md border bg-muted/30 p-2`},fN=[`src`,`alt`],pN={key:0,class:`text-sm text-muted-foreground`},mN=P({__name:`ScreenshotsView`,setup(e){let t=fn(null),n=A(!1),r=A(null);async function i(){t.value=await jd(),n.value=!0}i();let a=K(()=>t.value?.config.sourceLocale??``),o=K(()=>{let e=t.value;return e?Object.entries(e.keys).filter(([,e])=>!!e.screenshot).map(([e,t])=>({key:e,entry:t,screenshot:t.screenshot,source:t.values[a.value]?.value??``})).sort((e,t)=>e.key.localeCompare(t.key)):[]});return(e,t)=>(R(),z(`div`,$M,[n.value?o.value.length===0?(R(),z(`div`,tN,[V(`div`,nN,[H(j(Ju),{class:`size-8 opacity-60`}),t[2]||=V(`p`,{class:`text-sm`},` No screenshots yet — add one from a key's detail panel in the Editor. `,-1)])])):(R(),z(`div`,rN,[(R(!0),z(L,null,F(o.value,e=>(R(),z(`button`,{key:e.key,type:`button`,class:`group flex flex-col overflow-hidden rounded-lg border bg-card text-left shadow-sm transition-colors hover:border-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t=>r.value=e},[V(`div`,aN,[V(`img`,{src:`/`+e.screenshot,alt:`Screenshot for ${e.key}`,class:`h-full w-full object-contain`},null,8,oN)]),V(`div`,sN,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,cN,k(e.key),1)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.key),1)]),_:2},1024)]),_:2},1024),e.source?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,lN,k(e.source),1)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(k(e.source),1)]),_:2},1024)]),_:2},1024)):(R(),z(`span`,uN,`—`))])],8,iN))),128))])):(R(),z(`div`,eN,` Loading screenshots… `)),H(j(bh),{open:r.value!==null,"onUpdate:open":t[1]||=e=>{e||(r.value=null)}},{default:M(()=>[r.value?(R(),B(j(LS),{key:0,class:`max-w-3xl`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),{class:`break-all font-mono text-sm`},{default:M(()=>[U(k(r.value.key),1)]),_:1}),H(j(VS),null,{default:M(()=>[U(k(r.value.source||`—`),1)]),_:1})]),_:1}),V(`div`,dN,[V(`img`,{src:`/`+r.value.screenshot,alt:`Screenshot for ${r.value.key}`,class:`max-h-[65vh] w-auto object-contain`},null,8,fN)]),r.value.entry.context?(R(),z(`p`,pN,[t[3]||=V(`span`,{class:`font-medium text-foreground`},`Context:`,-1),U(` `+k(r.value.entry.context),1)])):W(``,!0),H(j(zS),null,{default:M(()=>[H(j(Q),{size:`sm`,onClick:t[0]||=e=>j(Op)(r.value.key)},{default:M(()=>[H(j(yd),{class:`size-4`}),t[4]||=U(` Open in editor `,-1)]),_:1})]),_:1})]),_:1})):W(``,!0)]),_:1},8,[`open`])]))}}),hN={class:`min-h-0 flex-1 overflow-y-auto p-4`},gN={key:0,class:`mt-8 text-center text-sm text-muted-foreground`},_N={key:1,class:`mx-auto flex max-w-4xl flex-col gap-4`},vN={key:0,class:`flex flex-wrap gap-1.5`},yN=[`onClick`],bN={class:`flex flex-wrap items-center gap-3 border-b px-4 py-2.5`},xN={class:`text-sm font-medium`},SN={class:`text-sm text-muted-foreground`},CN={class:`border-b`},wN={class:`overflow-x-auto whitespace-pre-wrap break-words bg-muted/40 px-4 py-3 font-mono text-xs leading-relaxed`},TN={class:`divide-y`},EN={class:`flex items-center gap-2`},DN={class:`truncate font-mono text-xs text-muted-foreground`},ON={class:`flex items-start gap-2 text-sm`},kN={class:`min-w-0 flex-1 break-words`},AN={class:`min-w-0 flex-1 break-words`},jN={key:0,class:`text-destructive`},MN={key:1},NN={key:0,class:`text-xs text-muted-foreground`},PN={key:1,class:`flex flex-wrap gap-1`},FN={key:2,class:`flex items-center gap-1.5 text-xs text-muted-foreground`},IN={class:`truncate font-mono`},LN={key:1,class:`flex flex-col gap-1.5 px-4 py-3`},RN={key:0,class:`flex items-center gap-2`},zN={class:`truncate font-mono text-xs text-muted-foreground`},BN={key:1,class:`flex items-start gap-2 text-sm`},VN=P({__name:`ActivityView`,setup(e){let t=A([]),n=A(!0),r=A(`all`);Ki(async()=>{try{t.value=await vf()}catch(e){$.error(e.message)}finally{n.value=!1}});let i=e=>e.kind===`translate`||e.kind===`context`,a=K(()=>[...new Set(t.value.map(e=>e.kind))]),o=K(()=>r.value===`all`?t.value:t.value.filter(e=>e.kind===r.value)),s=e=>eS(`rounded-full border px-2.5 py-0.5 text-xs transition-colors`,r.value===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted`);function c(e,t){return e.results?.find(e=>e.id===t)}function l(e){return e.doNotTranslate?`${e.term} (do-not-translate)`:e.forced?`${e.term} → ${e.forced}`:e.term}function u(e){return e==null||e===``?`∅`:typeof e==`string`?e:JSON.stringify(e)}let d=e=>typeof e==`object`&&!!e;return(e,f)=>(R(),z(`div`,hN,[!n.value&&t.value.length===0?(R(),z(`p`,gN,` No activity yet — edits, translations, and config changes will show up here. `)):(R(),z(`div`,_N,[a.value.length>1?(R(),z(`div`,vN,[V(`button`,{type:`button`,class:O(s(`all`)),onClick:f[0]||=e=>r.value=`all`},`All`,2),(R(!0),z(L,null,F(a.value,e=>(R(),z(`button`,{key:e,type:`button`,class:O(s(e)),onClick:t=>r.value=e},k(e),11,yN))),128))])):W(``,!0),(R(!0),z(L,null,F(o.value,(e,t)=>(R(),z(`article`,{key:`${e.at}-${t}`,class:`rounded-lg border bg-card`},[V(`header`,bN,[V(`span`,xN,k(new Date(e.at).toLocaleString()),1),H(j(dS),{variant:`outline`,class:`font-mono uppercase`},{default:M(()=>[U(k(e.kind),1)]),_:2},1024),V(`span`,SN,k(e.summary),1),e.model?(R(),B(j(dS),{key:0,variant:`secondary`,class:`ml-auto font-mono`},{default:M(()=>[U(k(e.model),1)]),_:2},1024)):W(``,!0)]),i(e)?(R(),z(L,{key:0},[V(`details`,CN,[f[1]||=V(`summary`,{class:`cursor-pointer select-none px-4 py-2 text-xs font-medium text-muted-foreground hover:text-foreground`},` System prompt `,-1),V(`pre`,wN,k(e.system),1)]),V(`ul`,TN,[(R(!0),z(L,null,F(e.items,t=>(R(),z(`li`,{key:t.id,class:`flex flex-col gap-1.5 px-4 py-3`},[V(`div`,EN,[V(`span`,DN,k(t.key),1),t.targetLocale?(R(),B(j(dS),{key:0,variant:`outline`,class:`shrink-0 font-mono uppercase`},{default:M(()=>[U(k(t.targetLocale),1)]),_:2},1024)):W(``,!0)]),V(`div`,ON,[V(`span`,kN,k(t.source),1),H(j(bu),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),V(`span`,AN,[c(e,t.id)?.error?(R(),z(`span`,jN,k(c(e,t.id)?.error),1)):(R(),z(`span`,MN,k(c(e,t.id)?.translation??c(e,t.id)?.value),1))])]),t.context?(R(),z(`p`,NN,k(t.context),1)):W(``,!0),t.glossary?.length?(R(),z(`div`,PN,[(R(!0),z(L,null,F(t.glossary,e=>(R(),z(`span`,{key:e.term,class:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`},k(l(e)),1))),128))])):W(``,!0),t.screenshot?(R(),z(`div`,FN,[H(j(Yu),{class:`size-3.5 shrink-0`}),V(`span`,IN,k(t.screenshot),1)])):W(``,!0)]))),128))])],64)):e.key||e.before!==void 0||e.after!==void 0?(R(),z(`div`,LN,[e.key?(R(),z(`div`,RN,[V(`span`,zN,k(e.key),1),e.locale?(R(),B(j(dS),{key:0,variant:`outline`,class:`shrink-0 font-mono uppercase`},{default:M(()=>[U(k(e.locale),1)]),_:2},1024)):W(``,!0)])):W(``,!0),e.before!==void 0||e.after!==void 0?(R(),z(`div`,BN,[e.before===void 0?W(``,!0):(R(),z(`span`,{key:0,class:O(j(eS)(`min-w-0 flex-1 break-words text-muted-foreground`,d(e.before)&&`font-mono text-xs`))},k(u(e.before)),3)),e.before!==void 0&&e.after!==void 0?(R(),B(j(bu),{key:1,class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})):W(``,!0),e.after===void 0?W(``,!0):(R(),z(`span`,{key:2,class:O(j(eS)(`min-w-0 flex-1 break-words`,d(e.after)&&`font-mono text-xs`))},k(u(e.after)),3))])):W(``,!0)])):W(``,!0)]))),128))]))]))}}),HN=[{id:`home`,title:`Home`,section:``,html:`<h1>Glotfile</h1>
|
|
7
|
+
`))}return()=>i.value||r.value||o.value?qs(t.default({present:o.value})[0],{ref:e=>{let t=lm(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),mh=P({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=vm(n.default()),r=e.findIndex(e=>e.type!==ns);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?G(t,i.props):t,o=_s({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),hh=[`area`,`img`,`input`],gh=P({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&hh.includes(r)?()=>qs(r,t):r===`template`?()=>qs(mh,t,{default:n.default}):()=>qs(e.as,t,{default:n.default})}});function _h(){let e=A();return{primitiveElement:e,currentElement:K(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:lm(e))}}var[vh,yh]=Rp(`DialogRoot`),bh=P({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=_m(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=A(),a=A(),{modal:o}=xn(n);return yh({open:r,modal:o,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>I(e.$slots,`default`,{open:j(r),close:()=>r.value=!1})}}),xh=P({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Rm();let n=vh();return(e,r)=>(R(),B(j(gh),G(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>j(n).onOpenChange(!1)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`type`]))}}),Sh=`dismissableLayer.pointerDownOutside`,Ch=`dismissableLayer.focusOutside`;function wh(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function Th(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=A(!1),a=A(()=>{});return Tr(o=>{if(!Kp||!gn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(wh(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Bp(Sh,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{gn(n)&&(i.value=!0)}}}function Eh(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=A(!1);return Tr(a=>{if(!Kp||!gn(n))return;let o=async n=>{if(!t?.value)return;await er(),await er();let r=n.target;!t.value||!r||wh(t.value,r)||n.target&&!i.value&&Bp(Ch,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{gn(n)&&(i.value=!0)},onBlurCapture:()=>{gn(n)&&(i.value=!1)}}}var Dh=Zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set}),Oh=P({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Rm(),o=K(()=>a.value?.ownerDocument??globalThis.document),s=K(()=>Dh.layersRoot),c=K(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=K(()=>Dh.layersWithOutsidePointerEventsDisabled.size>0),u=K(()=>{let e=Array.from(s.value),[t]=[...Dh.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Th(async e=>{let t=[...Dh.branches].some(t=>t?.contains(e.target));!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await er(),e.defaultPrevented||r(`dismiss`))},a),f=Eh(e=>{[...Dh.branches].some(t=>t?.contains(e.target))||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return mm(`Escape`,e=>{c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Tr(e=>{a.value&&(n.disableOutsidePointerEvents&&(Dh.layersWithOutsidePointerEventsDisabled.size===0&&(Dh.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),Dh.layersWithOutsidePointerEventsDisabled.add(a.value)),s.value.add(a.value),e(()=>{n.disableOutsidePointerEvents&&Dh.layersWithOutsidePointerEventsDisabled.size===1&&!Vp(Dh.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=Dh.originalBodyPointerEvents)}))}),Tr(e=>{e(()=>{a.value&&(s.value.delete(a.value),Dh.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(R(),B(j(gh),{ref:j(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:ge({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:j(f).onFocusCapture,onBlurCapture:j(f).onBlurCapture,onPointerdownCapture:j(d).onPointerDownCapture},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),kh=Gp(()=>A([]));function Ah(){let e=kh();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=jh(e.value,t),e.value.unshift(t)},remove(t){e.value=jh(e.value,t),e.value[0]?.resume()}}}function jh(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var Mh=`focusScope.autoFocusOnMount`,Nh=`focusScope.autoFocusOnUnmount`,Ph={bubbles:!1,cancelable:!0};function Fh(e,{select:t=!1}={}){let n=zp();for(let r of e)if(Vh(r,{select:t}),zp()!==n)return!0}function Ih(e){let t=Lh(e);return[Rh(t,e),Rh(t.reverse(),e)]}function Lh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Rh(e,t){for(let n of e)if(!zh(n,{upTo:t}))return n}function zh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Bh(e){return e instanceof HTMLInputElement&&`select`in e}function Vh(e,{select:t=!1}={}){if(e&&e.focus){let n=zp();e.focus({preventScroll:!0}),e!==n&&Bh(e)&&t&&e.select()}}var Hh=P({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=Rm(),o=A(null),s=Ah(),c=Zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Tr(e=>{if(!Kp)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Vh(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Vh(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||Vh(t))}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})}),Tr(async e=>{let t=a.value;if(await er(),!t)return;s.add(c);let n=zp();if(!t.contains(n)){let e=new CustomEvent(Mh,Ph);t.addEventListener(Mh,e=>r(`mountAutoFocus`,e)),t.dispatchEvent(e),e.defaultPrevented||(Fh(Lh(t),{select:!0}),zp()===n&&Vh(t))}e(()=>{t.removeEventListener(Mh,e=>r(`mountAutoFocus`,e));let e=new CustomEvent(Nh,Ph),i=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Nh,i),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Vh(n??document.body,{select:!0}),t.removeEventListener(Nh,i),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})});function l(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=zp();if(t&&r){let t=e.currentTarget,[i,a]=Ih(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Vh(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Vh(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(R(),B(j(gh),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:l},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Uh=`menu.itemSelect`,Wh=[`Enter`,` `],Gh=[`ArrowDown`,`PageUp`,`Home`],Kh=[`ArrowUp`,`PageDown`,`End`],qh=[...Gh,...Kh];[...Wh],[...Wh];function Jh(e){return e?`open`:`closed`}function Yh(e){let t=zp();for(let n of e)if(n===t||(n.focus(),zp()!==t))return}function Xh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Zh(e,t){return t?Xh({x:e.clientX,y:e.clientY},t):!1}function Qh(e){return e.pointerType===`mouse`}var $h=P({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),{forwardRef:a,currentElement:o}=Rm();return i.titleId||=ah(void 0,`reka-dialog-title`),i.descriptionId||=ah(void 0,`reka-dialog-description`),Ki(()=>{i.contentElement=o,zp()!==document.body&&(i.triggerElement.value=zp())}),(e,t)=>(R(),B(j(Hh),{"as-child":``,loop:``,trapped:n.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),G({id:j(i).contentId,ref:j(a),as:e.as,"as-child":e.asChild,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":j(i).descriptionId,"aria-labelledby":j(i).titleId,"data-state":j(Jh)(j(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>j(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`]))}}),eg=P({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),a=Nm(r),{forwardRef:o,currentElement:s}=Rm();return rh(s),(e,t)=>(R(),B($h,G({...n,...j(a)},{ref:j(o),"trap-focus":j(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),j(i).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),tg=P({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Nm(t);Rm();let i=vh(),a=A(!1),o=A(!1);return(e,t)=>(R(),B($h,G({...n,...j(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||j(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;j(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ng=P({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=vh(),a=Nm(r),{forwardRef:o}=Rm();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[j(i).modal.value?(R(),B(eg,G({key:0,ref:j(o)},{...n,...j(a),...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(tg,G({key:1,ref:j(o)},{...n,...j(a),...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),rg=P({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;Rm();let n=vh();return(e,r)=>(R(),B(j(gh),G(t,{id:j(n).descriptionId}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),ig=P({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=vh();return km(!0),Rm(),(e,n)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,"data-state":j(t).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:n[0]||=q(()=>{},[`left`,`self`,`prevent`])},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),ag=P({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=vh(),{forwardRef:n}=Rm();return(e,r)=>j(t)?.modal.value?(R(),B(j(ph),{key:0,present:e.forceMount||j(t).open.value},{default:M(()=>[H(ig,G(e.$attrs,{ref:j(n),as:e.as,"as-child":e.asChild}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as`,`as-child`])]),_:3},8,[`present`])):W(`v-if`,!0)}}),og=P({__name:`Teleport`,props:{to:{type:null,required:!1,default:`body`},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=dm();return(e,n)=>j(t)||e.forceMount?(R(),B(Hr,{key:0,to:e.to,disabled:e.disabled,defer:e.defer},[I(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):W(`v-if`,!0)}}),sg=P({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),cg=P({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=vh();return Rm(),(e,r)=>(R(),B(j(gh),G(t,{id:j(n).titleId}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),lg=`data-reka-collection-item`;function ug(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:A(),itemMap:A(new Map)},br(r,i)):i=xr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${lg}]`)),r=Array.from(i.itemMap.value.values()).sort((e,t)=>n.indexOf(e.ref)-n.indexOf(t.ref));return e?r:r.filter(e=>e.ref.dataset.disabled!==``)},o=P({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=_h();return N(a,()=>{i.collectionRef.value=a.value}),()=>qs(mh,{ref:r,...n},t)}}),s=P({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=_h();return Tr(t=>{if(a.value){let n=cn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>qs(mh,{...n,[lg]:``,ref:r},t)}});return{getItems:a,reactiveItems:K(()=>Array.from(i.itemMap.value.values())),itemMapSize:K(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var dg=P({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),fg=P({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=_h();return N(K(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(R(),B(dg,G({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),pg=P({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=K(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=K(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(R(),z(L,null,[W(` We render single input if it's required `),n.value?(R(),B(fg,G({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(R(!0),z(L,{key:1},F(r.value,n=>(R(),B(fg,G({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),mg=`rovingFocusGroup.onEntryFocus`,hg={bubbles:!1,cancelable:!0},gg={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function _g(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function vg(e,t,n){let r=_g(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return gg[r]}function yg(e,t=!1){let n=zp();for(let r of e)if(r===n||(r.focus({preventScroll:t}),zp()!==n))return}function bg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[xg,Sg]=Rp(`PopperRoot`),Cg=P({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=A();return Sg({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>I(e.$slots,`default`)}}),wg=P({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Rm(),i=xg();return Er(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(R(),B(j(gh),{ref:j(n),as:e.as,"as-child":e.asChild},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function Tg(e){return e!==null}function Eg(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Dg(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}}function Dg(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Og=[`top`,`right`,`bottom`,`left`],kg=Math.min,Ag=Math.max,jg=Math.round,Mg=Math.floor,Ng=e=>({x:e,y:e}),Pg={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fg(e,t,n){return Ag(e,kg(t,n))}function Ig(e,t){return typeof e==`function`?e(t):e}function Lg(e){return e.split(`-`)[0]}function Rg(e){return e.split(`-`)[1]}function zg(e){return e===`x`?`y`:`x`}function Bg(e){return e===`y`?`height`:`width`}function Vg(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Hg(e){return zg(Vg(e))}function Ug(e,t,n){n===void 0&&(n=!1);let r=Rg(e),i=Hg(e),a=Bg(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Qg(o)),[o,Qg(o)]}function Wg(e){let t=Qg(e);return[Gg(e),t,Gg(t)]}function Gg(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Kg=[`left`,`right`],qg=[`right`,`left`],Jg=[`top`,`bottom`],Yg=[`bottom`,`top`];function Xg(e,t,n){switch(e){case`top`:case`bottom`:return n?t?qg:Kg:t?Kg:qg;case`left`:case`right`:return t?Jg:Yg;default:return[]}}function Zg(e,t,n,r){let i=Rg(e),a=Xg(Lg(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Gg)))),a}function Qg(e){let t=Lg(e);return Pg[t]+e.slice(t.length)}function $g(e){return{top:0,right:0,bottom:0,left:0,...e}}function e_(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$g(e)}function t_(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function n_(e,t,n){let{reference:r,floating:i}=e,a=Vg(t),o=Hg(t),s=Bg(o),c=Lg(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Rg(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function r_(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ig(t,e),p=e_(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=t_(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=t_(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var i_=50,a_=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:r_},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=n_(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<i_&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=n_(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},o_=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ig(e,t)||{};if(l==null)return{};let d=e_(u),f={x:n,y:r},p=Hg(i),m=Bg(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=kg(d[_],T),E=kg(d[v],T),te=ee,ne=C-h[m]-E,re=C/2-h[m]/2+w,ie=Fg(te,re,ne),ae=!c.arrow&&Rg(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?ee:E)-h[m]/2<0,oe=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+oe,data:{[p]:ie,centerOffset:re-ie-oe,...ae&&{alignmentOffset:oe}},reset:ae}}}),s_=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ig(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Lg(r),_=Vg(o),v=Lg(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Qg(o)]:Wg(o)),x=p!==`none`;!d&&x&&b.push(...Zg(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ug(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Vg(t))||T.every(e=>Vg(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Vg(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function c_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function l_(e){return Og.some(t=>e[t]>=0)}var u_=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ig(e,t);switch(i){case`referenceHidden`:{let e=c_(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:l_(e)}}}case`escaped`:{let e=c_(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:l_(e)}}}default:return{}}}}},d_=new Set([`left`,`top`]);async function f_(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lg(n),s=Rg(n),c=Vg(n)===`y`,l=d_.has(o)?-1:1,u=a&&c?-1:1,d=Ig(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var p_=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await f_(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},m_=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ig(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Vg(Lg(i)),p=zg(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Fg(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Fg(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},h_=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ig(e,t),u={x:n,y:r},d=Vg(i),f=zg(d),p=u[f],m=u[d],h=Ig(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=d_.has(Lg(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},g_=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ig(e,t),u=await o.detectOverflow(t,l),d=Lg(i),f=Rg(i),p=Vg(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kg(h-u[g],v),x=kg(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ag(u.left,0),t=Ag(u.right,0),n=Ag(u.top,0),r=Ag(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ag(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ag(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function __(){return typeof window<`u`}function v_(e){return x_(e)?(e.nodeName||``).toLowerCase():`#document`}function y_(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function b_(e){return((x_(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function x_(e){return __()?e instanceof Node||e instanceof y_(e).Node:!1}function S_(e){return __()?e instanceof Element||e instanceof y_(e).Element:!1}function C_(e){return __()?e instanceof HTMLElement||e instanceof y_(e).HTMLElement:!1}function w_(e){return!__()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof y_(e).ShadowRoot}function T_(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function E_(e){return/^(table|td|th)$/.test(v_(e))}function D_(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var O_=/transform|translate|scale|rotate|perspective|filter/,k_=/paint|layout|strict|content/,A_=e=>!!e&&e!==`none`,j_;function M_(e){let t=S_(e)?I_(e):e;return A_(t.transform)||A_(t.translate)||A_(t.scale)||A_(t.rotate)||A_(t.perspective)||!P_()&&(A_(t.backdropFilter)||A_(t.filter))||O_.test(t.willChange||``)||k_.test(t.contain||``)}function N_(e){let t=R_(e);for(;C_(t)&&!F_(t);){if(M_(t))return t;if(D_(t))return null;t=R_(t)}return null}function P_(){return j_??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),j_}function F_(e){return/^(html|body|#document)$/.test(v_(e))}function I_(e){return y_(e).getComputedStyle(e)}function L_(e){return S_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R_(e){if(v_(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||w_(e)&&e.host||b_(e);return w_(t)?t.host:t}function z_(e){let t=R_(e);return F_(t)?e.ownerDocument?e.ownerDocument.body:e.body:C_(t)&&T_(t)?t:z_(t)}function B_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=z_(e),i=r===e.ownerDocument?.body,a=y_(r);if(i){let e=V_(a);return t.concat(a,a.visualViewport||[],T_(r)?r:[],e&&n?B_(e):[])}else return t.concat(r,B_(r,[],n))}function V_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H_(e){let t=I_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=C_(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jg(n)!==a||jg(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function U_(e){return S_(e)?e:e.contextElement}function W_(e){let t=U_(e);if(!C_(t))return Ng(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=H_(t),o=(a?jg(n.width):n.width)/r,s=(a?jg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var G_=Ng(0);function K_(e){let t=y_(e);return!P_()||!t.visualViewport?G_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function q_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==y_(e)?!1:t}function J_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=U_(e),o=Ng(1);t&&(r?S_(r)&&(o=W_(r)):o=W_(e));let s=q_(a,n,r)?K_(a):Ng(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=y_(a),t=r&&S_(r)?y_(r):r,n=e,i=V_(n);for(;i&&r&&t!==n;){let e=W_(i),t=i.getBoundingClientRect(),r=I_(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=y_(i),i=V_(n)}}return t_({width:u,height:d,x:c,y:l})}function Y_(e,t){let n=L_(e).scrollLeft;return t?t.left+n:J_(b_(e)).left+n}function X_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Y_(e,n),y:n.top+t.scrollTop}}function Z_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=b_(r),s=t?D_(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ng(1),u=Ng(0),d=C_(r);if((d||!d&&!a)&&((v_(r)!==`body`||T_(o))&&(c=L_(r)),d)){let e=J_(r);l=W_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?X_(o,c):Ng(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Q_(e){return Array.from(e.getClientRects())}function $_(e){let t=b_(e),n=L_(e),r=e.ownerDocument.body,i=Ag(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ag(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Y_(e),s=-n.scrollTop;return I_(r).direction===`rtl`&&(o+=Ag(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ev=25;function tv(e,t){let n=y_(e),r=b_(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P_();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Y_(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ev&&(a-=o)}else l<=ev&&(a+=l);return{width:a,height:o,x:s,y:c}}function nv(e,t){let n=J_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=C_(e)?W_(e):Ng(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rv(e,t,n){let r;if(t===`viewport`)r=tv(e,n);else if(t===`document`)r=$_(b_(e));else if(S_(t))r=nv(t,n);else{let n=K_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return t_(r)}function iv(e,t){let n=R_(e);return n===t||!S_(n)||F_(n)?!1:I_(n).position===`fixed`||iv(n,t)}function av(e,t){let n=t.get(e);if(n)return n;let r=B_(e,[],!1).filter(e=>S_(e)&&v_(e)!==`body`),i=null,a=I_(e).position===`fixed`,o=a?R_(e):e;for(;S_(o)&&!F_(o);){let t=I_(o),n=M_(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||T_(o)&&!n&&iv(e,o))?r=r.filter(e=>e!==o):i=t,o=R_(o)}return t.set(e,r),r}function ov(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?D_(t)?[]:av(t,this._c):[].concat(n),r],o=rv(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=rv(t,a[e],i);s=Ag(n.top,s),c=kg(n.right,c),l=kg(n.bottom,l),u=Ag(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function sv(e){let{width:t,height:n}=H_(e);return{width:t,height:n}}function cv(e,t,n){let r=C_(t),i=b_(t),a=n===`fixed`,o=J_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ng(0);function l(){c.x=Y_(i)}if(r||!r&&!a)if((v_(t)!==`body`||T_(i))&&(s=L_(t)),r){let e=J_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?X_(i,s):Ng(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function lv(e){return I_(e).position===`static`}function uv(e,t){if(!C_(e)||I_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return b_(e)===n&&(n=n.ownerDocument.body),n}function dv(e,t){let n=y_(e);if(D_(e))return n;if(!C_(e)){let t=R_(e);for(;t&&!F_(t);){if(S_(t)&&!lv(t))return t;t=R_(t)}return n}let r=uv(e,t);for(;r&&E_(r)&&lv(r);)r=uv(r,t);return r&&F_(r)&&lv(r)&&!M_(r)?n:r||N_(e)||n}var fv=async function(e){let t=this.getOffsetParent||dv,n=this.getDimensions,r=await n(e.floating);return{reference:cv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pv(e){return I_(e).direction===`rtl`}var mv={convertOffsetParentRelativeRectToViewportRelativeRect:Z_,getDocumentElement:b_,getClippingRect:ov,getOffsetParent:dv,getElementRects:fv,getClientRects:Q_,getDimensions:sv,getScale:W_,isElement:S_,isRTL:pv};function hv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gv(e,t){let n=null,r,i=b_(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mg(d),h=Mg(i.clientWidth-(u+f)),g=Mg(i.clientHeight-(d+p)),_=Mg(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ag(0,kg(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!hv(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function _v(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=U_(e),u=i||a?[...l?B_(l):[],...t?B_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?gv(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?J_(e):null;c&&g();function g(){let t=J_(e);h&&!hv(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var vv=p_,yv=m_,bv=s_,xv=g_,Sv=u_,Cv=o_,wv=h_,Tv=(e,t,n)=>{let r=new Map,i={platform:mv,...n},a={...i.platform,_c:r};return a_(e,t,{...i,platform:a})};function Ev(e){return typeof e==`object`&&!!e&&`$el`in e}function Dv(e){if(Ev(e)){let t=e.$el;return x_(t)&&v_(t)===`#comment`?null:t}return e}function Ov(e){return typeof e==`function`?e():j(e)}function kv(e){return{name:`arrow`,options:e,fn(t){let n=Dv(Ov(e.element));return n==null?{}:Cv({element:n,padding:e.padding}).fn(t)}}}function Av(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jv(e,t){let n=Av(e);return Math.round(t*n)/n}function Mv(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=K(()=>Ov(n.open)??!0),a=K(()=>Ov(n.middleware)),o=K(()=>Ov(n.placement)??`bottom`),s=K(()=>Ov(n.strategy)??`absolute`),c=K(()=>Ov(n.transform)??!0),l=K(()=>Dv(e.value)),u=K(()=>Dv(t.value)),d=A(0),f=A(0),p=A(s.value),m=A(o.value),h=fn({}),g=A(!1),_=K(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=jv(u.value,d.value),n=jv(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Av(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;Tv(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return N([a,o,s,i],y,{flush:`sync`}),N([l,u],x,{flush:`sync`}),N(i,S,{flush:`sync`}),Fe()&&Ie(b),{x:en(d),y:en(f),strategy:en(p),placement:en(m),middlewareData:en(h),isPositioned:en(g),floatingStyles:_,update:y}}var Nv={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[Pv,Fv]=Rp(`PopperContent`),Iv=P({inheritAttrs:!1,__name:`PopperContent`,props:Oa({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Nv}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=xg(),{forwardRef:a,currentElement:o}=Rm(),s=A(),c=A(),{width:l,height:u}=oh(c),d=K(()=>n.side+(n.align===`center`?``:`-${n.align}`)),f=K(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),p=K(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),m=K(()=>({padding:f.value,boundary:p.value.filter(Tg),altBoundary:p.value.length>0})),h=K(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=Hp(()=>[vv({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bv({...m.value,...h.value}),n.avoidCollisions&&yv({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?wv():void 0,...m.value}),!n.prioritizePosition&&n.avoidCollisions&&bv({...m.value,...h.value}),xv({...m.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),c.value&&kv({element:c.value,padding:n.arrowPadding}),Eg({arrowWidth:l.value,arrowHeight:u.value}),n.hideWhenDetached&&Sv({strategy:`referenceHidden`,...m.value})]),{floatingStyles:_,placement:v,isPositioned:y,middlewareData:b,update:x}=Mv(K(()=>n.reference??i.anchor.value),s,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...e)=>_v(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:g}),S=K(()=>Dg(v.value)[0]),C=K(()=>Dg(v.value)[1]);Er(()=>{y.value&&r(`placed`)});let w=K(()=>{let e=b.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),T=A(``);return Tr(()=>{o.value&&(T.value=window.getComputedStyle(o.value).zIndex)}),Fv({placedSide:S,onArrowChange:e=>c.value=e,arrowX:K(()=>b.value.arrow?.x??0),arrowY:K(()=>b.value.arrow?.y??0),shouldHideArrow:w}),(e,t)=>(R(),z(`div`,{ref_key:`floatingRef`,ref:s,"data-reka-popper-content-wrapper":``,style:ge({...j(_),transform:j(y)?j(_).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:T.value,"--reka-popper-transform-origin":[j(b).transformOrigin?.x,j(b).transformOrigin?.y].join(` `),...j(b).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[H(j(gh),G({ref:j(a)},e.$attrs,{"as-child":n.asChild,as:e.as,"data-side":S.value,"data-align":C.value,style:{animation:j(y)?void 0:`none`}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])],4))}});function Lv(e){let t=Sm({nonce:A()});return K(()=>e?.value||t.nonce?.value)}var[Rv,zv]=Rp(`RovingFocusGroup`),Bv=P({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:s}=xn(r),c=Mm(s),l=_m(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=A(!1),d=A(!1),f=A(0),{getItems:p,CollectionSlot:m}=ug({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(mg,hg);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);yg([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===l.value),...e].filter(Boolean),r.preventScrollOnEntryFocus)}}d.value=!1}function g(){setTimeout(()=>{d.value=!1},1)}return t({getItems:p}),zv({loop:a,dir:c,orientation:o,currentTabStopId:l,onItemFocus:e=>{l.value=e},onItemShiftTab:()=>{u.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(e,t)=>(R(),B(j(m),null,{default:M(()=>[H(j(gh),{tabindex:u.value||f.value===0?-1:0,"data-orientation":j(o),as:e.as,"as-child":e.asChild,dir:j(c),style:{outline:`none`},onMousedown:t[0]||=e=>d.value=!0,onMouseup:g,onFocus:h,onBlur:t[1]||=e=>u.value=!1},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),Vv=P({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Rv(),r=ah(),i=K(()=>t.tabStopId||r),a=K(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=ug();Ki(()=>{t.focusable&&n.onFocusableItemAdd()}),Xi(()=>{t.focusable&&n.onFocusableItemRemove()});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=vg(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?bg(i,t+1):i.slice(t+1)}er(()=>yg(i))}}return(e,t)=>(R(),B(j(s),null,{default:M(()=>[H(j(gh),{tabindex:a.value?0:-1,"data-orientation":j(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?j(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>j(n).onItemFocus(i.value),onKeydown:c},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),Hv=P({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(wg),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}});function Uv(){let e=A(!1);return Ki(()=>{um(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),um([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var Wv=em(Uv),[Gv,Kv]=Rp([`MenuRoot`,`MenuSub`],`MenuContext`),[qv,Jv]=Rp(`MenuRoot`),Yv=P({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=xn(n),o=Mm(a),s=_m(n,`open`,r),c=A(),l=Wv();return Kv({open:s,onOpenChange:e=>{s.value=e},content:c,onContentChange:e=>{c.value=e}}),Jv({onClose:()=>{s.value=!1},isUsingKeyboardRef:l,dir:o,modal:i}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`)]),_:3}))}}),[Xv,Zv]=Rp(`MenuContent`),Qv=P({__name:`MenuContentImpl`,props:Oa({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Nv}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Gv(),a=qv(),{trapFocus:o,disableOutsidePointerEvents:s,loop:c}=xn(n);Fm(),km(s.value);let l=A(``),u=A(0),d=A(0),f=A(null),p=A(`right`),m=A(0),h=A(null),g=A(),{forwardRef:_,currentElement:v}=Rm(),{handleTypeaheadSearch:y}=ch(),b=A();function x(e){let t=bm(e,b.value||zp(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(b.value=t,t.scrollIntoView({block:`nearest`}))}function S(){b.value&&b.value.click()}let C=A(),w=A();N(b,e=>{w.value&&(e===void 0||e!==w.value.trigger.value)&&(w.value.onOpenChange(!1),w.value=void 0)}),N(v,e=>{i.onContentChange(e)}),Xi(()=>{window.clearTimeout(u.value)});function T(e){return p.value===f.value?.side&&Zh(e,f.value?.area)}async function ee(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),v.value?.focus({preventScroll:!0}))}function E(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,s=bm(e,zp(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(s)return s?.focus();if(e.code===`Space`)return;let l=g.value?.getItems()??[];if(n&&(e.key===`Tab`&&e.preventDefault(),!i&&o&&!r&&y(e.key,l)),e.target!==v.value||!qh.includes(e.key))return;e.preventDefault();let u=[...l.map(e=>e.ref)];Kh.includes(e.key)&&u.reverse(),Yh(u)}function te(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(u.value),l.value=``)}function ne(e){if(!Qh(e))return;let t=e.target,n=m.value!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(p.value=e.clientX>m.value?`right`:`left`,m.value=e.clientX)}function re(e){Qh(e)&&C.value&&C.value.focus()}return Zv({onItemEnter:e=>!!T(e),onItemLeave:e=>T(e)?!0:([`INPUT`,`TEXTAREA`].includes(zp()?.tagName||``)||v.value?.focus(),h.value=null,!1),onTriggerLeave:e=>!!T(e),searchRef:l,highlightedElement:b,onKeydownNavigation:x,onKeydownEnter:S,filterElement:C,onFilterElementChange:e=>{C.value=e},activeSubmenuContext:w,pointerGraceTimerRef:d,onPointerGraceIntentChange:e=>{f.value=e}}),(e,t)=>(R(),B(j(Hh),{"as-child":``,trapped:j(o),onMountAutoFocus:ee,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":j(s),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:M(()=>[H(j(Bv),{ref_key:`rovingFocusGroupRef`,ref:g,"current-tab-stop-id":h.value,"onUpdate:currentTabStopId":t[0]||=e=>h.value=e,"as-child":``,orientation:`vertical`,dir:j(a).dir.value,loop:j(c),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),j(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:M(()=>[H(j(Iv),{ref:j(_),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":j(Jh)(j(i).open.value),dir:j(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:E,onBlur:te,onPointermove:ne,onPointerenter:re},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),$v=P({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Xv(),{forwardRef:r,currentElement:i}=Rm(),{CollectionItem:a}=ug(),o=A(!1),s=K(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function c(e){if(!(e.defaultPrevented||!Qh(e))){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(zp()?.tagName||``)||t.focus({preventScroll:!0})}}}async function l(e){await er(),!e.defaultPrevented&&Qh(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(R(),B(j(a),{value:{textValue:e.textValue}},{default:M(()=>[H(j(gh),G({ref:j(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:c,onPointerleave:l,onFocus:t[0]||=async t=>{await er(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,j(n).highlightedElement.value=t.currentTarget)},onBlur:t[1]||=async e=>{await er(),!e.defaultPrevented&&(o.value=!1)}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),ey=P({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Rm(),o=qv(),s=Xv(),c=A(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Uh,{bubbles:!0,cancelable:!0});r(`select`,e),await er(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(R(),B($v,G(n,{ref:j(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await er(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=j(s).searchRef.value!==``;e.disabled||n&&t.key===` `||j(Wh).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ty=P({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Bm(n,r),a=Gv(),{forwardRef:o,currentElement:s}=Rm();return rh(s),(e,t)=>(R(),B(Qv,G(j(i),{ref:j(o),"trap-focus":j(a).open.value,"disable-outside-pointer-events":j(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>j(a).onOpenChange(!1),onFocusOutside:t[1]||=q(e=>r(`focusOutside`,e),[`prevent`])}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),ny=P({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t),r=Gv();return(e,t)=>(R(),B(Qv,G(j(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>j(r).onOpenChange(!1)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),ry=P({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t),r=Gv(),i=qv();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(r).open.value},{default:M(()=>[j(i).modal.value?(R(),B(ty,xe(G({key:0},{...e.$attrs,...j(n)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(ny,xe(G({key:1},{...e.$attrs,...j(n)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),[iy,ay]=Rp(`MenuGroup`),oy=P({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=iy({id:``});return(e,r)=>(R(),B(j(gh),G(t,{id:j(n).id||void 0}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),sy=P({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),cy=P({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(gh),G(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),[ly,uy]=Rp(`PopoverRoot`),dy=P({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=xn(n),a=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return uy({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:A(),hasCustomAnchor:A(!1)}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{open:j(a),close:()=>a.value=!1})]),_:3}))}}),fy=P({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=zm(rm(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=Rm(),o=ly();return Fm(),(e,t)=>(R(),B(j(Hh),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>j(o).onOpenChange(!1)},{default:M(()=>[H(j(Iv),G(j(i),{id:j(o).contentId,ref:j(a),"data-state":j(o).open.value?`open`:`closed`,"aria-labelledby":j(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),py=P({__name:`PopoverContentModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=A(!1);km(!0);let o=Bm(n,r),{forwardRef:s,currentElement:c}=Rm();return rh(c),(e,t)=>(R(),B(fy,G(j(o),{ref:j(s),"trap-focus":j(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=q(e=>{r(`closeAutoFocus`,e),a.value||j(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.value=t.button===2||n},onFocusOutside:t[2]||=q(()=>{},[`prevent`])}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),my=P({__name:`PopoverContentNonModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=A(!1),o=A(!1),s=Bm(n,r);return(e,t)=>(R(),B(fy,G(j(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||j(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;j(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),hy=P({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ly(),a=Bm(n,r),{forwardRef:o}=Rm();return i.contentId||=ah(void 0,`reka-popover-content`),(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[j(i).modal.value?(R(),B(py,G({key:0},j(a),{ref:j(o)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):(R(),B(my,G({key:1},j(a),{ref:j(o)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),gy=P({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),_y=P({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=ly(),{forwardRef:r,currentElement:i}=Rm();return n.triggerId||=ah(void 0,`reka-popover-trigger`),Ki(()=>{n.triggerElement.value=i.value}),(e,i)=>(R(),B(aa(j(n).hasCustomAnchor.value?j(gh):j(wg)),{"as-child":``},{default:M(()=>[H(j(gh),{id:j(n).triggerId,ref:j(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":j(n).open.value,"aria-controls":j(n).contentId,"data-state":j(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:j(n).onOpenToggle},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),[vy,yy]=Rp(`DropdownMenuRoot`),by=P({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Rm();let i=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=A(),{modal:o,dir:s}=xn(n),c=Mm(s);return yy({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:o,dir:c}),(e,t)=>(R(),B(j(Yv),{open:j(i),"onUpdate:open":t[0]||=e=>dn(i)?i.value=e:null,dir:j(c),modal:j(o)},{default:M(()=>[I(e.$slots,`default`,{open:j(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),xy=P({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=Bm(e,t);Rm();let r=vy(),i=A(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=ah(void 0,`reka-dropdown-menu-content`),(e,t)=>(R(),B(j(ry),G(j(n),{id:j(r).contentId,"aria-labelledby":j(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!j(r).modal.value||a)&&(i.value=!0),j(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Sy=P({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=Nm(t);return Rm(),(e,t)=>(R(),B(j(ey),xe(gs({...n,...j(r)})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Cy=P({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(oy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),wy=P({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(sy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Ty=P({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(cy),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Ey=P({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=vy(),{forwardRef:r,currentElement:i}=Rm();return Ki(()=>{n.triggerElement=i}),n.triggerId||=ah(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(R(),B(j(Hv),{"as-child":``},{default:M(()=>[H(j(gh),{id:j(n).triggerId,ref:j(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":j(n).open.value,"aria-controls":j(n).open.value?j(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":j(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(j(n)?.onOpenToggle(),await er(),j(n).open.value&&t.preventDefault())},onKeydown:i[1]||=Xl(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&j(n).onOpenToggle(),t.key===`ArrowDown`&&j(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Dy=P({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return Rm(),(e,n)=>(R(),B(j(gh),G(t,{onMousedown:n[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Oy=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ky=[` `,`Enter`];function Ay(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>jy(e,t,n)):jy(e,t,n)}function jy(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Ip(e,t)}function My(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Ny={key:0,value:``},[Py,Fy]=Rp(`SelectRoot`),Iy=P({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=xn(n),c=_m(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=A(),d=A(),f=A({x:0,y:0}),p=K(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Vp(c.value));ug({isProvider:!0});let m=Mm(s),h=Lm(u),g=A(new Set),_=K(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>jy(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Ay(e,t.value,n.by))}return Fy({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{modelValue:j(c),open:j(l)}),j(h)&&e.name?(R(),B(Ly,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:j(o),required:j(i),name:e.name,autocomplete:e.autocomplete,disabled:j(a),value:j(c)},{default:M(()=>[j(Vp)(j(c))?(R(),z(`option`,Ny)):W(`v-if`,!0),(R(!0),z(L,null,F(Array.from(g.value),e=>(R(),z(`option`,G({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):W(`v-if`,!0)]),_:3}))}}),Ly=P({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=A(),r=Py();N(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(R(),B(j(dg),{"as-child":``},{default:M(()=>[V(`select`,G({ref_key:`selectElement`,ref:n},t,{onInput:i}),[I(e.$slots,`default`)],16)]),_:3}))}}),Ry=P({__name:`SelectPopperPosition`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=zm(e);return(e,n)=>(R(),B(j(Iv),G(j(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),zy={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[By,Vy]=Rp(`SelectContent`),Hy=P({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Py();Fm(),km(n.bodyLock);let{CollectionSlot:a,getItems:o}=ug(),s=A();rh(s);let{search:c,handleTypeaheadSearch:l}=ch(),u=A(),d=A(),f=A(),p=A(!1),m=A(!1),h=A(!1);function g(){d.value&&s.value&&Yh([d.value,s.value])}N(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;Tr(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Yh(t)),e.preventDefault()}}let b=zm(K(()=>n.position===`popper`?n:{}).value);return Vy({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=Ay(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else (a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(Ay(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(R(),B(j(a),null,{default:M(()=>[H(j(Hh),{"as-child":``,onMountAutoFocus:t[6]||=q(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(j(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:M(()=>[H(j(Oh),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=q(()=>{},[`prevent`]),onDismiss:t[3]||=e=>j(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:M(()=>[(R(),B(aa(e.position===`popper`?Ry:Gy),G({...e.$attrs,...j(b)},{id:j(i).contentId,ref:e=>{if(!e)return;let t=j(lm)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":j(i).open.value?`open`:`closed`,dir:j(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=q(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[Uy,Wy]=Rp(`SelectItemAlignedPosition`),Gy=P({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=ug(),a=Py(),o=By(),s=A(!1),c=A(!0),l=A(),{forwardRef:u,currentElement:d}=Rm(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=Lp(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=Lp(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),ee=e.top+e.height/2-10,E=u-ee,te=p.value.offsetHeight/2,ne=p.value.offsetTop+te,re=_+v+ne,ie=x-re;if(re<=ee){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=re+Math.max(E,te+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(ee,_+f.value.offsetTop+(e?w:0)+te)+ie;l.value.style.height=`${t}px`,f.value.scrollTop=re-ee+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=A(``);Ki(async()=>{await er(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return gm(a.triggerElement,()=>{g()}),Wy({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(R(),z(`div`,{ref_key:`contentWrapperElement`,ref:l,style:ge({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[H(j(gh),G({ref:j(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)],4))}}),Ky=P({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return Fy(e.context),Vy(zy),(e,t)=>I(e.$slots,`default`)}}),qy={key:1},Jy=P({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t),i=Py(),a=A();Ki(()=>{a.value=new DocumentFragment});let o=A(),s=K(()=>n.forceMount||i.open.value),c=A(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return N(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),Xi(u),(e,t)=>s.value||c.value||o.value?.present?(R(),B(j(ph),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:M(()=>[H(Hy,xe(gs({...j(r),...e.$attrs})),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(R(),z(`div`,qy,[(R(),B(Hr,{to:a.value},[H(Ky,{context:j(i)},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):W(`v-if`,!0)}}),Yy=P({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(R(),B(j(gh),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:M(()=>[I(e.$slots,`default`,{},()=>[t[0]||=U(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[Xy,Zy]=Rp(`SelectItem`),Qy=P({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=xn(n),a=Py(),o=By(),{forwardRef:s,currentElement:c}=Rm(),{CollectionItem:l}=ug(),u=K(()=>Ay(a.modelValue?.value,n.value,a.by)),d=A(!1),f=A(n.textValue??``),p=ah(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||Bp(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await er(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await er(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await er(),!e.defaultPrevented&&e.currentTarget===zp()&&o.onItemLeave?.()}async function v(e){await er(),!e.defaultPrevented&&(o.searchRef?.value!==``&&e.key===` `||(ky.includes(e.key)&&m(e),e.key===` `&&e.preventDefault()))}if(n.value===``)throw Error(`A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Ki(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),Zy({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(R(),B(j(l),{value:{textValue:f.value}},{default:M(()=>[H(j(gh),{ref:j(s),role:`option`,"aria-labelledby":j(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":j(i)||void 0,"data-disabled":j(i)?``:void 0,tabindex:j(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=q(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),$y=P({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Xy();return(e,r)=>j(n).isSelected.value?(R(),B(j(gh),G({key:0,"aria-hidden":`true`},t),{default:M(()=>[I(e.$slots,`default`)]),_:3},16)):W(`v-if`,!0)}}),eb=P({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Py(),r=By(),i=Xy(),{forwardRef:a,currentElement:o}=Rm(),s=K(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??``}));return Ki(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(s.value))}),Xi(()=>{n.onOptionRemove(s.value)}),(e,n)=>(R(),B(j(gh),G({id:j(i).textId,ref:j(a)},{...t,...e.$attrs}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`id`]))}}),tb=P({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),nb=P({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Py(),{forwardRef:r,currentElement:i}=Rm(),a=K(()=>n.disabled?.value||t.disabled);n.contentId||=ah(void 0,`reka-select-content`),Ki(()=>{n.onTriggerChange(i.value)});let{getItems:o}=ug(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=ch();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}return(e,t)=>(R(),B(j(wg),{"as-child":``,reference:e.reference},{default:M(()=>[H(j(gh),{ref:j(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":j(n).contentId,"aria-expanded":j(n).open.value||!1,"aria-required":j(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:j(n)?.dir.value,"data-state":j(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":j(My)(j(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:t[0]||=e=>{(e?.currentTarget)?.focus()},onPointerdown:t[1]||=e=>{if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(d(e),e.preventDefault())},onPointerup:t[2]||=q(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[3]||=e=>{let t=j(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(j(c)(e.key,j(o)()),j(Oy).includes(e.key)&&(u(),e.preventDefault()))}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),rb=P({__name:`SelectValue`,props:{placeholder:{type:String,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Rm(),i=Py();Ki(()=>{i.valueElement=r});let a=K(()=>{let e=[],t=Array.from(i.optionsSet.value),n=e=>t.find(t=>Ay(e,t.value,i.by));return e=Array.isArray(i.modelValue.value)?i.modelValue.value.map(e=>n(e)?.textContent??``):[n(i.modelValue.value)?.textContent??``],e.filter(Boolean)}),o=K(()=>a.value.length?a.value.join(`, `):t.placeholder);return(e,r)=>(R(),B(j(gh),{ref:j(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`},"data-placeholder":a.value.length?void 0:t.placeholder},{default:M(()=>[I(e.$slots,`default`,{selectedLabel:a.value,modelValue:j(i).modelValue.value},()=>[U(k(o.value),1)])]),_:3},8,[`as`,`as-child`,`data-placeholder`]))}}),ib=P({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=xn(t),r=Lv(n),i=By(),a=i.position===`item-aligned`?Uy():void 0,{forwardRef:o,currentElement:s}=Rm();Ki(()=>{i?.onViewportChange(s.value)});let c=A(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o<n){let i=o+e,a=Math.min(n,i),s=i-a;r.value.style.height=`${a}px`,r.value.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(R(),z(L,null,[H(j(gh),G({ref:j(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16),H(j(gh),{as:`style`,nonce:j(r)},{default:M(()=>n[0]||=[U(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[ab,ob]=Rp(`SwitchRoot`),sb=P({__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=xn(n),a=_m(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),o=K(()=>a.value===n.trueValue);function s(){i.value||(a.value=o.value?n.falseValue:n.trueValue)}let{forwardRef:c,currentElement:l}=Rm(),u=Lm(l),d=K(()=>n.id&&l.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return ob({checked:o,toggleCheck:s,disabled:i}),(e,t)=>(R(),B(j(gh),G(e.$attrs,{id:e.id,ref:j(c),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||d.value,"aria-checked":o.value,"aria-required":e.required,"data-state":o.value?`checked`:`unchecked`,"data-disabled":j(i)?``:void 0,"as-child":e.asChild,as:e.as,disabled:j(i),onClick:s,onKeydown:Xl(q(s,[`prevent`]),[`enter`])}),{default:M(()=>[I(e.$slots,`default`,{modelValue:j(a),checked:o.value}),j(u)&&e.name?(R(),B(j(pg),{key:0,type:`checkbox`,name:e.name,disabled:j(i),required:e.required,value:e.value,checked:o.value},null,8,[`name`,`disabled`,`required`,`value`,`checked`])):W(`v-if`,!0)]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]))}}),cb=P({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=ab();return Rm(),(e,n)=>(R(),B(j(gh),{"data-state":j(t).checked.value?`checked`:`unchecked`,"data-disabled":j(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),[lb,ub]=Rp(`TabsRoot`),db=P({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{orientation:i,unmountOnHide:a,dir:o}=xn(n),s=Mm(o);Rm();let c=_m(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),l=A(),u=fn(new Set);return ub({modelValue:c,changeModelValue:e=>{c.value=e},orientation:i,dir:s,unmountOnHide:a,activationMode:n.activationMode,baseId:ah(void 0,`reka-tabs`),tabsList:l,contentIds:u,registerContent:e=>{u.value=new Set([...u.value,e])},unregisterContent:e=>{let t=new Set(u.value);t.delete(e),u.value=t}}),(e,t)=>(R(),B(j(gh),{dir:j(s),"data-orientation":j(i),"as-child":e.asChild,as:e.as},{default:M(()=>[I(e.$slots,`default`,{modelValue:j(c)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function fb(e,t){return`${e}-trigger-${t}`}function pb(e,t){return`${e}-content-${t}`}var mb=P({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=xn(e),{forwardRef:n,currentElement:r}=Rm(),i=lb();return i.tabsList=r,(e,r)=>(R(),B(j(Bv),{"as-child":``,orientation:j(i).orientation.value,dir:j(i).dir.value,loop:j(t)},{default:M(()=>[H(j(gh),{ref:j(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":j(i).orientation.value},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),hb=P({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=Rm(),r=lb(),i=K(()=>fb(r.baseId,t.value)),a=K(()=>r.contentIds.value.has(t.value)?pb(r.baseId,t.value):void 0),o=K(()=>t.value===r.modelValue.value);return(e,t)=>(R(),B(j(Vv),{"as-child":``,focusable:!e.disabled,active:o.value},{default:M(()=>[H(j(gh),{id:i.value,ref:j(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":j(r).orientation.value,onMousedown:t[0]||=q(t=>{!e.disabled&&t.ctrlKey===!1?j(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=Xl(t=>j(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=j(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&j(r).changeModelValue(e.value)}},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),[gb,_b]=Rp(`TooltipProvider`),vb=P({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=xn(e);Rm();let c=A(!0),l=A(!1),{start:u,stop:d}=om(()=>{c.value=!0},n,{immediate:!1});return _b({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>I(e.$slots,`default`)}}),yb=`tooltip.open`,[bb,xb]=Rp(`TooltipRoot`),Sb=P({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Rm();let i=gb(),a=K(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=K(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=K(()=>n.disabled??i.disabled.value),c=K(()=>n.delayDuration??i.delayDuration.value),l=K(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=_m(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});N(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(yb))):i.onClose())});let d=A(!1),f=A(),p=K(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=om(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return xb({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(R(),B(j(Cg),null,{default:M(()=>[I(e.$slots,`default`,{open:j(u)})]),_:3}))}}),Cb=P({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=bb(),a=gb(),{forwardRef:o,currentElement:s}=Rm(),c=K(()=>n.ariaLabel||s.value?.textContent),l=K(()=>{let{ariaLabel:e,...t}=n;return Dm(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return Ki(()=>{um(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),um(window,yb,i.onClose)}),(e,t)=>(R(),B(j(Oh),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{j(i).disableClosingTrigger.value&&j(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=q(()=>{},[`prevent`]),onDismiss:t[3]||=e=>j(i).onClose()},{default:M(()=>[H(j(Iv),G({ref:j(o),"data-state":j(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:M(()=>[I(e.$slots,`default`),H(j(dg),{id:j(i).contentId,role:`tooltip`},{default:M(()=>[U(k(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),wb=P({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=zm(e),{forwardRef:n,currentElement:r}=Rm(),{trigger:i,onClose:a}=bb(),o=gb(),{isPointerInTransit:s,onPointerExit:c}=Vm(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(R(),B(Cb,G({ref:j(n)},j(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Tb=P({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=bb(),a=Bm(n,r),{forwardRef:o}=Rm();return(e,t)=>(R(),B(j(ph),{present:e.forceMount||j(i).open.value},{default:M(()=>[(R(),B(aa(j(i).disableHoverableContent.value?Cb:wb),G({ref:j(o)},j(a)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Eb=P({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(j(og),xe(gs(t)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16))}}),Db=P({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=bb(),r=gb();n.contentId||=ah(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Rm(),o=A(!1),s=A(!1),c=K(()=>n.disabled.value?{}:{click:h,focus:p,pointermove:d,pointerleave:f,pointerdown:u,blur:m});Ki(()=>{n.onTriggerChange(a.value)});function l(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener(`pointerup`,l,{once:!0})}function d(e){e.pointerType!==`touch`&&!s.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function f(){n.onTriggerLeave(),s.value=!1}function p(e){o.value||n.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||n.onOpen()}function m(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(R(),B(j(wg),{"as-child":``,reference:e.reference},{default:M(()=>[H(j(gh),G({ref:j(i),"aria-describedby":j(n).open.value?j(n).contentId:void 0,"data-state":j(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},da(c.value)),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),Ob=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kb=(e,t)=>({classGroupId:e,validator:t}),Ab=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),jb=`-`,Mb=[],Nb=`arbitrary..`,Pb=e=>{let t=Lb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ib(e);let n=e.split(jb);return Fb(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ob(i,t):t:i||Mb}return n[e]||Mb}}},Fb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Fb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(jb):e.slice(t).join(jb),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ib=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Nb+r:void 0})(),Lb=e=>{let{theme:t,classGroups:n}=e;return Rb(n,t)},Rb=(e,t)=>{let n=Ab();for(let r in e){let i=e[r];zb(i,n,r,t)}return n},zb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Bb(i,t,n,r)}},Bb=(e,t,n,r)=>{if(typeof e==`string`){Vb(e,t,n);return}if(typeof e==`function`){Hb(e,t,n,r);return}Ub(e,t,n,r)},Vb=(e,t,n)=>{let r=e===``?t:Wb(t,e);r.classGroupId=n},Hb=(e,t,n,r)=>{if(Gb(e)){zb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kb(n,e))},Ub=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];zb(o,Wb(t,a),n,r)}},Wb=(e,t)=>{let n=e,r=t.split(jb),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ab(),n.nextPart.set(t,i)),n=i}return n},Gb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Kb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},qb=`!`,Jb=`:`,Yb=[],Xb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Zb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Jb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(qb)?(c=s.slice(0,-1),l=!0):s.startsWith(qb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Xb(t,l,c,u)};if(t){let e=t+Jb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Xb(Yb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Qb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},$b=e=>({cache:Kb(e.cacheSize),parseClassName:Zb(e),sortModifiers:Qb(e),postfixLookupClassGroupIds:ex(e),...Pb(e)}),ex=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},tx=/\s+/,nx=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(tx),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+qb:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},rx=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ix(n))&&(i&&(i+=` `),i+=r);return i},ix=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ix(e[r]))&&(n&&(n+=` `),n+=t);return n},ax=(e,...t)=>{let n,r,i,a,o=o=>(n=$b(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=nx(e,n);return i(e,a),a};return a=o,(...e)=>a(rx(...e))},ox=[],sx=e=>{let t=t=>t[e]||ox;return t.isThemeGetter=!0,t},cx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ux=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,px=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gx=e=>ux.test(e),_x=e=>!!e&&!Number.isNaN(Number(e)),vx=e=>!!e&&Number.isInteger(Number(e)),yx=e=>e.endsWith(`%`)&&_x(e.slice(0,-1)),bx=e=>dx.test(e),xx=()=>!0,Sx=e=>fx.test(e)&&!px.test(e),Cx=()=>!1,wx=e=>mx.test(e),Tx=e=>hx.test(e),Ex=e=>!X(e)&&!Z(e),Dx=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ox=e=>Ux(e,qx,Cx),X=e=>cx.test(e),kx=e=>Ux(e,Jx,Sx),Ax=e=>Ux(e,Yx,_x),jx=e=>Ux(e,Zx,xx),Mx=e=>Ux(e,Xx,Cx),Nx=e=>Ux(e,Gx,Cx),Px=e=>Ux(e,Kx,Tx),Fx=e=>Ux(e,Qx,wx),Z=e=>lx.test(e),Ix=e=>Wx(e,Jx),Lx=e=>Wx(e,Xx),Rx=e=>Wx(e,Gx),zx=e=>Wx(e,qx),Bx=e=>Wx(e,Kx),Vx=e=>Wx(e,Qx,!0),Hx=e=>Wx(e,Zx,!0),Ux=(e,t,n)=>{let r=cx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Wx=(e,t,n=!1)=>{let r=lx.exec(e);return r?r[1]?t(r[1]):n:!1},Gx=e=>e===`position`||e===`percentage`,Kx=e=>e===`image`||e===`url`,qx=e=>e===`length`||e===`size`||e===`bg-size`,Jx=e=>e===`length`,Yx=e=>e===`number`,Xx=e=>e===`family-name`,Zx=e=>e===`number`||e===`weight`,Qx=e=>e===`shadow`,$x=ax(()=>{let e=sx(`color`),t=sx(`font`),n=sx(`text`),r=sx(`font-weight`),i=sx(`tracking`),a=sx(`leading`),o=sx(`breakpoint`),s=sx(`container`),c=sx(`spacing`),l=sx(`radius`),u=sx(`shadow`),d=sx(`inset-shadow`),f=sx(`text-shadow`),p=sx(`drop-shadow`),m=sx(`blur`),h=sx(`perspective`),g=sx(`aspect`),_=sx(`ease`),v=sx(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[gx,`full`,`auto`,...w()],ee=()=>[vx,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,vx,Z,X]},vx,Z,X],te=()=>[vx,`auto`,Z,X],ne=()=>[`auto`,`min`,`max`,`fr`,Z,X],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[gx,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[gx,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[gx,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,Z,X],le=()=>[...b(),Rx,Nx,{position:[Z,X]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,zx,Ox,{size:[Z,X]}],fe=()=>[yx,Ix,kx],pe=()=>[``,`none`,`full`,l,Z,X],me=()=>[``,_x,Ix,kx],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[_x,yx,Rx,Nx],ve=()=>[``,`none`,m,Z,X],ye=()=>[`none`,_x,Z,X],be=()=>[`none`,_x,Z,X],O=()=>[_x,Z,X],xe=()=>[gx,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[bx],breakpoint:[bx],color:[xx],container:[bx],"drop-shadow":[bx],ease:[`in`,`out`,`in-out`],font:[Ex],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[bx],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[bx],shadow:[bx],spacing:[`px`,_x],text:[bx],"text-shadow":[bx],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,gx,X,Z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[Dx],columns:[{columns:[_x,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[vx,`auto`,Z,X]}],basis:[{basis:[gx,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[_x,gx,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,_x,Z,X]}],shrink:[{shrink:[``,_x,Z,X]}],order:[{order:[vx,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,Ix,kx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Hx,jx]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,yx,X]}],"font-family":[{font:[Lx,Mx,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[_x,`none`,Z,Ax]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[_x,`from-font`,`auto`,Z,kx]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[_x,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[vx,Z,X]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},vx,Z,X],radial:[``,Z,X],conic:[vx,Z,X]},Bx,Px]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[_x,Z,X]}],"outline-w":[{outline:[``,_x,Ix,kx]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,Vx,Fx]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,Vx,Fx]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[_x,kx]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,Vx,Fx]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[_x,Z,X]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[_x]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[_x]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:ve()}],brightness:[{brightness:[_x,Z,X]}],contrast:[{contrast:[_x,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Vx,Fx]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,_x,Z,X]}],"hue-rotate":[{"hue-rotate":[_x,Z,X]}],invert:[{invert:[``,_x,Z,X]}],saturate:[{saturate:[_x,Z,X]}],sepia:[{sepia:[``,_x,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[_x,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[_x,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,_x,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_x,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,_x,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[_x,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[_x,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,_x,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[_x,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[_x,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[vx,Z,X]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[_x,Ix,kx,Ax]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function eS(...e){return $x(Ap(e))}async function tS(e){if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-9999px;left:-9999px;opacity:0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}var Q=P({__name:`Button`,props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return(n,r)=>(R(),B(j(gh),{as:e.as,"as-child":e.asChild,class:O(j(eS)(j(nS)({variant:e.variant,size:e.size}),t.class))},{default:M(()=>[I(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),nS=Np(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,destructive:`bg-destructive text-white hover:bg-destructive/90`},size:{sm:`h-8 rounded-md px-3 text-xs`,default:`h-9 px-4 py-2`,icon:`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),rS=P({__name:`Input`,props:ka({class:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Za(e,`modelValue`);return(e,n)=>vr((R(),z(`input`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,class:O(j(eS)(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e.$props.class))},null,2)),[[Fl,t.value]])}}),iS=P({__name:`SelectTrigger`,props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(nb),G(j(n),{class:j(eS)(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,t.class)}),{default:M(()=>[I(e.$slots,`default`),H(j(Yy),{"as-child":``},{default:M(()=>[H(j(Ou),{class:`size-4 opacity-50`})]),_:1})]),_:3},16,[`class`]))}}),aS=P({__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`popper`},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(t,i)=>(R(),B(j(tb),null,{default:M(()=>[H(j(Jy),G(j(r),{class:j(eS)(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,n.class)}),{default:M(()=>[H(j(ib),{class:O(j(eS)(`p-1`,e.position===`popper`&&`h-[var(--reka-select-trigger-height)] w-full min-w-[var(--reka-select-trigger-width)]`))},{default:M(()=>[I(t.$slots,`default`)]),_:3},8,[`class`])]),_:3},16,[`class`])]),_:3}))}}),oS={class:`absolute left-2 flex size-3.5 items-center justify-center`},sS=P({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(Qy),G(j(n),{class:j(eS)(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t.class)}),{default:M(()=>[V(`span`,oS,[H(j($y),null,{default:M(()=>[H(j(Du),{class:`size-4`})]),_:1})]),H(j(eb),null,{default:M(()=>[I(e.$slots,`default`)]),_:3})]),_:3},16,[`class`]))}}),cS=P({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(mb),G(t,{class:j(eS)(`inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),lS=P({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(hb),G(j(n),{class:j(eS)(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),uS=P({__name:`PopoverContent`,props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(gy),null,{default:M(()=>[H(j(hy),G(j(r),{class:j(eS)(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),dS=P({__name:`Badge`,props:{variant:{},class:{}},setup(e){return(t,n)=>(R(),z(`span`,{class:O(j(eS)(j(fS)({variant:e.variant}),t.$props.class))},[I(t.$slots,`default`)],2))}}),fS=Np(`inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground`,outline:`text-foreground`,destructive:`border-transparent bg-destructive text-white`,source:`border-transparent bg-state-source/15 text-state-source`,machine:`border-transparent bg-state-machine/15 text-state-machine`,reviewed:`border-transparent bg-state-reviewed/15 text-state-reviewed`,"needs-review":`border-transparent bg-state-needs-review/15 text-state-needs-review`}},defaultVariants:{variant:`default`}}),pS=P({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(sb),G(j(r),{class:j(eS)(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,n.class)}),{default:M(()=>[H(j(cb),{class:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`})]),_:1},16,[`class`]))}}),mS={class:`flex flex-col gap-3`},hS=[`aria-checked`,`onClick`],gS=[`aria-checked`],_S=[`aria-checked`,`disabled`],vS={key:0,class:`ml-[30px] text-[11px] text-muted-foreground`},yS=[`aria-checked`],bS={class:`border-t pt-2`},xS=[`aria-checked`,`onClick`],SS={class:`border-t pt-2`},CS=[`aria-checked`],wS={class:`border-t pt-2`},TS=[`aria-checked`,`disabled`,`onClick`],ES={class:`truncate`},DS=P({__name:`FilterMenu`,props:{states:{},issues:{},enabled:{},plurality:{},emptySource:{type:Boolean},aiContextUnreviewed:{type:Boolean},noUsages:{type:Boolean},skipTranslate:{type:Boolean},scanIndexed:{type:Boolean}},emits:[`update:states`,`update:issues`,`update:enabled`,`update:plurality`,`update:emptySource`,`update:aiContextUnreviewed`,`update:noUsages`,`update:skipTranslate`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>new Set(n.enabled));function a(e){r(`update:states`,n.states.includes(e)?n.states.filter(t=>t!==e):[...n.states,e])}function o(e){r(`update:plurality`,n.plurality.includes(e)?n.plurality.filter(t=>t!==e):[...n.plurality,e])}function s(e){i.value.has(e)&&r(`update:issues`,n.issues.includes(e)?n.issues.filter(t=>t!==e):[...n.issues,e])}function c(e,t){t?i.value.has(e)||r(`update:enabled`,[...n.enabled,e]):(r(`update:enabled`,n.enabled.filter(t=>t!==e)),n.issues.includes(e)&&r(`update:issues`,n.issues.filter(t=>t!==e)))}return(t,n)=>(R(),z(`div`,mS,[V(`div`,null,[n[7]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Status`,-1),(R(!0),z(L,null,F(j(ap),t=>(R(),z(`button`,{key:t,type:`button`,role:`checkbox`,"aria-checked":e.states.includes(t),class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:e=>a(t)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.states.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.states.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),U(` `+k(j(cp)[t]),1)],8,hS))),128)),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.emptySource,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[0]||=t=>r(`update:emptySource`,!e.emptySource)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.emptySource?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.emptySource?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[4]||=U(` Empty source `,-1)],8,gS),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.noUsages,disabled:!e.scanIndexed,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm enabled:hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50`,onClick:n[1]||=t=>r(`update:noUsages`,!e.noUsages)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.noUsages?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.noUsages?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[5]||=U(` Unused `,-1)],8,_S),e.scanIndexed?W(``,!0):(R(),z(`p`,vS,`Run a scan first`)),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.skipTranslate,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[2]||=t=>r(`update:skipTranslate`,!e.skipTranslate)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.skipTranslate?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.skipTranslate?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),n[6]||=U(` Skip-translate `,-1)],8,yS)]),V(`div`,bS,[n[8]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Type`,-1),(R(!0),z(L,null,F(j(op),t=>(R(),z(`button`,{key:t,type:`button`,role:`checkbox`,"aria-checked":e.plurality.includes(t),class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:e=>o(t)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.plurality.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.plurality.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),U(` `+k(j(lp)[t]),1)],8,xS))),128))]),V(`div`,SS,[n[10]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Context`,-1),V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.aiContextUnreviewed,class:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-sm hover:bg-accent`,onClick:n[3]||=t=>r(`update:aiContextUnreviewed`,!e.aiContextUnreviewed)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,e.aiContextUnreviewed?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.aiContextUnreviewed?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),H(j(vd),{class:`size-3.5 text-muted-foreground`}),n[9]||=U(` AI context (unreviewed) `,-1)],8,CS)]),V(`div`,wS,[n[11]||=V(`p`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Issues`,-1),n[12]||=V(`p`,{class:`mb-1.5 text-[11px] text-muted-foreground`},`Toggle a check to run it; tick its box to filter by it.`,-1),(R(!0),z(L,null,F(j(rp),t=>(R(),z(`div`,{key:t,class:`flex items-center gap-2 py-0.5`},[V(`button`,{type:`button`,role:`checkbox`,"aria-checked":e.issues.includes(t),class:`flex min-w-0 flex-1 items-center gap-2 rounded px-1.5 py-1 text-sm disabled:opacity-50 enabled:hover:bg-accent`,disabled:!i.value.has(t),onClick:e=>s(t)},[V(`span`,{class:O([`flex size-4 shrink-0 items-center justify-center rounded border transition-colors`,e.issues.includes(t)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[e.issues.includes(t)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),V(`span`,ES,k(j(sp)[t]),1)],8,TS),H(j(pS),{"model-value":i.value.has(t),"aria-label":`Enable ${j(sp)[t]} check`,"onUpdate:modelValue":e=>c(t,e)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])]))),128))])]))}}),OS={class:`pointer-events-none fixed bottom-4 right-4 z-[200] flex w-80 flex-col gap-2`},kS=[`onClick`],AS=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(P({__name:`Toaster`,setup(e){let t=FS();return(e,n)=>(R(),B(Hr,{to:`body`},[V(`div`,OS,[H(wl,{name:`toast`},{default:M(()=>[(R(!0),z(L,null,F(j(t).toasts,e=>(R(),z(`button`,{key:e.id,type:`button`,class:O(j(eS)(`pointer-events-auto flex items-center rounded-md border bg-card px-4 py-3 text-left text-sm text-card-foreground shadow-lg`,e.variant===`success`&&`border-state-reviewed/50 text-state-reviewed`,e.variant===`error`&&`border-destructive/50 text-destructive`)),onClick:t=>j(PS)(e.id)},k(e.message),11,kS))),128))]),_:1})])]))}}),[[`__scopeId`,`data-v-e9967100`]]),jS=Zt({toasts:[]}),MS=0;function NS(e,t,n=4e3){let r=MS++;jS.toasts.push({id:r,message:e,variant:t}),window.setTimeout(()=>PS(r),n)}function PS(e){let t=jS.toasts.findIndex(t=>t.id===e);t!==-1&&jS.toasts.splice(t,1)}var $=Object.assign(e=>NS(e,`default`),{success:e=>NS(e,`success`),error:e=>NS(e,`error`),info:e=>NS(e,`default`)});function FS(){return jS}var IS=P({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Dy),{for:t.for,class:O(j(eS)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`for`,`class`]))}}),LS=P({__name:`DialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(sg),null,{default:M(()=>[H(j(ag),{class:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),H(j(ng),G(j(r),{class:j(eS)(`fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,n.class)}),{default:M(()=>[I(e.$slots,`default`),H(j(xh),{class:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`},{default:M(()=>[H(j(kd),{class:`size-4`}),t[0]||=V(`span`,{class:`sr-only`},`Close`,-1)]),_:1})]),_:3},16,[`class`])]),_:3}))}}),RS=P({__name:`DialogHeader`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`div`,{class:O(j(eS)(`flex flex-col gap-1.5 text-center sm:text-left`,e.$props.class))},[I(e.$slots,`default`)],2))}}),zS=P({__name:`DialogFooter`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`div`,{class:O(j(eS)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e.$props.class))},[I(e.$slots,`default`)],2))}}),BS=P({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(cg),{class:O(j(eS)(`text-lg font-semibold leading-none tracking-tight`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),VS=P({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(rg),{class:O(j(eS)(`text-sm text-muted-foreground`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),HS=P({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(wy),null,{default:M(()=>[H(j(xy),G(j(r),{class:j(eS)(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),US=P({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e,n=zm(t);return(e,r)=>(R(),B(j(Sy),G(j(n),{class:j(eS)(`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4`,t.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`]))}}),WS=P({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Cy),{class:O(j(eS)(`px-2 py-1.5 text-sm font-semibold`,t.class))},{default:M(()=>[I(e.$slots,`default`)]),_:3},8,[`class`]))}}),GS=P({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{}},setup(e){let t=e;return(e,n)=>(R(),B(j(Ty),{class:O(j(eS)(`-mx-1 my-1 h-px bg-border`,t.class))},null,8,[`class`]))}}),KS={class:`flex flex-wrap items-center gap-2`},qS={class:`grid gap-2`},JS={class:`flex flex-wrap gap-2`},YS=P({__name:`SelectionBar`,props:{keys:{},locales:{},scopeLabel:{},tagsOnSelection:{}},emits:[`changed`,`clear`,`translate`,`build-context`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A(!1),o=A(!1),s=A(!1),c=A(!1),l=A(``);N(s,e=>{e||(l.value=``)});async function u(e,t,n=!1){i.value=!0;try{await e(),$.success(t),r(`changed`),n&&r(`clear`),a.value=!1,o.value=!1,s.value=!1,c.value=!1}catch(e){$.error(e.message||`Bulk action failed`)}finally{i.value=!1}}let d=()=>u(()=>Pd(n.keys,n.locales),`Cleared translations for ${n.keys.length} key${n.keys.length===1?``:`s`}`),f=()=>u(()=>Fd(n.keys),`Deleted ${n.keys.length} key${n.keys.length===1?``:`s`}`,!0),p=e=>u(()=>Id(n.keys,n.locales,e),`Marked ${n.keys.length} key${n.keys.length===1?``:`s`} ${e}`),m=e=>u(()=>Ld(n.keys,{skipTranslate:e}),e?`Marked skip-translate`:`Cleared skip-translate`),h=()=>u(()=>Ld(n.keys,{clearContext:!0}),`Cleared context for ${n.keys.length} key${n.keys.length===1?``:`s`}`),g=()=>{let e=l.value.trim();if(!(!e||i.value))return u(()=>Ld(n.keys,{addTags:[e]}),`Added tag "${e}"`).then(()=>l.value=``)},_=e=>u(()=>Ld(n.keys,{removeTags:[e]}),`Removed tag "${e}"`);return(t,n)=>(R(),z(`div`,KS,[H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-clear-trigger`,disabled:i.value||!e.keys.length,onClick:n[0]||=e=>a.value=!0},{default:M(()=>[H(j(Ru),{class:`size-4`}),n[19]||=U(` Clear translations `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-translate`,disabled:i.value||!e.keys.length,onClick:n[1]||=e=>r(`translate`)},{default:M(()=>[H(j(vd),{class:`size-4`}),n[20]||=U(` Translate `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-build-context`,disabled:i.value||!e.keys.length,onClick:n[2]||=e=>r(`build-context`)},{default:M(()=>[H(j(Od),{class:`size-4`}),n[21]||=U(` Build context `,-1)]),_:1},8,[`disabled`]),H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5`,"data-testid":`bulk-set-trigger`,disabled:i.value||!e.keys.length},{default:M(()=>[n[22]||=U(` Set `,-1),H(j(Ou),{class:`size-4`})]),_:1},8,[`disabled`])]),_:1}),H(j(HS),{align:`end`,class:`w-52`},{default:M(()=>[H(j(WS),null,{default:M(()=>[U(`Status · `+k(e.scopeLabel),1)]),_:1}),H(j(US),{"data-testid":`bulk-mark-reviewed`,onSelect:n[3]||=e=>p(`reviewed`)},{default:M(()=>[...n[23]||=[U(`Mark reviewed`,-1)]]),_:1}),H(j(US),{"data-testid":`bulk-mark-needs-review`,onSelect:n[4]||=e=>p(`needs-review`)},{default:M(()=>[...n[24]||=[U(`Mark needs-review`,-1)]]),_:1}),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[25]||=[U(`Tags · key`,-1)]]),_:1}),H(j(US),{onSelect:n[5]||=e=>s.value=!0},{default:M(()=>[...n[26]||=[U(`Add tag…`,-1)]]),_:1}),H(j(US),{disabled:!e.tagsOnSelection.length,onSelect:n[6]||=e=>c.value=!0},{default:M(()=>[...n[27]||=[U(`Remove tag…`,-1)]]),_:1},8,[`disabled`]),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[28]||=[U(`Context · key`,-1)]]),_:1}),H(j(US),{onSelect:h},{default:M(()=>[...n[29]||=[U(`Clear context`,-1)]]),_:1}),H(j(GS)),H(j(WS),null,{default:M(()=>[...n[30]||=[U(`Translation · key`,-1)]]),_:1}),H(j(US),{onSelect:n[7]||=e=>m(!0)},{default:M(()=>[...n[31]||=[U(`Skip translate`,-1)]]),_:1}),H(j(US),{onSelect:n[8]||=e=>m(!1)},{default:M(()=>[...n[32]||=[U(`Don't skip`,-1)]]),_:1})]),_:1})]),_:1}),H(j(Q),{variant:`ghost`,size:`sm`,class:`h-8 gap-1.5 text-destructive hover:bg-destructive/10 hover:text-destructive`,"data-testid":`bulk-delete-trigger`,disabled:i.value||!e.keys.length,onClick:n[9]||=e=>o.value=!0},{default:M(()=>[H(j(wd),{class:`size-4`}),n[33]||=U(` Delete `,-1)]),_:1},8,[`disabled`]),H(j(bh),{open:a.value,"onUpdate:open":n[11]||=e=>a.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[34]||=[U(`Clear translations`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(` Clear translations for `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+` in `+k(e.scopeLabel)+`? Source strings are kept. This cannot be undone. `,1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[10]||=e=>a.value=!1},{default:M(()=>[...n[35]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:i.value,"data-testid":`bulk-clear-confirm`,onClick:d},{default:M(()=>[...n[36]||=[U(`Clear translations`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:o.value,"onUpdate:open":n[13]||=e=>o.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[37]||=[U(`Delete keys`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(` Delete `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+` and all their translations? This cannot be undone. `,1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[12]||=e=>o.value=!1},{default:M(()=>[...n[38]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:i.value,"data-testid":`bulk-delete-confirm`,onClick:f},{default:M(()=>[...n[39]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:s.value,"onUpdate:open":n[16]||=e=>s.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[40]||=[U(`Add tag`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[U(`Add a tag to `+k(e.keys.length)+` `+k(e.keys.length===1?`key`:`keys`)+`.`,1)]),_:1})]),_:1}),V(`div`,qS,[H(j(IS),{for:`bulk-add-tag`},{default:M(()=>[...n[41]||=[U(`Tag`,-1)]]),_:1}),H(j(rS),{id:`bulk-add-tag`,modelValue:l.value,"onUpdate:modelValue":n[14]||=e=>l.value=e,disabled:i.value,onKeydown:Xl(q(g,[`prevent`]),[`enter`])},null,8,[`modelValue`,`disabled`,`onKeydown`])]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[15]||=e=>s.value=!1},{default:M(()=>[...n[42]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:i.value||!l.value.trim(),onClick:g},{default:M(()=>[...n[43]||=[U(`Add`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:c.value,"onUpdate:open":n[18]||=e=>c.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[44]||=[U(`Remove tag`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...n[45]||=[U(`Remove a tag from the selected keys.`,-1)]]),_:1})]),_:1}),V(`div`,JS,[(R(!0),z(L,null,F(e.tagsOnSelection,e=>(R(),B(j(Q),{key:e,variant:`outline`,size:`sm`,disabled:i.value,onClick:t=>_(e)},{default:M(()=>[U(k(e),1)]),_:2},1032,[`disabled`,`onClick`]))),128))]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:i.value,onClick:n[17]||=e=>c.value=!1},{default:M(()=>[...n[46]||=[U(`Close`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]))}});function XS(){let e=A(new Set),t=null;function n(t){return e.value.has(t)}function r(n){e.value.has(n)?e.value.delete(n):e.value.add(n),t=n}function i(n,i){if(t===null)return r(n);let a=i.indexOf(t),o=i.indexOf(n);if(a===-1||o===-1)return r(n);let[s,c]=a<o?[a,o]:[o,a];for(let t=s;t<=c;t++)e.value.add(i[t]);t=n}function a(n){for(let t of n)e.value.add(t);t=n.length?n[n.length-1]:null}function o(){e.value.clear(),t=null}function s(n){let r=new Set(n);for(let t of[...e.value])r.has(t)||e.value.delete(t);t!==null&&!r.has(t)&&(t=null)}return{has:n,toggle:r,toggleRange:i,selectAll:a,clear:o,pruneTo:s,keys:()=>[...e.value],count:K(()=>e.value.size),allSelected:t=>t.length>0&&t.every(t=>e.value.has(t)),someSelected:t=>t.some(t=>e.value.has(t))}}var ZS=P({__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Bm(n,t);return(e,t)=>(R(),B(j(Eb),null,{default:M(()=>[H(j(Tb),G(j(r),{class:j(eS)(`z-50 overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-xs text-background shadow-md data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95`,n.class)}),{default:M(()=>[I(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),QS=[`zero`,`one`,`two`,`few`,`many`,`other`];function $S(e){let t;try{t=new Intl.PluralRules(e.replace(/_/g,`-`),{type:`cardinal`}).resolvedOptions().pluralCategories}catch{t=[`other`]}let n=new Set(t);return QS.filter(e=>n.has(e))}function eC(e,t,n){if(t===n)return!1;let r=e.values[n];if(e.plural){if(!r?.forms?.other)return!1;let n=e.values[t]?.forms??{};return $S(t).some(e=>(n[e]??``)===``)}return r?.value?!e.values[t]?.value:!1}function tC(e,t,n){return t.filter(t=>eC(e,t,n))}function nC(e,t,n){return t.filter(t=>{if(t===n)return!1;let r=e.values[t];return!r||r.state!==`needs-review`?!1:r.value?r.value.length>0:Object.keys(r.forms??{}).length>0})}var rC=new Intl.DisplayNames([`en`],{type:`language`}),iC=new Map;function aC(e){if(!iC.has(e)){let t;try{t=new Intl.DisplayNames([e],{type:`language`}).of(e)??void 0}catch{t=void 0}iC.set(e,t)}return iC.get(e)}function oC(e){return e.split(`-`).slice(1).some(e=>/^[a-zA-Z]{5,8}$/.test(e)||/^[0-9][a-zA-Z0-9]{3}$/.test(e))}var sC=new Set([`ar`,`he`,`iw`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`,`ks`,`nqo`,`rhg`]);function cC(e){let t=e.split(/[-_]/)[0]?.toLowerCase()??``;return sC.has(t)}function lC(e,t){let n=e.replace(/_/g,`-`),r=n,i=!1;try{r=Intl.getCanonicalLocales(n)[0]??n,oC(r)&&(i=!0)}catch{i=!0}let a=e;t?.name===void 0?i||(a=rC.of(r)??e):a=t.name;let o;return o=t&&t.flag!==void 0?t.flag:i?null:r===`en`?`en`:new Intl.Locale(r).maximize().region??null,{code:e,bcp47:r,name:a,endonym:i?void 0:aC(r),flagRegion:o,isCustom:i,rtl:cC(e)}}var uC=[`aria-label`],dC=`inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11.5px] font-medium leading-none whitespace-nowrap min-w-[132px]`,fC=P({__name:`StateBadge`,props:{state:{},editable:{type:Boolean}},emits:[`setState`],setup(e,{emit:t}){let n=e,r=t,i=[`machine`,`reviewed`,`needs-review`],a={source:`Source`,machine:`Machine`,reviewed:`Reviewed`,"needs-review":`Needs review`},o={source:`bg-accent text-muted-foreground border-border-soft`,machine:`bg-machine-soft text-machine border-transparent`,reviewed:`bg-review-soft text-review border-transparent`,"needs-review":`bg-muted text-muted-foreground border-border`},s={source:`bg-muted-foreground`,machine:`bg-machine`,reviewed:`bg-review`,"needs-review":`bg-muted-foreground`};return(t,c)=>!e.editable||e.state===`source`?(R(),z(`span`,{key:0,class:O(j(eS)(dC,o[e.state],`cursor-default`)),"data-testid":`state-badge`},[e.state===`reviewed`?(R(),B(j(Du),{key:0,class:`size-3 shrink-0`})):(R(),z(`span`,{key:1,class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e.state]))},null,2)),U(` `+k(a[e.state]),1)],2)):(R(),B(j(by),{key:1},{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:O(j(eS)(dC,o[e.state],`transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`)),"aria-label":`${a[e.state]} — change state`,"data-testid":`state-badge`},[e.state===`reviewed`?(R(),B(j(Du),{key:0,class:`size-3 shrink-0`})):(R(),z(`span`,{key:1,class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e.state]))},null,2)),U(` `+k(a[e.state])+` `,1),H(j(Ou),{class:`ml-auto size-3 opacity-50`})],10,uC)]),_:1}),H(j(HS),{align:`end`,class:`min-w-[10rem]`},{default:M(()=>[(R(),z(L,null,F(i,e=>H(j(US),{key:e,onSelect:t=>r(`setState`,e)},{default:M(()=>[V(`span`,{class:O(j(eS)(`size-[7px] shrink-0 rounded-full`,s[e]))},null,2),U(` `+k(a[e])+` `,1),H(j(Du),{class:O(j(eS)(`ml-auto size-4`,e===n.state?`opacity-100`:`opacity-0`))},null,8,[`class`])]),_:2},1032,[`onSelect`])),64))]),_:1})]),_:1}))}}),pC=new RegExp([`\\{\\s*[A-Za-z0-9_]+\\s*,\\s*(?:plural|select|selectordinal)\\s*,(?:[^{}]|\\{[^{}]*\\})*\\}`,`\\{\\s*[A-Za-z0-9_.]+\\s*\\}`].join(`|`),`g`);function mC(e){let t=[];if(!e.includes(`'`))return t;for(let n=0;n<e.length;){if(e[n]===`'`){let r=e[n+1];if(r===`'`){n+=2;continue}if(r===`{`||r===`}`||r===`#`||r===`|`){let r=n;for(n+=2;n<e.length&&e[n]!==`'`;)n++;let i=n<e.length?n+1:n;t.push([r,i]),n=i;continue}}n++}return t}function hC(e){if(!e)return[];let t=mC(e),n=e=>t.some(([t,n])=>e>=t&&e<n),r=[],i=0;pC.lastIndex=0;let a;for(;(a=pC.exec(e))!==null;){if(a[0].length===0){pC.lastIndex++;continue}n(a.index)||(a.index>i&&r.push({text:e.slice(i,a.index),placeholder:!1}),r.push({text:a[0],placeholder:!0}),i=a.index+a[0].length)}return i<e.length&&r.push({text:e.slice(i),placeholder:!1}),r}var gC=P({__name:`Textarea`,props:ka({class:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Za(e,`modelValue`);return(e,n)=>vr((R(),z(`textarea`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,class:O(j(eS)(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e.$props.class))},null,2)),[[Fl,t.value]])}}),_C={class:`min-w-0`},vC={key:0,class:`flex flex-col gap-1`},yC={class:`whitespace-pre-wrap break-words`},bC={key:0,class:`rounded bg-ph-bg px-1 font-mono text-[0.85em] font-semibold text-ph-fg`},xC=P({__name:`ValueEditor`,props:{keyName:{},locale:{},sourceLocale:{},value:{},maxLength:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A(``),o=A(!1),s=A(null),c=K(()=>n.locale===n.sourceLocale),l=K(()=>hC(n.value)),u=K(()=>n.maxLength!==void 0&&n.value.length>n.maxLength);function d(e){e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`)}async function f(){a.value=n.value,i.value=!0,await er();let e=s.value?.$el;e?.focus(),e?.select(),d(e)}function p(){i.value=!1}async function m(){if(!i.value)return;i.value=!1;let e=a.value;if(e!==n.value){o.value=!0;try{c.value?await Rd(n.keyName,{source:e}):await zd(n.keyName,n.locale,e),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`),r(`changed`)}finally{o.value=!1}}}return(t,n)=>(R(),z(`div`,_C,[i.value?(R(),z(`div`,vC,[H(j(gC),{ref_key:`textareaEl`,ref:s,modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e,rows:`1`,maxlength:e.maxLength,class:`max-w-[560px] resize-none rounded-lg border-2 border-primary text-sm shadow-[0_0_0_3px_var(--ring)]`,onInput:n[1]||=e=>d(e.target),onBlur:m,onKeydown:[Xl(q(p,[`prevent`]),[`escape`]),Xl(q(m,[`exact`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`maxlength`,`onKeydown`]),n[2]||=V(`span`,{class:`text-[10.5px] text-muted-foreground`},[V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`↵`),U(` save · `),V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`esc`),U(` cancel `)],-1)])):e.value?(R(),z(`button`,{key:1,type:`button`,class:O(j(eS)(`group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 -mx-2 -my-1 text-left text-sm leading-relaxed hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,u.value&&`text-destructive`)),onClick:q(f,[`stop`])},[V(`span`,yC,[(R(!0),z(L,null,F(l.value,(e,t)=>(R(),z(L,{key:t},[e.placeholder?(R(),z(`span`,bC,k(e.text),1)):(R(),z(L,{key:1},[U(k(e.text),1)],64))],64))),128))]),H(j(ad),{"aria-hidden":`true`,class:`size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-60`})],2)):(R(),z(`button`,{key:2,type:`button`,"data-testid":`empty-marker`,class:`group inline-flex items-center gap-1.5 rounded-md border border-dashed border-input px-2.5 py-1 text-[12.5px] font-medium italic text-muted-foreground transition-colors hover:border-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:q(f,[`stop`])},[n[3]||=U(` Empty `,-1),H(j(ad),{class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})]))]))}}),SC={class:`flex min-w-0 flex-col gap-2`},CC={class:`min-w-0 flex-1`},wC={key:0,class:`flex flex-col gap-1`},TC={class:`font-mono text-[10px] font-semibold uppercase tracking-wide text-primary`},EC=[`onClick`],DC={class:`whitespace-pre-wrap break-words`},OC={key:0,class:`rounded bg-ph-bg px-1 font-mono text-[0.85em] font-semibold text-ph-fg`},kC=[`onClick`],AC=P({__name:`PluralValueEditor`,props:{keyName:{},locale:{},sourceLocale:{},arg:{},forms:{},sourceForms:{},maxLength:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>n.locale===n.sourceLocale),a=K(()=>[...Object.keys(n.forms).filter(e=>/^=\d+$/.test(e)).sort((e,t)=>Number(e.slice(1))-Number(t.slice(1))),...$S(n.locale)]),o=A(null),s=A(``),c=A(!1),l=A(null);function u(e){l.value=e}function d(e){return n.forms[e]??``}function f(e){return hC(d(e))}function p(e){return n.maxLength!==void 0&&d(e).length>n.maxLength}function m(e){e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,160)}px`)}async function h(e){s.value=d(e),o.value=e,await er();let t=l.value?.$el;t?.focus(),t?.select(),m(t)}function g(){o.value=null}async function _(){let e=o.value;if(!e)return;o.value=null;let t=s.value;if(t!==d(e)){c.value=!0;try{let i={};for(let[e,t]of Object.entries(n.forms))i[e]=t??``;i[e]=t,await Hd(n.keyName,n.locale,i),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`),r(`changed`)}finally{c.value=!1}}}return(t,n)=>(R(),z(`div`,SC,[(R(!0),z(L,null,F(a.value,t=>(R(),z(`div`,{key:t,"data-testid":`plural-field`,class:`flex items-start gap-2.5`},[V(`span`,{class:O(j(eS)(`mt-0.5 min-w-[46px] shrink-0 rounded border border-border px-1.5 py-1 text-center font-mono text-[9.5px] font-semibold uppercase tracking-wide text-muted-foreground`,!i.value&&!d(t)&&`opacity-55`))},k(t),3),V(`div`,CC,[o.value===t?(R(),z(`div`,wC,[V(`span`,TC,`Plural: `+k(t),1),H(j(gC),{ref_for:!0,ref:u,modelValue:s.value,"onUpdate:modelValue":n[0]||=e=>s.value=e,rows:`1`,maxlength:e.maxLength,class:`max-w-[560px] resize-none rounded-lg border-2 border-primary text-sm shadow-[0_0_0_3px_var(--ring)]`,onInput:n[1]||=e=>m(e.target),onBlur:_,onKeydown:[Xl(q(g,[`prevent`]),[`escape`]),Xl(q(_,[`exact`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`maxlength`,`onKeydown`]),n[2]||=V(`span`,{class:`text-[10.5px] text-muted-foreground`},[V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`↵`),U(` save · `),V(`kbd`,{class:`rounded border border-border-soft bg-accent px-1 font-mono text-[10px]`},`esc`),U(` cancel `)],-1)])):d(t)?(R(),z(`button`,{key:1,type:`button`,class:O(j(eS)(`group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 -mx-2 -my-1 text-left text-sm leading-relaxed hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,p(t)&&`text-destructive`)),onClick:q(e=>h(t),[`stop`])},[V(`span`,DC,[(R(!0),z(L,null,F(f(t),(e,t)=>(R(),z(L,{key:t},[e.placeholder?(R(),z(`span`,OC,k(e.text),1)):(R(),z(L,{key:1},[U(k(e.text),1)],64))],64))),128))]),H(j(ad),{class:`size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})],10,EC)):(R(),z(`button`,{key:2,type:`button`,"data-testid":`empty-marker`,class:`group inline-flex items-center gap-1.5 rounded-md border border-dashed border-input px-2.5 py-1 text-[12.5px] font-medium italic text-muted-foreground transition-colors hover:border-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:q(e=>h(t),[`stop`])},[n[3]||=U(` Empty `,-1),H(j(ad),{class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60`,"aria-hidden":`true`})],8,kC))])]))),128))]))}}),jC=Object.assign({"./assets/flags/ad.svg":`/assets/ad-B18i8NGa.svg`,"./assets/flags/ae.svg":`/assets/ae-CZRtWSox.svg`,"./assets/flags/af.svg":`/assets/af-C77Rf6cE.svg`,"./assets/flags/ag.svg":`/assets/ag-C8MykuG2.svg`,"./assets/flags/ai.svg":`/assets/ai-Dmedkf4v.svg`,"./assets/flags/al.svg":`/assets/al-10QRkakw.svg`,"./assets/flags/am.svg":`/assets/am-DMt4_dd4.svg`,"./assets/flags/ao.svg":`/assets/ao-tXuRa6vm.svg`,"./assets/flags/aq.svg":`/assets/aq-CF5jO-0h.svg`,"./assets/flags/ar.svg":`/assets/ar-Be8Ju1cG.svg`,"./assets/flags/arab.svg":`/assets/arab-C4CYPgyC.svg`,"./assets/flags/as.svg":`/assets/as-Dekqy8Of.svg`,"./assets/flags/asean.svg":`/assets/asean-WMtZ-US_.svg`,"./assets/flags/at.svg":`/assets/at-DGA_6m5E.svg`,"./assets/flags/au.svg":`/assets/au-DAHDIuPI.svg`,"./assets/flags/aw.svg":`/assets/aw-W0PWLK5p.svg`,"./assets/flags/ax.svg":`/assets/ax-DvLIy84U.svg`,"./assets/flags/az.svg":`/assets/az-Bk-bYNxy.svg`,"./assets/flags/ba.svg":`/assets/ba-WdDiSMvP.svg`,"./assets/flags/bb.svg":`/assets/bb-DJxbaxmT.svg`,"./assets/flags/bd.svg":`/assets/bd-BF9t1-60.svg`,"./assets/flags/be.svg":`/assets/be-CLLkK3PN.svg`,"./assets/flags/bf.svg":`/assets/bf-YclsoDuF.svg`,"./assets/flags/bg.svg":`/assets/bg-GUQenraa.svg`,"./assets/flags/bh.svg":`/assets/bh-BQqEGq6F.svg`,"./assets/flags/bi.svg":`/assets/bi-CRmKY6RQ.svg`,"./assets/flags/bj.svg":`/assets/bj-14PhO9bM.svg`,"./assets/flags/bl.svg":`/assets/bl-4CI2YcwX.svg`,"./assets/flags/bm.svg":`/assets/bm-BeYgB2z9.svg`,"./assets/flags/bn.svg":`/assets/bn-B6T3O78g.svg`,"./assets/flags/bo.svg":`/assets/bo-CcUiMqkJ.svg`,"./assets/flags/bq.svg":`/assets/bq-BYpdxEeT.svg`,"./assets/flags/br.svg":`/assets/br-Cu5YU29T.svg`,"./assets/flags/bs.svg":`/assets/bs-7Gd_oriM.svg`,"./assets/flags/bt.svg":`/assets/bt-BTo4qm10.svg`,"./assets/flags/bv.svg":`/assets/bv-wM9JLv4R.svg`,"./assets/flags/bw.svg":`/assets/bw-n5ZaAnGL.svg`,"./assets/flags/by.svg":`/assets/by-C621sBpd.svg`,"./assets/flags/bz.svg":`/assets/bz-BCKHR4_q.svg`,"./assets/flags/ca.svg":`/assets/ca-PYUrLVUV.svg`,"./assets/flags/cc.svg":`/assets/cc-BNT6Xjzk.svg`,"./assets/flags/cd.svg":`/assets/cd-BGclsrP6.svg`,"./assets/flags/cefta.svg":`/assets/cefta-2dDBYygd.svg`,"./assets/flags/cf.svg":`/assets/cf-DRetLmp-.svg`,"./assets/flags/cg.svg":`/assets/cg-CwIyG6SE.svg`,"./assets/flags/ch.svg":`/assets/ch-sfriZoF1.svg`,"./assets/flags/ci.svg":`/assets/ci-C8Q8IYTn.svg`,"./assets/flags/ck.svg":`/assets/ck-DfXMUOTo.svg`,"./assets/flags/cl.svg":`/assets/cl-BgYYb4qP.svg`,"./assets/flags/cm.svg":`/assets/cm-D4yjdmKT.svg`,"./assets/flags/cn.svg":`/assets/cn-DifnnI3t.svg`,"./assets/flags/co.svg":`/assets/co-DV591zMm.svg`,"./assets/flags/cp.svg":`/assets/cp-K_ay05Q_.svg`,"./assets/flags/cr.svg":`/assets/cr-BlYVN-_Q.svg`,"./assets/flags/cu.svg":`/assets/cu-L6XVZNgo.svg`,"./assets/flags/cv.svg":`/assets/cv-CPsfcOfk.svg`,"./assets/flags/cw.svg":`/assets/cw-BbrnximR.svg`,"./assets/flags/cx.svg":`/assets/cx-DpYD6n6U.svg`,"./assets/flags/cy.svg":`/assets/cy-bZuP8hmf.svg`,"./assets/flags/cz.svg":`/assets/cz-WWBC5Aeb.svg`,"./assets/flags/de.svg":`/assets/de-B-2o-4Z9.svg`,"./assets/flags/dg.svg":`/assets/dg-CJPJrjiZ.svg`,"./assets/flags/dj.svg":`/assets/dj-hp_BwbmO.svg`,"./assets/flags/dk.svg":`/assets/dk-DmS9BCZB.svg`,"./assets/flags/dm.svg":`/assets/dm-Cbhezfe1.svg`,"./assets/flags/do.svg":`/assets/do-B86d445t.svg`,"./assets/flags/dz.svg":`/assets/dz-Dytc1TFu.svg`,"./assets/flags/eac.svg":`/assets/eac-CwGQsyAM.svg`,"./assets/flags/ec.svg":`/assets/ec-CaVOFQ3t.svg`,"./assets/flags/ee.svg":`/assets/ee-DufrxGIR.svg`,"./assets/flags/eg.svg":`/assets/eg-YC70hswZ.svg`,"./assets/flags/eh.svg":`/assets/eh-0awM4TVj.svg`,"./assets/flags/en.svg":`/assets/en-BZRN_IpI.svg`,"./assets/flags/er.svg":`/assets/er-X83uml6t.svg`,"./assets/flags/es-ct.svg":`/assets/es-ct-CVyhLp7O.svg`,"./assets/flags/es-ga.svg":`/assets/es-ga-D9xG2hYr.svg`,"./assets/flags/es-pv.svg":`/assets/es-pv-CO3NM2SE.svg`,"./assets/flags/es.svg":`/assets/es-d5m8M5h8.svg`,"./assets/flags/et.svg":`/assets/et-DwdlzOIx.svg`,"./assets/flags/eu.svg":`/assets/eu-Brdgz8ab.svg`,"./assets/flags/fi.svg":`/assets/fi-DWUIkfjL.svg`,"./assets/flags/fj.svg":`/assets/fj-DEAVMg38.svg`,"./assets/flags/fk.svg":`/assets/fk-nuUF_Ak3.svg`,"./assets/flags/fm.svg":`/assets/fm-B4Z83GL0.svg`,"./assets/flags/fo.svg":`/assets/fo-DFjwyWur.svg`,"./assets/flags/fr.svg":`/assets/fr-DVvUyOqI.svg`,"./assets/flags/ga.svg":`/assets/ga-BklUhLH_.svg`,"./assets/flags/gb-eng.svg":`/assets/gb-eng-C8iDhGHN.svg`,"./assets/flags/gb-nir.svg":`/assets/gb-nir-D4gikpNq.svg`,"./assets/flags/gb-sct.svg":`/assets/gb-sct-fW5q01ek.svg`,"./assets/flags/gb-wls.svg":`/assets/gb-wls-Bxz9hxvX.svg`,"./assets/flags/gb.svg":`/assets/gb-DTXiLQoe.svg`,"./assets/flags/gd.svg":`/assets/gd-CO-whzUe.svg`,"./assets/flags/ge.svg":`/assets/ge-B2RiL-Ih.svg`,"./assets/flags/gf.svg":`/assets/gf-DWl5zcw0.svg`,"./assets/flags/gg.svg":`/assets/gg-jdOQS2nU.svg`,"./assets/flags/gh.svg":`/assets/gh-r3LP_X7q.svg`,"./assets/flags/gi.svg":`/assets/gi-BJKE9SzW.svg`,"./assets/flags/gl.svg":`/assets/gl-CHaBnMib.svg`,"./assets/flags/gm.svg":`/assets/gm-Bu99atwn.svg`,"./assets/flags/gn.svg":`/assets/gn-1dJNy9oQ.svg`,"./assets/flags/gp.svg":`/assets/gp-DNyt_wTA.svg`,"./assets/flags/gq.svg":`/assets/gq-Cag8QTk2.svg`,"./assets/flags/gr.svg":`/assets/gr-C5PU0p9p.svg`,"./assets/flags/gs.svg":`/assets/gs-DiiNa0F5.svg`,"./assets/flags/gt.svg":`/assets/gt-CJo5DI-7.svg`,"./assets/flags/gu.svg":`/assets/gu-Di1JYREk.svg`,"./assets/flags/gw.svg":`/assets/gw-D249VY33.svg`,"./assets/flags/gy.svg":`/assets/gy-CcVYUM2E.svg`,"./assets/flags/hk.svg":`/assets/hk-CUNIaSX0.svg`,"./assets/flags/hm.svg":`/assets/hm-Dh6t_Tj3.svg`,"./assets/flags/hn.svg":`/assets/hn-CRjyS_bm.svg`,"./assets/flags/hr.svg":`/assets/hr-fzLfaANM.svg`,"./assets/flags/ht.svg":`/assets/ht-DIMg4gti.svg`,"./assets/flags/hu.svg":`/assets/hu-7Q5wwIIi.svg`,"./assets/flags/ic.svg":`/assets/ic-CSo4d8tH.svg`,"./assets/flags/id.svg":`/assets/id-DiSP6Fmm.svg`,"./assets/flags/ie.svg":`/assets/ie-ChAXClx3.svg`,"./assets/flags/il.svg":`/assets/il-_56OEGLa.svg`,"./assets/flags/im.svg":`/assets/im--VPIqfkF.svg`,"./assets/flags/in.svg":`/assets/in-Cdwu6Bq7.svg`,"./assets/flags/io.svg":`/assets/io-13HOfeJD.svg`,"./assets/flags/iq.svg":`/assets/iq-Dp8HDzo2.svg`,"./assets/flags/ir.svg":`/assets/ir-cCIgaNf6.svg`,"./assets/flags/is.svg":`/assets/is-CZjefTNV.svg`,"./assets/flags/it.svg":`/assets/it-Br7q0Zh6.svg`,"./assets/flags/je.svg":`/assets/je-DyWbhIiC.svg`,"./assets/flags/jm.svg":`/assets/jm-CItSr3iX.svg`,"./assets/flags/jo.svg":`/assets/jo-BAF1FGbm.svg`,"./assets/flags/jp.svg":`/assets/jp-BIMmfxpO.svg`,"./assets/flags/ke.svg":`/assets/ke-C8foqndp.svg`,"./assets/flags/kg.svg":`/assets/kg-B0FsxZiL.svg`,"./assets/flags/kh.svg":`/assets/kh-BeWfuE30.svg`,"./assets/flags/ki.svg":`/assets/ki-p_fAQGbS.svg`,"./assets/flags/km.svg":`/assets/km-B5tqtGG7.svg`,"./assets/flags/kn.svg":`/assets/kn-DVPxDkNY.svg`,"./assets/flags/kp.svg":`/assets/kp-CrDKzoxe.svg`,"./assets/flags/kr.svg":`/assets/kr-BCXH1Hao.svg`,"./assets/flags/kw.svg":`/assets/kw-fSBzmd30.svg`,"./assets/flags/ky.svg":`/assets/ky-Dpsu1myA.svg`,"./assets/flags/kz.svg":`/assets/kz-CwKXYZ8s.svg`,"./assets/flags/la.svg":`/assets/la-CuJflhIW.svg`,"./assets/flags/lb.svg":`/assets/lb-BSjpYEoo.svg`,"./assets/flags/lc.svg":`/assets/lc-CNvab8Ae.svg`,"./assets/flags/li.svg":`/assets/li-CHdhvNcr.svg`,"./assets/flags/lk.svg":`/assets/lk-DUkgV9Tq.svg`,"./assets/flags/lr.svg":`/assets/lr-B84vu3Ds.svg`,"./assets/flags/ls.svg":`/assets/ls-5Xk3Mxq5.svg`,"./assets/flags/lt.svg":`/assets/lt-DoukV-Sm.svg`,"./assets/flags/lu.svg":`/assets/lu-DOI02Msy.svg`,"./assets/flags/lv.svg":`/assets/lv-C-KfY8Yc.svg`,"./assets/flags/ly.svg":`/assets/ly-BWpTK3ux.svg`,"./assets/flags/ma.svg":`/assets/ma-BTRNTRUj.svg`,"./assets/flags/mc.svg":`/assets/mc-PK078JHl.svg`,"./assets/flags/md.svg":`/assets/md-DRlxvNwm.svg`,"./assets/flags/me.svg":`/assets/me-Cv4Gwqah.svg`,"./assets/flags/mf.svg":`/assets/mf-BaAGWwAq.svg`,"./assets/flags/mg.svg":`/assets/mg-C168LHXW.svg`,"./assets/flags/mh.svg":`/assets/mh-gxuIp6Wk.svg`,"./assets/flags/mk.svg":`/assets/mk-D9SIMr-a.svg`,"./assets/flags/ml.svg":`/assets/ml-DVf6ujpi.svg`,"./assets/flags/mm.svg":`/assets/mm-lwT09MQ0.svg`,"./assets/flags/mn.svg":`/assets/mn-CgXyw0O9.svg`,"./assets/flags/mo.svg":`/assets/mo-BAtCjuYA.svg`,"./assets/flags/mp.svg":`/assets/mp-CrOApEqW.svg`,"./assets/flags/mq.svg":`/assets/mq-BFnJ22KI.svg`,"./assets/flags/mr.svg":`/assets/mr-D6G1wpeZ.svg`,"./assets/flags/ms.svg":`/assets/ms-DxciGbUu.svg`,"./assets/flags/mt.svg":`/assets/mt-YqzKx9xl.svg`,"./assets/flags/mu.svg":`/assets/mu-mcq7cUFl.svg`,"./assets/flags/mv.svg":`/assets/mv-BynAllfM.svg`,"./assets/flags/mw.svg":`/assets/mw-C15nc1xZ.svg`,"./assets/flags/mx.svg":`/assets/mx-Cc8Ccfe8.svg`,"./assets/flags/my.svg":`/assets/my-Co4JeeyE.svg`,"./assets/flags/mz.svg":`/assets/mz-Drlr_USV.svg`,"./assets/flags/na.svg":`/assets/na-D79ffb4Z.svg`,"./assets/flags/nc.svg":`/assets/nc-5j7wEmDR.svg`,"./assets/flags/ne.svg":`/assets/ne-B1jPOYkl.svg`,"./assets/flags/nf.svg":`/assets/nf-Dl00mlk2.svg`,"./assets/flags/ng.svg":`/assets/ng-su4NM9If.svg`,"./assets/flags/ni.svg":`/assets/ni-CcFCSQxm.svg`,"./assets/flags/nl.svg":`/assets/nl-BnOa6UiA.svg`,"./assets/flags/no.svg":`/assets/no-qf2JPO73.svg`,"./assets/flags/np.svg":`/assets/np-CIuq5GKd.svg`,"./assets/flags/nr.svg":`/assets/nr-DERIdzkN.svg`,"./assets/flags/nu.svg":`/assets/nu-BfgWvGcd.svg`,"./assets/flags/nz.svg":`/assets/nz-5vODdBjz.svg`,"./assets/flags/om.svg":`/assets/om-DcqxRdQL.svg`,"./assets/flags/pa.svg":`/assets/pa-BLNN9G2-.svg`,"./assets/flags/pc.svg":`/assets/pc-BJpYiA9b.svg`,"./assets/flags/pe.svg":`/assets/pe-BLqhuu1C.svg`,"./assets/flags/pf.svg":`/assets/pf-C8ahG68q.svg`,"./assets/flags/pg.svg":`/assets/pg-BAYpbp9Z.svg`,"./assets/flags/ph.svg":`/assets/ph-BEzTn62K.svg`,"./assets/flags/pk.svg":`/assets/pk-CWMEc3ad.svg`,"./assets/flags/pl.svg":`/assets/pl-o38JROoc.svg`,"./assets/flags/pm.svg":`/assets/pm-CHiP5UmZ.svg`,"./assets/flags/pn.svg":`/assets/pn-DgxdtieE.svg`,"./assets/flags/pr.svg":`/assets/pr-B4tMV0xm.svg`,"./assets/flags/ps.svg":`/assets/ps-DO8YKYeS.svg`,"./assets/flags/pt.svg":`/assets/pt-DZ2ADgIR.svg`,"./assets/flags/pw.svg":`/assets/pw-CQP52WMX.svg`,"./assets/flags/py.svg":`/assets/py-mNzh0mZC.svg`,"./assets/flags/qa.svg":`/assets/qa-Dkmpc78M.svg`,"./assets/flags/re.svg":`/assets/re-Bk4ipYK1.svg`,"./assets/flags/ro.svg":`/assets/ro-CoSeqKY1.svg`,"./assets/flags/rs.svg":`/assets/rs-BfwKwXtn.svg`,"./assets/flags/ru.svg":`/assets/ru-D-4tNwXt.svg`,"./assets/flags/rw.svg":`/assets/rw-D7nbSYKI.svg`,"./assets/flags/sa.svg":`/assets/sa-Dh79zbT9.svg`,"./assets/flags/sb.svg":`/assets/sb-BDTYjcbk.svg`,"./assets/flags/sc.svg":`/assets/sc-CRNsSLg9.svg`,"./assets/flags/sd.svg":`/assets/sd-ClziNjGr.svg`,"./assets/flags/se.svg":`/assets/se-8C923vhy.svg`,"./assets/flags/sg.svg":`/assets/sg-DGYIMG0G.svg`,"./assets/flags/sh-ac.svg":`/assets/sh-ac-FjwY7RYr.svg`,"./assets/flags/sh-hl.svg":`/assets/sh-hl-CqtQPzWZ.svg`,"./assets/flags/sh-ta.svg":`/assets/sh-ta-CPJublpi.svg`,"./assets/flags/sh.svg":`/assets/sh-DNImvbrE.svg`,"./assets/flags/si.svg":`/assets/si-BMKT-Tec.svg`,"./assets/flags/sj.svg":`/assets/sj-BFFEGknm.svg`,"./assets/flags/sk.svg":`/assets/sk-K9BNIYAO.svg`,"./assets/flags/sl.svg":`/assets/sl-DxLJY5vJ.svg`,"./assets/flags/sm.svg":`/assets/sm-DGBIRFB_.svg`,"./assets/flags/sn.svg":`/assets/sn-S8ipNF1U.svg`,"./assets/flags/so.svg":`/assets/so-DlzA2Fco.svg`,"./assets/flags/sr.svg":`/assets/sr-Co7OKBh3.svg`,"./assets/flags/ss.svg":`/assets/ss-CxVEpdPD.svg`,"./assets/flags/st.svg":`/assets/st-C1Nd1c3V.svg`,"./assets/flags/sv.svg":`/assets/sv-CJIHhYwF.svg`,"./assets/flags/sx.svg":`/assets/sx-nDhIaDNb.svg`,"./assets/flags/sy.svg":`/assets/sy-DwSud114.svg`,"./assets/flags/sz.svg":`/assets/sz-qxMwa2gs.svg`,"./assets/flags/tc.svg":`/assets/tc-dtelpZmc.svg`,"./assets/flags/td.svg":`/assets/td-BsuVhZpT.svg`,"./assets/flags/tf.svg":`/assets/tf-Co33RhQH.svg`,"./assets/flags/tg.svg":`/assets/tg-CP1-sc35.svg`,"./assets/flags/th.svg":`/assets/th-tzq84hgd.svg`,"./assets/flags/tj.svg":`/assets/tj-b-aWfOTb.svg`,"./assets/flags/tk.svg":`/assets/tk-CDucsEss.svg`,"./assets/flags/tl.svg":`/assets/tl-wpo93AGk.svg`,"./assets/flags/tm.svg":`/assets/tm-C_WSgUcv.svg`,"./assets/flags/tn.svg":`/assets/tn-BcKCZULf.svg`,"./assets/flags/to.svg":`/assets/to-D8uVsoxb.svg`,"./assets/flags/tr.svg":`/assets/tr-Cd6FO9Bg.svg`,"./assets/flags/tt.svg":`/assets/tt-CTnr7aY5.svg`,"./assets/flags/tv.svg":`/assets/tv-DDqkVT-n.svg`,"./assets/flags/tw.svg":`/assets/tw-d-Mf-0VT.svg`,"./assets/flags/tz.svg":`/assets/tz-BjLtHeil.svg`,"./assets/flags/ua.svg":`/assets/ua-Bq0XgQqK.svg`,"./assets/flags/ug.svg":`/assets/ug-ByL2ejGl.svg`,"./assets/flags/um.svg":`/assets/um-Bhke9Eic.svg`,"./assets/flags/un.svg":`/assets/un-Bqg4Cbbh.svg`,"./assets/flags/us.svg":`/assets/us-C73uVeEr.svg`,"./assets/flags/uy.svg":`/assets/uy-DD6peej-.svg`,"./assets/flags/uz.svg":`/assets/uz-C2f-Cubn.svg`,"./assets/flags/va.svg":`/assets/va-B9-hqIE-.svg`,"./assets/flags/vc.svg":`/assets/vc-COpmFovN.svg`,"./assets/flags/ve.svg":`/assets/ve-BSqnIB9l.svg`,"./assets/flags/vg.svg":`/assets/vg-C7xY6pic.svg`,"./assets/flags/vi.svg":`/assets/vi-BC_zcciE.svg`,"./assets/flags/vn.svg":`/assets/vn-BEAEijd0.svg`,"./assets/flags/vu.svg":`/assets/vu-D6k0NQlg.svg`,"./assets/flags/wf.svg":`/assets/wf-DrxpOO_G.svg`,"./assets/flags/ws.svg":`/assets/ws-vzJNwdVm.svg`,"./assets/flags/xk.svg":`/assets/xk-Bj15g7cp.svg`,"./assets/flags/xx.svg":`/assets/xx-zm_JmrXl.svg`,"./assets/flags/ye.svg":`/assets/ye-BwST9gXC.svg`,"./assets/flags/yt.svg":`/assets/yt-DIfEG0ex.svg`,"./assets/flags/za.svg":`/assets/za-Jz40JTrv.svg`,"./assets/flags/zm.svg":`/assets/zm-BmsW91ne.svg`,"./assets/flags/zw.svg":`/assets/zw-U0m7oJ5e.svg`}),MC=new Map;for(let[e,t]of Object.entries(jC)){let n=e.match(/\/([^/]+)\.svg$/);n&&MC.set(n[1].toLowerCase(),t)}function NC(e){return MC.get(e.toLowerCase())}var PC=[`src`,`alt`,`width`,`height`],FC=P({__name:`Flag`,props:{code:{},override:{},size:{default:16}},setup(e){let t=e,n=K(()=>lC(t.code,t.override)),r=K(()=>n.value.flagRegion?NC(n.value.flagRegion):void 0),i=K(()=>Math.round(t.size*4/3));return(t,a)=>r.value?(R(),z(`img`,{key:0,src:r.value,alt:n.value.name,width:i.value,height:e.size,class:`inline-block shrink-0 rounded-[2px] object-cover ring-1 ring-black/10`,style:ge({width:`${i.value}px`,height:`${e.size}px`})},null,12,PC)):(R(),B(j(qu),{key:1,class:`inline-block shrink-0 text-muted-foreground`,style:ge({width:`${e.size}px`,height:`${e.size}px`}),"aria-hidden":`true`},null,8,[`style`]))}}),IC={class:`inline-flex min-w-0 items-start gap-2`},LC={class:`flex min-w-0 flex-col leading-tight`},RC={class:`flex items-center gap-1.5`},zC={class:`font-mono text-[11.5px] font-semibold tracking-wide`},BC={key:0,class:`truncate text-[11px] text-muted-foreground`},VC={class:`inline-flex min-w-0 items-center gap-1.5`},HC={key:0,class:`truncate`},UC=P({__name:`LanguageLabel`,props:{code:{},override:{},showName:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},size:{default:16},codeMinChars:{},layout:{default:`inline`}},setup(e){let t=e,n=K(()=>lC(t.code,t.override));return(t,r)=>e.layout===`stacked`?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,IC,[H(FC,{code:e.code,override:e.override,size:e.size,class:`mt-0.5 shrink-0`},null,8,[`code`,`override`,`size`]),V(`span`,LC,[V(`span`,RC,[V(`span`,zC,k(e.code.toUpperCase()),1),n.value.rtl?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[...r[0]||=[V(`span`,{class:`rounded border border-border px-1 text-[9px] font-bold uppercase tracking-wide text-muted-foreground`},`RTL`,-1)]]),_:1}),H(j(ZS),null,{default:M(()=>[...r[1]||=[U(`Right-to-left`,-1)]]),_:1})]),_:1})):W(``,!0)]),e.showName?(R(),z(`span`,BC,k(n.value.name),1)):W(``,!0)])])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(n.value.name),1)]),_:1})]),_:1})):(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,VC,[H(FC,{code:e.code,override:e.override,size:e.size},null,8,[`code`,`override`,`size`]),e.showName?(R(),z(`span`,HC,k(n.value.name),1)):W(``,!0),e.showCode?(R(),z(`span`,{key:1,class:`font-mono text-xs`,style:ge(e.codeMinChars==null?void 0:{minWidth:`${e.codeMinChars}ch`})},k(e.code.toUpperCase()),5)):W(``,!0)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(n.value.name),1)]),_:1})]),_:1}))}}),WC=[`data-state`],GC={class:`flex flex-wrap items-start gap-2 pt-0.5`},KC={key:0,class:`rounded-md border border-border-soft bg-accent px-1.5 py-0.5 text-[10.5px] font-semibold uppercase tracking-wide text-muted-foreground`},qC=[`dir`],JC={key:0,"data-testid":`filling-hint`,class:`flex items-center gap-1.5 text-sm italic text-muted-foreground`},YC={key:0,class:`flex items-center justify-end gap-1.5 pt-0.5`},XC={type:`button`,class:`flex size-7 items-center justify-center rounded-md bg-destructive-soft text-destructive transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Show issues`},ZC={class:`flex flex-col gap-1`},QC={key:0,class:`mt-2 border-t pt-2`},$C={class:`flex flex-wrap gap-1`},ew=[`onClick`],tw=[`disabled`],nw=P({__name:`TranslationRow`,props:{keyName:{},locale:{},sourceLocale:{},value:{},maxLength:{},issues:{},labelChars:{},plural:{},sourceForms:{},filling:{type:Boolean}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=K(()=>n.locale===n.sourceLocale),a=K(()=>n.value?.state??(i.value?`source`:`needs-review`)),o=K(()=>n.value?.value??``),s=K(()=>!!n.plural),c=K(()=>n.value?.forms??{}),l=K(()=>cC(n.locale)),u=K(()=>!i.value&&(s.value?Object.keys(c.value).length>0:!!n.value?.value)),d=K(()=>(n.issues?.length??0)>0),f=K(()=>[...new Set((n.issues??[]).filter(e=>e.check===`spelling`).flatMap(e=>e.detail??[]))]);async function p(e){try{await lf(e),$.success(`Added "${e}" to the dictionary`),r(`changed`)}catch(e){$.error(`Could not add word: ${e.message}`)}}let m=A(!1);async function h(){try{await Vd(n.keyName,n.locale),$.success(`Cleared`),r(`changed`)}catch(e){$.error(e.message)}}async function g(e){try{await Bd(n.keyName,n.locale,e),r(`changed`)}catch(e){$.error(`Could not update state: ${e.message}`)}}async function _(){m.value=!0;try{let e=await Gd({onlyMissing:!1,locales:[n.locale],keyGlob:n.keyName,force:!0});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Translated ${n.locale.toUpperCase()} (${e.written} written)`),r(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{m.value=!1}}return(t,n)=>(R(),z(`div`,{class:O(j(eS)(`grid grid-cols-[172px_minmax(0,1fr)_232px] items-start gap-[18px] border-b border-border-soft py-[11px] pl-4 pr-[18px] last:border-b-0 max-[1080px]:grid-cols-[150px_minmax(0,1fr)_200px] max-[1080px]:gap-3`,i.value&&`bg-foreground/[0.015] dark:bg-foreground/[0.025]`)),"data-state":a.value},[V(`div`,GC,[H(UC,{code:e.locale,layout:`stacked`,"show-name":``,size:15},null,8,[`code`]),i.value?(R(),z(`span`,KC,`Source`)):W(``,!0)]),V(`div`,{class:`flex min-w-0 flex-col gap-2`,dir:l.value?`rtl`:`ltr`},[e.filling?(R(),z(`div`,JC,[H(j($u),{class:`size-3.5 shrink-0 animate-spin`}),n[2]||=U(` filling… `,-1)])):s.value?(R(),B(AC,{key:1,"key-name":e.keyName,locale:e.locale,"source-locale":e.sourceLocale,arg:e.plural.arg,forms:c.value,"source-forms":e.sourceForms,"max-length":e.maxLength,onChanged:n[0]||=e=>r(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`arg`,`forms`,`source-forms`,`max-length`])):(R(),B(xC,{key:2,"key-name":e.keyName,locale:e.locale,"source-locale":e.sourceLocale,value:o.value,"max-length":e.maxLength,onChanged:n[1]||=e=>r(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`value`,`max-length`]))],8,qC),i.value?W(``,!0):(R(),z(`div`,YC,[d.value?(R(),B(j(dy),{key:0},{default:M(()=>[H(j(_y),{"as-child":``},{default:M(()=>[V(`button`,XC,[H(j(Td),{class:`size-3.5`})])]),_:1}),H(j(uS),{align:`end`,class:`w-fit max-w-xs text-xs`},{default:M(()=>[V(`ul`,ZC,[(R(!0),z(L,null,F(e.issues,(e,t)=>(R(),z(`li`,{key:t,class:`whitespace-pre-line text-foreground/80`},k(e.message),1))),128))]),f.value.length?(R(),z(`div`,QC,[n[3]||=V(`p`,{class:`mb-1 text-[11px] font-medium text-muted-foreground`},`Add to dictionary`,-1),V(`div`,$C,[(R(!0),z(L,null,F(f.value,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`inline-flex items-center gap-0.5 rounded border border-amber-500/40 px-1.5 py-0.5 text-[11px] text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300`,onClick:t=>p(e)},[H(j(od),{class:`size-3`}),U(k(e),1)],8,ew)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(`Add '`+k(e)+`' to the custom dictionary`,1)]),_:2},1024)]),_:2},1024))),128))])])):W(``,!0)]),_:1})]),_:1})):W(``,!0),u.value?(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,"aria-label":`Clear translation`,onClick:q(h,[`stop`])},[H(j(Ru),{class:`size-4`})])]),_:1}),H(j(ZS),null,{default:M(()=>[...n[4]||=[U(`Clear translation`,-1)]]),_:1})]),_:1})):W(``,!0),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-primary-soft hover:text-primary disabled:opacity-50`,disabled:m.value||e.filling,"aria-label":`AI translate this cell`,onClick:q(_,[`stop`])},[m.value||e.filling?(R(),B(j($u),{key:0,class:`size-4 animate-spin`})):(R(),B(j(Zu),{key:1,class:`size-4`}))],8,tw)]),_:1}),H(j(ZS),null,{default:M(()=>[...n[5]||=[U(`AI translate`,-1)]]),_:1})]),_:1}),H(fC,{state:a.value,editable:!0,onSetState:g},null,8,[`state`])]))],10,WC))}}),rw=[`aria-pressed`],iw={key:0,class:`pointer-events-none absolute inset-0 z-[3] border-2 border-primary`,"aria-hidden":`true`},aw={key:1,class:`pointer-events-none absolute inset-y-0 left-0 z-[4] w-1 bg-primary`,"aria-hidden":`true`},ow={class:`sticky top-3`},sw=[`aria-checked`],cw={class:`absolute right-0 top-0`},lw=[`disabled`],uw=[`innerHTML`],dw={key:0,class:`mt-1.5 flex flex-wrap items-center gap-1.5 pl-6`},fw={key:0,class:`inline-flex items-center gap-1 rounded-md border border-primary-border bg-primary/[0.09] px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-primary`},pw={class:`font-medium normal-case text-muted-foreground`},mw={"data-testid":`issue-badge`,class:`inline-flex items-center gap-1 rounded-md bg-destructive-soft px-1.5 py-0.5 text-[11.5px] font-bold text-destructive`},hw={key:1,class:`mt-2 flex flex-wrap gap-1.5 pl-6`},gw=[`onClick`],_w=[`data-testid`,`disabled`],vw={key:3,"data-testid":`translating-missing`,class:`ml-6 mt-2.5 inline-flex items-center gap-1 text-[11px] text-primary`},yw=[`disabled`],bw={class:`min-w-0 flex-1 [&>*:nth-child(even)]:bg-zebra`},xw={class:`grid gap-2`},Sw={class:`break-all rounded bg-muted px-1 py-0.5 font-mono text-sm`},Cw=P({__name:`KeyRow`,props:{keyName:{},entry:{},sourceLocale:{},locales:{},selected:{type:Boolean},checked:{type:Boolean},issues:{}},emits:[`changed`,`select`,`toggle-select`,`renamed`,`filter-tag`],setup(e,{emit:t}){let n=e,r=K(()=>n.keyName.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\./g,`.<wbr>`)),i=K(()=>{let e=new Map;for(let t of n.issues??[]){let n=e.get(t.locale);n?n.push(t):e.set(t.locale,[t])}return e}),a=t,o=A(!1),s=A(``),c=A(!1),l=A(!1),u=A(!1),d=A(!1),f=K(()=>tC(n.entry,n.locales,n.sourceLocale)),p=K(()=>nC(n.entry,n.locales,n.sourceLocale));async function m(){d.value=!0;try{let e=await Gd({onlyMissing:!1,force:!0,keyGlob:n.keyName,locales:p.value});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Re-translated ${e.written} stale value${e.written===1?``:`s`}`),a(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{d.value=!1}}async function h(){u.value=!0;try{let e=await Gd({onlyMissing:!0,keyGlob:n.keyName});e.errors?.length?$.error(e.errors[0]?.error??`Translation failed`):$.success(`Translated ${e.written} missing value${e.written===1?``:`s`}`),a(`changed`)}catch(e){$.error(`Translate failed: ${e.message}`)}finally{u.value=!1}}function g(e){a(`toggle-select`,{shift:e.shiftKey})}function _(e){e.target?.closest(`button, input, textarea, select, a, [contenteditable="true"]`)||a(`select`)}async function v(){let e=!n.entry.skipTranslate;l.value=!0;try{await Ld([n.keyName],{skipTranslate:e}),$.success(e?`Excluded from translation`:`Included in translation`),a(`changed`)}catch(e){$.error(`Update failed: ${e.message}`)}finally{l.value=!1}}function y(){s.value=n.keyName,o.value=!0}async function b(){let e=s.value.trim();if(!e||e===n.keyName){o.value=!1;return}l.value=!0;try{await Rd(n.keyName,{rename:e}),o.value=!1,$.success(`Renamed to ${e}`),a(`renamed`,e)}catch(e){$.error(`Rename failed: ${e.message}`)}finally{l.value=!1}}async function x(){l.value=!0;try{await Nd(n.keyName),c.value=!1,$.success(`Deleted ${n.keyName}`),a(`changed`)}catch(e){$.error(`Delete failed: ${e.message}`)}finally{l.value=!1}}return(t,n)=>(R(),z(`div`,{class:O(j(eS)(`relative flex border-b-2 border-border bg-card`,e.selected&&`z-[1]`)),role:`button`,"aria-pressed":e.selected,"aria-label":`Select key`,onClick:_},[e.selected?(R(),z(`span`,iw)):W(``,!0),e.selected?(R(),z(`span`,aw)):W(``,!0),V(`div`,{class:O(j(eS)(`relative w-[var(--key-col-width,272px)] shrink-0 border-r border-border-soft p-[14px_16px_14px_18px]`,e.selected&&`bg-primary-soft/60`))},[V(`div`,ow,[V(`button`,{type:`button`,role:`checkbox`,"aria-checked":!!e.checked,"data-testid":`row-select`,class:O([`absolute left-0 top-0.5 flex size-4 items-center justify-center rounded border transition-colors`,e.checked?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`]),"aria-label":`Select key`,onClick:q(g,[`stop`])},[e.checked?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],10,sw),V(`div`,cw,[H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Key actions`,disabled:u.value,onClick:n[0]||=q(()=>{},[`stop`])},[H(j(Lu),{class:`size-4`})],8,lw)]),_:1}),H(j(HS),{align:`end`},{default:M(()=>[f.value.length>0?(R(),B(j(US),{key:0,disabled:u.value,onSelect:h},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` Translate missing (`+k(f.value.length)+`) `,1)]),_:1},8,[`disabled`])):W(``,!0),H(j(US),{onSelect:y},{default:M(()=>[H(j(ad),{class:`size-4`}),n[9]||=U(` Rename `,-1)]),_:1}),H(j(US),{"data-testid":`toggle-skip`,disabled:l.value,onSelect:v},{default:M(()=>[H(j(Zu),{class:`size-4`}),U(` `+k(e.entry.skipTranslate?`Include in translation`:`Skip translation`),1)]),_:1},8,[`disabled`]),H(j(US),{class:`text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive`,onSelect:n[1]||=e=>c.value=!0},{default:M(()=>[H(j(wd),{class:`size-4`}),n[10]||=U(` Delete `,-1)]),_:1})]),_:1})]),_:1})]),V(`div`,{class:`break-words pl-6 pr-7 font-mono text-[13.5px] font-semibold tracking-tight cursor-pointer`,onClick:n[2]||=q(e=>g(e),[`stop`])},[V(`span`,{innerHTML:r.value},null,8,uw),e.entry.screenshot?(R(),B(j(Yu),{key:0,class:`ml-1.5 inline size-3.5 align-[-2px] text-muted-foreground`,"aria-label":`Has screenshot`})):W(``,!0)]),e.entry.plural||e.entry.skipTranslate||(e.issues?.length??0)>0?(R(),z(`div`,dw,[e.entry.plural?(R(),z(`span`,fw,[n[11]||=U(`PLURAL`,-1),V(`span`,pw,`· `+k(e.entry.plural.arg),1)])):W(``,!0),e.entry.skipTranslate?(R(),B(j(Sb),{key:1},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[...n[12]||=[V(`span`,{"data-testid":`skip-badge`,class:`inline-flex items-center gap-1 rounded-md border border-warning-border bg-warning-bg px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-warning`},`SKIP`,-1)]]),_:1}),H(j(ZS),null,{default:M(()=>[...n[13]||=[U(`Excluded from translation`,-1)]]),_:1})]),_:1})):W(``,!0),(e.issues?.length??0)>0?(R(),B(j(Sb),{key:2},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,mw,[H(j(Td),{class:`size-3`}),U(k(e.issues.length),1)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(e.issues.length)+` issue`+k(e.issues.length===1?``:`s`),1)]),_:1})]),_:1})):W(``,!0)])):W(``,!0),(e.entry.tags??[]).length?(R(),z(`div`,hw,[(R(!0),z(L,null,F(e.entry.tags,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`inline-flex h-[22px] items-center gap-1.5 rounded-full border border-primary-border bg-transparent px-[9px] text-xs font-medium text-foreground transition-colors hover:border-primary hover:bg-primary/[0.07]`,onClick:q(t=>a(`filter-tag`,e),[`stop`])},[H(j(Sd),{class:`size-3 text-primary`}),U(k(e),1)],8,gw)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(`Filter by tag: `+k(e),1)]),_:2},1024)]),_:2},1024))),128))])):W(``,!0),f.value.length>0?(R(),B(j(Sb),{key:2},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-testid":u.value?`translating-missing`:`translate-missing-btn`,disabled:u.value,class:`ml-6 mt-2.5 inline-flex items-center gap-1.5 rounded-lg border border-primary-border bg-primary-soft px-2.5 py-1.5 text-[11.5px] font-semibold text-primary transition hover:brightness-95 disabled:opacity-80`,onClick:q(h,[`stop`])},[u.value?(R(),B(j($u),{key:0,class:`size-3 animate-spin`})):(R(),B(j(vd),{key:1,class:`size-3`})),U(` `+k(u.value?`Translating…`:`Translate ${f.value.length} missing`),1)],8,_w)]),_:1}),H(j(ZS),null,{default:M(()=>[U(`Translate the `+k(f.value.length)+` missing language`+k(f.value.length>1?`s`:``)+` for this key`,1)]),_:1})]),_:1})):u.value?(R(),z(`span`,vw,[H(j($u),{class:`size-3 animate-spin`}),n[14]||=U(` Translating… `,-1)])):W(``,!0),p.value.length>0?(R(),B(j(Sb),{key:4},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-testid":`retranslate-stale-btn`,disabled:d.value,class:`ml-6 mt-2.5 inline-flex items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-[11.5px] font-semibold text-amber-700 transition hover:brightness-95 disabled:opacity-80 dark:text-amber-300`,onClick:q(m,[`stop`])},[d.value?(R(),B(j($u),{key:0,class:`size-3 animate-spin`})):(R(),B(j(sd),{key:1,class:`size-3`})),U(` `+k(d.value?`Re-translating…`:`Re-translate ${p.value.length} stale`),1)],8,yw)]),_:1}),H(j(ZS),null,{default:M(()=>[U(`Re-translate the `+k(p.value.length)+` stale language`+k(p.value.length>1?`s`:``)+` for this key`,1)]),_:1})]),_:1})):W(``,!0)])],2),V(`div`,bw,[(R(!0),z(L,null,F(e.locales,t=>(R(),B(nw,{key:t,"key-name":e.keyName,locale:t,"source-locale":e.sourceLocale,value:e.entry.values[t],"max-length":e.entry.maxLength,issues:i.value.get(t)??[],plural:e.entry.plural,"source-forms":e.entry.values[e.sourceLocale]?.forms,filling:u.value&&f.value.includes(t)||d.value&&p.value.includes(t),onChanged:n[3]||=e=>a(`changed`)},null,8,[`key-name`,`locale`,`source-locale`,`value`,`max-length`,`issues`,`plural`,`source-forms`,`filling`]))),128))]),H(j(bh),{open:o.value,"onUpdate:open":n[6]||=e=>o.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[15]||=[U(`Rename key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...n[16]||=[U(`Use dot notation, e.g. `,-1),V(`span`,{class:`font-mono`},`home.title`,-1),U(`.`,-1)]]),_:1})]),_:1}),V(`div`,xw,[H(j(IS),{for:`rename-key`},{default:M(()=>[...n[17]||=[U(`New key`,-1)]]),_:1}),H(j(rS),{id:`rename-key`,modelValue:s.value,"onUpdate:modelValue":n[4]||=e=>s.value=e,class:`font-mono`,onKeydown:Xl(q(b,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:l.value,onClick:n[5]||=e=>o.value=!1},{default:M(()=>[...n[18]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:l.value,onClick:b},{default:M(()=>[...n[19]||=[U(`Rename`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]),H(j(bh),{open:c.value,"onUpdate:open":n[8]||=e=>c.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[20]||=[U(`Delete key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[n[21]||=U(` Delete `,-1),V(`code`,Sw,k(e.keyName),1),n[22]||=U(` and all its translations? This cannot be undone. `,-1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:l.value,onClick:n[7]||=e=>c.value=!1},{default:M(()=>[...n[23]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:l.value,onClick:x},{default:M(()=>[...n[24]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])],10,rw))}}),ww=[{id:`phpstorm`,label:`PhpStorm`,buildUrl:e=>`phpstorm://open?file=${encodeURIComponent(e.abs)}&line=${e.line}`},{id:`vscode`,label:`VS Code`,buildUrl:e=>`vscode://file${e.abs}:${e.line}:${e.col}`},{id:`zed`,label:`Zed`,buildUrl:e=>`zed://file${e.abs}:${e.line}:${e.col}`}],Tw=`vscode`,Ew=e=>ww.some(t=>t.id===e),Dw=A(Tw);function Ow(e){Ew(e)&&(Dw.value=e,rf({editor:e}).catch(()=>{}))}async function kw(){try{let{editor:e}=await nf();Ew(e)&&(Dw.value=e)}catch{}}function Aw(e,t){return(ww.find(e=>e.id===Dw.value)??ww[0]).buildUrl(e,t)}function jw(){return{dirs:new Map,files:new Map}}function Mw(e){let t=jw();for(let n of e){let e=n.file.split(`/`).filter(Boolean),r=e.pop()??n.file,i=t;for(let t of e){let e=i.dirs.get(t);e||(e=jw(),i.dirs.set(t,e)),i=e}let a=i.files.get(r)??[];a.push({line:n.line,url:n.url}),i.files.set(r,a)}let n=[],r=(e,t)=>{for(let i of[...e.dirs.keys()].sort()){let a=i,o=e.dirs.get(i);for(;o.files.size===0&&o.dirs.size===1;){let e=[...o.dirs.keys()][0];a+=`/`+e,o=o.dirs.get(e)}n.push({kind:`dir`,depth:t,label:a}),r(o,t+1)}for(let r of[...e.files.keys()].sort()){let i=e.files.get(r).slice().sort((e,t)=>e.line-t.line);n.push({kind:`file`,depth:t,name:r,refs:i})}};return r(t,0),n}var Nw={class:`flex flex-col gap-2`},Pw={class:`flex items-center gap-1.5`},Fw={key:0,class:`flex flex-col gap-2`},Iw={class:`mt-1 flex gap-2`},Lw={class:`flex items-center justify-between`},Rw={class:`font-mono text-[10px] text-muted-foreground`},zw={class:`flex gap-1.5`},Bw=[`onClick`],Vw=[`onClick`],Hw={class:`whitespace-pre-wrap break-words text-[12.5px] leading-snug`},Uw=P({__name:`NotesEditor`,props:{keyName:{},notes:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=e=>new Date(e).toLocaleString(),a=A(``),o=A(!1);async function s(){let e=a.value.trim();if(e){o.value=!0;try{await hf(n.keyName,e),a.value=``,r(`changed`)}catch(e){$.error(`Could not add note: ${e.message}`)}finally{o.value=!1}}}let c=A(null),l=A(``),u=A(!1);function d(e){c.value=e.id,l.value=e.text}function f(){c.value=null,l.value=``}async function p(e){let t=l.value.trim();if(t){u.value=!0;try{await gf(n.keyName,e,t),f(),r(`changed`)}catch(e){$.error(`Could not save note: ${e.message}`)}finally{u.value=!1}}}async function m(e){try{await _f(n.keyName,e),r(`changed`)}catch(e){$.error(`Could not delete note: ${e.message}`)}}return(t,n)=>(R(),z(`div`,Nw,[V(`div`,Pw,[H(j(bd),{class:`size-3.5 text-muted-foreground`}),n[2]||=V(`p`,{class:`text-[13px] font-semibold`},`Notes`,-1)]),n[6]||=V(`p`,{class:`-mt-1 text-[11.5px] text-muted-foreground`},`Internal notes — never sent to the AI or exported.`,-1),e.notes.length?(R(),z(`ul`,Fw,[(R(!0),z(L,null,F(e.notes,e=>(R(),z(`li`,{key:e.id,class:`flex flex-col gap-1 rounded-lg border border-border-soft bg-background p-2.5 text-sm`},[c.value===e.id?(R(),z(L,{key:0},[H(j(gC),{modelValue:l.value,"onUpdate:modelValue":n[0]||=e=>l.value=e,rows:`2`,onKeydown:Xl(q(f,[`prevent`]),[`escape`])},null,8,[`modelValue`,`onKeydown`]),V(`div`,Iw,[H(j(Q),{size:`sm`,disabled:u.value||!l.value.trim(),onClick:t=>p(e.id)},{default:M(()=>[...n[3]||=[U(`Save`,-1)]]),_:1},8,[`disabled`,`onClick`]),H(j(Q),{size:`sm`,variant:`ghost`,onClick:f},{default:M(()=>[...n[4]||=[U(`Cancel`,-1)]]),_:1})])],64)):(R(),z(L,{key:1},[V(`div`,Lw,[V(`span`,Rw,k(i(e.at)),1),V(`span`,zw,[V(`button`,{type:`button`,"aria-label":`Edit note`,class:`text-muted-foreground hover:text-foreground`,onClick:t=>d(e)},[H(j(ad),{class:`size-3.5`})],8,Bw),V(`button`,{type:`button`,"aria-label":`Delete note`,class:`text-muted-foreground hover:text-destructive`,onClick:t=>m(e.id)},[H(j(wd),{class:`size-3.5`})],8,Vw)])]),V(`p`,Hw,k(e.text),1)],64))]))),128))])):W(``,!0),H(j(gC),{"data-testid":`new-note`,modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e,rows:`2`,placeholder:`Add an internal note…`},null,8,[`modelValue`]),H(j(Q),{"data-testid":`add-note`,variant:`outline`,class:`w-full text-muted-foreground`,disabled:o.value||!a.value.trim(),onClick:s},{default:M(()=>[...n[5]||=[U(` Add note `,-1)]]),_:1},8,[`disabled`])]))}}),Ww={class:`flex shrink-0 flex-col overflow-y-auto border-l border-border bg-card max-[1080px]:hidden`},Gw={key:0,class:`flex flex-1 flex-col items-center justify-center gap-2.5 p-10 text-center text-muted-foreground`},Kw={key:1,class:`flex flex-col gap-4 px-5 pb-10 pt-[18px]`},qw={class:`flex flex-col gap-0.5`},Jw=[`innerHTML`],Yw={class:`flex flex-wrap items-center gap-2`},Xw={key:0,class:`rounded-md border border-primary-border bg-primary-soft px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-primary`},Zw={key:1,class:`rounded-md border border-border-soft bg-accent px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-wide text-muted-foreground`},Qw=[`disabled`],$w=[`disabled`],eT={key:0,class:`flex flex-col gap-1.5`},tT={class:`flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-wide text-destructive`},nT={class:`font-mono text-[11px] font-semibold`},rT={class:`ml-auto rounded border border-destructive px-1.5 py-0.5 text-[10.5px] font-semibold text-destructive`},iT=[`disabled`,`onClick`],aT={key:1,class:`flex flex-col gap-1.5`},oT={class:`flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-wide text-muted-foreground`},sT={class:`font-mono text-[11px] font-semibold`},cT={class:`flex flex-col gap-1.5`},lT={class:`flex items-center gap-1.5`},uT={key:0,class:`ml-auto text-[11.5px] text-muted-foreground`},dT={key:0,class:`text-[12px] text-muted-foreground`},fT={key:0,class:`rounded-md border border-border-soft bg-accent px-2 py-1.5 text-[12px] text-muted-foreground`},pT={key:1,class:`flex flex-col gap-0.5 text-[11.5px]`},mT={class:`min-w-0 truncate font-mono`,style:{direction:`rtl`,"text-align":`left`}},hT=[`href`],gT={key:1,class:`min-w-0 shrink truncate font-mono text-foreground`},_T={class:`flex min-w-0 flex-wrap items-baseline gap-x-1.5 gap-y-0.5`},vT=[`href`],yT={key:1,class:`shrink-0 font-mono text-muted-foreground`},bT={key:2,class:`flex flex-col gap-1`},xT={class:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground`},ST={class:`flex flex-col gap-1`},CT={class:`min-w-0 flex-1 truncate font-mono`,style:{direction:`rtl`,"text-align":`left`}},wT={class:`shrink-0 rounded border border-dashed border-border-soft px-1 font-mono text-[10px]`},TT={class:`shrink-0 font-mono`},ET={class:`flex flex-col gap-1.5`},DT={class:`flex items-center gap-1.5`},OT={class:`ml-0.5 flex items-center gap-0.5 rounded border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] font-semibold text-primary`},kT=[`disabled`],AT={class:`flex flex-col gap-1.5`},jT={class:`flex items-center gap-1.5`},MT={class:`flex flex-col gap-1.5`},NT={class:`flex items-center gap-1.5`},PT={class:`flex flex-col gap-2`},FT={class:`flex items-center gap-1.5`},IT={key:0,class:`flex flex-col gap-2`},LT=[`src`,`alt`],RT={class:`flex gap-2`},zT=[`disabled`],BT={class:`flex flex-col gap-1.5 text-[11.5px] text-muted-foreground`},VT={class:`flex items-center justify-between gap-3`},HT={class:`font-mono text-[11px] text-foreground`},UT={class:`flex items-center justify-between gap-3`},WT={class:`font-mono text-[11px] text-foreground`},GT=P({__name:`DetailPanel`,props:{keyName:{},entry:{},issues:{},locales:{},sourceLocale:{},usageRevision:{}},emits:[`changed`],setup(e,{emit:t}){let n=e,r=t,i=e=>e?new Date(e).toLocaleString():`—`,a=K(()=>n.keyName?n.keyName.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\./g,`.<wbr>`):``),o=K(()=>{let e=``;for(let t of Object.values(n.entry?.values??{}))t.updatedAt&&t.updatedAt>e&&(e=t.updatedAt);return e||void 0}),s=K(()=>!!n.entry?.plural),c={placeholder:`Placeholder`,spelling:`Spelling`,length:`Length`,glossary:`Glossary`},l=K(()=>(n.issues??[]).filter(e=>e.check!==`untranslated`)),u={spelling:`spelling`,length:`max-length`},d=A(!1);async function f(e){let t=u[e.check];if(!(!t||!n.keyName||d.value)){d.value=!0;try{await Ef(n.keyName,t,e.locale),$.success(`Dismissed until the source text changes`),r(`changed`)}catch(e){$.error(e.message)}finally{d.value=!1}}}let p=K(()=>{let e=n.entry,t=n.sourceLocale;return!e||!t?[]:(n.locales??[]).filter(n=>eC(e,n,t))}),m=A(null),h=A(!1),g=A(!1);function _(){m.value?.click()}async function v(e){let t=e.target,i=t.files?.[0];if(t.value=``,!(!i||!n.keyName)){h.value=!0;try{await pf(n.keyName,i),$.success(`Screenshot uploaded`),r(`changed`)}catch(e){$.error(`Upload failed: ${e.message}`)}finally{h.value=!1}}}async function y(){if(n.keyName){g.value=!0;try{await mf(n.keyName),$.success(`Screenshot removed`),r(`changed`)}catch(e){$.error(`Could not remove: ${e.message}`)}finally{g.value=!1}}}let b=Zt({context:``,tags:``,maxLength:void 0}),x=A(!1),S=A(!1);async function C(){if(n.keyName){S.value=!0;try{let e=0,t=[];for await(let r of Jd({keyGlob:n.keyName,all:!0,force:!0}))r.type===`done`&&(e=r.written,t=r.errors);e>0?($.success(`Context suggested and saved — review it below`),r(`changed`)):t.length>0?$.error(t[0].error):$.info(`No usage found — add a code snippet or type context manually`)}catch(e){$.error(`Could not suggest: ${e.message}`)}finally{S.value=!1}}}N(()=>[n.keyName,n.entry],()=>{b.context=n.entry?.context??``,b.tags=(n.entry?.tags??[]).join(`, `),b.maxLength=n.entry?.maxLength},{immediate:!0});let w=A(null),T=A(6);async function ee(){let e=n.keyName;if(!e){w.value=null;return}try{w.value=await Zd(e)}catch{w.value=null}}N(()=>n.keyName,async()=>{w.value=null,T.value=6,await ee()},{immediate:!0}),N(()=>n.usageRevision,ee);let E=e=>Aw(e,w.value?.project??``),te=K(()=>(w.value?.refs??[]).map(e=>({...e,url:E(e)}))),ne=K(()=>(w.value?.prefixRefs??[]).map(e=>({...e,url:E(e)}))),re=K(()=>Mw(te.value.slice(0,T.value))),ie=e=>e.find(e=>e.url)?.url??null,ae=A(`count`),oe=A(!1);N(()=>[n.keyName,n.entry],()=>{ae.value=n.entry?.plural?.arg??`count`},{immediate:!0});async function se(){if(!n.keyName)return;let e=ae.value.trim()||`count`;oe.value=!0;try{await Ud(n.keyName,e),$.success(`Converted to plural`),r(`changed`)}catch(e){$.error(`Could not convert: ${e.message}`)}finally{oe.value=!1}}async function ce(){if(n.keyName){oe.value=!0;try{await Wd(n.keyName),$.success(`Converted to a single string`),r(`changed`)}catch(e){$.error(`Could not convert: ${e.message}`)}finally{oe.value=!1}}}async function D(){let e=ae.value.trim();if(!(!n.keyName||!e||e===n.entry?.plural?.arg))try{await Rd(n.keyName,{pluralArg:e}),$.success(`Renamed count variable`),r(`changed`)}catch(e){$.error(`Could not rename: ${e.message}`)}}async function le(){if(n.keyName){x.value=!0;try{await Rd(n.keyName,{metadata:{context:b.context.trim(),tags:b.tags.split(`,`).map(e=>e.trim()).filter(Boolean),maxLength:b.maxLength?Number(b.maxLength):null}}),$.success(`Metadata saved`),r(`changed`)}catch(e){$.error(`Could not save: ${e.message}`)}finally{x.value=!1}}}return(t,n)=>(R(),z(`aside`,Ww,[!e.keyName||!e.entry?(R(),z(`div`,Gw,[H(j(Uu),{class:`size-5`}),n[7]||=V(`p`,{class:`max-w-[200px] text-sm leading-relaxed`},`Select a key to view and edit its details.`,-1)])):(R(),z(`div`,Kw,[V(`div`,qw,[n[9]||=V(`span`,{class:`text-[10.5px] font-bold uppercase tracking-wide text-muted-foreground`},`Key`,-1),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,{class:`inline-block w-fit break-words cursor-pointer font-mono text-base font-semibold tracking-tight`,innerHTML:a.value,onClick:n[0]||=t=>j(tS)(e.keyName).then(()=>j($).success(`Copied`)).catch(()=>{})},null,8,Jw)]),_:1}),H(j(ZS),null,{default:M(()=>[...n[8]||=[U(`Click to copy`,-1)]]),_:1})]),_:1})]),V(`div`,Yw,[s.value?(R(),z(`span`,Xw,`PLURAL`)):(R(),z(`span`,Zw,`SINGLE`)),s.value?(R(),z(L,{key:2},[n[10]||=V(`span`,{class:`text-[11.5px] text-muted-foreground`},`arg`,-1),H(j(rS),{modelValue:ae.value,"onUpdate:modelValue":n[1]||=e=>ae.value=e,class:`h-7 w-24 font-mono text-xs`,"aria-label":`Number variable name`,onBlur:D,onKeydown:Xl(q(D,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),V(`button`,{type:`button`,class:`ml-auto rounded-md px-2 py-1 text-[12px] font-semibold text-primary transition-colors hover:bg-primary-soft disabled:opacity-50`,disabled:oe.value,onClick:ce},`Make single`,8,Qw)],64)):(R(),z(`button`,{key:3,type:`button`,class:`ml-auto rounded-md px-2 py-1 text-[12px] font-semibold text-primary transition-colors hover:bg-primary-soft disabled:opacity-50`,disabled:oe.value,onClick:se},`Make plural`,8,$w))]),l.value.length||p.value.length?(R(),z(`div`,{key:0,class:O(j(eS)(`flex flex-col gap-3 rounded-xl border border-border bg-background p-3`,l.value.length&&`border-primary-border`))},[l.value.length?(R(),z(`div`,eT,[V(`div`,tT,[H(j(Td),{class:`size-3.5`}),U(` `+k(l.value.length)+` issue`+k(l.value.length===1?``:`s`),1)]),(R(!0),z(L,null,F(l.value,(e,t)=>(R(),z(`div`,{key:t,class:`group flex items-center gap-2 text-[12.5px]`},[H(FC,{code:e.locale,size:14},null,8,[`code`]),V(`span`,nT,k(e.locale.toUpperCase()),1),V(`span`,rT,k(c[e.check]??e.check),1),u[e.check]?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`flex size-[20px] items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100`,disabled:d.value,"aria-label":`Dismiss until the source changes`,onClick:t=>f(e)},[H(j(Su),{class:`size-3`})],8,iT)]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[11]||=[U(`Dismiss until the source text changes`,-1)]]),_:1})]),_:2},1024)):W(``,!0)]))),128))])):W(``,!0),p.value.length?(R(),z(`div`,aT,[V(`div`,oT,[n[12]||=V(`span`,{class:`size-[7px] rounded-full bg-muted-foreground`},null,-1),U(` `+k(p.value.length)+` untranslated `,1)]),(R(!0),z(L,null,F(p.value,e=>(R(),z(`div`,{key:e,class:`flex items-center gap-2 text-[12.5px]`},[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,sT,k(e.toUpperCase()),1),n[13]||=V(`span`,{class:`ml-auto rounded border border-border-soft bg-accent px-1.5 py-0.5 text-[10.5px] font-semibold italic text-muted-foreground`},`Empty`,-1)]))),128))])):W(``,!0)],2)):W(``,!0),V(`div`,cT,[V(`div`,lT,[H(j(Fu),{class:`size-3.5 text-muted-foreground`}),n[14]||=V(`span`,{class:`text-[13px] font-semibold`},`Usage`,-1),w.value?.indexed?(R(),z(`span`,uT,k(w.value.count)+` reference`+k(w.value.count===1?``:`s`),1)):W(``,!0)]),!w.value||!w.value.indexed?(R(),z(`p`,dT,` Run a scan to find where this key is used in your code. `)):(R(),z(L,{key:1},[w.value.count===0&&ne.value.length===0?(R(),z(`p`,fT,` Not referenced in the last scan — this key may be unused. `)):W(``,!0),te.value.length?(R(),z(`div`,pT,[(R(!0),z(L,null,F(re.value,(e,t)=>(R(),z(L,{key:t},[e.kind===`dir`?(R(),z(`div`,{key:0,class:`flex items-center gap-1 text-muted-foreground`,style:ge({paddingLeft:`${e.depth*12}px`})},[H(j(Ku),{class:`size-3 shrink-0`}),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,mT,k(e.label),1)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.label),1)]),_:2},1024)]),_:2},1024)],4)):(R(),z(`div`,{key:1,class:`flex items-baseline gap-1.5`,style:ge({paddingLeft:`${e.depth*12+16}px`})},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[ie(e.refs)?(R(),z(`a`,{key:0,href:ie(e.refs),class:`min-w-0 shrink truncate rounded px-0.5 font-mono text-foreground hover:bg-accent hover:text-primary`},k(e.name),9,hT)):(R(),z(`span`,gT,k(e.name),1))]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(ie(e.refs)?`Open ${e.name}`:e.name),1)]),_:2},1024)]),_:2},1024),V(`span`,_T,[(R(!0),z(L,null,F(e.refs,(t,n)=>(R(),z(L,{key:n},[t.url?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`a`,{href:t.url,class:`shrink-0 rounded px-0.5 font-mono text-muted-foreground hover:bg-accent hover:text-primary`},`:`+k(t.line),9,vT)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(`Open `+k(e.name)+`:`+k(t.line),1)]),_:2},1024)]),_:2},1024)):(R(),z(`span`,yT,`:`+k(t.line),1))],64))),128))])],4))],64))),128)),w.value.count>T.value?(R(),z(`button`,{key:0,type:`button`,class:`mt-0.5 self-start text-[11.5px] text-primary hover:underline`,onClick:n[2]||=e=>T.value=w.value.count},` + `+k(w.value.count-T.value)+` more `,1)):W(``,!0)])):W(``,!0),ne.value.length?(R(),z(`div`,bT,[V(`p`,xT,[H(j(xu),{class:`size-3`}),n[15]||=U(` Possible usage (dynamic keys) `,-1)]),V(`ul`,ST,[(R(!0),z(L,null,F(ne.value,(e,t)=>(R(),z(`li`,{key:t,class:`text-[11.5px]`},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[(R(),B(aa(e.url?`a`:`div`),{href:e.url||void 0,class:O([`group flex items-baseline gap-2 text-muted-foreground`,e.url?`hover:text-primary`:``])},{default:M(()=>[V(`span`,CT,k(e.file),1),V(`span`,wT,k(e.prefix)+`*`,1),V(`span`,TT,`:`+k(e.line),1),e.url?(R(),B(j(zu),{key:0,class:`size-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`})):W(``,!0)]),_:2},1032,[`href`,`class`]))]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.url?`Open ${e.file}:${e.line}`:`${e.file}:${e.line}`),1)]),_:2},1024)]),_:2},1024)]))),128))])])):W(``,!0)],64))]),V(`div`,ET,[V(`div`,DT,[H(j(Xu),{class:`size-3.5 text-muted-foreground`}),n[17]||=V(`label`,{for:`detail-context`,class:`text-[13px] font-semibold`},`Context`,-1),e.entry.contextSource===`ai`?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,OT,[H(j(vd),{class:`size-2.5`}),n[16]||=U(` AI `,-1)])]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(e.entry.contextAt?`AI-generated ${i(e.entry.contextAt)}`:`AI-generated`),1)]),_:1})]),_:1})):W(``,!0),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,disabled:S.value,onClick:C},[H(j(vd),{class:`size-3`}),U(` `+k(S.value?`Suggesting…`:`Suggest`),1)],8,kT)]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(S.value?`Suggesting…`:`Suggest context with AI`),1)]),_:1})]),_:1})]),H(j(gC),{id:`detail-context`,modelValue:b.context,"onUpdate:modelValue":n[3]||=e=>b.context=e,rows:`5`,class:`min-h-28`,placeholder:`Where/how this string is used…`},null,8,[`modelValue`])]),V(`div`,AT,[V(`div`,jT,[H(j(Cd),{class:`size-3.5 text-muted-foreground`}),n[18]||=V(`label`,{for:`detail-tags`,class:`text-[13px] font-semibold`},`Tags`,-1)]),H(j(rS),{id:`detail-tags`,modelValue:b.tags,"onUpdate:modelValue":n[4]||=e=>b.tags=e,placeholder:`comma, separated`},null,8,[`modelValue`])]),V(`div`,MT,[V(`div`,NT,[H(j(ld),{class:`size-3.5 text-muted-foreground`}),n[19]||=V(`label`,{for:`detail-maxlen`,class:`text-[13px] font-semibold`},`Max length`,-1)]),H(j(rS),{id:`detail-maxlen`,modelValue:b.maxLength,"onUpdate:modelValue":n[5]||=e=>b.maxLength=e,modelModifiers:{number:!0},type:`number`,min:`0`,placeholder:`—`,class:`font-mono`},null,8,[`modelValue`])]),H(j(Q),{class:`w-full`,disabled:x.value,onClick:le},{default:M(()=>[...n[20]||=[U(`Save details`,-1)]]),_:1},8,[`disabled`]),n[26]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),e.keyName?(R(),B(Uw,{key:1,"key-name":e.keyName,notes:e.entry.notes??[],onChanged:n[6]||=e=>r(`changed`)},null,8,[`key-name`,`notes`])):W(``,!0),n[27]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),V(`div`,PT,[V(`div`,FT,[H(j(Yu),{class:`size-3.5 text-muted-foreground`}),n[21]||=V(`span`,{class:`text-[13px] font-semibold`},`Screenshot`,-1)]),V(`input`,{ref_key:`fileInput`,ref:m,type:`file`,accept:`image/*`,class:`hidden`,onChange:v},null,544),e.entry.screenshot?(R(),z(`div`,IT,[V(`img`,{src:`/`+e.entry.screenshot,alt:`Screenshot for ${e.keyName}`,class:`max-h-48 w-full rounded-lg border border-border object-contain`},null,8,LT),V(`div`,RT,[H(j(Q),{variant:`outline`,size:`sm`,disabled:h.value,onClick:_},{default:M(()=>[H(j(sd),{class:`size-4`}),n[22]||=U(` Replace `,-1)]),_:1},8,[`disabled`]),H(j(Q),{variant:`outline`,size:`sm`,class:`text-muted-foreground hover:text-destructive`,disabled:g.value,onClick:y},{default:M(()=>[H(j(wd),{class:`size-4`}),n[23]||=U(` Remove `,-1)]),_:1},8,[`disabled`])])])):(R(),z(`button`,{key:1,type:`button`,class:`flex w-full flex-col items-center gap-2 rounded-xl border-[1.5px] border-dashed border-input p-[22px] text-center text-[12.5px] font-medium text-muted-foreground transition-colors hover:border-primary-border hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60`,disabled:h.value,onClick:_},[H(j(Dd),{class:`size-5`}),U(` `+k(h.value?`Uploading…`:`Upload screenshot`),1)],8,zT))]),n[28]||=V(`div`,{class:`h-px bg-border-soft`},null,-1),V(`div`,BT,[V(`div`,VT,[n[24]||=V(`span`,null,`Created`,-1),V(`span`,HT,k(i(e.entry.createdAt)),1)]),V(`div`,UT,[n[25]||=V(`span`,null,`Last updated`,-1),V(`span`,WT,k(i(o.value)),1)])])]))]))}}),KT={class:`grid gap-3`},qT={class:`grid gap-1.5`},JT={class:`grid gap-1.5`},YT={class:`flex items-center justify-between gap-2 rounded-md border p-2.5`},XT={class:`flex flex-col`},ZT={key:0,class:`grid gap-1.5`},QT={key:1,class:`text-sm text-destructive`},$T=P({__name:`AddKeyDialog`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:ka([`created`],[`update:open`]),setup(e,{emit:t}){let n=Za(e,`open`),r=t,i=A(``),a=A(``),o=A(``),s=A(!1),c=A(!1),l=A(`count`);N(n,e=>{e&&(i.value=``,a.value=``,o.value=``,c.value=!1,l.value=`count`)});async function u(){let e=i.value.trim();if(!e){o.value=`Key is required.`;return}if(!a.value.trim()){o.value=`Source value is required.`;return}s.value=!0,o.value=``;try{c.value?await Md(e,a.value,{arg:l.value.trim()||`count`}):await Md(e,a.value),$.success(`Added ${e}`),n.value=!1,r(`created`,e)}catch(e){o.value=e.message}finally{s.value=!1}}return(e,t)=>(R(),B(j(bh),{open:n.value,"onUpdate:open":t[5]||=e=>n.value=e},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[6]||=[U(`Add key`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...t[7]||=[U(`Create a new translation key using dot notation.`,-1)]]),_:1})]),_:1}),V(`div`,KT,[V(`div`,qT,[H(j(IS),{for:`add-key`},{default:M(()=>[...t[8]||=[U(`Key `,-1),V(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),H(j(rS),{id:`add-key`,modelValue:i.value,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:`font-mono`,placeholder:`home.title`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),V(`div`,JT,[H(j(IS),{for:`add-value`},{default:M(()=>[U(k(c.value?`Source value (other form)`:`Source value`)+` `,1),t[9]||=V(`span`,{class:`text-destructive`},`*`,-1)]),_:1}),H(j(rS),{id:`add-value`,modelValue:a.value,"onUpdate:modelValue":t[1]||=e=>a.value=e,placeholder:c.value?`{count} items`:`Welcome home`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])]),V(`div`,YT,[V(`div`,XT,[H(j(IS),{for:`add-plural`,class:`cursor-pointer`},{default:M(()=>[...t[10]||=[U(`Plural`,-1)]]),_:1}),t[11]||=V(`span`,{class:`text-xs text-muted-foreground`},`One form per CLDR category, by locale.`,-1)]),H(j(pS),{id:`add-plural`,modelValue:c.value,"onUpdate:modelValue":t[2]||=e=>c.value=e},null,8,[`modelValue`])]),c.value?(R(),z(`div`,ZT,[H(j(IS),{for:`add-plural-arg`},{default:M(()=>[...t[12]||=[U(`Count argument`,-1)]]),_:1}),H(j(rS),{id:`add-plural-arg`,modelValue:l.value,"onUpdate:modelValue":t[3]||=e=>l.value=e,class:`font-mono`,placeholder:`count`,onKeydown:Xl(q(u,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])])):W(``,!0),o.value?(R(),z(`p`,QT,k(o.value),1)):W(``,!0)]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:s.value,onClick:t[4]||=e=>n.value=!1},{default:M(()=>[...t[13]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:s.value||!i.value.trim()||!a.value.trim(),onClick:u},{default:M(()=>[...t[14]||=[U(`Add key`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),eE={key:0,class:`flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-400`},tE={key:1,class:`text-sm text-destructive`},nE={key:2,class:`flex flex-1 items-center justify-center py-12 text-sm text-muted-foreground`},rE={key:0,class:`flex flex-col gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-400`},iE={class:`flex items-center gap-1.5 font-medium`},aE={class:`list-inside list-disc pl-1`},oE={class:`grid min-h-0 flex-1 grid-cols-[16rem_1fr] gap-3 overflow-hidden`},sE={class:`min-h-0 overflow-y-auto rounded-md border`},cE=[`onClick`],lE={key:0,class:`px-3 py-2 text-xs text-muted-foreground`},uE={key:0,class:`min-h-0 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs leading-relaxed [tab-size:2]`},dE={key:1,class:`flex min-h-0 items-center justify-center rounded-md border text-sm text-muted-foreground`},fE=P({__name:`ExportDialog`,props:ka({exportLocales:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:[`update:open`],setup(e){let t=Za(e,`open`),n=e,r=K(()=>(n.exportLocales?.length??0)>0),i=A(!1),a=A(!1),o=A(``),s=A([]),c=A([]),l=A(null),u=K(()=>s.value.find(e=>e.path===l.value)??null);async function d(){i.value=!0,o.value=``,s.value=[],c.value=[],l.value=null;try{let e=await yf();s.value=[...e.files].sort((e,t)=>e.path.localeCompare(t.path)),c.value=e.warnings,l.value=s.value[0]?.path??null}catch(e){o.value=e.message}finally{i.value=!1}}N(t,e=>{e&&d()},{immediate:!0});async function f(){a.value=!0;try{let e=await bf();$.success(`Wrote ${e.files} file${e.files===1?``:`s`}`),t.value=!1}catch(e){$.error(`Export failed: ${e.message}`)}finally{a.value=!1}}return(e,d)=>(R(),B(j(bh),{open:t.value,"onUpdate:open":d[1]||=e=>t.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] w-full max-w-5xl flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...d[2]||=[U(`Export preview`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[...d[3]||=[U(`Review the files that will be written to disk.`,-1)]]),_:1})]),_:1}),r.value?(R(),z(`p`,eE,[H(j(Td),{class:`size-3.5 shrink-0`}),U(` Export is limited to `+k(n.exportLocales.length)+` language`+k(n.exportLocales.length===1?``:`s`)+` (Settings → Export targets). `,1)])):W(``,!0),o.value?(R(),z(`p`,tE,k(o.value),1)):W(``,!0),i.value?(R(),z(`div`,nE,` Generating preview… `)):o.value?W(``,!0):(R(),z(L,{key:3},[c.value.length?(R(),z(`div`,rE,[V(`p`,iE,[H(j(Td),{class:`size-4`}),U(` `+k(c.value.length)+` warning`+k(c.value.length===1?``:`s`),1)]),V(`ul`,aE,[(R(!0),z(L,null,F(c.value,(e,t)=>(R(),z(`li`,{key:t},k(e),1))),128))])])):W(``,!0),V(`div`,oE,[V(`ul`,sE,[(R(!0),z(L,null,F(s.value,e=>(R(),z(`li`,{key:e.path},[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:O(j(eS)(`w-full truncate px-3 py-1.5 text-left font-mono text-xs transition-colors`,e.path===l.value?`bg-accent text-accent-foreground`:`hover:bg-muted/60`)),onClick:t=>l.value=e.path},k(e.path),11,cE)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.path),1)]),_:2},1024)]),_:2},1024)]))),128)),s.value.length===0?(R(),z(`li`,lE,` No files to write. `)):W(``,!0)]),u.value?(R(),z(`pre`,uE,k(u.value.contents),1)):(R(),z(`div`,dE,` Select a file to preview its contents. `))])],64)),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:a.value,onClick:d[0]||=e=>t.value=!1},{default:M(()=>[...d[4]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:i.value||a.value||s.value.length===0,onClick:f},{default:M(()=>[H(j(Hu),{class:`size-4`}),U(` `+k(a.value?`Writing…`:`Write ${s.value.length} file${s.value.length===1?``:`s`}`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),pE={class:`relative h-2 w-full overflow-hidden rounded-full bg-muted`},mE=P({__name:`Progress`,props:{modelValue:{}},setup(e){return(t,n)=>(R(),z(`div`,pE,[V(`div`,{class:`h-full bg-primary transition-all`,style:ge({width:`${Math.min(100,Math.max(0,e.modelValue??0))}%`})},null,4)]))}}),hE={key:0,class:`rounded-md border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`},gE={class:`font-medium text-foreground`},_E={key:0,class:`mt-0.5`},vE={key:1,class:`mt-1`},yE={class:`mt-1`},bE={key:1,class:`flex min-h-0 flex-col gap-1.5`},xE={class:`flex justify-between text-xs text-muted-foreground`},SE={key:0},CE={key:0,class:`mt-1 flex max-h-56 min-h-0 flex-col overflow-y-auto rounded-md border text-sm`},wE={key:2,class:`flex flex-col gap-1 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive`},TE={class:`flex items-center gap-1.5 font-medium`},EE={key:3,class:`flex min-h-0 flex-col gap-1.5`},DE={class:`flex items-center gap-1.5 text-sm font-medium text-amber-700 dark:text-amber-400`},OE={class:`min-h-0 flex-1 overflow-y-auto rounded-md border text-sm`},kE={class:`inline-flex items-center gap-1.5 font-mono text-xs`},AE={class:`text-muted-foreground`},jE=P({__name:`TranslateDialog`,props:ka({state:{},filteredKeys:{},targetLocale:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`changed`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=A(!1),o=A(``),s=A([]),c=A(0),l=A(0),u=null,d=A([]),f=e=>d.value.find(t=>t.locale===e),p=K(()=>d.value.filter(e=>e.status===`active`).length),m={active:0,queued:1,done:2},h=K(()=>[...d.value].sort((e,t)=>m[e.status]-m[t.status])),g=e=>e===`active`?$u:e===`done`?Du:Nu,_=K(()=>{let e=n.state;return e?n.targetLocale?[n.targetLocale]:e.config.locales.filter(t=>t!==e.config.sourceLocale):[]}),v=K(()=>{let e=n.state;if(!e)return 0;let t=n.filteredKeys?new Set(n.filteredKeys):null,r=0;for(let[n,i]of Object.entries(e.keys))if(!(t&&!t.has(n))&&!i.skipTranslate)for(let t of _.value)eC(i,t,e.config.sourceLocale)&&r++;return r}),y=A(null),b=K(()=>y.value??v.value),x=A(null),S=e=>e>=1e4?`${Math.round(e/1e3)}k`:e.toLocaleString(),C=e=>e>=.1?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`;async function w(){x.value=null;try{x.value=await Kd({keys:n.filteredKeys?.length?n.filteredKeys:void 0,locales:n.targetLocale?[n.targetLocale]:void 0})}catch{}}N(r,e=>{e&&(o.value=``,s.value=[],c.value=0,l.value=0,d.value=[],y.value=null,w())},{immediate:!0});function T(){u?.abort()}async function ee(){u=new AbortController,a.value=!0,o.value=``,s.value=[],c.value=0,d.value=[],y.value=v.value,l.value=y.value;try{let e=u.signal,t=0,a=n.filteredKeys?.length?n.filteredKeys:void 0,o=n.targetLocale?[n.targetLocale]:void 0,p=o?[e,a,o]:a?[e,a]:[e];for await(let e of qd(...p))if(e.type===`start`)l.value=e.total,d.value=e.locales.map(e=>({locale:e.locale,total:e.total,done:0,status:`queued`}));else if(e.type===`locale-start`){let t=f(e.locale);t&&(t.status=`active`)}else if(e.type===`progress`){c.value=e.done,l.value=e.total;let t=f(e.locale);t&&(t.done=e.localeDone,t.status===`queued`&&(t.status=`active`)),i(`changed`)}else if(e.type===`locale-done`){let t=f(e.locale);t&&(t.status=`done`,t.done=t.total)}else e.type===`done`&&(t=e.written,s.value=e.errors,c.value=l.value,i(`changed`));e.aborted||($.success(`Translated ${t} string${t===1?``:`s`}`),s.value.length===0&&(r.value=!1))}catch(e){e.name!==`AbortError`&&(o.value=e.message)}finally{a.value=!1,u=null}}return(e,t)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":t[1]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] max-w-lg flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[2]||=[U(`Translate missing strings`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[b.value===0?(R(),z(L,{key:0},[U(`Nothing missing — all translations are filled.`)],64)):(R(),z(L,{key:1},[U(` Translate `+k(b.value.toLocaleString())+` missing string`+k(b.value===1?``:`s`)+` across `+k(_.value.length)+` language`+k(_.value.length===1?``:`s`)+` with Claude? This sends source strings + context to the AI provider. `,1)],64))]),_:1})]),_:1}),x.value&&x.value.requests>0&&b.value>0&&!a.value&&c.value===0?(R(),z(`div`,hE,[V(`p`,null,[U(` ≈ `+k(x.value.requests.toLocaleString())+` requests · `+k(x.value.batches.toLocaleString())+` batch`+k(x.value.batches===1?``:`es`)+` · ~`+k(S(x.value.inputTokens))+` in / ~`+k(S(x.value.outputTokens))+` out tokens`,1),x.value.estimatedCost===null?W(``,!0):(R(),z(L,{key:0},[t[3]||=U(` · `,-1),V(`span`,gE,`≈ `+k(C(x.value.estimatedCost)),1),t[4]||=U(` (±20%)`,-1)],64))]),x.value.pricing?W(``,!0):(R(),z(`p`,_E,` No pricing known for this model — set a price in Settings → AI for a dollar estimate. `)),x.value.perLocale.length>1?(R(),z(`details`,vE,[t[5]||=V(`summary`,{class:`cursor-pointer select-none`},`Per-language breakdown`,-1),V(`ul`,yE,[(R(!0),z(L,null,F(x.value.perLocale,e=>(R(),z(`li`,{key:e.locale,class:`flex justify-between font-mono tabular-nums`},[V(`span`,null,k(e.locale),1),V(`span`,null,k(e.requests.toLocaleString())+` req · ~`+k(S(e.inputTokens))+` / ~`+k(S(e.outputTokens)),1)]))),128))])])):W(``,!0)])):W(``,!0),a.value||c.value>0?(R(),z(`div`,bE,[V(`div`,xE,[V(`span`,null,k(c.value.toLocaleString())+` / `+k(l.value.toLocaleString())+` translated`,1),a.value&&d.value.length?(R(),z(`span`,SE,k(p.value)+` of `+k(d.value.length)+` language`+k(d.value.length===1?``:`s`)+` active`,1)):W(``,!0)]),H(j(mE),{"model-value":l.value>0?c.value/l.value*100:0},null,8,[`model-value`]),d.value.length?(R(),z(`ul`,CE,[(R(!0),z(L,null,F(h.value,e=>(R(),z(`li`,{key:e.locale,class:O([`flex items-center gap-2 border-b px-3 py-1.5 last:border-b-0`,e.status===`queued`&&`opacity-55`])},[(R(),B(aa(g(e.status)),{class:O([`size-3.5 shrink-0`,e.status===`active`?`animate-spin text-primary`:e.status===`done`?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`])},null,8,[`class`])),H(UC,{code:e.locale,size:14,"show-name":``},null,8,[`code`]),V(`span`,{class:O([`ml-auto font-mono text-xs tabular-nums`,e.status===`active`?`text-foreground`:`text-muted-foreground`])},k(e.done.toLocaleString())+` / `+k(e.total.toLocaleString()),3)],2))),128))])):W(``,!0)])):W(``,!0),o.value?(R(),z(`div`,wE,[V(`p`,TE,[H(j(Td),{class:`size-4`}),t[6]||=U(` Translation failed `,-1)]),V(`p`,null,k(o.value),1)])):W(``,!0),s.value.length?(R(),z(`div`,EE,[V(`p`,DE,[H(j(Td),{class:`size-4`}),U(` `+k(s.value.length)+` string`+k(s.value.length===1?``:`s`)+` could not be translated `,1)]),V(`ul`,OE,[(R(!0),z(L,null,F(s.value,(e,t)=>(R(),z(`li`,{key:`${e.key}-${e.locale}-${t}`,class:`border-b px-3 py-1.5 last:border-b-0`},[V(`span`,kE,[U(k(e.key)+` @ `,1),H(UC,{code:e.locale,size:12},null,8,[`code`])]),V(`span`,AE,` — `+k(e.error),1)]))),128))])])):W(``,!0),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,onClick:t[0]||=e=>a.value?T():r.value=!1},{default:M(()=>[U(k(a.value?`Cancel`:`Close`),1)]),_:1}),b.value>0?(R(),B(j(Q),{key:0,disabled:a.value,onClick:ee},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` `+k(a.value?`Translating…`:`Translate`),1)]),_:1},8,[`disabled`])):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),ME={key:0,class:`flex flex-col gap-1.5`},NE={class:`flex justify-between text-xs text-muted-foreground`},PE={key:1,class:`flex flex-col gap-1 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive`},FE={class:`flex items-center gap-1.5 font-medium`},IE={key:2,class:`flex min-h-0 flex-col gap-1.5`},LE={class:`flex items-center gap-1.5 text-sm font-medium text-amber-700 dark:text-amber-400`},RE={class:`min-h-0 flex-1 overflow-y-auto rounded-md border text-sm`},zE={class:`font-mono text-xs`},BE={class:`text-muted-foreground`},VE=P({__name:`ContextDialog`,props:ka({state:{},keys:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`changed`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=A(!1),o=A(null),s=A(``),c=A([]),l=A(0),u=A(0),d=K(()=>{let e=n.state;return e?n.keys.filter(t=>e.keys[t]&&!e.keys[t].context).length:0});N(r,e=>{e?(s.value=``,c.value=[],l.value=0,u.value=0):o.value?.abort()});function f(){o.value?.abort()}async function p(){a.value=!0,s.value=``,c.value=[],l.value=0,u.value=0,o.value=new AbortController;let e=!1;try{for await(let t of Jd({keys:n.keys},o.value.signal))t.type===`start`?u.value=t.total:t.type===`progress`?(l.value=t.done,u.value=t.total):t.type===`done`&&(e=!0,l.value=u.value,c.value=t.errors,i(`changed`),$.success(`Built context for ${t.written} key${t.written===1?``:`s`}`),t.errors.length===0&&(r.value=!1))}catch(e){s.value=e.message}finally{!e&&o.value?.signal.aborted&&(i(`changed`),$(`Build cancelled after ${l.value} of ${u.value} keys`)),o.value=null,a.value=!1}}return(e,t)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":t[1]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`flex max-h-[85vh] max-w-lg flex-col`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...t[2]||=[U(`Build context`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[d.value===0?(R(),z(L,{key:0},[U(` All selected keys already have context — nothing to build. `)],64)):(R(),z(L,{key:1},[U(` Build AI context notes for `+k(d.value)+` selected key`+k(d.value===1?``:`s`)+` that currently have none? The AI will scan call-site code snippets to write a short translator hint for each key. `,1)],64))]),_:1})]),_:1}),a.value||l.value>0?(R(),z(`div`,ME,[V(`div`,NE,[V(`span`,null,k(l.value.toLocaleString())+` / `+k(u.value.toLocaleString())+` built`,1)]),H(j(mE),{"model-value":u.value>0?l.value/u.value*100:0},null,8,[`model-value`])])):W(``,!0),s.value?(R(),z(`div`,PE,[V(`p`,FE,[H(j(Td),{class:`size-4`}),t[3]||=U(` Build failed `,-1)]),V(`p`,null,k(s.value),1)])):W(``,!0),c.value.length?(R(),z(`div`,IE,[V(`p`,LE,[H(j(Td),{class:`size-4`}),U(` `+k(c.value.length)+` key`+k(c.value.length===1?``:`s`)+` could not be processed `,1)]),V(`ul`,RE,[(R(!0),z(L,null,F(c.value,(e,t)=>(R(),z(`li`,{key:`${e.key}-${t}`,class:`border-b px-3 py-1.5 last:border-b-0`},[V(`span`,zE,k(e.key),1),V(`span`,BE,` — `+k(e.error),1)]))),128))])])):W(``,!0),H(j(zS),null,{default:M(()=>[a.value?(R(),B(j(Q),{key:0,variant:`outline`,onClick:f},{default:M(()=>[...t[4]||=[U(`Cancel`,-1)]]),_:1})):(R(),B(j(Q),{key:1,variant:`outline`,onClick:t[0]||=e=>r.value=!1},{default:M(()=>[...t[5]||=[U(`Close`,-1)]]),_:1})),d.value>0?(R(),B(j(Q),{key:2,disabled:a.value,onClick:p},{default:M(()=>[H(j(vd),{class:`size-4`}),U(` `+k(a.value?`Building…`:`Build context`),1)]),_:1},8,[`disabled`])):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),HE={class:`relative w-0 shrink-0`},UE=[`aria-valuenow`,`aria-valuemin`,`aria-valuemax`],WE=P({__name:`ResizeHandle`,props:{side:{},width:{},min:{},max:{}},emits:[`update:width`,`commit`,`reset`],setup(e,{emit:t}){let n=e,r=t,i=A(!1);function a(e){if(e.button!==0)return;let t=e.currentTarget,a=e.clientX,o=n.width,s=n.side===`right`?1:-1;i.value=!0,t.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let c=e=>Math.min(n.max,Math.max(n.min,Math.round(e))),l=e=>{r(`update:width`,c(o+s*(e.clientX-a)))},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),document.body.style.cursor=``,document.body.style.userSelect=``,i.value=!1,r(`commit`)};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u)}return(t,n)=>(R(),z(`div`,HE,[V(`div`,{class:O(j(eS)(`absolute inset-y-0 -left-1 z-10 w-2 cursor-col-resize transition-colors hover:bg-primary/20`,i.value&&`bg-primary/30`)),role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":e.width,"aria-valuemin":e.min,"aria-valuemax":e.max,"aria-label":`Resize panel (double-click to reset)`,onPointerdown:a,onDblclick:n[0]||=e=>r(`reset`)},null,42,UE)]))}});function GE(e,t,n,r){let i=`glotfile-${e}`,a=e=>Math.min(r,Math.max(n,Math.round(e))),o=A((()=>{let e=Number(localStorage.getItem(i));return Number.isFinite(e)&&e>0?a(e):t})()),s=()=>{localStorage.setItem(i,String(o.value)),tf({[e]:o.value}).catch(()=>{})};return{width:o,min:n,max:r,set:e=>{o.value=a(e)},commit:s,reset:()=>{o.value=t,s()},syncValue:e=>{typeof e==`number`&&Number.isFinite(e)&&(o.value=a(e),localStorage.setItem(i,String(o.value)))}}}var KE=GE(`keyColumnWidth`,272,180,560),qE=GE(`detailPanelWidth`,420,320,720);async function JE(e){try{let t=e??await ef();KE.syncValue(t.keyColumnWidth),qE.syncValue(t.detailPanelWidth)}catch{}}var YE={class:`flex min-h-0 flex-1 flex-col`},XE={class:`flex shrink-0 flex-wrap items-center gap-2 border-b px-4 py-2`},ZE={class:`relative`},QE={key:0,class:`rounded bg-primary px-1.5 text-xs text-primary-foreground`},$E=[`aria-label`],eD={key:0},tD={class:`ml-auto flex items-center gap-2`},nD={class:`mr-1 text-xs text-muted-foreground tabular-nums`},rD={key:2},iD={key:3},aD={key:4},oD={key:0,class:`flex shrink-0 flex-wrap items-center gap-1.5 border-b px-4 py-1.5`},sD=[`aria-label`,`onClick`],cD=[`aria-label`,`onClick`],lD=[`aria-label`,`onClick`],uD={key:1,class:`sticky top-0 z-20 flex h-11 shrink-0 items-center gap-2 border-b bg-background pl-[18px] pr-4`},dD=[`aria-checked`,`aria-label`],fD={class:`text-sm font-medium tabular-nums`},pD={class:`text-sm text-muted-foreground`},mD={key:1,for:`select-all-checkbox`,class:`cursor-pointer select-none text-sm text-muted-foreground`},hD={class:`relative min-w-0 flex-1 overflow-hidden`},gD={key:0,class:`flex h-full items-center justify-center gap-2 p-8 text-sm text-muted-foreground`},_D={key:1,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},vD=[`data-index`],yD=`glotfile:enabledChecks`,bD=P({__name:`EditorView`,setup(e){let t=KE.width,n=qE.width,r=fn(null),{filter:i,sort:a,view:o,locale:s}=mp(Cp()),c=A(i),l=XS();function u(){try{let e=localStorage.getItem(yD);if(e){let t=JSON.parse(e);return rp.filter(e=>t.includes(e))}}catch{}return[...ip]}let d=A(u()),f=A(new Map),p=A(null),m=A(!1),h=A(0);async function g(){try{let e=await Qd();m.value=e.indexed,p.value=e.indexed?new Set(e.used):null}catch{m.value=!1,p.value=null}h.value++}let _=A(!1),v=0;async function y(){if(d.value.length===0){f.value=new Map,_.value=!1;return}try{let e=await wf(d.value);f.value=up(e.issues),_.value=e.spellPending,e.spellPending&&v<6?(v++,setTimeout(y,800)):v=0}catch{f.value=new Map}}N(d,e=>{localStorage.setItem(yD,JSON.stringify(e)),v=0,y()},{deep:!0});let b=A(a),x=A(o),S=A(s),C=null;N([b,x,S,()=>({...c.value,text:void 0})],()=>{wp(hp({filter:c.value,sort:b.value,view:x.value,locale:S.value}))},{deep:!0}),N(()=>c.value.text,()=>{C&&clearTimeout(C),C=setTimeout(()=>{wp(hp({filter:c.value,sort:b.value,view:x.value,locale:S.value}))},300)});let w=K(()=>c.value.states.length+c.value.issues.length+c.value.plurality.length+ +!!c.value.emptySource+ +!!c.value.aiContextUnreviewed+ +!!c.value.noUsages+ +!!c.value.skipTranslate),T=K(()=>{let e=0;for(let t of f.value.values())e+=t.length;return e});function ee(e){c.value.states=c.value.states.filter(t=>t!==e)}function E(e){c.value.issues=c.value.issues.filter(t=>t!==e)}function te(e){c.value.plurality=c.value.plurality.filter(t=>t!==e)}if(Tp.value){let e=Tp.value;if(c.value={text:``,states:[],issues:[],plurality:[],tag:``,needsAttention:!1,emptySource:!1,aiContextUnreviewed:!1,noUsages:!1,skipTranslate:!1,...e},e.issues?.length){let t=new Set([...d.value,...e.issues]);d.value=rp.filter(e=>t.has(e))}e.locale&&(x.value=`bilingual`,S.value=e.locale),Tp.value=null}let ne=A(null);Dp.value&&=(ne.value=Dp.value,null);let re=A(!1),ie=A(!1),ae=A(!1),oe=A(!1),se=A(!1),ce=A(null),D=A(null),le=A(!0),ue=A(!1);async function de(){r.value=await jd(),y()}let fe=setTimeout(()=>{le.value&&(ue.value=!0)},250);de().finally(()=>{le.value=!1,ue.value=!1,clearTimeout(fe)});let pe=K(()=>r.value?.config.sourceLocale??``),me=K(()=>r.value?.config.locales??[]),he=K(()=>me.value.filter(e=>e!==pe.value));N(he,e=>{!S.value&&e.length>0&&(S.value=e[0])},{immediate:!0});let _e=K(()=>{if(x.value===`bilingual`)return S.value?[pe.value,S.value]:[pe.value];let e=me.value.filter(e=>e!==pe.value);return[pe.value,...e]}),ve=K(()=>{let e=r.value;if(!e)return[];let t=x.value===`bilingual`&&S.value?S.value:void 0;return np(e,{...c.value,locale:t},f.value,p.value??void 0)}),ye=K(()=>{let e=r.value,t=ve.value;if(b.value===`key-desc`)return[...t].reverse();if(b.value===`created`){let n=t=>{let n=e?.keys[t]?.createdAt;return n?Date.parse(n):0};return[...t].sort((e,t)=>n(t)-n(e))}if(b.value===`updated`){let n=t=>{let n=Object.values(e?.keys[t]?.values??{}),r=0;for(let e of n){let t=e.updatedAt?Date.parse(e.updatedAt):0;t>r&&(r=t)}return r};return[...t].sort((e,t)=>n(t)-n(e))}return t}),be=K(()=>x.value===`bilingual`?S.value?[S.value]:[]:he.value),xe=K(()=>x.value===`bilingual`?S.value||`—`:`all ${he.value.length} targets`),Se=K(()=>l.keys()),Ce=K(()=>l.count.value),we=K(()=>l.allSelected(ye.value)),Te=K(()=>l.someSelected(ye.value)),Ee=K(()=>{let e=r.value;if(!e)return[];let t=new Set;for(let n of l.keys())for(let r of e.keys[n]?.tags??[])t.add(r);return[...t].sort()});function De(){l.allSelected(ye.value)?l.clear():l.selectAll(ye.value)}function Oe(e,t){t?l.toggleRange(e,ye.value):l.toggle(e)}N(ye,e=>l.pruneTo(e));let ke=K(()=>r.value&&ne.value?r.value.keys[ne.value]??null:null),Ae=Qf(K(()=>({count:ye.value.length,getScrollElement:()=>D.value,estimateSize:()=>56,overscan:8,getItemKey:e=>ye.value[e]??e}))),je=K(()=>Ae.value.getVirtualItems()),Me=K(()=>Ae.value.getTotalSize());function Ne(e){ne.value=e}let Pe=A(null);function Fe(){let e=Pe.value?.$el;e?.focus?.(),e?.select?.()}function Ie(e){let t=e.target,n=!!(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)),r=!!document.querySelector(`[role="listbox"],[role="menu"],[role="dialog"]`);if(e.key===`/`&&!n&&!r&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault(),Fe();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`||n||r)return;let i=ye.value;if(i.length===0)return;e.preventDefault();let a=ne.value?i.indexOf(ne.value):-1,o=Math.max(0,Math.min(i.length-1,e.key===`ArrowDown`?a+1:a-1)),s=i[o];s&&(ne.value=s,Ae.value.scrollToIndex(o,{align:`auto`}))}Ki(()=>window.addEventListener(`keydown`,Ie)),Xi(()=>{window.removeEventListener(`keydown`,Ie),C&&clearTimeout(C)}),Ki(async()=>{try{let e=await Xd();e.indexed&&!ce.value&&!se.value&&(ce.value=`${e.files.toLocaleString()} files · ${e.refs.toLocaleString()} refs`)}catch{}g()});async function Le(e,t){ne.value===e&&(ne.value=t),await de()}async function Re(e){await de(),ne.value=e,c.value.text=`"${e}"`}async function ze(){se.value=!0,ce.value=null;try{let e=await Yd();ce.value=`${e.files.toLocaleString()} files · ${e.refs.toLocaleString()} refs`,await g()}catch{ce.value=`Scan failed`}finally{se.value=!1}}return(e,i)=>(R(),B(j(vb),{"delay-duration":400},{default:M(()=>[V(`div`,YE,[V(`div`,XE,[V(`div`,ZE,[H(j(pd),{class:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),H(j(rS),{ref_key:`searchInput`,ref:Pe,modelValue:c.value.text,"onUpdate:modelValue":i[0]||=e=>c.value.text=e,placeholder:`Search keys, values, context…`,class:`h-8 w-64 pl-8 pr-8`,onKeydown:i[1]||=Xl(e=>c.value.text=``,[`esc`])},null,8,[`modelValue`]),c.value.text?(R(),z(`button`,{key:0,type:`button`,class:`absolute right-1.5 top-1/2 grid size-5 -translate-y-1/2 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,"aria-label":`Clear search`,onClick:i[2]||=e=>c.value.text=``},[H(j(kd),{class:`size-3.5`})])):W(``,!0)]),H(j(dy),null,{default:M(()=>[H(j(_y),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`outline`,size:`sm`,class:`h-8 gap-1.5`},{default:M(()=>[H(j(Qu),{class:`size-4 opacity-60`}),i[29]||=U(` Filter `,-1),w.value?(R(),z(`span`,QE,k(w.value),1)):W(``,!0)]),_:1})]),_:1}),H(j(uS),{align:`start`,class:`w-64`},{default:M(()=>[H(DS,{states:c.value.states,"onUpdate:states":i[3]||=e=>c.value.states=e,issues:c.value.issues,"onUpdate:issues":i[4]||=e=>c.value.issues=e,enabled:d.value,"onUpdate:enabled":i[5]||=e=>d.value=e,plurality:c.value.plurality,"onUpdate:plurality":i[6]||=e=>c.value.plurality=e,"empty-source":c.value.emptySource,"onUpdate:emptySource":i[7]||=e=>c.value.emptySource=e,"ai-context-unreviewed":c.value.aiContextUnreviewed,"onUpdate:aiContextUnreviewed":i[8]||=e=>c.value.aiContextUnreviewed=e,"no-usages":c.value.noUsages,"onUpdate:noUsages":i[9]||=e=>c.value.noUsages=e,"skip-translate":c.value.skipTranslate,"onUpdate:skipTranslate":i[10]||=e=>c.value.skipTranslate=e,"scan-indexed":m.value},null,8,[`states`,`issues`,`enabled`,`plurality`,`empty-source`,`ai-context-unreviewed`,`no-usages`,`skip-translate`,`scan-indexed`])]),_:1})]),_:1}),H(j(Q),{variant:c.value.needsAttention?`default`:`outline`,size:`sm`,class:`h-8 gap-1.5`,role:`switch`,"aria-checked":c.value.needsAttention,onClick:i[11]||=e=>c.value.needsAttention=!c.value.needsAttention},{default:M(()=>[H(j(Td),{class:O([`size-4`,c.value.needsAttention?``:`opacity-60`])},null,8,[`class`]),i[30]||=U(` Needs attention `,-1),T.value?(R(),z(`span`,{key:0,class:`ml-0.5 rounded-full bg-destructive-soft px-1.5 text-[11px] font-bold text-destructive tabular-nums`,"aria-label":`${T.value} issue${T.value===1?``:`s`}`},k(T.value.toLocaleString()),9,$E)):W(``,!0)]),_:1},8,[`variant`,`aria-checked`]),H(j(Iy),{modelValue:b.value,"onUpdate:modelValue":i[12]||=e=>b.value=e},{default:M(()=>[H(j(iS),{class:`h-8 w-[160px]`},{default:M(()=>[H(j(rb),{placeholder:`Sort`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`key-asc`},{default:M(()=>[...i[31]||=[U(`Key A→Z`,-1)]]),_:1}),H(j(sS),{value:`key-desc`},{default:M(()=>[...i[32]||=[U(`Key Z→A`,-1)]]),_:1}),H(j(sS),{value:`created`},{default:M(()=>[...i[33]||=[U(`Recently created`,-1)]]),_:1}),H(j(sS),{value:`updated`},{default:M(()=>[...i[34]||=[U(`Recently updated`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),H(j(db),{modelValue:x.value,"onUpdate:modelValue":i[13]||=e=>x.value=e},{default:M(()=>[H(j(cS),{class:`h-8`},{default:M(()=>[H(j(lS),{value:`bilingual`,class:`text-xs`},{default:M(()=>[...i[35]||=[U(`Bilingual`,-1)]]),_:1}),H(j(lS),{value:`multilingual`,class:`text-xs`},{default:M(()=>[...i[36]||=[U(`Multilingual`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),x.value===`bilingual`?(R(),B(j(Iy),{key:0,modelValue:S.value,"onUpdate:modelValue":i[14]||=e=>S.value=e},{default:M(()=>[H(j(iS),{class:`h-8 w-[150px]`},{default:M(()=>[S.value?(R(),z(`span`,eD,[H(UC,{code:S.value,"show-name":``,"show-code":!1,size:14},null,8,[`code`])])):(R(),B(j(rb),{key:1,placeholder:`Locale`}))]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(he.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[H(UC,{code:e,"show-name":``,"show-code":!1,size:14},null,8,[`code`])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])):W(``,!0),V(`div`,tD,[V(`span`,nD,k(ye.value.length.toLocaleString())+` keys`,1),H(j(Q),{size:`sm`,variant:`outline`,onClick:i[15]||=e=>ie.value=!0},{default:M(()=>[H(j(Hu),{class:`size-4`}),i[37]||=U(` Export `,-1)]),_:1}),H(j(Q),{size:`sm`,variant:`outline`,disabled:se.value,onClick:ze},{default:M(()=>[se.value?(R(),B(j($u),{key:0,class:`size-4 animate-spin`})):(R(),B(j(dd),{key:1,class:`size-4`})),se.value?(R(),z(`span`,rD,`Scanning…`)):ce.value?(R(),z(`span`,iD,k(ce.value),1)):(R(),z(`span`,aD,`Scan`))]),_:1},8,[`disabled`]),H(j(Q),{size:`sm`,onClick:i[16]||=e=>re.value=!0},{default:M(()=>[H(j(od),{class:`size-4`}),i[38]||=U(` Add key `,-1)]),_:1})])]),c.value.states.length||c.value.issues.length||c.value.plurality.length||c.value.emptySource||c.value.aiContextUnreviewed||c.value.noUsages||c.value.skipTranslate?(R(),z(`div`,oD,[(R(!0),z(L,null,F(c.value.states,e=>(R(),B(j(dS),{key:`s-${e}`,variant:`secondary`,class:`gap-1`},{default:M(()=>[U(k(j(cp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(cp)[e]} filter`,onClick:t=>ee(e)},[H(j(kd),{class:`size-3`})],8,sD)]),_:2},1024))),128)),(R(!0),z(L,null,F(c.value.plurality,e=>(R(),B(j(dS),{key:`p-${e}`,variant:`secondary`,class:`gap-1`},{default:M(()=>[U(k(j(lp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(lp)[e]} filter`,onClick:t=>te(e)},[H(j(kd),{class:`size-3`})],8,cD)]),_:2},1024))),128)),c.value.emptySource?(R(),B(j(dS),{key:0,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[39]||=U(` Empty source `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Empty source filter`,onClick:i[17]||=e=>c.value.emptySource=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),(R(!0),z(L,null,F(c.value.issues,e=>(R(),B(j(dS),{key:`i-${e}`,variant:`outline`,class:`gap-1`},{default:M(()=>[U(k(j(sp)[e])+` `,1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove ${j(sp)[e]} filter`,onClick:t=>E(e)},[H(j(kd),{class:`size-3`})],8,lD)]),_:2},1024))),128)),c.value.aiContextUnreviewed?(R(),B(j(dS),{key:1,variant:`secondary`,class:`gap-1`},{default:M(()=>[H(j(vd),{class:`size-3`}),i[40]||=U(` AI context (unreviewed) `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove AI context filter`,onClick:i[18]||=e=>c.value.aiContextUnreviewed=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),c.value.noUsages?(R(),B(j(dS),{key:2,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[41]||=U(` Unused `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Unused filter`,onClick:i[19]||=e=>c.value.noUsages=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0),c.value.skipTranslate?(R(),B(j(dS),{key:3,variant:`secondary`,class:`gap-1`},{default:M(()=>[i[42]||=U(` Skip-translate `,-1),V(`button`,{type:`button`,class:`hover:text-foreground`,"aria-label":`Remove Skip-translate filter`,onClick:i[20]||=e=>c.value.skipTranslate=!1},[H(j(kd),{class:`size-3`})])]),_:1})):W(``,!0)])):W(``,!0),ye.value.length?(R(),z(`div`,uD,[V(`button`,{id:`select-all-checkbox`,type:`button`,role:`checkbox`,"aria-checked":we.value?`true`:Te.value?`mixed`:`false`,"data-testid":`select-all`,class:O([`flex size-4 items-center justify-center rounded border transition-colors`,we.value||Te.value?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`]),"aria-label":we.value?`Deselect all`:`Select all`,onClick:De},[we.value?(R(),B(j(Du),{key:0,class:`size-3`})):Te.value?(R(),B(j(td),{key:1,class:`size-3`})):W(``,!0)],10,dD),Ce.value?(R(),z(L,{key:0},[V(`span`,fD,k(Ce.value.toLocaleString())+` selected`,1),V(`span`,pD,`· `+k(xe.value),1)],64)):(R(),z(`label`,mD,`Select all`)),Ce.value?(R(),B(YS,{key:2,class:`ml-auto`,keys:Se.value,locales:be.value,"scope-label":xe.value,"tags-on-selection":Ee.value,onChanged:de,onClear:i[21]||=e=>j(l).clear(),onTranslate:i[22]||=e=>ae.value=!0,onBuildContext:i[23]||=e=>oe.value=!0},null,8,[`keys`,`locales`,`scope-label`,`tags-on-selection`])):W(``,!0)])):W(``,!0),V(`div`,{class:`flex min-h-0 flex-1 overflow-hidden`,style:ge({"--key-col-width":`${j(t)}px`})},[V(`div`,hD,[V(`div`,{ref_key:`parent`,ref:D,class:`h-full overflow-auto`},[ue.value?(R(),z(`div`,gD,[H(j($u),{class:`size-4 animate-spin`}),i[43]||=U(` Loading… `,-1)])):!le.value&&ye.value.length===0?(R(),z(`div`,_D,` No keys match the current filter. `)):(R(),z(`div`,{key:2,style:ge({height:`${Me.value}px`,position:`relative`,width:`100%`})},[(R(!0),z(L,null,F(je.value,e=>(R(),z(`div`,{key:e.key,ref_for:!0,ref:e=>j(Ae).measureElement(e),"data-index":e.index,style:ge({position:`absolute`,top:`${e.start}px`,left:`0`,width:`100%`})},[r.value&&ye.value[e.index]?(R(),B(Cw,{key:0,"key-name":ye.value[e.index],entry:r.value.keys[ye.value[e.index]],"source-locale":pe.value,locales:_e.value,selected:ne.value===ye.value[e.index],issues:f.value.get(ye.value[e.index])??[],checked:j(l).has(ye.value[e.index]),onSelect:t=>Ne(ye.value[e.index]),onChanged:de,onRenamed:t=>Le(ye.value[e.index],t),onFilterTag:i[24]||=e=>c.value.text=e,onToggleSelect:t=>Oe(ye.value[e.index],t.shift)},null,8,[`key-name`,`entry`,`source-locale`,`locales`,`selected`,`issues`,`checked`,`onSelect`,`onRenamed`,`onToggleSelect`])):W(``,!0)],12,vD))),128))],4))],512),ye.value.length?(R(),z(`div`,{key:0,class:`absolute inset-y-0`,style:ge({left:`${j(t)}px`})},[H(WE,{side:`right`,class:`h-full`,width:j(t),min:j(KE).min,max:j(KE).max,"onUpdate:width":j(KE).set,onCommit:j(KE).commit,onReset:j(KE).reset},null,8,[`width`,`min`,`max`,`onUpdate:width`,`onCommit`,`onReset`])],4)):W(``,!0)]),H(WE,{side:`left`,class:`max-[1080px]:hidden`,width:j(n),min:j(qE).min,max:j(qE).max,"onUpdate:width":j(qE).set,onCommit:j(qE).commit,onReset:j(qE).reset},null,8,[`width`,`min`,`max`,`onUpdate:width`,`onCommit`,`onReset`]),H(GT,{"key-name":ne.value,entry:ke.value,issues:ne.value?f.value.get(ne.value)??[]:[],locales:me.value,"source-locale":pe.value,"usage-revision":h.value,style:ge({width:`${j(n)}px`}),onChanged:de},null,8,[`key-name`,`entry`,`issues`,`locales`,`source-locale`,`usage-revision`,`style`])],4),H($T,{open:re.value,"onUpdate:open":i[25]||=e=>re.value=e,onCreated:Re},null,8,[`open`]),H(fE,{open:ie.value,"onUpdate:open":i[26]||=e=>ie.value=e,"export-locales":r.value?.config.exportLocales??[]},null,8,[`open`,`export-locales`]),H(jE,{open:ae.value,"onUpdate:open":i[27]||=e=>ae.value=e,state:r.value,"filtered-keys":Se.value,"target-locale":x.value===`bilingual`?S.value:void 0,onChanged:de},null,8,[`open`,`state`,`filtered-keys`,`target-locale`]),H(VE,{open:oe.value,"onUpdate:open":i[28]||=e=>oe.value=e,state:r.value,keys:Se.value,onChanged:de},null,8,[`open`,`state`,`keys`])])]),_:1}))}}),xD={"empty-source":`Empty source`,"empty-translation":`Untranslated`,"placeholder-mismatch":`Placeholder mismatch`,"icu-mismatch":`ICU mismatch`,"glossary-violation":`Glossary`,"max-length":`Too long`,"identical-to-source":`Identical to source`,whitespace:`Whitespace`,spelling:`Spelling`,"output-stale":`Outputs out of date`},SD={"empty-translation":`untranslated`,"placeholder-mismatch":`placeholder`,"glossary-violation":`glossary`,"max-length":`length`,spelling:`spelling`};function CD(e){if(e.ruleId===`empty-translation`)return{text:e.key,states:[`missing`]};if(e.ruleId===`output-stale`)return{};let t=SD[e.ruleId],n=e.locale?{locale:e.locale}:{};return t?{...n,issues:[t]}:{...n,text:e.key}}function wD(e,t){let n=e.values[t];return n?e.plural?(n.forms?.other??``).trim()!==``:(n.value??``).trim()!==``:!1}function TD(e,t){if(!wD(e,t))return`missing`;let n=e.values[t].state;return n===`reviewed`?`reviewed`:n===`needs-review`?`needsReview`:`machine`}function ED(e,t){let n=e.values[t];return n?e.plural?n.forms?.other??``:n.value??``:``}function DD(e){let t=e.trim();return t===``?0:t.split(/\s+/).length}function OD(e,t){return`${e} ${t}${e===1?``:`s`}`}function kD(e,t){let{sourceLocale:n,locales:r}=e.config,i=r.filter(e=>e!==n),a=Object.keys(e.keys).filter(t=>!e.keys[t].skipTranslate),o=t.findings.filter(e=>e.locale===``),s=o.filter(e=>e.severity===`error`).length,c=new Map;for(let e of t.findings){if(e.locale===``)continue;let t=c.get(e.locale);t?t.push(e):c.set(e.locale,[e])}let l=i.map(t=>{let n={reviewed:0,needsReview:0,machine:0,missing:0},r=[];for(let i of a){let a=TD(e.keys[i],t);n[a]++,a===`needsReview`&&r.push(i)}let i=c.get(t)??[],o=[...new Set(i.filter(e=>e.ruleId===`empty-translation`).map(e=>e.key))],s=i.filter(e=>e.severity===`error`&&e.ruleId!==`empty-translation`),l=i.filter(e=>e.severity===`warn`),u=a.length,d=n.reviewed+n.needsReview+n.machine,f;f=o.length>0||s.length>0?`blocked`:r.length>0?`almost`:`ready`;let p=[];o.length&&p.push(`${o.length} missing`),s.length&&p.push(`${s.length} breaking`),r.length&&p.push(`${r.length} stale`);let m=[];return l.length&&m.push(OD(l.length,`warning`)),{locale:t,total:u,translated:d,pct:u?Math.round(d/u*100):0,counts:n,missingKeys:o,staleKeys:r,errors:s,warnings:l,breaking:s.length,warning:l.length,verdict:f,blockers:p,notes:m}}),u=a.length*i.length,d=0,f=0;for(let e of l)d+=e.translated,f+=e.counts.reviewed;let p=a.reduce((t,r)=>t+DD(ED(e.keys[r],n)),0),m={breaking:[],warning:[]};for(let e of t.findings)e.ruleId!==`empty-translation`&&m[e.severity===`error`?`breaking`:`warning`].push(e);return{totals:{keys:Object.keys(e.keys).length,locales:i.length,translatedPct:u?Math.round(d/u*1e3)/10:0,reviewedPct:u?Math.round(f/u*1e3)/10:0,sourceWords:p,openIssues:m.breaking.length+m.warning.length,ready:l.filter(e=>e.verdict===`ready`).length,almost:l.filter(e=>e.verdict===`almost`).length,blocked:l.filter(e=>e.verdict===`blocked`).length,breaking:m.breaking.length,missing:l.reduce((e,t)=>e+t.missingKeys.length,0),stale:l.reduce((e,t)=>e+t.staleKeys.length,0)},project:o,projectErrors:s,locales:l,risk:m,worklist:AD(l,m)}}function AD(e,t){let n=[];for(let e of t.breaking)n.push({id:`b:${e.locale}:${e.key}:${e.ruleId}`,priority:`breaking`,title:`Fix ${xD[e.ruleId].toLowerCase()}`,where:e.locale?`${e.locale.toUpperCase()} · ${e.key}`:e.key,detail:e.message,filter:e.ruleId===`output-stale`?void 0:CD(e),count:1});let r=new Map;for(let t of e)for(let e of t.missingKeys){let n=r.get(e);n?n.push(t.locale):r.set(e,[t.locale])}for(let[e,t]of r)n.push({id:`m:${e}`,priority:`missing`,title:`Translate ${OD(t.length,`missing string`)}`,where:e,detail:`Missing in ${t.map(e=>e.toUpperCase()).join(`, `)}`,filter:{text:e,states:[`missing`]},count:t.length});let i=[];for(let t of e)for(let e of t.staleKeys)i.push({locale:t.locale,key:e});i.length&&n.push({id:`s:all`,priority:`stale`,title:`Refresh ${OD(i.length,`stale translation`)}`,where:`source changed since translated`,detail:i.map(e=>`${e.locale.toUpperCase()} · ${e.key}`).join(` · `),filter:{states:[`needs-review`]},count:i.length});let a=new Map;for(let e of t.warning){let t=a.get(e.ruleId);t?t.push(e):a.set(e.ruleId,[e])}for(let[e,t]of a)n.push({id:`w:${e}`,priority:`warning`,title:`Review ${OD(t.length,`${xD[e].toLowerCase()} warning`)}`,where:[...new Set(t.map(e=>e.locale.toUpperCase()||e.key))].join(`, `),detail:t.map(e=>`${e.locale?e.locale.toUpperCase():`—`} · ${e.key}`).join(` · `),filter:CD(t[0]),count:t.length});return n}var jD={class:`min-h-0 flex-1 overflow-y-auto p-6`},MD={key:0,class:`mt-8 text-center text-sm text-muted-foreground`},ND={key:1,class:`mt-8 text-center text-sm text-muted-foreground`},PD={key:2,class:`mx-auto flex max-w-[1080px] flex-col gap-4`},FD={class:`flex flex-wrap divide-x rounded-xl border bg-card px-2 py-3 shadow-sm`},ID={class:`flex flex-col px-5`},LD={class:`text-lg font-semibold tabular-nums`},RD={class:`flex flex-col px-5`},zD={class:`text-lg font-semibold tabular-nums`},BD={class:`flex flex-col px-5`},VD={class:`text-lg font-semibold tabular-nums`},HD={class:`flex flex-col px-5`},UD={class:`text-lg font-semibold tabular-nums`},WD=[`disabled`],GD={class:`flex flex-col px-5`},KD={class:`text-lg font-semibold tabular-nums`},qD={class:`flex flex-wrap items-start justify-between gap-6`},JD={class:`min-w-0`},YD={class:`mt-1.5 flex items-center gap-2.5 text-2xl font-semibold tracking-tight`},XD={class:`mt-1.5 text-sm text-muted-foreground`},ZD={class:`text-emerald-600 dark:text-emerald-400`},QD={class:`text-amber-600 dark:text-amber-400`},$D={class:`text-red-600 dark:text-red-400`},eO={key:0,class:`mt-2 flex flex-col gap-1`},tO={class:`font-semibold`},nO={class:`font-mono text-muted-foreground`},rO={class:`text-muted-foreground`},iO={class:`flex gap-2`},aO={class:`text-[11px] uppercase tracking-wide text-muted-foreground`},oO={class:`mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t pt-3.5`},sO={class:`flex items-center gap-1 text-xs text-muted-foreground`},cO={class:`flex items-center gap-1 text-xs text-muted-foreground`},lO={class:`flex items-center gap-1 text-xs text-muted-foreground`},uO={class:`flex items-center gap-1 text-xs text-muted-foreground`},dO={class:`rounded-2xl border bg-card p-5 shadow-sm`},fO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},pO={key:1,class:`grid grid-cols-[repeat(auto-fill,minmax(218px,1fr))] gap-3`},mO=[`data-test`,`onClick`],hO={class:`flex items-start justify-between gap-2`},gO={class:`flex min-w-0 flex-col`},_O={class:`truncate font-mono text-xs font-semibold uppercase`},vO=[`title`],yO={class:`text-2xl font-semibold tabular-nums leading-none`},bO={class:`flex h-[7px] w-full overflow-hidden rounded-full bg-muted`},xO={class:`flex min-h-[20px] items-center gap-1.5 text-xs text-muted-foreground`},SO={class:`truncate`},CO={class:`rounded-2xl border bg-card p-5 shadow-sm`},wO={class:`mb-4`},TO={class:`mt-0.5 text-sm text-muted-foreground`},EO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},DO={key:1,class:`flex flex-col gap-2`},OO=[`disabled`,`onClick`],kO={class:`flex min-w-0 flex-col gap-0.5`},AO={class:`flex items-center gap-2 text-sm font-semibold`},jO={class:`truncate font-mono text-xs text-muted-foreground`},MO={key:0,class:`grid grid-cols-1 gap-4 lg:grid-cols-2`},NO={class:`rounded-2xl border bg-card p-5 shadow-sm`},PO={key:0,class:`flex items-center gap-3 rounded-xl bg-muted p-4`},FO={key:1,class:`flex flex-col gap-2.5`},IO=[`disabled`,`onClick`],LO={class:`flex flex-1 flex-col`},RO={class:`text-sm font-semibold`},zO={class:`text-xs text-muted-foreground`},BO={key:0,class:`border-t`},VO={class:`flex items-center justify-between gap-2 border-b bg-muted/40 px-3.5 py-1.5`},HO={class:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`},UO=[`disabled`,`title`,`onClick`],WO=[`onClick`,`onKeydown`],GO=[`title`],KO={class:`truncate font-medium`},qO={class:`font-mono text-muted-foreground`},JO={class:`truncate text-muted-foreground`},YO={class:`flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100`},XO=[`disabled`,`title`,`onClick`],ZO=[`disabled`,`onClick`],QO={key:2,class:`mt-3 overflow-hidden rounded-xl border`},$O={key:0,class:`border-t`},ek={class:`font-mono font-semibold uppercase`},tk={class:`truncate`},nk={class:`font-mono`},rk={class:`truncate`},ik=[`disabled`,`onClick`],ak={class:`rounded-2xl border bg-card p-5 shadow-sm`},ok=[`onClick`],sk={class:`flex min-w-0 items-center gap-2`},ck={class:`flex min-w-0 flex-col`},lk={class:`whitespace-nowrap font-mono uppercase leading-tight`},uk=[`title`],dk={class:`text-center font-mono tabular-nums`},fk={key:1,class:`rounded-2xl border bg-card p-5 shadow-sm`},pk={class:`flex items-center gap-3 rounded-xl bg-muted p-4`},mk=P({__name:`AnalyticsView`,setup(e){let t=A(null),n=A({findings:[],counts:{error:0,warn:0,suppressed:0},ok:!0}),r=A(!0),i=K(()=>({...n.value,findings:n.value.findings.filter(e=>!e.suppressed)})),a=K(()=>n.value.findings.filter(e=>e.suppressed)),o=K(()=>t.value?kD(t.value,i.value):null),s=K(()=>!!o.value&&(o.value.totals.keys===0||o.value.totals.locales===0)),c=K(()=>!!o.value&&o.value.totals.translatedPct===0);async function l(){let[e,r]=await Promise.all([jd(),Tf({includeSuppressed:!0}).catch(()=>null)]);t.value=e,r&&(n.value=r)}Ki(async()=>{try{await l()}catch(e){$.error(e.message)}finally{r.value=!1}});let u=A(!1),d=A(!1);function f(e){return e.ruleId===`spelling`?/"([^"]+)"/.exec(e.message)?.[1]:void 0}async function p(e,t){if(!d.value){d.value=!0;try{await t(),await l(),$.success(e)}catch(e){$.error(e.message)}finally{d.value=!1}}}let m=e=>p(`Dismissed until the source of ${e.key} changes`,()=>Ef(e.key,e.ruleId,e.locale)),h=e=>p(`Restored ${xD[e.ruleId].toLowerCase()} on ${e.key}`,()=>Df(e.key,e.ruleId,e.locale)),g=(e,t)=>p(`Dismissed ${t} warning${t===1?``:`s`}`,()=>Of({rules:[e]})),_=e=>{let t=f(e);t&&p(`Added "${t}" to the dictionary`,()=>lf(t))};function v(e){let t=new Map;for(let n of o.value.risk[e]){let e=t.get(n.ruleId);e?e.push(n):t.set(n.ruleId,[n])}return[...t.entries()].map(([e,t])=>({ruleId:e,findings:t}))}let y={ready:{label:`Ready`,icon:ju,text:`text-emerald-600 dark:text-emerald-400`,border:`border-l-emerald-500`,bar:`bg-emerald-500`,soft:`bg-emerald-500/10`},almost:{label:`Almost`,icon:Pu,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,bar:`bg-amber-500`,soft:`bg-amber-500/10`},blocked:{label:`Blocked`,icon:id,text:`text-red-600 dark:text-red-400`,border:`border-l-red-500`,bar:`bg-red-500`,soft:`bg-red-500/10`},none:{label:`Not started`,icon:gd,text:`text-muted-foreground`,border:`border-l-border`,bar:`bg-muted-foreground/40`,soft:`bg-muted`}},b={breaking:{label:`Breaking`,icon:id,text:`text-red-600 dark:text-red-400`,border:`border-l-red-500`,soft:`bg-red-500/10`},missing:{label:`Missing`,icon:Nu,text:`text-muted-foreground`,border:`border-l-muted-foreground/40`,soft:`bg-muted`},stale:{label:`Stale`,icon:Pu,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,soft:`bg-amber-500/10`},warning:{label:`Warning`,icon:Td,text:`text-amber-600 dark:text-amber-400`,border:`border-l-amber-500`,soft:`bg-amber-500/10`}},x=[{key:`breaking`,label:`Breaking`,blurb:"Lint errors — `glotfile check` fails on these. Ship-blocking.",text:`text-red-600 dark:text-red-400`,bar:`bg-red-500`},{key:`warning`,label:`Warning`,blurb:`Lint warnings — worth a look, won't block a release.`,text:`text-amber-600 dark:text-amber-400`,bar:`bg-amber-500`}],S=K(()=>{let e=o.value;return c.value?`none`:e.projectErrors>0?`blocked`:e.totals.ready===e.totals.locales&&e.totals.locales>0?`ready`:`blocked`}),C=K(()=>S.value===`none`?`Nothing to ship yet`:S.value===`ready`?`Ready to ship`:`Not ready to ship`);function w(e){return e.verdict===`ready`?e.notes.length?e.notes.join(` · `):`Clean — clears the gate`:e.blockers.join(` · `)}function T(e){return e.missingKeys.length?{locale:e.locale,states:[`missing`]}:e.errors.length?{locale:e.locale,...CD(e.errors[0])}:e.staleKeys.length?{locale:e.locale,states:[`needs-review`]}:{locale:e.locale}}function ee(e){return lC(e).name}function E(e,t){return(t?e/t*100:0)+`%`}function te(e){let t=[...new Set(o.value.risk[e].flatMap(e=>CD(e).issues??[]))];return t.length?{issues:t}:{needsAttention:!0}}return(e,t)=>(R(),z(`div`,jD,[r.value?(R(),z(`div`,MD,`Loading analytics…`)):s.value?(R(),z(`div`,ND,` No keys yet — add keys in the Editor to see analytics. `)):o.value?(R(),z(`div`,PD,[V(`section`,FD,[V(`div`,ID,[V(`span`,LD,k(o.value.totals.keys),1),t[2]||=V(`span`,{class:`text-xs text-muted-foreground`},`keys`,-1)]),V(`div`,RD,[V(`span`,zD,k(o.value.totals.locales),1),t[3]||=V(`span`,{class:`text-xs text-muted-foreground`},`locales`,-1)]),V(`div`,BD,[V(`span`,VD,k(o.value.totals.translatedPct)+`%`,1),t[4]||=V(`span`,{class:`text-xs text-muted-foreground`},`translated`,-1)]),V(`div`,HD,[V(`span`,UD,k(o.value.totals.reviewedPct)+`%`,1),t[5]||=V(`span`,{class:`text-xs text-muted-foreground`},`reviewed`,-1)]),V(`button`,{type:`button`,class:`group flex flex-col px-5 text-left`,"data-test":`open-issues`,disabled:!o.value.totals.openIssues,onClick:t[0]||=e=>j(Ep)({needsAttention:!0})},[V(`span`,{class:O([`text-lg font-semibold tabular-nums`,o.value.totals.breaking?`text-red-600 dark:text-red-400`:``])},k(o.value.totals.openIssues),3),t[6]||=V(`span`,{class:`text-xs text-muted-foreground group-hover:text-foreground`},`open issues`,-1)],8,WD),V(`div`,GD,[V(`span`,KD,k(o.value.totals.sourceWords),1),t[7]||=V(`span`,{class:`text-xs text-muted-foreground`},`source words`,-1)])]),V(`section`,{class:O([`rounded-2xl border border-l-4 bg-card p-6 shadow-sm`,y[S.value].border])},[V(`div`,qD,[V(`div`,JD,[t[12]||=V(`div`,{class:`font-mono text-[11px] uppercase tracking-wider text-muted-foreground`},`Can I ship?`,-1),V(`h1`,YD,[(R(),B(aa(y[S.value].icon),{class:O([`size-6`,y[S.value].text])},null,8,[`class`])),U(` `+k(C.value),1)]),V(`p`,XD,[c.value?(R(),z(L,{key:0},[U(`Add translations to get started — run a sync to let the AI fill them in.`)],64)):(R(),z(L,{key:1},[V(`strong`,ZD,k(o.value.totals.ready),1),U(` of `+k(o.value.totals.locales)+` locales ready`,1),o.value.totals.almost?(R(),z(L,{key:0},[t[8]||=U(` · `,-1),V(`strong`,QD,k(o.value.totals.almost),1),t[9]||=U(` need a refresh`,-1)],64)):W(``,!0),o.value.totals.blocked?(R(),z(L,{key:1},[t[10]||=U(` · `,-1),V(`strong`,$D,k(o.value.totals.blocked),1),t[11]||=U(` blocked`,-1)],64)):W(``,!0)],64))]),o.value.project.length?(R(),z(`ul`,eO,[(R(!0),z(L,null,F(o.value.project,e=>(R(),z(`li`,{key:`${e.ruleId}:${e.key}`,class:O([`flex items-center gap-1.5 text-xs`,e.severity===`error`?`text-red-600 dark:text-red-400`:`text-amber-600 dark:text-amber-400`])},[e.severity===`error`?(R(),B(j(id),{key:0,class:`size-3 shrink-0`})):(R(),B(j(Td),{key:1,class:`size-3 shrink-0`})),V(`span`,tO,k(j(xD)[e.ruleId]),1),V(`span`,nO,k(e.key),1),V(`span`,rO,k(e.message),1)],2))),128))])):W(``,!0)]),V(`div`,iO,[(R(!0),z(L,null,F([{n:o.value.totals.ready,label:`ready`,cls:`text-emerald-600 dark:text-emerald-400`},{n:o.value.totals.almost,label:`almost`,cls:`text-amber-600 dark:text-amber-400`},{n:o.value.totals.blocked,label:`blocked`,cls:`text-red-600 dark:text-red-400`}],e=>(R(),z(`div`,{key:e.label,class:`flex min-w-[66px] flex-col items-center rounded-xl border px-4 py-2`},[V(`span`,{class:O([`text-2xl font-semibold tabular-nums`,e.n?e.cls:`text-muted-foreground/50`])},k(e.n),3),V(`span`,aO,k(e.label),1)]))),128))])]),V(`div`,oO,[t[17]||=V(`span`,{class:`font-mono text-[10px] uppercase tracking-wider text-muted-foreground`},`Release gate`,-1),V(`span`,sO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[13]||=U(` 100% translated`,-1)]),V(`span`,cO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[14]||=U(` 0 lint errors`,-1)]),V(`span`,lO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[15]||=U(` outputs exported`,-1)]),V(`span`,uO,[H(j(Du),{class:`size-3 text-emerald-500`}),t[16]||=U(` nothing stale`,-1)]),t[18]||=V(`span`,{class:`ml-auto text-[11px] italic text-muted-foreground`},[U(`same rules as `),V(`code`,{class:`font-mono not-italic`},`glotfile check`),U(` · skip via `),V(`code`,{class:`font-mono not-italic`},`config.lint.rules`)],-1)])],2),V(`section`,dO,[t[21]||=V(`header`,{class:`mb-4`},[V(`h2`,{class:`text-base font-semibold`},`Release readiness`),V(`p`,{class:`mt-0.5 text-sm text-muted-foreground`},`Per-locale status against the release gate. Click any locale to drill in.`)],-1),c.value?(R(),z(`div`,fO,[H(j(Wu),{class:`size-5 text-muted-foreground`}),t[19]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No locale is ready yet.`),V(`span`,{class:`text-sm text-muted-foreground`},`Translate your strings, then locales appear here as they clear the gate.`)],-1)])):(R(),z(`div`,pO,[(R(!0),z(L,null,F(o.value.locales,e=>(R(),z(`button`,{key:e.locale,type:`button`,"data-test":`rcard-${e.locale}`,class:O([`flex flex-col gap-2 rounded-xl border border-l-[3px] p-3.5 text-left transition hover:-translate-y-0.5 hover:bg-muted/50`,y[e.verdict].border]),onClick:t=>j(Ep)(T(e))},[V(`div`,hO,[V(`span`,gO,[V(`span`,_O,k(e.locale),1),V(`span`,{class:`truncate text-[11px] text-muted-foreground`,title:ee(e.locale)},k(ee(e.locale)),9,vO)]),V(`span`,{class:O([`flex items-center gap-1 text-[11px] font-semibold`,y[e.verdict].text])},[(R(),B(aa(y[e.verdict].icon),{class:`size-3`})),U(k(y[e.verdict].label),1)],2)]),V(`div`,yO,[U(k(e.pct),1),t[20]||=V(`span`,{class:`ml-0.5 text-xs text-muted-foreground`},`%`,-1)]),V(`div`,bO,[V(`span`,{class:`h-full bg-emerald-500`,style:ge({width:E(e.counts.reviewed,e.total)})},null,4),V(`span`,{class:`h-full bg-amber-500`,style:ge({width:E(e.counts.needsReview,e.total)})},null,4),V(`span`,{class:`h-full bg-sky-500`,style:ge({width:E(e.counts.machine,e.total)})},null,4)]),V(`div`,xO,[e.verdict===`ready`?W(``,!0):(R(),B(aa(y[e.verdict].icon),{key:0,class:O([`size-3 shrink-0`,y[e.verdict].text])},null,8,[`class`])),V(`span`,SO,k(w(e)),1)])],10,mO))),128))]))]),V(`section`,CO,[V(`header`,wO,[t[22]||=V(`h2`,{class:`text-base font-semibold`},`Needs attention`,-1),V(`p`,TO,k(c.value?`Your prioritized worklist will fill in as the AI translates.`:`Prioritized — fix the top item first. Each opens the matching strings.`),1)]),o.value.worklist.length?(R(),z(`ol`,DO,[(R(!0),z(L,null,F(o.value.worklist,(e,t)=>(R(),z(`li`,{key:e.id},[V(`button`,{type:`button`,class:O([`grid w-full grid-cols-[30px_1fr_auto_16px] items-center gap-3 rounded-xl border border-l-[3px] px-3.5 py-3 text-left transition enabled:hover:bg-muted/50`,[b[e.priority].border,t===0?b[e.priority].soft:``]]),disabled:!e.filter,onClick:t=>e.filter&&j(Ep)(e.filter)},[V(`span`,{class:O([`flex size-[30px] items-center justify-center rounded-lg`,[b[e.priority].soft,b[e.priority].text]])},[(R(),B(aa(b[e.priority].icon),{class:`size-4`}))],2),V(`span`,kO,[V(`span`,AO,[U(k(e.title)+` `,1),t===0?(R(),z(`span`,{key:0,class:O([`rounded-full px-2 py-0.5 font-mono text-[9.5px] font-semibold uppercase tracking-wide text-white`,b[e.priority].text.includes(`red`)?`bg-red-500`:b[e.priority].text.includes(`amber`)?`bg-amber-500`:`bg-muted-foreground`])},`Start here`,2)):W(``,!0)]),V(`span`,jO,k(e.where),1)]),V(`span`,{class:O([`rounded-full px-2.5 py-1 text-[11px] font-semibold`,[b[e.priority].soft,b[e.priority].text]])},k(b[e.priority].label),3),H(j(ku),{class:`size-4 text-muted-foreground`})],10,OO)]))),128))])):(R(),z(`div`,EO,[H(j(ju),{class:`size-5 text-emerald-500`}),t[23]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`Nothing needs attention.`),V(`span`,{class:`text-sm text-muted-foreground`},`Every translated string clears its checks and is up to date.`)],-1)]))]),c.value?(R(),z(`section`,fk,[t[32]||=V(`h2`,{class:`mb-4 text-base font-semibold`},`Quality`,-1),V(`div`,pk,[H(j(Mu),{class:`size-5 text-muted-foreground`}),t[31]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No checks run yet.`),V(`span`,{class:`text-sm text-muted-foreground`},`Quality checks appear once strings are translated.`)],-1)])])):(R(),z(`div`,MO,[V(`section`,NO,[t[29]||=V(`header`,{class:`mb-4`},[V(`h2`,{class:`text-base font-semibold`},`Quality`),V(`p`,{class:`mt-0.5 text-sm text-muted-foreground`},`Grouped by risk — a broken placeholder is not a typo.`)],-1),o.value.totals.openIssues?(R(),z(`div`,FO,[(R(),z(L,null,F(x,e=>V(`div`,{key:e.key,class:`overflow-hidden rounded-xl border`},[V(`button`,{type:`button`,class:`flex w-full items-center gap-3 px-3.5 py-3 text-left enabled:hover:bg-muted/50`,disabled:!o.value.risk[e.key].length,onClick:t=>j(Ep)(te(e.key))},[V(`span`,{class:O([`w-1 self-stretch rounded-full`,e.bar])},null,2),V(`span`,{class:O([`min-w-[22px] text-xl font-semibold tabular-nums`,e.text])},k(o.value.risk[e.key].length),3),V(`span`,LO,[V(`span`,RO,k(e.label),1),V(`span`,zO,k(e.blurb),1)]),o.value.risk[e.key].length?(R(),B(j(ku),{key:0,class:`size-4 text-muted-foreground`})):W(``,!0)],8,IO),o.value.risk[e.key].length?(R(),z(`div`,BO,[(R(!0),z(L,null,F(v(e.key),n=>(R(),z(L,{key:n.ruleId},[V(`div`,VO,[V(`span`,HO,k(j(xD)[n.ruleId])+` · `+k(n.findings.length),1),e.key===`warning`?(R(),z(`button`,{key:0,type:`button`,class:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Hide all ${n.findings.length} until each key's source changes`,onClick:e=>g(n.ruleId,n.findings.length)},[H(j(Su),{class:`size-3`}),t[25]||=U(` Dismiss all `,-1)],8,UO)):W(``,!0)]),(R(!0),z(L,null,F(n.findings,(e,n)=>(R(),z(`div`,{key:n,role:`button`,tabindex:`0`,class:`group grid w-full cursor-pointer grid-cols-[42px_minmax(90px,1fr)_1.4fr_auto] items-center gap-2.5 border-b px-3.5 py-2.5 text-left text-xs last:border-b-0 hover:bg-muted/50`,onClick:t=>j(Ep)(j(CD)(e)),onKeydown:Xl(t=>j(Ep)(j(CD)(e)),[`enter`])},[V(`span`,{class:`font-mono font-semibold uppercase text-muted-foreground`,title:e.locale?ee(e.locale):`project-wide`},k(e.locale||`—`),9,GO),V(`span`,KO,[V(`span`,qO,k(e.key),1)]),V(`span`,JO,k(e.message),1),V(`span`,YO,[f(e)?(R(),z(`button`,{key:0,type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Never flag "${f(e)}" again`,onClick:q(t=>_(e),[`stop`])},[H(j(wu),{class:`size-3`}),t[26]||=U(` Add word `,-1)],8,XO)):W(``,!0),e.severity===`warn`?(R(),z(`button`,{key:1,type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,title:`Hide until this key's source changes`,onClick:q(t=>m(e),[`stop`])},[H(j(Su),{class:`size-3`}),t[27]||=U(` Dismiss `,-1)],8,ZO)):W(``,!0)])],40,WO))),128))],64))),128))])):W(``,!0)])),64))])):(R(),z(`div`,PO,[H(j(ju),{class:`size-5 text-emerald-500`}),t[24]||=V(`div`,{class:`flex flex-col`},[V(`b`,{class:`text-sm`},`No issues found.`),V(`span`,{class:`text-sm text-muted-foreground`},`All translated strings pass their checks.`)],-1)])),a.value.length?(R(),z(`div`,QO,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-xs text-muted-foreground hover:bg-muted/50`,onClick:t[1]||=e=>u.value=!u.value},[(R(),B(aa(u.value?j(Ou):j(ku)),{class:`size-3.5`})),H(j(Su),{class:`size-3.5`}),U(` Suppressed (`+k(a.value.length)+`) — hidden until each key's source changes `,1)]),u.value?(R(),z(`div`,$O,[(R(!0),z(L,null,F(a.value,(e,n)=>(R(),z(`div`,{key:n,class:`grid w-full grid-cols-[42px_minmax(90px,1fr)_1.4fr_auto] items-center gap-2.5 border-b px-3.5 py-2.5 text-left text-xs text-muted-foreground last:border-b-0`},[V(`span`,ek,k(e.locale||`—`),1),V(`span`,tk,[U(k(j(xD)[e.ruleId])+` · `,1),V(`span`,nk,k(e.key),1)]),V(`span`,rk,k(e.message),1),V(`button`,{type:`button`,class:`flex items-center gap-1 rounded border bg-background px-1.5 py-0.5 text-[11px] transition-colors hover:bg-accent hover:text-foreground`,disabled:d.value,onClick:t=>h(e)},[H(j(cd),{class:`size-3`}),t[28]||=U(` Restore `,-1)],8,ik)]))),128))])):W(``,!0)])):W(``,!0)]),V(`section`,ak,[t[30]||=vs(`<header class="mb-4"><h2 class="text-base font-semibold">By locale</h2><p class="mt-0.5 text-sm text-muted-foreground">Full breakdown.</p></header><div class="grid grid-cols-[minmax(96px,1.4fr)_52px_64px_50px_72px_72px_16px] gap-2 border-b pb-2 font-mono text-[11px] uppercase tracking-wide text-muted-foreground"><span>Locale</span><span class="text-center">Done</span><span class="text-center">Missing</span><span class="text-center">Stale</span><span class="text-center">Breaking</span><span class="text-center">Warnings</span><span></span></div>`,2),(R(!0),z(L,null,F(o.value.locales,e=>(R(),z(`button`,{key:e.locale,type:`button`,class:`grid w-full grid-cols-[minmax(96px,1.4fr)_52px_64px_50px_72px_72px_16px] items-center gap-2 border-b py-2.5 text-left text-sm last:border-b-0 hover:bg-muted/50`,onClick:t=>j(Ep)(T(e))},[V(`span`,sk,[V(`span`,{class:O([`size-2 shrink-0 rounded-full`,y[e.verdict].bar])},null,2),V(`span`,ck,[V(`span`,lk,k(e.locale),1),V(`span`,{class:`truncate text-xs leading-tight text-muted-foreground`,title:ee(e.locale)},k(ee(e.locale)),9,uk)])]),V(`span`,dk,k(e.pct)+`%`,1),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.missingKeys.length?``:`text-muted-foreground`])},k(e.missingKeys.length||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.staleKeys.length?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`])},k(e.staleKeys.length||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.breaking?`text-red-600 dark:text-red-400`:`text-muted-foreground`])},k(e.breaking||`—`),3),V(`span`,{class:O([`text-center font-mono tabular-nums`,e.warning?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`])},k(e.warning||`—`),3),H(j(ku),{class:`size-3.5 text-muted-foreground`})],8,ok))),128))])]))])):W(``,!0)]))}});function hk(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.term.toLowerCase().includes(n)||(e.notes??``).toLowerCase().includes(n)?!0:Object.entries(e.translations??{}).some(([e,t])=>e.toLowerCase().includes(n)||t.toLowerCase().includes(n)))}var gk={class:`grid gap-4`},_k={class:`grid gap-1.5`},vk={key:0,class:`text-xs text-muted-foreground`},yk={class:`flex items-center justify-between`},bk={class:`flex items-center justify-between`},xk={class:`grid gap-1.5`},Sk={key:0,class:`grid gap-2 border-t pt-3`},Ck={key:1,class:`text-sm text-destructive`},wk=P({__name:`GlossaryEntryDialog`,props:ka({entry:{},targetLocales:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:ka([`saved`],[`update:open`]),setup(e,{emit:t}){let n=e,r=Za(e,`open`),i=t,a=Zt({term:``,doNotTranslate:!1,caseSensitive:!1,notes:``,translations:{}}),o=A(!1),s=A(``),c=A(!1);N(r,e=>{if(!e)return;let t=n.entry;c.value=t!==null,a.term=t?.term??``,a.doNotTranslate=t?.doNotTranslate??!1,a.caseSensitive=t?.caseSensitive??!1,a.notes=t?.notes??``,a.translations={};for(let e of n.targetLocales)a.translations[e]=t?.translations?.[e]??``;s.value=``},{immediate:!0});async function l(){let e=a.term.trim();if(!e){s.value=`Term is required.`;return}let t={};for(let[e,n]of Object.entries(a.translations)){let r=n.trim();r&&(t[e]=r)}let n={term:e};a.doNotTranslate&&(n.doNotTranslate=!0),a.caseSensitive&&(n.caseSensitive=!0),a.notes.trim()&&(n.notes=a.notes.trim()),Object.keys(t).length>0&&(n.translations=t),o.value=!0,s.value=``;try{await df(n),$.success(c.value?`Updated ${e}`:`Added ${e}`),r.value=!1,i(`saved`)}catch(e){s.value=e.message}finally{o.value=!1}}return(t,n)=>(R(),B(j(bh),{open:r.value,"onUpdate:open":n[5]||=e=>r.value=e},{default:M(()=>[H(j(LS),{class:`max-h-[85vh] max-w-lg overflow-y-auto`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[U(k(c.value?`Edit term`:`Add term`),1)]),_:1}),H(j(VS),null,{default:M(()=>[...n[6]||=[U(` Guide AI translations with do-not-translate terms and forced translations. `,-1)]]),_:1})]),_:1}),V(`div`,gk,[V(`div`,_k,[H(j(IS),{for:`glossary-term`},{default:M(()=>[...n[7]||=[U(`Term`,-1)]]),_:1}),H(j(rS),{id:`glossary-term`,modelValue:a.term,"onUpdate:modelValue":n[0]||=e=>a.term=e,class:`font-mono`,placeholder:`Sign in`,disabled:c.value,onKeydown:Xl(q(l,[`prevent`]),[`enter`])},null,8,[`modelValue`,`disabled`,`onKeydown`]),c.value?(R(),z(`p`,vk,` The term is the entry's identity and can't be changed. `)):W(``,!0)]),V(`div`,yk,[V(`div`,null,[H(j(IS),{for:`glossary-dnt`},{default:M(()=>[...n[8]||=[U(`Do not translate`,-1)]]),_:1}),n[9]||=V(`p`,{class:`text-xs text-muted-foreground`},`Keep this term verbatim in every language.`,-1)]),H(j(pS),{id:`glossary-dnt`,modelValue:a.doNotTranslate,"onUpdate:modelValue":n[1]||=e=>a.doNotTranslate=e},null,8,[`modelValue`])]),V(`div`,bk,[V(`div`,null,[H(j(IS),{for:`glossary-cs`},{default:M(()=>[...n[10]||=[U(`Case sensitive`,-1)]]),_:1}),n[11]||=V(`p`,{class:`text-xs text-muted-foreground`},`Only match the exact casing.`,-1)]),H(j(pS),{id:`glossary-cs`,modelValue:a.caseSensitive,"onUpdate:modelValue":n[2]||=e=>a.caseSensitive=e},null,8,[`modelValue`])]),V(`div`,xk,[H(j(IS),{for:`glossary-notes`},{default:M(()=>[...n[12]||=[U(`Notes`,-1)]]),_:1}),H(j(gC),{id:`glossary-notes`,modelValue:a.notes,"onUpdate:modelValue":n[3]||=e=>a.notes=e,rows:`5`,class:`min-h-24 resize-y`,placeholder:`Optional guidance for translators.`},null,8,[`modelValue`])]),e.targetLocales.length>0?(R(),z(`div`,Sk,[n[13]||=V(`p`,{class:`text-sm font-medium`},`Forced translations`,-1),(R(!0),z(L,null,F(e.targetLocales,e=>(R(),z(`div`,{key:e,class:`grid gap-1.5`},[H(j(IS),{for:`glossary-tr-${e}`,class:`text-xs text-muted-foreground`},{default:M(()=>[H(UC,{code:e,"show-name":``,"show-code":!1,size:12},null,8,[`code`])]),_:2},1032,[`for`]),H(j(rS),{id:`glossary-tr-${e}`,modelValue:a.translations[e],"onUpdate:modelValue":t=>a.translations[e]=t,placeholder:`Forced translation for ${e}`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`placeholder`])]))),128))])):W(``,!0),s.value?(R(),z(`p`,Ck,k(s.value),1)):W(``,!0)]),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:o.value,onClick:n[4]||=e=>r.value=!1},{default:M(()=>[...n[14]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{disabled:o.value,onClick:l},{default:M(()=>[U(k(c.value?`Save`:`Add term`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),Tk={class:`min-h-0 flex-1 overflow-y-auto`},Ek={key:0,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},Dk={key:1,class:`mx-auto flex max-w-3xl flex-col gap-4 p-6`},Ok={class:`flex items-center justify-between`},kk={class:`relative`},Ak={key:0,class:`rounded-lg border border-dashed p-10 text-center text-sm text-muted-foreground`},jk={key:1,class:`rounded-lg border border-dashed p-10 text-center text-sm text-muted-foreground`},Mk={key:2,class:`flex flex-col gap-2`},Nk={class:`min-w-0 flex-1`},Pk={class:`flex flex-wrap items-center gap-2`},Fk={class:`font-mono text-sm font-medium`},Ik={key:0,class:`mt-1 text-sm text-muted-foreground`},Lk={key:1,class:`mt-2 flex flex-wrap gap-1.5`},Rk={class:`flex shrink-0 items-center gap-1`},zk={class:`font-mono`},Bk=P({__name:`GlossaryView`,setup(e){let t=A([]),n=A(``),r=A([]),i=A(!1),a=A(!1),o=A(null),s=A(null),c=A(!1),l=A(``),u=K(()=>hk(t.value,l.value)),d=K(()=>r.value.filter(e=>e!==n.value));async function f(){let[e,a]=await Promise.all([uf(),jd()]);t.value=e,n.value=a.config.sourceLocale,r.value=a.config.locales,i.value=!0}f();function p(){o.value=null,a.value=!0}function m(e){o.value=e,a.value=!0}function h(e){return Object.entries(e.translations??{}).map(([e,t])=>`${e}: ${t}`)}async function g(){let e=s.value;if(e){c.value=!0;try{await ff(e.term),$.success(`Deleted ${e.term}`),s.value=null,await f()}catch(e){$.error(`Delete failed: ${e.message}`)}finally{c.value=!1}}}return(e,n)=>(R(),z(`div`,Tk,[i.value?(R(),z(`div`,Dk,[V(`div`,Ok,[n[7]||=V(`div`,null,[V(`h2`,{class:`text-base font-semibold`},`Glossary`),V(`p`,{class:`text-sm text-muted-foreground`},`Do-not-translate terms and forced translations.`)],-1),H(j(Q),{onClick:p},{default:M(()=>[H(j(od),{class:`size-4`}),n[6]||=U(` Add term `,-1)]),_:1})]),V(`div`,kk,[H(j(pd),{class:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),H(j(rS),{modelValue:l.value,"onUpdate:modelValue":n[0]||=e=>l.value=e,placeholder:`Search terms, notes, translations…`,class:`h-8 w-full pl-8 pr-8`,onKeydown:n[1]||=Xl(e=>l.value=``,[`esc`])},null,8,[`modelValue`]),l.value?(R(),z(`button`,{key:0,class:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":`Clear search`,onClick:n[2]||=e=>l.value=``},[H(j(kd),{class:`size-4`})])):W(``,!0)]),t.value.length===0?(R(),z(`div`,Ak,` No glossary terms yet — add do-not-translate terms and forced translations to guide AI. `)):u.value.length===0?(R(),z(`div`,jk,` No terms match your search. `)):(R(),z(`ul`,Mk,[(R(!0),z(L,null,F(u.value,e=>(R(),z(`li`,{key:e.term,class:`flex items-start gap-3 rounded-lg border bg-card p-3 text-card-foreground shadow-sm`},[V(`div`,Nk,[V(`div`,Pk,[V(`span`,Fk,k(e.term),1),e.doNotTranslate?(R(),B(j(dS),{key:0,variant:`secondary`},{default:M(()=>[...n[8]||=[U(`Do-not-translate`,-1)]]),_:1})):W(``,!0),e.caseSensitive?(R(),B(j(dS),{key:1,variant:`outline`},{default:M(()=>[...n[9]||=[U(`Case-sensitive`,-1)]]),_:1})):W(``,!0)]),e.notes?(R(),z(`p`,Ik,k(e.notes),1)):W(``,!0),h(e).length?(R(),z(`div`,Lk,[(R(!0),z(L,null,F(h(e),e=>(R(),z(`span`,{key:e,class:`inline-flex items-center rounded-md border bg-background px-2 py-0.5 font-mono text-xs`},k(e),1))),128))])):W(``,!0)]),V(`div`,Rk,[H(j(Q),{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.term}`,onClick:t=>m(e)},{default:M(()=>[H(j(ad),{class:`size-4`})]),_:1},8,[`aria-label`,`onClick`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`text-muted-foreground hover:text-destructive`,"aria-label":`Delete ${e.term}`,onClick:t=>s.value=e},{default:M(()=>[H(j(wd),{class:`size-4`})]),_:1},8,[`aria-label`,`onClick`])])]))),128))]))])):(R(),z(`div`,Ek,` Loading glossary… `)),H(wk,{open:a.value,"onUpdate:open":n[3]||=e=>a.value=e,entry:o.value,"target-locales":d.value,onSaved:f},null,8,[`open`,`entry`,`target-locales`]),H(j(bh),{open:s.value!==null,"onUpdate:open":n[5]||=e=>{e||(s.value=null)}},{default:M(()=>[H(j(LS),{class:`max-w-md`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[10]||=[U(`Delete term`,-1)]]),_:1}),H(j(VS),null,{default:M(()=>[n[11]||=U(` Delete `,-1),V(`span`,zk,k(s.value?.term),1),n[12]||=U(` from the glossary? This cannot be undone. `,-1)]),_:1})]),_:1}),H(j(zS),null,{default:M(()=>[H(j(Q),{variant:`outline`,disabled:c.value,onClick:n[4]||=e=>s.value=null},{default:M(()=>[...n[13]||=[U(`Cancel`,-1)]]),_:1},8,[`disabled`]),H(j(Q),{variant:`destructive`,disabled:c.value,onClick:g},{default:M(()=>[...n[14]||=[U(`Delete`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]))}}),Vk=[{id:`empty-source`,label:`Empty source`,description:`The source text itself is empty.`,default:`error`},{id:`empty-translation`,label:`Untranslated`,description:`A target translation is missing or blank.`,default:`error`},{id:`placeholder-mismatch`,label:`Placeholder mismatch`,description:`Placeholders differ between source and translation.`,default:`error`},{id:`icu-mismatch`,label:`ICU mismatch`,description:`ICU plural/select structure differs from the source.`,default:`error`},{id:`glossary-violation`,label:`Glossary`,description:`A glossary term is missing or translated incorrectly.`,default:`error`},{id:`max-length`,label:`Too long`,description:`The translation exceeds the key's maximum length.`,default:`warn`},{id:`identical-to-source`,label:`Identical to source`,description:`The translation is exactly the source text.`,default:`warn`},{id:`whitespace`,label:`Whitespace`,description:`Leading/trailing whitespace differs from the source.`,default:`warn`},{id:`spelling`,label:`Spelling`,description:`A word isn't in the locale's dictionary, the glossary, or your custom dictionary.`,default:`warn`}],Hk=Object.fromEntries(Vk.map(e=>[e.id,e.default]));function Uk(e,t){if(typeof e==`string`&&e.trim()===``)return t;let n=typeof e==`number`?e:Number(e);return Number.isFinite(n)?n:t}function Wk(e){return{sourceLocale:e.sourceLocale,locales:[...e.locales],outputs:e.outputs.map(e=>({adapter:e.adapter,path:e.path,emptyAs:e.emptyAs,style:e.style===`flat`?`flat`:`nested`,indent:e.indent??null,finalNewline:e.finalNewline??null,includeLocale:e.includeLocale??!0,localeAliases:e.localeAliases?structuredClone(e.localeAliases):{},localeCase:e.localeCase,localeMap:e.localeMap?structuredClone(e.localeMap):{}})),indent:e.format.indent,sortKeys:e.format.sortKeys,finalNewline:e.format.finalNewline,autoExport:e.autoExport??!0,exportLocales:[...e.exportLocales??[]],customWords:[...e.spelling?.customWords??[]],lintRules:{...Hk,...e.lint?.rules},lintIgnore:[...e.lint?.ignore??[]],scanAccessors:[...e.scan?.accessors??[]],scanPatterns:[...e.scan?.patterns??[]],scanInclude:[...e.scan?.include??[]],scanExclude:[...e.scan?.exclude??[]]}}function Gk(e,t){let n=e.outputs.map(e=>{let t={adapter:e.adapter.trim(),path:e.path.trim()};if(e.style===`flat`&&(t.style=`flat`),e.emptyAs&&(t.emptyAs=e.emptyAs),e.indent!=null&&(t.indent=e.indent),e.finalNewline!=null&&(t.finalNewline=e.finalNewline),e.includeLocale||(t.includeLocale=!1),e.localeAliases&&Object.keys(e.localeAliases).length&&(t.localeAliases=Object.fromEntries(Object.entries(e.localeAliases).filter(([,e])=>e.length>0)),Object.keys(t.localeAliases).length===0&&delete t.localeAliases),e.localeCase&&(t.localeCase=e.localeCase),e.localeMap){let n=Object.fromEntries(Object.entries(e.localeMap).filter(([,e])=>e.trim()!==``));Object.keys(n).length&&(t.localeMap=n)}return t}).filter(e=>e.adapter||e.path),r={};e.scanAccessors.length&&(r.accessors=[...e.scanAccessors]),e.scanPatterns.length&&(r.patterns=[...e.scanPatterns]),e.scanInclude.length&&(r.include=[...e.scanInclude]),e.scanExclude.length&&(r.exclude=[...e.scanExclude]);let i={sourceLocale:e.sourceLocale,locales:[...e.locales],outputs:n,format:{indent:Uk(e.indent,2),sortKeys:e.sortKeys,finalNewline:e.finalNewline},autoExport:e.autoExport,...e.exportLocales.length?{exportLocales:[...e.exportLocales]}:{},spelling:{customWords:[...e.customWords]},...Object.keys(r).length?{scan:r}:{}},a=Object.fromEntries(Object.entries(e.lintRules).filter(([e,t])=>Hk[e]!==void 0&&t!==Hk[e])),o={};return Object.keys(a).length&&(o.rules=a),e.lintIgnore.length&&(o.ignore=[...e.lintIgnore]),t?.lint?.spelling!==void 0&&(o.spelling=t.lint.spelling),Object.keys(o).length&&(i.lint=o),t?.storage!==void 0&&(i.storage=t.storage),i}var Kk=A(0),qk={class:`flex items-center gap-2 p-2`},Jk=[`aria-label`],Yk={class:`!flex items-center gap-2`},Xk={class:`truncate font-medium`},Zk={class:`flex items-center gap-2`},Qk={key:0,class:`grid gap-5 border-t border-border p-4`},$k={key:0,class:`grid gap-1.5`},eA={class:`mt-1 inline-flex w-fit rounded-md border border-input p-0.5`},tA=[`onClick`],nA={key:1,class:`grid gap-1.5`},rA={class:`mt-1 inline-flex w-fit rounded-md border border-input p-0.5`},iA=[`onClick`],aA={key:2,class:`grid gap-1.5`},oA={class:`flex items-center gap-2`},sA={key:0,class:`text-xs text-muted-foreground`},cA={class:`flex items-center gap-2`},lA={key:3,class:`grid gap-1.5`},uA={class:`flex items-center gap-2`},dA={key:0,class:`text-xs text-muted-foreground`},fA={class:`flex items-center gap-2`},pA={class:`text-xs text-muted-foreground`},mA={key:4,class:`grid gap-1.5`},hA={class:`flex items-center gap-2`},gA={class:`text-xs text-muted-foreground`},_A={class:`grid gap-1.5`},vA={class:`flex w-full items-center justify-between gap-4`},yA={class:`font-mono text-xs text-muted-foreground`},bA={class:`grid gap-1.5`},xA={class:`mt-1 grid gap-2`},SA={key:0,class:`text-xs text-muted-foreground`},CA={class:`w-24 shrink-0 font-mono text-xs font-semibold`},wA={key:1},TA={class:`!flex items-center gap-1.5`},EA={class:`border-t border-border pt-4`},DA={class:`mt-2 grid gap-2`},OA={key:0,class:`text-xs text-muted-foreground`},kA={class:`flex h-8 shrink-0 items-center gap-1.5`},AA={class:`font-mono text-xs font-semibold`},jA={class:`flex flex-1 flex-wrap items-center gap-1.5`},MA=[`onClick`],NA={key:1},PA={class:`!flex items-center gap-1.5`},FA=P({__name:`OutputEditor`,props:{output:{},formatIndent:{},formatFinalNewline:{type:Boolean},locales:{},adapters:{}},emits:[`update:output`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=A(!1),a=A({}),o={"laravel-php":[`emptyAs`,`indent`,`finalNewline`],"vue-i18n-json":[`emptyAs`,`style`,`indent`,`finalNewline`],"flutter-arb":[`emptyAs`,`indent`,`finalNewline`,`includeLocale`],"angular-xliff":[`emptyAs`],"rails-yaml":[`emptyAs`,`indent`,`finalNewline`],"apple-strings":[`emptyAs`]};function s(e){return o[e]??[`emptyAs`,`indent`,`finalNewline`]}function c(e){return s(n.output.adapter).includes(e)}let l=[{value:`source`,label:`Fill source`},{value:`empty`,label:`Leave empty`},{value:`omit`,label:`Omit`}],u=[{value:`lower-hyphen`,label:`lower-hyphen`,example:`en-us`},{value:`lower-underscore`,label:`lower-underscore`,example:`en_us`},{value:`bcp47-hyphen`,label:`bcp47-hyphen`,example:`en-US`},{value:`bcp47-underscore`,label:`bcp47-underscore`,example:`en_US`}];function d(e){return e===`flutter-arb`?`Default (Flutter: en_US)`:e===`angular-xliff`?`Default (Angular: en-US)`:e===`rails-yaml`?`Default (Rails: en-US)`:e===`apple-strings`?`Default (Apple: en-US)`:`Default (en-us)`}let f=K(()=>n.output.localeCase??`default`);function p(e){v({localeCase:e==="default"?void 0:e})}let m={"laravel-php":`Laravel PHP`,"vue-i18n-json":`Vue i18n JSON`,"flutter-arb":`Flutter ARB`,"angular-xliff":`Angular XLIFF`,"rails-yaml":`Rails YAML`,"apple-strings":`Apple .strings`};function h(e){return m[e]??e}let g={"laravel-php":Vu,"vue-i18n-json":Bu,"flutter-arb":_d,"angular-xliff":Vu,"rails-yaml":Vu,"apple-strings":_d};function _(e){return g[e]??Uu}function v(e){r(`update:output`,{...n.output,...e})}function y(e){return e===`flutter-arb`?`omit`:`source`}function b(e){v({adapter:e,emptyAs:y(e),style:e===`vue-i18n-json`?`nested`:n.output.style,includeLocale:!0})}let x=K(()=>n.output.emptyAs??y(n.output.adapter)),S=K(()=>n.output.finalNewline??n.formatFinalNewline),C=K(()=>n.output.indent!=null),w=K(()=>n.output.finalNewline!=null),T=K(()=>n.output.localeAliases??{}),ee=K(()=>Object.keys(T.value)),E=K(()=>n.locales.filter(e=>!ee.value.includes(e)));function te(e){v({localeAliases:e})}function ne(e){te({...T.value,[e]:[]})}function re(e){let t={...T.value};delete t[e],te(t)}function ie(e){let t=(a.value[e]??``).trim();if(!t)return;let n=T.value[e]??[];n.includes(t)||(te({...T.value,[e]:[...n,t]}),a.value={...a.value,[e]:``})}function ae(e,t){te({...T.value,[e]:(T.value[e]??[]).filter(e=>e!==t)})}let oe=K(()=>n.output.localeMap??{}),se=K(()=>Object.keys(oe.value)),ce=K(()=>n.locales.filter(e=>!se.value.includes(e)));function D(e){v({localeMap:e})}function le(e){D({...oe.value,[e]:e})}function ue(e){let t={...oe.value};delete t[e],D(t)}function de(e,t){D({...oe.value,[e]:t})}return(t,n)=>(R(),z(`div`,{class:O([`rounded-lg border`,i.value?`border-input`:`border-border`])},[V(`div`,qk,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":i.value?`Collapse`:`Expand options`,onClick:n[0]||=e=>i.value=!i.value},[H(j(ku),{class:O([`size-4 transition-transform`,i.value?`rotate-90`:``])},null,8,[`class`])],8,Jk)]),_:1}),H(j(ZS),null,{default:M(()=>[U(k(i.value?`Collapse`:`Expand options`),1)]),_:1})]),_:1}),H(j(Iy),{"model-value":e.output.adapter,"onUpdate:modelValue":b},{default:M(()=>[H(j(iS),{class:`w-44 shrink-0`},{default:M(()=>[V(`span`,Yk,[(R(),B(aa(_(e.output.adapter)),{class:`size-3.5 shrink-0 text-primary`})),V(`span`,Xk,k(h(e.output.adapter)),1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(e.adapters,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[V(`span`,Zk,[(R(),B(aa(_(e)),{class:`size-3.5 text-primary`})),U(` `+k(h(e)),1)])]),_:2},1032,[`value`]))),128)),e.output.adapter&&!e.adapters.includes(e.output.adapter)?(R(),B(j(sS),{key:0,value:e.output.adapter},{default:M(()=>[U(k(e.output.adapter),1)]),_:1},8,[`value`])):W(``,!0)]),_:1})]),_:1},8,[`model-value`]),H(j(rS),{"model-value":e.output.path,class:`flex-1 font-mono text-sm`,placeholder:`lib/l10n/app_{locale}.arb`,spellcheck:`false`,"aria-label":`Output path`,"onUpdate:modelValue":n[1]||=e=>v({path:String(e)})},null,8,[`model-value`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove output`,onClick:n[2]||=e=>r(`remove`)},{default:M(()=>[H(j(wd),{class:`size-4`})]),_:1})]),i.value?(R(),z(`div`,Qk,[c(`emptyAs`)?(R(),z(`div`,$k,[H(j(IS),null,{default:M(()=>[...n[8]||=[U(`Empty keys`,-1)]]),_:1}),n[9]||=V(`p`,{class:`text-xs text-muted-foreground`},`What to write when a translation is missing.`,-1),V(`div`,eA,[(R(),z(L,null,F(l,e=>V(`button`,{key:e.value,type:`button`,class:O([`rounded-[5px] px-2.5 py-1 text-xs font-medium transition-colors`,x.value===e.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`]),onClick:t=>v({emptyAs:e.value})},k(e.label),11,tA)),64))])])):W(``,!0),c(`style`)?(R(),z(`div`,nA,[H(j(IS),null,{default:M(()=>[...n[10]||=[U(`Nesting`,-1)]]),_:1}),n[11]||=V(`p`,{class:`text-xs text-muted-foreground`},`Expand dotted keys into nested objects.`,-1),V(`div`,rA,[(R(),z(L,null,F([`nested`,`flat`],t=>V(`button`,{key:t,type:`button`,class:O([`rounded-[5px] px-2.5 py-1 text-xs font-medium capitalize transition-colors`,(e.output.style??`nested`)===t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`]),onClick:e=>v({style:t})},k(t),11,iA)),64))])])):W(``,!0),c(`indent`)?(R(),z(`div`,aA,[V(`div`,oA,[H(j(IS),null,{default:M(()=>[...n[12]||=[U(`Indent`,-1)]]),_:1}),C.value?(R(),z(`button`,{key:1,type:`button`,class:`text-xs text-primary hover:underline`,onClick:n[3]||=e=>v({indent:null})},`Reset`)):(R(),z(`span`,sA,`Inherited · `+k(e.formatIndent),1))]),V(`div`,cA,[H(j(rS),{type:`number`,min:`0`,max:`8`,class:O([`w-20`,C.value?`border-primary`:``]),"model-value":e.output.indent??``,placeholder:String(e.formatIndent),"onUpdate:modelValue":n[4]||=e=>v({indent:e===``?null:Math.max(0,parseInt(String(e),10)||0)})},null,8,[`class`,`model-value`,`placeholder`]),n[13]||=V(`span`,{class:`text-xs text-muted-foreground`},`spaces`,-1)])])):W(``,!0),c(`finalNewline`)?(R(),z(`div`,lA,[V(`div`,uA,[H(j(IS),null,{default:M(()=>[...n[14]||=[U(`Final newline`,-1)]]),_:1}),w.value?(R(),z(`button`,{key:1,type:`button`,class:`text-xs text-primary hover:underline`,onClick:n[5]||=e=>v({finalNewline:null})},`Reset`)):(R(),z(`span`,dA,`Inherited · `+k(e.formatFinalNewline?`on`:`off`),1))]),V(`div`,fA,[H(j(pS),{"model-value":S.value,"onUpdate:modelValue":n[6]||=e=>v({finalNewline:e})},null,8,[`model-value`]),V(`span`,pA,k(S.value?`Enabled`:`Disabled`),1)])])):W(``,!0),c(`includeLocale`)?(R(),z(`div`,mA,[H(j(IS),{class:`flex items-center gap-1.5`},{default:M(()=>[...n[15]||=[U(`Include `,-1),V(`code`,{class:`font-mono text-xs`},`@@locale`,-1)]]),_:1}),n[16]||=V(`p`,{class:`text-xs text-muted-foreground`},`Write the locale marker into each file. Standard for Flutter.`,-1),V(`div`,hA,[H(j(pS),{"model-value":e.output.includeLocale??!0,"onUpdate:modelValue":n[7]||=e=>v({includeLocale:e})},null,8,[`model-value`]),V(`span`,gA,k(e.output.includeLocale??!0?`Enabled`:`Disabled`),1)])])):W(``,!0),V(`div`,_A,[H(j(IS),null,{default:M(()=>[...n[17]||=[U(`Locale code format`,-1)]]),_:1}),n[18]||=V(`p`,{class:`text-xs text-muted-foreground`},[U(`How the `),V(`code`,{class:`font-mono text-xs`},`{locale}`),U(` token is rendered in file names (and the in-file marker for ARB).`)],-1),H(j(Iy),{"model-value":f.value,"onUpdate:modelValue":p},{default:M(()=>[H(j(iS),{class:`w-72`,"aria-label":`Locale code format`},{default:M(()=>[H(j(rb))]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`default`},{default:M(()=>[U(k(d(e.output.adapter)),1)]),_:1}),(R(),z(L,null,F(u,e=>H(j(sS),{key:e.value,value:e.value},{default:M(()=>[V(`span`,vA,[V(`span`,null,k(e.label),1),V(`span`,yA,k(e.example),1)])]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`model-value`])]),V(`div`,bA,[H(j(IS),null,{default:M(()=>[...n[19]||=[U(`Locale overrides`,-1)]]),_:1}),n[21]||=V(`p`,{class:`text-xs text-muted-foreground`},`Force a specific export code for one locale — wins over the format above.`,-1),V(`div`,xA,[se.value.length===0?(R(),z(`p`,SA,`No overrides.`)):W(``,!0),(R(!0),z(L,null,F(se.value,e=>(R(),z(`div`,{key:e,class:`flex items-center gap-2`},[V(`span`,CA,k(e),1),H(j(bu),{class:`size-3 shrink-0 text-muted-foreground`}),H(j(rS),{class:`h-8 flex-1 font-mono text-xs`,"aria-label":`Export code for `+e,placeholder:`export code`,"model-value":oe.value[e]??``,"onUpdate:modelValue":t=>de(e,String(t))},null,8,[`aria-label`,`model-value`,`onUpdate:modelValue`]),H(j(Q),{variant:`ghost`,size:`icon`,class:`size-8 shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove override `+e,onClick:t=>ue(e)},{default:M(()=>[H(j(wd),{class:`size-3.5`})]),_:1},8,[`aria-label`,`onClick`])]))),128)),ce.value.length>0?(R(),z(`div`,wA,[H(j(Iy),{"model-value":``,"onUpdate:modelValue":le},{default:M(()=>[H(j(iS),{class:`w-56 text-muted-foreground`,"aria-label":`Add locale override`},{default:M(()=>[V(`span`,TA,[H(j(od),{class:`size-3.5`}),n[20]||=U(` Add override…`,-1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(ce.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})])):W(``,!0)])]),V(`div`,EA,[n[25]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Advanced · Locale aliases`,-1),n[26]||=V(`p`,{class:`mt-1.5 text-xs text-muted-foreground`},[U(` Write one catalog locale to additional file codes — e.g. `),V(`span`,{class:`font-mono`},`zh-Hans`),U(` also as `),V(`span`,{class:`font-mono`},`zh, zh_CN`),U(`. `)],-1),V(`div`,DA,[ee.value.length===0?(R(),z(`p`,OA,`No aliases. The locale's own code is used as the file name.`)):W(``,!0),(R(!0),z(L,null,F(ee.value,e=>(R(),z(`div`,{key:e,class:`flex items-start gap-2`},[V(`div`,kA,[V(`span`,AA,k(e),1),H(j(bu),{class:`size-3 text-muted-foreground`})]),V(`div`,jA,[(R(!0),z(L,null,F(T.value[e]??[],t=>(R(),z(`span`,{key:t,class:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-xs`},[U(k(t)+` `,1),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`text-muted-foreground hover:text-destructive`,"aria-label":`Remove`,onClick:n=>ae(e,t)},[H(j(kd),{class:`size-3`})],8,MA)]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[22]||=[U(`Remove`,-1)]]),_:1})]),_:2},1024)]))),128)),H(j(rS),{class:`h-8 w-28 font-mono text-xs`,placeholder:`add code…`,"model-value":a.value[e]??``,"onUpdate:modelValue":t=>a.value={...a.value,[e]:String(t)},onKeydown:Xl(q(t=>ie(e),[`prevent`]),[`enter`])},null,8,[`model-value`,`onUpdate:modelValue`,`onKeydown`])]),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`ghost`,size:`icon`,class:`size-8 shrink-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove alias`,onClick:t=>re(e)},{default:M(()=>[H(j(wd),{class:`size-3.5`})]),_:1},8,[`onClick`])]),_:2},1024),H(j(ZS),null,{default:M(()=>[...n[23]||=[U(`Remove alias`,-1)]]),_:1})]),_:2},1024)]))),128)),E.value.length>0?(R(),z(`div`,NA,[H(j(Iy),{"model-value":``,"onUpdate:modelValue":ne},{default:M(()=>[H(j(iS),{class:`w-56 text-muted-foreground`},{default:M(()=>[V(`span`,PA,[H(j(od),{class:`size-3.5`}),n[24]||=U(` Add locale alias…`,-1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(E.value,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})])):W(``,!0)])])])):W(``,!0)],2))}}),IA={class:`grid gap-1.5`},LA={class:`flex flex-wrap gap-2`},RA=[`aria-label`,`onClick`],zA={key:0,class:`text-sm text-muted-foreground`},BA={class:`flex max-w-sm gap-2`},VA={key:0,class:`flex items-center gap-1.5 text-xs text-destructive`},HA=P({__name:`ScanListField`,props:{label:{},items:{},placeholder:{},mono:{type:Boolean},addLabel:{},validate:{type:Function}},emits:[`update:items`],setup(e,{emit:t}){let n=e,r=t,i=A(``),a=A(``);function o(){let e=i.value.trim();if(!e)return;if(n.items.includes(e)){a.value=`"${e}" is already listed`;return}let t=n.validate?.(e)??null;if(t){a.value=t;return}a.value=``,r(`update:items`,[...n.items,e]),i.value=``}function s(e){r(`update:items`,n.items.filter(t=>t!==e))}return(t,n)=>(R(),z(`div`,IA,[H(j(IS),null,{default:M(()=>[U(k(e.label),1)]),_:1}),I(t.$slots,`help`),V(`div`,LA,[(R(!0),z(L,null,F(e.items,t=>(R(),z(`span`,{key:t,class:O([`inline-flex items-center gap-1.5 rounded-lg border bg-accent px-2.5 py-1.5 text-sm`,e.mono&&`font-mono`])},[U(k(t)+` `,1),V(`button`,{type:`button`,class:`flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${t}`,onClick:e=>s(t)},[H(j(kd),{class:`size-3`})],8,RA)],2))),128)),e.items.length===0?(R(),z(`p`,zA,`None — auto-detect.`)):W(``,!0)]),V(`div`,BA,[H(j(rS),{modelValue:i.value,"onUpdate:modelValue":n[0]||=e=>i.value=e,class:O(e.mono?`font-mono`:void 0),placeholder:e.placeholder,onKeydown:Xl(q(o,[`prevent`]),[`enter`]),onInput:n[1]||=e=>a.value=``},null,8,[`modelValue`,`class`,`placeholder`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:o},{default:M(()=>[H(j(od),{class:`size-4`}),U(` `+k(e.addLabel??`Add`),1)]),_:1})]),a.value?(R(),z(`p`,VA,[H(j(Td),{class:`size-3.5`}),U(` `+k(a.value),1)])):W(``,!0)]))}}),UA={key:0,class:`flex flex-1 items-center justify-center text-sm text-muted-foreground`},WA={key:1,class:`flex min-h-0 flex-1 overflow-hidden`},GA={class:`flex w-60 shrink-0 flex-col gap-1 overflow-y-auto border-r bg-muted p-3`},KA=[`onClick`],qA={class:`min-w-0 flex-1`},JA={class:`block text-[13px] font-[570] leading-tight`},YA={class:`mt-0.5 block truncate text-[11px] opacity-70`},XA={key:0,class:`size-2 shrink-0 rounded-full bg-primary ring-2 ring-primary/25`},ZA={key:1,class:`shrink-0 rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wide text-emerald-600 dark:text-emerald-400`},QA=[`onClick`],$A={class:`min-w-0 flex-1`},ej={class:`block text-[13px] font-[570] leading-tight`},tj={class:`mt-0.5 block truncate text-[11px] opacity-70`},nj={class:`relative flex min-w-0 flex-1 flex-col`},rj={class:`flex-1 overflow-y-auto px-8 pb-28 pt-7`},ij={class:`max-w-[680px]`},aj={class:`mb-6`},oj={class:`flex items-center gap-2.5 text-[21px] font-bold tracking-tight`},sj={key:0,class:`size-2 rounded-full bg-primary ring-2 ring-primary/25`},cj={key:0,class:`mt-1.5 text-sm text-muted-foreground`},lj={key:1,class:`mt-1.5 text-sm text-muted-foreground`},uj={key:2,class:`mt-1.5 text-sm text-muted-foreground`},dj={key:3,class:`mt-1.5 text-sm text-muted-foreground`},fj={key:4,class:`mt-1.5 text-sm text-muted-foreground`},pj={key:5,class:`mt-1.5 text-sm text-muted-foreground`},mj={key:6,class:`mt-1.5 text-sm text-muted-foreground`},hj={key:7,class:`mt-2 flex items-center gap-1.5 text-sm text-muted-foreground`},gj={key:0,class:`flex flex-col gap-5`},_j={class:`grid max-w-sm gap-1.5`},vj={key:0},yj={class:`grid gap-1.5`},bj={class:`ml-1.5 font-normal text-muted-foreground`},xj={class:`flex flex-wrap gap-2`},Sj={key:0,class:`font-mono text-[10px] italic text-muted-foreground`},Cj=[`aria-label`,`onClick`],wj={class:`mt-1 flex items-center gap-1.5 text-xs text-destructive`},Tj={class:`grid max-w-sm gap-1.5`},Ej={class:`flex gap-2`},Dj={key:0,class:`flex items-center gap-1.5 text-xs text-muted-foreground`},Oj={key:1,class:`flex flex-col gap-6`},kj={class:`flex items-center justify-between gap-4 rounded-lg border p-3.5`},Aj={class:`flex items-start gap-2.5`},jj={class:`grid size-8 shrink-0 place-items-center rounded-md border border-primary/25 bg-primary/10 text-primary`},Mj={class:`rounded-lg border p-3.5`},Nj={class:`flex items-center justify-between gap-4`},Pj={class:`flex items-start gap-2.5`},Fj={class:`grid size-8 shrink-0 place-items-center rounded-md border border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`},Ij={key:0,class:`mt-3 border-t pt-3`},Lj={class:`flex flex-wrap gap-2`},Rj=[`aria-checked`,`onClick`],zj={class:`mt-2 flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400`},Bj={class:`mt-2 divide-y rounded-lg border`},Vj={class:`flex items-center justify-between gap-4 p-3.5`},Hj={class:`flex items-center gap-2`},Uj={class:`flex items-center justify-between gap-4 p-3.5`},Wj={class:`flex items-center gap-2 text-sm font-medium`},Gj={class:`inline-flex items-center gap-1 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`},Kj={class:`inline-flex shrink-0 items-center gap-1 rounded-md border border-primary/25 bg-primary/10 px-2 py-1 text-xs font-medium text-primary`},qj={class:`flex items-center justify-between gap-4 p-3.5`},Jj={class:`mt-2 flex flex-col gap-2.5`},Yj={key:0,class:`text-sm text-muted-foreground`},Xj={key:2,class:`flex flex-col gap-4`},Zj={class:`flex items-center gap-2 rounded-lg border p-3`},Qj={key:1,class:`flex-1 text-sm text-muted-foreground`},$j={class:`grid max-w-sm gap-4`},eM={class:`grid gap-1.5`},tM={class:`flex items-center gap-2`},nM={key:0,class:`flex items-center gap-1 text-xs leading-none text-emerald-600 dark:text-emerald-400`},rM={class:`text-xs text-muted-foreground`},iM={class:`grid gap-1.5`},aM={key:0,class:`text-xs text-muted-foreground`},oM=[`onClick`],sM={key:0},cM={key:0,class:`grid gap-1.5`},lM={key:1,class:`grid gap-1.5`},uM={key:0,class:`text-xs text-muted-foreground`},dM={key:1,class:`text-xs text-muted-foreground`},fM={class:`grid gap-1.5`},pM={class:`grid gap-1.5`},mM={class:`grid gap-1.5`},hM={class:`grid gap-1.5`},gM={class:`grid gap-1.5`},_M={class:`grid gap-1.5`},vM={key:2,class:`flex items-center gap-3`},yM={class:`grid gap-0.5`},bM={key:3,class:`grid gap-1.5`},xM={key:3,class:`flex flex-col gap-6`},SM={key:4,class:`flex flex-col gap-6`},CM={class:`mt-2 divide-y rounded-lg border`},wM={class:`min-w-0`},TM={class:`flex items-center gap-2 text-sm font-medium`},EM={class:`rounded border bg-muted px-1 py-0.5 font-mono text-[10px] text-muted-foreground`},DM={class:`mt-0.5 text-xs text-muted-foreground`},OM={key:5,class:`flex flex-col gap-4`},kM={class:`flex flex-wrap gap-2`},AM=[`aria-label`,`onClick`],jM={key:0,class:`text-sm text-muted-foreground`},MM={class:`grid max-w-sm gap-1.5`},NM={class:`flex gap-2`},PM={key:6,class:`flex flex-col gap-4`},FM={class:`grid max-w-sm gap-1.5`},IM={class:`flex items-center gap-2`},LM={key:0,class:`flex items-center gap-1 text-xs leading-none text-emerald-600 dark:text-emerald-400`},RM={class:`flex items-center gap-1.5 text-sm text-muted-foreground`},zM={class:`inline-grid h-5 min-w-[20px] shrink-0 place-items-center rounded-full bg-primary px-1.5 text-[11px] font-bold tabular-nums text-primary-foreground`},BM={class:`font-semibold`},VM={class:`relative`},HM={key:0,class:`absolute bottom-full left-1/2 z-50 mb-2.5 w-64 -translate-x-1/2 rounded-xl border bg-card p-3.5 shadow-lg`},UM={class:`mt-1 text-xs leading-relaxed text-muted-foreground`},WM={class:`mt-3 flex justify-end gap-2`},GM={role:`dialog`,"aria-modal":`true`,"aria-labelledby":`leave-warning-title`,class:`w-full max-w-md rounded-2xl border bg-card p-5 shadow-xl`},KM={id:`leave-warning-title`,class:`flex items-center gap-2 text-[15px] font-semibold`},qM={class:`mt-1.5 text-[13px] leading-relaxed text-muted-foreground`},JM={class:`font-medium text-foreground`},YM={class:`block`},XM={class:`mt-4 flex items-center gap-2`},ZM={key:0,class:`fixed left-1/2 top-4 z-[80] flex -translate-x-1/2 items-center gap-2 rounded-[11px] bg-foreground px-4 py-2.5 text-[12.5px] font-medium text-background shadow-lg`},QM=P({__name:`SettingsView`,setup(e){let t=[`languages`,`outputs`,`ai`,`scan`,`quality`,`dictionary`,`editor`],n=[`flutter-arb`,`laravel-php`,`vue-i18n-json`,`angular-xliff`,`rails-yaml`,`apple-strings`],r=[{value:`anthropic`,label:`Anthropic`},{value:`bedrock`,label:`AWS Bedrock`},{value:`claude-code`,label:`Claude Code`},{value:`ollama`,label:`Ollama`},{value:`openai`,label:`OpenAI`},{value:`openrouter`,label:`OpenRouter`}],i={anthropic:[`claude-opus-4-8`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`],openai:[`gpt-4o-mini`,`gpt-4o`,`gpt-4.1`],bedrock:[`amazon.nova-pro-v1:0`,`anthropic.claude-3-5-sonnet-20241022-v2:0`,`meta.llama3-1-70b-instruct-v1:0`],openrouter:[`anthropic/claude-3.5-haiku`,`openai/gpt-4o-mini`,`google/gemini-2.0-flash-001`],ollama:[`translategemma:4b`,`translategemma:12b`,`qwen3.5:9b`],"claude-code":[`claude-opus-4-8`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`]},a={anthropic:`Set ANTHROPIC_API_KEY in your environment (or a .env file).`,openai:`Set OPENAI_API_KEY in your environment (or a .env file).`,bedrock:`Uses your AWS credentials (env vars, AWS_PROFILE, or an instance/SSO role).`,openrouter:`Set OPENROUTER_API_KEY in your environment (or a .env file).`,ollama:`Runs locally — no API key needed. Set OLLAMA_API_KEY only for a secured/remote server.`,"claude-code":`Uses your local Claude Code session — no separate API key needed. Requires the claude CLI to be installed.`},o=A(null),s=A(null),c=Zt({sourceLocale:``,locales:[],outputs:[],indent:2,sortKeys:!0,finalNewline:!0,autoExport:!0,exportLocales:[],customWords:[],lintRules:{},lintIgnore:[],scanAccessors:[],scanPatterns:[],scanInclude:[],scanExclude:[]}),l=A(!1),u=A(!1),d=A(p()),f=A(!1);function p(){let e=Cp().get(`section`)??``;return t.includes(e)?e:`languages`}function m(e){d.value=e,location.hash=`settings?section=${e}`}function h(){d.value=p()}let g=A(null),_=A(!1),v=null;function y(e){c.sourceLocale=e.sourceLocale,c.locales=[...e.locales],c.outputs=e.outputs.map(e=>({...e})),c.indent=e.indent,c.sortKeys=e.sortKeys,c.finalNewline=e.finalNewline,c.autoExport=e.autoExport,c.exportLocales=[...e.exportLocales],c.customWords=[...e.customWords],c.lintRules={...e.lintRules},c.lintIgnore=[...e.lintIgnore],c.scanAccessors=[...e.scanAccessors],c.scanPatterns=[...e.scanPatterns],c.scanInclude=[...e.scanInclude],c.scanExclude=[...e.scanExclude]}function b(){o.value={sourceLocale:c.sourceLocale,locales:[...c.locales],outputs:c.outputs.map(e=>({...e})),indent:c.indent,sortKeys:c.sortKeys,finalNewline:c.finalNewline,autoExport:c.autoExport,exportLocales:[...c.exportLocales],customWords:[...c.customWords],lintRules:{...c.lintRules},lintIgnore:[...c.lintIgnore],scanAccessors:[...c.scanAccessors],scanPatterns:[...c.scanPatterns],scanInclude:[...c.scanInclude],scanExclude:[...c.scanExclude]}}async function x(){let e=await jd();s.value=e.config,y(Wk(e.config)),b(),await re(),l.value=!0}x();let S=A({}),C=A(null),w=A(``),T=Zt({provider:`anthropic`,model:``,endpoint:``,region:``,batchSize:25,concurrency:``,contextBatchSize:``,contextConcurrency:``,vision:!1,promptStyle:``,inputPricePerMTok:``,outputPricePerMTok:``}),ee=A(!1),E=null,te=null,ne=``;async function re(){let[e,t]=await Promise.all([nf(),af()]);S.value=t.profiles,C.value=t.activeProfile,w.value=t.activeProfile??``,ie(C.value?t.profiles[C.value]??e.ai:e.ai),ne=JSON.stringify(ae())}function ie(e){T.provider=e.provider,T.model=e.model,T.endpoint=e.endpoint??``,T.region=e.region??``,T.batchSize=e.batchSize,T.concurrency=e.concurrency??``,T.contextBatchSize=e.contextBatchSize??``,T.contextConcurrency=e.contextConcurrency??``,T.vision=e.vision??!1,T.promptStyle=e.promptStyle??``,T.inputPricePerMTok=e.inputPricePerMTok??``,T.outputPricePerMTok=e.outputPricePerMTok??``,ne=JSON.stringify(ae())}function ae(){let e=String(T.endpoint).trim(),t=String(T.region).trim(),n=Number(T.batchSize),r=Number(T.concurrency),i=Number(T.contextBatchSize),a=Number(T.contextConcurrency),o=Number(T.inputPricePerMTok),s=Number(T.outputPricePerMTok);return{provider:T.provider.trim(),model:T.model.trim(),endpoint:e===``?null:e,region:t===``?null:t,batchSize:Number.isFinite(n)&&n>0?n:25,concurrency:Number.isFinite(r)&&r>0?r:void 0,contextBatchSize:Number.isFinite(i)&&i>0?i:void 0,contextConcurrency:Number.isFinite(a)&&a>0?a:void 0,vision:T.vision||void 0,promptStyle:T.promptStyle||void 0,inputPricePerMTok:T.inputPricePerMTok!==``&&Number.isFinite(o)&&o>=0?o:void 0,outputPricePerMTok:T.outputPricePerMTok!==``&&Number.isFinite(s)&&s>=0?s:void 0}}N(T,()=>{JSON.stringify(ae())!==ne&&(te&&clearTimeout(te),te=setTimeout(async()=>{let e=ae();try{C.value?(await of(C.value,e),S.value={...S.value,[C.value]:e}):await rf({ai:e}),ne=JSON.stringify(e),ee.value=!0,E&&clearTimeout(E),E=setTimeout(()=>{ee.value=!1},1700)}catch(e){$.error(e.message)}},500))},{deep:!0});let oe=[`languages`,`outputs`,`scan`,`quality`,`dictionary`],se=[`ai`,`editor`];function ce(e){if(!o.value)return!0;let t=c,n=o.value;return e===`languages`?JSON.stringify(t.locales)===JSON.stringify(n.locales)&&t.sourceLocale===n.sourceLocale:e===`outputs`?JSON.stringify(t.outputs)===JSON.stringify(n.outputs)&&String(t.indent)===String(n.indent)&&t.finalNewline===n.finalNewline&&t.autoExport===n.autoExport&&JSON.stringify(t.exportLocales)===JSON.stringify(n.exportLocales):e===`scan`?JSON.stringify(t.scanAccessors)===JSON.stringify(n.scanAccessors)&&JSON.stringify(t.scanPatterns)===JSON.stringify(n.scanPatterns)&&JSON.stringify(t.scanInclude)===JSON.stringify(n.scanInclude)&&JSON.stringify(t.scanExclude)===JSON.stringify(n.scanExclude):e===`quality`?JSON.stringify(t.lintRules)===JSON.stringify(n.lintRules)&&JSON.stringify(t.lintIgnore)===JSON.stringify(n.lintIgnore):e===`dictionary`?JSON.stringify(t.customWords)===JSON.stringify(n.customWords):!0}let D=K(()=>oe.filter(e=>!ce(e))),le=K(()=>D.value.length),ue=K(()=>D.value.map(e=>he[e].title));N(le,e=>{Kk.value=e},{immediate:!0}),Xi(()=>{Kk.value=0});let de=K(()=>ww.find(e=>e.id===Dw.value)?.label??`VS Code`),fe=A(!1),pe=null;function me(e){Ow(e),fe.value=!0,pe&&clearTimeout(pe),pe=setTimeout(()=>{fe.value=!1},1700)}let he={languages:{title:`Languages`},outputs:{title:`Export targets`},ai:{title:`AI`},scan:{title:`Scan`},quality:{title:`Quality checks`},dictionary:{title:`Custom dictionary`},editor:{title:`Editor`}},ge=[{id:`languages`,title:`Languages`},{id:`outputs`,title:`Export targets`},{id:`scan`,title:`Scan`},{id:`quality`,title:`Quality checks`},{id:`dictionary`,title:`Custom dictionary`}];function _e(e){if(e===`languages`)return`${c.locales.length} language${c.locales.length===1?``:`s`}`;if(e===`outputs`)return`${c.outputs.length} target${c.outputs.length===1?``:`s`}${c.autoExport?` · auto`:``}${c.exportLocales.length?` · limited`:``}`;if(e===`ai`)return C.value?`${C.value} · ${T.model}`:`${T.provider} · ${T.model}`;if(e===`scan`){let e=c.scanAccessors.length,t=c.scanPatterns.length,n=[e&&`${e} accessor${e===1?``:`s`}`,t&&`${t} pattern${t===1?``:`s`}`].filter(Boolean);return n.length?n.join(` · `):`Auto-detect`}if(e===`quality`){let e=Object.entries(c.lintRules).filter(([,e])=>e===`off`).length,t=Object.entries(c.lintRules).filter(([e,t])=>Hk[e]!==void 0&&t!==Hk[e]).length;return!t&&!c.lintIgnore.length?`Defaults`:[t&&`${t} adjusted${e?` (${e} off)`:``}`,c.lintIgnore.length&&`${c.lintIgnore.length} ignored`].filter(Boolean).join(` · `)}return e===`dictionary`?c.customWords.length?`${c.customWords.length} word${c.customWords.length===1?``:`s`}`:`No custom words`:``}async function ve(){if(le.value!==0){u.value=!0;try{await $d(Gk(c,s.value??void 0)),b(),_.value=!0,v&&clearTimeout(v),v=setTimeout(()=>{_.value=!1},1700)}catch(e){$.error(e.message)}finally{u.value=!1}}}function ye(){o.value&&y(o.value),f.value=!1}function be(e){return e===`settings`||le.value===0?!0:(g.value=e,!1)}function xe(e){g.value=null,xp(e)}function Se(){g.value=null}function Ce(){let e=g.value;ye(),e&&xe(e)}async function we(){let e=g.value;await ve(),e&&le.value===0&&xe(e)}function Te(e){le.value>0&&(e.preventDefault(),e.returnValue=``)}function Ee(e){if(e.key===`Escape`&&g.value){e.preventDefault(),Se();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),ve())}Ki(()=>{window.addEventListener(`keydown`,Ee),window.addEventListener(`beforeunload`,Te),window.addEventListener(`hashchange`,h),bp(be)}),Xi(()=>{window.removeEventListener(`keydown`,Ee),window.removeEventListener(`beforeunload`,Te),window.removeEventListener(`hashchange`,h),bp(null)});let De=A(``);function Oe(){let e=De.value.trim().toLowerCase();if(e){if(c.locales.some(t=>t.toLowerCase()===e)){$.error(`${e} is already in the list`);return}c.locales.push(e),De.value=``}}function ke(e){e!==c.sourceLocale&&(c.locales=c.locales.filter(t=>t!==e))}function Ae(){c.outputs.push({adapter:`flutter-arb`,path:``,emptyAs:`omit`,style:`nested`,indent:null,finalNewline:null,includeLocale:!0,localeAliases:{}})}function je(e){c.outputs.splice(e,1)}let Me=K(()=>c.exportLocales.length>0);function Ne(e){c.exportLocales=e?[...c.locales]:[]}function Pe(e){c.exportLocales=c.exportLocales.includes(e)?c.exportLocales.filter(t=>t!==e):[...c.exportLocales,e]}let Fe=K(()=>T.provider===`bedrock`),Ie=K(()=>T.provider===`ollama`),Le=K(()=>a[T.provider]??``),Re=K(()=>i[T.provider]??[]),ze=K(()=>Re.value[0]??``);async function Be(e){C.value=e,w.value=e??``,await cf(e),ie(e?S.value[e]??ae():(await nf()).ai)}async function Ve(){let e=`Profile ${Object.keys(S.value).length+1}`,t=ae();await of(e,t),S.value={...S.value,[e]:t},await Be(e)}async function He(e,t){let n=t.trim();if(!n||n===e){w.value=e;return}if(n in S.value){$.error(`A profile with that name already exists`),w.value=e;return}let r=S.value[e];await of(n,r),await sf(e);let i={...S.value};delete i[e],i[n]=r,S.value=i,await Be(n)}async function Ue(){if(!C.value)return;let e=C.value;await sf(e);let t={...S.value};delete t[e],S.value=t,await Be(null)}let We=A(``);function Ge(){let e=We.value.trim();if(e){if(c.customWords.includes(e)){$.error(`${e} is already in the dictionary`);return}c.customWords=[...c.customWords,e].sort(),We.value=``}}function Ke(e){c.customWords=c.customWords.filter(t=>t!==e)}function qe(e){try{return new RegExp(e),null}catch(e){return`Invalid regex: ${e.message}`}}return(e,t)=>(R(),z(L,null,[l.value?(R(),z(`div`,WA,[V(`nav`,GA,[t[29]||=V(`p`,{class:`px-2.5 pb-2 pt-1 text-[10.5px] font-bold uppercase tracking-widest text-muted-foreground`},` Settings `,-1),(R(),z(L,null,F(ge,e=>V(`button`,{key:e.id,type:`button`,class:O([`flex w-full items-center gap-2.5 rounded-[10px] border px-2.5 py-2.5 text-left transition-colors`,d.value===e.id?`border-border bg-card text-foreground shadow-sm`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`]),onClick:t=>m(e.id)},[V(`span`,{class:O([`flex size-[30px] shrink-0 items-center justify-center rounded-lg border`,d.value===e.id?`border-primary/30 bg-primary/10 text-primary`:`border-border/60 bg-background text-muted-foreground`])},[e.id===`languages`?(R(),B(j(qu),{key:0,class:`size-4`})):e.id===`outputs`?(R(),B(j(Uu),{key:1,class:`size-4`})):e.id===`ai`?(R(),B(j(Iu),{key:2,class:`size-4`})):e.id===`scan`?(R(),B(j(dd),{key:3,class:`size-4`})):e.id===`quality`?(R(),B(j(hd),{key:4,class:`size-4`})):(R(),B(j(Cu),{key:5,class:`size-4`}))],2),V(`span`,qA,[V(`span`,JA,k(e.title),1),V(`span`,YA,k(_e(e.id)),1)]),!e.autosave&&D.value.includes(e.id)?(R(),z(`span`,XA)):W(``,!0),e.autosave?(R(),z(`span`,ZA,`Auto`)):W(``,!0)],10,KA)),64)),t[30]||=V(`p`,{class:`mt-4 border-t px-2.5 pb-2 pt-3 text-[10.5px] font-bold uppercase tracking-widest text-muted-foreground`},` Local (not committed) `,-1),(R(),z(L,null,F(se,e=>V(`button`,{key:e,type:`button`,class:O([`flex w-full items-center gap-2.5 rounded-[10px] border px-2.5 py-2.5 text-left transition-colors`,d.value===e?`border-border bg-card text-foreground shadow-sm`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`]),onClick:t=>m(e)},[V(`span`,{class:O([`flex size-[30px] shrink-0 items-center justify-center rounded-lg border`,d.value===e?`border-primary/30 bg-primary/10 text-primary`:`border-border/60 bg-background text-muted-foreground`])},[e===`ai`?(R(),B(j(Iu),{key:0,class:`size-4`})):(R(),B(j(Fu),{key:1,class:`size-4`}))],2),V(`span`,$A,[V(`span`,ej,k(he[e].title),1),V(`span`,tj,k(e===`editor`?de.value:_e(e)),1)])],10,QA)),64))]),V(`div`,nj,[V(`div`,rj,[V(`div`,ij,[V(`div`,aj,[V(`h2`,oj,[U(k(he[d.value].title)+` `,1),D.value.includes(d.value)?(R(),z(`span`,sj)):W(``,!0)]),d.value===`languages`?(R(),z(`p`,cj,` The source language is translated into every other language. `)):d.value===`outputs`?(R(),z(`p`,lj,[...t[31]||=[U(` Where compiled translation files are written. Use `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`{locale}`,-1),U(` and `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`{namespace}`,-1),U(` placeholders in the path. `,-1)]])):d.value===`ai`?(R(),z(`p`,uj,[...t[32]||=[U(` The provider and model used for machine translation. Stored locally in `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),U(`, not shared with your team. `,-1)]])):d.value===`scan`?(R(),z(`p`,dj,` How the usage scanner finds where keys are referenced in code. Auto-detection handles most projects — these settings are for the cases it can't infer. `)):d.value===`quality`?(R(),z(`p`,fj,[...t[33]||=[U(` Which checks run and how severe they are — in the editor, the Analytics release gate, and `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`glotfile lint`,-1),U(` alike. Errors block a release; warnings don't. `,-1)]])):d.value===`dictionary`?(R(),z(`p`,pj,` Words the spell checker should never flag. Added here or from a cell's warning. `)):d.value===`editor`?(R(),z(`p`,mj,[...t[34]||=[U(` Which editor opens when you click a key's code usage. Stored locally in `,-1),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),U(`, not shared with your team. `,-1)]])):W(``,!0),se.includes(d.value)?(R(),z(`p`,hj,[H(j(Ad),{class:`size-3.5`}),t[35]||=U(` Changes here save automatically. `,-1)])):W(``,!0)]),d.value===`languages`?(R(),z(`div`,gj,[V(`div`,_j,[H(j(IS),{for:`source-locale`},{default:M(()=>[...t[36]||=[U(`Source language`,-1)]]),_:1}),H(j(Iy),{modelValue:c.sourceLocale,"onUpdate:modelValue":t[0]||=e=>c.sourceLocale=e},{default:M(()=>[H(j(iS),{id:`source-locale`},{default:M(()=>[c.sourceLocale?(R(),z(`span`,vj,[H(UC,{code:c.sourceLocale,"show-name":``,size:14},null,8,[`code`])])):(R(),B(j(rb),{key:1,placeholder:`Select source`}))]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(c.locales,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[H(UC,{code:e,"show-name":``,size:14},null,8,[`code`])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),V(`div`,yj,[H(j(IS),null,{default:M(()=>[t[37]||=U(` Languages `,-1),V(`span`,bj,k(c.locales.length),1)]),_:1}),V(`div`,xj,[(R(!0),z(L,null,F(c.locales,e=>(R(),z(`span`,{key:e,class:O([`inline-flex items-center gap-1.5 rounded-[9px] border px-2.5 py-1.5 text-sm transition-colors`,e===c.sourceLocale?`border-border/60 bg-accent`:`border-border bg-background`])},[H(UC,{code:e,"show-name":``,size:14},null,8,[`code`]),e===c.sourceLocale?(R(),z(`span`,Sj,`source`)):(R(),z(`button`,{key:1,type:`button`,class:`ml-0.5 flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${e}`,onClick:t=>ke(e)},[H(j(kd),{class:`size-3`})],8,Cj))],2))),128))]),V(`p`,wj,[H(j(Td),{class:`size-3.5`}),t[38]||=U(` Removing a language deletes its translations. `,-1)])]),V(`div`,Tj,[H(j(IS),{for:`add-locale`},{default:M(()=>[...t[39]||=[U(`Add language`,-1)]]),_:1}),V(`div`,Ej,[H(j(rS),{id:`add-locale`,modelValue:De.value,"onUpdate:modelValue":t[1]||=e=>De.value=e,class:`font-mono`,placeholder:`es`,onKeydown:Xl(q(Oe,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:Oe},{default:M(()=>[H(j(od),{class:`size-4`}),t[40]||=U(` Add`,-1)]),_:1})]),De.value.trim()?(R(),z(`p`,Dj,[t[41]||=U(` Preview: `,-1),H(UC,{code:De.value.trim(),"show-name":``,size:14},null,8,[`code`])])):W(``,!0)])])):d.value===`outputs`?(R(),z(`div`,Oj,[V(`div`,kj,[V(`div`,Aj,[V(`span`,jj,[H(j(Ad),{class:`size-4`})]),t[42]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Auto-export on save`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Write locale files to your project automatically as you edit, so your running app picks them up immediately.`)],-1)]),H(j(pS),{modelValue:c.autoExport,"onUpdate:modelValue":t[2]||=e=>c.autoExport=e},null,8,[`modelValue`])]),V(`div`,Mj,[V(`div`,Nj,[V(`div`,Pj,[V(`span`,Fj,[H(j(Zu),{class:`size-4`})]),t[43]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Limit export languages`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Only the selected languages are written to disk, including auto-export. Off exports all languages.`)],-1)]),H(j(pS),{"model-value":Me.value,"onUpdate:modelValue":Ne},null,8,[`model-value`])]),Me.value?(R(),z(`div`,Ij,[V(`div`,Lj,[(R(!0),z(L,null,F(c.locales,e=>(R(),z(`button`,{key:e,type:`button`,role:`checkbox`,"aria-checked":c.exportLocales.includes(e),class:O([`inline-flex items-center gap-1.5 rounded-[9px] border px-2.5 py-1.5 text-sm transition-colors`,c.exportLocales.includes(e)?`border-primary/40 bg-primary/10`:`border-border bg-background text-muted-foreground hover:bg-accent`]),onClick:t=>Pe(e)},[V(`span`,{class:O([`flex size-4 items-center justify-center rounded border transition-colors`,c.exportLocales.includes(e)?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground hover:border-primary hover:bg-primary/10`])},[c.exportLocales.includes(e)?(R(),B(j(Du),{key:0,class:`size-3`})):W(``,!0)],2),H(UC,{code:e,"show-name":``,size:14},null,8,[`code`])],10,Rj))),128))]),V(`p`,zj,[H(j(Td),{class:`size-3.5`}),U(` Export limited to `+k(c.exportLocales.length)+` of `+k(c.locales.length)+` languages. `,1)])])):W(``,!0)]),V(`div`,null,[t[51]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Format defaults`,-1),t[52]||=V(`p`,{class:`mt-1 text-xs text-muted-foreground`},`Export targets inherit these. Indent and Final newline can be overridden per target.`,-1),V(`div`,Bj,[V(`div`,Vj,[t[45]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Indent`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Spaces per nesting level.`)],-1),V(`div`,Hj,[H(j(rS),{modelValue:c.indent,"onUpdate:modelValue":t[3]||=e=>c.indent=e,modelModifiers:{number:!0},type:`number`,min:`0`,max:`8`,class:`w-20`},null,8,[`modelValue`]),t[44]||=V(`span`,{class:`text-xs text-muted-foreground`},`spaces`,-1)])]),V(`div`,Uj,[V(`div`,null,[V(`div`,Wj,[t[47]||=U(` Sort keys `,-1),V(`span`,Gj,[H(j(ed),{class:`size-2.5`}),t[46]||=U(` Locked`,-1)])]),t[48]||=V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Keys are always written alphabetically so output is deterministic and diffs stay clean.`,-1)]),V(`span`,Kj,[H(j(Du),{class:`size-3`}),t[49]||=U(` Always alphabetical`,-1)])]),V(`div`,qj,[t[50]||=V(`div`,null,[V(`div`,{class:`text-sm font-medium`},`Final newline`),V(`div`,{class:`mt-0.5 text-xs text-muted-foreground`},`Append a trailing newline at the end of every file.`)],-1),H(j(pS),{modelValue:c.finalNewline,"onUpdate:modelValue":t[4]||=e=>c.finalNewline=e},null,8,[`modelValue`])])])]),V(`div`,null,[t[54]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Export targets`,-1),V(`div`,Jj,[(R(!0),z(L,null,F(c.outputs,(e,t)=>(R(),B(FA,{key:t,output:e,"format-indent":Number(c.indent)||0,"format-final-newline":c.finalNewline,locales:c.locales,adapters:n,"onUpdate:output":e=>c.outputs.splice(t,1,e),onRemove:e=>je(t)},null,8,[`output`,`format-indent`,`format-final-newline`,`locales`,`onUpdate:output`,`onRemove`]))),128)),c.outputs.length===0?(R(),z(`p`,Yj,`No export targets configured.`)):W(``,!0),V(`div`,null,[H(j(Q),{variant:`ghost`,size:`sm`,class:`mt-1 pl-2`,onClick:Ae},{default:M(()=>[H(j(od),{class:`size-4`}),t[53]||=U(` Add export target `,-1)]),_:1})])])])])):d.value===`ai`?(R(),z(`div`,Xj,[V(`div`,Zj,[H(j(Iy),{"model-value":C.value??`__none__`,"onUpdate:modelValue":t[5]||=e=>Be(e===`__none__`?null:e)},{default:M(()=>[H(j(iS),{class:`w-44`},{default:M(()=>[H(j(rb),{placeholder:`No profile`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`__none__`},{default:M(()=>[...t[55]||=[U(`No profile`,-1)]]),_:1}),(R(!0),z(L,null,F(Object.keys(S.value),e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[U(k(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]),C.value?(R(),B(j(rS),{key:0,modelValue:w.value,"onUpdate:modelValue":t[6]||=e=>w.value=e,class:`flex-1 font-medium`,placeholder:`Profile name`,onBlur:t[7]||=e=>He(C.value,w.value),onKeydown:t[8]||=Xl(q(e=>He(C.value,w.value),[`prevent`]),[`enter`])},null,8,[`modelValue`])):(R(),z(`span`,Qj,`Using default settings`)),H(j(Q),{variant:`outline`,size:`sm`,class:`shrink-0`,onClick:Ve},{default:M(()=>[H(j(od),{class:`size-4`}),t[56]||=U(` New `,-1)]),_:1}),H(j(Q),{variant:`ghost`,size:`sm`,class:`shrink-0 text-destructive hover:bg-destructive/10 hover:text-destructive`,disabled:!C.value,onClick:Ue},{default:M(()=>[H(j(kd),{class:`size-4`})]),_:1},8,[`disabled`])]),V(`div`,$j,[V(`div`,eM,[V(`div`,tM,[H(j(IS),{for:`ai-provider`},{default:M(()=>[...t[57]||=[U(`Provider`,-1)]]),_:1}),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0 translate-y-0.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-300 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0`},{default:M(()=>[ee.value?(R(),z(`span`,nM,[H(j(Du),{class:`size-3`}),t[58]||=U(` Saved `,-1)])):W(``,!0)]),_:1})]),H(j(Iy),{modelValue:T.provider,"onUpdate:modelValue":t[9]||=e=>T.provider=e},{default:M(()=>[H(j(iS),{id:`ai-provider`},{default:M(()=>[H(j(rb),{placeholder:`Select provider`})]),_:1}),H(j(aS),null,{default:M(()=>[(R(),z(L,null,F(r,e=>H(j(sS),{key:e.value,value:e.value},{default:M(()=>[U(k(e.label),1)]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`modelValue`]),V(`p`,rM,k(Le.value),1)]),V(`div`,iM,[H(j(IS),{for:`ai-model`},{default:M(()=>[...t[59]||=[U(`Model`,-1)]]),_:1}),H(j(rS),{id:`ai-model`,modelValue:T.model,"onUpdate:modelValue":t[10]||=e=>T.model=e,class:`font-mono`,placeholder:ze.value},null,8,[`modelValue`,`placeholder`]),Re.value.length?(R(),z(`p`,aM,[t[60]||=U(` Examples: `,-1),(R(!0),z(L,null,F(Re.value,(e,t)=>(R(),z(L,{key:e},[V(`button`,{type:`button`,class:`font-mono underline-offset-2 hover:text-foreground hover:underline`,onClick:t=>T.model=e},k(e),9,oM),t<Re.value.length-1?(R(),z(`span`,sM,` · `)):W(``,!0)],64))),128))])):W(``,!0)]),Fe.value?(R(),z(`div`,cM,[H(j(IS),{for:`ai-region`},{default:M(()=>[...t[61]||=[U(`Region`,-1)]]),_:1}),H(j(rS),{id:`ai-region`,modelValue:T.region,"onUpdate:modelValue":t[11]||=e=>T.region=e,class:`font-mono`,placeholder:`us-east-1`},null,8,[`modelValue`]),t[62]||=V(`p`,{class:`text-xs text-muted-foreground`},[U(`AWS region for Bedrock. Falls back to `),V(`code`,{class:`font-mono`},`AWS_REGION`),U(` if empty.`)],-1)])):(R(),z(`div`,lM,[H(j(IS),{for:`ai-endpoint`},{default:M(()=>[...t[63]||=[U(`Endpoint`,-1)]]),_:1}),H(j(rS),{id:`ai-endpoint`,modelValue:T.endpoint,"onUpdate:modelValue":t[12]||=e=>T.endpoint=e,class:`font-mono`,placeholder:Ie.value?`http://localhost:11434/v1`:`Default (leave empty)`},null,8,[`modelValue`,`placeholder`]),Ie.value?(R(),z(`p`,uM,[...t[64]||=[U(`Defaults to the local Ollama server. Override only for a remote instance — include the `,-1),V(`code`,{class:`font-mono`},`/v1`,-1),U(` suffix.`,-1)]])):(R(),z(`p`,dM,`Optional — for an in-region or self-hosted / OpenAI-compatible gateway.`))])),t[82]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Translation`,-1),V(`div`,fM,[H(j(IS),{for:`ai-batch`},{default:M(()=>[...t[65]||=[U(`Batch size`,-1)]]),_:1}),H(j(rS),{id:`ai-batch`,modelValue:T.batchSize,"onUpdate:modelValue":t[13]||=e=>T.batchSize=e,modelModifiers:{number:!0},type:`number`,min:`1`,class:`w-28`},null,8,[`modelValue`]),t[66]||=V(`p`,{class:`text-xs text-muted-foreground`},`Strings sent per request.`,-1)]),V(`div`,pM,[H(j(IS),{for:`ai-concurrency`},{default:M(()=>[...t[67]||=[U(`Parallel locales`,-1)]]),_:1}),H(j(rS),{id:`ai-concurrency`,modelValue:T.concurrency,"onUpdate:modelValue":t[14]||=e=>T.concurrency=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:`3`,class:`w-28`},null,8,[`modelValue`]),t[68]||=V(`p`,{class:`text-xs text-muted-foreground`},`How many locales to translate at once.`,-1)]),V(`div`,mM,[H(j(IS),{for:`ai-price-in`},{default:M(()=>[...t[69]||=[U(`Input price ($ / 1M tokens)`,-1)]]),_:1}),H(j(rS),{id:`ai-price-in`,modelValue:T.inputPricePerMTok,"onUpdate:modelValue":t[15]||=e=>T.inputPricePerMTok=e,modelModifiers:{number:!0},type:`number`,min:`0`,step:`0.01`,placeholder:`Auto for Claude models`,class:`w-44`},null,8,[`modelValue`])]),V(`div`,hM,[H(j(IS),{for:`ai-price-out`},{default:M(()=>[...t[70]||=[U(`Output price ($ / 1M tokens)`,-1)]]),_:1}),H(j(rS),{id:`ai-price-out`,modelValue:T.outputPricePerMTok,"onUpdate:modelValue":t[16]||=e=>T.outputPricePerMTok=e,modelModifiers:{number:!0},type:`number`,min:`0`,step:`0.01`,placeholder:`Auto for Claude models`,class:`w-44`},null,8,[`modelValue`]),t[71]||=V(`p`,{class:`text-xs text-muted-foreground`},`Used for the pre-translate cost estimate. Set both to override the built-in Claude prices or to price other models.`,-1)]),t[83]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Context build`,-1),V(`div`,gM,[H(j(IS),{for:`ai-context-batch`},{default:M(()=>[...t[72]||=[U(`Batch size`,-1)]]),_:1}),H(j(rS),{id:`ai-context-batch`,modelValue:T.contextBatchSize,"onUpdate:modelValue":t[17]||=e=>T.contextBatchSize=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:String(T.batchSize||25),class:`w-28`},null,8,[`modelValue`,`placeholder`]),t[73]||=V(`p`,{class:`text-xs text-muted-foreground`},`Keys per request. Defaults to translation batch size.`,-1)]),V(`div`,_M,[H(j(IS),{for:`ai-context-concurrency`},{default:M(()=>[...t[74]||=[U(`Concurrency`,-1)]]),_:1}),H(j(rS),{id:`ai-context-concurrency`,modelValue:T.contextConcurrency,"onUpdate:modelValue":t[18]||=e=>T.contextConcurrency=e,modelModifiers:{number:!0},type:`number`,min:`1`,placeholder:String(T.concurrency||3),class:`w-28`},null,8,[`modelValue`,`placeholder`]),t[75]||=V(`p`,{class:`text-xs text-muted-foreground`},`Parallel context requests. Defaults to parallel locales.`,-1)]),Ie.value?(R(),z(`div`,vM,[H(j(pS),{id:`ai-vision`,modelValue:T.vision,"onUpdate:modelValue":t[19]||=e=>T.vision=e},null,8,[`modelValue`]),V(`div`,yM,[H(j(IS),{for:`ai-vision`},{default:M(()=>[...t[76]||=[U(`Vision`,-1)]]),_:1}),t[77]||=V(`p`,{class:`text-xs text-muted-foreground`},`Enable for models that support image input (e.g. translategemma, llava).`,-1)])])):W(``,!0),Ie.value?(R(),z(`div`,bM,[H(j(IS),{for:`ai-prompt-style`},{default:M(()=>[...t[78]||=[U(`Prompt style`,-1)]]),_:1}),H(j(Iy),{"model-value":T.promptStyle||`__default__`,"onUpdate:modelValue":t[20]||=e=>T.promptStyle=e===`__default__`?``:e},{default:M(()=>[H(j(iS),{id:`ai-prompt-style`},{default:M(()=>[H(j(rb),{placeholder:`Default`})]),_:1}),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`__default__`},{default:M(()=>[...t[79]||=[U(`Default`,-1)]]),_:1}),H(j(sS),{value:`translategemma`},{default:M(()=>[...t[80]||=[U(`TranslateGemma`,-1)]]),_:1})]),_:1})]),_:1},8,[`model-value`]),t[81]||=V(`p`,{class:`text-xs text-muted-foreground`},`TranslateGemma uses a role-based system prompt and plain-text output instead of JSON batching.`,-1)])):W(``,!0)])])):d.value===`scan`?(R(),z(`div`,xM,[H(HA,{label:`Flutter accessors`,items:c.scanAccessors,mono:``,placeholder:`translations`,"onUpdate:items":t[21]||=e=>c.scanAccessors=e},{help:M(()=>[...t[84]||=[V(`p`,{class:`text-xs text-muted-foreground`},[U(` Accessors assigned from `),V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-[11px]`},`AppLocalizations.of(...)`),U(` are detected automatically. Add a name only if yours isn't found. `)],-1)]]),_:1},8,[`items`]),H(HA,{label:`Custom patterns`,items:c.scanPatterns,mono:``,placeholder:`LocaleKeys\\.(\\w+)\\.tr\\(\\)`,validate:qe,"onUpdate:items":t[22]||=e=>c.scanPatterns=e},{help:M(()=>[...t[85]||=[V(`p`,{class:`text-xs text-muted-foreground`},` Regex applied to every scanned file — capture group 1 is the key. `,-1)]]),_:1},8,[`items`]),H(HA,{label:`Include globs`,items:c.scanInclude,mono:``,placeholder:`lib/**`,"onUpdate:items":t[23]||=e=>c.scanInclude=e},{help:M(()=>[...t[86]||=[V(`p`,{class:`text-xs text-muted-foreground`},`Limit the scan to these globs. Empty scans everything.`,-1)]]),_:1},8,[`items`]),H(HA,{label:`Exclude globs`,items:c.scanExclude,mono:``,placeholder:`**/*.g.dart`,"onUpdate:items":t[24]||=e=>c.scanExclude=e},{help:M(()=>[...t[87]||=[V(`p`,{class:`text-xs text-muted-foreground`},`Skipped on top of always-excluded dirs (node_modules, build, …).`,-1)]]),_:1},8,[`items`])])):d.value===`quality`?(R(),z(`div`,SM,[V(`div`,null,[t[89]||=V(`div`,{class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},`Rules`,-1),V(`div`,CM,[(R(!0),z(L,null,F(j(Vk),e=>(R(),z(`div`,{key:e.id,class:`flex items-center justify-between gap-4 p-3.5`},[V(`div`,wM,[V(`div`,TM,[U(k(e.label)+` `,1),V(`code`,EM,k(e.id),1)]),V(`div`,DM,k(e.description),1)]),H(j(Iy),{"model-value":c.lintRules[e.id]??e.default,"onUpdate:modelValue":t=>c.lintRules={...c.lintRules,[e.id]:t}},{default:M(()=>[H(j(iS),{class:O([`w-32 shrink-0`,c.lintRules[e.id]===`off`?`text-muted-foreground`:``])},{default:M(()=>[H(j(rb))]),_:1},8,[`class`]),H(j(aS),null,{default:M(()=>[H(j(sS),{value:`error`},{default:M(()=>[U(`Error`+k(e.default===`error`?` ·`:``),1)]),_:2},1024),H(j(sS),{value:`warn`},{default:M(()=>[U(`Warning`+k(e.default===`warn`?` ·`:``),1)]),_:2},1024),H(j(sS),{value:`off`},{default:M(()=>[...t[88]||=[U(`Off`,-1)]]),_:1})]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])]))),128))]),t[90]||=V(`p`,{class:`mt-2 text-xs text-muted-foreground`},`· marks the built-in default.`,-1)]),H(HA,{label:`Ignore keys`,items:c.lintIgnore,mono:``,placeholder:`legacy.*`,"onUpdate:items":t[25]||=e=>c.lintIgnore=e},{help:M(()=>[...t[91]||=[V(`p`,{class:`text-xs text-muted-foreground`},` Key globs excluded from every check — for legacy or generated keys you don't maintain. `,-1)]]),_:1},8,[`items`])])):d.value===`dictionary`?(R(),z(`div`,OM,[V(`div`,kM,[(R(!0),z(L,null,F(c.customWords,e=>(R(),z(`span`,{key:e,class:`inline-flex items-center gap-1.5 rounded-lg border bg-accent px-2.5 py-1.5 font-mono text-sm`},[U(k(e)+` `,1),V(`button`,{type:`button`,class:`flex size-[18px] items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,"aria-label":`Remove ${e}`,onClick:t=>Ke(e)},[H(j(kd),{class:`size-3`})],8,AM)]))),128)),c.customWords.length===0?(R(),z(`p`,jM,`No custom words yet.`)):W(``,!0)]),V(`div`,MM,[H(j(IS),{for:`add-word`},{default:M(()=>[...t[92]||=[U(`Add word`,-1)]]),_:1}),V(`div`,NM,[H(j(rS),{id:`add-word`,modelValue:We.value,"onUpdate:modelValue":t[26]||=e=>We.value=e,class:`font-mono`,placeholder:`Glotfile`,onKeydown:Xl(q(Ge,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),H(j(Q),{variant:`outline`,onClick:Ge},{default:M(()=>[H(j(od),{class:`size-4`}),t[93]||=U(` Add`,-1)]),_:1})])])])):d.value===`editor`?(R(),z(`div`,PM,[V(`div`,FM,[V(`div`,IM,[H(j(IS),{for:`editor-select`},{default:M(()=>[...t[94]||=[U(`Editor`,-1)]]),_:1}),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0 translate-y-0.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-300 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0`},{default:M(()=>[fe.value?(R(),z(`span`,LM,[H(j(Du),{class:`size-3`}),t[95]||=U(` Saved `,-1)])):W(``,!0)]),_:1})]),H(j(Iy),{"model-value":j(Dw),"onUpdate:modelValue":me},{default:M(()=>[H(j(iS),{id:`editor-select`},{default:M(()=>[H(j(rb),{placeholder:`Select editor`})]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(j(ww),e=>(R(),B(j(sS),{key:e.id,value:e.id},{default:M(()=>[U(k(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])]),V(`p`,RM,[H(j(ed),{class:`size-3.5`}),t[96]||=U(` Stored locally in `,-1),t[97]||=V(`code`,{class:`rounded border bg-muted px-1 py-0.5 font-mono text-xs`},`.glotfile/`,-1),t[98]||=U(` — clicking a usage opens the file via its URL scheme. `,-1)])])):W(``,!0)])]),se.includes(d.value)?W(``,!0):(R(),z(`div`,{key:0,class:O([`absolute bottom-5 left-1/2 flex min-w-[400px] max-w-[calc(100%-3.5rem)] -translate-x-1/2 items-center gap-3 rounded-[14px] border bg-card px-4 py-2.5 shadow-lg transition-[border-color,box-shadow]`,le.value>0?`border-primary/40 shadow-primary/10`:`border-border`])},[V(`span`,{class:O([`flex min-w-0 flex-1 items-center gap-2 overflow-hidden text-ellipsis whitespace-nowrap text-[13px]`,le.value>0?`text-foreground`:`text-muted-foreground`])},[le.value>0?(R(),z(L,{key:0},[V(`span`,zM,k(le.value),1),U(` Unsaved `+k(le.value===1?`change`:`changes`)+` in `,1),V(`strong`,BM,k(ue.value.join(`, `)),1)],64)):(R(),z(L,{key:1},[H(j(Du),{class:`size-3.5 shrink-0`}),t[99]||=U(` All changes saved `,-1)],64))],2),V(`div`,VM,[H(j(Q),{variant:`ghost`,size:`sm`,disabled:le.value===0,onClick:t[27]||=e=>f.value=!f.value},{default:M(()=>[H(j(Ed),{class:`size-4`}),t[100]||=U(` Discard `,-1)]),_:1},8,[`disabled`]),f.value?(R(),z(`div`,HM,[t[103]||=V(`p`,{class:`text-[13px] font-semibold`},`Discard all changes?`,-1),V(`p`,UM,` Reverts every unsaved edit in `+k(ue.value.join(`, `))+`. `,1),V(`div`,WM,[H(j(Q),{size:`sm`,variant:`outline`,onClick:t[28]||=e=>f.value=!1},{default:M(()=>[...t[101]||=[U(`Keep editing`,-1)]]),_:1}),H(j(Q),{size:`sm`,variant:`destructive`,onClick:ye},{default:M(()=>[...t[102]||=[U(`Discard`,-1)]]),_:1})])])):W(``,!0)]),H(j(Q),{size:`sm`,disabled:le.value===0||u.value,onClick:ve},{default:M(()=>[H(j(ud),{class:`size-4`}),t[104]||=U(` Save changes `,-1)]),_:1},8,[`disabled`])],2))])])):(R(),z(`div`,UA,` Loading settings… `)),H(gc,{"enter-active-class":`transition duration-150 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-100 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:M(()=>[g.value?(R(),z(`div`,{key:0,class:`fixed inset-0 z-[70] flex items-center justify-center bg-background/70 p-6 backdrop-blur-sm`,onClick:q(Se,[`self`])},[V(`div`,GM,[V(`h3`,KM,[H(j(Td),{class:`size-4 text-amber-500`}),t[105]||=U(` Unsaved changes `,-1)]),V(`p`,qM,[U(` You have `+k(le.value)+` unsaved `+k(le.value===1?`change`:`changes`)+` in `,1),V(`strong`,JM,k(ue.value.join(`, `)),1),t[106]||=U(`. `,-1),V(`span`,YM,`Leaving now discards `+k(le.value===1?`it`:`them`)+`.`,1)]),V(`div`,XM,[H(j(Q),{size:`sm`,variant:`outline`,class:`mr-auto`,onClick:Se},{default:M(()=>[...t[107]||=[U(`Keep editing`,-1)]]),_:1}),H(j(Q),{size:`sm`,variant:`destructive`,onClick:Ce},{default:M(()=>[H(j(Ed),{class:`size-4`}),t[108]||=U(` Discard & leave `,-1)]),_:1}),H(j(Q),{size:`sm`,disabled:u.value,onClick:we},{default:M(()=>[H(j(ud),{class:`size-4`}),t[109]||=U(` Save & leave `,-1)]),_:1},8,[`disabled`])])])])):W(``,!0)]),_:1}),H(gc,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0 -translate-y-1.5`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0 -translate-y-1.5`},{default:M(()=>[_.value?(R(),z(`div`,ZM,[H(j(Du),{class:`size-3.5`}),t[110]||=U(` Settings saved `,-1)])):W(``,!0)]),_:1})],64))}}),$M={class:`min-h-0 flex-1 overflow-y-auto`},eN={key:0,class:`flex h-full items-center justify-center p-8 text-sm text-muted-foreground`},tN={key:1,class:`flex h-full items-center justify-center p-8`},nN={class:`flex max-w-md flex-col items-center gap-3 text-center text-muted-foreground`},rN={key:2,class:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-3 p-6`},iN=[`onClick`],aN={class:`flex aspect-video items-center justify-center overflow-hidden border-b bg-muted/30`},oN=[`src`,`alt`],sN={class:`flex flex-col gap-0.5 p-2.5`},cN={class:`truncate font-mono text-xs font-medium`},lN={class:`truncate text-xs text-muted-foreground`},uN={key:1,class:`truncate text-xs text-muted-foreground`},dN={class:`flex max-h-[70vh] items-center justify-center overflow-auto rounded-md border bg-muted/30 p-2`},fN=[`src`,`alt`],pN={key:0,class:`text-sm text-muted-foreground`},mN=P({__name:`ScreenshotsView`,setup(e){let t=fn(null),n=A(!1),r=A(null);async function i(){t.value=await jd(),n.value=!0}i();let a=K(()=>t.value?.config.sourceLocale??``),o=K(()=>{let e=t.value;return e?Object.entries(e.keys).filter(([,e])=>!!e.screenshot).map(([e,t])=>({key:e,entry:t,screenshot:t.screenshot,source:t.values[a.value]?.value??``})).sort((e,t)=>e.key.localeCompare(t.key)):[]});return(e,t)=>(R(),z(`div`,$M,[n.value?o.value.length===0?(R(),z(`div`,tN,[V(`div`,nN,[H(j(Ju),{class:`size-8 opacity-60`}),t[2]||=V(`p`,{class:`text-sm`},` No screenshots yet — add one from a key's detail panel in the Editor. `,-1)])])):(R(),z(`div`,rN,[(R(!0),z(L,null,F(o.value,e=>(R(),z(`button`,{key:e.key,type:`button`,class:`group flex flex-col overflow-hidden rounded-lg border bg-card text-left shadow-sm transition-colors hover:border-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t=>r.value=e},[V(`div`,aN,[V(`img`,{src:`/`+e.screenshot,alt:`Screenshot for ${e.key}`,class:`h-full w-full object-contain`},null,8,oN)]),V(`div`,sN,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,cN,k(e.key),1)]),_:2},1024),H(j(ZS),{class:`font-mono`},{default:M(()=>[U(k(e.key),1)]),_:2},1024)]),_:2},1024),e.source?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,lN,k(e.source),1)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(k(e.source),1)]),_:2},1024)]),_:2},1024)):(R(),z(`span`,uN,`—`))])],8,iN))),128))])):(R(),z(`div`,eN,` Loading screenshots… `)),H(j(bh),{open:r.value!==null,"onUpdate:open":t[1]||=e=>{e||(r.value=null)}},{default:M(()=>[r.value?(R(),B(j(LS),{key:0,class:`max-w-3xl`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),{class:`break-all font-mono text-sm`},{default:M(()=>[U(k(r.value.key),1)]),_:1}),H(j(VS),null,{default:M(()=>[U(k(r.value.source||`—`),1)]),_:1})]),_:1}),V(`div`,dN,[V(`img`,{src:`/`+r.value.screenshot,alt:`Screenshot for ${r.value.key}`,class:`max-h-[65vh] w-auto object-contain`},null,8,fN)]),r.value.entry.context?(R(),z(`p`,pN,[t[3]||=V(`span`,{class:`font-medium text-foreground`},`Context:`,-1),U(` `+k(r.value.entry.context),1)])):W(``,!0),H(j(zS),null,{default:M(()=>[H(j(Q),{size:`sm`,onClick:t[0]||=e=>j(Op)(r.value.key)},{default:M(()=>[H(j(yd),{class:`size-4`}),t[4]||=U(` Open in editor `,-1)]),_:1})]),_:1})]),_:1})):W(``,!0)]),_:1},8,[`open`])]))}}),hN={class:`min-h-0 flex-1 overflow-y-auto p-4`},gN={key:0,class:`mt-8 text-center text-sm text-muted-foreground`},_N={key:1,class:`mx-auto flex max-w-4xl flex-col gap-4`},vN={key:0,class:`flex flex-wrap gap-1.5`},yN=[`onClick`],bN={class:`flex flex-wrap items-center gap-3 border-b px-4 py-2.5`},xN={class:`text-sm font-medium`},SN={class:`text-sm text-muted-foreground`},CN={class:`border-b`},wN={class:`overflow-x-auto whitespace-pre-wrap break-words bg-muted/40 px-4 py-3 font-mono text-xs leading-relaxed`},TN={class:`divide-y`},EN={class:`flex items-center gap-2`},DN={class:`truncate font-mono text-xs text-muted-foreground`},ON={class:`flex items-start gap-2 text-sm`},kN={class:`min-w-0 flex-1 break-words`},AN={class:`min-w-0 flex-1 break-words`},jN={key:0,class:`text-destructive`},MN={key:1},NN={key:0,class:`text-xs text-muted-foreground`},PN={key:1,class:`flex flex-wrap gap-1`},FN={key:2,class:`flex items-center gap-1.5 text-xs text-muted-foreground`},IN={class:`truncate font-mono`},LN={key:1,class:`flex flex-col gap-1.5 px-4 py-3`},RN={key:0,class:`flex items-center gap-2`},zN={class:`truncate font-mono text-xs text-muted-foreground`},BN={key:1,class:`flex items-start gap-2 text-sm`},VN=P({__name:`ActivityView`,setup(e){let t=A([]),n=A(!0),r=A(`all`);Ki(async()=>{try{t.value=await vf()}catch(e){$.error(e.message)}finally{n.value=!1}});let i=e=>e.kind===`translate`||e.kind===`context`,a=K(()=>[...new Set(t.value.map(e=>e.kind))]),o=K(()=>r.value===`all`?t.value:t.value.filter(e=>e.kind===r.value)),s=e=>eS(`rounded-full border px-2.5 py-0.5 text-xs transition-colors`,r.value===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted`);function c(e,t){return e.results?.find(e=>e.id===t)}function l(e){return e.doNotTranslate?`${e.term} (do-not-translate)`:e.forced?`${e.term} → ${e.forced}`:e.term}function u(e){return e==null||e===``?`∅`:typeof e==`string`?e:JSON.stringify(e)}let d=e=>typeof e==`object`&&!!e;return(e,f)=>(R(),z(`div`,hN,[!n.value&&t.value.length===0?(R(),z(`p`,gN,` No activity yet — edits, translations, and config changes will show up here. `)):(R(),z(`div`,_N,[a.value.length>1?(R(),z(`div`,vN,[V(`button`,{type:`button`,class:O(s(`all`)),onClick:f[0]||=e=>r.value=`all`},`All`,2),(R(!0),z(L,null,F(a.value,e=>(R(),z(`button`,{key:e,type:`button`,class:O(s(e)),onClick:t=>r.value=e},k(e),11,yN))),128))])):W(``,!0),(R(!0),z(L,null,F(o.value,(e,t)=>(R(),z(`article`,{key:`${e.at}-${t}`,class:`rounded-lg border bg-card`},[V(`header`,bN,[V(`span`,xN,k(new Date(e.at).toLocaleString()),1),H(j(dS),{variant:`outline`,class:`font-mono uppercase`},{default:M(()=>[U(k(e.kind),1)]),_:2},1024),V(`span`,SN,k(e.summary),1),e.model?(R(),B(j(dS),{key:0,variant:`secondary`,class:`ml-auto font-mono`},{default:M(()=>[U(k(e.model),1)]),_:2},1024)):W(``,!0)]),i(e)?(R(),z(L,{key:0},[V(`details`,CN,[f[1]||=V(`summary`,{class:`cursor-pointer select-none px-4 py-2 text-xs font-medium text-muted-foreground hover:text-foreground`},` System prompt `,-1),V(`pre`,wN,k(e.system),1)]),V(`ul`,TN,[(R(!0),z(L,null,F(e.items,t=>(R(),z(`li`,{key:t.id,class:`flex flex-col gap-1.5 px-4 py-3`},[V(`div`,EN,[V(`span`,DN,k(t.key),1),t.targetLocale?(R(),B(j(dS),{key:0,variant:`outline`,class:`shrink-0 font-mono uppercase`},{default:M(()=>[U(k(t.targetLocale),1)]),_:2},1024)):W(``,!0)]),V(`div`,ON,[V(`span`,kN,k(t.source),1),H(j(bu),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),V(`span`,AN,[c(e,t.id)?.error?(R(),z(`span`,jN,k(c(e,t.id)?.error),1)):(R(),z(`span`,MN,k(c(e,t.id)?.translation??c(e,t.id)?.value),1))])]),t.context?(R(),z(`p`,NN,k(t.context),1)):W(``,!0),t.glossary?.length?(R(),z(`div`,PN,[(R(!0),z(L,null,F(t.glossary,e=>(R(),z(`span`,{key:e.term,class:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`},k(l(e)),1))),128))])):W(``,!0),t.screenshot?(R(),z(`div`,FN,[H(j(Yu),{class:`size-3.5 shrink-0`}),V(`span`,IN,k(t.screenshot),1)])):W(``,!0)]))),128))])],64)):e.key||e.before!==void 0||e.after!==void 0?(R(),z(`div`,LN,[e.key?(R(),z(`div`,RN,[V(`span`,zN,k(e.key),1),e.locale?(R(),B(j(dS),{key:0,variant:`outline`,class:`shrink-0 font-mono uppercase`},{default:M(()=>[U(k(e.locale),1)]),_:2},1024)):W(``,!0)])):W(``,!0),e.before!==void 0||e.after!==void 0?(R(),z(`div`,BN,[e.before===void 0?W(``,!0):(R(),z(`span`,{key:0,class:O(j(eS)(`min-w-0 flex-1 break-words text-muted-foreground`,d(e.before)&&`font-mono text-xs`))},k(u(e.before)),3)),e.before!==void 0&&e.after!==void 0?(R(),B(j(bu),{key:1,class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})):W(``,!0),e.after===void 0?W(``,!0):(R(),z(`span`,{key:2,class:O(j(eS)(`min-w-0 flex-1 break-words`,d(e.after)&&`font-mono text-xs`))},k(u(e.after)),3))])):W(``,!0)])):W(``,!0)]))),128))]))]))}}),HN=[{id:`home`,title:`Home`,section:``,html:`<h1>Glotfile</h1>
|
|
8
8
|
<blockquote>
|
|
9
9
|
<p>A <strong>local-first, git-native translation manager</strong>. All of your app's copy lives in one JSON file you commit to your repo. You edit and AI-translate it through a local web UI, then export to whatever locale formats your apps consume — no SaaS, no hosted database, nothing leaves your machine except the AI calls you choose to make.</p>
|
|
10
10
|
</blockquote>
|
|
@@ -32,7 +32,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
32
32
|
<h2>The command line</h2>
|
|
33
33
|
<ul>
|
|
34
34
|
<li>CLI Overview — every command at a glance</li>
|
|
35
|
-
<li>serve · translate · export · lint and check · import
|
|
35
|
+
<li>serve · translate · export · lint and check · import</li>
|
|
36
36
|
</ul>
|
|
37
37
|
<h2>AI translation</h2>
|
|
38
38
|
<ul>
|
|
@@ -56,7 +56,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
56
56
|
<ul>
|
|
57
57
|
<li>Troubleshooting and FAQ</li>
|
|
58
58
|
</ul>
|
|
59
|
-
`},{id:`getting-started/installation`,title:`Installation`,section:`Getting Started`,html:`<h1>Installation</h1>
|
|
59
|
+
`,text:`Glotfile A local-first, git-native translation manager . All of your app's copy lives in one JSON file you commit to your repo. You edit and AI-translate it through a local web UI, then export to whatever locale formats your apps consume — no SaaS, no hosted database, nothing leaves your machine except the AI calls you choose to make. This is the home page of the user guide. Everything is linked from here. Start here - Installation — requirements and how to run Glotfile - Quick Start — from zero to translated strings in five minutes - Translation Workflow — the day-to-day loop, end to end Core concepts - The State File — , the single source of truth - Keys and Locales — how strings and languages are organised - Review States — → → / - Plurals — CLDR plural forms - Glossary — do-not-translate and forced terms - Key Context and Metadata — context, notes, tags, length limits, screenshots The web UI - Web UI Overview — the panels and how they fit together - Editor · Analytics · Screenshots · Settings · AI Log The command line - CLI Overview — every command at a glance - serve · translate · export · lint and check · import AI translation - How Translation Works — what the translator does for you - AI Providers — Anthropic, OpenAI, AWS Bedrock, and OpenRouter setup Reference - Output Formats — the six export adapters - Checks and Validation — every rule and what it catches - Configuration Reference — every field in - Placeholders and ICU — what's preserved across formats Guides - Translation Workflow — author → translate → review → export - Continuous Integration — gate merges on translation health - Keeping Translations Fresh — handling source changes Help - Troubleshooting and FAQ`},{id:`getting-started/installation`,title:`Installation`,section:`Getting Started`,html:`<h1>Installation</h1>
|
|
60
60
|
<h2>Requirements</h2>
|
|
61
61
|
<ul>
|
|
62
62
|
<li><strong>Node.js</strong> <code>^20.19.0 || >=22.12.0</code></li>
|
|
@@ -84,7 +84,7 @@ node bin/glotfile.js # equivalent to the \`glotfile\` command
|
|
|
84
84
|
<li>If not, it starts from sensible defaults and <strong>writes the file as soon as you make your first edit</strong>.</li>
|
|
85
85
|
</ul>
|
|
86
86
|
<blockquote>
|
|
87
|
-
<p><strong>Info:</strong> Already have locale files? —
|
|
87
|
+
<p><strong>Info:</strong> Already have locale files? — Import an existing project by reading your current <code>.arb</code> / <code>.php</code> / <code>.json</code> files <em>into</em> the catalog with <code>glotfile import</code> — see import.</p>
|
|
88
88
|
</blockquote>
|
|
89
89
|
<h2>Targeting a different file</h2>
|
|
90
90
|
<p>Every command accepts <code>--file</code> (<code>-f</code>) to use a state file other than <code>./glotfile.json</code>:</p>
|
|
@@ -99,7 +99,7 @@ node bin/glotfile.js # equivalent to the \`glotfile\` command
|
|
|
99
99
|
<li>Quick Start — translate your first strings</li>
|
|
100
100
|
<li>The State File — understand what <code>glotfile.json</code> holds</li>
|
|
101
101
|
</ul>
|
|
102
|
-
`},{id:`getting-started/quick-start`,title:`Quick Start`,section:`Getting Started`,html:`<h1>Quick Start</h1>
|
|
102
|
+
`,text:`Installation Requirements - Node.js That's the only hard requirement. Everything except AI translation runs fully offline, with no account and no network access. Running Glotfile Glotfile is designed to run with no install via : ⚠ Pre-1.0: run from a checkout for now — Glotfile is pre-1.0 and not yet published to npm. Until it is, run it from a clone of the repo: Once published, and a global install will both work. Throughout these docs, and are interchangeable. First run Run Glotfile from the root of the project whose copy you want to manage: This starts a local server bound to , opens your browser, and: - If a already exists in the current directory, it loads it. - If not, it starts from sensible defaults and writes the file as soon as you make your first edit . Info: Already have locale files? — Import an existing project by reading your current / / files into the catalog with — see import. Targeting a different file Every command accepts ( ) to use a state file other than : Developing Glotfile itself If you're hacking on Glotfile (not just using it), run the Vite UI with hot-reload alongside the server: Next steps - Quick Start — translate your first strings - The State File — understand what holds`},{id:`getting-started/quick-start`,title:`Quick Start`,section:`Getting Started`,html:`<h1>Quick Start</h1>
|
|
103
103
|
<p>This walks you from an empty project to translated, exported strings. It assumes you've done Installation.</p>
|
|
104
104
|
<h2>1. Start the UI</h2>
|
|
105
105
|
<p>From your project root:</p>
|
|
@@ -159,7 +159,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
159
159
|
<li>Continuous Integration — keep translations healthy in CI</li>
|
|
160
160
|
<li>The State File — what's actually in <code>glotfile.json</code></li>
|
|
161
161
|
</ul>
|
|
162
|
-
`},{id:`web-ui/ai-log`,title:`AI Log`,section:`Web UI`,html:`<h1>AI Log</h1>
|
|
162
|
+
`,text:`Quick Start This walks you from an empty project to translated, exported strings. It assumes you've done Installation. 1. Start the UI From your project root: Your browser opens the Editor. If there's no yet, Glotfile uses defaults and writes the file on your first edit. 2. Add your languages Open Settings and set: - Source locale — the language you author in (e.g. ). - Locales — every language you want to maintain (e.g. , , ). See Keys and Locales for how locales work. 3. Add keys and source copy In the Editor, add a key in dot notation and type its source string: Key (source) --- --- The source value is saved with the state . 4. AI-translate the rest Info: One-time setup — AI translation needs an API key in your environment. The default provider is Anthropic — set (a local file works). See AI Providers for OpenAI and AWS Bedrock. Fill the empty languages — from the Editor's translate action, or the CLI: New translations are written as state. Glotfile never overwrites a value you've marked . See How Translation Works. 5. Review Back in the Editor, filter to machine to see unreviewed translations. Promote the good ones to ; flag the rest. See Review States. 6. Export to your app's formats Configure where files go in Settings (or Output Formats), then: This writes the locale files for every configured output (Flutter ARB, Laravel PHP, i18next JSON, and more — see Output Formats). 7. Commit Commit together with your code. The diff is the review: Because the catalog is just a file in your repo, branching, pull-request review, and rollback work exactly the way they already do for code. Where to go next - Translation Workflow — the same loop, in depth - Continuous Integration — keep translations healthy in CI - The State File — what's actually in`},{id:`web-ui/ai-log`,title:`AI Log`,section:`Web UI`,html:`<h1>AI Log</h1>
|
|
163
163
|
<p>The AI Log is a record of recent translation runs — what was sent to the provider and what came back. It's useful for understanding why a translation turned out the way it did, and for auditing what left your machine.</p>
|
|
164
164
|
<h2>What each entry records</h2>
|
|
165
165
|
<p>For every run:</p>
|
|
@@ -182,7 +182,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
182
182
|
<ul>
|
|
183
183
|
<li>How Translation Works · AI Providers</li>
|
|
184
184
|
</ul>
|
|
185
|
-
`},{id:`web-ui/analytics`,title:`Analytics`,section:`Web UI`,html:`<h1>Analytics</h1>
|
|
185
|
+
`,text:`AI Log The AI Log is a record of recent translation runs — what was sent to the provider and what came back. It's useful for understanding why a translation turned out the way it did, and for auditing what left your machine. What each entry records For every run: - When it ran and the model used. - The system prompt that framed the request. - Per string: the key , source , target locale , the context and relevant glossary hints sent, and whether the key had a screenshot . - The results returned (translation or plural forms, or an error). What it deliberately does not record ⚠ The log is egress-only and credential-free - No API keys are ever written to the log (or to ). - No screenshot bytes — only the fact that a key had one. In other words: the AI Log shows exactly what crossed the network boundary, and nothing more. Related - How Translation Works · AI Providers`},{id:`web-ui/analytics`,title:`Analytics`,section:`Web UI`,html:`<h1>Analytics</h1>
|
|
186
186
|
<p>The Analytics panel answers one question — <strong>can I ship?</strong> — plus the detail behind the answer: how complete and how reviewed your catalog is per locale, and what's blocking a release.</p>
|
|
187
187
|
<h2>The release gate</h2>
|
|
188
188
|
<p>The "Ready to ship" verdict is computed from the <strong>same lint report as <code>glotfile check</code></strong>: the lint rules over your catalog plus the output-drift check. If the CLI fails, the panel shows the same blockers, and vice versa — the two can never disagree.</p>
|
|
@@ -223,7 +223,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
223
223
|
<ul>
|
|
224
224
|
<li>Review States · Editor · Checks and Validation · Lint and Check (CLI)</li>
|
|
225
225
|
</ul>
|
|
226
|
-
`},{id:`web-ui/editor`,title:`Editor`,section:`Web UI`,html:`<h1>Editor</h1>
|
|
226
|
+
`,text:`Analytics The Analytics panel answers one question — can I ship? — plus the detail behind the answer: how complete and how reviewed your catalog is per locale, and what's blocking a release. The release gate The "Ready to ship" verdict is computed from the same lint report as : the lint rules over your catalog plus the output-drift check. If the CLI fails, the panel shows the same blockers, and vice versa — the two can never disagree. A locale is Ready when it clears the gate: - 100% translated (no errors) - 0 lint errors (placeholder mismatches, glossary violations, …) - Outputs exported (no stale files on disk) - Nothing stale (no needs-review strings; these mark a locale Almost rather than blocked) Reviewed state is optional — a fully machine-translated locale can ship. Skipping rules The gate honors in , exactly like the CLI. Set a rule to to skip it in both places, or change its severity: Rules at severity block the release; rules surface as warnings only. See Checks and Validation for the full rule list. Totals At the top: total keys, number of locales, overall translated % and reviewed % , open issues, and the source word count. Per locale For each target locale: - Verdict against the release gate ( Ready / Almost / Blocked ) with its blockers - Translated % and a breakdown of states: reviewed, needs-review, machine, missing - Breaking and warning counts from the lint report Click any locale, issue, or worklist item to drill into the matching strings in the Editor. Tip: Reviewed ≠ translated — a locale can be 100% translated (no missing values) but only 40% reviewed . The two percentages together tell you whether you have copy at all, and whether a human has signed off on it. Related - Review States · Editor · Checks and Validation · Lint and Check (CLI)`},{id:`web-ui/editor`,title:`Editor`,section:`Web UI`,html:`<h1>Editor</h1>
|
|
227
227
|
<p>The Editor is a table of every key with the source string and each target language side by side. It's built to stay fast with thousands of keys (only visible rows are rendered).</p>
|
|
228
228
|
<h2>Working with keys</h2>
|
|
229
229
|
<ul>
|
|
@@ -259,7 +259,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
259
259
|
<ul>
|
|
260
260
|
<li>Review States · Key Context and Metadata · Analytics · translate</li>
|
|
261
261
|
</ul>
|
|
262
|
-
`},{id:`web-ui/screenshots`,title:`Screenshots`,section:`Web UI`,html:`<h1>Screenshots</h1>
|
|
262
|
+
`,text:`Editor The Editor is a table of every key with the source string and each target language side by side. It's built to stay fast with thousands of keys (only visible rows are rendered). Working with keys - Add a key (dot-notation name + source value). - Rename a key inline. - Delete a key. - Edit values inline — click a cell, type, commit. Editing values - Press Enter to commit an edit, Escape to cancel. - Use ↑ / ↓ arrow keys to move between rows. - Plural keys open a dedicated per-category form editor. Each value shows a state badge you can toggle as you review ( → / ). Filtering and search Free-text search plus state facets let you focus: - missing — values with no content - machine — AI translations not yet reviewed - needs-review — flagged values (e.g. source changed) - reviewed — human-approved values - needs attention — any key with an open issue You can also filter by tag and narrow to a single locale. Per-key detail panel Selecting a key opens its detail panel for metadata: context , notes , tags , max length , screenshot , the skip-translate flag, and the plural marker. Translating from the Editor The translate action runs AI translation for the current selection/filter — the same engine as . Results come back as and never overwrite values. Exporting from the Editor The export action opens a preview of exactly what will write, before any files are touched. See Output Formats. Related - Review States · Key Context and Metadata · Analytics · translate`},{id:`web-ui/screenshots`,title:`Screenshots`,section:`Web UI`,html:`<h1>Screenshots</h1>
|
|
263
263
|
<p>A screenshot attached to a key shows <em>where</em> a string appears in your UI. Vision-capable AI models use it as context, which markedly improves ambiguous strings.</p>
|
|
264
264
|
<h2>Attaching a screenshot</h2>
|
|
265
265
|
<p>Attach an image to a key from its detail panel in the Editor, or manage images across keys in the <strong>Screenshots</strong> panel.</p>
|
|
@@ -277,7 +277,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
277
277
|
<ul>
|
|
278
278
|
<li>Key Context and Metadata · How Translation Works · AI Providers</li>
|
|
279
279
|
</ul>
|
|
280
|
-
`},{id:`web-ui/settings`,title:`Settings`,section:`Web UI`,html:`<h1>Settings</h1>
|
|
280
|
+
`,text:`Screenshots A screenshot attached to a key shows where a string appears in your UI. Vision-capable AI models use it as context, which markedly improves ambiguous strings. Attaching a screenshot Attach an image to a key from its detail panel in the Editor, or manage images across keys in the Screenshots panel. How the AI uses them During translation, a key's screenshot is sent only to vision-capable models : - Supported: Anthropic, OpenAI (gpt-4o-class), AWS Bedrock (Nova, Claude). - Not supported: AWS Bedrock Meta Llama text models — those runs proceed text-only and print a warning noting how many screenshots were skipped. So screenshots are always safe to attach: models that can't see them simply ignore them. See AI Providers for the full support matrix. Info: Screenshots never appear in the AI log — the AI Log records what was sent to a provider, but not the image bytes themselves — only that a key had a screenshot. Related - Key Context and Metadata · How Translation Works · AI Providers`},{id:`web-ui/settings`,title:`Settings`,section:`Web UI`,html:`<h1>Settings</h1>
|
|
281
281
|
<p>The Settings panel edits the <code>config</code> block of <code>glotfile.json</code>. Every field here is also documented in the Configuration Reference.</p>
|
|
282
282
|
<h2>What you can configure</h2>
|
|
283
283
|
<ul>
|
|
@@ -297,7 +297,7 @@ git commit -m "Add sign-in copy + translations"
|
|
|
297
297
|
<ul>
|
|
298
298
|
<li>Configuration Reference · Output Formats · AI Providers · Checks and Validation</li>
|
|
299
299
|
</ul>
|
|
300
|
-
`},{id:`web-ui/web-ui-overview`,title:`Web UI Overview`,section:`Web UI`,html:`<h1>Web UI Overview</h1>
|
|
300
|
+
`,text:`Settings The Settings panel edits the block of . Every field here is also documented in the Configuration Reference. What you can configure - Source locale — the language you author in. - Locales — the languages you maintain (add / remove). See Keys and Locales. - Outputs — the export targets: adapter + path template per entry. See Output Formats. - AI — provider, model, endpoint, region, and batch size. See AI Providers. - Formatting — indent, sort keys, final newline (controls how is written). - Custom dictionary — words the spelling check should accept. Save behaviour Most edits across the UI save immediately to . In Settings, some changes are explicit: ⚠ Dictionary changes require an explicit save — edits to the custom spelling dictionary are staged and only written when you Save , so you can add several words without a write (and a git diff) per keystroke. Related - Configuration Reference · Output Formats · AI Providers · Checks and Validation`},{id:`web-ui/web-ui-overview`,title:`Web UI Overview`,section:`Web UI`,html:`<h1>Web UI Overview</h1>
|
|
301
301
|
<p><code>glotfile serve</code> (or just <code>glotfile</code>) opens a single-page app for managing your catalog. It runs locally, bound to <code>127.0.0.1</code>, and writes changes straight back to <code>glotfile.json</code>.</p>
|
|
302
302
|
<h2>The panels</h2>
|
|
303
303
|
<p>A nav rail switches between six panels:</p>
|
|
@@ -346,48 +346,101 @@ git commit -m "Add sign-in copy + translations"
|
|
|
346
346
|
<li>CLI Overview — the same operations without the browser</li>
|
|
347
347
|
<li>Quick Start — a guided first run</li>
|
|
348
348
|
</ul>
|
|
349
|
-
`},{id:`cli/
|
|
349
|
+
`,text:`Web UI Overview (or just ) opens a single-page app for managing your catalog. It runs locally, bound to , and writes changes straight back to . The panels A nav rail switches between six panels: Panel What it's for --- --- Editor The heart of the app — a searchable, filterable table of every key with the source and each translation side by side. Analytics Coverage and review progress per locale, namespace, and tag. Screenshots Attach and review images that give the AI visual context. Glossary Manage do-not-translate and forced terms — see Glossary. Settings Edit the block: locales, outputs, AI provider, formatting, dictionary. AI Log A record of recent translation runs (egress only). Cross-cutting features - Checks — the UI continuously surfaces issues (missing values, placeholder mismatches, length and glossary violations) so you can fix them as you go. - Export preview — before writing files, preview exactly what will produce. See Output Formats. - Save semantics — most edits save immediately to . A few settings (notably dictionary changes) require an explicit Save — see Settings. Privacy Nothing leaves your machine except the AI calls you choose to make. The UI is local; the AI Log never stores your API keys or screenshot bytes. Related - CLI Overview — the same operations without the browser - Quick Start — a guided first run`},{id:`cli/build-context`,title:"`glotfile build-context`",section:`CLI`,html:`<h1><code>glotfile build-context</code></h1>
|
|
350
|
+
<p>AI-generates a short <strong>context</strong> note for each key — what it's for, where it appears — by reading the code snippets around its usages. Better context produces better translations. Requires a prior <code>glotfile scan</code> so the usage index exists.</p>
|
|
351
|
+
<pre><code class="language-bash">glotfile scan
|
|
352
|
+
glotfile build-context
|
|
353
|
+
</code></pre>
|
|
354
|
+
<p>By default it only fills keys that have <strong>no</strong> context yet. The flags combine to narrow the run.</p>
|
|
355
|
+
<h2>Options</h2>
|
|
356
|
+
<table>
|
|
357
|
+
<thead>
|
|
358
|
+
<tr>
|
|
359
|
+
<th>Option</th>
|
|
360
|
+
<th>Description</th>
|
|
361
|
+
</tr>
|
|
362
|
+
</thead>
|
|
363
|
+
<tbody><tr>
|
|
364
|
+
<td><code>--all</code></td>
|
|
365
|
+
<td>(Re)build context for every key, not just those missing it.</td>
|
|
366
|
+
</tr>
|
|
367
|
+
<tr>
|
|
368
|
+
<td><code>--key <glob></code></td>
|
|
369
|
+
<td>Only keys matching this glob (e.g. <code>"auth.*"</code>).</td>
|
|
370
|
+
</tr>
|
|
371
|
+
<tr>
|
|
372
|
+
<td><code>--limit <n></code></td>
|
|
373
|
+
<td>Process at most <code>n</code> keys.</td>
|
|
374
|
+
</tr>
|
|
375
|
+
<tr>
|
|
376
|
+
<td><code>--since <date></code></td>
|
|
377
|
+
<td>Only keys added or changed since this date.</td>
|
|
378
|
+
</tr>
|
|
379
|
+
<tr>
|
|
380
|
+
<td><code>--file</code>, <code>-f <path></code></td>
|
|
381
|
+
<td>Target a different state file.</td>
|
|
382
|
+
</tr>
|
|
383
|
+
</tbody></table>
|
|
384
|
+
<p>It uses the same AI provider as <code>translate</code> (configured per-machine — see AI Providers). If no usage index is found it stops and tells you to run <code>scan</code> first.</p>
|
|
385
|
+
<h2>Related</h2>
|
|
386
|
+
<ul>
|
|
387
|
+
<li>scan · translate · Key Context and Metadata · AI Providers</li>
|
|
388
|
+
</ul>
|
|
389
|
+
`,text:`AI-generates a short context note for each key — what it's for, where it appears — by reading the code snippets around its usages. Better context produces better translations. Requires a prior so the usage index exists. By default it only fills keys that have no context yet. The flags combine to narrow the run. Options Option Description --- --- (Re)build context for every key, not just those missing it. Only keys matching this glob (e.g. ). Process at most keys. Only keys added or changed since this date. , Target a different state file. It uses the same AI provider as (configured per-machine — see AI Providers). If no usage index is found it stops and tells you to run first. Related - scan · translate · Key Context and Metadata · AI Providers`},{id:`cli/cli-overview`,title:`CLI Overview`,section:`CLI`,html:`<h1>CLI Overview</h1>
|
|
350
390
|
<p>Run <code>glotfile <command></code> (or <code>node bin/glotfile.js <command></code> from a checkout — see Installation).</p>
|
|
351
391
|
<table>
|
|
352
392
|
<thead>
|
|
353
393
|
<tr>
|
|
354
394
|
<th>Command</th>
|
|
355
395
|
<th>What it does</th>
|
|
356
|
-
<th></th>
|
|
357
396
|
</tr>
|
|
358
397
|
</thead>
|
|
359
398
|
<tbody><tr>
|
|
360
399
|
<td>serve (default)</td>
|
|
361
400
|
<td>Start the local web UI and open the browser.</td>
|
|
362
|
-
<td></td>
|
|
363
401
|
</tr>
|
|
364
402
|
<tr>
|
|
365
403
|
<td>translate</td>
|
|
366
404
|
<td>AI-translate strings, writing results back to <code>glotfile.json</code>.</td>
|
|
367
|
-
<td></td>
|
|
368
405
|
</tr>
|
|
369
406
|
<tr>
|
|
370
407
|
<td>export</td>
|
|
371
408
|
<td>Write the locale files for every configured output.</td>
|
|
372
|
-
<td></td>
|
|
373
409
|
</tr>
|
|
374
410
|
<tr>
|
|
375
411
|
<td>lint</td>
|
|
376
412
|
<td>Report translation problems (states, placeholders, glossary, spelling…).</td>
|
|
377
|
-
<td></td>
|
|
378
413
|
</tr>
|
|
379
414
|
<tr>
|
|
380
415
|
<td>check</td>
|
|
381
416
|
<td>CI gate: lint <strong>and</strong> verify exported files are up to date.</td>
|
|
382
|
-
<td></td>
|
|
383
417
|
</tr>
|
|
384
418
|
<tr>
|
|
385
419
|
<td>import</td>
|
|
386
|
-
<td>
|
|
387
|
-
|
|
420
|
+
<td>Create <code>glotfile.json</code> from existing locale files.</td>
|
|
421
|
+
</tr>
|
|
422
|
+
<tr>
|
|
423
|
+
<td>build-context</td>
|
|
424
|
+
<td>AI-generate per-key context to improve translation (needs a prior scan).</td>
|
|
425
|
+
</tr>
|
|
426
|
+
<tr>
|
|
427
|
+
<td>scan</td>
|
|
428
|
+
<td>Index code references to keys (writes <code>.glotfile/usage.json</code>).</td>
|
|
429
|
+
</tr>
|
|
430
|
+
<tr>
|
|
431
|
+
<td>prune</td>
|
|
432
|
+
<td>Remove empty-source or unused keys (dry-run unless <code>--write</code>).</td>
|
|
433
|
+
</tr>
|
|
434
|
+
<tr>
|
|
435
|
+
<td>split</td>
|
|
436
|
+
<td>Convert <code>glotfile.json</code> into a reviewable <code>glotfile/</code> directory.</td>
|
|
437
|
+
</tr>
|
|
438
|
+
<tr>
|
|
439
|
+
<td>skill</td>
|
|
440
|
+
<td>Install the Claude Code skill for managing glotfile.</td>
|
|
388
441
|
</tr>
|
|
389
442
|
</tbody></table>
|
|
390
|
-
<p>Running <code>glotfile</code> with no command is the same as <code>glotfile serve</code
|
|
443
|
+
<p>Running <code>glotfile</code> with no command is the same as <code>glotfile serve</code>. Run <code>glotfile <command> --help</code> for a command's options.</p>
|
|
391
444
|
<h2>Global option</h2>
|
|
392
445
|
<p>Every command accepts <code>--file</code> (<code>-f</code>) to target a state file other than <code>./glotfile.json</code>:</p>
|
|
393
446
|
<pre><code class="language-bash">glotfile translate --file packages/app/glotfile.json
|
|
@@ -407,7 +460,7 @@ glotfile export -f ./i18n/glotfile.json
|
|
|
407
460
|
<li>Web UI Overview — the same operations in the browser</li>
|
|
408
461
|
<li>Configuration Reference</li>
|
|
409
462
|
</ul>
|
|
410
|
-
`},{id:`cli/export`,title:"`glotfile export`",section:`CLI`,html:`<h1><code>glotfile export</code></h1>
|
|
463
|
+
`,text:`CLI Overview Run (or from a checkout — see Installation). Command What it does --- --- serve (default) Start the local web UI and open the browser. translate AI-translate strings, writing results back to . export Write the locale files for every configured output. lint Report translation problems (states, placeholders, glossary, spelling…). check CI gate: lint and verify exported files are up to date. import Create from existing locale files. build-context AI-generate per-key context to improve translation (needs a prior scan). scan Index code references to keys (writes ). prune Remove empty-source or unused keys (dry-run unless ). split Convert into a reviewable directory. skill Install the Claude Code skill for managing glotfile. Running with no command is the same as . Run for a command's options. Global option Every command accepts ( ) to target a state file other than : Exit codes - , , exit on success. - exits when there are errors (or warnings over ). - exits when there are any errors (including out-of-date exports). This is what makes and usable as CI gates — see Continuous Integration. Credentials Only translate needs network access or credentials. Glotfile reads them from the environment, including a local file in the project directory. See AI Providers. Related - Web UI Overview — the same operations in the browser - Configuration Reference`},{id:`cli/export`,title:"`glotfile export`",section:`CLI`,html:`<h1><code>glotfile export</code></h1>
|
|
411
464
|
<p>Writes the locale files for every output configured in <code>config.outputs</code>, using the adapters you've set up.</p>
|
|
412
465
|
<pre><code class="language-bash">glotfile export
|
|
413
466
|
</code></pre>
|
|
@@ -426,11 +479,16 @@ glotfile export -f ./i18n/glotfile.json
|
|
|
426
479
|
<td>Export only the outputs using this adapter.</td>
|
|
427
480
|
</tr>
|
|
428
481
|
<tr>
|
|
482
|
+
<td><code>--watch</code></td>
|
|
483
|
+
<td>Re-export whenever the state file changes (stays running).</td>
|
|
484
|
+
</tr>
|
|
485
|
+
<tr>
|
|
429
486
|
<td><code>--file</code>, <code>-f <path></code></td>
|
|
430
487
|
<td>Target a different state file.</td>
|
|
431
488
|
</tr>
|
|
432
489
|
</tbody></table>
|
|
433
490
|
<pre><code class="language-bash">glotfile export --adapter laravel-php # just the Laravel files
|
|
491
|
+
glotfile export --watch # re-export on every change
|
|
434
492
|
</code></pre>
|
|
435
493
|
<h2>Warnings</h2>
|
|
436
494
|
<p>Where a conversion would be lossy (a construct a target format can't represent), export prints a <strong>warning</strong> and writes the best safe output rather than corrupting the file:</p>
|
|
@@ -449,38 +507,58 @@ git diff --exit-code # non-zero if exports drifted
|
|
|
449
507
|
<ul>
|
|
450
508
|
<li>Output Formats · Placeholders and ICU · lint and check · Continuous Integration</li>
|
|
451
509
|
</ul>
|
|
452
|
-
`},{id:`cli/import`,title:"`glotfile import`",section:`CLI`,html:`<h1><code>glotfile import</code></h1>
|
|
453
|
-
<
|
|
454
|
-
<
|
|
455
|
-
</blockquote>
|
|
456
|
-
<p>Import will be the inverse of <code>glotfile export</code>: it reads your <strong>existing</strong> locale files and ingests them <em>into</em> <code>glotfile.json</code>, so you can onboard a project that already has translations without re-keying everything by hand.</p>
|
|
457
|
-
<h2>Planned shape</h2>
|
|
458
|
-
<pre><code class="language-bash">glotfile import --adapter laravel-php --from lang/
|
|
510
|
+
`,text:`Writes the locale files for every output configured in , using the adapters you've set up. Options Option Description --- --- Export only the outputs using this adapter. Re-export whenever the state file changes (stays running). , Target a different state file. Warnings Where a conversion would be lossy (a construct a target format can't represent), export prints a warning and writes the best safe output rather than corrupting the file: See Placeholders and ICU. Zero-diff guarantee Because is written deterministically, re-running with no real changes produces a zero-line diff . That makes it safe to run in CI to confirm your locale files are up to date: Tip: Prefer in CI — re-exports in memory and fails if any output file is missing or stale — no dance required. See Continuous Integration. Related - Output Formats · Placeholders and ICU · lint and check · Continuous Integration`},{id:`cli/import`,title:"`glotfile import`",section:`CLI`,html:`<h1><code>glotfile import</code></h1>
|
|
511
|
+
<p>The inverse of <code>glotfile export</code>: it reads your <strong>existing</strong> locale files and ingests them <em>into</em> a new <code>glotfile.json</code>, so you can onboard a project that already has translations without re-keying everything by hand.</p>
|
|
512
|
+
<pre><code class="language-bash">glotfile import --format laravel-php --source lang/
|
|
459
513
|
</code></pre>
|
|
514
|
+
<p>Glotfile parses each file with the chosen adapter (the same adapters used for export, run in reverse), flattens the keys, and assembles a catalog. Existing translations land as <code>reviewed</code> (not raw machine output) and the source-locale strings as <code>source</code> — ready for review in the Editor.</p>
|
|
515
|
+
<h2>Options</h2>
|
|
460
516
|
<table>
|
|
461
517
|
<thead>
|
|
462
518
|
<tr>
|
|
463
|
-
<th>Option
|
|
519
|
+
<th>Option</th>
|
|
464
520
|
<th>Description</th>
|
|
465
521
|
</tr>
|
|
466
522
|
</thead>
|
|
467
523
|
<tbody><tr>
|
|
468
|
-
<td><code>--
|
|
469
|
-
<td>
|
|
524
|
+
<td><code>--format <name></code></td>
|
|
525
|
+
<td>Source layout adapter to read (e.g. <code>laravel-php</code>, <code>flutter-arb</code>). Required.</td>
|
|
526
|
+
</tr>
|
|
527
|
+
<tr>
|
|
528
|
+
<td><code>--source <dir></code></td>
|
|
529
|
+
<td>Directory to import from. Defaults to the state file's directory.</td>
|
|
530
|
+
</tr>
|
|
531
|
+
<tr>
|
|
532
|
+
<td><code>--source-locale <code></code></td>
|
|
533
|
+
<td>Which locale to treat as the source language.</td>
|
|
470
534
|
</tr>
|
|
471
535
|
<tr>
|
|
472
|
-
<td><code>--
|
|
473
|
-
<td>
|
|
536
|
+
<td><code>--locales <list></code></td>
|
|
537
|
+
<td>Comma-separated locales to import (default: every locale found).</td>
|
|
538
|
+
</tr>
|
|
539
|
+
<tr>
|
|
540
|
+
<td><code>--cldr</code></td>
|
|
541
|
+
<td>Expand CLDR plural forms into glotfile plurals.</td>
|
|
542
|
+
</tr>
|
|
543
|
+
<tr>
|
|
544
|
+
<td><code>--force</code></td>
|
|
545
|
+
<td>Overwrite an existing <code>glotfile.json</code>.</td>
|
|
546
|
+
</tr>
|
|
547
|
+
<tr>
|
|
548
|
+
<td><code>--file</code>, <code>-f <path></code></td>
|
|
549
|
+
<td>Write the catalog to a different state-file path.</td>
|
|
474
550
|
</tr>
|
|
475
551
|
</tbody></table>
|
|
476
|
-
<
|
|
477
|
-
|
|
478
|
-
|
|
552
|
+
<pre><code class="language-bash">glotfile import --format flutter-arb --source lib/l10n --source-locale en
|
|
553
|
+
glotfile import --format gettext-po --source locale --cldr
|
|
554
|
+
</code></pre>
|
|
555
|
+
<h2>Round-trip safety</h2>
|
|
556
|
+
<p>Import records the <code>localeCase</code> and <code>localeMap</code> it inferred from the filenames it found, so a subsequent <code>glotfile export</code> reproduces byte-identical files. Round-trip tests assert <code>import(export(x))</code> fidelity. See Output Formats.</p>
|
|
479
557
|
<h2>Related</h2>
|
|
480
558
|
<ul>
|
|
481
559
|
<li>export · Output Formats · Installation</li>
|
|
482
560
|
</ul>
|
|
483
|
-
`},{id:`cli/lint-and-check`,title:"`glotfile lint` and `glotfile check`",section:`CLI`,html:`<h1><code>glotfile lint</code> and <code>glotfile check</code></h1>
|
|
561
|
+
`,text:`The inverse of : it reads your existing locale files and ingests them into a new , so you can onboard a project that already has translations without re-keying everything by hand. Glotfile parses each file with the chosen adapter (the same adapters used for export, run in reverse), flattens the keys, and assembles a catalog. Existing translations land as (not raw machine output) and the source-locale strings as — ready for review in the Editor. Options Option Description --- --- Source layout adapter to read (e.g. , ). Required. Directory to import from. Defaults to the state file's directory. Which locale to treat as the source language. Comma-separated locales to import (default: every locale found). Expand CLDR plural forms into glotfile plurals. Overwrite an existing . , Write the catalog to a different state-file path. Round-trip safety Import records the and it inferred from the filenames it found, so a subsequent reproduces byte-identical files. Round-trip tests assert fidelity. See Output Formats. Related - export · Output Formats · Installation`},{id:`cli/lint-and-check`,title:"`glotfile lint` and `glotfile check`",section:`CLI`,html:`<h1><code>glotfile lint</code> and <code>glotfile check</code></h1>
|
|
484
562
|
<p>Two related commands for finding translation problems. Both are designed to run in CI.</p>
|
|
485
563
|
<ul>
|
|
486
564
|
<li><strong><code>lint</code></strong> runs the rule engine against your catalog.</li>
|
|
@@ -563,7 +641,54 @@ glotfile lint --include-suppressed # audit what's hidden
|
|
|
563
641
|
<ul>
|
|
564
642
|
<li>Checks and Validation · Continuous Integration · export · Configuration Reference</li>
|
|
565
643
|
</ul>
|
|
566
|
-
`},{id:`cli/
|
|
644
|
+
`,text:`and Two related commands for finding translation problems. Both are designed to run in CI. - runs the rule engine against your catalog. - runs the same rules and verifies that your exported locale files are up to date. It's the all-in-one CI gate. Exits if there are any errors , or if warnings exceed . Options Option Description --- --- Output format: (default), , or . Run only these rule ids, comma-separated. Restrict to these locales. Exit if warnings exceed (errors always fail). Also print findings hidden by suppressions, marked . Suppress every current warning (narrow with / ) and write the state file. , Target a different state file. Suppressions and A finding dismissed in the UI (or accepted here) is suppressed for that key + locale until the key's source text changes , then it resurfaces automatically. Adopting glotfile on a project with a noisy backlog: never suppresses errors, and suppressions are committed with the state file so the whole team (and CI) agrees. Info: SARIF for code scanning — emits SARIF 2.1.0 with each finding located at its line in . Upload it to GitHub code scanning to see findings inline on the PR. See Continuous Integration. does everything does, plus re-exports every output in memory and compares it to what's on disk. A missing or out-of-date file is reported as an error : It exits on any error (a lint error or a stale export), and accepts like . If itself can't be parsed, reports a single and exits . Tip: Use as your one CI step — it catches both "the catalog has problems" and "someone forgot to run " in a single command. Configuring rules Rule severities, ignored keys, and dictionaries are set in . See Checks and Validation and Configuration Reference. Related - Checks and Validation · Continuous Integration · export · Configuration Reference`},{id:`cli/prune`,title:"`glotfile prune`",section:`CLI`,html:`<h1><code>glotfile prune</code></h1>
|
|
645
|
+
<p>Removes keys you no longer need. It's a <strong>dry-run by default</strong> — it lists what it would remove and changes nothing until you pass <code>--write</code>.</p>
|
|
646
|
+
<pre><code class="language-bash">glotfile prune --unused # list keys with no code reference
|
|
647
|
+
glotfile prune --unused --write # actually remove them
|
|
648
|
+
</code></pre>
|
|
649
|
+
<h2>Options</h2>
|
|
650
|
+
<table>
|
|
651
|
+
<thead>
|
|
652
|
+
<tr>
|
|
653
|
+
<th>Option</th>
|
|
654
|
+
<th>Description</th>
|
|
655
|
+
</tr>
|
|
656
|
+
</thead>
|
|
657
|
+
<tbody><tr>
|
|
658
|
+
<td><code>--empty-source</code></td>
|
|
659
|
+
<td>Select keys whose source value is empty.</td>
|
|
660
|
+
</tr>
|
|
661
|
+
<tr>
|
|
662
|
+
<td><code>--unused</code></td>
|
|
663
|
+
<td>Select keys with no code reference (runs a scan first).</td>
|
|
664
|
+
</tr>
|
|
665
|
+
<tr>
|
|
666
|
+
<td><code>--write</code></td>
|
|
667
|
+
<td>Remove the selected keys. Without it, prune only lists them.</td>
|
|
668
|
+
</tr>
|
|
669
|
+
<tr>
|
|
670
|
+
<td><code>--file</code>, <code>-f <path></code></td>
|
|
671
|
+
<td>Target a different state file.</td>
|
|
672
|
+
</tr>
|
|
673
|
+
</tbody></table>
|
|
674
|
+
<p>Pick exactly one of <code>--empty-source</code> or <code>--unused</code>. The <code>--unused</code> selector runs a fresh scan, so its accuracy depends on your <code>config.scan</code> settings — review the dry-run list before writing.</p>
|
|
675
|
+
<h2>Related</h2>
|
|
676
|
+
<ul>
|
|
677
|
+
<li>scan · Keys and Locales · Configuration Reference</li>
|
|
678
|
+
</ul>
|
|
679
|
+
`,text:`Removes keys you no longer need. It's a dry-run by default — it lists what it would remove and changes nothing until you pass . Options Option Description --- --- Select keys whose source value is empty. Select keys with no code reference (runs a scan first). Remove the selected keys. Without it, prune only lists them. , Target a different state file. Pick exactly one of or . The selector runs a fresh scan, so its accuracy depends on your settings — review the dry-run list before writing. Related - scan · Keys and Locales · Configuration Reference`},{id:`cli/scan`,title:"`glotfile scan`",section:`CLI`,html:`<h1><code>glotfile scan</code></h1>
|
|
680
|
+
<p>Scans your codebase for places each translation key is used, and writes the result to <code>.glotfile/usage.json</code> (gitignored). This usage index powers the <strong>unused-keys</strong> pruning, the per-key context builder, and the usage tree in the web UI.</p>
|
|
681
|
+
<pre><code class="language-bash">glotfile scan
|
|
682
|
+
</code></pre>
|
|
683
|
+
<pre><code>Scanned 214 file(s), found 1,038 reference(s).
|
|
684
|
+
</code></pre>
|
|
685
|
+
<h2>What it scans</h2>
|
|
686
|
+
<p>The scan walks the project and matches key references. Tune it with the <code>config.scan</code> block — <code>include</code>/<code>exclude</code> globs, extra Flutter accessor names, and custom capture-group regexes. See Configuration Reference.</p>
|
|
687
|
+
<h2>Related</h2>
|
|
688
|
+
<ul>
|
|
689
|
+
<li>prune · build-context · Key Context and Metadata · Configuration Reference</li>
|
|
690
|
+
</ul>
|
|
691
|
+
`,text:`Scans your codebase for places each translation key is used, and writes the result to (gitignored). This usage index powers the unused-keys pruning, the per-key context builder, and the usage tree in the web UI. What it scans The scan walks the project and matches key references. Tune it with the block — / globs, extra Flutter accessor names, and custom capture-group regexes. See Configuration Reference. Related - prune · build-context · Key Context and Metadata · Configuration Reference`},{id:`cli/serve`,title:"`glotfile serve`",section:`CLI`,html:`<h1><code>glotfile serve</code></h1>
|
|
567
692
|
<p>Starts the local web UI and opens your browser. This is the <strong>default command</strong> — <code>glotfile</code> on its own does the same thing.</p>
|
|
568
693
|
<pre><code class="language-bash">glotfile
|
|
569
694
|
glotfile serve
|
|
@@ -595,7 +720,43 @@ glotfile serve
|
|
|
595
720
|
<ul>
|
|
596
721
|
<li>Quick Start · Web UI Overview · Installation</li>
|
|
597
722
|
</ul>
|
|
598
|
-
`},{id:`cli/
|
|
723
|
+
`,text:`Starts the local web UI and opens your browser. This is the default command — on its own does the same thing. It binds a server to , prints the URL, and opens it. If there's no in the current directory, it starts from defaults and writes the file on your first edit. Options Option Description --- --- , Use a state file other than . Developer mode for working on Glotfile itself (used by ). Note: Local only — the server binds to — it is not exposed to your network. Everything stays on your machine except the AI calls you trigger. Related - Quick Start · Web UI Overview · Installation`},{id:`cli/skill`,title:"`glotfile skill`",section:`CLI`,html:`<h1><code>glotfile skill</code></h1>
|
|
724
|
+
<p>Installs the <strong>Claude Code skill</strong> for managing glotfile into <code>./.claude/skills/glotfile/</code>, so Claude Code knows how to drive glotfile in your project — translating, exporting, linting, and editing the catalog.</p>
|
|
725
|
+
<pre><code class="language-bash">glotfile skill
|
|
726
|
+
</code></pre>
|
|
727
|
+
<h2>Options</h2>
|
|
728
|
+
<table>
|
|
729
|
+
<thead>
|
|
730
|
+
<tr>
|
|
731
|
+
<th>Option</th>
|
|
732
|
+
<th>Description</th>
|
|
733
|
+
</tr>
|
|
734
|
+
</thead>
|
|
735
|
+
<tbody><tr>
|
|
736
|
+
<td><code>--print</code></td>
|
|
737
|
+
<td>Write <code>SKILL.md</code> to stdout instead of installing it.</td>
|
|
738
|
+
</tr>
|
|
739
|
+
<tr>
|
|
740
|
+
<td><code>--force</code></td>
|
|
741
|
+
<td>Overwrite an existing installed skill.</td>
|
|
742
|
+
</tr>
|
|
743
|
+
</tbody></table>
|
|
744
|
+
<p>Run it once per project. With the skill installed, you can ask Claude Code to manage translations directly and it will use the glotfile CLI for you.</p>
|
|
745
|
+
<h2>Related</h2>
|
|
746
|
+
<ul>
|
|
747
|
+
<li>CLI Overview · translate</li>
|
|
748
|
+
</ul>
|
|
749
|
+
`,text:`Installs the Claude Code skill for managing glotfile into , so Claude Code knows how to drive glotfile in your project — translating, exporting, linting, and editing the catalog. Options Option Description --- --- Write to stdout instead of installing it. Overwrite an existing installed skill. Run it once per project. With the skill installed, you can ask Claude Code to manage translations directly and it will use the glotfile CLI for you. Related - CLI Overview · translate`},{id:`cli/split`,title:"`glotfile split`",section:`CLI`,html:`<h1><code>glotfile split</code></h1>
|
|
750
|
+
<p>Converts a single <code>glotfile.json</code> into a <code>glotfile/</code> <strong>directory</strong> of smaller files — one per locale plus shared config and key metadata. For large catalogs this keeps <code>git diff</code> fast and reviewable: an AI run on French rewrites only <code>glotfile/locales/fr.json</code>.</p>
|
|
751
|
+
<pre><code class="language-bash">glotfile split
|
|
752
|
+
</code></pre>
|
|
753
|
+
<p>This is a one-time, deliberate operation that produces a clearly-labelled commit and sets <code>config.storage</code> to <code>"split"</code>. After splitting, the CLI, web UI, and every export adapter behave identically — only the on-disk layout changes. Load auto-detects the format, so nothing else needs configuring.</p>
|
|
754
|
+
<p>See The State File for the full directory layout and the trade-offs.</p>
|
|
755
|
+
<h2>Related</h2>
|
|
756
|
+
<ul>
|
|
757
|
+
<li>The State File · Configuration Reference</li>
|
|
758
|
+
</ul>
|
|
759
|
+
`,text:`Converts a single into a directory of smaller files — one per locale plus shared config and key metadata. For large catalogs this keeps fast and reviewable: an AI run on French rewrites only . This is a one-time, deliberate operation that produces a clearly-labelled commit and sets to . After splitting, the CLI, web UI, and every export adapter behave identically — only the on-disk layout changes. Load auto-detects the format, so nothing else needs configuring. See The State File for the full directory layout and the trade-offs. Related - The State File · Configuration Reference`},{id:`cli/translate`,title:"`glotfile translate`",section:`CLI`,html:`<h1><code>glotfile translate</code></h1>
|
|
599
760
|
<p>AI-translates strings and writes the results back to <code>glotfile.json</code> as <code>machine</code> state. It never overwrites a <code>reviewed</code> value.</p>
|
|
600
761
|
<pre><code class="language-bash">glotfile translate
|
|
601
762
|
</code></pre>
|
|
@@ -613,8 +774,12 @@ glotfile serve
|
|
|
613
774
|
<td>Re-translate every string, not just empty values (still never overwrites <code>reviewed</code>).</td>
|
|
614
775
|
</tr>
|
|
615
776
|
<tr>
|
|
777
|
+
<td><code>--estimate</code></td>
|
|
778
|
+
<td>Print the batches, token counts and estimated cost without translating.</td>
|
|
779
|
+
</tr>
|
|
780
|
+
<tr>
|
|
616
781
|
<td><code>--locale <list></code></td>
|
|
617
|
-
<td>Only these target languages, comma-separated (e.g. <code>fr,de</code>)
|
|
782
|
+
<td>Only these target languages, comma-separated (e.g. <code>fr,de</code>). Alias: <code>--locales</code>.</td>
|
|
618
783
|
</tr>
|
|
619
784
|
<tr>
|
|
620
785
|
<td><code>--key <glob></code></td>
|
|
@@ -630,6 +795,7 @@ glotfile translate --all # redo every non-reviewed value
|
|
|
630
795
|
glotfile translate --locale fr,de # only French and German
|
|
631
796
|
glotfile translate --key "auth.*" # only the auth namespace
|
|
632
797
|
glotfile translate --all --locale fr --key "checkout.*"
|
|
798
|
+
glotfile translate --estimate # batches, tokens and cost — no API calls
|
|
633
799
|
</code></pre>
|
|
634
800
|
<h2>What it prints</h2>
|
|
635
801
|
<pre><code>Translating 34 string(s)…
|
|
@@ -640,7 +806,7 @@ Wrote 34 machine translation(s).
|
|
|
640
806
|
</code></pre>
|
|
641
807
|
<p>See How Translation Works for the validation rules and Placeholders and ICU for what's checked.</p>
|
|
642
808
|
<h2>Credentials</h2>
|
|
643
|
-
<p><code>translate</code> is the only command that needs network access. Configure the provider in Settings
|
|
809
|
+
<p><code>translate</code> is the only command that needs network access. Configure the provider in Settings (stored per-machine), and put credentials in your environment (a local <code>.env</code> works). See AI Providers.</p>
|
|
644
810
|
<blockquote>
|
|
645
811
|
<p><strong>Info:</strong> Egress is logged — what's sent to the provider is recorded in the AI Log.</p>
|
|
646
812
|
</blockquote>
|
|
@@ -648,7 +814,7 @@ Wrote 34 machine translation(s).
|
|
|
648
814
|
<ul>
|
|
649
815
|
<li>How Translation Works · AI Providers · Review States</li>
|
|
650
816
|
</ul>
|
|
651
|
-
`},{id:`concepts/glossary`,title:`Glossary`,section:`Concepts`,html:`<h1>Glossary</h1>
|
|
817
|
+
`,text:`AI-translates strings and writes the results back to as state. It never overwrites a value. With no flags, only empty values are filled — existing translations are left alone. Pass to re-translate every string. The flags below combine to narrow the run. Options Option Description --- --- Re-translate every string, not just empty values (still never overwrites ). Print the batches, token counts and estimated cost without translating. Only these target languages, comma-separated (e.g. ). Alias: . Only keys matching a glob (e.g. ). , Target a different state file. What it prints Rejected translations (a dropped placeholder, a busted length limit) are reported and skipped , not written: See How Translation Works for the validation rules and Placeholders and ICU for what's checked. Credentials is the only command that needs network access. Configure the provider in Settings (stored per-machine), and put credentials in your environment (a local works). See AI Providers. Info: Egress is logged — what's sent to the provider is recorded in the AI Log. Related - How Translation Works · AI Providers · Review States`},{id:`concepts/glossary`,title:`Glossary`,section:`Concepts`,html:`<h1>Glossary</h1>
|
|
652
818
|
<p>The <strong>glossary</strong> is a list of terms that get special handling during AI translation and validation. It's stored at the top level of <code>glotfile.json</code> and edited in the Glossary panel.</p>
|
|
653
819
|
<p>Use it for two things:</p>
|
|
654
820
|
<ol>
|
|
@@ -705,7 +871,7 @@ Wrote 34 machine translation(s).
|
|
|
705
871
|
<ul>
|
|
706
872
|
<li>How Translation Works · Checks and Validation · Key Context and Metadata</li>
|
|
707
873
|
</ul>
|
|
708
|
-
`},{id:`concepts/key-context-and-metadata`,title:`Key Context and Metadata`,section:`Concepts`,html:`<h1>Key Context and Metadata</h1>
|
|
874
|
+
`,text:`Glossary The glossary is a list of terms that get special handling during AI translation and validation. It's stored at the top level of and edited in the Glossary panel. Use it for two things: 1. Do-not-translate terms — brand names, product names, code identifiers that must appear verbatim in every language. 2. Forced translations — a term that must always render a specific way in a given locale. Entry shape Field Meaning --- --- The source-language term to match. Keep the term verbatim in every translation. Match the term case-sensitively. Forced output per locale ( ). Freeform guidance (also passed to the AI). How it's used - During translation: relevant glossary terms for each string are injected into every AI request, so the model knows what to keep verbatim and what to render a fixed way. See How Translation Works. - During validation: the rule flags any translation that drops a do-not-translate term or doesn't use the forced translation. See Checks and Validation. Tip: Only relevant terms are sent — Glotfile matches glossary terms against each source string and includes just the ones that appear — the AI isn't handed your entire glossary for every key. Related - How Translation Works · Checks and Validation · Key Context and Metadata`},{id:`concepts/key-context-and-metadata`,title:`Key Context and Metadata`,section:`Concepts`,html:`<h1>Key Context and Metadata</h1>
|
|
709
875
|
<p>Beyond its values, each key can carry metadata that improves translation quality and helps reviewers. Edit it in the Editor's per-key detail panel.</p>
|
|
710
876
|
<table>
|
|
711
877
|
<thead>
|
|
@@ -751,7 +917,7 @@ Wrote 34 machine translation(s).
|
|
|
751
917
|
<ul>
|
|
752
918
|
<li>Glossary · Screenshots · How Translation Works · Checks and Validation</li>
|
|
753
919
|
</ul>
|
|
754
|
-
`},{id:`concepts/keys-and-locales`,title:`Keys and Locales`,section:`Concepts`,html:`<h1>Keys and Locales</h1>
|
|
920
|
+
`,text:`Key Context and Metadata Beyond its values, each key can carry metadata that improves translation quality and helps reviewers. Edit it in the Editor's per-key detail panel. Field What it's for --- --- Context A note for humans and the AI explaining where/how the string is used. The single highest-leverage field for good machine translation. Notes Timestamped freeform notes — a running comment thread on the key. Tags Labels for grouping and filtering (e.g. , , ). Analytics reports coverage per tag. Max length A character budget. AI translations that exceed it are rejected, and the check flags any value over the limit. Screenshot An image showing where the string appears. Sent to vision-capable models for context. See Screenshots. Skip translate Marks a key to be excluded from translation runs (e.g. a code-like token that should never change). Why context matters most Translators — human or AI — can't see your UI. A bare string like could be a verb (open a file) or an adjective (the store is open), and they translate differently. A one-line context removes the ambiguity: Example: Key → context: "Adjective. Shown on a badge when the shop is currently accepting orders." AI translation sends the context, the relevant Glossary terms, any max length, and the screenshot along with each string. A note on The state file also reserves a field on keys. It is not yet editable in the UI — prefer context (which feeds the AI) and notes (for human discussion) today. Related - Glossary · Screenshots · How Translation Works · Checks and Validation`},{id:`concepts/keys-and-locales`,title:`Keys and Locales`,section:`Concepts`,html:`<h1>Keys and Locales</h1>
|
|
755
921
|
<h2>Keys</h2>
|
|
756
922
|
<p>A <strong>key</strong> is a stable identifier for one piece of copy, written in <strong>dot notation</strong>:</p>
|
|
757
923
|
<pre><code>auth.signIn.button
|
|
@@ -789,7 +955,7 @@ settings.profile.heading
|
|
|
789
955
|
<ul>
|
|
790
956
|
<li>Review States · Plurals · Key Context and Metadata · The State File</li>
|
|
791
957
|
</ul>
|
|
792
|
-
`},{id:`concepts/plurals`,title:`Plurals`,section:`Concepts`,html:`<h1>Plurals</h1>
|
|
958
|
+
`,text:`Keys and Locales Keys A key is a stable identifier for one piece of copy, written in dot notation : Keys live in a flat map in — the dots are just naming convention, not nesting. The first segment usually acts as a namespace (a feature, screen, or file group); some export adapters split files by it (Laravel writes keys into ). Each key holds: - A value per locale (or plural forms). - A review state per locale. - Optional metadata — context, notes, tags, a max length, a screenshot, and a skip-translation flag. Create, rename, and delete keys in the Editor. Locales A locale is a language you maintain, identified by a code like , , , or . Two settings define them (Settings panel or config): - — the one language you author in. Its values have the state and are the basis for every translation. - — the full list of languages you maintain, including the source. ⚠ The source locale must be in the list — must appear in , or the file fails validation. Adding and removing Manage locales in Settings. Adding a locale gives every key an empty slot for it (which shows up as missing until filled). Languages are shown with their flag and name in the UI. Missing values A locale value is missing when it has no content for a key. Missing values are: - highlighted in the Editor (filter to missing ), - counted in Analytics, - what fills by default (see translate), - flagged by the rule in Checks and Validation. Related - Review States · Plurals · Key Context and Metadata · The State File`},{id:`concepts/plurals`,title:`Plurals`,section:`Concepts`,html:`<h1>Plurals</h1>
|
|
793
959
|
<p>Some strings change shape with a count — "1 file" vs "5 files". Glotfile models these as <strong>plural keys</strong> using the <a href="https://cldr.unicode.org/index/cldr-spec/plural-rules">CLDR plural categories</a>.</p>
|
|
794
960
|
<h2>How a plural key differs</h2>
|
|
795
961
|
<p>A normal key stores one <code>value</code> per locale. A <strong>plural key</strong> instead stores <strong><code>forms</code></strong> — one entry per category — and is marked with a <code>plural</code> field naming the <strong>count argument</strong>:</p>
|
|
@@ -826,7 +992,7 @@ settings.profile.heading
|
|
|
826
992
|
<ul>
|
|
827
993
|
<li>Placeholders and ICU · How Translation Works · Keys and Locales</li>
|
|
828
994
|
</ul>
|
|
829
|
-
`},{id:`concepts/review-states`,title:`Review States`,section:`Concepts`,html:`<h1>Review States</h1>
|
|
995
|
+
`,text:`Plurals Some strings change shape with a count — "1 file" vs "5 files". Glotfile models these as plural keys using the CLDR plural categories. How a plural key differs A normal key stores one per locale. A plural key instead stores — one entry per category — and is marked with a field naming the count argument : Plural categories The six CLDR categories are: · · · · · ⚠ is always required — every locale's plural value must include the form — it's the fallback every language has. Which of the other categories apply depends on the language (English uses / ; Polish uses / / / ). Editing plurals In the Editor, a plural key shows a dedicated form editor with one field per category that the target language actually uses. AI translation fills every required category at once and validates the result. Across export formats Plural and ICU / structure is preserved when exporting, and converted to each format's native plural mechanism where one exists. Where a target format can't represent a construct, warns rather than producing broken output. See Output Formats and Placeholders and ICU. Related - Placeholders and ICU · How Translation Works · Keys and Locales`},{id:`concepts/review-states`,title:`Review States`,section:`Concepts`,html:`<h1>Review States</h1>
|
|
830
996
|
<p>Every locale value carries a <strong>state</strong> that tracks where the translation is in its lifecycle. State is per <em>value</em>, not per key — <code>fr</code> can be <code>reviewed</code> while <code>de</code> is still <code>machine</code>.</p>
|
|
831
997
|
<table>
|
|
832
998
|
<thead>
|
|
@@ -872,7 +1038,7 @@ settings.profile.heading
|
|
|
872
1038
|
<ul>
|
|
873
1039
|
<li>How Translation Works · Keeping Translations Fresh</li>
|
|
874
1040
|
</ul>
|
|
875
|
-
`},{id:`concepts/the-state-file`,title:"The State File — `glotfile.json`",section:`Concepts`,html:`<h1>The State File — <code>glotfile.json</code></h1>
|
|
1041
|
+
`,text:`Review States Every locale value carries a state that tracks where the translation is in its lifecycle. State is per value , not per key — can be while is still . State Meaning --- --- The value in your source locale. It's what everything else is translated from . Produced by AI translation and not yet reviewed by a human . A human has checked and approved it. AI translation never overwrites a value. Flagged for attention — typically because the source string changed after this translation was made (see Keeping Translations Fresh). The typical flow 1. You author a string in the source locale → . 2. AI fills the other languages → . 3. You review in the Editor and promote good ones → . 4. If the source later changes, dependent translations are marked so they don't silently drift. See Keeping Translations Fresh. Why is protected Marking a value is a promise: a human owns this translation. Glotfile honours that promise — neither nor the UI's translate action will overwrite it. To re-translate a reviewed value, change it back first. Filtering by state In the Editor, filter by missing , machine (unreviewed), needs-review , or reviewed , plus a needs-attention facet for any key with an open issue. Analytics reports translated vs reviewed percentages per locale. Related - How Translation Works · Keeping Translations Fresh`},{id:`concepts/the-state-file`,title:"The State File — `glotfile.json`",section:`Concepts`,html:`<h1>The State File — <code>glotfile.json</code></h1>
|
|
876
1042
|
<p>Everything Glotfile does is derived from one file at the root of your project: <strong><code>glotfile.json</code></strong>. It holds your configuration, your glossary, and every key with its translations. You commit it alongside your code, and versioning, review, and rollback all come from git.</p>
|
|
877
1043
|
<blockquote>
|
|
878
1044
|
<p><strong>Tip:</strong> You normally never edit this file by hand — the web UI writes it for you. The structure below is documented so you can read diffs and understand what's stored — not so you can hand-edit it.</p>
|
|
@@ -881,7 +1047,7 @@ settings.profile.heading
|
|
|
881
1047
|
<p>A fresh file looks like this:</p>
|
|
882
1048
|
<pre><code class="language-json">{
|
|
883
1049
|
"$schema": "https://glotfile.dev/schema/v1.json",
|
|
884
|
-
"version":
|
|
1050
|
+
"version": 1,
|
|
885
1051
|
"config": {
|
|
886
1052
|
"sourceLocale": "en",
|
|
887
1053
|
"locales": ["en"],
|
|
@@ -889,7 +1055,6 @@ settings.profile.heading
|
|
|
889
1055
|
{ "adapter": "flutter-arb", "path": "lib/l10n/app_{locale}.arb" },
|
|
890
1056
|
{ "adapter": "laravel-php", "path": "lang/{locale}/{namespace}.php" }
|
|
891
1057
|
],
|
|
892
|
-
"ai": { "provider": "anthropic", "model": "claude-opus-4-8", "endpoint": null, "region": null, "batchSize": 25 },
|
|
893
1058
|
"format": { "indent": 2, "sortKeys": true, "finalNewline": true },
|
|
894
1059
|
"spelling": { "customWords": [] }
|
|
895
1060
|
},
|
|
@@ -906,11 +1071,11 @@ settings.profile.heading
|
|
|
906
1071
|
</thead>
|
|
907
1072
|
<tbody><tr>
|
|
908
1073
|
<td><code>version</code></td>
|
|
909
|
-
<td>State-file schema version (currently <code>
|
|
1074
|
+
<td>State-file schema version (currently <code>1</code>).</td>
|
|
910
1075
|
</tr>
|
|
911
1076
|
<tr>
|
|
912
1077
|
<td><code>config</code></td>
|
|
913
|
-
<td>All configuration — see Configuration Reference.</td>
|
|
1078
|
+
<td>All committed configuration — see Configuration Reference. AI provider settings are <strong>not</strong> here; they live in per-machine local settings (see AI Providers).</td>
|
|
914
1079
|
</tr>
|
|
915
1080
|
<tr>
|
|
916
1081
|
<td><code>glossary</code></td>
|
|
@@ -989,8 +1154,8 @@ settings.profile.heading
|
|
|
989
1154
|
<ul>
|
|
990
1155
|
<li>Configuration Reference · Keys and Locales · Review States</li>
|
|
991
1156
|
</ul>
|
|
992
|
-
`},{id:`ai-translation/ai-providers`,title:`AI Providers`,section:`AI Translation`,html:`<h1>AI Providers</h1>
|
|
993
|
-
<p>Glotfile translates via <strong>one provider at a time</strong>, chosen by <code>
|
|
1157
|
+
`,text:`The State File — Everything Glotfile does is derived from one file at the root of your project: . It holds your configuration, your glossary, and every key with its translations. You commit it alongside your code, and versioning, review, and rollback all come from git. Tip: You normally never edit this file by hand — the web UI writes it for you. The structure below is documented so you can read diffs and understand what's stored — not so you can hand-edit it. Anatomy A fresh file looks like this: Field Purpose --- --- State-file schema version (currently ). All committed configuration — see Configuration Reference. AI provider settings are not here; they live in per-machine local settings (see AI Providers). Do-not-translate terms and forced per-locale translations — see Glossary. A flat map of dot-notation keys to their values and metadata — see Keys and Locales. A populated key Each locale carries a (or for plural keys), a state, and an optional recording the source string it was translated from (used to detect stale translations). Deterministic writes Glotfile writes the file deterministically — stable key order, fixed indent, one trailing newline — so git diffs stay small and reviewable. The block controls this: - — spaces per level (default ) - — sort keys alphabetically (default ) - — end with a single newline (default ) Info: Why this matters — because writes are deterministic, re-running with no real changes produces a zero-line diff . That's what makes Glotfile safe to run in CI. On load When Glotfile reads the file it validates the structure (see Checks and Validation) and normalises values — for example, trimming surrounding whitespace — so legacy data folds to the same shape the UI produces on save. A malformed file fails loudly with a specific message rather than corrupting silently. Split storage: the directory For large catalogs, a single can reach several megabytes — making slow, overflowing GitHub's render limit, and producing noisy conflicts when multiple branches add keys. The split layout breaks the catalog into a directory of smaller files, one per locale. Run once to convert an existing single file: - holds the configuration and glossary — the parts that change rarely. - holds per-key metadata (tags, notes, context, plural config, screenshots) but not translation values. A tag edit touches only this file. - holds all translation values for one locale. An AI run on French rewrites only . What controls the layout A field in the config selects how the catalog is saved: Value Behaviour --- --- (or absent) Write a single — the default for new projects. Write the directory. Set automatically by . Load auto-detects: Glotfile checks for first (split), then (single), then starts from defaults. You never need to set this by hand — sets it for you. Promotion is an explicit commit There is no silent auto-promotion at a size threshold. Running is a deliberate, one-time operation that produces a clearly-labelled commit. Once split, the CLI, web UI, and all export adapters work identically to the single-file layout — the in-memory state is unchanged. Related - Configuration Reference · Keys and Locales · Review States`},{id:`ai-translation/ai-providers`,title:`AI Providers`,section:`AI Translation`,html:`<h1>AI Providers</h1>
|
|
1158
|
+
<p>Glotfile translates via <strong>one provider at a time</strong>, chosen by the <code>ai.provider</code> setting. These AI settings are <strong>per-machine</strong> — they live in <code>.glotfile/settings.json</code> (gitignored), not in the committed <code>glotfile.json</code>, so each developer can use their own provider and model. Edit them in Settings and re-run translate. Credentials are read from the environment, including a local <code>.env</code> file in the project directory.</p>
|
|
994
1159
|
<h2>Supported providers</h2>
|
|
995
1160
|
<table>
|
|
996
1161
|
<thead>
|
|
@@ -1006,35 +1171,35 @@ settings.profile.heading
|
|
|
1006
1171
|
<td><strong>Anthropic</strong> (default)</td>
|
|
1007
1172
|
<td><code>anthropic</code></td>
|
|
1008
1173
|
<td><code>ANTHROPIC_API_KEY</code></td>
|
|
1009
|
-
<td><code>
|
|
1174
|
+
<td><code>endpoint</code> (base URL)</td>
|
|
1010
1175
|
<td>bundled (<code>@anthropic-ai/sdk</code>)</td>
|
|
1011
1176
|
</tr>
|
|
1012
1177
|
<tr>
|
|
1013
1178
|
<td><strong>OpenAI</strong></td>
|
|
1014
1179
|
<td><code>openai</code></td>
|
|
1015
1180
|
<td><code>OPENAI_API_KEY</code></td>
|
|
1016
|
-
<td><code>
|
|
1181
|
+
<td><code>endpoint</code> (base URL; also reaches any OpenAI-compatible gateway)</td>
|
|
1017
1182
|
<td>optional — <code>npm i openai</code></td>
|
|
1018
1183
|
</tr>
|
|
1019
1184
|
<tr>
|
|
1020
1185
|
<td><strong>AWS Bedrock</strong></td>
|
|
1021
1186
|
<td><code>bedrock</code></td>
|
|
1022
1187
|
<td>standard AWS chain: <code>AWS_ACCESS_KEY_ID</code> / <code>AWS_SECRET_ACCESS_KEY</code> (/ <code>AWS_SESSION_TOKEN</code>), or <code>AWS_PROFILE</code>, or an SSO / instance role</td>
|
|
1023
|
-
<td><code>
|
|
1188
|
+
<td><code>region</code> (falls back to <code>AWS_REGION</code>)</td>
|
|
1024
1189
|
<td>optional — <code>npm i @aws-sdk/client-bedrock-runtime</code></td>
|
|
1025
1190
|
</tr>
|
|
1026
1191
|
<tr>
|
|
1027
1192
|
<td><strong>OpenRouter</strong></td>
|
|
1028
1193
|
<td><code>openrouter</code></td>
|
|
1029
1194
|
<td><code>OPENROUTER_API_KEY</code></td>
|
|
1030
|
-
<td><code>
|
|
1195
|
+
<td><code>endpoint</code> (base URL; defaults to <code>https://openrouter.ai/api/v1</code>)</td>
|
|
1031
1196
|
<td>optional — <code>npm i openai</code> (OpenAI-compatible)</td>
|
|
1032
1197
|
</tr>
|
|
1033
1198
|
<tr>
|
|
1034
1199
|
<td><strong>Ollama</strong> (local)</td>
|
|
1035
1200
|
<td><code>ollama</code></td>
|
|
1036
1201
|
<td>none for local; <code>OLLAMA_API_KEY</code> only for a secured / remote server</td>
|
|
1037
|
-
<td><code>
|
|
1202
|
+
<td><code>endpoint</code> (base URL; defaults to <code>http://localhost:11434/v1</code>)</td>
|
|
1038
1203
|
<td>optional — <code>npm i openai</code> (OpenAI-compatible)</td>
|
|
1039
1204
|
</tr>
|
|
1040
1205
|
<tr>
|
|
@@ -1048,8 +1213,9 @@ settings.profile.heading
|
|
|
1048
1213
|
<blockquote>
|
|
1049
1214
|
<p><strong>Info:</strong> Optional SDKs load on demand — the OpenAI SDK (also used by OpenRouter) and the AWS SDK are optional dependencies, loaded only when their provider is selected — so a default install stays small. If the SDK is missing when you translate, Glotfile tells you exactly what to install.</p>
|
|
1050
1215
|
</blockquote>
|
|
1051
|
-
<h2
|
|
1052
|
-
<
|
|
1216
|
+
<h2>The <code>ai</code> settings</h2>
|
|
1217
|
+
<p>Stored per-machine in <code>.glotfile/settings.json</code> (gitignored). The default:</p>
|
|
1218
|
+
<pre><code class="language-json">"ai": { "provider": "anthropic", "model": "claude-sonnet-4-6", "endpoint": null, "region": null, "batchSize": 25 }
|
|
1053
1219
|
</code></pre>
|
|
1054
1220
|
<table>
|
|
1055
1221
|
<thead>
|
|
@@ -1143,7 +1309,7 @@ settings.profile.heading
|
|
|
1143
1309
|
<ul>
|
|
1144
1310
|
<li>How Translation Works · translate · Settings · AI Log</li>
|
|
1145
1311
|
</ul>
|
|
1146
|
-
`},{id:`ai-translation/how-translation-works`,title:`How Translation Works`,section:`AI Translation`,html:`<h1>How Translation Works</h1>
|
|
1312
|
+
`,text:`AI Providers Glotfile translates via one provider at a time , chosen by the setting. These AI settings are per-machine — they live in (gitignored), not in the committed , so each developer can use their own provider and model. Edit them in Settings and re-run translate. Credentials are read from the environment, including a local file in the project directory. Supported providers Provider Credentials Region / endpoint SDK --- --- --- --- --- Anthropic (default) (base URL) bundled ( ) OpenAI (base URL; also reaches any OpenAI-compatible gateway) optional — AWS Bedrock standard AWS chain: / (/ ), or , or an SSO / instance role (falls back to ) optional — OpenRouter (base URL; defaults to ) optional — (OpenAI-compatible) Ollama (local) none for local; only for a secured / remote server (base URL; defaults to ) optional — (OpenAI-compatible) Claude Code (local) none — uses your local Claude Code session n/a none — spawns the CLI Info: Optional SDKs load on demand — the OpenAI SDK (also used by OpenRouter) and the AWS SDK are optional dependencies, loaded only when their provider is selected — so a default install stays small. If the SDK is missing when you translate, Glotfile tells you exactly what to install. The settings Stored per-machine in (gitignored). The default: Field Meaning --- --- , , , , , or . The model id for the chosen provider. Base URL override (Anthropic / OpenAI / OpenRouter / Ollama). for the provider default — OpenRouter defaults to , Ollama to . An overridden Ollama endpoint must include the suffix. AWS region (Bedrock). Falls back to . Strings per request (default ). Examples OpenAI: OpenRouter (OpenAI-compatible; uses namespaced model ids): Ollama (local, OpenAI-compatible; no key needed — start Ollama and the model first): Claude Code (uses your local Claude Code session; no API key needed): AWS Bedrock — Amazon Nova: AWS Bedrock — Claude or Meta Llama (same provider, different model id): Vision (screenshots) Keys with a screenshot are sent to vision-capable models for context: Model family Vision --- --- Anthropic ✅ OpenAI (gpt-4o-class) ✅ Bedrock — Amazon Nova / Claude ✅ Bedrock — Meta Llama (text) ❌ — runs text-only, warns how many screenshots were skipped OpenRouter ✅ for vision-capable models (e.g. , , ); a text-only model ignores the image Ollama ❌ — runs text-only (most local models can't see images); screenshots are skipped Claude Code ❌ — runs text-only via the CLI subprocess; screenshots are skipped Data residency AI translation is the only path by which source strings leave your boundary. To keep strings in-region, pin AWS Bedrock to a region , or point the Anthropic / OpenAI at an in-region or self-hosted gateway. For the strongest guarantee, run Ollama locally — strings never leave the machine. Note that OpenRouter routes your strings through its service to the upstream model provider you select — avoid it where data residency is a hard requirement. No credentials are ever written to or logged. Related - How Translation Works · translate · Settings · AI Log`},{id:`ai-translation/how-translation-works`,title:`How Translation Works`,section:`AI Translation`,html:`<h1>How Translation Works</h1>
|
|
1147
1313
|
<p>AI translation is the only feature that needs network access or credentials — everything else in Glotfile works offline. You can trigger it from the Editor or with <code>glotfile translate</code>; both use the same engine.</p>
|
|
1148
1314
|
<h2>What gets sent</h2>
|
|
1149
1315
|
<p>For each string that needs translating, Glotfile sends the provider:</p>
|
|
@@ -1155,7 +1321,7 @@ settings.profile.heading
|
|
|
1155
1321
|
<li>any <strong>max length</strong>, and</li>
|
|
1156
1322
|
<li>for vision-capable models, the key's <strong>screenshot</strong>.</li>
|
|
1157
1323
|
</ul>
|
|
1158
|
-
<p>Strings are sent in batches (<code>
|
|
1324
|
+
<p>Strings are sent in batches (the <code>ai.batchSize</code> setting, default 25).</p>
|
|
1159
1325
|
<h2>Validation on the way back</h2>
|
|
1160
1326
|
<p>A translation is only written if it passes validation:</p>
|
|
1161
1327
|
<ul>
|
|
@@ -1182,7 +1348,7 @@ settings.profile.heading
|
|
|
1182
1348
|
<ul>
|
|
1183
1349
|
<li>AI Providers · Glossary · Placeholders and ICU · AI Log</li>
|
|
1184
1350
|
</ul>
|
|
1185
|
-
`},{id:`reference/checks-and-validation`,title:`Checks and Validation`,section:`Reference`,html:`<h1>Checks and Validation</h1>
|
|
1351
|
+
`,text:`How Translation Works AI translation is the only feature that needs network access or credentials — everything else in Glotfile works offline. You can trigger it from the Editor or with ; both use the same engine. What gets sent For each string that needs translating, Glotfile sends the provider: - the source string (or plural forms), - the key's context , - the relevant Glossary terms (only those that appear in the string), - the target locale , - any max length , and - for vision-capable models, the key's screenshot . Strings are sent in batches (the setting, default 25). Validation on the way back A translation is only written if it passes validation: - Placeholders must match the source — a translation that drops or renames , , , etc. is rejected . See Placeholders and ICU. - ICU plural/select structure must be preserved. - Max length , if set, must not be exceeded. Rejected translations are reported and skipped, not written: What it writes - Accepted translations are written as state. - A value is never overwritten — your human edits are safe. - The source string each translation was made from is recorded, so later source edits can flag the translation as stale. Vision and model fit Screenshots are sent only to models that can see them. For models that can't (e.g. Bedrock Meta Llama text models), the run proceeds text-only and prints how many screenshots were skipped — so any model still works. See AI Providers for the support matrix. Privacy ⚠ What leaves your machine — AI translation is the only path by which your source strings leave your boundary. No credentials are ever written to or the AI Log. To keep strings in-region, pin a Bedrock region or point an Anthropic/OpenAI endpoint at an in-region gateway — see AI Providers. Related - AI Providers · Glossary · Placeholders and ICU · AI Log`},{id:`reference/checks-and-validation`,title:`Checks and Validation`,section:`Reference`,html:`<h1>Checks and Validation</h1>
|
|
1186
1352
|
<p>Glotfile validates your catalog two ways: <strong>live in the UI</strong> as you edit, and via the <strong><code>lint</code> / <code>check</code></strong> commands for CI. Both look for the same kinds of problem.</p>
|
|
1187
1353
|
<h2>Lint rules</h2>
|
|
1188
1354
|
<p><code>glotfile lint</code> runs these rules. Each has a default severity you can override in <code>config.lint.rules</code>.</p>
|
|
@@ -1307,15 +1473,17 @@ settings.profile.heading
|
|
|
1307
1473
|
<ul>
|
|
1308
1474
|
<li>lint and check · Continuous Integration · Placeholders and ICU · Configuration Reference</li>
|
|
1309
1475
|
</ul>
|
|
1310
|
-
`},{id:`reference/configuration-reference`,title:`Configuration Reference`,section:`Reference`,html:`<h1>Configuration Reference</h1>
|
|
1311
|
-
<p>Every field in the <code>config</code> block of <code>glotfile.json</code
|
|
1476
|
+
`,text:`Checks and Validation Glotfile validates your catalog two ways: live in the UI as you edit, and via the / commands for CI. Both look for the same kinds of problem. Lint rules runs these rules. Each has a default severity you can override in . Rule id Default Catches --- --- --- error A key whose source value is empty. error A target value that's missing or whitespace-only. error Translation placeholders differ from the source. error One side is an ICU plural/select and the other isn't. error A do-not-translate term is altered, or a forced Glossary translation is missing. warn A value longer than the key's max length. warn A translation identical to the source string. warn Leading/trailing whitespace that differs from the source. warn A word the locale's dictionary doesn't recognise. adds one more, by re-exporting and comparing to disk: Rule id Default Catches --- --- --- error An exported file is missing or out of date — run . Configuring rules — Editable in Settings → Quality checks , or by hand: Field Meaning --- --- Override a rule's severity: , , or . Globs of keys to skip entirely. Map a locale to a different dictionary id (e.g. use the dictionary for ). Rule configuration applies everywhere at once: the live editor checks, the Analytics release gate, and / . The rule accepts Glossary terms and the custom dictionary ( ) automatically. Note: Spelling needs a dictionary — the rule only runs for locales that have a dictionary available. Locales without one are skipped with a notice. Dismissing a single finding Sometimes a warning is just wrong for one string — "Logo" really is "Logo" in French. Dismiss the finding from Analytics (or the key's detail panel) and it's suppressed for that key + locale until the source text changes , at which point it resurfaces automatically. Suppressions are stored on the key in the state file, so they're shared with your team and reviewable in diffs. - bulk-suppresses the current warnings — useful when adopting glotfile on an existing project. - shows suppressed findings (marked); Analytics has a matching "Suppressed (n)" drawer with per-finding restore. - Errors are never bulk-accepted; fix those instead. Severities and exit codes - error → fails / (exit ). - warn → reported; fails only if over . - off → not run. See lint and check for (text / json / sarif), , , and , and Continuous Integration for wiring it up. Live UI checks The Editor continuously surfaces issues — missing values, placeholder mismatches, length and glossary violations, and spelling — so you fix them as you work. The needs-attention filter shows every key with an open issue. Related - lint and check · Continuous Integration · Placeholders and ICU · Configuration Reference`},{id:`reference/configuration-reference`,title:`Configuration Reference`,section:`Reference`,html:`<h1>Configuration Reference</h1>
|
|
1477
|
+
<p>Every field in the <code>config</code> block of <code>glotfile.json</code> — the configuration you <strong>commit</strong> alongside your code. Edit these in Settings rather than by hand where you can.</p>
|
|
1478
|
+
<blockquote>
|
|
1479
|
+
<p><strong>Info:</strong> AI provider settings are <strong>not</strong> part of this committed config. They're per-machine and live in <code>.glotfile/settings.json</code> (gitignored) — see AI Providers.</p>
|
|
1480
|
+
</blockquote>
|
|
1312
1481
|
<pre><code class="language-json">"config": {
|
|
1313
1482
|
"sourceLocale": "en",
|
|
1314
1483
|
"locales": ["en", "fr", "de"],
|
|
1315
1484
|
"outputs": [
|
|
1316
1485
|
{ "adapter": "flutter-arb", "path": "lib/l10n/app_{locale}.arb" }
|
|
1317
1486
|
],
|
|
1318
|
-
"ai": { "provider": "anthropic", "model": "claude-opus-4-8", "endpoint": null, "region": null, "batchSize": 25 },
|
|
1319
1487
|
"format": { "indent": 2, "sortKeys": true, "finalNewline": true },
|
|
1320
1488
|
"spelling": { "customWords": [] },
|
|
1321
1489
|
"lint": { "rules": {}, "ignore": [], "spelling": { "locales": {} } }
|
|
@@ -1353,7 +1521,7 @@ settings.profile.heading
|
|
|
1353
1521
|
<tr>
|
|
1354
1522
|
<td><code>localeCase</code></td>
|
|
1355
1523
|
<td><code>"lower-hyphen"</code> | <code>"lower-underscore"</code> | <code>"bcp47-hyphen"</code> | <code>"bcp47-underscore"</code> | null</td>
|
|
1356
|
-
<td>Locale-code rendering style for this output. Default: the adapter's own convention (<code>bcp47-underscore</code> for ARB
|
|
1524
|
+
<td>Locale-code rendering style for this output. Default: the adapter's own convention (<code>bcp47-underscore</code> for ARB; <code>bcp47-hyphen</code> for <code>angular-xliff</code>, <code>rails-yaml</code> and <code>apple-strings</code>; <code>lower-hyphen</code> for all others). Applies to the <code>{locale}</code> path token and any in-file locale token.</td>
|
|
1357
1525
|
</tr>
|
|
1358
1526
|
<tr>
|
|
1359
1527
|
<td><code>localeMap</code></td>
|
|
@@ -1361,42 +1529,9 @@ settings.profile.heading
|
|
|
1361
1529
|
<td>Per-locale override that wins over <code>localeCase</code>. Keys are canonical (lowercase-hyphen) codes and must be locales in <code>config.locales</code>. E.g. <code>{ "zh-hant": "zh_HK" }</code>.</td>
|
|
1362
1530
|
</tr>
|
|
1363
1531
|
</tbody></table>
|
|
1364
|
-
<
|
|
1365
|
-
<p>
|
|
1366
|
-
|
|
1367
|
-
<thead>
|
|
1368
|
-
<tr>
|
|
1369
|
-
<th>Field</th>
|
|
1370
|
-
<th>Type</th>
|
|
1371
|
-
<th>Default</th>
|
|
1372
|
-
</tr>
|
|
1373
|
-
</thead>
|
|
1374
|
-
<tbody><tr>
|
|
1375
|
-
<td><code>provider</code></td>
|
|
1376
|
-
<td><code>anthropic</code> | <code>openai</code> | <code>bedrock</code></td>
|
|
1377
|
-
<td><code>anthropic</code></td>
|
|
1378
|
-
</tr>
|
|
1379
|
-
<tr>
|
|
1380
|
-
<td><code>model</code></td>
|
|
1381
|
-
<td>string</td>
|
|
1382
|
-
<td><code>claude-opus-4-8</code></td>
|
|
1383
|
-
</tr>
|
|
1384
|
-
<tr>
|
|
1385
|
-
<td><code>endpoint</code></td>
|
|
1386
|
-
<td>string | null</td>
|
|
1387
|
-
<td><code>null</code></td>
|
|
1388
|
-
</tr>
|
|
1389
|
-
<tr>
|
|
1390
|
-
<td><code>region</code></td>
|
|
1391
|
-
<td>string | null</td>
|
|
1392
|
-
<td><code>null</code></td>
|
|
1393
|
-
</tr>
|
|
1394
|
-
<tr>
|
|
1395
|
-
<td><code>batchSize</code></td>
|
|
1396
|
-
<td>number</td>
|
|
1397
|
-
<td><code>25</code></td>
|
|
1398
|
-
</tr>
|
|
1399
|
-
</tbody></table>
|
|
1532
|
+
<blockquote>
|
|
1533
|
+
<p><strong>Info:</strong> AI provider settings — <code>provider</code>, <code>model</code>, <code>endpoint</code>, <code>region</code>, <code>batchSize</code> — are <strong>not</strong> in <code>config</code>. They're per-machine local settings; see AI Providers.</p>
|
|
1534
|
+
</blockquote>
|
|
1400
1535
|
<h2><code>format</code> (object, required)</h2>
|
|
1401
1536
|
<p>Controls how <code>glotfile.json</code> is written — keeps diffs small. See The State File.</p>
|
|
1402
1537
|
<table>
|
|
@@ -1464,6 +1599,43 @@ settings.profile.heading
|
|
|
1464
1599
|
<td>Use a specific dictionary for a locale.</td>
|
|
1465
1600
|
</tr>
|
|
1466
1601
|
</tbody></table>
|
|
1602
|
+
<h2><code>scan</code> (object, optional)</h2>
|
|
1603
|
+
<p>Tunes the codebase scan that powers usage detection and unused-key pruning. See scan.</p>
|
|
1604
|
+
<table>
|
|
1605
|
+
<thead>
|
|
1606
|
+
<tr>
|
|
1607
|
+
<th>Field</th>
|
|
1608
|
+
<th>Type</th>
|
|
1609
|
+
<th>Meaning</th>
|
|
1610
|
+
</tr>
|
|
1611
|
+
</thead>
|
|
1612
|
+
<tbody><tr>
|
|
1613
|
+
<td><code>include</code></td>
|
|
1614
|
+
<td>string[]</td>
|
|
1615
|
+
<td>Globs of files to scan.</td>
|
|
1616
|
+
</tr>
|
|
1617
|
+
<tr>
|
|
1618
|
+
<td><code>exclude</code></td>
|
|
1619
|
+
<td>string[]</td>
|
|
1620
|
+
<td>Globs to skip.</td>
|
|
1621
|
+
</tr>
|
|
1622
|
+
<tr>
|
|
1623
|
+
<td><code>accessors</code></td>
|
|
1624
|
+
<td>string[]</td>
|
|
1625
|
+
<td>Extra Flutter accessor names the <code>gen_l10n</code> object is bound to (auto-detection covers most projects; this is the escape hatch).</td>
|
|
1626
|
+
</tr>
|
|
1627
|
+
<tr>
|
|
1628
|
+
<td><code>patterns</code></td>
|
|
1629
|
+
<td>string[]</td>
|
|
1630
|
+
<td>Custom usage-scan regexes (capture group 1 = the key) applied to every file.</td>
|
|
1631
|
+
</tr>
|
|
1632
|
+
</tbody></table>
|
|
1633
|
+
<h2><code>autoExport</code> (boolean, optional)</h2>
|
|
1634
|
+
<p>When <code>true</code> (the default), <code>glotfile serve</code> re-exports the locale files to disk on every change. Set <code>false</code> to write only on an explicit <code>glotfile export</code>.</p>
|
|
1635
|
+
<h2><code>exportLocales</code> (string[], optional)</h2>
|
|
1636
|
+
<p>An allow-list narrowing which locales every export writes. Empty or absent means export all of <code>locales</code>. Persisted so the serve auto-export hook honours it too.</p>
|
|
1637
|
+
<h2><code>storage</code> (<code>"single"</code> | <code>"split"</code>, optional)</h2>
|
|
1638
|
+
<p>On-disk layout. Absent or <code>"single"</code> keeps the monolithic <code>glotfile.json</code>; <code>"split"</code> persists the catalog as a <code>glotfile/</code> directory of per-locale files. Set automatically by <code>glotfile split</code> — see The State File.</p>
|
|
1467
1639
|
<blockquote>
|
|
1468
1640
|
<p><strong>⚠ Validation on load</strong> — Glotfile validates the whole file when it loads. A bad <code>sourceLocale</code>, an unknown rule id, a plural key missing its <code>other</code> form, or a malformed value fails with a specific message rather than corrupting data.</p>
|
|
1469
1641
|
</blockquote>
|
|
@@ -1471,7 +1643,7 @@ settings.profile.heading
|
|
|
1471
1643
|
<ul>
|
|
1472
1644
|
<li>The State File · Output Formats · AI Providers · Checks and Validation</li>
|
|
1473
1645
|
</ul>
|
|
1474
|
-
`},{id:`reference/output-formats`,title:`Output Formats`,section:`Reference`,html:`<h1>Output Formats</h1>
|
|
1646
|
+
`,text:`Configuration Reference Every field in the block of — the configuration you commit alongside your code. Edit these in Settings rather than by hand where you can. Info: AI provider settings are not part of this committed config. They're per-machine and live in (gitignored) — see AI Providers. (string, required) The language you author in. Must be one of . See Keys and Locales. (string[], required) Every language you maintain, including the source. See Keys and Locales. (array, required) Export targets. Each entry: Field Type Meaning --- --- --- string One of the adapters. string Path template with / . string? Adapter-specific layout option (e.g. ). \\ \\ \\ \\ null Locale-code rendering style for this output. Default: the adapter's own convention ( for ARB; for , and ; for all others). Applies to the path token and any in-file locale token. \\ null Per-locale override that wins over . Keys are canonical (lowercase-hyphen) codes and must be locales in . E.g. . Info: AI provider settings — , , , , — are not in . They're per-machine local settings; see AI Providers. (object, required) Controls how is written — keeps diffs small. See The State File. Field Type Default --- --- --- number boolean boolean (object, optional) Field Type Meaning --- --- --- string[] Words the spelling check always accepts. (object, optional) Tune the validation rules (Settings → Quality checks in the UI). The spelling rule accepts Glossary terms and automatically. Field Type Meaning --- --- --- Per-rule severity overrides. string[] Key globs to skip. Use a specific dictionary for a locale. (object, optional) Tunes the codebase scan that powers usage detection and unused-key pruning. See scan. Field Type Meaning --- --- --- string[] Globs of files to scan. string[] Globs to skip. string[] Extra Flutter accessor names the object is bound to (auto-detection covers most projects; this is the escape hatch). string[] Custom usage-scan regexes (capture group 1 = the key) applied to every file. (boolean, optional) When (the default), re-exports the locale files to disk on every change. Set to write only on an explicit . (string[], optional) An allow-list narrowing which locales every export writes. Empty or absent means export all of . Persisted so the serve auto-export hook honours it too. ( , optional) On-disk layout. Absent or keeps the monolithic ; persists the catalog as a directory of per-locale files. Set automatically by — see The State File. ⚠ Validation on load — Glotfile validates the whole file when it loads. A bad , an unknown rule id, a plural key missing its form, or a malformed value fails with a specific message rather than corrupting data. Related - The State File · Output Formats · AI Providers · Checks and Validation`},{id:`reference/output-formats`,title:`Output Formats`,section:`Reference`,html:`<h1>Output Formats</h1>
|
|
1475
1647
|
<p>Glotfile exports your catalog to the locale formats your apps consume. You configure outputs in <code>config.outputs</code> (via Settings or the file); each entry names an <strong>adapter</strong> and a <strong>path template</strong>. <code>glotfile export</code> writes them all.</p>
|
|
1476
1648
|
<pre><code class="language-json">"outputs": [
|
|
1477
1649
|
{ "adapter": "flutter-arb", "path": "lib/l10n/app_{locale}.arb" },
|
|
@@ -1520,8 +1692,14 @@ settings.profile.heading
|
|
|
1520
1692
|
<td>one per locale</td>
|
|
1521
1693
|
</tr>
|
|
1522
1694
|
<tr>
|
|
1695
|
+
<td><code>apple-strings</code></td>
|
|
1696
|
+
<td>Apple <code>.strings</code></td>
|
|
1697
|
+
<td>printf</td>
|
|
1698
|
+
<td>one per locale</td>
|
|
1699
|
+
</tr>
|
|
1700
|
+
<tr>
|
|
1523
1701
|
<td><code>apple-stringsdict</code></td>
|
|
1524
|
-
<td>Apple <code>.stringsdict</code
|
|
1702
|
+
<td>Apple <code>.stringsdict</code> (plurals)</td>
|
|
1525
1703
|
<td>printf</td>
|
|
1526
1704
|
<td>one per locale</td>
|
|
1527
1705
|
</tr>
|
|
@@ -1548,7 +1726,7 @@ settings.profile.heading
|
|
|
1548
1726
|
<p><strong>Example:</strong> How <code>{namespace}</code> works — with <code>laravel-php</code> and path <code>lang/{locale}/{namespace}.php</code>, the key <code>auth.signIn.button</code> is written as <code>signIn.button</code> inside <code>lang/fr/auth.php</code>. Keys with no dot fall into a <code>messages</code> namespace.</p>
|
|
1549
1727
|
</blockquote>
|
|
1550
1728
|
<h2>Locale code rendering</h2>
|
|
1551
|
-
<p>By default each adapter renders locale codes in its own convention: <code>flutter-arb</code> uses BCP-47 with underscores (<code>en_US</code>, <code>zh_Hant_TW</code>); <code>angular-xliff</code> and <code>
|
|
1729
|
+
<p>By default each adapter renders locale codes in its own convention: <code>flutter-arb</code> uses BCP-47 with underscores (<code>en_US</code>, <code>zh_Hant_TW</code>); <code>angular-xliff</code>, <code>rails-yaml</code> and <code>apple-strings</code> use BCP-47 with hyphens (<code>en-US</code>, <code>pt-BR</code>); every other adapter uses glotfile's internal lowercase-hyphen form (<code>en-us</code>).</p>
|
|
1552
1730
|
<h3><code>localeCase</code></h3>
|
|
1553
1731
|
<p>The optional <code>localeCase</code> field on an output entry overrides the adapter default for <strong>all</strong> locales in that output:</p>
|
|
1554
1732
|
<table>
|
|
@@ -1595,14 +1773,12 @@ settings.profile.heading
|
|
|
1595
1773
|
<h2>Lossless where possible, loud where not</h2>
|
|
1596
1774
|
<p>Placeholders and ICU <code>plural</code>/<code>select</code> structure are <strong>preserved</strong> and converted to each format's native mechanism. Where a conversion would be lossy, <code>glotfile export</code> emits a <strong>warning</strong> and writes safe output rather than corrupting the file. See Placeholders and ICU.</p>
|
|
1597
1775
|
<h2>Round-tripping (import)</h2>
|
|
1598
|
-
<
|
|
1599
|
-
<p><strong>Info:</strong> 🚧 Coming soon — <code>glotfile import</code> will read existing files back into the catalog using these same adapters in reverse.</p>
|
|
1600
|
-
</blockquote>
|
|
1776
|
+
<p><code>glotfile import</code> reads existing files back into the catalog using these same adapters in reverse — inferring <code>localeCase</code>/<code>localeMap</code> from the filenames so a later export reproduces them byte-for-byte. See import.</p>
|
|
1601
1777
|
<h2>Related</h2>
|
|
1602
1778
|
<ul>
|
|
1603
1779
|
<li>export · Placeholders and ICU · Plurals · Configuration Reference</li>
|
|
1604
1780
|
</ul>
|
|
1605
|
-
`},{id:`reference/placeholders-and-icu`,title:`Placeholders and ICU`,section:`Reference`,html:`<h1>Placeholders and ICU</h1>
|
|
1781
|
+
`,text:`Output Formats Glotfile exports your catalog to the locale formats your apps consume. You configure outputs in (via Settings or the file); each entry names an adapter and a path template . writes them all. Adapters Adapter Target Placeholder style Files written --- --- --- --- Flutter ICU one per locale Laravel arrays one per locale per namespace i18next / generic JSON one per locale Vue I18n JSON one per locale gettext printf ( ) one per locale Apple printf one per locale Apple (plurals) printf one per locale Angular XLIFF 1.2 ( ) one per locale Rails i18n one per locale Path templates Two tokens are substituted in : - — the locale code ( , , …). Used by every adapter. - — the first dot-segment of the key. Used by adapters that split files by namespace. Example: How works — with and path , the key is written as inside . Keys with no dot fall into a namespace. Locale code rendering By default each adapter renders locale codes in its own convention: uses BCP-47 with underscores ( , ); , and use BCP-47 with hyphens ( , ); every other adapter uses glotfile's internal lowercase-hyphen form ( ). The optional field on an output entry overrides the adapter default for all locales in that output: Value Example --- --- , , , , applies to the filename token and any in-file locale token (ARB , gettext , XLIFF ). The optional field maps individual canonical locale codes to exact export tokens, overriding for those locales: Keys are canonical (lowercase-hyphen) codes and must be locales present in . Use for semantic remaps that no style can express — for example, Flutter rejects script subtags so must ship as ; Android requires . ⚠ Locale collision — if two locales resolve to the same export token after applying and , emits a warning and writes only the first locale's file (in config order), skipping the colliding ones rather than silently overwriting. Round-trip safety sets and automatically: it inspects the filenames it finds, picks the that reproduces them, and records only the exceptions in . A subsequent produces byte-identical files. The option Some adapters accept an optional to tune their output. For example, supports a flat layout: (Without , JSON adapters nest keys by their dot segments.) Lossless where possible, loud where not Placeholders and ICU / structure are preserved and converted to each format's native mechanism. Where a conversion would be lossy, emits a warning and writes safe output rather than corrupting the file. See Placeholders and ICU. Round-tripping (import) reads existing files back into the catalog using these same adapters in reverse — inferring / from the filenames so a later export reproduces them byte-for-byte. See import. Related - export · Placeholders and ICU · Plurals · Configuration Reference`},{id:`reference/placeholders-and-icu`,title:`Placeholders and ICU`,section:`Reference`,html:`<h1>Placeholders and ICU</h1>
|
|
1606
1782
|
<p>Translations must keep the machinery the source string carries: <strong>interpolation placeholders</strong> and <strong>ICU plural/select</strong> structure. Glotfile protects both during translation, validation, and export.</p>
|
|
1607
1783
|
<h2>One canonical form, converted on export</h2>
|
|
1608
1784
|
<p>Glotfile stores every placeholder in a single <strong>canonical</strong> form — <code>{name}</code> —
|
|
@@ -1717,7 +1893,7 @@ round-trip.</p>
|
|
|
1717
1893
|
<ul>
|
|
1718
1894
|
<li>Plurals · Output Formats · Checks and Validation · How Translation Works</li>
|
|
1719
1895
|
</ul>
|
|
1720
|
-
`},{id:`guides/continuous-integration`,title:`Continuous Integration`,section:`Guides`,html:`<h1>Continuous Integration</h1>
|
|
1896
|
+
`,text:`Placeholders and ICU Translations must keep the machinery the source string carries: interpolation placeholders and ICU plural/select structure. Glotfile protects both during translation, validation, and export. One canonical form, converted on export Glotfile stores every placeholder in a single canonical form — — no matter what style the source file used. Import normalises to it; export converts it to each adapter's native style. So you edit and validate against one syntax, and each output file still gets the flavour its framework expects. Format Native style Example On import → stored On export ← stored --- --- --- --- --- Flutter ARB ICU named (already canonical) Vue I18n single braces (already canonical) Laravel colon Rails YAML percent-brace i18next double braces Angular XLIFF placeholder element A translation that drops, renames, or adds a placeholder relative to the source is: - rejected by AI translation (not written), and - flagged by the rule. Because everything is canonical internally, the editor and the checks only ever look for — they never mistake an unrelated colon or percent sign (a time like , a ratio ) for a placeholder. printf formats ( , in gettext and Apple ) are export-only and lossy — they sit outside the canonical guarantee. See Lossy conversions below. Escaping a literal To write text that looks like a placeholder but should be left alone, use ICU apostrophe quoting : You write You get --- --- a literal the literal text (not a token) a literal apostrophe Quoted spans are treated as plain text, so is never flagged by the checks or altered by AI translation. ARB output (ICU) preserves the quoting on round-trip. ICU plural and select ICU constructs like: are preserved structurally. The rule flags a string where one side (source or translation) is an ICU plural/select and the other isn't. See also Plurals for the dedicated plural-key model. Lossy conversions Not every format can represent every construct. When export hits one it can't faithfully convert, it warns and writes safe output rather than emitting something broken: Treat these warnings as a prompt to simplify the string or pick a different adapter for that output. Related - Plurals · Output Formats · Checks and Validation · How Translation Works`},{id:`guides/continuous-integration`,title:`Continuous Integration`,section:`Guides`,html:`<h1>Continuous Integration</h1>
|
|
1721
1897
|
<p>Glotfile is built to run in CI so a broken or stale translation state can't reach <code>main</code>. The key command is <code>glotfile check</code>; <code>glotfile lint</code> gives you finer control.</p>
|
|
1722
1898
|
<h2>The one-liner</h2>
|
|
1723
1899
|
<p>Add a single step that validates the catalog <strong>and</strong> confirms exports are up to date:</p>
|
|
@@ -1801,7 +1977,7 @@ glotfile lint --locale fr,de # only some locales
|
|
|
1801
1977
|
<ul>
|
|
1802
1978
|
<li>lint and check · Checks and Validation · export · Translation Workflow</li>
|
|
1803
1979
|
</ul>
|
|
1804
|
-
`},{id:`guides/keeping-translations-fresh`,title:`Keeping Translations Fresh`,section:`Guides`,html:`<h1>Keeping Translations Fresh</h1>
|
|
1980
|
+
`,text:`Continuous Integration Glotfile is built to run in CI so a broken or stale translation state can't reach . The key command is ; gives you finer control. The one-liner Add a single step that validates the catalog and confirms exports are up to date: exits non-zero if there are any errors — a lint error or an finding (someone changed copy but forgot to run ). That one command is usually all you need. Tip: Why over + — re-exports in memory and compares to disk, so you don't need to write files and diff. It also catches catalog problems (placeholder mismatches, empty translations, glossary violations) that a diff wouldn't. What gets gated Failure Caught by Default severity --- --- --- Empty source / empty translation , error Placeholder or ICU mismatch , error Glossary violation , error Length / identical-to-source / whitespace / spelling , warn Exported file missing or stale only error Tune severities in — see Checks and Validation. GitHub Actions Note: No credentials needed in CI — and are fully offline — only translate needs an API key. Don't put translation secrets in CI just to validate. Failing on warnings By default only errors fail the build. To hold the line on warnings too: exits when warnings exceed the threshold. Combine with (run both) if you want stale-export gating and zero warnings. Code scanning (SARIF) Emit SARIF and upload it so findings appear inline on the PR, each located at its line in : is also available for custom tooling. Scoping a run Related - lint and check · Checks and Validation · export · Translation Workflow`},{id:`guides/keeping-translations-fresh`,title:`Keeping Translations Fresh`,section:`Guides`,html:`<h1>Keeping Translations Fresh</h1>
|
|
1805
1981
|
<p>A translation is only correct relative to the source string it was made from. When you edit a source string, its translations may no longer match — Glotfile tracks this so nothing drifts silently.</p>
|
|
1806
1982
|
<h2>How staleness is detected</h2>
|
|
1807
1983
|
<p>Each translated value records the <strong>source string it was translated from</strong> (the <code>source</code> field on the value). When you change a source string, any translation whose recorded source no longer matches is flagged <strong><code>needs-review</code></strong>. See Review States.</p>
|
|
@@ -1827,7 +2003,7 @@ You change the source to <code>"Log in"</code>. The French value is no
|
|
|
1827
2003
|
<ul>
|
|
1828
2004
|
<li>Review States · How Translation Works · Translation Workflow</li>
|
|
1829
2005
|
</ul>
|
|
1830
|
-
`},{id:`guides/translation-workflow`,title:`Translation Workflow`,section:`Guides`,html:`<h1>Translation Workflow</h1>
|
|
2006
|
+
`,text:`Keeping Translations Fresh A translation is only correct relative to the source string it was made from. When you edit a source string, its translations may no longer match — Glotfile tracks this so nothing drifts silently. How staleness is detected Each translated value records the source string it was translated from (the field on the value). When you change a source string, any translation whose recorded source no longer matches is flagged . See Review States. Example: source → (reviewed, source ). You change the source to . The French value is now marked — it was translated from text that no longer exists. Finding stale translations - In the Editor, filter to needs-review . - Analytics counts per locale. Fixing them 1. Review the flagged value against the new source. 2. Edit it directly and mark it , or 3. Re-translate: a bare only fills empty values, so it won't touch a value that still has text. To have the AI redo non-empty values, run (or clear the stale value first, then ). Either way, a value still marked is protected — unmark it first to have the AI redo it. Why not auto-overwrite? Glotfile flags rather than silently re-translating because a source edit might be cosmetic (a typo fix that doesn't change meaning) or substantive (a different action entirely). Only you know which — so it surfaces the change and lets you decide. Related - Review States · How Translation Works · Translation Workflow`},{id:`guides/translation-workflow`,title:`Translation Workflow`,section:`Guides`,html:`<h1>Translation Workflow</h1>
|
|
1831
2007
|
<p>The day-to-day loop, end to end. This is the same flow as Quick Start, but with the <em>why</em> behind each step.</p>
|
|
1832
2008
|
<h2>The loop</h2>
|
|
1833
2009
|
<pre><code>author ──▶ translate ──▶ review ──▶ export ──▶ commit
|
|
@@ -1863,7 +2039,7 @@ git commit -m "Checkout copy + translations"
|
|
|
1863
2039
|
<ul>
|
|
1864
2040
|
<li>Continuous Integration · Keeping Translations Fresh · How Translation Works · Review States</li>
|
|
1865
2041
|
</ul>
|
|
1866
|
-
`},{id:`troubleshooting-and-faq`,title:`Troubleshooting and FAQ`,section:`Help`,html:`<h1>Troubleshooting and FAQ</h1>
|
|
2042
|
+
`,text:`Translation Workflow The day-to-day loop, end to end. This is the same flow as Quick Start, but with the why behind each step. The loop 1. Author source copy as you build Run and add keys with their source strings in the Editor while you build a feature. Add a one-line context for anything ambiguous — it's the highest-leverage thing you can do for translation quality. Attach a screenshot for UI-heavy strings. 2. Fill the other languages This fills only the empty values; pass to re-translate everything. Or use the Editor's translate action. New translations land as . See How Translation Works. 3. Review Filter the Editor to machine and check the new translations. Promote good ones to (which protects them from being overwritten); flag the rest as . Watch the Analytics panel for reviewed-vs-translated coverage. 4. Export This regenerates your apps' locale files from the catalog. See Output Formats. 5. Commit Commit together with your code and the regenerated locale files. The diff is the review: Why git-native pays off Because the catalog is just a file in your repo: - Branching — translations live on the feature branch with the code that needs them. - Pull-request review — reviewers see copy changes as a normal diff. - Rollback — reverting a commit reverts the copy too. - No drift — CI can fail the build if exports are stale or the catalog has problems. Related - Continuous Integration · Keeping Translations Fresh · How Translation Works · Review States`},{id:`troubleshooting-and-faq`,title:`Troubleshooting and FAQ`,section:`Help`,html:`<h1>Troubleshooting and FAQ</h1>
|
|
1867
2043
|
<h2>Setup</h2>
|
|
1868
2044
|
<p><strong><code>glotfile: command not found</code></strong>
|
|
1869
2045
|
It's pre-1.0 and not yet on npm. Run from a checkout: <code>npm install && npm run build && node bin/glotfile.js</code>. See Installation.</p>
|
|
@@ -1894,11 +2070,11 @@ You can, but you rarely need to — the UI writes it for you, deterministically.
|
|
|
1894
2070
|
Check <code>config.format</code> (<code>indent</code>, <code>sortKeys</code>, <code>finalNewline</code>). Deterministic formatting keeps diffs minimal. See The State File.</p>
|
|
1895
2071
|
<h2>General</h2>
|
|
1896
2072
|
<p><strong>Do I already have translations I can import?</strong>
|
|
1897
|
-
|
|
2073
|
+
Import existing locale files with <code>glotfile import</code> — see import. You can also add keys via the Editor.</p>
|
|
1898
2074
|
<p><strong>Does anything leave my machine?</strong>
|
|
1899
2075
|
Only the AI calls you trigger. The UI is local-only; no credentials or screenshot bytes are ever logged. See AI Log.</p>
|
|
1900
2076
|
<h2>Related</h2>
|
|
1901
2077
|
<ul>
|
|
1902
2078
|
<li>Home · Installation · AI Providers · Continuous Integration</li>
|
|
1903
2079
|
</ul>
|
|
1904
|
-
`}],UN={class:`flex min-h-0 flex-1 overflow-hidden`},WN={class:`flex w-56 shrink-0 flex-col gap-1 overflow-y-auto border-r bg-muted/30 px-2 py-3`},GN=[`onClick`],KN={class:`min-w-0 flex-1 overflow-y-auto`},qN=[`innerHTML`],JN=P({__name:`DocsView`,setup(e){let t=[``,`Getting Started`,`Web UI`,`CLI`,`Concepts`,`AI Translation`,`Reference`,`Guides`,`Help`],n=A(HN[0]?.id??``),r=K(()=>{let e=new Map;for(let n of t)e.set(n,[]);for(let t of HN)e.has(t.section)||e.set(t.section,[]),e.get(t.section).push(t);return t.map(t=>({section:t,pages:e.get(t)??[]})).filter(e=>e.pages.length>0)}),i=K(()=>HN.find(e=>e.id===n.value)??HN[0]);return(e,t)=>(R(),z(`div`,UN,[V(`nav`,WN,[(R(!0),z(L,null,F(r.value,(e,t)=>(R(),z(L,{key:e.section},[e.section?(R(),z(`div`,{key:0,class:O([`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,t>0?`mt-3`:``])},k(e.section),3)):W(``,!0),(R(!0),z(L,null,F(e.pages,e=>(R(),z(`button`,{key:e.id,type:`button`,class:O([`w-full rounded-md px-2 py-1 text-left text-sm transition-colors`,n.value===e.id?`bg-primary text-primary-foreground`:`text-foreground hover:bg-accent hover:text-accent-foreground`]),onClick:t=>n.value=e.id},k(e.title),11,GN))),128))],64))),128))]),V(`div`,KN,[V(`div`,{class:`prose prose-sm dark:prose-invert mx-auto max-w-3xl px-8 py-6`,innerHTML:i.value?.html},null,8,qN)])]))}}),YN={en:`English`,fr:`French`,de:`German`,es:`Spanish`,pt:`Portuguese`,it:`Italian`,nl:`Dutch`,ca:`Catalan`,pl:`Polish`,ru:`Russian`,uk:`Ukrainian`,cs:`Czech`,sk:`Slovak`,sv:`Swedish`,da:`Danish`,no:`Norwegian`,nb:`Norwegian Bokmål`,fi:`Finnish`,tr:`Turkish`,el:`Greek`,ro:`Romanian`,hu:`Hungarian`,bg:`Bulgarian`,hr:`Croatian`,sr:`Serbian`,sl:`Slovenian`,ja:`Japanese`,ko:`Korean`,zh:`Chinese`,ar:`Arabic`,he:`Hebrew`,hi:`Hindi`,th:`Thai`,vi:`Vietnamese`,id:`Indonesian`,ms:`Malay`,fa:`Persian`};function XN(e){let[t=``,n]=e.split(/[-_]/),r=t.toLowerCase(),i=n&&/^[A-Za-z]{2}$/.test(n)?n.toUpperCase():void 0,a=YN[r]??e;return{code:e,name:i?`${a} (${i})`:a}}var ZN={class:`p-6`},QN={class:`flex items-start gap-3 pr-6`},$N={class:`grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-primary/25 bg-primary/10 font-mono text-[13px] font-semibold leading-none tracking-tight text-primary`},eP={class:`min-w-0`},tP={class:`font-medium text-foreground`},nP={class:`font-mono text-[12px]`},rP={class:`mt-4 flex items-center gap-4 rounded-lg border border-border bg-muted/40 px-3.5 py-2.5`},iP={class:`flex flex-col`},aP={class:`text-[17px] font-semibold leading-none tabular-nums`},oP={class:`flex flex-col`},sP={class:`text-[17px] font-semibold leading-none tabular-nums`},cP={class:`ml-auto flex items-center gap-1.5 whitespace-nowrap text-[11px] text-muted-foreground`},lP={class:`mt-5`},uP={class:`!flex min-w-0 items-center gap-2`},dP={class:`font-mono text-[13px]`},fP={class:`truncate text-[13px] text-muted-foreground`},pP={class:`flex items-center gap-2`},mP={class:`font-mono text-[13px]`},hP={class:`text-[13px] text-muted-foreground`},gP={class:`mt-4`},_P={class:`flex items-center justify-between`},vP={class:`whitespace-nowrap text-[12px] tabular-nums text-muted-foreground`},yP={class:`mt-1.5 flex flex-wrap gap-1.5 rounded-lg border border-border bg-muted/30 p-2.5`},bP=[`disabled`,`onClick`],xP={class:`font-mono`},SP={key:0,class:`ml-0.5 rounded-sm bg-primary/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-primary`},CP={key:0,class:`mt-4`},wP={class:`overflow-hidden rounded-lg border border-border`},TP={class:`ml-auto font-mono text-[11px] text-muted-foreground/70`},EP={key:0,class:`divide-y divide-border border-t border-border gf-content-fade`},DP={class:`shrink-0 font-mono text-foreground`},OP={class:`ml-auto truncate text-right text-muted-foreground`},kP={key:0,class:`px-3 py-1.5 text-[11px] text-muted-foreground/70`},AP={class:`flex items-center gap-2 border-t border-border px-6 py-4`},jP={class:`ml-1 flex cursor-pointer select-none items-center gap-1.5 text-[12px] text-muted-foreground`},MP={class:`ml-auto`},NP={class:`flex flex-col items-center justify-center gap-4 p-6 py-8 text-center`},PP={key:0,class:`mt-1 text-[13px] text-muted-foreground`},FP={class:`p-6`},IP={class:`flex flex-col items-center gap-3 pt-1 text-center`},LP={class:`grid h-12 w-12 place-items-center rounded-full bg-success-bg text-success ring-1 ring-success-border`},RP={class:`font-semibold text-foreground tabular-nums`},zP={class:`font-semibold text-foreground`},BP={key:0,class:`mt-5 overflow-hidden rounded-lg border border-warning-border bg-warning-bg/60`},VP={class:`whitespace-nowrap text-[13px] font-medium text-warning`},HP={key:0,class:`max-h-44 divide-y divide-warning-border/40 overflow-auto border-t border-warning-border/70 gf-content-fade`},UP={class:`flex items-center border-t border-border px-6 py-4`},WP={class:`ml-auto`},GP={class:`p-6`},KP={class:`flex items-start gap-3 pr-6`},qP={class:`grid h-10 w-10 shrink-0 place-items-center rounded-full bg-destructive-soft text-destructive`},JP={class:`min-w-0`},YP={class:`flex items-center border-t border-border px-6 py-4`},XP={class:`ml-auto`},ZP=P({__name:`ImportWizard`,emits:[`dismiss`,`imported`],setup(e,{expose:t,emit:n}){let r=n,i=A(!0),a=A(`confirm`),o=A(null),s=A(``),c=A({}),l=A(!1),u=A(!1),d=A(null),f=A(``),p=A(!0);t({init:m});async function m(){try{let e=await kf();if(!e.found){r(`dismiss`);return}o.value=e,s.value=e.sourceLocale}catch{r(`dismiss`)}}let h={"laravel-php":{label:`Laravel PHP`,glyph:`</>`,file:`lang/{locale}/*.php`},"vue-i18n-json":{label:`Vue i18n JSON`,glyph:`{ }`,file:`locales/{locale}.json`},"flutter-arb":{label:`Flutter ARB`,glyph:`arb`,file:`lib/l10n/app_{locale}.arb`},"apple-strings":{label:`Apple .strings`,glyph:``,file:`{locale}.lproj/Localizable.strings`}},g=K(()=>h[o.value?.format??``]??{label:o.value?.format??``,glyph:`{}`,file:``});function _(e){return e===s.value||!c.value[e]}function v(e){e!==s.value&&(c.value={...c.value,[e]:!c.value[e]})}let y=K(()=>o.value?o.value.locales.filter(_):[]),b=K(()=>y.value.length),x=K(()=>o.value?Math.max(0,o.value.keyCount-o.value.sampleKeys.length):0);async function S(){if(o.value){a.value=`importing`;try{d.value=await Af({format:o.value.format,sourceLocale:s.value,locales:y.value,cldr:p.value}),a.value=`done`}catch(e){f.value=e.message,a.value=`error`}}}function C(e){e||a.value!==`importing`&&(a.value===`done`?r(`imported`):r(`dismiss`))}return(e,t)=>(R(),B(j(bh),{open:i.value,"onUpdate:open":C},{default:M(()=>[H(j(sg),null,{default:M(()=>[H(j(ag),{class:`fixed inset-0 z-50 bg-foreground/40 gf-content-fade`}),H(j(ng),{class:`fixed left-1/2 top-1/2 z-50 w-[28rem] max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-card text-card-foreground shadow-2xl focus:outline-none gf-content-fade`,onInteractOutside:t[9]||=q(()=>{},[`prevent`])},{default:M(()=>[a.value===`confirm`&&o.value?(R(),z(L,{key:0},[V(`button`,{type:`button`,class:`absolute right-3.5 top-3.5 z-10 grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:t[0]||=e=>r(`dismiss`)},[H(j(kd),{class:`size-4`})]),V(`div`,ZN,[V(`div`,QN,[V(`div`,$N,k(g.value.glyph),1),V(`div`,eP,[H(j(cg),{class:`text-base font-semibold leading-tight`},{default:M(()=>[...t[10]||=[U(`Import your translations`,-1)]]),_:1}),H(j(rg),{class:`mt-0.5 text-[13px] text-muted-foreground`},{default:M(()=>[t[11]||=U(` Found a `,-1),V(`span`,tP,k(g.value.label),1),t[12]||=U(` setup in `,-1),V(`span`,nP,k(g.value.file),1),t[13]||=U(`. `,-1)]),_:1})])]),V(`div`,rP,[V(`div`,iP,[V(`span`,aP,k(o.value.keyCount.toLocaleString()),1),t[14]||=V(`span`,{class:`mt-1 whitespace-nowrap text-[11px] text-muted-foreground`},`keys detected`,-1)]),t[17]||=V(`div`,{class:`h-7 w-px bg-border`},null,-1),V(`div`,oP,[V(`span`,sP,k(o.value.locales.length),1),t[15]||=V(`span`,{class:`mt-1 whitespace-nowrap text-[11px] text-muted-foreground`},`locales`,-1)]),V(`div`,cP,[H(j(Gu),{class:`size-3.5 opacity-70`}),t[16]||=U(` Detected automatically `,-1)])]),V(`div`,lP,[H(j(IS),{class:`flex items-center gap-1.5 whitespace-nowrap`},{default:M(()=>[...t[18]||=[U(` Source language `,-1),V(`span`,{class:`text-[12px] font-normal text-muted-foreground`},`· the original text`,-1)]]),_:1}),H(j(Iy),{modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e},{default:M(()=>[H(j(iS),{class:`mt-1.5`},{default:M(()=>[V(`span`,uP,[H(FC,{code:s.value,size:14},null,8,[`code`]),V(`span`,dP,k(s.value),1),V(`span`,fP,k(j(XN)(s.value).name),1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(o.value.locales,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[V(`span`,pP,[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,mP,k(e),1),V(`span`,hP,k(j(XN)(e).name),1)])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),V(`div`,gP,[V(`div`,_P,[H(j(IS),{class:`whitespace-nowrap`},{default:M(()=>[...t[19]||=[U(`Locales to import`,-1)]]),_:1}),V(`span`,vP,k(b.value)+` of `+k(o.value.locales.length),1)]),V(`div`,yP,[(R(!0),z(L,null,F(o.value.locales,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,disabled:e===s.value,class:O([`group inline-flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border pl-1.5 pr-2 text-[12px] transition-colors`,e===s.value?`border-primary/40 bg-primary/10 cursor-default`:_(e)?`border-input bg-card text-foreground hover:bg-muted`:`border-dashed border-border bg-transparent text-muted-foreground hover:bg-muted/50`]),onClick:t=>v(e)},[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,xP,k(e),1),e===s.value?(R(),z(`span`,SP,`src`)):(R(),z(`span`,{key:1,class:O([`grid size-3.5 place-items-center rounded-[3px] border`,_(e)?`border-primary bg-primary text-primary-foreground`:`border-border text-transparent`])},[H(j(Du),{class:`size-2.5`,"stroke-width":3})],2))],10,bP)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(k(e===s.value?`Source language — always imported`:_(e)?`Click to exclude`:`Click to include`),1)]),_:2},1024)]),_:2},1024))),128))])]),o.value.sampleKeys.length?(R(),z(`div`,CP,[V(`div`,wP,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3 py-2 text-[13px] text-muted-foreground transition-colors hover:bg-muted/50`,onClick:t[2]||=e=>l.value=!l.value},[H(j(ku),{class:O([`size-3.5 shrink-0 transition-transform`,l.value?`rotate-90`:``])},null,8,[`class`]),t[20]||=V(`span`,{class:`whitespace-nowrap`},`Preview sample keys`,-1),V(`span`,TP,k(g.value.glyph),1)]),l.value?(R(),z(`div`,EP,[(R(!0),z(L,null,F(o.value.sampleKeys,e=>(R(),z(`div`,{key:e.key,class:`flex items-baseline gap-3 px-3 py-1.5 text-[12px]`},[V(`span`,DP,k(e.key),1),V(`span`,OP,k(e.value),1)]))),128)),x.value>0?(R(),z(`div`,kP,` + `+k(x.value.toLocaleString())+` more keys `,1)):W(``,!0)])):W(``,!0)])])):W(``,!0)]),V(`div`,AP,[H(j(Q),{variant:`ghost`,size:`sm`,onClick:t[3]||=e=>r(`dismiss`)},{default:M(()=>[...t[21]||=[U(`Skip`,-1)]]),_:1}),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`label`,jP,[vr(V(`input`,{type:`checkbox`,"data-testid":`cldr-toggle`,"onUpdate:modelValue":t[4]||=e=>p.value=e,class:`size-3.5 accent-primary`},null,512),[[Il,p.value]]),t[22]||=U(` Convert plurals to CLDR categories `,-1)])]),_:1}),H(j(ZS),{class:`max-w-xs`},{default:M(()=>[...t[23]||=[U(`Rewrite exact =N plural selectors (e.g. =1) into each language's CLDR plural categories, the way Crowdin does.`,-1)]]),_:1})]),_:1}),V(`div`,MP,[H(j(Q),{"data-testid":`import-btn`,disabled:b.value===0,onClick:S},{default:M(()=>[H(j(Ad),{class:`size-4`}),U(` Import `+k(b.value)+` `+k(b.value===1?`locale`:`locales`),1)]),_:1},8,[`disabled`])])])],64)):a.value===`importing`?(R(),z(L,{key:1},[H(j(cg),{class:`sr-only`},{default:M(()=>[...t[24]||=[U(`Importing translations`,-1)]]),_:1}),V(`div`,NP,[H(j($u),{class:`size-10 text-primary gf-spin`}),V(`div`,null,[t[25]||=V(`div`,{class:`text-sm font-semibold`},`Importing translations…`,-1),o.value?(R(),z(`div`,PP,` Reading `+k(o.value.keyCount.toLocaleString())+` keys across `+k(b.value)+` locales `,1)):W(``,!0)])])],64)):a.value===`done`&&d.value?(R(),z(L,{key:2},[V(`div`,FP,[V(`div`,IP,[V(`div`,LP,[H(j(Du),{class:`size-6`,"stroke-width":2.5})]),V(`div`,null,[H(j(cg),{class:`text-base font-semibold`},{default:M(()=>[...t[26]||=[U(`Import complete`,-1)]]),_:1}),H(j(rg),{class:`mt-1 text-[13px] text-muted-foreground`},{default:M(()=>[V(`span`,RP,k(d.value.keyCount.toLocaleString())+` keys`,1),t[27]||=U(` across `,-1),V(`span`,zP,k(d.value.localeCount)+` locales`,1),t[28]||=U(` imported. `,-1)]),_:1})])]),d.value.warnings.length?(R(),z(`div`,BP,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-left`,onClick:t[5]||=e=>u.value=!u.value},[H(j(Td),{class:`size-3.5 shrink-0 text-warning`}),V(`span`,VP,k(d.value.warnings.length)+` `+k(d.value.warnings.length===1?`warning`:`warnings`),1),t[29]||=V(`span`,{class:`whitespace-nowrap text-[12px] text-warning/70`},`· import still succeeded`,-1),H(j(ku),{class:O([`ml-auto size-3.5 shrink-0 text-warning transition-transform`,u.value?`rotate-90`:``])},null,8,[`class`])]),u.value?(R(),z(`ul`,HP,[(R(!0),z(L,null,F(d.value.warnings,(e,t)=>(R(),z(`li`,{key:t,class:`px-3 py-2 text-[12px] text-muted-foreground`},k(e),1))),128))])):W(``,!0)])):W(``,!0)]),V(`div`,UP,[V(`div`,WP,[H(j(Q),{onClick:t[6]||=e=>r(`imported`)},{default:M(()=>[t[30]||=U(`Open editor `,-1),H(j(bu),{class:`size-4`})]),_:1})])])],64)):a.value===`error`?(R(),z(L,{key:3},[V(`button`,{type:`button`,class:`absolute right-3.5 top-3.5 z-10 grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:t[7]||=e=>r(`dismiss`)},[H(j(kd),{class:`size-4`})]),V(`div`,GP,[V(`div`,KP,[V(`div`,qP,[H(j(Td),{class:`size-5`})]),V(`div`,JP,[H(j(cg),{class:`text-base font-semibold`},{default:M(()=>[...t[31]||=[U(`Couldn't import translations`,-1)]]),_:1}),H(j(rg),{class:`mt-1 text-[13px] text-muted-foreground`},{default:M(()=>[U(k(f.value),1)]),_:1})])])]),V(`div`,YP,[V(`div`,XP,[H(j(Q),{variant:`outline`,onClick:t[8]||=e=>r(`dismiss`)},{default:M(()=>[...t[32]||=[U(`Dismiss`,-1)]]),_:1})])])],64)):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),QP=`glotfile-theme`,$P=[`system`,`light`,`dark`],eF=e=>$P.includes(e);function tF(){let e=localStorage.getItem(QP);return eF(e)?e:`system`}var nF=window.matchMedia(`(prefers-color-scheme: dark)`),rF=A(nF.matches);nF.addEventListener(`change`,e=>{rF.value=e.matches});var iF=A(tF()),aF=K(()=>iF.value===`system`?rF.value:iF.value===`dark`);function oF(){document.documentElement.classList.toggle(`dark`,aF.value)}function sF(){N(aF,oF,{immediate:!0,flush:`sync`})}function cF(e){iF.value=e,localStorage.setItem(QP,e),tf({theme:e}).catch(()=>{})}async function lF(){try{let{theme:e}=await ef();eF(e)&&e!==iF.value&&(iF.value=e,localStorage.setItem(QP,e))}catch{}}var uF={class:`flex flex-col items-center gap-0.5 rounded-lg bg-black/15 p-0.5`},dF=[`data-mode`,`aria-label`,`aria-pressed`,`onClick`],fF=P({__name:`ThemeToggle`,setup(e){let t=[{value:`light`,label:`Light`,icon:xd},{value:`system`,label:`System`,icon:nd},{value:`dark`,label:`Dark`,icon:rd}];return(e,n)=>(R(),z(`div`,uF,[(R(),z(L,null,F(t,e=>H(j(Sb),{key:e.value},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-mode":e.value,"aria-label":e.label,"aria-pressed":j(iF)===e.value,class:O(j(eS)(`flex size-8 items-center justify-center rounded-md transition-colors`,j(iF)===e.value?`bg-primary text-primary-foreground`:`text-rail-foreground/70 hover:bg-white/10 hover:text-rail-foreground`)),onClick:t=>j(cF)(e.value)},[(R(),B(aa(e.icon),{class:`size-4`}))],10,dF)]),_:2},1024),H(j(ZS),{side:`right`},{default:M(()=>[U(k(e.label),1)]),_:2},1024)]),_:2},1024)),64))]))}}),pF=P({__name:`Kbd`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`kbd`,{class:O(j(eS)(`inline-flex h-5 min-w-5 items-center justify-center rounded border bg-muted px-1.5 font-mono text-xs font-medium text-muted-foreground`,e.$props.class))},[I(e.$slots,`default`)],2))}}),mF=[{route:`editor`,keys:[`g`,`e`],label:`Editor`},{route:`analytics`,keys:[`g`,`a`],label:`Analytics`},{route:`glossary`,keys:[`g`,`g`],label:`Glossary`},{route:`screenshots`,keys:[`g`,`i`],label:`Screenshots`},{route:`settings`,keys:[`g`,`s`],label:`Settings`},{route:`activity`,keys:[`g`,`l`],label:`Activity`},{route:`docs`,keys:[`g`,`d`],label:`Docs`}];function hF(e,t){if(e.pending===`g`){let e=mF.find(e=>e.keys[1]===t);return{state:{pending:null},action:e?{type:`navigate`,route:e.route}:null}}return t===`g`?{state:{pending:`g`},action:null}:t===`?`?{state:{pending:null},action:{type:`toggleHelp`}}:{state:{pending:null},action:null}}var gF={class:`flex w-14 shrink-0 flex-col items-center gap-1 bg-rail py-3 text-rail-foreground`},_F=[`aria-label`,`onClick`],vF={key:0,class:`flex items-center gap-0.5`},yF={class:`mt-auto`},bF=P({__name:`NavRail`,setup(e){let t=Sp(),n=[{id:`editor`,label:`Editor`,icon:Zu},{id:`analytics`,label:`Analytics`,icon:Eu},{id:`glossary`,label:`Glossary`,icon:Tu},{id:`screenshots`,label:`Screenshots`,icon:Yu},{id:`settings`,label:`Settings`,icon:md},{id:`activity`,label:`Activity`,icon:fd},{id:`docs`,label:`Docs`,icon:Cu}].map(e=>({...e,keys:mF.find(t=>t.route===e.id)?.keys}));return(e,r)=>(R(),B(j(vb),{"delay-duration":300},{default:M(()=>[V(`nav`,gF,[r[0]||=V(`div`,{class:`mb-3 flex size-9 items-center justify-center rounded-md bg-primary font-mono text-base font-semibold text-primary-foreground`},` G `,-1),(R(!0),z(L,null,F(j(n),e=>(R(),B(j(Sb),{key:e.id},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"aria-label":e.label,class:O(j(eS)(`relative flex size-10 items-center justify-center rounded-md transition-colors`,j(t)===e.id?`bg-primary text-primary-foreground`:`text-rail-foreground/70 hover:bg-white/10 hover:text-rail-foreground`)),onClick:t=>j(xp)(e.id)},[(R(),B(aa(e.icon),{class:`size-5`}))],10,_F)]),_:2},1024),H(j(ZS),{side:`right`,class:`flex items-center gap-2`},{default:M(()=>[V(`span`,null,k(e.label),1),e.keys?(R(),z(`span`,vF,[(R(!0),z(L,null,F(e.keys,(e,t)=>(R(),B(pF,{key:t},{default:M(()=>[U(k(e),1)]),_:2},1024))),128))])):W(``,!0)]),_:2},1024)]),_:2},1024))),128)),V(`div`,yF,[H(fF)])])]),_:1}))}}),xF={class:`flex flex-col gap-1`},SF={class:`flex items-center gap-1`},CF={class:`flex items-center justify-between py-1 text-sm`},wF={class:`flex items-center gap-1`},TF=P({__name:`ShortcutsDialog`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:[`update:open`],setup(e){let t=Za(e,`open`);return(e,n)=>(R(),B(j(bh),{open:t.value,"onUpdate:open":n[0]||=e=>t.value=e},{default:M(()=>[H(j(LS),{class:`max-w-sm`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[1]||=[U(`Keyboard shortcuts`,-1)]]),_:1})]),_:1}),V(`ul`,xF,[(R(!0),z(L,null,F(j(mF),e=>(R(),z(`li`,{key:e.route,class:`flex items-center justify-between py-1 text-sm`},[V(`span`,null,k(e.label),1),V(`span`,SF,[(R(!0),z(L,null,F(e.keys,(e,t)=>(R(),B(pF,{key:t},{default:M(()=>[U(k(e),1)]),_:2},1024))),128))])]))),128)),V(`li`,CF,[n[3]||=V(`span`,null,`Search keys`,-1),V(`span`,wF,[H(pF,null,{default:M(()=>[...n[2]||=[U(`/`,-1)]]),_:1})])])])]),_:1})]),_:1},8,[`open`]))}}),EF=A(!1),DF=1e3;function OF(){let e={pending:null},t=null;function n(){t!==null&&(clearTimeout(t),t=null)}function r(r){if(r.metaKey||r.ctrlKey||r.altKey||r.repeat)return;let i=r.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.isContentEditable))return;let a=r.key.toLowerCase(),o=!!document.querySelector(`[role="dialog"],[role="menu"],[role="listbox"]`),s=a===`?`&&EF.value;if(o&&!s)return;let c=hF(e,a);e=c.state,n(),e.pending===`g`&&(t=window.setTimeout(()=>{e={pending:null},t=null},DF));let{action:l}=c;l&&(l.type===`navigate`?xp(l.route):EF.value=!EF.value,r.preventDefault())}Ki(()=>window.addEventListener(`keydown`,r)),Xi(()=>{n(),window.removeEventListener(`keydown`,r)})}var kF={class:`flex h-screen bg-background text-foreground`},AF={class:`flex min-w-0 flex-1 flex-col`},jF={class:`flex h-12 shrink-0 items-center justify-between border-b px-4`},MF={class:`flex min-w-0 items-center gap-3`},NF={key:0,class:`flex min-w-0 items-center gap-1.5`},PF={class:`max-w-[12rem] shrink-0 truncate font-mono text-sm font-medium`},FF={class:`truncate`},IF={key:0,class:`text-muted-foreground`},LF={class:`text-sm font-semibold`},RF={class:`font-mono`},zF={class:`flex min-h-0 flex-1 flex-col overflow-hidden`},BF=P({__name:`App`,setup(e){let t=Sp();OF();let n=fn(null),r=A(null),i=A([]),a=K(()=>[...i.value].sort((e,t)=>{let n=e.relDir?`${e.relDir}/${e.name}`:e.name,r=t.relDir?`${t.relDir}/${t.name}`:t.name;return n.localeCompare(r)})),o=A(!1),s=A(null);async function c(){n.value=await jd()}Ki(async()=>{await c();try{[r.value,i.value]=await Promise.all([xf(),Sf()]),document.title=r.value.project?`${r.value.project} — Glotfile`:`Glotfile`}catch(e){$.error(e.message)}n.value&&Object.keys(n.value.keys).length===0&&(o.value=!0)});function l(){location.reload()}async function u(e){if(e!==r.value?.path)try{await Cf(e),location.reload()}catch(e){$.error(e.message)}}let d=K(()=>({editor:`Editor`,analytics:`Analytics`,glossary:`Glossary`,screenshots:`Screenshots`,settings:`Settings`,activity:`Activity`,docs:`Docs`})[t.value]),f=K(()=>{if(!n.value)return null;let{sourceLocale:e,locales:t}=n.value.config;return{source:e,targets:t.filter(t=>t!==e)}});return(e,n)=>(R(),B(j(vb),{"delay-duration":300},{default:M(()=>[V(`div`,kF,[H(bF),V(`div`,AF,[V(`header`,jF,[V(`div`,MF,[r.value?(R(),z(`div`,NF,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,PF,k(r.value.project),1)]),_:1}),H(j(ZS),{side:`bottom`,class:`font-mono`},{default:M(()=>[U(k(r.value.dir),1)]),_:1})]),_:1}),H(j(ku),{class:`size-3.5 shrink-0 text-muted-foreground`}),H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`outline`,size:`sm`,class:`max-w-[16rem] gap-1.5 font-mono`},{default:M(()=>[V(`span`,FF,k(r.value.name),1),H(j(Au),{class:`size-3.5 shrink-0 text-muted-foreground`})]),_:1})]),_:1}),H(j(HS),{align:`start`,class:`w-max`},{default:M(()=>[(R(!0),z(L,null,F(a.value,e=>(R(),B(j(US),{key:e.path,class:`font-mono`,onSelect:t=>u(e.path)},{default:M(()=>[H(j(Du),{class:O([`size-4 shrink-0`,e.path===r.value.path?`opacity-100`:`opacity-0`])},null,8,[`class`]),V(`span`,null,[e.relDir?(R(),z(`span`,IF,k(e.relDir)+`/`,1)):W(``,!0),U(k(e.name),1)])]),_:2},1032,[`onSelect`]))),128))]),_:1})]),_:1})])):W(``,!0),V(`h1`,LF,k(d.value),1)]),f.value?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`shrink-0 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:n[0]||=e=>j(xp)(`settings`)},k(f.value.source)+` → `+k(f.value.targets.length)+` `+k(f.value.targets.length===1?`locale`:`locales`),1)]),_:1}),H(j(ZS),{side:`bottom`,class:`max-w-[28rem] leading-relaxed`},{default:M(()=>[V(`div`,RF,k(f.value.targets.join(`, `)||`—`),1),n[4]||=V(`div`,{class:`mt-1 text-background/60`},`Click to manage in Settings`,-1)]),_:1})]),_:1})):W(``,!0)]),V(`main`,zF,[j(t)===`editor`?(R(),B(bD,{key:0})):j(t)===`analytics`?(R(),B(mk,{key:1})):j(t)===`glossary`?(R(),B(Bk,{key:2})):j(t)===`screenshots`?(R(),B(mN,{key:3})):j(t)===`settings`?(R(),B(QM,{key:4})):j(t)===`activity`?(R(),B(VN,{key:5})):j(t)===`docs`?(R(),B(JN,{key:6})):W(``,!0)])]),H(j(AS)),H(TF,{open:j(EF),"onUpdate:open":n[1]||=e=>dn(EF)?EF.value=e:null},null,8,[`open`]),o.value?(R(),B(ZP,{key:0,ref_key:`wizardRef`,ref:s,onVnodeMounted:n[2]||=e=>s.value?.init(),onDismiss:n[3]||=e=>o.value=!1,onImported:l},null,512)):W(``,!0)])]),_:1}))}});sF(),iu(BF).mount(`#app`),lF(),JE(),kw();
|
|
2080
|
+
`,text:`Troubleshooting and FAQ Setup It's pre-1.0 and not yet on npm. Run from a checkout: . See Installation. Wrong Node version Glotfile needs Node . Check with . Translation "Install the SDK for this provider" OpenAI, OpenRouter, and Bedrock need an optional SDK. Install the one for your provider — (OpenAI or OpenRouter) or (Bedrock). See AI Providers. No API key / auth errors Set the provider's credentials in your environment or a local : , , , or the AWS chain. See AI Providers. A translation was skipped The result failed validation — a dropped placeholder, broken ICU, or an over-length value. Glotfile prints the reason and leaves the value untranslated. See Placeholders and ICU and How Translation Works. My reviewed translation didn't change after That's intentional — values are protected from being overwritten. Unmark it first to re-translate. Screenshots seem ignored The selected model may not support vision (e.g. Bedrock Meta Llama text models). The run proceeds text-only and warns how many screenshots were skipped. See Screenshots. Validation and CI fails with Your exported files don't match the catalog. Run and commit the result. See Continuous Integration. Spelling flags real words Add them to the custom dictionary in Settings ( ). The same list silences both the editor's live spell check and the lint rule. Glossary terms are accepted automatically. See Checks and Validation. A rule is too noisy Override its severity (or turn it off) in , or certain key globs. See Configuration Reference. Files and git Can I edit by hand? You can, but you rarely need to — the UI writes it for you, deterministically. If you do edit it, keep it valid: it's validated on load. See The State File. Big diffs on every save Check ( , , ). Deterministic formatting keeps diffs minimal. See The State File. General Do I already have translations I can import? Import existing locale files with — see import. You can also add keys via the Editor. Does anything leave my machine? Only the AI calls you trigger. The UI is local-only; no credentials or screenshot bytes are ever logged. See AI Log. Related - Home · Installation · AI Providers · Continuous Integration`}],UN={class:`flex min-h-0 flex-1 overflow-hidden`},WN={class:`flex w-56 shrink-0 flex-col overflow-hidden border-r bg-muted/30`},GN={class:`relative shrink-0 px-2 py-2`},KN={key:0,class:`flex flex-col gap-1 overflow-y-auto px-2 pb-3`},qN={class:`px-2 py-1 text-xs text-muted-foreground`},JN=[`onClick`],YN={class:`text-sm font-medium`},XN={key:0,class:`text-[10px] uppercase tracking-wider text-muted-foreground`},ZN={key:1,class:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`},QN={class:`bg-primary/20 text-foreground`},$N={key:1,class:`flex flex-col gap-1 overflow-y-auto px-2 pb-3`},eP=[`onClick`],tP={class:`min-w-0 flex-1 overflow-y-auto`},nP=[`innerHTML`],rP=P({__name:`DocsView`,setup(e){let t=[``,`Getting Started`,`Web UI`,`CLI`,`Concepts`,`AI Translation`,`Reference`,`Guides`,`Help`],n=A(HN[0]?.id??``),r=A(``),i=K(()=>{let e=new Map;for(let n of t)e.set(n,[]);for(let t of HN)e.has(t.section)||e.set(t.section,[]),e.get(t.section).push(t);return t.map(t=>({section:t,pages:e.get(t)??[]})).filter(e=>e.pages.length>0)}),a=K(()=>{let e=r.value.trim().toLowerCase();if(!e)return[];let t=[];for(let n of HN){let r=n.text.toLowerCase(),i=n.title.toLowerCase().includes(e),a=r.indexOf(e);if(a===-1&&!i)continue;if(a===-1){t.push({id:n.id,title:n.title,section:n.section,before:``,match:``,after:``});continue}let o=Math.max(0,a-40),s=Math.min(n.text.length,a+e.length+80);t.push({id:n.id,title:n.title,section:n.section,before:(o>0?`…`:``)+n.text.slice(o,a),match:n.text.slice(a,a+e.length),after:n.text.slice(a+e.length,s)+(s<n.text.length?`…`:``)})}return t}),o=K(()=>HN.find(e=>e.id===n.value)??HN[0]);function s(e){n.value=e,r.value=``}return(e,t)=>(R(),z(`div`,UN,[V(`nav`,WN,[V(`div`,GN,[H(j(pd),{class:`pointer-events-none absolute left-4 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),vr(V(`input`,{"onUpdate:modelValue":t[0]||=e=>r.value=e,type:`search`,placeholder:`Search docs…`,class:`w-full rounded-md border bg-background py-1 pl-7 pr-7 text-sm outline-none focus:ring-2 focus:ring-ring`},null,512),[[Fl,r.value]]),r.value?(R(),z(`button`,{key:0,type:`button`,class:`absolute right-4 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:t[1]||=e=>r.value=``},[H(j(kd),{class:`size-3.5`})])):W(``,!0)]),r.value.trim()?(R(),z(`div`,KN,[V(`div`,qN,k(a.value.length)+` result`+k(a.value.length===1?``:`s`),1),(R(!0),z(L,null,F(a.value,e=>(R(),z(`button`,{key:e.id,type:`button`,class:`w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground`,onClick:t=>s(e.id)},[V(`div`,YN,k(e.title),1),e.section?(R(),z(`div`,XN,k(e.section),1)):W(``,!0),e.match?(R(),z(`div`,ZN,[U(k(e.before),1),V(`mark`,QN,k(e.match),1),U(k(e.after),1)])):W(``,!0)],8,JN))),128))])):(R(),z(`div`,$N,[(R(!0),z(L,null,F(i.value,(e,t)=>(R(),z(L,{key:e.section},[e.section?(R(),z(`div`,{key:0,class:O([`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,t>0?`mt-3`:``])},k(e.section),3)):W(``,!0),(R(!0),z(L,null,F(e.pages,e=>(R(),z(`button`,{key:e.id,type:`button`,class:O([`w-full rounded-md px-2 py-1 text-left text-sm transition-colors`,n.value===e.id?`bg-primary text-primary-foreground`:`text-foreground hover:bg-accent hover:text-accent-foreground`]),onClick:t=>n.value=e.id},k(e.title),11,eP))),128))],64))),128))]))]),V(`div`,tP,[V(`div`,{class:`prose prose-sm dark:prose-invert mx-auto max-w-3xl px-8 py-6`,innerHTML:o.value?.html},null,8,nP)])]))}}),iP={en:`English`,fr:`French`,de:`German`,es:`Spanish`,pt:`Portuguese`,it:`Italian`,nl:`Dutch`,ca:`Catalan`,pl:`Polish`,ru:`Russian`,uk:`Ukrainian`,cs:`Czech`,sk:`Slovak`,sv:`Swedish`,da:`Danish`,no:`Norwegian`,nb:`Norwegian Bokmål`,fi:`Finnish`,tr:`Turkish`,el:`Greek`,ro:`Romanian`,hu:`Hungarian`,bg:`Bulgarian`,hr:`Croatian`,sr:`Serbian`,sl:`Slovenian`,ja:`Japanese`,ko:`Korean`,zh:`Chinese`,ar:`Arabic`,he:`Hebrew`,hi:`Hindi`,th:`Thai`,vi:`Vietnamese`,id:`Indonesian`,ms:`Malay`,fa:`Persian`};function aP(e){let[t=``,n]=e.split(/[-_]/),r=t.toLowerCase(),i=n&&/^[A-Za-z]{2}$/.test(n)?n.toUpperCase():void 0,a=iP[r]??e;return{code:e,name:i?`${a} (${i})`:a}}var oP={class:`p-6`},sP={class:`flex items-start gap-3 pr-6`},cP={class:`grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-primary/25 bg-primary/10 font-mono text-[13px] font-semibold leading-none tracking-tight text-primary`},lP={class:`min-w-0`},uP={class:`font-medium text-foreground`},dP={class:`font-mono text-[12px]`},fP={class:`mt-4 flex items-center gap-4 rounded-lg border border-border bg-muted/40 px-3.5 py-2.5`},pP={class:`flex flex-col`},mP={class:`text-[17px] font-semibold leading-none tabular-nums`},hP={class:`flex flex-col`},gP={class:`text-[17px] font-semibold leading-none tabular-nums`},_P={class:`ml-auto flex items-center gap-1.5 whitespace-nowrap text-[11px] text-muted-foreground`},vP={class:`mt-5`},yP={class:`!flex min-w-0 items-center gap-2`},bP={class:`font-mono text-[13px]`},xP={class:`truncate text-[13px] text-muted-foreground`},SP={class:`flex items-center gap-2`},CP={class:`font-mono text-[13px]`},wP={class:`text-[13px] text-muted-foreground`},TP={class:`mt-4`},EP={class:`flex items-center justify-between`},DP={class:`whitespace-nowrap text-[12px] tabular-nums text-muted-foreground`},OP={class:`mt-1.5 flex flex-wrap gap-1.5 rounded-lg border border-border bg-muted/30 p-2.5`},kP=[`disabled`,`onClick`],AP={class:`font-mono`},jP={key:0,class:`ml-0.5 rounded-sm bg-primary/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-primary`},MP={key:0,class:`mt-4`},NP={class:`overflow-hidden rounded-lg border border-border`},PP={class:`ml-auto font-mono text-[11px] text-muted-foreground/70`},FP={key:0,class:`divide-y divide-border border-t border-border gf-content-fade`},IP={class:`shrink-0 font-mono text-foreground`},LP={class:`ml-auto truncate text-right text-muted-foreground`},RP={key:0,class:`px-3 py-1.5 text-[11px] text-muted-foreground/70`},zP={class:`flex items-center gap-2 border-t border-border px-6 py-4`},BP={class:`ml-1 flex cursor-pointer select-none items-center gap-1.5 text-[12px] text-muted-foreground`},VP={class:`ml-auto`},HP={class:`flex flex-col items-center justify-center gap-4 p-6 py-8 text-center`},UP={key:0,class:`mt-1 text-[13px] text-muted-foreground`},WP={class:`p-6`},GP={class:`flex flex-col items-center gap-3 pt-1 text-center`},KP={class:`grid h-12 w-12 place-items-center rounded-full bg-success-bg text-success ring-1 ring-success-border`},qP={class:`font-semibold text-foreground tabular-nums`},JP={class:`font-semibold text-foreground`},YP={key:0,class:`mt-5 overflow-hidden rounded-lg border border-warning-border bg-warning-bg/60`},XP={class:`whitespace-nowrap text-[13px] font-medium text-warning`},ZP={key:0,class:`max-h-44 divide-y divide-warning-border/40 overflow-auto border-t border-warning-border/70 gf-content-fade`},QP={class:`flex items-center border-t border-border px-6 py-4`},$P={class:`ml-auto`},eF={class:`p-6`},tF={class:`flex items-start gap-3 pr-6`},nF={class:`grid h-10 w-10 shrink-0 place-items-center rounded-full bg-destructive-soft text-destructive`},rF={class:`min-w-0`},iF={class:`flex items-center border-t border-border px-6 py-4`},aF={class:`ml-auto`},oF=P({__name:`ImportWizard`,emits:[`dismiss`,`imported`],setup(e,{expose:t,emit:n}){let r=n,i=A(!0),a=A(`confirm`),o=A(null),s=A(``),c=A({}),l=A(!1),u=A(!1),d=A(null),f=A(``),p=A(!0);t({init:m});async function m(){try{let e=await kf();if(!e.found){r(`dismiss`);return}o.value=e,s.value=e.sourceLocale}catch{r(`dismiss`)}}let h={"laravel-php":{label:`Laravel PHP`,glyph:`</>`,file:`lang/{locale}/*.php`},"vue-i18n-json":{label:`Vue i18n JSON`,glyph:`{ }`,file:`locales/{locale}.json`},"flutter-arb":{label:`Flutter ARB`,glyph:`arb`,file:`lib/l10n/app_{locale}.arb`},"apple-strings":{label:`Apple .strings`,glyph:``,file:`{locale}.lproj/Localizable.strings`}},g=K(()=>h[o.value?.format??``]??{label:o.value?.format??``,glyph:`{}`,file:``});function _(e){return e===s.value||!c.value[e]}function v(e){e!==s.value&&(c.value={...c.value,[e]:!c.value[e]})}let y=K(()=>o.value?o.value.locales.filter(_):[]),b=K(()=>y.value.length),x=K(()=>o.value?Math.max(0,o.value.keyCount-o.value.sampleKeys.length):0);async function S(){if(o.value){a.value=`importing`;try{d.value=await Af({format:o.value.format,sourceLocale:s.value,locales:y.value,cldr:p.value}),a.value=`done`}catch(e){f.value=e.message,a.value=`error`}}}function C(e){e||a.value!==`importing`&&(a.value===`done`?r(`imported`):r(`dismiss`))}return(e,t)=>(R(),B(j(bh),{open:i.value,"onUpdate:open":C},{default:M(()=>[H(j(sg),null,{default:M(()=>[H(j(ag),{class:`fixed inset-0 z-50 bg-foreground/40 gf-content-fade`}),H(j(ng),{class:`fixed left-1/2 top-1/2 z-50 w-[28rem] max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-card text-card-foreground shadow-2xl focus:outline-none gf-content-fade`,onInteractOutside:t[9]||=q(()=>{},[`prevent`])},{default:M(()=>[a.value===`confirm`&&o.value?(R(),z(L,{key:0},[V(`button`,{type:`button`,class:`absolute right-3.5 top-3.5 z-10 grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:t[0]||=e=>r(`dismiss`)},[H(j(kd),{class:`size-4`})]),V(`div`,oP,[V(`div`,sP,[V(`div`,cP,k(g.value.glyph),1),V(`div`,lP,[H(j(cg),{class:`text-base font-semibold leading-tight`},{default:M(()=>[...t[10]||=[U(`Import your translations`,-1)]]),_:1}),H(j(rg),{class:`mt-0.5 text-[13px] text-muted-foreground`},{default:M(()=>[t[11]||=U(` Found a `,-1),V(`span`,uP,k(g.value.label),1),t[12]||=U(` setup in `,-1),V(`span`,dP,k(g.value.file),1),t[13]||=U(`. `,-1)]),_:1})])]),V(`div`,fP,[V(`div`,pP,[V(`span`,mP,k(o.value.keyCount.toLocaleString()),1),t[14]||=V(`span`,{class:`mt-1 whitespace-nowrap text-[11px] text-muted-foreground`},`keys detected`,-1)]),t[17]||=V(`div`,{class:`h-7 w-px bg-border`},null,-1),V(`div`,hP,[V(`span`,gP,k(o.value.locales.length),1),t[15]||=V(`span`,{class:`mt-1 whitespace-nowrap text-[11px] text-muted-foreground`},`locales`,-1)]),V(`div`,_P,[H(j(Gu),{class:`size-3.5 opacity-70`}),t[16]||=U(` Detected automatically `,-1)])]),V(`div`,vP,[H(j(IS),{class:`flex items-center gap-1.5 whitespace-nowrap`},{default:M(()=>[...t[18]||=[U(` Source language `,-1),V(`span`,{class:`text-[12px] font-normal text-muted-foreground`},`· the original text`,-1)]]),_:1}),H(j(Iy),{modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e},{default:M(()=>[H(j(iS),{class:`mt-1.5`},{default:M(()=>[V(`span`,yP,[H(FC,{code:s.value,size:14},null,8,[`code`]),V(`span`,bP,k(s.value),1),V(`span`,xP,k(j(aP)(s.value).name),1)])]),_:1}),H(j(aS),null,{default:M(()=>[(R(!0),z(L,null,F(o.value.locales,e=>(R(),B(j(sS),{key:e,value:e},{default:M(()=>[V(`span`,SP,[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,CP,k(e),1),V(`span`,wP,k(j(aP)(e).name),1)])]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),V(`div`,TP,[V(`div`,EP,[H(j(IS),{class:`whitespace-nowrap`},{default:M(()=>[...t[19]||=[U(`Locales to import`,-1)]]),_:1}),V(`span`,DP,k(b.value)+` of `+k(o.value.locales.length),1)]),V(`div`,OP,[(R(!0),z(L,null,F(o.value.locales,e=>(R(),B(j(Sb),{key:e},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,disabled:e===s.value,class:O([`group inline-flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border pl-1.5 pr-2 text-[12px] transition-colors`,e===s.value?`border-primary/40 bg-primary/10 cursor-default`:_(e)?`border-input bg-card text-foreground hover:bg-muted`:`border-dashed border-border bg-transparent text-muted-foreground hover:bg-muted/50`]),onClick:t=>v(e)},[H(FC,{code:e,size:14},null,8,[`code`]),V(`span`,AP,k(e),1),e===s.value?(R(),z(`span`,jP,`src`)):(R(),z(`span`,{key:1,class:O([`grid size-3.5 place-items-center rounded-[3px] border`,_(e)?`border-primary bg-primary text-primary-foreground`:`border-border text-transparent`])},[H(j(Du),{class:`size-2.5`,"stroke-width":3})],2))],10,kP)]),_:2},1024),H(j(ZS),null,{default:M(()=>[U(k(e===s.value?`Source language — always imported`:_(e)?`Click to exclude`:`Click to include`),1)]),_:2},1024)]),_:2},1024))),128))])]),o.value.sampleKeys.length?(R(),z(`div`,MP,[V(`div`,NP,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3 py-2 text-[13px] text-muted-foreground transition-colors hover:bg-muted/50`,onClick:t[2]||=e=>l.value=!l.value},[H(j(ku),{class:O([`size-3.5 shrink-0 transition-transform`,l.value?`rotate-90`:``])},null,8,[`class`]),t[20]||=V(`span`,{class:`whitespace-nowrap`},`Preview sample keys`,-1),V(`span`,PP,k(g.value.glyph),1)]),l.value?(R(),z(`div`,FP,[(R(!0),z(L,null,F(o.value.sampleKeys,e=>(R(),z(`div`,{key:e.key,class:`flex items-baseline gap-3 px-3 py-1.5 text-[12px]`},[V(`span`,IP,k(e.key),1),V(`span`,LP,k(e.value),1)]))),128)),x.value>0?(R(),z(`div`,RP,` + `+k(x.value.toLocaleString())+` more keys `,1)):W(``,!0)])):W(``,!0)])])):W(``,!0)]),V(`div`,zP,[H(j(Q),{variant:`ghost`,size:`sm`,onClick:t[3]||=e=>r(`dismiss`)},{default:M(()=>[...t[21]||=[U(`Skip`,-1)]]),_:1}),H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`label`,BP,[vr(V(`input`,{type:`checkbox`,"data-testid":`cldr-toggle`,"onUpdate:modelValue":t[4]||=e=>p.value=e,class:`size-3.5 accent-primary`},null,512),[[Il,p.value]]),t[22]||=U(` Convert plurals to CLDR categories `,-1)])]),_:1}),H(j(ZS),{class:`max-w-xs`},{default:M(()=>[...t[23]||=[U(`Rewrite exact =N plural selectors (e.g. =1) into each language's CLDR plural categories, the way Crowdin does.`,-1)]]),_:1})]),_:1}),V(`div`,VP,[H(j(Q),{"data-testid":`import-btn`,disabled:b.value===0,onClick:S},{default:M(()=>[H(j(Ad),{class:`size-4`}),U(` Import `+k(b.value)+` `+k(b.value===1?`locale`:`locales`),1)]),_:1},8,[`disabled`])])])],64)):a.value===`importing`?(R(),z(L,{key:1},[H(j(cg),{class:`sr-only`},{default:M(()=>[...t[24]||=[U(`Importing translations`,-1)]]),_:1}),V(`div`,HP,[H(j($u),{class:`size-10 text-primary gf-spin`}),V(`div`,null,[t[25]||=V(`div`,{class:`text-sm font-semibold`},`Importing translations…`,-1),o.value?(R(),z(`div`,UP,` Reading `+k(o.value.keyCount.toLocaleString())+` keys across `+k(b.value)+` locales `,1)):W(``,!0)])])],64)):a.value===`done`&&d.value?(R(),z(L,{key:2},[V(`div`,WP,[V(`div`,GP,[V(`div`,KP,[H(j(Du),{class:`size-6`,"stroke-width":2.5})]),V(`div`,null,[H(j(cg),{class:`text-base font-semibold`},{default:M(()=>[...t[26]||=[U(`Import complete`,-1)]]),_:1}),H(j(rg),{class:`mt-1 text-[13px] text-muted-foreground`},{default:M(()=>[V(`span`,qP,k(d.value.keyCount.toLocaleString())+` keys`,1),t[27]||=U(` across `,-1),V(`span`,JP,k(d.value.localeCount)+` locales`,1),t[28]||=U(` imported. `,-1)]),_:1})])]),d.value.warnings.length?(R(),z(`div`,YP,[V(`button`,{type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-left`,onClick:t[5]||=e=>u.value=!u.value},[H(j(Td),{class:`size-3.5 shrink-0 text-warning`}),V(`span`,XP,k(d.value.warnings.length)+` `+k(d.value.warnings.length===1?`warning`:`warnings`),1),t[29]||=V(`span`,{class:`whitespace-nowrap text-[12px] text-warning/70`},`· import still succeeded`,-1),H(j(ku),{class:O([`ml-auto size-3.5 shrink-0 text-warning transition-transform`,u.value?`rotate-90`:``])},null,8,[`class`])]),u.value?(R(),z(`ul`,ZP,[(R(!0),z(L,null,F(d.value.warnings,(e,t)=>(R(),z(`li`,{key:t,class:`px-3 py-2 text-[12px] text-muted-foreground`},k(e),1))),128))])):W(``,!0)])):W(``,!0)]),V(`div`,QP,[V(`div`,$P,[H(j(Q),{onClick:t[6]||=e=>r(`imported`)},{default:M(()=>[t[30]||=U(`Open editor `,-1),H(j(bu),{class:`size-4`})]),_:1})])])],64)):a.value===`error`?(R(),z(L,{key:3},[V(`button`,{type:`button`,class:`absolute right-3.5 top-3.5 z-10 grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:t[7]||=e=>r(`dismiss`)},[H(j(kd),{class:`size-4`})]),V(`div`,eF,[V(`div`,tF,[V(`div`,nF,[H(j(Td),{class:`size-5`})]),V(`div`,rF,[H(j(cg),{class:`text-base font-semibold`},{default:M(()=>[...t[31]||=[U(`Couldn't import translations`,-1)]]),_:1}),H(j(rg),{class:`mt-1 text-[13px] text-muted-foreground`},{default:M(()=>[U(k(f.value),1)]),_:1})])])]),V(`div`,iF,[V(`div`,aF,[H(j(Q),{variant:`outline`,onClick:t[8]||=e=>r(`dismiss`)},{default:M(()=>[...t[32]||=[U(`Dismiss`,-1)]]),_:1})])])],64)):W(``,!0)]),_:1})]),_:1})]),_:1},8,[`open`]))}}),sF=`glotfile-theme`,cF=[`system`,`light`,`dark`],lF=e=>cF.includes(e);function uF(){let e=localStorage.getItem(sF);return lF(e)?e:`system`}var dF=window.matchMedia(`(prefers-color-scheme: dark)`),fF=A(dF.matches);dF.addEventListener(`change`,e=>{fF.value=e.matches});var pF=A(uF()),mF=K(()=>pF.value===`system`?fF.value:pF.value===`dark`);function hF(){document.documentElement.classList.toggle(`dark`,mF.value)}function gF(){N(mF,hF,{immediate:!0,flush:`sync`})}function _F(e){pF.value=e,localStorage.setItem(sF,e),tf({theme:e}).catch(()=>{})}async function vF(){try{let{theme:e}=await ef();lF(e)&&e!==pF.value&&(pF.value=e,localStorage.setItem(sF,e))}catch{}}var yF={class:`flex flex-col items-center gap-0.5 rounded-lg bg-black/15 p-0.5`},bF=[`data-mode`,`aria-label`,`aria-pressed`,`onClick`],xF=P({__name:`ThemeToggle`,setup(e){let t=[{value:`light`,label:`Light`,icon:xd},{value:`system`,label:`System`,icon:nd},{value:`dark`,label:`Dark`,icon:rd}];return(e,n)=>(R(),z(`div`,yF,[(R(),z(L,null,F(t,e=>H(j(Sb),{key:e.value},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"data-mode":e.value,"aria-label":e.label,"aria-pressed":j(pF)===e.value,class:O(j(eS)(`flex size-8 items-center justify-center rounded-md transition-colors`,j(pF)===e.value?`bg-primary text-primary-foreground`:`text-rail-foreground/70 hover:bg-white/10 hover:text-rail-foreground`)),onClick:t=>j(_F)(e.value)},[(R(),B(aa(e.icon),{class:`size-4`}))],10,bF)]),_:2},1024),H(j(ZS),{side:`right`},{default:M(()=>[U(k(e.label),1)]),_:2},1024)]),_:2},1024)),64))]))}}),SF=P({__name:`Kbd`,props:{class:{}},setup(e){return(e,t)=>(R(),z(`kbd`,{class:O(j(eS)(`inline-flex h-5 min-w-5 items-center justify-center rounded border bg-muted px-1.5 font-mono text-xs font-medium text-muted-foreground`,e.$props.class))},[I(e.$slots,`default`)],2))}}),CF=[{route:`editor`,keys:[`g`,`e`],label:`Editor`},{route:`analytics`,keys:[`g`,`a`],label:`Analytics`},{route:`glossary`,keys:[`g`,`g`],label:`Glossary`},{route:`screenshots`,keys:[`g`,`i`],label:`Screenshots`},{route:`settings`,keys:[`g`,`s`],label:`Settings`},{route:`activity`,keys:[`g`,`l`],label:`Activity`},{route:`docs`,keys:[`g`,`d`],label:`Docs`}];function wF(e,t){if(e.pending===`g`){let e=CF.find(e=>e.keys[1]===t);return{state:{pending:null},action:e?{type:`navigate`,route:e.route}:null}}return t===`g`?{state:{pending:`g`},action:null}:t===`?`?{state:{pending:null},action:{type:`toggleHelp`}}:{state:{pending:null},action:null}}var TF={class:`flex w-14 shrink-0 flex-col items-center gap-1 bg-rail py-3 text-rail-foreground`},EF=[`aria-label`,`onClick`],DF={key:0,class:`flex items-center gap-0.5`},OF={class:`mt-auto`},kF=P({__name:`NavRail`,setup(e){let t=Sp(),n=[{id:`editor`,label:`Editor`,icon:Zu},{id:`analytics`,label:`Analytics`,icon:Eu},{id:`glossary`,label:`Glossary`,icon:Tu},{id:`screenshots`,label:`Screenshots`,icon:Yu},{id:`settings`,label:`Settings`,icon:md},{id:`activity`,label:`Activity`,icon:fd},{id:`docs`,label:`Docs`,icon:Cu}].map(e=>({...e,keys:CF.find(t=>t.route===e.id)?.keys}));return(e,r)=>(R(),B(j(vb),{"delay-duration":300},{default:M(()=>[V(`nav`,TF,[r[0]||=V(`div`,{class:`mb-3 flex size-9 items-center justify-center rounded-md bg-primary font-mono text-base font-semibold text-primary-foreground`},` G `,-1),(R(!0),z(L,null,F(j(n),e=>(R(),B(j(Sb),{key:e.id},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,"aria-label":e.label,class:O(j(eS)(`relative flex size-10 items-center justify-center rounded-md transition-colors`,j(t)===e.id?`bg-primary text-primary-foreground`:`text-rail-foreground/70 hover:bg-white/10 hover:text-rail-foreground`)),onClick:t=>j(xp)(e.id)},[(R(),B(aa(e.icon),{class:`size-5`}))],10,EF)]),_:2},1024),H(j(ZS),{side:`right`,class:`flex items-center gap-2`},{default:M(()=>[V(`span`,null,k(e.label),1),e.keys?(R(),z(`span`,DF,[(R(!0),z(L,null,F(e.keys,(e,t)=>(R(),B(SF,{key:t},{default:M(()=>[U(k(e),1)]),_:2},1024))),128))])):W(``,!0)]),_:2},1024)]),_:2},1024))),128)),V(`div`,OF,[H(xF)])])]),_:1}))}}),AF={class:`flex flex-col gap-1`},jF={class:`flex items-center gap-1`},MF={class:`flex items-center justify-between py-1 text-sm`},NF={class:`flex items-center gap-1`},PF=P({__name:`ShortcutsDialog`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:[`update:open`],setup(e){let t=Za(e,`open`);return(e,n)=>(R(),B(j(bh),{open:t.value,"onUpdate:open":n[0]||=e=>t.value=e},{default:M(()=>[H(j(LS),{class:`max-w-sm`},{default:M(()=>[H(j(RS),null,{default:M(()=>[H(j(BS),null,{default:M(()=>[...n[1]||=[U(`Keyboard shortcuts`,-1)]]),_:1})]),_:1}),V(`ul`,AF,[(R(!0),z(L,null,F(j(CF),e=>(R(),z(`li`,{key:e.route,class:`flex items-center justify-between py-1 text-sm`},[V(`span`,null,k(e.label),1),V(`span`,jF,[(R(!0),z(L,null,F(e.keys,(e,t)=>(R(),B(SF,{key:t},{default:M(()=>[U(k(e),1)]),_:2},1024))),128))])]))),128)),V(`li`,MF,[n[3]||=V(`span`,null,`Search keys`,-1),V(`span`,NF,[H(SF,null,{default:M(()=>[...n[2]||=[U(`/`,-1)]]),_:1})])])])]),_:1})]),_:1},8,[`open`]))}}),FF=A(!1),IF=1e3;function LF(){let e={pending:null},t=null;function n(){t!==null&&(clearTimeout(t),t=null)}function r(r){if(r.metaKey||r.ctrlKey||r.altKey||r.repeat)return;let i=r.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.isContentEditable))return;let a=r.key.toLowerCase(),o=!!document.querySelector(`[role="dialog"],[role="menu"],[role="listbox"]`),s=a===`?`&&FF.value;if(o&&!s)return;let c=wF(e,a);e=c.state,n(),e.pending===`g`&&(t=window.setTimeout(()=>{e={pending:null},t=null},IF));let{action:l}=c;l&&(l.type===`navigate`?xp(l.route):FF.value=!FF.value,r.preventDefault())}Ki(()=>window.addEventListener(`keydown`,r)),Xi(()=>{n(),window.removeEventListener(`keydown`,r)})}var RF={class:`flex h-screen bg-background text-foreground`},zF={class:`flex min-w-0 flex-1 flex-col`},BF={class:`flex h-12 shrink-0 items-center justify-between border-b px-4`},VF={class:`flex min-w-0 items-center gap-3`},HF={key:0,class:`flex min-w-0 items-center gap-1.5`},UF={class:`max-w-[12rem] shrink-0 truncate font-mono text-sm font-medium`},WF={class:`truncate`},GF={key:0,class:`text-muted-foreground`},KF={class:`text-sm font-semibold`},qF={class:`font-mono`},JF={class:`flex min-h-0 flex-1 flex-col overflow-hidden`},YF=P({__name:`App`,setup(e){let t=Sp();LF();let n=fn(null),r=A(null),i=A([]),a=K(()=>[...i.value].sort((e,t)=>{let n=e.relDir?`${e.relDir}/${e.name}`:e.name,r=t.relDir?`${t.relDir}/${t.name}`:t.name;return n.localeCompare(r)})),o=A(!1),s=A(null);async function c(){n.value=await jd()}Ki(async()=>{await c();try{[r.value,i.value]=await Promise.all([xf(),Sf()]),document.title=r.value.project?`${r.value.project} — Glotfile`:`Glotfile`}catch(e){$.error(e.message)}n.value&&Object.keys(n.value.keys).length===0&&(o.value=!0)});function l(){location.reload()}async function u(e){if(e!==r.value?.path)try{await Cf(e),location.reload()}catch(e){$.error(e.message)}}let d=K(()=>({editor:`Editor`,analytics:`Analytics`,glossary:`Glossary`,screenshots:`Screenshots`,settings:`Settings`,activity:`Activity`,docs:`Docs`})[t.value]),f=K(()=>{if(!n.value)return null;let{sourceLocale:e,locales:t}=n.value.config;return{source:e,targets:t.filter(t=>t!==e)}});return(e,n)=>(R(),B(j(vb),{"delay-duration":300},{default:M(()=>[V(`div`,RF,[H(kF),V(`div`,zF,[V(`header`,BF,[V(`div`,VF,[r.value?(R(),z(`div`,HF,[H(j(Sb),null,{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`span`,UF,k(r.value.project),1)]),_:1}),H(j(ZS),{side:`bottom`,class:`font-mono`},{default:M(()=>[U(k(r.value.dir),1)]),_:1})]),_:1}),H(j(ku),{class:`size-3.5 shrink-0 text-muted-foreground`}),H(j(by),null,{default:M(()=>[H(j(Ey),{"as-child":``},{default:M(()=>[H(j(Q),{variant:`outline`,size:`sm`,class:`max-w-[16rem] gap-1.5 font-mono`},{default:M(()=>[V(`span`,WF,k(r.value.name),1),H(j(Au),{class:`size-3.5 shrink-0 text-muted-foreground`})]),_:1})]),_:1}),H(j(HS),{align:`start`,class:`w-max`},{default:M(()=>[(R(!0),z(L,null,F(a.value,e=>(R(),B(j(US),{key:e.path,class:`font-mono`,onSelect:t=>u(e.path)},{default:M(()=>[H(j(Du),{class:O([`size-4 shrink-0`,e.path===r.value.path?`opacity-100`:`opacity-0`])},null,8,[`class`]),V(`span`,null,[e.relDir?(R(),z(`span`,GF,k(e.relDir)+`/`,1)):W(``,!0),U(k(e.name),1)])]),_:2},1032,[`onSelect`]))),128))]),_:1})]),_:1})])):W(``,!0),V(`h1`,KF,k(d.value),1)]),f.value?(R(),B(j(Sb),{key:0},{default:M(()=>[H(j(Db),{"as-child":``},{default:M(()=>[V(`button`,{type:`button`,class:`shrink-0 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:n[0]||=e=>j(xp)(`settings`)},k(f.value.source)+` → `+k(f.value.targets.length)+` `+k(f.value.targets.length===1?`locale`:`locales`),1)]),_:1}),H(j(ZS),{side:`bottom`,class:`max-w-[28rem] leading-relaxed`},{default:M(()=>[V(`div`,qF,k(f.value.targets.join(`, `)||`—`),1),n[4]||=V(`div`,{class:`mt-1 text-background/60`},`Click to manage in Settings`,-1)]),_:1})]),_:1})):W(``,!0)]),V(`main`,JF,[j(t)===`editor`?(R(),B(bD,{key:0})):j(t)===`analytics`?(R(),B(mk,{key:1})):j(t)===`glossary`?(R(),B(Bk,{key:2})):j(t)===`screenshots`?(R(),B(mN,{key:3})):j(t)===`settings`?(R(),B(QM,{key:4})):j(t)===`activity`?(R(),B(VN,{key:5})):j(t)===`docs`?(R(),B(rP,{key:6})):W(``,!0)])]),H(j(AS)),H(PF,{open:j(FF),"onUpdate:open":n[1]||=e=>dn(FF)?FF.value=e:null},null,8,[`open`]),o.value?(R(),B(oF,{key:0,ref_key:`wizardRef`,ref:s,onVnodeMounted:n[2]||=e=>s.value?.init(),onDismiss:n[3]||=e=>o.value=!1,onImported:l},null,512)):W(``,!0)])]),_:1}))}});gF(),iu(YF).mount(`#app`),vF(),JE(),kw();
|