diff --git "a/.next/server/app/page.js" "b/.next/server/app/page.js" --- "a/.next/server/app/page.js" +++ "b/.next/server/app/page.js" @@ -1,283 +1,4 @@ -(()=>{var e={};e.id=974,e.ids=[974],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},5699:(e,t,r)=>{Promise.resolve().then(r.bind(r,90597))},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11120:function(e,t,r){"use strict";var n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(65840)),a=r(86908);function i(e,t){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}i.default=i,e.exports=i},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19566:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},o=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;else if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,c,u,d=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p{Promise.resolve().then(r.bind(r,85042))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},44517:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g;function c(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var u=1,d=1;function p(e){var t=e.match(r);t&&(u+=t.length);var n=e.lastIndexOf("\n");d=~n?e.length-n:d+e.length}function h(){var e={line:u,column:d};return function(t){return t.position=new m(e),v(n),t}}function m(e){this.start=e,this.end={line:u,column:d},this.source=l.source}m.prototype.content=e;var f=[];function g(t){var r=Error(l.source+":"+u+":"+d+": "+t);if(r.reason=t,r.filename=l.source,r.line=u,r.column=d,r.source=e,l.silent)f.push(r);else throw r}function v(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function x(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return g("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}v(n);var b,w=[];for(x(w);b=function(){var e=h(),r=v(a);if(r){if(y(),!v(i))return g("property missing ':'");var n=v(o),l=e({type:"declaration",property:c(r[0].replace(t,"")),value:n?c(n[0].replace(t,"")):""});return v(s),l}}();)!1!==b&&(w.push(b),x(w));return w}},55511:e=>{"use strict";e.exports=require("crypto")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65840:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=null;if(!e||"string"!=typeof e)return r;var n=(0,a.default)(e),i="function"==typeof t;return n.forEach(function(e){if("declaration"===e.type){var n=e.property,a=e.value;i?t(n,a,e):a&&((r=r||{})[n]=a)}}),r};var a=n(r(44517))},71997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>o.a,__next_app__:()=>d,pages:()=>u,routeModule:()=>p,tree:()=>c});var n=r(65239),a=r(48088),i=r(88170),o=r.n(i),s=r(30893),l={};for(let e in s)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>s[e]);r.d(t,l);let c={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,90597)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,u=["/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],d={require:r,loadChunk:()=>Promise.resolve()},p=new n.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},85042:(e,t,r)=>{"use strict";let n,a;r.r(t),r.d(t,{default:()=>cK});var i={};r.r(i),r.d(i,{boolean:()=>oL,booleanish:()=>oz,commaOrSpaceSeparated:()=>o_,commaSeparated:()=>oB,number:()=>oF,overloadedBoolean:()=>oO,spaceSeparated:()=>oq});var o={};r.r(o),r.d(o,{attentionMarkers:()=>lz,contentInitial:()=>lD,disable:()=>lO,document:()=>lP,flow:()=>lI,flowInitial:()=>lT,insideSpan:()=>lL,string:()=>lA,text:()=>lR});var s=r(60687),l=r(43210),c=r.t(l,2),u=r.n(l),d=r(16189),p=r(28602),h=r(96241),m=r(24934),f=r(68988);let g=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{className:(0,h.cn)("flex min-h-[84px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));g.displayName="Textarea";var v=r(62688);let x=(0,v.A)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]),y=(0,v.A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=(0,v.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var w=r(13964),k=r(11860);let j=(0,v.A)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),N=(0,v.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),C=(0,v.A)("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),S=(0,v.A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),E=(0,v.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var M=r(13861);let P=(0,v.A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),D=(0,v.A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=(0,v.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),I=(0,v.A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),A=Symbol.for("constructDateFrom");function R(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}let L={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function z(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let O={date:z({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:z({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:z({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},F={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function q(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function B(e){return(t,r={})=>{let n,a=r.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;let s=o[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;re.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(s));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(s.length)}}}let _={code:"en-US",formatDistance:(e,t,r)=>{let n,a=L[e];if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:O,formatRelative:(e,t,r,n)=>F[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:function(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:o=r.valueCallback?r.valueCallback(o):o,rest:t.slice(a.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},$={};function U(e,t){return R(t||e,e)}function H(e){let t=U(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function V(e,...t){let r=R.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function W(e,t){let r=U(e)-U(t);return r<0?-1:r>0?1:r}function G(e,t){return function(e,t,r){let n,a=r?.locale??$.locale??_,i=W(e,t);if(isNaN(i))throw RangeError("Invalid time value");let o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[s,l]=V(r?.in,...i>0?[t,e]:[e,t]),c=function(e,t,r){var n;return(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((U(e)-U(t))/1e3)}(l,s),u=Math.round((c-(H(l)-H(s))/1e3)/60);if(u<2)if(r?.includeSeconds)if(c<5)return a.formatDistance("lessThanXSeconds",5,o);else if(c<10)return a.formatDistance("lessThanXSeconds",10,o);else if(c<20)return a.formatDistance("lessThanXSeconds",20,o);else if(c<40)return a.formatDistance("halfAMinute",0,o);else if(c<60)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",1,o);else if(0===u)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",u,o);if(u<45)return a.formatDistance("xMinutes",u,o);if(u<90)return a.formatDistance("aboutXHours",1,o);if(u<1440){let e=Math.round(u/60);return a.formatDistance("aboutXHours",e,o)}if(u<2520)return a.formatDistance("xDays",1,o);else if(u<43200){let e=Math.round(u/1440);return a.formatDistance("xDays",e,o)}else if(u<86400)return n=Math.round(u/43200),a.formatDistance("aboutXMonths",n,o);if((n=function(e,t,r){let[n,a,i]=V(void 0,e,e,t),o=W(a,i),s=Math.abs(function(e,t,r){let[n,a]=V(void 0,e,t);return 12*(n.getFullYear()-a.getFullYear())+(n.getMonth()-a.getMonth())}(a,i));if(s<1)return 0;1===a.getMonth()&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-o*s);let l=W(a,i)===-o;(function(e,t){let r=U(e,void 0);return+function(e,t){let r=U(e,t?.in);return r.setHours(23,59,59,999),r}(r,void 0)==+function(e,t){let r=U(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===s&&1===W(n,i)&&(l=!1);let c=o*(s-l);return 0===c?0:c}(l,s))<12){let e=Math.round(u/43200);return a.formatDistance("xMonths",e,o)}{let e=n%12,t=Math.trunc(n/12);return e<3?a.formatDistance("aboutXYears",t,o):e<9?a.formatDistance("overXYears",t,o):a.formatDistance("almostXYears",t+1,o)}}(e,R(e,Date.now()),t)}var K=r(70569),Y=r(98599),J=r(11273),X=r(65551),Z=r(14163),Q=r(9510),ee=r(43),et=r(31355),er=r(1359),en=r(32547),ea=r(96963),ei=r(55509),eo=r(25028),es=r(46059),el=r(13495),ec="rovingFocusGroup.onEntryFocus",eu={bubbles:!1,cancelable:!0},ed="RovingFocusGroup",[ep,eh,em]=(0,Q.N)(ed),[ef,eg]=(0,J.A)(ed,[em]),[ev,ex]=ef(ed),ey=l.forwardRef((e,t)=>(0,s.jsx)(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(eb,{...e,ref:t})})}));ey.displayName=ed;var eb=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,m=l.useRef(null),f=(0,Y.s)(t,m),g=(0,ee.jH)(i),[v,x]=(0,X.i)({prop:o,defaultProp:c??null,onChange:u,caller:ed}),[y,b]=l.useState(!1),w=(0,el.c)(d),k=eh(r),j=l.useRef(!1),[N,C]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ec,w),()=>e.removeEventListener(ec,w)},[w]),(0,s.jsx)(ev,{scope:r,orientation:n,dir:g,loop:a,currentTabStopId:v,onItemFocus:l.useCallback(e=>x(e),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>C(e=>e-1),[]),children:(0,s.jsx)(Z.sG.div,{tabIndex:y||0===N?-1:0,"data-orientation":n,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:(0,K.mK)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,K.mK)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(ec,eu);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);eN([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:(0,K.mK)(e.onBlur,()=>b(!1))})})}),ew="RovingFocusGroupItem",ek=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...c}=e,u=(0,ea.B)(),d=i||u,p=ex(ew,r),h=p.currentTabStopId===d,m=eh(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:v}=p;return l.useEffect(()=>{if(n)return f(),()=>g()},[n,f,g]),(0,s.jsx)(ep.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:(0,s.jsx)(Z.sG.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:(0,K.mK)(e.onMouseDown,e=>{n?p.onItemFocus(d):e.preventDefault()}),onFocus:(0,K.mK)(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let a=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return ej[a]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eN(r))}}),children:"function"==typeof o?o({isCurrentTabStop:h,hasTabStop:null!=v}):o})})});ek.displayName=ew;var ej={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eN(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eC=r(8730),eS=r(63376),eE=r(42247),eM=["Enter"," "],eP=["ArrowUp","PageDown","End"],eD=["ArrowDown","PageUp","Home",...eP],eT={ltr:[...eM,"ArrowRight"],rtl:[...eM,"ArrowLeft"]},eI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eA="Menu",[eR,eL,ez]=(0,Q.N)(eA),[eO,eF]=(0,J.A)(eA,[ez,ei.Bk,eg]),eq=(0,ei.Bk)(),eB=eg(),[e_,e$]=eO(eA),[eU,eH]=eO(eA),eV=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,c=eq(t),[u,d]=l.useState(null),p=l.useRef(!1),h=(0,el.c)(i),m=(0,ee.jH)(a);return l.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,s.jsx)(ei.bL,{...c,children:(0,s.jsx)(e_,{scope:t,open:r,onOpenChange:h,content:u,onContentChange:d,children:(0,s.jsx)(eU,{scope:t,onClose:l.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:m,modal:o,children:n})})})};eV.displayName=eA;var eW=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(ei.Mz,{...a,...n,ref:t})});eW.displayName="MenuAnchor";var eG="MenuPortal",[eK,eY]=eO(eG,{forceMount:void 0}),eJ=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:a}=e,i=e$(eG,t);return(0,s.jsx)(eK,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};eJ.displayName=eG;var eX="MenuContent",[eZ,eQ]=eO(eX),e0=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:o.modal?(0,s.jsx)(e1,{...a,ref:t}):(0,s.jsx)(e2,{...a,ref:t})})})})}),e1=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu),n=l.useRef(null),a=(0,Y.s)(t,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(e4,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),e2=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu);return(0,s.jsx)(e4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),e3=(0,eC.TL)("MenuContent.ScrollLock"),e4=l.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,disableOutsideScroll:g,...v}=e,x=e$(eX,r),y=eH(eX,r),b=eq(r),w=eB(r),k=eL(r),[j,N]=l.useState(null),C=l.useRef(null),S=(0,Y.s)(t,C,x.onContentChange),E=l.useRef(0),M=l.useRef(""),P=l.useRef(0),D=l.useRef(null),T=l.useRef("right"),I=l.useRef(0),A=g?eE.A:l.Fragment,R=e=>{let t=M.current+e,r=k().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,i=function(e,t,r){var n;let a=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,o=(n=Math.max(i,0),e.map((t,r)=>e[(n+r)%e.length]));1===a.length&&(o=o.filter(e=>e!==r));let s=o.find(e=>e.toLowerCase().startsWith(a.toLowerCase()));return s!==r?s:void 0}(r.map(e=>e.textValue),t,a),o=r.find(e=>e.textValue===i)?.ref.current;!function e(t){M.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),o&&setTimeout(()=>o.focus())};l.useEffect(()=>()=>window.clearTimeout(E.current),[]),(0,er.Oh)();let L=l.useCallback(e=>T.current===D.current?.side&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}({x:e.clientX,y:e.clientY},t)}(e,D.current?.area),[]);return(0,s.jsx)(eZ,{scope:r,searchRef:M,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(C.current?.focus(),N(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:l.useCallback(e=>{D.current=e},[]),children:(0,s.jsx)(A,{...g?{as:e3,allowPinchZoom:!0}:void 0,children:(0,s.jsx)(en.n,{asChild:!0,trapped:a,onMountAutoFocus:(0,K.mK)(i,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,children:(0,s.jsx)(ey,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,K.mK)(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,s.jsx)(ei.UC,{role:"menu","aria-orientation":"vertical","data-state":tk(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:(0,K.mK)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&R(e.key));let a=C.current;if(e.target!==a||!eD.includes(e.key))return;e.preventDefault();let i=k().filter(e=>!e.disabled).map(e=>e.ref.current);eP.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,K.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),M.current="")}),onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&(T.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})});e0.displayName=eX;var e5=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"group",...n,ref:t})});e5.displayName="MenuGroup";var e6=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{...n,ref:t})});e6.displayName="MenuLabel";var e8="MenuItem",e9="menu.itemSelect",e7=l.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...a}=e,i=l.useRef(null),o=eH(e8,e.__scopeMenu),c=eQ(e8,e.__scopeMenu),u=(0,Y.s)(t,i),d=l.useRef(!1);return(0,s.jsx)(te,{...a,ref:u,disabled:r,onClick:(0,K.mK)(e.onClick,()=>{let e=i.current;if(!r&&e){let t=new CustomEvent(e9,{bubbles:!0,cancelable:!0});e.addEventListener(e9,e=>n?.(e),{once:!0}),(0,Z.hO)(e,t),t.defaultPrevented?d.current=!1:o.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,K.mK)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||eM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});e7.displayName=e8;var te=l.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=e,o=eQ(e8,r),c=eB(r),u=l.useRef(null),d=(0,Y.s)(t,u),[p,h]=l.useState(!1),[m,f]=l.useState("");return l.useEffect(()=>{let e=u.current;e&&f((e.textContent??"").trim())},[i.children]),(0,s.jsx)(eR.ItemSlot,{scope:r,disabled:n,textValue:a??m,children:(0,s.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,s.jsx)(Z.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{n?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>o.onItemLeave(e))),onFocus:(0,K.mK)(e.onFocus,()=>h(!0)),onBlur:(0,K.mK)(e.onBlur,()=>h(!1))})})})}),tt=l.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...a}=e;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:r,children:(0,s.jsx)(e7,{role:"menuitemcheckbox","aria-checked":tj(r)?"mixed":r,...a,ref:t,"data-state":tN(r),onSelect:(0,K.mK)(a.onSelect,()=>n?.(!!tj(r)||!r),{checkForDefaultPrevented:!1})})})});tt.displayName="MenuCheckboxItem";var tr="MenuRadioGroup",[tn,ta]=eO(tr,{value:void 0,onValueChange:()=>{}}),ti=l.forwardRef((e,t)=>{let{value:r,onValueChange:n,...a}=e,i=(0,el.c)(n);return(0,s.jsx)(tn,{scope:e.__scopeMenu,value:r,onValueChange:i,children:(0,s.jsx)(e5,{...a,ref:t})})});ti.displayName=tr;var to="MenuRadioItem",ts=l.forwardRef((e,t)=>{let{value:r,...n}=e,a=ta(to,e.__scopeMenu),i=r===a.value;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:i,children:(0,s.jsx)(e7,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":tN(i),onSelect:(0,K.mK)(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ts.displayName=to;var tl="MenuItemIndicator",[tc,tu]=eO(tl,{checked:!1}),td=l.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...a}=e,i=tu(tl,r);return(0,s.jsx)(es.C,{present:n||tj(i.checked)||!0===i.checked,children:(0,s.jsx)(Z.sG.span,{...a,ref:t,"data-state":tN(i.checked)})})});td.displayName=tl;var tp=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tp.displayName="MenuSeparator";var th=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(ei.i3,{...a,...n,ref:t})});th.displayName="MenuArrow";var tm="MenuSub",[tf,tg]=eO(tm),tv=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,i=e$(tm,t),o=eq(t),[c,u]=l.useState(null),[d,p]=l.useState(null),h=(0,el.c)(a);return l.useEffect(()=>(!1===i.open&&h(!1),()=>h(!1)),[i.open,h]),(0,s.jsx)(ei.bL,{...o,children:(0,s.jsx)(e_,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:p,children:(0,s.jsx)(tf,{scope:t,contentId:(0,ea.B)(),triggerId:(0,ea.B)(),trigger:c,onTriggerChange:u,children:r})})})};tv.displayName=tm;var tx="MenuSubTrigger",ty=l.forwardRef((e,t)=>{let r=e$(tx,e.__scopeMenu),n=eH(tx,e.__scopeMenu),a=tg(tx,e.__scopeMenu),i=eQ(tx,e.__scopeMenu),o=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,s.jsx)(eW,{asChild:!0,...d,children:(0,s.jsx)(te,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":tk(r.open),...e,ref:(0,Y.t)(t,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,K.mK)(e.onPointerMove,tC(t=>{i.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||o.current||(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>{p();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,a="right"===n,o=t[a?"left":"right"],s=t[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:o,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,K.mK)(e.onKeyDown,t=>{let a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||eT[n.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})});ty.displayName=tx;var tb="MenuSubContent",tw=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu),c=tg(tb,e.__scopeMenu),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:(0,s.jsx)(e4,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===o.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,K.mK)(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=eI[o.dir].includes(e.key);t&&r&&(i.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function tk(e){return e?"open":"closed"}function tj(e){return"indeterminate"===e}function tN(e){return tj(e)?"indeterminate":e?"checked":"unchecked"}function tC(e){return t=>"mouse"===t.pointerType?e(t):void 0}tw.displayName=tb;var tS="DropdownMenu",[tE,tM]=(0,J.A)(tS,[eF]),tP=eF(),[tD,tT]=tE(tS),tI=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,u=tP(t),d=l.useRef(null),[p,h]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:o,caller:tS});return(0,s.jsx)(tD,{scope:t,triggerId:(0,ea.B)(),triggerRef:d,contentId:(0,ea.B)(),open:p,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(e=>!e),[h]),modal:c,children:(0,s.jsx)(eV,{...u,open:p,onOpenChange:h,dir:n,modal:c,children:r})})};tI.displayName=tS;var tA="DropdownMenuTrigger",tR=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=tT(tA,r),o=tP(r);return(0,s.jsx)(eW,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:(0,Y.t)(t,i.triggerRef),onPointerDown:(0,K.mK)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});tR.displayName=tA;var tL=e=>{let{__scopeDropdownMenu:t,...r}=e,n=tP(t);return(0,s.jsx)(eJ,{...n,...r})};tL.displayName="DropdownMenuPortal";var tz="DropdownMenuContent",tO=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tT(tz,r),i=tP(r),o=l.useRef(!1);return(0,s.jsx)(e0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:t,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{o.current||a.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:(0,K.mK)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tO.displayName=tz,l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="DropdownMenuGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e6,{...a,...n,ref:t})}).displayName="DropdownMenuLabel";var tF=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});tF.displayName="DropdownMenuItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tt,{...a,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="DropdownMenuRadioGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ts,{...a,...n,ref:t})}).displayName="DropdownMenuRadioItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(td,{...a,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var tq=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});function tB({...e}){return(0,s.jsx)(tI,{"data-slot":"dropdown-menu",...e})}function t_({...e}){return(0,s.jsx)(tR,{"data-slot":"dropdown-menu-trigger",...e})}function t$({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(tL,{children:(0,s.jsx)(tO,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,h.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-40 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...r})})}function tU({className:e,inset:t,variant:r="default",...n}){return(0,s.jsx)(tF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,h.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function tH({className:e,...t}){return(0,s.jsx)(tq,{"data-slot":"dropdown-menu-separator",className:(0,h.cn)("bg-border -mx-1 my-1 h-px",e),...t})}tq.displayName="DropdownMenuSeparator",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="DropdownMenuArrow",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ty,{...a,...n,ref:t})}).displayName="DropdownMenuSubTrigger",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var tV=r(52581);function tW({project:e,onSelect:t,onDelete:r,onExport:n,onExportZip:a,onDuplicate:i,onPreview:o,onUpdate:c,viewMode:u="grid",forceMenuOpen:d=!1,highlightExport:v=!1}){let[A,R]=(0,l.useState)(!1),[L,z]=(0,l.useState)(e.name),[O,F]=(0,l.useState)(e.description||""),[q,B]=(0,l.useState)(null),[_,$]=(0,l.useState)(!0),[U,H]=(0,l.useState)(!1),V=async()=>{if(!L.trim()){tV.oR.error("Project name cannot be empty"),z(e.name),R(!1);return}if(L.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(O.length>200)return void tV.oR.error("Description must be 200 characters or less");try{e.name=L.trim(),e.description=O.trim()||void 0,await p.OP.updateProject(e),c(e),R(!1),tV.oR.success("Project updated")}catch(t){h.v.error("Failed to update project:",t),tV.oR.error("Failed to update project"),z(e.name),F(e.description||"")}},W=()=>{z(e.name),F(e.description||""),R(!1)},K=e=>{if(d)return void H(!0);H(e)},Y=()=>q?Object.entries(q.fileTypes).sort(([,e],[,t])=>t-e).slice(0,3):[],J=e=>{let t=e.toLowerCase();return["html","htm"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["css","scss","sass"].includes(t)?(0,s.jsx)(y,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(t)?(0,s.jsx)(b,{className:"h-3 w-3"}):(0,s.jsx)(y,{className:"h-3 w-3"})},X=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===u?(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${v?"ring-2 ring-primary/70":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[A?(0,s.jsxs)("div",{className:"flex items-center gap-2",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&V(),"Escape"===e.key&&W()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[L.length,"/50"]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),e.description&&!A&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-md",children:e.description})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 ml-4",children:[q&&(0,s.jsxs)("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:G(e.updatedAt,{addSuffix:!0})}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(M.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(D,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}):(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${v?"ring-2 ring-primary/70":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),"data-tour-id":"project-card",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[A?(0,s.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),V()),"Escape"===e.key&&W()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[L.length,"/50"]})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(M.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(D,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),A?(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(g,{value:O,onChange:e=>F(e.target.value),onKeyDown:e=>{"Escape"===e.key&&W()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,s.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[O.length,"/200"]})})]}):(0,s.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),_?(0,s.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," ",1===q.fileCount?"file":"files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),Y().length>0&&(0,s.jsx)("div",{className:"flex items-center gap-3 text-xs",children:Y().map(([e,t])=>(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[J(e),(0,s.jsxs)("span",{children:[e," (",t,")"]})]},e))})]}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,s.jsxs)("p",{children:["Updated ",G(e.updatedAt,{addSuffix:!0})]})})]})})}var tG=r(22106),tK=r(78122);let tY=(0,v.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),tJ=(0,v.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tX=(0,v.A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),tZ=(0,v.A)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),tQ=(0,v.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),t0=(0,v.A)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),t1=(0,v.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var t2=r(63974);let t3={mobile:{width:"375px",height:"100%",maxHeight:"667px"},tablet:{width:"768px",height:"100%",maxHeight:"1024px"},desktop:{width:"100%",height:"100%",maxHeight:"900px",maxWidth:"1440px"},responsive:{width:"100%",height:"100%"}};function t4({projectId:e,refreshTrigger:t,onFocusSelection:r,hasFocusTarget:n=!1,onClose:a}){let[i,o]=(0,l.useState)(null),[c,u]=(0,l.useState)("/"),[d,f]=(0,l.useState)(!0),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)("tablet"),[b,w]=(0,l.useState)(["/"]),[j,N]=(0,l.useState)(0),[C,S]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),D=(0,l.useRef)(null),T=(0,l.useRef)(null),I=(0,l.useRef)(null),A=(0,l.useRef)("/"),R=(0,l.useRef)(null),L=(0,l.useRef)(!1),z=(0,l.useCallback)(e=>{if(D.current&&D.current.contentWindow)try{D.current.contentWindow.postMessage(e,"*")}catch(e){h.v.warn("Failed to communicate with preview iframe",e)}},[]),O=(0,l.useRef)(!1),F=(0,l.useRef)(null),q=(0,l.useRef)(null),B=(0,l.useRef)(null),_=()=>(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,s.jsx)(M.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),a?(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":"Hide preview",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(M.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(M.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]}),$=(0,l.useCallback)(async(t=!1,r=!0)=>{r&&f(!0),v(null);try{await p.OP.init();let r=t?A.current:null;T.current&&T.current.cleanupBlobUrls();let n=new tG.B(p.OP,e);T.current=n;let a=await n.compileProject();o(a),I.current=a;let i=r;i||(i=a.blobUrls.has("/index.html")?"/":a.entryPoint||(a.routes.length>0?a.routes[0].path:"/")),H(i,a)}catch(e){v(e instanceof Error?e.message:"Failed to compile project"),h.v.error("Compilation error:",e)}finally{r&&f(!1)}},[e]),U=(0,l.useCallback)((e=!1,t=!0)=>{if(O.current){let r=F.current;F.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t};return}(async(e,t)=>{O.current=!0;try{await $(e,t)}finally{O.current=!1;let e=F.current;F.current=null,e&&U(e.preserve,e.showLoading)}})(e,t)},[$]);(0,l.useCallback)((e=!1,t=!1)=>{let r=B.current;B.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t},q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{let e=B.current;B.current=null,q.current=null,e&&U(e.preserve,e.showLoading)},150)},[U]);let H=(e,t)=>{let r,n=t||I.current||i;if(!n)return void h.v.warn("No compiled project available");if(L.current?P(!1):z({type:"selector-toggle",active:!1}),!D.current||!C){R.current=e;return}let a=e;a.startsWith("/")||(a="/"+a);let o=n.routes.find(e=>e.path===a);r=o?o.file:"/"===a?"/index.html":a+".html";let s=n.files.find(e=>e.path===r);if(!s){v(`Page not found: ${e}`),n.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&H("/",t);return}let l="string"==typeof s.content?s.content:new TextDecoder().decode(s.content);l=(l=(l=l.replace(/href="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".css")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`href="${a}"`:e})).replace(/src="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".js")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,t)=>{let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e});let c=` - - `;l.includes("")?l=l.replace("",c+""):l+=c,D.current.srcdoc=l,u(a),A.current=a,N(e=>(w(t=>[...t.slice(0,e+1),a]),e+1))},V=(0,l.useCallback)(e=>{H(e)},[i]),W=()=>{if(j>0){let e=j-1;N(e),H(b[e])}},G=()=>{if(j{H("/")},Y=()=>{U(!0,!1)};return d?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsx)(tK.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):g?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,s.jsx)("p",{className:"font-medium",children:"Error"}),(0,s.jsx)("p",{className:"text-sm mt-2",children:g}),(0,s.jsx)(m.$,{onClick:Y,className:"mt-4",children:"Try Again"})]})})]}):(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:E?{backgroundColor:"var(--button-preview-active)",color:"white"}:n?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},title:E?"Cancel element selection":n?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,s.jsx)(t2.yv,{className:"truncate"})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,s.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:{backgroundColor:E?"var(--button-preview-active)":void 0,color:E?"white":void 0},title:E?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),(0,s.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:c}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"w-[200px] h-8",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===x?"var(--button-preview-active)":void 0,color:"mobile"===x?"white":void 0},onClick:()=>y("mobile"),children:(0,s.jsx)(tQ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===x?"var(--button-preview-active)":void 0,color:"tablet"===x?"white":void 0},onClick:()=>y("tablet"),children:(0,s.jsx)(t0,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===x?"var(--button-preview-active)":void 0,color:"desktop"===x?"white":void 0},onClick:()=>y("desktop"),children:(0,s.jsx)(t1,{className:"h-3 w-3"})})]})]}),(0,s.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,s.jsx)("div",{className:(0,h.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==x&&"rounded-lg"),style:{width:t3[x].width||"100%",height:t3[x].height||"100%",maxHeight:t3[x].maxHeight||"100%",maxWidth:t3[x].maxWidth||"100%"},children:(0,s.jsx)("iframe",{ref:e=>{D.current=e,e&&!C?setTimeout(()=>{S(!0)},0):!e&&C&&S(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})}let t5={rE:"1.0.6"};var t6="Dialog",[t8,t9]=(0,J.A)(t6),[t7,re]=t8(t6),rt=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,p]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:i,caller:t6});return(0,s.jsx)(t7,{scope:t,triggerRef:c,contentRef:u,contentId:(0,ea.B)(),titleId:(0,ea.B)(),descriptionId:(0,ea.B)(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:o,children:r})};rt.displayName=t6;var rr="DialogTrigger";l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rr,r),i=(0,Y.s)(t,a.triggerRef);return(0,s.jsx)(Z.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":rk(a.open),...n,ref:i,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})}).displayName=rr;var rn="DialogPortal",[ra,ri]=t8(rn,{forceMount:void 0}),ro=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=re(rn,t);return(0,s.jsx)(ra,{scope:t,forceMount:r,children:l.Children.map(n,e=>(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:e})}))})};ro.displayName=rn;var rs="DialogOverlay",rl=l.forwardRef((e,t)=>{let r=ri(rs,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rs,e.__scopeDialog);return i.modal?(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(ru,{...a,ref:t})}):null});rl.displayName=rs;var rc=(0,eC.TL)("DialogOverlay.RemoveScroll"),ru=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rs,r);return(0,s.jsx)(eE.A,{as:rc,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(Z.sG.div,{"data-state":rk(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rd="DialogContent",rp=l.forwardRef((e,t)=>{let r=ri(rd,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rd,e.__scopeDialog);return(0,s.jsx)(es.C,{present:n||i.open,children:i.modal?(0,s.jsx)(rh,{...a,ref:t}):(0,s.jsx)(rm,{...a,ref:t})})});rp.displayName=rd;var rh=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(null),a=(0,Y.s)(t,r.contentRef,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(rf,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,K.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault())})}),rm=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(!1),a=l.useRef(!1);return(0,s.jsx)(rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let i=t.target;r.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rf=l.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=re(rd,r),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,er.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,s.jsx)(et.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rk(c.open),...o,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(rS,{titleId:c.titleId}),(0,s.jsx)(rE,{contentRef:u,descriptionId:c.descriptionId})]})]})}),rg="DialogTitle",rv=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rg,r);return(0,s.jsx)(Z.sG.h2,{id:a.titleId,...n,ref:t})});rv.displayName=rg;var rx="DialogDescription",ry=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rx,r);return(0,s.jsx)(Z.sG.p,{id:a.descriptionId,...n,ref:t})});ry.displayName=rx;var rb="DialogClose",rw=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rb,r);return(0,s.jsx)(Z.sG.button,{type:"button",...n,ref:t,onClick:(0,K.mK)(e.onClick,()=>a.onOpenChange(!1))})});function rk(e){return e?"open":"closed"}rw.displayName=rb;var rj="DialogTitleWarning",[rN,rC]=(0,J.q)(rj,{contentName:rd,titleName:rg,docsSlug:"dialog"}),rS=({titleId:e})=>{let t=rC(rj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},rE=({contentRef:e,descriptionId:t})=>{let r=rC("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null};function rM({...e}){return(0,s.jsx)(rt,{"data-slot":"dialog",...e})}function rP({...e}){return(0,s.jsx)(ro,{"data-slot":"dialog-portal",...e})}function rD({className:e,...t}){return(0,s.jsx)(rl,{"data-slot":"dialog-overlay",className:(0,h.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t})}function rT({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(rP,{"data-slot":"dialog-portal",children:[(0,s.jsx)(rD,{}),(0,s.jsxs)(rp,{"data-slot":"dialog-content",className:(0,h.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-2xl duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(rw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(k.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function rI({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,h.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function rA({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,h.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rR({className:e,...t}){return(0,s.jsx)(rv,{"data-slot":"dialog-title",className:(0,h.cn)("text-lg leading-none font-semibold",e),...t})}function rL({className:e,...t}){return(0,s.jsx)(ry,{"data-slot":"dialog-description",className:(0,h.cn)("text-muted-foreground text-sm",e),...t})}var rz=r(96271),rO=r(59821);let rF=(0,v.A)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var rq=r(25334);function rB({open:e,onOpenChange:t}){return(0,s.jsx)(rM,{open:e,onOpenChange:t,children:(0,s.jsxs)(rT,{className:"max-w-3xl max-h-[90vh]",children:[(0,s.jsx)(rI,{children:(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,s.jsx)(rz.g,{width:64,height:64}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rR,{className:"text-2xl",children:"DeepStudio"}),(0,s.jsx)(rL,{className:"text-base",children:"Browser-based Website Builder"})]})]})}),(0,s.jsxs)("div",{className:"space-y-6 overflow-y-auto max-h-[60vh] pr-4",children:[(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed space-y-3",children:[(0,s.jsx)("p",{children:"DeepStudio is a fork from @enzostvs and @victor's DeepSite v2 that over the months of tinkering became a BYOK (Bring Your Own Key) agentic browser-based website builder where you describe what you want and an agent writes the code."}),(0,s.jsx)("p",{children:"This is a solo project and there isn't a huge corpo behind it. I'll do my best to fix issues and possibly keep the project improving, but it's just me doing this for fun so please be patient. All feedback and contributions are more than welcome."}),(0,s.jsx)("p",{children:"If you make something with the app I would be thrilled if you could share what you've made."})]})}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-semibold text-lg mb-3",children:"Links & Support"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsx)(rF,{className:"h-4 w-4"}),"GitHub repo",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsxs)("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",children:[(0,s.jsx)("title",{children:"HuggingFace"}),(0,s.jsx)("path",{d:"M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"})]}),"Live Demo (HuggingFace)",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsx)("a",{href:"https://www.buymeacoffee.com/otst",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",style:{height:"30px",width:"109px"}})})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-4 border-t",children:[(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs",children:["v",process.env.NEXT_PUBLIC_APP_VERSION||t5.rE]}),(0,s.jsx)(m.$,{onClick:()=>t(!1),children:"Close"})]})]})})}let r_=(0,v.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),r$=(0,v.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),rU=(0,v.A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rH=(0,v.A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),rV=(0,v.A)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);var rW=r(99270);let rG=(0,v.A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),rK=(0,v.A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),rY=(0,v.A)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var rJ=r(51567),rX=r(39390),rZ=r(32623);let rQ={name:"Example Studios",description:"Creative agency portfolio showcasing modern web development capabilities",directories:["/styles","/scripts","/portfolio","/assets","/assets/images","/templates"],files:[{path:"/index.html",content:` +(()=>{var e={};e.id=974,e.ids=[974],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},5699:(e,t,r)=>{Promise.resolve().then(r.bind(r,90597))},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11120:function(e,t,r){"use strict";var n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(65840)),a=r(86908);function i(e,t){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}i.default=i,e.exports=i},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19566:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},o=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;else if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,c,u,d=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p{Promise.resolve().then(r.bind(r,59459))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33660:(e,t,r)=>{"use strict";r.d(t,{DEMO_PROJECT_TEMPLATE:()=>n});let n={name:"Example Studios",description:"Creative agency portfolio showcasing modern web development capabilities",directories:["/styles","/scripts","/portfolio","/assets","/assets/images","/templates"],files:[{path:"/index.html",content:` @@ -3098,109 +2819,388 @@ document.addEventListener('DOMContentLoaded', function() { -
-
-
-

TechFlow Dashboard

-

Modern analytics platform with real-time data visualization

-
-
- -
-
-
-

Project Overview

-

A comprehensive analytics solution built for modern businesses

-
- -
-
-
Challenge
-

Challenge

-

TechFlow needed a modern dashboard to visualize complex data streams in real-time, replacing their outdated reporting system with something more intuitive and scalable.

-
- -
-
Solution
-

Solution

-

We designed and built a React-based dashboard with D3.js visualizations, featuring customizable widgets and real-time data updates via WebSocket connections.

-
-
-
- -
-
-

Technology Stack

-
-
-
-
React
-

React

-

Modern component-based architecture for maintainable UI development

-
- -
-
Data
-

D3.js

-

Custom data visualizations with smooth animations and interactions

-
- -
-
Backend
-

Node.js

-

Robust backend API with real-time data processing capabilities

-
-
-
- -
-
-

Results

-
-
-
Results
-

Impact & Performance

-

The new dashboard reduced report generation time by 75% and improved user engagement by 300%. Real-time updates eliminated the need for manual refreshes, and the intuitive interface reduced training time for new users.

-
-
-
- -
-
-

Ready for Your Next Project?

-

Let's discuss how we can create a custom solution for your business needs.

- Start Your Project -
-
-
+
+
+
+

TechFlow Dashboard

+

Modern analytics platform with real-time data visualization

+
+
+ +
+
+
+

Project Overview

+

A comprehensive analytics solution built for modern businesses

+
+ +
+
+
Challenge
+

Challenge

+

TechFlow needed a modern dashboard to visualize complex data streams in real-time, replacing their outdated reporting system with something more intuitive and scalable.

+
+ +
+
Solution
+

Solution

+

We designed and built a React-based dashboard with D3.js visualizations, featuring customizable widgets and real-time data updates via WebSocket connections.

+
+
+
+ +
+
+

Technology Stack

+
+
+
+
React
+

React

+

Modern component-based architecture for maintainable UI development

+
+ +
+
Data
+

D3.js

+

Custom data visualizations with smooth animations and interactions

+
+ +
+
Backend
+

Node.js

+

Robust backend API with real-time data processing capabilities

+
+
+
+ +
+
+

Results

+
+
+
Results
+

Impact & Performance

+

The new dashboard reduced report generation time by 75% and improved user engagement by 300%. Real-time updates eliminated the need for manual refreshes, and the intuitive interface reduced training time for new users.

+
+
+
+ +
+
+

Ready for Your Next Project?

+

Let's discuss how we can create a custom solution for your business needs.

+ Start Your Project +
+
+
+ + {{> footer}} + + + +`},{path:"/assets/README.md",content:`# Assets Directory + +This directory contains all static assets for the Example project. + +## Structure + +- \`/images/\` - Image files including: + - \`example-background.jpg\` - Hero section background image + - \`logo.svg\` - Site logo + - \`favicon.svg\` - Browser favicon + +## Background Image + +The \`example-background.jpg\` is automatically included when the demo project is created. It features a beautiful flowing gradient design that complements the orange (#ff7b00) and blue (#2563eb) color scheme. + +## File Types Supported + +The VFS system supports various file types: +- Images: PNG, JPG, JPEG, GIF, WebP, SVG, ICO +- Documents: HTML, CSS, JS, JSON, TXT, MD, XML +- Binary files up to 10MB + +This demonstrates the VFS capability to handle multiple file types and organize them in a structured directory system.`}]}},33873:e=>{"use strict";e.exports=require("path")},44517:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g;function c(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var u=1,d=1;function p(e){var t=e.match(r);t&&(u+=t.length);var n=e.lastIndexOf("\n");d=~n?e.length-n:d+e.length}function h(){var e={line:u,column:d};return function(t){return t.position=new m(e),v(n),t}}function m(e){this.start=e,this.end={line:u,column:d},this.source=l.source}m.prototype.content=e;var f=[];function g(t){var r=Error(l.source+":"+u+":"+d+": "+t);if(r.reason=t,r.filename=l.source,r.line=u,r.column=d,r.source=e,l.silent)f.push(r);else throw r}function v(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function x(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return g("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}v(n);var b,w=[];for(x(w);b=function(){var e=h(),r=v(a);if(r){if(y(),!v(i))return g("property missing ':'");var n=v(o),l=e({type:"declaration",property:c(r[0].replace(t,"")),value:n?c(n[0].replace(t,"")):""});return v(s),l}}();)!1!==b&&(w.push(b),x(w));return w}},55511:e=>{"use strict";e.exports=require("crypto")},59459:(e,t,r)=>{"use strict";let n,a;r.r(t),r.d(t,{default:()=>cG});var i={};r.r(i),r.d(i,{boolean:()=>oR,booleanish:()=>oL,commaOrSpaceSeparated:()=>oB,commaSeparated:()=>oq,number:()=>oO,overloadedBoolean:()=>oz,spaceSeparated:()=>oF});var o={};r.r(o),r.d(o,{attentionMarkers:()=>lL,contentInitial:()=>lP,disable:()=>lz,document:()=>lM,flow:()=>lT,flowInitial:()=>lD,insideSpan:()=>lR,string:()=>lI,text:()=>lA});var s=r(60687),l=r(43210),c=r.t(l,2),u=r.n(l),d=r(16189),p=r(28602),h=r(96241),m=r(24934),f=r(68988);let g=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{className:(0,h.cn)("flex min-h-[84px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));g.displayName="Textarea";var v=r(62688);let x=(0,v.A)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]),y=(0,v.A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=(0,v.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var w=r(13964),k=r(11860);let j=(0,v.A)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),N=(0,v.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),C=(0,v.A)("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),S=(0,v.A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),E=(0,v.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var M=r(13861);let P=(0,v.A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),D=(0,v.A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=(0,v.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),I=(0,v.A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),A=Symbol.for("constructDateFrom");function R(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}let L={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function z(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let O={date:z({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:z({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:z({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},F={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function q(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function B(e){return(t,r={})=>{let n,a=r.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;let s=o[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;re.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(s));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(s.length)}}}let _={code:"en-US",formatDistance:(e,t,r)=>{let n,a=L[e];if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:O,formatRelative:(e,t,r,n)=>F[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:function(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:o=r.valueCallback?r.valueCallback(o):o,rest:t.slice(a.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},$={};function U(e,t){return R(t||e,e)}function H(e){let t=U(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function V(e,...t){let r=R.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function W(e,t){let r=U(e)-U(t);return r<0?-1:r>0?1:r}function G(e,t){return function(e,t,r){let n,a=r?.locale??$.locale??_,i=W(e,t);if(isNaN(i))throw RangeError("Invalid time value");let o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[s,l]=V(r?.in,...i>0?[t,e]:[e,t]),c=function(e,t,r){var n;return(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((U(e)-U(t))/1e3)}(l,s),u=Math.round((c-(H(l)-H(s))/1e3)/60);if(u<2)if(r?.includeSeconds)if(c<5)return a.formatDistance("lessThanXSeconds",5,o);else if(c<10)return a.formatDistance("lessThanXSeconds",10,o);else if(c<20)return a.formatDistance("lessThanXSeconds",20,o);else if(c<40)return a.formatDistance("halfAMinute",0,o);else if(c<60)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",1,o);else if(0===u)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",u,o);if(u<45)return a.formatDistance("xMinutes",u,o);if(u<90)return a.formatDistance("aboutXHours",1,o);if(u<1440){let e=Math.round(u/60);return a.formatDistance("aboutXHours",e,o)}if(u<2520)return a.formatDistance("xDays",1,o);else if(u<43200){let e=Math.round(u/1440);return a.formatDistance("xDays",e,o)}else if(u<86400)return n=Math.round(u/43200),a.formatDistance("aboutXMonths",n,o);if((n=function(e,t,r){let[n,a,i]=V(void 0,e,e,t),o=W(a,i),s=Math.abs(function(e,t,r){let[n,a]=V(void 0,e,t);return 12*(n.getFullYear()-a.getFullYear())+(n.getMonth()-a.getMonth())}(a,i));if(s<1)return 0;1===a.getMonth()&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-o*s);let l=W(a,i)===-o;(function(e,t){let r=U(e,void 0);return+function(e,t){let r=U(e,t?.in);return r.setHours(23,59,59,999),r}(r,void 0)==+function(e,t){let r=U(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===s&&1===W(n,i)&&(l=!1);let c=o*(s-l);return 0===c?0:c}(l,s))<12){let e=Math.round(u/43200);return a.formatDistance("xMonths",e,o)}{let e=n%12,t=Math.trunc(n/12);return e<3?a.formatDistance("aboutXYears",t,o):e<9?a.formatDistance("overXYears",t,o):a.formatDistance("almostXYears",t+1,o)}}(e,R(e,Date.now()),t)}var K=r(70569),Y=r(98599),J=r(11273),X=r(65551),Z=r(14163),Q=r(9510),ee=r(43),et=r(31355),er=r(1359),en=r(32547),ea=r(96963),ei=r(55509),eo=r(25028),es=r(46059),el=r(13495),ec="rovingFocusGroup.onEntryFocus",eu={bubbles:!1,cancelable:!0},ed="RovingFocusGroup",[ep,eh,em]=(0,Q.N)(ed),[ef,eg]=(0,J.A)(ed,[em]),[ev,ex]=ef(ed),ey=l.forwardRef((e,t)=>(0,s.jsx)(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(eb,{...e,ref:t})})}));ey.displayName=ed;var eb=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,m=l.useRef(null),f=(0,Y.s)(t,m),g=(0,ee.jH)(i),[v,x]=(0,X.i)({prop:o,defaultProp:c??null,onChange:u,caller:ed}),[y,b]=l.useState(!1),w=(0,el.c)(d),k=eh(r),j=l.useRef(!1),[N,C]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ec,w),()=>e.removeEventListener(ec,w)},[w]),(0,s.jsx)(ev,{scope:r,orientation:n,dir:g,loop:a,currentTabStopId:v,onItemFocus:l.useCallback(e=>x(e),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>C(e=>e-1),[]),children:(0,s.jsx)(Z.sG.div,{tabIndex:y||0===N?-1:0,"data-orientation":n,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:(0,K.mK)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,K.mK)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(ec,eu);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);eN([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:(0,K.mK)(e.onBlur,()=>b(!1))})})}),ew="RovingFocusGroupItem",ek=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...c}=e,u=(0,ea.B)(),d=i||u,p=ex(ew,r),h=p.currentTabStopId===d,m=eh(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:v}=p;return l.useEffect(()=>{if(n)return f(),()=>g()},[n,f,g]),(0,s.jsx)(ep.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:(0,s.jsx)(Z.sG.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:(0,K.mK)(e.onMouseDown,e=>{n?p.onItemFocus(d):e.preventDefault()}),onFocus:(0,K.mK)(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let a=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return ej[a]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eN(r))}}),children:"function"==typeof o?o({isCurrentTabStop:h,hasTabStop:null!=v}):o})})});ek.displayName=ew;var ej={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eN(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eC=r(8730),eS=r(63376),eE=r(42247),eM=["Enter"," "],eP=["ArrowUp","PageDown","End"],eD=["ArrowDown","PageUp","Home",...eP],eT={ltr:[...eM,"ArrowRight"],rtl:[...eM,"ArrowLeft"]},eI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eA="Menu",[eR,eL,ez]=(0,Q.N)(eA),[eO,eF]=(0,J.A)(eA,[ez,ei.Bk,eg]),eq=(0,ei.Bk)(),eB=eg(),[e_,e$]=eO(eA),[eU,eH]=eO(eA),eV=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,c=eq(t),[u,d]=l.useState(null),p=l.useRef(!1),h=(0,el.c)(i),m=(0,ee.jH)(a);return l.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,s.jsx)(ei.bL,{...c,children:(0,s.jsx)(e_,{scope:t,open:r,onOpenChange:h,content:u,onContentChange:d,children:(0,s.jsx)(eU,{scope:t,onClose:l.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:m,modal:o,children:n})})})};eV.displayName=eA;var eW=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(ei.Mz,{...a,...n,ref:t})});eW.displayName="MenuAnchor";var eG="MenuPortal",[eK,eY]=eO(eG,{forceMount:void 0}),eJ=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:a}=e,i=e$(eG,t);return(0,s.jsx)(eK,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};eJ.displayName=eG;var eX="MenuContent",[eZ,eQ]=eO(eX),e0=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:o.modal?(0,s.jsx)(e1,{...a,ref:t}):(0,s.jsx)(e2,{...a,ref:t})})})})}),e1=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu),n=l.useRef(null),a=(0,Y.s)(t,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(e4,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),e2=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu);return(0,s.jsx)(e4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),e3=(0,eC.TL)("MenuContent.ScrollLock"),e4=l.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,disableOutsideScroll:g,...v}=e,x=e$(eX,r),y=eH(eX,r),b=eq(r),w=eB(r),k=eL(r),[j,N]=l.useState(null),C=l.useRef(null),S=(0,Y.s)(t,C,x.onContentChange),E=l.useRef(0),M=l.useRef(""),P=l.useRef(0),D=l.useRef(null),T=l.useRef("right"),I=l.useRef(0),A=g?eE.A:l.Fragment,R=e=>{let t=M.current+e,r=k().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,i=function(e,t,r){var n;let a=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,o=(n=Math.max(i,0),e.map((t,r)=>e[(n+r)%e.length]));1===a.length&&(o=o.filter(e=>e!==r));let s=o.find(e=>e.toLowerCase().startsWith(a.toLowerCase()));return s!==r?s:void 0}(r.map(e=>e.textValue),t,a),o=r.find(e=>e.textValue===i)?.ref.current;!function e(t){M.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),o&&setTimeout(()=>o.focus())};l.useEffect(()=>()=>window.clearTimeout(E.current),[]),(0,er.Oh)();let L=l.useCallback(e=>T.current===D.current?.side&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}({x:e.clientX,y:e.clientY},t)}(e,D.current?.area),[]);return(0,s.jsx)(eZ,{scope:r,searchRef:M,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(C.current?.focus(),N(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:l.useCallback(e=>{D.current=e},[]),children:(0,s.jsx)(A,{...g?{as:e3,allowPinchZoom:!0}:void 0,children:(0,s.jsx)(en.n,{asChild:!0,trapped:a,onMountAutoFocus:(0,K.mK)(i,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,children:(0,s.jsx)(ey,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,K.mK)(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,s.jsx)(ei.UC,{role:"menu","aria-orientation":"vertical","data-state":tk(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:(0,K.mK)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&R(e.key));let a=C.current;if(e.target!==a||!eD.includes(e.key))return;e.preventDefault();let i=k().filter(e=>!e.disabled).map(e=>e.ref.current);eP.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,K.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),M.current="")}),onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&(T.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})});e0.displayName=eX;var e5=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"group",...n,ref:t})});e5.displayName="MenuGroup";var e6=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{...n,ref:t})});e6.displayName="MenuLabel";var e8="MenuItem",e9="menu.itemSelect",e7=l.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...a}=e,i=l.useRef(null),o=eH(e8,e.__scopeMenu),c=eQ(e8,e.__scopeMenu),u=(0,Y.s)(t,i),d=l.useRef(!1);return(0,s.jsx)(te,{...a,ref:u,disabled:r,onClick:(0,K.mK)(e.onClick,()=>{let e=i.current;if(!r&&e){let t=new CustomEvent(e9,{bubbles:!0,cancelable:!0});e.addEventListener(e9,e=>n?.(e),{once:!0}),(0,Z.hO)(e,t),t.defaultPrevented?d.current=!1:o.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,K.mK)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||eM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});e7.displayName=e8;var te=l.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=e,o=eQ(e8,r),c=eB(r),u=l.useRef(null),d=(0,Y.s)(t,u),[p,h]=l.useState(!1),[m,f]=l.useState("");return l.useEffect(()=>{let e=u.current;e&&f((e.textContent??"").trim())},[i.children]),(0,s.jsx)(eR.ItemSlot,{scope:r,disabled:n,textValue:a??m,children:(0,s.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,s.jsx)(Z.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{n?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>o.onItemLeave(e))),onFocus:(0,K.mK)(e.onFocus,()=>h(!0)),onBlur:(0,K.mK)(e.onBlur,()=>h(!1))})})})}),tt=l.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...a}=e;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:r,children:(0,s.jsx)(e7,{role:"menuitemcheckbox","aria-checked":tj(r)?"mixed":r,...a,ref:t,"data-state":tN(r),onSelect:(0,K.mK)(a.onSelect,()=>n?.(!!tj(r)||!r),{checkForDefaultPrevented:!1})})})});tt.displayName="MenuCheckboxItem";var tr="MenuRadioGroup",[tn,ta]=eO(tr,{value:void 0,onValueChange:()=>{}}),ti=l.forwardRef((e,t)=>{let{value:r,onValueChange:n,...a}=e,i=(0,el.c)(n);return(0,s.jsx)(tn,{scope:e.__scopeMenu,value:r,onValueChange:i,children:(0,s.jsx)(e5,{...a,ref:t})})});ti.displayName=tr;var to="MenuRadioItem",ts=l.forwardRef((e,t)=>{let{value:r,...n}=e,a=ta(to,e.__scopeMenu),i=r===a.value;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:i,children:(0,s.jsx)(e7,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":tN(i),onSelect:(0,K.mK)(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ts.displayName=to;var tl="MenuItemIndicator",[tc,tu]=eO(tl,{checked:!1}),td=l.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...a}=e,i=tu(tl,r);return(0,s.jsx)(es.C,{present:n||tj(i.checked)||!0===i.checked,children:(0,s.jsx)(Z.sG.span,{...a,ref:t,"data-state":tN(i.checked)})})});td.displayName=tl;var tp=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tp.displayName="MenuSeparator";var th=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(ei.i3,{...a,...n,ref:t})});th.displayName="MenuArrow";var tm="MenuSub",[tf,tg]=eO(tm),tv=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,i=e$(tm,t),o=eq(t),[c,u]=l.useState(null),[d,p]=l.useState(null),h=(0,el.c)(a);return l.useEffect(()=>(!1===i.open&&h(!1),()=>h(!1)),[i.open,h]),(0,s.jsx)(ei.bL,{...o,children:(0,s.jsx)(e_,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:p,children:(0,s.jsx)(tf,{scope:t,contentId:(0,ea.B)(),triggerId:(0,ea.B)(),trigger:c,onTriggerChange:u,children:r})})})};tv.displayName=tm;var tx="MenuSubTrigger",ty=l.forwardRef((e,t)=>{let r=e$(tx,e.__scopeMenu),n=eH(tx,e.__scopeMenu),a=tg(tx,e.__scopeMenu),i=eQ(tx,e.__scopeMenu),o=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,s.jsx)(eW,{asChild:!0,...d,children:(0,s.jsx)(te,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":tk(r.open),...e,ref:(0,Y.t)(t,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,K.mK)(e.onPointerMove,tC(t=>{i.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||o.current||(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>{p();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,a="right"===n,o=t[a?"left":"right"],s=t[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:o,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,K.mK)(e.onKeyDown,t=>{let a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||eT[n.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})});ty.displayName=tx;var tb="MenuSubContent",tw=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu),c=tg(tb,e.__scopeMenu),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:(0,s.jsx)(e4,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===o.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,K.mK)(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=eI[o.dir].includes(e.key);t&&r&&(i.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function tk(e){return e?"open":"closed"}function tj(e){return"indeterminate"===e}function tN(e){return tj(e)?"indeterminate":e?"checked":"unchecked"}function tC(e){return t=>"mouse"===t.pointerType?e(t):void 0}tw.displayName=tb;var tS="DropdownMenu",[tE,tM]=(0,J.A)(tS,[eF]),tP=eF(),[tD,tT]=tE(tS),tI=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,u=tP(t),d=l.useRef(null),[p,h]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:o,caller:tS});return(0,s.jsx)(tD,{scope:t,triggerId:(0,ea.B)(),triggerRef:d,contentId:(0,ea.B)(),open:p,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(e=>!e),[h]),modal:c,children:(0,s.jsx)(eV,{...u,open:p,onOpenChange:h,dir:n,modal:c,children:r})})};tI.displayName=tS;var tA="DropdownMenuTrigger",tR=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=tT(tA,r),o=tP(r);return(0,s.jsx)(eW,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:(0,Y.t)(t,i.triggerRef),onPointerDown:(0,K.mK)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});tR.displayName=tA;var tL=e=>{let{__scopeDropdownMenu:t,...r}=e,n=tP(t);return(0,s.jsx)(eJ,{...n,...r})};tL.displayName="DropdownMenuPortal";var tz="DropdownMenuContent",tO=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tT(tz,r),i=tP(r),o=l.useRef(!1);return(0,s.jsx)(e0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:t,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{o.current||a.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:(0,K.mK)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tO.displayName=tz,l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="DropdownMenuGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e6,{...a,...n,ref:t})}).displayName="DropdownMenuLabel";var tF=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});tF.displayName="DropdownMenuItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tt,{...a,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="DropdownMenuRadioGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ts,{...a,...n,ref:t})}).displayName="DropdownMenuRadioItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(td,{...a,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var tq=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});function tB({...e}){return(0,s.jsx)(tI,{"data-slot":"dropdown-menu",...e})}function t_({...e}){return(0,s.jsx)(tR,{"data-slot":"dropdown-menu-trigger",...e})}function t$({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(tL,{children:(0,s.jsx)(tO,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,h.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-40 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...r})})}function tU({className:e,inset:t,variant:r="default",...n}){return(0,s.jsx)(tF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,h.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function tH({className:e,...t}){return(0,s.jsx)(tq,{"data-slot":"dropdown-menu-separator",className:(0,h.cn)("bg-border -mx-1 my-1 h-px",e),...t})}tq.displayName="DropdownMenuSeparator",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="DropdownMenuArrow",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ty,{...a,...n,ref:t})}).displayName="DropdownMenuSubTrigger",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var tV=r(52581);function tW({project:e,onSelect:t,onDelete:r,onExport:n,onExportZip:a,onDuplicate:i,onPreview:o,onUpdate:c,viewMode:u="grid",forceMenuOpen:d=!1,highlightExport:v=!1}){let[A,R]=(0,l.useState)(!1),[L,z]=(0,l.useState)(e.name),[O,F]=(0,l.useState)(e.description||""),[q,B]=(0,l.useState)(null),[_,$]=(0,l.useState)(!0),[U,H]=(0,l.useState)(!1),V=async()=>{if(!L.trim()){tV.oR.error("Project name cannot be empty"),z(e.name),R(!1);return}if(L.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(O.length>200)return void tV.oR.error("Description must be 200 characters or less");try{e.name=L.trim(),e.description=O.trim()||void 0,await p.OP.updateProject(e),c(e),R(!1),tV.oR.success("Project updated")}catch(t){h.v.error("Failed to update project:",t),tV.oR.error("Failed to update project"),z(e.name),F(e.description||"")}},W=()=>{z(e.name),F(e.description||""),R(!1)},K=e=>{if(d)return void H(!0);H(e)},Y=()=>q?Object.entries(q.fileTypes).sort(([,e],[,t])=>t-e).slice(0,3):[],J=e=>{let t=e.toLowerCase();return["html","htm"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["css","scss","sass"].includes(t)?(0,s.jsx)(y,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(t)?(0,s.jsx)(b,{className:"h-3 w-3"}):(0,s.jsx)(y,{className:"h-3 w-3"})},X=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===u?(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[A?(0,s.jsxs)("div",{className:"flex items-center gap-2",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&V(),"Escape"===e.key&&W()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[L.length,"/50"]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),e.description&&!A&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-md",children:e.description})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 ml-4",children:[q&&(0,s.jsxs)("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:G(e.updatedAt,{addSuffix:!0})}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(M.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(D,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}):(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),"data-tour-id":"project-card",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[A?(0,s.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),V()),"Escape"===e.key&&W()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[L.length,"/50"]})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(M.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(D,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),A?(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(g,{value:O,onChange:e=>F(e.target.value),onKeyDown:e=>{"Escape"===e.key&&W()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,s.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[O.length,"/200"]})})]}):(0,s.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),_?(0,s.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," ",1===q.fileCount?"file":"files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),Y().length>0&&(0,s.jsx)("div",{className:"flex items-center gap-3 text-xs",children:Y().map(([e,t])=>(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[J(e),(0,s.jsxs)("span",{children:[e," (",t,")"]})]},e))})]}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,s.jsxs)("p",{children:["Updated ",G(e.updatedAt,{addSuffix:!0})]})})]})})}var tG=r(22106),tK=r(78122);let tY=(0,v.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),tJ=(0,v.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tX=(0,v.A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),tZ=(0,v.A)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),tQ=(0,v.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),t0=(0,v.A)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),t1=(0,v.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var t2=r(63974);let t3={mobile:{width:"375px",height:"100%",maxHeight:"667px"},tablet:{width:"768px",height:"100%",maxHeight:"1024px"},desktop:{width:"100%",height:"100%",maxHeight:"900px",maxWidth:"1440px"},responsive:{width:"100%",height:"100%"}};function t4({projectId:e,refreshTrigger:t,onFocusSelection:r,hasFocusTarget:n=!1,onClose:a}){let[i,o]=(0,l.useState)(null),[c,u]=(0,l.useState)("/"),[d,f]=(0,l.useState)(!0),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)("tablet"),[b,w]=(0,l.useState)(["/"]),[j,N]=(0,l.useState)(0),[C,S]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),D=(0,l.useRef)(null),T=(0,l.useRef)(null),I=(0,l.useRef)(null),A=(0,l.useRef)("/"),R=(0,l.useRef)(null),L=(0,l.useRef)(!1),z=(0,l.useCallback)(e=>{if(D.current&&D.current.contentWindow)try{D.current.contentWindow.postMessage(e,"*")}catch(e){h.v.warn("Failed to communicate with preview iframe",e)}},[]),O=(0,l.useRef)(!1),F=(0,l.useRef)(null),q=(0,l.useRef)(null),B=(0,l.useRef)(null),_=()=>(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,s.jsx)(M.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),a?(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":"Hide preview",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(M.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(M.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]}),$=(0,l.useCallback)(async(t=!1,r=!0)=>{r&&f(!0),v(null);try{await p.OP.init();let r=t?A.current:null;T.current&&T.current.cleanupBlobUrls();let n=new tG.B(p.OP,e);T.current=n;let a=await n.compileProject();o(a),I.current=a;let i=r;i||(i=a.blobUrls.has("/index.html")?"/":a.entryPoint||(a.routes.length>0?a.routes[0].path:"/")),H(i,a)}catch(e){v(e instanceof Error?e.message:"Failed to compile project"),h.v.error("Compilation error:",e)}finally{r&&f(!1)}},[e]),U=(0,l.useCallback)((e=!1,t=!0)=>{if(O.current){let r=F.current;F.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t};return}(async(e,t)=>{O.current=!0;try{await $(e,t)}finally{O.current=!1;let e=F.current;F.current=null,e&&U(e.preserve,e.showLoading)}})(e,t)},[$]);(0,l.useCallback)((e=!1,t=!1)=>{let r=B.current;B.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t},q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{let e=B.current;B.current=null,q.current=null,e&&U(e.preserve,e.showLoading)},150)},[U]);let H=(e,t)=>{let r,n=t||I.current||i;if(!n)return void h.v.warn("No compiled project available");if(L.current?P(!1):z({type:"selector-toggle",active:!1}),!D.current||!C){R.current=e;return}let a=e;a.startsWith("/")||(a="/"+a);let o=n.routes.find(e=>e.path===a);r=o?o.file:"/"===a?"/index.html":a+".html";let s=n.files.find(e=>e.path===r);if(!s){v(`Page not found: ${e}`),n.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&H("/",t);return}let l="string"==typeof s.content?s.content:new TextDecoder().decode(s.content);l=(l=(l=l.replace(/href="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".css")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`href="${a}"`:e})).replace(/src="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".js")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,t)=>{let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e});let c=` + - -`},{path:"/assets/README.md",content:`# Assets Directory + function handleMouseMove(event) { + if (!selectorState.active) { + return; + } + const target = isElement(event.target) ? event.target : (event.target && event.target.parentElement); + if (!isElement(target) || target === selectorState.lastTarget) { + return; + } + selectorState.lastTarget = target; + positionOverlay(target); + } -This directory contains all static assets for the Example project. + function handleClick(event) { + if (!selectorState.active) { + return; + } + event.preventDefault(); + event.stopPropagation(); + if (typeof event.stopImmediatePropagation === 'function') { + event.stopImmediatePropagation(); + } + const target = isElement(event.target) ? event.target : (event.target && event.target.parentElement); + if (!isElement(target)) { + disableSelector(false); + return; + } + const payload = { + domPath: buildDomPath(target), + tagName: target.tagName.toLowerCase(), + attributes: gatherAttributes(target), + outerHTML: target.outerHTML || '' + }; + if (isInIframe) { + window.parent.postMessage({ type: 'selector-selection', payload: payload }, '*'); + } + disableSelector(false); + } -## Structure + function handleContextMenu(event) { + if (!selectorState.active) { + return; + } + event.preventDefault(); + event.stopPropagation(); + } -- \`/images/\` - Image files including: - - \`example-background.jpg\` - Hero section background image - - \`logo.svg\` - Site logo - - \`favicon.svg\` - Browser favicon + function handleKeyDown(event) { + if (!selectorState.active) { + return; + } + if (event.key === 'Escape') { + event.preventDefault(); + disableSelector(true); + } + } -## Background Image + function enableSelector() { + if (selectorState.active) { + return; + } + selectorState.active = true; + selectorState.previousCursor = document.body.style.cursor; + const overlay = ensureOverlay(); + overlay.style.opacity = '0'; + document.body.style.cursor = 'crosshair'; + document.addEventListener('mousemove', handleMouseMove, true); + document.addEventListener('click', handleClick, true); + document.addEventListener('contextmenu', handleContextMenu, true); + document.addEventListener('keydown', handleKeyDown, true); + } -The \`example-background.jpg\` is automatically included when the demo project is created. It features a beautiful flowing gradient design that complements the orange (#ff7b00) and blue (#2563eb) color scheme. + function disableSelector(notifyCancel) { + if (!selectorState.active) { + return; + } + selectorState.active = false; + selectorState.lastTarget = null; + if (selectorState.overlay) { + selectorState.overlay.style.opacity = '0'; + window.setTimeout(clearOverlay, 120); + } else { + clearOverlay(); + } + document.body.style.cursor = selectorState.previousCursor || ''; + document.removeEventListener('mousemove', handleMouseMove, true); + document.removeEventListener('click', handleClick, true); + document.removeEventListener('contextmenu', handleContextMenu, true); + document.removeEventListener('keydown', handleKeyDown, true); + if (notifyCancel && isInIframe) { + window.parent.postMessage({ type: 'selector-cancelled' }, '*'); + } + } -## File Types Supported + window.addEventListener('message', function(event) { + const data = event.data; + if (!data || typeof data !== 'object') { + return; + } + if (data.type === 'selector-toggle') { + if (data.active) { + enableSelector(); + } else { + disableSelector(false); + } + } + }); + })(); + + `;l.includes("")?l=l.replace("",c+""):l+=c,D.current.srcdoc=l,u(a),A.current=a,N(e=>(w(t=>[...t.slice(0,e+1),a]),e+1))},V=(0,l.useCallback)(e=>{H(e)},[i]),W=()=>{if(j>0){let e=j-1;N(e),H(b[e])}},G=()=>{if(j{H("/")},Y=()=>{U(!0,!1)};return d?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsx)(tK.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):g?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,s.jsx)("p",{className:"font-medium",children:"Error"}),(0,s.jsx)("p",{className:"text-sm mt-2",children:g}),(0,s.jsx)(m.$,{onClick:Y,className:"mt-4",children:"Try Again"})]})})]}):(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:E?{backgroundColor:"var(--button-preview-active)",color:"white"}:n?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},title:E?"Cancel element selection":n?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,s.jsx)(t2.yv,{className:"truncate"})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,s.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:{backgroundColor:E?"var(--button-preview-active)":void 0,color:E?"white":void 0},title:E?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),(0,s.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:c}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"w-[200px] h-8",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===x?"var(--button-preview-active)":void 0,color:"mobile"===x?"white":void 0},onClick:()=>y("mobile"),children:(0,s.jsx)(tQ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===x?"var(--button-preview-active)":void 0,color:"tablet"===x?"white":void 0},onClick:()=>y("tablet"),children:(0,s.jsx)(t0,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===x?"var(--button-preview-active)":void 0,color:"desktop"===x?"white":void 0},onClick:()=>y("desktop"),children:(0,s.jsx)(t1,{className:"h-3 w-3"})})]})]}),(0,s.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,s.jsx)("div",{className:(0,h.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==x&&"rounded-lg"),style:{width:t3[x].width||"100%",height:t3[x].height||"100%",maxHeight:t3[x].maxHeight||"100%",maxWidth:t3[x].maxWidth||"100%"},children:(0,s.jsx)("iframe",{ref:e=>{D.current=e,e&&!C?setTimeout(()=>{S(!0)},0):!e&&C&&S(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})}let t5={rE:"1.0.7"};var t6="Dialog",[t8,t9]=(0,J.A)(t6),[t7,re]=t8(t6),rt=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,p]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:i,caller:t6});return(0,s.jsx)(t7,{scope:t,triggerRef:c,contentRef:u,contentId:(0,ea.B)(),titleId:(0,ea.B)(),descriptionId:(0,ea.B)(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:o,children:r})};rt.displayName=t6;var rr="DialogTrigger";l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rr,r),i=(0,Y.s)(t,a.triggerRef);return(0,s.jsx)(Z.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":rk(a.open),...n,ref:i,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})}).displayName=rr;var rn="DialogPortal",[ra,ri]=t8(rn,{forceMount:void 0}),ro=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=re(rn,t);return(0,s.jsx)(ra,{scope:t,forceMount:r,children:l.Children.map(n,e=>(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:e})}))})};ro.displayName=rn;var rs="DialogOverlay",rl=l.forwardRef((e,t)=>{let r=ri(rs,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rs,e.__scopeDialog);return i.modal?(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(ru,{...a,ref:t})}):null});rl.displayName=rs;var rc=(0,eC.TL)("DialogOverlay.RemoveScroll"),ru=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rs,r);return(0,s.jsx)(eE.A,{as:rc,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(Z.sG.div,{"data-state":rk(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rd="DialogContent",rp=l.forwardRef((e,t)=>{let r=ri(rd,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rd,e.__scopeDialog);return(0,s.jsx)(es.C,{present:n||i.open,children:i.modal?(0,s.jsx)(rh,{...a,ref:t}):(0,s.jsx)(rm,{...a,ref:t})})});rp.displayName=rd;var rh=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(null),a=(0,Y.s)(t,r.contentRef,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(rf,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,K.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault())})}),rm=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(!1),a=l.useRef(!1);return(0,s.jsx)(rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let i=t.target;r.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rf=l.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=re(rd,r),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,er.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,s.jsx)(et.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rk(c.open),...o,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(rS,{titleId:c.titleId}),(0,s.jsx)(rE,{contentRef:u,descriptionId:c.descriptionId})]})]})}),rg="DialogTitle",rv=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rg,r);return(0,s.jsx)(Z.sG.h2,{id:a.titleId,...n,ref:t})});rv.displayName=rg;var rx="DialogDescription",ry=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rx,r);return(0,s.jsx)(Z.sG.p,{id:a.descriptionId,...n,ref:t})});ry.displayName=rx;var rb="DialogClose",rw=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rb,r);return(0,s.jsx)(Z.sG.button,{type:"button",...n,ref:t,onClick:(0,K.mK)(e.onClick,()=>a.onOpenChange(!1))})});function rk(e){return e?"open":"closed"}rw.displayName=rb;var rj="DialogTitleWarning",[rN,rC]=(0,J.q)(rj,{contentName:rd,titleName:rg,docsSlug:"dialog"}),rS=({titleId:e})=>{let t=rC(rj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. -The VFS system supports various file types: -- Images: PNG, JPG, JPEG, GIF, WebP, SVG, ICO -- Documents: HTML, CSS, JS, JSON, TXT, MD, XML -- Binary files up to 10MB +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -This demonstrates the VFS capability to handle multiple file types and organize them in a structured directory system.`}]},r0={name:"Barebones Project",description:"A minimal starting template",directories:["/styles","/scripts","/templates"],files:[{path:"/index.html",content:` +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},rE=({contentRef:e,descriptionId:t})=>{let r=rC("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null};function rM({...e}){return(0,s.jsx)(rt,{"data-slot":"dialog",...e})}function rP({...e}){return(0,s.jsx)(ro,{"data-slot":"dialog-portal",...e})}function rD({className:e,...t}){return(0,s.jsx)(rl,{"data-slot":"dialog-overlay",className:(0,h.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t})}function rT({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(rP,{"data-slot":"dialog-portal",children:[(0,s.jsx)(rD,{}),(0,s.jsxs)(rp,{"data-slot":"dialog-content",className:(0,h.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-2xl duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(rw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(k.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function rI({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,h.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function rA({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,h.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rR({className:e,...t}){return(0,s.jsx)(rv,{"data-slot":"dialog-title",className:(0,h.cn)("text-lg leading-none font-semibold",e),...t})}function rL({className:e,...t}){return(0,s.jsx)(ry,{"data-slot":"dialog-description",className:(0,h.cn)("text-muted-foreground text-sm",e),...t})}var rz=r(96271),rO=r(59821);let rF=(0,v.A)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var rq=r(25334);function rB({open:e,onOpenChange:t}){return(0,s.jsx)(rM,{open:e,onOpenChange:t,children:(0,s.jsxs)(rT,{className:"max-w-3xl max-h-[90vh]",children:[(0,s.jsx)(rI,{children:(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,s.jsx)(rz.g,{width:64,height:64}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rR,{className:"text-2xl",children:"DeepStudio"}),(0,s.jsx)(rL,{className:"text-base",children:"Browser-based Website Builder"})]})]})}),(0,s.jsxs)("div",{className:"space-y-6 overflow-y-auto max-h-[60vh] pr-4",children:[(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed space-y-3",children:[(0,s.jsx)("p",{children:"DeepStudio is a fork from @enzostvs and @victor's DeepSite v2 that over the months of tinkering became a BYOK (Bring Your Own Key) agentic browser-based website builder where you describe what you want and an agent writes the code."}),(0,s.jsx)("p",{children:"This is a solo project and there isn't a huge corpo behind it. I'll do my best to fix issues and possibly keep the project improving, but it's just me doing this for fun so please be patient. All feedback and contributions are more than welcome."}),(0,s.jsx)("p",{children:"If you make something with the app I would be thrilled if you could share what you've made."})]})}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-semibold text-lg mb-3",children:"Links & Support"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsx)(rF,{className:"h-4 w-4"}),"GitHub repo",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsxs)("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",children:[(0,s.jsx)("title",{children:"HuggingFace"}),(0,s.jsx)("path",{d:"M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"})]}),"Live Demo (HuggingFace)",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsx)("a",{href:"https://www.buymeacoffee.com/otst",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",style:{height:"30px",width:"109px"}})})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-4 border-t",children:[(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs",children:["v",process.env.NEXT_PUBLIC_APP_VERSION||t5.rE]}),(0,s.jsx)(m.$,{onClick:()=>t(!1),children:"Close"})]})]})})}let r_=(0,v.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),r$=(0,v.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),rU=(0,v.A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rH=(0,v.A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),rV=(0,v.A)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);var rW=r(99270);let rG=(0,v.A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),rK=(0,v.A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),rY=(0,v.A)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var rJ=r(51567),rX=r(39390);r(33660);let rZ={name:"Barebones Project",description:"A minimal starting template",directories:["/styles","/scripts","/templates"],files:[{path:"/index.html",content:` @@ -3251,8 +3251,8 @@ document.addEventListener('DOMContentLoaded', () => { `},{path:"/data.json",content:`{ "title": "Welcome", "message": "Start building your website!" -}`}]};async function r1(e,t,r){await rZ.$.runWithSuppressedDirty(t,async()=>{for(let n of r.directories)await e.createDirectory(t,n);for(let n of r.files){let r=n.content;if(n.isBase64){let e=atob(n.content),t=new Uint8Array(e.length);for(let r=0;r{await e.createFile(t,"/assets/images/example-background.jpg",n)})}}catch(e){}}var r3=r(33135),r4=r(4950),r5=r(83721),r6=r(18853),r8="Switch",[r9,r7]=(0,J.A)(r8),[ne,nt]=r9(r8),nr=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[m,f]=l.useState(null),g=(0,Y.s)(t,e=>f(e)),v=l.useRef(!1),x=!m||p||!!m.closest("form"),[y,b]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:d,caller:r8});return(0,s.jsxs)(ne,{scope:r,checked:y,disabled:c,children:[(0,s.jsx)(Z.sG.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":no(y),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:g,onClick:(0,K.mK)(e.onClick,e=>{b(e=>!e),x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),x&&(0,s.jsx)(ni,{control:m,bubbles:!v.current,name:n,value:u,checked:y,required:o,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nr.displayName=r8;var nn="SwitchThumb",na=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=nt(nn,r);return(0,s.jsx)(Z.sG.span,{"data-state":no(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});na.displayName=nn;var ni=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{let o=l.useRef(null),c=(0,Y.s)(o,i),u=(0,r5.Z)(r),d=(0,r6.X)(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(u!==r&&t){let a=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(a)}},[u,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function no(e){return e?"checked":"unchecked"}function ns({className:e,...t}){return(0,s.jsx)(nr,{"data-slot":"switch",className:(0,h.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,s.jsx)(na,{"data-slot":"switch-thumb",className:(0,h.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}ni.displayName="SwitchBubbleInput";var nl=r(10218);let nc=(0,v.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var nu=r(86884);function nd({onClose:e}){let[t,r]=(0,l.useState)({}),[n,a]=(0,l.useState)({}),{theme:i,setTheme:o}=(0,nl.D)(),[c,u]=(0,l.useState)(!1),[d,p]=(0,l.useState)(!1),h=(e,t)=>{r4.s.setSetting(e,t),r(r=>({...r,[e]:t}))};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium text-sm",children:"Application Settings"}),(0,s.jsx)("p",{className:"text-muted-foreground text-xs mt-1",children:"Configure your preferences and display options"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"theme",children:"Theme"}),(0,s.jsxs)(t2.l6,{value:c?i:"dark",onValueChange:e=>{o(e),h("theme",e)},children:[(0,s.jsx)(t2.bq,{id:"theme",className:"mt-2",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"light",children:"Light"}),(0,s.jsx)(t2.eb,{value:"dark",children:"Dark"}),(0,s.jsx)(t2.eb,{value:"system",children:"System"})]})]})]}),(0,s.jsxs)("div",{className:"border-t pt-4 mt-4",children:[(0,s.jsxs)("h4",{className:"font-medium text-sm mb-3 flex items-center gap-2",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),"Cost Tracking"]}),(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"show-costs",children:"Display Costs"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Show cost information in messages"})]}),(0,s.jsx)(ns,{id:"show-costs",checked:!1!==n.showCosts,onCheckedChange:e=>{let t={...n,showCosts:e};r4.s.setCostSettings(t),a(t)}})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"daily-limit",children:"Daily Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"daily-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.dailyLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,dailyLimit:t};r4.s.setCostSettings(r),a(r)}}),n.dailyLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.dailyLimit.toFixed(2),"/day"]})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"project-limit",children:"Project Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"project-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.projectLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,projectLimit:t};r4.s.setCostSettings(r),a(r)}}),n.projectLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.projectLimit.toFixed(2),"/project"]})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"warning-threshold",children:"Warning Threshold (%)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"warning-threshold",type:"number",min:"50",max:"100",step:"5",value:n.warningThreshold||80,onChange:e=>{let t=parseInt(e.target.value),r={...n,warningThreshold:t};r4.s.setCostSettings(r),a(r)}}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[(0,s.jsx)(nc,{className:"h-3 w-3"}),"Warn at ",n.warningThreshold||80,"%"]})]})]}),(0,s.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Lifetime Total"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:nu.U.formatCost(r4.s.getLifetimeCosts().total)})]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{confirm("Reset lifetime cost tracking? This cannot be undone.")&&(r4.s.resetLifetimeCosts(),tV.oR.success("Lifetime costs reset"))},children:"Reset Stats"})]})})]})]}),(0,s.jsxs)("div",{className:"flex justify-between pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(m.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(r4.s.clearSettings(),r({}),tV.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>p(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]})]}),e&&(0,s.jsx)(m.$,{onClick:e,children:"Close"})]}),(0,s.jsx)(rB,{open:d,onOpenChange:p})]})}let np=[{id:"welcome",title:"Welcome to DeepStudio",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Let's take a guided tour of the workspace so you can see how projects, agents, and saves all fit together."}),(0,s.jsx)("p",{children:"The tour takes under two minutes and you can skip at any time."})]}),location:"project-manager",primaryLabel:"Start tour",secondaryLabel:"Skip"},{id:"projects-overview",title:"Projects at a Glance",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,s.jsx)("p",{children:"I've loaded a demo project so you can explore without setting anything up."})]}),location:"project-manager",target:'[data-tour-id="projects-list"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"create-project",title:"Creating a Project",body:(0,s.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,s.jsx)("p",{children:"Use the New Project button to start fresh. The dialog lets you name the project and add an optional description."})}),location:"project-manager",target:'[data-tour-id="new-project-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"project-controls",title:"Exporting a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Click the dropdown menu on any project card to access export options. You can export as a ZIP for deployment or JSON for backup."}),(0,s.jsx)("p",{children:"Projects can also be duplicated or deleted from this menu."})]}),location:"project-manager",target:'[data-tour-id="project-export-json"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"edit-project",title:"Editing a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"To get to the workspace and start editing, simply click on the project card. This will open the full development environment."}),(0,s.jsx)("p",{children:"Click Next to enter the workspace and continue the tour."})]}),location:"project-manager",target:'[data-tour-id="project-card"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-overview",title:"Workspace Layout",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,s.jsx)("p",{children:"The VFS works like a project file tree—add HTML, CSS, JS, or assets and the agent can edit them just like local files."})]}),location:"workspace",target:'[data-tour-id="workspace-panels"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-edit",title:"See the Agent in Action",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'I\'ll request the agent to change the color of "Our Services" button to a green accent and the agent performs the task.'}),(0,s.jsx)("p",{children:"This mimics what you will see when asking the agent to perform tasks."})]}),location:"workspace",target:'[data-tour-id="assistant-panel"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-focus",title:"Element Focus Tool",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,s.jsx)("p",{children:"Click it to activate element selection mode, then click any element in the preview to highlight it."})]}),location:"workspace",target:'[data-tour-id="focus-crosshair-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-checkpoint",title:"Checkpoints & Manual Saves",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'The "Discard Changes" button restores to the original saved point, letting you revert any changes back to your last manual save.'}),(0,s.jsx)("p",{children:"If you like the result, use the Save button to lock it in as your manual checkpoint."})]}),location:"workspace",target:'[data-tour-id="discard-changes-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"clear-conversation",title:"Clear Conversation",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The agent will have the last tasks and responses in memory. You can clear it with the trashcan button to start fresh."}),(0,s.jsx)("p",{children:"This removes the conversation history but keeps your project files intact."})]}),location:"workspace",target:'[data-tour-id="clear-chat-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"provider-settings",title:"Connect Your Provider",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,s.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,s.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,s.jsx)("p",{className:"text-xs text-orange-500/90",children:"Privacy note: Remote LLM providers (OpenAI, Anthropic, etc.) will receive your code when generating. For complete privacy, use local models with Ollama or LM Studio."})]}),location:"workspace",target:'[data-tour-id="provider-settings-trigger"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"wrap-up",title:"You're Ready!",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"That's the basics—prompt the agent, preview updates, and save when you're happy. You can replay this tour from the Help menu anytime."}),(0,s.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var nh=r(25495),nm=r(94742);let nf=(0,l.createContext)(null);function ng({children:e}){let[t,r]=(0,l.useState)("idle"),[n,a]=(0,l.useState)(0),[i,o]=(0,l.useState)(0),[c,u]=(0,l.useState)([]),[d,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)([]),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),y=(0,l.useRef)(v),b=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=np.length))return np[e]})(n),[n]),E=(0,l.useCallback)(()=>{x({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),b.current=null,w.current=null,k.current=null,j.current=null},[]),M=(0,l.useCallback)(()=>{"running"!==t&&(r("running"),a(0),o(e=>e+1),u([]),E())},[E,t]),P=(0,l.useCallback)(e=>{C.current=e},[]),D=(0,l.useCallback)((e="finish")=>{let t=y.current;t.projectId&&t.preCheckpointId&&t.postCheckpointId&&rZ.$.runWithSuppressedDirty(t.projectId,async()=>{await nm.Y.restoreCheckpoint(t.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),E(),u([]),a(0),o(e=>e+1),r("finish"===e?"completed":"idle"),r4.s.setHasSeenTour(!0),N.current?.abort(),C.current=null},[E]),T=(0,l.useCallback)(()=>{D("skip")},[D]),I=(0,l.useCallback)(()=>{a(e=>{let t=e+1;return t>=np.length?(D(),e):(o(e=>e+1),t)})},[D]),A=(0,l.useCallback)(()=>{a(e=>{let t=Math.max(0,e-1);return t!==e&&o(e=>e+1),t})},[]),R=(0,l.useMemo)(()=>({state:{status:t,stepIndex:n,stepKey:i,currentStep:S,transcript:c,isBusy:d,projectList:h},start:M,skip:T,next:I,previous:A,setProjectList:e=>{m(e)},setActiveProjectId:g,setTranscript:u,setWorkspaceHandler:P}),[t,n,i,S,c,d,h,M,T,I,A,P]);return(0,s.jsx)(nf.Provider,{value:R,children:e})}function nv(){let e=(0,l.useContext)(nf);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var nx=r(41862);function ny({location:e}){let{state:t,next:r,previous:n,skip:a}=nv(),{status:i,currentStep:o,stepKey:c,isBusy:u}=t,[d,p]=(0,l.useState)(null),h=(0,l.useMemo)(()=>!!o&&!!u&&("workspace-edit"===o.id||"workspace-focus"===o.id||"workspace-checkpoint"===o.id),[o,u]);if("running"!==i||!o||o.location!==e)return null;let f=o.primaryLabel??"Next",g=o.secondaryLabel??"Skip";return(0,s.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-background/30"}),d&&(0,s.jsx)("div",{className:"pointer-events-none fixed rounded-xl border-2 border-primary ring-4 ring-primary/30 transition-all",style:{top:d.top,left:d.left,width:d.width,height:d.height}}),(0,s.jsx)("div",{className:"absolute bottom-10 left-1/2 flex w-full max-w-xl -translate-x-1/2 flex-col gap-4 px-4",children:(0,s.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:o.title}),(0,s.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:o.body})]}),u&&(0,s.jsx)(nx.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[o.showBack?(0,s.jsx)(m.$,{variant:"ghost",onClick:n,disabled:u,children:"Back"}):(0,s.jsx)("div",{}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(m.$,{variant:"ghost",onClick:a,children:g}),(0,s.jsx)(m.$,{onClick:r,disabled:h,children:f})]})]})]})})]})}function nb({onProjectSelect:e}){let t=(0,d.useRouter)(),[r,n]=(0,l.useState)([]),[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(""),[u,v]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),[b,w]=(0,l.useState)(""),[k,j]=(0,l.useState)("blank"),[C,S]=(0,l.useState)("updated"),[E,M]=(0,l.useState)("grid"),[P,D]=(0,l.useState)(null),[T,I]=(0,l.useState)(!1),{state:A,setProjectList:R,start:L}=nv(),z=A.currentStep?.id,O="running"===A.status,[F,q]=(0,l.useState)(!1),[B,_]=(0,l.useState)(null),$=(0,l.useRef)(!1),U=(0,l.useRef)(!1);(0,l.useCallback)(async()=>{if(!$.current){$.current=!0,i(!0);try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to load projects:",e),tV.oR.error("Failed to load projects")}finally{i(!1),q(!0),$.current=!1}}},[R]);let H=(0,l.useCallback)(async()=>{try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to reload projects:",e),tV.oR.error("Failed to reload projects")}},[R]),V=async()=>{if(!U.current){U.current=!0;try{let t=await p.OP.createProject("Multi-File Demo","Interactive examples showing how HTML, CSS, and JavaScript files work together");return await r2(p.OP,t.id),tV.oR.success("Demo project created successfully"),await H(),e(t),t}catch(e){throw h.v.error("Failed to create demo project:",e),tV.oR.error("Failed to create demo project"),U.current=!1,e}}},W=async()=>{try{0===r.length&&await V(),L()}catch(e){h.v.error("Failed to prepare for tour:",e),tV.oR.error("Failed to start tour - could not create demo project")}},G=async()=>{if(!x.trim())return void tV.oR.error("Please enter a project name");if(x.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(b.length>200)return void tV.oR.error("Description must be 200 characters or less");try{let t=await p.OP.createProject(x.trim().slice(0,50),b.trim().slice(0,200)||void 0);"demo"===k?await r2(p.OP,t.id):await r1(p.OP,t.id,r0),tV.oR.success("Project created successfully"),v(!1),y(""),w(""),j("blank"),await H(),e(t)}catch(e){h.v.error("Failed to create project:",e),tV.oR.error("Failed to create project")}},K=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await p.OP.deleteProject(e.id),tV.oR.success("Project deleted"),await H()}catch(e){h.v.error("Failed to delete project:",e),tV.oR.error("Failed to delete project")}},Y=async t=>{try{let r=await p.OP.duplicateProject(t.id);tV.oR.success("Project duplicated successfully"),await H(),e(r)}catch(e){h.v.error("Failed to duplicate project:",e),tV.oR.error("Failed to duplicate project")}},J=async e=>{try{let t=await p.OP.exportProject(e.id),r=JSON.stringify(t,null,2),n=new Blob([r],{type:"application/json"}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a),tV.oR.success("Project exported")}catch(e){h.v.error("Failed to export project:",e),tV.oR.error("Failed to export project")}},X=async e=>{try{let t=await p.OP.exportProjectAsZip(e.id),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),tV.oR.success("Project exported as ZIP")}catch(e){h.v.error("Failed to export project as ZIP:",e),tV.oR.error("Failed to export project as ZIP")}},Z=async()=>{let t=document.createElement("input");t.type="file",t.accept=".json",t.onchange=async t=>{let r=t.target.files?.[0];if(r)try{let t=await r.text(),n=JSON.parse(t);if(!n.project||!n.files)throw Error("Invalid project file");let a=await p.OP.importProject(n);tV.oR.success("Project imported successfully"),await H(),e(a)}catch(e){h.v.error("Failed to import project:",e),tV.oR.error("Failed to import project")}},t.click()},Q=((e,t)=>{let r=[...e];switch(t){case"updated":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());case"created":return r.sort((e,t)=>t.createdAt.getTime()-e.createdAt.getTime());case"name":return r.sort((e,t)=>e.name.localeCompare(t.name));case"size":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());default:return r}})(r.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.description?.toLowerCase().includes(o.toLowerCase())),C);if(a&&!F)return(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,s.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let ee=[{id:"new-project",label:"New Project",icon:r_,onClick:()=>v(!0),content:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>v(!0),"data-tour-id":"new-project-button",className:"justify-start",children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"New Project"]})},{id:"import",label:"Import",icon:r$,onClick:Z,variant:"outline"}],et=(0,s.jsxs)(r3.AM,{children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsx)(m.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,s.jsx)(rU,{className:"h-4 w-4"})})}),(0,s.jsx)(r3.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nd,{})})]}),er=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)(r3.AM,{children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,s.jsx)(r3.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nd,{})})]}),(0,s.jsx)("div",{className:"border-t my-2"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),className:"w-full justify-start",children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>I(!0),className:"w-full justify-start",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,s.jsx)(rJ.j,{onLogoClick:()=>I(!0),actions:ee,mobileMenuContent:er,desktopOnlyContent:et,leftText:"DeepStudio"}),(0,s.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:(0,s.jsxs)("div",{className:"container mx-auto p-6 max-w-6xl",children:[(0,s.jsx)("div",{className:"mb-6 space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-4","data-tour-id":"projects-actions",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(rW.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),(0,s.jsx)(f.p,{placeholder:"Search projects...",value:o,onChange:e=>c(e.target.value),className:"pl-10 bg-card"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(t2.l6,{value:C,onValueChange:e=>S(e),children:[(0,s.jsxs)(t2.bq,{className:"flex-1 md:w-[180px] bg-card",children:[(0,s.jsx)(rG,{className:"h-4 w-4 mr-2"}),(0,s.jsx)(t2.yv,{placeholder:"Sort by..."})]}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"updated",children:"Last Updated"}),(0,s.jsx)(t2.eb,{value:"created",children:"Date Created"}),(0,s.jsx)(t2.eb,{value:"name",children:"Name"})]})]}),(0,s.jsxs)("div",{className:"flex gap-0.5 border rounded-sm p-1 bg-card h-9",children:[(0,s.jsx)(m.$,{size:"icon",variant:"grid"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>M("grid"),children:(0,s.jsx)(rK,{className:"h-4 w-4"})}),(0,s.jsx)(m.$,{size:"icon",variant:"list"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>M("list"),children:(0,s.jsx)(rY,{className:"h-4 w-4"})})]})]})]})}),0===Q.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2",children:o?"No projects found":"No projects yet"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:o?"Try a different search term":"Create your first project to get started"}),!o&&(0,s.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,s.jsxs)(m.$,{onClick:()=>v(!0),children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,s.jsxs)(m.$,{variant:"outline",onClick:V,children:[(0,s.jsx)(N,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,s.jsx)("div",{className:"grid"===E?"grid gap-4 md:grid-cols-2 lg:grid-cols-3":"space-y-3","data-tour-id":"projects-list",children:Q.map(t=>"object"==typeof t&&t.id&&t.name?(0,s.jsx)(tW,{project:t,onSelect:e,onDelete:K,onExport:J,onExportZip:X,onDuplicate:Y,onPreview:D,onUpdate:e=>{n(r.map(t=>t.id===e.id?e:t))},viewMode:E,forceMenuOpen:B===t.id,highlightExport:O&&"project-controls"===z&&B===t.id},t.id):(h.v.error("Invalid project object:",t),null))})]})}),(0,s.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,s.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,"data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>I(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]})}),(0,s.jsx)(rM,{open:u,onOpenChange:v,children:(0,s.jsxs)(rT,{children:[(0,s.jsxs)(rI,{children:[(0,s.jsx)(rR,{children:"Create New Project"}),(0,s.jsx)(rL,{children:"Start a new multipage website project"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"name",children:"Project Name"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x.length,"/50"]})]}),(0,s.jsx)(f.p,{id:"name",value:x,onChange:e=>y(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"template",children:"Template"}),(0,s.jsxs)(t2.l6,{value:k,onValueChange:e=>j(e),children:[(0,s.jsx)(t2.bq,{id:"template",className:"mt-2",children:(0,s.jsx)(t2.yv,{placeholder:"Select a template"})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"blank",children:"Blank (HTML/CSS/JS starter)"}),(0,s.jsx)(t2.eb,{value:"demo",children:"Demo (multi-page example)"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"description",children:"Description (optional)"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[b.length,"/200"]})]}),(0,s.jsx)(g,{id:"description",value:b,onChange:e=>w(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,s.jsxs)(rA,{children:[(0,s.jsx)(m.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,s.jsx)(m.$,{onClick:G,children:"Create Project"})]})]})}),P&&(0,s.jsx)(rM,{open:!!P,onOpenChange:()=>D(null),children:(0,s.jsxs)(rT,{className:"max-w-[90vw] sm:max-w-[85vw] lg:max-w-[80vw] 2xl:max-w-[1400px] max-h-[90vh] w-full h-full p-0 flex flex-col",children:[(0,s.jsx)(rI,{className:"p-4 border-b",children:(0,s.jsxs)(rR,{children:["Preview: ",P.name]})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)(t4,{projectId:P.id})})]})}),(0,s.jsx)(rB,{open:T,onOpenChange:I}),(0,s.jsx)(ny,{location:"project-manager"})]})}var nw=r(24923),nk=r(78272);let nj=(0,v.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),nN=(0,v.A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),nC=(0,v.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),nS=(0,v.A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var nE="ContextMenu",[nM,nP]=(0,J.A)(nE,[eF]),nD=eF(),[nT,nI]=nM(nE),nA=e=>{let{__scopeContextMenu:t,children:r,onOpenChange:n,dir:a,modal:i=!0}=e,[o,c]=l.useState(!1),u=nD(t),d=(0,el.c)(n),p=l.useCallback(e=>{c(e),d(e)},[d]);return(0,s.jsx)(nT,{scope:t,open:o,onOpenChange:p,modal:i,children:(0,s.jsx)(eV,{...u,dir:a,open:o,onOpenChange:p,modal:i,children:r})})};nA.displayName=nE;var nR="ContextMenuTrigger",nL=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,disabled:n=!1,...a}=e,i=nI(nR,r),o=nD(r),c=l.useRef({x:0,y:0}),u=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(d.current),[]),h=e=>{c.current={x:e.clientX,y:e.clientY},i.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(n&&p()),[n,p]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eW,{...o,virtualRef:u}),(0,s.jsx)(Z.sG.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:(0,K.mK)(e.onContextMenu,e=>{p(),h(e),e.preventDefault()}),onPointerDown:n?e.onPointerDown:(0,K.mK)(e.onPointerDown,nK(e=>{p(),d.current=window.setTimeout(()=>h(e),700)})),onPointerMove:n?e.onPointerMove:(0,K.mK)(e.onPointerMove,nK(p)),onPointerCancel:n?e.onPointerCancel:(0,K.mK)(e.onPointerCancel,nK(p)),onPointerUp:n?e.onPointerUp:(0,K.mK)(e.onPointerUp,nK(p))})]})});nL.displayName=nR;var nz=e=>{let{__scopeContextMenu:t,...r}=e,n=nD(t);return(0,s.jsx)(eJ,{...n,...r})};nz.displayName="ContextMenuPortal";var nO="ContextMenuContent",nF=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nI(nO,r),i=nD(r),o=l.useRef(!1);return(0,s.jsx)(e0,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||a.modal||(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nF.displayName=nO,l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="ContextMenuGroup";var nq=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(e6,{...a,...n,ref:t})});nq.displayName="ContextMenuLabel";var nB=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});nB.displayName="ContextMenuItem";var n_=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(tt,{...a,...n,ref:t})});n_.displayName="ContextMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="ContextMenuRadioGroup";var n$=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(ts,{...a,...n,ref:t})});n$.displayName="ContextMenuRadioItem";var nU=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(td,{...a,...n,ref:t})});nU.displayName="ContextMenuItemIndicator";var nH=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});nH.displayName="ContextMenuSeparator",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="ContextMenuArrow";var nV="ContextMenuSub",nW=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(ty,{...a,...n,ref:t})});nW.displayName="ContextMenuSubTrigger";var nG=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nD(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});function nK(e){return t=>"mouse"!==t.pointerType?e(t):void 0}nG.displayName="ContextMenuSubContent";let nY=(0,v.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);l.forwardRef(({className:e,inset:t,children:r,...n},a)=>(0,s.jsxs)(nW,{ref:a,className:(0,h.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,(0,s.jsx)(tJ,{className:"ml-auto h-4 w-4"})]})).displayName=nW.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nG,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})).displayName=nG.displayName;let nJ=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nz,{children:(0,s.jsx)(nF,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));nJ.displayName=nF.displayName;let nX=l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(nB,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));function nZ({projectId:e,onFileSelect:t,selectedPath:r,onClose:n}){let[a,i]=(0,l.useState)([]),[o,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(new Set(["/"])),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)(""),[w,j]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[E,M]=(0,l.useState)(null),P=(0,l.useRef)(null),D=(0,l.useCallback)(async()=>{try{await p.OP.init();let t=await p.OP.getAllFilesAndDirectories(e),r=t.filter(e=>"directory"!==e.type);i(r),c(T(t))}catch(e){h.v.error("Failed to load files:",e)}},[e]),T=e=>{let t=[],r=new Map;e.forEach(e=>{if("directory"===e.type){let t=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name||t[t.length-1]||"unnamed",type:"directory",children:[]};r.set(e.path,n)}}),e.forEach(e=>{if("directory"!==e.type){let t=e.path.split("/").filter(Boolean),n="";for(let e=0;e{let a=n.split("/").filter(Boolean);if(1===a.length)t.push(e);else{let t="/"+a.slice(0,-1).join("/"),n=r.get(t);n&&n.children&&n.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let n=e.path.split("/").filter(Boolean),a={path:e.path,name:e.name,type:"file"};if(1===n.length)t.push(a);else{let e="/"+n.slice(0,-1).join("/"),t=r.get(e);t&&t.children?.push(a)}}});let n=e=>{e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&n(e.children)})};return n(t),t},I=e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},A=async e=>{if("directory"===e.type)I(e.path);else{let r=a.find(t=>t.path===e.path);r&&t&&t(r)}},R=async(t="/")=>{let r=prompt("Enter file name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createFile(e,n,""),await D()}catch(e){h.v.error("Failed to create file:",e)}},L=async(t="/")=>{let r=prompt("Enter directory name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createDirectory(e,n),await D()}catch(e){h.v.error("Failed to create directory:",e)}},z=async(t,r)=>{if(confirm(`Delete ${r} "${t}"?`))try{"file"===r?await p.OP.deleteFile(e,t):await p.OP.deleteDirectory(e,t),await D()}catch(e){h.v.error(`Failed to delete ${r}:`,e)}},O=async(t,r)=>{if(!x)return;let n=t.split("/");n[n.length-1]=x;let a=n.join("/");try{"directory"===r?await p.OP.renameDirectory(e,t,a):await p.OP.renameFile(e,t,a),await D(),v(null),y("")}catch(e){h.v.error(`Failed to rename ${r}:`,e)}},F=async e=>{for(let t of(e.preventDefault(),e.stopPropagation(),j(!1),Array.from(e.dataTransfer.items)))if("file"===t.kind){let e=t.getAsFile();e&&await q(e,"/")}},q=async(t,r)=>{if(!(0,nw.fu)(t.name))return void tV.oR.error(`File type not supported: ${t.name}`);let n=(0,nw.Gr)(t.name),a=nw.Q6[n];if(t.size>a)return void tV.oR.error(`File too large: ${t.name}. Maximum size is ${Math.round(a/1024/1024)}MB`);let i="/"===r?`/${t.name}`:`${r}/${t.name}`;try{let r;r="image"===n||"video"===n||"binary"===n?await t.arrayBuffer():await t.text(),await p.OP.createFile(e,i,r),await D(),tV.oR.success(`Uploaded ${t.name}`)}catch(n){if(n.message?.includes("already exists")){if(confirm(`File "${t.name}" already exists. Overwrite?`))try{await p.OP.deleteFile(e,i),await q(t,r)}catch(e){h.v.error("Failed to overwrite file:",e),tV.oR.error("Failed to overwrite file")}}else h.v.error("Failed to upload file:",n),tV.oR.error(`Failed to upload ${t.name}: ${n.message}`)}},B=(e,t)=>{e.stopPropagation(),S(t),e.dataTransfer.effectAllowed="move"},_=()=>{S(null),M(null)},$=(e,t)=>{e.preventDefault(),e.stopPropagation(),C&&t!==C.path&&(e.dataTransfer.dropEffect="move",M(t))},U=async(t,r)=>{if(t.preventDefault(),t.stopPropagation(),!C||r&&C.path===r.path)return void M(null);let n=r&&"directory"===r.type?r.path:"/";if("directory"===C.type){let e=C.path.endsWith("/")?C.path:C.path+"/";if((n.endsWith("/")?n:n+"/").startsWith(e)){tV.oR.error("Cannot move a folder into itself"),M(null);return}}let a=C.name,i="/"===n?`/${a}`:`${n}/${a}`;try{"directory"===C.type?await p.OP.moveDirectory(e,C.path,i):await p.OP.moveFile(e,C.path,i),await D(),tV.oR.success(`Moved ${C.name} to ${"/"===n?"root":n}`)}catch(e){h.v.error("Failed to move item:",e),tV.oR.error(`Failed to move: ${e.message}`)}M(null)},H=(e,t=0)=>{let n=u.has(e.path),a=r===e.path,i=g===e.path,o=E===e.path;return(0,s.jsxs)("div",{draggable:!i,onDragStart:t=>B(t,e),onDragEnd:_,onDragOver:t=>"directory"===e.type&&$(t,e.path),onDrop:t=>"directory"===e.type&&U(t,e),children:[(0,s.jsxs)(nA,{children:[(0,s.jsx)(nL,{children:(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",a&&"bg-accent text-accent-foreground",o&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",C?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*t+8}px`},onClick:()=>A(e),children:["directory"===e.type?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsx)(nk.A,{className:"w-4 h-4 text-muted-foreground"}):(0,s.jsx)(tJ,{className:"w-4 h-4 text-muted-foreground"}),n?(0,s.jsx)(N,{className:"w-4 h-4 text-blue-500"}):(0,s.jsx)(nj,{className:"w-4 h-4 text-blue-500"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"w-4"}),(()=>{let t=(0,nw.Gr)(e.path);return"image"===t?(0,s.jsx)(b,{className:"w-4 h-4 text-green-500"}):"video"===t?(0,s.jsx)(nN,{className:"w-4 h-4 text-purple-500"}):(0,s.jsx)(nC,{className:"w-4 h-4 text-muted-foreground"})})()]}),i?(0,s.jsx)(f.p,{value:x,onChange:e=>y(e.target.value),onBlur:()=>O(e.path,e.type),onKeyDown:t=>{"Enter"===t.key?O(e.path,e.type):"Escape"===t.key&&(v(null),y(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,s.jsxs)(nJ,{children:["directory"===e.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(nX,{onClick:()=>R(e.path),children:[(0,s.jsx)(nC,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(nX,{onClick:()=>L(e.path),children:[(0,s.jsx)(nj,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(nX,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,s.jsx)(nX,{onClick:()=>{v(e.path),y(e.name)},children:"Rename"}),(0,s.jsx)(nX,{onClick:()=>z(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&n&&e.children&&(0,s.jsx)("div",{children:e.children.map(e=>H(e,t+1))})]},e.path)};return(0,s.jsxs)("div",{className:"h-full flex flex-col",onDrop:F,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),j(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getBoundingClientRect(),r=e.clientX,n=e.clientY;(r=t.right||n=t.bottom)&&j(!1)},children:[(0,s.jsx)("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let t of Array.from(e.target.files||[]))await q(t,"/");P.current&&(P.current.value="")}}),(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nS,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),n?(0,s.jsxs)("button",{type:"button",onClick:n,"aria-label":"Hide file explorer",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(nS,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(nS,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P.current?.click(),title:"Upload files",children:(0,s.jsx)(r$,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>R("/"),title:"New file",children:(0,s.jsx)(nC,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>L("/"),title:"New folder",children:(0,s.jsx)(nj,{className:"h-3 w-3"})})]})]}),(0,s.jsxs)(nA,{children:[(0,s.jsx)(nL,{asChild:!0,children:(0,s.jsxs)("div",{className:(0,h.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",w&&"bg-blue-500/10"),onDragOver:e=>{C&&(e.preventDefault(),e.stopPropagation(),M("/"))},onDrop:e=>{C&&U(e,null)},children:[w&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,s.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,s.jsx)(r$,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===o.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(nj,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,s.jsx)("div",{className:"contents",children:o.map(e=>H(e))})]})}),(0,s.jsxs)(nJ,{children:[(0,s.jsxs)(nX,{onClick:()=>R("/"),children:[(0,s.jsx)(nC,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(nX,{onClick:()=>L("/"),children:[(0,s.jsx)(nj,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(nX,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function nQ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}nX.displayName=nB.displayName,l.forwardRef(({className:e,children:t,checked:r,...n},a)=>(0,s.jsxs)(n_,{ref:a,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(nU,{children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})}),t]})).displayName=n_.displayName,l.forwardRef(({className:e,children:t,...r},n)=>(0,s.jsxs)(n$,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(nU,{children:(0,s.jsx)(nY,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=n$.displayName,l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(nq,{ref:n,className:(0,h.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r})).displayName=nq.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nH,{ref:r,className:(0,h.cn)("-mx-1 my-1 h-px bg-border",e),...t})).displayName=nH.displayName;function n0(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};n8.initial(e),n8.handler(t);var r={current:e},n=n3(ae)(r,t),a=n3(n7)(r),i=n3(n8.changes)(e),o=n3(n9)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return n8.selector(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r{n.current=!1}:e,t)};function aw(){}function ak(e,t,r,n){var a,i,o,s,l,c;return a=e,i=n,a.editor.getModel(aj(a,i))||(o=e,s=t,l=r,c=n,o.editor.createModel(s,l,c?aj(o,c):void 0))}function aj(e,t){return e.Uri.parse(t)}(0,l.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:p={},height:h="100%",width:m="100%",className:f,wrapperProps:g={},beforeMount:v=aw,onMount:x=aw}){let[y,b]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!0),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useRef)(x),E=(0,l.useRef)(v),M=(0,l.useRef)(!1);ay(()=>{let e=am.init();return e.then(e=>(N.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(s||t?.original?.dispose(),c||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),ab(()=>{if(j.current&&N.current){let t=j.current.getOriginalEditor(),a=ak(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],y),ab(()=>{if(j.current&&N.current){let e=j.current.getModifiedEditor(),n=ak(N.current,t||"",a||r||"text",o||"");n!==e.getModel()&&e.setModel(n)}},[o],y),ab(()=>{let e=j.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),ab(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],y),ab(()=>{let{original:e,modified:t}=j.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],y),ab(()=>{N.current?.editor.setTheme(u)},[u],y),ab(()=>{j.current?.updateOptions(p)},[p],y);let P=(0,l.useCallback)(()=>{if(!N.current)return;E.current(N.current);let s=ak(N.current,e||"",n||r||"text",i||""),l=ak(N.current,t||"",a||r||"text",o||"");j.current?.setModel({original:s,modified:l})},[r,t,a,e,n,i,o]),D=(0,l.useCallback)(()=>{!M.current&&C.current&&(j.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...p}),P(),N.current?.editor.setTheme(u),b(!0),M.current=!0)},[p,u,P]);return(0,l.useEffect)(()=>{y&&S.current(j.current,N.current)},[y]),(0,l.useEffect)(()=>{w||y||D()},[w,y,D]),l.createElement(ax,{width:m,height:h,isEditorReady:y,loading:d,_ref:C,className:f,wrapperProps:g})});var aN=function(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current},aC=new Map,aS=(0,l.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:o="light",line:s,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:p=!0,keepCurrentModel:h=!1,width:m="100%",height:f="100%",className:g,wrapperProps:v={},beforeMount:x=aw,onMount:y=aw,onChange:b,onValidate:w=aw}){let[k,j]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),S=(0,l.useRef)(null),E=(0,l.useRef)(null),M=(0,l.useRef)(null),P=(0,l.useRef)(y),D=(0,l.useRef)(x),T=(0,l.useRef)(),I=(0,l.useRef)(n),A=aN(i),R=(0,l.useRef)(!1),L=(0,l.useRef)(!1);ay(()=>{let e=am.init();return e.then(e=>(S.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>E.current?void(T.current?.dispose(),h?p&&aC.set(i,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()):e.cancel()}),ab(()=>{let o=ak(S.current,e||n||"",t||a||"",i||r||"");o!==E.current?.getModel()&&(p&&aC.set(A,E.current?.saveViewState()),E.current?.setModel(o),p&&E.current?.restoreViewState(aC.get(i)))},[i],k),ab(()=>{E.current?.updateOptions(u)},[u],k),ab(()=>{E.current&&void 0!==n&&(E.current.getOption(S.current.editor.EditorOption.readOnly)?E.current.setValue(n):n!==E.current.getValue()&&(L.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),E.current.pushUndoStop(),L.current=!1))},[n],k),ab(()=>{let e=E.current?.getModel();e&&a&&S.current?.editor.setModelLanguage(e,a)},[a],k),ab(()=>{void 0!==s&&E.current?.revealLine(s)},[s],k),ab(()=>{S.current?.editor.setTheme(o)},[o],k);let z=(0,l.useCallback)(()=>{if(!(!M.current||!S.current)&&!R.current){D.current(S.current);let l=i||r,c=ak(S.current,n||e||"",t||a||"",l||"");E.current=S.current?.editor.create(M.current,{model:c,automaticLayout:!0,...u},d),p&&E.current.restoreViewState(aC.get(l)),S.current.editor.setTheme(o),void 0!==s&&E.current.revealLine(s),j(!0),R.current=!0}},[e,t,r,n,a,i,u,d,p,o,s]);return(0,l.useEffect)(()=>{k&&P.current(E.current,S.current)},[k]),(0,l.useEffect)(()=>{N||k||z()},[N,k,z]),I.current=n,(0,l.useEffect)(()=>{k&&b&&(T.current?.dispose(),T.current=E.current?.onDidChangeModelContent(e=>{L.current||b(E.current.getValue(),e)}))},[k,b]),(0,l.useEffect)(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,w]),l.createElement(ax,{width:m,height:f,isEditorReady:k,loading:c,_ref:M,className:g,wrapperProps:v})});let aE=(0,v.A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),aM=(0,v.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var aP=r(93613);function aD({projectId:e,onFilesChange:t,onClose:r}){let[n,a]=(0,l.useState)(new Map),[i,o]=(0,l.useState)(null),{resolvedTheme:c}=(0,nl.D)(),[u,d]=(0,l.useState)(!1),f=(e,t)=>{t&&t.stopPropagation();let r=n.get(e);if((!r?.modified||confirm(`Close ${r.file.name} without saving?`))&&(a(t=>{let r=new Map(t);return r.delete(e),r}),i===e)){let t=Array.from(n.keys()).filter(t=>t!==e);o(t.length>0?t[t.length-1]:null)}},g=(0,l.useCallback)((e,t)=>{void 0!==e&&"text"===y(t).type&&a(r=>{let n=new Map(r),a=n.get(t);return a&&n.set(t,{...a,content:e,modified:a.file.content!==e}),n})},[]),v=(0,l.useCallback)(async t=>{let r=n.get(t);if(r&&r.modified)try{await p.OP.init();let n=await p.OP.updateFile(e,t,r.content);a(e=>{let a=new Map(e);return a.set(t,{file:n,content:r.content,modified:!1}),a}),window.dispatchEvent(new CustomEvent("fileContentChanged",{detail:{path:t,projectId:e}}))}catch(e){h.v.error("Failed to save file:",e)}},[n,e]);(0,l.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),i&&v(i))},[i,v]);let y=e=>{let t=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(t||""))return{type:"image",language:"plaintext"};let r={js:"javascript",mjs:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",json:"json",md:"markdown",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"};return r[t||""]?{type:"text",language:r[t||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(t||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},w=e=>y(e).language,j=i?n.get(i):null;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aE,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),r?(0,s.jsxs)("button",{type:"button",onClick:r,"aria-label":"Hide code editor",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aE,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(aE,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),j?.modified&&"text"===y(j.file.path).type&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>v(i),children:[(0,s.jsx)(aM,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===n.size?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(x,{className:"h-12 w-12 mx-auto opacity-50"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,s.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"border-b bg-muted/70",children:(0,s.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(n.entries()).map(([e,t])=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",i===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>o(e),children:[(0,s.jsxs)("span",{className:"text-sm",children:[t.file.name,t.modified&&(0,s.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>f(e,t),children:(0,s.jsx)(k.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),j&&(0,s.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=y(j.file.path);return"image"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,s.jsx)(b,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name})]}),(0,s.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,s.jsx)("img",{src:`data:image/${j.file.path.split(".").pop()};base64,${j.content}`,alt:j.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let t=e.target;if(t.style.display="none",!t.parentElement?.querySelector(".error-msg")){let e=document.createElement("div");e.className="error-msg text-sm text-muted-foreground flex items-center gap-2",e.innerHTML='Unable to display image',t.parentElement?.appendChild(e)}}})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)(aP.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:"This file type is not supported for editing in the text editor. Binary files and certain document formats cannot be displayed here."})]})]})}):(0,s.jsx)(aS,{height:"100%",language:w(j.file.path),value:j.content,onChange:e=>g(e,j.file.path),theme:u?"dark"===c?"vs-dark":"light":"vs-dark",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",wrappingIndent:"indent"}})})()})]})]})}function aT(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var aI=r(28559);let aA=(0,v.A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),aR=(0,v.A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),aL=(0,v.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var az=r(3589),aO=r(99526);function aF(){let[e,t]=(0,l.useState)(()=>r4.s.getCostSettings()),r=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:r}}var aq=r(10158);class aB{async initDB(){if(!this.isInitialized)return new Promise((e,t)=>{let r=indexedDB.open(this.dbName,1);r.onerror=()=>{h.v.error("Failed to open conversation database"),t(r.error)},r.onsuccess=()=>{this.db=r.result,this.isInitialized=!0,e()},r.onupgradeneeded=e=>{let t=e.target.result;if(!t.objectStoreNames.contains(this.storeName)){let e=t.createObjectStore(this.storeName,{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("lastUpdated","lastUpdated",{unique:!1})}}})}getConversationId(e){return`conv_${e}`}async loadConversationFromDB(e){if(await this.initDB(),!this.db)return null;let t=this.getConversationId(e);return new Promise((r,n)=>{let a=this.db.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let t=a.result;if(t){let n={id:t.id,projectId:t.projectId,messages:t.messages||[],lastUpdated:t.lastUpdated,version:t.version||1};this.conversationBreaks.set(e,t.breaks||[]),r(n)}else r(null)},a.onerror=()=>{h.v.error("Failed to load conversation from DB"),n(a.error)}})}async saveConversationToDB(e){if(await this.initDB(),!this.db)return;let t=this.conversationBreaks.get(e.projectId)||[],r={id:e.id,projectId:e.projectId,messages:e.messages,lastUpdated:e.lastUpdated,version:e.version,breaks:t};return new Promise((e,t)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to save conversation to DB"),t(n.error)}})}async deleteConversationFromDB(e){if(await this.initDB(),!this.db)return;let t=this.getConversationId(e);return new Promise((e,r)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to delete conversation from DB"),r(n.error)}})}async getConversation(e){let t=this.conversations.get(e);if(!t){let r=await this.loadConversationFromDB(e);t=r||{id:this.getConversationId(e),projectId:e,messages:[],lastUpdated:new Date().toISOString(),version:1},this.conversations.set(e,t)}return t}async updateConversation(e,t){let r=await this.getConversation(e);r.messages=[...t],r.lastUpdated=new Date().toISOString(),r.version+=1,this.conversations.set(e,r),await this.saveConversationToDB(r),h.v.debug(`[ConversationState] Updated conversation for project ${e} with ${t.length} messages`)}async clearConversation(e){let t=await this.getConversation(e);await this.recordConversationBreak(e,{type:"clear",timestamp:new Date().toISOString(),description:"User cleared chat"}),t.messages=[],t.lastUpdated=new Date().toISOString(),t.version+=1,this.conversations.set(e,t),await this.saveConversationToDB(t),h.v.debug(`[ConversationState] Cleared conversation for project ${e}`)}async recordConversationBreak(e,t){let r=this.conversationBreaks.get(e)||[];r.push(t),r.length>20&&(r=r.slice(-20)),this.conversationBreaks.set(e,r);let n=this.conversations.get(e);n&&await this.saveConversationToDB(n),h.v.debug(`[ConversationState] Recorded conversation break for project ${e}:`,t.type)}getRecentBreaks(e,t=5){return(this.conversationBreaks.get(e)||[]).slice(-t)}async addBreakContextMessage(e,t){let r,n=await this.getConversation(e);switch(t.type){case"checkpoint_restore":r=`[Context: Project was restored to checkpoint "${t.description||"previous state"}" at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"retry":r=`[Context: Retrying previous request after restoring to checkpoint at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"page_refresh":r=`[Context: Session resumed after page refresh at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"manual_save":r=`[Context: Project saved manually at ${new Date(t.timestamp).toLocaleTimeString()}${t.description?` (${t.description})`:""}]`;break;default:return}let a={role:"system",content:r};n.messages.push(a),await this.updateConversation(e,n.messages)}async getConversationMessages(e,t){let r=await this.getConversation(e);if(!t||r.messages.length<=t)return[...r.messages];let n=[...r.messages],a=n.filter(e=>"system"===e.role),i=n.filter(e=>"system"!==e.role).slice(-(t-a.length));return[...a,...i]}async deleteProject(e){this.conversations.delete(e),this.conversationBreaks.delete(e),await this.deleteConversationFromDB(e),h.v.debug(`[ConversationState] Deleted all conversation data for project ${e}`)}async getConversationStats(e){let t=await this.getConversation(e),r=this.conversationBreaks.get(e)||[];return{messageCount:t.messages.length,lastUpdated:t.lastUpdated,breaks:r.length,version:t.version}}constructor(){this.conversations=new Map,this.conversationBreaks=new Map,this.dbName="DeepStudioConversations",this.storeName="conversations",this.db=null,this.isInitialized=!1}}let a_=new aB;class a${static convertToOrchestratorMessages(e){let t=[];for(let r of e)if(!r.isTask){if("user"===r.role)t.push({role:"user",content:r.content||""});else if("assistant"===r.role){let e={role:"assistant",content:r.content||""};if(r.toolCalls&&r.toolCalls.length>0&&(e.tool_calls=r.toolCalls),r.toolMessages&&!e.tool_calls){let t=[];for(let e of r.toolMessages)"tool"===e.type&&e.name&&t.push({id:e.id||`tool_${t.length}`,type:"function",function:{name:e.name,arguments:JSON.stringify(e.parameters||{})}});t.length>0&&(e.tool_calls=t)}if((r.checkpointId||r.cost||r.usage||r.toolMessages)&&(e.ui_metadata={},r.checkpointId&&(e.ui_metadata.checkpointId=r.checkpointId),r.cost&&(e.ui_metadata.cost=r.cost),r.usage&&(e.ui_metadata.usage=r.usage),r.toolMessages&&(e.ui_metadata.toolMessages=r.toolMessages)),r.toolMessages){let t=r.toolMessages,n=[];for(let e of t)"message"===e.type&&e.content&&n.push(e.content);if(n.length>0){let t=[e.content,...n].filter(e=>e&&e.trim()).join("\n\n");e.content=t}}if(t.push(e),r.toolMessages){let e=r.toolMessages;for(let r=0;r`${e}_recovered_${r++}`;for(let r=0;r0&&(i.toolCalls=e)}if(!i.toolMessages&&a.tool_calls&&a.tool_calls.length>0){let t=[];for(let i of(a.content&&a.content.trim()&&t.push({id:n("msg"),type:"message",content:a.content}),a.tool_calls)){let a=i.id||n("tool"),o={};if(i.function?.arguments)try{o=JSON.parse(i.function.arguments)}catch{o={arguments:i.function.arguments}}let s=null;for(let t=r+1;t0&&(i.toolMessages=t),i.toolCalls=a.tool_calls}t.push(i)}}}return h.v.debug(`[ConversationConverter] Converted ${e.length} orchestrator messages to ${t.length} UI messages`),t}static truncateConversation(e,t=50){if(e.length<=t)return e;let r=e.filter(e=>"system"===e.role),n=e.filter(e=>"system"!==e.role),a=t-r.length;return a<=0?r:[...r,...n.slice(-a)]}static createContextMessage(e,t){return{role:"system",content:`[Context: ${t}]`}}static prepareConversationForOrchestrator(e,t={}){let r=this.convertToOrchestratorMessages(e);return t.includeSystemPrompt&&t.systemPrompt&&(r.some(e=>"system"===e.role)||r.unshift({role:"system",content:t.systemPrompt})),t.maxMessages&&(r=this.truncateConversation(r,t.maxMessages)),h.v.debug(`[ConversationConverter] Prepared ${r.length} messages for orchestrator`),r}}var aU=r(57462);let aH=(0,v.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),aV=(0,l.createContext)(null);aV.displayName="PanelGroupContext";let aW={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},aG=c["useId".toString()],aK="function"==typeof aG?aG:()=>null,aY=0;function aJ(e=null){let t=aK(),r=(0,l.useRef)(e||t||null);return null===r.current&&(r.current=""+aY++),null!=e?e:r.current}function aX({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:o,maxSize:s,minSize:c,onCollapse:u,onExpand:d,onResize:p,order:h,style:m,tagName:f="div",...g}){let v=(0,l.useContext)(aV);if(null===v)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:x,expandPanel:y,getPanelSize:b,getPanelStyle:w,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:N,registerPanel:C,resizePanel:S,unregisterPanel:E}=v,M=aJ(o),P=(0,l.useRef)({callbacks:{onCollapse:u,onExpand:d,onResize:p},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:c},id:M,idIsFromProps:void 0!==o,order:h});(0,l.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,l.useImperativeHandle)(i,()=>({collapse:()=>{x(P.current)},expand:e=>{y(P.current,e)},getId:()=>M,getSize:()=>b(P.current),isCollapsed:()=>j(P.current),isExpanded:()=>!j(P.current),resize:e=>{S(P.current,e)}}),[x,y,b,j,M,S]);let D=w(P.current,a);return(0,l.createElement)(f,{...g,children:e,className:t,id:M,style:{...D,...m},[aW.groupId]:k,[aW.panel]:"",[aW.panelCollapsible]:n||void 0,[aW.panelId]:M,[aW.panelSize]:parseFloat(""+D.flexGrow).toFixed(1)})}let aZ=(0,l.forwardRef)((e,t)=>(0,l.createElement)(aX,{...e,forwardedRef:t}));aX.displayName="Panel",aZ.displayName="forwardRef(Panel)";let aQ=null,a0=-1,a1=null;function a2(e,t,r){var a,i,o;0;let s=function(e,t,r){let n=(t&ir)!=0,a=(t&ia)!=0,i=(t&ii)!=0,o=(t&io)!=0;!1;if(t){if(n)if(i)return"se-resize";else if(o)return"ne-resize";else return"e-resize";else if(a)if(i)return"sw-resize";else if(o)return"nw-resize";else return"w-resize";else if(i)return"s-resize";else if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,t,r);if(aQ!==s){if(aQ=s,null===a1){a1=document.createElement("style");n&&a1.setAttribute("nonce",n),document.head.appendChild(a1)}a0>=0&&(null==(o=a1.sheet)||o.removeRule(a0)),a0=null!=(a=null==(i=a1.sheet)?void 0:i.insertRule(`*{cursor: ${s} !important;}`))?a:-1}}function a3(e){return"keydown"===e.type}function a4(e){return e.type.startsWith("pointer")}function a5(e){return e.type.startsWith("mouse")}function a6(e){if(a4(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(a5(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let a8=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function a9(e){let t=e.length;for(;t--;){let r=e[t];if(ik(r,"Missing node"),function(e){let t=getComputedStyle(e);return!!("fixed"===t.position||"auto"!==t.zIndex&&("static"!==t.position||function(e){var t;let r=getComputedStyle(null!=(t=it(e))?t:e).display;return"flex"===r||"inline-flex"===r}(e))||1>+t.opacity||"transform"in t&&"none"!==t.transform||"webkitTransform"in t&&"none"!==t.webkitTransform||"mixBlendMode"in t&&"normal"!==t.mixBlendMode||"filter"in t&&"none"!==t.filter||"webkitFilter"in t&&"none"!==t.webkitFilter||"isolation"in t&&"isolate"===t.isolation||a8.test(t.willChange))||"touch"===t.webkitOverflowScrolling}(r))return r}return null}function a7(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ie(e){let t=[];for(;e;)t.push(e),e=it(e);return t}function it(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let ir=1,ia=2,ii=4,io=8,is="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),il=[],ic=!1,iu=new Map,id=new Map,ip=new Set;function ih(e){let{target:t}=e,{x:r,y:n}=a6(e);ic=!0,ix({target:t,x:r,y:n}),ib(),il.length>0&&(iw("down",e),iy(),e.preventDefault(),iv(t)||e.stopImmediatePropagation())}function im(e){let{x:t,y:r}=a6(e);if(ic&&0===e.buttons&&(ic=!1,iw("up",e)),!ic){let{target:n}=e;ix({target:n,x:t,y:r})}iw("move",e),iy(),il.length>0&&e.preventDefault()}function ig(e){let{target:t}=e,{x:r,y:n}=a6(e);id.clear(),ic=!1,il.length>0&&(e.preventDefault(),iv(t)||e.stopImmediatePropagation()),iw("up",e),ix({target:t,x:r,y:n}),iy(),ib()}function iv(e){let t=e;for(;t;){if(t.hasAttribute(aW.resizeHandle))return!0;t=t.parentElement}return!1}function ix({target:e,x:t,y:r}){il.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),ip.forEach(e=>{let{element:a,hitAreaMargins:i}=e,o=a.getBoundingClientRect(),{bottom:s,left:l,right:c,top:u}=o,d=is?i.coarse:i.fine;if(t>=l-d&&t<=c+d&&r>=u-d&&r<=s+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:ie(e),b:ie(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;ik(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:a7(a9(n.a)),b:a7(a9(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e&&!e.contains(a);){var p,h;if(p=e.getBoundingClientRect(),h=o,p.xh.x&&p.yh.y){t=!0;break}e=e.parentElement}if(t)return}il.push(e)}})}function iy(){let e=!1,t=!1;il.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;id.forEach(e=>{r|=e}),e&&t?a2("intersection",r,ic):e?a2("horizontal",r,ic):t?a2("vertical",r,ic):null!==a1&&(document.head.removeChild(a1),aQ=null,a1=null,a0=-1)}function ib(){var e;null==(e=a)||e.abort();let t={capture:!0,signal:(a=new AbortController).signal};ip.size&&(ic?(il.length>0&&iu.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("contextmenu",ig,t),n.addEventListener("pointerleave",im,t),n.addEventListener("pointermove",im,t))}),iu.forEach((e,r)=>{let{body:n}=r;n.addEventListener("pointerup",ig,t),n.addEventListener("pointercancel",ig,t)})):iu.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("pointerdown",ih,t),n.addEventListener("pointermove",im,t))}))}function iw(e,t){ip.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,il.includes(r),t)})}function ik(e,t){if(!e)throw console.error(t),Error(t)}function ij(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function iN(e,t,r=10){return 0===ij(e,t,r)}function iC(e,t,r){return 0===ij(e,t,r)}function iS({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];ik(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:o=100,minSize:s=0}=n;return 0>ij(r,s)&&(r=i&&0>ij(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(o,r)).toFixed(10))}function iE({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(iC(e,0))return t;let o=[...t],[s,l]=n;ik(null!=s,"Invalid first pivot index"),ik(null!=l,"Invalid second pivot index");let c=0;if("keyboard"===i){{let n=e<0?l:s,a=r[n];ik(a,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(ik(null!=r,`Previous layout not found for panel index ${n}`),iC(r,i)){let t=c-r;ij(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];ik(a,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(ik(null!=r,`Previous layout not found for panel index ${n}`),iC(r,c)){let t=r-i;ij(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,i=0;for(;;){let e=t[a];if(ik(null!=e,`Previous layout not found for panel index ${a}`),i+=iS({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let n=e<0?s:l;for(;n>=0&&n=0))break;e<0?n--:n++}}if(function(e,t,r){if(e.length!==t.length)return!1;for(let r=0;r=0&&n0?n--:n++}}}return iC(o.reduce((e,t)=>t+e,0),100)?o:a}function iM(e,t=document){return Array.from(t.querySelectorAll(`[${aW.resizeHandleId}][data-panel-group-id="${e}"]`))}function iP(e,t,r=document){let n=iM(e,r).findIndex(e=>e.getAttribute(aW.resizeHandleId)===t);return null!=n?n:null}function iD(e,t,r){let n=iP(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function iT(e,t=document){if((t instanceof HTMLElement||"object"==typeof t&&null!==t&&"tagName"in t&&"getAttribute"in t)&&t.dataset.panelGroupId==e)return t;let r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function iI(e,t=document){let r=t.querySelector(`[${aW.resizeHandleId}="${e}"]`);return r||null}function iA(e,t){let{x:r,y:n}=a6(t);return"horizontal"===e?r:n}function iR(e,t,r){t.forEach((t,n)=>{let a=e[n];ik(a,`Panel data not found for index ${n}`);let{callbacks:i,constraints:o,id:s}=a,{collapsedSize:l=0,collapsible:c}=o,u=r[s];if(null==u||t!==u){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=i;a&&a(t,u),c&&(e||n)&&(n&&(null==u||iN(u,l))&&!iN(t,l)&&n(),e&&(null==u||!iN(u,l))&&iN(t,l)&&e())}})}function iL(e,t){if(e.length!==t.length)return!1;for(let r=0;rlocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function iO(e){return`react-resizable-panels:${e}`}function iF(e,t,r,n,a){var i;let o=iO(e),s=t.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),l=null!=(i=function(e,t){try{let r=iO(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,a))?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(o,JSON.stringify(l))}catch(e){console.error(e)}}let iq={getItem:e=>(iz(iq),iq.getItem(e)),setItem:(e,t)=>{iz(iq),iq.setItem(e,t)}},iB={};function i_({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=iq,style:u,tagName:d="div",...p}){let h=aJ(i),m=(0,l.useRef)(null),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)([]),y=function(){let[e,t]=(0,l.useState)(0);return(0,l.useCallback)(()=>t(e=>e+1),[])}(),b=(0,l.useRef)({}),w=(0,l.useRef)(new Map),k=(0,l.useRef)(0),j=(0,l.useRef)({autoSaveId:e,direction:n,dragState:f,id:h,keyboardResizeBy:s,onLayout:o,storage:c}),N=(0,l.useRef)({layout:v,panelDataArray:[],panelDataArrayChanged:!1});(0,l.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,l.useImperativeHandle)(a,()=>({getId:()=>j.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current,a=function({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!iC(n,100)&&r.length>0)for(let e=0;ee.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{if(!i)return;let e=t.current;ik(e,"Eager values not found");let{panelDataArray:a}=e;ik(null!=iT(r,i),`No group found for id "${r}"`);let s=iM(r,i);ik(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(aW.resizeHandleId);ik(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,i,o,s;let l=iI(t,n),c=iM(e,n),u=l?c.indexOf(l):-1;return[null!=(a=null==(i=r[u])?void 0:i.id)?a:null,null!=(o=null==(s=r[u+1])?void 0:s.id)?o:null]}(r,t,a,i);if(null==s||null==l)return()=>{};let c=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];ik(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(null!=s&&u){let e=iE({delta:iC(s,c)?d-c:c-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:iD(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&o(e)}}}};return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,a,o])}({committedValuesRef:j,eagerValuesRef:N,groupId:h,layout:v,panelDataArray:N.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),(0,l.useEffect)(()=>{let{panelDataArray:t}=N.current;if(e){if(0===v.length||v.length!==t.length)return;let r=iB[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(iF,100),iB[e]=r),r(e,[...t],new Map(w.current),v,c)}},[e,v,c]),(0,l.useEffect)(()=>{});let C=(0,l.useCallback)(e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:o,pivotIndices:s}=iH(n,e,r);if(ik(null!=o,`Panel size not found for panel "${e.id}"`),!iN(o,i)){w.current.set(e.id,o);let l=iE({delta:iU(n,e)===n.length-1?o-i:i-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});iL(r,l)||(x(l),N.current.layout=l,t&&t(l),iR(n,l,b.current))}}},[]),S=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current;if(e.constraints.collapsible){let i=a.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:l=0,pivotIndices:c}=iH(a,e,n),u=null!=t?t:l;if(iN(s,o)){let t=w.current.get(e.id),o=null!=t&&t>=u?t:u,l=iE({delta:iU(a,e)===a.length-1?s-o:o-s,initialLayout:n,panelConstraints:i,pivotIndices:c,prevLayout:n,trigger:"imperative-api"});iL(n,l)||(x(l),N.current.layout=l,r&&r(l),iR(a,l,b.current))}}},[]),E=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{panelSize:n}=iH(r,e,t);return ik(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),M=(0,l.useCallback)((e,t)=>{let{panelDataArray:r}=N.current,n=iU(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){let o,s=r[a];return{flexBasis:0,flexGrow:null==s?void 0!=e?e.toFixed(i):"1":1===n.length?"1":s.toFixed(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:f,layout:v,panelData:r,panelIndex:n})},[f,v]),P=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=iH(r,e,t);return ik(null!=i,`Panel size not found for panel "${e.id}"`),!0===a&&iN(i,n)},[]),D=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=iH(r,e,t);return ik(null!=i,`Panel size not found for panel "${e.id}"`),!a||ij(i,n)>0},[]),T=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),N.current.panelDataArrayChanged=!0,y()},[y]),I=(0,l.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let i=m.current;if(!i)return()=>null;let{direction:o,dragState:s,id:l,keyboardResizeBy:c,onLayout:u}=j.current,{layout:d,panelDataArray:p}=N.current,{initialLayout:h}=null!=s?s:{},f=iD(l,e,i),g=function(e,t,r,n,a,i){if(a3(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,a){let i="horizontal"===r,o=iI(t,a);ik(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(aW.groupId);ik(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,c=iA(r,e),u=iT(s,a);ik(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect();return(c-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(r,e,o,s,c,i),v="horizontal"===o;v&&t&&(g=-g);let y=iE({delta:g,initialLayout:null!=h?h:d,panelConstraints:p.map(e=>e.constraints),pivotIndices:f,prevLayout:d,trigger:a3(r)?"keyboard":"mouse-or-touch"}),w=!iL(d,y);(a4(r)||a5(r))&&k.current!=g&&((k.current=g,w||0===g)?id.set(e,0):v?(n=g<0?ir:ia,id.set(e,n)):(a=g<0?ii:io,id.set(e,a))),w&&(x(y),N.current.layout=y,u&&u(y),iR(p,y,b.current))}},[]),A=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current,i=a.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=iH(a,e,n);ik(null!=o,`Panel size not found for panel "${e.id}"`);let l=iE({delta:iU(a,e)===a.length-1?o-t:t-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});iL(n,l)||(x(l),N.current.layout=l,r&&r(l),iR(a,l,b.current))},[]),R=(0,l.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=N.current,{collapsedSize:a=0,collapsible:i}=t,{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:c=0}=e.constraints,{panelSize:u}=iH(n,e,r);null!=u&&(i&&s&&iN(u,a)?iN(a,o)||A(e,o):ul&&A(e,l))},[A]),L=(0,l.useCallback)((e,t)=>{let{direction:r}=j.current,{layout:n}=N.current;if(!m.current)return;let a=iI(e,m.current);ik(a,`Drag handle element not found for id "${e}"`);let i=iA(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),z=(0,l.useCallback)(()=>{g(null)},[]),O=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current,r=iU(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],N.current.panelDataArrayChanged=!0,y())},[y]),F=(0,l.useMemo)(()=>({collapsePanel:C,direction:n,dragState:f,expandPanel:S,getPanelSize:E,getPanelStyle:M,groupId:h,isPanelCollapsed:P,isPanelExpanded:D,reevaluatePanelConstraints:R,registerPanel:T,registerResizeHandle:I,resizePanel:A,startDragging:L,stopDragging:z,unregisterPanel:O,panelGroupElement:m.current}),[C,f,n,S,E,M,h,P,D,R,T,I,A,L,z,O]);return(0,l.createElement)(aV.Provider,{value:F},(0,l.createElement)(d,{...p,children:t,className:r,id:i,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},[aW.group]:"",[aW.groupDirection]:n,[aW.groupId]:h}))}let i$=(0,l.forwardRef)((e,t)=>(0,l.createElement)(i_,{...e,forwardedRef:t}));function iU(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function iH(e,t,r){let n=iU(e,t),a=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:a?[n-1,n]:[n,n+1]}}function iV({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:i,onClick:o,onDragging:s,onFocus:c,onPointerDown:u,onPointerUp:d,style:p={},tabIndex:h=0,tagName:m="div",...f}){var g,v;let x=(0,l.useRef)(null),y=(0,l.useRef)({onClick:o,onDragging:s,onPointerDown:u,onPointerUp:d});(0,l.useEffect)(()=>{y.current.onClick=o,y.current.onDragging=s,y.current.onPointerDown=u,y.current.onPointerUp=d});let b=(0,l.useContext)(aV);if(null===b)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:k,registerResizeHandle:j,startDragging:N,stopDragging:C,panelGroupElement:S}=b,E=aJ(a),[M,P]=(0,l.useState)("inactive"),[D,T]=(0,l.useState)(!1),[I,A]=(0,l.useState)(null),R=(0,l.useRef)({state:M});(0,l.useEffect)(()=>{if(r)A(null);else{let e=j(E);A(()=>e)}},[r,E,j]);let L=null!=(g=null==n?void 0:n.coarse)?g:15,z=null!=(v=null==n?void 0:n.fine)?v:5;return(0,l.useEffect)(()=>{if(r||null==I)return;let e=x.current;ik(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var i;let{ownerDocument:o}=t,s={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},l=null!=(i=iu.get(o))?i:0;return iu.set(o,l+1),ip.add(s),ib(),function(){var t;id.delete(e),ip.delete(s);let r=null!=(t=iu.get(o))?t:1;if(iu.set(o,r-1),ib(),1===r&&iu.delete(o),il.includes(s)){let e=il.indexOf(s);e>=0&&il.splice(e,1),iy(),a("up",!0,null)}}}(E,e,w,{coarse:L,fine:z},(e,r,n)=>{if(!r)return void P("inactive");switch(e){case"down":{P("drag"),t=!1,ik(n,'Expected event to be defined for "down" action'),N(E,n);let{onDragging:e,onPointerDown:r}=y.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=R.current;t=!0,"drag"!==e&&P("hover"),ik(n,'Expected event to be defined for "move" action'),I(n);break}case"up":{P("hover"),C();let{onClick:e,onDragging:r,onPointerUp:n}=y.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[L,w,r,z,j,E,I,N,C]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,l.useEffect)(()=>{if(e||null==r||null==n)return;let a=iI(t,n);if(null==a)return;let i=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(aW.groupId);ik(r,`No group element found for id "${r}"`);let i=iM(r,n),o=iP(r,t,n);ik(null!==o,`No resize element found for id "${t}"`);let s=e.shiftKey?o>0?o-1:i.length-1:o+1{a.removeEventListener("keydown",i)}},[n,e,t,r])}({disabled:r,handleId:E,resizeHandler:I,panelGroupElement:S}),(0,l.createElement)(m,{...f,children:e,className:t,id:a,onBlur:()=>{T(!1),null==i||i()},onFocus:()=>{T(!0),null==c||c()},ref:x,role:"separator",style:{touchAction:"none",userSelect:"none",...p},tabIndex:h,[aW.groupDirection]:w,[aW.groupId]:k,[aW.resizeHandle]:"",[aW.resizeHandleActive]:"drag"===M?"pointer":D?"keyboard":void 0,[aW.resizeHandleEnabled]:!r,[aW.resizeHandleId]:E,[aW.resizeHandleState]:M})}i_.displayName="PanelGroup",i$.displayName="forwardRef(PanelGroup)",iV.displayName="PanelResizeHandle";let iW=({className:e,...t})=>(0,s.jsx)(i$,{className:(0,h.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),iG=({withHandle:e,className:t,...r})=>(0,s.jsx)(iV,{className:(0,h.cn)("group relative flex w-2 mx-1 items-center justify-center bg-transparent hover:bg-border/50 transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-2 data-[panel-group-direction=vertical]:my-1 data-[panel-group-direction=vertical]:mx-0 data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 cursor-col-resize data-[panel-group-direction=vertical]:cursor-row-resize",t),...r,children:e&&(0,s.jsx)("div",{className:"z-10 flex h-12 w-1 items-center justify-center rounded-full bg-border/30 hover:bg-border/50 transition-colors opacity-0 group-hover:opacity-100",children:(0,s.jsx)(aH,{className:"h-3 w-3 text-muted-foreground/50"})})});var iK=r(69024),[iY,iJ]=(0,J.A)("Tooltip",[ei.Bk]),iX=(0,ei.Bk)(),iZ="TooltipProvider",iQ="tooltip.open",[i0,i1]=iY(iZ),i2=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=l.useRef(!0),c=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,s.jsx)(i0,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};i2.displayName=iZ;var i3="Tooltip",[i4,i5]=iY(i3),i6=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,u=i1(i3,e.__scopeTooltip),d=iX(t),[p,h]=l.useState(null),m=(0,ea.B)(),f=l.useRef(0),g=o??u.disableHoverableContent,v=c??u.delayDuration,x=l.useRef(!1),[y,b]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(iQ))):u.onClose(),i?.(e)},caller:i3}),w=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),j=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),N=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},v)},[v,b]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,s.jsx)(ei.bL,{...d,children:(0,s.jsx)(i4,{scope:t,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:l.useCallback(()=>{g?j():(window.clearTimeout(f.current),f.current=0)},[j,g]),onOpen:k,onClose:j,disableHoverableContent:g,children:r})})};i6.displayName=i3;var i8="TooltipTrigger",i9=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=i5(i8,r),i=i1(i8,r),o=iX(r),c=l.useRef(null),u=(0,Y.s)(t,c,a.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),(0,s.jsx)(ei.Mz,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:(0,K.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(p.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),p.current=!0))}),onPointerLeave:(0,K.mK)(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:(0,K.mK)(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:(0,K.mK)(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:(0,K.mK)(e.onBlur,a.onClose),onClick:(0,K.mK)(e.onClick,a.onClose)})})});i9.displayName=i8;var i7="TooltipPortal",[oe,ot]=iY(i7,{forceMount:void 0}),or=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=i5(i7,t);return(0,s.jsx)(oe,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};or.displayName=i7;var on="TooltipContent",oa=l.forwardRef((e,t)=>{let r=ot(on,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=i5(on,e.__scopeTooltip);return(0,s.jsx)(es.C,{present:n||o.open,children:o.disableHoverableContent?(0,s.jsx)(oc,{side:a,...i,ref:t}):(0,s.jsx)(oi,{side:a,...i,ref:t})})}),oi=l.forwardRef((e,t)=>{let r=i5(on,e.__scopeTooltip),n=i1(on,e.__scopeTooltip),a=l.useRef(null),i=(0,Y.s)(t,a),[o,c]=l.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:h}=n,m=l.useCallback(()=>{c(null),h(!1)},[h]),f=l.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());c(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,a),...function(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}(t.getBoundingClientRect())])),h(!0)},[h]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){let e=e=>f(e,p),t=e=>f(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,f,m]),l.useEffect(()=>{if(o){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||p?.contains(t),a=!function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}(r,o);n?m():a&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,o,d,m]),(0,s.jsx)(oc,{...e,ref:i})}),[oo,os]=iY(i3,{isInside:!1}),ol=(0,eC.Dc)("TooltipContent"),oc=l.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,u=i5(on,r),d=iX(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(iQ,p),()=>document.removeEventListener(iQ,p)),[p]),l.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,s.jsxs)(ei.UC,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,s.jsx)(ol,{children:n}),(0,s.jsx)(oo,{scope:r,isInside:!0,children:(0,s.jsx)(iK.bL,{id:u.contentId,role:"tooltip",children:a||n})})]})})});oa.displayName=on;var ou="TooltipArrow",od=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=iX(r);return os(ou,r).isInside?null:(0,s.jsx)(ei.i3,{...a,...n,ref:t})});function op({delayDuration:e=0,...t}){return(0,s.jsx)(i2,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function oh({...e}){return(0,s.jsx)(op,{children:(0,s.jsx)(i6,{"data-slot":"tooltip",...e})})}function om({...e}){return(0,s.jsx)(i9,{"data-slot":"tooltip-trigger",...e})}function of({className:e,sideOffset:t=0,children:r,arrowStyle:n,...a}){return(0,s.jsx)(or,{children:(0,s.jsxs)(oa,{"data-slot":"tooltip-content",sideOffset:t,className:(0,h.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[r,(0,s.jsx)(od,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:n})]})})}od.displayName=ou;var og=r(48730);let ov={pending:(0,s.jsx)(og.A,{className:"h-4 w-4 text-muted-foreground"}),in_progress:(0,s.jsx)(nx.A,{className:"h-4 w-4 text-blue-500 animate-spin"}),success:(0,s.jsx)(w.A,{className:"h-4 w-4 text-green-500"}),failed:(0,s.jsx)(k.A,{className:"h-4 w-4 text-red-500"}),skipped:(0,s.jsx)("span",{className:"text-muted-foreground",children:"⊘"})},ox={pending:"text-muted-foreground",in_progress:"text-blue-500",success:"text-green-500",failed:"text-red-500",skipped:"text-gray-400"};function oy({title:e,steps:t,checkpointId:r,onRestore:n,isSavedCheckpoint:a,expanded:i=!0,onToggleExpand:o}){let l=t.filter(e=>"success"===e.status).length,c=t.filter(e=>"failed"===e.status).length,u=t.some(e=>"in_progress"===e.status),d=t.every(e=>"pending"!==e.status&&"in_progress"!==e.status),p=r&&d?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(rO.E,{variant:a?"default":"outline",className:"h-6 px-2 text-xs",children:a?"Saved version":"Checkpoint"}),n&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>n(r),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aA,{className:"h-3 w-3 mr-1"}),"Restore"]})]}):null;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 flex-1",children:[(0,s.jsx)("button",{onClick:o,className:"mt-0.5 hover:bg-muted rounded p-0.5","aria-label":i?"Collapse":"Expand",children:i?(0,s.jsx)(nk.A,{className:"h-4 w-4"}):(0,s.jsx)(tJ,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e}),u&&(0,s.jsx)("span",{className:"text-xs text-blue-500 animate-pulse",children:"In Progress..."}),d&&(0,s.jsx)("span",{className:(0,h.cn)("text-xs",0===c?"text-green-500":"text-orange-500"),children:0===c?"✓ Complete":`⚠ ${l}/${t.length} succeeded`})]}),!i&&t.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(w.A,{className:"h-3 w-3 text-green-500"}),l]}),c>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(k.A,{className:"h-3 w-3 text-red-500"}),c]}),(0,s.jsxs)("span",{children:[t.length," total"]})]})]})]})}),i&&t.length>0&&(0,s.jsx)("div",{className:"ml-6 space-y-1 text-sm",children:t.map(e=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-start gap-2 py-1",ox[e.status]),children:[(0,s.jsx)("span",{className:"mt-0.5",children:ov[e.status]}),(0,s.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,s.jsx)("div",{children:e.description}),e.error&&(0,s.jsxs)("div",{className:"text-xs text-red-400 ml-6",children:["Error: ",e.error]})]})]},e.id))}),p&&(0,s.jsx)("div",{className:"ml-6",children:p})]})}var ob=r(5336),ow=r(35071);let ok=(0,v.A)("iteration-cw",[["path",{d:"M4 10a8 8 0 1 1 8 8H4",key:"svv66n"}],["path",{d:"m8 22-4-4 4-4",key:"6g7gki"}]]);var oj=r(45583);let oN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oS={};function oE(e,t){return((t||oS).jsx?oC:oN).test(e)}let oM=/[ \t\n\f\r]/g;function oP(e){return""===e.replace(oM,"")}class oD{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}function oT(e,t){let r={},n={};for(let t of e)Object.assign(r,t.property),Object.assign(n,t.normal);return new oD(r,n,t)}function oI(e){return e.toLowerCase()}oD.prototype.normal={},oD.prototype.property={},oD.prototype.space=void 0;class oA{constructor(e,t){this.attribute=t,this.property=e}}oA.prototype.attribute="",oA.prototype.booleanish=!1,oA.prototype.boolean=!1,oA.prototype.commaOrSpaceSeparated=!1,oA.prototype.commaSeparated=!1,oA.prototype.defined=!1,oA.prototype.mustUseProperty=!1,oA.prototype.number=!1,oA.prototype.overloadedBoolean=!1,oA.prototype.property="",oA.prototype.spaceSeparated=!1,oA.prototype.space=void 0;let oR=0,oL=o$(),oz=o$(),oO=o$(),oF=o$(),oq=o$(),oB=o$(),o_=o$();function o$(){return 2**++oR}let oU=Object.keys(i);class oH extends oA{constructor(e,t,r,n){let a=-1;if(super(e,t),function(e,t,r){r&&(e[t]=r)}(this,"space",n),"number"==typeof r)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function oG(e,t){return t in e?e[t]:t}function oK(e,t){return oG(e,t.toLowerCase())}let oY=oV({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oB,acceptCharset:oq,accessKey:oq,action:null,allow:null,allowFullScreen:oL,allowPaymentRequest:oL,allowUserMedia:oL,alt:null,as:null,async:oL,autoCapitalize:null,autoComplete:oq,autoFocus:oL,autoPlay:oL,blocking:oq,capture:null,charSet:null,checked:oL,cite:null,className:oq,cols:oF,colSpan:null,content:null,contentEditable:oz,controls:oL,controlsList:oq,coords:oF|oB,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oL,defer:oL,dir:null,dirName:null,disabled:oL,download:oO,draggable:oz,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oL,formTarget:null,headers:oq,height:oF,hidden:oO,high:oF,href:null,hrefLang:null,htmlFor:oq,httpEquiv:oq,id:null,imageSizes:null,imageSrcSet:null,inert:oL,inputMode:null,integrity:null,is:null,isMap:oL,itemId:null,itemProp:oq,itemRef:oq,itemScope:oL,itemType:oq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oL,low:oF,manifest:null,max:null,maxLength:oF,media:null,method:null,min:null,minLength:oF,multiple:oL,muted:oL,name:null,nonce:null,noModule:oL,noValidate:oL,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oL,optimum:oF,pattern:null,ping:oq,placeholder:null,playsInline:oL,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oL,referrerPolicy:null,rel:oq,required:oL,reversed:oL,rows:oF,rowSpan:oF,sandbox:oq,scope:null,scoped:oL,seamless:oL,selected:oL,shadowRootClonable:oL,shadowRootDelegatesFocus:oL,shadowRootMode:null,shape:null,size:oF,sizes:null,slot:null,span:oF,spellCheck:oz,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oF,step:null,style:null,tabIndex:oF,target:null,title:null,translate:null,type:null,typeMustMatch:oL,useMap:null,value:oz,width:oF,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oq,axis:null,background:null,bgColor:null,border:oF,borderColor:null,bottomMargin:oF,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oL,declare:oL,event:null,face:null,frame:null,frameBorder:null,hSpace:oF,leftMargin:oF,link:null,longDesc:null,lowSrc:null,marginHeight:oF,marginWidth:oF,noResize:oL,noHref:oL,noShade:oL,noWrap:oL,object:null,profile:null,prompt:null,rev:null,rightMargin:oF,rules:null,scheme:null,scrolling:oz,standby:null,summary:null,text:null,topMargin:oF,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oF,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:oL,disableRemotePlayback:oL,prefix:null,property:null,results:oF,security:null,unselectable:null},space:"html",transform:oK}),oJ=oV({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:o_,accentHeight:oF,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oF,amplitude:oF,arabicForm:null,ascent:oF,attributeName:null,attributeType:null,azimuth:oF,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oF,by:null,calcMode:null,capHeight:oF,className:oq,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oF,diffuseConstant:oF,direction:null,display:null,dur:null,divisor:oF,dominantBaseline:null,download:oL,dx:null,dy:null,edgeMode:null,editable:null,elevation:oF,enableBackground:null,end:null,event:null,exponent:oF,externalResourcesRequired:null,fill:null,fillOpacity:oF,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oB,g2:oB,glyphName:oB,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oF,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oF,horizOriginX:oF,horizOriginY:oF,id:null,ideographic:oF,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oF,k:oF,k1:oF,k2:oF,k3:oF,k4:oF,kernelMatrix:o_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oF,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oF,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oF,overlineThickness:oF,paintOrder:null,panose1:null,path:null,pathLength:oF,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:oq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oF,pointsAtY:oF,pointsAtZ:oF,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:o_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:o_,rev:o_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:o_,requiredFeatures:o_,requiredFonts:o_,requiredFormats:o_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oF,specularExponent:oF,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oF,strikethroughThickness:oF,string:null,stroke:null,strokeDashArray:o_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oF,strokeOpacity:oF,strokeWidth:null,style:null,surfaceScale:oF,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:o_,tabIndex:oF,tableValues:null,target:null,targetX:oF,targetY:oF,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:o_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oF,underlineThickness:oF,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oF,values:null,vAlphabetic:oF,vMathematical:oF,vectorEffect:null,vHanging:oF,vIdeographic:oF,version:null,vertAdvY:oF,vertOriginX:oF,vertOriginY:oF,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oF,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:oG}),oX=oV({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),oZ=oV({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oK}),oQ=oV({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),o0=oT([oW,oY,oX,oZ,oQ],"html"),o1=oT([oW,oJ,oX,oZ,oQ],"svg"),o2=/[A-Z]/g,o3=/-[a-z]/g,o4=/^data[-\w.:]+$/i;function o5(e){return"-"+e.toLowerCase()}function o6(e){return e.charAt(1).toUpperCase()}let o8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var o9=r(11120);let o7=st("end"),se=st("start");function st(e){return function(t){let r=t&&t.position&&t.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function sr(e){return e&&"object"==typeof e?"position"in e||"type"in e?sa(e.position):"start"in e||"end"in e?sa(e):"line"in e||"column"in e?sn(e):"":""}function sn(e){return si(e&&e.line)+":"+si(e&&e.column)}function sa(e){return sn(e&&e.start)+"-"+sn(e&&e.end)}function si(e){return e&&"number"==typeof e?e:1}class so extends Error{constructor(e,t,r){super(),"string"==typeof t&&(r=t,t=void 0);let n="",a={},i=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?n=e:!a.cause&&e&&(i=!0,n=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof r){let e=r.indexOf(":");-1===e?a.ruleId=r:(a.source=r.slice(0,e),a.ruleId=r.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=o?o.line:void 0,this.name=sr(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}so.prototype.file="",so.prototype.name="",so.prototype.reason="",so.prototype.message="",so.prototype.stack="",so.prototype.column=void 0,so.prototype.line=void 0,so.prototype.ancestors=void 0,so.prototype.cause=void 0,so.prototype.fatal=void 0,so.prototype.place=void 0,so.prototype.ruleId=void 0,so.prototype.source=void 0;let ss={}.hasOwnProperty,sl=new Map,sc=/[A-Z]/g,su=new Set(["table","tbody","thead","tfoot","tr"]),sd=new Set(["td","th"]),sp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sh(e,t,r){var n;return"element"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.tagName.toLowerCase()&&"html"===n.space&&(e.schema=o1),e.ancestors.push(t);let i=sv(e,t.tagName,!1),o=function(e,t){let r,n,a={};for(n in t.properties)if("children"!==n&&ss.call(t.properties,n)){let i=function(e,t,r){let n=function(e,t){let r=oI(t),n=t,a=oA;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&o4.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(o3,o6);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!o3.test(e)){let r=e.replace(o2,o5);"-"!==r.charAt(0)&&(r="-"+r),t="data"+r}}a=oH}return new a(n,t)}(e.schema,t);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?function(e,t){let r={};return(""===e[e.length-1]?[...e,""]:e).join((r.padRight?" ":"")+","+(!1===r.padLeft?"":" ")).trim()}(r):r.join(" ").trim()),"style"===n.property){let t="object"==typeof r?r:function(e,t){try{return o9(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let t=new so("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=sp+"#cannot-parse-style-attribute",t}}(e,String(r));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,r={};for(t in e)ss.call(e,t)&&(r[function(e){let t=e.replace(sc,sy);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return r}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&n.space?o8[n.property]||n.property:n.attribute,r]}}(e,n,t.properties[n]);if(i){let[n,o]=i;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof o&&sd.has(t.tagName)?r=o:a[n]=o}}return r&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),a}(e,t),s=sg(e,t);return su.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&oP(e.value):oP(e))})),sm(e,o,i,t),sf(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sx(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.name&&"html"===n.space&&(e.schema=o1),e.ancestors.push(t);let i=null===t.name?e.Fragment:sv(e,t.name,!0),o=function(e,t){let r={};for(let n of t.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let t=n.data.estree.body[0];t.type;let a=t.expression;a.type;let i=a.properties[0];i.type,Object.assign(r,e.evaluater.evaluateExpression(i.argument))}else sx(e,t.position);else{let a,i=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let t=n.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else sx(e,t.position);else a=null===n.value||n.value;r[i]=a}return r}(e,t),s=sg(e,t);return sm(e,o,i,t),sf(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sx(e,t.position)}(e,t):"root"===t.type?function(e,t,r){let n={};return sf(n,sg(e,t)),e.create(t,e.Fragment,n,r)}(e,t,r):"text"===t.type?(n=0,t.value):void 0}function sm(e,t,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(t.node=n)}function sf(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function sg(e,t){let r=[],n=-1,a=e.passKeys?new Map:sl;for(;++ni?0:i+t:t>i?i:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);o0?(sN(e,e.length,0,t),e):t}class sS{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return r&&sE(this.left,r),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sE(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sE(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function sU(e,t,r,n){let a=n?n-1:Number.POSITIVE_INFINITY,i=0;return function(n){return sq(n)?(e.enter(r),function n(o){return sq(o)&&i++n))return;let s=a.events.length,l=s;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){r=a.events[l][1].end;break}e=!0}for(g(o),i=s;it;){let t=i[r];a.containerState=t[1],t[0].exit.call(a,e)}i.length=t}function v(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},sW={tokenize:function(e,t,r){return sU(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},sG={partial:!0,tokenize:function(e,t,r){return function(t){return sq(t)?sU(e,n,"linePrefix")(t):n(t)};function n(e){return null===e||sO(e)?t(e):r(e)}}},sK={resolve:function(e){return sM(e),e},tokenize:function(e,t){let r;return function(t){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(t)};function n(t){return null===t?a(t):sO(t)?e.check(sY,i,a)(t):(e.consume(t),n)}function a(r){return e.exit("chunkContent"),e.exit("content"),t(r)}function i(t){return e.consume(t),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},sY={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),sU(e,a,"linePrefix")};function a(a){if(null===a||sO(a))return r(a);let i=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}},sJ={tokenize:function(e){let t=this,r=e.attempt(sG,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,sU(e,e.attempt(this.parser.constructs.flow,n,e.attempt(sK,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r)}}},sX={resolveAll:s1()},sZ=s0("string"),sQ=s0("text");function s0(e){return{resolveAll:s1("text"===e?s2:void 0),tokenize:function(t){let r=this,n=this.parser.constructs[e],a=t.attempt(n,i,o);return i;function i(e){return l(e)?a(e):o(e)}function o(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=n[e],a=-1;if(t)for(;++a=3&&(null===o||sO(o))?(e.exit("thematicBreak"),t(o)):r(o)}(o)}}},s4={continuation:{tokenize:function(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(sG,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,sU(e,t,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!sq(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(s6,t,a)(r))});function a(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,sU(e,e.attempt(s4,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,o=0;return function(t){let a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:sR(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(s3,r,s)(t):s(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return sR(a)&&++o<10?(e.consume(a),t):(!n.interrupt||o<2)&&(n.containerState.marker?a===n.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),s(a)):r(a)}(t)}return r(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(sG,n.interrupt?r:l,e.attempt(s5,u,c))}function l(e){return n.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return sq(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):r(t)}function u(r){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}}},s5={partial:!0,tokenize:function(e,t,r){let n=this;return sU(e,function(e){let a=n.events[n.events.length-1];return!sq(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},s6={partial:!0,tokenize:function(e,t,r){let n=this;return sU(e,function(e){let a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)},"listItemIndent",n.containerState.size+1)}},s8={continuation:{tokenize:function(e,t,r){let n=this;return function(t){return sq(t)?sU(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(n){return e.attempt(s8,t,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,r){let n=this;return function(t){if(62===t){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return sq(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}}};function s9(e,t,r,n,a,i,o,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return function(t){return 60===t?(e.enter(n),e.enter(a),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||sA(t)?r(t):(e.enter(n),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function d(r){return 62===r?(e.enter(i),e.consume(r),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(r))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||sO(t)?r(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function m(a){return!u&&(null===a||41===a||sF(a))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(a)):u999||null===d||91===d||93===d&&!o||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):93===d?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(n),t):sO(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||sO(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),o||(o=!sq(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function le(e,t,r,n,a,i){let o;return function(t){return 34===t||39===t||40===t?(e.enter(n),e.enter(a),e.consume(t),e.exit(a),o=40===t?41:t,s):r(t)};function s(r){return r===o?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(i),l(r))}function l(t){return t===o?(e.exit(i),s(o)):null===t?r(t):sO(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),sU(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||sO(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function lt(e,t){let r;return function n(a){return sO(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):sq(a)?sU(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}function lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ln={partial:!0,tokenize:function(e,t,r){return function(t){return sF(t)?lt(e,n)(t):r(t)};function n(t){return le(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return sq(t)?sU(e,i,"whitespace")(t):i(t)}function i(e){return null===e||sO(e)?t(e):r(e)}}},la={name:"codeIndented",tokenize:function(e,t,r){let n=this;return function(t){return e.enter("codeIndented"),sU(e,a,"linePrefix",5)(t)};function a(t){let a=n.events[n.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(r){return null===r?i(r):sO(r)?e.attempt(li,t,i)(r):(e.enter("codeFlowValue"),function r(n){return null===n||sO(n)?(e.exit("codeFlowValue"),t(n)):(e.consume(n),r)}(r))}(t):r(t)}function i(r){return e.exit("codeIndented"),t(r)}}},li={partial:!0,tokenize:function(e,t,r){let n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):sO(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):sU(e,i,"linePrefix",5)(t)}function i(e){let i=n.events[n.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):sO(e)?a(e):r(e)}}},lo={name:"setextUnderline",resolveTo:function(e,t){let r,n,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){r=i;break}"paragraph"===e[i][1].type&&(n=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,r){let n,a=this;return function(t){var o;let s,l=a.events.length;for(;l--;)if("lineEnding"!==a.events[l][1].type&&"linePrefix"!==a.events[l][1].type&&"content"!==a.events[l][1].type){s="paragraph"===a.events[l][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),n=t,o=t,e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),sq(r)?sU(e,i,"lineSuffix")(r):i(r))}(o)):r(t)};function i(n){return null===n||sO(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}}},ls=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ll=["pre","script","style","textarea"],lc={partial:!0,tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(sG,t,r)}}},lu={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return sO(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},ld={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return null===t?r(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lp={concrete:!0,name:"codeFenced",tokenize:function(e,t,r){let n,a=this,i={partial:!0,tokenize:function(e,t,r){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),sq(t)?sU(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===n?(e.enter("codeFencedFenceSequence"),function t(a){return a===n?(i++,e.consume(a),t):i>=s?(e.exit("codeFencedFenceSequence"),sq(a)?sU(e,c,"whitespace")(a):c(a)):r(a)}(t)):r(t)}function c(n){return null===n||sO(n)?(e.exit("codeFencedFence"),t(n)):r(n)}}},o=0,s=0;return function(t){var i=t;let c=a.events[a.events.length-1];return o=c&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,n=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===n?(s++,e.consume(a),t):s<3?r(a):(e.exit("codeFencedFenceSequence"),sq(a)?sU(e,l,"whitespace")(a):l(a))}(i)};function l(i){return null===i||sO(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(ld,u,m)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||sO(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):sq(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),sU(e,c,"whitespace")(a)):96===a&&a===n?r(a):(e.consume(a),t)}(i))}function c(t){return null===t||sO(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||sO(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===n?r(a):(e.consume(a),t)}(t))}function u(t){return e.attempt(i,m,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return o>0&&sq(t)?sU(e,h,"linePrefix",o+1)(t):h(t)}function h(t){return null===t||sO(t)?e.check(ld,u,m)(t):(e.enter("codeFlowValue"),function t(r){return null===r||sO(r)?(e.exit("codeFlowValue"),h(r)):(e.consume(r),t)}(t))}function m(r){return e.exit("codeFenced"),t(r)}}},lh={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"⁡",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"⁠",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"⁡",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"��",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"⁣",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"},lm={}.hasOwnProperty;function lf(e){return!!lm.call(lh,e)&&lh[e]}let lg={name:"characterReference",tokenize:function(e,t,r){let n,a,i=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),n=31,a=sT,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=sL,c):(e.enter("characterReferenceValue"),n=7,a=sR,c(t))}function c(s){if(59===s&&o){let n=e.exit("characterReferenceValue");return a!==sT||lf(i.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)}return a(s)&&o++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},p={...e[u][1].start};lE(d,-s),lE(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},a={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:s>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},e[r][1].end={...i.start},e[u][1].start={...o.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=sC(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=sC(l,[["enter",n,t],["enter",i,t],["exit",i,t],["enter",a,t]]),l=sC(l,ly(t.parser.constructs.insideSpan.null,e.slice(r+1,u),t)),l=sC(l,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",n,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=sC(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,sN(e,r-1,u-r+3,l),u=r+l.length-c-2;break}}for(u=-1;++ui&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(i===a-1||a-4>i&&"whitespace"===e[a-2][1].type)&&(a-=i+1===a?2:4),a>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},n={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},sN(e,i,a-i+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]])),e},tokenize:function(e,t,r){let n=0;return function(a){var i;return e.enter("atxHeading"),i=a,e.enter("atxHeadingSequence"),function a(i){return 35===i&&n++<6?(e.consume(i),a):null===i||sF(i)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function t(n){return 35===n?(e.consume(n),t):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||sO(n)?(e.exit("atxHeading"),t(n)):sq(n)?sU(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function t(n){return null===n||35===n||sF(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),t)}(n))}(i)):r(i)}(i)}}},42:s3,45:[lo,s3],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,r){let n,a,i,o,s,l=this;return function(t){var r;return r=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(o){return 33===o?(e.consume(o),u):47===o?(e.consume(o),a=!0,h):63===o?(e.consume(o),n=3,l.interrupt?t:I):sD(o)?(e.consume(o),i=String.fromCharCode(o),m):r(o)}function u(a){return 45===a?(e.consume(a),n=2,d):91===a?(e.consume(a),n=5,o=0,p):sD(a)?(e.consume(a),n=4,l.interrupt?t:I):r(a)}function d(n){return 45===n?(e.consume(n),l.interrupt?t:I):r(n)}function p(n){let a="CDATA[";return n===a.charCodeAt(o++)?(e.consume(n),o===a.length)?l.interrupt?t:N:p:r(n)}function h(t){return sD(t)?(e.consume(t),i=String.fromCharCode(t),m):r(t)}function m(o){if(null===o||47===o||62===o||sF(o)){let s=47===o,c=i.toLowerCase();return!s&&!a&&ll.includes(c)?(n=1,l.interrupt?t(o):N(o)):ls.includes(i.toLowerCase())?(n=6,s)?(e.consume(o),f):l.interrupt?t(o):N(o):(n=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(o):a?function t(r){return sq(r)?(e.consume(r),t):k(r)}(o):g(o))}return 45===o||sT(o)?(e.consume(o),i+=String.fromCharCode(o),m):r(o)}function f(n){return 62===n?(e.consume(n),l.interrupt?t:N):r(n)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||sD(t)?(e.consume(t),v):sq(t)?(e.consume(t),g):k(t)}function v(t){return 45===t||46===t||58===t||95===t||sT(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),y):sq(t)?(e.consume(t),x):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),s=t,b):sq(t)?(e.consume(t),y):function t(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||sF(r)?x(r):(e.consume(r),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,w):null===t||sO(t)?r(t):(e.consume(t),b)}function w(e){return 47===e||62===e||sq(e)?g(e):r(e)}function k(t){return 62===t?(e.consume(t),j):r(t)}function j(t){return null===t||sO(t)?N(t):sq(t)?(e.consume(t),j):r(t)}function N(t){return 45===t&&2===n?(e.consume(t),M):60===t&&1===n?(e.consume(t),P):62===t&&4===n?(e.consume(t),A):63===t&&3===n?(e.consume(t),I):93===t&&5===n?(e.consume(t),T):sO(t)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(lc,R,C)(t)):null===t||sO(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(lu,S,R)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||sO(t)?C(t):(e.enter("htmlFlowData"),N(t))}function M(t){return 45===t?(e.consume(t),I):N(t)}function P(t){return 47===t?(e.consume(t),i="",D):N(t)}function D(t){if(62===t){let r=i.toLowerCase();return ll.includes(r)?(e.consume(t),A):N(t)}return sD(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),D):N(t)}function T(t){return 93===t?(e.consume(t),I):N(t)}function I(t){return 62===t?(e.consume(t),A):45===t&&2===n?(e.consume(t),I):N(t)}function A(t){return null===t||sO(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),A)}function R(r){return e.exit("htmlFlow"),t(r)}}},61:lo,95:s3,96:lp,126:lp},lA={38:lg,92:lv},lR={[-5]:lx,[-4]:lx,[-3]:lx,33:lN,38:lg,42:lS,60:[{name:"autolink",tokenize:function(e,t,r){let n=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a};function a(t){return sD(t)?(e.consume(t),i):64===t?r(t):s(t)}function i(t){return 43===t||45===t||46===t||sT(t)?(n=1,function t(r){return 58===r?(e.consume(r),n=0,o):(43===r||45===r||46===r||sT(r))&&n++<32?(e.consume(r),t):(n=0,s(r))}(t)):s(t)}function o(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):null===n||32===n||60===n||sA(n)?r(n):(e.consume(n),o)}function s(t){return 64===t?(e.consume(t),l):sI(t)?(e.consume(t),s):r(t)}function l(a){return sT(a)?function a(i){return 46===i?(e.consume(i),n=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||sT(i))&&n++<63){let r=45===i?t:a;return e.consume(i),r}return r(i)}(i)}(a):r(a)}}},{name:"htmlText",tokenize:function(e,t,r){let n,a,i,o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),x):sD(t)?(e.consume(t),k):r(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,h):sD(t)?(e.consume(t),v):r(t)}function c(t){return 45===t?(e.consume(t),p):r(t)}function u(t){return null===t?r(t):45===t?(e.consume(t),d):sO(t)?(i=u,D(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?P(e):45===e?d(e):u(e)}function h(t){let n="CDATA[";return t===n.charCodeAt(a++)?(e.consume(t),a===n.length?m:h):r(t)}function m(t){return null===t?r(t):93===t?(e.consume(t),f):sO(t)?(i=m,D(t)):(e.consume(t),m)}function f(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?P(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?P(t):sO(t)?(i=v,D(t)):(e.consume(t),v)}function x(t){return null===t?r(t):63===t?(e.consume(t),y):sO(t)?(i=x,D(t)):(e.consume(t),x)}function y(e){return 62===e?P(e):x(e)}function b(t){return sD(t)?(e.consume(t),w):r(t)}function w(t){return 45===t||sT(t)?(e.consume(t),w):function t(r){return sO(r)?(i=t,D(r)):sq(r)?(e.consume(r),t):P(r)}(t)}function k(t){return 45===t||sT(t)?(e.consume(t),k):47===t||62===t||sF(t)?j(t):r(t)}function j(t){return 47===t?(e.consume(t),P):58===t||95===t||sD(t)?(e.consume(t),N):sO(t)?(i=j,D(t)):sq(t)?(e.consume(t),j):P(t)}function N(t){return 45===t||46===t||58===t||95===t||sT(t)?(e.consume(t),N):function t(r){return 61===r?(e.consume(r),C):sO(r)?(i=t,D(r)):sq(r)?(e.consume(r),t):j(r)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),n=t,S):sO(t)?(i=C,D(t)):sq(t)?(e.consume(t),C):(e.consume(t),E)}function S(t){return t===n?(e.consume(t),n=void 0,M):null===t?r(t):sO(t)?(i=S,D(t)):(e.consume(t),S)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):47===t||62===t||sF(t)?j(t):(e.consume(t),E)}function M(e){return 47===e||62===e||sF(e)?j(e):r(e)}function P(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}function D(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return sq(t)?sU(e,I,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):I(t)}function I(t){return e.enter("htmlTextData"),i(t)}}}],91:lM,92:[{name:"hardBreakEscape",tokenize:function(e,t,r){return function(t){return e.enter("hardBreakEscape"),e.consume(t),n};function n(n){return sO(n)?(e.exit("hardBreakEscape"),t(n)):r(n)}}},lv],93:lb,95:lS,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let lB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l_(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),t=120===e||88===e;return lq(r.slice(t?2:1),t?16:10)}return lf(r)||e}let l$={}.hasOwnProperty;function lU(e){return{line:e.line,column:e.column,offset:e.offset}}function lH(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+sr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sr({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+sr({start:t.start,end:t.end})+") is still open")}function lV(e){let t=this;t.parser=function(r){var n,a;let i,s,l,c;return"string"!=typeof(n={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=n,n=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:n(m),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:n(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:n(h,a),codeText:n(function(){return{type:"inlineCode",value:""}},a),codeTextData:c,data:c,codeFlowValue:c,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(f),hardBreakTrailing:n(f),htmlFlow:n(g,a),htmlFlowData:c,htmlText:n(g,a),htmlTextData:c,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(x),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:n(m),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:o(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(t=lq(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):t=lf(r);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=lU(e.end)},codeFenced:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:o(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lr(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(d),hardBreakTrailing:o(d),htmlFlow:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=t},labelText:function(e){let t=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=t.replace(lB,l_),r.identifier=lr(t).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=lU(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(r.type)&&(c.call(this,e),u.call(this,e))},link:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lr(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};!function e(t,r){let n=-1;for(;++n0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||lH).call(o,void 0,e[0])}for(n.position={start:lU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:lU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u-1){let e=r[0];"string"==typeof e?r[0]=e.slice(a):r.shift()}o>0&&r.push(e[i].slice(0,o))}return r}(o,e)}function p(){let{_bufferIndex:e,_index:t,line:r,column:a,offset:i}=n;return{_bufferIndex:e,_index:t,line:r,column:a,offset:i}}function h(e,t){t.restore()}function m(e,t){return function(r,a,i){var o;let u,d,h,m;return Array.isArray(r)?f(r):"tokenize"in r?f([r]):(o=r,function(e){let t=null!==e&&o[e],r=null!==e&&o.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function f(e){return(u=e,d=0,0===e.length)?i:v(e[d])}function v(e){return function(r){return(m=function(){let e=p(),t=c.previous,r=c.currentConstruct,a=c.events.length,i=Array.from(s);return{from:a,restore:function(){n=e,c.previous=t,c.currentConstruct=r,c.events.length=a,s=i,g()}}}(),h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(r):e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,x,y)(r)}}function x(t){return e(h,m),a}function y(e){return(m.restore(),++d{let r=(t,r)=>(e.set(r,t),t),n=a=>{if(e.has(a))return e.get(a);let[i,o]=t[a];switch(i){case 0:case -1:return r(o,a);case 1:{let e=r([],a);for(let t of o)e.push(n(t));return e}case 2:{let e=r({},a);for(let[t,r]of o)e[n(t)]=n(r);return e}case 3:return r(new Date(o),a);case 4:{let{source:e,flags:t}=o;return r(new RegExp(e,t),a)}case 5:{let e=r(new Map,a);for(let[t,r]of o)e.set(n(t),n(r));return e}case 6:{let e=r(new Set,a);for(let t of o)e.add(n(t));return e}case 7:{let{name:e,message:t}=o;return r(new lW[e](t),a)}case 8:return r(BigInt(o),a);case"BigInt":return r(Object(BigInt(o)),a);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:e}=new Uint8Array(o);return r(new DataView(e),o)}}return r(new lW[i](o),a)};return n},lK=e=>lG(new Map,e)(0),{toString:lY}={},{keys:lJ}=Object,lX=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let r=lY.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},lZ=([e,t])=>0===e&&("function"===t||"symbol"===t),lQ=(e,t,r,n)=>{let a=(e,t)=>{let a=n.push(e)-1;return r.set(t,a),a},i=n=>{if(r.has(n))return r.get(n);let[o,s]=lX(n);switch(o){case 0:{let t=n;switch(s){case"bigint":o=8,t=n.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],n)}return a([o,t],n)}case 1:{if(s){let e=n;return"DataView"===s?e=new Uint8Array(n.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(n)),a([s,[...e]],n)}let e=[],t=a([o,e],n);for(let t of n)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,n.toString()],n);case"Boolean":case"Number":case"String":return a([s,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let r=[],l=a([o,r],n);for(let t of lJ(n))(e||!lZ(lX(n[t])))&&r.push([i(t),i(n[t])]);return l}case 3:return a([o,n.toISOString()],n);case 4:{let{source:e,flags:t}=n;return a([o,{source:e,flags:t}],n)}case 5:{let t=[],r=a([o,t],n);for(let[r,a]of n)(e||!(lZ(lX(r))||lZ(lX(a))))&&t.push([i(r),i(a)]);return r}case 6:{let t=[],r=a([o,t],n);for(let r of n)(e||!lZ(lX(r)))&&t.push(i(r));return r}}let{message:l}=n;return a([o,{name:s,message:l}],n)};return i},l0=(e,{json:t,lossy:r}={})=>{let n=[];return lQ(!(t||r),!!t,new Map,n)(e),n},l1="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?lK(l0(e,t)):structuredClone(e):(e,t)=>lK(l0(e,t));function l2(e){let t=[],r=-1,n=0,a=0;for(;++r55295&&i<57344){let t=e.charCodeAt(r+1);i<56320&&t>56319&&t<57344?(o=String.fromCharCode(i,t),a=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+a+1,o=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function l3(e,t){let r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function l4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let l5=function(e){var t,r;if(null==e)return l8;if("function"==typeof e)return l6(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],r=-1;for(;++r":"")+"\x1b[39m)"})}return i;function i(){var a;let i,o,s,h=l9;if((!l||d(t,r,n[n.length-1]||void 0))&&!1===(h=Array.isArray(a=c(t,n))?a:"number"==typeof a?[!0,a]:null==a?l9:[a])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(o=(u?t.children.length:-1)+p,s=n.concat(t);o>-1&&o1:t}function cr(e,t,r){let n=0,a=e.length;if(t){let t=e.codePointAt(n);for(;9===t||32===t;)n++,t=e.codePointAt(n)}if(r){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}let cn={blockquote:function(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){let r=t.value?t.value+"\n":"",n={};t.lang&&(n.className=["language-"+t.lang]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},footnoteReference:function(e,t){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),i=l2(a.toLowerCase()),o=e.footnoteOrder.indexOf(a),s=e.footnoteCounts.get(a);void 0===s?(s=0,e.footnoteOrder.push(a),r=e.footnoteOrder.length):r=o+1,s+=1,e.footnoteCounts.set(a,s);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}},imageReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ce(e,t);let a={src:l2(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let r={src:l2(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)},inlineCode:function(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ce(e,t);let a={href:l2(n.url||"")};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let r={href:l2(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},listItem:function(e,t,r){let n=e.all(t),a=r?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},i=se(t.children[1]),o=o7(t.children[t.children.length-1]);i&&o&&(n.position={start:i,end:o}),a.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){let n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",i=r&&"table"===r.type?r.align:void 0,o=i?i.length:t.children.length,s=-1,l=[];for(;++s0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(cr(t.slice(a),a>0,!1)),i.join("")}(String(t.value))};return e.patch(t,r),e.applyData(t,r)},thematicBreak:function(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)},toml:ca,yaml:ca,definition:ca,footnoteDefinition:ca};function ca(){}let ci={}.hasOwnProperty,co={};function cs(e,t){e.position&&(t.position=function(e){let t=se(e),r=o7(e);if(t&&r)return{start:t,end:r}}(e))}function cl(e,t){let r=t;if(e&&e.data){let t=e.data.hName,n=e.data.hChildren,a=e.data.hProperties;"string"==typeof t&&("element"===r.type?r.tagName=t:r={type:"element",tagName:t,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&a&&Object.assign(r.properties,l1(a)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function cc(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:"\n"});++n0&&r.push({type:"text",value:"\n"}),r}function cu(e){let t=0,r=e.charCodeAt(t);for(;9===r||32===r;)t++,r=e.charCodeAt(t);return e.slice(t)}function cd(e,t){let r=function(e,t){let r=t||co,n=new Map,a=new Map,i={all:function(e){let t=[];if("children"in e){let r=e.children,n=-1;for(;++n0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(a,m),s.push(m)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...l1(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:"\n"},a),i}function cp(e,t){return e&&"run"in e?async function(r,n){let a=cd(r,{file:n,...t});await e.run(a,n)}:function(r,n){return cd(r,{file:n,...e||t})}}function ch(e){if(e)throw e}var cm=r(19566);function cf(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let cg=require("node:path"),cv=require("node:process");function cx(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let cy=require("node:url"),cb=["history","path","basename","stem","extname","dirname"];class cw{constructor(e){let t,r;t=e?cx(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":cv.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++nt.length;o&&t.push(n);try{i=e.apply(this,t)}catch(e){if(o&&r)throw e;return n(e)}o||(i&&i.then&&"function"==typeof i.then?i.then(a,n):i instanceof Error?n(i):a(i))};function n(e,...a){r||(r=!0,t(e,...a))}function a(e){n(null,e)}})(s,a)(...o):n(null,...o)}(null,...t)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}};return t}()}copy(){let e=new cE,t=-1;for(;++t0){let[n,...i]=t,o=r[a][1];cf(o)&&cf(n)&&(n=cm(!0,o,n)),r[a]=[e,n,...i]}}}}let cM=new cE().freeze();function cP(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function cD(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function cT(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cI(e){if(!cf(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function cA(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cR(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new cw(e)}let cL=[],cz={allowDangerousHtml:!0},cO=/^(https?|ircs?|mailto|xmpp)$/i,cF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cq(e){let t=function(e){let t=e.rehypePlugins||cL,r=e.remarkPlugins||cL,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cz}:cz;return cM().use(lV).use(r).use(cp,n).use(t)}(e),r=function(e){let t=e.children||"",r=new cw;return"string"==typeof t&&(r.value=t),r}(e);return function(e,t){let r=t.allowedElements,n=t.allowElement,a=t.components,i=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||cB;for(let e of cF)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return l7(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return o?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in sb)if(Object.hasOwn(sb,t)&&Object.hasOwn(e.properties,t)){let r=e.properties[t],n=sb[t];(null===n||n.includes(e.tagName))&&(e.properties[t]=c(String(r||""),t,e))}}if("element"===e.type){let o=r?!r.includes(e.tagName):!!i&&i.includes(e.tagName);if(!o&&n&&"number"==typeof t&&(o=!n(e,t,a)),o&&a&&"number"==typeof t)return l&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var r,n,a,i,o;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=t.jsxDEV,s=function(e,t,a,i){let o=Array.isArray(a.children),s=se(e);return n(t,a,i,o,{columnNumber:s?s.column-1:void 0,fileName:r,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");a=0,i=t.jsx,o=t.jsxs,s=function(e,t,r,n){let a=Array.isArray(r.children)?o:i;return n?a(t,r,n):a(t,r)}}let c={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?o1:o0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=sh(c,e,void 0);return u&&"string"!=typeof u?u:c.create(e,c.Fragment,{children:u||void 0},void 0)}(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(r),r),e)}function cB(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==r&&t>r||-1!==n&&t>n||cO.test(e.slice(0,t))?e:""}function c_({content:e,className:t}){return(0,s.jsx)("div",{className:(0,h.cn)("prose prose-sm dark:prose-invert max-w-none",t),children:(0,s.jsx)(cq,{components:{h1:({children:e})=>(0,s.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,s.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,s.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,s.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,s.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,s.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,s.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,s.jsx)("li",{className:"text-sm",children:e}),code:({className:e,children:t,...r})=>/language-(\w+)/.exec(e||"")?(0,s.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",children:(0,s.jsx)("code",{className:"font-mono text-xs",children:t})}):(0,s.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...r,children:t}),blockquote:({children:e})=>(0,s.jsx)("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 py-0.5 mb-2 italic text-muted-foreground",children:e}),a:({href:e,children:t})=>(0,s.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),strong:({children:e})=>(0,s.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,s.jsx)("em",{className:"italic",children:e}),hr:()=>(0,s.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,s.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,s.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,s.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,s.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,s.jsx)("tr",{children:e}),th:({children:e})=>(0,s.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,s.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:e})})}let c$={shell:(0,s.jsx)(tJ,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,s.jsx)(x,{className:"h-3 w-3 text-orange-500"}),evaluation:(0,s.jsx)(ob.A,{className:"h-3 w-3 text-orange-500"}),complete_task:(0,s.jsx)(ob.A,{className:"h-3 w-3 text-green-500"})},cU={pending:(0,s.jsx)(nx.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,s.jsx)(nx.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,s.jsx)(ob.A,{className:"h-3 w-3 text-green-500"}),failed:(0,s.jsx)(ow.A,{className:"h-3 w-3 text-red-500"})};function cH({content:e,toolCalls:t=[],toolMessages:r,checkpointId:n,onRestore:a,onRetry:i,isSavedCheckpoint:o,isExecuting:l=!1,className:c,cost:d,usage:p}){let[f,g]=u().useState(new Set),[v,x]=u().useState(!1),{shouldShowCosts:y}=aF(),b=!!(e&&""!==e.trim()),w=e=>{let t=new Set(f);t.has(e)?t.delete(e):t.add(e),g(t)},k=n&&(a||i)&&!l?(0,s.jsxs)("div",{className:"pt-2 flex flex-wrap items-center gap-2","data-tour-id":"checkpoint-actions",children:[(0,s.jsx)(rO.E,{variant:o?"default":"outline",className:"h-6 px-2 text-xs",children:o?"Saved version":"Checkpoint"}),a&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>a(n),className:"h-7 text-xs","data-tour-id":"checkpoint-restore-button",children:[(0,s.jsx)(aA,{className:"h-3 w-3 mr-1"}),"Restore"]}),i&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>i(n),className:"h-7 text-xs","data-tour-id":"checkpoint-retry-button",children:[(0,s.jsx)(ok,{className:"h-3 w-3 mr-1"}),"Retry"]})]}):null;return r&&r.length>0?(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c_,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),nu.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(oj.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",nu.U.formatCost(d)]})]})]}),r.map(e=>"message"===e.type?(0,s.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,s.jsx)(c_,{content:e.content||""})},e.id):"divider"===e.type?(0,s.jsxs)("div",{className:"flex items-center gap-2 my-2",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground whitespace-nowrap",children:e.title||"Section"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]},e.id):(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(e.id)?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(e.id),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(ob.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ow.A,{className:"h-3 w-3 text-red-500"}):e.name&&c$[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:cU[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),"evaluation"===e.name&&e.parameters&&(0,s.jsxs)("div",{className:"px-2 py-1 mt-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:e.parameters.reasoning}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[e.parameters.goal_achieved?(0,s.jsx)(ob.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ow.A,{className:"h-3 w-3 text-red-500"}),(0,s.jsx)("span",{className:e.parameters.goal_achieved?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:e.parameters.goal_achieved?"Goal achieved":"Goal not achieved"})]}),!e.parameters.should_continue&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,s.jsx)("span",{children:"•"}),(0,s.jsx)("span",{children:"Stopping"})]})]})]}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(e.id)&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},e.id)),k]}):(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c_,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),nu.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(oj.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",nu.U.formatCost(d)]})]})]}),t.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(String(t))?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(String(t)),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(ob.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ow.A,{className:"h-3 w-3 text-red-500"}):e.name&&c$[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:cU[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(String(t))&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},t))}),k]})}var cV=r(97815);function cW({project:e,onBack:t}){let[r,n]=(0,l.useState)(0),[a,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(null),[f,v]=(0,l.useState)([]),[x,y]=(0,l.useState)("preview"),[b,w]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[C,S]=(0,l.useState)(e.lastSavedAt??null),[E,P]=(0,l.useState)(null),D=(0,l.useRef)(null),T=(0,l.useRef)(null),A=(0,l.useRef)(0),R=(0,l.useCallback)(()=>{try{let e=globalThis?.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID()}catch{}let e=`${Date.now()}_${A.current}`;return A.current+=1,e},[]),L=(0,l.useCallback)(e=>{if(null!=T.current&&T.current>=0&&T.current{let e=[ea,eo,el,eu].filter(Boolean).length;if(4===e)return{assistant:25,files:15,editor:35,preview:25};if(3===e){if(!ea)return{assistant:0,files:20,editor:40,preview:40};if(!eo)return{assistant:30,files:0,editor:40,preview:30};if(!el)return{assistant:33,files:20,editor:0,preview:47};if(!eu)return{assistant:30,files:20,editor:50,preview:0}}else if(2===e)return{assistant:50,files:50,editor:50,preview:50};return{assistant:100,files:100,editor:100,preview:100}})(),eh=e=>{if(!e)return"Select Model";let t=e.split("/");return t[t.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},em=(0,l.useCallback)((e,t=1200)=>{if(!e)return"";if(e.length<=t)return e;let r=Math.max(0,Math.floor(.6*t)),n=Math.max(0,Math.floor(.3*t)),a=e.slice(0,r),i=n>0?e.slice(-n):"";return`${a} +}`}]};var rQ=r(32623);async function r0(e,t,r){await rQ.$.runWithSuppressedDirty(t,async()=>{for(let n of r.directories)await e.createDirectory(t,n);for(let n of r.files){let r=n.content;if(n.isBase64){let e=atob(n.content),t=new Uint8Array(e.length);for(let r=0;r{await e.createFile(t,"/assets/images/example-background.jpg",n)})}}catch(e){}}var r2=r(33135),r3=r(4950),r4=r(83721),r5=r(18853),r6="Switch",[r8,r9]=(0,J.A)(r6),[r7,ne]=r8(r6),nt=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[m,f]=l.useState(null),g=(0,Y.s)(t,e=>f(e)),v=l.useRef(!1),x=!m||p||!!m.closest("form"),[y,b]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:d,caller:r6});return(0,s.jsxs)(r7,{scope:r,checked:y,disabled:c,children:[(0,s.jsx)(Z.sG.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":ni(y),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:g,onClick:(0,K.mK)(e.onClick,e=>{b(e=>!e),x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),x&&(0,s.jsx)(na,{control:m,bubbles:!v.current,name:n,value:u,checked:y,required:o,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nt.displayName=r6;var nr="SwitchThumb",nn=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=ne(nr,r);return(0,s.jsx)(Z.sG.span,{"data-state":ni(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});nn.displayName=nr;var na=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{let o=l.useRef(null),c=(0,Y.s)(o,i),u=(0,r4.Z)(r),d=(0,r5.X)(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(u!==r&&t){let a=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(a)}},[u,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function ni(e){return e?"checked":"unchecked"}function no({className:e,...t}){return(0,s.jsx)(nt,{"data-slot":"switch",className:(0,h.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,s.jsx)(nn,{"data-slot":"switch-thumb",className:(0,h.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}na.displayName="SwitchBubbleInput";var ns=r(10218);let nl=(0,v.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var nc=r(86884);function nu({onClose:e}){let[t,r]=(0,l.useState)({}),[n,a]=(0,l.useState)({}),{theme:i,setTheme:o}=(0,ns.D)(),[c,u]=(0,l.useState)(!1),[d,p]=(0,l.useState)(!1),h=(e,t)=>{r3.s.setSetting(e,t),r(r=>({...r,[e]:t}))};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium text-sm",children:"Application Settings"}),(0,s.jsx)("p",{className:"text-muted-foreground text-xs mt-1",children:"Configure your preferences and display options"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"theme",children:"Theme"}),(0,s.jsxs)(t2.l6,{value:c?i:"dark",onValueChange:e=>{o(e),h("theme",e)},children:[(0,s.jsx)(t2.bq,{id:"theme",className:"mt-2",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"light",children:"Light"}),(0,s.jsx)(t2.eb,{value:"dark",children:"Dark"}),(0,s.jsx)(t2.eb,{value:"system",children:"System"})]})]})]}),(0,s.jsxs)("div",{className:"border-t pt-4 mt-4",children:[(0,s.jsxs)("h4",{className:"font-medium text-sm mb-3 flex items-center gap-2",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),"Cost Tracking"]}),(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"show-costs",children:"Display Costs"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Show cost information in messages"})]}),(0,s.jsx)(no,{id:"show-costs",checked:!1!==n.showCosts,onCheckedChange:e=>{let t={...n,showCosts:e};r3.s.setCostSettings(t),a(t)}})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"daily-limit",children:"Daily Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"daily-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.dailyLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,dailyLimit:t};r3.s.setCostSettings(r),a(r)}}),n.dailyLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.dailyLimit.toFixed(2),"/day"]})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"project-limit",children:"Project Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"project-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.projectLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,projectLimit:t};r3.s.setCostSettings(r),a(r)}}),n.projectLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.projectLimit.toFixed(2),"/project"]})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(rX.J,{htmlFor:"warning-threshold",children:"Warning Threshold (%)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"warning-threshold",type:"number",min:"50",max:"100",step:"5",value:n.warningThreshold||80,onChange:e=>{let t=parseInt(e.target.value),r={...n,warningThreshold:t};r3.s.setCostSettings(r),a(r)}}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[(0,s.jsx)(nl,{className:"h-3 w-3"}),"Warn at ",n.warningThreshold||80,"%"]})]})]}),(0,s.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Lifetime Total"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:nc.U.formatCost(r3.s.getLifetimeCosts().total)})]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{confirm("Reset lifetime cost tracking? This cannot be undone.")&&(r3.s.resetLifetimeCosts(),tV.oR.success("Lifetime costs reset"))},children:"Reset Stats"})]})})]})]}),(0,s.jsxs)("div",{className:"flex justify-between pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(m.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(r3.s.clearSettings(),r({}),tV.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>p(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]})]}),e&&(0,s.jsx)(m.$,{onClick:e,children:"Close"})]}),(0,s.jsx)(rB,{open:d,onOpenChange:p})]})}let nd=[{id:"welcome",title:"Welcome to DeepStudio",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Let's take a guided tour of the workspace so you can see how projects, agents, and saves all fit together."}),(0,s.jsx)("p",{children:"The tour takes under two minutes and you can skip at any time."})]}),location:"project-manager",primaryLabel:"Start tour",secondaryLabel:"Skip"},{id:"projects-overview",title:"Projects at a Glance",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,s.jsx)("p",{children:"I've loaded a demo project so you can explore without setting anything up."})]}),location:"project-manager",target:'[data-tour-id="projects-list"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"create-project",title:"Creating a Project",body:(0,s.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,s.jsx)("p",{children:"Use the New Project button to start fresh. The dialog lets you name the project and add an optional description."})}),location:"project-manager",target:'[data-tour-id="new-project-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"project-controls",title:"Exporting a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Click the dropdown menu on any project card to access export options. You can export as a ZIP for deployment or JSON for backup."}),(0,s.jsx)("p",{children:"Projects can also be duplicated or deleted from this menu."})]}),location:"project-manager",target:'[data-tour-id="project-export-json"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"edit-project",title:"Editing a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"To get to the workspace and start editing, simply click on the project card. This will open the full development environment."}),(0,s.jsx)("p",{children:"Click Next to enter the workspace and continue the tour."})]}),location:"project-manager",target:'[data-tour-id="project-card"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-overview",title:"Workspace Layout",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,s.jsx)("p",{children:"The VFS works like a project file tree—add HTML, CSS, JS, or assets and the agent can edit them just like local files."})]}),location:"workspace",target:'[data-tour-id="workspace-panels"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-edit",title:"See the Agent in Action",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'I\'ll request the agent to change the color of "Our Services" button to a green accent and the agent performs the task.'}),(0,s.jsx)("p",{children:"This mimics what you will see when asking the agent to perform tasks."})]}),location:"workspace",target:'[data-tour-id="assistant-panel"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-focus",title:"Element Focus Tool",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,s.jsx)("p",{children:"Click it to activate element selection mode, then click any element in the preview to highlight it."})]}),location:"workspace",target:'[data-tour-id="focus-crosshair-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-checkpoint",title:"Checkpoints & Manual Saves",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'The "Discard Changes" button restores to the original saved point, letting you revert any changes back to your last manual save.'}),(0,s.jsx)("p",{children:"If you like the result, use the Save button to lock it in as your manual checkpoint."})]}),location:"workspace",target:'[data-tour-id="discard-changes-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"clear-conversation",title:"Clear Conversation",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The agent will have the last tasks and responses in memory. You can clear it with the trashcan button to start fresh."}),(0,s.jsx)("p",{children:"This removes the conversation history but keeps your project files intact."})]}),location:"workspace",target:'[data-tour-id="clear-chat-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"provider-settings",title:"Connect Your Provider",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,s.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,s.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,s.jsx)("p",{className:"text-xs text-orange-500/90",children:"Privacy note: Remote LLM providers (OpenAI, Anthropic, etc.) will receive your code when generating. For complete privacy, use local models with Ollama or LM Studio."})]}),location:"workspace",target:'[data-tour-id="provider-settings-trigger"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"wrap-up",title:"You're Ready!",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"That's the basics—prompt the agent, preview updates, and save when you're happy. You can replay this tour from the Help menu anytime."}),(0,s.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var np=r(25495),nh=r(94742);let nm=(0,l.createContext)(null);function nf({children:e}){let[t,r]=(0,l.useState)("idle"),[n,a]=(0,l.useState)(0),[i,o]=(0,l.useState)(0),[c,u]=(0,l.useState)([]),[d,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)([]),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),y=(0,l.useRef)(v),b=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=nd.length))return nd[e]})(n),[n]),E=(0,l.useCallback)(()=>{x({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),b.current=null,w.current=null,k.current=null,j.current=null},[]),M=(0,l.useCallback)(()=>{"running"!==t&&(r("running"),a(0),o(e=>e+1),u([]),E())},[E,t]),P=(0,l.useCallback)(e=>{C.current=e},[]),D=(0,l.useCallback)((e="finish")=>{let t=y.current;t.projectId&&t.preCheckpointId&&t.postCheckpointId&&rQ.$.runWithSuppressedDirty(t.projectId,async()=>{await nh.Y.restoreCheckpoint(t.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),E(),u([]),a(0),o(e=>e+1),r("finish"===e?"completed":"idle"),r3.s.setHasSeenTour(!0),N.current?.abort(),C.current=null},[E]),T=(0,l.useCallback)(()=>{D("skip")},[D]),I=(0,l.useCallback)(()=>{a(e=>{let t=e+1;return t>=nd.length?(D(),e):(o(e=>e+1),t)})},[D]),A=(0,l.useCallback)(()=>{a(e=>{let t=Math.max(0,e-1);return t!==e&&o(e=>e+1),t})},[]),R=(0,l.useMemo)(()=>({state:{status:t,stepIndex:n,stepKey:i,currentStep:S,transcript:c,isBusy:d,projectList:h},start:M,skip:T,next:I,previous:A,setProjectList:e=>{m(e)},setActiveProjectId:g,setTranscript:u,setWorkspaceHandler:P}),[t,n,i,S,c,d,h,M,T,I,A,P]);return(0,s.jsx)(nm.Provider,{value:R,children:e})}function ng(){let e=(0,l.useContext)(nm);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var nv=r(41862);function nx({location:e}){let{state:t,next:r,previous:n,skip:a}=ng(),{status:i,currentStep:o,stepKey:c,isBusy:u,stepIndex:d}=t,[p,h]=(0,l.useState)(null),f=nd.length,g=(0,l.useMemo)(()=>!!o&&!!u&&("workspace-edit"===o.id||"workspace-focus"===o.id||"workspace-checkpoint"===o.id),[o,u]);if("running"!==i||!o||o.location!==e)return null;let v=o.primaryLabel??"Next",x=o.secondaryLabel??"Skip";return(0,s.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-background/30"}),p&&(0,s.jsx)("div",{className:"pointer-events-none fixed rounded-xl border-2 border-primary ring-4 ring-primary/30 transition-all animate-ring-opacity",style:{top:p.top,left:p.left,width:p.width,height:p.height}}),(0,s.jsx)("div",{className:"absolute bottom-10 left-1/2 flex w-full max-w-xl -translate-x-1/2 flex-col gap-4 px-4",children:(0,s.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:o.title}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground font-medium",children:[d+1,"/",f]})]}),(0,s.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:o.body})]}),u&&(0,s.jsx)(nv.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[o.showBack?(0,s.jsx)(m.$,{variant:"ghost",onClick:n,disabled:u,children:"Back"}):(0,s.jsx)("div",{}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(m.$,{variant:"ghost",onClick:a,children:x}),(0,s.jsx)(m.$,{onClick:r,disabled:g,children:v})]})]})]})})]})}function ny({onProjectSelect:e}){let t=(0,d.useRouter)(),[r,n]=(0,l.useState)([]),[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(""),[u,v]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),[b,w]=(0,l.useState)(""),[k,j]=(0,l.useState)("blank"),[C,S]=(0,l.useState)("updated"),[E,M]=(0,l.useState)("grid"),[P,D]=(0,l.useState)(null),[T,I]=(0,l.useState)(!1),{state:A,setProjectList:R,start:L}=ng(),z=A.currentStep?.id,O="running"===A.status,[F,q]=(0,l.useState)(!1),[B,_]=(0,l.useState)(null),$=(0,l.useRef)(!1),U=(0,l.useRef)(!1);(0,l.useCallback)(async()=>{if(!$.current){$.current=!0,i(!0);try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to load projects:",e),tV.oR.error("Failed to load projects")}finally{i(!1),q(!0),$.current=!1}}},[R]);let H=(0,l.useCallback)(async()=>{try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to reload projects:",e),tV.oR.error("Failed to reload projects")}},[R]),V=async()=>{if(!U.current){U.current=!0;try{let t=await p.OP.createProject("Multi-File Demo","Interactive examples showing how HTML, CSS, and JavaScript files work together");return await r1(p.OP,t.id),tV.oR.success("Demo project created successfully"),await H(),e(t),t}catch(e){throw h.v.error("Failed to create demo project:",e),tV.oR.error("Failed to create demo project"),U.current=!1,e}}},W=async()=>{try{0===r.length&&await V(),L()}catch(e){h.v.error("Failed to prepare for tour:",e),tV.oR.error("Failed to start tour - could not create demo project")}},G=async()=>{if(!x.trim())return void tV.oR.error("Please enter a project name");if(x.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(b.length>200)return void tV.oR.error("Description must be 200 characters or less");try{let t=await p.OP.createProject(x.trim().slice(0,50),b.trim().slice(0,200)||void 0);"demo"===k?await r1(p.OP,t.id):await r0(p.OP,t.id,rZ),tV.oR.success("Project created successfully"),v(!1),y(""),w(""),j("blank"),await H(),e(t)}catch(e){h.v.error("Failed to create project:",e),tV.oR.error("Failed to create project")}},K=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await p.OP.deleteProject(e.id),tV.oR.success("Project deleted"),await H()}catch(e){h.v.error("Failed to delete project:",e),tV.oR.error("Failed to delete project")}},Y=async t=>{try{let r=await p.OP.duplicateProject(t.id);tV.oR.success("Project duplicated successfully"),await H(),e(r)}catch(e){h.v.error("Failed to duplicate project:",e),tV.oR.error("Failed to duplicate project")}},J=async e=>{try{let t=await p.OP.exportProject(e.id),r=JSON.stringify(t,null,2),n=new Blob([r],{type:"application/json"}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a),tV.oR.success("Project exported")}catch(e){h.v.error("Failed to export project:",e),tV.oR.error("Failed to export project")}},X=async e=>{try{let t=await p.OP.exportProjectAsZip(e.id),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),tV.oR.success("Project exported as ZIP")}catch(e){h.v.error("Failed to export project as ZIP:",e),tV.oR.error("Failed to export project as ZIP")}},Z=async()=>{let t=document.createElement("input");t.type="file",t.accept=".json",t.onchange=async t=>{let r=t.target.files?.[0];if(r)try{let t=await r.text(),n=JSON.parse(t);if(!n.project||!n.files)throw Error("Invalid project file");let a=await p.OP.importProject(n);tV.oR.success("Project imported successfully"),await H(),e(a)}catch(e){h.v.error("Failed to import project:",e),tV.oR.error("Failed to import project")}},t.click()},Q=((e,t)=>{let r=[...e];switch(t){case"updated":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());case"created":return r.sort((e,t)=>t.createdAt.getTime()-e.createdAt.getTime());case"name":return r.sort((e,t)=>e.name.localeCompare(t.name));case"size":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());default:return r}})(r.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.description?.toLowerCase().includes(o.toLowerCase())),C);if(a&&!F)return(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,s.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let ee=[{id:"new-project",label:"New Project",icon:r_,onClick:()=>v(!0),content:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>v(!0),"data-tour-id":"new-project-button",className:"justify-start",children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"New Project"]})},{id:"import",label:"Import",icon:r$,onClick:Z,variant:"outline"}],et=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsx)(m.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,s.jsx)(rU,{className:"h-4 w-4"})})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nu,{})})]}),er=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nu,{})})]}),(0,s.jsx)("div",{className:"border-t my-2"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),className:"w-full justify-start",children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>I(!0),className:"w-full justify-start",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,s.jsx)(rJ.j,{onLogoClick:()=>I(!0),actions:ee,mobileMenuContent:er,desktopOnlyContent:et,leftText:"DeepStudio"}),(0,s.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:(0,s.jsxs)("div",{className:"container mx-auto p-6 max-w-6xl",children:[(0,s.jsx)("div",{className:"mb-6 space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-4","data-tour-id":"projects-actions",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(rW.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),(0,s.jsx)(f.p,{placeholder:"Search projects...",value:o,onChange:e=>c(e.target.value),className:"pl-10 bg-card"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(t2.l6,{value:C,onValueChange:e=>S(e),children:[(0,s.jsxs)(t2.bq,{className:"flex-1 md:w-[180px] bg-card",children:[(0,s.jsx)(rG,{className:"h-4 w-4 mr-2"}),(0,s.jsx)(t2.yv,{placeholder:"Sort by..."})]}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"updated",children:"Last Updated"}),(0,s.jsx)(t2.eb,{value:"created",children:"Date Created"}),(0,s.jsx)(t2.eb,{value:"name",children:"Name"})]})]}),(0,s.jsxs)("div",{className:"flex gap-0.5 border rounded-sm p-1 bg-card h-9",children:[(0,s.jsx)(m.$,{size:"icon",variant:"grid"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>M("grid"),children:(0,s.jsx)(rK,{className:"h-4 w-4"})}),(0,s.jsx)(m.$,{size:"icon",variant:"list"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>M("list"),children:(0,s.jsx)(rY,{className:"h-4 w-4"})})]})]})]})}),0===Q.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2",children:o?"No projects found":"No projects yet"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:o?"Try a different search term":"Create your first project to get started"}),!o&&(0,s.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,s.jsxs)(m.$,{onClick:()=>v(!0),children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,s.jsxs)(m.$,{variant:"outline",onClick:V,children:[(0,s.jsx)(N,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,s.jsx)("div",{className:"grid"===E?"grid gap-4 md:grid-cols-2 lg:grid-cols-3":"space-y-3","data-tour-id":"projects-list",children:Q.map(t=>"object"==typeof t&&t.id&&t.name?(0,s.jsx)(tW,{project:t,onSelect:e,onDelete:K,onExport:J,onExportZip:X,onDuplicate:Y,onPreview:D,onUpdate:e=>{n(r.map(t=>t.id===e.id?e:t))},viewMode:E,forceMenuOpen:B===t.id,highlightExport:O&&"project-controls"===z&&B===t.id},t.id):(h.v.error("Invalid project object:",t),null))})]})}),(0,s.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,s.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,"data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>I(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]})}),(0,s.jsx)(rM,{open:u,onOpenChange:v,children:(0,s.jsxs)(rT,{children:[(0,s.jsxs)(rI,{children:[(0,s.jsx)(rR,{children:"Create New Project"}),(0,s.jsx)(rL,{children:"Start a new multipage website project"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"name",children:"Project Name"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x.length,"/50"]})]}),(0,s.jsx)(f.p,{id:"name",value:x,onChange:e=>y(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"template",children:"Template"}),(0,s.jsxs)(t2.l6,{value:k,onValueChange:e=>j(e),children:[(0,s.jsx)(t2.bq,{id:"template",className:"mt-2",children:(0,s.jsx)(t2.yv,{placeholder:"Select a template"})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"blank",children:"Blank (HTML/CSS/JS starter)"}),(0,s.jsx)(t2.eb,{value:"demo",children:"Demo (multi-page example)"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"description",children:"Description (optional)"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[b.length,"/200"]})]}),(0,s.jsx)(g,{id:"description",value:b,onChange:e=>w(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,s.jsxs)(rA,{children:[(0,s.jsx)(m.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,s.jsx)(m.$,{onClick:G,children:"Create Project"})]})]})}),P&&(0,s.jsx)(rM,{open:!!P,onOpenChange:()=>D(null),children:(0,s.jsxs)(rT,{className:"max-w-[90vw] sm:max-w-[85vw] lg:max-w-[80vw] 2xl:max-w-[1400px] max-h-[90vh] w-full h-full p-0 flex flex-col",children:[(0,s.jsx)(rI,{className:"p-4 border-b",children:(0,s.jsxs)(rR,{children:["Preview: ",P.name]})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)(t4,{projectId:P.id})})]})}),(0,s.jsx)(rB,{open:T,onOpenChange:I}),(0,s.jsx)(nx,{location:"project-manager"})]})}var nb=r(24923),nw=r(78272);let nk=(0,v.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),nj=(0,v.A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),nN=(0,v.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),nC=(0,v.A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var nS="ContextMenu",[nE,nM]=(0,J.A)(nS,[eF]),nP=eF(),[nD,nT]=nE(nS),nI=e=>{let{__scopeContextMenu:t,children:r,onOpenChange:n,dir:a,modal:i=!0}=e,[o,c]=l.useState(!1),u=nP(t),d=(0,el.c)(n),p=l.useCallback(e=>{c(e),d(e)},[d]);return(0,s.jsx)(nD,{scope:t,open:o,onOpenChange:p,modal:i,children:(0,s.jsx)(eV,{...u,dir:a,open:o,onOpenChange:p,modal:i,children:r})})};nI.displayName=nS;var nA="ContextMenuTrigger",nR=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,disabled:n=!1,...a}=e,i=nT(nA,r),o=nP(r),c=l.useRef({x:0,y:0}),u=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(d.current),[]),h=e=>{c.current={x:e.clientX,y:e.clientY},i.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(n&&p()),[n,p]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eW,{...o,virtualRef:u}),(0,s.jsx)(Z.sG.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:(0,K.mK)(e.onContextMenu,e=>{p(),h(e),e.preventDefault()}),onPointerDown:n?e.onPointerDown:(0,K.mK)(e.onPointerDown,nG(e=>{p(),d.current=window.setTimeout(()=>h(e),700)})),onPointerMove:n?e.onPointerMove:(0,K.mK)(e.onPointerMove,nG(p)),onPointerCancel:n?e.onPointerCancel:(0,K.mK)(e.onPointerCancel,nG(p)),onPointerUp:n?e.onPointerUp:(0,K.mK)(e.onPointerUp,nG(p))})]})});nR.displayName=nA;var nL=e=>{let{__scopeContextMenu:t,...r}=e,n=nP(t);return(0,s.jsx)(eJ,{...n,...r})};nL.displayName="ContextMenuPortal";var nz="ContextMenuContent",nO=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nT(nz,r),i=nP(r),o=l.useRef(!1);return(0,s.jsx)(e0,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||a.modal||(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nO.displayName=nz,l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="ContextMenuGroup";var nF=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(e6,{...a,...n,ref:t})});nF.displayName="ContextMenuLabel";var nq=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});nq.displayName="ContextMenuItem";var nB=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(tt,{...a,...n,ref:t})});nB.displayName="ContextMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="ContextMenuRadioGroup";var n_=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(ts,{...a,...n,ref:t})});n_.displayName="ContextMenuRadioItem";var n$=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(td,{...a,...n,ref:t})});n$.displayName="ContextMenuItemIndicator";var nU=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});nU.displayName="ContextMenuSeparator",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="ContextMenuArrow";var nH="ContextMenuSub",nV=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(ty,{...a,...n,ref:t})});nV.displayName="ContextMenuSubTrigger";var nW=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nP(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});function nG(e){return t=>"mouse"!==t.pointerType?e(t):void 0}nW.displayName="ContextMenuSubContent";let nK=(0,v.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);l.forwardRef(({className:e,inset:t,children:r,...n},a)=>(0,s.jsxs)(nV,{ref:a,className:(0,h.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,(0,s.jsx)(tJ,{className:"ml-auto h-4 w-4"})]})).displayName=nV.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nW,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})).displayName=nW.displayName;let nY=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nL,{children:(0,s.jsx)(nO,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));nY.displayName=nO.displayName;let nJ=l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(nq,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));function nX({projectId:e,onFileSelect:t,selectedPath:r,onClose:n}){let[a,i]=(0,l.useState)([]),[o,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(new Set(["/"])),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)(""),[w,j]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[E,M]=(0,l.useState)(null),P=(0,l.useRef)(null),D=(0,l.useCallback)(async()=>{try{await p.OP.init();let t=await p.OP.getAllFilesAndDirectories(e),r=t.filter(e=>"directory"!==e.type);i(r),c(T(t))}catch(e){h.v.error("Failed to load files:",e)}},[e]),T=e=>{let t=[],r=new Map;e.forEach(e=>{if("directory"===e.type){let t=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name||t[t.length-1]||"unnamed",type:"directory",children:[]};r.set(e.path,n)}}),e.forEach(e=>{if("directory"!==e.type){let t=e.path.split("/").filter(Boolean),n="";for(let e=0;e{let a=n.split("/").filter(Boolean);if(1===a.length)t.push(e);else{let t="/"+a.slice(0,-1).join("/"),n=r.get(t);n&&n.children&&n.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let n=e.path.split("/").filter(Boolean),a={path:e.path,name:e.name,type:"file"};if(1===n.length)t.push(a);else{let e="/"+n.slice(0,-1).join("/"),t=r.get(e);t&&t.children?.push(a)}}});let n=e=>{e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&n(e.children)})};return n(t),t},I=e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},A=async e=>{if("directory"===e.type)I(e.path);else{let r=a.find(t=>t.path===e.path);r&&t&&t(r)}},R=async(t="/")=>{let r=prompt("Enter file name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createFile(e,n,""),await D()}catch(e){h.v.error("Failed to create file:",e)}},L=async(t="/")=>{let r=prompt("Enter directory name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createDirectory(e,n),await D()}catch(e){h.v.error("Failed to create directory:",e)}},z=async(t,r)=>{if(confirm(`Delete ${r} "${t}"?`))try{"file"===r?await p.OP.deleteFile(e,t):await p.OP.deleteDirectory(e,t),await D()}catch(e){h.v.error(`Failed to delete ${r}:`,e)}},O=async(t,r)=>{if(!x)return;let n=t.split("/");n[n.length-1]=x;let a=n.join("/");try{"directory"===r?await p.OP.renameDirectory(e,t,a):await p.OP.renameFile(e,t,a),await D(),v(null),y("")}catch(e){h.v.error(`Failed to rename ${r}:`,e)}},F=async e=>{for(let t of(e.preventDefault(),e.stopPropagation(),j(!1),Array.from(e.dataTransfer.items)))if("file"===t.kind){let e=t.getAsFile();e&&await q(e,"/")}},q=async(t,r)=>{if(!(0,nb.fu)(t.name))return void tV.oR.error(`File type not supported: ${t.name}`);let n=(0,nb.Gr)(t.name),a=nb.Q6[n];if(t.size>a)return void tV.oR.error(`File too large: ${t.name}. Maximum size is ${Math.round(a/1024/1024)}MB`);let i="/"===r?`/${t.name}`:`${r}/${t.name}`;try{let r;r="image"===n||"video"===n||"binary"===n?await t.arrayBuffer():await t.text(),await p.OP.createFile(e,i,r),await D(),tV.oR.success(`Uploaded ${t.name}`)}catch(n){if(n.message?.includes("already exists")){if(confirm(`File "${t.name}" already exists. Overwrite?`))try{await p.OP.deleteFile(e,i),await q(t,r)}catch(e){h.v.error("Failed to overwrite file:",e),tV.oR.error("Failed to overwrite file")}}else h.v.error("Failed to upload file:",n),tV.oR.error(`Failed to upload ${t.name}: ${n.message}`)}},B=(e,t)=>{e.stopPropagation(),S(t),e.dataTransfer.effectAllowed="move"},_=()=>{S(null),M(null)},$=(e,t)=>{e.preventDefault(),e.stopPropagation(),C&&t!==C.path&&(e.dataTransfer.dropEffect="move",M(t))},U=async(t,r)=>{if(t.preventDefault(),t.stopPropagation(),!C||r&&C.path===r.path)return void M(null);let n=r&&"directory"===r.type?r.path:"/";if("directory"===C.type){let e=C.path.endsWith("/")?C.path:C.path+"/";if((n.endsWith("/")?n:n+"/").startsWith(e)){tV.oR.error("Cannot move a folder into itself"),M(null);return}}let a=C.name,i="/"===n?`/${a}`:`${n}/${a}`;try{"directory"===C.type?await p.OP.moveDirectory(e,C.path,i):await p.OP.moveFile(e,C.path,i),await D(),tV.oR.success(`Moved ${C.name} to ${"/"===n?"root":n}`)}catch(e){h.v.error("Failed to move item:",e),tV.oR.error(`Failed to move: ${e.message}`)}M(null)},H=(e,t=0)=>{let n=u.has(e.path),a=r===e.path,i=g===e.path,o=E===e.path;return(0,s.jsxs)("div",{draggable:!i,onDragStart:t=>B(t,e),onDragEnd:_,onDragOver:t=>"directory"===e.type&&$(t,e.path),onDrop:t=>"directory"===e.type&&U(t,e),children:[(0,s.jsxs)(nI,{children:[(0,s.jsx)(nR,{children:(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",a&&"bg-accent text-accent-foreground",o&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",C?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*t+8}px`},onClick:()=>A(e),children:["directory"===e.type?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsx)(nw.A,{className:"w-4 h-4 text-muted-foreground"}):(0,s.jsx)(tJ,{className:"w-4 h-4 text-muted-foreground"}),n?(0,s.jsx)(N,{className:"w-4 h-4 text-blue-500"}):(0,s.jsx)(nk,{className:"w-4 h-4 text-blue-500"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"w-4"}),(()=>{let t=(0,nb.Gr)(e.path);return"image"===t?(0,s.jsx)(b,{className:"w-4 h-4 text-green-500"}):"video"===t?(0,s.jsx)(nj,{className:"w-4 h-4 text-purple-500"}):(0,s.jsx)(nN,{className:"w-4 h-4 text-muted-foreground"})})()]}),i?(0,s.jsx)(f.p,{value:x,onChange:e=>y(e.target.value),onBlur:()=>O(e.path,e.type),onKeyDown:t=>{"Enter"===t.key?O(e.path,e.type):"Escape"===t.key&&(v(null),y(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,s.jsxs)(nY,{children:["directory"===e.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(nJ,{onClick:()=>R(e.path),children:[(0,s.jsx)(nN,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(nJ,{onClick:()=>L(e.path),children:[(0,s.jsx)(nk,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(nJ,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,s.jsx)(nJ,{onClick:()=>{v(e.path),y(e.name)},children:"Rename"}),(0,s.jsx)(nJ,{onClick:()=>z(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&n&&e.children&&(0,s.jsx)("div",{children:e.children.map(e=>H(e,t+1))})]},e.path)};return(0,s.jsxs)("div",{className:"h-full flex flex-col",onDrop:F,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),j(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getBoundingClientRect(),r=e.clientX,n=e.clientY;(r=t.right||n=t.bottom)&&j(!1)},children:[(0,s.jsx)("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let t of Array.from(e.target.files||[]))await q(t,"/");P.current&&(P.current.value="")}}),(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nC,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),n?(0,s.jsxs)("button",{type:"button",onClick:n,"aria-label":"Hide file explorer",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(nC,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(nC,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P.current?.click(),title:"Upload files",children:(0,s.jsx)(r$,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>R("/"),title:"New file",children:(0,s.jsx)(nN,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>L("/"),title:"New folder",children:(0,s.jsx)(nk,{className:"h-3 w-3"})})]})]}),(0,s.jsxs)(nI,{children:[(0,s.jsx)(nR,{asChild:!0,children:(0,s.jsxs)("div",{className:(0,h.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",w&&"bg-blue-500/10"),onDragOver:e=>{C&&(e.preventDefault(),e.stopPropagation(),M("/"))},onDrop:e=>{C&&U(e,null)},children:[w&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,s.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,s.jsx)(r$,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===o.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(nk,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,s.jsx)("div",{className:"contents",children:o.map(e=>H(e))})]})}),(0,s.jsxs)(nY,{children:[(0,s.jsxs)(nJ,{onClick:()=>R("/"),children:[(0,s.jsx)(nN,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(nJ,{onClick:()=>L("/"),children:[(0,s.jsx)(nk,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(nJ,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function nZ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}nJ.displayName=nq.displayName,l.forwardRef(({className:e,children:t,checked:r,...n},a)=>(0,s.jsxs)(nB,{ref:a,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n$,{children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})}),t]})).displayName=nB.displayName,l.forwardRef(({className:e,children:t,...r},n)=>(0,s.jsxs)(n_,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n$,{children:(0,s.jsx)(nK,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=n_.displayName,l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(nF,{ref:n,className:(0,h.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r})).displayName=nF.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(nU,{ref:r,className:(0,h.cn)("-mx-1 my-1 h-px bg-border",e),...t})).displayName=nU.displayName;function nQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};n6.initial(e),n6.handler(t);var r={current:e},n=n2(n7)(r,t),a=n2(n9)(r),i=n2(n6.changes)(e),o=n2(n8)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return n6.selector(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r{n.current=!1}:e,t)};function ab(){}function aw(e,t,r,n){var a,i,o,s,l,c;return a=e,i=n,a.editor.getModel(ak(a,i))||(o=e,s=t,l=r,c=n,o.editor.createModel(s,l,c?ak(o,c):void 0))}function ak(e,t){return e.Uri.parse(t)}(0,l.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:p={},height:h="100%",width:m="100%",className:f,wrapperProps:g={},beforeMount:v=ab,onMount:x=ab}){let[y,b]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!0),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useRef)(x),E=(0,l.useRef)(v),M=(0,l.useRef)(!1);ax(()=>{let e=ah.init();return e.then(e=>(N.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(s||t?.original?.dispose(),c||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),ay(()=>{if(j.current&&N.current){let t=j.current.getOriginalEditor(),a=aw(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],y),ay(()=>{if(j.current&&N.current){let e=j.current.getModifiedEditor(),n=aw(N.current,t||"",a||r||"text",o||"");n!==e.getModel()&&e.setModel(n)}},[o],y),ay(()=>{let e=j.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),ay(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],y),ay(()=>{let{original:e,modified:t}=j.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],y),ay(()=>{N.current?.editor.setTheme(u)},[u],y),ay(()=>{j.current?.updateOptions(p)},[p],y);let P=(0,l.useCallback)(()=>{if(!N.current)return;E.current(N.current);let s=aw(N.current,e||"",n||r||"text",i||""),l=aw(N.current,t||"",a||r||"text",o||"");j.current?.setModel({original:s,modified:l})},[r,t,a,e,n,i,o]),D=(0,l.useCallback)(()=>{!M.current&&C.current&&(j.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...p}),P(),N.current?.editor.setTheme(u),b(!0),M.current=!0)},[p,u,P]);return(0,l.useEffect)(()=>{y&&S.current(j.current,N.current)},[y]),(0,l.useEffect)(()=>{w||y||D()},[w,y,D]),l.createElement(av,{width:m,height:h,isEditorReady:y,loading:d,_ref:C,className:f,wrapperProps:g})});var aj=function(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current},aN=new Map,aC=(0,l.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:o="light",line:s,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:p=!0,keepCurrentModel:h=!1,width:m="100%",height:f="100%",className:g,wrapperProps:v={},beforeMount:x=ab,onMount:y=ab,onChange:b,onValidate:w=ab}){let[k,j]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),S=(0,l.useRef)(null),E=(0,l.useRef)(null),M=(0,l.useRef)(null),P=(0,l.useRef)(y),D=(0,l.useRef)(x),T=(0,l.useRef)(),I=(0,l.useRef)(n),A=aj(i),R=(0,l.useRef)(!1),L=(0,l.useRef)(!1);ax(()=>{let e=ah.init();return e.then(e=>(S.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>E.current?void(T.current?.dispose(),h?p&&aN.set(i,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()):e.cancel()}),ay(()=>{let o=aw(S.current,e||n||"",t||a||"",i||r||"");o!==E.current?.getModel()&&(p&&aN.set(A,E.current?.saveViewState()),E.current?.setModel(o),p&&E.current?.restoreViewState(aN.get(i)))},[i],k),ay(()=>{E.current?.updateOptions(u)},[u],k),ay(()=>{E.current&&void 0!==n&&(E.current.getOption(S.current.editor.EditorOption.readOnly)?E.current.setValue(n):n!==E.current.getValue()&&(L.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),E.current.pushUndoStop(),L.current=!1))},[n],k),ay(()=>{let e=E.current?.getModel();e&&a&&S.current?.editor.setModelLanguage(e,a)},[a],k),ay(()=>{void 0!==s&&E.current?.revealLine(s)},[s],k),ay(()=>{S.current?.editor.setTheme(o)},[o],k);let z=(0,l.useCallback)(()=>{if(!(!M.current||!S.current)&&!R.current){D.current(S.current);let l=i||r,c=aw(S.current,n||e||"",t||a||"",l||"");E.current=S.current?.editor.create(M.current,{model:c,automaticLayout:!0,...u},d),p&&E.current.restoreViewState(aN.get(l)),S.current.editor.setTheme(o),void 0!==s&&E.current.revealLine(s),j(!0),R.current=!0}},[e,t,r,n,a,i,u,d,p,o,s]);return(0,l.useEffect)(()=>{k&&P.current(E.current,S.current)},[k]),(0,l.useEffect)(()=>{N||k||z()},[N,k,z]),I.current=n,(0,l.useEffect)(()=>{k&&b&&(T.current?.dispose(),T.current=E.current?.onDidChangeModelContent(e=>{L.current||b(E.current.getValue(),e)}))},[k,b]),(0,l.useEffect)(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,w]),l.createElement(av,{width:m,height:f,isEditorReady:k,loading:c,_ref:M,className:g,wrapperProps:v})});let aS=(0,v.A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),aE=(0,v.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var aM=r(93613);function aP({projectId:e,onFilesChange:t,onClose:r}){let[n,a]=(0,l.useState)(new Map),[i,o]=(0,l.useState)(null),{resolvedTheme:c}=(0,ns.D)(),[u,d]=(0,l.useState)(!1),f=(e,t)=>{t&&t.stopPropagation();let r=n.get(e);if((!r?.modified||confirm(`Close ${r.file.name} without saving?`))&&(a(t=>{let r=new Map(t);return r.delete(e),r}),i===e)){let t=Array.from(n.keys()).filter(t=>t!==e);o(t.length>0?t[t.length-1]:null)}},g=(0,l.useCallback)((e,t)=>{void 0!==e&&"text"===y(t).type&&a(r=>{let n=new Map(r),a=n.get(t);return a&&n.set(t,{...a,content:e,modified:a.file.content!==e}),n})},[]),v=(0,l.useCallback)(async t=>{let r=n.get(t);if(r&&r.modified)try{await p.OP.init();let n=await p.OP.updateFile(e,t,r.content);a(e=>{let a=new Map(e);return a.set(t,{file:n,content:r.content,modified:!1}),a}),window.dispatchEvent(new CustomEvent("fileContentChanged",{detail:{path:t,projectId:e}}))}catch(e){h.v.error("Failed to save file:",e)}},[n,e]);(0,l.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),i&&v(i))},[i,v]);let y=e=>{let t=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(t||""))return{type:"image",language:"plaintext"};let r={js:"javascript",mjs:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",json:"json",md:"markdown",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"};return r[t||""]?{type:"text",language:r[t||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(t||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},w=e=>y(e).language,j=i?n.get(i):null;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aS,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),r?(0,s.jsxs)("button",{type:"button",onClick:r,"aria-label":"Hide code editor",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aS,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(aS,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),j?.modified&&"text"===y(j.file.path).type&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>v(i),children:[(0,s.jsx)(aE,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===n.size?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(x,{className:"h-12 w-12 mx-auto opacity-50"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,s.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"border-b bg-muted/70",children:(0,s.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(n.entries()).map(([e,t])=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",i===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>o(e),children:[(0,s.jsxs)("span",{className:"text-sm",children:[t.file.name,t.modified&&(0,s.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>f(e,t),children:(0,s.jsx)(k.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),j&&(0,s.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=y(j.file.path);return"image"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,s.jsx)(b,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name})]}),(0,s.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,s.jsx)("img",{src:`data:image/${j.file.path.split(".").pop()};base64,${j.content}`,alt:j.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let t=e.target;if(t.style.display="none",!t.parentElement?.querySelector(".error-msg")){let e=document.createElement("div");e.className="error-msg text-sm text-muted-foreground flex items-center gap-2",e.innerHTML='Unable to display image',t.parentElement?.appendChild(e)}}})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)(aM.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:"This file type is not supported for editing in the text editor. Binary files and certain document formats cannot be displayed here."})]})]})}):(0,s.jsx)(aC,{height:"100%",language:w(j.file.path),value:j.content,onChange:e=>g(e,j.file.path),theme:u?"dark"===c?"vs-dark":"light":"vs-dark",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",wrappingIndent:"indent"}})})()})]})]})}function aD(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var aT=r(28559);let aI=(0,v.A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),aA=(0,v.A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),aR=(0,v.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var aL=r(3589),az=r(99526);function aO(){let[e,t]=(0,l.useState)(()=>r3.s.getCostSettings()),r=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:r}}var aF=r(10158);class aq{async initDB(){if(!this.isInitialized)return new Promise((e,t)=>{let r=indexedDB.open(this.dbName,1);r.onerror=()=>{h.v.error("Failed to open conversation database"),t(r.error)},r.onsuccess=()=>{this.db=r.result,this.isInitialized=!0,e()},r.onupgradeneeded=e=>{let t=e.target.result;if(!t.objectStoreNames.contains(this.storeName)){let e=t.createObjectStore(this.storeName,{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("lastUpdated","lastUpdated",{unique:!1})}}})}getConversationId(e){return`conv_${e}`}async loadConversationFromDB(e){if(await this.initDB(),!this.db)return null;let t=this.getConversationId(e);return new Promise((r,n)=>{let a=this.db.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let t=a.result;if(t){let n={id:t.id,projectId:t.projectId,messages:t.messages||[],lastUpdated:t.lastUpdated,version:t.version||1};this.conversationBreaks.set(e,t.breaks||[]),r(n)}else r(null)},a.onerror=()=>{h.v.error("Failed to load conversation from DB"),n(a.error)}})}async saveConversationToDB(e){if(await this.initDB(),!this.db)return;let t=this.conversationBreaks.get(e.projectId)||[],r={id:e.id,projectId:e.projectId,messages:e.messages,lastUpdated:e.lastUpdated,version:e.version,breaks:t};return new Promise((e,t)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to save conversation to DB"),t(n.error)}})}async deleteConversationFromDB(e){if(await this.initDB(),!this.db)return;let t=this.getConversationId(e);return new Promise((e,r)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to delete conversation from DB"),r(n.error)}})}async getConversation(e){let t=this.conversations.get(e);if(!t){let r=await this.loadConversationFromDB(e);t=r||{id:this.getConversationId(e),projectId:e,messages:[],lastUpdated:new Date().toISOString(),version:1},this.conversations.set(e,t)}return t}async updateConversation(e,t){let r=await this.getConversation(e);r.messages=[...t],r.lastUpdated=new Date().toISOString(),r.version+=1,this.conversations.set(e,r),await this.saveConversationToDB(r),h.v.debug(`[ConversationState] Updated conversation for project ${e} with ${t.length} messages`)}async clearConversation(e){let t=await this.getConversation(e);await this.recordConversationBreak(e,{type:"clear",timestamp:new Date().toISOString(),description:"User cleared chat"}),t.messages=[],t.lastUpdated=new Date().toISOString(),t.version+=1,this.conversations.set(e,t),await this.saveConversationToDB(t),h.v.debug(`[ConversationState] Cleared conversation for project ${e}`)}async recordConversationBreak(e,t){let r=this.conversationBreaks.get(e)||[];r.push(t),r.length>20&&(r=r.slice(-20)),this.conversationBreaks.set(e,r);let n=this.conversations.get(e);n&&await this.saveConversationToDB(n),h.v.debug(`[ConversationState] Recorded conversation break for project ${e}:`,t.type)}getRecentBreaks(e,t=5){return(this.conversationBreaks.get(e)||[]).slice(-t)}async addBreakContextMessage(e,t){let r,n=await this.getConversation(e);switch(t.type){case"checkpoint_restore":r=`[Context: Project was restored to checkpoint "${t.description||"previous state"}" at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"retry":r=`[Context: Retrying previous request after restoring to checkpoint at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"page_refresh":r=`[Context: Session resumed after page refresh at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"manual_save":r=`[Context: Project saved manually at ${new Date(t.timestamp).toLocaleTimeString()}${t.description?` (${t.description})`:""}]`;break;default:return}let a={role:"system",content:r};n.messages.push(a),await this.updateConversation(e,n.messages)}async getConversationMessages(e,t){let r=await this.getConversation(e);if(!t||r.messages.length<=t)return[...r.messages];let n=[...r.messages],a=n.filter(e=>"system"===e.role),i=n.filter(e=>"system"!==e.role).slice(-(t-a.length));return[...a,...i]}async deleteProject(e){this.conversations.delete(e),this.conversationBreaks.delete(e),await this.deleteConversationFromDB(e),h.v.debug(`[ConversationState] Deleted all conversation data for project ${e}`)}async getConversationStats(e){let t=await this.getConversation(e),r=this.conversationBreaks.get(e)||[];return{messageCount:t.messages.length,lastUpdated:t.lastUpdated,breaks:r.length,version:t.version}}constructor(){this.conversations=new Map,this.conversationBreaks=new Map,this.dbName="DeepStudioConversations",this.storeName="conversations",this.db=null,this.isInitialized=!1}}let aB=new aq;class a_{static convertToOrchestratorMessages(e){let t=[];for(let r of e)if(!r.isTask){if("user"===r.role)t.push({role:"user",content:r.content||""});else if("assistant"===r.role){let e={role:"assistant",content:r.content||""};if(r.toolCalls&&r.toolCalls.length>0&&(e.tool_calls=r.toolCalls),r.toolMessages&&!e.tool_calls){let t=[];for(let e of r.toolMessages)"tool"===e.type&&e.name&&t.push({id:e.id||`tool_${t.length}`,type:"function",function:{name:e.name,arguments:JSON.stringify(e.parameters||{})}});t.length>0&&(e.tool_calls=t)}if((r.checkpointId||r.cost||r.usage||r.toolMessages)&&(e.ui_metadata={},r.checkpointId&&(e.ui_metadata.checkpointId=r.checkpointId),r.cost&&(e.ui_metadata.cost=r.cost),r.usage&&(e.ui_metadata.usage=r.usage),r.toolMessages&&(e.ui_metadata.toolMessages=r.toolMessages)),r.toolMessages){let t=r.toolMessages,n=[];for(let e of t)"message"===e.type&&e.content&&n.push(e.content);if(n.length>0){let t=[e.content,...n].filter(e=>e&&e.trim()).join("\n\n");e.content=t}}if(t.push(e),r.toolMessages){let e=r.toolMessages;for(let r=0;r`${e}_recovered_${r++}`;for(let r=0;r0&&(i.toolCalls=e)}if(!i.toolMessages&&a.tool_calls&&a.tool_calls.length>0){let t=[];for(let i of(a.content&&a.content.trim()&&t.push({id:n("msg"),type:"message",content:a.content}),a.tool_calls)){let a=i.id||n("tool"),o={};if(i.function?.arguments)try{o=JSON.parse(i.function.arguments)}catch{o={arguments:i.function.arguments}}let s=null;for(let t=r+1;t0&&(i.toolMessages=t),i.toolCalls=a.tool_calls}t.push(i)}}}return h.v.debug(`[ConversationConverter] Converted ${e.length} orchestrator messages to ${t.length} UI messages`),t}static truncateConversation(e,t=50){if(e.length<=t)return e;let r=e.filter(e=>"system"===e.role),n=e.filter(e=>"system"!==e.role),a=t-r.length;return a<=0?r:[...r,...n.slice(-a)]}static createContextMessage(e,t){return{role:"system",content:`[Context: ${t}]`}}static prepareConversationForOrchestrator(e,t={}){let r=this.convertToOrchestratorMessages(e);return t.includeSystemPrompt&&t.systemPrompt&&(r.some(e=>"system"===e.role)||r.unshift({role:"system",content:t.systemPrompt})),t.maxMessages&&(r=this.truncateConversation(r,t.maxMessages)),h.v.debug(`[ConversationConverter] Prepared ${r.length} messages for orchestrator`),r}}var a$=r(57462);let aU=(0,v.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),aH=(0,l.createContext)(null);aH.displayName="PanelGroupContext";let aV={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},aW=c["useId".toString()],aG="function"==typeof aW?aW:()=>null,aK=0;function aY(e=null){let t=aG(),r=(0,l.useRef)(e||t||null);return null===r.current&&(r.current=""+aK++),null!=e?e:r.current}function aJ({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:o,maxSize:s,minSize:c,onCollapse:u,onExpand:d,onResize:p,order:h,style:m,tagName:f="div",...g}){let v=(0,l.useContext)(aH);if(null===v)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:x,expandPanel:y,getPanelSize:b,getPanelStyle:w,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:N,registerPanel:C,resizePanel:S,unregisterPanel:E}=v,M=aY(o),P=(0,l.useRef)({callbacks:{onCollapse:u,onExpand:d,onResize:p},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:c},id:M,idIsFromProps:void 0!==o,order:h});(0,l.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,l.useImperativeHandle)(i,()=>({collapse:()=>{x(P.current)},expand:e=>{y(P.current,e)},getId:()=>M,getSize:()=>b(P.current),isCollapsed:()=>j(P.current),isExpanded:()=>!j(P.current),resize:e=>{S(P.current,e)}}),[x,y,b,j,M,S]);let D=w(P.current,a);return(0,l.createElement)(f,{...g,children:e,className:t,id:M,style:{...D,...m},[aV.groupId]:k,[aV.panel]:"",[aV.panelCollapsible]:n||void 0,[aV.panelId]:M,[aV.panelSize]:parseFloat(""+D.flexGrow).toFixed(1)})}let aX=(0,l.forwardRef)((e,t)=>(0,l.createElement)(aJ,{...e,forwardedRef:t}));aJ.displayName="Panel",aX.displayName="forwardRef(Panel)";let aZ=null,aQ=-1,a0=null;function a1(e,t,r){var a,i,o;0;let s=function(e,t,r){let n=(t&it)!=0,a=(t&ir)!=0,i=(t&ia)!=0,o=(t&ii)!=0;!1;if(t){if(n)if(i)return"se-resize";else if(o)return"ne-resize";else return"e-resize";else if(a)if(i)return"sw-resize";else if(o)return"nw-resize";else return"w-resize";else if(i)return"s-resize";else if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,t,r);if(aZ!==s){if(aZ=s,null===a0){a0=document.createElement("style");n&&a0.setAttribute("nonce",n),document.head.appendChild(a0)}aQ>=0&&(null==(o=a0.sheet)||o.removeRule(aQ)),aQ=null!=(a=null==(i=a0.sheet)?void 0:i.insertRule(`*{cursor: ${s} !important;}`))?a:-1}}function a2(e){return"keydown"===e.type}function a3(e){return e.type.startsWith("pointer")}function a4(e){return e.type.startsWith("mouse")}function a5(e){if(a3(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(a4(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let a6=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function a8(e){let t=e.length;for(;t--;){let r=e[t];if(iw(r,"Missing node"),function(e){let t=getComputedStyle(e);return!!("fixed"===t.position||"auto"!==t.zIndex&&("static"!==t.position||function(e){var t;let r=getComputedStyle(null!=(t=ie(e))?t:e).display;return"flex"===r||"inline-flex"===r}(e))||1>+t.opacity||"transform"in t&&"none"!==t.transform||"webkitTransform"in t&&"none"!==t.webkitTransform||"mixBlendMode"in t&&"normal"!==t.mixBlendMode||"filter"in t&&"none"!==t.filter||"webkitFilter"in t&&"none"!==t.webkitFilter||"isolation"in t&&"isolate"===t.isolation||a6.test(t.willChange))||"touch"===t.webkitOverflowScrolling}(r))return r}return null}function a9(e){return e&&Number(getComputedStyle(e).zIndex)||0}function a7(e){let t=[];for(;e;)t.push(e),e=ie(e);return t}function ie(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let it=1,ir=2,ia=4,ii=8,io="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),is=[],il=!1,ic=new Map,iu=new Map,id=new Set;function ip(e){let{target:t}=e,{x:r,y:n}=a5(e);il=!0,iv({target:t,x:r,y:n}),iy(),is.length>0&&(ib("down",e),ix(),e.preventDefault(),ig(t)||e.stopImmediatePropagation())}function ih(e){let{x:t,y:r}=a5(e);if(il&&0===e.buttons&&(il=!1,ib("up",e)),!il){let{target:n}=e;iv({target:n,x:t,y:r})}ib("move",e),ix(),is.length>0&&e.preventDefault()}function im(e){let{target:t}=e,{x:r,y:n}=a5(e);iu.clear(),il=!1,is.length>0&&(e.preventDefault(),ig(t)||e.stopImmediatePropagation()),ib("up",e),iv({target:t,x:r,y:n}),ix(),iy()}function ig(e){let t=e;for(;t;){if(t.hasAttribute(aV.resizeHandle))return!0;t=t.parentElement}return!1}function iv({target:e,x:t,y:r}){is.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),id.forEach(e=>{let{element:a,hitAreaMargins:i}=e,o=a.getBoundingClientRect(),{bottom:s,left:l,right:c,top:u}=o,d=io?i.coarse:i.fine;if(t>=l-d&&t<=c+d&&r>=u-d&&r<=s+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:a7(e),b:a7(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;iw(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:a9(a8(n.a)),b:a9(a8(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e&&!e.contains(a);){var p,h;if(p=e.getBoundingClientRect(),h=o,p.xh.x&&p.yh.y){t=!0;break}e=e.parentElement}if(t)return}is.push(e)}})}function ix(){let e=!1,t=!1;is.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;iu.forEach(e=>{r|=e}),e&&t?a1("intersection",r,il):e?a1("horizontal",r,il):t?a1("vertical",r,il):null!==a0&&(document.head.removeChild(a0),aZ=null,a0=null,aQ=-1)}function iy(){var e;null==(e=a)||e.abort();let t={capture:!0,signal:(a=new AbortController).signal};id.size&&(il?(is.length>0&&ic.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("contextmenu",im,t),n.addEventListener("pointerleave",ih,t),n.addEventListener("pointermove",ih,t))}),ic.forEach((e,r)=>{let{body:n}=r;n.addEventListener("pointerup",im,t),n.addEventListener("pointercancel",im,t)})):ic.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("pointerdown",ip,t),n.addEventListener("pointermove",ih,t))}))}function ib(e,t){id.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,is.includes(r),t)})}function iw(e,t){if(!e)throw console.error(t),Error(t)}function ik(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function ij(e,t,r=10){return 0===ik(e,t,r)}function iN(e,t,r){return 0===ik(e,t,r)}function iC({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];iw(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:o=100,minSize:s=0}=n;return 0>ik(r,s)&&(r=i&&0>ik(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(o,r)).toFixed(10))}function iS({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(iN(e,0))return t;let o=[...t],[s,l]=n;iw(null!=s,"Invalid first pivot index"),iw(null!=l,"Invalid second pivot index");let c=0;if("keyboard"===i){{let n=e<0?l:s,a=r[n];iw(a,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(iw(null!=r,`Previous layout not found for panel index ${n}`),iN(r,i)){let t=c-r;ik(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];iw(a,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(iw(null!=r,`Previous layout not found for panel index ${n}`),iN(r,c)){let t=r-i;ik(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,i=0;for(;;){let e=t[a];if(iw(null!=e,`Previous layout not found for panel index ${a}`),i+=iC({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let n=e<0?s:l;for(;n>=0&&n=0))break;e<0?n--:n++}}if(function(e,t,r){if(e.length!==t.length)return!1;for(let r=0;r=0&&n0?n--:n++}}}return iN(o.reduce((e,t)=>t+e,0),100)?o:a}function iE(e,t=document){return Array.from(t.querySelectorAll(`[${aV.resizeHandleId}][data-panel-group-id="${e}"]`))}function iM(e,t,r=document){let n=iE(e,r).findIndex(e=>e.getAttribute(aV.resizeHandleId)===t);return null!=n?n:null}function iP(e,t,r){let n=iM(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function iD(e,t=document){if((t instanceof HTMLElement||"object"==typeof t&&null!==t&&"tagName"in t&&"getAttribute"in t)&&t.dataset.panelGroupId==e)return t;let r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function iT(e,t=document){let r=t.querySelector(`[${aV.resizeHandleId}="${e}"]`);return r||null}function iI(e,t){let{x:r,y:n}=a5(t);return"horizontal"===e?r:n}function iA(e,t,r){t.forEach((t,n)=>{let a=e[n];iw(a,`Panel data not found for index ${n}`);let{callbacks:i,constraints:o,id:s}=a,{collapsedSize:l=0,collapsible:c}=o,u=r[s];if(null==u||t!==u){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=i;a&&a(t,u),c&&(e||n)&&(n&&(null==u||ij(u,l))&&!ij(t,l)&&n(),e&&(null==u||!ij(u,l))&&ij(t,l)&&e())}})}function iR(e,t){if(e.length!==t.length)return!1;for(let r=0;rlocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function iz(e){return`react-resizable-panels:${e}`}function iO(e,t,r,n,a){var i;let o=iz(e),s=t.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),l=null!=(i=function(e,t){try{let r=iz(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,a))?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(o,JSON.stringify(l))}catch(e){console.error(e)}}let iF={getItem:e=>(iL(iF),iF.getItem(e)),setItem:(e,t)=>{iL(iF),iF.setItem(e,t)}},iq={};function iB({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=iF,style:u,tagName:d="div",...p}){let h=aY(i),m=(0,l.useRef)(null),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)([]),y=function(){let[e,t]=(0,l.useState)(0);return(0,l.useCallback)(()=>t(e=>e+1),[])}(),b=(0,l.useRef)({}),w=(0,l.useRef)(new Map),k=(0,l.useRef)(0),j=(0,l.useRef)({autoSaveId:e,direction:n,dragState:f,id:h,keyboardResizeBy:s,onLayout:o,storage:c}),N=(0,l.useRef)({layout:v,panelDataArray:[],panelDataArrayChanged:!1});(0,l.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,l.useImperativeHandle)(a,()=>({getId:()=>j.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current,a=function({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!iN(n,100)&&r.length>0)for(let e=0;ee.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{if(!i)return;let e=t.current;iw(e,"Eager values not found");let{panelDataArray:a}=e;iw(null!=iD(r,i),`No group found for id "${r}"`);let s=iE(r,i);iw(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(aV.resizeHandleId);iw(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,i,o,s;let l=iT(t,n),c=iE(e,n),u=l?c.indexOf(l):-1;return[null!=(a=null==(i=r[u])?void 0:i.id)?a:null,null!=(o=null==(s=r[u+1])?void 0:s.id)?o:null]}(r,t,a,i);if(null==s||null==l)return()=>{};let c=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];iw(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(null!=s&&u){let e=iS({delta:iN(s,c)?d-c:c-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:iP(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&o(e)}}}};return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,a,o])}({committedValuesRef:j,eagerValuesRef:N,groupId:h,layout:v,panelDataArray:N.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),(0,l.useEffect)(()=>{let{panelDataArray:t}=N.current;if(e){if(0===v.length||v.length!==t.length)return;let r=iq[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(iO,100),iq[e]=r),r(e,[...t],new Map(w.current),v,c)}},[e,v,c]),(0,l.useEffect)(()=>{});let C=(0,l.useCallback)(e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:o,pivotIndices:s}=iU(n,e,r);if(iw(null!=o,`Panel size not found for panel "${e.id}"`),!ij(o,i)){w.current.set(e.id,o);let l=iS({delta:i$(n,e)===n.length-1?o-i:i-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});iR(r,l)||(x(l),N.current.layout=l,t&&t(l),iA(n,l,b.current))}}},[]),S=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current;if(e.constraints.collapsible){let i=a.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:l=0,pivotIndices:c}=iU(a,e,n),u=null!=t?t:l;if(ij(s,o)){let t=w.current.get(e.id),o=null!=t&&t>=u?t:u,l=iS({delta:i$(a,e)===a.length-1?s-o:o-s,initialLayout:n,panelConstraints:i,pivotIndices:c,prevLayout:n,trigger:"imperative-api"});iR(n,l)||(x(l),N.current.layout=l,r&&r(l),iA(a,l,b.current))}}},[]),E=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{panelSize:n}=iU(r,e,t);return iw(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),M=(0,l.useCallback)((e,t)=>{let{panelDataArray:r}=N.current,n=i$(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){let o,s=r[a];return{flexBasis:0,flexGrow:null==s?void 0!=e?e.toFixed(i):"1":1===n.length?"1":s.toFixed(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:f,layout:v,panelData:r,panelIndex:n})},[f,v]),P=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=iU(r,e,t);return iw(null!=i,`Panel size not found for panel "${e.id}"`),!0===a&&ij(i,n)},[]),D=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=iU(r,e,t);return iw(null!=i,`Panel size not found for panel "${e.id}"`),!a||ik(i,n)>0},[]),T=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),N.current.panelDataArrayChanged=!0,y()},[y]),I=(0,l.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let i=m.current;if(!i)return()=>null;let{direction:o,dragState:s,id:l,keyboardResizeBy:c,onLayout:u}=j.current,{layout:d,panelDataArray:p}=N.current,{initialLayout:h}=null!=s?s:{},f=iP(l,e,i),g=function(e,t,r,n,a,i){if(a2(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,a){let i="horizontal"===r,o=iT(t,a);iw(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(aV.groupId);iw(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,c=iI(r,e),u=iD(s,a);iw(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect();return(c-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(r,e,o,s,c,i),v="horizontal"===o;v&&t&&(g=-g);let y=iS({delta:g,initialLayout:null!=h?h:d,panelConstraints:p.map(e=>e.constraints),pivotIndices:f,prevLayout:d,trigger:a2(r)?"keyboard":"mouse-or-touch"}),w=!iR(d,y);(a3(r)||a4(r))&&k.current!=g&&((k.current=g,w||0===g)?iu.set(e,0):v?(n=g<0?it:ir,iu.set(e,n)):(a=g<0?ia:ii,iu.set(e,a))),w&&(x(y),N.current.layout=y,u&&u(y),iA(p,y,b.current))}},[]),A=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current,i=a.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=iU(a,e,n);iw(null!=o,`Panel size not found for panel "${e.id}"`);let l=iS({delta:i$(a,e)===a.length-1?o-t:t-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});iR(n,l)||(x(l),N.current.layout=l,r&&r(l),iA(a,l,b.current))},[]),R=(0,l.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=N.current,{collapsedSize:a=0,collapsible:i}=t,{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:c=0}=e.constraints,{panelSize:u}=iU(n,e,r);null!=u&&(i&&s&&ij(u,a)?ij(a,o)||A(e,o):ul&&A(e,l))},[A]),L=(0,l.useCallback)((e,t)=>{let{direction:r}=j.current,{layout:n}=N.current;if(!m.current)return;let a=iT(e,m.current);iw(a,`Drag handle element not found for id "${e}"`);let i=iI(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),z=(0,l.useCallback)(()=>{g(null)},[]),O=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current,r=i$(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],N.current.panelDataArrayChanged=!0,y())},[y]),F=(0,l.useMemo)(()=>({collapsePanel:C,direction:n,dragState:f,expandPanel:S,getPanelSize:E,getPanelStyle:M,groupId:h,isPanelCollapsed:P,isPanelExpanded:D,reevaluatePanelConstraints:R,registerPanel:T,registerResizeHandle:I,resizePanel:A,startDragging:L,stopDragging:z,unregisterPanel:O,panelGroupElement:m.current}),[C,f,n,S,E,M,h,P,D,R,T,I,A,L,z,O]);return(0,l.createElement)(aH.Provider,{value:F},(0,l.createElement)(d,{...p,children:t,className:r,id:i,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},[aV.group]:"",[aV.groupDirection]:n,[aV.groupId]:h}))}let i_=(0,l.forwardRef)((e,t)=>(0,l.createElement)(iB,{...e,forwardedRef:t}));function i$(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function iU(e,t,r){let n=i$(e,t),a=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:a?[n-1,n]:[n,n+1]}}function iH({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:i,onClick:o,onDragging:s,onFocus:c,onPointerDown:u,onPointerUp:d,style:p={},tabIndex:h=0,tagName:m="div",...f}){var g,v;let x=(0,l.useRef)(null),y=(0,l.useRef)({onClick:o,onDragging:s,onPointerDown:u,onPointerUp:d});(0,l.useEffect)(()=>{y.current.onClick=o,y.current.onDragging=s,y.current.onPointerDown=u,y.current.onPointerUp=d});let b=(0,l.useContext)(aH);if(null===b)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:k,registerResizeHandle:j,startDragging:N,stopDragging:C,panelGroupElement:S}=b,E=aY(a),[M,P]=(0,l.useState)("inactive"),[D,T]=(0,l.useState)(!1),[I,A]=(0,l.useState)(null),R=(0,l.useRef)({state:M});(0,l.useEffect)(()=>{if(r)A(null);else{let e=j(E);A(()=>e)}},[r,E,j]);let L=null!=(g=null==n?void 0:n.coarse)?g:15,z=null!=(v=null==n?void 0:n.fine)?v:5;return(0,l.useEffect)(()=>{if(r||null==I)return;let e=x.current;iw(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var i;let{ownerDocument:o}=t,s={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},l=null!=(i=ic.get(o))?i:0;return ic.set(o,l+1),id.add(s),iy(),function(){var t;iu.delete(e),id.delete(s);let r=null!=(t=ic.get(o))?t:1;if(ic.set(o,r-1),iy(),1===r&&ic.delete(o),is.includes(s)){let e=is.indexOf(s);e>=0&&is.splice(e,1),ix(),a("up",!0,null)}}}(E,e,w,{coarse:L,fine:z},(e,r,n)=>{if(!r)return void P("inactive");switch(e){case"down":{P("drag"),t=!1,iw(n,'Expected event to be defined for "down" action'),N(E,n);let{onDragging:e,onPointerDown:r}=y.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=R.current;t=!0,"drag"!==e&&P("hover"),iw(n,'Expected event to be defined for "move" action'),I(n);break}case"up":{P("hover"),C();let{onClick:e,onDragging:r,onPointerUp:n}=y.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[L,w,r,z,j,E,I,N,C]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,l.useEffect)(()=>{if(e||null==r||null==n)return;let a=iT(t,n);if(null==a)return;let i=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(aV.groupId);iw(r,`No group element found for id "${r}"`);let i=iE(r,n),o=iM(r,t,n);iw(null!==o,`No resize element found for id "${t}"`);let s=e.shiftKey?o>0?o-1:i.length-1:o+1{a.removeEventListener("keydown",i)}},[n,e,t,r])}({disabled:r,handleId:E,resizeHandler:I,panelGroupElement:S}),(0,l.createElement)(m,{...f,children:e,className:t,id:a,onBlur:()=>{T(!1),null==i||i()},onFocus:()=>{T(!0),null==c||c()},ref:x,role:"separator",style:{touchAction:"none",userSelect:"none",...p},tabIndex:h,[aV.groupDirection]:w,[aV.groupId]:k,[aV.resizeHandle]:"",[aV.resizeHandleActive]:"drag"===M?"pointer":D?"keyboard":void 0,[aV.resizeHandleEnabled]:!r,[aV.resizeHandleId]:E,[aV.resizeHandleState]:M})}iB.displayName="PanelGroup",i_.displayName="forwardRef(PanelGroup)",iH.displayName="PanelResizeHandle";let iV=({className:e,...t})=>(0,s.jsx)(i_,{className:(0,h.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),iW=({withHandle:e,className:t,...r})=>(0,s.jsx)(iH,{className:(0,h.cn)("group relative flex w-2 mx-1 items-center justify-center bg-transparent hover:bg-border/50 transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-2 data-[panel-group-direction=vertical]:my-1 data-[panel-group-direction=vertical]:mx-0 data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 cursor-col-resize data-[panel-group-direction=vertical]:cursor-row-resize",t),...r,children:e&&(0,s.jsx)("div",{className:"z-10 flex h-12 w-1 items-center justify-center rounded-full bg-border/30 hover:bg-border/50 transition-colors opacity-0 group-hover:opacity-100",children:(0,s.jsx)(aU,{className:"h-3 w-3 text-muted-foreground/50"})})});var iG=r(69024),[iK,iY]=(0,J.A)("Tooltip",[ei.Bk]),iJ=(0,ei.Bk)(),iX="TooltipProvider",iZ="tooltip.open",[iQ,i0]=iK(iX),i1=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=l.useRef(!0),c=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,s.jsx)(iQ,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};i1.displayName=iX;var i2="Tooltip",[i3,i4]=iK(i2),i5=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,u=i0(i2,e.__scopeTooltip),d=iJ(t),[p,h]=l.useState(null),m=(0,ea.B)(),f=l.useRef(0),g=o??u.disableHoverableContent,v=c??u.delayDuration,x=l.useRef(!1),[y,b]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(iZ))):u.onClose(),i?.(e)},caller:i2}),w=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),j=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),N=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},v)},[v,b]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,s.jsx)(ei.bL,{...d,children:(0,s.jsx)(i3,{scope:t,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:l.useCallback(()=>{g?j():(window.clearTimeout(f.current),f.current=0)},[j,g]),onOpen:k,onClose:j,disableHoverableContent:g,children:r})})};i5.displayName=i2;var i6="TooltipTrigger",i8=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=i4(i6,r),i=i0(i6,r),o=iJ(r),c=l.useRef(null),u=(0,Y.s)(t,c,a.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),(0,s.jsx)(ei.Mz,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:(0,K.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(p.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),p.current=!0))}),onPointerLeave:(0,K.mK)(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:(0,K.mK)(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:(0,K.mK)(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:(0,K.mK)(e.onBlur,a.onClose),onClick:(0,K.mK)(e.onClick,a.onClose)})})});i8.displayName=i6;var i9="TooltipPortal",[i7,oe]=iK(i9,{forceMount:void 0}),ot=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=i4(i9,t);return(0,s.jsx)(i7,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};ot.displayName=i9;var or="TooltipContent",on=l.forwardRef((e,t)=>{let r=oe(or,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=i4(or,e.__scopeTooltip);return(0,s.jsx)(es.C,{present:n||o.open,children:o.disableHoverableContent?(0,s.jsx)(ol,{side:a,...i,ref:t}):(0,s.jsx)(oa,{side:a,...i,ref:t})})}),oa=l.forwardRef((e,t)=>{let r=i4(or,e.__scopeTooltip),n=i0(or,e.__scopeTooltip),a=l.useRef(null),i=(0,Y.s)(t,a),[o,c]=l.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:h}=n,m=l.useCallback(()=>{c(null),h(!1)},[h]),f=l.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());c(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,a),...function(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}(t.getBoundingClientRect())])),h(!0)},[h]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){let e=e=>f(e,p),t=e=>f(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,f,m]),l.useEffect(()=>{if(o){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||p?.contains(t),a=!function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}(r,o);n?m():a&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,o,d,m]),(0,s.jsx)(ol,{...e,ref:i})}),[oi,oo]=iK(i2,{isInside:!1}),os=(0,eC.Dc)("TooltipContent"),ol=l.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,u=i4(or,r),d=iJ(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(iZ,p),()=>document.removeEventListener(iZ,p)),[p]),l.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,s.jsxs)(ei.UC,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,s.jsx)(os,{children:n}),(0,s.jsx)(oi,{scope:r,isInside:!0,children:(0,s.jsx)(iG.bL,{id:u.contentId,role:"tooltip",children:a||n})})]})})});on.displayName=or;var oc="TooltipArrow",ou=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=iJ(r);return oo(oc,r).isInside?null:(0,s.jsx)(ei.i3,{...a,...n,ref:t})});function od({delayDuration:e=0,...t}){return(0,s.jsx)(i1,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function op({...e}){return(0,s.jsx)(od,{children:(0,s.jsx)(i5,{"data-slot":"tooltip",...e})})}function oh({...e}){return(0,s.jsx)(i8,{"data-slot":"tooltip-trigger",...e})}function om({className:e,sideOffset:t=0,children:r,arrowStyle:n,...a}){return(0,s.jsx)(ot,{children:(0,s.jsxs)(on,{"data-slot":"tooltip-content",sideOffset:t,className:(0,h.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[r,(0,s.jsx)(ou,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:n})]})})}ou.displayName=oc;var of=r(48730);let og={pending:(0,s.jsx)(of.A,{className:"h-4 w-4 text-muted-foreground"}),in_progress:(0,s.jsx)(nv.A,{className:"h-4 w-4 text-blue-500 animate-spin"}),success:(0,s.jsx)(w.A,{className:"h-4 w-4 text-green-500"}),failed:(0,s.jsx)(k.A,{className:"h-4 w-4 text-red-500"}),skipped:(0,s.jsx)("span",{className:"text-muted-foreground",children:"⊘"})},ov={pending:"text-muted-foreground",in_progress:"text-blue-500",success:"text-green-500",failed:"text-red-500",skipped:"text-gray-400"};function ox({title:e,steps:t,checkpointId:r,onRestore:n,isSavedCheckpoint:a,expanded:i=!0,onToggleExpand:o}){let l=t.filter(e=>"success"===e.status).length,c=t.filter(e=>"failed"===e.status).length,u=t.some(e=>"in_progress"===e.status),d=t.every(e=>"pending"!==e.status&&"in_progress"!==e.status),p=r&&d?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(rO.E,{variant:a?"default":"outline",className:"h-6 px-2 text-xs",children:a?"Saved version":"Checkpoint"}),n&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>n(r),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aI,{className:"h-3 w-3 mr-1"}),"Restore"]})]}):null;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 flex-1",children:[(0,s.jsx)("button",{onClick:o,className:"mt-0.5 hover:bg-muted rounded p-0.5","aria-label":i?"Collapse":"Expand",children:i?(0,s.jsx)(nw.A,{className:"h-4 w-4"}):(0,s.jsx)(tJ,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e}),u&&(0,s.jsx)("span",{className:"text-xs text-blue-500 animate-pulse",children:"In Progress..."}),d&&(0,s.jsx)("span",{className:(0,h.cn)("text-xs",0===c?"text-green-500":"text-orange-500"),children:0===c?"✓ Complete":`⚠ ${l}/${t.length} succeeded`})]}),!i&&t.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(w.A,{className:"h-3 w-3 text-green-500"}),l]}),c>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(k.A,{className:"h-3 w-3 text-red-500"}),c]}),(0,s.jsxs)("span",{children:[t.length," total"]})]})]})]})}),i&&t.length>0&&(0,s.jsx)("div",{className:"ml-6 space-y-1 text-sm",children:t.map(e=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-start gap-2 py-1",ov[e.status]),children:[(0,s.jsx)("span",{className:"mt-0.5",children:og[e.status]}),(0,s.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,s.jsx)("div",{children:e.description}),e.error&&(0,s.jsxs)("div",{className:"text-xs text-red-400 ml-6",children:["Error: ",e.error]})]})]},e.id))}),p&&(0,s.jsx)("div",{className:"ml-6",children:p})]})}var oy=r(5336),ob=r(35071);let ow=(0,v.A)("iteration-cw",[["path",{d:"M4 10a8 8 0 1 1 8 8H4",key:"svv66n"}],["path",{d:"m8 22-4-4 4-4",key:"6g7gki"}]]);var ok=r(45583);let oj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oC={};function oS(e,t){return((t||oC).jsx?oN:oj).test(e)}let oE=/[ \t\n\f\r]/g;function oM(e){return""===e.replace(oE,"")}class oP{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}function oD(e,t){let r={},n={};for(let t of e)Object.assign(r,t.property),Object.assign(n,t.normal);return new oP(r,n,t)}function oT(e){return e.toLowerCase()}oP.prototype.normal={},oP.prototype.property={},oP.prototype.space=void 0;class oI{constructor(e,t){this.attribute=t,this.property=e}}oI.prototype.attribute="",oI.prototype.booleanish=!1,oI.prototype.boolean=!1,oI.prototype.commaOrSpaceSeparated=!1,oI.prototype.commaSeparated=!1,oI.prototype.defined=!1,oI.prototype.mustUseProperty=!1,oI.prototype.number=!1,oI.prototype.overloadedBoolean=!1,oI.prototype.property="",oI.prototype.spaceSeparated=!1,oI.prototype.space=void 0;let oA=0,oR=o_(),oL=o_(),oz=o_(),oO=o_(),oF=o_(),oq=o_(),oB=o_();function o_(){return 2**++oA}let o$=Object.keys(i);class oU extends oI{constructor(e,t,r,n){let a=-1;if(super(e,t),function(e,t,r){r&&(e[t]=r)}(this,"space",n),"number"==typeof r)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function oW(e,t){return t in e?e[t]:t}function oG(e,t){return oW(e,t.toLowerCase())}let oK=oH({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oq,acceptCharset:oF,accessKey:oF,action:null,allow:null,allowFullScreen:oR,allowPaymentRequest:oR,allowUserMedia:oR,alt:null,as:null,async:oR,autoCapitalize:null,autoComplete:oF,autoFocus:oR,autoPlay:oR,blocking:oF,capture:null,charSet:null,checked:oR,cite:null,className:oF,cols:oO,colSpan:null,content:null,contentEditable:oL,controls:oR,controlsList:oF,coords:oO|oq,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oR,defer:oR,dir:null,dirName:null,disabled:oR,download:oz,draggable:oL,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oR,formTarget:null,headers:oF,height:oO,hidden:oz,high:oO,href:null,hrefLang:null,htmlFor:oF,httpEquiv:oF,id:null,imageSizes:null,imageSrcSet:null,inert:oR,inputMode:null,integrity:null,is:null,isMap:oR,itemId:null,itemProp:oF,itemRef:oF,itemScope:oR,itemType:oF,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oR,low:oO,manifest:null,max:null,maxLength:oO,media:null,method:null,min:null,minLength:oO,multiple:oR,muted:oR,name:null,nonce:null,noModule:oR,noValidate:oR,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oR,optimum:oO,pattern:null,ping:oF,placeholder:null,playsInline:oR,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oR,referrerPolicy:null,rel:oF,required:oR,reversed:oR,rows:oO,rowSpan:oO,sandbox:oF,scope:null,scoped:oR,seamless:oR,selected:oR,shadowRootClonable:oR,shadowRootDelegatesFocus:oR,shadowRootMode:null,shape:null,size:oO,sizes:null,slot:null,span:oO,spellCheck:oL,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oO,step:null,style:null,tabIndex:oO,target:null,title:null,translate:null,type:null,typeMustMatch:oR,useMap:null,value:oL,width:oO,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oF,axis:null,background:null,bgColor:null,border:oO,borderColor:null,bottomMargin:oO,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oR,declare:oR,event:null,face:null,frame:null,frameBorder:null,hSpace:oO,leftMargin:oO,link:null,longDesc:null,lowSrc:null,marginHeight:oO,marginWidth:oO,noResize:oR,noHref:oR,noShade:oR,noWrap:oR,object:null,profile:null,prompt:null,rev:null,rightMargin:oO,rules:null,scheme:null,scrolling:oL,standby:null,summary:null,text:null,topMargin:oO,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oO,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:oR,disableRemotePlayback:oR,prefix:null,property:null,results:oO,security:null,unselectable:null},space:"html",transform:oG}),oY=oH({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:oB,accentHeight:oO,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oO,amplitude:oO,arabicForm:null,ascent:oO,attributeName:null,attributeType:null,azimuth:oO,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oO,by:null,calcMode:null,capHeight:oO,className:oF,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oO,diffuseConstant:oO,direction:null,display:null,dur:null,divisor:oO,dominantBaseline:null,download:oR,dx:null,dy:null,edgeMode:null,editable:null,elevation:oO,enableBackground:null,end:null,event:null,exponent:oO,externalResourcesRequired:null,fill:null,fillOpacity:oO,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oq,g2:oq,glyphName:oq,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oO,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oO,horizOriginX:oO,horizOriginY:oO,id:null,ideographic:oO,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oO,k:oO,k1:oO,k2:oO,k3:oO,k4:oO,kernelMatrix:oB,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oO,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oO,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oO,overlineThickness:oO,paintOrder:null,panose1:null,path:null,pathLength:oO,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:oF,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oO,pointsAtY:oO,pointsAtZ:oO,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oB,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oB,rev:oB,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oB,requiredFeatures:oB,requiredFonts:oB,requiredFormats:oB,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oO,specularExponent:oO,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oO,strikethroughThickness:oO,string:null,stroke:null,strokeDashArray:oB,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oO,strokeOpacity:oO,strokeWidth:null,style:null,surfaceScale:oO,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oB,tabIndex:oO,tableValues:null,target:null,targetX:oO,targetY:oO,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oB,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oO,underlineThickness:oO,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oO,values:null,vAlphabetic:oO,vMathematical:oO,vectorEffect:null,vHanging:oO,vIdeographic:oO,version:null,vertAdvY:oO,vertOriginX:oO,vertOriginY:oO,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oO,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:oW}),oJ=oH({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),oX=oH({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oG}),oZ=oH({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),oQ=oD([oV,oK,oJ,oX,oZ],"html"),o0=oD([oV,oY,oJ,oX,oZ],"svg"),o1=/[A-Z]/g,o2=/-[a-z]/g,o3=/^data[-\w.:]+$/i;function o4(e){return"-"+e.toLowerCase()}function o5(e){return e.charAt(1).toUpperCase()}let o6={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var o8=r(11120);let o9=se("end"),o7=se("start");function se(e){return function(t){let r=t&&t.position&&t.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function st(e){return e&&"object"==typeof e?"position"in e||"type"in e?sn(e.position):"start"in e||"end"in e?sn(e):"line"in e||"column"in e?sr(e):"":""}function sr(e){return sa(e&&e.line)+":"+sa(e&&e.column)}function sn(e){return sr(e&&e.start)+"-"+sr(e&&e.end)}function sa(e){return e&&"number"==typeof e?e:1}class si extends Error{constructor(e,t,r){super(),"string"==typeof t&&(r=t,t=void 0);let n="",a={},i=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?n=e:!a.cause&&e&&(i=!0,n=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof r){let e=r.indexOf(":");-1===e?a.ruleId=r:(a.source=r.slice(0,e),a.ruleId=r.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=o?o.line:void 0,this.name=st(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}si.prototype.file="",si.prototype.name="",si.prototype.reason="",si.prototype.message="",si.prototype.stack="",si.prototype.column=void 0,si.prototype.line=void 0,si.prototype.ancestors=void 0,si.prototype.cause=void 0,si.prototype.fatal=void 0,si.prototype.place=void 0,si.prototype.ruleId=void 0,si.prototype.source=void 0;let so={}.hasOwnProperty,ss=new Map,sl=/[A-Z]/g,sc=new Set(["table","tbody","thead","tfoot","tr"]),su=new Set(["td","th"]),sd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sp(e,t,r){var n;return"element"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.tagName.toLowerCase()&&"html"===n.space&&(e.schema=o0),e.ancestors.push(t);let i=sg(e,t.tagName,!1),o=function(e,t){let r,n,a={};for(n in t.properties)if("children"!==n&&so.call(t.properties,n)){let i=function(e,t,r){let n=function(e,t){let r=oT(t),n=t,a=oI;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&o3.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(o2,o5);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!o2.test(e)){let r=e.replace(o1,o4);"-"!==r.charAt(0)&&(r="-"+r),t="data"+r}}a=oU}return new a(n,t)}(e.schema,t);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?function(e,t){let r={};return(""===e[e.length-1]?[...e,""]:e).join((r.padRight?" ":"")+","+(!1===r.padLeft?"":" ")).trim()}(r):r.join(" ").trim()),"style"===n.property){let t="object"==typeof r?r:function(e,t){try{return o8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let t=new si("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=sd+"#cannot-parse-style-attribute",t}}(e,String(r));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,r={};for(t in e)so.call(e,t)&&(r[function(e){let t=e.replace(sl,sx);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return r}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&n.space?o6[n.property]||n.property:n.attribute,r]}}(e,n,t.properties[n]);if(i){let[n,o]=i;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof o&&su.has(t.tagName)?r=o:a[n]=o}}return r&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),a}(e,t),s=sf(e,t);return sc.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&oM(e.value):oM(e))})),sh(e,o,i,t),sm(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sv(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.name&&"html"===n.space&&(e.schema=o0),e.ancestors.push(t);let i=null===t.name?e.Fragment:sg(e,t.name,!0),o=function(e,t){let r={};for(let n of t.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let t=n.data.estree.body[0];t.type;let a=t.expression;a.type;let i=a.properties[0];i.type,Object.assign(r,e.evaluater.evaluateExpression(i.argument))}else sv(e,t.position);else{let a,i=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let t=n.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else sv(e,t.position);else a=null===n.value||n.value;r[i]=a}return r}(e,t),s=sf(e,t);return sh(e,o,i,t),sm(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sv(e,t.position)}(e,t):"root"===t.type?function(e,t,r){let n={};return sm(n,sf(e,t)),e.create(t,e.Fragment,n,r)}(e,t,r):"text"===t.type?(n=0,t.value):void 0}function sh(e,t,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(t.node=n)}function sm(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function sf(e,t){let r=[],n=-1,a=e.passKeys?new Map:ss;for(;++ni?0:i+t:t>i?i:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);o0?(sj(e,e.length,0,t),e):t}class sC{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return r&&sS(this.left,r),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sS(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sS(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function s$(e,t,r,n){let a=n?n-1:Number.POSITIVE_INFINITY,i=0;return function(n){return sF(n)?(e.enter(r),function n(o){return sF(o)&&i++n))return;let s=a.events.length,l=s;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){r=a.events[l][1].end;break}e=!0}for(g(o),i=s;it;){let t=i[r];a.containerState=t[1],t[0].exit.call(a,e)}i.length=t}function v(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},sV={tokenize:function(e,t,r){return s$(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},sW={partial:!0,tokenize:function(e,t,r){return function(t){return sF(t)?s$(e,n,"linePrefix")(t):n(t)};function n(e){return null===e||sz(e)?t(e):r(e)}}},sG={resolve:function(e){return sE(e),e},tokenize:function(e,t){let r;return function(t){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(t)};function n(t){return null===t?a(t):sz(t)?e.check(sK,i,a)(t):(e.consume(t),n)}function a(r){return e.exit("chunkContent"),e.exit("content"),t(r)}function i(t){return e.consume(t),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},sK={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s$(e,a,"linePrefix")};function a(a){if(null===a||sz(a))return r(a);let i=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}},sY={tokenize:function(e){let t=this,r=e.attempt(sW,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,s$(e,e.attempt(this.parser.constructs.flow,n,e.attempt(sG,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r)}}},sJ={resolveAll:s0()},sX=sQ("string"),sZ=sQ("text");function sQ(e){return{resolveAll:s0("text"===e?s1:void 0),tokenize:function(t){let r=this,n=this.parser.constructs[e],a=t.attempt(n,i,o);return i;function i(e){return l(e)?a(e):o(e)}function o(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=n[e],a=-1;if(t)for(;++a=3&&(null===o||sz(o))?(e.exit("thematicBreak"),t(o)):r(o)}(o)}}},s3={continuation:{tokenize:function(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(sW,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,s$(e,t,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!sF(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(s5,t,a)(r))});function a(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,s$(e,e.attempt(s3,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,o=0;return function(t){let a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:sA(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(s2,r,s)(t):s(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return sA(a)&&++o<10?(e.consume(a),t):(!n.interrupt||o<2)&&(n.containerState.marker?a===n.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),s(a)):r(a)}(t)}return r(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(sW,n.interrupt?r:l,e.attempt(s4,u,c))}function l(e){return n.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return sF(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):r(t)}function u(r){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}}},s4={partial:!0,tokenize:function(e,t,r){let n=this;return s$(e,function(e){let a=n.events[n.events.length-1];return!sF(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},s5={partial:!0,tokenize:function(e,t,r){let n=this;return s$(e,function(e){let a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)},"listItemIndent",n.containerState.size+1)}},s6={continuation:{tokenize:function(e,t,r){let n=this;return function(t){return sF(t)?s$(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(n){return e.attempt(s6,t,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,r){let n=this;return function(t){if(62===t){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return sF(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}}};function s8(e,t,r,n,a,i,o,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return function(t){return 60===t?(e.enter(n),e.enter(a),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||sI(t)?r(t):(e.enter(n),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function d(r){return 62===r?(e.enter(i),e.consume(r),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(r))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||sz(t)?r(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function m(a){return!u&&(null===a||41===a||sO(a))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(a)):u999||null===d||91===d||93===d&&!o||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):93===d?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(n),t):sz(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||sz(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),o||(o=!sF(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function s7(e,t,r,n,a,i){let o;return function(t){return 34===t||39===t||40===t?(e.enter(n),e.enter(a),e.consume(t),e.exit(a),o=40===t?41:t,s):r(t)};function s(r){return r===o?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(i),l(r))}function l(t){return t===o?(e.exit(i),s(o)):null===t?r(t):sz(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s$(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||sz(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function le(e,t){let r;return function n(a){return sz(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):sF(a)?s$(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}function lt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let lr={partial:!0,tokenize:function(e,t,r){return function(t){return sO(t)?le(e,n)(t):r(t)};function n(t){return s7(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return sF(t)?s$(e,i,"whitespace")(t):i(t)}function i(e){return null===e||sz(e)?t(e):r(e)}}},ln={name:"codeIndented",tokenize:function(e,t,r){let n=this;return function(t){return e.enter("codeIndented"),s$(e,a,"linePrefix",5)(t)};function a(t){let a=n.events[n.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(r){return null===r?i(r):sz(r)?e.attempt(la,t,i)(r):(e.enter("codeFlowValue"),function r(n){return null===n||sz(n)?(e.exit("codeFlowValue"),t(n)):(e.consume(n),r)}(r))}(t):r(t)}function i(r){return e.exit("codeIndented"),t(r)}}},la={partial:!0,tokenize:function(e,t,r){let n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):sz(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):s$(e,i,"linePrefix",5)(t)}function i(e){let i=n.events[n.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):sz(e)?a(e):r(e)}}},li={name:"setextUnderline",resolveTo:function(e,t){let r,n,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){r=i;break}"paragraph"===e[i][1].type&&(n=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,r){let n,a=this;return function(t){var o;let s,l=a.events.length;for(;l--;)if("lineEnding"!==a.events[l][1].type&&"linePrefix"!==a.events[l][1].type&&"content"!==a.events[l][1].type){s="paragraph"===a.events[l][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),n=t,o=t,e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),sF(r)?s$(e,i,"lineSuffix")(r):i(r))}(o)):r(t)};function i(n){return null===n||sz(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}}},lo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ls=["pre","script","style","textarea"],ll={partial:!0,tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(sW,t,r)}}},lc={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return sz(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lu={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return null===t?r(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},ld={concrete:!0,name:"codeFenced",tokenize:function(e,t,r){let n,a=this,i={partial:!0,tokenize:function(e,t,r){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),sF(t)?s$(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===n?(e.enter("codeFencedFenceSequence"),function t(a){return a===n?(i++,e.consume(a),t):i>=s?(e.exit("codeFencedFenceSequence"),sF(a)?s$(e,c,"whitespace")(a):c(a)):r(a)}(t)):r(t)}function c(n){return null===n||sz(n)?(e.exit("codeFencedFence"),t(n)):r(n)}}},o=0,s=0;return function(t){var i=t;let c=a.events[a.events.length-1];return o=c&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,n=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===n?(s++,e.consume(a),t):s<3?r(a):(e.exit("codeFencedFenceSequence"),sF(a)?s$(e,l,"whitespace")(a):l(a))}(i)};function l(i){return null===i||sz(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(lu,u,m)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||sz(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):sF(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s$(e,c,"whitespace")(a)):96===a&&a===n?r(a):(e.consume(a),t)}(i))}function c(t){return null===t||sz(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||sz(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===n?r(a):(e.consume(a),t)}(t))}function u(t){return e.attempt(i,m,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return o>0&&sF(t)?s$(e,h,"linePrefix",o+1)(t):h(t)}function h(t){return null===t||sz(t)?e.check(lu,u,m)(t):(e.enter("codeFlowValue"),function t(r){return null===r||sz(r)?(e.exit("codeFlowValue"),h(r)):(e.consume(r),t)}(t))}function m(r){return e.exit("codeFenced"),t(r)}}},lp={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"⁡",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"⁠",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"⁡",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"⁣",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"��",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"},lh={}.hasOwnProperty;function lm(e){return!!lh.call(lp,e)&&lp[e]}let lf={name:"characterReference",tokenize:function(e,t,r){let n,a,i=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),n=31,a=sD,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=sR,c):(e.enter("characterReferenceValue"),n=7,a=sA,c(t))}function c(s){if(59===s&&o){let n=e.exit("characterReferenceValue");return a!==sD||lm(i.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)}return a(s)&&o++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},p={...e[u][1].start};lS(d,-s),lS(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},a={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:s>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},e[r][1].end={...i.start},e[u][1].start={...o.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=sN(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=sN(l,[["enter",n,t],["enter",i,t],["exit",i,t],["enter",a,t]]),l=sN(l,lx(t.parser.constructs.insideSpan.null,e.slice(r+1,u),t)),l=sN(l,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",n,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=sN(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,sj(e,r-1,u-r+3,l),u=r+l.length-c-2;break}}for(u=-1;++ui&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(i===a-1||a-4>i&&"whitespace"===e[a-2][1].type)&&(a-=i+1===a?2:4),a>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},n={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},sj(e,i,a-i+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]])),e},tokenize:function(e,t,r){let n=0;return function(a){var i;return e.enter("atxHeading"),i=a,e.enter("atxHeadingSequence"),function a(i){return 35===i&&n++<6?(e.consume(i),a):null===i||sO(i)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function t(n){return 35===n?(e.consume(n),t):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||sz(n)?(e.exit("atxHeading"),t(n)):sF(n)?s$(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function t(n){return null===n||35===n||sO(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),t)}(n))}(i)):r(i)}(i)}}},42:s2,45:[li,s2],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,r){let n,a,i,o,s,l=this;return function(t){var r;return r=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(o){return 33===o?(e.consume(o),u):47===o?(e.consume(o),a=!0,h):63===o?(e.consume(o),n=3,l.interrupt?t:I):sP(o)?(e.consume(o),i=String.fromCharCode(o),m):r(o)}function u(a){return 45===a?(e.consume(a),n=2,d):91===a?(e.consume(a),n=5,o=0,p):sP(a)?(e.consume(a),n=4,l.interrupt?t:I):r(a)}function d(n){return 45===n?(e.consume(n),l.interrupt?t:I):r(n)}function p(n){let a="CDATA[";return n===a.charCodeAt(o++)?(e.consume(n),o===a.length)?l.interrupt?t:N:p:r(n)}function h(t){return sP(t)?(e.consume(t),i=String.fromCharCode(t),m):r(t)}function m(o){if(null===o||47===o||62===o||sO(o)){let s=47===o,c=i.toLowerCase();return!s&&!a&&ls.includes(c)?(n=1,l.interrupt?t(o):N(o)):lo.includes(i.toLowerCase())?(n=6,s)?(e.consume(o),f):l.interrupt?t(o):N(o):(n=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(o):a?function t(r){return sF(r)?(e.consume(r),t):k(r)}(o):g(o))}return 45===o||sD(o)?(e.consume(o),i+=String.fromCharCode(o),m):r(o)}function f(n){return 62===n?(e.consume(n),l.interrupt?t:N):r(n)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||sP(t)?(e.consume(t),v):sF(t)?(e.consume(t),g):k(t)}function v(t){return 45===t||46===t||58===t||95===t||sD(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),y):sF(t)?(e.consume(t),x):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),s=t,b):sF(t)?(e.consume(t),y):function t(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||sO(r)?x(r):(e.consume(r),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,w):null===t||sz(t)?r(t):(e.consume(t),b)}function w(e){return 47===e||62===e||sF(e)?g(e):r(e)}function k(t){return 62===t?(e.consume(t),j):r(t)}function j(t){return null===t||sz(t)?N(t):sF(t)?(e.consume(t),j):r(t)}function N(t){return 45===t&&2===n?(e.consume(t),M):60===t&&1===n?(e.consume(t),P):62===t&&4===n?(e.consume(t),A):63===t&&3===n?(e.consume(t),I):93===t&&5===n?(e.consume(t),T):sz(t)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(ll,R,C)(t)):null===t||sz(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(lc,S,R)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||sz(t)?C(t):(e.enter("htmlFlowData"),N(t))}function M(t){return 45===t?(e.consume(t),I):N(t)}function P(t){return 47===t?(e.consume(t),i="",D):N(t)}function D(t){if(62===t){let r=i.toLowerCase();return ls.includes(r)?(e.consume(t),A):N(t)}return sP(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),D):N(t)}function T(t){return 93===t?(e.consume(t),I):N(t)}function I(t){return 62===t?(e.consume(t),A):45===t&&2===n?(e.consume(t),I):N(t)}function A(t){return null===t||sz(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),A)}function R(r){return e.exit("htmlFlow"),t(r)}}},61:li,95:s2,96:ld,126:ld},lI={38:lf,92:lg},lA={[-5]:lv,[-4]:lv,[-3]:lv,33:lj,38:lf,42:lC,60:[{name:"autolink",tokenize:function(e,t,r){let n=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a};function a(t){return sP(t)?(e.consume(t),i):64===t?r(t):s(t)}function i(t){return 43===t||45===t||46===t||sD(t)?(n=1,function t(r){return 58===r?(e.consume(r),n=0,o):(43===r||45===r||46===r||sD(r))&&n++<32?(e.consume(r),t):(n=0,s(r))}(t)):s(t)}function o(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):null===n||32===n||60===n||sI(n)?r(n):(e.consume(n),o)}function s(t){return 64===t?(e.consume(t),l):sT(t)?(e.consume(t),s):r(t)}function l(a){return sD(a)?function a(i){return 46===i?(e.consume(i),n=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||sD(i))&&n++<63){let r=45===i?t:a;return e.consume(i),r}return r(i)}(i)}(a):r(a)}}},{name:"htmlText",tokenize:function(e,t,r){let n,a,i,o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),x):sP(t)?(e.consume(t),k):r(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,h):sP(t)?(e.consume(t),v):r(t)}function c(t){return 45===t?(e.consume(t),p):r(t)}function u(t){return null===t?r(t):45===t?(e.consume(t),d):sz(t)?(i=u,D(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?P(e):45===e?d(e):u(e)}function h(t){let n="CDATA[";return t===n.charCodeAt(a++)?(e.consume(t),a===n.length?m:h):r(t)}function m(t){return null===t?r(t):93===t?(e.consume(t),f):sz(t)?(i=m,D(t)):(e.consume(t),m)}function f(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?P(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?P(t):sz(t)?(i=v,D(t)):(e.consume(t),v)}function x(t){return null===t?r(t):63===t?(e.consume(t),y):sz(t)?(i=x,D(t)):(e.consume(t),x)}function y(e){return 62===e?P(e):x(e)}function b(t){return sP(t)?(e.consume(t),w):r(t)}function w(t){return 45===t||sD(t)?(e.consume(t),w):function t(r){return sz(r)?(i=t,D(r)):sF(r)?(e.consume(r),t):P(r)}(t)}function k(t){return 45===t||sD(t)?(e.consume(t),k):47===t||62===t||sO(t)?j(t):r(t)}function j(t){return 47===t?(e.consume(t),P):58===t||95===t||sP(t)?(e.consume(t),N):sz(t)?(i=j,D(t)):sF(t)?(e.consume(t),j):P(t)}function N(t){return 45===t||46===t||58===t||95===t||sD(t)?(e.consume(t),N):function t(r){return 61===r?(e.consume(r),C):sz(r)?(i=t,D(r)):sF(r)?(e.consume(r),t):j(r)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),n=t,S):sz(t)?(i=C,D(t)):sF(t)?(e.consume(t),C):(e.consume(t),E)}function S(t){return t===n?(e.consume(t),n=void 0,M):null===t?r(t):sz(t)?(i=S,D(t)):(e.consume(t),S)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):47===t||62===t||sO(t)?j(t):(e.consume(t),E)}function M(e){return 47===e||62===e||sO(e)?j(e):r(e)}function P(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}function D(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return sF(t)?s$(e,I,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):I(t)}function I(t){return e.enter("htmlTextData"),i(t)}}}],91:lE,92:[{name:"hardBreakEscape",tokenize:function(e,t,r){return function(t){return e.enter("hardBreakEscape"),e.consume(t),n};function n(n){return sz(n)?(e.exit("hardBreakEscape"),t(n)):r(n)}}},lg],93:ly,95:lC,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let lq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lB(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),t=120===e||88===e;return lF(r.slice(t?2:1),t?16:10)}return lm(r)||e}let l_={}.hasOwnProperty;function l$(e){return{line:e.line,column:e.column,offset:e.offset}}function lU(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is still open")}function lH(e){let t=this;t.parser=function(r){var n,a;let i,s,l,c;return"string"!=typeof(n={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=n,n=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:n(m),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:n(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:n(h,a),codeText:n(function(){return{type:"inlineCode",value:""}},a),codeTextData:c,data:c,codeFlowValue:c,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(f),hardBreakTrailing:n(f),htmlFlow:n(g,a),htmlFlowData:c,htmlText:n(g,a),htmlTextData:c,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(x),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:n(m),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:o(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(t=lF(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):t=lm(r);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=l$(e.end)},codeFenced:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:o(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lt(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(d),hardBreakTrailing:o(d),htmlFlow:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=t},labelText:function(e){let t=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=t.replace(lq,lB),r.identifier=lt(t).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=l$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(r.type)&&(c.call(this,e),u.call(this,e))},link:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lt(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};!function e(t,r){let n=-1;for(;++n0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||lU).call(o,void 0,e[0])}for(n.position={start:l$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:l$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u-1){let e=r[0];"string"==typeof e?r[0]=e.slice(a):r.shift()}o>0&&r.push(e[i].slice(0,o))}return r}(o,e)}function p(){let{_bufferIndex:e,_index:t,line:r,column:a,offset:i}=n;return{_bufferIndex:e,_index:t,line:r,column:a,offset:i}}function h(e,t){t.restore()}function m(e,t){return function(r,a,i){var o;let u,d,h,m;return Array.isArray(r)?f(r):"tokenize"in r?f([r]):(o=r,function(e){let t=null!==e&&o[e],r=null!==e&&o.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function f(e){return(u=e,d=0,0===e.length)?i:v(e[d])}function v(e){return function(r){return(m=function(){let e=p(),t=c.previous,r=c.currentConstruct,a=c.events.length,i=Array.from(s);return{from:a,restore:function(){n=e,c.previous=t,c.currentConstruct=r,c.events.length=a,s=i,g()}}}(),h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(r):e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,x,y)(r)}}function x(t){return e(h,m),a}function y(e){return(m.restore(),++d{let r=(t,r)=>(e.set(r,t),t),n=a=>{if(e.has(a))return e.get(a);let[i,o]=t[a];switch(i){case 0:case -1:return r(o,a);case 1:{let e=r([],a);for(let t of o)e.push(n(t));return e}case 2:{let e=r({},a);for(let[t,r]of o)e[n(t)]=n(r);return e}case 3:return r(new Date(o),a);case 4:{let{source:e,flags:t}=o;return r(new RegExp(e,t),a)}case 5:{let e=r(new Map,a);for(let[t,r]of o)e.set(n(t),n(r));return e}case 6:{let e=r(new Set,a);for(let t of o)e.add(n(t));return e}case 7:{let{name:e,message:t}=o;return r(new lV[e](t),a)}case 8:return r(BigInt(o),a);case"BigInt":return r(Object(BigInt(o)),a);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:e}=new Uint8Array(o);return r(new DataView(e),o)}}return r(new lV[i](o),a)};return n},lG=e=>lW(new Map,e)(0),{toString:lK}={},{keys:lY}=Object,lJ=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let r=lK.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},lX=([e,t])=>0===e&&("function"===t||"symbol"===t),lZ=(e,t,r,n)=>{let a=(e,t)=>{let a=n.push(e)-1;return r.set(t,a),a},i=n=>{if(r.has(n))return r.get(n);let[o,s]=lJ(n);switch(o){case 0:{let t=n;switch(s){case"bigint":o=8,t=n.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],n)}return a([o,t],n)}case 1:{if(s){let e=n;return"DataView"===s?e=new Uint8Array(n.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(n)),a([s,[...e]],n)}let e=[],t=a([o,e],n);for(let t of n)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,n.toString()],n);case"Boolean":case"Number":case"String":return a([s,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let r=[],l=a([o,r],n);for(let t of lY(n))(e||!lX(lJ(n[t])))&&r.push([i(t),i(n[t])]);return l}case 3:return a([o,n.toISOString()],n);case 4:{let{source:e,flags:t}=n;return a([o,{source:e,flags:t}],n)}case 5:{let t=[],r=a([o,t],n);for(let[r,a]of n)(e||!(lX(lJ(r))||lX(lJ(a))))&&t.push([i(r),i(a)]);return r}case 6:{let t=[],r=a([o,t],n);for(let r of n)(e||!lX(lJ(r)))&&t.push(i(r));return r}}let{message:l}=n;return a([o,{name:s,message:l}],n)};return i},lQ=(e,{json:t,lossy:r}={})=>{let n=[];return lZ(!(t||r),!!t,new Map,n)(e),n},l0="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?lG(lQ(e,t)):structuredClone(e):(e,t)=>lG(lQ(e,t));function l1(e){let t=[],r=-1,n=0,a=0;for(;++r55295&&i<57344){let t=e.charCodeAt(r+1);i<56320&&t>56319&&t<57344?(o=String.fromCharCode(i,t),a=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+a+1,o=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function l2(e,t){let r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function l3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let l4=function(e){var t,r;if(null==e)return l6;if("function"==typeof e)return l5(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],r=-1;for(;++r":"")+"\x1b[39m)"})}return i;function i(){var a;let i,o,s,h=l8;if((!l||d(t,r,n[n.length-1]||void 0))&&!1===(h=Array.isArray(a=c(t,n))?a:"number"==typeof a?[!0,a]:null==a?l8:[a])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(o=(u?t.children.length:-1)+p,s=n.concat(t);o>-1&&o1:t}function ct(e,t,r){let n=0,a=e.length;if(t){let t=e.codePointAt(n);for(;9===t||32===t;)n++,t=e.codePointAt(n)}if(r){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}let cr={blockquote:function(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){let r=t.value?t.value+"\n":"",n={};t.lang&&(n.className=["language-"+t.lang]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},footnoteReference:function(e,t){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),i=l1(a.toLowerCase()),o=e.footnoteOrder.indexOf(a),s=e.footnoteCounts.get(a);void 0===s?(s=0,e.footnoteOrder.push(a),r=e.footnoteOrder.length):r=o+1,s+=1,e.footnoteCounts.set(a,s);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}},imageReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return l7(e,t);let a={src:l1(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let r={src:l1(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)},inlineCode:function(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return l7(e,t);let a={href:l1(n.url||"")};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let r={href:l1(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},listItem:function(e,t,r){let n=e.all(t),a=r?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},i=o7(t.children[1]),o=o9(t.children[t.children.length-1]);i&&o&&(n.position={start:i,end:o}),a.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){let n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",i=r&&"table"===r.type?r.align:void 0,o=i?i.length:t.children.length,s=-1,l=[];for(;++s0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(ct(t.slice(a),a>0,!1)),i.join("")}(String(t.value))};return e.patch(t,r),e.applyData(t,r)},thematicBreak:function(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)},toml:cn,yaml:cn,definition:cn,footnoteDefinition:cn};function cn(){}let ca={}.hasOwnProperty,ci={};function co(e,t){e.position&&(t.position=function(e){let t=o7(e),r=o9(e);if(t&&r)return{start:t,end:r}}(e))}function cs(e,t){let r=t;if(e&&e.data){let t=e.data.hName,n=e.data.hChildren,a=e.data.hProperties;"string"==typeof t&&("element"===r.type?r.tagName=t:r={type:"element",tagName:t,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&a&&Object.assign(r.properties,l0(a)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function cl(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:"\n"});++n0&&r.push({type:"text",value:"\n"}),r}function cc(e){let t=0,r=e.charCodeAt(t);for(;9===r||32===r;)t++,r=e.charCodeAt(t);return e.slice(t)}function cu(e,t){let r=function(e,t){let r=t||ci,n=new Map,a=new Map,i={all:function(e){let t=[];if("children"in e){let r=e.children,n=-1;for(;++n0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(a,m),s.push(m)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...l0(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:"\n"},a),i}function cd(e,t){return e&&"run"in e?async function(r,n){let a=cu(r,{file:n,...t});await e.run(a,n)}:function(r,n){return cu(r,{file:n,...e||t})}}function cp(e){if(e)throw e}var ch=r(19566);function cm(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let cf=require("node:path"),cg=require("node:process");function cv(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let cx=require("node:url"),cy=["history","path","basename","stem","extname","dirname"];class cb{constructor(e){let t,r;t=e?cv(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":cg.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++nt.length;o&&t.push(n);try{i=e.apply(this,t)}catch(e){if(o&&r)throw e;return n(e)}o||(i&&i.then&&"function"==typeof i.then?i.then(a,n):i instanceof Error?n(i):a(i))};function n(e,...a){r||(r=!0,t(e,...a))}function a(e){n(null,e)}})(s,a)(...o):n(null,...o)}(null,...t)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}};return t}()}copy(){let e=new cS,t=-1;for(;++t0){let[n,...i]=t,o=r[a][1];cm(o)&&cm(n)&&(n=ch(!0,o,n)),r[a]=[e,n,...i]}}}}let cE=new cS().freeze();function cM(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function cP(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function cD(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cT(e){if(!cm(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function cI(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cA(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new cb(e)}let cR=[],cL={allowDangerousHtml:!0},cz=/^(https?|ircs?|mailto|xmpp)$/i,cO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cF(e){let t=function(e){let t=e.rehypePlugins||cR,r=e.remarkPlugins||cR,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cL}:cL;return cE().use(lH).use(r).use(cd,n).use(t)}(e),r=function(e){let t=e.children||"",r=new cb;return"string"==typeof t&&(r.value=t),r}(e);return function(e,t){let r=t.allowedElements,n=t.allowElement,a=t.components,i=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||cq;for(let e of cO)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return l9(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return o?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in sy)if(Object.hasOwn(sy,t)&&Object.hasOwn(e.properties,t)){let r=e.properties[t],n=sy[t];(null===n||n.includes(e.tagName))&&(e.properties[t]=c(String(r||""),t,e))}}if("element"===e.type){let o=r?!r.includes(e.tagName):!!i&&i.includes(e.tagName);if(!o&&n&&"number"==typeof t&&(o=!n(e,t,a)),o&&a&&"number"==typeof t)return l&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var r,n,a,i,o;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=t.jsxDEV,s=function(e,t,a,i){let o=Array.isArray(a.children),s=o7(e);return n(t,a,i,o,{columnNumber:s?s.column-1:void 0,fileName:r,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");a=0,i=t.jsx,o=t.jsxs,s=function(e,t,r,n){let a=Array.isArray(r.children)?o:i;return n?a(t,r,n):a(t,r)}}let c={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?o0:oQ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=sp(c,e,void 0);return u&&"string"!=typeof u?u:c.create(e,c.Fragment,{children:u||void 0},void 0)}(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(r),r),e)}function cq(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==r&&t>r||-1!==n&&t>n||cz.test(e.slice(0,t))?e:""}function cB({content:e,className:t}){return(0,s.jsx)("div",{className:(0,h.cn)("prose prose-sm dark:prose-invert max-w-none",t),children:(0,s.jsx)(cF,{components:{h1:({children:e})=>(0,s.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,s.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,s.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,s.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,s.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,s.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,s.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,s.jsx)("li",{className:"text-sm",children:e}),code:({className:e,children:t,...r})=>/language-(\w+)/.exec(e||"")?(0,s.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",children:(0,s.jsx)("code",{className:"font-mono text-xs",children:t})}):(0,s.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...r,children:t}),blockquote:({children:e})=>(0,s.jsx)("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 py-0.5 mb-2 italic text-muted-foreground",children:e}),a:({href:e,children:t})=>(0,s.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),strong:({children:e})=>(0,s.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,s.jsx)("em",{className:"italic",children:e}),hr:()=>(0,s.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,s.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,s.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,s.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,s.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,s.jsx)("tr",{children:e}),th:({children:e})=>(0,s.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,s.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:e})})}let c_={shell:(0,s.jsx)(tJ,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,s.jsx)(x,{className:"h-3 w-3 text-orange-500"}),evaluation:(0,s.jsx)(oy.A,{className:"h-3 w-3 text-orange-500"}),complete_task:(0,s.jsx)(oy.A,{className:"h-3 w-3 text-green-500"})},c$={pending:(0,s.jsx)(nv.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,s.jsx)(nv.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,s.jsx)(oy.A,{className:"h-3 w-3 text-green-500"}),failed:(0,s.jsx)(ob.A,{className:"h-3 w-3 text-red-500"})};function cU({content:e,toolCalls:t=[],toolMessages:r,checkpointId:n,onRestore:a,onRetry:i,isSavedCheckpoint:o,isExecuting:l=!1,className:c,cost:d,usage:p}){let[f,g]=u().useState(new Set),[v,x]=u().useState(!1),{shouldShowCosts:y}=aO(),b=!!(e&&""!==e.trim()),w=e=>{let t=new Set(f);t.has(e)?t.delete(e):t.add(e),g(t)},k=n&&(a||i)&&!l?(0,s.jsxs)("div",{className:"pt-2 flex flex-wrap items-center gap-2","data-tour-id":"checkpoint-actions",children:[(0,s.jsx)(rO.E,{variant:o?"default":"outline",className:"h-6 px-2 text-xs",children:o?"Saved version":"Checkpoint"}),a&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>a(n),className:"h-7 text-xs","data-tour-id":"checkpoint-restore-button",children:[(0,s.jsx)(aI,{className:"h-3 w-3 mr-1"}),"Restore"]}),i&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>i(n),className:"h-7 text-xs","data-tour-id":"checkpoint-retry-button",children:[(0,s.jsx)(ow,{className:"h-3 w-3 mr-1"}),"Retry"]})]}):null;return r&&r.length>0?(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(cB,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),nc.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(ok.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",nc.U.formatCost(d)]})]})]}),r.map(e=>"message"===e.type?(0,s.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,s.jsx)(cB,{content:e.content||""})},e.id):"divider"===e.type?(0,s.jsxs)("div",{className:"flex items-center gap-2 my-2",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground whitespace-nowrap",children:e.title||"Section"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]},e.id):(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(e.id)?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(e.id),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(oy.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ob.A,{className:"h-3 w-3 text-red-500"}):e.name&&c_[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c$[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),"evaluation"===e.name&&e.parameters&&(0,s.jsxs)("div",{className:"px-2 py-1 mt-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:e.parameters.reasoning}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[e.parameters.goal_achieved?(0,s.jsx)(oy.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ob.A,{className:"h-3 w-3 text-red-500"}),(0,s.jsx)("span",{className:e.parameters.goal_achieved?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:e.parameters.goal_achieved?"Goal achieved":"Goal not achieved"})]}),!e.parameters.should_continue&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,s.jsx)("span",{children:"•"}),(0,s.jsx)("span",{children:"Stopping"})]})]})]}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(e.id)&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},e.id)),k]}):(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(cB,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),nc.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(ok.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",nc.U.formatCost(d)]})]})]}),t.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(String(t))?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(String(t)),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(oy.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(ob.A,{className:"h-3 w-3 text-red-500"}):e.name&&c_[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c$[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(String(t))&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},t))}),k]})}var cH=r(97815);function cV({project:e,onBack:t}){let[r,n]=(0,l.useState)(0),[a,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(null),[f,v]=(0,l.useState)([]),[x,y]=(0,l.useState)("preview"),[b,w]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[C,S]=(0,l.useState)(e.lastSavedAt??null),[E,P]=(0,l.useState)(null),D=(0,l.useRef)(null),T=(0,l.useRef)(null),A=(0,l.useRef)(0),R=(0,l.useCallback)(()=>{try{let e=globalThis?.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID()}catch{}let e=`${Date.now()}_${A.current}`;return A.current+=1,e},[]),L=(0,l.useCallback)(e=>{if(null!=T.current&&T.current>=0&&T.current{let e=[ea,eo,el,eu].filter(Boolean).length;if(4===e)return{assistant:25,files:15,editor:35,preview:25};if(3===e){if(!ea)return{assistant:0,files:20,editor:40,preview:40};if(!eo)return{assistant:30,files:0,editor:40,preview:30};if(!el)return{assistant:33,files:20,editor:0,preview:47};if(!eu)return{assistant:30,files:20,editor:50,preview:0}}else if(2===e)return{assistant:50,files:50,editor:50,preview:50};return{assistant:100,files:100,editor:100,preview:100}})(),eh=e=>{if(!e)return"Select Model";let t=e.split("/");return t[t.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},em=(0,l.useCallback)((e,t=1200)=>{if(!e)return"";if(e.length<=t)return e;let r=Math.max(0,Math.floor(.6*t)),n=Math.max(0,Math.floor(.3*t)),a=e.slice(0,r),i=n>0?e.slice(-n):"";return`${a} (...truncated...) -${i}`},[]),ef=(0,l.useCallback)(e=>{let t=Object.entries(e.attributes||{}).slice(0,6);if(0===t.length)return`<${e.tagName}>`;let r=t.map(([e,t])=>{let r=t.length>40?`${t.slice(0,37)}…`:t;return`${e}="${r}"`}).join(" ");return`<${e.tagName} ${r}>`},[]),eg=(0,l.useCallback)(e=>{let t=ef(e),r=em(e.outerHTML,1200),n=e.domPath||"(unknown path)";return["Focus context:",`- Target: ${t}`,`- DOM path: ${n}`,"- HTML snippet:","```html",r,"```"].join("\n")},[ef,em]),ev=(0,l.useCallback)(e=>{if(!e){P(null),D.current=null;return}let t=`${e.domPath||""}::${e.tagName||""}::${e.outerHTML?e.outerHTML.length:0}`,r=Date.now();if(D.current&&D.current.signature===t&&r-D.current.timestamp<400)return;let n={...e,timestamp:r};P(n),tV.oR.info("Focus context set",{description:ef(n)}),D.current={signature:t,timestamp:r}},[ef]);E&&ef(E);let ex=E?em(E.outerHTML,240):"",ey=ex?.trim()??"",eb=E?(0,s.jsxs)("div",{id:"focus-context-hint",className:"rounded-md border border-dashed border-primary/40 bg-primary/5 px-3 py-2 text-xs text-muted-foreground shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>P(null),title:"Clear focus context",children:"Clear"})]}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[E.domPath&&(0,s.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:E.domPath}),ey&&(0,s.jsx)("pre",{className:"max-h-24 overflow-auto rounded border border-border/50 bg-background/90 px-2 py-1 text-[11px] text-foreground leading-relaxed",children:(0,s.jsx)("code",{children:ey})})]})]}):null,ew=(0,l.useCallback)(()=>{if(!ee.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=ee.current;t-e-r<100?(er.current=!0,en.current=!1):o||(er.current=!1,en.current=!0)},[o]),ek=(0,l.useCallback)(e=>{window.innerWidth<768?(y("editor"),setTimeout(()=>{aT(e)},0)):el?aT(e):(ec(!0),setTimeout(()=>{aT(e)},0))},[el]),ej=(0,l.useCallback)(()=>{n(e=>e+1),window.dispatchEvent(new CustomEvent("filesChanged"))},[]),eN=(0,l.useCallback)(async()=>{if(!j){N(!0);try{let t=await rZ.$.save(e.id),r=await p.OP.getProject(e.id);S(r.lastSavedAt??new Date(t.timestamp)),O(t.id);let n=new Date().toISOString(),a={type:"manual_save",timestamp:n,checkpointId:t.id,description:"Manual save"};await a_.recordConversationBreak(e.id,a),await a_.addBreakContextMessage(e.id,a),tV.oR.success("Project saved")}catch(e){h.v.error("Failed to save project",e),tV.oR.error("Failed to save project")}finally{N(!1)}}},[e.id,j]),eC=(0,l.useCallback)(async(t,r)=>{try{if(!await nm.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - it may have been cleaned up"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}if(await rZ.$.runWithSuppressedDirty(e.id,()=>nm.Y.restoreCheckpoint(t))){tV.oR.success(`Restored to: ${r||"checkpoint"}`),ej(),await a_.recordConversationBreak(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"}),await a_.addBreakContextMessage(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"});let n=rZ.$.getSavedCheckpointId(e.id);if(n&&n===t){rZ.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else rZ.$.markDirty(e.id);v(e=>[...e,{id:R(),role:"assistant",content:`Restored to checkpoint: ${r||"previous state"}`,checkpointId:t}]);let a=a$.convertToOrchestratorMessages(f);await a_.updateConversation(e.id,a)}else tV.oR.error("Failed to restore checkpoint")}catch(e){h.v.error("Error restoring checkpoint:",e),tV.oR.error("Failed to restore checkpoint")}},[ej,f,e.id]),eS=(0,l.useCallback)(async(t,r)=>{try{if(!await nm.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - cannot retry"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}let n=null;for(let e=r-1;e>=0;e--)if("user"===f[e].role){n=f[e];break}if(!n)return void tV.oR.error("Cannot find original user message to retry");if(!await rZ.$.runWithSuppressedDirty(e.id,()=>nm.Y.restoreCheckpoint(t)))return void tV.oR.error("Failed to restore checkpoint");let a=rZ.$.getSavedCheckpointId(e.id);if(a&&a===t){rZ.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else rZ.$.markDirty(e.id);await a_.recordConversationBreak(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:`Retrying: "${n.content.substring(0,50)}..."`});let o=f.slice(0,r-1);v(o);let s=a$.convertToOrchestratorMessages(o);await a_.updateConversation(e.id,s),await a_.addBreakContextMessage(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:"Retrying after restoring to checkpoint"}),tV.oR.success("Restored checkpoint and retrying..."),ej(),i(n.content),setTimeout(()=>{let e=document.querySelector('[data-retry-trigger="true"]');e&&e.click()},100)}catch(e){h.v.error("Error during retry:",e),tV.oR.error("Failed to retry")}},[f,ej,e.id]),eE=async()=>{if(Z)return;let t=a.trim();if(!t)return void tV.oR.error("Please enter a prompt");let r=r4.s.getSelectedProvider(),n=(0,aq.sO)(r),o=r4.s.getApiKey();if(n.apiKeyRequired&&!o)return void tV.oR.error(`Please set your ${n.name} API key in settings`);if(n.isLocal&&!r4.s.getProviderModel(r))return void tV.oR.error(`No model selected for ${n.name}. Please select a model in settings.`);er.current=!0,en.current=!1,c(!0);let s=E?`${eg(E)} +${i}`},[]),ef=(0,l.useCallback)(e=>{let t=Object.entries(e.attributes||{}).slice(0,6);if(0===t.length)return`<${e.tagName}>`;let r=t.map(([e,t])=>{let r=t.length>40?`${t.slice(0,37)}…`:t;return`${e}="${r}"`}).join(" ");return`<${e.tagName} ${r}>`},[]),eg=(0,l.useCallback)(e=>{let t=ef(e),r=em(e.outerHTML,1200),n=e.domPath||"(unknown path)";return["Focus context:",`- Target: ${t}`,`- DOM path: ${n}`,"- HTML snippet:","```html",r,"```"].join("\n")},[ef,em]),ev=(0,l.useCallback)(e=>{if(!e){P(null),D.current=null;return}let t=`${e.domPath||""}::${e.tagName||""}::${e.outerHTML?e.outerHTML.length:0}`,r=Date.now();if(D.current&&D.current.signature===t&&r-D.current.timestamp<400)return;let n={...e,timestamp:r};P(n),tV.oR.info("Focus context set",{description:ef(n)}),D.current={signature:t,timestamp:r}},[ef]);E&&ef(E);let ex=E?em(E.outerHTML,240):"",ey=ex?.trim()??"",eb=E?(0,s.jsxs)("div",{id:"focus-context-hint",className:"rounded-md border border-dashed border-primary/40 bg-primary/5 px-3 py-2 text-xs text-muted-foreground shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>P(null),title:"Clear focus context",children:"Clear"})]}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[E.domPath&&(0,s.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:E.domPath}),ey&&(0,s.jsx)("pre",{className:"max-h-24 overflow-auto rounded border border-border/50 bg-background/90 px-2 py-1 text-[11px] text-foreground leading-relaxed",children:(0,s.jsx)("code",{children:ey})})]})]}):null,ew=(0,l.useCallback)(()=>{if(!ee.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=ee.current;t-e-r<100?(er.current=!0,en.current=!1):o||(er.current=!1,en.current=!0)},[o]),ek=(0,l.useCallback)(e=>{window.innerWidth<768?(y("editor"),setTimeout(()=>{aD(e)},0)):el?aD(e):(ec(!0),setTimeout(()=>{aD(e)},0))},[el]),ej=(0,l.useCallback)(()=>{n(e=>e+1),window.dispatchEvent(new CustomEvent("filesChanged"))},[]),eN=(0,l.useCallback)(async()=>{if(!j){N(!0);try{let t=await rQ.$.save(e.id),r=await p.OP.getProject(e.id);S(r.lastSavedAt??new Date(t.timestamp)),O(t.id);let n=new Date().toISOString(),a={type:"manual_save",timestamp:n,checkpointId:t.id,description:"Manual save"};await aB.recordConversationBreak(e.id,a),await aB.addBreakContextMessage(e.id,a),tV.oR.success("Project saved")}catch(e){h.v.error("Failed to save project",e),tV.oR.error("Failed to save project")}finally{N(!1)}}},[e.id,j]),eC=(0,l.useCallback)(async(t,r)=>{try{if(!await nh.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - it may have been cleaned up"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}if(await rQ.$.runWithSuppressedDirty(e.id,()=>nh.Y.restoreCheckpoint(t))){tV.oR.success(`Restored to: ${r||"checkpoint"}`),ej(),await aB.recordConversationBreak(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"}),await aB.addBreakContextMessage(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"});let n=rQ.$.getSavedCheckpointId(e.id);if(n&&n===t){rQ.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else rQ.$.markDirty(e.id);v(e=>[...e,{id:R(),role:"assistant",content:`Restored to checkpoint: ${r||"previous state"}`,checkpointId:t}]);let a=a_.convertToOrchestratorMessages(f);await aB.updateConversation(e.id,a)}else tV.oR.error("Failed to restore checkpoint")}catch(e){h.v.error("Error restoring checkpoint:",e),tV.oR.error("Failed to restore checkpoint")}},[ej,f,e.id]),eS=(0,l.useCallback)(async(t,r)=>{try{if(!await nh.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - cannot retry"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}let n=null;for(let e=r-1;e>=0;e--)if("user"===f[e].role){n=f[e];break}if(!n)return void tV.oR.error("Cannot find original user message to retry");if(!await rQ.$.runWithSuppressedDirty(e.id,()=>nh.Y.restoreCheckpoint(t)))return void tV.oR.error("Failed to restore checkpoint");let a=rQ.$.getSavedCheckpointId(e.id);if(a&&a===t){rQ.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else rQ.$.markDirty(e.id);await aB.recordConversationBreak(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:`Retrying: "${n.content.substring(0,50)}..."`});let o=f.slice(0,r-1);v(o);let s=a_.convertToOrchestratorMessages(o);await aB.updateConversation(e.id,s),await aB.addBreakContextMessage(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:"Retrying after restoring to checkpoint"}),tV.oR.success("Restored checkpoint and retrying..."),ej(),i(n.content),setTimeout(()=>{let e=document.querySelector('[data-retry-trigger="true"]');e&&e.click()},100)}catch(e){h.v.error("Error during retry:",e),tV.oR.error("Failed to retry")}},[f,ej,e.id]),eE=async()=>{if(Z)return;let t=a.trim();if(!t)return void tV.oR.error("Please enter a prompt");let r=r3.s.getSelectedProvider(),n=(0,aF.sO)(r),o=r3.s.getApiKey();if(n.apiKeyRequired&&!o)return void tV.oR.error(`Please set your ${n.name} API key in settings`);if(n.isLocal&&!r3.s.getProviderModel(r))return void tV.oR.error(`No model selected for ${n.name}. Please select a model in settings.`);er.current=!0,en.current=!1,c(!0);let s=E?`${eg(E)} -${t}`:t,l={id:R(),role:"user",content:s};v(e=>[...e,l]);try{let t;T.current=null,v(e=>L([...e]).arr);let r=await a_.getConversationMessages(e.id,50),n=f.length,a=r.filter(e=>"user"===e.role||"assistant"===e.role).length;h.v.debug("[Workspace] Context validation:",{uiMessages:n,contextMessages:a,totalContextIncludingSystem:r.length,contextTypes:r.map(e=>e.role)}),0===n&&a>0&&(h.v.warn(`[Workspace] GHOST CONVERSATION DETECTED: UI has ${n} messages but context has ${a} messages!`),h.v.warn("[Workspace] This causes the LLM to continue previous conversations that the user cannot see."),h.v.warn("[Workspace] Clearing context to match UI state..."),await a_.clearConversation(e.id),r.length=0);try{let r=await p.OP.listDirectory(e.id,"/");r.length>0&&(t=r.map(e=>e.path).join("\n"))}catch{}let o=(0,aU.m)(t),l=await new Promise(e=>{v(t=>(e(t),t))}),c=a$.prepareConversationForOrchestrator(l,{maxMessages:50,includeSystemPrompt:!0,systemPrompt:o}),u=new aO.r(e.id,c,(e,t)=>{if("assistant_delta"===e&&(t?.text||t?.snapshot)){let e=t.text,r=t.snapshot;v(t=>{let{arr:n,idx:a}=L([...t]);if(a<0||a>=n.length||!n[a])return h.v.error("[assistant_delta] Invalid index or missing message:",{idx:a,arrayLength:n.length}),t;let i=n[a],o={...i,toolMessages:[...i.toolMessages||[]]},s=o.toolMessages;(0===s.length||"message"!==s[s.length-1].type)&&s.push({id:R(),type:"message",content:""});let l=s[s.length-1];return void 0!==r?l.content=r:e&&(l.content=(l.content||"")+e),n[a]=o,n})}if("toolCalls"===e&&t?.toolCalls){let e=t.toolCalls;h.v.debug(`[Workspace] Received ${e.length} tool calls`),v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let t=0;t{if(null==T.current)return e;let r=[...e],n=r[T.current];return r[T.current]={...n,cost:t.totalCost,usage:t.usage},r}),"evaluation"===e&&t?.summary){let e=t.summary;v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"message",content:e}),r[n]=i,r})}if("divider"===e&&v(e=>{let{arr:r,idx:n}=L([...e]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"divider",title:t?.title||"Section"}),r[n]=i,r}),"tool_result"===e&&t){let{toolIndex:e,result:r}=t;h.v.debug(`[Workspace] Received tool result for tool ${e}`,{resultPreview:"string"==typeof r?r.substring(0,100):r}),v(e=>{let{arr:t,idx:n}=L([...e]),a=t[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let e=o.length-1;e>=0;e--)if("tool"===o[e].type&&!o[e].result){o[e]={...o[e],result:r};break}return t[n]=i,t})}if("tool_status"===e&&t){let{toolIndex:e,status:r,result:n,error:a}=t;v(e=>{let{arr:t,idx:i}=L([...e]),o=t[i],s={...o,toolMessages:[...o.toolMessages||[]]},l=s.toolMessages;for(let e=l.length-1;e>=0;e--)if("tool"===l[e].type&&("pending"===l[e].status||"executing"===l[e].status)){l[e]={...l[e],status:r,result:n||a||l[e].result};break}return t[i]=s,t})}});d(u);let m=await u.execute(s);v(e=>{if(null==T.current)return e;let t=[...e],r=t[T.current];return t[T.current]={...r,checkpointId:m.checkpointId,cost:m.totalCost,usage:m.usageInfo},t}),m.success&&ej();let g=await new Promise(e=>{v(t=>(e(t),t))}),x=a$.convertToOrchestratorMessages(g);await a_.updateConversation(e.id,x),i("")}catch(e){h.v.error("Generation error:",e),tV.oR.error(e instanceof Error?e.message:"Failed to generate"),v(t=>[...t,{id:R(),role:"assistant",content:`Error: ${e instanceof Error?e.message:"Unknown error"}`}])}finally{c(!1),d(null),T.current=null}},eM=(0,l.useCallback)(()=>{u&&(u.stop(),tV.oR.info("Generation stopped"))},[u]),eP=[{id:"back",label:"Back to projects",icon:aI.A,onClick:t,variant:"outline"}];eP.push({id:"save",label:j?"Saving…":b?"Save":"Saved",icon:aM,onClick:eN,variant:b?"default":"outline",disabled:!b||j}),z&&eP.push({id:"discard",label:"Discard Changes",icon:aA,onClick:()=>eC(z,"Last saved state"),variant:"outline",disabled:j||!b,dataTourId:"discard-changes-button"});let eD=(0,s.jsxs)(r3.AM,{children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[Q&&(0,s.jsxs)("span",{className:"text-sm font-medium",children:["$",W.toFixed(3)]}),(0,s.jsx)(rU,{className:"h-4 w-4"})]})}),(0,s.jsx)(r3.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nd,{})})]}),eT=(0,s.jsxs)("div",{className:"space-y-2",children:[Q&&(0,s.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",W.toFixed(W>=10?2:3)]})}),(0,s.jsxs)(r3.AM,{children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,s.jsx)(r3.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nd,{})})]})]});return(0,s.jsxs)(op,{children:[(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(rJ.j,{leftText:e.name,onLogoClick:t,actions:eP,mobileMenuContent:eT,desktopOnlyContent:eD}),(0,s.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,s.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,s.jsxs)(oh,{children:[(0,s.jsx)(om,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${ea?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:ea?"var(--button-assistant-active)":void 0,color:ea?"white":void 0},onClick:()=>ei(!ea),children:(0,s.jsx)(aR,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(of,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-assistant-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-assistant-active)",fill:"var(--button-assistant-active)"},children:(0,s.jsx)("p",{children:"Chat"})})]}),(0,s.jsxs)(oh,{children:[(0,s.jsx)(om,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${eo?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eo?"var(--button-files-active)":void 0,color:eo?"white":void 0},onClick:()=>es(!eo),children:(0,s.jsx)(nS,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(of,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-files-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-files-active)",fill:"var(--button-files-active)"},children:(0,s.jsx)("p",{children:"File Explorer"})})]}),(0,s.jsxs)(oh,{children:[(0,s.jsx)(om,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${el?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:el?"var(--button-editor-active)":void 0,color:el?"white":void 0},onClick:()=>ec(!el),children:(0,s.jsx)(aE,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(of,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-editor-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-editor-active)",fill:"var(--button-editor-active)"},children:(0,s.jsx)("p",{children:"Code Editor"})})]}),(0,s.jsxs)(oh,{children:[(0,s.jsx)(om,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 mx-1 rounded-sm flex items-center justify-center transition-all ${eu?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eu?"var(--button-preview-active)":void 0,color:eu?"white":void 0},onClick:()=>ed(!eu),children:(0,s.jsx)(M.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(of,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-preview-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-preview-active)",fill:"var(--button-preview-active)"},children:(0,s.jsx)("p",{children:"Preview"})})]})]}),(0,s.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,s.jsxs)(iW,{direction:"horizontal",autoSaveId:"workspace-layout",children:[ea&&(0,s.jsx)(aZ,{id:"assistant",order:1,defaultSize:ep.assistant,minSize:15,children:(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},"data-tour-id":"assistant-panel",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aR,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),(0,s.jsxs)("button",{type:"button",onClick:()=>ei(!1),"aria-label":"Hide chat",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aR,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a_.clearConversation(e.id);let t=await a_.getConversationMessages(e.id);t.length>0?h.v.error(`[Workspace] Clear failed! Still has ${t.length} messages in storage`):h.v.debug(`[Workspace] Successfully cleared all conversation data for project ${e.id}`)},className:"h-5 w-5 p-0",title:"Clear chat","data-tour-id":"clear-chat-button",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-y-auto p-4 space-y-3 flex flex-col","data-tour-id":"checkpoint-panel",children:[0===f.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(aR,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"Ready to build"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Describe what you want to create or change"})]})]})}):f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsx)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm",children:(0,s.jsx)(oy,{title:e.taskTitle||"Task Progress",steps:e.taskSteps,checkpointId:e.checkpointId,onRestore:e=>eC(e,"task checkpoint"),isSavedCheckpoint:e.checkpointId===z,expanded:F.has(t),onToggleExpand:()=>{let e=new Set(F);e.has(t)?e.delete(t):e.add(t),q(e)}})},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(cH,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c_,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsxs)("div",{className:"flex flex-col p-2 gap-2",children:[(0,s.jsxs)(oh,{children:[(0,s.jsx)(om,{asChild:!0,children:(0,s.jsx)(m.$,{onClick:o?eM:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2","data-retry-trigger":"true",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nx.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(aL,{className:"h-4 w-4"}),"Send"]})})}),(0,s.jsx)(of,{side:"left",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Ctrl/Cmd+Enter"})," to send"]}),(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Enter"})," for newline"]})]})})]}),a.length>0&&(0,s.jsxs)("div",{className:"px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-xs text-center",children:[a.length," chars"]})]})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)(r3.AM,{open:$,onOpenChange:U,children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),$?(0,s.jsx)(nk.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(az.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r3.hl,{className:"w-96",align:"start",children:(0,s.jsx)(cV.t,{onClose:()=>U(!1),onModelChange:e=>_(e)})})]})})})]})]})]})}),ea&&(eo||el||eu)&&(0,s.jsx)(iG,{withHandle:!0}),eo&&(0,s.jsx)(aZ,{id:"files",order:2,defaultSize:ep.files,minSize:14,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(nZ,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})})}),eo&&(el||eu)&&(0,s.jsx)(iG,{withHandle:!0}),el&&(0,s.jsx)(aZ,{id:"editor",order:3,defaultSize:ep.editor,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aD,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})})}),el&&eu&&(0,s.jsx)(iG,{withHandle:!0}),eu&&(0,s.jsx)(aZ,{id:"preview",order:4,defaultSize:ep.preview,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})})]})})]}),(0,s.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["assistant"===x&&(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aR,{className:"h-4 w-4",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a_.clearConversation(e.id)},className:"h-5 w-5 p-0",title:"Clear chat",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-auto p-2 space-y-2",children:[f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsxs)("div",{className:"border border-border rounded-lg p-3 bg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Task Progress"}),e.checkpointId&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>eC(e.checkpointId,"checkpoint"),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aA,{className:"h-3 w-3 mr-1"}),"Restore"]})]}),(0,s.jsx)(cH,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(cH,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c_,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,s.jsx)(m.$,{onClick:o?eM:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nx.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(aL,{className:"h-4 w-4"}),"Send"]})})})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsxs)(r3.AM,{open:H,onOpenChange:V,children:[(0,s.jsx)(r3.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),H?(0,s.jsx)(nk.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(az.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r3.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(cV.t,{onClose:()=>V(!1),onModelChange:e=>_(e)})})]})})]})]})]}),"files"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(nZ,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})}),"editor"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aD,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})}),"preview"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})]}),(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,s.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"assistant"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"assistant"===x?"var(--button-assistant-active)":void 0},onClick:()=>y("assistant"),children:(0,s.jsx)(aR,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===x?"var(--button-files-active)":void 0},onClick:()=>y("files"),children:(0,s.jsx)(nS,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===x?"var(--button-editor-active)":void 0},onClick:()=>y("editor"),children:(0,s.jsx)(aE,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===x?"var(--button-preview-active)":void 0},onClick:()=>y("preview"),children:(0,s.jsx)(M.A,{className:"h-4 w-4"})})]})})]})]}),(0,s.jsx)(ny,{location:"workspace"}),(0,s.jsx)(ny,{location:"settings"})]})}function cG(){let[e,t]=(0,l.useState)(null),{state:r,setActiveProjectId:n}=nv();r.currentStep?.id,r.status;let a=(0,l.useMemo)(()=>e?(0,s.jsx)(cW,{project:e,onBack:()=>t(null)}):(0,s.jsx)(nb,{onProjectSelect:t}),[e]);return(0,s.jsxs)(s.Fragment,{children:[a,(0,s.jsx)(ny,{location:"global"})]})}function cK(){return(0,s.jsx)(ng,{children:(0,s.jsx)(cG,{})})}},86908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var c;return(void 0===t&&(t={}),!(c=e)||a.test(c)||r.test(c))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,l):e.replace(i,l)).replace(n,s))}},90597:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx","default")},94735:e=>{"use strict";e.exports=require("events")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[447,551,212,617],()=>r(71997));module.exports=n})(); \ No newline at end of file +${t}`:t,l={id:R(),role:"user",content:s};v(e=>[...e,l]);try{let t;T.current=null,v(e=>L([...e]).arr);let r=await aB.getConversationMessages(e.id,50),n=f.length,a=r.filter(e=>"user"===e.role||"assistant"===e.role).length;h.v.debug("[Workspace] Context validation:",{uiMessages:n,contextMessages:a,totalContextIncludingSystem:r.length,contextTypes:r.map(e=>e.role)}),0===n&&a>0&&(h.v.warn(`[Workspace] GHOST CONVERSATION DETECTED: UI has ${n} messages but context has ${a} messages!`),h.v.warn("[Workspace] This causes the LLM to continue previous conversations that the user cannot see."),h.v.warn("[Workspace] Clearing context to match UI state..."),await aB.clearConversation(e.id),r.length=0);try{let r=await p.OP.listDirectory(e.id,"/");r.length>0&&(t=r.map(e=>e.path).join("\n"))}catch{}let o=(0,a$.m)(t),l=await new Promise(e=>{v(t=>(e(t),t))}),c=a_.prepareConversationForOrchestrator(l,{maxMessages:50,includeSystemPrompt:!0,systemPrompt:o}),u=new az.r(e.id,c,(e,t)=>{if("assistant_delta"===e&&(t?.text||t?.snapshot)){let e=t.text,r=t.snapshot;v(t=>{let{arr:n,idx:a}=L([...t]);if(a<0||a>=n.length||!n[a])return h.v.error("[assistant_delta] Invalid index or missing message:",{idx:a,arrayLength:n.length}),t;let i=n[a],o={...i,toolMessages:[...i.toolMessages||[]]},s=o.toolMessages;(0===s.length||"message"!==s[s.length-1].type)&&s.push({id:R(),type:"message",content:""});let l=s[s.length-1];return void 0!==r?l.content=r:e&&(l.content=(l.content||"")+e),n[a]=o,n})}if("toolCalls"===e&&t?.toolCalls){let e=t.toolCalls;h.v.debug(`[Workspace] Received ${e.length} tool calls`),v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let t=0;t{if(null==T.current)return e;let r=[...e],n=r[T.current];return r[T.current]={...n,cost:t.totalCost,usage:t.usage},r}),"evaluation"===e&&t?.summary){let e=t.summary;v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"message",content:e}),r[n]=i,r})}if("divider"===e&&v(e=>{let{arr:r,idx:n}=L([...e]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"divider",title:t?.title||"Section"}),r[n]=i,r}),"tool_result"===e&&t){let{toolIndex:e,result:r}=t;h.v.debug(`[Workspace] Received tool result for tool ${e}`,{resultPreview:"string"==typeof r?r.substring(0,100):r}),v(e=>{let{arr:t,idx:n}=L([...e]),a=t[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let e=o.length-1;e>=0;e--)if("tool"===o[e].type&&!o[e].result){o[e]={...o[e],result:r};break}return t[n]=i,t})}if("tool_status"===e&&t){let{toolIndex:e,status:r,result:n,error:a}=t;v(e=>{let{arr:t,idx:i}=L([...e]),o=t[i],s={...o,toolMessages:[...o.toolMessages||[]]},l=s.toolMessages;for(let e=l.length-1;e>=0;e--)if("tool"===l[e].type&&("pending"===l[e].status||"executing"===l[e].status)){l[e]={...l[e],status:r,result:n||a||l[e].result};break}return t[i]=s,t})}});d(u);let m=await u.execute(s);v(e=>{if(null==T.current)return e;let t=[...e],r=t[T.current];return t[T.current]={...r,checkpointId:m.checkpointId,cost:m.totalCost,usage:m.usageInfo},t}),m.success&&ej();let g=await new Promise(e=>{v(t=>(e(t),t))}),x=a_.convertToOrchestratorMessages(g);await aB.updateConversation(e.id,x),i("")}catch(e){h.v.error("Generation error:",e),tV.oR.error(e instanceof Error?e.message:"Failed to generate"),v(t=>[...t,{id:R(),role:"assistant",content:`Error: ${e instanceof Error?e.message:"Unknown error"}`}])}finally{c(!1),d(null),T.current=null}},eM=(0,l.useCallback)(()=>{u&&(u.stop(),tV.oR.info("Generation stopped"))},[u]),eP=[{id:"back",label:"Back to projects",icon:aT.A,onClick:t,variant:"outline"}];eP.push({id:"save",label:j?"Saving…":b?"Save":"Saved",icon:aE,onClick:eN,variant:b?"default":"outline",disabled:!b||j}),z&&eP.push({id:"discard",label:"Discard Changes",icon:aI,onClick:()=>eC(z,"Last saved state"),variant:"outline",disabled:j||!b,dataTourId:"discard-changes-button"});let eD=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[Q&&(0,s.jsxs)("span",{className:"text-sm font-medium",children:["$",W.toFixed(3)]}),(0,s.jsx)(rU,{className:"h-4 w-4"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nu,{})})]}),eT=(0,s.jsxs)("div",{className:"space-y-2",children:[Q&&(0,s.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",W.toFixed(W>=10?2:3)]})}),(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nu,{})})]})]});return(0,s.jsxs)(od,{children:[(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(rJ.j,{leftText:e.name,onLogoClick:t,actions:eP,mobileMenuContent:eT,desktopOnlyContent:eD}),(0,s.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,s.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,s.jsxs)(op,{children:[(0,s.jsx)(oh,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${ea?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:ea?"var(--button-assistant-active)":void 0,color:ea?"white":void 0},onClick:()=>ei(!ea),children:(0,s.jsx)(aA,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(om,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-assistant-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-assistant-active)",fill:"var(--button-assistant-active)"},children:(0,s.jsx)("p",{children:"Chat"})})]}),(0,s.jsxs)(op,{children:[(0,s.jsx)(oh,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${eo?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eo?"var(--button-files-active)":void 0,color:eo?"white":void 0},onClick:()=>es(!eo),children:(0,s.jsx)(nC,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(om,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-files-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-files-active)",fill:"var(--button-files-active)"},children:(0,s.jsx)("p",{children:"File Explorer"})})]}),(0,s.jsxs)(op,{children:[(0,s.jsx)(oh,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${el?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:el?"var(--button-editor-active)":void 0,color:el?"white":void 0},onClick:()=>ec(!el),children:(0,s.jsx)(aS,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(om,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-editor-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-editor-active)",fill:"var(--button-editor-active)"},children:(0,s.jsx)("p",{children:"Code Editor"})})]}),(0,s.jsxs)(op,{children:[(0,s.jsx)(oh,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 mx-1 rounded-sm flex items-center justify-center transition-all ${eu?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eu?"var(--button-preview-active)":void 0,color:eu?"white":void 0},onClick:()=>ed(!eu),children:(0,s.jsx)(M.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(om,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-preview-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-preview-active)",fill:"var(--button-preview-active)"},children:(0,s.jsx)("p",{children:"Preview"})})]})]}),(0,s.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,s.jsxs)(iV,{direction:"horizontal",autoSaveId:"workspace-layout",children:[ea&&(0,s.jsx)(aX,{id:"assistant",order:1,defaultSize:ep.assistant,minSize:15,children:(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},"data-tour-id":"assistant-panel",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aA,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),(0,s.jsxs)("button",{type:"button",onClick:()=>ei(!1),"aria-label":"Hide chat",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aA,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await aB.clearConversation(e.id);let t=await aB.getConversationMessages(e.id);t.length>0?h.v.error(`[Workspace] Clear failed! Still has ${t.length} messages in storage`):h.v.debug(`[Workspace] Successfully cleared all conversation data for project ${e.id}`)},className:"h-5 w-5 p-0",title:"Clear chat","data-tour-id":"clear-chat-button",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-y-auto p-4 space-y-3 flex flex-col","data-tour-id":"checkpoint-panel",children:[0===f.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(aA,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"Ready to build"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Describe what you want to create or change"})]})]})}):f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsx)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm",children:(0,s.jsx)(ox,{title:e.taskTitle||"Task Progress",steps:e.taskSteps,checkpointId:e.checkpointId,onRestore:e=>eC(e,"task checkpoint"),isSavedCheckpoint:e.checkpointId===z,expanded:F.has(t),onToggleExpand:()=>{let e=new Set(F);e.has(t)?e.delete(t):e.add(t),q(e)}})},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(cU,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(cB,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsxs)("div",{className:"flex flex-col p-2 gap-2",children:[(0,s.jsxs)(op,{children:[(0,s.jsx)(oh,{asChild:!0,children:(0,s.jsx)(m.$,{onClick:o?eM:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2","data-retry-trigger":"true",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nv.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(aR,{className:"h-4 w-4"}),"Send"]})})}),(0,s.jsx)(om,{side:"left",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Ctrl/Cmd+Enter"})," to send"]}),(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Enter"})," for newline"]})]})})]}),a.length>0&&(0,s.jsxs)("div",{className:"px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-xs text-center",children:[a.length," chars"]})]})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)(r2.AM,{open:$,onOpenChange:U,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),$?(0,s.jsx)(nw.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(aL.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"start",children:(0,s.jsx)(cH.t,{onClose:()=>U(!1),onModelChange:e=>_(e)})})]})})})]})]})]})}),ea&&(eo||el||eu)&&(0,s.jsx)(iW,{withHandle:!0}),eo&&(0,s.jsx)(aX,{id:"files",order:2,defaultSize:ep.files,minSize:14,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(nX,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})})}),eo&&(el||eu)&&(0,s.jsx)(iW,{withHandle:!0}),el&&(0,s.jsx)(aX,{id:"editor",order:3,defaultSize:ep.editor,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aP,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})})}),el&&eu&&(0,s.jsx)(iW,{withHandle:!0}),eu&&(0,s.jsx)(aX,{id:"preview",order:4,defaultSize:ep.preview,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})})]})})]}),(0,s.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["assistant"===x&&(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aA,{className:"h-4 w-4",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await aB.clearConversation(e.id)},className:"h-5 w-5 p-0",title:"Clear chat",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-auto p-2 space-y-2",children:[f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsxs)("div",{className:"border border-border rounded-lg p-3 bg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Task Progress"}),e.checkpointId&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>eC(e.checkpointId,"checkpoint"),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aI,{className:"h-3 w-3 mr-1"}),"Restore"]})]}),(0,s.jsx)(cU,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(cU,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(cB,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,s.jsx)(m.$,{onClick:o?eM:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nv.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(aR,{className:"h-4 w-4"}),"Send"]})})})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsxs)(r2.AM,{open:H,onOpenChange:V,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),H?(0,s.jsx)(nw.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(aL.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(cH.t,{onClose:()=>V(!1),onModelChange:e=>_(e)})})]})})]})]})]}),"files"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(nX,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})}),"editor"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aP,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})}),"preview"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})]}),(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,s.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"assistant"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"assistant"===x?"var(--button-assistant-active)":void 0},onClick:()=>y("assistant"),children:(0,s.jsx)(aA,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===x?"var(--button-files-active)":void 0},onClick:()=>y("files"),children:(0,s.jsx)(nC,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===x?"var(--button-editor-active)":void 0},onClick:()=>y("editor"),children:(0,s.jsx)(aS,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===x?"var(--button-preview-active)":void 0},onClick:()=>y("preview"),children:(0,s.jsx)(M.A,{className:"h-4 w-4"})})]})})]})]}),(0,s.jsx)(nx,{location:"workspace"}),(0,s.jsx)(nx,{location:"settings"})]})}function cW(){let[e,t]=(0,l.useState)(null),{state:r,setActiveProjectId:n}=ng();r.currentStep?.id,r.status;let a=(0,l.useMemo)(()=>e?(0,s.jsx)(cV,{project:e,onBack:()=>t(null)}):(0,s.jsx)(ny,{onProjectSelect:t}),[e]);return(0,s.jsxs)(s.Fragment,{children:[a,(0,s.jsx)(nx,{location:"global"})]})}function cG(){return(0,s.jsx)(nf,{children:(0,s.jsx)(cW,{})})}},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65840:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=null;if(!e||"string"!=typeof e)return r;var n=(0,a.default)(e),i="function"==typeof t;return n.forEach(function(e){if("declaration"===e.type){var n=e.property,a=e.value;i?t(n,a,e):a&&((r=r||{})[n]=a)}}),r};var a=n(r(44517))},71997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>o.a,__next_app__:()=>d,pages:()=>u,routeModule:()=>p,tree:()=>c});var n=r(65239),a=r(48088),i=r(88170),o=r.n(i),s=r(30893),l={};for(let e in s)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>s[e]);r.d(t,l);let c={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,90597)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,u=["/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],d={require:r,loadChunk:()=>Promise.resolve()},p=new n.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},86908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var c;return(void 0===t&&(t={}),!(c=e)||a.test(c)||r.test(c))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,l):e.replace(i,l)).replace(n,s))}},90597:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx","default")},94735:e=>{"use strict";e.exports=require("events")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[447,551,212,617],()=>r(71997));module.exports=n})(); \ No newline at end of file