termdock 1.4.128 → 1.4.129
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/.desktop-dist/main.js +78 -7
- package/dist/client/assets/{ModelPreview-Ki--VGiC.js → ModelPreview-DA71QiMN.js} +1 -1
- package/dist/client/assets/{abnfDiagram-VRR7QNED-_MScG92N.js → abnfDiagram-VRR7QNED-vwQxXhvY.js} +1 -1
- package/dist/client/assets/{arc-t9qRCmSV.js → arc-KcBV2d81.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZJ3FMSHR-sFlMCTBw.js → architectureDiagram-ZJ3FMSHR-BKm_EWca.js} +1 -1
- package/dist/client/assets/{blockDiagram-677ZJIJ3-ssxX4KkU.js → blockDiagram-677ZJIJ3-DAQx8c-B.js} +1 -1
- package/dist/client/assets/{c4Diagram-LMCZKHZV-BCz5LtTX.js → c4Diagram-LMCZKHZV-BeYeekky.js} +1 -1
- package/dist/client/assets/channel-jqLwHPeC.js +1 -0
- package/dist/client/assets/{chunk-2Q5K7J3B-CDimwARA.js → chunk-2Q5K7J3B-DHqXZZU-.js} +1 -1
- package/dist/client/assets/{chunk-32BRIVSS-CDmUf83L.js → chunk-32BRIVSS-D1m2Benc.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DLtTCYUg.js → chunk-5VM5RSS4-CtOKKO1w.js} +1 -1
- package/dist/client/assets/{chunk-EX3LRPZG-w_FWq-tH.js → chunk-EX3LRPZG-CXjhbuNm.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-B0zV1WOe.js → chunk-JWPE2WC7-C0Zq6OdN.js} +1 -1
- package/dist/client/assets/{chunk-MOJQB5TN-C2VFDFd0.js → chunk-MOJQB5TN-BlkCCLDm.js} +1 -1
- package/dist/client/assets/{chunk-RYQCIY6F-BaaZmXwK.js → chunk-RYQCIY6F-Cz6TWAav.js} +1 -1
- package/dist/client/assets/{chunk-V7JOEXUC-p5cKhdl6.js → chunk-V7JOEXUC-DhLyQr8d.js} +1 -1
- package/dist/client/assets/{chunk-VR4S4FIN-DzfT9at0.js → chunk-VR4S4FIN-DSnFyHH_.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-C1zTdwEh.js → chunk-XXDRQBXY-C2ISI6ro.js} +1 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-DFjGJuxW.js +1 -0
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-DFjGJuxW.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BGHVpXFF.js → cose-bilkent-JH36ORCC-DQVr0EsM.js} +1 -1
- package/dist/client/assets/{cynefin-VYW2F7L2-BwZxg1VK.js → cynefin-VYW2F7L2-BP6p28mL.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-TSTJHNR4-D49XyIFA.js → cynefinDiagram-TSTJHNR4-CPUSyMuB.js} +1 -1
- package/dist/client/assets/{dagre-VKFMJZFB-DXoRuv6O.js → dagre-VKFMJZFB-C_zQd2eB.js} +1 -1
- package/dist/client/assets/{diagram-FQU43EPY-D0vgZCfK.js → diagram-FQU43EPY-RkUQLZyi.js} +1 -1
- package/dist/client/assets/{diagram-G47NLZAW-9K9fR0Z0.js → diagram-G47NLZAW-CtjAPFXS.js} +1 -1
- package/dist/client/assets/{diagram-NH7WQ7WH-CIIC3eUC.js → diagram-NH7WQ7WH-C5xtKZ-W.js} +1 -1
- package/dist/client/assets/{diagram-OA4YK3LP-CA3Uw6Ea.js → diagram-OA4YK3LP-CrbMkTb7.js} +1 -1
- package/dist/client/assets/{diagram-WEI45ONY-dhaSf1fa.js → diagram-WEI45ONY-DAF4URgC.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-CCIWWBDH-0bWc11Yz.js → ebnfDiagram-CCIWWBDH-ni71VSx1.js} +1 -1
- package/dist/client/assets/{erDiagram-Q63AITRT-C4FPyL3a.js → erDiagram-Q63AITRT-DODYotxF.js} +1 -1
- package/dist/client/assets/{flowDiagram-23GEKE2U-DXY0Jxj_.js → flowDiagram-23GEKE2U-CN1Vp7G4.js} +1 -1
- package/dist/client/assets/{ganttDiagram-NO4QXBWP-RPMjjnRd.js → ganttDiagram-NO4QXBWP-DoVPMnyV.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-IHSO6WYX-Bf4HUqTl.js → gitGraphDiagram-IHSO6WYX-jiV9FRlU.js} +1 -1
- package/dist/client/assets/{index-D75wYB98.js → index-DPj6Kass.js} +4 -4
- package/dist/client/assets/{infoDiagram-FWYZ7A6U-ZqP7Ocf3.js → infoDiagram-FWYZ7A6U-Bk78PinY.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-FXEZZL3T-BzdFAcyT.js → ishikawaDiagram-FXEZZL3T-C3lsh4Lh.js} +1 -1
- package/dist/client/assets/{journeyDiagram-5HDEW3XC-BfSvMq6y.js → journeyDiagram-5HDEW3XC-CHLuYRBt.js} +1 -1
- package/dist/client/assets/{kanban-definition-HUTT4EX6-Dpf9hCl5.js → kanban-definition-HUTT4EX6-UXjM1jpV.js} +1 -1
- package/dist/client/assets/{linear-ZmI28AZz.js → linear-BKUyrWyw.js} +1 -1
- package/dist/client/assets/{mermaid.core-BTzHsVSr.js → mermaid.core-Bhj0Bx21.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LN4V7U3C-By5Ie3jN.js → mindmap-definition-LN4V7U3C-Dxv1Vfld.js} +1 -1
- package/dist/client/assets/{pegDiagram-2B236MQR--NolZ5bc.js → pegDiagram-2B236MQR-DYZ4d5zF.js} +1 -1
- package/dist/client/assets/{pieDiagram-ENE6RG2P-DI-Y6Yz-.js → pieDiagram-ENE6RG2P-BoId8qhV.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-ABIIQ3AL-DYnBddBB.js → quadrantDiagram-ABIIQ3AL-sswrNp8d.js} +1 -1
- package/dist/client/assets/{railroadDiagram-RFXS5EU6-DOOkdA8K.js → railroadDiagram-RFXS5EU6-BfYV2CjC.js} +1 -1
- package/dist/client/assets/{requirementDiagram-TGXJPOKE-BO_adPJj.js → requirementDiagram-TGXJPOKE-DZhZPZVt.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-HTMAVEWB-LVYAe84b.js → sankeyDiagram-HTMAVEWB-DXKoOi7e.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-DBY2YBRQ-DAkGCs0T.js → sequenceDiagram-DBY2YBRQ-CpulK2HV.js} +1 -1
- package/dist/client/assets/{sizeCapture-X5ZJPWSS-CszARDsf.js → sizeCapture-X5ZJPWSS-D-mlzS9r.js} +1 -1
- package/dist/client/assets/{stateDiagram-2N3HPSRC-DUs3aedx.js → stateDiagram-2N3HPSRC-l_ydCaW0.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-Gh5mC4sm.js +1 -0
- package/dist/client/assets/{swimlanes-5IMT3BWC-Duig5jF-.js → swimlanes-5IMT3BWC-eEUQLyov.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-CFuSbo_y.js +8 -0
- package/dist/client/assets/{timeline-definition-FHXFAJF6-BKW9IU-6.js → timeline-definition-FHXFAJF6-Bu7sztn9.js} +1 -1
- package/dist/client/assets/{vennDiagram-L72KCM5P-Cet4IXwa.js → vennDiagram-L72KCM5P-Bat45ZW0.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-EHGQE667-DgoE-0pr.js → wardleyDiagram-EHGQE667-Bxn0-4Oq.js} +1 -1
- package/dist/client/assets/{xychartDiagram-FW5EYKEG-BqJ_UrZL.js → xychartDiagram-FW5EYKEG-C4BdUEul.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/sw.js +1 -1
- package/package.json +1 -1
- package/runtime-manifest.json +1 -1
- package/dist/client/assets/channel-DLbt-DA1.js +0 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-CtCQ5VTR.js +0 -1
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-CtCQ5VTR.js +0 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-B8crJAxl.js +0 -1
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-Di4AbqD1.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ca-rq7yX.js","assets/react-XDCjal2T.js","assets/ModelPreview-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ca-rq7yX.js","assets/react-XDCjal2T.js","assets/ModelPreview-DA71QiMN.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/katex-55ZPZeOF.css","assets/mermaid.core-Bhj0Bx21.js","assets/purify.es-CC4Brkr_.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as hg,a as i_,g as D7}from"./react-XDCjal2T.js";import{b,R as D,r as Ei,a as o_}from"./dnd-BCFAPC0L.js";import{L as a_,l as l_}from"./terminal-C7X98Amf.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var A1={exports:{}},W0={};var Dv;function c_(){if(Dv)return W0;Dv=1;var e=hg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,f){var p,g={},y=null,v=null;f!==void 0&&(y=""+f),u.key!==void 0&&(y=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)r.call(u,p)&&!i.hasOwnProperty(p)&&(g[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)g[p]===void 0&&(g[p]=u[p]);return{$$typeof:t,type:c,key:y,ref:v,props:g,_owner:s.current}}return W0.Fragment=n,W0.jsx=a,W0.jsxs=a,W0}var jv;function u_(){return jv||(jv=1,A1.exports=c_()),A1.exports}var o=u_(),ap={},Pv;function d_(){if(Pv)return ap;Pv=1;var e=i_();return ap.createRoot=e.createRoot,ap.hydrateRoot=e.hydrateRoot,ap}var f_=d_();const h_=D7(f_);function Bv(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function J2(e={},t={}){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Bv(t[r])&&Bv(e[r])&&Object.keys(t[r]).length>0&&J2(e[r],t[r])})}const j7={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Zu(){const e=typeof document<"u"?document:{};return J2(e,j7),e}const p_={document:j7,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function ta(){const e=typeof window<"u"?window:{};return J2(e,p_),e}function m_(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function g_(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function P7(e,t=0){return setTimeout(e,t)}function Tm(){return Date.now()}function x_(e){const t=ta();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function b_(e,t="x"){const n=ta();let r,s,i;const a=x_(e);return n.WebKitCSSMatrix?(s=a.transform||a.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(c=>c.replace(",",".")).join(", ")),i=new n.WebKitCSSMatrix(s==="none"?"":s)):(i=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=i.toString().split(",")),t==="x"&&(n.WebKitCSSMatrix?s=i.m41:r.length===16?s=parseFloat(r[12]):s=parseFloat(r[4])),t==="y"&&(n.WebKitCSSMatrix?s=i.m42:r.length===16?s=parseFloat(r[13]):s=parseFloat(r[5])),s||0}function lp(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function y_(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function Ea(...e){const t=Object(e[0]);for(let n=1;n<e.length;n+=1){const r=e[n];if(r!=null&&!y_(r)){const s=Object.keys(Object(r)).filter(i=>i!=="__proto__"&&i!=="constructor"&&i!=="prototype");for(let i=0,a=s.length;i<a;i+=1){const c=s[i],u=Object.getOwnPropertyDescriptor(r,c);u!==void 0&&u.enumerable&&(lp(t[c])&&lp(r[c])?r[c].__swiper__?t[c]=r[c]:Ea(t[c],r[c]):!lp(t[c])&&lp(r[c])?(t[c]={},r[c].__swiper__?t[c]=r[c]:Ea(t[c],r[c])):t[c]=r[c])}}}return t}function _d(e,t,n){e.style.setProperty(t,n)}function B7({swiper:e,targetPosition:t,side:n}){const r=ta(),s=-e.translate;let i=null,a;const c=e.params.speed;e.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(e.cssModeFrameID);const u=t>s?"next":"prev",f=(g,y)=>u==="next"&&g>=y||u==="prev"&&g<=y,p=()=>{a=new Date().getTime(),i===null&&(i=a);const g=Math.max(Math.min((a-i)/c,1),0),y=.5-Math.cos(g*Math.PI)/2;let v=s+y*(t-s);if(f(v,t)&&(v=t),e.wrapperEl.scrollTo({[n]:v}),f(v,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[n]:v})}),r.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=r.requestAnimationFrame(p)};p()}function yc(e,t=""){const n=ta(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(s=>s.matches(t)):r}function v_(e,t){const n=[t];for(;n.length>0;){const r=n.shift();if(e===r)return!0;n.push(...r.children,...r.shadowRoot?r.shadowRoot.children:[],...r.assignedElements?r.assignedElements():[])}}function w_(e,t){const n=ta();let r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||(r=v_(e,t))),r}function Cm(e){try{console.warn(e);return}catch{}}function bb(e,t=[]){const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:m_(t)),n}function S_(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function A_(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function Wc(e,t){return ta().getComputedStyle(e,null).getPropertyValue(t)}function Fv(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function T_(e,t){const n=[];let r=e.parentElement;for(;r;)n.push(r),r=r.parentElement;return n}function Ov(e,t,n){const r=ta();return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}function Qv(e,t=""){typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let T1;function C_(){const e=ta(),t=Zu();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function F7(){return T1||(T1=C_()),T1}let C1;function k_({userAgent:e}={}){const t=F7(),n=ta(),r=n.navigator.platform,s=e||n.navigator.userAgent,i={ios:!1,android:!1},a=n.screen.width,c=n.screen.height,u=s.match(/(Android);?[\s\/]+([\d.]+)?/);let f=s.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const p=s.match(/(iPod)(.*OS\s([\d_]+))?/),g=!f&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),y=r==="Win32";let v=r==="MacIntel";const S=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!f&&v&&t.touch&&S.indexOf(`${a}x${c}`)>=0&&(f=s.match(/(Version)\/([\d.]+)/),f||(f=[0,1,"13_0_0"]),v=!1),u&&!y&&(i.os="android",i.android=!0),(f||g||p)&&(i.os="ios",i.ios=!0),i}function O7(e={}){return C1||(C1=k_(e)),C1}let k1;function __(){const e=ta(),t=O7();let n=!1;function r(){const c=e.navigator.userAgent.toLowerCase();return c.indexOf("safari")>=0&&c.indexOf("chrome")<0&&c.indexOf("android")<0}if(r()){const c=String(e.navigator.userAgent);if(c.includes("Version/")){const[u,f]=c.split("Version/")[1].split(" ")[0].split(".").map(p=>Number(p));n=u<16||u===16&&f<2}}const s=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),i=r(),a=i||s&&t.ios;return{isSafari:n||i,needPerspectiveFix:n,need3dFix:a,isWebView:s}}function Q7(){return k1||(k1=__()),k1}function L_({swiper:e,on:t,emit:n}){const r=ta();let s=null,i=null;const a=()=>{!e||e.destroyed||!e.initialized||(n("beforeResize"),n("resize"))},c=()=>{!e||e.destroyed||!e.initialized||(s=new ResizeObserver(p=>{i=r.requestAnimationFrame(()=>{const{width:g,height:y}=e;let v=g,S=y;p.forEach(({contentBoxSize:A,contentRect:T,target:L})=>{L&&L!==e.el||(v=T?T.width:(A[0]||A).inlineSize,S=T?T.height:(A[0]||A).blockSize)}),(v!==g||S!==y)&&a()})}),s.observe(e.el))},u=()=>{i&&r.cancelAnimationFrame(i),s&&s.unobserve&&e.el&&(s.unobserve(e.el),s=null)},f=()=>{!e||e.destroyed||!e.initialized||n("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof r.ResizeObserver<"u"){c();return}r.addEventListener("resize",a),r.addEventListener("orientationchange",f)}),t("destroy",()=>{u(),r.removeEventListener("resize",a),r.removeEventListener("orientationchange",f)})}function E_({swiper:e,extendParams:t,on:n,emit:r}){const s=[],i=ta(),a=(f,p={})=>{const g=i.MutationObserver||i.WebkitMutationObserver,y=new g(v=>{if(e.__preventObserver__)return;if(v.length===1){r("observerUpdate",v[0]);return}const S=function(){r("observerUpdate",v[0])};i.requestAnimationFrame?i.requestAnimationFrame(S):i.setTimeout(S,0)});y.observe(f,{attributes:typeof p.attributes>"u"?!0:p.attributes,childList:e.isElement||(typeof p.childList>"u"?!0:p).childList,characterData:typeof p.characterData>"u"?!0:p.characterData}),s.push(y)},c=()=>{if(e.params.observer){if(e.params.observeParents){const f=T_(e.hostEl);for(let p=0;p<f.length;p+=1)a(f[p])}a(e.hostEl,{childList:e.params.observeSlideChildren}),a(e.wrapperEl,{attributes:!1})}},u=()=>{s.forEach(f=>{f.disconnect()}),s.splice(0,s.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",c),n("destroy",u)}var I_={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const s=n?"unshift":"push";return e.split(" ").forEach(i=>{r.eventsListeners[i]||(r.eventsListeners[i]=[]),r.eventsListeners[i][s](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;function s(...i){r.off(e,s),s.__emitterProxy&&delete s.__emitterProxy,t.apply(r,i)}return s.__emitterProxy=t,r.on(e,s,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(" ").forEach(r=>{typeof t>"u"?n.eventsListeners[r]=[]:n.eventsListeners[r]&&n.eventsListeners[r].forEach((s,i)=>{(s===t||s.__emitterProxy&&s.__emitterProxy===t)&&n.eventsListeners[r].splice(i,1)})}),n},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let n,r,s;return typeof e[0]=="string"||Array.isArray(e[0])?(n=e[0],r=e.slice(1,e.length),s=t):(n=e[0].events,r=e[0].data,s=e[0].context||t),r.unshift(s),(Array.isArray(n)?n:n.split(" ")).forEach(a=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(c=>{c.apply(s,[a,...r])}),t.eventsListeners&&t.eventsListeners[a]&&t.eventsListeners[a].forEach(c=>{c.apply(s,r)})}),t}};function R_(){const e=this;let t,n;const r=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=r.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?n=e.params.height:n=r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt(Wc(r,"padding-left")||0,10)-parseInt(Wc(r,"padding-right")||0,10),n=n-parseInt(Wc(r,"padding-top")||0,10)-parseInt(Wc(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function N_(){const e=this;function t(K,W){return parseFloat(K.getPropertyValue(e.getDirectionLabel(W))||0)}const n=e.params,{wrapperEl:r,slidesEl:s,rtlTranslate:i,wrongRTL:a}=e,c=e.virtual&&n.virtual.enabled,u=c?e.virtual.slides.length:e.slides.length,f=yc(s,`.${e.params.slideClass}, swiper-slide`),p=c?e.virtual.slides.length:f.length;let g=[];const y=[],v=[];let S=n.slidesOffsetBefore;typeof S=="function"&&(S=n.slidesOffsetBefore.call(e));let A=n.slidesOffsetAfter;typeof A=="function"&&(A=n.slidesOffsetAfter.call(e));const T=e.snapGrid.length,L=e.slidesGrid.length,I=e.size-S-A;let j=n.spaceBetween,P=-S,F=0,R=0;if(typeof I>"u")return;typeof j=="string"&&j.indexOf("%")>=0?j=parseFloat(j.replace("%",""))/100*I:typeof j=="string"&&(j=parseFloat(j)),e.virtualSize=-j-S-A,f.forEach(K=>{i?K.style.marginLeft="":K.style.marginRight="",K.style.marginBottom="",K.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(_d(r,"--swiper-centered-offset-before",""),_d(r,"--swiper-centered-offset-after","")),n.cssMode&&(_d(r,"--swiper-slides-offset-before",`${S}px`),_d(r,"--swiper-slides-offset-after",`${A}px`));const C=n.grid&&n.grid.rows>1&&e.grid;C?e.grid.initSlides(f):e.grid&&e.grid.unsetSlides();let $;const H=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(K=>typeof n.breakpoints[K].slidesPerView<"u").length>0;for(let K=0;K<p;K+=1){$=0;const W=f[K];if(!(W&&(C&&e.grid.updateSlide(K,W,f),Wc(W,"display")==="none"))){if(c&&n.slidesPerView==="auto")n.virtual.slidesPerViewAutoSlideSize&&($=n.virtual.slidesPerViewAutoSlideSize),$&&W&&(n.roundLengths&&($=Math.floor($)),W.style[e.getDirectionLabel("width")]=`${$}px`);else if(n.slidesPerView==="auto"){H&&(W.style[e.getDirectionLabel("width")]="");const ue=getComputedStyle(W),Z=W.style.transform,ye=W.style.webkitTransform;if(Z&&(W.style.transform="none"),ye&&(W.style.webkitTransform="none"),n.roundLengths)$=e.isHorizontal()?Ov(W,"width"):Ov(W,"height");else{const ve=t(ue,"width"),Ae=t(ue,"padding-left"),oe=t(ue,"padding-right"),q=t(ue,"margin-left"),z=t(ue,"margin-right"),ne=ue.getPropertyValue("box-sizing");if(ne&&ne==="border-box")$=ve+q+z;else{const{clientWidth:pe,offsetWidth:de}=W;$=ve+Ae+oe+q+z+(de-pe)}}Z&&(W.style.transform=Z),ye&&(W.style.webkitTransform=ye),n.roundLengths&&($=Math.floor($))}else $=(I-(n.slidesPerView-1)*j)/n.slidesPerView,n.roundLengths&&($=Math.floor($)),W&&(W.style[e.getDirectionLabel("width")]=`${$}px`);W&&(W.swiperSlideSize=$),v.push($),n.centeredSlides?(P=P+$/2+F/2+j,F===0&&K!==0&&(P=P-I/2-j),K===0&&(P=P-I/2-j),Math.abs(P)<1/1e3&&(P=0),n.roundLengths&&(P=Math.floor(P)),R%n.slidesPerGroup===0&&g.push(P),y.push(P)):(n.roundLengths&&(P=Math.floor(P)),(R-Math.min(e.params.slidesPerGroupSkip,R))%e.params.slidesPerGroup===0&&g.push(P),y.push(P),P=P+$+j),e.virtualSize+=$+j,F=$,R+=1}}if(e.virtualSize=Math.max(e.virtualSize,I)+A,i&&a&&(n.effect==="slide"||n.effect==="coverflow")&&(r.style.width=`${e.virtualSize+j}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+j}px`),C&&e.grid.updateWrapperSize($,g),!n.centeredSlides){const K=n.slidesPerView!=="auto"&&n.slidesPerView%1!==0,W=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView==="auto"||K);let ue=g.length;if(W){let ye;if(n.slidesPerView==="auto"){ye=1;let ve=0;for(let Ae=v.length-1;Ae>=0&&(ve+=v[Ae]+(Ae<v.length-1?j:0),ve<=I);Ae-=1)ye=v.length-Ae}else ye=Math.floor(n.slidesPerView);ue=Math.max(p-ye,0)}const Z=[];for(let ye=0;ye<g.length;ye+=1){let ve=g[ye];n.roundLengths&&(ve=Math.floor(ve)),W?ye<=ue&&Z.push(ve):g[ye]<=e.virtualSize-I&&Z.push(ve)}g=Z,Math.floor(e.virtualSize-I)-Math.floor(g[g.length-1])>1&&(W||g.push(e.virtualSize-I))}if(c&&n.loop){const K=v[0]+j;if(n.slidesPerGroup>1){const W=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),ue=K*n.slidesPerGroup;for(let Z=0;Z<W;Z+=1)g.push(g[g.length-1]+ue)}for(let W=0;W<e.virtual.slidesBefore+e.virtual.slidesAfter;W+=1)n.slidesPerGroup===1&&g.push(g[g.length-1]+K),y.push(y[y.length-1]+K),e.virtualSize+=K}if(g.length===0&&(g=[0]),j!==0){const K=e.isHorizontal()&&i?"marginLeft":e.getDirectionLabel("marginRight");f.filter((W,ue)=>!n.cssMode||n.loop?!0:ue!==f.length-1).forEach(W=>{W.style[K]=`${j}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let K=0;v.forEach(ue=>{K+=ue+(j||0)}),K-=j;const W=K>I?K-I:0;g=g.map(ue=>ue<=0?-S:ue>W?W+A:ue)}if(n.centerInsufficientSlides){let K=0;if(v.forEach(W=>{K+=W+(j||0)}),K-=j,K<I){const W=(I-K)/2;g.forEach((ue,Z)=>{g[Z]=ue-W}),y.forEach((ue,Z)=>{y[Z]=ue+W})}}if(Object.assign(e,{slides:f,snapGrid:g,slidesGrid:y,slidesSizesGrid:v}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){_d(r,"--swiper-centered-offset-before",`${-g[0]}px`),_d(r,"--swiper-centered-offset-after",`${e.size/2-v[v.length-1]/2}px`);const K=-e.snapGrid[0],W=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(ue=>ue+K),e.slidesGrid=e.slidesGrid.map(ue=>ue+W)}if(p!==u&&e.emit("slidesLengthChange"),g.length!==T&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),y.length!==L&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!c&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const K=`${n.containerModifierClass}backface-hidden`,W=e.el.classList.contains(K);p<=n.maxBackfaceHiddenSlides?W||e.el.classList.add(K):W&&e.el.classList.remove(K)}}function M_(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let s=0,i;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const a=c=>r?t.slides[t.getSlideIndexByData(c)]:t.slides[c];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(c=>{n.push(c)});else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const c=t.activeIndex+i;if(c>t.slides.length&&!r)break;n.push(a(c))}else n.push(a(t.activeIndex));for(i=0;i<n.length;i+=1)if(typeof n[i]<"u"){const c=n[i].offsetHeight;s=c>s?c:s}(s||s===0)&&(t.wrapperEl.style.height=`${s}px`)}function D_(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}const $v=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function j_(e=this&&this.translate||0){const t=this,n=t.params,{slides:r,rtlTranslate:s,snapGrid:i}=t;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let a=-e;s&&(a=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let c=n.spaceBetween;typeof c=="string"&&c.indexOf("%")>=0?c=parseFloat(c.replace("%",""))/100*t.size:typeof c=="string"&&(c=parseFloat(c));for(let u=0;u<r.length;u+=1){const f=r[u];let p=f.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(p-=r[0].swiperSlideOffset);const g=(a+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),y=(a-i[0]+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),v=-(a-p),S=v+t.slidesSizesGrid[u],A=v>=0&&v<=t.size-t.slidesSizesGrid[u],T=v>=0&&v<t.size-1||S>1&&S<=t.size||v<=0&&S>=t.size;T&&(t.visibleSlides.push(f),t.visibleSlidesIndexes.push(u)),$v(f,T,n.slideVisibleClass),$v(f,A,n.slideFullyVisibleClass),f.progress=s?-g:g,f.originalProgress=s?-y:y}}function P_(e){const t=this;if(typeof e>"u"){const p=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*p||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:s,isBeginning:i,isEnd:a,progressLoop:c}=t;const u=i,f=a;if(r===0)s=0,i=!0,a=!0;else{s=(e-t.minTranslate())/r;const p=Math.abs(e-t.minTranslate())<1,g=Math.abs(e-t.maxTranslate())<1;i=p||s<=0,a=g||s>=1,p&&(s=0),g&&(s=1)}if(n.loop){const p=t.getSlideIndexByData(0),g=t.getSlideIndexByData(t.slides.length-1),y=t.slidesGrid[p],v=t.slidesGrid[g],S=t.slidesGrid[t.slidesGrid.length-1],A=Math.abs(e);A>=y?c=(A-y)/S:c=(A+S-v)/S,c>1&&(c-=1)}Object.assign(t,{progress:s,progressLoop:c,isBeginning:i,isEnd:a}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),i&&!u&&t.emit("reachBeginning toEdge"),a&&!f&&t.emit("reachEnd toEdge"),(u&&!i||f&&!a)&&t.emit("fromEdge"),t.emit("progress",s)}const _1=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function B_(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:s}=e,i=e.virtual&&n.virtual.enabled,a=e.grid&&n.grid&&n.grid.rows>1,c=g=>yc(r,`.${n.slideClass}${g}, swiper-slide${g}`)[0];let u,f,p;if(i)if(n.loop){let g=s-e.virtual.slidesBefore;g<0&&(g=e.virtual.slides.length+g),g>=e.virtual.slides.length&&(g-=e.virtual.slides.length),u=c(`[data-swiper-slide-index="${g}"]`)}else u=c(`[data-swiper-slide-index="${s}"]`);else a?(u=t.find(g=>g.column===s),p=t.find(g=>g.column===s+1),f=t.find(g=>g.column===s-1)):u=t[s];u&&(a||(p=A_(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!p&&(p=t[0]),f=S_(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!f===0&&(f=t[t.length-1]))),t.forEach(g=>{_1(g,g===u,n.slideActiveClass),_1(g,g===p,n.slideNextClass),_1(g,g===f,n.slidePrevClass)}),e.emitSlidesClasses()}const Jp=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,r=t.closest(n());if(r){let s=r.querySelector(`.${e.params.lazyPreloaderClass}`);!s&&e.isElement&&(r.shadowRoot?s=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(s=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),s&&!s.lazyPreloaderManaged&&s.remove())})),s&&!s.lazyPreloaderManaged&&s.remove()}},L1=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},yb=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),s=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const a=s,c=[a-t];c.push(...Array.from({length:t}).map((u,f)=>a+r+f)),e.slides.forEach((u,f)=>{c.includes(u.column)&&L1(e,f)});return}const i=s+r-1;if(e.params.rewind||e.params.loop)for(let a=s-t;a<=i+t;a+=1){const c=(a%n+n)%n;(c<s||c>i)&&L1(e,c)}else for(let a=Math.max(s-t,0);a<=Math.min(i+t,n-1);a+=1)a!==s&&(a>i||a<s)&&L1(e,a)};function F_(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let s;for(let i=0;i<t.length;i+=1)typeof t[i+1]<"u"?r>=t[i]&&r<t[i+1]-(t[i+1]-t[i])/2?s=i:r>=t[i]&&r<t[i+1]&&(s=i+1):r>=t[i]&&(s=i);return n.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function O_(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:s,activeIndex:i,realIndex:a,snapIndex:c}=t;let u=e,f;const p=v=>{let S=v-t.virtual.slidesBefore;return S<0&&(S=t.virtual.slides.length+S),S>=t.virtual.slides.length&&(S-=t.virtual.slides.length),S};if(typeof u>"u"&&(u=F_(t)),r.indexOf(n)>=0)f=r.indexOf(n);else{const v=Math.min(s.slidesPerGroupSkip,u);f=v+Math.floor((u-v)/s.slidesPerGroup)}if(f>=r.length&&(f=r.length-1),u===i&&!t.params.loop){f!==c&&(t.snapIndex=f,t.emit("snapIndexChange"));return}if(u===i&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=p(u);return}const g=t.grid&&s.grid&&s.grid.rows>1;let y;if(t.virtual&&s.virtual.enabled)s.loop?y=p(u):y=u;else if(g){const v=t.slides.find(A=>A.column===u);let S=parseInt(v.getAttribute("data-swiper-slide-index"),10);Number.isNaN(S)&&(S=Math.max(t.slides.indexOf(v),0)),y=Math.floor(S/s.grid.rows)}else if(t.slides[u]){const v=t.slides[u].getAttribute("data-swiper-slide-index");v?y=parseInt(v,10):y=u}else y=u;Object.assign(t,{previousSnapIndex:c,snapIndex:f,previousRealIndex:a,realIndex:y,previousIndex:i,activeIndex:u}),t.initialized&&yb(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(a!==y&&t.emit("realIndexChange"),t.emit("slideChange"))}function Q_(e,t){const n=this,r=n.params;let s=e.closest(`.${r.slideClass}, swiper-slide`);!s&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(c=>{!s&&c.matches&&c.matches(`.${r.slideClass}, swiper-slide`)&&(s=c)});let i=!1,a;if(s){for(let c=0;c<n.slides.length;c+=1)if(n.slides[c]===s){i=!0,a=c;break}}if(s&&i)n.clickedSlide=s,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(s.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=a;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var $_={updateSize:R_,updateSlides:N_,updateAutoHeight:M_,updateSlidesOffset:D_,updateSlidesProgress:j_,updateProgress:P_,updateSlidesClasses:B_,updateActiveIndex:O_,updateClickedSlide:Q_};function H_(e=this.isHorizontal()?"x":"y"){const t=this,{params:n,rtlTranslate:r,translate:s,wrapperEl:i}=t;if(n.virtualTranslate)return r?-s:s;if(n.cssMode)return s;let a=b_(i,e);return a+=t.cssOverflowAdjustment(),r&&(a=-a),a||0}function U_(e,t){const n=this,{rtlTranslate:r,params:s,wrapperEl:i,progress:a}=n;let c=0,u=0;const f=0;n.isHorizontal()?c=r?-e:e:u=e,s.roundLengths&&(c=Math.floor(c),u=Math.floor(u)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?c:u,s.cssMode?i[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-c:-u:s.virtualTranslate||(n.isHorizontal()?c-=n.cssOverflowAdjustment():u-=n.cssOverflowAdjustment(),i.style.transform=`translate3d(${c}px, ${u}px, ${f}px)`);let p;const g=n.maxTranslate()-n.minTranslate();g===0?p=0:p=(e-n.minTranslate())/g,p!==a&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function z_(){return-this.snapGrid[0]}function G_(){return-this.snapGrid[this.snapGrid.length-1]}function W_(e=0,t=this.params.speed,n=!0,r=!0,s){const i=this,{params:a,wrapperEl:c}=i;if(i.animating&&a.preventInteractionOnTransition)return!1;const u=i.minTranslate(),f=i.maxTranslate();let p;if(r&&e>u?p=u:r&&e<f?p=f:p=e,i.updateProgress(p),a.cssMode){const g=i.isHorizontal();if(t===0)c[g?"scrollLeft":"scrollTop"]=-p;else{if(!i.support.smoothScroll)return B7({swiper:i,targetPosition:-p,side:g?"left":"top"}),!0;c.scrollTo({[g?"left":"top"]:-p,behavior:"smooth"})}return!0}return t===0?(i.setTransition(0),i.setTranslate(p),n&&(i.emit("beforeTransitionStart",t,s),i.emit("transitionEnd"))):(i.setTransition(t),i.setTranslate(p),n&&(i.emit("beforeTransitionStart",t,s),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(y){!i||i.destroyed||y.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,n&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}var V_={getTranslate:H_,setTranslate:U_,minTranslate:z_,maxTranslate:G_,translateTo:W_};function q_(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?"0ms":""),n.emit("setTransition",e,t)}function $7({swiper:e,runCallbacks:t,direction:n,step:r}){const{activeIndex:s,previousIndex:i}=e;let a=n;a||(s>i?a="next":s<i?a="prev":a="reset"),e.emit(`transition${r}`),t&&a==="reset"?e.emit(`slideResetTransition${r}`):t&&s!==i&&(e.emit(`slideChangeTransition${r}`),a==="next"?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function K_(e=!0,t){const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),$7({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function Y_(e=!0,t){const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),$7({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var X_={setTransition:q_,transitionStart:K_,transitionEnd:Y_};function Z_(e=0,t,n=!0,r,s){typeof e=="string"&&(e=parseInt(e,10));const i=this;let a=e;a<0&&(a=0);const{params:c,snapGrid:u,slidesGrid:f,previousIndex:p,activeIndex:g,rtlTranslate:y,wrapperEl:v,enabled:S}=i;if(!S&&!r&&!s||i.destroyed||i.animating&&c.preventInteractionOnTransition)return!1;typeof t>"u"&&(t=i.params.speed);const A=Math.min(i.params.slidesPerGroupSkip,a);let T=A+Math.floor((a-A)/i.params.slidesPerGroup);T>=u.length&&(T=u.length-1);const L=-u[T];if(c.normalizeSlideIndex)for(let C=0;C<f.length;C+=1){const $=-Math.floor(L*100),H=Math.floor(f[C]*100),K=Math.floor(f[C+1]*100);typeof f[C+1]<"u"?$>=H&&$<K-(K-H)/2?a=C:$>=H&&$<K&&(a=C+1):$>=H&&(a=C)}if(i.initialized&&a!==g&&(!i.allowSlideNext&&(y?L>i.translate&&L>i.minTranslate():L<i.translate&&L<i.minTranslate())||!i.allowSlidePrev&&L>i.translate&&L>i.maxTranslate()&&(g||0)!==a))return!1;a!==(p||0)&&n&&i.emit("beforeSlideChangeStart"),i.updateProgress(L);let I;a>g?I="next":a<g?I="prev":I="reset";const j=i.virtual&&i.params.virtual.enabled;if(!(j&&s)&&(y&&-L===i.translate||!y&&L===i.translate))return i.updateActiveIndex(a),c.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),c.effect!=="slide"&&i.setTranslate(L),I!=="reset"&&(i.transitionStart(n,I),i.transitionEnd(n,I)),!1;if(c.cssMode){const C=i.isHorizontal(),$=y?L:-L;if(t===0)j&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),j&&!i._cssModeVirtualInitialSet&&i.params.initialSlide>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{v[C?"scrollLeft":"scrollTop"]=$})):v[C?"scrollLeft":"scrollTop"]=$,j&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1});else{if(!i.support.smoothScroll)return B7({swiper:i,targetPosition:$,side:C?"left":"top"}),!0;v.scrollTo({[C?"left":"top"]:$,behavior:"smooth"})}return!0}const R=Q7().isSafari;return j&&!s&&R&&i.isElement&&i.virtual.update(!1,!1,a),i.setTransition(t),i.setTranslate(L),i.updateActiveIndex(a),i.updateSlidesClasses(),i.emit("beforeTransitionStart",t,r),i.transitionStart(n,I),t===0?i.transitionEnd(n,I):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function($){!i||i.destroyed||$.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(n,I))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0}function J_(e=0,t,n=!0,r){typeof e=="string"&&(e=parseInt(e,10));const s=this;if(s.destroyed)return;typeof t>"u"&&(t=s.params.speed);const i=s.grid&&s.params.grid&&s.params.grid.rows>1;let a=e;if(s.params.loop)if(s.virtual&&s.params.virtual.enabled)a=a+s.virtual.slidesBefore;else{let c;if(i){const A=a*s.params.grid.rows;c=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else c=s.getSlideIndexByData(a);const u=i?Math.ceil(s.slides.length/s.params.grid.rows):s.slides.length,{centeredSlides:f,slidesOffsetBefore:p,slidesOffsetAfter:g}=s.params,y=f||!!p||!!g;let v=s.params.slidesPerView;v==="auto"?v=s.slidesPerViewDynamic():(v=Math.ceil(parseFloat(s.params.slidesPerView,10)),y&&v%2===0&&(v=v+1));let S=u-c<v;if(y&&(S=S||c<Math.ceil(v/2)),r&&y&&s.params.slidesPerView!=="auto"&&!i&&(S=!1),S){const A=y?c<s.activeIndex?"prev":"next":c-s.activeIndex-1<s.params.slidesPerView?"next":"prev";s.loopFix({direction:A,slideTo:!0,activeSlideIndex:A==="next"?c+1:c-u+1,slideRealIndex:A==="next"?s.realIndex:void 0})}if(i){const A=a*s.params.grid.rows;a=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else a=s.getSlideIndexByData(a)}return requestAnimationFrame(()=>{s.slideTo(a,t,n,r)}),s}function eL(e,t=!0,n){const r=this,{enabled:s,params:i,animating:a}=r;if(!s||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);let c=i.slidesPerGroup;i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(c=Math.max(r.slidesPerViewDynamic("current",!0),1));const u=r.activeIndex<i.slidesPerGroupSkip?1:c,f=r.virtual&&i.virtual.enabled;if(i.loop){if(a&&!f&&i.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+u,e,t,n)}),!0}return i.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+u,e,t,n)}function tL(e,t=!0,n){const r=this,{params:s,snapGrid:i,slidesGrid:a,rtlTranslate:c,enabled:u,animating:f}=r;if(!u||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);const p=r.virtual&&s.virtual.enabled;if(s.loop){if(f&&!p&&s.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const g=c?r.translate:-r.translate;function y(I){return I<0?-Math.floor(Math.abs(I)):Math.floor(I)}const v=y(g),S=i.map(I=>y(I)),A=s.freeMode&&s.freeMode.enabled;let T=i[S.indexOf(v)-1];if(typeof T>"u"&&(s.cssMode||A)){let I;i.forEach((j,P)=>{v>=j&&(I=P)}),typeof I<"u"&&(T=A?i[I]:i[I>0?I-1:I])}let L=0;if(typeof T<"u"&&(L=a.indexOf(T),L<0&&(L=r.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(L=L-r.slidesPerViewDynamic("previous",!0)+1,L=Math.max(L,0))),s.rewind&&r.isBeginning){const I=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(I,e,t,n)}else if(s.loop&&r.activeIndex===0&&s.cssMode)return requestAnimationFrame(()=>{r.slideTo(L,e,t,n)}),!0;return r.slideTo(L,e,t,n)}function nL(e,t=!0,n){const r=this;if(!r.destroyed)return typeof e>"u"&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)}function rL(e,t=!0,n,r=.5){const s=this;if(s.destroyed)return;typeof e>"u"&&(e=s.params.speed);let i=s.activeIndex;const a=Math.min(s.params.slidesPerGroupSkip,i),c=a+Math.floor((i-a)/s.params.slidesPerGroup),u=s.rtlTranslate?s.translate:-s.translate;if(u>=s.snapGrid[c]){const f=s.snapGrid[c],p=s.snapGrid[c+1];u-f>(p-f)*r&&(i+=s.params.slidesPerGroup)}else{const f=s.snapGrid[c-1],p=s.snapGrid[c];u-f<=(p-f)*r&&(i-=s.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,s.slidesGrid.length-1),s.slideTo(i,e,t,n)}function sL(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let s=e.getSlideIndexWhenGrid(e.clickedIndex),i;const a=e.isElement?"swiper-slide":`.${t.slideClass}`,c=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(i):s>(c?(e.slides.length-r)/2-(e.params.grid.rows-1):e.slides.length-r)?(e.loopFix(),s=e.getSlideIndex(yc(n,`${a}[data-swiper-slide-index="${i}"]`)[0]),P7(()=>{e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}var iL={slideTo:Z_,slideToLoop:J_,slideNext:eL,slidePrev:tL,slideReset:nL,slideToClosest:rL,slideToClickedSlide:sL};function oL(e,t){const n=this,{params:r,slidesEl:s}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;const i=()=>{yc(s,`.${r.slideClass}, swiper-slide`).forEach((S,A)=>{S.setAttribute("data-swiper-slide-index",A)})},a=()=>{const v=yc(s,`.${r.slideBlankClass}`);v.forEach(S=>{S.remove()}),v.length>0&&(n.recalcSlides(),n.updateSlides())},c=n.grid&&r.grid&&r.grid.rows>1;r.loopAddBlankSlides&&(r.slidesPerGroup>1||c)&&a();const u=r.slidesPerGroup*(c?r.grid.rows:1),f=n.slides.length%u!==0,p=c&&n.slides.length%r.grid.rows!==0,g=v=>{for(let S=0;S<v;S+=1){const A=n.isElement?bb("swiper-slide",[r.slideBlankClass]):bb("div",[r.slideClass,r.slideBlankClass]);n.slidesEl.append(A)}};if(f){if(r.loopAddBlankSlides){const v=u-n.slides.length%u;g(v),n.recalcSlides(),n.updateSlides()}else Cm("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(p){if(r.loopAddBlankSlides){const v=r.grid.rows-n.slides.length%r.grid.rows;g(v),n.recalcSlides(),n.updateSlides()}else Cm("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();const y=r.centeredSlides||!!r.slidesOffsetBefore||!!r.slidesOffsetAfter;n.loopFix({slideRealIndex:e,direction:y?void 0:"next",initial:t})}function aL({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:s,initial:i,byController:a,byMousewheel:c}={}){const u=this;if(!u.params.loop)return;u.emit("beforeLoopFix");const{slides:f,allowSlidePrev:p,allowSlideNext:g,slidesEl:y,params:v}=u,{centeredSlides:S,slidesOffsetBefore:A,slidesOffsetAfter:T,initialSlide:L}=v,I=S||!!A||!!T;if(u.allowSlidePrev=!0,u.allowSlideNext=!0,u.virtual&&v.virtual.enabled){t&&(!I&&u.snapIndex===0?u.slideTo(u.virtual.slides.length,0,!1,!0):I&&u.snapIndex<v.slidesPerView?u.slideTo(u.virtual.slides.length+u.snapIndex,0,!1,!0):u.snapIndex===u.snapGrid.length-1&&u.slideTo(u.virtual.slidesBefore,0,!1,!0)),u.allowSlidePrev=p,u.allowSlideNext=g,u.emit("loopFix");return}let j=v.slidesPerView;j==="auto"?j=u.slidesPerViewDynamic():(j=Math.ceil(parseFloat(v.slidesPerView,10)),I&&j%2===0&&(j=j+1));const P=v.slidesPerGroupAuto?j:v.slidesPerGroup;let F=I?Math.max(P,Math.ceil(j/2)):P;F%P!==0&&(F+=P-F%P),F+=v.loopAdditionalSlides,u.loopedSlides=F;const R=u.grid&&v.grid&&v.grid.rows>1;f.length<j+F||u.params.effect==="cards"&&f.length<j+F*2?Cm("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):R&&v.grid.fill==="row"&&Cm("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const C=[],$=[],H=R?Math.ceil(f.length/v.grid.rows):f.length,K=i&&H-L<j&&!I;let W=K?L:u.activeIndex;typeof s>"u"?s=u.getSlideIndex(f.find(q=>q.classList.contains(v.slideActiveClass))):W=s;const ue=n==="next"||!n,Z=n==="prev"||!n;let ye=0,ve=0;const oe=(R?f[s].column:s)+(I&&typeof r>"u"?-j/2+.5:0);if(oe<F){ye=Math.max(F-oe,P);for(let q=0;q<F-oe;q+=1){const z=q-Math.floor(q/H)*H;if(R){const ne=H-z-1;for(let pe=f.length-1;pe>=0;pe-=1)f[pe].column===ne&&C.push(pe)}else C.push(H-z-1)}}else if(oe+j>H-F){ve=Math.max(oe-(H-F*2),P),K&&(ve=Math.max(ve,j-H+L+1));for(let q=0;q<ve;q+=1){const z=q-Math.floor(q/H)*H;R?f.forEach((ne,pe)=>{ne.column===z&&$.push(pe)}):$.push(z)}}if(u.__preventObserver__=!0,requestAnimationFrame(()=>{u.__preventObserver__=!1}),u.params.effect==="cards"&&f.length<j+F*2&&($.includes(s)&&$.splice($.indexOf(s),1),C.includes(s)&&C.splice(C.indexOf(s),1)),Z&&C.forEach(q=>{f[q].swiperLoopMoveDOM=!0,y.prepend(f[q]),f[q].swiperLoopMoveDOM=!1}),ue&&$.forEach(q=>{f[q].swiperLoopMoveDOM=!0,y.append(f[q]),f[q].swiperLoopMoveDOM=!1}),u.recalcSlides(),v.slidesPerView==="auto"?u.updateSlides():R&&(C.length>0&&Z||$.length>0&&ue)&&u.slides.forEach((q,z)=>{u.grid.updateSlide(z,q,u.slides)}),v.watchSlidesProgress&&u.updateSlidesOffset(),t){if(C.length>0&&Z){if(typeof e>"u"){const q=u.slidesGrid[W],ne=u.slidesGrid[W+ye]-q;c?u.setTranslate(u.translate-ne):(u.slideTo(W+Math.ceil(ye),0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-ne,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-ne))}else if(r){const q=R?C.length/v.grid.rows:C.length;u.slideTo(u.activeIndex+q,0,!1,!0),u.touchEventsData.currentTranslate=u.translate}}else if($.length>0&&ue)if(typeof e>"u"){const q=u.slidesGrid[W],ne=u.slidesGrid[W-ve]-q;c?u.setTranslate(u.translate-ne):(u.slideTo(W-ve,0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-ne,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-ne))}else{const q=R?$.length/v.grid.rows:$.length;u.slideTo(u.activeIndex-q,0,!1,!0)}}if(u.allowSlidePrev=p,u.allowSlideNext=g,u.controller&&u.controller.control&&!a){const q={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:s,byController:!0};Array.isArray(u.controller.control)?u.controller.control.forEach(z=>{!z.destroyed&&z.params.loop&&z.loopFix({...q,slideTo:z.params.slidesPerView===v.slidesPerView?t:!1})}):u.controller.control instanceof u.constructor&&u.controller.control.params.loop&&u.controller.control.loopFix({...q,slideTo:u.controller.control.params.slidesPerView===v.slidesPerView?t:!1})}u.emit("loopFix")}function lL(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||!n||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(s=>{const i=typeof s.swiperSlideIndex>"u"?s.getAttribute("data-swiper-slide-index")*1:s.swiperSlideIndex;r[i]=s}),e.slides.forEach(s=>{s.removeAttribute("data-swiper-slide-index")}),r.forEach(s=>{n.append(s)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var cL={loopCreate:oL,loopFix:aL,loopDestroy:lL};function uL(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function dL(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var fL={setGrabCursor:uL,unsetGrabCursor:dL};function hL(e,t=this){function n(r){if(!r||r===Zu()||r===ta())return null;r.assignedSlot&&(r=r.assignedSlot);const s=r.closest(e);return!s&&!r.getRootNode?null:s||n(r.getRootNode().host)}return n(t)}function Hv(e,t,n){const r=ta(),{params:s}=e,i=s.edgeSwipeDetection,a=s.edgeSwipeThreshold;return i&&(n<=a||n>=r.innerWidth-a)?i==="prevent"?(t.preventDefault(),!0):!1:!0}function pL(e){const t=this;if(t.destroyed)return;const n=Zu();let r=e;r.originalEvent&&(r=r.originalEvent);const s=t.touchEventsData;if(r.type==="pointerdown"){if(s.pointerId!==null&&s.pointerId!==r.pointerId)return;s.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(s.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){Hv(t,r,r.targetTouches[0].pageX);return}const{params:i,touches:a,enabled:c}=t;if(!c||!i.simulateTouch&&r.pointerType==="mouse"||t.animating&&i.preventInteractionOnTransition)return;!t.animating&&i.cssMode&&i.loop&&t.loopFix();let u=r.target;if(i.touchEventsTarget==="wrapper"&&!w_(u,t.wrapperEl)||"which"in r&&r.which===3||"button"in r&&r.button>0||s.isTouched&&s.isMoved)return;const f=!!i.noSwipingClass&&i.noSwipingClass!=="",p=r.composedPath?r.composedPath():r.path;f&&r.target&&r.target.shadowRoot&&p&&(u=p[0]);const g=i.noSwipingSelector?i.noSwipingSelector:`.${i.noSwipingClass}`,y=!!(r.target&&r.target.shadowRoot);if(i.noSwiping&&(y?hL(g,u):u.closest(g))){t.allowClick=!0;return}if(i.swipeHandler&&!u.closest(i.swipeHandler))return;a.currentX=r.pageX,a.currentY=r.pageY;const v=a.currentX,S=a.currentY;if(!Hv(t,r,v))return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=v,a.startY=S,s.touchStartTime=Tm(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,i.threshold>0&&(s.allowThresholdMove=!1);let A=!0;u.matches(s.focusableElements)&&(A=!1,u.nodeName==="SELECT"&&(s.isTouched=!1)),n.activeElement&&n.activeElement.matches(s.focusableElements)&&n.activeElement!==u&&(r.pointerType==="mouse"||r.pointerType!=="mouse"&&!u.matches(s.focusableElements))&&n.activeElement.blur();const T=A&&t.allowTouchMove&&i.touchStartPreventDefault;(i.touchStartForcePreventDefault||T)&&!u.isContentEditable&&r.preventDefault(),i.freeMode&&i.freeMode.enabled&&t.freeMode&&t.animating&&!i.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function mL(e){const t=Zu(),n=this;if(n.destroyed)return;const r=n.touchEventsData,{params:s,touches:i,rtlTranslate:a,enabled:c}=n;if(!c||!s.simulateTouch&&e.pointerType==="mouse")return;let u=e;if(u.originalEvent&&(u=u.originalEvent),u.type==="pointermove"&&(r.touchId!==null||u.pointerId!==r.pointerId))return;let f;if(u.type==="touchmove"){if(f=[...u.changedTouches].find(F=>F.identifier===r.touchId),!f||f.identifier!==r.touchId)return}else f=u;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",u);return}const p=f.pageX,g=f.pageY;if(u.preventedByNestedSwiper){i.startX=p,i.startY=g;return}if(!n.allowTouchMove){u.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(i,{startX:p,startY:g,currentX:p,currentY:g}),r.touchStartTime=Tm());return}if(s.touchReleaseOnEdges&&!s.loop)if(n.isVertical()){if(g<i.startY&&n.translate<=n.maxTranslate()||g>i.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else{if(a&&(p>i.startX&&-n.translate<=n.maxTranslate()||p<i.startX&&-n.translate>=n.minTranslate()))return;if(!a&&(p<i.startX&&n.translate<=n.maxTranslate()||p>i.startX&&n.translate>=n.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==u.target&&u.pointerType!=="mouse"&&t.activeElement.blur(),t.activeElement&&u.target===t.activeElement&&u.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit("touchMove",u),i.previousX=i.currentX,i.previousY=i.currentY,i.currentX=p,i.currentY=g;const y=i.currentX-i.startX,v=i.currentY-i.startY;if(n.params.threshold&&Math.sqrt(y**2+v**2)<n.params.threshold)return;if(typeof r.isScrolling>"u"){let F;n.isHorizontal()&&i.currentY===i.startY||n.isVertical()&&i.currentX===i.startX?r.isScrolling=!1:y*y+v*v>=25&&(F=Math.atan2(Math.abs(v),Math.abs(y))*180/Math.PI,r.isScrolling=n.isHorizontal()?F>s.touchAngle:90-F>s.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",u),typeof r.startMoving>"u"&&(i.currentX!==i.startX||i.currentY!==i.startY)&&(r.startMoving=!0),r.isScrolling||u.type==="touchmove"&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!s.cssMode&&u.cancelable&&u.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&u.stopPropagation();let S=n.isHorizontal()?y:v,A=n.isHorizontal()?i.currentX-i.previousX:i.currentY-i.previousY;s.oneWayMovement&&(S=Math.abs(S)*(a?1:-1),A=Math.abs(A)*(a?1:-1)),i.diff=S,S*=s.touchRatio,a&&(S=-S,A=-A);const T=n.touchesDirection;n.swipeDirection=S>0?"prev":"next",n.touchesDirection=A>0?"prev":"next";const L=n.params.loop&&!s.cssMode,I=n.touchesDirection==="next"&&n.allowSlideNext||n.touchesDirection==="prev"&&n.allowSlidePrev;if(!r.isMoved){if(L&&I&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const F=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(F)}r.allowMomentumBounce=!1,s.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",u)}if(new Date().getTime(),s._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&T!==n.touchesDirection&&L&&I&&Math.abs(S)>=1){Object.assign(i,{startX:p,startY:g,currentX:p,currentY:g,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit("sliderMove",u),r.isMoved=!0,r.currentTranslate=S+r.startTranslate;let j=!0,P=s.resistanceRatio;if(s.touchReleaseOnEdges&&(P=0),S>0?(L&&I&&r.allowThresholdMove&&r.currentTranslate>(s.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-(s.slidesPerView!=="auto"&&n.slides.length-s.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(j=!1,s.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+S)**P))):S<0&&(L&&I&&r.allowThresholdMove&&r.currentTranslate<(s.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+(s.slidesPerView!=="auto"&&n.slides.length-s.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-(s.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(parseFloat(s.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(j=!1,s.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-S)**P))),j&&(u.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),s.threshold>0)if(Math.abs(S)>s.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,i.startX=i.currentX,i.startY=i.currentY,r.currentTranslate=r.startTranslate,i.diff=n.isHorizontal()?i.currentX-i.startX:i.currentY-i.startY;return}}else{r.currentTranslate=r.startTranslate;return}!s.followFinger||s.cssMode||((s.freeMode&&s.freeMode.enabled&&n.freeMode||s.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),s.freeMode&&s.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function gL(e){const t=this;if(t.destroyed)return;const n=t.touchEventsData;let r=e;r.originalEvent&&(r=r.originalEvent);let s;if(r.type==="touchend"||r.type==="touchcancel"){if(s=[...r.changedTouches].find(F=>F.identifier===n.touchId),!s||s.identifier!==n.touchId)return}else{if(n.touchId!==null||r.pointerId!==n.pointerId)return;s=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;const{params:a,touches:c,rtlTranslate:u,slidesGrid:f,enabled:p}=t;if(!p||!a.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&a.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}a.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const g=Tm(),y=g-n.touchStartTime;if(t.allowClick){const F=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(F&&F[0]||r.target,F),t.emit("tap click",r),y<300&&g-n.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(n.lastClickTime=Tm(),P7(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||c.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let v;if(a.followFinger?v=u?t.translate:-t.translate:v=-n.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:v});return}const S=v>=-t.maxTranslate()&&!t.params.loop;let A=0,T=t.slidesSizesGrid[0];for(let F=0;F<f.length;F+=F<a.slidesPerGroupSkip?1:a.slidesPerGroup){const R=F<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;typeof f[F+R]<"u"?(S||v>=f[F]&&v<f[F+R])&&(A=F,T=f[F+R]-f[F]):(S||v>=f[F])&&(A=F,T=f[f.length-1]-f[f.length-2])}let L=null,I=null;a.rewind&&(t.isBeginning?I=a.virtual&&a.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(L=0));const j=(v-f[A])/T,P=A<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;if(y>a.longSwipesMs){if(!a.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(j>=a.longSwipesRatio?t.slideTo(a.rewind&&t.isEnd?L:A+P):t.slideTo(A)),t.swipeDirection==="prev"&&(j>1-a.longSwipesRatio?t.slideTo(A+P):I!==null&&j<0&&Math.abs(j)>a.longSwipesRatio?t.slideTo(I):t.slideTo(A))}else{if(!a.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(A+P):t.slideTo(A):(t.swipeDirection==="next"&&t.slideTo(L!==null?L:A+P),t.swipeDirection==="prev"&&t.slideTo(I!==null?I:A))}}function Uv(){const e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:s,snapGrid:i}=e,a=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const c=a&&t.loop;if((t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!c){const u=a?e.virtual.slides:e.slides;e.slideTo(u.length-1,0,!1,!0)}else e.params.loop&&!a?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0);e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=s,e.allowSlideNext=r,e.params.watchOverflow&&i!==e.snapGrid&&e.checkOverflow()}function xL(e){const t=this;t.destroyed||t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function bL(){const e=this;if(e.destroyed)return;const{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let s;const i=e.maxTranslate()-e.minTranslate();i===0?s=0:s=(e.translate-e.minTranslate())/i,s!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function yL(e){const t=this;t.destroyed||(Jp(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update())}function vL(){const e=this;e.destroyed||e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const H7=(e,t)=>{const n=Zu(),{params:r,el:s,wrapperEl:i,device:a}=e,c=!!r.nested,u=t==="on"?"addEventListener":"removeEventListener",f=t;!s||typeof s=="string"||(n[u]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:c}),s[u]("touchstart",e.onTouchStart,{passive:!1}),s[u]("pointerdown",e.onTouchStart,{passive:!1}),n[u]("touchmove",e.onTouchMove,{passive:!1,capture:c}),n[u]("pointermove",e.onTouchMove,{passive:!1,capture:c}),n[u]("touchend",e.onTouchEnd,{passive:!0}),n[u]("pointerup",e.onTouchEnd,{passive:!0}),n[u]("pointercancel",e.onTouchEnd,{passive:!0}),n[u]("touchcancel",e.onTouchEnd,{passive:!0}),n[u]("pointerout",e.onTouchEnd,{passive:!0}),n[u]("pointerleave",e.onTouchEnd,{passive:!0}),n[u]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&s[u]("click",e.onClick,!0),r.cssMode&&i[u]("scroll",e.onScroll),r.updateOnWindowResize?e[f](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",Uv,!0):e[f]("observerUpdate",Uv,!0),s[u]("load",e.onLoad,{capture:!0}))};function wL(){const e=this,{params:t}=e;e.onTouchStart=pL.bind(e),e.onTouchMove=mL.bind(e),e.onTouchEnd=gL.bind(e),e.onDocumentTouchStart=vL.bind(e),t.cssMode&&(e.onScroll=bL.bind(e)),e.onClick=xL.bind(e),e.onLoad=yL.bind(e),H7(e,"on")}function SL(){H7(this,"off")}var AL={attachEvents:wL,detachEvents:SL};const zv=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function TL(){const e=this,{realIndex:t,initialized:n,params:r,el:s}=e,i=r.breakpoints;if(!i||i&&Object.keys(i).length===0)return;const a=Zu(),c=r.breakpointsBase==="window"||!r.breakpointsBase?r.breakpointsBase:"container",u=["window","container"].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:a.querySelector(r.breakpointsBase),f=e.getBreakpoint(i,c,u);if(!f||e.currentBreakpoint===f)return;const g=(f in i?i[f]:void 0)||e.originalParams,y=zv(e,r),v=zv(e,g),S=e.params.grabCursor,A=g.grabCursor,T=r.enabled;y&&!v?(s.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!y&&v&&(s.classList.add(`${r.containerModifierClass}grid`),(g.grid.fill&&g.grid.fill==="column"||!g.grid.fill&&r.grid.fill==="column")&&s.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),S&&!A?e.unsetGrabCursor():!S&&A&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(R=>{if(typeof g[R]>"u")return;const C=r[R]&&r[R].enabled,$=g[R]&&g[R].enabled;C&&!$&&e[R].disable(),!C&&$&&e[R].enable()});const L=g.direction&&g.direction!==r.direction,I=r.loop&&(g.slidesPerView!==r.slidesPerView||L),j=r.loop;L&&n&&e.changeDirection(),Ea(e.params,g);const P=e.params.enabled,F=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),T&&!P?e.disable():!T&&P&&e.enable(),e.currentBreakpoint=f,e.emit("_beforeBreakpoint",g),n&&(I?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!j&&F?(e.loopCreate(t),e.updateSlides()):j&&!F&&e.loopDestroy()),e.emit("breakpoint",g)}function CL(e,t="window",n){if(!e||t==="container"&&!n)return;let r=!1;const s=ta(),i=t==="window"?s.innerHeight:n.clientHeight,a=Object.keys(e).map(c=>{if(typeof c=="string"&&c.indexOf("@")===0){const u=parseFloat(c.substr(1));return{value:i*u,point:c}}return{value:c,point:c}});a.sort((c,u)=>parseInt(c.value,10)-parseInt(u.value,10));for(let c=0;c<a.length;c+=1){const{point:u,value:f}=a[c];t==="window"?s.matchMedia(`(min-width: ${f}px)`).matches&&(r=u):f<=n.clientWidth&&(r=u)}return r||"max"}var kL={setBreakpoint:TL,getBreakpoint:CL};function _L(e,t){const n=[];return e.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(s=>{r[s]&&n.push(t+s)}):typeof r=="string"&&n.push(t+r)}),n}function LL(){const e=this,{classNames:t,params:n,rtl:r,el:s,device:i}=e,a=_L(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill==="column"},{android:i.android},{ios:i.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...a),s.classList.add(...t),e.emitContainerClasses()}function EL(){const e=this,{el:t,classNames:n}=e;!t||typeof t=="string"||(t.classList.remove(...n),e.emitContainerClasses())}var IL={addClasses:LL,removeClasses:EL};function RL(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const s=e.slides.length-1,i=e.slidesGrid[s]+e.slidesSizesGrid[s]+r*2;e.isLocked=e.size>i}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var NL={checkOverflow:RL},vb={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function ML(e,t){return function(r={}){const s=Object.keys(r)[0],i=r[s];if(typeof i!="object"||i===null){Ea(t,r);return}if(e[s]===!0&&(e[s]={enabled:!0}),s==="navigation"&&e[s]&&e[s].enabled&&!e[s].prevEl&&!e[s].nextEl&&(e[s].auto=!0),["pagination","scrollbar"].indexOf(s)>=0&&e[s]&&e[s].enabled&&!e[s].el&&(e[s].auto=!0),!(s in e&&"enabled"in i)){Ea(t,r);return}typeof e[s]=="object"&&!("enabled"in e[s])&&(e[s].enabled=!0),e[s]||(e[s]={enabled:!1}),Ea(t,r)}}const E1={eventsEmitter:I_,update:$_,translate:V_,transition:X_,slide:iL,loop:cL,grabCursor:fL,events:AL,breakpoints:kL,checkOverflow:NL,classes:IL},I1={};let ey=class gc{constructor(...t){let n,r;t.length===1&&t[0].constructor&&Object.prototype.toString.call(t[0]).slice(8,-1)==="Object"?r=t[0]:[n,r]=t,r||(r={}),r=Ea({},r),n&&!r.el&&(r.el=n);const s=Zu();if(r.el&&typeof r.el=="string"&&s.querySelectorAll(r.el).length>1){const u=[];return s.querySelectorAll(r.el).forEach(f=>{const p=Ea({},r,{el:f});u.push(new gc(p))}),u}const i=this;i.__swiper__=!0,i.support=F7(),i.device=O7({userAgent:r.userAgent}),i.browser=Q7(),i.eventsListeners={},i.eventsAnyListeners=[],i.modules=[...i.__modules__],r.modules&&Array.isArray(r.modules)&&r.modules.forEach(u=>{typeof u=="function"&&i.modules.indexOf(u)<0&&i.modules.push(u)});const a={};i.modules.forEach(u=>{u({params:r,swiper:i,extendParams:ML(r,a),on:i.on.bind(i),once:i.once.bind(i),off:i.off.bind(i),emit:i.emit.bind(i)})});const c=Ea({},vb,a);return i.params=Ea({},c,I1,r),i.originalParams=Ea({},i.params),i.passedParams=Ea({},r),i.params&&i.params.on&&Object.keys(i.params.on).forEach(u=>{i.on(u,i.params.on[u])}),i.params&&i.params.onAny&&i.onAny(i.params.onAny),Object.assign(i,{enabled:i.params.enabled,el:n,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return i.params.direction==="horizontal"},isVertical(){return i.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:i.params.allowSlideNext,allowSlidePrev:i.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:i.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:i.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),i.emit("_swiper"),i.params.init&&i.init(),i}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:n,params:r}=this,s=yc(n,`.${r.slideClass}, swiper-slide`),i=Fv(s[0]);return Fv(t)-i}getSlideIndexByData(t){return this.getSlideIndex(this.slides.find(n=>n.getAttribute("data-swiper-slide-index")*1===t))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?t=Math.floor(t/this.params.grid.rows):this.params.grid.fill==="row"&&(t=t%Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const t=this,{slidesEl:n,params:r}=t;t.slides=yc(n,`.${r.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,n){const r=this;t=Math.min(Math.max(t,0),1);const s=r.minTranslate(),a=(r.maxTranslate()-s)*t+s;r.translateTo(a,typeof n>"u"?0:n),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=t.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",n.join(" "))}getSlideClasses(t){const n=this;return n.destroyed?"":t.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(n.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=[];t.slides.forEach(r=>{const s=t.getSlideClasses(r);n.push({slideEl:r,classNames:s}),t.emit("_slideClass",r,s)}),t.emit("_slideClasses",n)}slidesPerViewDynamic(t="current",n=!1){const r=this,{params:s,slides:i,slidesGrid:a,slidesSizesGrid:c,size:u,activeIndex:f}=r;let p=1;if(typeof s.slidesPerView=="number")return s.slidesPerView;if(s.centeredSlides){let g=i[f]?Math.ceil(i[f].swiperSlideSize):0,y;for(let v=f+1;v<i.length;v+=1)i[v]&&!y&&(g+=Math.ceil(i[v].swiperSlideSize),p+=1,g>u&&(y=!0));for(let v=f-1;v>=0;v-=1)i[v]&&!y&&(g+=i[v].swiperSlideSize,p+=1,g>u&&(y=!0))}else if(t==="current")for(let g=f+1;g<i.length;g+=1)(n?a[g]+c[g]-a[f]<u:a[g]-a[f]<u)&&(p+=1);else for(let g=f-1;g>=0;g-=1)a[f]-a[g]<u&&(p+=1);return p}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:n,params:r}=t;r.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(a=>{a.complete&&Jp(t,a)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function s(){const a=t.rtlTranslate?t.translate*-1:t.translate,c=Math.min(Math.max(a,t.maxTranslate()),t.minTranslate());t.setTranslate(c),t.updateActiveIndex(),t.updateSlidesClasses()}let i;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)s(),r.autoHeight&&t.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&t.isEnd&&!r.centeredSlides){const a=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;i=t.slideTo(a.length-1,0,!1,!0)}else i=t.slideTo(t.activeIndex,0,!1,!0);i||s()}r.watchOverflow&&n!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,n=!0){const r=this,s=r.params.direction;return t||(t=s==="horizontal"?"vertical":"horizontal"),t===s||t!=="horizontal"&&t!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${s}`),r.el.classList.add(`${r.params.containerModifierClass}${t}`),r.emitContainerClasses(),r.params.direction=t,r.slides.forEach(i=>{t==="vertical"?i.style.width="":i.style.height=""}),r.emit("changeDirection"),n&&r.update()),r}changeLanguageDirection(t){const n=this;n.rtl&&t==="rtl"||!n.rtl&&t==="ltr"||(n.rtl=t==="rtl",n.rtlTranslate=n.params.direction==="horizontal"&&n.rtl,n.rtl?(n.el.classList.add(`${n.params.containerModifierClass}rtl`),n.el.dir="rtl"):(n.el.classList.remove(`${n.params.containerModifierClass}rtl`),n.el.dir="ltr"),n.update())}mount(t){const n=this;if(n.mounted)return!0;let r=t||n.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=n,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===n.params.swiperElementNodeName.toUpperCase()&&(n.isElement=!0);const s=()=>`.${(n.params.wrapperClass||"").trim().split(" ").join(".")}`;let a=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(s()):yc(r,s())[0];return!a&&n.params.createElements&&(a=bb("div",n.params.wrapperClass),r.append(a),yc(r,`.${n.params.slideClass}`).forEach(c=>{a.append(c)})),Object.assign(n,{el:r,wrapperEl:a,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:a,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||Wc(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||Wc(r,"direction")==="rtl"),wrongRTL:Wc(a,"display")==="-webkit-box"}),!0}init(t){const n=this;if(n.initialized||n.mount(t)===!1)return n;n.emit("beforeInit"),n.params.breakpoints&&n.setBreakpoint(),n.addClasses(),n.updateSize(),n.updateSlides(),n.params.watchOverflow&&n.checkOverflow(),n.params.grabCursor&&n.enabled&&n.setGrabCursor(),n.params.loop&&n.virtual&&n.params.virtual.enabled?n.slideTo(n.params.initialSlide+n.virtual.slidesBefore,0,n.params.runCallbacksOnInit,!1,!0):n.slideTo(n.params.initialSlide,0,n.params.runCallbacksOnInit,!1,!0),n.params.loop&&n.loopCreate(void 0,!0),n.attachEvents();const s=[...n.el.querySelectorAll('[loading="lazy"]')];return n.isElement&&s.push(...n.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach(i=>{i.complete?Jp(n,i):i.addEventListener("load",a=>{Jp(n,a.target)})}),yb(n),n.initialized=!0,yb(n),n.emit("init"),n.emit("afterInit"),n}destroy(t=!0,n=!0){const r=this,{params:s,el:i,wrapperEl:a,slides:c}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),s.loop&&r.loopDestroy(),n&&(r.removeClasses(),i&&typeof i!="string"&&i.removeAttribute("style"),a&&a.removeAttribute("style"),c&&c.length&&c.forEach(u=>{u.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),u.removeAttribute("style"),u.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(u=>{r.off(u)}),t!==!1&&(r.el&&typeof r.el!="string"&&(r.el.swiper=null),g_(r)),r.destroyed=!0),null}static extendDefaults(t){Ea(I1,t)}static get extendedDefaults(){return I1}static get defaults(){return vb}static installModule(t){gc.prototype.__modules__||(gc.prototype.__modules__=[]);const n=gc.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>gc.installModule(n)),gc):(gc.installModule(t),gc)}};Object.keys(E1).forEach(e=>{Object.keys(E1[e]).forEach(t=>{ey.prototype[t]=E1[e][t]})});ey.use([L_,E_]);const U7=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Wu(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function r0(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Wu(t[r])&&Wu(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:r0(e[r],t[r]):e[r]=t[r]})}function z7(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function G7(e={}){return e.pagination&&typeof e.pagination.el>"u"}function W7(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function V7(e=""){const t=e.split(" ").map(r=>r.trim()).filter(r=>!!r),n=[];return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n.join(" ")}function DL(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function jL({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:s,prevEl:i,scrollbarEl:a,paginationEl:c}){const u=r.filter($=>$!=="children"&&$!=="direction"&&$!=="wrapperClass"),{params:f,pagination:p,navigation:g,scrollbar:y,virtual:v,thumbs:S}=e;let A,T,L,I,j,P,F,R;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&!n.thumbs.swiper.destroyed&&f.thumbs&&(!f.thumbs.swiper||f.thumbs.swiper.destroyed)&&(A=!0),r.includes("controller")&&n.controller&&n.controller.control&&f.controller&&!f.controller.control&&(T=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||c)&&(f.pagination||f.pagination===!1)&&p&&!p.el&&(L=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||a)&&(f.scrollbar||f.scrollbar===!1)&&y&&!y.el&&(I=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||i)&&(n.navigation.nextEl||s)&&(f.navigation||f.navigation===!1)&&g&&!g.prevEl&&!g.nextEl&&(j=!0);const C=$=>{e[$]&&(e[$].destroy(),$==="navigation"?(e.isElement&&(e[$].prevEl.remove(),e[$].nextEl.remove()),f[$].prevEl=void 0,f[$].nextEl=void 0,e[$].prevEl=void 0,e[$].nextEl=void 0):(e.isElement&&e[$].el.remove(),f[$].el=void 0,e[$].el=void 0))};r.includes("loop")&&e.isElement&&(f.loop&&!n.loop?P=!0:!f.loop&&n.loop?F=!0:R=!0),u.forEach($=>{if(Wu(f[$])&&Wu(n[$]))Object.assign(f[$],n[$]),($==="navigation"||$==="pagination"||$==="scrollbar")&&"enabled"in n[$]&&!n[$].enabled&&C($);else{const H=n[$];(H===!0||H===!1)&&($==="navigation"||$==="pagination"||$==="scrollbar")?H===!1&&C($):f[$]=n[$]}}),u.includes("controller")&&!T&&e.controller&&e.controller.control&&f.controller&&f.controller.control&&(e.controller.control=f.controller.control),r.includes("children")&&t&&v&&f.virtual.enabled?(v.slides=t,v.update(!0)):r.includes("virtual")&&v&&f.virtual.enabled&&(t&&(v.slides=t),v.update(!0)),r.includes("children")&&t&&f.loop&&(R=!0),A&&S.init()&&S.update(!0),T&&(e.controller.control=f.controller.control),L&&(e.isElement&&(!c||typeof c=="string")&&(c=document.createElement("div"),c.classList.add("swiper-pagination"),c.part.add("pagination"),e.el.appendChild(c)),c&&(f.pagination.el=c),p.init(),p.render(),p.update()),I&&(e.isElement&&(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-scrollbar"),a.part.add("scrollbar"),e.el.appendChild(a)),a&&(f.scrollbar.el=a),y.init(),y.updateSize(),y.setTranslate()),j&&(e.isElement&&((!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-button-next"),Qv(s,e.navigation.arrowSvg),s.part.add("button-next"),e.el.appendChild(s)),(!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-prev"),Qv(i,e.navigation.arrowSvg),i.part.add("button-prev"),e.el.appendChild(i))),s&&(f.navigation.nextEl=s),i&&(f.navigation.prevEl=i),g.init(),g.update()),r.includes("allowSlideNext")&&(e.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(e.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&e.changeDirection(n.direction,!1),(P||R)&&e.loopDestroy(),(F||R)&&e.loopCreate(),e.update()}function PL(e={},t=!0){const n={on:{}},r={},s={};r0(n,vb),n._emitClasses=!0,n.init=!1;const i={},a=U7.map(u=>u.replace(/_/,"")),c=Object.assign({},e);return Object.keys(c).forEach(u=>{typeof e[u]>"u"||(a.indexOf(u)>=0?Wu(e[u])?(n[u]={},s[u]={},r0(n[u],e[u]),r0(s[u],e[u])):(n[u]=e[u],s[u]=e[u]):u.search(/on[A-Z]/)===0&&typeof e[u]=="function"?t?r[`${u[2].toLowerCase()}${u.substr(3)}`]=e[u]:n.on[`${u[2].toLowerCase()}${u.substr(3)}`]=e[u]:i[u]=e[u])}),["navigation","pagination","scrollbar"].forEach(u=>{n[u]===!0&&(n[u]={}),n[u]===!1&&delete n[u]}),{params:n,passedParams:s,rest:i,events:r}}function BL({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:s,swiper:i},a){z7(a)&&t&&n&&(i.params.navigation.nextEl=t,i.originalParams.navigation.nextEl=t,i.params.navigation.prevEl=n,i.originalParams.navigation.prevEl=n),G7(a)&&r&&(i.params.pagination.el=r,i.originalParams.pagination.el=r),W7(a)&&s&&(i.params.scrollbar.el=s,i.originalParams.scrollbar.el=s),i.init(e)}function FL(e,t,n,r,s){const i=[];if(!t)return i;const a=u=>{i.indexOf(u)<0&&i.push(u)};if(n&&r){const u=r.map(s),f=n.map(s);u.join("")!==f.join("")&&a("children"),r.length!==n.length&&a("children")}return U7.filter(u=>u[0]==="_").map(u=>u.replace(/_/,"")).forEach(u=>{if(u in e&&u in t)if(Wu(e[u])&&Wu(t[u])){const f=Object.keys(e[u]),p=Object.keys(t[u]);f.length!==p.length?a(u):(f.forEach(g=>{e[u][g]!==t[u][g]&&a(u)}),p.forEach(g=>{e[u][g]!==t[u][g]&&a(u)}))}else e[u]!==t[u]&&a(u)}),i}const OL=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function km(){return km=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},km.apply(this,arguments)}function q7(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function K7(e){const t=[];return D.Children.toArray(e).forEach(n=>{q7(n)?t.push(n):n.props&&n.props.children&&K7(n.props.children).forEach(r=>t.push(r))}),t}function QL(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return D.Children.toArray(e).forEach(r=>{if(q7(r))t.push(r);else if(r.props&&r.props.slot&&n[r.props.slot])n[r.props.slot].push(r);else if(r.props&&r.props.children){const s=K7(r.props.children);s.length>0?s.forEach(i=>t.push(i)):n["container-end"].push(r)}else n["container-end"].push(r)}),{slides:t,slots:n}}function $L(e,t,n){if(!n)return null;const r=p=>{let g=p;return p<0?g=t.length+p:g>=t.length&&(g=g-t.length),g},s=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:i,to:a}=n,c=e.params.loop?-t.length:0,u=e.params.loop?t.length*2:t.length,f=[];for(let p=c;p<u;p+=1)p>=i&&p<=a&&f.push(t[r(p)]);return f.map((p,g)=>D.cloneElement(p,{swiper:e,style:s,key:p.props.virtualIndex||p.key||`slide-${g}`}))}function jf(e,t){return typeof window>"u"?b.useEffect(e,t):b.useLayoutEffect(e,t)}const Gv=b.createContext(null),HL=b.createContext(null),ph=b.forwardRef(({className:e,tag:t="div",wrapperTag:n="div",children:r,onSwiper:s,...i}={},a)=>{let c=!1;const[u,f]=b.useState("swiper"),[p,g]=b.useState(null),[y,v]=b.useState(!1),S=b.useRef(!1),A=b.useRef(null),T=b.useRef(null),L=b.useRef(null),I=b.useRef(null),j=b.useRef(null),P=b.useRef(null),F=b.useRef(null),R=b.useRef(null),{params:C,passedParams:$,rest:H,events:K}=PL(i),{slides:W,slots:ue}=QL(r),Z=()=>{v(!y)};Object.assign(C.on,{_containerClasses(q,z){f(z)}});const ye=()=>{Object.assign(C.on,K),c=!0;const q={...C};if(delete q.wrapperClass,T.current=new ey(q),T.current.virtual&&T.current.params.virtual.enabled){T.current.virtual.slides=W;const z={cache:!1,slides:W,renderExternal:g,renderExternalUpdate:!1};r0(T.current.params.virtual,z),r0(T.current.originalParams.virtual,z)}};A.current||ye(),T.current&&T.current.on("_beforeBreakpoint",Z);const ve=()=>{c||!K||!T.current||Object.keys(K).forEach(q=>{T.current.on(q,K[q])})},Ae=()=>{!K||!T.current||Object.keys(K).forEach(q=>{T.current.off(q,K[q])})};b.useEffect(()=>()=>{T.current&&T.current.off("_beforeBreakpoint",Z)}),b.useEffect(()=>{!S.current&&T.current&&(T.current.emitSlidesClasses(),S.current=!0)}),jf(()=>{if(a&&(a.current=A.current),!!A.current)return T.current.destroyed&&ye(),BL({el:A.current,nextEl:j.current,prevEl:P.current,paginationEl:F.current,scrollbarEl:R.current,swiper:T.current},C),s&&!T.current.destroyed&&s(T.current),()=>{T.current&&!T.current.destroyed&&T.current.destroy(!0,!1)}},[]),jf(()=>{ve();const q=FL($,L.current,W,I.current,z=>z.key);return L.current=$,I.current=W,q.length&&T.current&&!T.current.destroyed&&jL({swiper:T.current,slides:W,passedParams:$,changedParams:q,nextEl:j.current,prevEl:P.current,scrollbarEl:R.current,paginationEl:F.current}),()=>{Ae()}}),jf(()=>{OL(T.current)},[p]);function oe(){return C.virtual?$L(T.current,W,p):W.map((q,z)=>D.cloneElement(q,{swiper:T.current,swiperSlideIndex:z}))}return D.createElement(t,km({ref:A,className:V7(`${u}${e?` ${e}`:""}`)},H),D.createElement(HL.Provider,{value:T.current},ue["container-start"],D.createElement(n,{className:DL(C.wrapperClass)},ue["wrapper-start"],oe(),ue["wrapper-end"]),z7(C)&&D.createElement(D.Fragment,null,D.createElement("div",{ref:P,className:"swiper-button-prev"}),D.createElement("div",{ref:j,className:"swiper-button-next"})),W7(C)&&D.createElement("div",{ref:R,className:"swiper-scrollbar"}),G7(C)&&D.createElement("div",{ref:F,className:"swiper-pagination"}),ue["container-end"]))});ph.displayName="Swiper";const Vu=b.forwardRef(({tag:e="div",children:t,className:n="",swiper:r,zoom:s,lazy:i,virtualIndex:a,swiperSlideIndex:c,...u}={},f)=>{const p=b.useRef(null),[g,y]=b.useState("swiper-slide"),[v,S]=b.useState(!1);function A(j,P,F){P===p.current&&y(F)}jf(()=>{if(typeof c<"u"&&(p.current.swiperSlideIndex=c),f&&(f.current=p.current),!(!p.current||!r)){if(r.destroyed){g!=="swiper-slide"&&y("swiper-slide");return}return r.on("_slideClass",A),()=>{r&&r.off("_slideClass",A)}}}),jf(()=>{r&&p.current&&!r.destroyed&&y(r.getSlideClasses(p.current))},[r]);const T={isActive:g.indexOf("swiper-slide-active")>=0,isVisible:g.indexOf("swiper-slide-visible")>=0,isFullyVisible:g.indexOf("swiper-slide-fully-visible")>=0,isPrev:g.indexOf("swiper-slide-prev")>=0,isNext:g.indexOf("swiper-slide-next")>=0},L=()=>typeof t=="function"?t(T):t,I=()=>{S(!0)};return D.createElement(e,km({ref:p,className:V7(`${g}${n?` ${n}`:""}`),"data-swiper-slide-index":a,onLoad:I},u),s&&D.createElement(Gv.Provider,{value:T},D.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof s=="number"?s:void 0},L(),i&&!v&&D.createElement("div",{className:"swiper-lazy-preloader",ref:j=>{j&&(j.lazyPreloaderManaged=!0)}}))),!s&&D.createElement(Gv.Provider,{value:T},L(),i&&!v&&D.createElement("div",{className:"swiper-lazy-preloader",ref:j=>{j&&(j.lazyPreloaderManaged=!0)}})))});Vu.displayName="SwiperSlide";const lo=[];for(let e=0;e<256;++e)lo.push((e+256).toString(16).slice(1));function UL(e,t=0){return(lo[e[t+0]]+lo[e[t+1]]+lo[e[t+2]]+lo[e[t+3]]+"-"+lo[e[t+4]]+lo[e[t+5]]+"-"+lo[e[t+6]]+lo[e[t+7]]+"-"+lo[e[t+8]]+lo[e[t+9]]+"-"+lo[e[t+10]]+lo[e[t+11]]+lo[e[t+12]]+lo[e[t+13]]+lo[e[t+14]]+lo[e[t+15]]).toLowerCase()}let R1;const zL=new Uint8Array(16);function GL(){if(!R1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");R1=crypto.getRandomValues.bind(crypto)}return R1(zL)}const WL=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wv={randomUUID:WL};function VL(e,t,n){e=e||{};const r=e.random??e.rng?.()??GL();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,UL(r)}function qL(e,t,n){return Wv.randomUUID&&!e?Wv.randomUUID():VL(e)}const KL={},Vv=e=>{let t;const n=new Set,r=(p,g)=>{const y=typeof p=="function"?p(t):p;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(S=>S(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(KL?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,u);return u},YL=e=>e?Vv(e):Vv;var N1={exports:{}},M1={},D1={exports:{}},j1={};var qv;function XL(){if(qv)return j1;qv=1;var e=hg();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function c(g,y){var v=y(),S=r({inst:{value:v,getSnapshot:y}}),A=S[0].inst,T=S[1];return i(function(){A.value=v,A.getSnapshot=y,u(A)&&T({inst:A})},[g,v,y]),s(function(){return u(A)&&T({inst:A}),g(function(){u(A)&&T({inst:A})})},[g]),a(v),v}function u(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function f(g,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return j1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,j1}var Kv;function ZL(){return Kv||(Kv=1,D1.exports=XL()),D1.exports}var Yv;function JL(){if(Yv)return M1;Yv=1;var e=hg(),t=ZL();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return M1.useSyncExternalStoreWithSelector=function(f,p,g,y,v){var S=i(null);if(S.current===null){var A={hasValue:!1,value:null};S.current=A}else A=S.current;S=c(function(){function L(R){if(!I){if(I=!0,j=R,R=y(R),v!==void 0&&A.hasValue){var C=A.value;if(v(C,R))return P=C}return P=R}if(C=P,r(j,R))return C;var $=y(R);return v!==void 0&&v(C,$)?(j=R,C):(j=R,P=$)}var I=!1,j,P,F=g===void 0?null:g;return[function(){return L(p())},F===null?void 0:function(){return L(F())}]},[p,g,y,v]);var T=s(f,S[0],S[1]);return a(function(){A.hasValue=!0,A.value=T},[T]),u(T),T},M1}var Xv;function eE(){return Xv||(Xv=1,N1.exports=JL()),N1.exports}var tE=eE();const nE=D7(tE),Y7={},{useDebugValue:rE}=D,{useSyncExternalStoreWithSelector:sE}=nE;let Zv=!1;const iE=e=>e;function oE(e,t=iE,n){(Y7?"production":void 0)!=="production"&&n&&!Zv&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Zv=!0);const r=sE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return rE(r),r}const Jv=e=>{(Y7?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?YL(e):e,n=(r,s)=>oE(t,r,s);return Object.assign(n,t),n},X7=e=>e?Jv(e):Jv,qf="auth:unauthorized";let Pu=null;class Ba extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r,this.name="TerminalApiError"}status;code}async function aE(){const e=await fetch("/api/terminal/update");if(!e.ok)throw new Ba("Failed to load update state",e.status);return e.json()}async function lE(){const e=await mr(),t=await fetch("/api/terminal/update/check",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Ba("Failed to check for updates",t.status);return t.json()}async function cE(){const e=await mr(),t=await fetch("/api/terminal/update/restart",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to restart Termdock"}));throw new Ba(n.error||"Failed to restart Termdock",t.status)}return t.json()}async function uE(){const e=await fetch("/api/terminal/quota");if(!e.ok)throw new Ba("Failed to fetch quota",e.status);return e.json()}async function dE(){const e=await mr(),t=await fetch("/api/terminal/quota/refresh",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Ba("Failed to refresh quota",t.status);return t.json()}const su=8e3,fE=32e3,tc=1e4,s0=45e3,hE=8e3,pE=8e3,mE=15e3,gE=1e4,f0=5e3;let xE=0;const em=[];let P1=!1;function Bc(e,t={}){if(typeof window>"u")return;const n=JSON.stringify({level:e==="error"||e==="timeout_or_abort"||e==="response_body_timeout"||e==="response_body_parse_error"?"warn":"info",message:`DIFF_API ${e}`,data:{seq:++xE,ts:Date.now(),...t}});em.push(n),bE()}async function bE(){if(!P1){P1=!0;try{for(;em.length>0;){const e=em[0];try{await fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}),em.shift()}catch{break}}}finally{P1=!1}}}function yE(e,t,n){const r=new AbortController;let s=setTimeout(()=>{r.abort(new DOMException(n,"TimeoutError"))},t);const i=()=>r.abort(e?.reason);return e&&(e.aborted?i():e.addEventListener("abort",i,{once:!0})),{signal:r.signal,cleanup:()=>{s&&(clearTimeout(s),s=null),e?.removeEventListener("abort",i)}}}async function Es(e,t,n,r){const{signal:s,cleanup:i}=yE(t?.signal??void 0,n,r);try{return await fetch(e,{...t,signal:s})}catch(a){throw a instanceof DOMException&&a.name==="TimeoutError"?new Error(r):a}finally{i()}}async function Z7(e,t,n){let r=null;const s=new Promise((i,a)=>{r=setTimeout(()=>a(new Error(n)),t)});try{return await Promise.race([e.text(),s])}finally{r&&clearTimeout(r)}}async function h0(e,t,n){const r=await Z7(e,t,n);return JSON.parse(r)}if(typeof window<"u"&&!window.__termdockFetchPatched){window.__termdockFetchPatched=!0;const e=window.fetch.bind(window);window.fetch=async(...t)=>{const n=await e(...t);if(n.status===401){Pu=null;try{window.dispatchEvent(new CustomEvent(qf))}catch{}}return n}}async function mr(){if(Pu)return Pu;const e=await Es("/api/csrf-token",void 0,hE,"CSRF token request timed out");if(!e.ok)throw new Error("Failed to get CSRF token");const t=await h0(e,f0,"CSRF token response timed out");if(!t.csrfToken)throw new Error("Invalid CSRF token response");return Pu=t.csrfToken,Pu}function J7(){Pu=null}const vE=2e4,e5=8e3,wE=1500,go=new Map,SE=24,AE=40,TE=40;function CE(e){return e.retryState.retryCount>=2||e.pendingInputs.length>=TE?"congested":e.retryState.retryCount>=1||e.pendingInputs.length>=8?"degraded":"good"}function t5(e){if(e.pendingInputs.length===0||e.ws.readyState!==WebSocket.OPEN)return;const t=e.pendingInputs.splice(0);for(const n of t)try{e.ws.send(JSON.stringify({type:"input",data:n}))}catch{}}function e8(e){if(e.ws.readyState!==WebSocket.OPEN)return;const t=CE(e);if(t==="good"){t5(e);return}if(e.inputFlushTimer)return;const n=t==="congested"?AE:SE;e.inputFlushTimer=setTimeout(()=>{e.inputFlushTimer=null,t5(e)},n)}const Pf=new Map;function kE(e,t,n,r){const s=Pf.get(e);s&&(Pf.delete(e),t?s.resolve({success:!0,layout:n}):s.reject(new Error(r||"Tmux action failed")))}function _E(e,t){const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/api/terminal/${e}/ws`;return t>0?`${r}?since=${t}`:r}const n5=new Map;async function LE(e){const t=await mr(),n=await fetch("/api/terminal/create",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({cols:e.cols||80,rows:e.rows||24,mode:e.mode||"shell",tmuxSessionName:e.tmuxSessionName,cwd:e.cwd,termType:e.termType})});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to create terminal"}));throw new Error(r.error||"Failed to create terminal session")}return n.json()}function EE(e,t,n,r={}){const{maxRetries:s=10,initialRetryDelay:i=1e3,maxRetryDelay:a=2e4,connectionTimeout:c=15e3}=r,u={maxRetries:s,initialDelayMs:i,maxDelayMs:a,connectionTimeoutMs:c,retryCount:0,retryTimeout:null,connectionTimeoutId:null,isClosed:!1,isSuspended:!1};let f=null,p=n5.get(e)??0;n5.delete(e);const g=[];let y=!1,v=null;const S=new WeakSet,A=()=>{u.retryTimeout&&(clearTimeout(u.retryTimeout),u.retryTimeout=null),u.connectionTimeoutId&&(clearTimeout(u.connectionTimeoutId),u.connectionTimeoutId=null),v&&(clearTimeout(v),v=null)},T=F=>{F.heartbeatTimer&&(clearInterval(F.heartbeatTimer),F.heartbeatTimer=null),F.pongTimer&&(clearTimeout(F.pongTimer),F.pongTimer=null),F.inputFlushTimer&&(clearTimeout(F.inputFlushTimer),F.inputFlushTimer=null)},L=F=>{T(F),F.heartbeatTimer=setInterval(()=>{if(F.ws.readyState===WebSocket.OPEN){try{F.ws.send(JSON.stringify({type:"ping"}))}catch{}F.pongTimer&&clearTimeout(F.pongTimer),F.pongTimer=setTimeout(()=>{if(Date.now()-F.lastInboundAt>=e5)try{F.ws.close()}catch{}},e5)}},vE)},I=()=>{if(u.isClosed=!0,A(),f){T(f),go.delete(e);try{f.ws.close()}catch{}f=null}},j=()=>{if(u.isClosed)return;if(f){S.add(f.ws),T(f);try{f.ws.close()}catch{}}const F=_E(e,p),R=new WebSocket(F);y=!1,u.connectionTimeoutId=setTimeout(()=>{R.readyState!==WebSocket.OPEN&&(y=!0,R.close(),P(new Error("WebSocket connection timeout"),!1))},c);const C={ws:R,onEvent:t,onError:n,reconnectNow:()=>{if(!u.isClosed&&(u.isSuspended=!1,!v)){if(A(),f){S.add(f.ws),T(f);try{f.ws.close()}catch{}}t({type:"reconnecting",attempt:Math.min(u.retryCount+1,s),maxAttempts:s}),u.retryCount=Math.min(u.retryCount+1,s),y=!0,v=setTimeout(()=>{v=null,y=!1,j()},0)}},suspendReconnect:()=>{u.isClosed||(u.isSuspended=!0,u.retryTimeout&&(clearTimeout(u.retryTimeout),u.retryTimeout=null))},retryState:u,lastSeq:p,pendingInputs:g,inputFlushTimer:null,heartbeatTimer:null,pongTimer:null,lastInboundAt:Date.now(),inboundSequence:0};R.onopen=()=>{A(),u.retryCount=0,C.lastInboundAt=Date.now(),C.inboundSequence+=1,L(C),e8(C)},R.onmessage=$=>{C.lastInboundAt=Date.now(),C.inboundSequence+=1;try{const H=JSON.parse($.data);if(H.type==="pong"){C.pongTimer&&(clearTimeout(C.pongTimer),C.pongTimer=null);return}if(H.type==="tmux-result"&&H.reqId){kE(H.reqId,H.success!==!1,H.layout,H.error);return}if(H.type==="tmux-layout"&&H.layout){t({type:"tmux-layout",layout:H.layout});return}if(H.type==="tmux-screen-sync"&&Array.isArray(H.chunks)){t({type:"tmux-screen-sync",chunks:H.chunks.filter(W=>typeof W=="string"),cols:typeof H.cols=="number"?H.cols:void 0,rows:typeof H.rows=="number"?H.rows:void 0,generation:typeof H.generation=="number"?H.generation:void 0});return}if(H.type==="active-program"){t({type:"active-program",activeProgram:H.activeProgram,activeProgramRaw:H.activeProgramRaw,activeProgramSource:H.activeProgramSource});return}if(H.type==="cwd"){t({type:"cwd",cwd:H.cwd});return}if(H.type==="agent-status"){t({type:"agent-status",agentStatus:H.agentStatus??null,agentIndicator:H.agentIndicator??null,agentStatusDetail:H.agentStatusDetail??null,agent:H.agent??null,agentMessage:H.agentMessage??null,agentNativeSessionId:H.agentNativeSessionId??null,agentResumeRecovered:H.agentResumeRecovered===!0,agentRich:H.agentRich===!0,agentActivity:typeof H.agentActivity=="number"?H.agentActivity:0,agentCwd:H.agentCwd??null,reviewed:typeof H.reviewed=="boolean"?H.reviewed:null});return}if(H.type==="git-status"){t({type:"git-status",gitStatus:H.gitStatus??null});return}if(H.type==="quota-status"&&Array.isArray(H.providers)){window.dispatchEvent(new CustomEvent("termdock:quota-update",{detail:H.providers}));return}if(H.type==="focus-mode"){t({type:"focus-mode",focusTrackingRequested:H.focusTrackingRequested===!0});return}if(H.type==="resize-ack"){t({type:"resize-ack",seq:typeof H.seq=="number"?H.seq:void 0,cols:typeof H.cols=="number"?H.cols:void 0,rows:typeof H.rows=="number"?H.rows:void 0,ok:H.ok!==!1,error:typeof H.error=="string"?H.error:void 0});return}if(H.type==="pty-size"){t({type:"pty-size",cols:typeof H.cols=="number"?H.cols:void 0,rows:typeof H.rows=="number"?H.rows:void 0,source:typeof H.source=="string"?H.source:void 0});return}if(H.type==="shell-title"){t({type:"shell-title",title:typeof H.title=="string"?H.title:""});return}if(H.type==="prompt-state"){t({type:"prompt-state",state:H.state==="running"?"running":"idle",exitCode:typeof H.exitCode=="number"?H.exitCode:void 0});return}const K=H;if(K.type==="connected"){typeof K.replayLastSeq=="number"&&K.replayLastSeq>0&&(p=K.replayLastSeq,C.lastSeq=p),t(K);return}if(K.type==="exit"){I(),t(K);return}t(K),K.type==="data"&&typeof K.seq=="number"&&Number.isFinite(K.seq)&&K.seq>p&&(p=K.seq,C.lastSeq=p)}catch(H){n?.(H,!1)}},R.onerror=()=>{S.has(R)||(A(),T(C),y||(y=!0,P(new Error("WebSocket connection error"),!1)))},R.onclose=$=>{if(!S.has(R)&&(A(),T(C),!u.isClosed&&!y)){if(y=!0,$.code===4001){console.warn("[Terminal] WS 4001: Session not found on server",{code:$.code,reason:$.reason,stack:new Error().stack}),P(new Error("Session not found on server"),!0);return}if($.code===4003||$.code===4401){try{window.dispatchEvent(new CustomEvent(qf))}catch{}P(new Error("Authentication required"),!0);return}P(new Error("WebSocket connection closed"),!1)}},f=C,go.set(e,f)},P=(F,R)=>{if(!u.isClosed)if(R)n?.(F,!0),I();else{u.retryCount=Math.min(u.retryCount+1,Math.max(1,s));const C=Math.min(i*Math.pow(2,u.retryCount-1),a);if(t({type:"reconnecting",attempt:u.retryCount,maxAttempts:s}),u.isSuspended)return;u.retryTimeout=setTimeout(()=>{u.isClosed||j()},C)}};return j(),I}async function t8(e,t){const n=go.get(e);if(n){if(n.ws.readyState===WebSocket.OPEN){n.pendingInputs.push(t),e8(n);return}if(n.ws.readyState===WebSocket.CONNECTING){n.pendingInputs.push(t);return}}const r=await mr(),s=await fetch(`/api/terminal/${e}/input`,{method:"POST",headers:{"Content-Type":"text/plain","X-XSRF-TOKEN":r},body:t});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to send input"}));throw new Error(i.error||"Failed to send terminal input")}}function IE(e,t){const n=go.get(e);if(!n)return!1;if(n.retryState.isSuspended=!1,n.ws.readyState!==WebSocket.OPEN)return n.reconnectNow(),!0;const r=n.inboundSequence;try{n.ws.send(JSON.stringify({type:"ping"}))}catch{}return setTimeout(()=>{go.get(e)!==n||n.retryState.isClosed||(n.inboundSequence<=r?n.reconnectNow():t?.())},wE),!0}function RE(e){const t=go.get(e);return t?(t.reconnectNow(),!0):!1}function r5(){for(const e of go.values())e.suspendReconnect()}function s5(e,t,n){const r=go.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"focus",focused:t,reason:n}))}catch{}}function i5(e,t,n){const r=go.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"viewing",viewing:t,reason:n}))}catch{}}function o5(e){const t=go.get(e);if(!(!t||t.ws.readyState!==WebSocket.OPEN))try{t.ws.send(JSON.stringify({type:"agent-review-ack"}))}catch{}}function a5(e,t,n){const r=go.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"flow-control",paused:t,reason:n}))}catch{}}async function NE(e,t,n,r){const s=go.get(e);if(s&&s.ws.readyState===WebSocket.OPEN)try{s.ws.send(JSON.stringify({type:"resize",cols:t,rows:n,seq:r}));return}catch{}const i=await mr(),a=await fetch(`/api/terminal/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":i},body:JSON.stringify({cols:t,rows:n,seq:r})});if(!a.ok){const u=await a.json().catch(()=>({error:"Failed to resize terminal"}));throw new Error(u.error||"Failed to resize terminal")}const c=await a.json().catch(()=>({success:!0}));if(c?.success===!1||c?.ok===!1)throw new Error(c?.error||"Failed to resize terminal")}async function ME(e,t){const n=go.get(e);if(n&&n.ws.readyState===WebSocket.OPEN)return t.action==="scroll"?(n.ws.send(JSON.stringify({type:"tmux",...t})),{success:!0}):new Promise((i,a)=>{const c=Math.random().toString(36).substring(7);Pf.set(c,{resolve:i,reject:a}),n.ws.send(JSON.stringify({type:"tmux",reqId:c,...t})),setTimeout(()=>{Pf.has(c)&&(Pf.delete(c),a(new Error("Tmux action timed out")))},3e4)});const r=await mr(),s=await fetch(`/api/terminal/${e}/tmux`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify(t)});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to execute tmux action"}));throw new Error(i.error||"Failed to execute tmux action")}return s.json()}async function n8(e){const t=go.get(e);if(t){t.retryState.isClosed=!0;try{t.ws.close()}catch{}go.delete(e)}const n=await mr(),r=await fetch(`/api/terminal/${e}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":n}});if(r.status!==404&&!r.ok){const s=await r.json().catch(()=>({error:"Failed to close terminal"}));throw new Error(s.error||"Failed to close terminal")}}async function DE(e,t){const n=go.get(e);if(n){n.retryState.isClosed=!0;try{n.ws.close()}catch{}go.delete(e)}const r=await mr(),s=await fetch(`/api/terminal/${e}/restart`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify({...t.cwd?{cwd:t.cwd}:{},cols:t.cols??80,rows:t.rows??24,mode:t.mode,tmuxSessionName:t.tmuxSessionName})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to restart terminal"}));throw new Error(i.error||"Failed to restart terminal session")}return s.json()}async function jE(e){const t=await Es(`/api/terminal/${e}/health`,{method:"GET"},pE,"Terminal health check timed out");if(!t.ok){if(t.status===404)return{healthy:!1,sessionId:e};const n=await h0(t,f0,"Terminal health error response timed out").catch(()=>({error:"Failed to check terminal health"}));throw new Error(n.error||"Failed to check terminal health")}return h0(t,f0,"Terminal health response timed out")}async function PE(e){const t=await mr(),n=await Es("/api/terminal/force-kill",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)},gE,"Terminal force-kill request timed out");if(!n.ok){const r=await h0(n,f0,"Terminal force-kill error response timed out").catch(()=>({error:"Failed to force kill terminal"}));throw new Error(r.error||"Failed to force kill terminal")}}async function wb(){const e=await fetch("/api/terminal/tmux/sessions",{method:"GET"});if(!e.ok){const n=await e.json().catch(()=>({error:"Failed to list tmux sessions"}));throw new Error(n.error||"Failed to list tmux sessions")}const t=await e.json();return Array.isArray(t.sessions)?t.sessions:[]}async function Sb(){const e=await fetch("/api/terminal/tmux/status",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to get tmux status"}));throw new Error(t.error||"Failed to get tmux status")}return e.json()}async function r8(e){const t=e.trim();if(!t)throw new Error("tmux session name is required");const n=await mr(),r=await fetch(`/api/terminal/tmux/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":n}});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to kill tmux session"}));throw new Error(i.error||"Failed to kill tmux session")}const s=await r.json();return{cleanedSessions:Array.isArray(s.cleanedSessions)?s.cleanedSessions:[],alreadyGone:!!s.alreadyGone}}async function BE(){const e=await mr(),t=await fetch("/api/terminal/tmux/recovery/restore-all",{method:"POST",headers:{"X-XSRF-TOKEN":e}}),n=await t.json().catch(()=>({}));if(!t.ok)throw new Ba(n.error||"Failed to restore tmux Agent sessions",t.status);return n}async function FE(){const e=await mr(),t=await fetch("/api/terminal/tmux/recovery",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Ba("Failed to dismiss tmux recovery",t.status)}const cp=new Map;function OE(e){return JSON.stringify({preferredFrontendSessionId:e.preferredFrontendSessionId??null,mode:e.mode??null,tmuxSessionName:e.tmuxSessionName??null,cwd:e.cwd??null,termType:e.termType??null,createIfEmpty:e.createIfEmpty===!0,requireExisting:e.requireExisting===!0})}async function QE(){const e=await fetch("/api/terminal/session-inventory",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load session inventory"}));throw new Error(t.error||"Failed to load session inventory")}return e.json()}async function s8(e){const t=OE(e),n=cp.get(t);if(n)return n;const r=await mr(),s=Es("/api/terminal/session-inventory/open",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify(e)},mE,"Terminal session open request timed out").then(async i=>{if(!i.ok){const a=await h0(i,f0,"Terminal session open error response timed out").catch(()=>({error:"Failed to open session"}));throw new Ba(a.error||"Failed to open session",i.status,typeof a.code=="string"?a.code:void 0)}return h0(i,f0,"Terminal session open response timed out")}).finally(()=>{cp.get(t)===s&&cp.delete(t)});return cp.set(t,s),s}async function tm(e,t){const n=await mr(),r=await fetch(`/api/terminal/session-inventory/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":n},body:JSON.stringify(t)});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to update session"}));throw new Error(s.error||"Failed to update session")}return r.json()}async function $E(e){const t=await mr(),n=await fetch("/api/terminal/session-inventory/reorder",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({sessionIds:e})});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to reorder sessions"}));throw new Error(r.error||"Failed to reorder sessions")}return n.json()}async function HE(e){const t=await mr(),n=await fetch(`/api/terminal/session-inventory/sessions/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to remove session"}));throw new Error(r.error||"Failed to remove session")}}async function UE(){const e=await mr(),t=await fetch("/api/terminal/session-inventory/sessions",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to clear sessions"}));throw new Error(n.error||"Failed to clear sessions")}}async function l5(){const e=await fetch("/api/terminal/toolbar-presets",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load toolbar presets"}));throw new Error(t.error||"Failed to load toolbar presets")}return e.json()}async function zE(e){const t=await mr(),n=await fetch("/api/terminal/toolbar-presets",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to save toolbar presets"})),s=new Error(r.error||"Failed to save toolbar presets");throw s.current=r.current,s.code=r.code,s}return n.json()}async function mh(){const e=await fetch("/api/terminal/settings",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load settings"}));throw new Error(t.error||"Failed to load settings")}return e.json()}async function ha(e){const t=await mr(),n=await fetch("/api/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to update settings"}));throw new Error(r.error||"Failed to update settings")}return n.json()}async function V0(e=!1){const t=await fetch(`/api/terminal/auto-title/catalog${e?"?refresh=1":""}`);if(!t.ok)throw new Error("Failed to discover title models");const n=await t.json();return Array.isArray(n?.namers)?n.namers:[]}async function GE(){const e=await fetch("/api/terminal/context-draft",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load context draft"}));throw new Error(t.error||"Failed to load context draft")}return e.json()}async function WE(e,t){const n=await mr(),r=await fetch("/api/terminal/context-draft",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":n},body:JSON.stringify({text:e,origin:t})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to update context draft"}));throw new Error(s.error||"Failed to update context draft")}return r.json()}async function VE(){const e=await fetch("/api/auth/status");if(!e.ok)throw new Error("Failed to query auth status");return e.json()}async function qE(e){const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok)return J7(),{ok:!0};const n=await t.json().catch(()=>null);return t.status===429?{ok:!1,rateLimited:!0,retryAfterMs:typeof n?.retryAfterMs=="number"?n.retryAfterMs:void 0,error:n?.error||"Too many failed attempts. Please wait and try again."}:{ok:!1,error:n?.error||"Login failed"}}async function KE(){const e=await mr();await fetch("/api/auth/logout",{method:"POST",headers:{"X-XSRF-TOKEN":e}}),J7()}async function i8(){const e=await fetch("/api/terminal/agent-launchers");if(!e.ok)throw new Error("Failed to detect agent launchers");const t=await e.json();return Array.isArray(t?.agents)?t.agents:[]}async function YE(){const e=await fetch("/api/terminal/agent-hooks");if(!e.ok)throw new Error("Failed to get agent hooks");const t=await e.json();return Array.isArray(t?.agents)?t.agents:[]}async function XE(e){const t=await mr(),n=await fetch(`/api/terminal/agent-hooks/${encodeURIComponent(e)}/install`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to install agent hooks");return{summary:r.summary??"Installed",devMode:r.devMode===!0}}async function ZE(e){const t=await mr(),n=await fetch(`/api/terminal/agent-hooks/${encodeURIComponent(e)}/uninstall`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to uninstall agent hooks");return r.summary??"Removed"}class ty extends Error{constructor(t,n,r){super(t),this.code=n,this.migration=r,this.name="AgentPluginManifestError"}code;migration}async function JE(){const e=await fetch("/api/terminal/agent-plugins");if(!e.ok)throw new Error("Failed to get agent plugins");return await e.json()}async function eI(e){const t=await mr(),n=await fetch("/api/terminal/agent-plugins",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)}),r=await n.json().catch(()=>({}));if(!n.ok)throw new ty(r.error||"Failed to create agent plugin",r.code,r.migration);return r}async function tI(e){const t=await mr(),n=await fetch("/api/terminal/agent-plugins/install",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({source:e})}),r=await n.json().catch(()=>({}));if(!n.ok)throw new ty(r.error||"Failed to install agent plugin",r.code,r.migration);return r}async function nI(e){const t=await mr(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/check-update`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to check plugin updates");return r}async function rI(e){const t=await mr(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/update`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to update plugin");return r}async function sI(e){const t=await mr(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/doctor`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to diagnose plugin");return r}async function iI(e){const t=await mr(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to delete agent plugin")}}async function oI(e){const t=await mr(),n=await fetch(`/api/terminal/${encodeURIComponent(e)}/agent-resume`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Ba(r.error||"Failed to resume agent session",n.status,typeof r.code=="string"?r.code:void 0);return{command:r.command??""}}async function c5(){const e=await fetch("/api/terminal/agent-resume-history",{method:"GET"});if(!e.ok)throw new Error("Failed to load Agent resume history");const t=await e.json().catch(()=>({entries:[]}));return Array.isArray(t.entries)?t.entries:[]}async function o8(e){const t=await mr(),n=await fetch(`/api/terminal/agent-resume-history/${encodeURIComponent(e)}/prepare`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Ba(r.error||"Failed to prepare Agent session resume",n.status,typeof r.code=="string"?r.code:void 0);return r}async function aI(e){const t=await mr(),n=await fetch(`/api/terminal/agent-resume-history/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok&&n.status!==404)throw new Error("Failed to remove Agent resume history")}async function Ld(e){const t=await mr(),n=await fetch("/api/terminal/program-rules",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to update program rules"}));throw new Error(r.error||"Failed to update program rules")}return n.json()}async function lI(){const e=await mr(),t=await fetch("/api/terminal/program-rules",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Error("Failed to reset program rules");return t.json()}async function cI(){const e=await fetch("/api/terminal/program-detection");if(!e.ok)throw new Error("Failed to get program detection config");return e.json()}async function u5(e){const t=await mr(),n=await fetch("/api/terminal/program-detection",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to save program detection config");return n.json()}async function uI(){const e=await mr(),t=await fetch("/api/terminal/program-detection",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Error("Failed to reset program detection config");return t.json()}const dI={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".bmp":"image/bmp",".ico":"image/x-icon",".svg":"image/svg+xml",".heic":"image/heic",".heif":"image/heif"};function ny(e){const t=e.lastIndexOf(".");return t<0?null:dI[e.slice(t).toLowerCase()]??null}function ry(e){return ny(e)!==null}function a8(e){const t=ny(e);return t==="image/heic"||t==="image/heif"}const fI={".mp4":"video/mp4",".m4v":"video/x-m4v",".webm":"video/webm",".mov":"video/quicktime",".ogv":"video/ogg",".mpeg":"video/mpeg",".mpg":"video/mpeg"};function l8(e){const t=e.lastIndexOf(".");return t<0?null:fI[e.slice(t).toLowerCase()]??null}function c8(e){return l8(e)!==null}function hI(e){return`/api/terminal/fs/video?path=${encodeURIComponent(e)}&action=view_file`}const pI=[".stl",".glb",".gltf"];function u8(e){const t=e.lastIndexOf(".");if(t<0)return null;const n=e.slice(t).toLowerCase();return pI.includes(n)?n:null}function d8(e){return u8(e)!==null}function f8(e){const t=e.toLowerCase();return t.endsWith(".kicad_sch")?".kicad_sch":t.endsWith(".kicad_pcb")?".kicad_pcb":null}function mI(e){return f8(e)!==null}function gI(e){return f8(e)===".kicad_pcb"?"pcb-front":"schematic"}const xI=[".html",".htm"];function q0(e){const t=e.lastIndexOf(".");if(t<0)return!1;const n=e.slice(t).toLowerCase();return xI.includes(n)}function bI(e){return`/api/terminal/fs/preview/${e.split(/[\\/]+/).filter(Boolean).map(n=>encodeURIComponent(n)).join("/")}`}const yI={".stl":"model/stl",".glb":"model/gltf-binary",".gltf":"model/gltf+json"};async function h8(e,t,n,r="list_directory",s,i="name"){const a=new URLSearchParams({path:e});n&&a.set("showHidden","true"),i!=="name"&&a.set("sort",i),a.set("action",r),s&&a.set("requestSlotId",s);const c=await Es(`/api/terminal/fs/list?${a}`,{signal:t},su,"Directory listing took too long. The folder may be on slow storage or blocked by another process.");if(!c.ok){const u=await c.json().catch(()=>({error:"Failed to list directory"}));throw new Error(u.error||"Failed to list directory")}return c.json()}async function vI(e,t,n,r,s,i="name",a){const c=new URLSearchParams({path:e,query:t,stream:"true"});s&&c.set("showHidden","true"),i==="content"&&c.set("mode","content"),a&&c.set("requestSlotId",a);const u=await fetch(`/api/terminal/fs/search?${c}`,{signal:r});if(!u.ok||!u.body){const v=await u.json().catch(()=>({error:"Failed to search files"}));throw new Error(v.error||"Failed to search files")}const f=u.body.getReader(),p=new TextDecoder;let g="";const y=v=>{if(!v.trim())return;const S=JSON.parse(v);if(S.type==="meta")n({path:S.path,query:S.query,engine:S.engine,mode:S.mode,limited:S.limited});else if(S.type==="batch")n({entries:S.entries??[]});else if(S.type==="content-batch")n({contentEntries:S.contentEntries??[]});else{if(S.type==="error")throw new Error(S.message||"Search failed");S.type==="done"&&n({total:S.total,truncated:S.truncated,limited:S.limited,engine:S.engine,mode:S.mode,done:!0})}};for(;;){const{value:v,done:S}=await f.read();if(S)break;g+=p.decode(v,{stream:!0});let A=g.indexOf(`
|
|
3
3
|
`);for(;A>=0;)y(g.slice(0,A)),g=g.slice(A+1),A=g.indexOf(`
|
|
4
4
|
`)}g+=p.decode(),y(g)}async function wI(e,t,n){const r=new URLSearchParams;r.set("roots",e.join("|"));const s=await fetch(`/api/terminal/fs/watch?${r}`,{signal:n});if(!s.ok||!s.body){const p=await s.json().catch(()=>({error:"Failed to watch files"}));throw new Error(p.error||"Failed to watch files")}const i=s.body.getReader(),a=new TextDecoder;let c="",u=null;const f=p=>{if(!p.trim())return;const g=JSON.parse(p);if(g.type==="events"&&g.events?.length){t(g.events);const y=g.events.find(v=>v.type==="rescan-required"&&v.reason!=="event-storm"&&v.reason!=="reconnected");y?.reason&&(u=y.reason)}};for(;;){const{value:p,done:g}=await i.read();if(g)break;c+=a.decode(p,{stream:!0});let y=c.indexOf(`
|
|
@@ -178,12 +178,12 @@ ${z.desc}`:""}`,"aria-pressed":T===z.key,onPointerEnter:()=>A(z.key),onPointerLe
|
|
|
178
178
|
|
|
179
179
|
`;return`${e}${r}${n}`}function _J(e,t){const n=e.trim();return n?t?`${n}\r`:/\s$/.test(e)?e:`${n} `:""}const B2="termdock:right-sidebar:html-view-mode-by-file:v1";function LJ(e){return e==="preview"||e==="source"}function MT(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(LJ)}function DT(e,t){if(!t)return null;const n=e&&!t.startsWith("/")?`${e}/${t}`:t;return e?`${e}::${n}`:n}function j4(e,t){const n=DT(e,t);return n?Fr(B2,MT)?.[n]??"source":"source"}function EJ(e,t,n){const r=DT(e,t);if(!r)return;const s=Fr(B2,MT)??{};zn(B2,{...s,[r]:n})}function Zx(e){const t=Number.isFinite(e)&&e>0?Math.floor(e):0,n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,i=String(r).padStart(2,"0"),a=String(s).padStart(2,"0");return n>0?`${n}:${i}:${a}`:`${i}:${a}`}function IJ(e,t,n){return!Number.isFinite(n)||n<=0||!t.width?0:Math.min(1,Math.max(0,(e-t.left)/t.width))*n}const RJ=350,NJ=12,MJ=90;function DJ({url:e,onLoadError:t}){const{t:n}=Zn(),r=b.useRef(null),s=b.useRef(null),i=b.useRef(null),a=b.useRef(null),c=b.useRef(!1),u=b.useRef(null),f=b.useRef(null),p=b.useRef(0),g=b.useRef(!1),y=b.useRef(!1),v=b.useRef(!1),S=b.useRef(null),A=b.useRef(null),T=b.useRef(!1),L=b.useRef(1),I=b.useRef(!1),[j,P]=b.useState(0),[F,R]=b.useState(0),[C,$]=b.useState(!1),[H,K]=b.useState(!1),[W,ue]=b.useState(null),[Z,ye]=b.useState(!1),[ve,Ae]=b.useState(0),[oe,q]=b.useState(!1),[z,ne]=b.useState({width:0,height:0}),pe=b.useCallback(()=>{S.current!==null&&(clearTimeout(S.current),S.current=null)},[]),de=b.useCallback(()=>{if(pe(),A.current=null,!T.current)return!1;const Te=i.current;return Te&&(Te.playbackRate=L.current),T.current=!1,ye(!1),!0},[pe]);b.useEffect(()=>()=>{u.current!==null&&cancelAnimationFrame(u.current),f.current!==null&&clearTimeout(f.current),pe();const Te=i.current;Te&&T.current&&(Te.playbackRate=L.current)},[pe]),b.useEffect(()=>{const Te=s.current;if(!Te||typeof ResizeObserver>"u")return;const He=new ResizeObserver(([lt])=>{lt&&ne({width:lt.contentRect.width,height:lt.contentRect.height})});return He.observe(Te),()=>He.disconnect()},[]),b.useEffect(()=>{const Te=()=>q(document.fullscreenElement===r.current);return document.addEventListener("fullscreenchange",Te),()=>document.removeEventListener("fullscreenchange",Te)},[]);const Le=b.useCallback((Te,He=!1)=>{const lt=i.current;if(!lt)return!1;const St=Number.isFinite(lt.duration)?lt.duration:Te,pt=Math.min(Math.max(Te,0),St);if(R(pt),Math.abs(lt.currentTime-pt)<1/120)return!1;const Jt=lt.fastSeek;return He&&typeof Jt=="function"?Jt.call(lt,pt):lt.currentTime=pt,!0},[]),xe=b.useCallback(()=>{u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null;const Te=i.current;if(!Te||!g.current||y.current||Te.seeking)return;const He=v.current;v.current=!1,y.current=Le(p.current,!He)}))},[Le]),ae=b.useCallback(Te=>{const He=a.current,lt=i.current;if(!He||!lt)return;const St=He.getBoundingClientRect(),pt=IJ(Te,St,lt.duration);p.current=pt,ue(pt),v.current=!1,xe(),f.current!==null&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,v.current=!0,xe()},MJ)},[xe]),fe=b.useCallback(()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),f.current!==null&&(clearTimeout(f.current),f.current=null),v.current=!1,y.current=!1,Le(p.current)},[Le]),X=b.useCallback(Te=>{const He=i.current;if(!(!He||!Number.isFinite(He.duration)||He.duration<=0)){c.current=!He.paused,He.pause(),g.current=!0,K(!0);try{Te.currentTarget.setPointerCapture(Te.pointerId)}catch{}ae(Te.clientX)}},[ae]),Ye=b.useCallback(()=>{g.current=!1,fe(),K(!1),ue(null);const Te=i.current;Te&&c.current&&!Te.ended&&Te.play().catch(()=>{}),c.current=!1},[fe]),st=b.useCallback(()=>{const Te=i.current;if(Te){if(I.current){I.current=!1;return}Te.paused?Te.play().catch(()=>{}):Te.pause()}},[]),Ze=b.useCallback(Te=>{const He=i.current;!He||He.paused||Te.button!==0||(pe(),A.current={id:Te.pointerId,x:Te.clientX,y:Te.clientY},S.current=setTimeout(()=>{S.current=null,L.current=He.playbackRate,He.playbackRate=2,T.current=!0,ye(!0)},RJ))},[pe]),me=b.useCallback(Te=>{const He=A.current;!He||He.id!==Te.pointerId||T.current||Math.hypot(Te.clientX-He.x,Te.clientY-He.y)>NJ&&(pe(),A.current=null)},[pe]),Qe=b.useCallback(()=>{de()&&(I.current=!0)},[de]);b.useEffect(()=>(window.addEventListener("pointerup",Qe),window.addEventListener("pointercancel",Qe),window.addEventListener("blur",Qe),()=>{window.removeEventListener("pointerup",Qe),window.removeEventListener("pointercancel",Qe),window.removeEventListener("blur",Qe)}),[Qe]);const Ce=b.useCallback(async()=>{const Te=r.current,He=i.current;if(!(!Te||!He))try{document.fullscreenElement===Te?await document.exitFullscreen():Te.requestFullscreen?await Te.requestFullscreen():He.webkitEnterFullscreen?.()}catch{He.webkitEnterFullscreen?.()}},[]),qe=b.useCallback(()=>Ae(Te=>(Te+90)%360),[]),Oe=b.useCallback(Te=>{const He=i.current;if(!He||!Number.isFinite(He.duration))return;const lt=Te.shiftKey?10:5;let St=null;Te.key==="ArrowLeft"?St=He.currentTime-lt:Te.key==="ArrowRight"?St=He.currentTime+lt:Te.key==="Home"?St=0:Te.key==="End"&&(St=He.duration),St!==null&&(Te.preventDefault(),Le(St))},[Le]),Ke=H&&W!==null?W:F,V=j>0?Math.min(1,Math.max(0,Ke/j)):0,Ge=(ve===90||ve===270)&&z.width>0&&z.height>0?{width:`${z.height}px`,height:`${z.width}px`}:{width:"100%",height:"100%"};return o.jsxs("div",{ref:r,className:"flex h-full min-h-0 flex-col overflow-hidden rounded-lg bg-background fullscreen:h-screen fullscreen:w-screen fullscreen:rounded-none","data-testid":"file-preview-video-player","data-rotation":ve,children:[o.jsxs("div",{ref:s,className:"relative min-h-0 flex-1 overflow-hidden bg-background",children:[o.jsx("video",{ref:i,"data-testid":"file-preview-video",className:"absolute left-1/2 top-1/2 max-w-none object-contain transition-transform duration-200",style:{...Ge,transform:`translate(-50%, -50%) rotate(${ve}deg)`},src:e,preload:"auto",playsInline:!0,onClick:st,onPointerDown:Ze,onPointerMove:me,onPointerUp:Qe,onPointerCancel:Qe,onContextMenu:Te=>{T.current&&Te.preventDefault()},onPlay:()=>$(!0),onPause:()=>$(!1),onTimeUpdate:Te=>R(Te.currentTarget.currentTime),onSeeked:Te=>{const He=Te.currentTarget;if(R(He.currentTime),y.current=!1,!g.current)return;const lt=He.requestVideoFrameCallback;typeof lt=="function"?lt.call(He,()=>{g.current&&xe()}):requestAnimationFrame(()=>{g.current&&xe()})},onLoadedMetadata:Te=>P(Number.isFinite(Te.currentTarget.duration)?Te.currentTarget.duration:0),onDurationChange:Te=>P(Number.isFinite(Te.currentTarget.duration)?Te.currentTarget.duration:0),onError:t,children:n("rightSidebar.videoUnsupported")}),Z&&o.jsx("div",{className:"pointer-events-none absolute left-1/2 top-3 z-10 -translate-x-1/2 rounded-full bg-surface-elevated px-3 py-1 text-xs font-semibold tabular-nums text-foreground shadow-md",children:n("rightSidebar.videoLongPressSpeed")}),H&&W!==null&&o.jsx("div",{className:"pointer-events-none absolute bottom-1 z-10 -translate-x-1/2 rounded-md bg-surface-elevated px-2 py-1 text-[11px] font-medium text-foreground shadow-md",style:{left:`${V*100}%`},"data-testid":"file-preview-video-scrub-time",children:Zx(W)})]}),o.jsx("div",{"data-testid":"file-preview-video-controls",className:`shrink-0 border-t border-border/60 bg-background px-2 py-1.5 ${E9}`,[I9]:"",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:st,"aria-label":n(C?"rightSidebar.videoPause":"rightSidebar.videoPlay"),title:n(C?"rightSidebar.videoPause":"rightSidebar.videoPlay"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-play",children:C?o.jsx(R8,{size:14}):o.jsx(Nb,{size:14})}),o.jsxs("div",{ref:a,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(j),"aria-valuenow":Math.floor(Ke),tabIndex:0,className:"group relative h-5 min-w-0 flex-1 cursor-pointer touch-none py-2","data-testid":"file-preview-video-track",onPointerDown:X,onPointerMove:Te=>{H&&ae(Te.clientX)},onPointerUp:Ye,onPointerCancel:Ye,onKeyDown:Oe,children:[o.jsx("div",{className:"h-1 w-full rounded-full bg-surface-elevated"}),o.jsx("div",{className:"absolute inset-y-0 left-0 my-auto h-1 rounded-full bg-primary",style:{width:`${V*100}%`}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary shadow",style:{left:`${V*100}%`}})]}),o.jsxs("div",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground","data-testid":"file-preview-video-time",children:[Zx(Ke)," / ",Zx(j)]}),o.jsx("button",{type:"button",onClick:qe,"aria-label":n("rightSidebar.videoRotate"),title:n("rightSidebar.videoRotate"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-rotate",children:o.jsx(BM,{size:14})}),o.jsx("button",{type:"button",onClick:()=>{Ce()},"aria-label":n(oe?"rightSidebar.videoFullscreenExit":"rightSidebar.videoFullscreenEnter"),title:n(oe?"rightSidebar.videoFullscreenExit":"rightSidebar.videoFullscreenEnter"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-fullscreen",children:oe?o.jsx(pM,{size:14}):o.jsx(cM,{size:14})})]})})]})}function jJ(e){const t=Math.max(0,Math.min(100,e.xPercent)),n=Math.max(0,Math.min(100,e.yPercent));return{...t<=50?{left:`calc(${t}% + 8px)`}:{right:`calc(${100-t}% + 8px)`},...n<=50?{top:`calc(${n}% + 8px)`}:{bottom:`calc(${100-n}% + 8px)`}}}function Hg({anchor:e,children:t,disabled:n=!1,onClick:r,title:s}){return o.jsxs("button",{type:"button","data-floating-annotation-button":!0,disabled:n,onClick:i=>{i.stopPropagation(),r()},title:s,style:jJ(e),className:"absolute z-30 inline-flex h-7 items-center gap-1 rounded-full bg-primary px-3 text-[11px] font-semibold text-primary-foreground shadow-lg ring-1 ring-primary/30 transition hover:bg-primary/90 active:scale-95 disabled:cursor-wait disabled:opacity-50",children:[o.jsx(Ll,{size:11}),t]})}function PJ(e,t,n,r){if(n.width<=0||n.height<=0||r.width<=0||r.height<=0)return null;const s=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(s)||s<=0)return null;const i=r.width*s,a=r.height*s,c=n.left+(n.width-i)/2,u=n.top+(n.height-a)/2,f=e-c,p=t-u;if(f<0||p<0||f>i||p>a)return null;const g=f/i*100,y=p/a*100;return{x:r.x+r.width*g/100,y:r.y+r.height*y/100,xPercent:g,yPercent:y}}function BJ(e,t,n){const r=[`SVG标注: ${e}`,`视图: ${t}`,`SVG坐标: (${n.x.toFixed(2)},${n.y.toFixed(2)}) [viewBox坐标]`,`图片位置: (${n.xPercent.toFixed(1)}%,${n.yPercent.toFixed(1)}%) [相对内容边界左上角]`];return n.nearestText&&r.push(`最近文字: ${n.nearestText}`),`"${r.join(" / ")}"`}function FJ(e){const t=new DOMParser().parseFromString(e,"image/svg+xml"),n=t.documentElement;if(n.nodeName.toLowerCase()!=="svg"||t.querySelector("parsererror"))throw new Error("Invalid SVG document");return t.querySelectorAll("script,foreignObject,iframe,object,embed").forEach(r=>r.remove()),t.querySelectorAll("*").forEach(r=>{for(const s of Array.from(r.attributes)){const i=s.name.toLowerCase(),a=s.value.trim();(i.startsWith("on")||(i==="href"||i.endsWith(":href"))&&a&&!a.startsWith("#"))&&r.removeAttribute(s.name)}}),n.removeAttribute("width"),n.removeAttribute("height"),n.setAttribute("preserveAspectRatio","xMidYMid meet"),new XMLSerializer().serializeToString(n)}function OJ(e,t,n){let r=null;for(const s of Array.from(e.querySelectorAll("text"))){const i=(s.textContent??"").replace(/\s+/g," ").trim();if(!i)continue;const a=Number(s.getAttribute("x")),c=Number(s.getAttribute("y"));if(!Number.isFinite(a)||!Number.isFinite(c))continue;const u=Math.hypot(a-t,c-n);(!r||u<r.distance)&&(r={text:i,distance:u})}return r?.text.slice(0,120)}function jT({blobUrl:e,filePath:t,viewLabel:n,onInsertAnnotation:r}){const s=b.useRef(null),i=b.useRef(null),[a,c]=b.useState(null),[u,f]=b.useState(null),[p,g]=b.useState(1),[y,v]=b.useState(!1),[S,A]=b.useState(null),T=b.useRef(new Map),L=b.useRef(null),I=b.useRef(!1),j=b.useRef(null),P=b.useRef(p);P.current=p,b.useEffect(()=>{const oe=new AbortController;return c(null),f(null),A(null),g(1),fetch(e,{signal:oe.signal}).then(q=>q.text()).then(q=>c(FJ(q))).catch(q=>{oe.signal.aborted||f(q instanceof Error?q.message:"SVG preview failed")}),()=>oe.abort()},[e]),b.useEffect(()=>{if(!y)return;const oe=q=>{q.key==="Escape"&&v(!1)};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[y]),b.useLayoutEffect(()=>{const oe=i.current,q=oe?.querySelector("[data-svg-document] > svg");if(!oe||!q)return;let z;try{z=q.getBBox()}catch{return}if(!z.width||!z.height)return;const ne=Math.max(2,Math.min(z.width,z.height)*.025);q.setAttribute("viewBox",`${z.x-ne} ${z.y-ne} ${z.width+2*ne} ${z.height+2*ne}`),q.style.width=`${p*100}%`,q.style.height=`${p*100}%`,q.style.minWidth=`${p*100}%`,q.style.minHeight=`${p*100}%`,q.style.display="block"},[a,p]);const F=b.useMemo(()=>S?BJ(t,n,S):null,[t,S,n]),R=oe=>{if(I.current){I.current=!1;return}const q=i.current,z=q?.querySelector("[data-svg-document] > svg"),ne=s.current;if(!q||!z||!ne)return;const pe=z.viewBox.baseVal,de=PJ(oe.clientX,oe.clientY,z.getBoundingClientRect(),pe);if(!de)return;const Le=ne.getBoundingClientRect();A({...de,nearestText:OJ(z,de.x,de.y),stageX:oe.clientX-Le.left,stageY:oe.clientY-Le.top,stageXPercent:(oe.clientX-Le.left)/Le.width*100,stageYPercent:(oe.clientY-Le.top)/Le.height*100})},C=oe=>Math.max(1,Math.min(12,oe)),$=(oe,q)=>{const z=C(q),ne=oe.querySelector("[data-svg-document] > svg");if(!ne)return z;const pe=`${z*100}%`;return ne.style.width=pe,ne.style.height=pe,ne.style.minWidth=pe,ne.style.minHeight=pe,P.current=z,z},H=(oe,q,z,ne)=>{const pe=P.current,de=oe.getBoundingClientRect(),Le=z-de.left,xe=ne-de.top,ae=(oe.scrollLeft+Le)/pe,fe=(oe.scrollTop+xe)/pe,X=$(oe,q);return oe.scrollLeft=ae*X-Le,oe.scrollTop=fe*X-xe,X},K=()=>{const oe=Array.from(T.current.values());return oe.length>=2?Math.hypot(oe[0].x-oe[1].x,oe[0].y-oe[1].y):0},W=oe=>{if(oe.pointerType==="mouse"&&oe.button!==0)return;const q=i.current;q&&(T.current.set(oe.pointerId,{x:oe.clientX,y:oe.clientY}),q.setPointerCapture?.(oe.pointerId),T.current.size>=2?(L.current={kind:"pinch",startX:oe.clientX,startY:oe.clientY,startScrollLeft:q.scrollLeft,startScrollTop:q.scrollTop,startDistance:K(),startZoom:P.current,moved:!1},I.current=!0):P.current>1&&(L.current={kind:"pan",startX:oe.clientX,startY:oe.clientY,startScrollLeft:q.scrollLeft,startScrollTop:q.scrollTop,startZoom:P.current,moved:!1}))},ue=oe=>{if(!T.current.has(oe.pointerId))return;T.current.set(oe.pointerId,{x:oe.clientX,y:oe.clientY});const q=i.current,z=L.current;if(!(!q||!z)){if(T.current.size>=2&&z.kind==="pinch"){const ne=K();if(!z.startDistance||!ne)return;const pe=C(z.startZoom*ne/z.startDistance);if(Math.abs(pe-P.current)<.01)return;const de=Array.from(T.current.values()),Le=(de[0].x+de[1].x)/2,xe=(de[0].y+de[1].y)/2;z.moved=!0,I.current=!0,H(q,pe,Le,xe),oe.preventDefault();return}if(z.kind==="pan"&&T.current.size===1){const ne=oe.clientX-z.startX,pe=oe.clientY-z.startY;if(!z.moved&&Math.hypot(ne,pe)<6)return;z.moved=!0,I.current=!0,q.scrollLeft=z.startScrollLeft-ne,q.scrollTop=z.startScrollTop-pe,oe.preventDefault()}}},Z=oe=>{const q=i.current,z=L.current,ne=T.current.size===1&&!z?.moved;T.current.delete(oe.pointerId);try{q?.releasePointerCapture?.(oe.pointerId)}catch{}if(T.current.size===1&&z?.kind==="pinch"){const Le=Array.from(T.current.values())[0];L.current=q?{kind:"pan",startX:Le.x,startY:Le.y,startScrollLeft:q.scrollLeft,startScrollTop:q.scrollTop,startZoom:P.current,moved:!1}:null;return}if(T.current.size>0||(L.current=null,z?.kind==="pinch"&&g(P.current),!ne||I.current))return;const pe=Date.now(),de=j.current;de&&pe-de.time<350&&Math.hypot(oe.clientX-de.x,oe.clientY-de.y)<24?(j.current=null,I.current=!0,g(Le=>Le>1?1:2.5)):j.current={time:pe,x:oe.clientX,y:oe.clientY}},ye=oe=>{if(!oe.ctrlKey&&!oe.metaKey)return;const q=i.current;if(!q)return;oe.preventDefault();const z=H(q,P.current*Math.exp(-oe.deltaY*.01),oe.clientX,oe.clientY);g(z)},ve=()=>{g(1),P.current=1,i.current&&(i.current.scrollLeft=0,i.current.scrollTop=0)},Ae=o.jsxs("div",{className:y?"fixed inset-0 z-modal-panel flex min-h-0 flex-col bg-surface pt-[env(safe-area-inset-top,0px)]":"flex h-full min-h-0 flex-col bg-surface",children:[o.jsxs("div",{ref:s,className:"relative min-h-0 flex-1",children:[o.jsx("div",{ref:i,role:"button",tabIndex:0,onClick:R,onDoubleClick:oe=>{oe.preventDefault(),g(q=>q>1?1:2.5)},onPointerDown:W,onPointerMove:ue,onPointerUp:Z,onPointerCancel:Z,onWheel:ye,onScroll:()=>A(null),className:"h-full touch-none cursor-crosshair overflow-auto bg-white p-3 text-slate-900",children:u?o.jsx("div",{className:"p-4 text-sm text-destructive",children:u}):a?o.jsx("div",{"data-svg-document":!0,className:"h-full min-h-[240px] w-full",dangerouslySetInnerHTML:{__html:a}}):o.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading SVG…"})}),S&&o.jsx("span",{"data-svg-pick-marker":!0,className:"pointer-events-none absolute z-10 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-white shadow-sm",style:{left:S.stageX,top:S.stageY}}),S&&F&&o.jsx(Hg,{anchor:{xPercent:S.stageXPercent,yPercent:S.stageYPercent},title:"引用 SVG 标注",onClick:()=>{r?.(F,`svg:${S.x.toFixed(2)}:${S.y.toFixed(2)}`),A(null)},children:"引用 SVG 标注"}),o.jsxs("div",{"data-svg-toolbar":!0,className:"absolute right-2 top-2 z-20 flex gap-1",children:[p>1.001&&o.jsx("button",{type:"button","aria-label":"适合窗口",title:"适合窗口",onClick:oe=>{oe.stopPropagation(),ve()},className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 bg-white/95 text-slate-600 shadow-sm backdrop-blur transition active:scale-95",children:o.jsx(QM,{size:14})}),o.jsx("button",{type:"button","aria-label":y?"退出全屏 SVG":"全屏 SVG",title:y?"退出全屏 SVG":"全屏 SVG",onClick:oe=>{oe.stopPropagation(),v(q=>!q)},className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 bg-white/95 text-slate-600 shadow-sm backdrop-blur transition active:scale-95",children:y?o.jsx(dy,{size:14}):o.jsx(uy,{size:14})})]})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:S?`SVG (${S.x.toFixed(2)}, ${S.y.toFixed(2)}) · ${S.nearestText??"附近无文字"}`:"点击 SVG 的问题位置生成精确引用"})})]});return y?Ei.createPortal(Ae,document.body):Ae}function wm(e){switch(e){case"schematic":return"原理图第1页";case"pcb-front":return"PCB正面";case"pcb-back":return"PCB背面(镜像)";case"pcb-3d":return"PCB 3D正面"}}function QJ(e,t,n,r){const s=[`电子标注: ${e}`,`视图: ${wm(t)}`,`图片位置: (${n.xPercent.toFixed(1)}%,${n.yPercent.toFixed(1)}%) [相对渲染图左上角]`];if(r?.available&&r.xMm!==void 0&&r.yMm!==void 0&&(s.push(`PCB坐标: (${r.xMm.toFixed(2)},${r.yMm.toFixed(2)})mm [KiCad板坐标]`),r.layer&&s.push(`显示层: ${r.layer}`),r.nearest)){const i=[r.nearest.net?`网络 ${r.nearest.net}`:null,`对象层 ${r.nearest.layer}`,`距离 ${r.nearest.distanceMm.toFixed(2)}mm`].filter(Boolean).join(",");s.push(`最近对象: ${r.nearest.label}${i?`(${i})`:""}`)}return`"${s.join(" / ")}"`}function $J({blobUrl:e,filePath:t,view:n,board:r,onViewChange:s,onInsertAnnotation:i,onRefresh:a,interactive3d:c}){const{t:u}=Zn(),f=b.useRef(null),p=b.useRef(null),g=b.useRef(null),[y,v]=b.useState(null),[S,A]=b.useState(!1);b.useEffect(()=>(g.current?.abort(),v(null),A(!1),()=>g.current?.abort()),[e,n]);const T=b.useMemo(()=>y?QJ(t,n,y,y.inspection):null,[t,y,n]),L=j=>{const P=f.current,F=p.current;if(!P||!F||!F.naturalWidth||!F.naturalHeight)return;const R=P.getBoundingClientRect(),C=Math.min(R.width/F.naturalWidth,R.height/F.naturalHeight),$=F.naturalWidth*C,H=F.naturalHeight*C,K=R.left+(R.width-$)/2,W=R.top+(R.height-H)/2,ue=j.clientX-K,Z=j.clientY-W;if(ue<0||Z<0||ue>$||Z>H)return;const ye={xPercent:Math.max(0,Math.min(100,ue/$*100)),yPercent:Math.max(0,Math.min(100,Z/H*100)),stageXPercent:(j.clientX-R.left)/R.width*100,stageYPercent:(j.clientY-R.top)/R.height*100,inspecting:r&&n!=="pcb-3d"};if(v(ye),g.current?.abort(),!ye.inspecting)return;const ve=new AbortController;g.current=ve,TI(t,n,ye.xPercent,ye.yPercent,ve.signal).then(Ae=>v(oe=>oe===ye?{...oe,inspection:Ae,inspecting:!1}:oe)).catch(()=>{ve.signal.aborted||v(Ae=>Ae===ye?{...Ae,inspection:{available:!1},inspecting:!1}:Ae)})},I=r?["pcb-front","pcb-back","pcb-3d"]:["schematic"];return o.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/15 px-3 py-2",children:[o.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:I.map(j=>o.jsx("button",{type:"button",onClick:()=>s(j),className:`h-8 shrink-0 rounded-full px-3 text-xs font-semibold transition active:scale-95 ${j===n?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:wm(j)},j))}),o.jsx("button",{type:"button",onClick:a,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",title:u("rightSidebar.edaRefresh"),"aria-label":u("rightSidebar.edaRefresh"),children:o.jsx(Bs,{size:13})})]}),r&&c?o.jsx("div",{className:n==="pcb-3d"?"flex min-h-0 flex-1 flex-col overflow-hidden":"hidden",children:c}):null,r?n==="pcb-3d"?c?null:o.jsx("div",{className:"min-h-0 flex-1"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:f,role:"button",tabIndex:0,onClick:L,onKeyDown:j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),v({xPercent:50,yPercent:50,stageXPercent:50,stageYPercent:50}))},className:"relative min-h-0 flex-1 cursor-crosshair overflow-hidden bg-surface p-3 outline-none",title:u("rightSidebar.edaPickHint"),children:[o.jsx("img",{ref:p,src:e,alt:`${t} ${wm(n)}`,onLoad:()=>A(!0),className:`pointer-events-none h-full w-full object-contain transition-opacity ${S?"opacity-100":"opacity-0"}`}),y&&o.jsx("span",{className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-surface shadow-sm",style:{left:`${y.stageXPercent}%`,top:`${y.stageYPercent}%`}}),y&&T&&o.jsx(Hg,{anchor:{xPercent:y.stageXPercent,yPercent:y.stageYPercent},disabled:y.inspecting,title:u("rightSidebar.edaInsertAnnotation"),onClick:()=>{i?.(T,`eda:${n}:${y.xPercent.toFixed(1)}:${y.yPercent.toFixed(1)}`),v(null)},children:u("rightSidebar.edaInsertAnnotation")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:y?y.inspecting?u("rightSidebar.edaInspecting"):y.inspection?.available?u("rightSidebar.edaPickedBoardPosition",{x:y.inspection.xMm?.toFixed(2)??"—",y:y.inspection.yMm?.toFixed(2)??"—",object:y.inspection.nearest?.label??u("rightSidebar.edaNoNearbyObject")}):u("rightSidebar.edaPickedPosition",{x:y.xPercent.toFixed(1),y:y.yPercent.toFixed(1)}):u("rightSidebar.edaPickHint")})})]}):o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(jT,{blobUrl:e,filePath:t,viewLabel:wm(n),onInsertAnnotation:i})})]})}function HJ(e){const t=[];let n=[],r="",s=!1;for(let i=0;i<e.length;i+=1){const a=e[i];s?a==='"'&&e[i+1]==='"'?(r+='"',i+=1):a==='"'?s=!1:r+=a:a==='"'?s=!0:a===","?(n.push(r),r=""):a===`
|
|
180
180
|
`?(n.push(r.replace(/\r$/,"")),t.push(n),n=[],r=""):r+=a}return(r||n.length>0)&&(n.push(r.replace(/\r$/,"")),t.push(n)),t}function UJ(e,t,n,r,s){const i=t[s]||`第${s+1}列`,a=n[s]??"",c=t.map((u,f)=>`${u||`第${f+1}列`}=${n[f]??""}`).join(";");return`"表格标注: ${e} / 数据行: ${r+1} / 列: ${i} / 值: ${a} / 记录: ${c}"`}function zJ({content:e,filePath:t,onInsertAnnotation:n}){const{t:r}=Zn(),s=b.useMemo(()=>HJ(e),[e]),i=s[0]??[],a=s.slice(1),c=b.useRef(null),[u,f]=b.useState(null),p=u?a[u.row]:null,g=u&&p?UJ(t,i,p,u.row+1,u.column):null;return o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-surface",children:[o.jsxs("div",{ref:c,className:"relative min-h-0 flex-1",children:[o.jsx("div",{className:"h-full overflow-auto",children:o.jsxs("table",{className:"min-w-full border-separate border-spacing-0 text-left text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"sticky left-0 top-0 z-20 border-b border-r border-border/20 bg-surface-elevated px-2 py-2 text-[10px] font-semibold text-muted-foreground",children:"#"}),i.map((y,v)=>o.jsx("th",{className:"sticky top-0 z-10 min-w-28 border-b border-r border-border/20 bg-surface-elevated px-3 py-2 font-semibold text-foreground",children:y||r("rightSidebar.csvUnnamedColumn",{index:v+1})},`${y}:${v}`))]})}),o.jsx("tbody",{children:a.map((y,v)=>o.jsxs("tr",{className:"hover:bg-surface-2",children:[o.jsx("th",{className:"sticky left-0 z-10 border-b border-r border-border/15 bg-surface px-2 py-2 text-right text-[10px] font-normal text-muted-foreground",children:v+1}),i.map((S,A)=>{const T=u?.row===v&&u.column===A;return o.jsx("td",{className:`border-b border-r border-border/15 p-0 ${T?"bg-primary/15":""}`,children:o.jsx("button",{type:"button",onClick:L=>{const I=c.current?.getBoundingClientRect(),j=L.currentTarget.getBoundingClientRect();if(!I?.width||!I.height)return;const P=L.clientX||j.left+j.width/2,F=L.clientY||j.top+j.height/2;f({row:v,column:A,xPercent:(P-I.left)/I.width*100,yPercent:(F-I.top)/I.height*100})},className:"block h-full min-h-9 w-full whitespace-pre-wrap px-3 py-2 text-left text-foreground outline-none hover:bg-primary/10 focus-visible:bg-primary/10",children:y[A]||" "})},`cell:${v}:${A}`)})]},`row:${v}`))})]})}),u&&g&&o.jsx(Hg,{anchor:{xPercent:u.xPercent,yPercent:u.yPercent},title:r("rightSidebar.csvInsertAnnotation"),onClick:()=>{n?.(g,`csv:${t}:${u.row+1}:${u.column+1}`),f(null)},children:r("rightSidebar.csvInsertAnnotation")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:u&&p?r("rightSidebar.csvSelectedCell",{row:u.row+1,column:i[u.column]||u.column+1}):r("rightSidebar.csvPickHint",{rows:a.length,columns:i.length})})})]})}function Qd(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function GJ(e,t){const n=JSON.parse(e),r=Qd(n,["meta","version"]);if(t)return[{label:"文件性质",value:"KiCad 本机界面状态,不属于电气设计源文件"},{label:"格式版本",value:String(r??"未知")},{label:"活动层编号",value:String(Qd(n,["board","active_layer"])??"未知")},{label:"可见层掩码",value:String(Qd(n,["board","visible_layers"])??"未知")},{label:"Git 集成",value:Qd(n,["git","integration_disabled"])===!0?"已禁用":"未禁用"}];const s=Qd(n,["net_settings","classes"]),i=Array.isArray(s)?s.find(c=>c&&typeof c=="object"&&c.name==="Default"):void 0,a=Qd(n,["board","design_settings","drc_exclusions"]);return[{label:"文件性质",value:"KiCad 工程配置"},{label:"格式版本",value:String(r??"未知")},{label:"网络类数量",value:String(Array.isArray(s)?s.length:0)},{label:"默认间距",value:i?.clearance!==void 0?`${i.clearance} mm`:"未设置"},{label:"默认线宽",value:i?.track_width!==void 0?`${i.track_width} mm`:"未设置"},{label:"默认过孔",value:i?.via_diameter!==void 0?`${i.via_diameter} / ${i.via_drill??"—"} mm(外径/钻孔)`:"未设置"},{label:"DRC 排除项",value:String(Array.isArray(a)?a.length:0)}]}function WJ(e,t){return`"KiCad项目标注: ${e} / 项: ${t.label} / 值: ${t.value}"`}function VJ({content:e,filePath:t,localState:n,onInsertAnnotation:r}){const{t:s}=Zn(),i=b.useRef(null),[a,c]=b.useState(null),u=b.useMemo(()=>{try{return{items:GJ(e,n),error:null}}catch(p){return{items:[],error:p instanceof Error?p.message:String(p)}}},[e,n]),f=a===null?null:u.items[a.index];return u.error?o.jsx("pre",{className:"min-h-0 flex-1 overflow-auto whitespace-pre-wrap p-3 font-mono text-xs text-foreground",children:e}):o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-surface",children:[n&&o.jsx("div",{className:"border-b border-[color:var(--warning)]/20 bg-[color:var(--warning)]/5 px-3 py-2 text-xs text-[color:var(--warning)]",children:s("rightSidebar.kicadLocalStateNotice")}),o.jsxs("div",{ref:i,className:"relative min-h-0 flex-1",children:[o.jsxs("div",{className:"h-full overflow-auto px-3 py-2",children:[o.jsx("div",{className:"divide-y divide-border/15",children:u.items.map((p,g)=>o.jsxs("button",{type:"button",onClick:y=>{const v=i.current?.getBoundingClientRect(),S=y.currentTarget.getBoundingClientRect();if(!v?.width||!v.height)return;const A=y.clientX||S.left+S.width/2,T=y.clientY||S.top+S.height/2;c({index:g,xPercent:(A-v.left)/v.width*100,yPercent:(T-v.top)/v.height*100})},className:`grid w-full grid-cols-[minmax(7rem,0.8fr)_minmax(0,1.4fr)] gap-3 px-2 py-3 text-left transition hover:bg-surface-2 ${a?.index===g?"bg-primary/10":""}`,children:[o.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:p.label}),o.jsx("span",{className:"break-words text-xs text-foreground",children:p.value})]},p.label))}),o.jsxs("details",{className:"mt-3 border-t border-border/15 pt-3",children:[o.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:s("rightSidebar.kicadShowRawJson")}),o.jsx("pre",{className:"mt-2 overflow-auto whitespace-pre p-2 font-mono text-[10px] leading-relaxed text-foreground",children:e})]})]}),f&&a&&o.jsx(Hg,{anchor:{xPercent:a.xPercent,yPercent:a.yPercent},title:s("rightSidebar.kicadInsertSetting"),onClick:()=>{r?.(WJ(t,f),`kicad-project:${t}:${f.label}`),c(null)},children:s("rightSidebar.kicadInsertSetting")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:f?`${f.label}: ${f.value}`:s("rightSidebar.kicadProjectPickHint")})})]})}const qJ=b.forwardRef(function({src:t,title:n,exitFullscreenLabel:r,onFullscreenChange:s},i){const a=b.useRef(null),[c,u]=b.useState(!1),[f,p]=b.useState(!1),g=c||f;b.useEffect(()=>{s?.(g)},[g,s]),b.useEffect(()=>{const S=()=>{u(document.fullscreenElement===a.current)};return document.addEventListener("fullscreenchange",S),()=>document.removeEventListener("fullscreenchange",S)},[]),b.useEffect(()=>{if(!f)return;const S=A=>{A.key==="Escape"&&p(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[f]);const y=b.useCallback(async()=>{const S=a.current;if(S){if(f){p(!1);return}if(document.fullscreenElement===S){await document.exitFullscreen();return}if(S.requestFullscreen&&document.fullscreenEnabled!==!1)try{await S.requestFullscreen();return}catch{}p(!0)}},[f]);b.useImperativeHandle(i,()=>({toggleFullscreen:y}),[y]);const v=o.jsxs("div",{ref:a,"data-html-preview-frame":!0,className:g?"fixed inset-0 z-modal-panel flex min-h-0 flex-col overflow-hidden bg-surface pt-[env(safe-area-inset-top,0px)] text-foreground":"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[g&&o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-3 border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[o.jsx("span",{className:"min-w-0 truncate text-[12px] font-semibold",children:n}),o.jsx("button",{type:"button",onClick:()=>{y()},"aria-label":r,title:`${r} (Esc)`,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:o.jsx(dy,{size:15})})]}),o.jsx("iframe",{src:t,title:n,sandbox:"allow-scripts",className:"block min-h-0 w-full flex-1 border-0 bg-white"})]});return f?Ei.createPortal(v,document.body):v}),PT="termdock-file-search-match",F2="termdock-file-search-current";function KJ(e){const t=e.metaKey||e.ctrlKey,n=e.key.toLocaleLowerCase();return t&&n==="f"?"open":t&&n==="g"||e.key==="F3"?e.shiftKey?"previous":"next":e.key==="Escape"?"close":null}function YJ(e){return e.parentElement?.closest("[data-markdown-preview-block-start], [data-file-preview-line]")??null}function XJ(e,t){const n=t.trim().toLocaleLowerCase();if(!n)return[];const r=[];let s="",i=null;const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let p=a.nextNode();p;p=a.nextNode()){if(!(p instanceof Text)||!p.data)continue;const g=YJ(p);if(!g)continue;i&&i!==g&&(s+=`
|
|
181
|
-
`);const y=s.length;s+=p.data,r.push({node:p,start:y,end:s.length,group:g}),i=g}const c=s.toLocaleLowerCase(),u=[];let f=0;for(;f<=c.length-n.length;){const p=c.indexOf(n,f);if(p<0)break;const g=p+n.length,y=r.find(S=>S.start<=p&&S.end>p),v=r.find(S=>S.start<g&&S.end>=g);if(y&&v&&y.group===v.group){const S=document.createRange();S.setStart(y.node,p-y.start),S.setEnd(v.node,g-v.start),u.push(S)}f=p+Math.max(n.length,1)}return u}function BT(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function zp(){const e=BT();e?.delete(PT),e?.delete(F2)}function P4(e,t){const n=BT();if(!n||typeof Highlight>"u")return;n.set(PT,new Highlight(...e));const r=e[t];r?n.set(F2,new Highlight(r)):n.delete(F2)}function B4(e){e?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}const dv="termdock:right-sidebar:file-tree-scroll:v1",fv="termdock:right-sidebar:file-preview-reading-state:v1",Mf="termdock:right-sidebar:file-tree-width:v1",FT="termdock:right-sidebar:markdown-view-mode:v1",OT="termdock:right-sidebar:diff-change-list-mode:v1",QT="termdock:right-sidebar:diff-wrap:v1",$T="termdock:diff-viewer:view-type:v1",HT="termdock:right-sidebar:file-search-mode:v1",Jx="termdock:right-sidebar:collapsed-git-repo-groups:v1",F4="termdock:right-sidebar:collapsed-diff-directories:v1",eb="termdock:right-sidebar:branch-audit-module-open:v1",UT="termdock:right-sidebar:branch-audit-module:v1",ZJ=150,zT="termdock:right-sidebar:active-git-repo:v1",O4="termdock:right-sidebar:context-draft-enabled:v1",Q4="termdock:right-sidebar:context-draft-collapsed:v1",$4="termdock:right-sidebar:context-draft-auto-collapse:v1",tb="termdock:right-sidebar:context-draft-text:v1",JJ=300,eee=20,tee=120,nee=250,ree=250,see=120,iee=700,nb=600,H4=[2e3,5e3,15e3,3e4],oee=320,aee=500,lee=20,cee=12e3,O2=300,U4=240,uee=560,GT="border-r px-2 py-1.5 sm:px-3 sm:py-2",og="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",WT=`${GT} border-b border-border/15 font-semibold last:border-r-0`,VT=`${GT} border-border/10 align-top text-muted-foreground last:border-r-0`,hv="termdock-file-preview-horizontal-scroll",z4=b.lazy(()=>A0(()=>import("./ModelPreview-Ki--VGiC.js"),__vite__mapDeps([2,3,1,4]))),qT=`${hv} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`;function dee(e,t,n){return e&&!t?"unified":n}const fee=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function hee(e){return e==="preview"||e==="source"}function pee(e){return e==="list"||e==="tree"||e==="ai"}function G4(){return Fr(FT,hee)??"preview"}function mee(){return Fr(OT,pee)??"tree"}function Df(e){return typeof e=="boolean"}function gee(e){return typeof e=="string"}function xee(){return Fr(QT,Df)??!0}function bee(e){return e==="unified"||e==="split"}function yee(){return Fr($T,bee)??"unified"}function vee(e){return e==="name"||e==="content"||e==="regex"}function wee(){return Fr(HT,vee)??"name"}function KT(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Co(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function See(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function YT(){return Fr(zT,See)??{}}function W4(e){if(!e)return;const t=YT();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function rb(e,t){e&&zn(zT,{...YT(),[e]:t})}function Aee(e,t){if(!t)return null;const n=new Set((e.repoFilters??[]).map(r=>r.root));return n.has(t)?t:n.size>0?null:(e.repositories??[]).some(r=>r.root===t)?t:null}function Q2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function V4(e){const t=Fr(e,Q2);return t?new Set(t):new Set}function sb(e,t){zn(e,[...t])}function Tee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.filePath=="string"&&typeof t.hunkHeader=="string"&&typeof t.hunkIndex=="number"&&typeof t.fingerprint=="string"&&typeof t.additions=="number"&&typeof t.deletions=="number"&&typeof t.diff=="string"&&(t.oldPath===void 0||t.oldPath===null||typeof t.oldPath=="string")&&(t.newPath===void 0||t.newPath===null||typeof t.newPath=="string")&&(t.source===void 0||t.source==="committed"||t.source==="uncommitted"||t.source==="unknown")&&(t.commit===void 0||t.commit===null||typeof t.commit=="string")}function Cee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.available=="boolean"&&(t.repoRoot===void 0||typeof t.repoRoot=="string")&&(t.workspaceRoot===void 0||typeof t.workspaceRoot=="string")&&(t.baseRef===void 0||typeof t.baseRef=="string")&&(t.baseBranch===void 0||typeof t.baseBranch=="string")&&(t.currentBranch===void 0||t.currentBranch===null||typeof t.currentBranch=="string")&&(t.headRef===void 0||t.headRef===null||typeof t.headRef=="string")&&(t.diffFingerprint===void 0||typeof t.diffFingerprint=="string")&&(t.stat===void 0||typeof t.stat=="string")&&(t.files===void 0||Q2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(Tee))&&(t.commits===void 0||Q2(t.commits))&&(t.commitCount===void 0||typeof t.commitCount=="number")&&(t.diff===void 0||typeof t.diff=="string")&&(t.truncated===void 0||typeof t.truncated=="boolean")&&(t.error===void 0||typeof t.error=="string")}function kee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&Cee(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function _ee(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return Array.isArray(n.selectedRepoRoots)&&n.selectedRepoRoots.every(r=>typeof r=="string")&&!!n.repoTargetBranches&&typeof n.repoTargetBranches=="object"&&!Array.isArray(n.repoTargetBranches)&&Object.values(n.repoTargetBranches).every(r=>typeof r=="string")&&(n.repoBaseBranches===void 0||!!n.repoBaseBranches&&typeof n.repoBaseBranches=="object"&&!Array.isArray(n.repoBaseBranches)&&Object.values(n.repoBaseBranches).every(r=>typeof r=="string"))&&(n.previewEntries===void 0||Array.isArray(n.previewEntries)&&n.previewEntries.every(kee))&&(n.selectedPreviewKey===void 0||n.selectedPreviewKey===null||typeof n.selectedPreviewKey=="string")&&(n.selectedPreviewFileKey===void 0||n.selectedPreviewFileKey===null||typeof n.selectedPreviewFileKey=="string")&&(n.previewDetailOpen===void 0||typeof n.previewDetailOpen=="boolean")&&(n.previewScrollTops===void 0||!!n.previewScrollTops&&typeof n.previewScrollTops=="object"&&!Array.isArray(n.previewScrollTops)&&Object.values(n.previewScrollTops).every(r=>typeof r=="number"))&&(n.previewMobileSlideIndex===void 0||typeof n.previewMobileSlideIndex=="number")&&(n.includeUncommitted===void 0||typeof n.includeUncommitted=="boolean")&&typeof n.updatedAt=="number"})}function q4(){return Fr(UT,_ee)??{}}function K4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function Y4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function XT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||Y4(n)===Y4(r)}function X4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!XT(r,t))??""}function $2(e,t){const n=Math.max(U4,t-320),r=Math.min(uee,n);return Math.min(r,Math.max(U4,e))}function Lee(e){return typeof e=="number"&&Number.isFinite(e)}function Eee(e){return $2(Fr(Mf,Lee)??O2,e)}function ZT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function vf(e){return fee.has(ZT(e))}function JT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function H2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||JT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function Iee(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const eC=b.createContext(null);function Sm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function tC(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function nC(e){return e.replace(/\s+#+\s*$/,"").trim()}function U2(e,t){const r=tC(e).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",s=t.headingSlugCounts.get(r)??0;return t.headingSlugCounts.set(r,s+1),s===0?r:`${r}-${s}`}function Z4(e){return tC(e)||e.trim()}function ag(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=G2(t[2]);return n?{id:Sm(t[1]),definition:{href:n.href,title:n.title}}:null}function Ree(e){const t=new Map;for(const n of e){const r=ag(n);r&&t.set(r.id,r.definition)}return t}function rC(e){return e.trim().toLowerCase()}function sC(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:rC(t[1]),text:t[2]}:null}function Nee(e){const t=new Map;let n=null;for(const r of e){const s=sC(r);if(s){n=s.id,t.set(s.id,{id:s.id,text:s.text,index:t.size+1});continue}if(n&&/^\s{4,}\S/.test(r)){const i=t.get(n);i&&(i.text=`${i.text} ${r.trim()}`);continue}r.trim()&&(n=null)}return t}function Mee(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(sC(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function Dee(e){const t=[...e];let n=0;const r=e[0]?.trim();if(r==="---"||r==="+++"){for(t[0]="",n=1;n<e.length&&e[n].trim()!==r;)t[n]="",n+=1;n<e.length&&(t[n]="",n+=1)}for(;n<e.length;){const s=e[n].trim();if(s.startsWith("<!--")){if(t[n]="",!s.includes("-->")){for(n+=1;n<e.length&&!e[n].includes("-->");)t[n]="",n+=1;n<e.length&&(t[n]="")}n+=1;continue}n+=1}return t}function iC(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function Vf(e){const t=e.split(/[?#]/,1)[0],n=t.startsWith("/"),r=[];for(const i of t.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r.pop();continue}r.push(i)}return`${n?"/":""}${r.join("/")}`||(n?"/":".")}function jee(e,t,n){const r=e.trim();if(!r||/^(?:https?:|mailto:|javascript:|data:|#)/i.test(r)||/^[a-z][a-z0-9+.-]*:/i.test(r))return null;const s=r.indexOf("#"),i=s>=0?r.slice(0,s):r,a=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=a?decodeURIComponent(a):null}catch{return null}const p=n?Vf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=Vf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=Vf(`${iC(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function Pee(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!ry(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=Vf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=Vf(`${iC(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const z2=128,Bee=360,ib=480;function pv(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function Fee(e,t,n,r){if(!t||!n)return null;let s,i;return pv(e)?(i=Math.min(Math.max(n,z2),Bee),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>ib&&(s=s*ib/i,i=ib),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function Oee(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function oC(e){const t=Oee(e),n=at(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function Qee({src:e,alt:t,title:n}){const r=pv(e),s=oC(e),i=b.useRef(null),[a,c]=b.useState(!1),[u,f]=b.useState(0),[p,g]=b.useState({status:"loading"}),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const T=i.current,L=T?.parentElement?.parentElement??T?.parentElement;if(!L)return;const I=()=>f(L.clientWidth);if(I(),typeof ResizeObserver>"u")return;const j=new ResizeObserver(I);return j.observe(L),()=>j.disconnect()},[]),b.useEffect(()=>{if(a)return;const T=i.current;if(!T||typeof IntersectionObserver>"u"){c(!0);return}const L=new IntersectionObserver(I=>{I.some(j=>j.isIntersecting)&&(c(!0),L.disconnect())},{rootMargin:"400px"});return L.observe(T),()=>L.disconnect()},[a]),b.useEffect(()=>{if(!a)return;const T=new AbortController;let L=null;g({status:"loading"});const I=window.setTimeout(()=>{T.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return fetch(s,{signal:T.signal}).then(async j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);const P=Number(j.headers.get("X-Image-Width"))||0,F=Number(j.headers.get("X-Image-Height"))||0;return{blob:await j.blob(),width:P,height:F}}).then(({blob:j,width:P,height:F})=>{T.signal.aborted||(L=URL.createObjectURL(j),P>0&&F>0&&v({width:P,height:F}),g({status:"ready",objectUrl:L}))}).catch(()=>{const j=T.signal.reason;T.signal.aborted&&!(j instanceof DOMException&&j.name==="TimeoutError")||g({status:"fallback"})}).finally(()=>{window.clearTimeout(I)}),()=>{window.clearTimeout(I),T.abort(),L&&URL.revokeObjectURL(L)}},[a,s]);const S=Fee(e,y?.width??0,y?.height??0,u),A=S??{width:z2*2,height:z2};return o.jsx("div",{ref:i,className:"block max-w-full",style:S?{width:S.width,height:S.height}:void 0,children:p.status==="ready"?o.jsx("img",{src:p.objectUrl,alt:t,title:n,decoding:"async",className:`${r?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):p.status==="fallback"?o.jsx("img",{src:s,alt:t,title:n,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):o.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:A.width,height:A.height},children:o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:t||"…"})})})}function ob(e,t,n,r,s){const i=Pee(n,s.markdownFilePath,s.rootPath);if(!i)return``;const a=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(Qee,{src:i,alt:t,title:r});return s.onImageOpen?o.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:r||t||"Open image",onClick:u=>{u.stopPropagation(),s.onImageOpen?.(a)},children:c},e):o.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c},e)}function ab(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function J4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function G2(e){const t=e.trim(),n=t.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(n)return{href:n[1],title:n[2]??n[3]??n[4]};const r=t.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return r?{href:r[1],title:r[2]??r[3]??r[4]}:null}const aC="",$ee=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function Hee(e){return e.replace($ee,(t,n)=>`${aC}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function e7(e){return e.replace(new RegExp(`${aC}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function Uee(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const lC={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Gp=null;function cC(){return Gp||(Gp=A0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Gp=null,e})),Gp}function uC({html:e}){const{t}=Zn(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),cC().then(i=>{s||r(i.sanitize(e,lC))}).catch(()=>{s||r("")}),()=>{s=!0}},[e]),n===null?o.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:t("rightSidebar.renderingHtml")}):n?o.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:n}}):null}function zee({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),cC().then(s=>{r||n(s.sanitize(e,lC))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function dC(e){const t=e.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!t)return null;const n=t[1].toLowerCase();return{tag:n,selfContained:new RegExp(`</${n}>`,"i").test(e)}}let Wp=null;function Gee(){return Wp||(Wp=Promise.all([A0(()=>import("./katex-DnlPpQZa.js"),[]),A0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Wp=null,e})),Wp}function fh({tex:e,display:t=!1}){const[n,r]=b.useState(null),[s,i]=b.useState(!1);if(b.useEffect(()=>{let c=!1;return r(null),i(!1),Gee().then(u=>{c||r(u.renderToString(e,{displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{c||i(!0)}),()=>{c=!0}},[t,e]),s)return o.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:t?`$$${e}$$`:`$${e}$`});if(!n)return o.jsx("span",{className:"text-muted-foreground/70",children:t?"Rendering formula...":e});const a=t?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return o.jsx("span",{className:a,dangerouslySetInnerHTML:{__html:n}})}function Wee(e,t,n){if(/^<br\s*\/?>$/i.test(e))return o.jsx("br",{},t);const r=e.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!r)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(e)?o.jsx(zee,{html:e},t):null;const s=r[1].toLowerCase(),i=Li(r[2],`${t}-${s}`,!0,n);return s==="kbd"?o.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:i},t):s==="mark"?o.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:i},t):s==="sub"?o.jsx("sub",{children:i},t):o.jsx("sup",{children:i},t)}function Li(e,t,n=!0,r){const s=Hee(e),i=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,a=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&a.push(e7(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?Wee(f,p,r):null;if(g)a.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))a.push(o.jsx(fh,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))a.push(o.jsx(fh,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;a.push(o.jsx("code",{className:`${n?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:Uee(f.slice(y,-y))},p))}else if(f.startsWith("~~"))a.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:Li(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))a.push(o.jsx("strong",{className:"font-semibold text-foreground",children:Li(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))a.push(o.jsx("em",{className:"italic",children:Li(f.slice(1,-1),`${p}-em`,n,r)},p));else if(f.startsWith("![")){const y=f.match(/^!\[([^\]]*)\]\((.*)\)$/),v=f.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^!\[([^\]]+)\]$/);if(y){const A=G2(y[2]);a.push(A?ob(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(Sm(A));a.push(T?ob(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(Sm(S[1]));a.push(A?ob(p,S[1],A.href,A.title,r):f)}else a.push(f)}else if(f.startsWith("[^")){const y=rC(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);a.push(v?o.jsx("sup",{id:`fnref-${v.id}`,title:v.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:o.jsx("a",{href:`#fn-${v.id}`,className:"text-primary no-underline",children:v.index})},p):f)}else if(f.startsWith("<http")){const y=f.slice(1,-1);a.push(o.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(f.startsWith("<")&&f.endsWith(">")&&J4(f.slice(1,-1))){const y=f.slice(1,-1);a.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(J4(ab(f).linkText)){const{linkText:y,suffix:v}=ab(f);a.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&a.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=ab(f),S=y.startsWith("www.")?`https://${y}`:y;a.push(o.jsx("a",{href:S,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&a.push(v)}else{const y=f.match(/^\[([^\]]+)\]\((.*)\)$/),v=f.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^\[([^\]]+)\]$/),A=v?v[2]||v[1]:S?.[1]??null,T=A?r.referenceDefinitions.get(Sm(A)):null,L=y?G2(y[2]):null,I=L?.href??T?.href??null,j=I?Iee(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";a.push(j?o.jsx("a",{href:j,title:L?.title??T?.title,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:Li(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&a.push(e7(s.slice(c))),a.length>0?a:[e]}function fC(e){return/(?: {2,}|\\)$/.test(e)}function hC(e){return e.replace(/(?: {2,}|\\)$/,"")}function lg(e){return/^(?: {4}|\t)/.test(e)}function pC(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function mC(e,t,n){const r=[];return e.forEach((s,i)=>{const a=fC(s);r.push(...Li(hC(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(a?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function W2(e,t,n){const r=[],s=[];return e.forEach((i,a)=>{s.push(fC(i)),r.push(Li(hC(i),`${t}-${a}`,!0,n))}),{perLine:r,hardBreaks:s}}function V2(e,t,n,r,s){const i=[];return e.forEach((a,c)=>{const u=n[c]??0,f=!!(s&&u>=s.start&&u<=s.end);i.push(o.jsx("span",{"data-md-ref-start":u,"data-md-ref-end":u,"data-selected":f?"true":void 0,children:a},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function hh(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,a=0;for(let c=0;c<t.length;c+=1){const u=t[c];if(s){r+=u,s=!1;continue}if(u==="\\"){s=!0;continue}if(u==="`"){const f=c;for(;c+1<t.length&&t[c+1]==="`";)c+=1;const p=c-f+1;r+="`".repeat(p),i===0?i=p:i===p&&(i=0);continue}if(i===0&&u==="["?a+=1:i===0&&u==="]"&&a>0&&(a-=1),u==="|"&&i===0&&a===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function gC(e){return hh(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function cg(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function ug(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function Vee(e,t){return e>96||e>44&&t>.35}function mv(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function gv(e){const t=e.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!t)return null;const n=/^\d+[.)]$/.test(t[1]);return{ordered:n,start:n?Number.parseInt(t[1],10):void 0,content:t[2]}}function xC(e,t,n,r,s,i=new Set){const a=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(ag(f)||i.has(u))){u+=1;continue}const p=gv(f),g=mv(f);if(!p){if(g>n&&c.length>0){([...c].reverse().find(A=>A.indent<g)?.item??c[c.length-1].item).paragraphs.push(f.trim());for(const A of c)A.item.lineEnd=u+1;u+=1;continue}break}if(g<n||g===n&&p.ordered!==r)break;const y={content:p.content,ordered:p.ordered,start:p.start,children:[],paragraphs:[],lineStart:u+1,lineEnd:u+1};for(;c.length>0&&c[c.length-1].indent>=g;)c.pop();const v=c[c.length-1]?.item??null;v?v.children.push(y):a.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:a,nextIndex:u}}function xv(e,t,n,r=0){return e.map((s,i)=>{const a=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!a,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[a?o.jsx("input",{type:"checkbox",checked:a[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,Li(a?.[2]??s.content,`li-${t}-${i}`,!0,n),s.paragraphs.length>0&&o.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:s.paragraphs.map((c,u)=>o.jsx("p",{children:Li(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:qee(s.children,`${t}-${i}`,n,r)}})}function qee(e,t,n,r=0){const s=[];for(const i of e){const a=s[s.length-1];a&&a.ordered===i.ordered?a.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,a)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:xv(i.items,`${t}-g${a}`,n,r)}))}function bv(e,t){return e.map(n=>{const r=!!(t&&n.refStart<=t.end&&n.refEnd>=t.start);return o.jsxs("li",{className:n.taskItem?"list-none":void 0,"data-md-ref-start":n.refStart,"data-md-ref-end":n.refEnd,"data-selected":r?"true":void 0,children:[n.content,n.groups.length>0&&Kee(n.groups,t)]},n.key)})}function Kee(e,t){return e.map((n,r)=>{const s=n.ordered?"ol":"ul";return o.jsx(s,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:bv(n.items,t)},`nested-${r}`)})}function Yee(e){const t=Array.from(e.footnoteDefinitions.values()).sort((n,r)=>n.index-r.index);return t.length===0?null:o.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:e.footnotesLabel}),o.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:t.map(n=>o.jsxs("li",{id:`fn-${n.id}`,children:[Li(n.text,`footnote-${n.id}`,!0,e)," ",o.jsx("a",{href:`#fnref-${n.id}`,className:"text-primary no-underline","aria-label":e.backToFootnoteLabel(n.index),children:"↩"})]},n.id))})]})}function Xee(e,t,n,r){const s=[];let i=0;const a=c=>r?.[c]??c+1;for(;i<e.length;){const c=e[i],u=c.trim();if(!u){i+=1;continue}if(/^<details>\s*$/i.test(u)){const L=i;let I="Details";const j=[];for(i+=1;i<e.length&&!/^<\/details>\s*$/i.test(e[i].trim());){const P=e[i].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);P?I=P[1].trim()||I:j.push(e[i].trimStart()),i+=1}i<e.length&&(i+=1),s.push({kind:"static",node:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:Li(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:mC(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=dC(c);if(f){const L=[c],I=i;for(i+=1;i<e.length&&!f.selfContained&&!new RegExp(`</${f.tag}>`,"i").test(e[i]);)L.push(e[i]),i+=1;i<e.length&&!f.selfContained&&(L.push(e[i]),i+=1),s.push({kind:"static",node:o.jsx(uC,{html:L.join(`
|
|
181
|
+
`);const y=s.length;s+=p.data,r.push({node:p,start:y,end:s.length,group:g}),i=g}const c=s.toLocaleLowerCase(),u=[];let f=0;for(;f<=c.length-n.length;){const p=c.indexOf(n,f);if(p<0)break;const g=p+n.length,y=r.find(S=>S.start<=p&&S.end>p),v=r.find(S=>S.start<g&&S.end>=g);if(y&&v&&y.group===v.group){const S=document.createRange();S.setStart(y.node,p-y.start),S.setEnd(v.node,g-v.start),u.push(S)}f=p+Math.max(n.length,1)}return u}function BT(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function zp(){const e=BT();e?.delete(PT),e?.delete(F2)}function P4(e,t){const n=BT();if(!n||typeof Highlight>"u")return;n.set(PT,new Highlight(...e));const r=e[t];r?n.set(F2,new Highlight(r)):n.delete(F2)}function B4(e){e?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}const dv="termdock:right-sidebar:file-tree-scroll:v1",fv="termdock:right-sidebar:file-preview-reading-state:v1",Mf="termdock:right-sidebar:file-tree-width:v1",FT="termdock:right-sidebar:markdown-view-mode:v1",OT="termdock:right-sidebar:diff-change-list-mode:v1",QT="termdock:right-sidebar:diff-wrap:v1",$T="termdock:diff-viewer:view-type:v1",HT="termdock:right-sidebar:file-search-mode:v1",Jx="termdock:right-sidebar:collapsed-git-repo-groups:v1",F4="termdock:right-sidebar:collapsed-diff-directories:v1",eb="termdock:right-sidebar:branch-audit-module-open:v1",UT="termdock:right-sidebar:branch-audit-module:v1",ZJ=150,zT="termdock:right-sidebar:active-git-repo:v1",O4="termdock:right-sidebar:context-draft-enabled:v1",Q4="termdock:right-sidebar:context-draft-collapsed:v1",$4="termdock:right-sidebar:context-draft-auto-collapse:v1",tb="termdock:right-sidebar:context-draft-text:v1",JJ=300,eee=20,tee=120,nee=250,ree=250,see=120,iee=700,nb=600,H4=[2e3,5e3,15e3,3e4],oee=320,aee=500,lee=20,cee=12e3,O2=300,U4=240,uee=560,GT="border-r px-2 py-1.5 sm:px-3 sm:py-2",og="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",WT=`${GT} border-b border-border/15 font-semibold last:border-r-0`,VT=`${GT} border-border/10 align-top text-muted-foreground last:border-r-0`,hv="termdock-file-preview-horizontal-scroll",z4=b.lazy(()=>A0(()=>import("./ModelPreview-DA71QiMN.js"),__vite__mapDeps([2,3,1,4]))),qT=`${hv} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`;function dee(e,t,n){return e&&!t?"unified":n}const fee=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function hee(e){return e==="preview"||e==="source"}function pee(e){return e==="list"||e==="tree"||e==="ai"}function G4(){return Fr(FT,hee)??"preview"}function mee(){return Fr(OT,pee)??"tree"}function Df(e){return typeof e=="boolean"}function gee(e){return typeof e=="string"}function xee(){return Fr(QT,Df)??!0}function bee(e){return e==="unified"||e==="split"}function yee(){return Fr($T,bee)??"unified"}function vee(e){return e==="name"||e==="content"||e==="regex"}function wee(){return Fr(HT,vee)??"name"}function KT(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Co(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function See(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function YT(){return Fr(zT,See)??{}}function W4(e){if(!e)return;const t=YT();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function rb(e,t){e&&zn(zT,{...YT(),[e]:t})}function Aee(e,t){if(!t)return null;const n=new Set((e.repoFilters??[]).map(r=>r.root));return n.has(t)?t:n.size>0?null:(e.repositories??[]).some(r=>r.root===t)?t:null}function Q2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function V4(e){const t=Fr(e,Q2);return t?new Set(t):new Set}function sb(e,t){zn(e,[...t])}function Tee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.filePath=="string"&&typeof t.hunkHeader=="string"&&typeof t.hunkIndex=="number"&&typeof t.fingerprint=="string"&&typeof t.additions=="number"&&typeof t.deletions=="number"&&typeof t.diff=="string"&&(t.oldPath===void 0||t.oldPath===null||typeof t.oldPath=="string")&&(t.newPath===void 0||t.newPath===null||typeof t.newPath=="string")&&(t.source===void 0||t.source==="committed"||t.source==="uncommitted"||t.source==="unknown")&&(t.commit===void 0||t.commit===null||typeof t.commit=="string")}function Cee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.available=="boolean"&&(t.repoRoot===void 0||typeof t.repoRoot=="string")&&(t.workspaceRoot===void 0||typeof t.workspaceRoot=="string")&&(t.baseRef===void 0||typeof t.baseRef=="string")&&(t.baseBranch===void 0||typeof t.baseBranch=="string")&&(t.currentBranch===void 0||t.currentBranch===null||typeof t.currentBranch=="string")&&(t.headRef===void 0||t.headRef===null||typeof t.headRef=="string")&&(t.diffFingerprint===void 0||typeof t.diffFingerprint=="string")&&(t.stat===void 0||typeof t.stat=="string")&&(t.files===void 0||Q2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(Tee))&&(t.commits===void 0||Q2(t.commits))&&(t.commitCount===void 0||typeof t.commitCount=="number")&&(t.diff===void 0||typeof t.diff=="string")&&(t.truncated===void 0||typeof t.truncated=="boolean")&&(t.error===void 0||typeof t.error=="string")}function kee(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&Cee(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function _ee(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return Array.isArray(n.selectedRepoRoots)&&n.selectedRepoRoots.every(r=>typeof r=="string")&&!!n.repoTargetBranches&&typeof n.repoTargetBranches=="object"&&!Array.isArray(n.repoTargetBranches)&&Object.values(n.repoTargetBranches).every(r=>typeof r=="string")&&(n.repoBaseBranches===void 0||!!n.repoBaseBranches&&typeof n.repoBaseBranches=="object"&&!Array.isArray(n.repoBaseBranches)&&Object.values(n.repoBaseBranches).every(r=>typeof r=="string"))&&(n.previewEntries===void 0||Array.isArray(n.previewEntries)&&n.previewEntries.every(kee))&&(n.selectedPreviewKey===void 0||n.selectedPreviewKey===null||typeof n.selectedPreviewKey=="string")&&(n.selectedPreviewFileKey===void 0||n.selectedPreviewFileKey===null||typeof n.selectedPreviewFileKey=="string")&&(n.previewDetailOpen===void 0||typeof n.previewDetailOpen=="boolean")&&(n.previewScrollTops===void 0||!!n.previewScrollTops&&typeof n.previewScrollTops=="object"&&!Array.isArray(n.previewScrollTops)&&Object.values(n.previewScrollTops).every(r=>typeof r=="number"))&&(n.previewMobileSlideIndex===void 0||typeof n.previewMobileSlideIndex=="number")&&(n.includeUncommitted===void 0||typeof n.includeUncommitted=="boolean")&&typeof n.updatedAt=="number"})}function q4(){return Fr(UT,_ee)??{}}function K4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function Y4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function XT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||Y4(n)===Y4(r)}function X4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!XT(r,t))??""}function $2(e,t){const n=Math.max(U4,t-320),r=Math.min(uee,n);return Math.min(r,Math.max(U4,e))}function Lee(e){return typeof e=="number"&&Number.isFinite(e)}function Eee(e){return $2(Fr(Mf,Lee)??O2,e)}function ZT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function vf(e){return fee.has(ZT(e))}function JT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function H2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||JT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function Iee(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const eC=b.createContext(null);function Sm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function tC(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function nC(e){return e.replace(/\s+#+\s*$/,"").trim()}function U2(e,t){const r=tC(e).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",s=t.headingSlugCounts.get(r)??0;return t.headingSlugCounts.set(r,s+1),s===0?r:`${r}-${s}`}function Z4(e){return tC(e)||e.trim()}function ag(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=G2(t[2]);return n?{id:Sm(t[1]),definition:{href:n.href,title:n.title}}:null}function Ree(e){const t=new Map;for(const n of e){const r=ag(n);r&&t.set(r.id,r.definition)}return t}function rC(e){return e.trim().toLowerCase()}function sC(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:rC(t[1]),text:t[2]}:null}function Nee(e){const t=new Map;let n=null;for(const r of e){const s=sC(r);if(s){n=s.id,t.set(s.id,{id:s.id,text:s.text,index:t.size+1});continue}if(n&&/^\s{4,}\S/.test(r)){const i=t.get(n);i&&(i.text=`${i.text} ${r.trim()}`);continue}r.trim()&&(n=null)}return t}function Mee(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(sC(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function Dee(e){const t=[...e];let n=0;const r=e[0]?.trim();if(r==="---"||r==="+++"){for(t[0]="",n=1;n<e.length&&e[n].trim()!==r;)t[n]="",n+=1;n<e.length&&(t[n]="",n+=1)}for(;n<e.length;){const s=e[n].trim();if(s.startsWith("<!--")){if(t[n]="",!s.includes("-->")){for(n+=1;n<e.length&&!e[n].includes("-->");)t[n]="",n+=1;n<e.length&&(t[n]="")}n+=1;continue}n+=1}return t}function iC(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function Vf(e){const t=e.split(/[?#]/,1)[0],n=t.startsWith("/"),r=[];for(const i of t.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r.pop();continue}r.push(i)}return`${n?"/":""}${r.join("/")}`||(n?"/":".")}function jee(e,t,n){const r=e.trim();if(!r||/^(?:https?:|mailto:|javascript:|data:|#)/i.test(r)||/^[a-z][a-z0-9+.-]*:/i.test(r))return null;const s=r.indexOf("#"),i=s>=0?r.slice(0,s):r,a=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=a?decodeURIComponent(a):null}catch{return null}const p=n?Vf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=Vf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=Vf(`${iC(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function Pee(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!ry(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=Vf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=Vf(`${iC(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const z2=128,Bee=360,ib=480;function pv(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function Fee(e,t,n,r){if(!t||!n)return null;let s,i;return pv(e)?(i=Math.min(Math.max(n,z2),Bee),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>ib&&(s=s*ib/i,i=ib),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function Oee(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function oC(e){const t=Oee(e),n=at(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function Qee({src:e,alt:t,title:n}){const r=pv(e),s=oC(e),i=b.useRef(null),[a,c]=b.useState(!1),[u,f]=b.useState(0),[p,g]=b.useState({status:"loading"}),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const T=i.current,L=T?.parentElement?.parentElement??T?.parentElement;if(!L)return;const I=()=>f(L.clientWidth);if(I(),typeof ResizeObserver>"u")return;const j=new ResizeObserver(I);return j.observe(L),()=>j.disconnect()},[]),b.useEffect(()=>{if(a)return;const T=i.current;if(!T||typeof IntersectionObserver>"u"){c(!0);return}const L=new IntersectionObserver(I=>{I.some(j=>j.isIntersecting)&&(c(!0),L.disconnect())},{rootMargin:"400px"});return L.observe(T),()=>L.disconnect()},[a]),b.useEffect(()=>{if(!a)return;const T=new AbortController;let L=null;g({status:"loading"});const I=window.setTimeout(()=>{T.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return fetch(s,{signal:T.signal}).then(async j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);const P=Number(j.headers.get("X-Image-Width"))||0,F=Number(j.headers.get("X-Image-Height"))||0;return{blob:await j.blob(),width:P,height:F}}).then(({blob:j,width:P,height:F})=>{T.signal.aborted||(L=URL.createObjectURL(j),P>0&&F>0&&v({width:P,height:F}),g({status:"ready",objectUrl:L}))}).catch(()=>{const j=T.signal.reason;T.signal.aborted&&!(j instanceof DOMException&&j.name==="TimeoutError")||g({status:"fallback"})}).finally(()=>{window.clearTimeout(I)}),()=>{window.clearTimeout(I),T.abort(),L&&URL.revokeObjectURL(L)}},[a,s]);const S=Fee(e,y?.width??0,y?.height??0,u),A=S??{width:z2*2,height:z2};return o.jsx("div",{ref:i,className:"block max-w-full",style:S?{width:S.width,height:S.height}:void 0,children:p.status==="ready"?o.jsx("img",{src:p.objectUrl,alt:t,title:n,decoding:"async",className:`${r?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):p.status==="fallback"?o.jsx("img",{src:s,alt:t,title:n,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):o.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:A.width,height:A.height},children:o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:t||"…"})})})}function ob(e,t,n,r,s){const i=Pee(n,s.markdownFilePath,s.rootPath);if(!i)return``;const a=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(Qee,{src:i,alt:t,title:r});return s.onImageOpen?o.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:r||t||"Open image",onClick:u=>{u.stopPropagation(),s.onImageOpen?.(a)},children:c},e):o.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c},e)}function ab(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function J4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function G2(e){const t=e.trim(),n=t.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(n)return{href:n[1],title:n[2]??n[3]??n[4]};const r=t.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return r?{href:r[1],title:r[2]??r[3]??r[4]}:null}const aC="",$ee=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function Hee(e){return e.replace($ee,(t,n)=>`${aC}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function e7(e){return e.replace(new RegExp(`${aC}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function Uee(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const lC={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Gp=null;function cC(){return Gp||(Gp=A0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Gp=null,e})),Gp}function uC({html:e}){const{t}=Zn(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),cC().then(i=>{s||r(i.sanitize(e,lC))}).catch(()=>{s||r("")}),()=>{s=!0}},[e]),n===null?o.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:t("rightSidebar.renderingHtml")}):n?o.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:n}}):null}function zee({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),cC().then(s=>{r||n(s.sanitize(e,lC))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function dC(e){const t=e.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!t)return null;const n=t[1].toLowerCase();return{tag:n,selfContained:new RegExp(`</${n}>`,"i").test(e)}}let Wp=null;function Gee(){return Wp||(Wp=Promise.all([A0(()=>import("./katex-DnlPpQZa.js"),[]),A0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Wp=null,e})),Wp}function fh({tex:e,display:t=!1}){const[n,r]=b.useState(null),[s,i]=b.useState(!1);if(b.useEffect(()=>{let c=!1;return r(null),i(!1),Gee().then(u=>{c||r(u.renderToString(e,{displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{c||i(!0)}),()=>{c=!0}},[t,e]),s)return o.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:t?`$$${e}$$`:`$${e}$`});if(!n)return o.jsx("span",{className:"text-muted-foreground/70",children:t?"Rendering formula...":e});const a=t?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return o.jsx("span",{className:a,dangerouslySetInnerHTML:{__html:n}})}function Wee(e,t,n){if(/^<br\s*\/?>$/i.test(e))return o.jsx("br",{},t);const r=e.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!r)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(e)?o.jsx(zee,{html:e},t):null;const s=r[1].toLowerCase(),i=Li(r[2],`${t}-${s}`,!0,n);return s==="kbd"?o.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:i},t):s==="mark"?o.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:i},t):s==="sub"?o.jsx("sub",{children:i},t):o.jsx("sup",{children:i},t)}function Li(e,t,n=!0,r){const s=Hee(e),i=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,a=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&a.push(e7(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?Wee(f,p,r):null;if(g)a.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))a.push(o.jsx(fh,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))a.push(o.jsx(fh,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;a.push(o.jsx("code",{className:`${n?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:Uee(f.slice(y,-y))},p))}else if(f.startsWith("~~"))a.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:Li(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))a.push(o.jsx("strong",{className:"font-semibold text-foreground",children:Li(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))a.push(o.jsx("em",{className:"italic",children:Li(f.slice(1,-1),`${p}-em`,n,r)},p));else if(f.startsWith("![")){const y=f.match(/^!\[([^\]]*)\]\((.*)\)$/),v=f.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^!\[([^\]]+)\]$/);if(y){const A=G2(y[2]);a.push(A?ob(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(Sm(A));a.push(T?ob(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(Sm(S[1]));a.push(A?ob(p,S[1],A.href,A.title,r):f)}else a.push(f)}else if(f.startsWith("[^")){const y=rC(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);a.push(v?o.jsx("sup",{id:`fnref-${v.id}`,title:v.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:o.jsx("a",{href:`#fn-${v.id}`,className:"text-primary no-underline",children:v.index})},p):f)}else if(f.startsWith("<http")){const y=f.slice(1,-1);a.push(o.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(f.startsWith("<")&&f.endsWith(">")&&J4(f.slice(1,-1))){const y=f.slice(1,-1);a.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(J4(ab(f).linkText)){const{linkText:y,suffix:v}=ab(f);a.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&a.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=ab(f),S=y.startsWith("www.")?`https://${y}`:y;a.push(o.jsx("a",{href:S,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&a.push(v)}else{const y=f.match(/^\[([^\]]+)\]\((.*)\)$/),v=f.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^\[([^\]]+)\]$/),A=v?v[2]||v[1]:S?.[1]??null,T=A?r.referenceDefinitions.get(Sm(A)):null,L=y?G2(y[2]):null,I=L?.href??T?.href??null,j=I?Iee(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";a.push(j?o.jsx("a",{href:j,title:L?.title??T?.title,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:Li(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&a.push(e7(s.slice(c))),a.length>0?a:[e]}function fC(e){return/(?: {2,}|\\)$/.test(e)}function hC(e){return e.replace(/(?: {2,}|\\)$/,"")}function lg(e){return/^(?: {4}|\t)/.test(e)}function pC(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function mC(e,t,n){const r=[];return e.forEach((s,i)=>{const a=fC(s);r.push(...Li(hC(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(a?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function W2(e,t,n){const r=[],s=[];return e.forEach((i,a)=>{s.push(fC(i)),r.push(Li(hC(i),`${t}-${a}`,!0,n))}),{perLine:r,hardBreaks:s}}function V2(e,t,n,r,s){const i=[];return e.forEach((a,c)=>{const u=n[c]??0,f=!!(s&&u>=s.start&&u<=s.end);i.push(o.jsx("span",{"data-md-ref-start":u,"data-md-ref-end":u,"data-selected":f?"true":void 0,children:a},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function hh(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,a=0;for(let c=0;c<t.length;c+=1){const u=t[c];if(s){r+=u,s=!1;continue}if(u==="\\"){s=!0;continue}if(u==="`"){const f=c;for(;c+1<t.length&&t[c+1]==="`";)c+=1;const p=c-f+1;r+="`".repeat(p),i===0?i=p:i===p&&(i=0);continue}if(i===0&&u==="["?a+=1:i===0&&u==="]"&&a>0&&(a-=1),u==="|"&&i===0&&a===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function gC(e){return hh(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function cg(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function ug(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function Vee(e,t){return e>96||e>44&&t>.35}function mv(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function gv(e){const t=e.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!t)return null;const n=/^\d+[.)]$/.test(t[1]);return{ordered:n,start:n?Number.parseInt(t[1],10):void 0,content:t[2]}}function xC(e,t,n,r,s,i=new Set){const a=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(ag(f)||i.has(u))){u+=1;continue}const p=gv(f),g=mv(f);if(!p){if(g>n&&c.length>0){([...c].reverse().find(A=>A.indent<g)?.item??c[c.length-1].item).paragraphs.push(f.trim());for(const A of c)A.item.lineEnd=u+1;u+=1;continue}break}if(g<n||g===n&&p.ordered!==r)break;const y={content:p.content,ordered:p.ordered,start:p.start,children:[],paragraphs:[],lineStart:u+1,lineEnd:u+1};for(;c.length>0&&c[c.length-1].indent>=g;)c.pop();const v=c[c.length-1]?.item??null;v?v.children.push(y):a.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:a,nextIndex:u}}function xv(e,t,n,r=0){return e.map((s,i)=>{const a=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!a,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[a?o.jsx("input",{type:"checkbox",checked:a[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,Li(a?.[2]??s.content,`li-${t}-${i}`,!0,n),s.paragraphs.length>0&&o.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:s.paragraphs.map((c,u)=>o.jsx("p",{children:Li(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:qee(s.children,`${t}-${i}`,n,r)}})}function qee(e,t,n,r=0){const s=[];for(const i of e){const a=s[s.length-1];a&&a.ordered===i.ordered?a.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,a)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:xv(i.items,`${t}-g${a}`,n,r)}))}function bv(e,t){return e.map(n=>{const r=!!(t&&n.refStart<=t.end&&n.refEnd>=t.start);return o.jsxs("li",{className:n.taskItem?"list-none":void 0,"data-md-ref-start":n.refStart,"data-md-ref-end":n.refEnd,"data-selected":r?"true":void 0,children:[n.content,n.groups.length>0&&Kee(n.groups,t)]},n.key)})}function Kee(e,t){return e.map((n,r)=>{const s=n.ordered?"ol":"ul";return o.jsx(s,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:bv(n.items,t)},`nested-${r}`)})}function Yee(e){const t=Array.from(e.footnoteDefinitions.values()).sort((n,r)=>n.index-r.index);return t.length===0?null:o.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:e.footnotesLabel}),o.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:t.map(n=>o.jsxs("li",{id:`fn-${n.id}`,children:[Li(n.text,`footnote-${n.id}`,!0,e)," ",o.jsx("a",{href:`#fnref-${n.id}`,className:"text-primary no-underline","aria-label":e.backToFootnoteLabel(n.index),children:"↩"})]},n.id))})]})}function Xee(e,t,n,r){const s=[];let i=0;const a=c=>r?.[c]??c+1;for(;i<e.length;){const c=e[i],u=c.trim();if(!u){i+=1;continue}if(/^<details>\s*$/i.test(u)){const L=i;let I="Details";const j=[];for(i+=1;i<e.length&&!/^<\/details>\s*$/i.test(e[i].trim());){const P=e[i].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);P?I=P[1].trim()||I:j.push(e[i].trimStart()),i+=1}i<e.length&&(i+=1),s.push({kind:"static",node:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:Li(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:mC(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=dC(c);if(f){const L=[c],I=i;for(i+=1;i<e.length&&!f.selfContained&&!new RegExp(`</${f.tag}>`,"i").test(e[i]);)L.push(e[i]),i+=1;i<e.length&&!f.selfContained&&(L.push(e[i]),i+=1),s.push({kind:"static",node:o.jsx(uC,{html:L.join(`
|
|
182
182
|
`)},`${t}-html-${I}`)});continue}const p=u.match(/^(```|~~~)\s*(.*)$/);if(p){const L=[],I=p[1],j=p[2]?.trim(),P=i;for(i+=1;i<e.length&&!e[i].trim().startsWith(I);)L.push(e[i]),i+=1;i<e.length&&(i+=1),j.toLowerCase()==="mermaid"?s.push({kind:"static",node:o.jsx(yC,{code:L.join(`
|
|
183
183
|
`),blockKey:`${t}-code-${P}`},`${t}-code-${P}`)}):["math","latex","tex"].includes(j.toLowerCase())?s.push({kind:"static",node:o.jsx(fh,{tex:L.join(`
|
|
184
184
|
`),display:!0},`${t}-code-${P}`)}):s.push({kind:"code",key:`${t}-code-${P}`,code:L.join(`
|
|
185
185
|
`),lang:j,blockKey:`${t}-code-${P}`,codeStartLine:a(P)+1});continue}if(lg(c)){const L=[],I=i;for(;i<e.length&&(lg(e[i])||!e[i].trim());)L.push(e[i].trim()?pC(e[i]):""),i+=1;s.push({kind:"code",key:`${t}-indented-code-${I}`,code:L.join(`
|
|
186
|
-
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:a(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=nC(g[2]),P=U2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:Li(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&ug(e[i+1])){const L=hh(c),I=gC(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(hh(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:qT,"data-markdown-table-scroll":!0,children:o.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[o.jsx("thead",{className:"bg-surface-2 text-foreground",children:o.jsx("tr",{children:L.map((F,R)=>o.jsx("th",{className:`${WT} ${cg(I[R]??null)}`,children:o.jsx("div",{className:og,children:Li(F,`${t}-th-${P}-${R}`,!0,n)})},`h-${R}`))})}),o.jsx("tbody",{children:j.map((F,R)=>o.jsx("tr",{className:"border-t border-border/10",children:L.map((C,$)=>o.jsx("td",{className:`${VT} ${cg(I[$]??null)}`,children:o.jsx("div",{className:og,children:Li(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=gv(c);if(y){const L=y.ordered,I=mv(c),j=y.start,P=i,F=xC(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:xv(F.items,`${t}-list-${P}`,n,a(0)-1)});continue}const v=[c.trimStart()],S=[a(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!H2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&ug(e[i+1]));)v.push(e[i].trimStart()),S.push(a(i)),i+=1;const T=W2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function Zee(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:V2(n.perLine,n.hardBreaks,n.lineNums,n.keyPrefix,t)},n.keyPrefix);case"list":{const r=n.ordered?"ol":"ul";return o.jsx(r,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:bv(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(dg,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Vp=null,t7=!1;const qp=16,bC=192;function Jee(){return Vp||(Vp=A0(()=>import("./mermaid.core-
|
|
186
|
+
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:a(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=nC(g[2]),P=U2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:Li(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&ug(e[i+1])){const L=hh(c),I=gC(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(hh(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:qT,"data-markdown-table-scroll":!0,children:o.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[o.jsx("thead",{className:"bg-surface-2 text-foreground",children:o.jsx("tr",{children:L.map((F,R)=>o.jsx("th",{className:`${WT} ${cg(I[R]??null)}`,children:o.jsx("div",{className:og,children:Li(F,`${t}-th-${P}-${R}`,!0,n)})},`h-${R}`))})}),o.jsx("tbody",{children:j.map((F,R)=>o.jsx("tr",{className:"border-t border-border/10",children:L.map((C,$)=>o.jsx("td",{className:`${VT} ${cg(I[$]??null)}`,children:o.jsx("div",{className:og,children:Li(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=gv(c);if(y){const L=y.ordered,I=mv(c),j=y.start,P=i,F=xC(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:xv(F.items,`${t}-list-${P}`,n,a(0)-1)});continue}const v=[c.trimStart()],S=[a(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!H2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&ug(e[i+1]));)v.push(e[i].trimStart()),S.push(a(i)),i+=1;const T=W2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function Zee(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:V2(n.perLine,n.hardBreaks,n.lineNums,n.keyPrefix,t)},n.keyPrefix);case"list":{const r=n.ordered?"ol":"ul";return o.jsx(r,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:bv(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(dg,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Vp=null,t7=!1;const qp=16,bC=192;function Jee(){return Vp||(Vp=A0(()=>import("./mermaid.core-Bhj0Bx21.js").then(e=>e.aJ),__vite__mapDeps([6,1,7])).then(e=>e.default??e).catch(e=>{throw Vp=null,e})),Vp}function ete(e){t7||(e.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"}),t7=!0)}function tte(e){const t=e.match(/\sviewBox=(["'])([^"']+)\1/i);if(!t)return e;const[,,n]=t,r=n.trim().split(/[\s,]+/).map(Number),[,,s,i]=r;if(!Number.isFinite(s)||!Number.isFinite(i)||s<=0||i<=0)return e;const a=Math.max(bC,Math.ceil(s)),c=Math.ceil(a/s*i);return e.replace(/<svg\b([^>]*)>/i,(u,f)=>`<svg${f.replace(/\s(?:width|height)=(["']).*?\1/gi,"").replace(/\sstyle=(["']).*?\1/gi,"")} width="${a}" height="${c}">`)}function nte(e){const t=e?.querySelector("svg");if(!t)return;let n;try{n=t.getBBox()}catch{return}if(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<=0||n.height<=0)return;const r=n.x-qp,s=n.y-qp,i=n.width+qp*2,a=n.height+qp*2,c=Math.max(bC,Math.ceil(i)),u=Math.ceil(c/i*a);t.setAttribute("viewBox",`${r} ${s} ${i} ${a}`),t.setAttribute("width",String(c)),t.setAttribute("height",String(u)),t.removeAttribute("style")}function rte(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t)return null;const n=t.replace(/^language-/,"");return u0(`code.${n}`)??n}function yC({code:e,blockKey:t}){const{t:n}=Zn(),[r,s]=b.useState(null),[i,a]=b.useState(!1),c=b.useRef(null),u=b.useContext(eC);b.useEffect(()=>{let p=!1;return s(null),a(!1),Jee().then(async g=>{ete(g);const y=`termdock-md-mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`,{svg:v}=await g.render(y,e);p||s(tte(v))}).catch(()=>{p||a(!0)}),()=>{p=!0}},[t,e]),b.useLayoutEffect(()=>{r&&nte(c.current)},[r]);const f=b.useCallback(()=>{const p=c.current?.querySelector("svg")?.outerHTML??r;p&&u?.(p)},[u,r]);return i?o.jsx(dg,{code:e,lang:"mermaid",blockKey:`${t}-fallback`}):o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[o.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:"mermaid"}),o.jsx("div",{className:"bg-surface p-3",children:r?o.jsx("button",{type:"button",className:"block max-w-full rounded text-left focus:outline-none focus:ring-2 focus:ring-ring/45",title:n("rightSidebar.openMermaidDiagram"),onClick:p=>{p.stopPropagation(),f()},children:o.jsx("span",{ref:c,role:"img","aria-label":n("rightSidebar.mermaidDiagram"),className:"block max-h-[70vh] max-w-full overflow-auto rounded bg-white p-2 text-slate-900 [&_svg]:block [&_svg]:h-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:r}})}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:n("rightSidebar.renderingDiagram")})})]})}function dg({code:e,lang:t,blockKey:n,codeStartLine:r,lineRange:s}){const i=rte(t),[a,c]=b.useState(null);b.useEffect(()=>{if(!i||!pT(e)){c(null);return}let f=!1;return mT().then(p=>{if(f||!p.registered(i)){f||c(null);return}try{c(gT(p,e,i))}catch{f||c(null)}}).catch(()=>{f||c(null)}),()=>{f=!0}},[n,e,i]);const u=a??(e||" ").split(`
|
|
187
187
|
`).map(f=>[f||" "]);return o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[t&&o.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),o.jsx("pre",{className:`${hv} termdock-code overflow-auto p-3 text-[11px] leading-relaxed text-foreground`,children:o.jsx("code",{children:u.map((f,p)=>{const g=r!=null?r+p:null,y=!!(s&&g!=null&&g>=s.start&&g<=s.end);return o.jsxs("span",{"data-md-ref-start":g??void 0,"data-md-ref-end":g??void 0,"data-selected":y?"true":void 0,children:[f,p<u.length-1?`
|
|
188
188
|
`:null]},`${n}-line-${p}`)})})})]})}function ste(e,t,n,r,s){e=Dee(e);const i=Ree(e),a=Mee(e),c=[],u={markdownFilePath:t,rootPath:n,referenceDefinitions:i,footnoteDefinitions:Nee(e),headingSlugCounts:new Map,images:c,onImageOpen:r,footnotesLabel:s?.footnotes??"Footnotes",backToFootnoteLabel:s?.backToFootnote??(y=>`Back to footnote ${y}`)},f=[];let p=0;for(;p<e.length;){const y=e[p],v=y.trim();if(ag(y)||a.has(p)){p+=1;continue}if(!v){p+=1;continue}if(/^<details>\s*$/i.test(v)){const R=p;let C="Details";const $=[];for(p+=1;p<e.length&&!/^<\/details>\s*$/i.test(e[p].trim());){const H=e[p].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);H?C=H[1].trim()||C:$.push(e[p].trimStart()),p+=1}p<e.length&&(p+=1),f.push({key:`details-${R}`,startLine:R+1,endLine:p,content:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:Li(C,`details-${R}-summary`,!0,u)}),$.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:mC($,`details-${R}`,u)})]})});continue}const S=dC(y);if(S){const R=[y],C=p;for(p+=1;p<e.length&&!S.selfContained&&!new RegExp(`</${S.tag}>`,"i").test(e[p]);)R.push(e[p]),p+=1;p<e.length&&!S.selfContained&&(R.push(e[p]),p+=1),f.push({key:`html-${C}`,startLine:C+1,endLine:p,content:o.jsx(uC,{html:R.join(`
|
|
189
189
|
`)})});continue}const A=v.match(/^(```|~~~)\s*(.*)$/);if(A){const R=[],C=A[1],$=A[2]?.trim(),H=p;for(p+=1;p<e.length&&!e[p].trim().startsWith(C);)R.push(e[p]),p+=1;p<e.length&&(p+=1),f.push({key:`code-${H}`,startLine:H+1,endLine:p,fineGrained:$.toLowerCase()!=="mermaid"&&!["math","latex","tex"].includes($.toLowerCase()),content:$.toLowerCase()==="mermaid"?o.jsx(yC,{code:R.join(`
|
|
@@ -627,4 +627,4 @@ new file mode 100644
|
|
|
627
627
|
@@ -0,0 +1,2 @@
|
|
628
628
|
+export const second = true;
|
|
629
629
|
+announce(second);`}};function _7(){if(typeof window>"u")return"kotlin";const t=new URLSearchParams(window.location.search).get("fixture");return t&&t in Y2?t:"kotlin"}function L7(){return typeof window>"u"?"unified":new URLSearchParams(window.location.search).get("view")==="split"?"split":"unified"}function E7(){if(typeof window>"u")return"words";const e=new URLSearchParams(window.location.search).get("inline");return e==="none"||e==="chars"||e==="words"?e:"words"}function I7(){return typeof window>"u"?!0:new URLSearchParams(window.location.search).get("wrap")!=="off"}function xne(){const[e,t]=b.useState(()=>_7()),[n,r]=b.useState(()=>L7()),[s,i]=b.useState(()=>LT()),[a,c]=b.useState(()=>E7()),[u,f]=b.useState(()=>I7()),p=Y2[e],g=b.useMemo(()=>Object.entries(Y2),[]),y=n==="split"&&!s?"unified":n;return b.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const v=window.matchMedia(uv),S=()=>i(v.matches);return S(),v.addEventListener?.("change",S),()=>v.removeEventListener?.("change",S)},[]),b.useEffect(()=>{if(typeof window>"u")return;let v=window.location.search;const S=()=>{window.location.search!==v&&(v=window.location.search,t(_7()),r(L7()),c(E7()),f(I7()))};window.addEventListener("popstate",S),window.addEventListener("pageshow",S),window.addEventListener("focus",S);const A=window.setInterval(S,250);return()=>{window.removeEventListener("popstate",S),window.removeEventListener("pageshow",S),window.removeEventListener("focus",S),window.clearInterval(A)}},[]),o.jsx("div",{className:"min-h-screen bg-background-subtle text-foreground","data-diff-lab":!0,"data-diff-lab-fixture":e,"data-diff-lab-view":y,"data-diff-lab-requested-view":n,"data-diff-lab-inline":a,"data-diff-lab-wrap":u?"on":"off",children:o.jsxs("div",{className:"mx-auto flex min-h-screen max-w-[1180px] flex-col px-4 py-4",children:[o.jsxs("header",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 border-b border-border/20 pb-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-semibold",children:"Diff Lab"}),o.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Fixed fixtures for iterating diff rendering without app auth, PWA state, or live Git data."})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("select",{value:e,onChange:v=>t(v.target.value),"aria-label":"Fixture",className:"h-8 rounded-md border border-border/30 bg-surface px-2 text-xs text-foreground outline-none",children:g.map(([v,S])=>o.jsx("option",{value:v,children:S.label},v))}),o.jsxs("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:[o.jsx("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":y==="unified",className:`rounded-full px-3 text-xs font-semibold ${y==="unified"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Unified"}),o.jsx("button",{type:"button",onClick:()=>r("split"),disabled:!s,"aria-pressed":y==="split",className:`rounded-full px-3 text-xs font-semibold ${y==="split"?"bg-surface-elevated text-foreground":"text-muted-foreground"} disabled:cursor-not-allowed disabled:opacity-40`,children:"Split"})]}),o.jsx("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:["none","words","chars"].map(v=>o.jsx("button",{type:"button",onClick:()=>c(v),className:`rounded-full px-3 text-xs font-semibold ${a===v?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:v},v))}),o.jsxs("button",{type:"button",onClick:()=>f(v=>!v),className:`h-8 rounded-full px-3 text-xs font-semibold ${u?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground"}`,children:["Wrap ",u?"on":"off"]})]})]}),o.jsx("main",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border/20 bg-surface",children:o.jsx(ET,{filePath:p.path,repoRoot:"/tmp/termdock-diff-lab",changedFile:{path:p.path,absolutePath:`/tmp/termdock-diff-lab/${p.path}`,repoRoot:"/tmp/termdock-diff-lab",status:"modified",staged:!1,unstaged:!0,untracked:!1,tracked:!0,canStage:!1,canUnstage:!1,canStash:!1,canRestoreWorktree:!1},diffOverride:p.diff,oldSourceOverride:p.oldSource,active:!0,wrap:u,showScrollHint:!u,viewType:y,inlineMode:a})})]})})}const MC=40,X2="/tmp/termdock-diff-review-lab";function R7(e,t){const n=[`diff --git a/${e} b/${e}`,`--- a/${e}`,`+++ b/${e}`,`@@ -1,${t} +1,${t} @@`];for(let r=0;r<t;r+=1)r%5===0&&n.push(`-const removed_${r} = ${r};`),r%3===0&&n.push(`+const added_${r} = ${r} * 2;`),n.push(` context line ${r} in ${e}`);return n.join(`
|
|
630
|
-
`)}function bne(e,t){return Array.from({length:MC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,a=`${X2}/${i}`,c=R7(i,s),u=R7(i,1);return{key:a,path:i,absolutePath:a,status:"modified",repoRoot:X2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function yne(){const e=b.useMemo(()=>{if(typeof window>"u")return 0;const L=new URLSearchParams(window.location.search).get("delay"),I=L===null?0:Number.parseInt(L,10);return Number.isInteger(I)&&I>0?I:0},[]),t=e>0,[n,r]=b.useState(()=>new Set);b.useEffect(()=>{if(!t)return;const L=Array.from({length:MC},(I,j)=>window.setTimeout(()=>{r(P=>{const F=new Set(P);return F.add(j),F})},e+j*20));return()=>L.forEach(I=>window.clearTimeout(I))},[t,e]);const s=b.useMemo(()=>bne(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:X2,label:"diff-review-lab",files:s.map(L=>({key:L.key,path:L.path,absolutePath:L.absolutePath,displayName:L.displayName,displayDir:L.displayDir,status:L.status}))}],[s]),a=b.useMemo(()=>{if(typeof window>"u")return null;const L=new URLSearchParams(window.location.search).get("select");if(L===null)return null;const I=Number.parseInt(L,10);return Number.isInteger(I)&&I>=0&&I<s.length?I:null},[s.length]),[c,u]=b.useState(()=>a!==null?s[a].key:null),[f,p]=b.useState(()=>({key:a!==null?s[a].key:null,nonce:a!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(a!==null?1:0);return o.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground","data-diff-review-lab":!0,children:[o.jsxs("div",{className:"shrink-0 border-b border-border/20 px-3 py-2 text-xs text-muted-foreground",children:["DiffReview Lab · ",s.length," mock files · selected: ",o.jsx("span",{"data-lab-selected":!0,children:c??"none"})," · slide ",A]}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(rg,{mobile:!0,backLabel:"Back",files:s,groups:i,selectedKey:c,scrollToKey:f.key,scrollToKeyNonce:f.nonce,mode:g,onModeChange:L=>{L!=="ai"&&y(L)},collapsedDirectoryKeys:v,onToggleDirectory:L=>S(I=>{const j=new Set(I);return j.has(L)?j.delete(L):j.add(L),j}),onSelectFile:L=>{u(L.key),p(I=>({key:L.key,nonce:I.nonce+1}))},onMobileSlideChange:T,renderLeading:()=>null,renderStreamBadge:L=>o.jsx("span",{className:"text-[10px] text-muted-foreground",children:L}),wrap:!0,showScrollHint:!1,activePane:!0})})]})}const vne=6e4,xb="termdock:build-id:v1";let N7=!1;function M7(){N7||(N7=!0,window.setTimeout(()=>{window.location.reload()},80))}function Z2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function wne(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function Sne(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&Z2(e)})})}function Ane(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="
|
|
630
|
+
`)}function bne(e,t){return Array.from({length:MC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,a=`${X2}/${i}`,c=R7(i,s),u=R7(i,1);return{key:a,path:i,absolutePath:a,status:"modified",repoRoot:X2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function yne(){const e=b.useMemo(()=>{if(typeof window>"u")return 0;const L=new URLSearchParams(window.location.search).get("delay"),I=L===null?0:Number.parseInt(L,10);return Number.isInteger(I)&&I>0?I:0},[]),t=e>0,[n,r]=b.useState(()=>new Set);b.useEffect(()=>{if(!t)return;const L=Array.from({length:MC},(I,j)=>window.setTimeout(()=>{r(P=>{const F=new Set(P);return F.add(j),F})},e+j*20));return()=>L.forEach(I=>window.clearTimeout(I))},[t,e]);const s=b.useMemo(()=>bne(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:X2,label:"diff-review-lab",files:s.map(L=>({key:L.key,path:L.path,absolutePath:L.absolutePath,displayName:L.displayName,displayDir:L.displayDir,status:L.status}))}],[s]),a=b.useMemo(()=>{if(typeof window>"u")return null;const L=new URLSearchParams(window.location.search).get("select");if(L===null)return null;const I=Number.parseInt(L,10);return Number.isInteger(I)&&I>=0&&I<s.length?I:null},[s.length]),[c,u]=b.useState(()=>a!==null?s[a].key:null),[f,p]=b.useState(()=>({key:a!==null?s[a].key:null,nonce:a!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(a!==null?1:0);return o.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground","data-diff-review-lab":!0,children:[o.jsxs("div",{className:"shrink-0 border-b border-border/20 px-3 py-2 text-xs text-muted-foreground",children:["DiffReview Lab · ",s.length," mock files · selected: ",o.jsx("span",{"data-lab-selected":!0,children:c??"none"})," · slide ",A]}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(rg,{mobile:!0,backLabel:"Back",files:s,groups:i,selectedKey:c,scrollToKey:f.key,scrollToKeyNonce:f.nonce,mode:g,onModeChange:L=>{L!=="ai"&&y(L)},collapsedDirectoryKeys:v,onToggleDirectory:L=>S(I=>{const j=new Set(I);return j.has(L)?j.delete(L):j.add(L),j}),onSelectFile:L=>{u(L.key),p(I=>({key:L.key,nonce:I.nonce+1}))},onMobileSlideChange:T,renderLeading:()=>null,renderStreamBadge:L=>o.jsx("span",{className:"text-[10px] text-muted-foreground",children:L}),wrap:!0,showScrollHint:!1,activePane:!0})})]})}const vne=6e4,xb="termdock:build-id:v1";let N7=!1;function M7(){N7||(N7=!0,window.setTimeout(()=>{window.location.reload()},80))}function Z2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function wne(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function Sne(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&Z2(e)})})}function Ane(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="1788330362086",t=window.localStorage.getItem(xb);if(t&&t!==e){wne().finally(()=>{window.localStorage.setItem(xb,e),M7()});return}t!==e&&window.localStorage.setItem(xb,e);let n=null;navigator.serviceWorker.addEventListener("controllerchange",M7),window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"}).then(r=>{Sne(r),Z2(r);const s=()=>{document.visibilityState==="visible"&&r.update().then(()=>Z2(r)).catch(()=>{})};s(),n=window.setInterval(s,vne),document.addEventListener("visibilitychange",s)}).catch(()=>{})}),window.addEventListener("beforeunload",()=>{n!==null&&window.clearInterval(n)})}dO();Ane();try{const e=JSON.parse(window.localStorage.getItem("termdock-color-theme")||"null");(e==="dark"||e==="light")&&(document.documentElement.dataset.theme=e,m9(e))}catch{}function Tne(){const{t:e}=Zn(),[t,n]=b.useState(null),[r,s]=b.useState(null),i=b.useCallback(async()=>{try{const a=await VE();n(a),s(null)}catch(a){s(a instanceof Error?a.message:"Failed to query auth status")}},[]);return b.useEffect(()=>{i()},[i]),b.useEffect(()=>{const a=()=>{n(c=>c&&{...c,authenticated:!1})};return window.addEventListener(qf,a),()=>window.removeEventListener(qf,a)},[]),t===null?o.jsx("div",{className:"flex w-screen items-center justify-center bg-background text-muted-foreground",style:{height:"var(--app-vh, 100vh)"},children:r?`${e("common.error")}: ${r}`:e("common.loading")}):t.enabled&&!t.authenticated?o.jsx(mne,{onLoginSuccess:i}):o.jsx(hne,{})}h_.createRoot(document.getElementById("root")).render(o.jsx(D.StrictMode,{children:o.jsx(NR,{children:o.jsx(wS,{children:(()=>{const e=new URLSearchParams(window.location.search);return e.get("dag-playground")==="1"?o.jsx(gne,{}):e.get("diff-review-lab")==="1"?o.jsx(yne,{}):e.get("diff-lab")==="1"?o.jsx(xne,{}):o.jsx(Tne,{})})()})})}));export{cM as M,Bs as R,eD as S,A0 as _,pM as a,gM as b,kt as c,o as j,Zn as u,qL as v};
|