termdock 1.4.111 → 1.4.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ModelPreview-B2B3H2Ix.js → ModelPreview-5X_nSoT6.js} +1 -1
- package/dist/client/assets/{abnfDiagram-VRR7QNED-B_RGrqGh.js → abnfDiagram-VRR7QNED-BejuBcRz.js} +1 -1
- package/dist/client/assets/{arc-D8fuDlDq.js → arc-CkJmgTVH.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZJ3FMSHR-C7OEgr0V.js → architectureDiagram-ZJ3FMSHR-CjQLWlX3.js} +1 -1
- package/dist/client/assets/{blockDiagram-677ZJIJ3-B0lliUOg.js → blockDiagram-677ZJIJ3-De7LfnfF.js} +1 -1
- package/dist/client/assets/{c4Diagram-LMCZKHZV-D_gNLjhL.js → c4Diagram-LMCZKHZV-D7aSKjrP.js} +1 -1
- package/dist/client/assets/channel-Di00g3Ei.js +1 -0
- package/dist/client/assets/{chunk-2Q5K7J3B-5wOu_9am.js → chunk-2Q5K7J3B-BBhO85Wt.js} +1 -1
- package/dist/client/assets/{chunk-32BRIVSS-CWU9Z9OC.js → chunk-32BRIVSS-BBsukLgj.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-CmFeFJEr.js → chunk-5VM5RSS4-pLX8G6XF.js} +1 -1
- package/dist/client/assets/{chunk-EX3LRPZG-C99e65el.js → chunk-EX3LRPZG-CyIhN1O9.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-BFyaZVDz.js → chunk-JWPE2WC7-DS700JlH.js} +1 -1
- package/dist/client/assets/{chunk-MOJQB5TN-DlvRLmHd.js → chunk-MOJQB5TN-B8YImCjU.js} +1 -1
- package/dist/client/assets/{chunk-RYQCIY6F-Dxo59sOh.js → chunk-RYQCIY6F-1vqg8sFr.js} +1 -1
- package/dist/client/assets/{chunk-V7JOEXUC-OTtxF8wx.js → chunk-V7JOEXUC-Codi_ivq.js} +1 -1
- package/dist/client/assets/{chunk-VR4S4FIN-VpAX1m9L.js → chunk-VR4S4FIN-DLnwOhKw.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-BOpEyvyZ.js → chunk-XXDRQBXY-BrhrHwLG.js} +1 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-C0rgFCNz.js +1 -0
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-C0rgFCNz.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-CbUPsduV.js → cose-bilkent-JH36ORCC-BH1cdm2G.js} +1 -1
- package/dist/client/assets/{cynefin-VYW2F7L2-BnEnpq42.js → cynefin-VYW2F7L2-Bb4AVgi9.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-TSTJHNR4-8pkQjQY5.js → cynefinDiagram-TSTJHNR4-DtUcSupE.js} +1 -1
- package/dist/client/assets/{dagre-VKFMJZFB-CnpOkLPA.js → dagre-VKFMJZFB-C5orczKC.js} +1 -1
- package/dist/client/assets/{diagram-FQU43EPY-BbXZVIci.js → diagram-FQU43EPY-BqYYJ6NP.js} +1 -1
- package/dist/client/assets/{diagram-G47NLZAW-33lA6lMi.js → diagram-G47NLZAW-D2tQ100W.js} +1 -1
- package/dist/client/assets/{diagram-NH7WQ7WH-D969Lz99.js → diagram-NH7WQ7WH-DR7KHAqK.js} +1 -1
- package/dist/client/assets/{diagram-OA4YK3LP-jyJW-6fp.js → diagram-OA4YK3LP-qcGKx_SU.js} +1 -1
- package/dist/client/assets/{diagram-WEI45ONY-BlxPX4rh.js → diagram-WEI45ONY-DQEogh0x.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-CCIWWBDH-R7BjUQE0.js → ebnfDiagram-CCIWWBDH-DF73pnx9.js} +1 -1
- package/dist/client/assets/{erDiagram-Q63AITRT-BaT08OkR.js → erDiagram-Q63AITRT-BA9GGyab.js} +1 -1
- package/dist/client/assets/{flowDiagram-23GEKE2U-rzUqlg7l.js → flowDiagram-23GEKE2U-DrctsU4a.js} +1 -1
- package/dist/client/assets/{ganttDiagram-NO4QXBWP-BRiQQKV3.js → ganttDiagram-NO4QXBWP-D2XnU1rZ.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-IHSO6WYX-qQ8yyBgt.js → gitGraphDiagram-IHSO6WYX-C0G2PrRK.js} +1 -1
- package/dist/client/assets/{index-DZ3m8aTM.js → index-DKda5Kox.js} +4 -4
- package/dist/client/assets/{infoDiagram-FWYZ7A6U-Cd-DvFU1.js → infoDiagram-FWYZ7A6U-BX1A93rv.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-FXEZZL3T-DOKNBTva.js → ishikawaDiagram-FXEZZL3T-Bbb_QACX.js} +1 -1
- package/dist/client/assets/{journeyDiagram-5HDEW3XC-BcqJIz-V.js → journeyDiagram-5HDEW3XC-BrlM7WN1.js} +1 -1
- package/dist/client/assets/{kanban-definition-HUTT4EX6-BKDSfLC5.js → kanban-definition-HUTT4EX6-BFcFBO2O.js} +1 -1
- package/dist/client/assets/{linear-BPEBfxtL.js → linear-C4ftdIdX.js} +1 -1
- package/dist/client/assets/{mermaid.core-DRiuhpyl.js → mermaid.core-BXdCtSXM.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LN4V7U3C-D_Lz_tAR.js → mindmap-definition-LN4V7U3C-DWFtXisD.js} +1 -1
- package/dist/client/assets/{pegDiagram-2B236MQR-DcaC1WDR.js → pegDiagram-2B236MQR-CqwAgbDa.js} +1 -1
- package/dist/client/assets/{pieDiagram-ENE6RG2P-CwlLlx-j.js → pieDiagram-ENE6RG2P-C4Fx3_bP.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-ABIIQ3AL-CppoTlSS.js → quadrantDiagram-ABIIQ3AL-9n5y4pY3.js} +1 -1
- package/dist/client/assets/{railroadDiagram-RFXS5EU6-CWRoVZGN.js → railroadDiagram-RFXS5EU6-DI_v0qDZ.js} +1 -1
- package/dist/client/assets/{requirementDiagram-TGXJPOKE-CA60L5D8.js → requirementDiagram-TGXJPOKE-DutPggPk.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-HTMAVEWB-CginUYn-.js → sankeyDiagram-HTMAVEWB-C06RwUtt.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-DBY2YBRQ-BaSDZj2t.js → sequenceDiagram-DBY2YBRQ-DcZ9svTP.js} +1 -1
- package/dist/client/assets/{sizeCapture-X5ZJPWSS-CHh0EWan.js → sizeCapture-X5ZJPWSS-CKg6qNRP.js} +1 -1
- package/dist/client/assets/{stateDiagram-2N3HPSRC-BKv0Coez.js → stateDiagram-2N3HPSRC-D_EcHzgL.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-CuoY6NCV.js +1 -0
- package/dist/client/assets/{swimlanes-5IMT3BWC-D2dLDa0q.js → swimlanes-5IMT3BWC-CJau-zNf.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-Dkn3ogV3.js +8 -0
- package/dist/client/assets/{timeline-definition-FHXFAJF6-bC8KgKqE.js → timeline-definition-FHXFAJF6-CuhORss5.js} +1 -1
- package/dist/client/assets/{vennDiagram-L72KCM5P-B2KDKlUF.js → vennDiagram-L72KCM5P-BCathpDO.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-EHGQE667-BQ9p_rao.js → wardleyDiagram-EHGQE667-41bcl4mk.js} +1 -1
- package/dist/client/assets/{xychartDiagram-FW5EYKEG-CudwkA9w.js → xychartDiagram-FW5EYKEG-CQg5FqjB.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-BrsU0XVb.js +0 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-Dj3A_N_-.js +0 -1
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-Dj3A_N_-.js +0 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-16TE83sZ.js +0 -1
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-C_OtlAfj.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-5X_nSoT6.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/katex-55ZPZeOF.css","assets/mermaid.core-BXdCtSXM.js","assets/purify.es-CC4Brkr_.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as rg,a as Mk,g as u7}from"./react-XDCjal2T.js";import{b,R as D,r as oa,a as Dk}from"./dnd-BCFAPC0L.js";import{L as jk,l as Pk}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 l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 u1={exports:{}},j0={};var x5;function Bk(){if(x5)return j0;x5=1;var e=rg(),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 l(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 j0.Fragment=n,j0.jsx=l,j0.jsxs=l,j0}var b5;function Fk(){return b5||(b5=1,u1.exports=Bk()),u1.exports}var o=Fk(),ep={},y5;function Ok(){if(y5)return ep;y5=1;var e=Mk();return ep.createRoot=e.createRoot,ep.hydrateRoot=e.hydrateRoot,ep}var Qk=Ok();const $k=u7(Qk);function v5(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function D2(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]:v5(t[r])&&v5(e[r])&&Object.keys(t[r]).length>0&&D2(e[r],t[r])})}const d7={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 Uu(){const e=typeof document<"u"?document:{};return D2(e,d7),e}const Hk={document:d7,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 Qo(){const e=typeof window<"u"?window:{};return D2(e,Hk),e}function Uk(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function zk(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function f7(e,t=0){return setTimeout(e,t)}function mm(){return Date.now()}function Gk(e){const t=Qo();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function Wk(e,t="x"){const n=Qo();let r,s,i;const l=Gk(e);return n.WebKitCSSMatrix?(s=l.transform||l.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(c=>c.replace(",",".")).join(", ")),i=new n.WebKitCSSMatrix(s==="none"?"":s)):(i=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.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 tp(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function Vk(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function xa(...e){const t=Object(e[0]);for(let n=1;n<e.length;n+=1){const r=e[n];if(r!=null&&!Vk(r)){const s=Object.keys(Object(r)).filter(i=>i!=="__proto__"&&i!=="constructor"&&i!=="prototype");for(let i=0,l=s.length;i<l;i+=1){const c=s[i],u=Object.getOwnPropertyDescriptor(r,c);u!==void 0&&u.enumerable&&(tp(t[c])&&tp(r[c])?r[c].__swiper__?t[c]=r[c]:xa(t[c],r[c]):!tp(t[c])&&tp(r[c])?(t[c]={},r[c].__swiper__?t[c]=r[c]:xa(t[c],r[c])):t[c]=r[c])}}}return t}function dd(e,t,n){e.style.setProperty(t,n)}function h7({swiper:e,targetPosition:t,side:n}){const r=Qo(),s=-e.translate;let i=null,l;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=()=>{l=new Date().getTime(),i===null&&(i=l);const g=Math.max(Math.min((l-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 fc(e,t=""){const n=Qo(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(s=>s.matches(t)):r}function qk(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 Yk(e,t){const n=Qo();let r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||(r=qk(e,t))),r}function gm(e){try{console.warn(e);return}catch{}}function nb(e,t=[]){const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:Uk(t)),n}function Kk(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 Xk(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 Hc(e,t){return Qo().getComputedStyle(e,null).getPropertyValue(t)}function w5(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function Zk(e,t){const n=[];let r=e.parentElement;for(;r;)n.push(r),r=r.parentElement;return n}function S5(e,t,n){const r=Qo();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 A5(e,t=""){typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let d1;function Jk(){const e=Qo(),t=Uu();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function p7(){return d1||(d1=Jk()),d1}let f1;function e_({userAgent:e}={}){const t=p7(),n=Qo(),r=n.navigator.platform,s=e||n.navigator.userAgent,i={ios:!1,android:!1},l=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(`${l}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 m7(e={}){return f1||(f1=e_(e)),f1}let h1;function t_(){const e=Qo(),t=m7();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(),l=i||s&&t.ios;return{isSafari:n||i,needPerspectiveFix:n,need3dFix:l,isWebView:s}}function g7(){return h1||(h1=t_()),h1}function n_({swiper:e,on:t,emit:n}){const r=Qo();let s=null,i=null;const l=()=>{!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)&&l()})}),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",l),r.addEventListener("orientationchange",f)}),t("destroy",()=>{u(),r.removeEventListener("resize",l),r.removeEventListener("orientationchange",f)})}function r_({swiper:e,extendParams:t,on:n,emit:r}){const s=[],i=Qo(),l=(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=Zk(e.hostEl);for(let p=0;p<f.length;p+=1)l(f[p])}l(e.hostEl,{childList:e.params.observeSlideChildren}),l(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 s_={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(l=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(c=>{c.apply(s,[l,...r])}),t.eventsListeners&&t.eventsListeners[l]&&t.eventsListeners[l].forEach(c=>{c.apply(s,r)})}),t}};function i_(){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(Hc(r,"padding-left")||0,10)-parseInt(Hc(r,"padding-right")||0,10),n=n-parseInt(Hc(r,"padding-top")||0,10)-parseInt(Hc(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 o_(){const e=this;function t(q,V){return parseFloat(q.getPropertyValue(e.getDirectionLabel(V))||0)}const n=e.params,{wrapperEl:r,slidesEl:s,rtlTranslate:i,wrongRTL:l}=e,c=e.virtual&&n.virtual.enabled,u=c?e.virtual.slides.length:e.slides.length,f=fc(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(q=>{i?q.style.marginLeft="":q.style.marginRight="",q.style.marginBottom="",q.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(dd(r,"--swiper-centered-offset-before",""),dd(r,"--swiper-centered-offset-after","")),n.cssMode&&(dd(r,"--swiper-slides-offset-before",`${S}px`),dd(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 Q=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(q=>typeof n.breakpoints[q].slidesPerView<"u").length>0;for(let q=0;q<p;q+=1){$=0;const V=f[q];if(!(V&&(C&&e.grid.updateSlide(q,V,f),Hc(V,"display")==="none"))){if(c&&n.slidesPerView==="auto")n.virtual.slidesPerViewAutoSlideSize&&($=n.virtual.slidesPerViewAutoSlideSize),$&&V&&(n.roundLengths&&($=Math.floor($)),V.style[e.getDirectionLabel("width")]=`${$}px`);else if(n.slidesPerView==="auto"){Q&&(V.style[e.getDirectionLabel("width")]="");const fe=getComputedStyle(V),J=V.style.transform,he=V.style.webkitTransform;if(J&&(V.style.transform="none"),he&&(V.style.webkitTransform="none"),n.roundLengths)$=e.isHorizontal()?S5(V,"width"):S5(V,"height");else{const ye=t(fe,"width"),ue=t(fe,"padding-left"),ie=t(fe,"padding-right"),G=t(fe,"margin-left"),z=t(fe,"margin-right"),X=fe.getPropertyValue("box-sizing");if(X&&X==="border-box")$=ye+G+z;else{const{clientWidth:oe,offsetWidth:me}=V;$=ye+ue+ie+G+z+(me-oe)}}J&&(V.style.transform=J),he&&(V.style.webkitTransform=he),n.roundLengths&&($=Math.floor($))}else $=(I-(n.slidesPerView-1)*j)/n.slidesPerView,n.roundLengths&&($=Math.floor($)),V&&(V.style[e.getDirectionLabel("width")]=`${$}px`);V&&(V.swiperSlideSize=$),v.push($),n.centeredSlides?(P=P+$/2+F/2+j,F===0&&q!==0&&(P=P-I/2-j),q===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&&l&&(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 q=n.slidesPerView!=="auto"&&n.slidesPerView%1!==0,V=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView==="auto"||q);let fe=g.length;if(V){let he;if(n.slidesPerView==="auto"){he=1;let ye=0;for(let ue=v.length-1;ue>=0&&(ye+=v[ue]+(ue<v.length-1?j:0),ye<=I);ue-=1)he=v.length-ue}else he=Math.floor(n.slidesPerView);fe=Math.max(p-he,0)}const J=[];for(let he=0;he<g.length;he+=1){let ye=g[he];n.roundLengths&&(ye=Math.floor(ye)),V?he<=fe&&J.push(ye):g[he]<=e.virtualSize-I&&J.push(ye)}g=J,Math.floor(e.virtualSize-I)-Math.floor(g[g.length-1])>1&&(V||g.push(e.virtualSize-I))}if(c&&n.loop){const q=v[0]+j;if(n.slidesPerGroup>1){const V=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),fe=q*n.slidesPerGroup;for(let J=0;J<V;J+=1)g.push(g[g.length-1]+fe)}for(let V=0;V<e.virtual.slidesBefore+e.virtual.slidesAfter;V+=1)n.slidesPerGroup===1&&g.push(g[g.length-1]+q),y.push(y[y.length-1]+q),e.virtualSize+=q}if(g.length===0&&(g=[0]),j!==0){const q=e.isHorizontal()&&i?"marginLeft":e.getDirectionLabel("marginRight");f.filter((V,fe)=>!n.cssMode||n.loop?!0:fe!==f.length-1).forEach(V=>{V.style[q]=`${j}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let q=0;v.forEach(fe=>{q+=fe+(j||0)}),q-=j;const V=q>I?q-I:0;g=g.map(fe=>fe<=0?-S:fe>V?V+A:fe)}if(n.centerInsufficientSlides){let q=0;if(v.forEach(V=>{q+=V+(j||0)}),q-=j,q<I){const V=(I-q)/2;g.forEach((fe,J)=>{g[J]=fe-V}),y.forEach((fe,J)=>{y[J]=fe+V})}}if(Object.assign(e,{slides:f,snapGrid:g,slidesGrid:y,slidesSizesGrid:v}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){dd(r,"--swiper-centered-offset-before",`${-g[0]}px`),dd(r,"--swiper-centered-offset-after",`${e.size/2-v[v.length-1]/2}px`);const q=-e.snapGrid[0],V=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(fe=>fe+q),e.slidesGrid=e.slidesGrid.map(fe=>fe+V)}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 q=`${n.containerModifierClass}backface-hidden`,V=e.el.classList.contains(q);p<=n.maxBackfaceHiddenSlides?V||e.el.classList.add(q):V&&e.el.classList.remove(q)}}function a_(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 l=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(l(c))}else n.push(l(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 l_(){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 T5=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function c_(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 l=-e;s&&(l=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=(l+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),y=(l-i[0]+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),v=-(l-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)),T5(f,T,n.slideVisibleClass),T5(f,A,n.slideFullyVisibleClass),f.progress=s?-g:g,f.originalProgress=s?-y:y}}function u_(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:l,progressLoop:c}=t;const u=i,f=l;if(r===0)s=0,i=!0,l=!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,l=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:l}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),i&&!u&&t.emit("reachBeginning toEdge"),l&&!f&&t.emit("reachEnd toEdge"),(u&&!i||f&&!l)&&t.emit("fromEdge"),t.emit("progress",s)}const p1=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function d_(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:s}=e,i=e.virtual&&n.virtual.enabled,l=e.grid&&n.grid&&n.grid.rows>1,c=g=>fc(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 l?(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&&(l||(p=Xk(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!p&&(p=t[0]),f=Kk(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!f===0&&(f=t[t.length-1]))),t.forEach(g=>{p1(g,g===u,n.slideActiveClass),p1(g,g===p,n.slideNextClass),p1(g,g===f,n.slidePrevClass)}),e.emitSlidesClasses()}const Gp=(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()}},m1=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},rb=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 l=s,c=[l-t];c.push(...Array.from({length:t}).map((u,f)=>l+r+f)),e.slides.forEach((u,f)=>{c.includes(u.column)&&m1(e,f)});return}const i=s+r-1;if(e.params.rewind||e.params.loop)for(let l=s-t;l<=i+t;l+=1){const c=(l%n+n)%n;(c<s||c>i)&&m1(e,c)}else for(let l=Math.max(s-t,0);l<=Math.min(i+t,n-1);l+=1)l!==s&&(l>i||l<s)&&m1(e,l)};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 h_(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:s,activeIndex:i,realIndex:l,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:l,realIndex:y,previousIndex:i,activeIndex:u}),t.initialized&&rb(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(l!==y&&t.emit("realIndexChange"),t.emit("slideChange"))}function p_(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,l;if(s){for(let c=0;c<n.slides.length;c+=1)if(n.slides[c]===s){i=!0,l=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=l;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var m_={updateSize:i_,updateSlides:o_,updateAutoHeight:a_,updateSlidesOffset:l_,updateSlidesProgress:c_,updateProgress:u_,updateSlidesClasses:d_,updateActiveIndex:h_,updateClickedSlide:p_};function g_(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 l=Wk(i,e);return l+=t.cssOverflowAdjustment(),r&&(l=-l),l||0}function x_(e,t){const n=this,{rtlTranslate:r,params:s,wrapperEl:i,progress:l}=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!==l&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function b_(){return-this.snapGrid[0]}function y_(){return-this.snapGrid[this.snapGrid.length-1]}function v_(e=0,t=this.params.speed,n=!0,r=!0,s){const i=this,{params:l,wrapperEl:c}=i;if(i.animating&&l.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),l.cssMode){const g=i.isHorizontal();if(t===0)c[g?"scrollLeft":"scrollTop"]=-p;else{if(!i.support.smoothScroll)return h7({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 w_={getTranslate:g_,setTranslate:x_,minTranslate:b_,maxTranslate:y_,translateTo:v_};function S_(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 x7({swiper:e,runCallbacks:t,direction:n,step:r}){const{activeIndex:s,previousIndex:i}=e;let l=n;l||(s>i?l="next":s<i?l="prev":l="reset"),e.emit(`transition${r}`),t&&l==="reset"?e.emit(`slideResetTransition${r}`):t&&s!==i&&(e.emit(`slideChangeTransition${r}`),l==="next"?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function A_(e=!0,t){const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),x7({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function T_(e=!0,t){const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),x7({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var C_={setTransition:S_,transitionStart:A_,transitionEnd:T_};function k_(e=0,t,n=!0,r,s){typeof e=="string"&&(e=parseInt(e,10));const i=this;let l=e;l<0&&(l=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,l);let T=A+Math.floor((l-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),Q=Math.floor(f[C]*100),q=Math.floor(f[C+1]*100);typeof f[C+1]<"u"?$>=Q&&$<q-(q-Q)/2?l=C:$>=Q&&$<q&&(l=C+1):$>=Q&&(l=C)}if(i.initialized&&l!==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)!==l))return!1;l!==(p||0)&&n&&i.emit("beforeSlideChangeStart"),i.updateProgress(L);let I;l>g?I="next":l<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(l),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 h7({swiper:i,targetPosition:$,side:C?"left":"top"}),!0;v.scrollTo({[C?"left":"top"]:$,behavior:"smooth"})}return!0}const R=g7().isSafari;return j&&!s&&R&&i.isElement&&i.virtual.update(!1,!1,l),i.setTransition(t),i.setTranslate(L),i.updateActiveIndex(l),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 __(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 l=e;if(s.params.loop)if(s.virtual&&s.params.virtual.enabled)l=l+s.virtual.slidesBefore;else{let c;if(i){const A=l*s.params.grid.rows;c=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else c=s.getSlideIndexByData(l);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=l*s.params.grid.rows;l=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else l=s.getSlideIndexByData(l)}return requestAnimationFrame(()=>{s.slideTo(l,t,n,r)}),s}function L_(e,t=!0,n){const r=this,{enabled:s,params:i,animating:l}=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(l&&!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 E_(e,t=!0,n){const r=this,{params:s,snapGrid:i,slidesGrid:l,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=l.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 I_(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 R_(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 l=Math.min(s.params.slidesPerGroupSkip,i),c=l+Math.floor((i-l)/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 N_(){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 l=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(fc(n,`${l}[data-swiper-slide-index="${i}"]`)[0]),f7(()=>{e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}var M_={slideTo:k_,slideToLoop:__,slideNext:L_,slidePrev:E_,slideReset:I_,slideToClosest:R_,slideToClickedSlide:N_};function D_(e,t){const n=this,{params:r,slidesEl:s}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;const i=()=>{fc(s,`.${r.slideClass}, swiper-slide`).forEach((S,A)=>{S.setAttribute("data-swiper-slide-index",A)})},l=()=>{const v=fc(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)&&l();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?nb("swiper-slide",[r.slideBlankClass]):nb("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 gm("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 gm("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 j_({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:s,initial:i,byController:l,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?gm("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"&&gm("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const C=[],$=[],Q=R?Math.ceil(f.length/v.grid.rows):f.length,q=i&&Q-L<j&&!I;let V=q?L:u.activeIndex;typeof s>"u"?s=u.getSlideIndex(f.find(G=>G.classList.contains(v.slideActiveClass))):V=s;const fe=n==="next"||!n,J=n==="prev"||!n;let he=0,ye=0;const ie=(R?f[s].column:s)+(I&&typeof r>"u"?-j/2+.5:0);if(ie<F){he=Math.max(F-ie,P);for(let G=0;G<F-ie;G+=1){const z=G-Math.floor(G/Q)*Q;if(R){const X=Q-z-1;for(let oe=f.length-1;oe>=0;oe-=1)f[oe].column===X&&C.push(oe)}else C.push(Q-z-1)}}else if(ie+j>Q-F){ye=Math.max(ie-(Q-F*2),P),q&&(ye=Math.max(ye,j-Q+L+1));for(let G=0;G<ye;G+=1){const z=G-Math.floor(G/Q)*Q;R?f.forEach((X,oe)=>{X.column===z&&$.push(oe)}):$.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)),J&&C.forEach(G=>{f[G].swiperLoopMoveDOM=!0,y.prepend(f[G]),f[G].swiperLoopMoveDOM=!1}),fe&&$.forEach(G=>{f[G].swiperLoopMoveDOM=!0,y.append(f[G]),f[G].swiperLoopMoveDOM=!1}),u.recalcSlides(),v.slidesPerView==="auto"?u.updateSlides():R&&(C.length>0&&J||$.length>0&&fe)&&u.slides.forEach((G,z)=>{u.grid.updateSlide(z,G,u.slides)}),v.watchSlidesProgress&&u.updateSlidesOffset(),t){if(C.length>0&&J){if(typeof e>"u"){const G=u.slidesGrid[V],X=u.slidesGrid[V+he]-G;c?u.setTranslate(u.translate-X):(u.slideTo(V+Math.ceil(he),0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-X,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-X))}else if(r){const G=R?C.length/v.grid.rows:C.length;u.slideTo(u.activeIndex+G,0,!1,!0),u.touchEventsData.currentTranslate=u.translate}}else if($.length>0&&fe)if(typeof e>"u"){const G=u.slidesGrid[V],X=u.slidesGrid[V-ye]-G;c?u.setTranslate(u.translate-X):(u.slideTo(V-ye,0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-X,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-X))}else{const G=R?$.length/v.grid.rows:$.length;u.slideTo(u.activeIndex-G,0,!1,!0)}}if(u.allowSlidePrev=p,u.allowSlideNext=g,u.controller&&u.controller.control&&!l){const G={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({...G,slideTo:z.params.slidesPerView===v.slidesPerView?t:!1})}):u.controller.control instanceof u.constructor&&u.controller.control.params.loop&&u.controller.control.loopFix({...G,slideTo:u.controller.control.params.slidesPerView===v.slidesPerView?t:!1})}u.emit("loopFix")}function P_(){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 B_={loopCreate:D_,loopFix:j_,loopDestroy:P_};function F_(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 O_(){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 Q_={setGrabCursor:F_,unsetGrabCursor:O_};function $_(e,t=this){function n(r){if(!r||r===Uu()||r===Qo())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 C5(e,t,n){const r=Qo(),{params:s}=e,i=s.edgeSwipeDetection,l=s.edgeSwipeThreshold;return i&&(n<=l||n>=r.innerWidth-l)?i==="prevent"?(t.preventDefault(),!0):!1:!0}function H_(e){const t=this;if(t.destroyed)return;const n=Uu();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"){C5(t,r,r.targetTouches[0].pageX);return}const{params:i,touches:l,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"&&!Yk(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?$_(g,u):u.closest(g))){t.allowClick=!0;return}if(i.swipeHandler&&!u.closest(i.swipeHandler))return;l.currentX=r.pageX,l.currentY=r.pageY;const v=l.currentX,S=l.currentY;if(!C5(t,r,v))return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),l.startX=v,l.startY=S,s.touchStartTime=mm(),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 U_(e){const t=Uu(),n=this;if(n.destroyed)return;const r=n.touchEventsData,{params:s,touches:i,rtlTranslate:l,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=mm());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(l&&(p>i.startX&&-n.translate<=n.maxTranslate()||p<i.startX&&-n.translate>=n.minTranslate()))return;if(!l&&(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)*(l?1:-1),A=Math.abs(A)*(l?1:-1)),i.diff=S,S*=s.touchRatio,l&&(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 z_(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:l,touches:c,rtlTranslate:u,slidesGrid:f,enabled:p}=t;if(!p||!l.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&l.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}l.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const g=mm(),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=mm(),f7(()=>{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(l.followFinger?v=u?t.translate:-t.translate:v=-n.currentTranslate,l.cssMode)return;if(l.freeMode&&l.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<l.slidesPerGroupSkip?1:l.slidesPerGroup){const R=F<l.slidesPerGroupSkip-1?1:l.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;l.rewind&&(t.isBeginning?I=l.virtual&&l.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<l.slidesPerGroupSkip-1?1:l.slidesPerGroup;if(y>l.longSwipesMs){if(!l.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(j>=l.longSwipesRatio?t.slideTo(l.rewind&&t.isEnd?L:A+P):t.slideTo(A)),t.swipeDirection==="prev"&&(j>1-l.longSwipesRatio?t.slideTo(A+P):I!==null&&j<0&&Math.abs(j)>l.longSwipesRatio?t.slideTo(I):t.slideTo(A))}else{if(!l.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 k5(){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,l=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const c=l&&t.loop;if((t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!c){const u=l?e.virtual.slides:e.slides;e.slideTo(u.length-1,0,!1,!0)}else e.params.loop&&!l?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 G_(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 W_(){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 V_(e){const t=this;t.destroyed||(Gp(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update())}function q_(){const e=this;e.destroyed||e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const b7=(e,t)=>{const n=Uu(),{params:r,el:s,wrapperEl:i,device:l}=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](l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate",k5,!0):e[f]("observerUpdate",k5,!0),s[u]("load",e.onLoad,{capture:!0}))};function Y_(){const e=this,{params:t}=e;e.onTouchStart=H_.bind(e),e.onTouchMove=U_.bind(e),e.onTouchEnd=z_.bind(e),e.onDocumentTouchStart=q_.bind(e),t.cssMode&&(e.onScroll=W_.bind(e)),e.onClick=G_.bind(e),e.onLoad=V_.bind(e),b7(e,"on")}function K_(){b7(this,"off")}var X_={attachEvents:Y_,detachEvents:K_};const _5=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function Z_(){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 l=Uu(),c=r.breakpointsBase==="window"||!r.breakpointsBase?r.breakpointsBase:"container",u=["window","container"].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:l.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=_5(e,r),v=_5(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(),xa(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 J_(e,t="window",n){if(!e||t==="container"&&!n)return;let r=!1;const s=Qo(),i=t==="window"?s.innerHeight:n.clientHeight,l=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}});l.sort((c,u)=>parseInt(c.value,10)-parseInt(u.value,10));for(let c=0;c<l.length;c+=1){const{point:u,value:f}=l[c];t==="window"?s.matchMedia(`(min-width: ${f}px)`).matches&&(r=u):f<=n.clientWidth&&(r=u)}return r||"max"}var eL={setBreakpoint:Z_,getBreakpoint:J_};function tL(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 nL(){const e=this,{classNames:t,params:n,rtl:r,el:s,device:i}=e,l=tL(["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(...l),s.classList.add(...t),e.emitContainerClasses()}function rL(){const e=this,{el:t,classNames:n}=e;!t||typeof t=="string"||(t.classList.remove(...n),e.emitContainerClasses())}var sL={addClasses:nL,removeClasses:rL};function iL(){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 oL={checkOverflow:iL},sb={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 aL(e,t){return function(r={}){const s=Object.keys(r)[0],i=r[s];if(typeof i!="object"||i===null){xa(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)){xa(t,r);return}typeof e[s]=="object"&&!("enabled"in e[s])&&(e[s].enabled=!0),e[s]||(e[s]={enabled:!1}),xa(t,r)}}const g1={eventsEmitter:s_,update:m_,translate:w_,transition:C_,slide:M_,loop:B_,grabCursor:Q_,events:X_,breakpoints:eL,checkOverflow:oL,classes:sL},x1={};let j2=class cc{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=xa({},r),n&&!r.el&&(r.el=n);const s=Uu();if(r.el&&typeof r.el=="string"&&s.querySelectorAll(r.el).length>1){const u=[];return s.querySelectorAll(r.el).forEach(f=>{const p=xa({},r,{el:f});u.push(new cc(p))}),u}const i=this;i.__swiper__=!0,i.support=p7(),i.device=m7({userAgent:r.userAgent}),i.browser=g7(),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 l={};i.modules.forEach(u=>{u({params:r,swiper:i,extendParams:aL(r,l),on:i.on.bind(i),once:i.once.bind(i),off:i.off.bind(i),emit:i.emit.bind(i)})});const c=xa({},sb,l);return i.params=xa({},c,x1,r),i.originalParams=xa({},i.params),i.passedParams=xa({},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=fc(n,`.${r.slideClass}, swiper-slide`),i=w5(s[0]);return w5(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=fc(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(),l=(r.maxTranslate()-s)*t+s;r.translateTo(l,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:l,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?l[g]+c[g]-l[f]<u:l[g]-l[f]<u)&&(p+=1);else for(let g=f-1;g>=0;g-=1)l[f]-l[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(l=>{l.complete&&Gp(t,l)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function s(){const l=t.rtlTranslate?t.translate*-1:t.translate,c=Math.min(Math.max(l,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 l=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;i=t.slideTo(l.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 l=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(s()):fc(r,s())[0];return!l&&n.params.createElements&&(l=nb("div",n.params.wrapperClass),r.append(l),fc(r,`.${n.params.slideClass}`).forEach(c=>{l.append(c)})),Object.assign(n,{el:r,wrapperEl:l,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:l,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||Hc(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||Hc(r,"direction")==="rtl"),wrongRTL:Hc(l,"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?Gp(n,i):i.addEventListener("load",l=>{Gp(n,l.target)})}),rb(n),n.initialized=!0,rb(n),n.emit("init"),n.emit("afterInit"),n}destroy(t=!0,n=!0){const r=this,{params:s,el:i,wrapperEl:l,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"),l&&l.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),zk(r)),r.destroyed=!0),null}static extendDefaults(t){xa(x1,t)}static get extendedDefaults(){return x1}static get defaults(){return sb}static installModule(t){cc.prototype.__modules__||(cc.prototype.__modules__=[]);const n=cc.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>cc.installModule(n)),cc):(cc.installModule(t),cc)}};Object.keys(g1).forEach(e=>{Object.keys(g1[e]).forEach(t=>{j2.prototype[t]=g1[e][t]})});j2.use([n_,r_]);const y7=["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 Fu(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function $d(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]:Fu(t[r])&&Fu(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:$d(e[r],t[r]):e[r]=t[r]})}function v7(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function w7(e={}){return e.pagination&&typeof e.pagination.el>"u"}function S7(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function A7(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 lL(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function cL({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:s,prevEl:i,scrollbarEl:l,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||l)&&(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(Fu(f[$])&&Fu(n[$]))Object.assign(f[$],n[$]),($==="navigation"||$==="pagination"||$==="scrollbar")&&"enabled"in n[$]&&!n[$].enabled&&C($);else{const Q=n[$];(Q===!0||Q===!1)&&($==="navigation"||$==="pagination"||$==="scrollbar")?Q===!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&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-scrollbar"),l.part.add("scrollbar"),e.el.appendChild(l)),l&&(f.scrollbar.el=l),y.init(),y.updateSize(),y.setTranslate()),j&&(e.isElement&&((!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-button-next"),A5(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"),A5(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 uL(e={},t=!0){const n={on:{}},r={},s={};$d(n,sb),n._emitClasses=!0,n.init=!1;const i={},l=y7.map(u=>u.replace(/_/,"")),c=Object.assign({},e);return Object.keys(c).forEach(u=>{typeof e[u]>"u"||(l.indexOf(u)>=0?Fu(e[u])?(n[u]={},s[u]={},$d(n[u],e[u]),$d(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 dL({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:s,swiper:i},l){v7(l)&&t&&n&&(i.params.navigation.nextEl=t,i.originalParams.navigation.nextEl=t,i.params.navigation.prevEl=n,i.originalParams.navigation.prevEl=n),w7(l)&&r&&(i.params.pagination.el=r,i.originalParams.pagination.el=r),S7(l)&&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 l=u=>{i.indexOf(u)<0&&i.push(u)};if(n&&r){const u=r.map(s),f=n.map(s);u.join("")!==f.join("")&&l("children"),r.length!==n.length&&l("children")}return y7.filter(u=>u[0]==="_").map(u=>u.replace(/_/,"")).forEach(u=>{if(u in e&&u in t)if(Fu(e[u])&&Fu(t[u])){const f=Object.keys(e[u]),p=Object.keys(t[u]);f.length!==p.length?l(u):(f.forEach(g=>{e[u][g]!==t[u][g]&&l(u)}),p.forEach(g=>{e[u][g]!==t[u][g]&&l(u)}))}else e[u]!==t[u]&&l(u)}),i}const hL=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 xm(){return xm=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},xm.apply(this,arguments)}function T7(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function C7(e){const t=[];return D.Children.toArray(e).forEach(n=>{T7(n)?t.push(n):n.props&&n.props.children&&C7(n.props.children).forEach(r=>t.push(r))}),t}function pL(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return D.Children.toArray(e).forEach(r=>{if(T7(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=C7(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 mL(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:l}=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<=l&&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 Af(e,t){return typeof window>"u"?b.useEffect(e,t):b.useLayoutEffect(e,t)}const L5=b.createContext(null),gL=b.createContext(null),nh=b.forwardRef(({className:e,tag:t="div",wrapperTag:n="div",children:r,onSwiper:s,...i}={},l)=>{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:Q,events:q}=uL(i),{slides:V,slots:fe}=pL(r),J=()=>{v(!y)};Object.assign(C.on,{_containerClasses(G,z){f(z)}});const he=()=>{Object.assign(C.on,q),c=!0;const G={...C};if(delete G.wrapperClass,T.current=new j2(G),T.current.virtual&&T.current.params.virtual.enabled){T.current.virtual.slides=V;const z={cache:!1,slides:V,renderExternal:g,renderExternalUpdate:!1};$d(T.current.params.virtual,z),$d(T.current.originalParams.virtual,z)}};A.current||he(),T.current&&T.current.on("_beforeBreakpoint",J);const ye=()=>{c||!q||!T.current||Object.keys(q).forEach(G=>{T.current.on(G,q[G])})},ue=()=>{!q||!T.current||Object.keys(q).forEach(G=>{T.current.off(G,q[G])})};b.useEffect(()=>()=>{T.current&&T.current.off("_beforeBreakpoint",J)}),b.useEffect(()=>{!S.current&&T.current&&(T.current.emitSlidesClasses(),S.current=!0)}),Af(()=>{if(l&&(l.current=A.current),!!A.current)return T.current.destroyed&&he(),dL({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)}},[]),Af(()=>{ye();const G=fL($,L.current,V,I.current,z=>z.key);return L.current=$,I.current=V,G.length&&T.current&&!T.current.destroyed&&cL({swiper:T.current,slides:V,passedParams:$,changedParams:G,nextEl:j.current,prevEl:P.current,scrollbarEl:R.current,paginationEl:F.current}),()=>{ue()}}),Af(()=>{hL(T.current)},[p]);function ie(){return C.virtual?mL(T.current,V,p):V.map((G,z)=>D.cloneElement(G,{swiper:T.current,swiperSlideIndex:z}))}return D.createElement(t,xm({ref:A,className:A7(`${u}${e?` ${e}`:""}`)},Q),D.createElement(gL.Provider,{value:T.current},fe["container-start"],D.createElement(n,{className:lL(C.wrapperClass)},fe["wrapper-start"],ie(),fe["wrapper-end"]),v7(C)&&D.createElement(D.Fragment,null,D.createElement("div",{ref:P,className:"swiper-button-prev"}),D.createElement("div",{ref:j,className:"swiper-button-next"})),S7(C)&&D.createElement("div",{ref:R,className:"swiper-scrollbar"}),w7(C)&&D.createElement("div",{ref:F,className:"swiper-pagination"}),fe["container-end"]))});nh.displayName="Swiper";const Ou=b.forwardRef(({tag:e="div",children:t,className:n="",swiper:r,zoom:s,lazy:i,virtualIndex:l,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)}Af(()=>{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)}}}),Af(()=>{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,xm({ref:p,className:A7(`${g}${n?` ${n}`:""}`),"data-swiper-slide-index":l,onLoad:I},u),s&&D.createElement(L5.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(L5.Provider,{value:T},L(),i&&!v&&D.createElement("div",{className:"swiper-lazy-preloader",ref:j=>{j&&(j.lazyPreloaderManaged=!0)}})))});Ou.displayName="SwiperSlide";const Ki=[];for(let e=0;e<256;++e)Ki.push((e+256).toString(16).slice(1));function xL(e,t=0){return(Ki[e[t+0]]+Ki[e[t+1]]+Ki[e[t+2]]+Ki[e[t+3]]+"-"+Ki[e[t+4]]+Ki[e[t+5]]+"-"+Ki[e[t+6]]+Ki[e[t+7]]+"-"+Ki[e[t+8]]+Ki[e[t+9]]+"-"+Ki[e[t+10]]+Ki[e[t+11]]+Ki[e[t+12]]+Ki[e[t+13]]+Ki[e[t+14]]+Ki[e[t+15]]).toLowerCase()}let b1;const bL=new Uint8Array(16);function yL(){if(!b1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");b1=crypto.getRandomValues.bind(crypto)}return b1(bL)}const vL=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),E5={randomUUID:vL};function wL(e,t,n){e=e||{};const r=e.random??e.rng?.()??yL();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,xL(r)}function SL(e,t,n){return E5.randomUUID&&!e?E5.randomUUID():wL(e)}const AL={},I5=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:()=>{(AL?"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},TL=e=>e?I5(e):I5;var y1={exports:{}},v1={},w1={exports:{}},S1={};var R5;function CL(){if(R5)return S1;R5=1;var e=rg();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,l=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]),l(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 S1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,S1}var N5;function kL(){return N5||(N5=1,w1.exports=CL()),w1.exports}var M5;function _L(){if(M5)return v1;M5=1;var e=rg(),t=kL();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,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return v1.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 l(function(){A.hasValue=!0,A.value=T},[T]),u(T),T},v1}var D5;function LL(){return D5||(D5=1,y1.exports=_L()),y1.exports}var EL=LL();const IL=u7(EL),k7={},{useDebugValue:RL}=D,{useSyncExternalStoreWithSelector:NL}=IL;let j5=!1;const ML=e=>e;function DL(e,t=ML,n){(k7?"production":void 0)!=="production"&&n&&!j5&&(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"),j5=!0);const r=NL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return RL(r),r}const P5=e=>{(k7?"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"?TL(e):e,n=(r,s)=>DL(t,r,s);return Object.assign(n,t),n},_7=e=>e?P5(e):P5,bm="auth:unauthorized";let Bd=null;class Sl extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r,this.name="TerminalApiError"}status;code}async function jL(){const e=await fetch("/api/terminal/update");if(!e.ok)throw new Sl("Failed to load update state",e.status);return e.json()}async function PL(){const e=await ir(),t=await fetch("/api/terminal/update/check",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Sl("Failed to check for updates",t.status);return t.json()}async function BL(){const e=await ir(),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 Sl(n.error||"Failed to restart Termdock",t.status)}return t.json()}async function FL(){const e=await fetch("/api/terminal/quota");if(!e.ok)throw new Sl("Failed to fetch quota",e.status);return e.json()}async function OL(){const e=await ir(),t=await fetch("/api/terminal/quota/refresh",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Sl("Failed to refresh quota",t.status);return t.json()}const eu=8e3,QL=32e3,zl=1e4,Hd=45e3,$L=8e3,HL=8e3,UL=15e3,zL=1e4,Yd=5e3;let GL=0;const Wp=[];let A1=!1;function Mc(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:++GL,ts:Date.now(),...t}});Wp.push(n),WL()}async function WL(){if(!A1){A1=!0;try{for(;Wp.length>0;){const e=Wp[0];try{await fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}),Wp.shift()}catch{break}}}finally{A1=!1}}}function VL(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 ks(e,t,n,r){const{signal:s,cleanup:i}=VL(t?.signal??void 0,n,r);try{return await fetch(e,{...t,signal:s})}catch(l){throw l instanceof DOMException&&l.name==="TimeoutError"?new Error(r):l}finally{i()}}async function L7(e,t,n){let r=null;const s=new Promise((i,l)=>{r=setTimeout(()=>l(new Error(n)),t)});try{return await Promise.race([e.text(),s])}finally{r&&clearTimeout(r)}}async function Kd(e,t,n){const r=await L7(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){Bd=null;try{window.dispatchEvent(new CustomEvent(bm))}catch{}}return n}}async function ir(){if(Bd)return Bd;const e=await ks("/api/csrf-token",void 0,$L,"CSRF token request timed out");if(!e.ok)throw new Error("Failed to get CSRF token");const t=await Kd(e,Yd,"CSRF token response timed out");if(!t.csrfToken)throw new Error("Invalid CSRF token response");return Bd=t.csrfToken,Bd}function E7(){Bd=null}const qL=2e4,B5=8e3,YL=1500,so=new Map,KL=24,XL=40,ZL=40;function JL(e){return e.retryState.retryCount>=2||e.pendingInputs.length>=ZL?"congested":e.retryState.retryCount>=1||e.pendingInputs.length>=8?"degraded":"good"}function F5(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 I7(e){if(e.ws.readyState!==WebSocket.OPEN)return;const t=JL(e);if(t==="good"){F5(e);return}if(e.inputFlushTimer)return;const n=t==="congested"?XL:KL;e.inputFlushTimer=setTimeout(()=>{e.inputFlushTimer=null,F5(e)},n)}const Tf=new Map;function eE(e,t,n,r){const s=Tf.get(e);s&&(Tf.delete(e),t?s.resolve({success:!0,layout:n}):s.reject(new Error(r||"Tmux action failed")))}function tE(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 O5=new Map;async function nE(e){const t=await ir(),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 rE(e,t,n,r={}){const{maxRetries:s=10,initialRetryDelay:i=1e3,maxRetryDelay:l=2e4,connectionTimeout:c=15e3}=r,u={maxRetries:s,initialDelayMs:i,maxDelayMs:l,connectionTimeoutMs:c,retryCount:0,retryTimeout:null,connectionTimeoutId:null,isClosed:!1,isSuspended:!1};let f=null,p=O5.get(e)??0;O5.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>=B5)try{F.ws.close()}catch{}},B5)}},qL)},I=()=>{if(u.isClosed=!0,A(),f){T(f),so.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=tE(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),I7(C)},R.onmessage=$=>{C.lastInboundAt=Date.now(),C.inboundSequence+=1;try{const Q=JSON.parse($.data);if(Q.type==="pong"){C.pongTimer&&(clearTimeout(C.pongTimer),C.pongTimer=null);return}if(Q.type==="tmux-result"&&Q.reqId){eE(Q.reqId,Q.success!==!1,Q.layout,Q.error);return}if(Q.type==="tmux-layout"&&Q.layout){t({type:"tmux-layout",layout:Q.layout});return}if(Q.type==="tmux-screen-sync"&&Array.isArray(Q.chunks)){t({type:"tmux-screen-sync",chunks:Q.chunks.filter(V=>typeof V=="string"),cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,generation:typeof Q.generation=="number"?Q.generation:void 0});return}if(Q.type==="active-program"){t({type:"active-program",activeProgram:Q.activeProgram,activeProgramRaw:Q.activeProgramRaw,activeProgramSource:Q.activeProgramSource});return}if(Q.type==="cwd"){t({type:"cwd",cwd:Q.cwd});return}if(Q.type==="agent-status"){t({type:"agent-status",agentStatus:Q.agentStatus??null,agentIndicator:Q.agentIndicator??null,agentStatusDetail:Q.agentStatusDetail??null,agent:Q.agent??null,agentMessage:Q.agentMessage??null,agentNativeSessionId:Q.agentNativeSessionId??null,agentResumeRecovered:Q.agentResumeRecovered===!0,agentRich:Q.agentRich===!0,agentActivity:typeof Q.agentActivity=="number"?Q.agentActivity:0,agentCwd:Q.agentCwd??null,reviewed:typeof Q.reviewed=="boolean"?Q.reviewed:null});return}if(Q.type==="git-status"){t({type:"git-status",gitStatus:Q.gitStatus??null});return}if(Q.type==="quota-status"&&Array.isArray(Q.providers)){window.dispatchEvent(new CustomEvent("termdock:quota-update",{detail:Q.providers}));return}if(Q.type==="focus-mode"){t({type:"focus-mode",focusTrackingRequested:Q.focusTrackingRequested===!0});return}if(Q.type==="resize-ack"){t({type:"resize-ack",seq:typeof Q.seq=="number"?Q.seq:void 0,cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,ok:Q.ok!==!1,error:typeof Q.error=="string"?Q.error:void 0});return}if(Q.type==="pty-size"){t({type:"pty-size",cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,source:typeof Q.source=="string"?Q.source:void 0});return}if(Q.type==="shell-title"){t({type:"shell-title",title:typeof Q.title=="string"?Q.title:""});return}if(Q.type==="prompt-state"){t({type:"prompt-state",state:Q.state==="running"?"running":"idle",exitCode:typeof Q.exitCode=="number"?Q.exitCode:void 0});return}const q=Q;if(q.type==="connected"){typeof q.replayLastSeq=="number"&&q.replayLastSeq>0&&(p=q.replayLastSeq,C.lastSeq=p),t(q);return}if(q.type==="exit"){I(),t(q);return}t(q),q.type==="data"&&typeof q.seq=="number"&&Number.isFinite(q.seq)&&q.seq>p&&(p=q.seq,C.lastSeq=p)}catch(Q){n?.(Q,!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(bm))}catch{}P(new Error("Authentication required"),!0);return}P(new Error("WebSocket connection closed"),!1)}},f=C,so.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),l);if(t({type:"reconnecting",attempt:u.retryCount,maxAttempts:s}),u.isSuspended)return;u.retryTimeout=setTimeout(()=>{u.isClosed||j()},C)}};return j(),I}async function R7(e,t){const n=so.get(e);if(n){if(n.ws.readyState===WebSocket.OPEN){n.pendingInputs.push(t),I7(n);return}if(n.ws.readyState===WebSocket.CONNECTING){n.pendingInputs.push(t);return}}const r=await ir(),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 sE(e,t){const n=so.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(()=>{so.get(e)!==n||n.retryState.isClosed||(n.inboundSequence<=r?n.reconnectNow():t?.())},YL),!0}function iE(e){const t=so.get(e);return t?(t.reconnectNow(),!0):!1}function Q5(){for(const e of so.values())e.suspendReconnect()}function $5(e,t,n){const r=so.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"focus",focused:t,reason:n}))}catch{}}function H5(e,t,n){const r=so.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"viewing",viewing:t,reason:n}))}catch{}}function U5(e){const t=so.get(e);if(!(!t||t.ws.readyState!==WebSocket.OPEN))try{t.ws.send(JSON.stringify({type:"agent-review-ack"}))}catch{}}function z5(e,t,n){const r=so.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 oE(e,t,n,r){const s=so.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 ir(),l=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(!l.ok){const u=await l.json().catch(()=>({error:"Failed to resize terminal"}));throw new Error(u.error||"Failed to resize terminal")}const c=await l.json().catch(()=>({success:!0}));if(c?.success===!1||c?.ok===!1)throw new Error(c?.error||"Failed to resize terminal")}async function aE(e,t){const n=so.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,l)=>{const c=Math.random().toString(36).substring(7);Tf.set(c,{resolve:i,reject:l}),n.ws.send(JSON.stringify({type:"tmux",reqId:c,...t})),setTimeout(()=>{Tf.has(c)&&(Tf.delete(c),l(new Error("Tmux action timed out")))},3e4)});const r=await ir(),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 N7(e){const t=so.get(e);if(t){t.retryState.isClosed=!0;try{t.ws.close()}catch{}so.delete(e)}const n=await ir(),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 lE(e,t){const n=so.get(e);if(n){n.retryState.isClosed=!0;try{n.ws.close()}catch{}so.delete(e)}const r=await ir(),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 cE(e){const t=await ks(`/api/terminal/${e}/health`,{method:"GET"},HL,"Terminal health check timed out");if(!t.ok){if(t.status===404)return{healthy:!1,sessionId:e};const n=await Kd(t,Yd,"Terminal health error response timed out").catch(()=>({error:"Failed to check terminal health"}));throw new Error(n.error||"Failed to check terminal health")}return Kd(t,Yd,"Terminal health response timed out")}async function uE(e){const t=await ir(),n=await ks("/api/terminal/force-kill",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)},zL,"Terminal force-kill request timed out");if(!n.ok){const r=await Kd(n,Yd,"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 ib(){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 ob(){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 M7(e){const t=e.trim();if(!t)throw new Error("tmux session name is required");const n=await ir(),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}}const np=new Map;function dE(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 fE(){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 D7(e){const t=dE(e),n=np.get(t);if(n)return n;const r=await ir(),s=ks("/api/terminal/session-inventory/open",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify(e)},UL,"Terminal session open request timed out").then(async i=>{if(!i.ok){const l=await Kd(i,Yd,"Terminal session open error response timed out").catch(()=>({error:"Failed to open session"}));throw new Sl(l.error||"Failed to open session",i.status,typeof l.code=="string"?l.code:void 0)}return Kd(i,Yd,"Terminal session open response timed out")}).finally(()=>{np.get(t)===s&&np.delete(t)});return np.set(t,s),s}async function Vp(e,t){const n=await ir(),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 hE(e){const t=await ir(),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 pE(e){const t=await ir(),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 mE(){const e=await ir(),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 G5(){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 gE(e){const t=await ir(),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 sg(){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 qa(e){const t=await ir(),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 P0(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 xE(){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 bE(e,t){const n=await ir(),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 yE(){const e=await fetch("/api/auth/status");if(!e.ok)throw new Error("Failed to query auth status");return e.json()}async function vE(e){const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok)return E7(),{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 wE(){const e=await ir();await fetch("/api/auth/logout",{method:"POST",headers:{"X-XSRF-TOKEN":e}}),E7()}async function j7(){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 SE(){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 AE(e){const t=await ir(),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 TE(e){const t=await ir(),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 P2 extends Error{constructor(t,n,r){super(t),this.code=n,this.migration=r,this.name="AgentPluginManifestError"}code;migration}async function CE(){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 kE(e){const t=await ir(),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 P2(r.error||"Failed to create agent plugin",r.code,r.migration);return r}async function _E(e){const t=await ir(),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 P2(r.error||"Failed to install agent plugin",r.code,r.migration);return r}async function LE(e){const t=await ir(),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 EE(e){const t=await ir(),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 IE(e){const t=await ir(),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 RE(e){const t=await ir(),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 NE(e){const t=await ir(),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 Sl(r.error||"Failed to resume agent session",n.status,typeof r.code=="string"?r.code:void 0);return{command:r.command??""}}async function W5(){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 P7(e){const t=await ir(),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 Sl(r.error||"Failed to prepare Agent session resume",n.status,typeof r.code=="string"?r.code:void 0);return r}async function ME(e){const t=await ir(),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 fd(e){const t=await ir(),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 DE(){const e=await ir(),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 jE(){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 V5(e){const t=await ir(),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 PE(){const e=await ir(),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 BE={".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 B2(e){const t=e.lastIndexOf(".");return t<0?null:BE[e.slice(t).toLowerCase()]??null}function F2(e){return B2(e)!==null}function B7(e){const t=B2(e);return t==="image/heic"||t==="image/heif"}const FE={".mp4":"video/mp4",".m4v":"video/x-m4v",".webm":"video/webm",".mov":"video/quicktime",".ogv":"video/ogg",".mpeg":"video/mpeg",".mpg":"video/mpeg"};function F7(e){const t=e.lastIndexOf(".");return t<0?null:FE[e.slice(t).toLowerCase()]??null}function O7(e){return F7(e)!==null}function OE(e){return`/api/terminal/fs/video?path=${encodeURIComponent(e)}&action=view_file`}const QE=[".stl",".glb",".gltf"];function Q7(e){const t=e.lastIndexOf(".");if(t<0)return null;const n=e.slice(t).toLowerCase();return QE.includes(n)?n:null}function $7(e){return Q7(e)!==null}function H7(e){const t=e.toLowerCase();return t.endsWith(".kicad_sch")?".kicad_sch":t.endsWith(".kicad_pcb")?".kicad_pcb":null}function $E(e){return H7(e)!==null}function HE(e){return H7(e)===".kicad_pcb"?"pcb-front":"schematic"}const UE=[".html",".htm"];function rp(e){const t=e.lastIndexOf(".");if(t<0)return!1;const n=e.slice(t).toLowerCase();return UE.includes(n)}function zE(e){return`/api/terminal/fs/preview/${e.split(/[\\/]+/).filter(Boolean).map(n=>encodeURIComponent(n)).join("/")}`}const GE={".stl":"model/stl",".glb":"model/gltf-binary",".gltf":"model/gltf+json"};async function U7(e,t,n,r="list_directory",s){const i=new URLSearchParams({path:e});n&&i.set("showHidden","true"),i.set("action",r),s&&i.set("requestSlotId",s);const l=await ks(`/api/terminal/fs/list?${i}`,{signal:t},eu,"Directory listing took too long. The folder may be on slow storage or blocked by another process.");if(!l.ok){const c=await l.json().catch(()=>({error:"Failed to list directory"}));throw new Error(c.error||"Failed to list directory")}return l.json()}async function WE(e,t,n,r,s,i="name",l){const c=new URLSearchParams({path:e,query:t,stream:"true"});s&&c.set("showHidden","true"),i==="content"&&c.set("mode","content"),l&&c.set("requestSlotId",l);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 VE(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 f=await s.json().catch(()=>({error:"Failed to watch files"}));throw new Error(f.error||"Failed to watch files")}const i=s.body.getReader(),l=new TextDecoder;let c="";const u=f=>{if(!f.trim())return;const p=JSON.parse(f);p.type==="events"&&p.events?.length&&t(p.events)};for(;;){const{value:f,done:p}=await i.read();if(p)break;c+=l.decode(f,{stream:!0});let g=c.indexOf(`
|
|
@@ -175,12 +175,12 @@ ${z.desc}`:""}`,"aria-pressed":T===z.key,onPointerEnter:()=>A(z.key),onPointerLe
|
|
|
175
175
|
`:`
|
|
176
176
|
|
|
177
177
|
`;return`${e}${r}${n}`}function jZ(e,t){const n=e.trim();return n?t?`${n}\r`:/\s$/.test(e)?e:`${n} `:""}const y2="termdock:right-sidebar:html-view-mode-by-file:v1";function PZ(e){return e==="preview"||e==="source"}function lT(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(PZ)}function cT(e,t){if(!t)return null;const n=e&&!t.startsWith("/")?`${e}/${t}`:t;return e?`${e}::${n}`:n}function h4(e,t){const n=cT(e,t);return n?Fr(y2,lT)?.[n]??"source":"source"}function BZ(e,t,n){const r=cT(e,t);if(!r)return;const s=Fr(y2,lT)??{};Bn(y2,{...s,[r]:n})}function Px(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"),l=String(s).padStart(2,"0");return n>0?`${n}:${i}:${l}`:`${i}:${l}`}function FZ(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 OZ=350,QZ=12,$Z=90;function HZ({url:e,onLoadError:t}){const{t:n}=$n(),r=b.useRef(null),s=b.useRef(null),i=b.useRef(null),l=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),[Q,q]=b.useState(!1),[V,fe]=b.useState(null),[J,he]=b.useState(!1),[ye,ue]=b.useState(0),[ie,G]=b.useState(!1),[z,X]=b.useState({width:0,height:0}),oe=b.useCallback(()=>{S.current!==null&&(clearTimeout(S.current),S.current=null)},[]),me=b.useCallback(()=>{if(oe(),A.current=null,!T.current)return!1;const Ce=i.current;return Ce&&(Ce.playbackRate=L.current),T.current=!1,he(!1),!0},[oe]);b.useEffect(()=>()=>{u.current!==null&&cancelAnimationFrame(u.current),f.current!==null&&clearTimeout(f.current),oe();const Ce=i.current;Ce&&T.current&&(Ce.playbackRate=L.current)},[oe]),b.useEffect(()=>{const Ce=s.current;if(!Ce||typeof ResizeObserver>"u")return;const Ze=new ResizeObserver(([bt])=>{bt&&X({width:bt.contentRect.width,height:bt.contentRect.height})});return Ze.observe(Ce),()=>Ze.disconnect()},[]),b.useEffect(()=>{const Ce=()=>G(document.fullscreenElement===r.current);return document.addEventListener("fullscreenchange",Ce),()=>document.removeEventListener("fullscreenchange",Ce)},[]);const Ee=b.useCallback((Ce,Ze=!1)=>{const bt=i.current;if(!bt)return!1;const gt=Number.isFinite(bt.duration)?bt.duration:Ce,Yt=Math.min(Math.max(Ce,0),gt);if(R(Yt),Math.abs(bt.currentTime-Yt)<1/120)return!1;const an=bt.fastSeek;return Ze&&typeof an=="function"?an.call(bt,Yt):bt.currentTime=Yt,!0},[]),pe=b.useCallback(()=>{u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null;const Ce=i.current;if(!Ce||!g.current||y.current||Ce.seeking)return;const Ze=v.current;v.current=!1,y.current=Ee(p.current,!Ze)}))},[Ee]),Se=b.useCallback(Ce=>{const Ze=l.current,bt=i.current;if(!Ze||!bt)return;const gt=Ze.getBoundingClientRect(),Yt=FZ(Ce,gt,bt.duration);p.current=Yt,fe(Yt),v.current=!1,pe(),f.current!==null&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,v.current=!0,pe()},$Z)},[pe]),ve=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,Ee(p.current)},[Ee]),K=b.useCallback(Ce=>{const Ze=i.current;if(!(!Ze||!Number.isFinite(Ze.duration)||Ze.duration<=0)){c.current=!Ze.paused,Ze.pause(),g.current=!0,q(!0);try{Ce.currentTarget.setPointerCapture(Ce.pointerId)}catch{}Se(Ce.clientX)}},[Se]),it=b.useCallback(()=>{g.current=!1,ve(),q(!1),fe(null);const Ce=i.current;Ce&&c.current&&!Ce.ended&&Ce.play().catch(()=>{}),c.current=!1},[ve]),at=b.useCallback(()=>{const Ce=i.current;if(Ce){if(I.current){I.current=!1;return}Ce.paused?Ce.play().catch(()=>{}):Ce.pause()}},[]),lt=b.useCallback(Ce=>{const Ze=i.current;!Ze||Ze.paused||Ce.button!==0||(oe(),A.current={id:Ce.pointerId,x:Ce.clientX,y:Ce.clientY},S.current=setTimeout(()=>{S.current=null,L.current=Ze.playbackRate,Ze.playbackRate=2,T.current=!0,he(!0)},OZ))},[oe]),ke=b.useCallback(Ce=>{const Ze=A.current;!Ze||Ze.id!==Ce.pointerId||T.current||Math.hypot(Ce.clientX-Ze.x,Ce.clientY-Ze.y)>QZ&&(oe(),A.current=null)},[oe]),Oe=b.useCallback(()=>{me()&&(I.current=!0)},[me]);b.useEffect(()=>(window.addEventListener("pointerup",Oe),window.addEventListener("pointercancel",Oe),window.addEventListener("blur",Oe),()=>{window.removeEventListener("pointerup",Oe),window.removeEventListener("pointercancel",Oe),window.removeEventListener("blur",Oe)}),[Oe]);const de=b.useCallback(async()=>{const Ce=r.current,Ze=i.current;if(!(!Ce||!Ze))try{document.fullscreenElement===Ce?await document.exitFullscreen():Ce.requestFullscreen?await Ce.requestFullscreen():Ze.webkitEnterFullscreen?.()}catch{Ze.webkitEnterFullscreen?.()}},[]),Fe=b.useCallback(()=>ue(Ce=>(Ce+90)%360),[]),Ue=b.useCallback(Ce=>{const Ze=i.current;if(!Ze||!Number.isFinite(Ze.duration))return;const bt=Ce.shiftKey?10:5;let gt=null;Ce.key==="ArrowLeft"?gt=Ze.currentTime-bt:Ce.key==="ArrowRight"?gt=Ze.currentTime+bt:Ce.key==="Home"?gt=0:Ce.key==="End"&&(gt=Ze.duration),gt!==null&&(Ce.preventDefault(),Ee(gt))},[Ee]),Je=Q&&V!==null?V:F,ae=j>0?Math.min(1,Math.max(0,Je/j)):0,qe=(ye===90||ye===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":ye,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:{...qe,transform:`translate(-50%, -50%) rotate(${ye}deg)`},src:e,preload:"auto",playsInline:!0,onClick:at,onPointerDown:lt,onPointerMove:ke,onPointerUp:Oe,onPointerCancel:Oe,onContextMenu:Ce=>{T.current&&Ce.preventDefault()},onPlay:()=>$(!0),onPause:()=>$(!1),onTimeUpdate:Ce=>R(Ce.currentTarget.currentTime),onSeeked:Ce=>{const Ze=Ce.currentTarget;if(R(Ze.currentTime),y.current=!1,!g.current)return;const bt=Ze.requestVideoFrameCallback;typeof bt=="function"?bt.call(Ze,()=>{g.current&&pe()}):requestAnimationFrame(()=>{g.current&&pe()})},onLoadedMetadata:Ce=>P(Number.isFinite(Ce.currentTarget.duration)?Ce.currentTarget.duration:0),onDurationChange:Ce=>P(Number.isFinite(Ce.currentTarget.duration)?Ce.currentTarget.duration:0),onError:t,children:n("rightSidebar.videoUnsupported")}),J&&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")}),Q&&V!==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:`${ae*100}%`},"data-testid":"file-preview-video-scrub-time",children:Px(V)})]}),o.jsx("div",{"data-testid":"file-preview-video-controls",className:`shrink-0 border-t border-border/60 bg-background px-2 py-1.5 ${s9}`,[i9]:"",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:at,"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(YN,{size:14}):o.jsx(l8,{size:14})}),o.jsxs("div",{ref:l,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(j),"aria-valuenow":Math.floor(Je),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:K,onPointerMove:Ce=>{Q&&Se(Ce.clientX)},onPointerUp:it,onPointerCancel:it,onKeyDown:Ue,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:`${ae*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:`${ae*100}%`}})]}),o.jsxs("div",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground","data-testid":"file-preview-video-time",children:[Px(Je)," / ",Px(j)]}),o.jsx("button",{type:"button",onClick:Fe,"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(lM,{size:14})}),o.jsx("button",{type:"button",onClick:()=>{de()},"aria-label":n(ie?"rightSidebar.videoFullscreenExit":"rightSidebar.videoFullscreenEnter"),title:n(ie?"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:ie?o.jsx(BN,{size:14}):o.jsx(NN,{size:14})})]})})]})}function UZ(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 Ig({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:UZ(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(Al,{size:11}),t]})}function zZ(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,l=r.height*s,c=n.left+(n.width-i)/2,u=n.top+(n.height-l)/2,f=e-c,p=t-u;if(f<0||p<0||f>i||p>l)return null;const g=f/i*100,y=p/l*100;return{x:r.x+r.width*g/100,y:r.y+r.height*y/100,xPercent:g,yPercent:y}}function GZ(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 WZ(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(),l=s.value.trim();(i.startsWith("on")||(i==="href"||i.endsWith(":href"))&&l&&!l.startsWith("#"))&&r.removeAttribute(s.name)}}),n.removeAttribute("width"),n.removeAttribute("height"),n.setAttribute("preserveAspectRatio","xMidYMid meet"),new XMLSerializer().serializeToString(n)}function VZ(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 l=Number(s.getAttribute("x")),c=Number(s.getAttribute("y"));if(!Number.isFinite(l)||!Number.isFinite(c))continue;const u=Math.hypot(l-t,c-n);(!r||u<r.distance)&&(r={text:i,distance:u})}return r?.text.slice(0,120)}function uT({blobUrl:e,filePath:t,viewLabel:n,onInsertAnnotation:r}){const s=b.useRef(null),i=b.useRef(null),[l,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 ie=new AbortController;return c(null),f(null),A(null),g(1),fetch(e,{signal:ie.signal}).then(G=>G.text()).then(G=>c(WZ(G))).catch(G=>{ie.signal.aborted||f(G instanceof Error?G.message:"SVG preview failed")}),()=>ie.abort()},[e]),b.useEffect(()=>{if(!y)return;const ie=G=>{G.key==="Escape"&&v(!1)};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[y]),b.useLayoutEffect(()=>{const ie=i.current,G=ie?.querySelector("[data-svg-document] > svg");if(!ie||!G)return;let z;try{z=G.getBBox()}catch{return}if(!z.width||!z.height)return;const X=Math.max(2,Math.min(z.width,z.height)*.025);G.setAttribute("viewBox",`${z.x-X} ${z.y-X} ${z.width+2*X} ${z.height+2*X}`),G.style.width=`${p*100}%`,G.style.height=`${p*100}%`,G.style.minWidth=`${p*100}%`,G.style.minHeight=`${p*100}%`,G.style.display="block"},[l,p]);const F=b.useMemo(()=>S?GZ(t,n,S):null,[t,S,n]),R=ie=>{if(I.current){I.current=!1;return}const G=i.current,z=G?.querySelector("[data-svg-document] > svg"),X=s.current;if(!G||!z||!X)return;const oe=z.viewBox.baseVal,me=zZ(ie.clientX,ie.clientY,z.getBoundingClientRect(),oe);if(!me)return;const Ee=X.getBoundingClientRect();A({...me,nearestText:VZ(z,me.x,me.y),stageX:ie.clientX-Ee.left,stageY:ie.clientY-Ee.top,stageXPercent:(ie.clientX-Ee.left)/Ee.width*100,stageYPercent:(ie.clientY-Ee.top)/Ee.height*100})},C=ie=>Math.max(1,Math.min(12,ie)),$=(ie,G)=>{const z=C(G),X=ie.querySelector("[data-svg-document] > svg");if(!X)return z;const oe=`${z*100}%`;return X.style.width=oe,X.style.height=oe,X.style.minWidth=oe,X.style.minHeight=oe,P.current=z,z},Q=(ie,G,z,X)=>{const oe=P.current,me=ie.getBoundingClientRect(),Ee=z-me.left,pe=X-me.top,Se=(ie.scrollLeft+Ee)/oe,ve=(ie.scrollTop+pe)/oe,K=$(ie,G);return ie.scrollLeft=Se*K-Ee,ie.scrollTop=ve*K-pe,K},q=()=>{const ie=Array.from(T.current.values());return ie.length>=2?Math.hypot(ie[0].x-ie[1].x,ie[0].y-ie[1].y):0},V=ie=>{if(ie.pointerType==="mouse"&&ie.button!==0)return;const G=i.current;G&&(T.current.set(ie.pointerId,{x:ie.clientX,y:ie.clientY}),G.setPointerCapture?.(ie.pointerId),T.current.size>=2?(L.current={kind:"pinch",startX:ie.clientX,startY:ie.clientY,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startDistance:q(),startZoom:P.current,moved:!1},I.current=!0):P.current>1&&(L.current={kind:"pan",startX:ie.clientX,startY:ie.clientY,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startZoom:P.current,moved:!1}))},fe=ie=>{if(!T.current.has(ie.pointerId))return;T.current.set(ie.pointerId,{x:ie.clientX,y:ie.clientY});const G=i.current,z=L.current;if(!(!G||!z)){if(T.current.size>=2&&z.kind==="pinch"){const X=q();if(!z.startDistance||!X)return;const oe=C(z.startZoom*X/z.startDistance);if(Math.abs(oe-P.current)<.01)return;const me=Array.from(T.current.values()),Ee=(me[0].x+me[1].x)/2,pe=(me[0].y+me[1].y)/2;z.moved=!0,I.current=!0,Q(G,oe,Ee,pe),ie.preventDefault();return}if(z.kind==="pan"&&T.current.size===1){const X=ie.clientX-z.startX,oe=ie.clientY-z.startY;if(!z.moved&&Math.hypot(X,oe)<6)return;z.moved=!0,I.current=!0,G.scrollLeft=z.startScrollLeft-X,G.scrollTop=z.startScrollTop-oe,ie.preventDefault()}}},J=ie=>{const G=i.current,z=L.current,X=T.current.size===1&&!z?.moved;T.current.delete(ie.pointerId);try{G?.releasePointerCapture?.(ie.pointerId)}catch{}if(T.current.size===1&&z?.kind==="pinch"){const Ee=Array.from(T.current.values())[0];L.current=G?{kind:"pan",startX:Ee.x,startY:Ee.y,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startZoom:P.current,moved:!1}:null;return}if(T.current.size>0||(L.current=null,z?.kind==="pinch"&&g(P.current),!X||I.current))return;const oe=Date.now(),me=j.current;me&&oe-me.time<350&&Math.hypot(ie.clientX-me.x,ie.clientY-me.y)<24?(j.current=null,I.current=!0,g(Ee=>Ee>1?1:2.5)):j.current={time:oe,x:ie.clientX,y:ie.clientY}},he=ie=>{if(!ie.ctrlKey&&!ie.metaKey)return;const G=i.current;if(!G)return;ie.preventDefault();const z=Q(G,P.current*Math.exp(-ie.deltaY*.01),ie.clientX,ie.clientY);g(z)},ye=()=>{g(1),P.current=1,i.current&&(i.current.scrollLeft=0,i.current.scrollTop=0)},ue=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:ie=>{ie.preventDefault(),g(G=>G>1?1:2.5)},onPointerDown:V,onPointerMove:fe,onPointerUp:J,onPointerCancel:J,onWheel:he,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}):l?o.jsx("div",{"data-svg-document":!0,className:"h-full min-h-[240px] w-full",dangerouslySetInnerHTML:{__html:l}}):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(Ig,{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:ie=>{ie.stopPropagation(),ye()},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(dM,{size:14})}),o.jsx("button",{type:"button","aria-label":y?"退出全屏 SVG":"全屏 SVG",title:y?"退出全屏 SVG":"全屏 SVG",onClick:ie=>{ie.stopPropagation(),v(G=>!G)},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(Y2,{size:14}):o.jsx(q2,{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?oa.createPortal(ue,document.body):ue}function fm(e){switch(e){case"schematic":return"原理图第1页";case"pcb-front":return"PCB正面";case"pcb-back":return"PCB背面(镜像)";case"pcb-3d":return"PCB 3D正面"}}function qZ(e,t,n,r){const s=[`电子标注: ${e}`,`视图: ${fm(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 YZ({blobUrl:e,filePath:t,view:n,board:r,onViewChange:s,onInsertAnnotation:i,onRefresh:l,interactive3d:c}){const{t:u}=$n(),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?qZ(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,Q=F.naturalHeight*C,q=R.left+(R.width-$)/2,V=R.top+(R.height-Q)/2,fe=j.clientX-q,J=j.clientY-V;if(fe<0||J<0||fe>$||J>Q)return;const he={xPercent:Math.max(0,Math.min(100,fe/$*100)),yPercent:Math.max(0,Math.min(100,J/Q*100)),stageXPercent:(j.clientX-R.left)/R.width*100,stageYPercent:(j.clientY-R.top)/R.height*100,inspecting:r&&n!=="pcb-3d"};if(v(he),g.current?.abort(),!he.inspecting)return;const ye=new AbortController;g.current=ye,KE(t,n,he.xPercent,he.yPercent,ye.signal).then(ue=>v(ie=>ie===he?{...ie,inspection:ue,inspecting:!1}:ie)).catch(()=>{ye.signal.aborted||v(ue=>ue===he?{...ue,inspection:{available:!1},inspecting:!1}:ue)})},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:fm(j)},j))}),o.jsx("button",{type:"button",onClick:l,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(fi,{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} ${fm(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(Ig,{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(uT,{blobUrl:e,filePath:t,viewLabel:fm(n),onInsertAnnotation:i})})]})}function KZ(e){const t=[];let n=[],r="",s=!1;for(let i=0;i<e.length;i+=1){const l=e[i];s?l==='"'&&e[i+1]==='"'?(r+='"',i+=1):l==='"'?s=!1:r+=l:l==='"'?s=!0:l===","?(n.push(r),r=""):l===`
|
|
178
|
-
`?(n.push(r.replace(/\r$/,"")),t.push(n),n=[],r=""):r+=l}return(r||n.length>0)&&(n.push(r.replace(/\r$/,"")),t.push(n)),t}function XZ(e,t,n,r,s){const i=t[s]||`第${s+1}列`,l=n[s]??"",c=t.map((u,f)=>`${u||`第${f+1}列`}=${n[f]??""}`).join(";");return`"表格标注: ${e} / 数据行: ${r+1} / 列: ${i} / 值: ${l} / 记录: ${c}"`}function ZZ({content:e,filePath:t,onInsertAnnotation:n}){const{t:r}=$n(),s=b.useMemo(()=>KZ(e),[e]),i=s[0]??[],l=s.slice(1),c=b.useRef(null),[u,f]=b.useState(null),p=u?l[u.row]:null,g=u&&p?XZ(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:l.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(Ig,{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:l.length,columns:i.length})})})]})}function Td(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function JZ(e,t){const n=JSON.parse(e),r=Td(n,["meta","version"]);if(t)return[{label:"文件性质",value:"KiCad 本机界面状态,不属于电气设计源文件"},{label:"格式版本",value:String(r??"未知")},{label:"活动层编号",value:String(Td(n,["board","active_layer"])??"未知")},{label:"可见层掩码",value:String(Td(n,["board","visible_layers"])??"未知")},{label:"Git 集成",value:Td(n,["git","integration_disabled"])===!0?"已禁用":"未禁用"}];const s=Td(n,["net_settings","classes"]),i=Array.isArray(s)?s.find(c=>c&&typeof c=="object"&&c.name==="Default"):void 0,l=Td(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(l)?l.length:0)}]}function eJ(e,t){return`"KiCad项目标注: ${e} / 项: ${t.label} / 值: ${t.value}"`}function tJ({content:e,filePath:t,localState:n,onInsertAnnotation:r}){const{t:s}=$n(),i=b.useRef(null),[l,c]=b.useState(null),u=b.useMemo(()=>{try{return{items:JZ(e,n),error:null}}catch(p){return{items:[],error:p instanceof Error?p.message:String(p)}}},[e,n]),f=l===null?null:u.items[l.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 ${l?.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&&l&&o.jsx(Ig,{anchor:{xPercent:l.xPercent,yPercent:l.yPercent},title:s("rightSidebar.kicadInsertSetting"),onClick:()=>{r?.(eJ(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 nJ=b.forwardRef(function({src:t,title:n,exitFullscreenLabel:r,onFullscreenChange:s},i){const l=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===l.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=l.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:l,"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(Y2,{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?oa.createPortal(v,document.body):v}),qy="termdock:right-sidebar:file-tree-scroll:v1",Yy="termdock:right-sidebar:file-preview-reading-state:v1",wf="termdock:right-sidebar:file-tree-width:v1",dT="termdock:right-sidebar:markdown-view-mode:v1",fT="termdock:right-sidebar:diff-change-list-mode:v1",hT="termdock:right-sidebar:diff-wrap:v1",pT="termdock:diff-viewer:view-type:v1",mT="termdock:right-sidebar:file-search-mode:v1",Bx="termdock:right-sidebar:collapsed-git-repo-groups:v1",p4="termdock:right-sidebar:collapsed-diff-directories:v1",Fx="termdock:right-sidebar:branch-audit-module-open:v1",gT="termdock:right-sidebar:branch-audit-module:v1",rJ=150,xT="termdock:right-sidebar:active-git-repo:v1",m4="termdock:right-sidebar:context-draft-enabled:v1",g4="termdock:right-sidebar:context-draft-collapsed:v1",x4="termdock:right-sidebar:context-draft-auto-collapse:v1",Ox="termdock:right-sidebar:context-draft-text:v1",sJ=300,iJ=20,oJ=120,aJ=250,lJ=250,cJ=120,uJ=700,Qx=600,b4=[2e3,5e3,15e3,3e4],dJ=320,fJ=500,hJ=20,pJ=12e3,v2=300,y4=240,mJ=560,bT="border-r px-2 py-1.5 sm:px-3 sm:py-2",Km="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",yT=`${bT} border-b border-border/15 font-semibold last:border-r-0`,vT=`${bT} border-border/10 align-top text-muted-foreground last:border-r-0`,Ky="termdock-file-preview-horizontal-scroll",v4=b.lazy(()=>o0(()=>import("./ModelPreview-B2B3H2Ix.js"),__vite__mapDeps([2,3,1,4]))),wT=`${Ky} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`,gJ=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function xJ(e){return e==="preview"||e==="source"}function bJ(e){return e==="list"||e==="tree"||e==="ai"}function w4(){return Fr(dT,xJ)??"preview"}function yJ(){return Fr(fT,bJ)??"tree"}function Sf(e){return typeof e=="boolean"}function vJ(e){return typeof e=="string"}function wJ(){return Fr(hT,Sf)??!0}function SJ(e){return e==="unified"||e==="split"}function AJ(){return Fr(pT,SJ)??"unified"}function TJ(e){return e==="name"||e==="content"||e==="regex"}function CJ(){return Fr(mT,TJ)??"name"}function kJ(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Bo(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function _J(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function ST(){return Fr(xT,_J)??{}}function S4(e){if(!e)return;const t=ST();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function $x(e,t){e&&Bn(xT,{...ST(),[e]:t})}function LJ(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 w2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function A4(e){const t=Fr(e,w2);return t?new Set(t):new Set}function Hx(e,t){Bn(e,[...t])}function EJ(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 IJ(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||w2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(EJ))&&(t.commits===void 0||w2(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 RJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&IJ(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function NJ(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(RJ))&&(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 T4(){return Fr(gT,NJ)??{}}function C4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function k4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function AT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||k4(n)===k4(r)}function _4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!AT(r,t))??""}function S2(e,t){const n=Math.max(y4,t-320),r=Math.min(mJ,n);return Math.min(r,Math.max(y4,e))}function MJ(e){return typeof e=="number"&&Number.isFinite(e)}function DJ(e){return S2(Fr(wf,MJ)??v2,e)}function TT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function af(e){return gJ.has(TT(e))}function CT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function A2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||CT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function jJ(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const kT=b.createContext(null);function hm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function _T(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function LT(e){return e.replace(/\s+#+\s*$/,"").trim()}function T2(e,t){const r=_T(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 L4(e){return _T(e)||e.trim()}function Xm(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=k2(t[2]);return n?{id:hm(t[1]),definition:{href:n.href,title:n.title}}:null}function PJ(e){const t=new Map;for(const n of e){const r=Xm(n);r&&t.set(r.id,r.definition)}return t}function ET(e){return e.trim().toLowerCase()}function IT(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:ET(t[1]),text:t[2]}:null}function BJ(e){const t=new Map;let n=null;for(const r of e){const s=IT(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 FJ(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(IT(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function OJ(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 RT(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function jf(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 QJ(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,l=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=l?decodeURIComponent(l):null}catch{return null}const p=n?jf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=jf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=jf(`${RT(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function $J(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!F2(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=jf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=jf(`${RT(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const C2=128,HJ=360,Ux=480;function Xy(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function UJ(e,t,n,r){if(!t||!n)return null;let s,i;return Xy(e)?(i=Math.min(Math.max(n,C2),HJ),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>Ux&&(s=s*Ux/i,i=Ux),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function zJ(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function NT(e){const t=zJ(e),n=xt(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function GJ({src:e,alt:t,title:n}){const r=Xy(e),s=NT(e),i=b.useRef(null),[l,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(l)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()},[l]),b.useEffect(()=>{if(!l)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)}},[l,s]);const S=UJ(e,y?.width??0,y?.height??0,u),A=S??{width:C2*2,height:C2};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 zx(e,t,n,r,s){const i=$J(n,s.markdownFilePath,s.rootPath);if(!i)return``;const l=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(GJ,{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?.(l)},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 Gx(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function E4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function k2(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 MT="",WJ=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function VJ(e){return e.replace(WJ,(t,n)=>`${MT}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function I4(e){return e.replace(new RegExp(`${MT}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function qJ(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const DT={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 Bp=null;function jT(){return Bp||(Bp=o0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Bp=null,e})),Bp}function PT({html:e}){const{t}=$n(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),jT().then(i=>{s||r(i.sanitize(e,DT))}).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 YJ({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),jT().then(s=>{r||n(s.sanitize(e,DT))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function BT(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 Fp=null;function KJ(){return Fp||(Fp=Promise.all([o0(()=>import("./katex-DnlPpQZa.js"),[]),o0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Fp=null,e})),Fp}function eh({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),KJ().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 l=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:l,dangerouslySetInnerHTML:{__html:n}})}function XJ(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(YJ,{html:e},t):null;const s=r[1].toLowerCase(),i=vi(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 vi(e,t,n=!0,r){const s=VJ(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,l=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&l.push(I4(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?XJ(f,p,r):null;if(g)l.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))l.push(o.jsx(eh,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))l.push(o.jsx(eh,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;l.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:qJ(f.slice(y,-y))},p))}else if(f.startsWith("~~"))l.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:vi(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))l.push(o.jsx("strong",{className:"font-semibold text-foreground",children:vi(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))l.push(o.jsx("em",{className:"italic",children:vi(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=k2(y[2]);l.push(A?zx(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(hm(A));l.push(T?zx(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(hm(S[1]));l.push(A?zx(p,S[1],A.href,A.title,r):f)}else l.push(f)}else if(f.startsWith("[^")){const y=ET(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);l.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);l.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(">")&&E4(f.slice(1,-1))){const y=f.slice(1,-1);l.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(E4(Gx(f).linkText)){const{linkText:y,suffix:v}=Gx(f);l.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&&l.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=Gx(f),S=y.startsWith("www.")?`https://${y}`:y;l.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&&l.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(hm(A)):null,L=y?k2(y[2]):null,I=L?.href??T?.href??null,j=I?jJ(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";l.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:vi(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&l.push(I4(s.slice(c))),l.length>0?l:[e]}function FT(e){return/(?: {2,}|\\)$/.test(e)}function OT(e){return e.replace(/(?: {2,}|\\)$/,"")}function Zm(e){return/^(?: {4}|\t)/.test(e)}function QT(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function $T(e,t,n){const r=[];return e.forEach((s,i)=>{const l=FT(s);r.push(...vi(OT(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(l?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function _2(e,t,n){const r=[],s=[];return e.forEach((i,l)=>{s.push(FT(i)),r.push(vi(OT(i),`${t}-${l}`,!0,n))}),{perLine:r,hardBreaks:s}}function L2(e,t,n,r,s){const i=[];return e.forEach((l,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:l},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function th(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,l=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==="["?l+=1:i===0&&u==="]"&&l>0&&(l-=1),u==="|"&&i===0&&l===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function HT(e){return th(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function Jm(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function eg(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function ZJ(e,t){return e>96||e>44&&t>.35}function Zy(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function Jy(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 UT(e,t,n,r,s,i=new Set){const l=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(Xm(f)||i.has(u))){u+=1;continue}const p=Jy(f),g=Zy(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):l.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:l,nextIndex:u}}function e5(e,t,n,r=0){return e.map((s,i)=>{const l=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!l,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[l?o.jsx("input",{type:"checkbox",checked:l[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,vi(l?.[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:vi(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:JJ(s.children,`${t}-${i}`,n,r)}})}function JJ(e,t,n,r=0){const s=[];for(const i of e){const l=s[s.length-1];l&&l.ordered===i.ordered?l.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,l)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:e5(i.items,`${t}-g${l}`,n,r)}))}function t5(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&&eee(n.groups,t)]},n.key)})}function eee(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:t5(n.items,t)},`nested-${r}`)})}function tee(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:[vi(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 nee(e,t,n,r){const s=[];let i=0;const l=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:vi(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:$T(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=BT(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(PT,{html:L.join(`
|
|
178
|
+
`?(n.push(r.replace(/\r$/,"")),t.push(n),n=[],r=""):r+=l}return(r||n.length>0)&&(n.push(r.replace(/\r$/,"")),t.push(n)),t}function XZ(e,t,n,r,s){const i=t[s]||`第${s+1}列`,l=n[s]??"",c=t.map((u,f)=>`${u||`第${f+1}列`}=${n[f]??""}`).join(";");return`"表格标注: ${e} / 数据行: ${r+1} / 列: ${i} / 值: ${l} / 记录: ${c}"`}function ZZ({content:e,filePath:t,onInsertAnnotation:n}){const{t:r}=$n(),s=b.useMemo(()=>KZ(e),[e]),i=s[0]??[],l=s.slice(1),c=b.useRef(null),[u,f]=b.useState(null),p=u?l[u.row]:null,g=u&&p?XZ(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:l.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(Ig,{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:l.length,columns:i.length})})})]})}function Td(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function JZ(e,t){const n=JSON.parse(e),r=Td(n,["meta","version"]);if(t)return[{label:"文件性质",value:"KiCad 本机界面状态,不属于电气设计源文件"},{label:"格式版本",value:String(r??"未知")},{label:"活动层编号",value:String(Td(n,["board","active_layer"])??"未知")},{label:"可见层掩码",value:String(Td(n,["board","visible_layers"])??"未知")},{label:"Git 集成",value:Td(n,["git","integration_disabled"])===!0?"已禁用":"未禁用"}];const s=Td(n,["net_settings","classes"]),i=Array.isArray(s)?s.find(c=>c&&typeof c=="object"&&c.name==="Default"):void 0,l=Td(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(l)?l.length:0)}]}function eJ(e,t){return`"KiCad项目标注: ${e} / 项: ${t.label} / 值: ${t.value}"`}function tJ({content:e,filePath:t,localState:n,onInsertAnnotation:r}){const{t:s}=$n(),i=b.useRef(null),[l,c]=b.useState(null),u=b.useMemo(()=>{try{return{items:JZ(e,n),error:null}}catch(p){return{items:[],error:p instanceof Error?p.message:String(p)}}},[e,n]),f=l===null?null:u.items[l.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 ${l?.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&&l&&o.jsx(Ig,{anchor:{xPercent:l.xPercent,yPercent:l.yPercent},title:s("rightSidebar.kicadInsertSetting"),onClick:()=>{r?.(eJ(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 nJ=b.forwardRef(function({src:t,title:n,exitFullscreenLabel:r,onFullscreenChange:s},i){const l=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===l.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=l.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:l,"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(Y2,{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?oa.createPortal(v,document.body):v}),qy="termdock:right-sidebar:file-tree-scroll:v1",Yy="termdock:right-sidebar:file-preview-reading-state:v1",wf="termdock:right-sidebar:file-tree-width:v1",dT="termdock:right-sidebar:markdown-view-mode:v1",fT="termdock:right-sidebar:diff-change-list-mode:v1",hT="termdock:right-sidebar:diff-wrap:v1",pT="termdock:diff-viewer:view-type:v1",mT="termdock:right-sidebar:file-search-mode:v1",Bx="termdock:right-sidebar:collapsed-git-repo-groups:v1",p4="termdock:right-sidebar:collapsed-diff-directories:v1",Fx="termdock:right-sidebar:branch-audit-module-open:v1",gT="termdock:right-sidebar:branch-audit-module:v1",rJ=150,xT="termdock:right-sidebar:active-git-repo:v1",m4="termdock:right-sidebar:context-draft-enabled:v1",g4="termdock:right-sidebar:context-draft-collapsed:v1",x4="termdock:right-sidebar:context-draft-auto-collapse:v1",Ox="termdock:right-sidebar:context-draft-text:v1",sJ=300,iJ=20,oJ=120,aJ=250,lJ=250,cJ=120,uJ=700,Qx=600,b4=[2e3,5e3,15e3,3e4],dJ=320,fJ=500,hJ=20,pJ=12e3,v2=300,y4=240,mJ=560,bT="border-r px-2 py-1.5 sm:px-3 sm:py-2",Km="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",yT=`${bT} border-b border-border/15 font-semibold last:border-r-0`,vT=`${bT} border-border/10 align-top text-muted-foreground last:border-r-0`,Ky="termdock-file-preview-horizontal-scroll",v4=b.lazy(()=>o0(()=>import("./ModelPreview-5X_nSoT6.js"),__vite__mapDeps([2,3,1,4]))),wT=`${Ky} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`,gJ=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function xJ(e){return e==="preview"||e==="source"}function bJ(e){return e==="list"||e==="tree"||e==="ai"}function w4(){return Fr(dT,xJ)??"preview"}function yJ(){return Fr(fT,bJ)??"tree"}function Sf(e){return typeof e=="boolean"}function vJ(e){return typeof e=="string"}function wJ(){return Fr(hT,Sf)??!0}function SJ(e){return e==="unified"||e==="split"}function AJ(){return Fr(pT,SJ)??"unified"}function TJ(e){return e==="name"||e==="content"||e==="regex"}function CJ(){return Fr(mT,TJ)??"name"}function kJ(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Bo(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function _J(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function ST(){return Fr(xT,_J)??{}}function S4(e){if(!e)return;const t=ST();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function $x(e,t){e&&Bn(xT,{...ST(),[e]:t})}function LJ(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 w2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function A4(e){const t=Fr(e,w2);return t?new Set(t):new Set}function Hx(e,t){Bn(e,[...t])}function EJ(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 IJ(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||w2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(EJ))&&(t.commits===void 0||w2(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 RJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&IJ(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function NJ(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(RJ))&&(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 T4(){return Fr(gT,NJ)??{}}function C4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function k4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function AT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||k4(n)===k4(r)}function _4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!AT(r,t))??""}function S2(e,t){const n=Math.max(y4,t-320),r=Math.min(mJ,n);return Math.min(r,Math.max(y4,e))}function MJ(e){return typeof e=="number"&&Number.isFinite(e)}function DJ(e){return S2(Fr(wf,MJ)??v2,e)}function TT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function af(e){return gJ.has(TT(e))}function CT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function A2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||CT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function jJ(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const kT=b.createContext(null);function hm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function _T(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function LT(e){return e.replace(/\s+#+\s*$/,"").trim()}function T2(e,t){const r=_T(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 L4(e){return _T(e)||e.trim()}function Xm(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=k2(t[2]);return n?{id:hm(t[1]),definition:{href:n.href,title:n.title}}:null}function PJ(e){const t=new Map;for(const n of e){const r=Xm(n);r&&t.set(r.id,r.definition)}return t}function ET(e){return e.trim().toLowerCase()}function IT(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:ET(t[1]),text:t[2]}:null}function BJ(e){const t=new Map;let n=null;for(const r of e){const s=IT(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 FJ(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(IT(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function OJ(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 RT(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function jf(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 QJ(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,l=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=l?decodeURIComponent(l):null}catch{return null}const p=n?jf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=jf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=jf(`${RT(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function $J(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!F2(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=jf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=jf(`${RT(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const C2=128,HJ=360,Ux=480;function Xy(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function UJ(e,t,n,r){if(!t||!n)return null;let s,i;return Xy(e)?(i=Math.min(Math.max(n,C2),HJ),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>Ux&&(s=s*Ux/i,i=Ux),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function zJ(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function NT(e){const t=zJ(e),n=xt(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function GJ({src:e,alt:t,title:n}){const r=Xy(e),s=NT(e),i=b.useRef(null),[l,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(l)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()},[l]),b.useEffect(()=>{if(!l)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)}},[l,s]);const S=UJ(e,y?.width??0,y?.height??0,u),A=S??{width:C2*2,height:C2};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 zx(e,t,n,r,s){const i=$J(n,s.markdownFilePath,s.rootPath);if(!i)return``;const l=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(GJ,{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?.(l)},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 Gx(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function E4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function k2(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 MT="",WJ=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function VJ(e){return e.replace(WJ,(t,n)=>`${MT}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function I4(e){return e.replace(new RegExp(`${MT}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function qJ(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const DT={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 Bp=null;function jT(){return Bp||(Bp=o0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Bp=null,e})),Bp}function PT({html:e}){const{t}=$n(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),jT().then(i=>{s||r(i.sanitize(e,DT))}).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 YJ({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),jT().then(s=>{r||n(s.sanitize(e,DT))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function BT(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 Fp=null;function KJ(){return Fp||(Fp=Promise.all([o0(()=>import("./katex-DnlPpQZa.js"),[]),o0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Fp=null,e})),Fp}function eh({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),KJ().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 l=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:l,dangerouslySetInnerHTML:{__html:n}})}function XJ(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(YJ,{html:e},t):null;const s=r[1].toLowerCase(),i=vi(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 vi(e,t,n=!0,r){const s=VJ(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,l=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&l.push(I4(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?XJ(f,p,r):null;if(g)l.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))l.push(o.jsx(eh,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))l.push(o.jsx(eh,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;l.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:qJ(f.slice(y,-y))},p))}else if(f.startsWith("~~"))l.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:vi(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))l.push(o.jsx("strong",{className:"font-semibold text-foreground",children:vi(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))l.push(o.jsx("em",{className:"italic",children:vi(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=k2(y[2]);l.push(A?zx(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(hm(A));l.push(T?zx(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(hm(S[1]));l.push(A?zx(p,S[1],A.href,A.title,r):f)}else l.push(f)}else if(f.startsWith("[^")){const y=ET(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);l.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);l.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(">")&&E4(f.slice(1,-1))){const y=f.slice(1,-1);l.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(E4(Gx(f).linkText)){const{linkText:y,suffix:v}=Gx(f);l.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&&l.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=Gx(f),S=y.startsWith("www.")?`https://${y}`:y;l.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&&l.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(hm(A)):null,L=y?k2(y[2]):null,I=L?.href??T?.href??null,j=I?jJ(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";l.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:vi(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&l.push(I4(s.slice(c))),l.length>0?l:[e]}function FT(e){return/(?: {2,}|\\)$/.test(e)}function OT(e){return e.replace(/(?: {2,}|\\)$/,"")}function Zm(e){return/^(?: {4}|\t)/.test(e)}function QT(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function $T(e,t,n){const r=[];return e.forEach((s,i)=>{const l=FT(s);r.push(...vi(OT(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(l?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function _2(e,t,n){const r=[],s=[];return e.forEach((i,l)=>{s.push(FT(i)),r.push(vi(OT(i),`${t}-${l}`,!0,n))}),{perLine:r,hardBreaks:s}}function L2(e,t,n,r,s){const i=[];return e.forEach((l,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:l},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function th(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,l=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==="["?l+=1:i===0&&u==="]"&&l>0&&(l-=1),u==="|"&&i===0&&l===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function HT(e){return th(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function Jm(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function eg(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function ZJ(e,t){return e>96||e>44&&t>.35}function Zy(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function Jy(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 UT(e,t,n,r,s,i=new Set){const l=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(Xm(f)||i.has(u))){u+=1;continue}const p=Jy(f),g=Zy(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):l.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:l,nextIndex:u}}function e5(e,t,n,r=0){return e.map((s,i)=>{const l=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!l,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[l?o.jsx("input",{type:"checkbox",checked:l[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,vi(l?.[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:vi(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:JJ(s.children,`${t}-${i}`,n,r)}})}function JJ(e,t,n,r=0){const s=[];for(const i of e){const l=s[s.length-1];l&&l.ordered===i.ordered?l.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,l)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:e5(i.items,`${t}-g${l}`,n,r)}))}function t5(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&&eee(n.groups,t)]},n.key)})}function eee(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:t5(n.items,t)},`nested-${r}`)})}function tee(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:[vi(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 nee(e,t,n,r){const s=[];let i=0;const l=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:vi(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:$T(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=BT(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(PT,{html:L.join(`
|
|
179
179
|
`)},`${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(GT,{code:L.join(`
|
|
180
180
|
`),blockKey:`${t}-code-${P}`},`${t}-code-${P}`)}):["math","latex","tex"].includes(j.toLowerCase())?s.push({kind:"static",node:o.jsx(eh,{tex:L.join(`
|
|
181
181
|
`),display:!0},`${t}-code-${P}`)}):s.push({kind:"code",key:`${t}-code-${P}`,code:L.join(`
|
|
182
182
|
`),lang:j,blockKey:`${t}-code-${P}`,codeStartLine:l(P)+1});continue}if(Zm(c)){const L=[],I=i;for(;i<e.length&&(Zm(e[i])||!e[i].trim());)L.push(e[i].trim()?QT(e[i]):""),i+=1;s.push({kind:"code",key:`${t}-indented-code-${I}`,code:L.join(`
|
|
183
|
-
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:l(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=LT(g[2]),P=T2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:vi(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&eg(e[i+1])){const L=th(c),I=HT(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(th(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:wT,"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:`${yT} ${Jm(I[R]??null)}`,children:o.jsx("div",{className:Km,children:vi(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} ${Jm(I[$]??null)}`,children:o.jsx("div",{className:Km,children:vi(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=Jy(c);if(y){const L=y.ordered,I=Zy(c),j=y.start,P=i,F=UT(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:e5(F.items,`${t}-list-${P}`,n,l(0)-1)});continue}const v=[c.trimStart()],S=[l(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!A2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&eg(e[i+1]));)v.push(e[i].trimStart()),S.push(l(i)),i+=1;const T=_2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function ree(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:L2(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:t5(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(tg,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Op=null,R4=!1;const Qp=16,zT=192;function see(){return Op||(Op=o0(()=>import("./mermaid.core-
|
|
183
|
+
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:l(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=LT(g[2]),P=T2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:vi(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&eg(e[i+1])){const L=th(c),I=HT(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(th(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:wT,"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:`${yT} ${Jm(I[R]??null)}`,children:o.jsx("div",{className:Km,children:vi(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} ${Jm(I[$]??null)}`,children:o.jsx("div",{className:Km,children:vi(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=Jy(c);if(y){const L=y.ordered,I=Zy(c),j=y.start,P=i,F=UT(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:e5(F.items,`${t}-list-${P}`,n,l(0)-1)});continue}const v=[c.trimStart()],S=[l(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!A2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&eg(e[i+1]));)v.push(e[i].trimStart()),S.push(l(i)),i+=1;const T=_2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function ree(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:L2(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:t5(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(tg,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Op=null,R4=!1;const Qp=16,zT=192;function see(){return Op||(Op=o0(()=>import("./mermaid.core-BXdCtSXM.js").then(e=>e.aJ),__vite__mapDeps([6,1,7])).then(e=>e.default??e).catch(e=>{throw Op=null,e})),Op}function iee(e){R4||(e.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"}),R4=!0)}function oee(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 l=Math.max(zT,Math.ceil(s)),c=Math.ceil(l/s*i);return e.replace(/<svg\b([^>]*)>/i,(u,f)=>`<svg${f.replace(/\s(?:width|height)=(["']).*?\1/gi,"").replace(/\sstyle=(["']).*?\1/gi,"")} width="${l}" height="${c}">`)}function aee(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,l=n.height+Qp*2,c=Math.max(zT,Math.ceil(i)),u=Math.ceil(c/i*l);t.setAttribute("viewBox",`${r} ${s} ${i} ${l}`),t.setAttribute("width",String(c)),t.setAttribute("height",String(u)),t.removeAttribute("style")}function lee(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t)return null;const n=t.replace(/^language-/,"");return Zf(`code.${n}`)??n}function GT({code:e,blockKey:t}){const{t:n}=$n(),[r,s]=b.useState(null),[i,l]=b.useState(!1),c=b.useRef(null),u=b.useContext(kT);b.useEffect(()=>{let p=!1;return s(null),l(!1),see().then(async g=>{iee(g);const y=`termdock-md-mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`,{svg:v}=await g.render(y,e);p||s(oee(v))}).catch(()=>{p||l(!0)}),()=>{p=!0}},[t,e]),b.useLayoutEffect(()=>{r&&aee(c.current)},[r]);const f=b.useCallback(()=>{const p=c.current?.querySelector("svg")?.outerHTML??r;p&&u?.(p)},[u,r]);return i?o.jsx(tg,{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 tg({code:e,lang:t,blockKey:n,codeStartLine:r,lineRange:s}){const i=lee(t),[l,c]=b.useState(null);b.useEffect(()=>{if(!i||!U9(e)){c(null);return}let f=!1;return z9().then(p=>{if(f||!p.registered(i)){f||c(null);return}try{c(G9(p,e,i))}catch{f||c(null)}}).catch(()=>{f||c(null)}),()=>{f=!0}},[n,e,i]);const u=l??(e||" ").split(`
|
|
184
184
|
`).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:`${Ky} 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?`
|
|
185
185
|
`:null]},`${n}-line-${p}`)})})})]})}function cee(e,t,n,r,s){e=OJ(e);const i=PJ(e),l=FJ(e),c=[],u={markdownFilePath:t,rootPath:n,referenceDefinitions:i,footnoteDefinitions:BJ(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(Xm(y)||l.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 Q=e[p].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);Q?C=Q[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:vi(C,`details-${R}-summary`,!0,u)}),$.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:$T($,`details-${R}`,u)})]})});continue}const S=BT(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(PT,{html:R.join(`
|
|
186
186
|
`)})});continue}const A=v.match(/^(```|~~~)\s*(.*)$/);if(A){const R=[],C=A[1],$=A[2]?.trim(),Q=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-${Q}`,startLine:Q+1,endLine:p,fineGrained:$.toLowerCase()!=="mermaid"&&!["math","latex","tex"].includes($.toLowerCase()),content:$.toLowerCase()==="mermaid"?o.jsx(GT,{code:R.join(`
|
|
@@ -453,4 +453,4 @@ ${De}
|
|
|
453
453
|
+ }
|
|
454
454
|
return context;
|
|
455
455
|
}`}};function r7(){if(typeof window>"u")return"kotlin";const t=new URLSearchParams(window.location.search).get("fixture");return t&&t in R2?t:"kotlin"}function s7(){return typeof window>"u"?"unified":new URLSearchParams(window.location.search).get("view")==="split"?"split":"unified"}function i7(){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 o7(){return typeof window>"u"?!0:new URLSearchParams(window.location.search).get("wrap")!=="off"}function wte(){const[e,t]=b.useState(()=>r7()),[n,r]=b.useState(()=>s7()),[s,i]=b.useState(()=>i7()),[l,c]=b.useState(()=>o7()),u=R2[e],f=b.useMemo(()=>Object.entries(R2),[]);return b.useEffect(()=>{if(typeof window>"u")return;let p=window.location.search;const g=()=>{window.location.search!==p&&(p=window.location.search,t(r7()),r(s7()),i(i7()),c(o7()))};window.addEventListener("popstate",g),window.addEventListener("pageshow",g),window.addEventListener("focus",g);const y=window.setInterval(g,250);return()=>{window.removeEventListener("popstate",g),window.removeEventListener("pageshow",g),window.removeEventListener("focus",g),window.clearInterval(y)}},[]),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":n,"data-diff-lab-inline":s,"data-diff-lab-wrap":l?"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:p=>t(p.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:f.map(([p,g])=>o.jsx("option",{value:p,children:g.label},p))}),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"),className:`rounded-full px-3 text-xs font-semibold ${n==="unified"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Unified"}),o.jsx("button",{type:"button",onClick:()=>r("split"),className:`rounded-full px-3 text-xs font-semibold ${n==="split"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,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(p=>o.jsx("button",{type:"button",onClick:()=>i(p),className:`rounded-full px-3 text-xs font-semibold ${s===p?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:p},p))}),o.jsxs("button",{type:"button",onClick:()=>c(p=>!p),className:`h-8 rounded-full px-3 text-xs font-semibold ${l?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground"}`,children:["Wrap ",l?"on":"off"]})]})]}),o.jsx("main",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border/20 bg-surface",children:o.jsx(sT,{filePath:u.path,repoRoot:"/tmp/termdock-diff-lab",changedFile:{path:u.path,absolutePath:`/tmp/termdock-diff-lab/${u.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:u.diff,oldSourceOverride:u.oldSource,active:!0,wrap:l,showScrollHint:!l,viewType:n,inlineMode:s})})]})})}const sC=40,N2="/tmp/termdock-diff-review-lab";function a7(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(`
|
|
456
|
-
`)}function Ste(e,t){return Array.from({length:sC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,l=`${N2}/${i}`,c=a7(i,s),u=a7(i,1);return{key:l,path:i,absolutePath:l,status:"modified",repoRoot:N2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function Ate(){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:sC},(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(()=>Ste(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:N2,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]),l=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(()=>l!==null?s[l].key:null),[f,p]=b.useState(()=>({key:l!==null?s[l].key:null,nonce:l!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(l!==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(Vm,{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 Tte=6e4,tb="termdock:build-id:v1";let l7=!1;function c7(){l7||(l7=!0,window.setTimeout(()=>{window.location.reload()},80))}function M2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function Cte(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function kte(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&M2(e)})})}function _te(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="
|
|
456
|
+
`)}function Ste(e,t){return Array.from({length:sC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,l=`${N2}/${i}`,c=a7(i,s),u=a7(i,1);return{key:l,path:i,absolutePath:l,status:"modified",repoRoot:N2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function Ate(){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:sC},(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(()=>Ste(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:N2,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]),l=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(()=>l!==null?s[l].key:null),[f,p]=b.useState(()=>({key:l!==null?s[l].key:null,nonce:l!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(l!==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(Vm,{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 Tte=6e4,tb="termdock:build-id:v1";let l7=!1;function c7(){l7||(l7=!0,window.setTimeout(()=>{window.location.reload()},80))}function M2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function Cte(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function kte(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&M2(e)})})}function _te(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="1788097123936",t=window.localStorage.getItem(tb);if(t&&t!==e){Cte().finally(()=>{window.localStorage.setItem(tb,e),c7()});return}t!==e&&window.localStorage.setItem(tb,e);let n=null;navigator.serviceWorker.addEventListener("controllerchange",c7),window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"}).then(r=>{kte(r),M2(r);const s=()=>{document.visibilityState==="visible"&&r.update().then(()=>M2(r)).catch(()=>{})};s(),n=window.setInterval(s,Tte),document.addEventListener("visibilitychange",s)}).catch(()=>{})}),window.addEventListener("beforeunload",()=>{n!==null&&window.clearInterval(n)})}PF();_te();try{const e=JSON.parse(window.localStorage.getItem("termdock-color-theme")||"null");(e==="dark"||e==="light")&&(document.documentElement.dataset.theme=e,zA(e))}catch{}function Lte(){const{t:e}=$n(),[t,n]=b.useState(null),[r,s]=b.useState(null),i=b.useCallback(async()=>{try{const l=await yE();n(l),s(null)}catch(l){s(l instanceof Error?l.message:"Failed to query auth status")}},[]);return b.useEffect(()=>{i()},[i]),b.useEffect(()=>{const l=()=>{n(c=>c&&{...c,authenticated:!1})};return window.addEventListener(bm,l),()=>window.removeEventListener(bm,l)},[]),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(yte,{onLoginSuccess:i}):o.jsx(xte,{})}$k.createRoot(document.getElementById("root")).render(o.jsx(D.StrictMode,{children:o.jsx(sR,{children:o.jsx(K8,{children:(()=>{const e=new URLSearchParams(window.location.search);return e.get("dag-playground")==="1"?o.jsx(vte,{}):e.get("diff-review-lab")==="1"?o.jsx(Ate,{}):e.get("diff-lab")==="1"?o.jsx(wte,{}):o.jsx(Lte,{})})()})})}));export{NN as M,fi as R,CM as S,o0 as _,BN as a,ON as b,It as c,o as j,$n as u,SL as v};
|