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,4 +1,4 @@ -(()=>{var e={};e.id=974,e.ids=[974],e.modules={597:(e,A,t)=>{"use strict";t.r(A),t.d(A,{default:()=>r});let r=(0,t(2907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/osw-studio-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/osw-studio-git/app/page.tsx","default")},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1553:(e,A,t)=>{"use strict";let r,n;t.r(A),t.d(A,{default:()=>fZ});var a,s,i,o,l,c={};t.r(c),t.d(c,{boolean:()=>pg,booleanish:()=>pf,commaOrSpaceSeparated:()=>px,commaSeparated:()=>pv,number:()=>pB,overloadedBoolean:()=>pm,spaceSeparated:()=>pw});var u={};t.r(u),t.d(u,{attentionMarkers:()=>gf,contentInitial:()=>gc,disable:()=>gm,document:()=>gl,flow:()=>gd,flowInitial:()=>gu,insideSpan:()=>gg,string:()=>gp,text:()=>gh});var d=t(687),p=t(3210),h=t.t(p,2),g=t.n(p),f=t(6189),m=t(1338),B=t(5495),w=t(4084),v=t.n(w),x=t(5589),y=t(6241);class b{constructor(){this.db=new x.n}async init(){await this.db.init()}async exportProjectAsTemplate(e,A,t){try{y.v.info("[TemplateService] Exporting project as template",{projectId:A,name:t.name}),this.validateMetadata(t);let r=await e.getAllFilesAndDirectories(A),n=r.filter(e=>"directory"!==e.type),a=r.filter(e=>"directory"===e.type).map(e=>e.path),s={version:"1.0.0",name:t.name,description:t.description,templateVersion:t.version,author:t.author,authorUrl:t.authorUrl,license:t.license,licenseLabel:t.licenseLabel,licenseDescription:t.licenseDescription,tags:t.tags||[],thumbnail:t.thumbnail,previewImages:t.previewImages||[],downloadUrl:t.downloadUrl,directories:a,files:n.map(e=>({path:e.path,content:e.content})),assets:[]},i=new(v());i.file("template.json",JSON.stringify(s,null,2));let o=await i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}});return y.v.info("[TemplateService] Template exported successfully",{name:t.name,size:o.size}),o}catch(e){throw y.v.error("[TemplateService] Failed to export template:",e),Error(`Failed to export template: ${e instanceof Error?e.message:"Unknown error"}`)}}async importTemplateFile(e){try{if(y.v.info("[TemplateService] Importing template file",{name:e.name,size:e.size}),!e.name.endsWith(".oswt"))throw Error("Invalid file type. Expected .oswt file.");if(e.size>0x1900000)throw Error(`File too large. Maximum size is ${Math.round(25)}MB.`);let A=new(v()),t=(await A.loadAsync(e)).file("template.json");if(!t)throw Error("Invalid template file format. Missing template.json.");let r=await t.async("string"),n=JSON.parse(r);this.validateTemplateStructure(n);let a={id:(0,B.A)(),name:n.name,description:n.description,version:n.templateVersion||"1.0.0",files:n.files||[],directories:n.directories||[],assets:n.assets,metadata:{author:n.author,authorUrl:n.authorUrl,license:n.license||"personal",licenseLabel:n.licenseLabel,licenseDescription:n.licenseDescription,tags:n.tags||[],thumbnail:n.thumbnail,previewImages:n.previewImages||[],downloadUrl:n.downloadUrl},importedAt:new Date};return await this.db.saveCustomTemplate(a),y.v.info("[TemplateService] Template imported successfully",{id:a.id,name:a.name}),a}catch(e){throw y.v.error("[TemplateService] Failed to import template:",e),Error(`Failed to import template: ${e instanceof Error?e.message:"Unknown error"}`)}}async listCustomTemplates(){try{return await this.init(),(await this.db.getAllCustomTemplates()).sort((e,A)=>A.importedAt.getTime()-e.importedAt.getTime())}catch(e){throw y.v.error("[TemplateService] Failed to list templates:",e),Error("Failed to list templates")}}async deleteCustomTemplate(e){try{await this.init(),await this.db.deleteCustomTemplate(e),y.v.info("[TemplateService] Template deleted",{id:e})}catch(e){throw y.v.error("[TemplateService] Failed to delete template:",e),Error("Failed to delete template")}}async exportTemplateAsFile(e){try{y.v.info("[TemplateService] Re-exporting custom template",{id:e.id,name:e.name});let A=new(v());for(let t of(A.file("template.json",JSON.stringify(e,null,2)),e.files))t.content,A.file(t.path,t.content);return await A.generateAsync({type:"blob"})}catch(e){throw y.v.error("[TemplateService] Failed to re-export template:",e),Error(`Failed to export template: ${e instanceof Error?e.message:"Unknown error"}`)}}async generateThumbnail(e){y.v.info("[TemplateService] Thumbnail generation not yet implemented")}validateMetadata(e){if(!e.name||e.name.length<1||e.name.length>50)throw Error("Template name must be between 1 and 50 characters");if(!e.description||e.description.length<10||e.description.length>500)throw Error("Template description must be between 10 and 500 characters");if(!e.version||!/^\d+\.\d+\.\d+$/.test(e.version))throw Error("Template version must be in semantic version format (e.g., 1.0.0)");if(e.author&&e.author.length>50)throw Error("Author name must be 50 characters or less");if(e.authorUrl&&!this.isValidUrl(e.authorUrl))throw Error("Author URL must be a valid URL");if(!e.license)throw Error("License is required");if(e.tags&&e.tags.length>10)throw Error("Maximum 10 tags allowed");if(e.thumbnail&&e.thumbnail.length>512e3)throw Error(`Thumbnail too large. Maximum size is ${Math.round(500)}KB`);if(e.previewImages&&e.previewImages.length>5)throw Error("Maximum 5 preview images allowed");if(e.previewImages){for(let A of e.previewImages)if(A.length>1048576)throw Error(`Preview image too large. Maximum size is ${Math.round(1024)}KB per image`)}}validateTemplateStructure(e){if(!e.name||"string"!=typeof e.name)throw Error("Invalid template: missing or invalid name");if(!e.description||"string"!=typeof e.description)throw Error("Invalid template: missing or invalid description");if(!e.files||!Array.isArray(e.files))throw Error("Invalid template: missing or invalid files array");if(!e.directories||!Array.isArray(e.directories))throw Error("Invalid template: missing or invalid directories array");for(let A of e.files){if(!A.path||"string"!=typeof A.path)throw Error("Invalid template: file missing path");if(void 0===A.content)throw Error("Invalid template: file missing content")}}isValidUrl(e){try{return new URL(e),!0}catch{return!1}}}let C=new b;var Q=t(4934),F=t(8988);let U=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)("textarea",{className:(0,y.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:t,...A}));U.displayName="Textarea";var E=t(2688);let k=(0,E.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"}]]),j=(0,E.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"}]]),I=(0,E.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"}]]),H=(0,E.A)("file-box",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);var S=t(3964),N=t(1860);let L=(0,E.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"}]]),D=(0,E.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"}]]),T=(0,E.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"}]]),M=(0,E.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"}]]),K=(0,E.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 P=t(3861);let R=(0,E.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"}]]),O=(0,E.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"}]]),V=(0,E.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"}]]),G=(0,E.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"}]]),z=Symbol.for("constructDateFrom");function q(e,A){return"function"==typeof e?e(A):e&&"object"==typeof e&&z in e?e[z](A):e instanceof Date?new e.constructor(A):new Date(A)}let W={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 J(e){return (A={})=>{let t=A.width?String(A.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}let X={date:J({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:J({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:J({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(e){return(A,t)=>{let r;if("formatting"===(t?.context?String(t.context):"standalone")&&e.formattingValues){let A=e.defaultFormattingWidth||e.defaultWidth,n=t?.width?String(t.width):A;r=e.formattingValues[n]||e.formattingValues[A]}else{let A=e.defaultWidth,n=t?.width?String(t.width):e.defaultWidth;r=e.values[n]||e.values[A]}return r[e.argumentCallback?e.argumentCallback(A):A]}}function $(e){return(A,t={})=>{let r,n=t.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=A.match(a);if(!s)return null;let i=s[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,A){for(let t=0;te.test(i)):function(e,A){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&A(e[t]))return t}(o,e=>e.test(i));return r=e.valueCallback?e.valueCallback(l):l,{value:r=t.valueCallback?t.valueCallback(r):r,rest:A.slice(i.length)}}}let Z={code:"en-US",formatDistance:(e,A,t)=>{let r,n=W[e];if(r="string"==typeof n?n:1===A?n.one:n.other.replace("{{count}}",A.toString()),t?.addSuffix)if(t.comparison&&t.comparison>0)return"in "+r;else return r+" ago";return r},formatLong:X,formatRelative:(e,A,t,r)=>_[e],localize:{ordinalNumber:(e,A)=>{let t=Number(e),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({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:Y({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:Y({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:Y({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(A,t={})=>{let r=A.match(e.matchPattern);if(!r)return null;let n=r[0],a=A.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];return{value:s=t.valueCallback?t.valueCallback(s):s,rest:A.slice(n.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:$({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:$({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:$({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:$({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:$({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}},ee={};function eA(e,A){return q(A||e,e)}function et(e){let A=eA(e),t=new Date(Date.UTC(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds(),A.getMilliseconds()));return t.setUTCFullYear(A.getFullYear()),e-t}function er(e,...A){let t=q.bind(null,e||A.find(e=>"object"==typeof e));return A.map(t)}function en(e,A){let t=eA(e)-eA(A);return t<0?-1:t>0?1:t}function ea(e,A){return function(e,A,t){let r,n=t?.locale??ee.locale??Z,a=en(e,A);if(isNaN(a))throw RangeError("Invalid time value");let s=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:a}),[i,o]=er(t?.in,...a>0?[A,e]:[e,A]),l=function(e,A,t){var r;return(r=void 0,e=>{let A=(r?Math[r]:Math.trunc)(e);return 0===A?0:A})((eA(e)-eA(A))/1e3)}(o,i),c=Math.round((l-(et(o)-et(i))/1e3)/60);if(c<2)if(t?.includeSeconds)if(l<5)return n.formatDistance("lessThanXSeconds",5,s);else if(l<10)return n.formatDistance("lessThanXSeconds",10,s);else if(l<20)return n.formatDistance("lessThanXSeconds",20,s);else if(l<40)return n.formatDistance("halfAMinute",0,s);else if(l<60)return n.formatDistance("lessThanXMinutes",1,s);else return n.formatDistance("xMinutes",1,s);else if(0===c)return n.formatDistance("lessThanXMinutes",1,s);else return n.formatDistance("xMinutes",c,s);if(c<45)return n.formatDistance("xMinutes",c,s);if(c<90)return n.formatDistance("aboutXHours",1,s);if(c<1440){let e=Math.round(c/60);return n.formatDistance("aboutXHours",e,s)}if(c<2520)return n.formatDistance("xDays",1,s);else if(c<43200){let e=Math.round(c/1440);return n.formatDistance("xDays",e,s)}else if(c<86400)return r=Math.round(c/43200),n.formatDistance("aboutXMonths",r,s);if((r=function(e,A,t){let[r,n,a]=er(void 0,e,e,A),s=en(n,a),i=Math.abs(function(e,A,t){let[r,n]=er(void 0,e,A);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(n,a));if(i<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let o=en(n,a)===-s;(function(e,A){let t=eA(e,void 0);return+function(e,A){let t=eA(e,A?.in);return t.setHours(23,59,59,999),t}(t,void 0)==+function(e,A){let t=eA(e,A?.in),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}(t,A)})(r)&&1===i&&1===en(r,a)&&(o=!1);let l=s*(i-o);return 0===l?0:l}(o,i))<12){let e=Math.round(c/43200);return n.formatDistance("xMonths",e,s)}{let e=r%12,A=Math.trunc(r/12);return e<3?n.formatDistance("aboutXYears",A,s):e<9?n.formatDistance("overXYears",A,s):n.formatDistance("almostXYears",A+1,s)}}(e,q(e,Date.now()),A)}var es=t(569),ei=t(8599),eo=t(1273),el=t(5551),ec=t(4163),eu=t(9510),ed=t(43),ep=t(1355),eh=t(1359),eg=t(2547),ef=t(6963),em=t(5509),eB=t(5028),ew=t(6059),ev=t(3495),ex="rovingFocusGroup.onEntryFocus",ey={bubbles:!1,cancelable:!0},eb="RovingFocusGroup",[eC,eQ,eF]=(0,eu.N)(eb),[eU,eE]=(0,eo.A)(eb,[eF]),[ek,ej]=eU(eb),eI=p.forwardRef((e,A)=>(0,d.jsx)(eC.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eC.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eH,{...e,ref:A})})}));eI.displayName=eb;var eH=p.forwardRef((e,A)=>{let{__scopeRovingFocusGroup:t,orientation:r,loop:n=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:o,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...u}=e,h=p.useRef(null),g=(0,ei.s)(A,h),f=(0,ed.jH)(a),[m,B]=(0,el.i)({prop:s,defaultProp:i??null,onChange:o,caller:eb}),[w,v]=p.useState(!1),x=(0,ev.c)(l),y=eQ(t),b=p.useRef(!1),[C,Q]=p.useState(0);return p.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(ex,x),()=>e.removeEventListener(ex,x)},[x]),(0,d.jsx)(ek,{scope:t,orientation:r,dir:f,loop:n,currentTabStopId:m,onItemFocus:p.useCallback(e=>B(e),[B]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>Q(e=>e+1),[]),onFocusableItemRemove:p.useCallback(()=>Q(e=>e-1),[]),children:(0,d.jsx)(ec.sG.div,{tabIndex:w||0===C?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:(0,es.mK)(e.onMouseDown,()=>{b.current=!0}),onFocus:(0,es.mK)(e.onFocus,e=>{let A=!b.current;if(e.target===e.currentTarget&&A&&!w){let A=new CustomEvent(ex,ey);if(e.currentTarget.dispatchEvent(A),!A.defaultPrevented){let e=y().filter(e=>e.focusable);eD([e.find(e=>e.active),e.find(e=>e.id===m),...e].filter(Boolean).map(e=>e.ref.current),c)}}b.current=!1}),onBlur:(0,es.mK)(e.onBlur,()=>v(!1))})})}),eS="RovingFocusGroupItem",eN=p.forwardRef((e,A)=>{let{__scopeRovingFocusGroup:t,focusable:r=!0,active:n=!1,tabStopId:a,children:s,...i}=e,o=(0,ef.B)(),l=a||o,c=ej(eS,t),u=c.currentTabStopId===l,h=eQ(t),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:m}=c;return p.useEffect(()=>{if(r)return g(),()=>f()},[r,g,f]),(0,d.jsx)(eC.ItemSlot,{scope:t,id:l,focusable:r,active:n,children:(0,d.jsx)(ec.sG.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...i,ref:A,onMouseDown:(0,es.mK)(e.onMouseDown,e=>{r?c.onItemFocus(l):e.preventDefault()}),onFocus:(0,es.mK)(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;let A=function(e,A,t){var r;let n=(r=e.key,"rtl"!==t?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===A&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===A&&["ArrowUp","ArrowDown"].includes(n)))return eL[n]}(e,c.orientation,c.dir);if(void 0!==A){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let t=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===A)t.reverse();else if("prev"===A||"next"===A){"prev"===A&&t.reverse();let r=t.indexOf(e.currentTarget);t=c.loop?function(e,A){return e.map((t,r)=>e[(A+r)%e.length])}(t,r+1):t.slice(r+1)}setTimeout(()=>eD(t))}}),children:"function"==typeof s?s({isCurrentTabStop:u,hasTabStop:null!=m}):s})})});eN.displayName=eS;var eL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eD(e,A=!1){let t=document.activeElement;for(let r of e)if(r===t||(r.focus({preventScroll:A}),document.activeElement!==t))return}var eT=t(8730),eM=t(3376),eK=t(2247),eP=["Enter"," "],eR=["ArrowUp","PageDown","End"],eO=["ArrowDown","PageUp","Home",...eR],eV={ltr:[...eP,"ArrowRight"],rtl:[...eP,"ArrowLeft"]},eG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ez="Menu",[eq,eW,eJ]=(0,eu.N)(ez),[eX,e_]=(0,eo.A)(ez,[eJ,em.Bk,eE]),eY=(0,em.Bk)(),e$=eE(),[eZ,e0]=eX(ez),[e1,e2]=eX(ez),e4=e=>{let{__scopeMenu:A,open:t=!1,children:r,dir:n,onOpenChange:a,modal:s=!0}=e,i=eY(A),[o,l]=p.useState(null),c=p.useRef(!1),u=(0,ev.c)(a),h=(0,ed.jH)(n);return p.useEffect(()=>{let e=()=>{c.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),(0,d.jsx)(em.bL,{...i,children:(0,d.jsx)(eZ,{scope:A,open:t,onOpenChange:u,content:o,onContentChange:l,children:(0,d.jsx)(e1,{scope:A,onClose:p.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};e4.displayName=ez;var e3=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e,n=eY(t);return(0,d.jsx)(em.Mz,{...n,...r,ref:A})});e3.displayName="MenuAnchor";var e5="MenuPortal",[e6,e8]=eX(e5,{forceMount:void 0}),e9=e=>{let{__scopeMenu:A,forceMount:t,children:r,container:n}=e,a=e0(e5,A);return(0,d.jsx)(e6,{scope:A,forceMount:t,children:(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:r})})})};e9.displayName=e5;var e7="MenuContent",[Ae,AA]=eX(e7),At=p.forwardRef((e,A)=>{let t=e8(e7,e.__scopeMenu),{forceMount:r=t.forceMount,...n}=e,a=e0(e7,e.__scopeMenu),s=e2(e7,e.__scopeMenu);return(0,d.jsx)(eq.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(eq.Slot,{scope:e.__scopeMenu,children:s.modal?(0,d.jsx)(Ar,{...n,ref:A}):(0,d.jsx)(An,{...n,ref:A})})})})}),Ar=p.forwardRef((e,A)=>{let t=e0(e7,e.__scopeMenu),r=p.useRef(null),n=(0,ei.s)(A,r);return p.useEffect(()=>{let e=r.current;if(e)return(0,eM.Eq)(e)},[]),(0,d.jsx)(As,{...e,ref:n,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),An=p.forwardRef((e,A)=>{let t=e0(e7,e.__scopeMenu);return(0,d.jsx)(As,{...e,ref:A,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Aa=(0,eT.TL)("MenuContent.ScrollLock"),As=p.forwardRef((e,A)=>{let{__scopeMenu:t,loop:r=!1,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEntryFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,onDismiss:g,disableOutsideScroll:f,...m}=e,B=e0(e7,t),w=e2(e7,t),v=eY(t),x=e$(t),y=eW(t),[b,C]=p.useState(null),Q=p.useRef(null),F=(0,ei.s)(A,Q,B.onContentChange),U=p.useRef(0),E=p.useRef(""),k=p.useRef(0),j=p.useRef(null),I=p.useRef("right"),H=p.useRef(0),S=f?eK.A:p.Fragment,N=e=>{let A=E.current+e,t=y().filter(e=>!e.disabled),r=document.activeElement,n=t.find(e=>e.ref.current===r)?.textValue,a=function(e,A,t){var r;let n=A.length>1&&Array.from(A).every(e=>e===A[0])?A[0]:A,a=t?e.indexOf(t):-1,s=(r=Math.max(a,0),e.map((A,t)=>e[(r+t)%e.length]));1===n.length&&(s=s.filter(e=>e!==t));let i=s.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),A,n),s=t.find(e=>e.textValue===a)?.ref.current;!function e(A){E.current=A,window.clearTimeout(U.current),""!==A&&(U.current=window.setTimeout(()=>e(""),1e3))}(A),s&&setTimeout(()=>s.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),(0,eh.Oh)();let L=p.useCallback(e=>I.current===j.current?.side&&function(e,A){return!!A&&function(e,A){let{x:t,y:r}=e,n=!1;for(let e=0,a=A.length-1;er!=u>r&&t<(c-o)*(r-l)/(u-l)+o&&(n=!n)}return n}({x:e.clientX,y:e.clientY},A)}(e,j.current?.area),[]);return(0,d.jsx)(Ae,{scope:t,searchRef:E,onItemEnter:p.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:p.useCallback(e=>{L(e)||(Q.current?.focus(),C(null))},[L]),onTriggerLeave:p.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:k,onPointerGraceIntentChange:p.useCallback(e=>{j.current=e},[]),children:(0,d.jsx)(S,{...f?{as:Aa,allowPinchZoom:!0}:void 0,children:(0,d.jsx)(eg.n,{asChild:!0,trapped:n,onMountAutoFocus:(0,es.mK)(a,e=>{e.preventDefault(),Q.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,d.jsx)(ep.qW,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,onDismiss:g,children:(0,d.jsx)(eI,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:C,onEntryFocus:(0,es.mK)(o,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,d.jsx)(em.UC,{role:"menu","aria-orientation":"vertical","data-state":AN(B.open),"data-radix-menu-content":"",dir:w.dir,...v,...m,ref:F,style:{outline:"none",...m.style},onKeyDown:(0,es.mK)(m.onKeyDown,e=>{let A=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;A&&("Tab"===e.key&&e.preventDefault(),!t&&r&&N(e.key));let n=Q.current;if(e.target!==n||!eO.includes(e.key))return;e.preventDefault();let a=y().filter(e=>!e.disabled).map(e=>e.ref.current);eR.includes(e.key)&&a.reverse(),function(e){let A=document.activeElement;for(let t of e)if(t===A||(t.focus(),document.activeElement!==A))return}(a)}),onBlur:(0,es.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(U.current),E.current="")}),onPointerMove:(0,es.mK)(e.onPointerMove,AT(e=>{let A=e.target,t=H.current!==e.clientX;e.currentTarget.contains(A)&&t&&(I.current=e.clientX>H.current?"right":"left",H.current=e.clientX)}))})})})})})})});At.displayName=e7;var Ai=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{role:"group",...r,ref:A})});Ai.displayName="MenuGroup";var Ao=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{...r,ref:A})});Ao.displayName="MenuLabel";var Al="MenuItem",Ac="menu.itemSelect",Au=p.forwardRef((e,A)=>{let{disabled:t=!1,onSelect:r,...n}=e,a=p.useRef(null),s=e2(Al,e.__scopeMenu),i=AA(Al,e.__scopeMenu),o=(0,ei.s)(A,a),l=p.useRef(!1);return(0,d.jsx)(Ad,{...n,ref:o,disabled:t,onClick:(0,es.mK)(e.onClick,()=>{let e=a.current;if(!t&&e){let A=new CustomEvent(Ac,{bubbles:!0,cancelable:!0});e.addEventListener(Ac,e=>r?.(e),{once:!0}),(0,ec.hO)(e,A),A.defaultPrevented?l.current=!1:s.onClose()}}),onPointerDown:A=>{e.onPointerDown?.(A),l.current=!0},onPointerUp:(0,es.mK)(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{let A=""!==i.searchRef.current;t||A&&" "===e.key||eP.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Au.displayName=Al;var Ad=p.forwardRef((e,A)=>{let{__scopeMenu:t,disabled:r=!1,textValue:n,...a}=e,s=AA(Al,t),i=e$(t),o=p.useRef(null),l=(0,ei.s)(A,o),[c,u]=p.useState(!1),[h,g]=p.useState("");return p.useEffect(()=>{let e=o.current;e&&g((e.textContent??"").trim())},[a.children]),(0,d.jsx)(eq.ItemSlot,{scope:t,disabled:r,textValue:n??h,children:(0,d.jsx)(eN,{asChild:!0,...i,focusable:!r,children:(0,d.jsx)(ec.sG.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:(0,es.mK)(e.onPointerMove,AT(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,es.mK)(e.onPointerLeave,AT(e=>s.onItemLeave(e))),onFocus:(0,es.mK)(e.onFocus,()=>u(!0)),onBlur:(0,es.mK)(e.onBlur,()=>u(!1))})})})}),Ap=p.forwardRef((e,A)=>{let{checked:t=!1,onCheckedChange:r,...n}=e;return(0,d.jsx)(Ax,{scope:e.__scopeMenu,checked:t,children:(0,d.jsx)(Au,{role:"menuitemcheckbox","aria-checked":AL(t)?"mixed":t,...n,ref:A,"data-state":AD(t),onSelect:(0,es.mK)(n.onSelect,()=>r?.(!!AL(t)||!t),{checkForDefaultPrevented:!1})})})});Ap.displayName="MenuCheckboxItem";var Ah="MenuRadioGroup",[Ag,Af]=eX(Ah,{value:void 0,onValueChange:()=>{}}),Am=p.forwardRef((e,A)=>{let{value:t,onValueChange:r,...n}=e,a=(0,ev.c)(r);return(0,d.jsx)(Ag,{scope:e.__scopeMenu,value:t,onValueChange:a,children:(0,d.jsx)(Ai,{...n,ref:A})})});Am.displayName=Ah;var AB="MenuRadioItem",Aw=p.forwardRef((e,A)=>{let{value:t,...r}=e,n=Af(AB,e.__scopeMenu),a=t===n.value;return(0,d.jsx)(Ax,{scope:e.__scopeMenu,checked:a,children:(0,d.jsx)(Au,{role:"menuitemradio","aria-checked":a,...r,ref:A,"data-state":AD(a),onSelect:(0,es.mK)(r.onSelect,()=>n.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});Aw.displayName=AB;var Av="MenuItemIndicator",[Ax,Ay]=eX(Av,{checked:!1}),Ab=p.forwardRef((e,A)=>{let{__scopeMenu:t,forceMount:r,...n}=e,a=Ay(Av,t);return(0,d.jsx)(ew.C,{present:r||AL(a.checked)||!0===a.checked,children:(0,d.jsx)(ec.sG.span,{...n,ref:A,"data-state":AD(a.checked)})})});Ab.displayName=Av;var AC=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{role:"separator","aria-orientation":"horizontal",...r,ref:A})});AC.displayName="MenuSeparator";var AQ=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e,n=eY(t);return(0,d.jsx)(em.i3,{...n,...r,ref:A})});AQ.displayName="MenuArrow";var AF="MenuSub",[AU,AE]=eX(AF),Ak=e=>{let{__scopeMenu:A,children:t,open:r=!1,onOpenChange:n}=e,a=e0(AF,A),s=eY(A),[i,o]=p.useState(null),[l,c]=p.useState(null),u=(0,ev.c)(n);return p.useEffect(()=>(!1===a.open&&u(!1),()=>u(!1)),[a.open,u]),(0,d.jsx)(em.bL,{...s,children:(0,d.jsx)(eZ,{scope:A,open:r,onOpenChange:u,content:l,onContentChange:c,children:(0,d.jsx)(AU,{scope:A,contentId:(0,ef.B)(),triggerId:(0,ef.B)(),trigger:i,onTriggerChange:o,children:t})})})};Ak.displayName=AF;var Aj="MenuSubTrigger",AI=p.forwardRef((e,A)=>{let t=e0(Aj,e.__scopeMenu),r=e2(Aj,e.__scopeMenu),n=AE(Aj,e.__scopeMenu),a=AA(Aj,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:o}=a,l={__scopeMenu:e.__scopeMenu},c=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>c,[c]),p.useEffect(()=>{let e=i.current;return()=>{window.clearTimeout(e),o(null)}},[i,o]),(0,d.jsx)(e3,{asChild:!0,...l,children:(0,d.jsx)(Ad,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":n.contentId,"data-state":AN(t.open),...e,ref:(0,ei.t)(A,n.onTriggerChange),onClick:A=>{e.onClick?.(A),e.disabled||A.defaultPrevented||(A.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:(0,es.mK)(e.onPointerMove,AT(A=>{a.onItemEnter(A),!A.defaultPrevented&&(e.disabled||t.open||s.current||(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),c()},100)))})),onPointerLeave:(0,es.mK)(e.onPointerLeave,AT(e=>{c();let A=t.content?.getBoundingClientRect();if(A){let r=t.content?.dataset.side,n="right"===r,s=A[n?"left":"right"],o=A[n?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(n?-5:5),y:e.clientY},{x:s,y:A.top},{x:o,y:A.top},{x:o,y:A.bottom},{x:s,y:A.bottom}],side:r}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:(0,es.mK)(e.onKeyDown,A=>{let n=""!==a.searchRef.current;e.disabled||n&&" "===A.key||eV[r.dir].includes(A.key)&&(t.onOpenChange(!0),t.content?.focus(),A.preventDefault())})})})});AI.displayName=Aj;var AH="MenuSubContent",AS=p.forwardRef((e,A)=>{let t=e8(e7,e.__scopeMenu),{forceMount:r=t.forceMount,...n}=e,a=e0(e7,e.__scopeMenu),s=e2(e7,e.__scopeMenu),i=AE(AH,e.__scopeMenu),o=p.useRef(null),l=(0,ei.s)(A,o);return(0,d.jsx)(eq.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(eq.Slot,{scope:e.__scopeMenu,children:(0,d.jsx)(As,{id:i.contentId,"aria-labelledby":i.triggerId,...n,ref:l,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&o.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>{e.target!==i.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:(0,es.mK)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{let A=e.currentTarget.contains(e.target),t=eG[s.dir].includes(e.key);A&&t&&(a.onOpenChange(!1),i.trigger?.focus(),e.preventDefault())})})})})})});function AN(e){return e?"open":"closed"}function AL(e){return"indeterminate"===e}function AD(e){return AL(e)?"indeterminate":e?"checked":"unchecked"}function AT(e){return A=>"mouse"===A.pointerType?e(A):void 0}AS.displayName=AH;var AM="DropdownMenu",[AK,AP]=(0,eo.A)(AM,[e_]),AR=e_(),[AO,AV]=AK(AM),AG=e=>{let{__scopeDropdownMenu:A,children:t,dir:r,open:n,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,o=AR(A),l=p.useRef(null),[c,u]=(0,el.i)({prop:n,defaultProp:a??!1,onChange:s,caller:AM});return(0,d.jsx)(AO,{scope:A,triggerId:(0,ef.B)(),triggerRef:l,contentId:(0,ef.B)(),open:c,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(e=>!e),[u]),modal:i,children:(0,d.jsx)(e4,{...o,open:c,onOpenChange:u,dir:r,modal:i,children:t})})};AG.displayName=AM;var Az="DropdownMenuTrigger",Aq=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,disabled:r=!1,...n}=e,a=AV(Az,t),s=AR(t);return(0,d.jsx)(e3,{asChild:!0,...s,children:(0,d.jsx)(ec.sG.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...n,ref:(0,ei.t)(A,a.triggerRef),onPointerDown:(0,es.mK)(e.onPointerDown,e=>{!r&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{!r&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Aq.displayName=Az;var AW=e=>{let{__scopeDropdownMenu:A,...t}=e,r=AR(A);return(0,d.jsx)(e9,{...r,...t})};AW.displayName="DropdownMenuPortal";var AJ="DropdownMenuContent",AX=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AV(AJ,t),a=AR(t),s=p.useRef(!1);return(0,d.jsx)(At,{id:n.contentId,"aria-labelledby":n.triggerId,...a,...r,ref:A,onCloseAutoFocus:(0,es.mK)(e.onCloseAutoFocus,e=>{s.current||n.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,es.mK)(e.onInteractOutside,e=>{let A=e.detail.originalEvent,t=0===A.button&&!0===A.ctrlKey,r=2===A.button||t;(!n.modal||r)&&(s.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)"}})});AX.displayName=AJ,p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ai,{...n,...r,ref:A})}).displayName="DropdownMenuGroup",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ao,{...n,...r,ref:A})}).displayName="DropdownMenuLabel";var A_=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Au,{...n,...r,ref:A})});A_.displayName="DropdownMenuItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ap,{...n,...r,ref:A})}).displayName="DropdownMenuCheckboxItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Am,{...n,...r,ref:A})}).displayName="DropdownMenuRadioGroup",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Aw,{...n,...r,ref:A})}).displayName="DropdownMenuRadioItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ab,{...n,...r,ref:A})}).displayName="DropdownMenuItemIndicator";var AY=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AC,{...n,...r,ref:A})});function A$({...e}){return(0,d.jsx)(AG,{"data-slot":"dropdown-menu",...e})}function AZ({...e}){return(0,d.jsx)(Aq,{"data-slot":"dropdown-menu-trigger",...e})}function A0({className:e,sideOffset:A=4,...t}){return(0,d.jsx)(AW,{children:(0,d.jsx)(AX,{"data-slot":"dropdown-menu-content",sideOffset:A,className:(0,y.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),...t})})}function A1({className:e,inset:A,variant:t="default",...r}){return(0,d.jsx)(A_,{"data-slot":"dropdown-menu-item","data-inset":A,"data-variant":t,className:(0,y.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),...r})}function A2({className:e,...A}){return(0,d.jsx)(AY,{"data-slot":"dropdown-menu-separator",className:(0,y.cn)("bg-border -mx-1 my-1 h-px",e),...A})}AY.displayName="DropdownMenuSeparator",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AQ,{...n,...r,ref:A})}).displayName="DropdownMenuArrow",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AI,{...n,...r,ref:A})}).displayName="DropdownMenuSubTrigger",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AS,{...n,...r,ref:A,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 A4=t(2581);function A3({project:e,onSelect:A,onDelete:t,onExport:r,onExportZip:n,onDuplicate:a,onPreview:s,onUpdate:i,onExportAsTemplate:o,viewMode:l="grid",forceMenuOpen:c=!1,highlightExport:u=!1}){let[h,g]=(0,p.useState)(!1),[f,B]=(0,p.useState)(e.name),[w,v]=(0,p.useState)(e.description||""),[x,b]=(0,p.useState)(null),[C,E]=(0,p.useState)(!0),[z,q]=(0,p.useState)(!1),W=async()=>{if(!f.trim()){A4.oR.error("Project name cannot be empty"),B(e.name),g(!1);return}if(f.length>50)return void A4.oR.error("Project name must be 50 characters or less");if(w.length>200)return void A4.oR.error("Description must be 200 characters or less");try{e.name=f.trim(),e.description=w.trim()||void 0,await m.vfs.updateProject(e),i(e),g(!1),A4.oR.success("Project updated")}catch(A){y.v.error("Failed to update project:",A),A4.oR.error("Failed to update project"),B(e.name),v(e.description||"")}},J=()=>{B(e.name),v(e.description||""),g(!1)},X=e=>{if(c)return void q(!0);q(e)},_=()=>x?Object.entries(x.fileTypes).sort(([,e],[,A])=>A-e).slice(0,3):[],Y=e=>{let A=e.toLowerCase();return["html","htm"].includes(A)?(0,d.jsx)(k,{className:"h-3 w-3"}):["css","scss","sass"].includes(A)?(0,d.jsx)(j,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(A)?(0,d.jsx)(k,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(A)?(0,d.jsx)(I,{className:"h-3 w-3"}):(0,d.jsx)(j,{className:"h-3 w-3"})},$=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===l?(0,d.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${u?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>A(e),children:(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[e.previewImage?(0,d.jsx)("div",{className:"w-16 h-12 rounded-md overflow-hidden bg-muted shrink-0 opacity-60",children:(0,d.jsx)("img",{src:e.previewImage,alt:`${e.name} preview`,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-16 h-12 rounded-md bg-muted flex items-center justify-center shrink-0 opacity-40",children:(0,d.jsx)(H,{className:"h-6 w-6 text-muted-foreground/30"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col md:flex-row md:gap-6",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-2",children:h?(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-1",onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(F.p,{value:f,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W(),"Escape"===e.key&&J()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[f.length,"/50"]}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,d.jsx)(S.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:J,children:(0,d.jsx)(N.A,{className:"h-3 w-3"})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),g(!0)},children:(0,d.jsx)(L,{className:"h-3 w-3"})})]})}),e.description&&!h&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1",children:e.description}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Updated ",ea(e.updatedAt,{addSuffix:!0})]})]}),(0,d.jsxs)("div",{className:"space-y-2 mt-2 md:mt-0",children:[x&&(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(D,{className:"h-4 w-4"}),x.fileCount," ",1===x.fileCount?"file":"files"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(T,{className:"h-4 w-4"}),x.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(M,{className:"h-4 w-4"}),$(e.costTracking.totalCost)]})]}),x&&_().length>0&&(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:_().map(([e,A])=>(0,d.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[Y(e),(0,d.jsxs)("span",{children:[e.toUpperCase()," (",A,")"]})]},e))})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2 ml-4",children:(0,d.jsxs)(A$,{open:!!c||z,onOpenChange:X,children:[(0,d.jsx)(AZ,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":u?"project-actions-trigger":void 0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),s(e)},children:[(0,d.jsx)(P.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),a(e)},children:[(0,d.jsx)(R,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),n(e)},children:[(0,d.jsx)(O,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),r(e)},"data-tour-id":u?"project-export-json":void 0,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),o&&(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),o(e)},children:[(0,d.jsx)(H,{className:"mr-2 h-4 w-4"}),"Export as Template"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:A=>{A.stopPropagation(),t(e)},children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})}):(0,d.jsxs)("div",{className:`border border-border rounded-lg overflow-hidden hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${u?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>A(e),"data-tour-id":"project-card",children:[e.previewImage?(0,d.jsx)("div",{className:"w-full aspect-video bg-muted",children:(0,d.jsx)("img",{src:e.previewImage,alt:`${e.name} preview`,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-full aspect-video bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-16 w-16 text-muted-foreground/30"})}),(0,d.jsxs)("div",{className:"p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-start",children:[h?(0,d.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(F.p,{value:f,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),W()),"Escape"===e.key&&J()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,d.jsx)(S.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:J,children:(0,d.jsx)(N.A,{className:"h-3 w-3"})})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[f.length,"/50"]})]}):(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),g(!0)},children:(0,d.jsx)(L,{className:"h-3 w-3"})})]}),(0,d.jsxs)(A$,{open:!!c||z,onOpenChange:X,children:[(0,d.jsx)(AZ,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":u?"project-actions-trigger":void 0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),s(e)},children:[(0,d.jsx)(P.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),a(e)},children:[(0,d.jsx)(R,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),n(e)},children:[(0,d.jsx)(O,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),r(e)},"data-tour-id":u?"project-export-json":void 0,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),o&&(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),o(e)},children:[(0,d.jsx)(H,{className:"mr-2 h-4 w-4"}),"Export as Template"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:A=>{A.stopPropagation(),t(e)},children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),h?(0,d.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(U,{value:w,onChange:e=>v(e.target.value),onKeyDown:e=>{"Escape"===e.key&&J()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,d.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[w.length,"/200"]})})]}):(0,d.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),C?(0,d.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):x&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(D,{className:"h-4 w-4"}),x.fileCount," ",1===x.fileCount?"file":"files"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(T,{className:"h-4 w-4"}),x.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(M,{className:"h-4 w-4"}),$(e.costTracking.totalCost)]})]}),_().length>0&&(0,d.jsx)("div",{className:"flex items-center gap-3 text-xs",children:_().map(([e,A])=>(0,d.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[Y(e),(0,d.jsxs)("span",{children:[e," (",A,")"]})]},e))})]}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,d.jsxs)("p",{children:["Updated ",ea(e.updatedAt,{addSuffix:!0})]})})]})]})}var A5=t(2106),A6=t(8122);let A8=(0,E.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),A9=(0,E.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),A7=(0,E.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"}]]),te=(0,E.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"}]]),tA=(0,E.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),tt=(0,E.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"}]]),tr=(0,E.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 tn=t(3974),ta=function(e,A){return(ta=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,A){e.__proto__=A}||function(e,A){for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t])})(e,A)};function ts(e,A){if("function"!=typeof A&&null!==A)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");function t(){this.constructor=e}ta(e,A),e.prototype=null===A?Object.create(A):(t.prototype=A.prototype,new t)}var ti=function(){return(ti=Object.assign||function(e){for(var A,t=1,r=arguments.length;t0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=55296&&n<=56319&&t>10)+55296,s%1024+56320)),(n+1===t||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},tf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tm="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tB=0;tB>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&a;return l},tb=function(e){for(var A=e.length,t=[],r=0;r=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e>11),A=this.index[A]+(e>>5&63),A=((A=this.index[A])<<2)+(31&e),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),tE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tk="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tj=0;tj50?(n.push(!0),s-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(A)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(a),t.push(16);if(4===s||11===s){if(0===a)return r.push(a),t.push(30);var i=t[a-1];return -1===tT.indexOf(i)?(r.push(r[a-1]),t.push(i)):(r.push(a),t.push(30))}if(r.push(a),31===s)return t.push("strict"===A?21:37);if(42===s||29===s)return t.push(30);if(43===s)if(e>=131072&&e<=196605||e>=196608&&e<=262141)return t.push(37);else return t.push(30);t.push(s)}),[r,t,n]},tR=function(e,A,t,r){var n=r[t];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var a=t;a<=r.length;){var s=r[++a];if(s===A)return!0;if(10!==s)break}if(10===n)for(var a=t;a>0;){var i=r[--a];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var o=t;o<=r.length;){var s=r[++o];if(s===A)return!0;if(10!==s)break}if(10!==i)break}return!1},tO=function(e,A){for(var t=e;t>=0;){var r=A[t];if(10!==r)return r;t--}return 0},tV=function(e,A,t,r,n){if(0===t[r])return"\xd7";var a=r-1;if(Array.isArray(n)&&!0===n[a])return"\xd7";var s=a-1,i=a+1,o=A[a],l=s>=0?A[s]:0,c=A[i];if(2===o&&3===c)return"\xd7";if(-1!==tN.indexOf(o))return"!";if(-1!==tN.indexOf(c)||-1!==tL.indexOf(c))return"\xd7";if(8===tO(a,A))return"\xf7";if(11===tH.get(e[a])||(32===o||33===o)&&11===tH.get(e[i])||7===o||7===c||9===o||-1===[10,13,15].indexOf(o)&&9===c||-1!==[17,18,19,24,28].indexOf(c)||22===tO(a,A)||tR(23,22,a,A)||tR([17,18],21,a,A)||tR(12,12,a,A))return"\xd7";if(10===o)return"\xf7";if(23===o||23===c)return"\xd7";if(16===c||16===o)return"\xf7";if(-1!==[13,15,21].indexOf(c)||14===o||36===l&&-1!==tK.indexOf(o)||28===o&&36===c||20===c||-1!==tS.indexOf(c)&&25===o||-1!==tS.indexOf(o)&&25===c||27===o&&-1!==[37,32,33].indexOf(c)||-1!==[37,32,33].indexOf(o)&&26===c||-1!==tS.indexOf(o)&&-1!==tD.indexOf(c)||-1!==tD.indexOf(o)&&-1!==tS.indexOf(c)||-1!==[27,26].indexOf(o)&&(25===c||-1!==[22,15].indexOf(c)&&25===A[i+1])||-1!==[22,15].indexOf(o)&&25===c||25===o&&-1!==[25,28,24].indexOf(c))return"\xd7";if(-1!==[25,28,24,17,18].indexOf(c))for(var u=a;u>=0;){var d=A[u];if(25===d)return"\xd7";if(-1!==[28,24].indexOf(d))u--;else break}if(-1!==[27,26].indexOf(c))for(var u=-1!==[17,18].indexOf(o)?s:a;u>=0;){var d=A[u];if(25===d)return"\xd7";if(-1!==[28,24].indexOf(d))u--;else break}if(38===o&&-1!==[38,39,34,35].indexOf(c)||-1!==[39,34].indexOf(o)&&-1!==[39,40].indexOf(c)||-1!==[40,35].indexOf(o)&&40===c||-1!==tM.indexOf(o)&&-1!==[20,26].indexOf(c)||-1!==tM.indexOf(c)&&27===o||-1!==tS.indexOf(o)&&-1!==tS.indexOf(c)||24===o&&-1!==tS.indexOf(c)||-1!==tS.concat(25).indexOf(o)&&22===c&&-1===tI.indexOf(e[i])||-1!==tS.concat(25).indexOf(c)&&18===o)return"\xd7";if(41===o&&41===c){for(var p=t[a],h=1;p>0;)if(41===A[--p])h++;else break;if(h%2!=0)return"\xd7"}return 32===o&&33===c?"\xd7":"\xf7"},tG=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=tP(e,A.lineBreak),r=t[0],n=t[1],a=t[2];return("break-all"===A.wordBreak||"break-word"===A.wordBreak)&&(n=n.map(function(e){return -1!==[25,30,42].indexOf(e)?37:e})),[r,n,"keep-all"===A.wordBreak?a.map(function(A,t){return A&&e[t]>=19968&&e[t]<=40959}):void 0]},tz=function(){function e(e,A,t,r){this.codePoints=e,this.required="!"===A,this.start=t,this.end=r}return e.prototype.slice=function(){return tg.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),tq=function(e,A){var t=th(e),r=tG(t,A),n=r[0],a=r[1],s=r[2],i=t.length,o=0,l=0;return{next:function(){if(l>=i)return{done:!0,value:null};for(var e="\xd7";l=48&&e<=57},tJ=function(e){return tW(e)||e>=65&&e<=70||e>=97&&e<=102},tX=function(e){return e>=97&&e<=122||e>=65&&e<=90},t_=function(e){return 10===e||9===e||32===e},tY=function(e){return tX(e)||e>=128||95===e},t$=function(e){return tY(e)||tW(e)||45===e},tZ=function(e,A){return 92===e&&10!==A},t0=function(e,A,t){return 45===e?tY(A)||tZ(A,t):!!(tY(e)||92===e&&tZ(e,A))||!1},t1=function(e,A,t){return 43===e||45===e?!!tW(A)||46===A&&tW(t):46===e?tW(A):tW(e)},t2=function(e){var A=0,t=1;(43===e[0]||45===e[A])&&(45===e[A]&&(t=-1),A++);for(var r=[];tW(e[A]);)r.push(e[A++]);var n=r.length?parseInt(tg.apply(void 0,r),10):0;46===e[A]&&A++;for(var a=[];tW(e[A]);)a.push(e[A++]);var s=a.length,i=s?parseInt(tg.apply(void 0,a),10):0;(69===e[A]||101===e[A])&&A++;var o=1;(43===e[A]||45===e[A])&&(45===e[A]&&(o=-1),A++);for(var l=[];tW(e[A]);)l.push(e[A++]);return t*(n+i*Math.pow(10,-s))*Math.pow(10,o*(l.length?parseInt(tg.apply(void 0,l),10):0))},t4={type:2},t3={type:3},t5={type:4},t6={type:13},t8={type:8},t9={type:21},t7={type:9},re={type:10},rA={type:11},rt={type:12},rr={type:14},rn={type:23},ra={type:1},rs={type:25},ri={type:24},ro={type:26},rl={type:27},rc={type:28},ru={type:29},rd={type:31},rp={type:32},rh=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(th(e))},e.prototype.read=function(){for(var e=[],A=this.consumeToken();A!==rp;)e.push(A),A=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var A=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(t$(A)||tZ(t,r)){var n=t0(A,t,r)?2:1,a=this.consumeName();return{type:5,value:a,flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t6;break;case 39:return this.consumeStringToken(39);case 40:return t4;case 41:return t3;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),rr;break;case 43:case 46:if(t1(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return t5;case 45:var s=this.peekCodePoint(0),i=this.peekCodePoint(1);if(t1(e,s,i))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(t0(e,s,i))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===s&&62===i)return this.consumeCodePoint(),this.consumeCodePoint(),ri;break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(42===o&&47===(o=this.consumeCodePoint())||-1===o)return this.consumeToken()}break;case 58:return ro;case 59:return rl;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),rs;break;case 64:if(t0(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2))){var a=this.consumeName();return{type:7,value:a}}break;case 91:return rc;case 92:if(tZ(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return ru;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t8;break;case 123:return rA;case 125:return rt;case 117:case 85:var l=this.peekCodePoint(0),c=this.peekCodePoint(1);return 43===l&&(tJ(c)||63===c)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t7;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),t9;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),re;break;case -1:return rp}return t_(e)?(this.consumeWhiteSpace(),rd):tW(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):tY(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:tg(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],A=this.consumeCodePoint();tJ(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var t=!1;63===A&&e.length<6;)e.push(A),A=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(tg.apply(void 0,e.map(function(e){return 63===e?48:e})),16),n=parseInt(tg.apply(void 0,e.map(function(e){return 63===e?70:e})),16);return{type:30,start:r,end:n}}var a=parseInt(tg.apply(void 0,e),16);if(!(45===this.peekCodePoint(0)&&tJ(this.peekCodePoint(1))))return{type:30,start:a,end:a};this.consumeCodePoint(),A=this.consumeCodePoint();for(var s=[];tJ(A)&&s.length<6;)s.push(A),A=this.consumeCodePoint();var n=parseInt(tg.apply(void 0,s),16);return{type:30,start:a,end:n}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:22,value:""};var A=this.peekCodePoint(0);if(39===A||34===A){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),rn)}for(;;){var r,n=this.consumeCodePoint();if(-1===n||41===n)return{type:22,value:tg.apply(void 0,e)};if(t_(n)){if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))return this.consumeCodePoint(),{type:22,value:tg.apply(void 0,e)};return this.consumeBadUrlRemnants(),rn}if(34===n||39===n||40===n||(r=n)>=0&&r<=8||11===r||r>=14&&r<=31||127===r)return this.consumeBadUrlRemnants(),rn;if(92===n)if(!tZ(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),rn;else e.push(this.consumeEscapedCodePoint());else e.push(n)}},e.prototype.consumeWhiteSpace=function(){for(;t_(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;tZ(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var A="";e>0;){var t=Math.min(5e4,e);A+=tg.apply(void 0,this._value.splice(0,t)),e-=t}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var A="",t=0;;){var r=this._value[t];if(-1===r||void 0===r||r===e)return{type:0,value:A+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),ra;if(92===r){var n=this._value[t+1];-1!==n&&void 0!==n&&(10===n?(A+=this.consumeStringSlice(t),t=-1,this._value.shift()):tZ(r,n)&&(A+=this.consumeStringSlice(t),A+=tg(this.consumeEscapedCodePoint()),t=-1))}t++}},e.prototype.consumeNumber=function(){var e=[],A=4,t=this.peekCodePoint(0);for((43===t||45===t)&&e.push(this.consumeCodePoint());tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&tW(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&tW(n)||tW(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[t2(e),A]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],t=e[1],r=this.peekCodePoint(0);return t0(r,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:A,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:A,flags:t}):{type:17,number:A,flags:t}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(tJ(e)){for(var A=tg(e);tJ(this.peekCodePoint(0))&&A.length<6;)A+=tg(this.consumeCodePoint());t_(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(A,16);return 0===t||t>=55296&&t<=57343||t>1114111?65533:t}return -1===e?65533:e},e.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(t$(A))e+=tg(A);else{if(!tZ(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),e;e+=tg(this.consumeEscapedCodePoint())}}},e}(),rg=function(){function e(e){this._tokens=e}return e.create=function(A){var t=new rh;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var A=this.consumeComponentValue();do e=this.consumeToken();while(31===e.type);if(32===e.type)return A;throw SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(32===A.type)return e;e.push(A),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var A={type:e,values:[]},t=this.consumeToken();;){if(32===t.type||rC(t,e))return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue()),t=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?rp:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),rf=function(e){return 15===e.type},rm=function(e){return 17===e.type},rB=function(e){return 20===e.type},rw=function(e){return 0===e.type},rv=function(e,A){return rB(e)&&e.value===A},rx=function(e){return 31!==e.type},ry=function(e){return 31!==e.type&&4!==e.type},rb=function(e){var A=[],t=[];return e.forEach(function(e){if(4===e.type){if(0===t.length)throw Error("Error parsing function args, zero tokens for arg");A.push(t),t=[];return}31!==e.type&&t.push(e)}),t.length&&A.push(t),A},rC=function(e,A){return 11===A&&12===e.type||28===A&&29===e.type||2===A&&3===e.type},rQ=function(e){return 17===e.type||15===e.type},rF=function(e){return 16===e.type||rQ(e)},rU=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},rE={type:17,number:0,flags:4},rk={type:16,number:50,flags:4},rj={type:16,number:100,flags:4},rI=function(e,A,t){var r=e[0],n=e[1];return[rH(r,A),rH(void 0!==n?n:r,t)]},rH=function(e,A){if(16===e.type)return e.number/100*A;if(rf(e))switch(e.unit){case"rem":case"em":return 16*e.number}return e.number},rS="grad",rN="turn",rL={parse:function(e,A){if(15===A.type)switch(A.unit){case"deg":return Math.PI*A.number/180;case rS:return Math.PI/200*A.number;case"rad":return A.number;case rN:return 2*Math.PI*A.number}throw Error("Unsupported angle type")}},rD=function(e){return 15===e.type&&("deg"===e.unit||e.unit===rS||"rad"===e.unit||e.unit===rN)},rT=function(e){switch(e.filter(rB).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[rE,rE];case"to top":case"bottom":return rM(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[rE,rj];case"to right":case"left":return rM(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[rj,rj];case"to bottom":case"top":return rM(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[rj,rE];case"to left":case"right":return rM(270)}return 0},rM=function(e){return Math.PI*e/180},rK={parse:function(e,A){if(18===A.type){var t=rW[A.name];if(void 0===t)throw Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(5===A.type){if(3===A.value.length){var r=A.value.substring(0,1),n=A.value.substring(1,2),a=A.value.substring(2,3);return rO(parseInt(r+r,16),parseInt(n+n,16),parseInt(a+a,16),1)}if(4===A.value.length){var r=A.value.substring(0,1),n=A.value.substring(1,2),a=A.value.substring(2,3),s=A.value.substring(3,4);return rO(parseInt(r+r,16),parseInt(n+n,16),parseInt(a+a,16),parseInt(s+s,16)/255)}if(6===A.value.length){var r=A.value.substring(0,2),n=A.value.substring(2,4),a=A.value.substring(4,6);return rO(parseInt(r,16),parseInt(n,16),parseInt(a,16),1)}if(8===A.value.length){var r=A.value.substring(0,2),n=A.value.substring(2,4),a=A.value.substring(4,6),s=A.value.substring(6,8);return rO(parseInt(r,16),parseInt(n,16),parseInt(a,16),parseInt(s,16)/255)}}if(20===A.type){var i=rX[A.value.toUpperCase()];if(void 0!==i)return i}return rX.TRANSPARENT}},rP=function(e){return(255&e)==0},rR=function(e){var A=255&e,t=255&e>>8,r=255&e>>16,n=255&e>>24;return A<255?"rgba("+n+","+r+","+t+","+A/255+")":"rgb("+n+","+r+","+t+")"},rO=function(e,A,t,r){return(e<<24|A<<16|t<<8|(0|Math.round(255*r)))>>>0},rV=function(e,A){if(17===e.type)return e.number;if(16===e.type){var t=3===A?1:255;return 3===A?e.number/100*t:Math.round(e.number/100*t)}return 0},rG=function(e,A){var t=A.filter(ry);if(3===t.length){var r=t.map(rV),n=r[0],a=r[1],s=r[2];return rO(n,a,s,1)}if(4===t.length){var i=t.map(rV),n=i[0],a=i[1],s=i[2];return rO(n,a,s,i[3])}return 0};function rz(e,A,t){return(t<0&&(t+=1),t>=1&&(t-=1),t<1/6)?(A-e)*t*6+e:t<.5?A:t<2/3?(A-e)*6*(2/3-t)+e:e}var rq=function(e,A){var t=A.filter(ry),r=t[0],n=t[1],a=t[2],s=t[3],i=(17===r.type?rM(r.number):rL.parse(e,r))/(2*Math.PI),o=rF(n)?n.number/100:0,l=rF(a)?a.number/100:0,c=void 0!==s&&rF(s)?rH(s,1):1;if(0===o)return rO(255*l,255*l,255*l,1);var u=l<=.5?l*(o+1):l+o-l*o,d=2*l-u;return rO(255*rz(d,u,i+1/3),255*rz(d,u,i),255*rz(d,u,i-1/3),c)},rW={hsl:rq,hsla:rq,rgb:rG,rgba:rG},rJ=function(e,A){return rK.parse(e,rg.create(A).parseComponentValue())},rX={ALICEBLUE:0xf0f8ffff,ANTIQUEWHITE:0xfaebd7ff,AQUA:0xffffff,AQUAMARINE:0x7fffd4ff,AZURE:0xf0ffffff,BEIGE:0xf5f5dcff,BISQUE:0xffe4c4ff,BLACK:255,BLANCHEDALMOND:0xffebcdff,BLUE:65535,BLUEVIOLET:0x8a2be2ff,BROWN:0xa52a2aff,BURLYWOOD:0xdeb887ff,CADETBLUE:0x5f9ea0ff,CHARTREUSE:0x7fff00ff,CHOCOLATE:0xd2691eff,CORAL:0xff7f50ff,CORNFLOWERBLUE:0x6495edff,CORNSILK:0xfff8dcff,CRIMSON:0xdc143cff,CYAN:0xffffff,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:0xb886bbff,DARKGRAY:0xa9a9a9ff,DARKGREEN:6553855,DARKGREY:0xa9a9a9ff,DARKKHAKI:0xbdb76bff,DARKMAGENTA:0x8b008bff,DARKOLIVEGREEN:0x556b2fff,DARKORANGE:0xff8c00ff,DARKORCHID:0x9932ccff,DARKRED:0x8b0000ff,DARKSALMON:0xe9967aff,DARKSEAGREEN:0x8fbc8fff,DARKSLATEBLUE:0x483d8bff,DARKSLATEGRAY:0x2f4f4fff,DARKSLATEGREY:0x2f4f4fff,DARKTURQUOISE:0xced1ff,DARKVIOLET:0x9400d3ff,DEEPPINK:0xff1493ff,DEEPSKYBLUE:0xbfffff,DIMGRAY:0x696969ff,DIMGREY:0x696969ff,DODGERBLUE:0x1e90ffff,FIREBRICK:0xb22222ff,FLORALWHITE:0xfffaf0ff,FORESTGREEN:0x228b22ff,FUCHSIA:0xff00ffff,GAINSBORO:0xdcdcdcff,GHOSTWHITE:0xf8f8ffff,GOLD:0xffd700ff,GOLDENROD:0xdaa520ff,GRAY:0x808080ff,GREEN:8388863,GREENYELLOW:0xadff2fff,GREY:0x808080ff,HONEYDEW:0xf0fff0ff,HOTPINK:0xff69b4ff,INDIANRED:0xcd5c5cff,INDIGO:0x4b0082ff,IVORY:0xfffff0ff,KHAKI:0xf0e68cff,LAVENDER:0xe6e6faff,LAVENDERBLUSH:0xfff0f5ff,LAWNGREEN:0x7cfc00ff,LEMONCHIFFON:0xfffacdff,LIGHTBLUE:0xadd8e6ff,LIGHTCORAL:0xf08080ff,LIGHTCYAN:0xe0ffffff,LIGHTGOLDENRODYELLOW:0xfafad2ff,LIGHTGRAY:0xd3d3d3ff,LIGHTGREEN:0x90ee90ff,LIGHTGREY:0xd3d3d3ff,LIGHTPINK:0xffb6c1ff,LIGHTSALMON:0xffa07aff,LIGHTSEAGREEN:0x20b2aaff,LIGHTSKYBLUE:0x87cefaff,LIGHTSLATEGRAY:0x778899ff,LIGHTSLATEGREY:0x778899ff,LIGHTSTEELBLUE:0xb0c4deff,LIGHTYELLOW:0xffffe0ff,LIME:0xff00ff,LIMEGREEN:0x32cd32ff,LINEN:0xfaf0e6ff,MAGENTA:0xff00ffff,MAROON:0x800000ff,MEDIUMAQUAMARINE:0x66cdaaff,MEDIUMBLUE:52735,MEDIUMORCHID:0xba55d3ff,MEDIUMPURPLE:0x9370dbff,MEDIUMSEAGREEN:0x3cb371ff,MEDIUMSLATEBLUE:0x7b68eeff,MEDIUMSPRINGGREEN:0xfa9aff,MEDIUMTURQUOISE:0x48d1ccff,MEDIUMVIOLETRED:0xc71585ff,MIDNIGHTBLUE:0x191970ff,MINTCREAM:0xf5fffaff,MISTYROSE:0xffe4e1ff,MOCCASIN:0xffe4b5ff,NAVAJOWHITE:0xffdeadff,NAVY:33023,OLDLACE:0xfdf5e6ff,OLIVE:0x808000ff,OLIVEDRAB:0x6b8e23ff,ORANGE:0xffa500ff,ORANGERED:0xff4500ff,ORCHID:0xda70d6ff,PALEGOLDENROD:0xeee8aaff,PALEGREEN:0x98fb98ff,PALETURQUOISE:0xafeeeeff,PALEVIOLETRED:0xdb7093ff,PAPAYAWHIP:0xffefd5ff,PEACHPUFF:0xffdab9ff,PERU:0xcd853fff,PINK:0xffc0cbff,PLUM:0xdda0ddff,POWDERBLUE:0xb0e0e6ff,PURPLE:0x800080ff,REBECCAPURPLE:0x663399ff,RED:0xff0000ff,ROSYBROWN:0xbc8f8fff,ROYALBLUE:0x4169e1ff,SADDLEBROWN:0x8b4513ff,SALMON:0xfa8072ff,SANDYBROWN:0xf4a460ff,SEAGREEN:0x2e8b57ff,SEASHELL:0xfff5eeff,SIENNA:0xa0522dff,SILVER:0xc0c0c0ff,SKYBLUE:0x87ceebff,SLATEBLUE:0x6a5acdff,SLATEGRAY:0x708090ff,SLATEGREY:0x708090ff,SNOW:0xfffafaff,SPRINGGREEN:0xff7fff,STEELBLUE:0x4682b4ff,TAN:0xd2b48cff,TEAL:8421631,THISTLE:0xd8bfd8ff,TOMATO:0xff6347ff,TRANSPARENT:0,TURQUOISE:0x40e0d0ff,VIOLET:0xee82eeff,WHEAT:0xf5deb3ff,WHITE:0xffffffff,WHITESMOKE:0xf5f5f5ff,YELLOW:0xffff00ff,YELLOWGREEN:0x9acd32ff},r_={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(rB(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},rY={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},r$=function(e,A){var t=rK.parse(e,A[0]),r=A[1];return r&&rF(r)?{color:t,stop:r}:{color:t,stop:null}},rZ=function(e,A){var t=e[0],r=e[e.length-1];null===t.stop&&(t.stop=rE),null===r.stop&&(r.stop=rj);for(var n=[],a=0,s=0;sa?n.push(o):n.push(a),a=o}else n.push(null)}for(var l=null,s=0;se.optimumDistance)?{optimumCorner:A,optimumDistance:a}:e},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},r3=function(e,A,t,r,n){var a=0,s=0;switch(e.size){case 0:0===e.shape?a=s=Math.min(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-n)):1===e.shape&&(a=Math.min(Math.abs(A),Math.abs(A-r)),s=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(0===e.shape)a=s=Math.min(r2(A,t),r2(A,t-n),r2(A-r,t),r2(A-r,t-n));else if(1===e.shape){var i=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(A),Math.abs(A-r)),o=r4(r,n,A,t,!0),l=o[0],c=o[1];a=r2(l-A,(c-t)/i),s=i*a}break;case 1:0===e.shape?a=s=Math.max(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-n)):1===e.shape&&(a=Math.max(Math.abs(A),Math.abs(A-r)),s=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(0===e.shape)a=s=Math.max(r2(A,t),r2(A,t-n),r2(A-r,t),r2(A-r,t-n));else if(1===e.shape){var i=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(A),Math.abs(A-r)),u=r4(r,n,A,t,!1),l=u[0],c=u[1];a=r2(l-A,(c-t)/i),s=i*a}}return Array.isArray(e.size)&&(a=rH(e.size[0],r),s=2===e.size.length?rH(e.size[1],n):a),[a,s]},r5=function(e,A){var t=rM(180),r=[];return rb(A).forEach(function(A,n){if(0===n){var a=A[0];if(20===a.type&&-1!==["top","left","right","bottom"].indexOf(a.value)){t=rT(A);return}if(rD(a)){t=(rL.parse(e,a)+rM(270))%rM(360);return}}var s=r$(e,A);r.push(s)}),{angle:t,stops:r,type:1}},r6="closest-side",r8="farthest-side",r9="closest-corner",r7="farthest-corner",ne="circle",nA="ellipse",nt="cover",nr="contain",nn=function(e,A){var t=0,r=3,n=[],a=[];return rb(A).forEach(function(A,s){var i=!0;if(0===s?i=A.reduce(function(e,A){if(rB(A))switch(A.value){case"center":return a.push(rk),!1;case"top":case"left":return a.push(rE),!1;case"right":case"bottom":return a.push(rj),!1}else if(rF(A)||rQ(A))return a.push(A),!1;return e},i):1===s&&(i=A.reduce(function(e,A){if(rB(A))switch(A.value){case ne:return t=0,!1;case nA:return t=1,!1;case nr:case r6:return r=0,!1;case r8:return r=1,!1;case r9:return r=2,!1;case nt:case r7:return r=3,!1}else if(rQ(A)||rF(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return e},i)),i){var o=r$(e,A);n.push(o)}}),{size:r,shape:t,stops:n,position:a,type:2}},na={parse:function(e,A){if(22===A.type){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(18===A.type){var r=ns[A.name];if(void 0===r)throw Error('Attempting to parse an unsupported image function "'+A.name+'"');return r(e,A.values)}throw Error("Unsupported image type "+A.type)}},ns={"linear-gradient":function(e,A){var t=rM(180),r=[];return rb(A).forEach(function(A,n){if(0===n){var a=A[0];if(20===a.type&&"to"===a.value){t=rT(A);return}if(rD(a)){t=rL.parse(e,a);return}}var s=r$(e,A);r.push(s)}),{angle:t,stops:r,type:1}},"-moz-linear-gradient":r5,"-ms-linear-gradient":r5,"-o-linear-gradient":r5,"-webkit-linear-gradient":r5,"radial-gradient":function(e,A){var t=0,r=3,n=[],a=[];return rb(A).forEach(function(A,s){var i=!0;if(0===s){var o=!1;i=A.reduce(function(e,A){if(o)if(rB(A))switch(A.value){case"center":a.push(rk);break;case"top":case"left":a.push(rE);break;case"right":case"bottom":a.push(rj)}else(rF(A)||rQ(A))&&a.push(A);else if(rB(A))switch(A.value){case ne:return t=0,!1;case nA:return t=1,!1;case"at":return o=!0,!1;case r6:return r=0,!1;case nt:case r8:return r=1,!1;case nr:case r9:return r=2,!1;case r7:return r=3,!1}else if(rQ(A)||rF(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return e},i)}if(i){var l=r$(e,A);n.push(l)}}),{size:r,shape:t,stops:n,position:a,type:2}},"-moz-radial-gradient":nn,"-ms-radial-gradient":nn,"-o-radial-gradient":nn,"-webkit-radial-gradient":nn,"-webkit-gradient":function(e,A){var t=rM(180),r=[],n=1;return rb(A).forEach(function(A,t){var a=A[0];if(0===t){if(rB(a)&&"linear"===a.value){n=1;return}else if(rB(a)&&"radial"===a.value){n=2;return}}if(18===a.type){if("from"===a.name){var s=rK.parse(e,a.values[0]);r.push({stop:rE,color:s})}else if("to"===a.name){var s=rK.parse(e,a.values[0]);r.push({stop:rj,color:s})}else if("color-stop"===a.name){var i=a.values.filter(ry);if(2===i.length){var s=rK.parse(e,i[1]),o=i[0];rm(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:s})}}}}),1===n?{angle:(t+rM(180))%rM(360),stops:r,type:n}:{size:3,shape:0,stops:r,position:[],type:n}}},ni={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A.filter(function(e){var A;return ry(e)&&(20!==(A=e).type||"none"!==A.value)&&(18!==A.type||!!ns[A.name])}).map(function(A){return na.parse(e,A)})}},no={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(rB(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},nl={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return rb(A).map(function(e){return e.filter(rF)}).map(rU)}},nc={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return rb(A).map(function(e){return e.filter(rB).map(function(e){return e.value}).join(" ")}).map(nu)}},nu=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(a||(a={}));var nd={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return rb(A).map(function(e){return e.filter(np)})}},np=function(e){return rB(e)||rF(e)},nh=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ng=nh("top"),nf=nh("right"),nm=nh("bottom"),nB=nh("left"),nw=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return rU(A.filter(rF))}}},nv=nw("top-left"),nx=nw("top-right"),ny=nw("bottom-right"),nb=nw("bottom-left"),nC=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},nQ=nC("top"),nF=nC("right"),nU=nC("bottom"),nE=nC("left"),nk=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,A){return rf(A)?A.number:0}}},nj=nk("top"),nI=nk("right"),nH=nk("bottom"),nS=nk("left"),nN={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nL={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){return+("rtl"===A)}},nD={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(rB).reduce(function(e,A){return e|nT(A.value)},0)}},nT=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 0x1000000;case"inline-block":return 0x2000000;case"inline-list-item":return 0x4000000;case"inline-table":return 0x8000000;case"inline-flex":return 0x10000000;case"inline-grid":return 0x20000000}return 0},nM={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},nK={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return 20===A.type&&"normal"===A.value?0:17===A.type||15===A.type?A.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(s||(s={}));var nP={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"strict"===A?s.STRICT:s.NORMAL}},nR={name:"line-height",initialValue:"normal",prefix:!1,type:4},nO=function(e,A){return rB(e)&&"normal"===e.value?1.2*A:17===e.type?A*e.number:rF(e)?rH(e,A):A},nV={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return 20===A.type&&"none"===A.value?null:na.parse(e,A)}},nG={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){return+("inside"!==A)}},nz={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return -1}}},nq=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},nW=nq("top"),nJ=nq("right"),nX=nq("bottom"),n_=nq("left"),nY={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.filter(rB).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},n$={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"break-word"===A?"break-word":"normal"}},nZ=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},n0=nZ("top"),n1=nZ("right"),n2=nZ("bottom"),n4=nZ("left"),n3={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},n5={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},n6={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&rv(A[0],"none")?[]:rb(A).map(function(A){for(var t={color:rX.TRANSPARENT,offsetX:rE,offsetY:rE,blur:rE},r=0,n=0;n1)],this.overflowWrap=ak(e,n$,A.overflowWrap),this.paddingTop=ak(e,n0,A.paddingTop),this.paddingRight=ak(e,n1,A.paddingRight),this.paddingBottom=ak(e,n2,A.paddingBottom),this.paddingLeft=ak(e,n4,A.paddingLeft),this.paintOrder=ak(e,ab,A.paintOrder),this.position=ak(e,n5,A.position),this.textAlign=ak(e,n3,A.textAlign),this.textDecorationColor=ak(e,ao,null!=(t=A.textDecorationColor)?t:A.color),this.textDecorationLine=ak(e,al,null!=(r=A.textDecorationLine)?r:A.textDecoration),this.textShadow=ak(e,n6,A.textShadow),this.textTransform=ak(e,n8,A.textTransform),this.transform=ak(e,n9,A.transform),this.transformOrigin=ak(e,at,A.transformOrigin),this.visibility=ak(e,ar,A.visibility),this.webkitTextStrokeColor=ak(e,aC,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=ak(e,aQ,A.webkitTextStrokeWidth),this.wordBreak=ak(e,an,A.wordBreak),this.zIndex=ak(e,aa,A.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return rP(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ag(this.display,4)||ag(this.display,0x2000000)||ag(this.display,0x10000000)||ag(this.display,0x20000000)||ag(this.display,0x4000000)||ag(this.display,0x8000000)},e}(),aU=function(e,A){this.content=ak(e,af,A.content),this.quotes=ak(e,av,A.quotes)},aE=function(e,A){this.counterIncrement=ak(e,am,A.counterIncrement),this.counterReset=ak(e,aB,A.counterReset)},ak=function(e,A,t){var r=new rh,n=null!=t?t.toString():A.initialValue;r.write(n);var a=new rg(r.read());switch(A.type){case 2:var s=a.parseComponentValue();return A.parse(e,rB(s)?s.value:A.initialValue);case 0:return A.parse(e,a.parseComponentValue());case 1:return A.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(A.format){case"angle":return rL.parse(e,a.parseComponentValue());case"color":return rK.parse(e,a.parseComponentValue());case"image":return na.parse(e,a.parseComponentValue());case"length":var i=a.parseComponentValue();return rQ(i)?i:rE;case"length-percentage":var o=a.parseComponentValue();return rF(o)?o:rE;case"time":return as.parse(e,a.parseComponentValue())}}},aj=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},aI=function(e,A){var t=aj(e);return 1===t||A===t},aH=function(e,A){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,aI(A,3),this.styles=new aF(e,window.getComputedStyle(A,null)),sK(A)&&(this.styles.animationDuration.some(function(e){return e>0})&&(A.style.animationDuration="0s"),null!==this.styles.transform&&(A.style.transform="none")),this.bounds=td(this.context,A),aI(A,4)&&(this.flags|=16)},aS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aN="undefined"==typeof Uint8Array?[]:new Uint8Array(256),aL=0;aL>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&a;return l},aT=function(e){for(var A=e.length,t=[],r=0;r=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e>11),A=this.index[A]+(e>>5&63),A=((A=this.index[A])<<2)+(31&e),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),aO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aV="undefined"==typeof Uint8Array?[]:new Uint8Array(256),aG=0;aG=55296&&n<=56319&&t>10)+55296,s%1024+56320)),(n+1===t||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},aW=function(e,A){var t,r,n=aD(e),a=Array.isArray(n)?aM(n):new Uint32Array(n),s=Array.isArray(n)?aT(n):new Uint16Array(n),i=aP(s,12,a[4]/2),o=2===a[5]?aP(s,(24+a[4])/2):(t=Math.ceil((24+a[4])/4),a.slice?a.slice(t,void 0):new Uint32Array(Array.prototype.slice.call(a,t,r)));return new aR(a[0],a[1],a[2],a[3],i,o)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),aJ=function(e){return aW.get(e)},aX=function(e,A,t){var r=t-2,n=A[r],a=A[t-1],s=A[t];if(2===a&&3===s)return"\xd7";if(2===a||3===a||4===a||2===s||3===s||4===s)return"\xf7";if(8===a&&-1!==[8,9,11,12].indexOf(s)||(11===a||9===a)&&(9===s||10===s)||(12===a||10===a)&&10===s||13===s||5===s||7===s||1===a)return"\xd7";if(13===a&&14===s){for(;5===n;)n=A[--r];if(14===n)return"\xd7"}if(15===a&&15===s){for(var i=0;15===n;)i++,n=A[--r];if(i%2==0)return"\xd7"}return"\xf7"},a_=function(e){var A=az(e),t=A.length,r=0,n=0,a=A.map(aJ);return{next:function(){if(r>=t)return{done:!0,value:null};for(var e="\xd7";rs.x||n.y>s.y;return s=n,0===A||i});return e.body.removeChild(A),i},a0=function(e){var A=new Image,t=e.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;A.src="data:image/svg+xml,";try{r.drawImage(A,0,0),t.toDataURL()}catch(e){return!1}return!0},a1=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},a2=function(e){var A=e.createElement("canvas");A.width=100,A.height=100;var t=A.getContext("2d");if(!t)return Promise.reject(!1);t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var r=new Image,n=A.toDataURL();r.src=n;var a=a4(100,100,0,0,r);return t.fillStyle="red",t.fillRect(0,0,100,100),a3(a).then(function(A){t.drawImage(A,0,0);var r=t.getImageData(0,0,100,100).data;t.fillStyle="red",t.fillRect(0,0,100,100);var a=e.createElement("div");return a.style.backgroundImage="url("+n+")",a.style.height="100px",a1(r)?a3(a4(100,100,0,0,a)):Promise.reject(!1)}).then(function(e){return t.drawImage(e,0,0),a1(t.getImageData(0,0,100,100).data)}).catch(function(){return!1})},a4=function(e,A,t,r,n){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg"),i=document.createElementNS(a,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",A.toString()),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",r.toString()),i.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(i),i.appendChild(n),s},a3=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){return A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},a5={get SUPPORT_RANGE_BOUNDS(){var a6=a$(document);return Object.defineProperty(a5,"SUPPORT_RANGE_BOUNDS",{value:a6}),a6},get SUPPORT_WORD_BREAKING(){var a8=a5.SUPPORT_RANGE_BOUNDS&&aZ(document);return Object.defineProperty(a5,"SUPPORT_WORD_BREAKING",{value:a8}),a8},get SUPPORT_SVG_DRAWING(){var a9=a0(document);return Object.defineProperty(a5,"SUPPORT_SVG_DRAWING",{value:a9}),a9},get SUPPORT_FOREIGNOBJECT_DRAWING(){var a7="function"==typeof Array.from&&"function"==typeof window.fetch?a2(document):Promise.resolve(!1);return Object.defineProperty(a5,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:a7}),a7},get SUPPORT_CORS_IMAGES(){var se=void 0!==new Image().crossOrigin;return Object.defineProperty(a5,"SUPPORT_CORS_IMAGES",{value:se}),se},get SUPPORT_RESPONSE_TYPE(){var sA="string"==typeof new XMLHttpRequest().responseType;return Object.defineProperty(a5,"SUPPORT_RESPONSE_TYPE",{value:sA}),sA},get SUPPORT_CORS_XHR(){var st="withCredentials"in new XMLHttpRequest;return Object.defineProperty(a5,"SUPPORT_CORS_XHR",{value:st}),st},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var sr=!!("undefined"!=typeof Intl&&Intl.Segmenter);return Object.defineProperty(a5,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:sr}),sr}},sn=function(e,A){this.text=e,this.bounds=A},sa=function(e,A,t,r){var n=sl(A,t),a=[],s=0;return n.forEach(function(A){if(t.textDecorationLine.length||A.trim().length>0)if(a5.SUPPORT_RANGE_BOUNDS){var n=si(r,s,A.length).getClientRects();if(n.length>1){var i=so(A),o=0;i.forEach(function(A){a.push(new sn(A,tu.fromDOMRectList(e,si(r,o+s,A.length).getClientRects()))),o+=A.length})}else a.push(new sn(A,tu.fromDOMRectList(e,n)))}else{var l=r.splitText(A.length);a.push(new sn(A,ss(e,r))),r=l}else a5.SUPPORT_RANGE_BOUNDS||(r=r.splitText(A.length));s+=A.length}),a},ss=function(e,A){var t=A.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var n=A.parentNode;if(n){n.replaceChild(r,A);var a=td(e,r);return r.firstChild&&n.replaceChild(r.firstChild,r),a}}return tu.EMPTY},si=function(e,A,t){var r=e.ownerDocument;if(!r)throw Error("Node has no owner document");var n=r.createRange();return n.setStart(e,A),n.setEnd(e,A+t),n},so=function(e){return a5.SUPPORT_NATIVE_TEXT_SEGMENTATION?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)).map(function(e){return e.segment}):aY(e)},sl=function(e,A){return 0!==A.letterSpacing?so(e):a5.SUPPORT_NATIVE_TEXT_SEGMENTATION?Array.from(new Intl.Segmenter(void 0,{granularity:"word"}).segment(e)).map(function(e){return e.segment}):su(e,A)},sc=[32,160,4961,65792,65793,4153,4241],su=function(e,A){for(var t,r=tq(e,{lineBreak:A.lineBreak,wordBreak:"break-word"===A.overflowWrap?"break-word":A.wordBreak}),n=[];!(t=r.next()).done;)if(t.value){var a=th(t.value.slice()),s="";a.forEach(function(e){-1===sc.indexOf(e)?s+=tg(e):(s.length&&n.push(s),n.push(tg(e)),s="")}),s.length&&n.push(s)}return n},sd=function(e,A,t){this.text=sp(A.data,t.textTransform),this.textBounds=sa(e,this.text,t,A)},sp=function(e,A){switch(A){case 1:return e.toLowerCase();case 3:return e.replace(sh,sg);case 2:return e.toUpperCase();default:return e}},sh=/(^|\s|:|-|\(|\))([a-z])/g,sg=function(e,A,t){return e.length>0?A+t.toUpperCase():e},sf=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.src=t.currentSrc||t.src,r.intrinsicWidth=t.naturalWidth,r.intrinsicHeight=t.naturalHeight,r.context.cache.addImage(r.src),r}return ts(A,e),A}(aH),sm=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.canvas=t,r.intrinsicWidth=t.width,r.intrinsicHeight=t.height,r}return ts(A,e),A}(aH),sB=function(e){function A(A,t){var r=e.call(this,A,t)||this,n=new XMLSerializer,a=td(A,t);return t.setAttribute("width",a.width+"px"),t.setAttribute("height",a.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(t)),r.intrinsicWidth=t.width.baseVal.value,r.intrinsicHeight=t.height.baseVal.value,r.context.cache.addImage(r.svg),r}return ts(A,e),A}(aH),sw=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.value=t.value,r}return ts(A,e),A}(aH),sv=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.start=t.start,r.reversed="boolean"==typeof t.reversed&&!0===t.reversed,r}return ts(A,e),A}(aH),sx=[{type:15,flags:0,unit:"px",number:3}],sy=[{type:16,flags:0,number:50}],sb=function(e){var A=e.type===sF?Array(e.value.length+1).join("•"):e.value;return 0===A.length?e.placeholder||"":A},sC="checkbox",sQ="radio",sF="password",sU=function(e){function A(A,t){var r,n=e.call(this,A,t)||this;switch(n.type=t.type.toLowerCase(),n.checked=t.checked,n.value=sb(t),(n.type===sC||n.type===sQ)&&(n.styles.backgroundColor=0xdededeff,n.styles.borderTopColor=n.styles.borderRightColor=n.styles.borderBottomColor=n.styles.borderLeftColor=0xa5a5a5ff,n.styles.borderTopWidth=n.styles.borderRightWidth=n.styles.borderBottomWidth=n.styles.borderLeftWidth=1,n.styles.borderTopStyle=n.styles.borderRightStyle=n.styles.borderBottomStyle=n.styles.borderLeftStyle=1,n.styles.backgroundClip=[0],n.styles.backgroundOrigin=[0],n.bounds=(r=n.bounds).width>r.height?new tu(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width0)t.textNodes.push(new sd(e,n,t.styles));else if(sM(n))if(sZ(n)&&n.assignedNodes)n.assignedNodes().forEach(function(A){return sH(e,A,t,r)});else{var s=sS(e,n);s.styles.isVisible()&&(sL(n,s,r)?s.flags|=4:sD(s.styles)&&(s.flags|=2),-1!==sI.indexOf(n.tagName)&&(s.flags|=8),t.elements.push(s),n.slot,n.shadowRoot?sH(e,n.shadowRoot,s,r):sY(n)||sG(n)||s$(n)||sH(e,n,s,r))}},sS=function(e,A){return sJ(A)?new sf(e,A):sq(A)?new sm(e,A):sG(A)?new sB(e,A):sR(A)?new sw(e,A):sO(A)?new sv(e,A):sV(A)?new sU(e,A):s$(A)?new sE(e,A):sY(A)?new sk(e,A):sX(A)?new sj(e,A):new aH(e,A)},sN=function(e,A){var t=sS(e,A);return t.flags|=4,sH(e,A,t,t),t},sL=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||sz(e)&&t.styles.isTransparent()},sD=function(e){return e.isPositioned()||e.isFloating()},sT=function(e){return e.nodeType===Node.TEXT_NODE},sM=function(e){return e.nodeType===Node.ELEMENT_NODE},sK=function(e){return sM(e)&&void 0!==e.style&&!sP(e)},sP=function(e){return"object"==typeof e.className},sR=function(e){return"LI"===e.tagName},sO=function(e){return"OL"===e.tagName},sV=function(e){return"INPUT"===e.tagName},sG=function(e){return"svg"===e.tagName},sz=function(e){return"BODY"===e.tagName},sq=function(e){return"CANVAS"===e.tagName},sW=function(e){return"VIDEO"===e.tagName},sJ=function(e){return"IMG"===e.tagName},sX=function(e){return"IFRAME"===e.tagName},s_=function(e){return"STYLE"===e.tagName},sY=function(e){return"TEXTAREA"===e.tagName},s$=function(e){return"SELECT"===e.tagName},sZ=function(e){return"SLOT"===e.tagName},s0=function(e){return e.tagName.indexOf("-")>0},s1=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var A=this.counters[e];return A&&A.length?A[A.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var A=this;e.forEach(function(e){return A.counters[e].pop()})},e.prototype.parse=function(e){var A=this,t=e.counterIncrement,r=e.counterReset,n=!0;null!==t&&t.forEach(function(e){var t=A.counters[e.counter];t&&0!==e.increment&&(n=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=e.increment)});var a=[];return n&&r.forEach(function(e){var t=A.counters[e.counter];a.push(e.counter),t||(t=A.counters[e.counter]=[]),t.push(e.reset)}),a},e}(),s2={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},s4={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},s3={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},s5={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},s6=function(e,A,t,r,n,a){return et?is(e,n,a.length>0):r.integers.reduce(function(A,t,n){for(;e>=t;)e-=t,A+=r.values[n];return A},"")+a},s8=function(e,A,t,r){var n="";do!t&&e--,n=r(e)+n,e/=A;while(e*A>=A);return n},s9=function(e,A,t,r,n){var a=t-A+1;return(e<0?"-":"")+(s8(Math.abs(e),a,r,function(e){return tg(Math.floor(e%a)+A)})+n)},s7=function(e,A,t){void 0===t&&(t=". ");var r=A.length;return s8(Math.abs(e),r,!1,function(e){return A[Math.floor(e%r)]})+t},ie=function(e,A,t,r,n,a){if(e<-9999||e>9999)return is(e,4,n.length>0);var s=Math.abs(e),i=n;if(0===s)return A[0]+i;for(var o=0;s>0&&o<=4;o++){var l=s%10;0===l&&ag(a,1)&&""!==i?i=A[l]+i:l>1||1===l&&0===o||1===l&&1===o&&ag(a,2)||1===l&&1===o&&ag(a,4)&&e>100||1===l&&o>1&&ag(a,8)?i=A[l]+(o>0?t[o-1]:"")+i:1===l&&o>0&&(i=t[o-1]+i),s=Math.floor(s/10)}return(e<0?r:"")+i},iA="十百千萬",it="拾佰仟萬",ir="マイナス",ia="마이너스",is=function(e,A,t){var r=t?". ":"",n=t?"、":"",a=t?", ":"",s=t?" ":"";switch(A){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var i=s9(e,48,57,!0,r);return i.length<4?"0"+i:i;case 4:return s7(e,"〇一二三四五六七八九",n);case 6:return s6(e,1,3999,s2,3,r).toLowerCase();case 7:return s6(e,1,3999,s2,3,r);case 8:return s9(e,945,969,!1,r);case 9:return s9(e,97,122,!1,r);case 10:return s9(e,65,90,!1,r);case 11:return s9(e,1632,1641,!0,r);case 12:case 49:return s6(e,1,9999,s4,3,r);case 35:return s6(e,1,9999,s4,3,r).toLowerCase();case 13:return s9(e,2534,2543,!0,r);case 14:case 30:return s9(e,6112,6121,!0,r);case 15:return s7(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return s7(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return ie(e,"零一二三四五六七八九",iA,"負",n,14);case 47:return ie(e,"零壹貳參肆伍陸柒捌玖",it,"負",n,15);case 42:return ie(e,"零一二三四五六七八九",iA,"负",n,14);case 41:return ie(e,"零壹贰叁肆伍陆柒捌玖",it,"负",n,15);case 26:return ie(e,"〇一二三四五六七八九","十百千万",ir,n,0);case 25:return ie(e,"零壱弐参四伍六七八九","拾百千万",ir,n,7);case 31:return ie(e,"영일이삼사오육칠팔구","십백천만",ia,a,7);case 33:return ie(e,"零一二三四五六七八九","十百千萬",ia,a,0);case 32:return ie(e,"零壹貳參四五六七八九","拾百千",ia,a,7);case 18:return s9(e,2406,2415,!0,r);case 20:return s6(e,1,19999,s5,3,r);case 21:return s9(e,2790,2799,!0,r);case 22:return s9(e,2662,2671,!0,r);case 22:return s6(e,1,10999,s3,3,r);case 23:return s7(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return s7(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return s9(e,3302,3311,!0,r);case 28:return s7(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return s7(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return s9(e,3792,3801,!0,r);case 37:return s9(e,6160,6169,!0,r);case 38:return s9(e,4160,4169,!0,r);case 39:return s9(e,2918,2927,!0,r);case 40:return s9(e,1776,1785,!0,r);case 43:return s9(e,3046,3055,!0,r);case 44:return s9(e,3174,3183,!0,r);case 45:return s9(e,3664,3673,!0,r);case 46:return s9(e,3872,3881,!0,r);default:return s9(e,48,57,!0,r)}},ii="data-html2canvas-ignore",io=function(){function e(e,A,t){if(this.context=e,this.options=t,this.scrolledElements=[],this.referenceElement=A,this.counters=new s1,this.quoteDepth=0,!A.ownerDocument)throw Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,A){var t=this,r=il(e,A);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var n=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,s=r.contentWindow,i=s.document,o=id(r).then(function(){return to(t,void 0,void 0,function(){var e,t;return tl(this,function(n){switch(n.label){case 0:if(this.scrolledElements.forEach(iB),s&&(s.scrollTo(A.left,A.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(s.scrollY!==A.top||s.scrollX!==A.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-A.left,s.scrollY-A.top,0,0))),e=this.options.onclone,void 0===(t=this.clonedReferenceElement))return[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")];if(!(i.fonts&&i.fonts.ready))return[3,2];return[4,i.fonts.ready];case 1:n.sent(),n.label=2;case 2:if(!/(AppleWebKit)/g.test(navigator.userAgent))return[3,4];return[4,iu(i)];case 3:n.sent(),n.label=4;case 4:if("function"==typeof e)return[2,Promise.resolve().then(function(){return e(i,t)}).then(function(){return r})];return[2,r]}})})});return i.open(),i.write(ig(document.doctype)+""),im(this.referenceElement.ownerDocument,n,a),i.replaceChild(i.adoptNode(this.documentElement),i.documentElement),i.close(),o},e.prototype.createElementClone=function(e){if(aI(e,2),sq(e))return this.createCanvasClone(e);if(sW(e))return this.createVideoClone(e);if(s_(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return(sJ(A)&&(sJ(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),"lazy"===A.loading&&(A.loading="eager")),s0(A))?this.createCustomElementClone(A):A},e.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return ih(e.style,A),A},e.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var t=[].slice.call(A.cssRules,0).reduce(function(e,A){return A&&"string"==typeof A.cssText?e+A.cssText:e},""),r=e.cloneNode(!1);return r.textContent=t,r}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var A,t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(A){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var n=e.getContext("2d"),a=r.getContext("2d");if(a)if(!this.options.allowTaint&&n)a.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var s=null!=(A=e.getContext("webgl2"))?A:e.getContext("webgl");if(s){var i=s.getContextAttributes();(null==i?void 0:i.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext("2d");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,A,t){sM(A)&&("SCRIPT"===A.tagName||A.hasAttribute(ii)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(A))||this.options.copyStyles&&sM(A)&&s_(A)||e.appendChild(this.cloneNode(A,t))},e.prototype.cloneChildNodes=function(e,A,t){for(var r=this,n=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;n;n=n.nextSibling)if(sM(n)&&sZ(n)&&"function"==typeof n.assignedNodes){var a=n.assignedNodes();a.length&&a.forEach(function(e){return r.appendChildNode(A,e,t)})}else this.appendChildNode(A,n,t)},e.prototype.cloneNode=function(e,A){if(sT(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&sM(e)&&(sK(e)||sP(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var n=t.getComputedStyle(e),a=t.getComputedStyle(e,":before"),s=t.getComputedStyle(e,":after");this.referenceElement===e&&sK(r)&&(this.clonedReferenceElement=r),sz(r)&&iy(r);var i=this.counters.parse(new aE(this.context,n)),l=this.resolvePseudoContent(e,r,a,o.BEFORE);s0(e)&&(A=!0),sW(e)||this.cloneChildNodes(e,r,A),l&&r.insertBefore(l,r.firstChild);var c=this.resolvePseudoContent(e,r,s,o.AFTER);return c&&r.appendChild(c),this.counters.pop(i),(n&&(this.options.copyStyles||sP(e))&&!sX(e)||A)&&ih(n,r),(0!==e.scrollTop||0!==e.scrollLeft)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(sY(e)||s$(e))&&(sY(r)||s$(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,A,t,r){var n=this;if(t){var a=t.content,s=A.ownerDocument;if(s&&a&&"none"!==a&&"-moz-alt-content"!==a&&"none"!==t.display){this.counters.parse(new aE(this.context,t));var i=new aU(this.context,t),l=s.createElement("html2canvaspseudoelement");ih(t,l),i.content.forEach(function(A){if(0===A.type)l.appendChild(s.createTextNode(A.value));else if(22===A.type){var t=s.createElement("img");t.src=A.value,t.style.opacity="1",l.appendChild(t)}else if(18===A.type){if("attr"===A.name){var r=A.values.filter(rB);r.length&&l.appendChild(s.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===A.name){var a=A.values.filter(ry),o=a[0],c=a[1];if(o&&rB(o)){var u=n.counters.getCounterValue(o.value),d=c&&rB(c)?nz.parse(n.context,c.value):3;l.appendChild(s.createTextNode(is(u,d,!1)))}}else if("counters"===A.name){var p=A.values.filter(ry),o=p[0],h=p[1],c=p[2];if(o&&rB(o)){var g=n.counters.getCounterValues(o.value),f=c&&rB(c)?nz.parse(n.context,c.value):3,m=h&&0===h.type?h.value:"",B=g.map(function(e){return is(e,f,!1)}).join(m);l.appendChild(s.createTextNode(B))}}}else if(20===A.type)switch(A.value){case"open-quote":l.appendChild(s.createTextNode(ax(i.quotes,n.quoteDepth++,!0)));break;case"close-quote":l.appendChild(s.createTextNode(ax(i.quotes,--n.quoteDepth,!1)));break;default:l.appendChild(s.createTextNode(A.value))}}),l.className=iw+" "+iv;var c=r===o.BEFORE?" "+iw:" "+iv;return sP(A)?A.className.baseValue+=c:A.className+=c,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(o||(o={}));var il=function(e,A){var t=e.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute(ii,"true"),e.body.appendChild(t),t},ic=function(e){return new Promise(function(A){if(e.complete||!e.src)return void A();e.onload=A,e.onerror=A})},iu=function(e){return Promise.all([].slice.call(e.images,0).map(ic))},id=function(e){return new Promise(function(A,t){var r=e.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var t=setInterval(function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),A(e))},50)}})},ip=["all","d","content"],ih=function(e,A){for(var t=e.length-1;t>=0;t--){var r=e.item(t);-1===ip.indexOf(r)&&A.style.setProperty(r,e.getPropertyValue(r))}return A},ig=function(e){var A="";return e&&(A+=""),A},im=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},iB=function(e){var A=e[0],t=e[1],r=e[2];A.scrollLeft=t,A.scrollTop=r},iw="___html2canvas___pseudoelement_before",iv="___html2canvas___pseudoelement_after",ix='{\n content: "" !important;\n display: none !important;\n}',iy=function(e){ib(e,"."+iw+":before"+ix+"\n ."+iv+":after"+ix)},ib=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},iC=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),iQ=function(){function e(e,A){this.context=e,this._options=A,this._cache={}}return e.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(iH(e)||ik(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return to(this,void 0,void 0,function(){var A,t,r,n,a=this;return tl(this,function(s){switch(s.label){case 0:if(A=iC.isSameOrigin(e),t=!ij(e)&&!0===this._options.useCORS&&a5.SUPPORT_CORS_IMAGES&&!A,r=!ij(e)&&!A&&!iH(e)&&"string"==typeof this._options.proxy&&a5.SUPPORT_CORS_XHR&&!t,!A&&!1===this._options.allowTaint&&!ij(e)&&!iH(e)&&!r&&!t)return[2];if(n=e,!r)return[3,2];return[4,this.proxy(n)];case 1:n=s.sent(),s.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,A){var r=new Image;r.onload=function(){return e(r)},r.onerror=A,(iI(n)||t)&&(r.crossOrigin="anonymous"),r.src=n,!0===r.complete&&setTimeout(function(){return e(r)},500),a._options.imageTimeout>0&&setTimeout(function(){return A("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,s.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var A=this,t=this._options.proxy;if(!t)throw Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(n,a){var s=a5.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=function(){if(200===i.status)if("text"===s)n(i.response);else{var e=new FileReader;e.addEventListener("load",function(){return n(e.result)},!1),e.addEventListener("error",function(e){return a(e)},!1),e.readAsDataURL(i.response)}else a("Failed to proxy resource "+r+" with status code "+i.status)},i.onerror=a;var o=t.indexOf("?")>-1?"&":"?";if(i.open("GET",""+t+o+"url="+encodeURIComponent(e)+"&responseType="+s),"text"!==s&&i instanceof XMLHttpRequest&&(i.responseType=s),A._options.imageTimeout){var l=A._options.imageTimeout;i.timeout=l,i.ontimeout=function(){return a("Timed out ("+l+"ms) proxying "+r)}}i.send()})},e}(),iF=/^data:image\/svg\+xml/i,iU=/^data:image\/.*;base64,/i,iE=/^data:image\/.*/i,ik=function(e){return a5.SUPPORT_SVG_DRAWING||!iS(e)},ij=function(e){return iE.test(e)},iI=function(e){return iU.test(e)},iH=function(e){return"blob"===e.substr(0,4)},iS=function(e){return"svg"===e.substr(-3).toLowerCase()||iF.test(e)},iN=function(){function e(e,A){this.type=0,this.x=e,this.y=A}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),iL=function(e,A,t){return new iN(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},iD=function(){function e(e,A,t,r){this.type=1,this.start=e,this.startControl=A,this.endControl=t,this.end=r}return e.prototype.subdivide=function(A,t){var r=iL(this.start,this.startControl,A),n=iL(this.startControl,this.endControl,A),a=iL(this.endControl,this.end,A),s=iL(r,n,A),i=iL(n,a,A),o=iL(s,i,A);return t?new e(this.start,r,s,o):new e(o,i,a,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),iT=function(e){return 1===e.type},iM=function(e){var A=e.styles,t=e.bounds,r=rI(A.borderTopLeftRadius,t.width,t.height),n=r[0],a=r[1],s=rI(A.borderTopRightRadius,t.width,t.height),i=s[0],o=s[1],c=rI(A.borderBottomRightRadius,t.width,t.height),u=c[0],d=c[1],p=rI(A.borderBottomLeftRadius,t.width,t.height),h=p[0],g=p[1],f=[];f.push((n+i)/t.width),f.push((h+u)/t.width),f.push((a+g)/t.height),f.push((o+d)/t.height);var m=Math.max.apply(Math,f);m>1&&(n/=m,a/=m,i/=m,o/=m,u/=m,d/=m,h/=m,g/=m);var B=t.width-i,w=t.height-d,v=t.width-u,x=t.height-g,y=A.borderTopWidth,b=A.borderRightWidth,C=A.borderBottomWidth,Q=A.borderLeftWidth,F=rH(A.paddingTop,e.bounds.width),U=rH(A.paddingRight,e.bounds.width),E=rH(A.paddingBottom,e.bounds.width),k=rH(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||a>0?iK(t.left+Q/3,t.top+y/3,n-Q/3,a-y/3,l.TOP_LEFT):new iN(t.left+Q/3,t.top+y/3),this.topRightBorderDoubleOuterBox=n>0||a>0?iK(t.left+B,t.top+y/3,i-b/3,o-y/3,l.TOP_RIGHT):new iN(t.left+t.width-b/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?iK(t.left+v,t.top+w,u-b/3,d-C/3,l.BOTTOM_RIGHT):new iN(t.left+t.width-b/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=h>0||g>0?iK(t.left+Q/3,t.top+x,h-Q/3,g-C/3,l.BOTTOM_LEFT):new iN(t.left+Q/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=n>0||a>0?iK(t.left+2*Q/3,t.top+2*y/3,n-2*Q/3,a-2*y/3,l.TOP_LEFT):new iN(t.left+2*Q/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=n>0||a>0?iK(t.left+B,t.top+2*y/3,i-2*b/3,o-2*y/3,l.TOP_RIGHT):new iN(t.left+t.width-2*b/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?iK(t.left+v,t.top+w,u-2*b/3,d-2*C/3,l.BOTTOM_RIGHT):new iN(t.left+t.width-2*b/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=h>0||g>0?iK(t.left+2*Q/3,t.top+x,h-2*Q/3,g-2*C/3,l.BOTTOM_LEFT):new iN(t.left+2*Q/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=n>0||a>0?iK(t.left+Q/2,t.top+y/2,n-Q/2,a-y/2,l.TOP_LEFT):new iN(t.left+Q/2,t.top+y/2),this.topRightBorderStroke=n>0||a>0?iK(t.left+B,t.top+y/2,i-b/2,o-y/2,l.TOP_RIGHT):new iN(t.left+t.width-b/2,t.top+y/2),this.bottomRightBorderStroke=u>0||d>0?iK(t.left+v,t.top+w,u-b/2,d-C/2,l.BOTTOM_RIGHT):new iN(t.left+t.width-b/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=h>0||g>0?iK(t.left+Q/2,t.top+x,h-Q/2,g-C/2,l.BOTTOM_LEFT):new iN(t.left+Q/2,t.top+t.height-C/2),this.topLeftBorderBox=n>0||a>0?iK(t.left,t.top,n,a,l.TOP_LEFT):new iN(t.left,t.top),this.topRightBorderBox=i>0||o>0?iK(t.left+B,t.top,i,o,l.TOP_RIGHT):new iN(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||d>0?iK(t.left+v,t.top+w,u,d,l.BOTTOM_RIGHT):new iN(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=h>0||g>0?iK(t.left,t.top+x,h,g,l.BOTTOM_LEFT):new iN(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||a>0?iK(t.left+Q,t.top+y,Math.max(0,n-Q),Math.max(0,a-y),l.TOP_LEFT):new iN(t.left+Q,t.top+y),this.topRightPaddingBox=i>0||o>0?iK(t.left+Math.min(B,t.width-b),t.top+y,B>t.width+b?0:Math.max(0,i-b),Math.max(0,o-y),l.TOP_RIGHT):new iN(t.left+t.width-b,t.top+y),this.bottomRightPaddingBox=u>0||d>0?iK(t.left+Math.min(v,t.width-Q),t.top+Math.min(w,t.height-C),Math.max(0,u-b),Math.max(0,d-C),l.BOTTOM_RIGHT):new iN(t.left+t.width-b,t.top+t.height-C),this.bottomLeftPaddingBox=h>0||g>0?iK(t.left+Q,t.top+Math.min(x,t.height-C),Math.max(0,h-Q),Math.max(0,g-C),l.BOTTOM_LEFT):new iN(t.left+Q,t.top+t.height-C),this.topLeftContentBox=n>0||a>0?iK(t.left+Q+k,t.top+y+F,Math.max(0,n-(Q+k)),Math.max(0,a-(y+F)),l.TOP_LEFT):new iN(t.left+Q+k,t.top+y+F),this.topRightContentBox=i>0||o>0?iK(t.left+Math.min(B,t.width+Q+k),t.top+y+F,B>t.width+Q+k?0:i-Q+k,o-(y+F),l.TOP_RIGHT):new iN(t.left+t.width-(b+U),t.top+y+F),this.bottomRightContentBox=u>0||d>0?iK(t.left+Math.min(v,t.width-(Q+k)),t.top+Math.min(w,t.height+y+F),Math.max(0,u-(b+U)),d-(C+E),l.BOTTOM_RIGHT):new iN(t.left+t.width-(b+U),t.top+t.height-(C+E)),this.bottomLeftContentBox=h>0||g>0?iK(t.left+Q+k,t.top+x,Math.max(0,h-(Q+k)),g-(C+E),l.BOTTOM_LEFT):new iN(t.left+Q+k,t.top+t.height-(C+E))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(l||(l={}));var iK=function(e,A,t,r,n){var a=(Math.sqrt(2)-1)/3*4,s=t*a,i=r*a,o=e+t,c=A+r;switch(n){case l.TOP_LEFT:return new iD(new iN(e,c),new iN(e,c-i),new iN(o-s,A),new iN(o,A));case l.TOP_RIGHT:return new iD(new iN(e,A),new iN(e+s,A),new iN(o,c-i),new iN(o,c));case l.BOTTOM_RIGHT:return new iD(new iN(o,A),new iN(o,A+i),new iN(e+s,c),new iN(e,c));case l.BOTTOM_LEFT:default:return new iD(new iN(o,c),new iN(o-s,c),new iN(e,A+i),new iN(e,A))}},iP=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},iR=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},iO=function(e,A,t){this.offsetX=e,this.offsetY=A,this.matrix=t,this.type=0,this.target=6},iV=function(e,A){this.path=e,this.target=A,this.type=1},iG=function(e){this.opacity=e,this.type=2,this.target=6},iz=function(e){return 1===e.type},iq=function(e,A){return e.length===A.length&&e.some(function(e,t){return e===A[t]})},iW=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},iJ=function(){function e(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new iM(this.container),this.container.styles.opacity<1&&this.effects.push(new iG(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new iO(t,r,n))}if(0!==this.container.styles.overflowX){var a=iP(this.curves),s=iR(this.curves);iq(a,s)?this.effects.push(new iV(a,6)):(this.effects.push(new iV(a,2)),this.effects.push(new iV(s,4)))}}return e.prototype.getEffects=function(e){for(var A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var n=t.effects.filter(function(e){return!iz(e)});if(A||0!==t.container.styles.position||!t.parent){if(r.unshift.apply(r,n),A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var a=iP(t.curves),s=iR(t.curves);iq(a,s)||r.unshift(new iV(s,6))}}else r.unshift.apply(r,n);t=t.parent}return r.filter(function(A){return ag(A.target,e)})},e}(),iX=function(e,A,t,r){e.container.elements.forEach(function(n){var a=ag(n.flags,4),s=ag(n.flags,2),i=new iJ(n,e);ag(n.styles.display,2048)&&r.push(i);var o=ag(n.flags,8)?[]:r;if(a||s){var l=a||n.styles.isPositioned()?t:A,c=new iW(i);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var d=0;l.negativeZIndex.some(function(e,A){if(u>e.element.container.styles.zIndex.order)d=A;else if(d>0)return!0;return!1}),l.negativeZIndex.splice(d,0,c)}else if(u>0){var p=0;l.positiveZIndex.some(function(e,A){if(u>=e.element.container.styles.zIndex.order)p=A+1;else if(p>0)return!0;return!1}),l.positiveZIndex.splice(p,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);iX(i,c,a?c:t,o)}else n.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),iX(i,A,t,o);ag(n.flags,8)&&i_(n,o)})},i_=function(e,A){for(var t=e instanceof sv?e.start:1,r=e instanceof sv&&e.reversed,n=0;n0&&e.intrinsicHeight>0){var r=i5(e),n=iR(A);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return to(this,void 0,void 0,function(){var t,r,n,a,s,i,o,l,c,u,d,p,h,g,f,m,B,w;return tl(this,function(v){switch(v.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,n=t.styles,a=0,s=t.textNodes,v.label=1;case 1:if(!(a0&&u>0&&(d=r.ctx.createPattern(v,"repeat"),r.renderRepeat(i,d,o,l))):2===t.type&&(i=(b=i6(e,A,[null,null,null]))[0],C=b[1],Q=b[2],c=b[3],u=b[4],o=rH((F=0===t.position.length?[rk]:t.position)[0],c),l=rH(F[F.length-1],u),E=(U=r3(t,o,l,c,u))[0],k=U[1],E>0&&k>0&&(j=r.ctx.createRadialGradient(C+o,Q+l,0,C+o,Q+l,E),rZ(t.stops,2*E).forEach(function(e){return j.addColorStop(e.stop,rR(e.color))}),r.path(i),r.ctx.fillStyle=j,E!==k?(I=e.bounds.left+.5*e.bounds.width,H=e.bounds.top+.5*e.bounds.height,N=1/(S=k/E),r.ctx.save(),r.ctx.translate(I,H),r.ctx.transform(1,0,0,S,0,0),r.ctx.translate(-I,-H),r.ctx.fillRect(C,N*(Q-H)+H,c,u*N),r.ctx.restore()):r.ctx.fill())),L.label=6;case 6:return A--,[2]}})},r=this,n=0,a=e.styles.backgroundImage.slice(0).reverse(),i.label=1;case 1:if(!(n0))return[3,11];if(2!==o.style)return[3,5];return[4,this.renderDashedDottedBorder(o.color,o.width,a,e.curves,2)];case 4:case 6:case 8:return c.sent(),[3,11];case 5:if(3!==o.style)return[3,7];return[4,this.renderDashedDottedBorder(o.color,o.width,a,e.curves,3)];case 7:if(4!==o.style)return[3,9];return[4,this.renderDoubleBorder(o.color,o.width,a,e.curves)];case 9:return[4,this.renderSolidBorder(o.color,a,e.curves)];case 10:c.sent(),c.label=11;case 11:a++,c.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,A,t,r,n){return to(this,void 0,void 0,function(){var a,s,i,o,l,c,u,d,p,h,g,f,m,B,w,v;return tl(this,function(x){return this.ctx.save(),a=i1(r,t),s=i$(r,t),2===n&&(this.path(s),this.ctx.clip()),iT(s[0])?(i=s[0].start.x,o=s[0].start.y):(i=s[0].x,o=s[0].y),iT(s[1])?(l=s[1].end.x,c=s[1].end.y):(l=s[1].x,c=s[1].y),u=0===t||2===t?Math.abs(i-l):Math.abs(o-c),this.ctx.beginPath(),3===n?this.formatPath(a):this.formatPath(s.slice(0,2)),d=A<3?3*A:2*A,p=A<3?2*A:A,3===n&&(d=A,p=A),h=!0,u<=2*d?h=!1:u<=2*d+p?(g=u/(2*d+p),d*=g,p*=g):(f=Math.floor((u+p)/(d+p)),m=(u-f*d)/(f-1),p=(B=(u-(f+1)*d)/f)<=0||Math.abs(p-m)setTimeout(()=>A(Error("html2canvas timeout after 4 seconds")),4e3))]),d=document.createElement("canvas");d.width=r,d.height=n;let p=d.getContext("2d");if(!p)return y.v.error("Failed to get canvas context"),null;p.drawImage(u,0,0,r,n);let h=d.toDataURL("image/jpeg",a),g=Math.ceil(3*h.length/4)/1024;if(g>250){y.v.warn(`Screenshot too large: ${g.toFixed(0)}KB, trying with lower quality`);let e=d.toDataURL("image/jpeg",.6),A=Math.ceil(3*e.length/4)/1024;return A>250&&y.v.warn(`Screenshot still too large: ${A.toFixed(0)}KB`),e}return h}catch(e){return y.v.error("Failed to capture screenshot:",e),null}}let om={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%"}},oB=(0,p.forwardRef)(({projectId:e,refreshTrigger:A,onFocusSelection:t,hasFocusTarget:r=!1,onClose:n},a)=>{let[s,i]=(0,p.useState)(null),[o,l]=(0,p.useState)("/"),[c,u]=(0,p.useState)(!0),[h,g]=(0,p.useState)(null),[f,B]=(0,p.useState)("tablet"),[w,v]=(0,p.useState)(["/"]),[x,b]=(0,p.useState)(0),[C,F]=(0,p.useState)(!1),[U,E]=(0,p.useState)(!1),k=(0,p.useMemo)(()=>U?{backgroundColor:"var(--button-preview-active)",color:"white"}:r?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},[U,r]),j=(0,p.useRef)(null),I=(0,p.useRef)(null),H=(0,p.useRef)(null),S=(0,p.useRef)("/"),L=(0,p.useRef)(null),D=(0,p.useRef)(!1);(0,p.useImperativeHandle)(a,()=>({captureScreenshot:async()=>j.current&&C?await of(j.current):(y.v.warn("Cannot capture screenshot: iframe not ready"),null)}),[C]);let T=(0,p.useCallback)(e=>{if(j.current&&j.current.contentWindow)try{j.current.contentWindow.postMessage(e,"*")}catch(e){y.v.warn("Failed to communicate with preview iframe",e)}},[]),M=(0,p.useRef)(!1),K=(0,p.useRef)(null),R=(0,p.useRef)(null),O=(0,p.useRef)(null),V=()=>(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,d.jsx)(P.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),n?(0,d.jsxs)("button",{type:"button",onClick:n,"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,d.jsx)(P.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(P.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]});(0,p.useEffect)(()=>{H.current=s},[s]),(0,p.useEffect)(()=>{D.current=U,C&&T({type:"selector-toggle",active:U})},[U,C,T]),(0,p.useEffect)(()=>{let e=j.current;if(!e)return;let A=()=>{T({type:"selector-toggle",active:D.current})};return e.addEventListener("load",A),()=>{e.removeEventListener("load",A)}},[C,T]),(0,p.useEffect)(()=>{S.current=o},[o]),(0,p.useEffect)(()=>{if(C&&L.current&&H.current){let e=L.current;L.current=null,W(e,H.current)}},[C]),(0,p.useEffect)(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);let G=(0,p.useCallback)(async(A=!1,t=!0)=>{t&&u(!0),g(null);try{await m.vfs.init();let t=A?S.current:null;I.current&&I.current.cleanupBlobUrls();let r=new A5.B(m.vfs,e);I.current=r;let n=await r.compileProject();i(n),H.current=n;let a=t;a||(a=n.blobUrls.has("/index.html")?"/":n.entryPoint||(n.routes.length>0?n.routes[0].path:"/")),W(a,n)}catch(e){g(e instanceof Error?e.message:"Failed to compile project"),y.v.error("Compilation error:",e)}finally{t&&u(!1)}},[e]),z=(0,p.useCallback)((e=!1,A=!0)=>{if(M.current){let t=K.current;K.current={preserve:(t?.preserve??!1)||e,showLoading:(t?.showLoading??!1)||A};return}(async(e,A)=>{M.current=!0;try{await G(e,A)}finally{M.current=!1;let e=K.current;K.current=null,e&&z(e.preserve,e.showLoading)}})(e,A)},[G]),q=(0,p.useCallback)((e=!1,A=!1)=>{let t=O.current;O.current={preserve:(t?.preserve??!1)||e,showLoading:(t?.showLoading??!1)||A},R.current&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>{let e=O.current;O.current=null,R.current=null,e&&z(e.preserve,e.showLoading)},150)},[z]);(0,p.useEffect)(()=>{z()},[e,A,z]),(0,p.useEffect)(()=>{let A=()=>{q(!0)},t=A=>{A.detail&&A.detail.projectId!==e||q(!0)};return window.addEventListener("filesChanged",A),window.addEventListener("fileContentChanged",t),()=>{window.removeEventListener("filesChanged",A),window.removeEventListener("fileContentChanged",t)}},[e,q]);let W=(e,A)=>{let t,r=A||H.current||s;if(!r)return void y.v.warn("No compiled project available");if(D.current?E(!1):T({type:"selector-toggle",active:!1}),!j.current||!C){L.current=e;return}let n=e;n.startsWith("/")||(n="/"+n);let a=r.routes.find(e=>e.path===n);t=a?a.file:"/"===n?"/index.html":n+".html";let i=r.files.find(e=>e.path===t);if(!i){g(`Page not found: ${e}`),r.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&W("/",A);return}let o="string"==typeof i.content?i.content:new TextDecoder().decode(i.content);o=(o=(o=o.replace(/href="([^"]+)"/g,(e,A)=>{if(!A.endsWith(".css")||A.startsWith("http")||A.startsWith("//"))return e;let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`href="${n}"`:e})).replace(/src="([^"]+)"/g,(e,A)=>{if(!A.endsWith(".js")||A.startsWith("http")||A.startsWith("//"))return e;let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`src="${n}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,A)=>{let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`src="${n}"`:e});let c=` +(()=>{var e={};e.id=974,e.ids=[974],e.modules={597:(e,A,t)=>{"use strict";t.r(A),t.d(A,{default:()=>r});let r=(0,t(2907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/osw-studio-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/osw-studio-git/app/page.tsx","default")},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2501:(e,A,t)=>{"use strict";t.r(A),t.d(A,{GlobalError:()=>s.a,__next_app__:()=>u,pages:()=>c,routeModule:()=>d,tree:()=>l});var r=t(5239),n=t(8088),a=t(8170),s=t.n(a),i=t(893),o={};for(let e in i)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);t.d(A,o);let l=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,597)),"/Users/otto/Desktop/deepstudio/osw-studio-git/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(t.bind(t,8014)),"/Users/otto/Desktop/deepstudio/osw-studio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,7398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(t.t.bind(t,9999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(t.t.bind(t,5284,23)),"next/dist/client/components/unauthorized-error"]}],c=["/Users/otto/Desktop/deepstudio/osw-studio-git/app/page.tsx"],u={require:t,loadChunk:()=>Promise.resolve()},d=new r.AppPageRouteModule({definition:{kind:n.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:l}})},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4517:e=>{var A=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,o=/^\s+|\s+$/g;function l(e){return e?e.replace(o,""):""}e.exports=function(e,o){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];o=o||{};var c=1,u=1;function d(e){var A=e.match(t);A&&(c+=A.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function p(){var e={line:c,column:u};return function(A){return A.position=new h(e),m(r),A}}function h(e){this.start=e,this.end={line:c,column:u},this.source=o.source}h.prototype.content=e;var g=[];function f(A){var t=Error(o.source+":"+c+":"+u+": "+A);if(t.reason=A,t.filename=o.source,t.line=c,t.column=u,t.source=e,o.silent)g.push(t);else throw t}function m(A){var t=A.exec(e);if(t){var r=t[0];return d(r),e=e.slice(r.length),t}}function B(e){var A;for(e=e||[];A=w();)!1!==A&&e.push(A);return e}function w(){var A=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var t=2;""!=e.charAt(t)&&("*"!=e.charAt(t)||"/"!=e.charAt(t+1));)++t;if(t+=2,""===e.charAt(t-1))return f("End of comment missing");var r=e.slice(2,t-2);return u+=2,d(r),e=e.slice(t),u+=2,A({type:"comment",comment:r})}}m(r);var v,x=[];for(B(x);v=function(){var e=p(),t=m(n);if(t){if(w(),!m(a))return f("property missing ':'");var r=m(s),o=e({type:"declaration",property:l(t[0].replace(A,"")),value:r?l(r[0].replace(A,"")):""});return m(i),o}}();)!1!==v&&(x.push(v),B(x));return x}},4735:e=>{"use strict";e.exports=require("events")},5511:e=>{"use strict";e.exports=require("crypto")},5840:function(e,A,t){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0}),A.default=function(e,A){var t=null;if(!e||"string"!=typeof e)return t;var r=(0,n.default)(e),a="function"==typeof A;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,n=e.value;a?A(r,n,e):n&&((t=t||{})[r]=n)}}),t};var n=r(t(4517))},6291:(e,A,t)=>{Promise.resolve().then(t.bind(t,597))},6539:(e,A,t)=>{Promise.resolve().then(t.bind(t,7198))},6908:(e,A)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(e,A){return A.toUpperCase()},o=function(e,A){return"".concat(A,"-")};A.camelCase=function(e,A){var l;return(void 0===A&&(A={}),!(l=e)||n.test(l)||t.test(l))?e:(e=e.toLowerCase(),(e=A.reactCompat?e.replace(s,o):e.replace(a,o)).replace(r,i))}},7198:(e,A,t)=>{"use strict";let r,n;t.r(A),t.d(A,{default:()=>fZ});var a,s,i,o,l,c={};t.r(c),t.d(c,{boolean:()=>pg,booleanish:()=>pf,commaOrSpaceSeparated:()=>px,commaSeparated:()=>pv,number:()=>pB,overloadedBoolean:()=>pm,spaceSeparated:()=>pw});var u={};t.r(u),t.d(u,{attentionMarkers:()=>gf,contentInitial:()=>gc,disable:()=>gm,document:()=>gl,flow:()=>gd,flowInitial:()=>gu,insideSpan:()=>gg,string:()=>gp,text:()=>gh});var d=t(687),p=t(3210),h=t.t(p,2),g=t.n(p),f=t(6189),m=t(1338),B=t(5495),w=t(4084),v=t.n(w),x=t(5589),y=t(6241);class b{constructor(){this.db=new x.n}async init(){await this.db.init()}async exportProjectAsTemplate(e,A,t){try{y.v.info("[TemplateService] Exporting project as template",{projectId:A,name:t.name}),this.validateMetadata(t);let r=await e.getAllFilesAndDirectories(A),n=r.filter(e=>"directory"!==e.type),a=r.filter(e=>"directory"===e.type).map(e=>e.path),s={version:"1.0.0",name:t.name,description:t.description,templateVersion:t.version,author:t.author,authorUrl:t.authorUrl,license:t.license,licenseLabel:t.licenseLabel,licenseDescription:t.licenseDescription,tags:t.tags||[],thumbnail:t.thumbnail,previewImages:t.previewImages||[],downloadUrl:t.downloadUrl,directories:a,files:n.map(e=>({path:e.path,content:e.content})),assets:[]},i=new(v());i.file("template.json",JSON.stringify(s,null,2));let o=await i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}});return y.v.info("[TemplateService] Template exported successfully",{name:t.name,size:o.size}),o}catch(e){throw y.v.error("[TemplateService] Failed to export template:",e),Error(`Failed to export template: ${e instanceof Error?e.message:"Unknown error"}`)}}async importTemplateFile(e){try{if(y.v.info("[TemplateService] Importing template file",{name:e.name,size:e.size}),!e.name.endsWith(".oswt"))throw Error("Invalid file type. Expected .oswt file.");if(e.size>0x1900000)throw Error(`File too large. Maximum size is ${Math.round(25)}MB.`);let A=new(v()),t=(await A.loadAsync(e)).file("template.json");if(!t)throw Error("Invalid template file format. Missing template.json.");let r=await t.async("string"),n=JSON.parse(r);this.validateTemplateStructure(n);let a={id:(0,B.A)(),name:n.name,description:n.description,version:n.templateVersion||"1.0.0",files:n.files||[],directories:n.directories||[],assets:n.assets,metadata:{author:n.author,authorUrl:n.authorUrl,license:n.license||"personal",licenseLabel:n.licenseLabel,licenseDescription:n.licenseDescription,tags:n.tags||[],thumbnail:n.thumbnail,previewImages:n.previewImages||[],downloadUrl:n.downloadUrl},importedAt:new Date};return await this.db.saveCustomTemplate(a),y.v.info("[TemplateService] Template imported successfully",{id:a.id,name:a.name}),a}catch(e){throw y.v.error("[TemplateService] Failed to import template:",e),Error(`Failed to import template: ${e instanceof Error?e.message:"Unknown error"}`)}}async listCustomTemplates(){try{return await this.init(),(await this.db.getAllCustomTemplates()).sort((e,A)=>A.importedAt.getTime()-e.importedAt.getTime())}catch(e){throw y.v.error("[TemplateService] Failed to list templates:",e),Error("Failed to list templates")}}async deleteCustomTemplate(e){try{await this.init(),await this.db.deleteCustomTemplate(e),y.v.info("[TemplateService] Template deleted",{id:e})}catch(e){throw y.v.error("[TemplateService] Failed to delete template:",e),Error("Failed to delete template")}}async exportTemplateAsFile(e){try{y.v.info("[TemplateService] Re-exporting custom template",{id:e.id,name:e.name});let A=new(v());for(let t of(A.file("template.json",JSON.stringify(e,null,2)),e.files))t.content,A.file(t.path,t.content);return await A.generateAsync({type:"blob"})}catch(e){throw y.v.error("[TemplateService] Failed to re-export template:",e),Error(`Failed to export template: ${e instanceof Error?e.message:"Unknown error"}`)}}async generateThumbnail(e){y.v.info("[TemplateService] Thumbnail generation not yet implemented")}validateMetadata(e){if(!e.name||e.name.length<1||e.name.length>50)throw Error("Template name must be between 1 and 50 characters");if(!e.description||e.description.length<10||e.description.length>500)throw Error("Template description must be between 10 and 500 characters");if(!e.version||!/^\d+\.\d+\.\d+$/.test(e.version))throw Error("Template version must be in semantic version format (e.g., 1.0.0)");if(e.author&&e.author.length>50)throw Error("Author name must be 50 characters or less");if(e.authorUrl&&!this.isValidUrl(e.authorUrl))throw Error("Author URL must be a valid URL");if(!e.license)throw Error("License is required");if(e.tags&&e.tags.length>10)throw Error("Maximum 10 tags allowed");if(e.thumbnail&&e.thumbnail.length>512e3)throw Error(`Thumbnail too large. Maximum size is ${Math.round(500)}KB`);if(e.previewImages&&e.previewImages.length>5)throw Error("Maximum 5 preview images allowed");if(e.previewImages){for(let A of e.previewImages)if(A.length>1048576)throw Error(`Preview image too large. Maximum size is ${Math.round(1024)}KB per image`)}}validateTemplateStructure(e){if(!e.name||"string"!=typeof e.name)throw Error("Invalid template: missing or invalid name");if(!e.description||"string"!=typeof e.description)throw Error("Invalid template: missing or invalid description");if(!e.files||!Array.isArray(e.files))throw Error("Invalid template: missing or invalid files array");if(!e.directories||!Array.isArray(e.directories))throw Error("Invalid template: missing or invalid directories array");for(let A of e.files){if(!A.path||"string"!=typeof A.path)throw Error("Invalid template: file missing path");if(void 0===A.content)throw Error("Invalid template: file missing content")}}isValidUrl(e){try{return new URL(e),!0}catch{return!1}}}let C=new b;var Q=t(4934),F=t(8988);let U=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)("textarea",{className:(0,y.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:t,...A}));U.displayName="Textarea";var E=t(2688);let k=(0,E.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"}]]),j=(0,E.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"}]]),I=(0,E.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"}]]),H=(0,E.A)("file-box",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);var S=t(3964),N=t(1860);let L=(0,E.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"}]]),D=(0,E.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"}]]),T=(0,E.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"}]]),M=(0,E.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"}]]),K=(0,E.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 P=t(3861);let R=(0,E.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"}]]),O=(0,E.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"}]]),V=(0,E.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"}]]),G=(0,E.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"}]]),z=Symbol.for("constructDateFrom");function q(e,A){return"function"==typeof e?e(A):e&&"object"==typeof e&&z in e?e[z](A):e instanceof Date?new e.constructor(A):new Date(A)}let W={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 J(e){return (A={})=>{let t=A.width?String(A.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}let X={date:J({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:J({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:J({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(e){return(A,t)=>{let r;if("formatting"===(t?.context?String(t.context):"standalone")&&e.formattingValues){let A=e.defaultFormattingWidth||e.defaultWidth,n=t?.width?String(t.width):A;r=e.formattingValues[n]||e.formattingValues[A]}else{let A=e.defaultWidth,n=t?.width?String(t.width):e.defaultWidth;r=e.values[n]||e.values[A]}return r[e.argumentCallback?e.argumentCallback(A):A]}}function $(e){return(A,t={})=>{let r,n=t.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=A.match(a);if(!s)return null;let i=s[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,A){for(let t=0;te.test(i)):function(e,A){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&A(e[t]))return t}(o,e=>e.test(i));return r=e.valueCallback?e.valueCallback(l):l,{value:r=t.valueCallback?t.valueCallback(r):r,rest:A.slice(i.length)}}}let Z={code:"en-US",formatDistance:(e,A,t)=>{let r,n=W[e];if(r="string"==typeof n?n:1===A?n.one:n.other.replace("{{count}}",A.toString()),t?.addSuffix)if(t.comparison&&t.comparison>0)return"in "+r;else return r+" ago";return r},formatLong:X,formatRelative:(e,A,t,r)=>_[e],localize:{ordinalNumber:(e,A)=>{let t=Number(e),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({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:Y({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:Y({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:Y({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(A,t={})=>{let r=A.match(e.matchPattern);if(!r)return null;let n=r[0],a=A.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];return{value:s=t.valueCallback?t.valueCallback(s):s,rest:A.slice(n.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:$({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:$({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:$({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:$({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:$({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}},ee={};function eA(e,A){return q(A||e,e)}function et(e){let A=eA(e),t=new Date(Date.UTC(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds(),A.getMilliseconds()));return t.setUTCFullYear(A.getFullYear()),e-t}function er(e,...A){let t=q.bind(null,e||A.find(e=>"object"==typeof e));return A.map(t)}function en(e,A){let t=eA(e)-eA(A);return t<0?-1:t>0?1:t}function ea(e,A){return function(e,A,t){let r,n=t?.locale??ee.locale??Z,a=en(e,A);if(isNaN(a))throw RangeError("Invalid time value");let s=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:a}),[i,o]=er(t?.in,...a>0?[A,e]:[e,A]),l=function(e,A,t){var r;return(r=void 0,e=>{let A=(r?Math[r]:Math.trunc)(e);return 0===A?0:A})((eA(e)-eA(A))/1e3)}(o,i),c=Math.round((l-(et(o)-et(i))/1e3)/60);if(c<2)if(t?.includeSeconds)if(l<5)return n.formatDistance("lessThanXSeconds",5,s);else if(l<10)return n.formatDistance("lessThanXSeconds",10,s);else if(l<20)return n.formatDistance("lessThanXSeconds",20,s);else if(l<40)return n.formatDistance("halfAMinute",0,s);else if(l<60)return n.formatDistance("lessThanXMinutes",1,s);else return n.formatDistance("xMinutes",1,s);else if(0===c)return n.formatDistance("lessThanXMinutes",1,s);else return n.formatDistance("xMinutes",c,s);if(c<45)return n.formatDistance("xMinutes",c,s);if(c<90)return n.formatDistance("aboutXHours",1,s);if(c<1440){let e=Math.round(c/60);return n.formatDistance("aboutXHours",e,s)}if(c<2520)return n.formatDistance("xDays",1,s);else if(c<43200){let e=Math.round(c/1440);return n.formatDistance("xDays",e,s)}else if(c<86400)return r=Math.round(c/43200),n.formatDistance("aboutXMonths",r,s);if((r=function(e,A,t){let[r,n,a]=er(void 0,e,e,A),s=en(n,a),i=Math.abs(function(e,A,t){let[r,n]=er(void 0,e,A);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(n,a));if(i<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let o=en(n,a)===-s;(function(e,A){let t=eA(e,void 0);return+function(e,A){let t=eA(e,A?.in);return t.setHours(23,59,59,999),t}(t,void 0)==+function(e,A){let t=eA(e,A?.in),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}(t,A)})(r)&&1===i&&1===en(r,a)&&(o=!1);let l=s*(i-o);return 0===l?0:l}(o,i))<12){let e=Math.round(c/43200);return n.formatDistance("xMonths",e,s)}{let e=r%12,A=Math.trunc(r/12);return e<3?n.formatDistance("aboutXYears",A,s):e<9?n.formatDistance("overXYears",A,s):n.formatDistance("almostXYears",A+1,s)}}(e,q(e,Date.now()),A)}var es=t(569),ei=t(8599),eo=t(1273),el=t(5551),ec=t(4163),eu=t(9510),ed=t(43),ep=t(1355),eh=t(1359),eg=t(2547),ef=t(6963),em=t(5509),eB=t(5028),ew=t(6059),ev=t(3495),ex="rovingFocusGroup.onEntryFocus",ey={bubbles:!1,cancelable:!0},eb="RovingFocusGroup",[eC,eQ,eF]=(0,eu.N)(eb),[eU,eE]=(0,eo.A)(eb,[eF]),[ek,ej]=eU(eb),eI=p.forwardRef((e,A)=>(0,d.jsx)(eC.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eC.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eH,{...e,ref:A})})}));eI.displayName=eb;var eH=p.forwardRef((e,A)=>{let{__scopeRovingFocusGroup:t,orientation:r,loop:n=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:o,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...u}=e,h=p.useRef(null),g=(0,ei.s)(A,h),f=(0,ed.jH)(a),[m,B]=(0,el.i)({prop:s,defaultProp:i??null,onChange:o,caller:eb}),[w,v]=p.useState(!1),x=(0,ev.c)(l),y=eQ(t),b=p.useRef(!1),[C,Q]=p.useState(0);return p.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(ex,x),()=>e.removeEventListener(ex,x)},[x]),(0,d.jsx)(ek,{scope:t,orientation:r,dir:f,loop:n,currentTabStopId:m,onItemFocus:p.useCallback(e=>B(e),[B]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>Q(e=>e+1),[]),onFocusableItemRemove:p.useCallback(()=>Q(e=>e-1),[]),children:(0,d.jsx)(ec.sG.div,{tabIndex:w||0===C?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:(0,es.mK)(e.onMouseDown,()=>{b.current=!0}),onFocus:(0,es.mK)(e.onFocus,e=>{let A=!b.current;if(e.target===e.currentTarget&&A&&!w){let A=new CustomEvent(ex,ey);if(e.currentTarget.dispatchEvent(A),!A.defaultPrevented){let e=y().filter(e=>e.focusable);eD([e.find(e=>e.active),e.find(e=>e.id===m),...e].filter(Boolean).map(e=>e.ref.current),c)}}b.current=!1}),onBlur:(0,es.mK)(e.onBlur,()=>v(!1))})})}),eS="RovingFocusGroupItem",eN=p.forwardRef((e,A)=>{let{__scopeRovingFocusGroup:t,focusable:r=!0,active:n=!1,tabStopId:a,children:s,...i}=e,o=(0,ef.B)(),l=a||o,c=ej(eS,t),u=c.currentTabStopId===l,h=eQ(t),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:m}=c;return p.useEffect(()=>{if(r)return g(),()=>f()},[r,g,f]),(0,d.jsx)(eC.ItemSlot,{scope:t,id:l,focusable:r,active:n,children:(0,d.jsx)(ec.sG.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...i,ref:A,onMouseDown:(0,es.mK)(e.onMouseDown,e=>{r?c.onItemFocus(l):e.preventDefault()}),onFocus:(0,es.mK)(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;let A=function(e,A,t){var r;let n=(r=e.key,"rtl"!==t?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===A&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===A&&["ArrowUp","ArrowDown"].includes(n)))return eL[n]}(e,c.orientation,c.dir);if(void 0!==A){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let t=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===A)t.reverse();else if("prev"===A||"next"===A){"prev"===A&&t.reverse();let r=t.indexOf(e.currentTarget);t=c.loop?function(e,A){return e.map((t,r)=>e[(A+r)%e.length])}(t,r+1):t.slice(r+1)}setTimeout(()=>eD(t))}}),children:"function"==typeof s?s({isCurrentTabStop:u,hasTabStop:null!=m}):s})})});eN.displayName=eS;var eL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eD(e,A=!1){let t=document.activeElement;for(let r of e)if(r===t||(r.focus({preventScroll:A}),document.activeElement!==t))return}var eT=t(8730),eM=t(3376),eK=t(2247),eP=["Enter"," "],eR=["ArrowUp","PageDown","End"],eO=["ArrowDown","PageUp","Home",...eR],eV={ltr:[...eP,"ArrowRight"],rtl:[...eP,"ArrowLeft"]},eG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ez="Menu",[eq,eW,eJ]=(0,eu.N)(ez),[eX,e_]=(0,eo.A)(ez,[eJ,em.Bk,eE]),eY=(0,em.Bk)(),e$=eE(),[eZ,e0]=eX(ez),[e1,e2]=eX(ez),e4=e=>{let{__scopeMenu:A,open:t=!1,children:r,dir:n,onOpenChange:a,modal:s=!0}=e,i=eY(A),[o,l]=p.useState(null),c=p.useRef(!1),u=(0,ev.c)(a),h=(0,ed.jH)(n);return p.useEffect(()=>{let e=()=>{c.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),(0,d.jsx)(em.bL,{...i,children:(0,d.jsx)(eZ,{scope:A,open:t,onOpenChange:u,content:o,onContentChange:l,children:(0,d.jsx)(e1,{scope:A,onClose:p.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};e4.displayName=ez;var e3=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e,n=eY(t);return(0,d.jsx)(em.Mz,{...n,...r,ref:A})});e3.displayName="MenuAnchor";var e5="MenuPortal",[e6,e8]=eX(e5,{forceMount:void 0}),e9=e=>{let{__scopeMenu:A,forceMount:t,children:r,container:n}=e,a=e0(e5,A);return(0,d.jsx)(e6,{scope:A,forceMount:t,children:(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:r})})})};e9.displayName=e5;var e7="MenuContent",[Ae,AA]=eX(e7),At=p.forwardRef((e,A)=>{let t=e8(e7,e.__scopeMenu),{forceMount:r=t.forceMount,...n}=e,a=e0(e7,e.__scopeMenu),s=e2(e7,e.__scopeMenu);return(0,d.jsx)(eq.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(eq.Slot,{scope:e.__scopeMenu,children:s.modal?(0,d.jsx)(Ar,{...n,ref:A}):(0,d.jsx)(An,{...n,ref:A})})})})}),Ar=p.forwardRef((e,A)=>{let t=e0(e7,e.__scopeMenu),r=p.useRef(null),n=(0,ei.s)(A,r);return p.useEffect(()=>{let e=r.current;if(e)return(0,eM.Eq)(e)},[]),(0,d.jsx)(As,{...e,ref:n,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),An=p.forwardRef((e,A)=>{let t=e0(e7,e.__scopeMenu);return(0,d.jsx)(As,{...e,ref:A,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Aa=(0,eT.TL)("MenuContent.ScrollLock"),As=p.forwardRef((e,A)=>{let{__scopeMenu:t,loop:r=!1,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEntryFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,onDismiss:g,disableOutsideScroll:f,...m}=e,B=e0(e7,t),w=e2(e7,t),v=eY(t),x=e$(t),y=eW(t),[b,C]=p.useState(null),Q=p.useRef(null),F=(0,ei.s)(A,Q,B.onContentChange),U=p.useRef(0),E=p.useRef(""),k=p.useRef(0),j=p.useRef(null),I=p.useRef("right"),H=p.useRef(0),S=f?eK.A:p.Fragment,N=e=>{let A=E.current+e,t=y().filter(e=>!e.disabled),r=document.activeElement,n=t.find(e=>e.ref.current===r)?.textValue,a=function(e,A,t){var r;let n=A.length>1&&Array.from(A).every(e=>e===A[0])?A[0]:A,a=t?e.indexOf(t):-1,s=(r=Math.max(a,0),e.map((A,t)=>e[(r+t)%e.length]));1===n.length&&(s=s.filter(e=>e!==t));let i=s.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),A,n),s=t.find(e=>e.textValue===a)?.ref.current;!function e(A){E.current=A,window.clearTimeout(U.current),""!==A&&(U.current=window.setTimeout(()=>e(""),1e3))}(A),s&&setTimeout(()=>s.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),(0,eh.Oh)();let L=p.useCallback(e=>I.current===j.current?.side&&function(e,A){return!!A&&function(e,A){let{x:t,y:r}=e,n=!1;for(let e=0,a=A.length-1;er!=u>r&&t<(c-o)*(r-l)/(u-l)+o&&(n=!n)}return n}({x:e.clientX,y:e.clientY},A)}(e,j.current?.area),[]);return(0,d.jsx)(Ae,{scope:t,searchRef:E,onItemEnter:p.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:p.useCallback(e=>{L(e)||(Q.current?.focus(),C(null))},[L]),onTriggerLeave:p.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:k,onPointerGraceIntentChange:p.useCallback(e=>{j.current=e},[]),children:(0,d.jsx)(S,{...f?{as:Aa,allowPinchZoom:!0}:void 0,children:(0,d.jsx)(eg.n,{asChild:!0,trapped:n,onMountAutoFocus:(0,es.mK)(a,e=>{e.preventDefault(),Q.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,d.jsx)(ep.qW,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,onDismiss:g,children:(0,d.jsx)(eI,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:C,onEntryFocus:(0,es.mK)(o,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,d.jsx)(em.UC,{role:"menu","aria-orientation":"vertical","data-state":AN(B.open),"data-radix-menu-content":"",dir:w.dir,...v,...m,ref:F,style:{outline:"none",...m.style},onKeyDown:(0,es.mK)(m.onKeyDown,e=>{let A=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;A&&("Tab"===e.key&&e.preventDefault(),!t&&r&&N(e.key));let n=Q.current;if(e.target!==n||!eO.includes(e.key))return;e.preventDefault();let a=y().filter(e=>!e.disabled).map(e=>e.ref.current);eR.includes(e.key)&&a.reverse(),function(e){let A=document.activeElement;for(let t of e)if(t===A||(t.focus(),document.activeElement!==A))return}(a)}),onBlur:(0,es.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(U.current),E.current="")}),onPointerMove:(0,es.mK)(e.onPointerMove,AT(e=>{let A=e.target,t=H.current!==e.clientX;e.currentTarget.contains(A)&&t&&(I.current=e.clientX>H.current?"right":"left",H.current=e.clientX)}))})})})})})})});At.displayName=e7;var Ai=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{role:"group",...r,ref:A})});Ai.displayName="MenuGroup";var Ao=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{...r,ref:A})});Ao.displayName="MenuLabel";var Al="MenuItem",Ac="menu.itemSelect",Au=p.forwardRef((e,A)=>{let{disabled:t=!1,onSelect:r,...n}=e,a=p.useRef(null),s=e2(Al,e.__scopeMenu),i=AA(Al,e.__scopeMenu),o=(0,ei.s)(A,a),l=p.useRef(!1);return(0,d.jsx)(Ad,{...n,ref:o,disabled:t,onClick:(0,es.mK)(e.onClick,()=>{let e=a.current;if(!t&&e){let A=new CustomEvent(Ac,{bubbles:!0,cancelable:!0});e.addEventListener(Ac,e=>r?.(e),{once:!0}),(0,ec.hO)(e,A),A.defaultPrevented?l.current=!1:s.onClose()}}),onPointerDown:A=>{e.onPointerDown?.(A),l.current=!0},onPointerUp:(0,es.mK)(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{let A=""!==i.searchRef.current;t||A&&" "===e.key||eP.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Au.displayName=Al;var Ad=p.forwardRef((e,A)=>{let{__scopeMenu:t,disabled:r=!1,textValue:n,...a}=e,s=AA(Al,t),i=e$(t),o=p.useRef(null),l=(0,ei.s)(A,o),[c,u]=p.useState(!1),[h,g]=p.useState("");return p.useEffect(()=>{let e=o.current;e&&g((e.textContent??"").trim())},[a.children]),(0,d.jsx)(eq.ItemSlot,{scope:t,disabled:r,textValue:n??h,children:(0,d.jsx)(eN,{asChild:!0,...i,focusable:!r,children:(0,d.jsx)(ec.sG.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:(0,es.mK)(e.onPointerMove,AT(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,es.mK)(e.onPointerLeave,AT(e=>s.onItemLeave(e))),onFocus:(0,es.mK)(e.onFocus,()=>u(!0)),onBlur:(0,es.mK)(e.onBlur,()=>u(!1))})})})}),Ap=p.forwardRef((e,A)=>{let{checked:t=!1,onCheckedChange:r,...n}=e;return(0,d.jsx)(Ax,{scope:e.__scopeMenu,checked:t,children:(0,d.jsx)(Au,{role:"menuitemcheckbox","aria-checked":AL(t)?"mixed":t,...n,ref:A,"data-state":AD(t),onSelect:(0,es.mK)(n.onSelect,()=>r?.(!!AL(t)||!t),{checkForDefaultPrevented:!1})})})});Ap.displayName="MenuCheckboxItem";var Ah="MenuRadioGroup",[Ag,Af]=eX(Ah,{value:void 0,onValueChange:()=>{}}),Am=p.forwardRef((e,A)=>{let{value:t,onValueChange:r,...n}=e,a=(0,ev.c)(r);return(0,d.jsx)(Ag,{scope:e.__scopeMenu,value:t,onValueChange:a,children:(0,d.jsx)(Ai,{...n,ref:A})})});Am.displayName=Ah;var AB="MenuRadioItem",Aw=p.forwardRef((e,A)=>{let{value:t,...r}=e,n=Af(AB,e.__scopeMenu),a=t===n.value;return(0,d.jsx)(Ax,{scope:e.__scopeMenu,checked:a,children:(0,d.jsx)(Au,{role:"menuitemradio","aria-checked":a,...r,ref:A,"data-state":AD(a),onSelect:(0,es.mK)(r.onSelect,()=>n.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});Aw.displayName=AB;var Av="MenuItemIndicator",[Ax,Ay]=eX(Av,{checked:!1}),Ab=p.forwardRef((e,A)=>{let{__scopeMenu:t,forceMount:r,...n}=e,a=Ay(Av,t);return(0,d.jsx)(ew.C,{present:r||AL(a.checked)||!0===a.checked,children:(0,d.jsx)(ec.sG.span,{...n,ref:A,"data-state":AD(a.checked)})})});Ab.displayName=Av;var AC=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e;return(0,d.jsx)(ec.sG.div,{role:"separator","aria-orientation":"horizontal",...r,ref:A})});AC.displayName="MenuSeparator";var AQ=p.forwardRef((e,A)=>{let{__scopeMenu:t,...r}=e,n=eY(t);return(0,d.jsx)(em.i3,{...n,...r,ref:A})});AQ.displayName="MenuArrow";var AF="MenuSub",[AU,AE]=eX(AF),Ak=e=>{let{__scopeMenu:A,children:t,open:r=!1,onOpenChange:n}=e,a=e0(AF,A),s=eY(A),[i,o]=p.useState(null),[l,c]=p.useState(null),u=(0,ev.c)(n);return p.useEffect(()=>(!1===a.open&&u(!1),()=>u(!1)),[a.open,u]),(0,d.jsx)(em.bL,{...s,children:(0,d.jsx)(eZ,{scope:A,open:r,onOpenChange:u,content:l,onContentChange:c,children:(0,d.jsx)(AU,{scope:A,contentId:(0,ef.B)(),triggerId:(0,ef.B)(),trigger:i,onTriggerChange:o,children:t})})})};Ak.displayName=AF;var Aj="MenuSubTrigger",AI=p.forwardRef((e,A)=>{let t=e0(Aj,e.__scopeMenu),r=e2(Aj,e.__scopeMenu),n=AE(Aj,e.__scopeMenu),a=AA(Aj,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:o}=a,l={__scopeMenu:e.__scopeMenu},c=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>c,[c]),p.useEffect(()=>{let e=i.current;return()=>{window.clearTimeout(e),o(null)}},[i,o]),(0,d.jsx)(e3,{asChild:!0,...l,children:(0,d.jsx)(Ad,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":n.contentId,"data-state":AN(t.open),...e,ref:(0,ei.t)(A,n.onTriggerChange),onClick:A=>{e.onClick?.(A),e.disabled||A.defaultPrevented||(A.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:(0,es.mK)(e.onPointerMove,AT(A=>{a.onItemEnter(A),!A.defaultPrevented&&(e.disabled||t.open||s.current||(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),c()},100)))})),onPointerLeave:(0,es.mK)(e.onPointerLeave,AT(e=>{c();let A=t.content?.getBoundingClientRect();if(A){let r=t.content?.dataset.side,n="right"===r,s=A[n?"left":"right"],o=A[n?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(n?-5:5),y:e.clientY},{x:s,y:A.top},{x:o,y:A.top},{x:o,y:A.bottom},{x:s,y:A.bottom}],side:r}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:(0,es.mK)(e.onKeyDown,A=>{let n=""!==a.searchRef.current;e.disabled||n&&" "===A.key||eV[r.dir].includes(A.key)&&(t.onOpenChange(!0),t.content?.focus(),A.preventDefault())})})})});AI.displayName=Aj;var AH="MenuSubContent",AS=p.forwardRef((e,A)=>{let t=e8(e7,e.__scopeMenu),{forceMount:r=t.forceMount,...n}=e,a=e0(e7,e.__scopeMenu),s=e2(e7,e.__scopeMenu),i=AE(AH,e.__scopeMenu),o=p.useRef(null),l=(0,ei.s)(A,o);return(0,d.jsx)(eq.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(eq.Slot,{scope:e.__scopeMenu,children:(0,d.jsx)(As,{id:i.contentId,"aria-labelledby":i.triggerId,...n,ref:l,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&o.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>{e.target!==i.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:(0,es.mK)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{let A=e.currentTarget.contains(e.target),t=eG[s.dir].includes(e.key);A&&t&&(a.onOpenChange(!1),i.trigger?.focus(),e.preventDefault())})})})})})});function AN(e){return e?"open":"closed"}function AL(e){return"indeterminate"===e}function AD(e){return AL(e)?"indeterminate":e?"checked":"unchecked"}function AT(e){return A=>"mouse"===A.pointerType?e(A):void 0}AS.displayName=AH;var AM="DropdownMenu",[AK,AP]=(0,eo.A)(AM,[e_]),AR=e_(),[AO,AV]=AK(AM),AG=e=>{let{__scopeDropdownMenu:A,children:t,dir:r,open:n,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,o=AR(A),l=p.useRef(null),[c,u]=(0,el.i)({prop:n,defaultProp:a??!1,onChange:s,caller:AM});return(0,d.jsx)(AO,{scope:A,triggerId:(0,ef.B)(),triggerRef:l,contentId:(0,ef.B)(),open:c,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(e=>!e),[u]),modal:i,children:(0,d.jsx)(e4,{...o,open:c,onOpenChange:u,dir:r,modal:i,children:t})})};AG.displayName=AM;var Az="DropdownMenuTrigger",Aq=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,disabled:r=!1,...n}=e,a=AV(Az,t),s=AR(t);return(0,d.jsx)(e3,{asChild:!0,...s,children:(0,d.jsx)(ec.sG.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...n,ref:(0,ei.t)(A,a.triggerRef),onPointerDown:(0,es.mK)(e.onPointerDown,e=>{!r&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,es.mK)(e.onKeyDown,e=>{!r&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Aq.displayName=Az;var AW=e=>{let{__scopeDropdownMenu:A,...t}=e,r=AR(A);return(0,d.jsx)(e9,{...r,...t})};AW.displayName="DropdownMenuPortal";var AJ="DropdownMenuContent",AX=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AV(AJ,t),a=AR(t),s=p.useRef(!1);return(0,d.jsx)(At,{id:n.contentId,"aria-labelledby":n.triggerId,...a,...r,ref:A,onCloseAutoFocus:(0,es.mK)(e.onCloseAutoFocus,e=>{s.current||n.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,es.mK)(e.onInteractOutside,e=>{let A=e.detail.originalEvent,t=0===A.button&&!0===A.ctrlKey,r=2===A.button||t;(!n.modal||r)&&(s.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)"}})});AX.displayName=AJ,p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ai,{...n,...r,ref:A})}).displayName="DropdownMenuGroup",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ao,{...n,...r,ref:A})}).displayName="DropdownMenuLabel";var A_=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Au,{...n,...r,ref:A})});A_.displayName="DropdownMenuItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ap,{...n,...r,ref:A})}).displayName="DropdownMenuCheckboxItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Am,{...n,...r,ref:A})}).displayName="DropdownMenuRadioGroup",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Aw,{...n,...r,ref:A})}).displayName="DropdownMenuRadioItem",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(Ab,{...n,...r,ref:A})}).displayName="DropdownMenuItemIndicator";var AY=p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AC,{...n,...r,ref:A})});function A$({...e}){return(0,d.jsx)(AG,{"data-slot":"dropdown-menu",...e})}function AZ({...e}){return(0,d.jsx)(Aq,{"data-slot":"dropdown-menu-trigger",...e})}function A0({className:e,sideOffset:A=4,...t}){return(0,d.jsx)(AW,{children:(0,d.jsx)(AX,{"data-slot":"dropdown-menu-content",sideOffset:A,className:(0,y.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),...t})})}function A1({className:e,inset:A,variant:t="default",...r}){return(0,d.jsx)(A_,{"data-slot":"dropdown-menu-item","data-inset":A,"data-variant":t,className:(0,y.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),...r})}function A2({className:e,...A}){return(0,d.jsx)(AY,{"data-slot":"dropdown-menu-separator",className:(0,y.cn)("bg-border -mx-1 my-1 h-px",e),...A})}AY.displayName="DropdownMenuSeparator",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AQ,{...n,...r,ref:A})}).displayName="DropdownMenuArrow",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AI,{...n,...r,ref:A})}).displayName="DropdownMenuSubTrigger",p.forwardRef((e,A)=>{let{__scopeDropdownMenu:t,...r}=e,n=AR(t);return(0,d.jsx)(AS,{...n,...r,ref:A,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 A4=t(2581);function A3({project:e,onSelect:A,onDelete:t,onExport:r,onExportZip:n,onDuplicate:a,onPreview:s,onUpdate:i,onExportAsTemplate:o,viewMode:l="grid",forceMenuOpen:c=!1,highlightExport:u=!1}){let[h,g]=(0,p.useState)(!1),[f,B]=(0,p.useState)(e.name),[w,v]=(0,p.useState)(e.description||""),[x,b]=(0,p.useState)(null),[C,E]=(0,p.useState)(!0),[z,q]=(0,p.useState)(!1),W=async()=>{if(!f.trim()){A4.oR.error("Project name cannot be empty"),B(e.name),g(!1);return}if(f.length>50)return void A4.oR.error("Project name must be 50 characters or less");if(w.length>200)return void A4.oR.error("Description must be 200 characters or less");try{e.name=f.trim(),e.description=w.trim()||void 0,await m.vfs.updateProject(e),i(e),g(!1),A4.oR.success("Project updated")}catch(A){y.v.error("Failed to update project:",A),A4.oR.error("Failed to update project"),B(e.name),v(e.description||"")}},J=()=>{B(e.name),v(e.description||""),g(!1)},X=e=>{if(c)return void q(!0);q(e)},_=()=>x?Object.entries(x.fileTypes).sort(([,e],[,A])=>A-e).slice(0,3):[],Y=e=>{let A=e.toLowerCase();return["html","htm"].includes(A)?(0,d.jsx)(k,{className:"h-3 w-3"}):["css","scss","sass"].includes(A)?(0,d.jsx)(j,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(A)?(0,d.jsx)(k,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(A)?(0,d.jsx)(I,{className:"h-3 w-3"}):(0,d.jsx)(j,{className:"h-3 w-3"})},$=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===l?(0,d.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${u?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>A(e),children:(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[e.previewImage?(0,d.jsx)("div",{className:"w-16 h-12 rounded-md overflow-hidden bg-muted shrink-0 opacity-60",children:(0,d.jsx)("img",{src:e.previewImage,alt:`${e.name} preview`,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-16 h-12 rounded-md bg-muted flex items-center justify-center shrink-0 opacity-40",children:(0,d.jsx)(H,{className:"h-6 w-6 text-muted-foreground/30"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col md:flex-row md:gap-6",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-2",children:h?(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-1",onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(F.p,{value:f,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&W(),"Escape"===e.key&&J()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[f.length,"/50"]}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,d.jsx)(S.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:J,children:(0,d.jsx)(N.A,{className:"h-3 w-3"})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),g(!0)},children:(0,d.jsx)(L,{className:"h-3 w-3"})})]})}),e.description&&!h&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1",children:e.description}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Updated ",ea(e.updatedAt,{addSuffix:!0})]})]}),(0,d.jsxs)("div",{className:"space-y-2 mt-2 md:mt-0",children:[x&&(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(D,{className:"h-4 w-4"}),x.fileCount," ",1===x.fileCount?"file":"files"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(T,{className:"h-4 w-4"}),x.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(M,{className:"h-4 w-4"}),$(e.costTracking.totalCost)]})]}),x&&_().length>0&&(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:_().map(([e,A])=>(0,d.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[Y(e),(0,d.jsxs)("span",{children:[e.toUpperCase()," (",A,")"]})]},e))})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2 ml-4",children:(0,d.jsxs)(A$,{open:!!c||z,onOpenChange:X,children:[(0,d.jsx)(AZ,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":u?"project-actions-trigger":void 0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),s(e)},children:[(0,d.jsx)(P.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),a(e)},children:[(0,d.jsx)(R,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),n(e)},children:[(0,d.jsx)(O,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),r(e)},"data-tour-id":u?"project-export-json":void 0,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),o&&(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),o(e)},children:[(0,d.jsx)(H,{className:"mr-2 h-4 w-4"}),"Export as Template"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:A=>{A.stopPropagation(),t(e)},children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})}):(0,d.jsxs)("div",{className:`border border-border rounded-lg overflow-hidden hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${u?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>A(e),"data-tour-id":"project-card",children:[e.previewImage?(0,d.jsx)("div",{className:"w-full aspect-video bg-muted",children:(0,d.jsx)("img",{src:e.previewImage,alt:`${e.name} preview`,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-full aspect-video bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-16 w-16 text-muted-foreground/30"})}),(0,d.jsxs)("div",{className:"p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-start",children:[h?(0,d.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(F.p,{value:f,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),W()),"Escape"===e.key&&J()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,d.jsx)(S.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:J,children:(0,d.jsx)(N.A,{className:"h-3 w-3"})})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[f.length,"/50"]})]}):(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),g(!0)},children:(0,d.jsx)(L,{className:"h-3 w-3"})})]}),(0,d.jsxs)(A$,{open:!!c||z,onOpenChange:X,children:[(0,d.jsx)(AZ,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":u?"project-actions-trigger":void 0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),s(e)},children:[(0,d.jsx)(P.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),a(e)},children:[(0,d.jsx)(R,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),n(e)},children:[(0,d.jsx)(O,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),r(e)},"data-tour-id":u?"project-export-json":void 0,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),o&&(0,d.jsxs)(A1,{onClick:A=>{A.stopPropagation(),o(e)},children:[(0,d.jsx)(H,{className:"mr-2 h-4 w-4"}),"Export as Template"]}),(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:A=>{A.stopPropagation(),t(e)},children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),h?(0,d.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,d.jsx)(U,{value:w,onChange:e=>v(e.target.value),onKeyDown:e=>{"Escape"===e.key&&J()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,d.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[w.length,"/200"]})})]}):(0,d.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),C?(0,d.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):x&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(D,{className:"h-4 w-4"}),x.fileCount," ",1===x.fileCount?"file":"files"]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(T,{className:"h-4 w-4"}),x.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(M,{className:"h-4 w-4"}),$(e.costTracking.totalCost)]})]}),_().length>0&&(0,d.jsx)("div",{className:"flex items-center gap-3 text-xs",children:_().map(([e,A])=>(0,d.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[Y(e),(0,d.jsxs)("span",{children:[e," (",A,")"]})]},e))})]}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,d.jsxs)("p",{children:["Updated ",ea(e.updatedAt,{addSuffix:!0})]})})]})]})}var A5=t(2106),A6=t(8122);let A8=(0,E.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),A9=(0,E.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),A7=(0,E.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"}]]),te=(0,E.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"}]]),tA=(0,E.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),tt=(0,E.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"}]]),tr=(0,E.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 tn=t(3974),ta=function(e,A){return(ta=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,A){e.__proto__=A}||function(e,A){for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t])})(e,A)};function ts(e,A){if("function"!=typeof A&&null!==A)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");function t(){this.constructor=e}ta(e,A),e.prototype=null===A?Object.create(A):(t.prototype=A.prototype,new t)}var ti=function(){return(ti=Object.assign||function(e){for(var A,t=1,r=arguments.length;t0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=55296&&n<=56319&&t>10)+55296,s%1024+56320)),(n+1===t||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},tf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tm="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tB=0;tB>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&a;return l},tb=function(e){for(var A=e.length,t=[],r=0;r=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e>11),A=this.index[A]+(e>>5&63),A=((A=this.index[A])<<2)+(31&e),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),tE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tk="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tj=0;tj50?(n.push(!0),s-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(A)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(a),t.push(16);if(4===s||11===s){if(0===a)return r.push(a),t.push(30);var i=t[a-1];return -1===tT.indexOf(i)?(r.push(r[a-1]),t.push(i)):(r.push(a),t.push(30))}if(r.push(a),31===s)return t.push("strict"===A?21:37);if(42===s||29===s)return t.push(30);if(43===s)if(e>=131072&&e<=196605||e>=196608&&e<=262141)return t.push(37);else return t.push(30);t.push(s)}),[r,t,n]},tR=function(e,A,t,r){var n=r[t];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var a=t;a<=r.length;){var s=r[++a];if(s===A)return!0;if(10!==s)break}if(10===n)for(var a=t;a>0;){var i=r[--a];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var o=t;o<=r.length;){var s=r[++o];if(s===A)return!0;if(10!==s)break}if(10!==i)break}return!1},tO=function(e,A){for(var t=e;t>=0;){var r=A[t];if(10!==r)return r;t--}return 0},tV=function(e,A,t,r,n){if(0===t[r])return"\xd7";var a=r-1;if(Array.isArray(n)&&!0===n[a])return"\xd7";var s=a-1,i=a+1,o=A[a],l=s>=0?A[s]:0,c=A[i];if(2===o&&3===c)return"\xd7";if(-1!==tN.indexOf(o))return"!";if(-1!==tN.indexOf(c)||-1!==tL.indexOf(c))return"\xd7";if(8===tO(a,A))return"\xf7";if(11===tH.get(e[a])||(32===o||33===o)&&11===tH.get(e[i])||7===o||7===c||9===o||-1===[10,13,15].indexOf(o)&&9===c||-1!==[17,18,19,24,28].indexOf(c)||22===tO(a,A)||tR(23,22,a,A)||tR([17,18],21,a,A)||tR(12,12,a,A))return"\xd7";if(10===o)return"\xf7";if(23===o||23===c)return"\xd7";if(16===c||16===o)return"\xf7";if(-1!==[13,15,21].indexOf(c)||14===o||36===l&&-1!==tK.indexOf(o)||28===o&&36===c||20===c||-1!==tS.indexOf(c)&&25===o||-1!==tS.indexOf(o)&&25===c||27===o&&-1!==[37,32,33].indexOf(c)||-1!==[37,32,33].indexOf(o)&&26===c||-1!==tS.indexOf(o)&&-1!==tD.indexOf(c)||-1!==tD.indexOf(o)&&-1!==tS.indexOf(c)||-1!==[27,26].indexOf(o)&&(25===c||-1!==[22,15].indexOf(c)&&25===A[i+1])||-1!==[22,15].indexOf(o)&&25===c||25===o&&-1!==[25,28,24].indexOf(c))return"\xd7";if(-1!==[25,28,24,17,18].indexOf(c))for(var u=a;u>=0;){var d=A[u];if(25===d)return"\xd7";if(-1!==[28,24].indexOf(d))u--;else break}if(-1!==[27,26].indexOf(c))for(var u=-1!==[17,18].indexOf(o)?s:a;u>=0;){var d=A[u];if(25===d)return"\xd7";if(-1!==[28,24].indexOf(d))u--;else break}if(38===o&&-1!==[38,39,34,35].indexOf(c)||-1!==[39,34].indexOf(o)&&-1!==[39,40].indexOf(c)||-1!==[40,35].indexOf(o)&&40===c||-1!==tM.indexOf(o)&&-1!==[20,26].indexOf(c)||-1!==tM.indexOf(c)&&27===o||-1!==tS.indexOf(o)&&-1!==tS.indexOf(c)||24===o&&-1!==tS.indexOf(c)||-1!==tS.concat(25).indexOf(o)&&22===c&&-1===tI.indexOf(e[i])||-1!==tS.concat(25).indexOf(c)&&18===o)return"\xd7";if(41===o&&41===c){for(var p=t[a],h=1;p>0;)if(41===A[--p])h++;else break;if(h%2!=0)return"\xd7"}return 32===o&&33===c?"\xd7":"\xf7"},tG=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=tP(e,A.lineBreak),r=t[0],n=t[1],a=t[2];return("break-all"===A.wordBreak||"break-word"===A.wordBreak)&&(n=n.map(function(e){return -1!==[25,30,42].indexOf(e)?37:e})),[r,n,"keep-all"===A.wordBreak?a.map(function(A,t){return A&&e[t]>=19968&&e[t]<=40959}):void 0]},tz=function(){function e(e,A,t,r){this.codePoints=e,this.required="!"===A,this.start=t,this.end=r}return e.prototype.slice=function(){return tg.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),tq=function(e,A){var t=th(e),r=tG(t,A),n=r[0],a=r[1],s=r[2],i=t.length,o=0,l=0;return{next:function(){if(l>=i)return{done:!0,value:null};for(var e="\xd7";l=48&&e<=57},tJ=function(e){return tW(e)||e>=65&&e<=70||e>=97&&e<=102},tX=function(e){return e>=97&&e<=122||e>=65&&e<=90},t_=function(e){return 10===e||9===e||32===e},tY=function(e){return tX(e)||e>=128||95===e},t$=function(e){return tY(e)||tW(e)||45===e},tZ=function(e,A){return 92===e&&10!==A},t0=function(e,A,t){return 45===e?tY(A)||tZ(A,t):!!(tY(e)||92===e&&tZ(e,A))||!1},t1=function(e,A,t){return 43===e||45===e?!!tW(A)||46===A&&tW(t):46===e?tW(A):tW(e)},t2=function(e){var A=0,t=1;(43===e[0]||45===e[A])&&(45===e[A]&&(t=-1),A++);for(var r=[];tW(e[A]);)r.push(e[A++]);var n=r.length?parseInt(tg.apply(void 0,r),10):0;46===e[A]&&A++;for(var a=[];tW(e[A]);)a.push(e[A++]);var s=a.length,i=s?parseInt(tg.apply(void 0,a),10):0;(69===e[A]||101===e[A])&&A++;var o=1;(43===e[A]||45===e[A])&&(45===e[A]&&(o=-1),A++);for(var l=[];tW(e[A]);)l.push(e[A++]);return t*(n+i*Math.pow(10,-s))*Math.pow(10,o*(l.length?parseInt(tg.apply(void 0,l),10):0))},t4={type:2},t3={type:3},t5={type:4},t6={type:13},t8={type:8},t9={type:21},t7={type:9},re={type:10},rA={type:11},rt={type:12},rr={type:14},rn={type:23},ra={type:1},rs={type:25},ri={type:24},ro={type:26},rl={type:27},rc={type:28},ru={type:29},rd={type:31},rp={type:32},rh=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(th(e))},e.prototype.read=function(){for(var e=[],A=this.consumeToken();A!==rp;)e.push(A),A=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var A=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(t$(A)||tZ(t,r)){var n=t0(A,t,r)?2:1,a=this.consumeName();return{type:5,value:a,flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t6;break;case 39:return this.consumeStringToken(39);case 40:return t4;case 41:return t3;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),rr;break;case 43:case 46:if(t1(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return t5;case 45:var s=this.peekCodePoint(0),i=this.peekCodePoint(1);if(t1(e,s,i))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(t0(e,s,i))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===s&&62===i)return this.consumeCodePoint(),this.consumeCodePoint(),ri;break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(42===o&&47===(o=this.consumeCodePoint())||-1===o)return this.consumeToken()}break;case 58:return ro;case 59:return rl;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),rs;break;case 64:if(t0(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2))){var a=this.consumeName();return{type:7,value:a}}break;case 91:return rc;case 92:if(tZ(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return ru;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t8;break;case 123:return rA;case 125:return rt;case 117:case 85:var l=this.peekCodePoint(0),c=this.peekCodePoint(1);return 43===l&&(tJ(c)||63===c)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),t7;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),t9;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),re;break;case -1:return rp}return t_(e)?(this.consumeWhiteSpace(),rd):tW(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):tY(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:tg(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],A=this.consumeCodePoint();tJ(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var t=!1;63===A&&e.length<6;)e.push(A),A=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(tg.apply(void 0,e.map(function(e){return 63===e?48:e})),16),n=parseInt(tg.apply(void 0,e.map(function(e){return 63===e?70:e})),16);return{type:30,start:r,end:n}}var a=parseInt(tg.apply(void 0,e),16);if(!(45===this.peekCodePoint(0)&&tJ(this.peekCodePoint(1))))return{type:30,start:a,end:a};this.consumeCodePoint(),A=this.consumeCodePoint();for(var s=[];tJ(A)&&s.length<6;)s.push(A),A=this.consumeCodePoint();var n=parseInt(tg.apply(void 0,s),16);return{type:30,start:a,end:n}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:22,value:""};var A=this.peekCodePoint(0);if(39===A||34===A){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),rn)}for(;;){var r,n=this.consumeCodePoint();if(-1===n||41===n)return{type:22,value:tg.apply(void 0,e)};if(t_(n)){if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))return this.consumeCodePoint(),{type:22,value:tg.apply(void 0,e)};return this.consumeBadUrlRemnants(),rn}if(34===n||39===n||40===n||(r=n)>=0&&r<=8||11===r||r>=14&&r<=31||127===r)return this.consumeBadUrlRemnants(),rn;if(92===n)if(!tZ(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),rn;else e.push(this.consumeEscapedCodePoint());else e.push(n)}},e.prototype.consumeWhiteSpace=function(){for(;t_(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;tZ(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var A="";e>0;){var t=Math.min(5e4,e);A+=tg.apply(void 0,this._value.splice(0,t)),e-=t}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var A="",t=0;;){var r=this._value[t];if(-1===r||void 0===r||r===e)return{type:0,value:A+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),ra;if(92===r){var n=this._value[t+1];-1!==n&&void 0!==n&&(10===n?(A+=this.consumeStringSlice(t),t=-1,this._value.shift()):tZ(r,n)&&(A+=this.consumeStringSlice(t),A+=tg(this.consumeEscapedCodePoint()),t=-1))}t++}},e.prototype.consumeNumber=function(){var e=[],A=4,t=this.peekCodePoint(0);for((43===t||45===t)&&e.push(this.consumeCodePoint());tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&tW(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&tW(n)||tW(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;tW(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[t2(e),A]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],t=e[1],r=this.peekCodePoint(0);return t0(r,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:A,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:A,flags:t}):{type:17,number:A,flags:t}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(tJ(e)){for(var A=tg(e);tJ(this.peekCodePoint(0))&&A.length<6;)A+=tg(this.consumeCodePoint());t_(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(A,16);return 0===t||t>=55296&&t<=57343||t>1114111?65533:t}return -1===e?65533:e},e.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(t$(A))e+=tg(A);else{if(!tZ(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),e;e+=tg(this.consumeEscapedCodePoint())}}},e}(),rg=function(){function e(e){this._tokens=e}return e.create=function(A){var t=new rh;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var A=this.consumeComponentValue();do e=this.consumeToken();while(31===e.type);if(32===e.type)return A;throw SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(32===A.type)return e;e.push(A),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var A={type:e,values:[]},t=this.consumeToken();;){if(32===t.type||rC(t,e))return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue()),t=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?rp:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),rf=function(e){return 15===e.type},rm=function(e){return 17===e.type},rB=function(e){return 20===e.type},rw=function(e){return 0===e.type},rv=function(e,A){return rB(e)&&e.value===A},rx=function(e){return 31!==e.type},ry=function(e){return 31!==e.type&&4!==e.type},rb=function(e){var A=[],t=[];return e.forEach(function(e){if(4===e.type){if(0===t.length)throw Error("Error parsing function args, zero tokens for arg");A.push(t),t=[];return}31!==e.type&&t.push(e)}),t.length&&A.push(t),A},rC=function(e,A){return 11===A&&12===e.type||28===A&&29===e.type||2===A&&3===e.type},rQ=function(e){return 17===e.type||15===e.type},rF=function(e){return 16===e.type||rQ(e)},rU=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},rE={type:17,number:0,flags:4},rk={type:16,number:50,flags:4},rj={type:16,number:100,flags:4},rI=function(e,A,t){var r=e[0],n=e[1];return[rH(r,A),rH(void 0!==n?n:r,t)]},rH=function(e,A){if(16===e.type)return e.number/100*A;if(rf(e))switch(e.unit){case"rem":case"em":return 16*e.number}return e.number},rS="grad",rN="turn",rL={parse:function(e,A){if(15===A.type)switch(A.unit){case"deg":return Math.PI*A.number/180;case rS:return Math.PI/200*A.number;case"rad":return A.number;case rN:return 2*Math.PI*A.number}throw Error("Unsupported angle type")}},rD=function(e){return 15===e.type&&("deg"===e.unit||e.unit===rS||"rad"===e.unit||e.unit===rN)},rT=function(e){switch(e.filter(rB).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[rE,rE];case"to top":case"bottom":return rM(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[rE,rj];case"to right":case"left":return rM(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[rj,rj];case"to bottom":case"top":return rM(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[rj,rE];case"to left":case"right":return rM(270)}return 0},rM=function(e){return Math.PI*e/180},rK={parse:function(e,A){if(18===A.type){var t=rW[A.name];if(void 0===t)throw Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(5===A.type){if(3===A.value.length){var r=A.value.substring(0,1),n=A.value.substring(1,2),a=A.value.substring(2,3);return rO(parseInt(r+r,16),parseInt(n+n,16),parseInt(a+a,16),1)}if(4===A.value.length){var r=A.value.substring(0,1),n=A.value.substring(1,2),a=A.value.substring(2,3),s=A.value.substring(3,4);return rO(parseInt(r+r,16),parseInt(n+n,16),parseInt(a+a,16),parseInt(s+s,16)/255)}if(6===A.value.length){var r=A.value.substring(0,2),n=A.value.substring(2,4),a=A.value.substring(4,6);return rO(parseInt(r,16),parseInt(n,16),parseInt(a,16),1)}if(8===A.value.length){var r=A.value.substring(0,2),n=A.value.substring(2,4),a=A.value.substring(4,6),s=A.value.substring(6,8);return rO(parseInt(r,16),parseInt(n,16),parseInt(a,16),parseInt(s,16)/255)}}if(20===A.type){var i=rX[A.value.toUpperCase()];if(void 0!==i)return i}return rX.TRANSPARENT}},rP=function(e){return(255&e)==0},rR=function(e){var A=255&e,t=255&e>>8,r=255&e>>16,n=255&e>>24;return A<255?"rgba("+n+","+r+","+t+","+A/255+")":"rgb("+n+","+r+","+t+")"},rO=function(e,A,t,r){return(e<<24|A<<16|t<<8|(0|Math.round(255*r)))>>>0},rV=function(e,A){if(17===e.type)return e.number;if(16===e.type){var t=3===A?1:255;return 3===A?e.number/100*t:Math.round(e.number/100*t)}return 0},rG=function(e,A){var t=A.filter(ry);if(3===t.length){var r=t.map(rV),n=r[0],a=r[1],s=r[2];return rO(n,a,s,1)}if(4===t.length){var i=t.map(rV),n=i[0],a=i[1],s=i[2];return rO(n,a,s,i[3])}return 0};function rz(e,A,t){return(t<0&&(t+=1),t>=1&&(t-=1),t<1/6)?(A-e)*t*6+e:t<.5?A:t<2/3?(A-e)*6*(2/3-t)+e:e}var rq=function(e,A){var t=A.filter(ry),r=t[0],n=t[1],a=t[2],s=t[3],i=(17===r.type?rM(r.number):rL.parse(e,r))/(2*Math.PI),o=rF(n)?n.number/100:0,l=rF(a)?a.number/100:0,c=void 0!==s&&rF(s)?rH(s,1):1;if(0===o)return rO(255*l,255*l,255*l,1);var u=l<=.5?l*(o+1):l+o-l*o,d=2*l-u;return rO(255*rz(d,u,i+1/3),255*rz(d,u,i),255*rz(d,u,i-1/3),c)},rW={hsl:rq,hsla:rq,rgb:rG,rgba:rG},rJ=function(e,A){return rK.parse(e,rg.create(A).parseComponentValue())},rX={ALICEBLUE:0xf0f8ffff,ANTIQUEWHITE:0xfaebd7ff,AQUA:0xffffff,AQUAMARINE:0x7fffd4ff,AZURE:0xf0ffffff,BEIGE:0xf5f5dcff,BISQUE:0xffe4c4ff,BLACK:255,BLANCHEDALMOND:0xffebcdff,BLUE:65535,BLUEVIOLET:0x8a2be2ff,BROWN:0xa52a2aff,BURLYWOOD:0xdeb887ff,CADETBLUE:0x5f9ea0ff,CHARTREUSE:0x7fff00ff,CHOCOLATE:0xd2691eff,CORAL:0xff7f50ff,CORNFLOWERBLUE:0x6495edff,CORNSILK:0xfff8dcff,CRIMSON:0xdc143cff,CYAN:0xffffff,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:0xb886bbff,DARKGRAY:0xa9a9a9ff,DARKGREEN:6553855,DARKGREY:0xa9a9a9ff,DARKKHAKI:0xbdb76bff,DARKMAGENTA:0x8b008bff,DARKOLIVEGREEN:0x556b2fff,DARKORANGE:0xff8c00ff,DARKORCHID:0x9932ccff,DARKRED:0x8b0000ff,DARKSALMON:0xe9967aff,DARKSEAGREEN:0x8fbc8fff,DARKSLATEBLUE:0x483d8bff,DARKSLATEGRAY:0x2f4f4fff,DARKSLATEGREY:0x2f4f4fff,DARKTURQUOISE:0xced1ff,DARKVIOLET:0x9400d3ff,DEEPPINK:0xff1493ff,DEEPSKYBLUE:0xbfffff,DIMGRAY:0x696969ff,DIMGREY:0x696969ff,DODGERBLUE:0x1e90ffff,FIREBRICK:0xb22222ff,FLORALWHITE:0xfffaf0ff,FORESTGREEN:0x228b22ff,FUCHSIA:0xff00ffff,GAINSBORO:0xdcdcdcff,GHOSTWHITE:0xf8f8ffff,GOLD:0xffd700ff,GOLDENROD:0xdaa520ff,GRAY:0x808080ff,GREEN:8388863,GREENYELLOW:0xadff2fff,GREY:0x808080ff,HONEYDEW:0xf0fff0ff,HOTPINK:0xff69b4ff,INDIANRED:0xcd5c5cff,INDIGO:0x4b0082ff,IVORY:0xfffff0ff,KHAKI:0xf0e68cff,LAVENDER:0xe6e6faff,LAVENDERBLUSH:0xfff0f5ff,LAWNGREEN:0x7cfc00ff,LEMONCHIFFON:0xfffacdff,LIGHTBLUE:0xadd8e6ff,LIGHTCORAL:0xf08080ff,LIGHTCYAN:0xe0ffffff,LIGHTGOLDENRODYELLOW:0xfafad2ff,LIGHTGRAY:0xd3d3d3ff,LIGHTGREEN:0x90ee90ff,LIGHTGREY:0xd3d3d3ff,LIGHTPINK:0xffb6c1ff,LIGHTSALMON:0xffa07aff,LIGHTSEAGREEN:0x20b2aaff,LIGHTSKYBLUE:0x87cefaff,LIGHTSLATEGRAY:0x778899ff,LIGHTSLATEGREY:0x778899ff,LIGHTSTEELBLUE:0xb0c4deff,LIGHTYELLOW:0xffffe0ff,LIME:0xff00ff,LIMEGREEN:0x32cd32ff,LINEN:0xfaf0e6ff,MAGENTA:0xff00ffff,MAROON:0x800000ff,MEDIUMAQUAMARINE:0x66cdaaff,MEDIUMBLUE:52735,MEDIUMORCHID:0xba55d3ff,MEDIUMPURPLE:0x9370dbff,MEDIUMSEAGREEN:0x3cb371ff,MEDIUMSLATEBLUE:0x7b68eeff,MEDIUMSPRINGGREEN:0xfa9aff,MEDIUMTURQUOISE:0x48d1ccff,MEDIUMVIOLETRED:0xc71585ff,MIDNIGHTBLUE:0x191970ff,MINTCREAM:0xf5fffaff,MISTYROSE:0xffe4e1ff,MOCCASIN:0xffe4b5ff,NAVAJOWHITE:0xffdeadff,NAVY:33023,OLDLACE:0xfdf5e6ff,OLIVE:0x808000ff,OLIVEDRAB:0x6b8e23ff,ORANGE:0xffa500ff,ORANGERED:0xff4500ff,ORCHID:0xda70d6ff,PALEGOLDENROD:0xeee8aaff,PALEGREEN:0x98fb98ff,PALETURQUOISE:0xafeeeeff,PALEVIOLETRED:0xdb7093ff,PAPAYAWHIP:0xffefd5ff,PEACHPUFF:0xffdab9ff,PERU:0xcd853fff,PINK:0xffc0cbff,PLUM:0xdda0ddff,POWDERBLUE:0xb0e0e6ff,PURPLE:0x800080ff,REBECCAPURPLE:0x663399ff,RED:0xff0000ff,ROSYBROWN:0xbc8f8fff,ROYALBLUE:0x4169e1ff,SADDLEBROWN:0x8b4513ff,SALMON:0xfa8072ff,SANDYBROWN:0xf4a460ff,SEAGREEN:0x2e8b57ff,SEASHELL:0xfff5eeff,SIENNA:0xa0522dff,SILVER:0xc0c0c0ff,SKYBLUE:0x87ceebff,SLATEBLUE:0x6a5acdff,SLATEGRAY:0x708090ff,SLATEGREY:0x708090ff,SNOW:0xfffafaff,SPRINGGREEN:0xff7fff,STEELBLUE:0x4682b4ff,TAN:0xd2b48cff,TEAL:8421631,THISTLE:0xd8bfd8ff,TOMATO:0xff6347ff,TRANSPARENT:0,TURQUOISE:0x40e0d0ff,VIOLET:0xee82eeff,WHEAT:0xf5deb3ff,WHITE:0xffffffff,WHITESMOKE:0xf5f5f5ff,YELLOW:0xffff00ff,YELLOWGREEN:0x9acd32ff},r_={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(rB(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},rY={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},r$=function(e,A){var t=rK.parse(e,A[0]),r=A[1];return r&&rF(r)?{color:t,stop:r}:{color:t,stop:null}},rZ=function(e,A){var t=e[0],r=e[e.length-1];null===t.stop&&(t.stop=rE),null===r.stop&&(r.stop=rj);for(var n=[],a=0,s=0;sa?n.push(o):n.push(a),a=o}else n.push(null)}for(var l=null,s=0;se.optimumDistance)?{optimumCorner:A,optimumDistance:a}:e},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},r3=function(e,A,t,r,n){var a=0,s=0;switch(e.size){case 0:0===e.shape?a=s=Math.min(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-n)):1===e.shape&&(a=Math.min(Math.abs(A),Math.abs(A-r)),s=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(0===e.shape)a=s=Math.min(r2(A,t),r2(A,t-n),r2(A-r,t),r2(A-r,t-n));else if(1===e.shape){var i=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(A),Math.abs(A-r)),o=r4(r,n,A,t,!0),l=o[0],c=o[1];a=r2(l-A,(c-t)/i),s=i*a}break;case 1:0===e.shape?a=s=Math.max(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-n)):1===e.shape&&(a=Math.max(Math.abs(A),Math.abs(A-r)),s=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(0===e.shape)a=s=Math.max(r2(A,t),r2(A,t-n),r2(A-r,t),r2(A-r,t-n));else if(1===e.shape){var i=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(A),Math.abs(A-r)),u=r4(r,n,A,t,!1),l=u[0],c=u[1];a=r2(l-A,(c-t)/i),s=i*a}}return Array.isArray(e.size)&&(a=rH(e.size[0],r),s=2===e.size.length?rH(e.size[1],n):a),[a,s]},r5=function(e,A){var t=rM(180),r=[];return rb(A).forEach(function(A,n){if(0===n){var a=A[0];if(20===a.type&&-1!==["top","left","right","bottom"].indexOf(a.value)){t=rT(A);return}if(rD(a)){t=(rL.parse(e,a)+rM(270))%rM(360);return}}var s=r$(e,A);r.push(s)}),{angle:t,stops:r,type:1}},r6="closest-side",r8="farthest-side",r9="closest-corner",r7="farthest-corner",ne="circle",nA="ellipse",nt="cover",nr="contain",nn=function(e,A){var t=0,r=3,n=[],a=[];return rb(A).forEach(function(A,s){var i=!0;if(0===s?i=A.reduce(function(e,A){if(rB(A))switch(A.value){case"center":return a.push(rk),!1;case"top":case"left":return a.push(rE),!1;case"right":case"bottom":return a.push(rj),!1}else if(rF(A)||rQ(A))return a.push(A),!1;return e},i):1===s&&(i=A.reduce(function(e,A){if(rB(A))switch(A.value){case ne:return t=0,!1;case nA:return t=1,!1;case nr:case r6:return r=0,!1;case r8:return r=1,!1;case r9:return r=2,!1;case nt:case r7:return r=3,!1}else if(rQ(A)||rF(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return e},i)),i){var o=r$(e,A);n.push(o)}}),{size:r,shape:t,stops:n,position:a,type:2}},na={parse:function(e,A){if(22===A.type){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(18===A.type){var r=ns[A.name];if(void 0===r)throw Error('Attempting to parse an unsupported image function "'+A.name+'"');return r(e,A.values)}throw Error("Unsupported image type "+A.type)}},ns={"linear-gradient":function(e,A){var t=rM(180),r=[];return rb(A).forEach(function(A,n){if(0===n){var a=A[0];if(20===a.type&&"to"===a.value){t=rT(A);return}if(rD(a)){t=rL.parse(e,a);return}}var s=r$(e,A);r.push(s)}),{angle:t,stops:r,type:1}},"-moz-linear-gradient":r5,"-ms-linear-gradient":r5,"-o-linear-gradient":r5,"-webkit-linear-gradient":r5,"radial-gradient":function(e,A){var t=0,r=3,n=[],a=[];return rb(A).forEach(function(A,s){var i=!0;if(0===s){var o=!1;i=A.reduce(function(e,A){if(o)if(rB(A))switch(A.value){case"center":a.push(rk);break;case"top":case"left":a.push(rE);break;case"right":case"bottom":a.push(rj)}else(rF(A)||rQ(A))&&a.push(A);else if(rB(A))switch(A.value){case ne:return t=0,!1;case nA:return t=1,!1;case"at":return o=!0,!1;case r6:return r=0,!1;case nt:case r8:return r=1,!1;case nr:case r9:return r=2,!1;case r7:return r=3,!1}else if(rQ(A)||rF(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return e},i)}if(i){var l=r$(e,A);n.push(l)}}),{size:r,shape:t,stops:n,position:a,type:2}},"-moz-radial-gradient":nn,"-ms-radial-gradient":nn,"-o-radial-gradient":nn,"-webkit-radial-gradient":nn,"-webkit-gradient":function(e,A){var t=rM(180),r=[],n=1;return rb(A).forEach(function(A,t){var a=A[0];if(0===t){if(rB(a)&&"linear"===a.value){n=1;return}else if(rB(a)&&"radial"===a.value){n=2;return}}if(18===a.type){if("from"===a.name){var s=rK.parse(e,a.values[0]);r.push({stop:rE,color:s})}else if("to"===a.name){var s=rK.parse(e,a.values[0]);r.push({stop:rj,color:s})}else if("color-stop"===a.name){var i=a.values.filter(ry);if(2===i.length){var s=rK.parse(e,i[1]),o=i[0];rm(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:s})}}}}),1===n?{angle:(t+rM(180))%rM(360),stops:r,type:n}:{size:3,shape:0,stops:r,position:[],type:n}}},ni={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A.filter(function(e){var A;return ry(e)&&(20!==(A=e).type||"none"!==A.value)&&(18!==A.type||!!ns[A.name])}).map(function(A){return na.parse(e,A)})}},no={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(rB(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},nl={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return rb(A).map(function(e){return e.filter(rF)}).map(rU)}},nc={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return rb(A).map(function(e){return e.filter(rB).map(function(e){return e.value}).join(" ")}).map(nu)}},nu=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(a||(a={}));var nd={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return rb(A).map(function(e){return e.filter(np)})}},np=function(e){return rB(e)||rF(e)},nh=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ng=nh("top"),nf=nh("right"),nm=nh("bottom"),nB=nh("left"),nw=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return rU(A.filter(rF))}}},nv=nw("top-left"),nx=nw("top-right"),ny=nw("bottom-right"),nb=nw("bottom-left"),nC=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},nQ=nC("top"),nF=nC("right"),nU=nC("bottom"),nE=nC("left"),nk=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,A){return rf(A)?A.number:0}}},nj=nk("top"),nI=nk("right"),nH=nk("bottom"),nS=nk("left"),nN={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nL={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){return+("rtl"===A)}},nD={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(rB).reduce(function(e,A){return e|nT(A.value)},0)}},nT=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 0x1000000;case"inline-block":return 0x2000000;case"inline-list-item":return 0x4000000;case"inline-table":return 0x8000000;case"inline-flex":return 0x10000000;case"inline-grid":return 0x20000000}return 0},nM={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},nK={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return 20===A.type&&"normal"===A.value?0:17===A.type||15===A.type?A.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(s||(s={}));var nP={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"strict"===A?s.STRICT:s.NORMAL}},nR={name:"line-height",initialValue:"normal",prefix:!1,type:4},nO=function(e,A){return rB(e)&&"normal"===e.value?1.2*A:17===e.type?A*e.number:rF(e)?rH(e,A):A},nV={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return 20===A.type&&"none"===A.value?null:na.parse(e,A)}},nG={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){return+("inside"!==A)}},nz={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return -1}}},nq=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},nW=nq("top"),nJ=nq("right"),nX=nq("bottom"),n_=nq("left"),nY={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.filter(rB).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},n$={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"break-word"===A?"break-word":"normal"}},nZ=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},n0=nZ("top"),n1=nZ("right"),n2=nZ("bottom"),n4=nZ("left"),n3={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},n5={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},n6={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&rv(A[0],"none")?[]:rb(A).map(function(A){for(var t={color:rX.TRANSPARENT,offsetX:rE,offsetY:rE,blur:rE},r=0,n=0;n1)],this.overflowWrap=ak(e,n$,A.overflowWrap),this.paddingTop=ak(e,n0,A.paddingTop),this.paddingRight=ak(e,n1,A.paddingRight),this.paddingBottom=ak(e,n2,A.paddingBottom),this.paddingLeft=ak(e,n4,A.paddingLeft),this.paintOrder=ak(e,ab,A.paintOrder),this.position=ak(e,n5,A.position),this.textAlign=ak(e,n3,A.textAlign),this.textDecorationColor=ak(e,ao,null!=(t=A.textDecorationColor)?t:A.color),this.textDecorationLine=ak(e,al,null!=(r=A.textDecorationLine)?r:A.textDecoration),this.textShadow=ak(e,n6,A.textShadow),this.textTransform=ak(e,n8,A.textTransform),this.transform=ak(e,n9,A.transform),this.transformOrigin=ak(e,at,A.transformOrigin),this.visibility=ak(e,ar,A.visibility),this.webkitTextStrokeColor=ak(e,aC,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=ak(e,aQ,A.webkitTextStrokeWidth),this.wordBreak=ak(e,an,A.wordBreak),this.zIndex=ak(e,aa,A.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return rP(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ag(this.display,4)||ag(this.display,0x2000000)||ag(this.display,0x10000000)||ag(this.display,0x20000000)||ag(this.display,0x4000000)||ag(this.display,0x8000000)},e}(),aU=function(e,A){this.content=ak(e,af,A.content),this.quotes=ak(e,av,A.quotes)},aE=function(e,A){this.counterIncrement=ak(e,am,A.counterIncrement),this.counterReset=ak(e,aB,A.counterReset)},ak=function(e,A,t){var r=new rh,n=null!=t?t.toString():A.initialValue;r.write(n);var a=new rg(r.read());switch(A.type){case 2:var s=a.parseComponentValue();return A.parse(e,rB(s)?s.value:A.initialValue);case 0:return A.parse(e,a.parseComponentValue());case 1:return A.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(A.format){case"angle":return rL.parse(e,a.parseComponentValue());case"color":return rK.parse(e,a.parseComponentValue());case"image":return na.parse(e,a.parseComponentValue());case"length":var i=a.parseComponentValue();return rQ(i)?i:rE;case"length-percentage":var o=a.parseComponentValue();return rF(o)?o:rE;case"time":return as.parse(e,a.parseComponentValue())}}},aj=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},aI=function(e,A){var t=aj(e);return 1===t||A===t},aH=function(e,A){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,aI(A,3),this.styles=new aF(e,window.getComputedStyle(A,null)),sK(A)&&(this.styles.animationDuration.some(function(e){return e>0})&&(A.style.animationDuration="0s"),null!==this.styles.transform&&(A.style.transform="none")),this.bounds=td(this.context,A),aI(A,4)&&(this.flags|=16)},aS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aN="undefined"==typeof Uint8Array?[]:new Uint8Array(256),aL=0;aL>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&a;return l},aT=function(e){for(var A=e.length,t=[],r=0;r=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e>11),A=this.index[A]+(e>>5&63),A=((A=this.index[A])<<2)+(31&e),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),aO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aV="undefined"==typeof Uint8Array?[]:new Uint8Array(256),aG=0;aG=55296&&n<=56319&&t>10)+55296,s%1024+56320)),(n+1===t||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},aW=function(e,A){var t,r,n=aD(e),a=Array.isArray(n)?aM(n):new Uint32Array(n),s=Array.isArray(n)?aT(n):new Uint16Array(n),i=aP(s,12,a[4]/2),o=2===a[5]?aP(s,(24+a[4])/2):(t=Math.ceil((24+a[4])/4),a.slice?a.slice(t,void 0):new Uint32Array(Array.prototype.slice.call(a,t,r)));return new aR(a[0],a[1],a[2],a[3],i,o)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),aJ=function(e){return aW.get(e)},aX=function(e,A,t){var r=t-2,n=A[r],a=A[t-1],s=A[t];if(2===a&&3===s)return"\xd7";if(2===a||3===a||4===a||2===s||3===s||4===s)return"\xf7";if(8===a&&-1!==[8,9,11,12].indexOf(s)||(11===a||9===a)&&(9===s||10===s)||(12===a||10===a)&&10===s||13===s||5===s||7===s||1===a)return"\xd7";if(13===a&&14===s){for(;5===n;)n=A[--r];if(14===n)return"\xd7"}if(15===a&&15===s){for(var i=0;15===n;)i++,n=A[--r];if(i%2==0)return"\xd7"}return"\xf7"},a_=function(e){var A=az(e),t=A.length,r=0,n=0,a=A.map(aJ);return{next:function(){if(r>=t)return{done:!0,value:null};for(var e="\xd7";rs.x||n.y>s.y;return s=n,0===A||i});return e.body.removeChild(A),i},a0=function(e){var A=new Image,t=e.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;A.src="data:image/svg+xml,";try{r.drawImage(A,0,0),t.toDataURL()}catch(e){return!1}return!0},a1=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},a2=function(e){var A=e.createElement("canvas");A.width=100,A.height=100;var t=A.getContext("2d");if(!t)return Promise.reject(!1);t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var r=new Image,n=A.toDataURL();r.src=n;var a=a4(100,100,0,0,r);return t.fillStyle="red",t.fillRect(0,0,100,100),a3(a).then(function(A){t.drawImage(A,0,0);var r=t.getImageData(0,0,100,100).data;t.fillStyle="red",t.fillRect(0,0,100,100);var a=e.createElement("div");return a.style.backgroundImage="url("+n+")",a.style.height="100px",a1(r)?a3(a4(100,100,0,0,a)):Promise.reject(!1)}).then(function(e){return t.drawImage(e,0,0),a1(t.getImageData(0,0,100,100).data)}).catch(function(){return!1})},a4=function(e,A,t,r,n){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg"),i=document.createElementNS(a,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",A.toString()),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",r.toString()),i.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(i),i.appendChild(n),s},a3=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){return A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},a5={get SUPPORT_RANGE_BOUNDS(){var a6=a$(document);return Object.defineProperty(a5,"SUPPORT_RANGE_BOUNDS",{value:a6}),a6},get SUPPORT_WORD_BREAKING(){var a8=a5.SUPPORT_RANGE_BOUNDS&&aZ(document);return Object.defineProperty(a5,"SUPPORT_WORD_BREAKING",{value:a8}),a8},get SUPPORT_SVG_DRAWING(){var a9=a0(document);return Object.defineProperty(a5,"SUPPORT_SVG_DRAWING",{value:a9}),a9},get SUPPORT_FOREIGNOBJECT_DRAWING(){var a7="function"==typeof Array.from&&"function"==typeof window.fetch?a2(document):Promise.resolve(!1);return Object.defineProperty(a5,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:a7}),a7},get SUPPORT_CORS_IMAGES(){var se=void 0!==new Image().crossOrigin;return Object.defineProperty(a5,"SUPPORT_CORS_IMAGES",{value:se}),se},get SUPPORT_RESPONSE_TYPE(){var sA="string"==typeof new XMLHttpRequest().responseType;return Object.defineProperty(a5,"SUPPORT_RESPONSE_TYPE",{value:sA}),sA},get SUPPORT_CORS_XHR(){var st="withCredentials"in new XMLHttpRequest;return Object.defineProperty(a5,"SUPPORT_CORS_XHR",{value:st}),st},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var sr=!!("undefined"!=typeof Intl&&Intl.Segmenter);return Object.defineProperty(a5,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:sr}),sr}},sn=function(e,A){this.text=e,this.bounds=A},sa=function(e,A,t,r){var n=sl(A,t),a=[],s=0;return n.forEach(function(A){if(t.textDecorationLine.length||A.trim().length>0)if(a5.SUPPORT_RANGE_BOUNDS){var n=si(r,s,A.length).getClientRects();if(n.length>1){var i=so(A),o=0;i.forEach(function(A){a.push(new sn(A,tu.fromDOMRectList(e,si(r,o+s,A.length).getClientRects()))),o+=A.length})}else a.push(new sn(A,tu.fromDOMRectList(e,n)))}else{var l=r.splitText(A.length);a.push(new sn(A,ss(e,r))),r=l}else a5.SUPPORT_RANGE_BOUNDS||(r=r.splitText(A.length));s+=A.length}),a},ss=function(e,A){var t=A.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var n=A.parentNode;if(n){n.replaceChild(r,A);var a=td(e,r);return r.firstChild&&n.replaceChild(r.firstChild,r),a}}return tu.EMPTY},si=function(e,A,t){var r=e.ownerDocument;if(!r)throw Error("Node has no owner document");var n=r.createRange();return n.setStart(e,A),n.setEnd(e,A+t),n},so=function(e){return a5.SUPPORT_NATIVE_TEXT_SEGMENTATION?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)).map(function(e){return e.segment}):aY(e)},sl=function(e,A){return 0!==A.letterSpacing?so(e):a5.SUPPORT_NATIVE_TEXT_SEGMENTATION?Array.from(new Intl.Segmenter(void 0,{granularity:"word"}).segment(e)).map(function(e){return e.segment}):su(e,A)},sc=[32,160,4961,65792,65793,4153,4241],su=function(e,A){for(var t,r=tq(e,{lineBreak:A.lineBreak,wordBreak:"break-word"===A.overflowWrap?"break-word":A.wordBreak}),n=[];!(t=r.next()).done;)if(t.value){var a=th(t.value.slice()),s="";a.forEach(function(e){-1===sc.indexOf(e)?s+=tg(e):(s.length&&n.push(s),n.push(tg(e)),s="")}),s.length&&n.push(s)}return n},sd=function(e,A,t){this.text=sp(A.data,t.textTransform),this.textBounds=sa(e,this.text,t,A)},sp=function(e,A){switch(A){case 1:return e.toLowerCase();case 3:return e.replace(sh,sg);case 2:return e.toUpperCase();default:return e}},sh=/(^|\s|:|-|\(|\))([a-z])/g,sg=function(e,A,t){return e.length>0?A+t.toUpperCase():e},sf=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.src=t.currentSrc||t.src,r.intrinsicWidth=t.naturalWidth,r.intrinsicHeight=t.naturalHeight,r.context.cache.addImage(r.src),r}return ts(A,e),A}(aH),sm=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.canvas=t,r.intrinsicWidth=t.width,r.intrinsicHeight=t.height,r}return ts(A,e),A}(aH),sB=function(e){function A(A,t){var r=e.call(this,A,t)||this,n=new XMLSerializer,a=td(A,t);return t.setAttribute("width",a.width+"px"),t.setAttribute("height",a.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(t)),r.intrinsicWidth=t.width.baseVal.value,r.intrinsicHeight=t.height.baseVal.value,r.context.cache.addImage(r.svg),r}return ts(A,e),A}(aH),sw=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.value=t.value,r}return ts(A,e),A}(aH),sv=function(e){function A(A,t){var r=e.call(this,A,t)||this;return r.start=t.start,r.reversed="boolean"==typeof t.reversed&&!0===t.reversed,r}return ts(A,e),A}(aH),sx=[{type:15,flags:0,unit:"px",number:3}],sy=[{type:16,flags:0,number:50}],sb=function(e){var A=e.type===sF?Array(e.value.length+1).join("•"):e.value;return 0===A.length?e.placeholder||"":A},sC="checkbox",sQ="radio",sF="password",sU=function(e){function A(A,t){var r,n=e.call(this,A,t)||this;switch(n.type=t.type.toLowerCase(),n.checked=t.checked,n.value=sb(t),(n.type===sC||n.type===sQ)&&(n.styles.backgroundColor=0xdededeff,n.styles.borderTopColor=n.styles.borderRightColor=n.styles.borderBottomColor=n.styles.borderLeftColor=0xa5a5a5ff,n.styles.borderTopWidth=n.styles.borderRightWidth=n.styles.borderBottomWidth=n.styles.borderLeftWidth=1,n.styles.borderTopStyle=n.styles.borderRightStyle=n.styles.borderBottomStyle=n.styles.borderLeftStyle=1,n.styles.backgroundClip=[0],n.styles.backgroundOrigin=[0],n.bounds=(r=n.bounds).width>r.height?new tu(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width0)t.textNodes.push(new sd(e,n,t.styles));else if(sM(n))if(sZ(n)&&n.assignedNodes)n.assignedNodes().forEach(function(A){return sH(e,A,t,r)});else{var s=sS(e,n);s.styles.isVisible()&&(sL(n,s,r)?s.flags|=4:sD(s.styles)&&(s.flags|=2),-1!==sI.indexOf(n.tagName)&&(s.flags|=8),t.elements.push(s),n.slot,n.shadowRoot?sH(e,n.shadowRoot,s,r):sY(n)||sG(n)||s$(n)||sH(e,n,s,r))}},sS=function(e,A){return sJ(A)?new sf(e,A):sq(A)?new sm(e,A):sG(A)?new sB(e,A):sR(A)?new sw(e,A):sO(A)?new sv(e,A):sV(A)?new sU(e,A):s$(A)?new sE(e,A):sY(A)?new sk(e,A):sX(A)?new sj(e,A):new aH(e,A)},sN=function(e,A){var t=sS(e,A);return t.flags|=4,sH(e,A,t,t),t},sL=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||sz(e)&&t.styles.isTransparent()},sD=function(e){return e.isPositioned()||e.isFloating()},sT=function(e){return e.nodeType===Node.TEXT_NODE},sM=function(e){return e.nodeType===Node.ELEMENT_NODE},sK=function(e){return sM(e)&&void 0!==e.style&&!sP(e)},sP=function(e){return"object"==typeof e.className},sR=function(e){return"LI"===e.tagName},sO=function(e){return"OL"===e.tagName},sV=function(e){return"INPUT"===e.tagName},sG=function(e){return"svg"===e.tagName},sz=function(e){return"BODY"===e.tagName},sq=function(e){return"CANVAS"===e.tagName},sW=function(e){return"VIDEO"===e.tagName},sJ=function(e){return"IMG"===e.tagName},sX=function(e){return"IFRAME"===e.tagName},s_=function(e){return"STYLE"===e.tagName},sY=function(e){return"TEXTAREA"===e.tagName},s$=function(e){return"SELECT"===e.tagName},sZ=function(e){return"SLOT"===e.tagName},s0=function(e){return e.tagName.indexOf("-")>0},s1=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var A=this.counters[e];return A&&A.length?A[A.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var A=this;e.forEach(function(e){return A.counters[e].pop()})},e.prototype.parse=function(e){var A=this,t=e.counterIncrement,r=e.counterReset,n=!0;null!==t&&t.forEach(function(e){var t=A.counters[e.counter];t&&0!==e.increment&&(n=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=e.increment)});var a=[];return n&&r.forEach(function(e){var t=A.counters[e.counter];a.push(e.counter),t||(t=A.counters[e.counter]=[]),t.push(e.reset)}),a},e}(),s2={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},s4={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},s3={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},s5={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},s6=function(e,A,t,r,n,a){return et?is(e,n,a.length>0):r.integers.reduce(function(A,t,n){for(;e>=t;)e-=t,A+=r.values[n];return A},"")+a},s8=function(e,A,t,r){var n="";do!t&&e--,n=r(e)+n,e/=A;while(e*A>=A);return n},s9=function(e,A,t,r,n){var a=t-A+1;return(e<0?"-":"")+(s8(Math.abs(e),a,r,function(e){return tg(Math.floor(e%a)+A)})+n)},s7=function(e,A,t){void 0===t&&(t=". ");var r=A.length;return s8(Math.abs(e),r,!1,function(e){return A[Math.floor(e%r)]})+t},ie=function(e,A,t,r,n,a){if(e<-9999||e>9999)return is(e,4,n.length>0);var s=Math.abs(e),i=n;if(0===s)return A[0]+i;for(var o=0;s>0&&o<=4;o++){var l=s%10;0===l&&ag(a,1)&&""!==i?i=A[l]+i:l>1||1===l&&0===o||1===l&&1===o&&ag(a,2)||1===l&&1===o&&ag(a,4)&&e>100||1===l&&o>1&&ag(a,8)?i=A[l]+(o>0?t[o-1]:"")+i:1===l&&o>0&&(i=t[o-1]+i),s=Math.floor(s/10)}return(e<0?r:"")+i},iA="十百千萬",it="拾佰仟萬",ir="マイナス",ia="마이너스",is=function(e,A,t){var r=t?". ":"",n=t?"、":"",a=t?", ":"",s=t?" ":"";switch(A){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var i=s9(e,48,57,!0,r);return i.length<4?"0"+i:i;case 4:return s7(e,"〇一二三四五六七八九",n);case 6:return s6(e,1,3999,s2,3,r).toLowerCase();case 7:return s6(e,1,3999,s2,3,r);case 8:return s9(e,945,969,!1,r);case 9:return s9(e,97,122,!1,r);case 10:return s9(e,65,90,!1,r);case 11:return s9(e,1632,1641,!0,r);case 12:case 49:return s6(e,1,9999,s4,3,r);case 35:return s6(e,1,9999,s4,3,r).toLowerCase();case 13:return s9(e,2534,2543,!0,r);case 14:case 30:return s9(e,6112,6121,!0,r);case 15:return s7(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return s7(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return ie(e,"零一二三四五六七八九",iA,"負",n,14);case 47:return ie(e,"零壹貳參肆伍陸柒捌玖",it,"負",n,15);case 42:return ie(e,"零一二三四五六七八九",iA,"负",n,14);case 41:return ie(e,"零壹贰叁肆伍陆柒捌玖",it,"负",n,15);case 26:return ie(e,"〇一二三四五六七八九","十百千万",ir,n,0);case 25:return ie(e,"零壱弐参四伍六七八九","拾百千万",ir,n,7);case 31:return ie(e,"영일이삼사오육칠팔구","십백천만",ia,a,7);case 33:return ie(e,"零一二三四五六七八九","十百千萬",ia,a,0);case 32:return ie(e,"零壹貳參四五六七八九","拾百千",ia,a,7);case 18:return s9(e,2406,2415,!0,r);case 20:return s6(e,1,19999,s5,3,r);case 21:return s9(e,2790,2799,!0,r);case 22:return s9(e,2662,2671,!0,r);case 22:return s6(e,1,10999,s3,3,r);case 23:return s7(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return s7(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return s9(e,3302,3311,!0,r);case 28:return s7(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return s7(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return s9(e,3792,3801,!0,r);case 37:return s9(e,6160,6169,!0,r);case 38:return s9(e,4160,4169,!0,r);case 39:return s9(e,2918,2927,!0,r);case 40:return s9(e,1776,1785,!0,r);case 43:return s9(e,3046,3055,!0,r);case 44:return s9(e,3174,3183,!0,r);case 45:return s9(e,3664,3673,!0,r);case 46:return s9(e,3872,3881,!0,r);default:return s9(e,48,57,!0,r)}},ii="data-html2canvas-ignore",io=function(){function e(e,A,t){if(this.context=e,this.options=t,this.scrolledElements=[],this.referenceElement=A,this.counters=new s1,this.quoteDepth=0,!A.ownerDocument)throw Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,A){var t=this,r=il(e,A);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var n=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,s=r.contentWindow,i=s.document,o=id(r).then(function(){return to(t,void 0,void 0,function(){var e,t;return tl(this,function(n){switch(n.label){case 0:if(this.scrolledElements.forEach(iB),s&&(s.scrollTo(A.left,A.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(s.scrollY!==A.top||s.scrollX!==A.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-A.left,s.scrollY-A.top,0,0))),e=this.options.onclone,void 0===(t=this.clonedReferenceElement))return[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")];if(!(i.fonts&&i.fonts.ready))return[3,2];return[4,i.fonts.ready];case 1:n.sent(),n.label=2;case 2:if(!/(AppleWebKit)/g.test(navigator.userAgent))return[3,4];return[4,iu(i)];case 3:n.sent(),n.label=4;case 4:if("function"==typeof e)return[2,Promise.resolve().then(function(){return e(i,t)}).then(function(){return r})];return[2,r]}})})});return i.open(),i.write(ig(document.doctype)+""),im(this.referenceElement.ownerDocument,n,a),i.replaceChild(i.adoptNode(this.documentElement),i.documentElement),i.close(),o},e.prototype.createElementClone=function(e){if(aI(e,2),sq(e))return this.createCanvasClone(e);if(sW(e))return this.createVideoClone(e);if(s_(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return(sJ(A)&&(sJ(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),"lazy"===A.loading&&(A.loading="eager")),s0(A))?this.createCustomElementClone(A):A},e.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return ih(e.style,A),A},e.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var t=[].slice.call(A.cssRules,0).reduce(function(e,A){return A&&"string"==typeof A.cssText?e+A.cssText:e},""),r=e.cloneNode(!1);return r.textContent=t,r}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var A,t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(A){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var n=e.getContext("2d"),a=r.getContext("2d");if(a)if(!this.options.allowTaint&&n)a.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var s=null!=(A=e.getContext("webgl2"))?A:e.getContext("webgl");if(s){var i=s.getContextAttributes();(null==i?void 0:i.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext("2d");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,A,t){sM(A)&&("SCRIPT"===A.tagName||A.hasAttribute(ii)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(A))||this.options.copyStyles&&sM(A)&&s_(A)||e.appendChild(this.cloneNode(A,t))},e.prototype.cloneChildNodes=function(e,A,t){for(var r=this,n=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;n;n=n.nextSibling)if(sM(n)&&sZ(n)&&"function"==typeof n.assignedNodes){var a=n.assignedNodes();a.length&&a.forEach(function(e){return r.appendChildNode(A,e,t)})}else this.appendChildNode(A,n,t)},e.prototype.cloneNode=function(e,A){if(sT(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&sM(e)&&(sK(e)||sP(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var n=t.getComputedStyle(e),a=t.getComputedStyle(e,":before"),s=t.getComputedStyle(e,":after");this.referenceElement===e&&sK(r)&&(this.clonedReferenceElement=r),sz(r)&&iy(r);var i=this.counters.parse(new aE(this.context,n)),l=this.resolvePseudoContent(e,r,a,o.BEFORE);s0(e)&&(A=!0),sW(e)||this.cloneChildNodes(e,r,A),l&&r.insertBefore(l,r.firstChild);var c=this.resolvePseudoContent(e,r,s,o.AFTER);return c&&r.appendChild(c),this.counters.pop(i),(n&&(this.options.copyStyles||sP(e))&&!sX(e)||A)&&ih(n,r),(0!==e.scrollTop||0!==e.scrollLeft)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(sY(e)||s$(e))&&(sY(r)||s$(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,A,t,r){var n=this;if(t){var a=t.content,s=A.ownerDocument;if(s&&a&&"none"!==a&&"-moz-alt-content"!==a&&"none"!==t.display){this.counters.parse(new aE(this.context,t));var i=new aU(this.context,t),l=s.createElement("html2canvaspseudoelement");ih(t,l),i.content.forEach(function(A){if(0===A.type)l.appendChild(s.createTextNode(A.value));else if(22===A.type){var t=s.createElement("img");t.src=A.value,t.style.opacity="1",l.appendChild(t)}else if(18===A.type){if("attr"===A.name){var r=A.values.filter(rB);r.length&&l.appendChild(s.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===A.name){var a=A.values.filter(ry),o=a[0],c=a[1];if(o&&rB(o)){var u=n.counters.getCounterValue(o.value),d=c&&rB(c)?nz.parse(n.context,c.value):3;l.appendChild(s.createTextNode(is(u,d,!1)))}}else if("counters"===A.name){var p=A.values.filter(ry),o=p[0],h=p[1],c=p[2];if(o&&rB(o)){var g=n.counters.getCounterValues(o.value),f=c&&rB(c)?nz.parse(n.context,c.value):3,m=h&&0===h.type?h.value:"",B=g.map(function(e){return is(e,f,!1)}).join(m);l.appendChild(s.createTextNode(B))}}}else if(20===A.type)switch(A.value){case"open-quote":l.appendChild(s.createTextNode(ax(i.quotes,n.quoteDepth++,!0)));break;case"close-quote":l.appendChild(s.createTextNode(ax(i.quotes,--n.quoteDepth,!1)));break;default:l.appendChild(s.createTextNode(A.value))}}),l.className=iw+" "+iv;var c=r===o.BEFORE?" "+iw:" "+iv;return sP(A)?A.className.baseValue+=c:A.className+=c,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(o||(o={}));var il=function(e,A){var t=e.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute(ii,"true"),e.body.appendChild(t),t},ic=function(e){return new Promise(function(A){if(e.complete||!e.src)return void A();e.onload=A,e.onerror=A})},iu=function(e){return Promise.all([].slice.call(e.images,0).map(ic))},id=function(e){return new Promise(function(A,t){var r=e.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var t=setInterval(function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),A(e))},50)}})},ip=["all","d","content"],ih=function(e,A){for(var t=e.length-1;t>=0;t--){var r=e.item(t);-1===ip.indexOf(r)&&A.style.setProperty(r,e.getPropertyValue(r))}return A},ig=function(e){var A="";return e&&(A+=""),A},im=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},iB=function(e){var A=e[0],t=e[1],r=e[2];A.scrollLeft=t,A.scrollTop=r},iw="___html2canvas___pseudoelement_before",iv="___html2canvas___pseudoelement_after",ix='{\n content: "" !important;\n display: none !important;\n}',iy=function(e){ib(e,"."+iw+":before"+ix+"\n ."+iv+":after"+ix)},ib=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},iC=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),iQ=function(){function e(e,A){this.context=e,this._options=A,this._cache={}}return e.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(iH(e)||ik(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return to(this,void 0,void 0,function(){var A,t,r,n,a=this;return tl(this,function(s){switch(s.label){case 0:if(A=iC.isSameOrigin(e),t=!ij(e)&&!0===this._options.useCORS&&a5.SUPPORT_CORS_IMAGES&&!A,r=!ij(e)&&!A&&!iH(e)&&"string"==typeof this._options.proxy&&a5.SUPPORT_CORS_XHR&&!t,!A&&!1===this._options.allowTaint&&!ij(e)&&!iH(e)&&!r&&!t)return[2];if(n=e,!r)return[3,2];return[4,this.proxy(n)];case 1:n=s.sent(),s.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,A){var r=new Image;r.onload=function(){return e(r)},r.onerror=A,(iI(n)||t)&&(r.crossOrigin="anonymous"),r.src=n,!0===r.complete&&setTimeout(function(){return e(r)},500),a._options.imageTimeout>0&&setTimeout(function(){return A("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,s.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var A=this,t=this._options.proxy;if(!t)throw Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(n,a){var s=a5.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=function(){if(200===i.status)if("text"===s)n(i.response);else{var e=new FileReader;e.addEventListener("load",function(){return n(e.result)},!1),e.addEventListener("error",function(e){return a(e)},!1),e.readAsDataURL(i.response)}else a("Failed to proxy resource "+r+" with status code "+i.status)},i.onerror=a;var o=t.indexOf("?")>-1?"&":"?";if(i.open("GET",""+t+o+"url="+encodeURIComponent(e)+"&responseType="+s),"text"!==s&&i instanceof XMLHttpRequest&&(i.responseType=s),A._options.imageTimeout){var l=A._options.imageTimeout;i.timeout=l,i.ontimeout=function(){return a("Timed out ("+l+"ms) proxying "+r)}}i.send()})},e}(),iF=/^data:image\/svg\+xml/i,iU=/^data:image\/.*;base64,/i,iE=/^data:image\/.*/i,ik=function(e){return a5.SUPPORT_SVG_DRAWING||!iS(e)},ij=function(e){return iE.test(e)},iI=function(e){return iU.test(e)},iH=function(e){return"blob"===e.substr(0,4)},iS=function(e){return"svg"===e.substr(-3).toLowerCase()||iF.test(e)},iN=function(){function e(e,A){this.type=0,this.x=e,this.y=A}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),iL=function(e,A,t){return new iN(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},iD=function(){function e(e,A,t,r){this.type=1,this.start=e,this.startControl=A,this.endControl=t,this.end=r}return e.prototype.subdivide=function(A,t){var r=iL(this.start,this.startControl,A),n=iL(this.startControl,this.endControl,A),a=iL(this.endControl,this.end,A),s=iL(r,n,A),i=iL(n,a,A),o=iL(s,i,A);return t?new e(this.start,r,s,o):new e(o,i,a,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),iT=function(e){return 1===e.type},iM=function(e){var A=e.styles,t=e.bounds,r=rI(A.borderTopLeftRadius,t.width,t.height),n=r[0],a=r[1],s=rI(A.borderTopRightRadius,t.width,t.height),i=s[0],o=s[1],c=rI(A.borderBottomRightRadius,t.width,t.height),u=c[0],d=c[1],p=rI(A.borderBottomLeftRadius,t.width,t.height),h=p[0],g=p[1],f=[];f.push((n+i)/t.width),f.push((h+u)/t.width),f.push((a+g)/t.height),f.push((o+d)/t.height);var m=Math.max.apply(Math,f);m>1&&(n/=m,a/=m,i/=m,o/=m,u/=m,d/=m,h/=m,g/=m);var B=t.width-i,w=t.height-d,v=t.width-u,x=t.height-g,y=A.borderTopWidth,b=A.borderRightWidth,C=A.borderBottomWidth,Q=A.borderLeftWidth,F=rH(A.paddingTop,e.bounds.width),U=rH(A.paddingRight,e.bounds.width),E=rH(A.paddingBottom,e.bounds.width),k=rH(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||a>0?iK(t.left+Q/3,t.top+y/3,n-Q/3,a-y/3,l.TOP_LEFT):new iN(t.left+Q/3,t.top+y/3),this.topRightBorderDoubleOuterBox=n>0||a>0?iK(t.left+B,t.top+y/3,i-b/3,o-y/3,l.TOP_RIGHT):new iN(t.left+t.width-b/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?iK(t.left+v,t.top+w,u-b/3,d-C/3,l.BOTTOM_RIGHT):new iN(t.left+t.width-b/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=h>0||g>0?iK(t.left+Q/3,t.top+x,h-Q/3,g-C/3,l.BOTTOM_LEFT):new iN(t.left+Q/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=n>0||a>0?iK(t.left+2*Q/3,t.top+2*y/3,n-2*Q/3,a-2*y/3,l.TOP_LEFT):new iN(t.left+2*Q/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=n>0||a>0?iK(t.left+B,t.top+2*y/3,i-2*b/3,o-2*y/3,l.TOP_RIGHT):new iN(t.left+t.width-2*b/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?iK(t.left+v,t.top+w,u-2*b/3,d-2*C/3,l.BOTTOM_RIGHT):new iN(t.left+t.width-2*b/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=h>0||g>0?iK(t.left+2*Q/3,t.top+x,h-2*Q/3,g-2*C/3,l.BOTTOM_LEFT):new iN(t.left+2*Q/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=n>0||a>0?iK(t.left+Q/2,t.top+y/2,n-Q/2,a-y/2,l.TOP_LEFT):new iN(t.left+Q/2,t.top+y/2),this.topRightBorderStroke=n>0||a>0?iK(t.left+B,t.top+y/2,i-b/2,o-y/2,l.TOP_RIGHT):new iN(t.left+t.width-b/2,t.top+y/2),this.bottomRightBorderStroke=u>0||d>0?iK(t.left+v,t.top+w,u-b/2,d-C/2,l.BOTTOM_RIGHT):new iN(t.left+t.width-b/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=h>0||g>0?iK(t.left+Q/2,t.top+x,h-Q/2,g-C/2,l.BOTTOM_LEFT):new iN(t.left+Q/2,t.top+t.height-C/2),this.topLeftBorderBox=n>0||a>0?iK(t.left,t.top,n,a,l.TOP_LEFT):new iN(t.left,t.top),this.topRightBorderBox=i>0||o>0?iK(t.left+B,t.top,i,o,l.TOP_RIGHT):new iN(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||d>0?iK(t.left+v,t.top+w,u,d,l.BOTTOM_RIGHT):new iN(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=h>0||g>0?iK(t.left,t.top+x,h,g,l.BOTTOM_LEFT):new iN(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||a>0?iK(t.left+Q,t.top+y,Math.max(0,n-Q),Math.max(0,a-y),l.TOP_LEFT):new iN(t.left+Q,t.top+y),this.topRightPaddingBox=i>0||o>0?iK(t.left+Math.min(B,t.width-b),t.top+y,B>t.width+b?0:Math.max(0,i-b),Math.max(0,o-y),l.TOP_RIGHT):new iN(t.left+t.width-b,t.top+y),this.bottomRightPaddingBox=u>0||d>0?iK(t.left+Math.min(v,t.width-Q),t.top+Math.min(w,t.height-C),Math.max(0,u-b),Math.max(0,d-C),l.BOTTOM_RIGHT):new iN(t.left+t.width-b,t.top+t.height-C),this.bottomLeftPaddingBox=h>0||g>0?iK(t.left+Q,t.top+Math.min(x,t.height-C),Math.max(0,h-Q),Math.max(0,g-C),l.BOTTOM_LEFT):new iN(t.left+Q,t.top+t.height-C),this.topLeftContentBox=n>0||a>0?iK(t.left+Q+k,t.top+y+F,Math.max(0,n-(Q+k)),Math.max(0,a-(y+F)),l.TOP_LEFT):new iN(t.left+Q+k,t.top+y+F),this.topRightContentBox=i>0||o>0?iK(t.left+Math.min(B,t.width+Q+k),t.top+y+F,B>t.width+Q+k?0:i-Q+k,o-(y+F),l.TOP_RIGHT):new iN(t.left+t.width-(b+U),t.top+y+F),this.bottomRightContentBox=u>0||d>0?iK(t.left+Math.min(v,t.width-(Q+k)),t.top+Math.min(w,t.height+y+F),Math.max(0,u-(b+U)),d-(C+E),l.BOTTOM_RIGHT):new iN(t.left+t.width-(b+U),t.top+t.height-(C+E)),this.bottomLeftContentBox=h>0||g>0?iK(t.left+Q+k,t.top+x,Math.max(0,h-(Q+k)),g-(C+E),l.BOTTOM_LEFT):new iN(t.left+Q+k,t.top+t.height-(C+E))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(l||(l={}));var iK=function(e,A,t,r,n){var a=(Math.sqrt(2)-1)/3*4,s=t*a,i=r*a,o=e+t,c=A+r;switch(n){case l.TOP_LEFT:return new iD(new iN(e,c),new iN(e,c-i),new iN(o-s,A),new iN(o,A));case l.TOP_RIGHT:return new iD(new iN(e,A),new iN(e+s,A),new iN(o,c-i),new iN(o,c));case l.BOTTOM_RIGHT:return new iD(new iN(o,A),new iN(o,A+i),new iN(e+s,c),new iN(e,c));case l.BOTTOM_LEFT:default:return new iD(new iN(o,c),new iN(o-s,c),new iN(e,A+i),new iN(e,A))}},iP=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},iR=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},iO=function(e,A,t){this.offsetX=e,this.offsetY=A,this.matrix=t,this.type=0,this.target=6},iV=function(e,A){this.path=e,this.target=A,this.type=1},iG=function(e){this.opacity=e,this.type=2,this.target=6},iz=function(e){return 1===e.type},iq=function(e,A){return e.length===A.length&&e.some(function(e,t){return e===A[t]})},iW=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},iJ=function(){function e(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new iM(this.container),this.container.styles.opacity<1&&this.effects.push(new iG(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new iO(t,r,n))}if(0!==this.container.styles.overflowX){var a=iP(this.curves),s=iR(this.curves);iq(a,s)?this.effects.push(new iV(a,6)):(this.effects.push(new iV(a,2)),this.effects.push(new iV(s,4)))}}return e.prototype.getEffects=function(e){for(var A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var n=t.effects.filter(function(e){return!iz(e)});if(A||0!==t.container.styles.position||!t.parent){if(r.unshift.apply(r,n),A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var a=iP(t.curves),s=iR(t.curves);iq(a,s)||r.unshift(new iV(s,6))}}else r.unshift.apply(r,n);t=t.parent}return r.filter(function(A){return ag(A.target,e)})},e}(),iX=function(e,A,t,r){e.container.elements.forEach(function(n){var a=ag(n.flags,4),s=ag(n.flags,2),i=new iJ(n,e);ag(n.styles.display,2048)&&r.push(i);var o=ag(n.flags,8)?[]:r;if(a||s){var l=a||n.styles.isPositioned()?t:A,c=new iW(i);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var d=0;l.negativeZIndex.some(function(e,A){if(u>e.element.container.styles.zIndex.order)d=A;else if(d>0)return!0;return!1}),l.negativeZIndex.splice(d,0,c)}else if(u>0){var p=0;l.positiveZIndex.some(function(e,A){if(u>=e.element.container.styles.zIndex.order)p=A+1;else if(p>0)return!0;return!1}),l.positiveZIndex.splice(p,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);iX(i,c,a?c:t,o)}else n.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),iX(i,A,t,o);ag(n.flags,8)&&i_(n,o)})},i_=function(e,A){for(var t=e instanceof sv?e.start:1,r=e instanceof sv&&e.reversed,n=0;n0&&e.intrinsicHeight>0){var r=i5(e),n=iR(A);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return to(this,void 0,void 0,function(){var t,r,n,a,s,i,o,l,c,u,d,p,h,g,f,m,B,w;return tl(this,function(v){switch(v.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,n=t.styles,a=0,s=t.textNodes,v.label=1;case 1:if(!(a0&&u>0&&(d=r.ctx.createPattern(v,"repeat"),r.renderRepeat(i,d,o,l))):2===t.type&&(i=(b=i6(e,A,[null,null,null]))[0],C=b[1],Q=b[2],c=b[3],u=b[4],o=rH((F=0===t.position.length?[rk]:t.position)[0],c),l=rH(F[F.length-1],u),E=(U=r3(t,o,l,c,u))[0],k=U[1],E>0&&k>0&&(j=r.ctx.createRadialGradient(C+o,Q+l,0,C+o,Q+l,E),rZ(t.stops,2*E).forEach(function(e){return j.addColorStop(e.stop,rR(e.color))}),r.path(i),r.ctx.fillStyle=j,E!==k?(I=e.bounds.left+.5*e.bounds.width,H=e.bounds.top+.5*e.bounds.height,N=1/(S=k/E),r.ctx.save(),r.ctx.translate(I,H),r.ctx.transform(1,0,0,S,0,0),r.ctx.translate(-I,-H),r.ctx.fillRect(C,N*(Q-H)+H,c,u*N),r.ctx.restore()):r.ctx.fill())),L.label=6;case 6:return A--,[2]}})},r=this,n=0,a=e.styles.backgroundImage.slice(0).reverse(),i.label=1;case 1:if(!(n0))return[3,11];if(2!==o.style)return[3,5];return[4,this.renderDashedDottedBorder(o.color,o.width,a,e.curves,2)];case 4:case 6:case 8:return c.sent(),[3,11];case 5:if(3!==o.style)return[3,7];return[4,this.renderDashedDottedBorder(o.color,o.width,a,e.curves,3)];case 7:if(4!==o.style)return[3,9];return[4,this.renderDoubleBorder(o.color,o.width,a,e.curves)];case 9:return[4,this.renderSolidBorder(o.color,a,e.curves)];case 10:c.sent(),c.label=11;case 11:a++,c.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,A,t,r,n){return to(this,void 0,void 0,function(){var a,s,i,o,l,c,u,d,p,h,g,f,m,B,w,v;return tl(this,function(x){return this.ctx.save(),a=i1(r,t),s=i$(r,t),2===n&&(this.path(s),this.ctx.clip()),iT(s[0])?(i=s[0].start.x,o=s[0].start.y):(i=s[0].x,o=s[0].y),iT(s[1])?(l=s[1].end.x,c=s[1].end.y):(l=s[1].x,c=s[1].y),u=0===t||2===t?Math.abs(i-l):Math.abs(o-c),this.ctx.beginPath(),3===n?this.formatPath(a):this.formatPath(s.slice(0,2)),d=A<3?3*A:2*A,p=A<3?2*A:A,3===n&&(d=A,p=A),h=!0,u<=2*d?h=!1:u<=2*d+p?(g=u/(2*d+p),d*=g,p*=g):(f=Math.floor((u+p)/(d+p)),m=(u-f*d)/(f-1),p=(B=(u-(f+1)*d)/f)<=0||Math.abs(p-m)setTimeout(()=>A(Error("html2canvas timeout after 4 seconds")),4e3))]),d=document.createElement("canvas");d.width=r,d.height=n;let p=d.getContext("2d");if(!p)return y.v.error("Failed to get canvas context"),null;p.drawImage(u,0,0,r,n);let h=d.toDataURL("image/jpeg",a),g=Math.ceil(3*h.length/4)/1024;if(g>250){y.v.warn(`Screenshot too large: ${g.toFixed(0)}KB, trying with lower quality`);let e=d.toDataURL("image/jpeg",.6),A=Math.ceil(3*e.length/4)/1024;return A>250&&y.v.warn(`Screenshot still too large: ${A.toFixed(0)}KB`),e}return h}catch(e){return y.v.error("Failed to capture screenshot:",e),null}}let om={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%"}},oB=(0,p.forwardRef)(({projectId:e,refreshTrigger:A,onFocusSelection:t,hasFocusTarget:r=!1,onClose:n},a)=>{let[s,i]=(0,p.useState)(null),[o,l]=(0,p.useState)("/"),[c,u]=(0,p.useState)(!0),[h,g]=(0,p.useState)(null),[f,B]=(0,p.useState)("tablet"),[w,v]=(0,p.useState)(["/"]),[x,b]=(0,p.useState)(0),[C,F]=(0,p.useState)(!1),[U,E]=(0,p.useState)(!1),k=(0,p.useMemo)(()=>U?{backgroundColor:"var(--button-preview-active)",color:"white"}:r?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},[U,r]),j=(0,p.useRef)(null),I=(0,p.useRef)(null),H=(0,p.useRef)(null),S=(0,p.useRef)("/"),L=(0,p.useRef)(null),D=(0,p.useRef)(!1);(0,p.useImperativeHandle)(a,()=>({captureScreenshot:async()=>j.current&&C?await of(j.current):(y.v.warn("Cannot capture screenshot: iframe not ready"),null)}),[C]);let T=(0,p.useCallback)(e=>{if(j.current&&j.current.contentWindow)try{j.current.contentWindow.postMessage(e,"*")}catch(e){y.v.warn("Failed to communicate with preview iframe",e)}},[]),M=(0,p.useRef)(!1),K=(0,p.useRef)(null),R=(0,p.useRef)(null),O=(0,p.useRef)(null),V=()=>(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,d.jsx)(P.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),n?(0,d.jsxs)("button",{type:"button",onClick:n,"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,d.jsx)(P.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(P.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]});(0,p.useEffect)(()=>{H.current=s},[s]),(0,p.useEffect)(()=>{D.current=U,C&&T({type:"selector-toggle",active:U})},[U,C,T]),(0,p.useEffect)(()=>{let e=j.current;if(!e)return;let A=()=>{T({type:"selector-toggle",active:D.current})};return e.addEventListener("load",A),()=>{e.removeEventListener("load",A)}},[C,T]),(0,p.useEffect)(()=>{S.current=o},[o]),(0,p.useEffect)(()=>{if(C&&L.current&&H.current){let e=L.current;L.current=null,W(e,H.current)}},[C]),(0,p.useEffect)(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);let G=(0,p.useCallback)(async(A=!1,t=!0)=>{t&&u(!0),g(null);try{await m.vfs.init();let t=A?S.current:null;I.current&&I.current.cleanupBlobUrls();let r=new A5.B(m.vfs,e);I.current=r;let n=await r.compileProject();i(n),H.current=n;let a=t;a||(a=n.blobUrls.has("/index.html")?"/":n.entryPoint||(n.routes.length>0?n.routes[0].path:"/")),W(a,n)}catch(e){g(e instanceof Error?e.message:"Failed to compile project"),y.v.error("Compilation error:",e)}finally{t&&u(!1)}},[e]),z=(0,p.useCallback)((e=!1,A=!0)=>{if(M.current){let t=K.current;K.current={preserve:(t?.preserve??!1)||e,showLoading:(t?.showLoading??!1)||A};return}(async(e,A)=>{M.current=!0;try{await G(e,A)}finally{M.current=!1;let e=K.current;K.current=null,e&&z(e.preserve,e.showLoading)}})(e,A)},[G]),q=(0,p.useCallback)((e=!1,A=!1)=>{let t=O.current;O.current={preserve:(t?.preserve??!1)||e,showLoading:(t?.showLoading??!1)||A},R.current&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>{let e=O.current;O.current=null,R.current=null,e&&z(e.preserve,e.showLoading)},150)},[z]);(0,p.useEffect)(()=>{z()},[e,A,z]),(0,p.useEffect)(()=>{let A=()=>{q(!0)},t=A=>{A.detail&&A.detail.projectId!==e||q(!0)};return window.addEventListener("filesChanged",A),window.addEventListener("fileContentChanged",t),()=>{window.removeEventListener("filesChanged",A),window.removeEventListener("fileContentChanged",t)}},[e,q]);let W=(e,A)=>{let t,r=A||H.current||s;if(!r)return void y.v.warn("No compiled project available");if(D.current?E(!1):T({type:"selector-toggle",active:!1}),!j.current||!C){L.current=e;return}let n=e;n.startsWith("/")||(n="/"+n);let a=r.routes.find(e=>e.path===n);t=a?a.file:"/"===n?"/index.html":n.endsWith("/")?n+"index.html":n+".html";let i=r.files.find(e=>e.path===t);if(!i&&!n.endsWith("/")){let e=n+"/index.html";(i=r.files.find(A=>A.path===e))&&(t=e)}if(!i){g(`Page not found: ${e}`),r.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&W("/",A);return}let o="string"==typeof i.content?i.content:new TextDecoder().decode(i.content);o=(o=(o=o.replace(/href="([^"]+)"/g,(e,A)=>{if(!A.endsWith(".css")||A.startsWith("http")||A.startsWith("//"))return e;let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`href="${n}"`:e})).replace(/src="([^"]+)"/g,(e,A)=>{if(!A.endsWith(".js")||A.startsWith("http")||A.startsWith("//"))return e;let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`src="${n}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,A)=>{let t=A.startsWith("/")?A:"/"+A,n=r.blobUrls.get(t);return n?`src="${n}"`:e});let c=` - `;o.includes("")?o=o.replace("",c+""):o+=c,j.current.srcdoc=o,l(n),S.current=n,b(e=>(v(A=>[...A.slice(0,e+1),n]),e+1))},J=(0,p.useCallback)(e=>{W(e)},[s]),X=()=>{if(x>0){let e=x-1;b(e),W(w[e])}},_=()=>{if(x{W("/")},$=()=>{z(!0,!1)};return((0,p.useEffect)(()=>{let e=e=>{let A=e.data;if(A&&"object"==typeof A){if("navigate"===A.type&&A.path)return void J(A.path);if("selector-selection"===A.type&&A.payload){E(!1),t?.(A.payload);return}"selector-cancelled"===A.type&&E(!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[J,t]),(0,p.useEffect)(()=>()=>{I.current&&I.current.cleanupBlobUrls()},[]),c)?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"text-center space-y-2",children:[(0,d.jsx)(A6.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,d.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):h?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,d.jsx)("p",{className:"font-medium",children:"Error"}),(0,d.jsx)("p",{className:"text-sm mt-2",children:h}),(0,d.jsx)(Q.$,{onClick:$,className:"mt-4",children:"Try Again"})]})})]}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:X,disabled:0===x,children:(0,d.jsx)(A8,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:_,disabled:x>=w.length-1,children:(0,d.jsx)(A9,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,d.jsx)(A7,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:$,children:(0,d.jsx)(A6.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>E(e=>!e),disabled:!C,style:k,title:U?"Cancel element selection":r?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,d.jsx)(te,{className:"h-3 w-3"})})]}),s&&s.routes.length>1&&(0,d.jsxs)(tn.l6,{value:o,onValueChange:J,children:[(0,d.jsx)(tn.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,d.jsx)(tn.yv,{className:"truncate"})}),(0,d.jsx)(tn.gC,{children:s.routes.map(e=>(0,d.jsx)(tn.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,d.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:X,disabled:0===x,children:(0,d.jsx)(A8,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:_,disabled:x>=w.length-1,children:(0,d.jsx)(A9,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,d.jsx)(A7,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:$,children:(0,d.jsx)(A6.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>E(e=>!e),disabled:!C,style:{backgroundColor:U?"var(--button-preview-active)":void 0,color:U?"white":void 0},title:U?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,d.jsx)(te,{className:"h-3 w-3"})})]}),(0,d.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:o}),s&&s.routes.length>1&&(0,d.jsxs)(tn.l6,{value:o,onValueChange:J,children:[(0,d.jsx)(tn.bq,{className:"w-[200px] h-8",children:(0,d.jsx)(tn.yv,{})}),(0,d.jsx)(tn.gC,{children:s.routes.map(e=>(0,d.jsx)(tn.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===f?"var(--button-preview-active)":void 0,color:"mobile"===f?"white":void 0},onClick:()=>B("mobile"),children:(0,d.jsx)(tA,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===f?"var(--button-preview-active)":void 0,color:"tablet"===f?"white":void 0},onClick:()=>B("tablet"),children:(0,d.jsx)(tt,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===f?"var(--button-preview-active)":void 0,color:"desktop"===f?"white":void 0},onClick:()=>B("desktop"),children:(0,d.jsx)(tr,{className:"h-3 w-3"})})]})]}),(0,d.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,d.jsx)("div",{className:(0,y.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==f&&"rounded-lg"),style:{width:om[f].width||"100%",height:om[f].height||"100%",maxHeight:om[f].maxHeight||"100%",maxWidth:om[f].maxWidth||"100%"},children:(0,d.jsx)("iframe",{ref:e=>{j.current=e,e&&!C?setTimeout(()=>{F(!0)},0):!e&&C&&F(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})});oB.displayName="MultipagePreview";let ow=g().memo(oB),ov={rE:"1.14.0"};var ox="Dialog",[oy,ob]=(0,eo.A)(ox),[oC,oQ]=oy(ox),oF=e=>{let{__scopeDialog:A,children:t,open:r,defaultOpen:n,onOpenChange:a,modal:s=!0}=e,i=p.useRef(null),o=p.useRef(null),[l,c]=(0,el.i)({prop:r,defaultProp:n??!1,onChange:a,caller:ox});return(0,d.jsx)(oC,{scope:A,triggerRef:i,contentRef:o,contentId:(0,ef.B)(),titleId:(0,ef.B)(),descriptionId:(0,ef.B)(),open:l,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(e=>!e),[c]),modal:s,children:t})};oF.displayName=ox;var oU="DialogTrigger";p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oU,t),a=(0,ei.s)(A,n.triggerRef);return(0,d.jsx)(ec.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":oW(n.open),...r,ref:a,onClick:(0,es.mK)(e.onClick,n.onOpenToggle)})}).displayName=oU;var oE="DialogPortal",[ok,oj]=oy(oE,{forceMount:void 0}),oI=e=>{let{__scopeDialog:A,forceMount:t,children:r,container:n}=e,a=oQ(oE,A);return(0,d.jsx)(ok,{scope:A,forceMount:t,children:p.Children.map(r,e=>(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:e})}))})};oI.displayName=oE;var oH="DialogOverlay",oS=p.forwardRef((e,A)=>{let t=oj(oH,e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=oQ(oH,e.__scopeDialog);return a.modal?(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(oL,{...n,ref:A})}):null});oS.displayName=oH;var oN=(0,eT.TL)("DialogOverlay.RemoveScroll"),oL=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oH,t);return(0,d.jsx)(eK.A,{as:oN,allowPinchZoom:!0,shards:[n.contentRef],children:(0,d.jsx)(ec.sG.div,{"data-state":oW(n.open),...r,ref:A,style:{pointerEvents:"auto",...r.style}})})}),oD="DialogContent",oT=p.forwardRef((e,A)=>{let t=oj(oD,e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=oQ(oD,e.__scopeDialog);return(0,d.jsx)(ew.C,{present:r||a.open,children:a.modal?(0,d.jsx)(oM,{...n,ref:A}):(0,d.jsx)(oK,{...n,ref:A})})});oT.displayName=oD;var oM=p.forwardRef((e,A)=>{let t=oQ(oD,e.__scopeDialog),r=p.useRef(null),n=(0,ei.s)(A,t.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return(0,eM.Eq)(e)},[]),(0,d.jsx)(oP,{...e,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,es.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:(0,es.mK)(e.onPointerDownOutside,e=>{let A=e.detail.originalEvent,t=0===A.button&&!0===A.ctrlKey;(2===A.button||t)&&e.preventDefault()}),onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>e.preventDefault())})}),oK=p.forwardRef((e,A)=>{let t=oQ(oD,e.__scopeDialog),r=p.useRef(!1),n=p.useRef(!1);return(0,d.jsx)(oP,{...e,ref:A,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:A=>{e.onCloseAutoFocus?.(A),A.defaultPrevented||(r.current||t.triggerRef.current?.focus(),A.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:A=>{e.onInteractOutside?.(A),A.defaultPrevented||(r.current=!0,"pointerdown"===A.detail.originalEvent.type&&(n.current=!0));let a=A.target;t.triggerRef.current?.contains(a)&&A.preventDefault(),"focusin"===A.detail.originalEvent.type&&n.current&&A.preventDefault()}})}),oP=p.forwardRef((e,A)=>{let{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,...s}=e,i=oQ(oD,t),o=p.useRef(null),l=(0,ei.s)(A,o);return(0,eh.Oh)(),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eg.n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:(0,d.jsx)(ep.qW,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":oW(i.open),...s,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(oY,{titleId:i.titleId}),(0,d.jsx)(o$,{contentRef:o,descriptionId:i.descriptionId})]})]})}),oR="DialogTitle",oO=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oR,t);return(0,d.jsx)(ec.sG.h2,{id:n.titleId,...r,ref:A})});oO.displayName=oR;var oV="DialogDescription",oG=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oV,t);return(0,d.jsx)(ec.sG.p,{id:n.descriptionId,...r,ref:A})});oG.displayName=oV;var oz="DialogClose",oq=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oz,t);return(0,d.jsx)(ec.sG.button,{type:"button",...r,ref:A,onClick:(0,es.mK)(e.onClick,()=>n.onOpenChange(!1))})});function oW(e){return e?"open":"closed"}oq.displayName=oz;var oJ="DialogTitleWarning",[oX,o_]=(0,eo.q)(oJ,{contentName:oD,titleName:oR,docsSlug:"dialog"}),oY=({titleId:e})=>{let A=o_(oJ),t=`\`${A.contentName}\` requires a \`${A.titleName}\` for the component to be accessible for screen reader users. + `;o.includes("")?o=o.replace("",c+""):o+=c,j.current.srcdoc=o,l(n),S.current=n,b(e=>(v(A=>[...A.slice(0,e+1),n]),e+1))},J=(0,p.useCallback)(e=>{W(e)},[s]),X=()=>{if(x>0){let e=x-1;b(e),W(w[e])}},_=()=>{if(x{W("/")},$=()=>{z(!0,!1)};return((0,p.useEffect)(()=>{let e=e=>{let A=e.data;if(A&&"object"==typeof A){if("navigate"===A.type&&A.path)return void J(A.path);if("selector-selection"===A.type&&A.payload){E(!1),t?.(A.payload);return}"selector-cancelled"===A.type&&E(!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[J,t]),(0,p.useEffect)(()=>()=>{I.current&&I.current.cleanupBlobUrls()},[]),c)?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"text-center space-y-2",children:[(0,d.jsx)(A6.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,d.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):h?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,d.jsx)("p",{className:"font-medium",children:"Error"}),(0,d.jsx)("p",{className:"text-sm mt-2",children:h}),(0,d.jsx)(Q.$,{onClick:$,className:"mt-4",children:"Try Again"})]})})]}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(V,{}),(0,d.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:X,disabled:0===x,children:(0,d.jsx)(A8,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:_,disabled:x>=w.length-1,children:(0,d.jsx)(A9,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,d.jsx)(A7,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:$,children:(0,d.jsx)(A6.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>E(e=>!e),disabled:!C,style:k,title:U?"Cancel element selection":r?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,d.jsx)(te,{className:"h-3 w-3"})})]}),s&&s.routes.length>1&&(0,d.jsxs)(tn.l6,{value:o,onValueChange:J,children:[(0,d.jsx)(tn.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,d.jsx)(tn.yv,{className:"truncate"})}),(0,d.jsx)(tn.gC,{children:s.routes.map(e=>(0,d.jsx)(tn.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,d.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:X,disabled:0===x,children:(0,d.jsx)(A8,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:_,disabled:x>=w.length-1,children:(0,d.jsx)(A9,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,d.jsx)(A7,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:$,children:(0,d.jsx)(A6.A,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>E(e=>!e),disabled:!C,style:{backgroundColor:U?"var(--button-preview-active)":void 0,color:U?"white":void 0},title:U?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,d.jsx)(te,{className:"h-3 w-3"})})]}),(0,d.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:o}),s&&s.routes.length>1&&(0,d.jsxs)(tn.l6,{value:o,onValueChange:J,children:[(0,d.jsx)(tn.bq,{className:"w-[200px] h-8",children:(0,d.jsx)(tn.yv,{})}),(0,d.jsx)(tn.gC,{children:s.routes.map(e=>(0,d.jsx)(tn.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===f?"var(--button-preview-active)":void 0,color:"mobile"===f?"white":void 0},onClick:()=>B("mobile"),children:(0,d.jsx)(tA,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===f?"var(--button-preview-active)":void 0,color:"tablet"===f?"white":void 0},onClick:()=>B("tablet"),children:(0,d.jsx)(tt,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===f?"var(--button-preview-active)":void 0,color:"desktop"===f?"white":void 0},onClick:()=>B("desktop"),children:(0,d.jsx)(tr,{className:"h-3 w-3"})})]})]}),(0,d.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,d.jsx)("div",{className:(0,y.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==f&&"rounded-lg"),style:{width:om[f].width||"100%",height:om[f].height||"100%",maxHeight:om[f].maxHeight||"100%",maxWidth:om[f].maxWidth||"100%"},children:(0,d.jsx)("iframe",{ref:e=>{j.current=e,e&&!C?setTimeout(()=>{F(!0)},0):!e&&C&&F(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})});oB.displayName="MultipagePreview";let ow=g().memo(oB),ov={rE:"1.14.1"};var ox="Dialog",[oy,ob]=(0,eo.A)(ox),[oC,oQ]=oy(ox),oF=e=>{let{__scopeDialog:A,children:t,open:r,defaultOpen:n,onOpenChange:a,modal:s=!0}=e,i=p.useRef(null),o=p.useRef(null),[l,c]=(0,el.i)({prop:r,defaultProp:n??!1,onChange:a,caller:ox});return(0,d.jsx)(oC,{scope:A,triggerRef:i,contentRef:o,contentId:(0,ef.B)(),titleId:(0,ef.B)(),descriptionId:(0,ef.B)(),open:l,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(e=>!e),[c]),modal:s,children:t})};oF.displayName=ox;var oU="DialogTrigger";p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oU,t),a=(0,ei.s)(A,n.triggerRef);return(0,d.jsx)(ec.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":oW(n.open),...r,ref:a,onClick:(0,es.mK)(e.onClick,n.onOpenToggle)})}).displayName=oU;var oE="DialogPortal",[ok,oj]=oy(oE,{forceMount:void 0}),oI=e=>{let{__scopeDialog:A,forceMount:t,children:r,container:n}=e,a=oQ(oE,A);return(0,d.jsx)(ok,{scope:A,forceMount:t,children:p.Children.map(r,e=>(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:e})}))})};oI.displayName=oE;var oH="DialogOverlay",oS=p.forwardRef((e,A)=>{let t=oj(oH,e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=oQ(oH,e.__scopeDialog);return a.modal?(0,d.jsx)(ew.C,{present:r||a.open,children:(0,d.jsx)(oL,{...n,ref:A})}):null});oS.displayName=oH;var oN=(0,eT.TL)("DialogOverlay.RemoveScroll"),oL=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oH,t);return(0,d.jsx)(eK.A,{as:oN,allowPinchZoom:!0,shards:[n.contentRef],children:(0,d.jsx)(ec.sG.div,{"data-state":oW(n.open),...r,ref:A,style:{pointerEvents:"auto",...r.style}})})}),oD="DialogContent",oT=p.forwardRef((e,A)=>{let t=oj(oD,e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=oQ(oD,e.__scopeDialog);return(0,d.jsx)(ew.C,{present:r||a.open,children:a.modal?(0,d.jsx)(oM,{...n,ref:A}):(0,d.jsx)(oK,{...n,ref:A})})});oT.displayName=oD;var oM=p.forwardRef((e,A)=>{let t=oQ(oD,e.__scopeDialog),r=p.useRef(null),n=(0,ei.s)(A,t.contentRef,r);return p.useEffect(()=>{let e=r.current;if(e)return(0,eM.Eq)(e)},[]),(0,d.jsx)(oP,{...e,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,es.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:(0,es.mK)(e.onPointerDownOutside,e=>{let A=e.detail.originalEvent,t=0===A.button&&!0===A.ctrlKey;(2===A.button||t)&&e.preventDefault()}),onFocusOutside:(0,es.mK)(e.onFocusOutside,e=>e.preventDefault())})}),oK=p.forwardRef((e,A)=>{let t=oQ(oD,e.__scopeDialog),r=p.useRef(!1),n=p.useRef(!1);return(0,d.jsx)(oP,{...e,ref:A,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:A=>{e.onCloseAutoFocus?.(A),A.defaultPrevented||(r.current||t.triggerRef.current?.focus(),A.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:A=>{e.onInteractOutside?.(A),A.defaultPrevented||(r.current=!0,"pointerdown"===A.detail.originalEvent.type&&(n.current=!0));let a=A.target;t.triggerRef.current?.contains(a)&&A.preventDefault(),"focusin"===A.detail.originalEvent.type&&n.current&&A.preventDefault()}})}),oP=p.forwardRef((e,A)=>{let{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,...s}=e,i=oQ(oD,t),o=p.useRef(null),l=(0,ei.s)(A,o);return(0,eh.Oh)(),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eg.n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:(0,d.jsx)(ep.qW,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":oW(i.open),...s,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(oY,{titleId:i.titleId}),(0,d.jsx)(o$,{contentRef:o,descriptionId:i.descriptionId})]})]})}),oR="DialogTitle",oO=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oR,t);return(0,d.jsx)(ec.sG.h2,{id:n.titleId,...r,ref:A})});oO.displayName=oR;var oV="DialogDescription",oG=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oV,t);return(0,d.jsx)(ec.sG.p,{id:n.descriptionId,...r,ref:A})});oG.displayName=oV;var oz="DialogClose",oq=p.forwardRef((e,A)=>{let{__scopeDialog:t,...r}=e,n=oQ(oz,t);return(0,d.jsx)(ec.sG.button,{type:"button",...r,ref:A,onClick:(0,es.mK)(e.onClick,()=>n.onOpenChange(!1))})});function oW(e){return e?"open":"closed"}oq.displayName=oz;var oJ="DialogTitleWarning",[oX,o_]=(0,eo.q)(oJ,{contentName:oD,titleName:oR,docsSlug:"dialog"}),oY=({titleId:e})=>{let A=o_(oJ),t=`\`${A.contentName}\` requires a \`${A.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${A.titleName}\`, you can wrap it with our VisuallyHidden component. @@ -3253,8 +3253,8 @@ document.addEventListener('DOMContentLoaded', () => { "message": "Start building your website!" }`}]};var lf=t(2623);async function lm(e,A,t,r){await lf.$.runWithSuppressedDirty(A,async()=>{for(let r of t.directories)await e.createDirectory(A,r);for(let r of t.files){let t=r.content;if(r.isBase64){let e=atob(r.content),A=new Uint8Array(e.length);for(let t=0;t0)for(let t of r)try{let r=await fetch(`${window.location.origin}/${t.filename}`);if(r.ok){let n=await r.arrayBuffer();await e.createFile(A,t.path,n)}}catch(e){}})}let lB=[{id:"blank",name:"Blank",description:"Minimal starting template with basic HTML/CSS/JS structure",isBuiltIn:!0,updatedAt:new Date("2025-01-01T00:00:00Z"),metadata:{author:"OSW Studio",tags:["starter","basic"]}},{id:"demo",name:"Example Studios",description:"Multi-page agency portfolio showcasing modern web development",isBuiltIn:!0,updatedAt:new Date("2025-01-01T00:00:00Z"),metadata:{author:"OSW Studio",tags:["portfolio","multi-page","example"]}}];var lw=t(5516),lv=t(4950),lx=t(3721),ly=t(8853),lb="Switch",[lC,lQ]=(0,eo.A)(lb),[lF,lU]=lC(lb),lE=p.forwardRef((e,A)=>{let{__scopeSwitch:t,name:r,checked:n,defaultChecked:a,required:s,disabled:i,value:o="on",onCheckedChange:l,form:c,...u}=e,[h,g]=p.useState(null),f=(0,ei.s)(A,e=>g(e)),m=p.useRef(!1),B=!h||c||!!h.closest("form"),[w,v]=(0,el.i)({prop:n,defaultProp:a??!1,onChange:l,caller:lb});return(0,d.jsxs)(lF,{scope:t,checked:w,disabled:i,children:[(0,d.jsx)(ec.sG.button,{type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":lH(w),"data-disabled":i?"":void 0,disabled:i,value:o,...u,ref:f,onClick:(0,es.mK)(e.onClick,e=>{v(e=>!e),B&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),B&&(0,d.jsx)(lI,{control:h,bubbles:!m.current,name:r,value:o,checked:w,required:s,disabled:i,form:c,style:{transform:"translateX(-100%)"}})]})});lE.displayName=lb;var lk="SwitchThumb",lj=p.forwardRef((e,A)=>{let{__scopeSwitch:t,...r}=e,n=lU(lk,t);return(0,d.jsx)(ec.sG.span,{"data-state":lH(n.checked),"data-disabled":n.disabled?"":void 0,...r,ref:A})});lj.displayName=lk;var lI=p.forwardRef(({__scopeSwitch:e,control:A,checked:t,bubbles:r=!0,...n},a)=>{let s=p.useRef(null),i=(0,ei.s)(s,a),o=(0,lx.Z)(t),l=(0,ly.X)(A);return p.useEffect(()=>{let e=s.current;if(!e)return;let A=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==t&&A){let n=new Event("click",{bubbles:r});A.call(e,t),e.dispatchEvent(n)}},[o,t,r]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...n,tabIndex:-1,ref:i,style:{...n.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function lH(e){return e?"checked":"unchecked"}function lS({className:e,...A}){return(0,d.jsx)(lE,{"data-slot":"switch",className:(0,y.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),...A,children:(0,d.jsx)(lj,{"data-slot":"switch-thumb",className:(0,y.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")})})}lI.displayName="SwitchBubbleInput";var lN=t(218);let lL=(0,E.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var lD=t(5891);let lT=(0,E.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"}]]),lM=(0,E.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var lK=t(6884);class lP{static{this.BACKUP_VERSION="1.9.0"}static{this.FILE_EXTENSION=".osws"}static{this.MAX_IMPORT_SIZE=0x6400000}static async exportAllData(){try{y.v.info("Starting data export...");let e={version:this.BACKUP_VERSION,exportDate:new Date().toISOString(),databases:{vfs:await this.exportUnifiedData(),conversations:[],checkpoints:[]},metadata:{projectCount:0,totalSize:0,exportedFrom:"oswstudio"}};e.metadata.projectCount=e.databases.vfs.projects.length,e.metadata.totalSize=this.calculateDataSize(e);let A=new(v());A.file("backup.json",JSON.stringify(e,null,2));let t=await A.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}}),r=`oswstudio-backup-${new Date().toISOString().split("T")[0]}${this.FILE_EXTENSION}`;this.downloadBlob(t,r),y.v.info(`Export completed: ${e.metadata.projectCount} projects, ${this.formatBytes(e.metadata.totalSize)}`)}catch(e){throw y.v.error("Export failed:",e),Error(`Export failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async importAllData(e,A={mode:"merge"}){try{if(!e.name.endsWith(this.FILE_EXTENSION))throw Error(`Invalid file type. Expected ${this.FILE_EXTENSION} file.`);if(e.size>this.MAX_IMPORT_SIZE)throw Error(`File too large. Maximum size is ${this.formatBytes(this.MAX_IMPORT_SIZE)}.`);A.onProgress?.(10,"Reading backup file...");let r=new(v()),n=(await r.loadAsync(e)).file("backup.json");if(!n)throw Error("Invalid backup file format.");let a=await n.async("string"),s=JSON.parse(a);if(this.validateBackupData(s),A.onProgress?.(30,"Validating backup data..."),"replace"===A.mode){A.onProgress?.(40,"Clearing existing data...");try{let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));e.db?.db&&(y.v.info("[Backup] Closing VFS database before deletion"),e.db.db.close())}catch(e){y.v.warn("[Backup] Could not close VFS database",e)}await this.clearAllData(),await new Promise(e=>setTimeout(e,500))}A.onProgress?.(50,"Importing all data...");let i={...s.databases.vfs,conversations:s.databases.vfs.conversations||s.databases.conversations||[],checkpoints:s.databases.vfs.checkpoints||s.databases.checkpoints||[]};await this.importUnifiedData(i),A.onProgress?.(100,"Import completed successfully!"),y.v.info(`Import completed: ${s.metadata.projectCount} projects restored`)}catch(e){throw y.v.error("Import failed:",e),Error(`Import failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async validateBackupFile(e){try{if(!e.name.endsWith(this.FILE_EXTENSION))return{valid:!1,reason:"Invalid file extension"};if(e.size>this.MAX_IMPORT_SIZE)return{valid:!1,reason:"File too large"};let A=new(v()),t=(await A.loadAsync(e)).file("backup.json");if(!t)return{valid:!1,reason:"Invalid backup file format"};let r=await t.async("string"),n=JSON.parse(r);return this.validateBackupData(n),{valid:!0,metadata:n.metadata}}catch(e){return{valid:!1,reason:e instanceof Error?e.message:"Unknown error"}}}static async exportUnifiedData(){let e={projects:[],files:[],fileTree:[],conversations:[],checkpoints:[]};return new Promise((A,t)=>{let r=indexedDB.open("osw-studio-db",1);r.onsuccess=async()=>{try{let t=r.result,n=t.transaction(["projects"],"readonly"),a=n.objectStore("projects").getAll();a.onsuccess=()=>{e.projects=a.result||[]};let s=t.transaction(["files"],"readonly"),i=s.objectStore("files").getAll();i.onsuccess=()=>{e.files=i.result||[]};let o=t.transaction(["fileTree"],"readonly"),l=o.objectStore("fileTree").getAll();l.onsuccess=()=>{e.fileTree=l.result||[]};let c=t.transaction(["conversations"],"readonly"),u=c.objectStore("conversations").getAll();u.onsuccess=()=>{e.conversations=u.result||[]};let d=t.transaction(["checkpoints"],"readonly"),p=d.objectStore("checkpoints").getAll();p.onsuccess=()=>{e.checkpoints=p.result||[]},await Promise.all([new Promise(e=>n.oncomplete=()=>e(void 0)),new Promise(e=>s.oncomplete=()=>e(void 0)),new Promise(e=>o.oncomplete=()=>e(void 0)),new Promise(e=>c.oncomplete=()=>e(void 0)),new Promise(e=>d.oncomplete=()=>e(void 0))]),A(e)}catch(e){t(e)}},r.onerror=()=>t(r.error)})}static async importLegacyConversations(){return new Promise(e=>{let A=indexedDB.open("DeepStudioConversations",1);A.onsuccess=()=>{let t=A.result.transaction(["conversations"],"readonly").objectStore("conversations").getAll();t.onsuccess=()=>{e(t.result||[])},t.onerror=()=>e([])},A.onerror=()=>e([])})}static async importLegacyCheckpoints(){return new Promise(e=>{let A=indexedDB.open("DeepStudioCheckpoints",1);A.onsuccess=()=>{let t=A.result.transaction(["checkpoints"],"readonly").objectStore("checkpoints").getAll();t.onsuccess=()=>{e(t.result||[])},t.onerror=()=>e([])},A.onerror=()=>e([])})}static async importUnifiedData(e){return new Promise((A,t)=>{y.v.info("[Import] Opening database for import...");let r=setTimeout(()=>{y.v.error("[Import] Database open timeout after 10s"),t(Error("Database open timeout"))},1e4),n=indexedDB.open("osw-studio-db",1);n.onerror=()=>{clearTimeout(r),y.v.error("[Import] Failed to open database for import",n.error),t(n.error)},n.onblocked=()=>{y.v.warn("[Import] Database open is blocked - waiting for connections to close")},n.onupgradeneeded=e=>{y.v.info("[Import] Creating database schema...");let A=e.target.result;if(!A.objectStoreNames.contains("projects")){let e=A.createObjectStore("projects",{keyPath:"id"});e.createIndex("name","name",{unique:!1}),e.createIndex("createdAt","createdAt",{unique:!1})}if(!A.objectStoreNames.contains("files")){let e=A.createObjectStore("files",{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("path",["projectId","path"],{unique:!0}),e.createIndex("type","type",{unique:!1})}if(!A.objectStoreNames.contains("fileTree")){let e=A.createObjectStore("fileTree",{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("path",["projectId","path"],{unique:!0}),e.createIndex("parentPath",["projectId","parentPath"],{unique:!1})}if(!A.objectStoreNames.contains("conversations")){let e=A.createObjectStore("conversations",{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("lastUpdated","lastUpdated",{unique:!1})}if(!A.objectStoreNames.contains("checkpoints")){let e=A.createObjectStore("checkpoints",{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}},n.onsuccess=async()=>{try{clearTimeout(r);let t=n.result;y.v.info("[Import] Database opened successfully"),y.v.info("[Import] Starting data import...",{projects:e.projects?.length||0,files:e.files?.length||0,fileTree:e.fileTree?.length||0,conversations:e.conversations?.length||0,checkpoints:e.checkpoints?.length||0});let a=t.transaction(["projects"],"readwrite").objectStore("projects");for(let A of e.projects||[])await new Promise((e,t)=>{let r=a.put(A);r.onsuccess=()=>e(),r.onerror=()=>{y.v.error("[Import] Failed to import project:",A.id,r.error),t(r.error)}});y.v.info("[Import] Projects imported");let s=t.transaction(["files"],"readwrite").objectStore("files");for(let A of e.files||[])await new Promise((e,t)=>{let r=s.put(A);r.onsuccess=()=>e(),r.onerror=()=>{y.v.error("[Import] Failed to import file:",A.path,r.error),t(r.error)}});y.v.info("[Import] Files imported");let i=t.transaction(["fileTree"],"readwrite").objectStore("fileTree");for(let A of e.fileTree||[])await new Promise((e,t)=>{let r=i.put(A);r.onsuccess=()=>e(),r.onerror=()=>{y.v.error("[Import] Failed to import tree node:",A.path,r.error),t(r.error)}});y.v.info("[Import] File tree imported");let o=e.conversations||[];if(o.length>0){y.v.info("[Import] Importing conversations:",o.length);let e=t.transaction(["conversations"],"readwrite").objectStore("conversations");for(let A of o)await new Promise((t,r)=>{let n=e.put(A);n.onsuccess=()=>t(),n.onerror=()=>{y.v.error("[Import] Failed to import conversation:",A.id,n.error),r(n.error)}});y.v.info("[Import] Conversations imported")}let l=e.checkpoints||[];if(l.length>0){y.v.info("[Import] Importing checkpoints:",l.length);let e=t.transaction(["checkpoints"],"readwrite").objectStore("checkpoints");for(let A of l)await new Promise((t,r)=>{let n=e.put(A);n.onsuccess=()=>t(),n.onerror=()=>{y.v.error("[Import] Failed to import checkpoint:",A.id,n.error),r(n.error)}});y.v.info("[Import] Checkpoints imported")}y.v.info("[Import] All data imported successfully"),A()}catch(e){t(e)}},n.onerror=()=>t(n.error)})}static async clearAllData(){for(let e of["osw-studio-db","osw-studio-vfs","OSWStudioConversations","OSWStudioCheckpoints","deepstudio-vfs","DeepStudioConversations","DeepStudioCheckpoints"])await new Promise(A=>{let t=setTimeout(()=>{y.v.warn(`[Backup] Database deletion timeout for: ${e}`),A()},2e3),r=indexedDB.deleteDatabase(e);r.onsuccess=()=>{clearTimeout(t),y.v.info(`[Backup] Deleted database: ${e}`),A()},r.onerror=()=>{clearTimeout(t),y.v.warn(`[Backup] Error deleting database: ${e}`,r.error),A()},r.onblocked=()=>{y.v.warn(`[Backup] Database deletion blocked: ${e}`)}});y.v.info("[Backup] All databases cleared")}static validateBackupData(e){if(!e.version||!e.exportDate||!e.databases||!e.metadata)throw Error("Invalid backup file structure");if(!e.databases.vfs||!e.databases.conversations||!e.databases.checkpoints)throw Error("Incomplete backup data");let A=e.version.split(".").map(Number),t=this.BACKUP_VERSION.split(".").map(Number);if(A[0]>t[0])throw Error(`Backup version ${e.version} is not compatible with current version ${this.BACKUP_VERSION}`)}static calculateDataSize(e){return JSON.stringify(e).length}static formatBytes(e){if(0===e)return"0 Bytes";let A=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,A)).toFixed(2))+" "+["Bytes","KB","MB","GB"][A]}static downloadBlob(e,A){let t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=A,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}var lR=t(6156),lO="Collapsible",[lV,lG]=(0,eo.A)(lO),[lz,lq]=lV(lO),lW=p.forwardRef((e,A)=>{let{__scopeCollapsible:t,open:r,defaultOpen:n,disabled:a,onOpenChange:s,...i}=e,[o,l]=(0,el.i)({prop:r,defaultProp:n??!1,onChange:s,caller:lO});return(0,d.jsx)(lz,{scope:t,disabled:a,contentId:(0,ef.B)(),open:o,onOpenToggle:p.useCallback(()=>l(e=>!e),[l]),children:(0,d.jsx)(ec.sG.div,{"data-state":lZ(o),"data-disabled":a?"":void 0,...i,ref:A})})});lW.displayName=lO;var lJ="CollapsibleTrigger",lX=p.forwardRef((e,A)=>{let{__scopeCollapsible:t,...r}=e,n=lq(lJ,t);return(0,d.jsx)(ec.sG.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":lZ(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:A,onClick:(0,es.mK)(e.onClick,n.onOpenToggle)})});lX.displayName=lJ;var l_="CollapsibleContent",lY=p.forwardRef((e,A)=>{let{forceMount:t,...r}=e,n=lq(l_,e.__scopeCollapsible);return(0,d.jsx)(ew.C,{present:t||n.open,children:({present:e})=>(0,d.jsx)(l$,{...r,ref:A,present:e})})});lY.displayName=l_;var l$=p.forwardRef((e,A)=>{let{__scopeCollapsible:t,present:r,children:n,...a}=e,s=lq(l_,t),[i,o]=p.useState(r),l=p.useRef(null),c=(0,ei.s)(A,l),u=p.useRef(0),h=u.current,g=p.useRef(0),f=g.current,m=s.open||i,B=p.useRef(m),w=p.useRef(void 0);return p.useEffect(()=>{let e=requestAnimationFrame(()=>B.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,lR.N)(()=>{let e=l.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let A=e.getBoundingClientRect();u.current=A.height,g.current=A.width,B.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),o(r)}},[s.open,r]),(0,d.jsx)(ec.sG.div,{"data-state":lZ(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...a,ref:c,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":f?`${f}px`:void 0,...e.style},children:m&&n})});function lZ(e){return e?"open":"closed"}function l0({...e}){return(0,d.jsx)(lW,{"data-slot":"collapsible",...e})}function l1({...e}){return(0,d.jsx)(lX,{"data-slot":"collapsible-trigger",...e})}function l2({...e}){return(0,d.jsx)(lY,{"data-slot":"collapsible-content",...e})}function l4({onClose:e}){let[A,t]=(0,p.useState)({}),[r,n]=(0,p.useState)({}),{theme:a,setTheme:s}=(0,lN.D)(),[i,o]=(0,p.useState)(!1),[l,c]=(0,p.useState)(!1),[u,h]=(0,p.useState)(!1),[g,f]=(0,p.useState)(!1),[m,B]=(0,p.useState)(0),[w,v]=(0,p.useState)(""),[x,y]=(0,p.useState)({application:!0,costTracking:!1,dataManagement:!1}),b=(e,A)=>{lv.s.setSetting(e,A),t(t=>({...t,[e]:A}))},C=async()=>{try{h(!0),await lP.exportAllData(),A4.oR.success("Data exported successfully!")}catch(e){A4.oR.error(e instanceof Error?e.message:"Export failed")}finally{h(!1)}},U=e=>{y(A=>({...A,[e]:!A[e]}))};return(0,d.jsxs)("div",{className:"max-h-[calc(100vh-4rem)] overflow-y-auto",children:[(0,d.jsxs)("div",{className:"space-y-3 pb-4",children:[(0,d.jsxs)(l0,{open:x.application,onOpenChange:()=>U("application"),children:[(0,d.jsxs)(l1,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(lL,{className:"h-4 w-4"}),(0,d.jsx)("h4",{className:"font-medium text-sm",children:"Application Settings"})]}),(0,d.jsx)(lD.A,{className:`h-4 w-4 transition-transform duration-200 ${x.application?"rotate-180":""}`})]}),(0,d.jsxs)(l2,{className:"px-3 pt-2 pb-3",children:[(0,d.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Configure your preferences and display options"}),(0,d.jsx)("div",{className:"space-y-4",children:(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"theme",children:"Theme"}),(0,d.jsxs)(tn.l6,{value:i?a:"dark",onValueChange:e=>{s(e),b("theme",e)},children:[(0,d.jsx)(tn.bq,{id:"theme",className:"mt-2",children:(0,d.jsx)(tn.yv,{})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsx)(tn.eb,{value:"light",children:"Light"}),(0,d.jsx)(tn.eb,{value:"dark",children:"Dark"}),(0,d.jsx)(tn.eb,{value:"system",children:"System"})]})]})]})})]})]}),(0,d.jsxs)(l0,{open:x.costTracking,onOpenChange:()=>U("costTracking"),children:[(0,d.jsxs)(l1,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(M,{className:"h-4 w-4"}),(0,d.jsx)("h4",{className:"font-medium text-sm",children:"Cost Tracking"})]}),(0,d.jsx)(lD.A,{className:`h-4 w-4 transition-transform duration-200 ${x.costTracking?"rotate-180":""}`})]}),(0,d.jsx)(l2,{className:"px-3 pt-2 pb-3",children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"show-costs",children:"Display Costs"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Show cost information in messages"})]}),(0,d.jsx)(lS,{id:"show-costs",checked:!1!==r.showCosts,onCheckedChange:e=>{let A={...r,showCosts:e};lv.s.setCostSettings(A),n(A)}})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"daily-limit",children:"Daily Cost Limit (USD)"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,d.jsx)(F.p,{id:"daily-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:r.dailyLimit||"",onChange:e=>{let A=e.target.value?parseFloat(e.target.value):void 0,t={...r,dailyLimit:A};lv.s.setCostSettings(t),n(t)}}),r.dailyLimit&&(0,d.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",r.dailyLimit.toFixed(2),"/day"]})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"project-limit",children:"Project Cost Limit (USD)"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,d.jsx)(F.p,{id:"project-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:r.projectLimit||"",onChange:e=>{let A=e.target.value?parseFloat(e.target.value):void 0,t={...r,projectLimit:A};lv.s.setCostSettings(t),n(t)}}),r.projectLimit&&(0,d.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",r.projectLimit.toFixed(2),"/project"]})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"warning-threshold",children:"Warning Threshold (%)"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,d.jsx)(F.p,{id:"warning-threshold",type:"number",min:"50",max:"100",step:"5",value:r.warningThreshold||80,onChange:e=>{let A=parseInt(e.target.value),t={...r,warningThreshold:A};lv.s.setCostSettings(t),n(t)}}),(0,d.jsxs)("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[(0,d.jsx)(lT,{className:"h-3 w-3"}),"Warn at ",r.warningThreshold||80,"%"]})]})]}),(0,d.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Lifetime Total"}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:lK.U.formatCost(lv.s.getLifetimeCosts().total)})]}),(0,d.jsx)(Q.$,{variant:"outline",size:"sm",onClick:()=>{confirm("Reset lifetime cost tracking? This cannot be undone.")&&(lv.s.resetLifetimeCosts(),A4.oR.success("Lifetime costs reset"))},children:"Reset Stats"})]})})]})})]}),(0,d.jsxs)(l0,{open:x.dataManagement,onOpenChange:()=>U("dataManagement"),children:[(0,d.jsxs)(l1,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(lM,{className:"h-4 w-4"}),(0,d.jsx)("h4",{className:"font-medium text-sm",children:"Data Management"})]}),(0,d.jsx)(lD.A,{className:`h-4 w-4 transition-transform duration-200 ${x.dataManagement?"rotate-180":""}`})]}),(0,d.jsxs)(l2,{className:"px-3 pt-2 pb-3",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Backup and restore your projects, conversations, and settings. Use this to migrate your data to OSWStudio or create backups."}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Export All Data"}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"Download a backup file containing all your projects and data"})]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:C,disabled:u,className:"flex items-center gap-2",children:[(0,d.jsx)(V,{className:"h-4 w-4"}),u?"Exporting...":"Export"]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Import Data"}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"Restore from a .osws backup file"})]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>{let e=document.createElement("input");e.type="file",e.accept=".osws",e.onchange=async e=>{let A=e.target.files?.[0];if(A)try{f(!0),B(0),v("Validating file...");let e=await lP.validateBackupFile(A);if(!e.valid)return void A4.oR.error(`Invalid backup file: ${e.reason}`);let t=confirm(`Import ${e.metadata?.projectCount||0} projects? -Choose OK to REPLACE all current data, or Cancel to MERGE with existing data.`);await lP.importAllData(A,{mode:t?"replace":"merge",onProgress:(e,A)=>{B(e),v(A)}}),A4.oR.success("Data imported successfully!"),setTimeout(()=>window.location.reload(),1e3)}catch(e){A4.oR.error(e instanceof Error?e.message:"Import failed")}finally{f(!1),B(0),v("")}},e.click()},disabled:g,className:"flex items-center gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),g?"Importing...":"Import"]})]}),g&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,d.jsx)("span",{children:w}),(0,d.jsxs)("span",{children:[m,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]})]})]})]})]}),(0,d.jsxs)("div",{className:"flex justify-between pt-4 px-3 border-t mt-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(Q.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(lv.s.clearSettings(),t({}),A4.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,d.jsxs)(Q.$,{variant:"outline",onClick:()=>c(!0),children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]})]}),e&&(0,d.jsx)(Q.$,{onClick:e,children:"Close"})]}),(0,d.jsx)(lA,{open:l,onOpenChange:c})]})}let l3=[{id:"welcome",title:"Welcome to Open Source Web Studio",body:(0,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,d.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,d.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,d.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,d.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var l5=t(4742);let l6=(0,p.createContext)(null);function l8({children:e}){let[A,t]=(0,p.useState)("idle"),[r,n]=(0,p.useState)(0),[a,s]=(0,p.useState)(0),[i,o]=(0,p.useState)([]),[l,c]=(0,p.useState)(!1),[u,h]=(0,p.useState)([]),[g,f]=(0,p.useState)(null),[m,B]=(0,p.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),w=(0,p.useRef)(m),v=(0,p.useRef)(null),x=(0,p.useRef)(null),y=(0,p.useRef)(null),b=(0,p.useRef)(null),C=(0,p.useRef)(null),Q=(0,p.useRef)(null),F=(0,p.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=l3.length))return l3[e]})(r),[r]),U=(0,p.useCallback)(()=>{B({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),v.current=null,x.current=null,y.current=null,b.current=null},[]),E=(0,p.useCallback)(()=>{"running"!==A&&(t("running"),n(0),s(e=>e+1),o([]),U())},[U,A]),k=(0,p.useCallback)(e=>{Q.current=e},[]),j=(0,p.useCallback)((e="finish")=>{let A=w.current;A.projectId&&A.preCheckpointId&&A.postCheckpointId&&lf.$.runWithSuppressedDirty(A.projectId,async()=>{await l5.Y.restoreCheckpoint(A.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),U(),o([]),n(0),s(e=>e+1),t("finish"===e?"completed":"idle"),lv.s.setHasSeenTour(!0),C.current?.abort(),Q.current=null},[U]),I=(0,p.useCallback)(()=>{j("skip")},[j]),H=(0,p.useCallback)(()=>{n(e=>{let A=e+1;return A>=l3.length?(j(),e):(s(e=>e+1),A)})},[j]),S=(0,p.useCallback)(()=>{n(e=>{let A=Math.max(0,e-1);return A!==e&&s(e=>e+1),A})},[]),N=(0,p.useMemo)(()=>({state:{status:A,stepIndex:r,stepKey:a,currentStep:F,transcript:i,isBusy:l,projectList:u},start:E,skip:I,next:H,previous:S,setProjectList:e=>{h(e)},setActiveProjectId:f,setTranscript:o,setWorkspaceHandler:k}),[A,r,a,F,i,l,u,E,I,H,S,k]);return(0,d.jsx)(l6.Provider,{value:N,children:e})}function l9(){let e=(0,p.useContext)(l6);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var l7=t(1862);function ce({location:e}){let{state:A,next:t,previous:r,skip:n}=l9(),{status:a,currentStep:s,stepKey:i,isBusy:o,stepIndex:l}=A,[c,u]=(0,p.useState)(null),h=l3.length,g=(0,p.useMemo)(()=>!!s&&!!o&&("workspace-edit"===s.id||"workspace-focus"===s.id||"workspace-checkpoint"===s.id),[s,o]);if("running"!==a||!s||s.location!==e)return null;let f=s.primaryLabel??"Next",m=s.secondaryLabel??"Skip";return(0,d.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-background/30"}),c&&(0,d.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:c.top,left:c.left,width:c.width,height:c.height}}),(0,d.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,d.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:s.title}),(0,d.jsxs)("span",{className:"text-sm text-muted-foreground font-medium",children:[l+1,"/",h]})]}),(0,d.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:s.body})]}),o&&(0,d.jsx)(l7.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,d.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[s.showBack?(0,d.jsx)(Q.$,{variant:"ghost",onClick:r,disabled:o,children:"Back"}):(0,d.jsx)("div",{}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(Q.$,{variant:"ghost",onClick:n,children:m}),(0,d.jsx)(Q.$,{onClick:t,disabled:g,children:f})]})]})]})})]})}var cA=t(4923);function ct({project:e,open:A,onOpenChange:t}){let[r,n]=(0,p.useState)(!1),[a,s]=(0,p.useState)({name:e?.name||"",description:e?.description||"",version:"1.0.0",author:"",authorUrl:"",license:"personal",tags:[],thumbnail:void 0,previewImages:[],downloadUrl:""}),[i,o]=(0,p.useState)(""),l=async()=>{if(e){if(!a.name||a.name.length<1||a.name.length>50)return void A4.oR.error("Template name must be between 1 and 50 characters");if(!a.description||a.description.length<10||a.description.length>500)return void A4.oR.error("Description must be between 10 and 500 characters");if(!a.version||!/^\d+\.\d+\.\d+$/.test(a.version))return void A4.oR.error("Version must be in format x.y.z (e.g., 1.0.0)");try{n(!0);let A=i.split(",").map(e=>e.trim()).filter(e=>e.length>0),r={...a,tags:A},l=await C.exportProjectAsTemplate(m.vfs,e.id,r),c=URL.createObjectURL(l),u=document.createElement("a");u.href=c,u.download=`${a.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c),A4.oR.success("Template exported successfully!"),t(!1),s({name:"",description:"",version:"1.0.0",author:"",authorUrl:"",license:"personal",tags:[],thumbnail:void 0,previewImages:[],downloadUrl:""}),o("")}catch(e){y.v.error("Failed to export template:",e),A4.oR.error(e instanceof Error?e.message:"Failed to export template")}finally{n(!1)}}},c=cA.N2.find(e=>e.value===a.license);return(0,d.jsx)(oZ,{open:A,onOpenChange:t,children:(0,d.jsxs)(o2,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,d.jsxs)(o4,{children:[(0,d.jsx)(o5,{children:"Export as Template"}),(0,d.jsx)(o6,{children:"Create a reusable template from this project"})]}),(0,d.jsxs)("div",{className:"space-y-4 py-4",children:[a.thumbnail&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{children:"Preview Thumbnail"}),(0,d.jsx)("div",{className:"w-full rounded-lg overflow-hidden bg-muted border",children:(0,d.jsx)("img",{src:a.thumbnail,alt:"Template preview",className:"w-full h-auto"})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"This preview was captured when you saved the project"})]}),!a.thumbnail&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{children:"Preview Thumbnail"}),(0,d.jsx)("div",{className:"w-full h-48 rounded-lg bg-muted flex items-center justify-center border",children:(0,d.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,d.jsx)(H,{className:"h-12 w-12 mx-auto mb-2"}),(0,d.jsx)("p",{className:"text-sm",children:"No preview available"}),(0,d.jsx)("p",{className:"text-xs",children:"Save your project to capture a preview"})]})})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-name",children:["Template Name ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.name.length,"/50"]})]}),(0,d.jsx)(F.p,{id:"template-name",value:a.name,onChange:e=>s({...a,name:e.target.value.slice(0,50)}),placeholder:"My Awesome Template",maxLength:50,required:!0})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-description",children:["Description ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.description.length,"/500"]})]}),(0,d.jsx)(U,{id:"template-description",value:a.description,onChange:e=>s({...a,description:e.target.value.slice(0,500)}),placeholder:"A complete multi-page template with...",className:"resize-none",rows:3,maxLength:500,required:!0})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-version",children:["Version ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsx)(F.p,{id:"template-version",value:a.version,onChange:e=>s({...a,version:e.target.value}),placeholder:"1.0.0",pattern:"^\\d+\\.\\d+\\.\\d+$",required:!0}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Semantic version format (e.g., 1.0.0)"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-author",children:"Author"}),(0,d.jsx)(F.p,{id:"template-author",value:a.author,onChange:e=>s({...a,author:e.target.value.slice(0,50)}),placeholder:"Your Name",maxLength:50})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-author-url",children:"Author URL"}),(0,d.jsx)(F.p,{id:"template-author-url",type:"url",value:a.authorUrl,onChange:e=>s({...a,authorUrl:e.target.value}),placeholder:"https://yourwebsite.com"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-license",children:["License ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)(tn.l6,{value:a.license,onValueChange:e=>s({...a,license:e}),children:[(0,d.jsx)(tn.bq,{id:"template-license",children:(0,d.jsx)(tn.yv,{})}),(0,d.jsx)(tn.gC,{children:cA.N2.map(e=>(0,d.jsx)(tn.eb,{value:e.value,children:e.label},e.value))})]}),c&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-md bg-muted text-xs",children:[(0,d.jsx)(lr,{className:"h-3 w-3 mt-0.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("p",{className:"text-muted-foreground",children:c.description})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-tags",children:"Tags"}),(0,d.jsx)(F.p,{id:"template-tags",value:i,onChange:e=>o(e.target.value),placeholder:"saas, marketing, landing (comma-separated)"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add up to 10 tags, separated by commas"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-download-url",children:"Marketplace URL"}),(0,d.jsx)(F.p,{id:"template-download-url",type:"url",value:a.downloadUrl,onChange:e=>s({...a,downloadUrl:e.target.value}),placeholder:"https://example.com/templates/..."}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Where users can find this template"})]})]}),(0,d.jsxs)(o3,{children:[(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>t(!1),disabled:r,children:"Cancel"}),(0,d.jsx)(Q.$,{onClick:l,disabled:r,children:r?"Exporting...":"Export Template"})]})]})})}let cr=(0,E.A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var cn=t(9024),[ca,cs]=(0,eo.A)("Tooltip",[em.Bk]),ci=(0,em.Bk)(),co="TooltipProvider",cl="tooltip.open",[cc,cu]=ca(co),cd=e=>{let{__scopeTooltip:A,delayDuration:t=700,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:a}=e,s=p.useRef(!0),i=p.useRef(!1),o=p.useRef(0);return p.useEffect(()=>{let e=o.current;return()=>window.clearTimeout(e)},[]),(0,d.jsx)(cc,{scope:A,isOpenDelayedRef:s,delayDuration:t,onOpen:p.useCallback(()=>{window.clearTimeout(o.current),s.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:p.useCallback(e=>{i.current=e},[]),disableHoverableContent:n,children:a})};cd.displayName=co;var cp="Tooltip",[ch,cg]=ca(cp),cf=e=>{let{__scopeTooltip:A,children:t,open:r,defaultOpen:n,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,o=cu(cp,e.__scopeTooltip),l=ci(A),[c,u]=p.useState(null),h=(0,ef.B)(),g=p.useRef(0),f=s??o.disableHoverableContent,m=i??o.delayDuration,B=p.useRef(!1),[w,v]=(0,el.i)({prop:r,defaultProp:n??!1,onChange:e=>{e?(o.onOpen(),document.dispatchEvent(new CustomEvent(cl))):o.onClose(),a?.(e)},caller:cp}),x=p.useMemo(()=>w?B.current?"delayed-open":"instant-open":"closed",[w]),y=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,B.current=!1,v(!0)},[v]),b=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v(!1)},[v]),C=p.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{B.current=!0,v(!0),g.current=0},m)},[m,v]);return p.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),(0,d.jsx)(em.bL,{...l,children:(0,d.jsx)(ch,{scope:A,contentId:h,open:w,stateAttribute:x,trigger:c,onTriggerChange:u,onTriggerEnter:p.useCallback(()=>{o.isOpenDelayedRef.current?C():y()},[o.isOpenDelayedRef,C,y]),onTriggerLeave:p.useCallback(()=>{f?b():(window.clearTimeout(g.current),g.current=0)},[b,f]),onOpen:y,onClose:b,disableHoverableContent:f,children:t})})};cf.displayName=cp;var cm="TooltipTrigger",cB=p.forwardRef((e,A)=>{let{__scopeTooltip:t,...r}=e,n=cg(cm,t),a=cu(cm,t),s=ci(t),i=p.useRef(null),o=(0,ei.s)(A,i,n.onTriggerChange),l=p.useRef(!1),c=p.useRef(!1),u=p.useCallback(()=>l.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,d.jsx)(em.Mz,{asChild:!0,...s,children:(0,d.jsx)(ec.sG.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:o,onPointerMove:(0,es.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||a.isPointerInTransitRef.current||(n.onTriggerEnter(),c.current=!0))}),onPointerLeave:(0,es.mK)(e.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:(0,es.mK)(e.onPointerDown,()=>{n.open&&n.onClose(),l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:(0,es.mK)(e.onFocus,()=>{l.current||n.onOpen()}),onBlur:(0,es.mK)(e.onBlur,n.onClose),onClick:(0,es.mK)(e.onClick,n.onClose)})})});cB.displayName=cm;var cw="TooltipPortal",[cv,cx]=ca(cw,{forceMount:void 0}),cy=e=>{let{__scopeTooltip:A,forceMount:t,children:r,container:n}=e,a=cg(cw,A);return(0,d.jsx)(cv,{scope:A,forceMount:t,children:(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:r})})})};cy.displayName=cw;var cb="TooltipContent",cC=p.forwardRef((e,A)=>{let t=cx(cb,e.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...a}=e,s=cg(cb,e.__scopeTooltip);return(0,d.jsx)(ew.C,{present:r||s.open,children:s.disableHoverableContent?(0,d.jsx)(ck,{side:n,...a,ref:A}):(0,d.jsx)(cQ,{side:n,...a,ref:A})})}),cQ=p.forwardRef((e,A)=>{let t=cg(cb,e.__scopeTooltip),r=cu(cb,e.__scopeTooltip),n=p.useRef(null),a=(0,ei.s)(A,n),[s,i]=p.useState(null),{trigger:o,onClose:l}=t,c=n.current,{onPointerInTransitChange:u}=r,h=p.useCallback(()=>{i(null),u(!1)},[u]),g=p.useCallback((e,A)=>{let t=e.currentTarget,r={x:e.clientX,y:e.clientY},n=function(e,A){let t=Math.abs(A.top-e.y),r=Math.abs(A.bottom-e.y),n=Math.abs(A.right-e.x),a=Math.abs(A.left-e.x);switch(Math.min(t,r,n,a)){case a:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw Error("unreachable")}}(r,t.getBoundingClientRect());i(function(e){let A=e.slice();return A.sort((e,A)=>e.xA.x?1:e.yA.y)),function(e){if(e.length<=1)return e.slice();let A=[];for(let t=0;t=2;){let e=A[A.length-1],t=A[A.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))A.pop();else break}A.push(r)}A.pop();let t=[];for(let A=e.length-1;A>=0;A--){let r=e[A];for(;t.length>=2;){let e=t[t.length-1],A=t[t.length-2];if((e.x-A.x)*(r.y-A.y)>=(e.y-A.y)*(r.x-A.x))t.pop();else break}t.push(r)}return(t.pop(),1===A.length&&1===t.length&&A[0].x===t[0].x&&A[0].y===t[0].y)?A:A.concat(t)}(A)}([...function(e,A,t=5){let r=[];switch(A){case"top":r.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":r.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":r.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":r.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t})}return r}(r,n),...function(e){let{top:A,right:t,bottom:r,left:n}=e;return[{x:n,y:A},{x:t,y:A},{x:t,y:r},{x:n,y:r}]}(A.getBoundingClientRect())])),u(!0)},[u]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(o&&c){let e=e=>g(e,c),A=e=>g(e,o);return o.addEventListener("pointerleave",e),c.addEventListener("pointerleave",A),()=>{o.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",A)}}},[o,c,g,h]),p.useEffect(()=>{if(s){let e=e=>{let A=e.target,t={x:e.clientX,y:e.clientY},r=o?.contains(A)||c?.contains(A),n=!function(e,A){let{x:t,y:r}=e,n=!1;for(let e=0,a=A.length-1;er!=u>r&&t<(c-o)*(r-l)/(u-l)+o&&(n=!n)}return n}(t,s);r?h():n&&(h(),l())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[o,c,s,l,h]),(0,d.jsx)(ck,{...e,ref:a})}),[cF,cU]=ca(cp,{isInside:!1}),cE=(0,eT.Dc)("TooltipContent"),ck=p.forwardRef((e,A)=>{let{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,o=cg(cb,t),l=ci(t),{onClose:c}=o;return p.useEffect(()=>(document.addEventListener(cl,c),()=>document.removeEventListener(cl,c)),[c]),p.useEffect(()=>{if(o.trigger){let e=e=>{let A=e.target;A?.contains(o.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[o.trigger,c]),(0,d.jsx)(ep.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:c,children:(0,d.jsxs)(em.UC,{"data-state":o.stateAttribute,...l,...i,ref:A,style:{...i.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,d.jsx)(cE,{children:r}),(0,d.jsx)(cF,{scope:t,isInside:!0,children:(0,d.jsx)(cn.bL,{id:o.contentId,role:"tooltip",children:n||r})})]})})});cC.displayName=cb;var cj="TooltipArrow",cI=p.forwardRef((e,A)=>{let{__scopeTooltip:t,...r}=e,n=ci(t);return cU(cj,t).isInside?null:(0,d.jsx)(em.i3,{...n,...r,ref:A})});function cH({delayDuration:e=0,...A}){return(0,d.jsx)(cd,{"data-slot":"tooltip-provider",delayDuration:e,...A})}function cS({...e}){return(0,d.jsx)(cH,{children:(0,d.jsx)(cf,{"data-slot":"tooltip",...e})})}function cN({...e}){return(0,d.jsx)(cB,{"data-slot":"tooltip-trigger",...e})}function cL({className:e,sideOffset:A=0,children:t,arrowStyle:r,...n}){return(0,d.jsx)(cy,{children:(0,d.jsxs)(cC,{"data-slot":"tooltip-content",sideOffset:A,className:(0,y.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),...n,children:[t,(0,d.jsx)(cI,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:r})]})})}function cD({template:e,onSelect:A,onDelete:t,onExport:r,viewMode:n="grid"}){let a="isBuiltIn"in e&&e.isBuiltIn,s=a?null:e,i=e=>{let A=cA.N2.find(A=>A.value===e);return A?.label||e},o=A=>{A.stopPropagation(),!a&&t&&t(e.id)},l=A=>{A.stopPropagation(),r&&r(e)},c=e=>{if(!e)return"Never";try{return ea(e,{addSuffix:!0})}catch{return"Recently"}};return"list"===n?(0,d.jsx)("div",{className:"border border-border rounded-lg p-4 bg-card",children:(0,d.jsxs)("div",{className:"flex items-center gap-4",children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[s?.metadata.thumbnail?(0,d.jsx)("div",{className:"w-24 h-16 rounded-md overflow-hidden bg-muted",children:(0,d.jsx)("img",{src:s.metadata.thumbnail,alt:e.name,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-24 h-16 rounded-md bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-8 w-8 text-muted-foreground"})}),a&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{className:"absolute top-1 right-1 bg-background/90 rounded-full p-1",children:(0,d.jsx)(cr,{className:"h-3 w-3 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"Built-in template"})]})})]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 mb-1",children:[(0,d.jsx)("h3",{className:"font-semibold text-base truncate",title:e.name,children:e.name}),s&&(0,d.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["v",s.version]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1 mb-2",title:e.description,children:e.description}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[(s?.metadata.author||e.metadata?.author)&&(0,d.jsxs)("span",{className:"truncate max-w-[150px]",title:s?.metadata.author||e.metadata?.author,children:["by ",s?.metadata.author||e.metadata?.author]}),s?.metadata.license&&(0,d.jsxs)(d.Fragment,{children:[s.metadata.author&&(0,d.jsx)("span",{children:"•"}),(0,d.jsx)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0 h-auto",children:i(s.metadata.license)})]}),s?.files&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[s.files.length," files"]})]}),(s?.metadata.tags||e.metadata?.tags)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"•"}),(s?.metadata.tags||e.metadata?.tags||[]).slice(0,2).map(e=>(0,d.jsx)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:e},e)),(s?.metadata.tags||e.metadata?.tags||[]).length>2&&(0,d.jsxs)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:["+",(s?.metadata.tags||e.metadata?.tags||[]).length-2]})]})]})]}),(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-3 shrink-0",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:c(s?.updatedAt||e.updatedAt)}),(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),a&&(0,d.jsx)(cL,{children:"Built-in templates cannot be deleted"})]})})]})]})]})]}),(0,d.jsx)("div",{className:"md:hidden",children:(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]})}):(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden bg-card group",children:[(0,d.jsxs)("div",{className:"relative",children:[s?.metadata.thumbnail?(0,d.jsx)("div",{className:"w-full aspect-video bg-muted",children:(0,d.jsx)("img",{src:s.metadata.thumbnail,alt:e.name,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-full aspect-video bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-16 w-16 text-muted-foreground"})}),a&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{className:"absolute top-2 right-2 bg-background/90 rounded-full p-1.5 shadow-sm",children:(0,d.jsx)(cr,{className:"h-4 w-4 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"Built-in template"})]})}),s?.metadata.downloadUrl&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("a",{href:s.metadata.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"absolute top-2 left-2 bg-background/90 hover:bg-background rounded-full p-1.5 shadow-sm transition-colors",onClick:e=>e.stopPropagation(),children:(0,d.jsx)(le.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"View on marketplace"})]})})]}),(0,d.jsxs)("div",{className:"p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("h3",{className:"font-semibold text-base line-clamp-1 flex-1",title:e.name,children:e.name}),s&&(0,d.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["v",s.version]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",title:e.description,children:e.description})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(s?.metadata.author||e.metadata?.author)&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:s?.metadata.authorUrl?(0,d.jsxs)("a",{href:s.metadata.authorUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",onClick:e=>e.stopPropagation(),children:["by ",s.metadata.author,(0,d.jsx)(le.A,{className:"h-3 w-3"})]}):(0,d.jsxs)("span",{children:["by ",s?.metadata.author||e.metadata?.author]})}),(s?.metadata.tags||e.metadata?.tags)&&(s?.metadata.tags||e.metadata?.tags||[]).length>0&&(0,d.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(s?.metadata.tags||e.metadata?.tags||[]).slice(0,3).map(e=>(0,d.jsx)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0.5",children:e},e)),(s?.metadata.tags||e.metadata?.tags||[]).length>3&&(0,d.jsxs)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0.5",children:["+",(s?.metadata.tags||e.metadata?.tags||[]).length-3]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-wrap",children:[s?.metadata.license&&(0,d.jsx)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:i(s.metadata.license)}),s?.files&&(0,d.jsxs)(d.Fragment,{children:[s.metadata.license&&(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[s.files.length," files"]})]})]})]}),(0,d.jsxs)("div",{className:"pt-3 border-t flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:c(s?.updatedAt||e.updatedAt)}),(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),a&&(0,d.jsx)(cL,{children:"Built-in templates cannot be deleted"})]})})]})]})]})]})]})]})}function cT({onProjectCreated:e}){let[A,t]=(0,p.useState)([]),[r,n]=(0,p.useState)(!0),[a,s]=(0,p.useState)(""),[i,o]=(0,p.useState)("updated"),[l,c]=(0,p.useState)("grid"),u=(0,p.useCallback)(async()=>{try{n(!0);let e=await C.listCustomTemplates();t(e)}catch(e){y.v.error("Failed to load custom templates:",e),A4.oR.error("Failed to load custom templates")}finally{n(!1)}},[]),h=async()=>{let e=document.createElement("input");e.type="file",e.accept=".oswt",e.onchange=async e=>{let A=e.target.files?.[0];if(A)try{await C.importTemplateFile(A),A4.oR.success("Template imported successfully!"),await u()}catch(e){y.v.error("Failed to import template:",e),A4.oR.error(e instanceof Error?e.message:"Failed to import template")}},e.click()},g=async e=>{if(confirm("Are you sure you want to delete this template?"))try{await C.deleteCustomTemplate(e),A4.oR.success("Template deleted"),await u()}catch(e){y.v.error("Failed to delete template:",e),A4.oR.error("Failed to delete template")}},f=async e=>{try{if("isBuiltIn"in e&&e.isBuiltIn){A4.oR.info("Exporting built-in template as custom template...");let A=await m.vfs.createProject(e.name,e.description);"blank"===e.id?await lm(m.vfs,A.id,lg):"demo"===e.id&&await lm(m.vfs,A.id,lh,lh.assets);let t=await C.exportProjectAsTemplate(m.vfs,A.id,{name:e.name,description:e.description,version:"1.0.0",author:"OSW Studio",license:"mit",tags:e.metadata?.tags||[]});await m.vfs.deleteProject(A.id);let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),A4.oR.success("Template exported successfully!")}else{let A=await C.exportTemplateAsFile(e),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`${e.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t),A4.oR.success("Template exported successfully!")}}catch(e){y.v.error("Failed to export template:",e),A4.oR.error("Failed to export template")}},B=async A=>{try{let t="Blank"===A.name||"Example Studios"===A.name?`New ${A.name} Project`:A.name,r=await m.vfs.createProject(t,A.description);"isBuiltIn"in A&&A.isBuiltIn?"blank"===A.id?await lm(m.vfs,r.id,lg):"demo"===A.id&&await lm(m.vfs,r.id,lh,lh.assets):await lm(m.vfs,r.id,{name:A.name,description:A.description,files:A.files.map(e=>({path:e.path,content:"string"==typeof e.content?e.content:new TextDecoder().decode(e.content)})),directories:A.directories,assets:A.assets}),A4.oR.success(`Project "${r.name}" created successfully!`),e&&e(r.id)}catch(e){y.v.error("Failed to create project from template:",e),A4.oR.error("Failed to create project")}},w=[...[...lB,...A].filter(e=>{let A=a.toLowerCase();return e.name.toLowerCase().includes(A)||e.description.toLowerCase().includes(A)||"metadata"in e&&e.metadata?.author?.toLowerCase().includes(A)||"metadata"in e&&e.metadata?.tags?.some(e=>e.toLowerCase().includes(A))})].sort((e,A)=>{switch(i){case"updated":let t="updatedAt"in e&&e.updatedAt?e.updatedAt:new Date("2024-01-01");return("updatedAt"in A&&A.updatedAt?A.updatedAt:new Date("2024-01-01")).getTime()-t.getTime();case"name":return e.name.localeCompare(A.name);case"author":let r="metadata"in e&&e.metadata?.author||"",n="metadata"in A&&A.metadata?.author||"";return r.localeCompare(n);case"files":let a="files"in e&&e.files?.length||0;return("files"in A&&A.files?.length||0)-a;default:return 0}});return r?(0,d.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,d.jsx)("p",{className:"mt-4",children:"Loading templates..."})]})}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)("div",{className:"pt-4 px-4 pb-3 sm:pt-6 sm:px-6 sm:pb-3 shrink-0",children:(0,d.jsxs)("div",{className:"mx-auto max-w-7xl flex flex-col sm:flex-row gap-3",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(ls.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,d.jsx)(F.p,{placeholder:"Search templates...",value:a,onChange:e=>s(e.target.value),className:"pl-9"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(li,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,d.jsx)(lw.hl,{className:"w-48",align:"end",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"font-semibold text-sm",children:"Sort by"}),(0,d.jsxs)(tn.l6,{value:i,onValueChange:e=>o(e),children:[(0,d.jsx)(tn.bq,{children:(0,d.jsx)(tn.yv,{})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsx)(tn.eb,{value:"updated",children:"Last Updated"}),(0,d.jsx)(tn.eb,{value:"name",children:"Name"}),(0,d.jsx)(tn.eb,{value:"author",children:"Author"}),(0,d.jsx)(tn.eb,{value:"files",children:"File Count"})]})]})]})})]}),(0,d.jsxs)("div",{className:"flex border rounded-full",children:[(0,d.jsx)(Q.$,{variant:"grid"===l?"secondary":"ghost",size:"sm",onClick:()=>c("grid"),className:"rounded-r-none rounded-l-full",children:(0,d.jsx)(lo,{className:"h-4 w-4"})}),(0,d.jsx)(Q.$,{variant:"list"===l?"secondary":"ghost",size:"sm",onClick:()=>c("list"),className:"rounded-l-none rounded-r-full",children:(0,d.jsx)(ll,{className:"h-4 w-4"})})]}),(0,d.jsxs)(Q.$,{onClick:h,size:"sm",className:"gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"Import"})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 px-4 pt-3 pb-4 sm:px-6 sm:pt-3 sm:pb-6",children:(0,d.jsx)("div",{className:"mx-auto max-w-7xl",children:0===w.length?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-center max-w-md",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ls.A,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h3",{className:"font-semibold mb-2",children:"No templates found"}),(0,d.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:['No templates match your search query "',a,'"']}),(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>s(""),children:"Clear search"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(O,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h3",{className:"font-semibold mb-2",children:"No custom templates yet"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Import custom templates to get started with professional designs."}),(0,d.jsxs)(Q.$,{onClick:h,children:[(0,d.jsx)(lu,{className:"h-4 w-4 mr-2"}),"Import Template"]})]})})}):(0,d.jsx)("div",{className:"grid"===l?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4":"space-y-3",children:w.map(e=>(0,d.jsx)(cD,{template:e,onSelect:B,onDelete:g,onExport:f,viewMode:l},e.id))})})})]})}function cM({onProjectSelect:e}){let A=(0,f.useRouter)(),[t,r]=(0,p.useState)([]),[n,a]=(0,p.useState)(!0),[s,i]=(0,p.useState)(""),[o,l]=(0,p.useState)(!1),[c,u]=(0,p.useState)(""),[h,g]=(0,p.useState)(""),[B,w]=(0,p.useState)("blank"),[v,x]=(0,p.useState)([]),[b,E]=(0,p.useState)("updated"),[k,j]=(0,p.useState)("list"),[I,H]=(0,p.useState)(null),[S,N]=(0,p.useState)(!1),[L,T]=(0,p.useState)(null),[M,K]=(0,p.useState)("projects"),{state:P,setProjectList:R,start:O}=l9(),V=P.currentStep?.id,G="running"===P.status,[z,q]=(0,p.useState)(!1),[W,J]=(0,p.useState)(null),X=(0,p.useRef)(!1),_=(0,p.useRef)(!1),Y=(0,p.useCallback)(async()=>{try{let e=await C.listCustomTemplates();x(e)}catch(e){y.v.error("Failed to load custom templates:",e)}},[]);(0,p.useCallback)(async()=>{if(!X.current){X.current=!0,a(!0);try{await m.vfs.init();let e=(await m.vfs.listProjects()).sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());r(e),R(e),await Y()}catch(e){y.v.error("Failed to load projects:",e),A4.oR.error("Failed to load projects")}finally{a(!1),q(!0),X.current=!1}}},[R,Y]);let $=(0,p.useCallback)(async()=>{try{await m.vfs.init();let e=(await m.vfs.listProjects()).sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());r(e),R(e)}catch(e){y.v.error("Failed to reload projects:",e),A4.oR.error("Failed to reload projects")}},[R]),Z=async()=>{if(!_.current){_.current=!0;try{let A=await m.vfs.createProject("Multi-File Demo","Interactive examples showing how HTML, CSS, and JavaScript files work together");return await lm(m.vfs,A.id,lh,lh.assets),A4.oR.success("Demo project created successfully"),await $(),e(A),A}catch(e){throw y.v.error("Failed to create demo project:",e),A4.oR.error("Failed to create demo project"),_.current=!1,e}}},ee=async()=>{try{0===t.length&&await Z(),O()}catch(e){y.v.error("Failed to prepare for tour:",e),A4.oR.error("Failed to start tour - could not create demo project")}},eA=async()=>{if(!c.trim())return void A4.oR.error("Please enter a project name");if(c.length>50)return void A4.oR.error("Project name must be 50 characters or less");if(h.length>200)return void A4.oR.error("Description must be 200 characters or less");try{let A=await m.vfs.createProject(c.trim().slice(0,50),h.trim().slice(0,200)||void 0);if(B.startsWith("custom:")){let e=B.replace("custom:",""),t=v.find(A=>A.id===e);t&&await lm(m.vfs,A.id,{name:t.name,description:t.description,files:t.files.map(e=>({path:e.path,content:"string"==typeof e.content?e.content:new TextDecoder().decode(e.content)})),directories:t.directories,assets:t.assets})}else"demo"===B?await lm(m.vfs,A.id,lh,lh.assets):await lm(m.vfs,A.id,lg);A4.oR.success("Project created successfully"),l(!1),u(""),g(""),w("blank"),await $(),e(A)}catch(e){y.v.error("Failed to create project:",e),A4.oR.error("Failed to create project")}},et=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await m.vfs.deleteProject(e.id),A4.oR.success("Project deleted"),await $()}catch(e){y.v.error("Failed to delete project:",e),A4.oR.error("Failed to delete project")}},er=async A=>{try{let t=await m.vfs.duplicateProject(A.id);A4.oR.success("Project duplicated successfully"),await $(),e(t)}catch(e){y.v.error("Failed to duplicate project:",e),A4.oR.error("Failed to duplicate project")}},en=async e=>{try{let A=await m.vfs.exportProject(e.id),t=JSON.stringify(A,null,2),r=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(r),a=document.createElement("a");a.href=n,a.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),A4.oR.success("Project exported")}catch(e){y.v.error("Failed to export project:",e),A4.oR.error("Failed to export project")}},ea=async e=>{try{let A=await m.vfs.exportProjectAsZip(e.id),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t),A4.oR.success("Project exported as ZIP")}catch(e){y.v.error("Failed to export project as ZIP:",e),A4.oR.error("Failed to export project as ZIP")}},es=async()=>{let A=document.createElement("input");A.type="file",A.accept=".json",A.onchange=async A=>{let t=A.target.files?.[0];if(t)try{let A=await t.text(),r=JSON.parse(A);if(!r.project||!r.files)throw Error("Invalid project file");let n=await m.vfs.importProject(r);A4.oR.success("Project imported successfully"),await $(),e(n)}catch(e){y.v.error("Failed to import project:",e),A4.oR.error("Failed to import project")}},A.click()},ei=((e,A)=>{let t=[...e];switch(A){case"updated":return t.sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());case"created":return t.sort((e,A)=>A.createdAt.getTime()-e.createdAt.getTime());case"name":return t.sort((e,A)=>e.name.localeCompare(A.name));case"size":return t.sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());default:return t}})(t.filter(e=>e.name.toLowerCase().includes(s.toLowerCase())||e.description?.toLowerCase().includes(s.toLowerCase())),b);if(n&&!z)return(0,d.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,d.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let eo=(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsx)(Q.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,d.jsx)(lt,{className:"h-4 w-4"})})}),(0,d.jsx)(lw.hl,{className:"w-96",align:"end",children:(0,d.jsx)(l4,{})})]}),el=(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,d.jsx)(lt,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,d.jsx)(lw.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,d.jsx)(l4,{})})]}),(0,d.jsx)("div",{className:"border-t my-2"}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:ee,disabled:G,className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>A.push("/test-generation"),className:"w-full justify-start",children:[(0,d.jsx)(ln,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>N(!0),className:"w-full justify-start",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]}),(0,d.jsx)(Q.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,d.jsxs)("a",{href:"https://github.com/o-stahl/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsx)(o7,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]}),ec=async A=>{await $();let t=await m.vfs.getProject(A);t&&(K("projects"),e(t))};return(0,d.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,d.jsx)(ld.j,{onLogoClick:()=>N(!0),actions:[],mobileMenuContent:el,desktopOnlyContent:eo,leftText:"Open Source Web Studio",viewTabs:[{id:"projects",label:"Projects",icon:D},{id:"templates",label:"Templates",icon:la}],activeViewTab:M,onViewTabChange:e=>K(e)}),(0,d.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:"templates"===M?(0,d.jsx)(cT,{onProjectCreated:ec}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)("div",{className:"pt-4 px-4 pb-3 sm:pt-6 sm:px-6 sm:pb-3 shrink-0",children:(0,d.jsxs)("div",{className:"mx-auto max-w-7xl flex flex-col sm:flex-row gap-3","data-tour-id":"projects-actions",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(ls.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,d.jsx)(F.p,{placeholder:"Search projects...",value:s,onChange:e=>i(e.target.value),className:"pl-9"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(li,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,d.jsx)(lw.hl,{className:"w-48",align:"end",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"font-semibold text-sm",children:"Sort by"}),(0,d.jsxs)(tn.l6,{value:b,onValueChange:e=>E(e),children:[(0,d.jsx)(tn.bq,{children:(0,d.jsx)(tn.yv,{})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsx)(tn.eb,{value:"updated",children:"Last Updated"}),(0,d.jsx)(tn.eb,{value:"created",children:"Date Created"}),(0,d.jsx)(tn.eb,{value:"name",children:"Name"})]})]})]})})]}),(0,d.jsxs)("div",{className:"flex border rounded-full",children:[(0,d.jsx)(Q.$,{variant:"grid"===k?"secondary":"ghost",size:"sm",onClick:()=>j("grid"),className:"rounded-r-none rounded-l-full",children:(0,d.jsx)(lo,{className:"h-4 w-4"})}),(0,d.jsx)(Q.$,{variant:"list"===k?"secondary":"ghost",size:"sm",onClick:()=>j("list"),className:"rounded-l-none rounded-r-full",children:(0,d.jsx)(ll,{className:"h-4 w-4"})})]}),(0,d.jsxs)(Q.$,{onClick:()=>l(!0),size:"sm",className:"gap-2",children:[(0,d.jsx)(lc,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"New"})]}),(0,d.jsxs)(Q.$,{onClick:es,variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"Import"})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 px-4 pt-3 pb-4 sm:px-6 sm:pt-3 sm:pb-6",children:(0,d.jsx)("div",{className:"mx-auto max-w-7xl",children:0===ei.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)(D,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h2",{className:"text-xl font-semibold mb-2",children:s?"No projects found":"No projects yet"}),(0,d.jsx)("p",{className:"text-muted-foreground mb-6",children:s?"Try a different search term":"Create your first project to get started"}),!s&&(0,d.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,d.jsxs)(Q.$,{onClick:()=>l(!0),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,d.jsxs)(Q.$,{variant:"outline",onClick:Z,children:[(0,d.jsx)(D,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,d.jsx)("div",{className:"grid"===k?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4":"space-y-3","data-tour-id":"projects-list",children:ei.map(A=>"object"==typeof A&&A.id&&A.name?(0,d.jsx)(A3,{project:A,onSelect:e,onDelete:et,onExport:en,onExportZip:ea,onDuplicate:er,onPreview:H,onExportAsTemplate:T,onUpdate:e=>{r(t.map(A=>A.id===e.id?e:A))},viewMode:k,forceMenuOpen:W===A.id,highlightExport:G&&"project-controls"===V&&W===A.id},A.id):(y.v.error("Invalid project object:",A),null))})})})]})}),(0,d.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,d.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:ee,disabled:G,"data-tour-id":"footer-guided-tour",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>A.push("/test-generation"),children:[(0,d.jsx)(ln,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]}),(0,d.jsx)(Q.$,{variant:"outline",size:"sm",asChild:!0,children:(0,d.jsxs)("a",{href:"https://github.com/o-stahl/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsx)(o7,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]})}),(0,d.jsx)(oZ,{open:o,onOpenChange:l,children:(0,d.jsxs)(o2,{children:[(0,d.jsxs)(o4,{children:[(0,d.jsx)(o5,{children:"Create New Project"}),(0,d.jsx)(o6,{children:"Start a new multipage website project"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsx)(lp.J,{htmlFor:"name",children:"Project Name"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.length,"/50"]})]}),(0,d.jsx)(F.p,{id:"name",value:c,onChange:e=>u(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"template",children:"Template"}),(0,d.jsxs)(tn.l6,{value:B,onValueChange:w,children:[(0,d.jsx)(tn.bq,{id:"template",className:"mt-2 w-full",children:(0,d.jsx)("div",{className:"truncate flex-1 text-left",children:(e=>{if(e.startsWith("custom:")){let A=e.replace("custom:",""),t=v.find(e=>e.id===A);return t?.name||"Custom Template"}let A=lB.find(A=>A.id===e);return A?.name||"Select a template"})(B)})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsxs)(tn.s3,{children:[(0,d.jsx)(tn.TR,{children:"Built-in Templates"}),lB.map(e=>(0,d.jsx)(tn.eb,{value:e.id,children:(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"font-medium",children:e.name}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})},e.id))]}),v.length>0&&(0,d.jsxs)(tn.s3,{children:[(0,d.jsx)(tn.TR,{children:"Custom Templates"}),v.map(e=>(0,d.jsx)(tn.eb,{value:`custom:${e.id}`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"font-medium",children:e.name}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})},e.id))]})]})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsx)(lp.J,{htmlFor:"description",children:"Description (optional)"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[h.length,"/200"]})]}),(0,d.jsx)(U,{id:"description",value:h,onChange:e=>g(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,d.jsxs)(o3,{children:[(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),(0,d.jsx)(Q.$,{onClick:eA,children:"Create Project"})]})]})}),I&&(0,d.jsx)(oZ,{open:!!I,onOpenChange:()=>H(null),children:(0,d.jsxs)(o2,{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,d.jsx)(o4,{className:"p-4 border-b",children:(0,d.jsxs)(o5,{children:["Preview: ",I.name]})}),(0,d.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,d.jsx)(ow,{projectId:I.id})})]})}),(0,d.jsx)(ct,{project:L,open:!!L,onOpenChange:e=>{e||T(null)}}),(0,d.jsx)(lA,{open:S,onOpenChange:N}),(0,d.jsx)(ce,{location:"project-manager"})]})}cI.displayName=cj;let cK=(0,E.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"}]]),cP=(0,E.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"}]]),cR=(0,E.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"}]]),cO=(0,E.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 cV="ContextMenu",[cG,cz]=(0,eo.A)(cV,[e_]),cq=e_(),[cW,cJ]=cG(cV),cX=e=>{let{__scopeContextMenu:A,children:t,onOpenChange:r,dir:n,modal:a=!0}=e,[s,i]=p.useState(!1),o=cq(A),l=(0,ev.c)(r),c=p.useCallback(e=>{i(e),l(e)},[l]);return(0,d.jsx)(cW,{scope:A,open:s,onOpenChange:c,modal:a,children:(0,d.jsx)(e4,{...o,dir:n,open:s,onOpenChange:c,modal:a,children:t})})};cX.displayName=cV;var c_="ContextMenuTrigger",cY=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,disabled:r=!1,...n}=e,a=cJ(c_,t),s=cq(t),i=p.useRef({x:0,y:0}),o=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...i.current})}),l=p.useRef(0),c=p.useCallback(()=>window.clearTimeout(l.current),[]),u=e=>{i.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return p.useEffect(()=>c,[c]),p.useEffect(()=>void(r&&c()),[r,c]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(e3,{...s,virtualRef:o}),(0,d.jsx)(ec.sG.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...n,ref:A,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:(0,es.mK)(e.onContextMenu,e=>{c(),u(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:(0,es.mK)(e.onPointerDown,ue(e=>{c(),l.current=window.setTimeout(()=>u(e),700)})),onPointerMove:r?e.onPointerMove:(0,es.mK)(e.onPointerMove,ue(c)),onPointerCancel:r?e.onPointerCancel:(0,es.mK)(e.onPointerCancel,ue(c)),onPointerUp:r?e.onPointerUp:(0,es.mK)(e.onPointerUp,ue(c))})]})});cY.displayName=c_;var c$=e=>{let{__scopeContextMenu:A,...t}=e,r=cq(A);return(0,d.jsx)(e9,{...r,...t})};c$.displayName="ContextMenuPortal";var cZ="ContextMenuContent",c0=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cJ(cZ,t),a=cq(t),s=p.useRef(!1);return(0,d.jsx)(At,{...a,...r,ref:A,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:A=>{e.onCloseAutoFocus?.(A),!A.defaultPrevented&&s.current&&A.preventDefault(),s.current=!1},onInteractOutside:A=>{e.onInteractOutside?.(A),A.defaultPrevented||n.modal||(s.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)"}})});c0.displayName=cZ,p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ai,{...n,...r,ref:A})}).displayName="ContextMenuGroup";var c1=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ao,{...n,...r,ref:A})});c1.displayName="ContextMenuLabel";var c2=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Au,{...n,...r,ref:A})});c2.displayName="ContextMenuItem";var c4=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ap,{...n,...r,ref:A})});c4.displayName="ContextMenuCheckboxItem",p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Am,{...n,...r,ref:A})}).displayName="ContextMenuRadioGroup";var c3=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Aw,{...n,...r,ref:A})});c3.displayName="ContextMenuRadioItem";var c5=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ab,{...n,...r,ref:A})});c5.displayName="ContextMenuItemIndicator";var c6=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AC,{...n,...r,ref:A})});c6.displayName="ContextMenuSeparator",p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AQ,{...n,...r,ref:A})}).displayName="ContextMenuArrow";var c8="ContextMenuSub",c9=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AI,{...n,...r,ref:A})});c9.displayName="ContextMenuSubTrigger";var c7=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AS,{...n,...r,ref:A,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 ue(e){return A=>"mouse"!==A.pointerType?e(A):void 0}c7.displayName="ContextMenuSubContent";let uA=(0,E.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);p.forwardRef(({className:e,inset:A,children:t,...r},n)=>(0,d.jsxs)(c9,{ref:n,className:(0,y.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",A&&"pl-8",e),...r,children:[t,(0,d.jsx)(A9,{className:"ml-auto h-4 w-4"})]})).displayName=c9.displayName,p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c7,{ref:t,className:(0,y.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),...A})).displayName=c7.displayName;let ut=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c$,{children:(0,d.jsx)(c0,{ref:t,className:(0,y.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),...A})}));ut.displayName=c0.displayName;let ur=p.forwardRef(({className:e,inset:A,...t},r)=>(0,d.jsx)(c2,{ref:r,className:(0,y.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",A&&"pl-8",e),...t}));function un({projectId:e,onFileSelect:A,selectedPath:t,onClose:r}){let[n,a]=(0,p.useState)([]),[s,i]=(0,p.useState)([]),[o,l]=(0,p.useState)(new Set(["/"])),[c,u]=(0,p.useState)(null),[h,g]=(0,p.useState)(""),[f,B]=(0,p.useState)(!1),[w,v]=(0,p.useState)(null),[x,b]=(0,p.useState)(null),C=(0,p.useRef)(null),U=(0,p.useCallback)(async()=>{try{await m.vfs.init();let A=await m.vfs.getAllFilesAndDirectories(e),t=A.filter(e=>"directory"!==e.type);a(t),i(E(A))}catch(e){y.v.error("Failed to load files:",e)}},[e]),E=e=>{let A=[],t=new Map;e.forEach(e=>{if("directory"===e.type){let A=e.path.split("/").filter(Boolean),r={path:e.path,name:e.name||A[A.length-1]||"unnamed",type:"directory",children:[]};t.set(e.path,r)}}),e.forEach(e=>{if("directory"!==e.type){let A=e.path.split("/").filter(Boolean),r="";for(let e=0;e{let n=r.split("/").filter(Boolean);if(1===n.length)A.push(e);else{let A="/"+n.slice(0,-1).join("/"),r=t.get(A);r&&r.children&&r.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let r=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name,type:"file"};if(1===r.length)A.push(n);else{let e="/"+r.slice(0,-1).join("/"),A=t.get(e);A&&A.children?.push(n)}}});let r=e=>{e.sort((e,A)=>e.type===A.type?e.name.localeCompare(A.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&r(e.children)})};return r(A),A},k=e=>{l(A=>{let t=new Set(A);return t.has(e)?t.delete(e):t.add(e),t})},j=async e=>{if("directory"===e.type)k(e.path);else{let t=n.find(A=>A.path===e.path);t&&A&&A(t)}},H=async(A="/")=>{let t=prompt("Enter file name:");if(!t)return;let r="/"===A?`/${t}`:`${A}/${t}`;try{await m.vfs.createFile(e,r,""),await U()}catch(e){y.v.error("Failed to create file:",e)}},S=async(A="/")=>{let t=prompt("Enter directory name:");if(!t)return;let r="/"===A?`/${t}`:`${A}/${t}`;try{await m.vfs.createDirectory(e,r),await U()}catch(e){y.v.error("Failed to create directory:",e)}},L=async(A,t)=>{if(confirm(`Delete ${t} "${A}"?`))try{"file"===t?await m.vfs.deleteFile(e,A):await m.vfs.deleteDirectory(e,A),await U()}catch(e){y.v.error(`Failed to delete ${t}:`,e)}},T=async(A,t)=>{if(!h)return;let r=A.split("/");r[r.length-1]=h;let n=r.join("/");try{"directory"===t?await m.vfs.renameDirectory(e,A,n):await m.vfs.renameFile(e,A,n),await U(),u(null),g("")}catch(e){y.v.error(`Failed to rename ${t}:`,e)}},M=async e=>{for(let A of(e.preventDefault(),e.stopPropagation(),B(!1),Array.from(e.dataTransfer.items)))if("file"===A.kind){let e=A.getAsFile();e&&await K(e,"/")}},K=async(A,t)=>{if(!(0,cA.fu)(A.name))return void A4.oR.error(`File type not supported: ${A.name}`);let r=(0,cA.Gr)(A.name),n=cA.Q6[r];if(A.size>n)return void A4.oR.error(`File too large: ${A.name}. Maximum size is ${Math.round(n/1024/1024)}MB`);let a="/"===t?`/${A.name}`:`${t}/${A.name}`;try{let t;t="image"===r||"video"===r||"binary"===r?await A.arrayBuffer():await A.text(),await m.vfs.createFile(e,a,t),await U(),A4.oR.success(`Uploaded ${A.name}`)}catch(r){if(r.message?.includes("already exists")){if(confirm(`File "${A.name}" already exists. Overwrite?`))try{await m.vfs.deleteFile(e,a),await K(A,t)}catch(e){y.v.error("Failed to overwrite file:",e),A4.oR.error("Failed to overwrite file")}}else y.v.error("Failed to upload file:",r),A4.oR.error(`Failed to upload ${A.name}: ${r.message}`)}},P=(e,A)=>{e.stopPropagation(),v(A),e.dataTransfer.effectAllowed="move"},R=()=>{v(null),b(null)},O=(e,A)=>{e.preventDefault(),e.stopPropagation(),w&&A!==w.path&&(e.dataTransfer.dropEffect="move",b(A))},V=async(A,t)=>{if(A.preventDefault(),A.stopPropagation(),!w||t&&w.path===t.path)return void b(null);let r=t&&"directory"===t.type?t.path:"/";if("directory"===w.type){let e=w.path.endsWith("/")?w.path:w.path+"/";if((r.endsWith("/")?r:r+"/").startsWith(e)){A4.oR.error("Cannot move a folder into itself"),b(null);return}}let n=w.name,a="/"===r?`/${n}`:`${r}/${n}`;try{"directory"===w.type?await m.vfs.moveDirectory(e,w.path,a):await m.vfs.moveFile(e,w.path,a),await U(),A4.oR.success(`Moved ${w.name} to ${"/"===r?"root":r}`)}catch(e){y.v.error("Failed to move item:",e),A4.oR.error(`Failed to move: ${e.message}`)}b(null)},G=(e,A=0)=>{let r=o.has(e.path),n=t===e.path,a=c===e.path,s=x===e.path;return(0,d.jsxs)("div",{draggable:!a,onDragStart:A=>P(A,e),onDragEnd:R,onDragOver:A=>"directory"===e.type&&O(A,e.path),onDrop:A=>"directory"===e.type&&V(A,e),children:[(0,d.jsxs)(cX,{children:[(0,d.jsx)(cY,{children:(0,d.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",n&&"bg-accent text-accent-foreground",s&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",w?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*A+8}px`},onClick:()=>j(e),children:["directory"===e.type?(0,d.jsxs)(d.Fragment,{children:[r?(0,d.jsx)(lD.A,{className:"w-4 h-4 text-muted-foreground"}):(0,d.jsx)(A9,{className:"w-4 h-4 text-muted-foreground"}),r?(0,d.jsx)(D,{className:"w-4 h-4 text-blue-500"}):(0,d.jsx)(cK,{className:"w-4 h-4 text-blue-500"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"w-4"}),(()=>{let A=(0,cA.Gr)(e.path);return"image"===A?(0,d.jsx)(I,{className:"w-4 h-4 text-green-500"}):"video"===A?(0,d.jsx)(cP,{className:"w-4 h-4 text-purple-500"}):(0,d.jsx)(cR,{className:"w-4 h-4 text-muted-foreground"})})()]}),a?(0,d.jsx)(F.p,{value:h,onChange:e=>g(e.target.value),onBlur:()=>T(e.path,e.type),onKeyDown:A=>{"Enter"===A.key?T(e.path,e.type):"Escape"===A.key&&(u(null),g(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,d.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,d.jsxs)(ut,{children:["directory"===e.type&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ur,{onClick:()=>H(e.path),children:[(0,d.jsx)(cR,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,d.jsxs)(ur,{onClick:()=>S(e.path),children:[(0,d.jsx)(cK,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,d.jsxs)(ur,{onClick:()=>C.current?.click(),children:[(0,d.jsx)(lu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,d.jsx)(ur,{onClick:()=>{u(e.path),g(e.name)},children:"Rename"}),(0,d.jsx)(ur,{onClick:()=>L(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&r&&e.children&&(0,d.jsx)("div",{children:e.children.map(e=>G(e,A+1))})]},e.path)};return(0,d.jsxs)("div",{className:"h-full flex flex-col",onDrop:M,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),B(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let A=e.currentTarget.getBoundingClientRect(),t=e.clientX,r=e.clientY;(t=A.right||r=A.bottom)&&B(!1)},children:[(0,d.jsx)("input",{ref:C,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let A of Array.from(e.target.files||[]))await K(A,"/");C.current&&(C.current.value="")}}),(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(cO,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),r?(0,d.jsxs)("button",{type:"button",onClick:r,"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,d.jsx)(cO,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(cO,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>C.current?.click(),title:"Upload files",children:(0,d.jsx)(lu,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>H("/"),title:"New file",children:(0,d.jsx)(cR,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>S("/"),title:"New folder",children:(0,d.jsx)(cK,{className:"h-3 w-3"})})]})]}),(0,d.jsxs)(cX,{children:[(0,d.jsx)(cY,{asChild:!0,children:(0,d.jsxs)("div",{className:(0,y.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",f&&"bg-blue-500/10"),onDragOver:e=>{w&&(e.preventDefault(),e.stopPropagation(),b("/"))},onDrop:e=>{w&&V(e,null)},children:[f&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,d.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,d.jsx)(lu,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,d.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===s.length?(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,d.jsxs)("div",{className:"text-center space-y-3",children:[(0,d.jsx)(cK,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,d.jsx)("div",{className:"contents",children:s.map(e=>G(e))})]})}),(0,d.jsxs)(ut,{children:[(0,d.jsxs)(ur,{onClick:()=>H("/"),children:[(0,d.jsx)(cR,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,d.jsxs)(ur,{onClick:()=>S("/"),children:[(0,d.jsx)(cK,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,d.jsxs)(ur,{onClick:()=>C.current?.click(),children:[(0,d.jsx)(lu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function ua(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);A&&(r=r.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,r)}return t}ur.displayName=c2.displayName,p.forwardRef(({className:e,children:A,checked:t,...r},n)=>(0,d.jsxs)(c4,{ref:n,className:(0,y.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:t,...r,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(c5,{children:(0,d.jsx)(S.A,{className:"h-4 w-4"})})}),A]})).displayName=c4.displayName,p.forwardRef(({className:e,children:A,...t},r)=>(0,d.jsxs)(c3,{ref:r,className:(0,y.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),...t,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(c5,{children:(0,d.jsx)(uA,{className:"h-2 w-2 fill-current"})})}),A]})).displayName=c3.displayName,p.forwardRef(({className:e,inset:A,...t},r)=>(0,d.jsx)(c1,{ref:r,className:(0,y.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",A&&"pl-8",e),...t})).displayName=c1.displayName,p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c6,{ref:t,className:(0,y.cn)("-mx-1 my-1 h-px bg-border",e),...A})).displayName=c6.displayName;function us(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,r=Array(A);t=e.length?e.apply(this,n):function(){for(var e=arguments.length,r=Array(e),a=0;a=e.length?e.apply(this,n):function(){for(var e=arguments.length,r=Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};up.initial(e),up.handler(A);var t={current:e},r=ul(uf)(t,A),n=ul(ug)(t),a=ul(up.changes)(e),s=ul(uh)(t);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return up.selector(e),e(t.current)},function(e){(function(){for(var e=arguments.length,A=Array(e),t=0;t{r.current=!1}:e,A)};function uT(){}function uM(e,A,t,r){var n,a,s,i,o,l;return n=e,a=r,n.editor.getModel(uK(n,a))||(s=e,i=A,o=t,l=r,s.editor.createModel(i,o,l?uK(s,l):void 0))}function uK(e,A){return e.Uri.parse(A)}(0,p.memo)(function({original:e,modified:A,language:t,originalLanguage:r,modifiedLanguage:n,originalModelPath:a,modifiedModelPath:s,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:o=!1,theme:l="light",loading:c="Loading...",options:u={},height:d="100%",width:h="100%",className:g,wrapperProps:f={},beforeMount:m=uT,onMount:B=uT}){let[w,v]=(0,p.useState)(!1),[x,y]=(0,p.useState)(!0),b=(0,p.useRef)(null),C=(0,p.useRef)(null),Q=(0,p.useRef)(null),F=(0,p.useRef)(B),U=(0,p.useRef)(m),E=(0,p.useRef)(!1);uL(()=>{let e=uj.init();return e.then(e=>(C.current=e)&&y(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let A;return b.current?(A=b.current?.getModel(),void(i||A?.original?.dispose(),o||A?.modified?.dispose(),b.current?.dispose())):e.cancel()}}),uD(()=>{if(b.current&&C.current){let A=b.current.getOriginalEditor(),n=uM(C.current,e||"",r||t||"text",a||"");n!==A.getModel()&&A.setModel(n)}},[a],w),uD(()=>{if(b.current&&C.current){let e=b.current.getModifiedEditor(),r=uM(C.current,A||"",n||t||"text",s||"");r!==e.getModel()&&e.setModel(r)}},[s],w),uD(()=>{let e=b.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(A||""):A!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:A||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[A],w),uD(()=>{b.current?.getModel()?.original.setValue(e||"")},[e],w),uD(()=>{let{original:e,modified:A}=b.current.getModel();C.current.editor.setModelLanguage(e,r||t||"text"),C.current.editor.setModelLanguage(A,n||t||"text")},[t,r,n],w),uD(()=>{C.current?.editor.setTheme(l)},[l],w),uD(()=>{b.current?.updateOptions(u)},[u],w);let k=(0,p.useCallback)(()=>{if(!C.current)return;U.current(C.current);let i=uM(C.current,e||"",r||t||"text",a||""),o=uM(C.current,A||"",n||t||"text",s||"");b.current?.setModel({original:i,modified:o})},[t,A,n,e,r,a,s]),j=(0,p.useCallback)(()=>{!E.current&&Q.current&&(b.current=C.current.editor.createDiffEditor(Q.current,{automaticLayout:!0,...u}),k(),C.current?.editor.setTheme(l),v(!0),E.current=!0)},[u,l,k]);return(0,p.useEffect)(()=>{w&&F.current(b.current,C.current)},[w]),(0,p.useEffect)(()=>{x||w||j()},[x,w,j]),p.createElement(uN,{width:h,height:d,isEditorReady:w,loading:c,_ref:Q,className:g,wrapperProps:f})});var uP=function(e){let A=(0,p.useRef)();return(0,p.useEffect)(()=>{A.current=e},[e]),A.current},uR=new Map,uO=(0,p.memo)(function({defaultValue:e,defaultLanguage:A,defaultPath:t,value:r,language:n,path:a,theme:s="light",line:i,loading:o="Loading...",options:l={},overrideServices:c={},saveViewState:u=!0,keepCurrentModel:d=!1,width:h="100%",height:g="100%",className:f,wrapperProps:m={},beforeMount:B=uT,onMount:w=uT,onChange:v,onValidate:x=uT}){let[y,b]=(0,p.useState)(!1),[C,Q]=(0,p.useState)(!0),F=(0,p.useRef)(null),U=(0,p.useRef)(null),E=(0,p.useRef)(null),k=(0,p.useRef)(w),j=(0,p.useRef)(B),I=(0,p.useRef)(),H=(0,p.useRef)(r),S=uP(a),N=(0,p.useRef)(!1),L=(0,p.useRef)(!1);uL(()=>{let e=uj.init();return e.then(e=>(F.current=e)&&Q(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>U.current?void(I.current?.dispose(),d?u&&uR.set(a,U.current.saveViewState()):U.current.getModel()?.dispose(),U.current.dispose()):e.cancel()}),uD(()=>{let s=uM(F.current,e||r||"",A||n||"",a||t||"");s!==U.current?.getModel()&&(u&&uR.set(S,U.current?.saveViewState()),U.current?.setModel(s),u&&U.current?.restoreViewState(uR.get(a)))},[a],y),uD(()=>{U.current?.updateOptions(l)},[l],y),uD(()=>{U.current&&void 0!==r&&(U.current.getOption(F.current.editor.EditorOption.readOnly)?U.current.setValue(r):r!==U.current.getValue()&&(L.current=!0,U.current.executeEdits("",[{range:U.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),U.current.pushUndoStop(),L.current=!1))},[r],y),uD(()=>{let e=U.current?.getModel();e&&n&&F.current?.editor.setModelLanguage(e,n)},[n],y),uD(()=>{void 0!==i&&U.current?.revealLine(i)},[i],y),uD(()=>{F.current?.editor.setTheme(s)},[s],y);let D=(0,p.useCallback)(()=>{if(!(!E.current||!F.current)&&!N.current){j.current(F.current);let o=a||t,d=uM(F.current,r||e||"",A||n||"",o||"");U.current=F.current?.editor.create(E.current,{model:d,automaticLayout:!0,...l},c),u&&U.current.restoreViewState(uR.get(o)),F.current.editor.setTheme(s),void 0!==i&&U.current.revealLine(i),b(!0),N.current=!0}},[e,A,t,r,n,a,l,c,u,s,i]);return(0,p.useEffect)(()=>{y&&k.current(U.current,F.current)},[y]),(0,p.useEffect)(()=>{C||y||D()},[C,y,D]),H.current=r,(0,p.useEffect)(()=>{y&&v&&(I.current?.dispose(),I.current=U.current?.onDidChangeModelContent(e=>{L.current||v(U.current.getValue(),e)}))},[y,v]),(0,p.useEffect)(()=>{if(y){let e=F.current.editor.onDidChangeMarkers(e=>{let A=U.current.getModel()?.uri;if(A&&e.find(e=>e.path===A.path)){let e=F.current.editor.getModelMarkers({resource:A});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[y,x]),p.createElement(uN,{width:h,height:g,isEditorReady:y,loading:o,_ref:E,className:f,wrapperProps:m})});let uV=(0,E.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"}]]),uG=(0,E.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 uz=t(3613);function uq({projectId:e,onFilesChange:A,onClose:t}){let[r,n]=(0,p.useState)(new Map),[a,s]=(0,p.useState)(null),{resolvedTheme:i}=(0,lN.D)(),[o,l]=(0,p.useState)(!1),c=(e,A)=>{A&&A.stopPropagation();let t=r.get(e);if((!t?.modified||confirm(`Close ${t.file.name} without saving?`))&&(n(A=>{let t=new Map(A);return t.delete(e),t}),a===e)){let A=Array.from(r.keys()).filter(A=>A!==e);s(A.length>0?A[A.length-1]:null)}},u=(0,p.useCallback)((e,A)=>{void 0!==e&&"text"===g(A).type&&n(t=>{let r=new Map(t),n=r.get(A);return n&&r.set(A,{...n,content:e,modified:n.file.content!==e}),r})},[]),h=(0,p.useCallback)(async A=>{let t=r.get(A);if(t&&t.modified)try{await m.vfs.init();let r=await m.vfs.updateFile(e,A,t.content);n(e=>{let n=new Map(e);return n.set(A,{file:r,content:t.content,modified:!1}),n}),window.dispatchEvent(new CustomEvent("fileContentChanged",{detail:{path:A,projectId:e}}))}catch(e){y.v.error("Failed to save file:",e)}},[r,e]);(0,p.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),a&&h(a))},[a,h]);let g=e=>{let A=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(A||""))return{type:"image",language:"plaintext"};let t={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 t[A||""]?{type:"text",language:t[A||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(A||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},f=e=>g(e).language,B=a?r.get(a):null;return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(uV,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),t?(0,d.jsxs)("button",{type:"button",onClick:t,"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,d.jsx)(uV,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(uV,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),B?.modified&&"text"===g(B.file.path).type&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>h(a),children:[(0,d.jsx)(uG,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===r.size?(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,d.jsxs)("div",{className:"text-center space-y-3",children:[(0,d.jsx)(k,{className:"h-12 w-12 mx-auto opacity-50"}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,d.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"border-b bg-muted/70",children:(0,d.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(r.entries()).map(([e,A])=>(0,d.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",a===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>s(e),children:[(0,d.jsxs)("span",{className:"text-sm",children:[A.file.name,A.modified&&(0,d.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:A=>c(e,A),children:(0,d.jsx)(N.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),B&&(0,d.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=g(B.file.path);return"image"===e.type?(0,d.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,d.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,d.jsx)(I,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:B.file.name})]}),(0,d.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,d.jsx)("img",{src:`data:image/${B.file.path.split(".").pop()};base64,${B.content}`,alt:B.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let A=e.target;if(A.style.display="none",!A.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',A.parentElement?.appendChild(e)}}})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,d.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,d.jsxs)("div",{className:"text-center space-y-4",children:[(0,d.jsx)(uz.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:B.file.name}),(0,d.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,d.jsx)(uO,{height:"100%",language:f(B.file.path),value:B.content,onChange:e=>u(e,B.file.path),theme:o?"dark"===i?"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 uW(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var uJ=t(8559);let uX=(0,E.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"}]]),u_=(0,E.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"}]]),uY=(0,E.A)("bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);var u$=t(1424),uZ=t(158);class u0{async initDB(){if(this.isInitialized)return;let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));await e.init(),this.isInitialized=!0}async getDB(){let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));return e.db.getDatabase()}getDebugEventsId(e){return`debug_events_${e}`}async loadEvents(e){await this.initDB();let A=await this.getDB(),t=this.getDebugEventsId(e);return new Promise((r,n)=>{let a=A.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let A=a.result;A&&A.events?(this.eventsCache.set(e,A.events),r(A.events)):r([])},a.onerror=()=>{y.v.error("Failed to load debug events from DB"),n(a.error)}})}async saveEvents(e,A){await this.initDB();let t=await this.getDB(),r={id:this.getDebugEventsId(e),projectId:e,events:A,lastUpdated:new Date().toISOString()};return new Promise((n,a)=>{let s=t.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);s.onsuccess=()=>{this.eventsCache.set(e,A),n()},s.onerror=()=>{y.v.error("Failed to save debug events to DB"),a(s.error)}})}async appendEvent(e,A){let t=this.eventsCache.get(e);t||(t=await this.loadEvents(e)),t.push(A),this.eventsCache.set(e,t),await this.saveEvents(e,t)}async clearEvents(e){this.eventsCache.delete(e),await this.saveEvents(e,[]),y.v.debug(`[DebugEventsState] Cleared debug events for project ${e}`)}async truncateEvents(e,A){this.eventsCache.set(e,A),await this.saveEvents(e,A),y.v.debug(`[DebugEventsState] Truncated debug events for project ${e} to ${A.length} events`)}async getEvents(e){let A=this.eventsCache.get(e);return A||(A=await this.loadEvents(e)),A}async deleteProject(e){await this.initDB();let A=await this.getDB(),t=this.getDebugEventsId(e);return new Promise((r,n)=>{let a=A.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);a.onsuccess=()=>{this.eventsCache.delete(e),r()},a.onerror=()=>{y.v.error("Failed to delete debug events from DB"),n(a.error)}})}constructor(){this.eventsCache=new Map,this.storeName="debugEvents",this.isInitialized=!1}}let u1=new u0,u2=(0,E.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"}]]),u4=(0,p.createContext)(null);u4.displayName="PanelGroupContext";let u3={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"},u5=h["useId".toString()],u6="function"==typeof u5?u5:()=>null,u8=0;function u9(e=null){let A=u6(),t=(0,p.useRef)(e||A||null);return null===t.current&&(t.current=""+u8++),null!=e?e:t.current}function u7({children:e,className:A="",collapsedSize:t,collapsible:r,defaultSize:n,forwardedRef:a,id:s,maxSize:i,minSize:o,onCollapse:l,onExpand:c,onResize:u,order:d,style:h,tagName:g="div",...f}){let m=(0,p.useContext)(u4);if(null===m)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:B,expandPanel:w,getPanelSize:v,getPanelStyle:x,groupId:y,isPanelCollapsed:b,reevaluatePanelConstraints:C,registerPanel:Q,resizePanel:F,unregisterPanel:U}=m,E=u9(s),k=(0,p.useRef)({callbacks:{onCollapse:l,onExpand:c,onResize:u},constraints:{collapsedSize:t,collapsible:r,defaultSize:n,maxSize:i,minSize:o},id:E,idIsFromProps:void 0!==s,order:d});(0,p.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,p.useImperativeHandle)(a,()=>({collapse:()=>{B(k.current)},expand:e=>{w(k.current,e)},getId:()=>E,getSize:()=>v(k.current),isCollapsed:()=>b(k.current),isExpanded:()=>!b(k.current),resize:e=>{F(k.current,e)}}),[B,w,v,b,E,F]);let j=x(k.current,n);return(0,p.createElement)(g,{...f,children:e,className:A,id:E,style:{...j,...h},[u3.groupId]:y,[u3.panel]:"",[u3.panelCollapsible]:r||void 0,[u3.panelId]:E,[u3.panelSize]:parseFloat(""+j.flexGrow).toFixed(1)})}let de=(0,p.forwardRef)((e,A)=>(0,p.createElement)(u7,{...e,forwardedRef:A}));u7.displayName="Panel",de.displayName="forwardRef(Panel)";let dA=null,dt=-1,dr=null;function dn(e,A,t){var n,a,s;0;let i=function(e,A,t){let r=(A&dg)!=0,n=(A&df)!=0,a=(A&dm)!=0,s=(A&dB)!=0;!1;if(A){if(r)if(a)return"se-resize";else if(s)return"ne-resize";else return"e-resize";else if(n)if(a)return"sw-resize";else if(s)return"nw-resize";else return"w-resize";else if(a)return"s-resize";else if(s)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,A,t);if(dA!==i){if(dA=i,null===dr){dr=document.createElement("style");r&&dr.setAttribute("nonce",r),document.head.appendChild(dr)}dt>=0&&(null==(s=dr.sheet)||s.removeRule(dt)),dt=null!=(n=null==(a=dr.sheet)?void 0:a.insertRule(`*{cursor: ${i} !important;}`))?n:-1}}function da(e){return"keydown"===e.type}function ds(e){return e.type.startsWith("pointer")}function di(e){return e.type.startsWith("mouse")}function dl(e){if(ds(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(di(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let dc=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function du(e){let A=e.length;for(;A--;){let t=e[A];if(dS(t,"Missing node"),function(e){let A=getComputedStyle(e);return!!("fixed"===A.position||"auto"!==A.zIndex&&("static"!==A.position||function(e){var A;let t=getComputedStyle(null!=(A=dh(e))?A:e).display;return"flex"===t||"inline-flex"===t}(e))||1>+A.opacity||"transform"in A&&"none"!==A.transform||"webkitTransform"in A&&"none"!==A.webkitTransform||"mixBlendMode"in A&&"normal"!==A.mixBlendMode||"filter"in A&&"none"!==A.filter||"webkitFilter"in A&&"none"!==A.webkitFilter||"isolation"in A&&"isolate"===A.isolation||dc.test(A.willChange))||"touch"===A.webkitOverflowScrolling}(t))return t}return null}function dd(e){return e&&Number(getComputedStyle(e).zIndex)||0}function dp(e){let A=[];for(;e;)A.push(e),e=dh(e);return A}function dh(e){let{parentNode:A}=e;return A&&A instanceof ShadowRoot?A.host:A}let dg=1,df=2,dm=4,dB=8,dw="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),dv=[],dx=!1,dy=new Map,db=new Map,dC=new Set;function dQ(e){let{target:A}=e,{x:t,y:r}=dl(e);dx=!0,dk({target:A,x:t,y:r}),dI(),dv.length>0&&(dH("down",e),dj(),e.preventDefault(),dE(A)||e.stopImmediatePropagation())}function dF(e){let{x:A,y:t}=dl(e);if(dx&&"pointerleave"!==e.type&&0===e.buttons&&(dx=!1,dH("up",e)),!dx){let{target:r}=e;dk({target:r,x:A,y:t})}dH("move",e),dj(),dv.length>0&&e.preventDefault()}function dU(e){let{target:A}=e,{x:t,y:r}=dl(e);db.clear(),dx=!1,dv.length>0&&(e.preventDefault(),dE(A)||e.stopImmediatePropagation()),dH("up",e),dk({target:A,x:t,y:r}),dj(),dI()}function dE(e){let A=e;for(;A;){if(A.hasAttribute(u3.resizeHandle))return!0;A=A.parentElement}return!1}function dk({target:e,x:A,y:t}){dv.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),dC.forEach(e=>{let{element:n,hitAreaMargins:a}=e,s=n.getBoundingClientRect(),{bottom:i,left:o,right:l,top:c}=s,u=dw?a.coarse:a.fine;if(A>=o-u&&A<=l+u&&t>=c-u&&t<=i+u){if(null!==r&&document.contains(r)&&n!==r&&!n.contains(r)&&!r.contains(n)&&function(e,A){let t;if(e===A)throw Error("Cannot compare node with itself");let r={a:dp(e),b:dp(A)};for(;r.a.at(-1)===r.b.at(-1);)e=r.a.pop(),A=r.b.pop(),t=e;dS(t,"Stacking order can only be calculated for elements with a common ancestor");let n={a:dd(du(r.a)),b:dd(du(r.b))};if(n.a===n.b){let e=t.childNodes,A={a:r.a.at(-1),b:r.b.at(-1)},n=e.length;for(;n--;){let t=e[n];if(t===A.a)return 1;if(t===A.b)return -1}}return Math.sign(n.a-n.b)}(r,n)>0){let e=r,A=!1;for(;e&&!e.contains(n);){var d,p;if(d=e.getBoundingClientRect(),p=s,d.xp.x&&d.yp.y){A=!0;break}e=e.parentElement}if(A)return}dv.push(e)}})}function dj(){let e=!1,A=!1;dv.forEach(t=>{let{direction:r}=t;"horizontal"===r?e=!0:A=!0});let t=0;db.forEach(e=>{t|=e}),e&&A?dn("intersection",t,dx):e?dn("horizontal",t,dx):A?dn("vertical",t,dx):null!==dr&&(document.head.removeChild(dr),dA=null,dr=null,dt=-1)}function dI(){var e;null==(e=n)||e.abort();let A={capture:!0,signal:(n=new AbortController).signal};dC.size&&(dx?(dv.length>0&&dy.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("contextmenu",dU,A),r.addEventListener("pointerleave",dF,A),r.addEventListener("pointermove",dF,A))}),dy.forEach((e,t)=>{let{body:r}=t;r.addEventListener("pointerup",dU,A),r.addEventListener("pointercancel",dU,A)})):dy.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("pointerdown",dQ,A),r.addEventListener("pointermove",dF,A))}))}function dH(e,A){dC.forEach(t=>{let{setResizeHandlerState:r}=t;r(e,dv.includes(t),A)})}function dS(e,A){if(!e)throw console.error(A),Error(A)}function dN(e,A,t=10){return e.toFixed(t)===A.toFixed(t)?0:e>A?1:-1}function dL(e,A,t=10){return 0===dN(e,A,t)}function dD(e,A,t){return 0===dN(e,A,t)}function dT({panelConstraints:e,panelIndex:A,size:t}){let r=e[A];dS(null!=r,`Panel constraints not found for index ${A}`);let{collapsedSize:n=0,collapsible:a,maxSize:s=100,minSize:i=0}=r;return 0>dN(t,i)&&(t=a&&0>dN(t,(n+i)/2)?n:i),t=parseFloat((t=Math.min(s,t)).toFixed(10))}function dM({delta:e,initialLayout:A,panelConstraints:t,pivotIndices:r,prevLayout:n,trigger:a}){if(dD(e,0))return A;let s=[...A],[i,o]=r;dS(null!=i,"Invalid first pivot index"),dS(null!=o,"Invalid second pivot index");let l=0;if("keyboard"===a){{let r=e<0?o:i,n=t[r];dS(n,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:s,minSize:l=0}=n;if(s){let t=A[r];if(dS(null!=t,`Previous layout not found for panel index ${r}`),dD(t,a)){let A=l-t;dN(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}{let r=e<0?i:o,n=t[r];dS(n,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:s,minSize:l=0}=n;if(s){let t=A[r];if(dS(null!=t,`Previous layout not found for panel index ${r}`),dD(t,l)){let A=t-a;dN(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}}{let r=e<0?1:-1,n=e<0?o:i,a=0;for(;;){let e=A[n];if(dS(null!=e,`Previous layout not found for panel index ${n}`),a+=dT({panelConstraints:t,panelIndex:n,size:100})-e,(n+=r)<0||n>=t.length)break}let s=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-s:s}{let r=e<0?i:o;for(;r>=0&&r=0))break;e<0?r--:r++}}if(function(e,A,t){if(e.length!==A.length)return!1;for(let t=0;t=0&&r0?r--:r++}}}return dD(s.reduce((e,A)=>A+e,0),100)?s:n}function dK(e,A=document){return Array.from(A.querySelectorAll(`[${u3.resizeHandleId}][data-panel-group-id="${e}"]`))}function dP(e,A,t=document){let r=dK(e,t).findIndex(e=>e.getAttribute(u3.resizeHandleId)===A);return null!=r?r:null}function dR(e,A,t){let r=dP(e,A,t);return null!=r?[r,r+1]:[-1,-1]}function dO(e,A=document){if((A instanceof HTMLElement||"object"==typeof A&&null!==A&&"tagName"in A&&"getAttribute"in A)&&A.dataset.panelGroupId==e)return A;let t=A.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function dV(e,A=document){let t=A.querySelector(`[${u3.resizeHandleId}="${e}"]`);return t||null}function dG(e,A){let{x:t,y:r}=dl(A);return"horizontal"===e?t:r}function dz(e,A,t){A.forEach((A,r)=>{let n=e[r];dS(n,`Panel data not found for index ${r}`);let{callbacks:a,constraints:s,id:i}=n,{collapsedSize:o=0,collapsible:l}=s,c=t[i];if(null==c||A!==c){t[i]=A;let{onCollapse:e,onExpand:r,onResize:n}=a;n&&n(A,c),l&&(e||r)&&(r&&(null==c||dL(c,o))&&!dL(A,o)&&r(),e&&(null==c||!dL(c,o))&&dL(A,o)&&e())}})}function dq(e,A){if(e.length!==A.length)return!1;for(let t=0;tlocalStorage.getItem(e),e.setItem=(e,A)=>{localStorage.setItem(e,A)};else throw Error("localStorage not supported in this environment")}catch(A){console.error(A),e.getItem=()=>null,e.setItem=()=>{}}}function dJ(e){return`react-resizable-panels:${e}`}function dX(e,A,t,r,n){var a;let s=dJ(e),i=A.map(e=>{let{constraints:A,id:t,idIsFromProps:r,order:n}=e;return r?t:n?`${n}:${JSON.stringify(A)}`:JSON.stringify(A)}).sort((e,A)=>e.localeCompare(A)).join(","),o=null!=(a=function(e,A){try{let t=dJ(e),r=A.getItem(t);if(r){let e=JSON.parse(r);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,n))?a:{};o[i]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{n.setItem(s,JSON.stringify(o))}catch(e){console.error(e)}}let d_={getItem:e=>(dW(d_),d_.getItem(e)),setItem:(e,A)=>{dW(d_),d_.setItem(e,A)}},dY={};function d$({autoSaveId:e=null,children:A,className:t="",direction:r,forwardedRef:n,id:a=null,onLayout:s=null,keyboardResizeBy:i=null,storage:o=d_,style:l,tagName:c="div",...u}){let d=u9(a),h=(0,p.useRef)(null),[g,f]=(0,p.useState)(null),[m,B]=(0,p.useState)([]),w=function(){let[e,A]=(0,p.useState)(0);return(0,p.useCallback)(()=>A(e=>e+1),[])}(),v=(0,p.useRef)({}),x=(0,p.useRef)(new Map),y=(0,p.useRef)(0),b=(0,p.useRef)({autoSaveId:e,direction:r,dragState:g,id:d,keyboardResizeBy:i,onLayout:s,storage:o}),C=(0,p.useRef)({layout:m,panelDataArray:[],panelDataArrayChanged:!1});(0,p.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,p.useImperativeHandle)(n,()=>({getId:()=>b.current.id,getLayout:()=>{let{layout:e}=C.current;return e},setLayout:e=>{let{onLayout:A}=b.current,{layout:t,panelDataArray:r}=C.current,n=function({layout:e,panelConstraints:A}){let t=[...e],r=t.reduce((e,A)=>e+A,0);if(t.length!==A.length)throw Error(`Invalid ${A.length} panel layout: ${t.map(e=>`${e}%`).join(", ")}`);if(!dD(r,100)&&t.length>0)for(let e=0;ee.constraints)});!function(e,A){if(e.length!==A.length)return!1;for(let t=0;t{if(!a)return;let e=A.current;dS(e,"Eager values not found");let{panelDataArray:n}=e;dS(null!=dO(t,a),`No group found for id "${t}"`);let i=dK(t,a);dS(i,`No resize handles found for group id "${t}"`);let o=i.map(e=>{let A=e.getAttribute(u3.resizeHandleId);dS(A,"Resize handle element has no handle id attribute");let[i,o]=function(e,A,t,r=document){var n,a,s,i;let o=dV(A,r),l=dK(e,r),c=o?l.indexOf(o):-1;return[null!=(n=null==(a=t[c])?void 0:a.id)?n:null,null!=(s=null==(i=t[c+1])?void 0:i.id)?s:null]}(t,A,n,a);if(null==i||null==o)return()=>{};let l=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let o=n.findIndex(e=>e.id===i);if(o>=0){let e=n[o];dS(e,`No panel data found for index ${o}`);let i=r[o],{collapsedSize:l=0,collapsible:c,minSize:u=0}=e.constraints;if(null!=i&&c){let e=dM({delta:dD(i,l)?u-l:l-i,initialLayout:r,panelConstraints:n.map(e=>e.constraints),pivotIndices:dR(t,A,a),prevLayout:r,trigger:"keyboard"});r!==e&&s(e)}}}};return e.addEventListener("keydown",l),()=>{e.removeEventListener("keydown",l)}});return()=>{o.forEach(e=>e())}},[a,e,A,t,r,n,s])}({committedValuesRef:b,eagerValuesRef:C,groupId:d,layout:m,panelDataArray:C.current.panelDataArray,setLayout:B,panelGroupElement:h.current}),(0,p.useEffect)(()=>{let{panelDataArray:A}=C.current;if(e){if(0===m.length||m.length!==A.length)return;let t=dY[e];null==t&&(t=function(e,A=10){let t=null;return(...r)=>{null!==t&&clearTimeout(t),t=setTimeout(()=>{e(...r)},A)}}(dX,100),dY[e]=t),t(e,[...A],new Map(x.current),m,o)}},[e,m,o]),(0,p.useEffect)(()=>{});let Q=(0,p.useCallback)(e=>{let{onLayout:A}=b.current,{layout:t,panelDataArray:r}=C.current;if(e.constraints.collapsible){let n=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:s,pivotIndices:i}=d1(r,e,t);if(dS(null!=s,`Panel size not found for panel "${e.id}"`),!dL(s,a)){x.current.set(e.id,s);let o=dM({delta:d0(r,e)===r.length-1?s-a:a-s,initialLayout:t,panelConstraints:n,pivotIndices:i,prevLayout:t,trigger:"imperative-api"});dq(t,o)||(B(o),C.current.layout=o,A&&A(o),dz(r,o,v.current))}}},[]),F=(0,p.useCallback)((e,A)=>{let{onLayout:t}=b.current,{layout:r,panelDataArray:n}=C.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:s=0,panelSize:i=0,minSize:o=0,pivotIndices:l}=d1(n,e,r),c=null!=A?A:o;if(dL(i,s)){let A=x.current.get(e.id),s=null!=A&&A>=c?A:c,o=dM({delta:d0(n,e)===n.length-1?i-s:s-i,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:"imperative-api"});dq(r,o)||(B(o),C.current.layout=o,t&&t(o),dz(n,o,v.current))}}},[]),U=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{panelSize:r}=d1(t,e,A);return dS(null!=r,`Panel size not found for panel "${e.id}"`),r},[]),E=(0,p.useCallback)((e,A)=>{let{panelDataArray:t}=C.current,r=d0(t,e);return function({defaultSize:e,dragState:A,layout:t,panelData:r,panelIndex:n,precision:a=3}){let s,i=t[n];return{flexBasis:0,flexGrow:null==i?void 0!=e?e.toFixed(a):"1":1===r.length?"1":i.toFixed(a),flexShrink:1,overflow:"hidden",pointerEvents:null!==A?"none":void 0}}({defaultSize:A,dragState:g,layout:m,panelData:t,panelIndex:r})},[g,m]),k=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{collapsedSize:r=0,collapsible:n,panelSize:a}=d1(t,e,A);return dS(null!=a,`Panel size not found for panel "${e.id}"`),!0===n&&dL(a,r)},[]),j=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{collapsedSize:r=0,collapsible:n,panelSize:a}=d1(t,e,A);return dS(null!=a,`Panel size not found for panel "${e.id}"`),!n||dN(a,r)>0},[]),I=(0,p.useCallback)(e=>{let{panelDataArray:A}=C.current;A.push(e),A.sort((e,A)=>{let t=e.order,r=A.order;return null==t&&null==r?0:null==t?-1:null==r?1:t-r}),C.current.panelDataArrayChanged=!0,w()},[w]),H=(0,p.useCallback)(e=>{let A=!1,t=h.current;return t&&"rtl"===window.getComputedStyle(t,null).getPropertyValue("direction")&&(A=!0),function(t){var r,n;t.preventDefault();let a=h.current;if(!a)return()=>null;let{direction:s,dragState:i,id:o,keyboardResizeBy:l,onLayout:c}=b.current,{layout:u,panelDataArray:d}=C.current,{initialLayout:p}=null!=i?i:{},g=dR(o,e,a),f=function(e,A,t,r,n,a){if(da(e)){let A="horizontal"===t,r=0;r=e.shiftKey?100:null!=n?n:10;let a=0;switch(e.key){case"ArrowDown":a=A?0:r;break;case"ArrowLeft":a=A?-r:0;break;case"ArrowRight":a=A?r:0;break;case"ArrowUp":a=A?0:-r;break;case"End":a=100;break;case"Home":a=-100}return a}return null==r?0:function(e,A,t,r,n){let a="horizontal"===t,s=dV(A,n);dS(s,`No resize handle element found for id "${A}"`);let i=s.getAttribute(u3.groupId);dS(i,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=r,l=dG(t,e),c=dO(i,n);dS(c,`No group element found for id "${i}"`);let u=c.getBoundingClientRect();return(l-o)/(a?u.width:u.height)*100}(e,A,t,r,a)}(t,e,s,i,l,a),m="horizontal"===s;m&&A&&(f=-f);let w=dM({delta:f,initialLayout:null!=p?p:u,panelConstraints:d.map(e=>e.constraints),pivotIndices:g,prevLayout:u,trigger:da(t)?"keyboard":"mouse-or-touch"}),x=!dq(u,w);(ds(t)||di(t))&&y.current!=f&&((y.current=f,x||0===f)?db.set(e,0):m?(r=f<0?dg:df,db.set(e,r)):(n=f<0?dm:dB,db.set(e,n))),x&&(B(w),C.current.layout=w,c&&c(w),dz(d,w,v.current))}},[]),S=(0,p.useCallback)((e,A)=>{let{onLayout:t}=b.current,{layout:r,panelDataArray:n}=C.current,a=n.map(e=>e.constraints),{panelSize:s,pivotIndices:i}=d1(n,e,r);dS(null!=s,`Panel size not found for panel "${e.id}"`);let o=dM({delta:d0(n,e)===n.length-1?s-A:A-s,initialLayout:r,panelConstraints:a,pivotIndices:i,prevLayout:r,trigger:"imperative-api"});dq(r,o)||(B(o),C.current.layout=o,t&&t(o),dz(n,o,v.current))},[]),N=(0,p.useCallback)((e,A)=>{let{layout:t,panelDataArray:r}=C.current,{collapsedSize:n=0,collapsible:a}=A,{collapsedSize:s=0,collapsible:i,maxSize:o=100,minSize:l=0}=e.constraints,{panelSize:c}=d1(r,e,t);null!=c&&(a&&i&&dL(c,n)?dL(n,s)||S(e,s):co&&S(e,o))},[S]),L=(0,p.useCallback)((e,A)=>{let{direction:t}=b.current,{layout:r}=C.current;if(!h.current)return;let n=dV(e,h.current);dS(n,`Drag handle element not found for id "${e}"`);let a=dG(t,A);f({dragHandleId:e,dragHandleRect:n.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),D=(0,p.useCallback)(()=>{f(null)},[]),T=(0,p.useCallback)(e=>{let{panelDataArray:A}=C.current,t=d0(A,e);t>=0&&(A.splice(t,1),delete v.current[e.id],C.current.panelDataArrayChanged=!0,w())},[w]),M=(0,p.useMemo)(()=>({collapsePanel:Q,direction:r,dragState:g,expandPanel:F,getPanelSize:U,getPanelStyle:E,groupId:d,isPanelCollapsed:k,isPanelExpanded:j,reevaluatePanelConstraints:N,registerPanel:I,registerResizeHandle:H,resizePanel:S,startDragging:L,stopDragging:D,unregisterPanel:T,panelGroupElement:h.current}),[Q,g,r,F,U,E,d,k,j,N,I,H,S,L,D,T]);return(0,p.createElement)(u4.Provider,{value:M},(0,p.createElement)(c,{...u,children:A,className:t,id:a,ref:h,style:{display:"flex",flexDirection:"horizontal"===r?"row":"column",height:"100%",overflow:"hidden",width:"100%",...l},[u3.group]:"",[u3.groupDirection]:r,[u3.groupId]:d}))}let dZ=(0,p.forwardRef)((e,A)=>(0,p.createElement)(d$,{...e,forwardedRef:A}));function d0(e,A){return e.findIndex(e=>e===A||e.id===A.id)}function d1(e,A,t){let r=d0(e,A),n=r===e.length-1,a=t[r];return{...A.constraints,panelSize:a,pivotIndices:n?[r-1,r]:[r,r+1]}}function d2({children:e=null,className:A="",disabled:t=!1,hitAreaMargins:r,id:n,onBlur:a,onClick:s,onDragging:i,onFocus:o,onPointerDown:l,onPointerUp:c,style:u={},tabIndex:d=0,tagName:h="div",...g}){var f,m;let B=(0,p.useRef)(null),w=(0,p.useRef)({onClick:s,onDragging:i,onPointerDown:l,onPointerUp:c});(0,p.useEffect)(()=>{w.current.onClick=s,w.current.onDragging=i,w.current.onPointerDown=l,w.current.onPointerUp=c});let v=(0,p.useContext)(u4);if(null===v)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:x,groupId:y,registerResizeHandle:b,startDragging:C,stopDragging:Q,panelGroupElement:F}=v,U=u9(n),[E,k]=(0,p.useState)("inactive"),[j,I]=(0,p.useState)(!1),[H,S]=(0,p.useState)(null),N=(0,p.useRef)({state:E});(0,p.useEffect)(()=>{if(t)S(null);else{let e=b(U);S(()=>e)}},[t,U,b]);let L=null!=(f=null==r?void 0:r.coarse)?f:15,D=null!=(m=null==r?void 0:r.fine)?m:5;return(0,p.useEffect)(()=>{if(t||null==H)return;let e=B.current;dS(e,"Element ref not attached");let A=!1;return function(e,A,t,r,n){var a;let{ownerDocument:s}=A,i={direction:t,element:A,hitAreaMargins:r,setResizeHandlerState:n},o=null!=(a=dy.get(s))?a:0;return dy.set(s,o+1),dC.add(i),dI(),function(){var A;db.delete(e),dC.delete(i);let t=null!=(A=dy.get(s))?A:1;if(dy.set(s,t-1),dI(),1===t&&dy.delete(s),dv.includes(i)){let e=dv.indexOf(i);e>=0&&dv.splice(e,1),dj(),n("up",!0,null)}}}(U,e,x,{coarse:L,fine:D},(e,t,r)=>{if(!t)return void k("inactive");switch(e){case"down":{k("drag"),A=!1,dS(r,'Expected event to be defined for "down" action'),C(U,r);let{onDragging:e,onPointerDown:t}=w.current;null==e||e(!0),null==t||t();break}case"move":{let{state:e}=N.current;A=!0,"drag"!==e&&k("hover"),dS(r,'Expected event to be defined for "move" action'),H(r);break}case"up":{k("hover"),Q();let{onClick:e,onDragging:t,onPointerUp:r}=w.current;null==t||t(!1),null==r||r(),A||null==e||e()}}})},[L,x,t,D,b,U,H,C,Q]),!function({disabled:e,handleId:A,resizeHandler:t,panelGroupElement:r}){(0,p.useEffect)(()=>{if(e||null==t||null==r)return;let n=dV(A,r);if(null==n)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),t(e);break;case"F6":{e.preventDefault();let t=n.getAttribute(u3.groupId);dS(t,`No group element found for id "${t}"`);let a=dK(t,r),s=dP(t,A,r);dS(null!==s,`No resize element found for id "${A}"`);let i=e.shiftKey?s>0?s-1:a.length-1:s+1{n.removeEventListener("keydown",a)}},[r,e,A,t])}({disabled:t,handleId:U,resizeHandler:H,panelGroupElement:F}),(0,p.createElement)(h,{...g,children:e,className:A,id:n,onBlur:()=>{I(!1),null==a||a()},onFocus:()=>{I(!0),null==o||o()},ref:B,role:"separator",style:{touchAction:"none",userSelect:"none",...u},tabIndex:d,[u3.groupDirection]:x,[u3.groupId]:y,[u3.resizeHandle]:"",[u3.resizeHandleActive]:"drag"===E?"pointer":j?"keyboard":void 0,[u3.resizeHandleEnabled]:!t,[u3.resizeHandleId]:U,[u3.resizeHandleState]:E})}d$.displayName="PanelGroup",dZ.displayName="forwardRef(PanelGroup)",d2.displayName="PanelResizeHandle";let d4=({className:e,...A})=>(0,d.jsx)(dZ,{className:(0,y.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...A}),d3=({withHandle:e,className:A,...t})=>(0,d.jsx)(d2,{className:(0,y.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",A),...t,children:e&&(0,d.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,d.jsx)(u2,{className:"h-3 w-3 text-muted-foreground/50"})})});var d5=t(3589);function d6({events:e,onClear:A,onClose:t}){let[r,n]=(0,p.useState)(""),[a,s]=(0,p.useState)(!0),i=(0,p.useRef)(null),[o,l]=(0,p.useState)(!0),c=(0,p.useMemo)(()=>{let A=[],t=null;for(let r of e)"assistant_delta"===r.event||"tool_param_delta"===r.event?t&&t.event===r.event?(t.count=(t.count||1)+1,t.data.all||(t.data={all:[t.data]}),t.data.all.push(r.data)):(t&&A.push(t),t={...r,count:1}):(t&&(A.push(t),t=null),A.push(r));return t&&A.push(t),A},[e]),u=r?c.filter(e=>e.event.toLowerCase().includes(r.toLowerCase())):c,h=e.reduce((e,A)=>(e[A.event]=(e[A.event]||0)+1,e),{});return(0,d.jsxs)("div",{className:"h-full flex flex-col bg-card border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-border bg-muted/30 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(uY,{className:"h-4 w-4 md:hidden"}),t?(0,d.jsxs)("button",{type:"button",onClick:t,"aria-label":"Hide debug panel",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,d.jsx)(uY,{className:"h-4 w-4 transition-opacity group-hover:opacity-0"}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(uY,{className:"hidden h-4 w-4 md:inline-flex"}),(0,d.jsx)("span",{className:"font-semibold text-sm",children:"Debug Events"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",u.length,"/",e.length,")"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:()=>{A?.()},className:"h-7 px-2 hover:bg-muted",title:"Clear all events",children:(0,d.jsx)(G,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:()=>{let A=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`debug-events-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},className:"h-7 px-2 text-xs hover:bg-muted",title:"Export to JSON",children:"Export"})]})]}),(0,d.jsx)("div",{className:"p-2 border-b border-border bg-muted/20 text-xs",children:(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(h).map(([e,A])=>(0,d.jsxs)("button",{onClick:()=>n(r===e?"":e),className:`px-2 py-1 rounded ${r===e?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:[e," (",A,")"]},e))})}),(0,d.jsx)("div",{className:"p-2 border-b border-border",children:(0,d.jsx)("input",{type:"text",placeholder:"Filter events...",value:r,onChange:e=>n(e.target.value),className:"w-full px-2 py-1 text-xs rounded bg-background border border-border"})}),(0,d.jsx)("div",{className:"p-2 border-b border-border flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-xs flex items-center gap-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:o,onChange:e=>l(e.target.checked),className:"rounded"}),"Auto-scroll"]})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[0===u.length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center p-4",children:"No events yet. Events will appear here as they occur."}):u.map(e=>(0,d.jsx)(d8,{event:e},e.id)),(0,d.jsx)("div",{ref:i})]})]})}function d8({event:e}){var A;let[t,r]=(0,p.useState)(!1),n=new Date(e.timestamp).toLocaleTimeString();return(0,d.jsxs)(l0,{open:t,onOpenChange:r,children:[(0,d.jsx)(l1,{className:"w-full text-left",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 p-1.5 rounded hover:bg-muted/50 text-xs",children:[t?(0,d.jsx)(d5.A,{className:"h-3 w-3"}):(0,d.jsx)(lD.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-muted-foreground font-mono",children:n}),(0,d.jsx)("span",{className:`font-semibold ${(A=e.event).includes("error")||A.includes("failed")?"text-red-500":A.includes("retry")?"text-yellow-500":A.includes("completed")||A.includes("success")?"text-green-500":A.includes("tool")?"text-blue-500":A.includes("agent")?"text-purple-500":A.includes("plan")?"text-orange-500":"text-foreground"}`,children:e.event}),e.count&&e.count>1&&(0,d.jsxs)("span",{className:"text-muted-foreground font-mono",children:["(",e.count,")"]})]})}),(0,d.jsx)(l2,{children:(0,d.jsx)("div",{className:"ml-6 p-2 bg-muted/30 rounded text-xs font-mono overflow-x-auto",children:(0,d.jsx)("pre",{children:JSON.stringify(e.data,null,2)})})})]})}var d9=t(5336),d7=t(5071);let pe=(0,E.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"}]]),pA=(0,E.A)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),pt=(0,E.A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),pr=(0,E.A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),pn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pa=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ps={};function pi(e,A){return((A||ps).jsx?pa:pn).test(e)}let po=/[ \t\n\f\r]/g;function pl(e){return""===e.replace(po,"")}class pc{constructor(e,A,t){this.normal=A,this.property=e,t&&(this.space=t)}}function pu(e,A){let t={},r={};for(let A of e)Object.assign(t,A.property),Object.assign(r,A.normal);return new pc(t,r,A)}function pd(e){return e.toLowerCase()}pc.prototype.normal={},pc.prototype.property={},pc.prototype.space=void 0;class pp{constructor(e,A){this.attribute=A,this.property=e}}pp.prototype.attribute="",pp.prototype.booleanish=!1,pp.prototype.boolean=!1,pp.prototype.commaOrSpaceSeparated=!1,pp.prototype.commaSeparated=!1,pp.prototype.defined=!1,pp.prototype.mustUseProperty=!1,pp.prototype.number=!1,pp.prototype.overloadedBoolean=!1,pp.prototype.property="",pp.prototype.spaceSeparated=!1,pp.prototype.space=void 0;let ph=0,pg=py(),pf=py(),pm=py(),pB=py(),pw=py(),pv=py(),px=py();function py(){return 2**++ph}let pb=Object.keys(c);class pC extends pp{constructor(e,A,t,r){let n=-1;if(super(e,A),function(e,A,t){t&&(e[A]=t)}(this,"space",r),"number"==typeof t)for(;++n"role"===A?A:"aria-"+A.slice(4).toLowerCase()});function pU(e,A){return A in e?e[A]:A}function pE(e,A){return pU(e,A.toLowerCase())}let pk=pQ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pv,acceptCharset:pw,accessKey:pw,action:null,allow:null,allowFullScreen:pg,allowPaymentRequest:pg,allowUserMedia:pg,alt:null,as:null,async:pg,autoCapitalize:null,autoComplete:pw,autoFocus:pg,autoPlay:pg,blocking:pw,capture:null,charSet:null,checked:pg,cite:null,className:pw,cols:pB,colSpan:null,content:null,contentEditable:pf,controls:pg,controlsList:pw,coords:pB|pv,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pg,defer:pg,dir:null,dirName:null,disabled:pg,download:pm,draggable:pf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pg,formTarget:null,headers:pw,height:pB,hidden:pm,high:pB,href:null,hrefLang:null,htmlFor:pw,httpEquiv:pw,id:null,imageSizes:null,imageSrcSet:null,inert:pg,inputMode:null,integrity:null,is:null,isMap:pg,itemId:null,itemProp:pw,itemRef:pw,itemScope:pg,itemType:pw,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pg,low:pB,manifest:null,max:null,maxLength:pB,media:null,method:null,min:null,minLength:pB,multiple:pg,muted:pg,name:null,nonce:null,noModule:pg,noValidate:pg,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:pg,optimum:pB,pattern:null,ping:pw,placeholder:null,playsInline:pg,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pg,referrerPolicy:null,rel:pw,required:pg,reversed:pg,rows:pB,rowSpan:pB,sandbox:pw,scope:null,scoped:pg,seamless:pg,selected:pg,shadowRootClonable:pg,shadowRootDelegatesFocus:pg,shadowRootMode:null,shape:null,size:pB,sizes:null,slot:null,span:pB,spellCheck:pf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pB,step:null,style:null,tabIndex:pB,target:null,title:null,translate:null,type:null,typeMustMatch:pg,useMap:null,value:pf,width:pB,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pw,axis:null,background:null,bgColor:null,border:pB,borderColor:null,bottomMargin:pB,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pg,declare:pg,event:null,face:null,frame:null,frameBorder:null,hSpace:pB,leftMargin:pB,link:null,longDesc:null,lowSrc:null,marginHeight:pB,marginWidth:pB,noResize:pg,noHref:pg,noShade:pg,noWrap:pg,object:null,profile:null,prompt:null,rev:null,rightMargin:pB,rules:null,scheme:null,scrolling:pf,standby:null,summary:null,text:null,topMargin:pB,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pB,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:pg,disableRemotePlayback:pg,prefix:null,property:null,results:pB,security:null,unselectable:null},space:"html",transform:pE}),pj=pQ({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:px,accentHeight:pB,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pB,amplitude:pB,arabicForm:null,ascent:pB,attributeName:null,attributeType:null,azimuth:pB,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pB,by:null,calcMode:null,capHeight:pB,className:pw,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:pB,diffuseConstant:pB,direction:null,display:null,dur:null,divisor:pB,dominantBaseline:null,download:pg,dx:null,dy:null,edgeMode:null,editable:null,elevation:pB,enableBackground:null,end:null,event:null,exponent:pB,externalResourcesRequired:null,fill:null,fillOpacity:pB,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:pv,g2:pv,glyphName:pv,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pB,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pB,horizOriginX:pB,horizOriginY:pB,id:null,ideographic:pB,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pB,k:pB,k1:pB,k2:pB,k3:pB,k4:pB,kernelMatrix:px,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pB,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:pB,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:pB,overlineThickness:pB,paintOrder:null,panose1:null,path:null,pathLength:pB,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pw,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pB,pointsAtY:pB,pointsAtZ:pB,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:px,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:px,rev:px,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:px,requiredFeatures:px,requiredFonts:px,requiredFormats:px,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:pB,specularExponent:pB,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pB,strikethroughThickness:pB,string:null,stroke:null,strokeDashArray:px,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pB,strokeOpacity:pB,strokeWidth:null,style:null,surfaceScale:pB,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:px,tabIndex:pB,tableValues:null,target:null,targetX:pB,targetY:pB,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:px,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pB,underlineThickness:pB,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pB,values:null,vAlphabetic:pB,vMathematical:pB,vectorEffect:null,vHanging:pB,vIdeographic:pB,version:null,vertAdvY:pB,vertOriginX:pB,vertOriginY:pB,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pB,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pU}),pI=pQ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,A)=>"xlink:"+A.slice(5).toLowerCase()}),pH=pQ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pE}),pS=pQ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,A)=>"xml:"+A.slice(3).toLowerCase()}),pN=pu([pF,pk,pI,pH,pS],"html"),pL=pu([pF,pj,pI,pH,pS],"svg"),pD=/[A-Z]/g,pT=/-[a-z]/g,pM=/^data[-\w.:]+$/i;function pK(e){return"-"+e.toLowerCase()}function pP(e){return e.charAt(1).toUpperCase()}let pR={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 pO=t(8739);let pV=pz("end"),pG=pz("start");function pz(e){return function(A){let t=A&&A.position&&A.position[e]||{};if("number"==typeof t.line&&t.line>0&&"number"==typeof t.column&&t.column>0)return{line:t.line,column:t.column,offset:"number"==typeof t.offset&&t.offset>-1?t.offset:void 0}}}function pq(e){return e&&"object"==typeof e?"position"in e||"type"in e?pJ(e.position):"start"in e||"end"in e?pJ(e):"line"in e||"column"in e?pW(e):"":""}function pW(e){return pX(e&&e.line)+":"+pX(e&&e.column)}function pJ(e){return pW(e&&e.start)+"-"+pW(e&&e.end)}function pX(e){return e&&"number"==typeof e?e:1}class p_ extends Error{constructor(e,A,t){super(),"string"==typeof A&&(t=A,A=void 0);let r="",n={},a=!1;if(A&&(n="line"in A&&"column"in A||"start"in A&&"end"in A?{place:A}:"type"in A?{ancestors:[A],place:A.position}:{...A}),"string"==typeof e?r=e:!n.cause&&e&&(a=!0,r=e.message,n.cause=e),!n.ruleId&&!n.source&&"string"==typeof t){let e=t.indexOf(":");-1===e?n.ruleId=t:(n.source=t.slice(0,e),n.ruleId=t.slice(e+1))}if(!n.place&&n.ancestors&&n.ancestors){let e=n.ancestors[n.ancestors.length-1];e&&(n.place=e.position)}let s=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=pq(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=a&&n.cause&&"string"==typeof n.cause.stack?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}p_.prototype.file="",p_.prototype.name="",p_.prototype.reason="",p_.prototype.message="",p_.prototype.stack="",p_.prototype.column=void 0,p_.prototype.line=void 0,p_.prototype.ancestors=void 0,p_.prototype.cause=void 0,p_.prototype.fatal=void 0,p_.prototype.place=void 0,p_.prototype.ruleId=void 0,p_.prototype.source=void 0;let pY={}.hasOwnProperty,p$=new Map,pZ=/[A-Z]/g,p0=new Set(["table","tbody","thead","tfoot","tr"]),p1=new Set(["td","th"]),p2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p4(e,A,t){var r;return"element"===A.type?function(e,A,t){let r=e.schema,n=r;"svg"===A.tagName.toLowerCase()&&"html"===r.space&&(e.schema=pL),e.ancestors.push(A);let a=p8(e,A.tagName,!1),s=function(e,A){let t,r,n={};for(r in A.properties)if("children"!==r&&pY.call(A.properties,r)){let a=function(e,A,t){let r=function(e,A){let t=pd(A),r=A,n=pp;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&pM.test(A)){if("-"===A.charAt(4)){let e=A.slice(5).replace(pT,pP);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=A.slice(4);if(!pT.test(e)){let t=e.replace(pD,pK);"-"!==t.charAt(0)&&(t="-"+t),A="data"+t}}n=pC}return new n(r,A)}(e.schema,A);if(!(null==t||"number"==typeof t&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?function(e,A){let t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(t):t.join(" ").trim()),"style"===r.property){let A="object"==typeof t?t:function(e,A){try{return pO(A,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let A=new p_("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw A.file=e.filePath||void 0,A.url=p2+"#cannot-parse-style-attribute",A}}(e,String(t));return"css"===e.stylePropertyNameCase&&(A=function(e){let A,t={};for(A in e)pY.call(e,A)&&(t[function(e){let A=e.replace(pZ,p7);return"ms-"===A.slice(0,3)&&(A="-"+A),A}(A)]=e[A]);return t}(A)),["style",A]}return["react"===e.elementAttributeNameCase&&r.space?pR[r.property]||r.property:r.attribute,t]}}(e,r,A.properties[r]);if(a){let[r,s]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&p1.has(A.tagName)?t=s:n[r]=s}}return t&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=t),n}(e,A),i=p6(e,A);return p0.has(A.tagName)&&(i=i.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&pl(e.value):pl(e))})),p3(e,s,a,A),p5(s,i),e.ancestors.pop(),e.schema=r,e.create(A,a,s,t)}(e,A,t):"mdxFlowExpression"===A.type||"mdxTextExpression"===A.type?function(e,A){if(A.data&&A.data.estree&&e.evaluater){let t=A.data.estree.body[0];return t.type,e.evaluater.evaluateExpression(t.expression)}p9(e,A.position)}(e,A):"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?function(e,A,t){let r=e.schema,n=r;"svg"===A.name&&"html"===r.space&&(e.schema=pL),e.ancestors.push(A);let a=null===A.name?e.Fragment:p8(e,A.name,!0),s=function(e,A){let t={};for(let r of A.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let A=r.data.estree.body[0];A.type;let n=A.expression;n.type;let a=n.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else p9(e,A.position);else{let n,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let A=r.value.data.estree.body[0];A.type,n=e.evaluater.evaluateExpression(A.expression)}else p9(e,A.position);else n=null===r.value||r.value;t[a]=n}return t}(e,A),i=p6(e,A);return p3(e,s,a,A),p5(s,i),e.ancestors.pop(),e.schema=r,e.create(A,a,s,t)}(e,A,t):"mdxjsEsm"===A.type?function(e,A){if(A.data&&A.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(A.data.estree);p9(e,A.position)}(e,A):"root"===A.type?function(e,A,t){let r={};return p5(r,p6(e,A)),e.create(A,e.Fragment,r,t)}(e,A,t):"text"===A.type?(r=0,A.value):void 0}function p3(e,A,t,r){"string"!=typeof t&&t!==e.Fragment&&e.passNode&&(A.node=r)}function p5(e,A){if(A.length>0){let t=A.length>1?A:A[0];t&&(e.children=t)}}function p6(e,A){let t=[],r=-1,n=e.passKeys?new Map:p$;for(;++ra?0:a+A:A>a?a:A,t=t>0?t:0,r.length<1e4)(n=Array.from(r)).unshift(A,t),e.splice(...n);else for(t&&e.splice(A,t);s0?(hn(e,e.length,0,A),e):A}class hs{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-t+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-t+this.left.length).reverse())}splice(e,A,t){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(A||0),Number.POSITIVE_INFINITY);return t&&hi(this.left,t),r.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),hi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hi(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(A))}}function hb(e,A,t,r){let n=r?r-1:Number.POSITIVE_INFINITY,a=0;return function(r){return hw(r)?(e.enter(t),function r(s){return hw(s)&&a++r))return;let i=n.events.length,o=i;for(;o--;)if("exit"===n.events[o][0]&&"chunkFlow"===n.events[o][1].type){if(e){t=n.events[o][1].end;break}e=!0}for(f(s),a=i;aA;){let A=a[t];n.containerState=A[1],A[0].exit.call(n,e)}a.length=A}function m(){A.write([null]),t=void 0,A=void 0,n.containerState._closeFlow=void 0}}},hF={tokenize:function(e,A,t){return hb(e,e.attempt(this.parser.constructs.document,A,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},hU={partial:!0,tokenize:function(e,A,t){return function(A){return hw(A)?hb(e,r,"linePrefix")(A):r(A)};function r(e){return null===e||hm(e)?A(e):t(e)}}},hE={resolve:function(e){return ho(e),e},tokenize:function(e,A){let t;return function(A){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),r(A)};function r(A){return null===A?n(A):hm(A)?e.check(hk,a,n)(A):(e.consume(A),r)}function n(t){return e.exit("chunkContent"),e.exit("content"),A(t)}function a(A){return e.consume(A),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}},hk={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),hb(e,n,"linePrefix")};function n(n){if(null===n||hm(n))return t(n);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?A(n):e.interrupt(r.parser.constructs.flow,t,A)(n)}}},hj={tokenize:function(e){let A=this,t=e.attempt(hU,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),A.currentConstruct=void 0,t)},e.attempt(this.parser.constructs.flowInitial,r,hb(e,e.attempt(this.parser.constructs.flow,r,e.attempt(hE,r)),"linePrefix")));return t;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),A.currentConstruct=void 0,t)}}},hI={resolveAll:hL()},hH=hN("string"),hS=hN("text");function hN(e){return{resolveAll:hL("text"===e?hD:void 0),tokenize:function(A){let t=this,r=this.parser.constructs[e],n=A.attempt(r,a,s);return a;function a(e){return o(e)?n(e):s(e)}function s(e){return null===e?void A.consume(e):(A.enter("data"),A.consume(e),i)}function i(e){return o(e)?(A.exit("data"),n(e)):(A.consume(e),i)}function o(e){if(null===e)return!0;let A=r[e],n=-1;if(A)for(;++n=3&&(null===s||hm(s))?(e.exit("thematicBreak"),A(s)):t(s)}(s)}}},hM={continuation:{tokenize:function(e,A,t){let r=this;return r.containerState._closeFlow=void 0,e.check(hU,function(t){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hb(e,A,"listItemIndent",r.containerState.size+1)(t)},function(t){return r.containerState.furtherBlankLines||!hw(t)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n(t)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hP,A,n)(t))});function n(n){return r.containerState._closeFlow=!0,r.interrupt=void 0,hb(e,e.attempt(hM,A,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,A,t){let r=this,n=r.events[r.events.length-1],a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,s=0;return function(A){let n=r.containerState.type||(42===A||43===A||45===A?"listUnordered":"listOrdered");if("listUnordered"===n?!r.containerState.marker||A===r.containerState.marker:hh(A)){if(r.containerState.type||(r.containerState.type=n,e.enter(n,{_container:!0})),"listUnordered"===n)return e.enter("listItemPrefix"),42===A||45===A?e.check(hT,t,i)(A):i(A);if(!r.interrupt||49===A)return e.enter("listItemPrefix"),e.enter("listItemValue"),function A(n){return hh(n)&&++s<10?(e.consume(n),A):(!r.interrupt||s<2)&&(r.containerState.marker?n===r.containerState.marker:41===n||46===n)?(e.exit("listItemValue"),i(n)):t(n)}(A)}return t(A)};function i(A){return e.enter("listItemMarker"),e.consume(A),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||A,e.check(hU,r.interrupt?t:o,e.attempt(hK,c,l))}function o(e){return r.containerState.initialBlankLine=!0,a++,c(e)}function l(A){return hw(A)?(e.enter("listItemPrefixWhitespace"),e.consume(A),e.exit("listItemPrefixWhitespace"),c):t(A)}function c(t){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,A(t)}}},hK={partial:!0,tokenize:function(e,A,t){let r=this;return hb(e,function(e){let n=r.events[r.events.length-1];return!hw(e)&&n&&"listItemPrefixWhitespace"===n[1].type?A(e):t(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},hP={partial:!0,tokenize:function(e,A,t){let r=this;return hb(e,function(e){let n=r.events[r.events.length-1];return n&&"listItemIndent"===n[1].type&&n[2].sliceSerialize(n[1],!0).length===r.containerState.size?A(e):t(e)},"listItemIndent",r.containerState.size+1)}},hR={continuation:{tokenize:function(e,A,t){let r=this;return function(A){return hw(A)?hb(e,n,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):n(A)};function n(r){return e.attempt(hR,A,t)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,A,t){let r=this;return function(A){if(62===A){let t=r.containerState;return t.open||(e.enter("blockQuote",{_container:!0}),t.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(A),e.exit("blockQuoteMarker"),n}return t(A)};function n(t){return hw(t)?(e.enter("blockQuotePrefixWhitespace"),e.consume(t),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),A):(e.exit("blockQuotePrefix"),A(t))}}};function hO(e,A,t,r,n,a,s,i,o){let l=o||Number.POSITIVE_INFINITY,c=0;return function(A){return 60===A?(e.enter(r),e.enter(n),e.enter(a),e.consume(A),e.exit(a),u):null===A||32===A||41===A||hp(A)?t(A):(e.enter(r),e.enter(s),e.enter(i),e.enter("chunkString",{contentType:"string"}),h(A))};function u(t){return 62===t?(e.enter(a),e.consume(t),e.exit(a),e.exit(n),e.exit(r),A):(e.enter(i),e.enter("chunkString",{contentType:"string"}),d(t))}function d(A){return 62===A?(e.exit("chunkString"),e.exit(i),u(A)):null===A||60===A||hm(A)?t(A):(e.consume(A),92===A?p:d)}function p(A){return 60===A||62===A||92===A?(e.consume(A),d):d(A)}function h(n){return!c&&(null===n||41===n||hB(n))?(e.exit("chunkString"),e.exit(i),e.exit(s),e.exit(r),A(n)):c999||null===u||91===u||93===u&&!s||94===u&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs?t(u):93===u?(e.exit(a),e.enter(n),e.consume(u),e.exit(n),e.exit(r),A):hm(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(A){return null===A||91===A||93===A||hm(A)||o++>999?(e.exit("chunkString"),l(A)):(e.consume(A),s||(s=!hw(A)),92===A?u:c)}function u(A){return 91===A||92===A||93===A?(e.consume(A),o++,c):c(A)}}function hG(e,A,t,r,n,a){let s;return function(A){return 34===A||39===A||40===A?(e.enter(r),e.enter(n),e.consume(A),e.exit(n),s=40===A?41:A,i):t(A)};function i(t){return t===s?(e.enter(n),e.consume(t),e.exit(n),e.exit(r),A):(e.enter(a),o(t))}function o(A){return A===s?(e.exit(a),i(s)):null===A?t(A):hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),hb(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(A))}function l(A){return A===s||null===A||hm(A)?(e.exit("chunkString"),o(A)):(e.consume(A),92===A?c:l)}function c(A){return A===s||92===A?(e.consume(A),l):l(A)}}function hz(e,A){let t;return function r(n){return hm(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t=!0,r):hw(n)?hb(e,r,t?"linePrefix":"lineSuffix")(n):A(n)}}function hq(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let hW={partial:!0,tokenize:function(e,A,t){return function(A){return hB(A)?hz(e,r)(A):t(A)};function r(A){return hG(e,n,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(A)}function n(A){return hw(A)?hb(e,a,"whitespace")(A):a(A)}function a(e){return null===e||hm(e)?A(e):t(e)}}},hJ={name:"codeIndented",tokenize:function(e,A,t){let r=this;return function(A){return e.enter("codeIndented"),hb(e,n,"linePrefix",5)(A)};function n(A){let n=r.events[r.events.length-1];return n&&"linePrefix"===n[1].type&&n[2].sliceSerialize(n[1],!0).length>=4?function A(t){return null===t?a(t):hm(t)?e.attempt(hX,A,a)(t):(e.enter("codeFlowValue"),function t(r){return null===r||hm(r)?(e.exit("codeFlowValue"),A(r)):(e.consume(r),t)}(t))}(A):t(A)}function a(t){return e.exit("codeIndented"),A(t)}}},hX={partial:!0,tokenize:function(e,A,t){let r=this;return n;function n(A){return r.parser.lazy[r.now().line]?t(A):hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n):hb(e,a,"linePrefix",5)(A)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?A(e):hm(e)?n(e):t(e)}}},h_={name:"setextUnderline",resolveTo:function(e,A){let t,r,n,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){t=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),n||"definition"!==e[a][1].type||(n=a);let s={type:"setextHeading",start:{...e[t][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",n?(e.splice(r,0,["enter",s,A]),e.splice(n+1,0,["exit",e[t][1],A]),e[t][1].end={...e[n][1].end}):e[t][1]=s,e.push(["exit",s,A]),e},tokenize:function(e,A,t){let r,n=this;return function(A){var s;let i,o=n.events.length;for(;o--;)if("lineEnding"!==n.events[o][1].type&&"linePrefix"!==n.events[o][1].type&&"content"!==n.events[o][1].type){i="paragraph"===n.events[o][1].type;break}return!n.parser.lazy[n.now().line]&&(n.interrupt||i)?(e.enter("setextHeadingLine"),r=A,s=A,e.enter("setextHeadingLineSequence"),function A(t){return t===r?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),hw(t)?hb(e,a,"lineSuffix")(t):a(t))}(s)):t(A)};function a(r){return null===r||hm(r)?(e.exit("setextHeadingLine"),A(r)):t(r)}}},hY=["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"],h$=["pre","script","style","textarea"],hZ={partial:!0,tokenize:function(e,A,t){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(hU,A,t)}}},h0={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n):t(A)};function n(e){return r.parser.lazy[r.now().line]?t(e):A(e)}}},h1={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return null===A?t(A):(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n)};function n(e){return r.parser.lazy[r.now().line]?t(e):A(e)}}},h2={concrete:!0,name:"codeFenced",tokenize:function(e,A,t){let r,n=this,a={partial:!0,tokenize:function(e,A,t){let a=0;return function(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),s};function s(A){return e.enter("codeFencedFence"),hw(A)?hb(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):o(A)}function o(A){return A===r?(e.enter("codeFencedFenceSequence"),function A(n){return n===r?(a++,e.consume(n),A):a>=i?(e.exit("codeFencedFenceSequence"),hw(n)?hb(e,l,"whitespace")(n):l(n)):t(n)}(A)):t(A)}function l(r){return null===r||hm(r)?(e.exit("codeFencedFence"),A(r)):t(r)}}},s=0,i=0;return function(A){var a=A;let l=n.events[n.events.length-1];return s=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function A(n){return n===r?(i++,e.consume(n),A):i<3?t(n):(e.exit("codeFencedFenceSequence"),hw(n)?hb(e,o,"whitespace")(n):o(n))}(a)};function o(a){return null===a||hm(a)?(e.exit("codeFencedFence"),n.interrupt?A(a):e.check(h1,c,h)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function A(n){return null===n||hm(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(n)):hw(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),hb(e,l,"whitespace")(n)):96===n&&n===r?t(n):(e.consume(n),A)}(a))}function l(A){return null===A||hm(A)?o(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function A(n){return null===n||hm(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(n)):96===n&&n===r?t(n):(e.consume(n),A)}(A))}function c(A){return e.attempt(a,h,u)(A)}function u(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d}function d(A){return s>0&&hw(A)?hb(e,p,"linePrefix",s+1)(A):p(A)}function p(A){return null===A||hm(A)?e.check(h1,c,h)(A):(e.enter("codeFlowValue"),function A(t){return null===t||hm(t)?(e.exit("codeFlowValue"),p(t)):(e.consume(t),A)}(A))}function h(t){return e.exit("codeFenced"),A(t)}}},h4={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:"‌"},h3={}.hasOwnProperty;function h5(e){return!!h3.call(h4,e)&&h4[e]}let h6={name:"characterReference",tokenize:function(e,A,t){let r,n,a=this,s=0;return function(A){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(A),e.exit("characterReferenceMarker"),i};function i(A){return 35===A?(e.enter("characterReferenceMarkerNumeric"),e.consume(A),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,n=hu,l(A))}function o(A){return 88===A||120===A?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(A),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,n=hg,l):(e.enter("characterReferenceValue"),r=7,n=hh,l(A))}function l(i){if(59===i&&s){let r=e.exit("characterReferenceValue");return n!==hu||h5(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),e.exit("characterReference"),A):t(i)}return n(i)&&s++1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let u={...e[t][1].end},d={...e[c][1].start};gi(u,-i),gi(d,i),a={type:i>1?"strongSequence":"emphasisSequence",start:u,end:{...e[t][1].end}},s={type:i>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},n={type:i>1?"strongText":"emphasisText",start:{...e[t][1].end},end:{...e[c][1].start}},r={type:i>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[t][1].end={...a.start},e[c][1].start={...s.end},o=[],e[t][1].end.offset-e[t][1].start.offset&&(o=ha(o,[["enter",e[t][1],A],["exit",e[t][1],A]])),o=ha(o,[["enter",r,A],["enter",a,A],["exit",a,A],["enter",n,A]]),o=ha(o,h7(A.parser.constructs.insideSpan.null,e.slice(t+1,c),A)),o=ha(o,[["exit",n,A],["enter",s,A],["exit",s,A],["exit",r,A]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,o=ha(o,[["enter",e[c][1],A],["exit",e[c][1],A]])):l=0,hn(e,t-1,c-t+3,o),c=t+o.length-l-2;break}}for(c=-1;++ca&&"whitespace"===e[n][1].type&&(n-=2),"atxHeadingSequence"===e[n][1].type&&(a===n-1||n-4>a&&"whitespace"===e[n-2][1].type)&&(n-=a+1===n?2:4),n>a&&(t={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},r={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},hn(e,a,n-a+1,[["enter",t,A],["enter",r,A],["exit",r,A],["exit",t,A]])),e},tokenize:function(e,A,t){let r=0;return function(n){var a;return e.enter("atxHeading"),a=n,e.enter("atxHeadingSequence"),function n(a){return 35===a&&r++<6?(e.consume(a),n):null===a||hB(a)?(e.exit("atxHeadingSequence"),function t(r){return 35===r?(e.enter("atxHeadingSequence"),function A(r){return 35===r?(e.consume(r),A):(e.exit("atxHeadingSequence"),t(r))}(r)):null===r||hm(r)?(e.exit("atxHeading"),A(r)):hw(r)?hb(e,t,"whitespace")(r):(e.enter("atxHeadingText"),function A(r){return null===r||35===r||hB(r)?(e.exit("atxHeadingText"),t(r)):(e.consume(r),A)}(r))}(a)):t(a)}(a)}}},42:hT,45:[h_,hT],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let A=e.length;for(;A--&&("enter"!==e[A][0]||"htmlFlow"!==e[A][1].type););return A>1&&"linePrefix"===e[A-2][1].type&&(e[A][1].start=e[A-2][1].start,e[A+1][1].start=e[A-2][1].start,e.splice(A-2,2)),e},tokenize:function(e,A,t){let r,n,a,s,i,o=this;return function(A){var t;return t=A,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l};function l(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),n=!0,p):63===s?(e.consume(s),r=3,o.interrupt?A:H):hc(s)?(e.consume(s),a=String.fromCharCode(s),h):t(s)}function c(n){return 45===n?(e.consume(n),r=2,u):91===n?(e.consume(n),r=5,s=0,d):hc(n)?(e.consume(n),r=4,o.interrupt?A:H):t(n)}function u(r){return 45===r?(e.consume(r),o.interrupt?A:H):t(r)}function d(r){let n="CDATA[";return r===n.charCodeAt(s++)?(e.consume(r),s===n.length)?o.interrupt?A:C:d:t(r)}function p(A){return hc(A)?(e.consume(A),a=String.fromCharCode(A),h):t(A)}function h(s){if(null===s||47===s||62===s||hB(s)){let i=47===s,l=a.toLowerCase();return!i&&!n&&h$.includes(l)?(r=1,o.interrupt?A(s):C(s)):hY.includes(a.toLowerCase())?(r=6,i)?(e.consume(s),g):o.interrupt?A(s):C(s):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?t(s):n?function A(t){return hw(t)?(e.consume(t),A):y(t)}(s):f(s))}return 45===s||hu(s)?(e.consume(s),a+=String.fromCharCode(s),h):t(s)}function g(r){return 62===r?(e.consume(r),o.interrupt?A:C):t(r)}function f(A){return 47===A?(e.consume(A),y):58===A||95===A||hc(A)?(e.consume(A),m):hw(A)?(e.consume(A),f):y(A)}function m(A){return 45===A||46===A||58===A||95===A||hu(A)?(e.consume(A),m):B(A)}function B(A){return 61===A?(e.consume(A),w):hw(A)?(e.consume(A),B):f(A)}function w(A){return null===A||60===A||61===A||62===A||96===A?t(A):34===A||39===A?(e.consume(A),i=A,v):hw(A)?(e.consume(A),w):function A(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||hB(t)?B(t):(e.consume(t),A)}(A)}function v(A){return A===i?(e.consume(A),i=null,x):null===A||hm(A)?t(A):(e.consume(A),v)}function x(e){return 47===e||62===e||hw(e)?f(e):t(e)}function y(A){return 62===A?(e.consume(A),b):t(A)}function b(A){return null===A||hm(A)?C(A):hw(A)?(e.consume(A),b):t(A)}function C(A){return 45===A&&2===r?(e.consume(A),E):60===A&&1===r?(e.consume(A),k):62===A&&4===r?(e.consume(A),S):63===A&&3===r?(e.consume(A),H):93===A&&5===r?(e.consume(A),I):hm(A)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(hZ,N,Q)(A)):null===A||hm(A)?(e.exit("htmlFlowData"),Q(A)):(e.consume(A),C)}function Q(A){return e.check(h0,F,N)(A)}function F(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),U}function U(A){return null===A||hm(A)?Q(A):(e.enter("htmlFlowData"),C(A))}function E(A){return 45===A?(e.consume(A),H):C(A)}function k(A){return 47===A?(e.consume(A),a="",j):C(A)}function j(A){if(62===A){let t=a.toLowerCase();return h$.includes(t)?(e.consume(A),S):C(A)}return hc(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),j):C(A)}function I(A){return 93===A?(e.consume(A),H):C(A)}function H(A){return 62===A?(e.consume(A),S):45===A&&2===r?(e.consume(A),H):C(A)}function S(A){return null===A||hm(A)?(e.exit("htmlFlowData"),N(A)):(e.consume(A),S)}function N(t){return e.exit("htmlFlow"),A(t)}}},61:h_,95:hT,96:h2,126:h2},gp={38:h6,92:h8},gh={[-5]:h9,[-4]:h9,[-3]:h9,33:gn,38:h6,42:gs,60:[{name:"autolink",tokenize:function(e,A,t){let r=0;return function(A){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(A),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),n};function n(A){return hc(A)?(e.consume(A),a):64===A?t(A):i(A)}function a(A){return 43===A||45===A||46===A||hu(A)?(r=1,function A(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||hu(t))&&r++<32?(e.consume(t),A):(r=0,i(t))}(A)):i(A)}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),A):null===r||32===r||60===r||hp(r)?t(r):(e.consume(r),s)}function i(A){return 64===A?(e.consume(A),o):hd(A)?(e.consume(A),i):t(A)}function o(n){return hu(n)?function n(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),A):function A(a){if((45===a||hu(a))&&r++<63){let t=45===a?A:n;return e.consume(a),t}return t(a)}(a)}(n):t(n)}}},{name:"htmlText",tokenize:function(e,A,t){let r,n,a,s=this;return function(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),i};function i(A){return 33===A?(e.consume(A),o):47===A?(e.consume(A),v):63===A?(e.consume(A),B):hc(A)?(e.consume(A),y):t(A)}function o(A){return 45===A?(e.consume(A),l):91===A?(e.consume(A),n=0,p):hc(A)?(e.consume(A),m):t(A)}function l(A){return 45===A?(e.consume(A),d):t(A)}function c(A){return null===A?t(A):45===A?(e.consume(A),u):hm(A)?(a=c,j(A)):(e.consume(A),c)}function u(A){return 45===A?(e.consume(A),d):c(A)}function d(e){return 62===e?k(e):45===e?u(e):c(e)}function p(A){let r="CDATA[";return A===r.charCodeAt(n++)?(e.consume(A),n===r.length?h:p):t(A)}function h(A){return null===A?t(A):93===A?(e.consume(A),g):hm(A)?(a=h,j(A)):(e.consume(A),h)}function g(A){return 93===A?(e.consume(A),f):h(A)}function f(A){return 62===A?k(A):93===A?(e.consume(A),f):h(A)}function m(A){return null===A||62===A?k(A):hm(A)?(a=m,j(A)):(e.consume(A),m)}function B(A){return null===A?t(A):63===A?(e.consume(A),w):hm(A)?(a=B,j(A)):(e.consume(A),B)}function w(e){return 62===e?k(e):B(e)}function v(A){return hc(A)?(e.consume(A),x):t(A)}function x(A){return 45===A||hu(A)?(e.consume(A),x):function A(t){return hm(t)?(a=A,j(t)):hw(t)?(e.consume(t),A):k(t)}(A)}function y(A){return 45===A||hu(A)?(e.consume(A),y):47===A||62===A||hB(A)?b(A):t(A)}function b(A){return 47===A?(e.consume(A),k):58===A||95===A||hc(A)?(e.consume(A),C):hm(A)?(a=b,j(A)):hw(A)?(e.consume(A),b):k(A)}function C(A){return 45===A||46===A||58===A||95===A||hu(A)?(e.consume(A),C):function A(t){return 61===t?(e.consume(t),Q):hm(t)?(a=A,j(t)):hw(t)?(e.consume(t),A):b(t)}(A)}function Q(A){return null===A||60===A||61===A||62===A||96===A?t(A):34===A||39===A?(e.consume(A),r=A,F):hm(A)?(a=Q,j(A)):hw(A)?(e.consume(A),Q):(e.consume(A),U)}function F(A){return A===r?(e.consume(A),r=void 0,E):null===A?t(A):hm(A)?(a=F,j(A)):(e.consume(A),F)}function U(A){return null===A||34===A||39===A||60===A||61===A||96===A?t(A):47===A||62===A||hB(A)?b(A):(e.consume(A),U)}function E(e){return 47===e||62===e||hB(e)?b(e):t(e)}function k(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),A):t(r)}function j(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),I}function I(A){return hw(A)?hb(e,H,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):H(A)}function H(A){return e.enter("htmlTextData"),a(A)}}}],91:go,92:[{name:"hardBreakEscape",tokenize:function(e,A,t){return function(A){return e.enter("hardBreakEscape"),e.consume(A),r};function r(r){return hm(r)?(e.exit("hardBreakEscape"),A(r)):t(r)}}},h8],93:ge,95:gs,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let A,t,r=e.length-4,n=3;if(("lineEnding"===e[3][1].type||"space"===e[n][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(A=n;++A13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(65535&t)==65535||(65535&t)==65534||t>1114111?"�":String.fromCodePoint(t)}let gv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gx(e,A,t){if(A)return A;if(35===t.charCodeAt(0)){let e=t.charCodeAt(1),A=120===e||88===e;return gw(t.slice(A?2:1),A?16:10)}return h5(t)||e}let gy={}.hasOwnProperty;function gb(e){return{line:e.line,column:e.column,offset:e.offset}}function gC(e,A){if(e)throw Error("Cannot close `"+e.type+"` ("+pq({start:e.start,end:e.end})+"): a different token (`"+A.type+"`, "+pq({start:A.start,end:A.end})+") is open");throw Error("Cannot close document, a token (`"+A.type+"`, "+pq({start:A.start,end:A.end})+") is still open")}function gQ(e){let A=this;A.parser=function(t){var r,n;let a,s,i,o;return"string"!=typeof(r={...A.data("settings"),...e,extensions:A.data("micromarkExtensions")||[],mdastExtensions:A.data("fromMarkdownExtensions")||[]})&&(n=r,r=void 0),(function(e){let A={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(m),autolinkProtocol:l,autolinkEmail:l,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:l,characterReference:l,codeFenced:r(p),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:r(p,n),codeText:r(function(){return{type:"inlineCode",value:""}},n),codeTextData:l,data:l,codeFlowValue:l,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(f,n),htmlFlowData:l,htmlText:r(f,n),htmlTextData:l,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:n,link:r(m),listItem:r(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:r(B,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(B),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let A=this.stack[this.stack.length-1];A.depth||(A.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:d,characterReferenceMarkerNumeric:d,characterReferenceValue:function(e){let A,t=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(A=gw(t,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):A=h5(t);let n=this.stack[this.stack.length-1];n.value+=A},characterReference:function(e){this.stack.pop().position.end=gb(e.end)},codeFenced:s(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:c,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let A=this.resume(),t=this.stack[this.stack.length-1];t.label=A,t.identifier=hq(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(u),hardBreakTrailing:s(u),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=A,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],A=this.resume(),t=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===t.type?t.children=e.children:t.alt=A},labelText:function(e){let A=this.sliceSerialize(e),t=this.stack[this.stack.length-2];t.label=A.replace(gv,gx),t.identifier=hq(A).toLowerCase()},lineEnding:function(e){let t=this.stack[this.stack.length-1];if(this.data.atHardBreak){t.children[t.children.length-1].position.end=gb(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&A.canContainEols.includes(t.type)&&(l.call(this,e),c.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=A,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let A=this.resume(),t=this.stack[this.stack.length-1];t.label=A,t.identifier=hq(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:s(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:s(),thematicBreak:s()}};!function e(A,t){let r=-1;for(;++r0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||gC).call(s,void 0,e[0])}for(r.position={start:gb(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:gb(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c-1){let e=t[0];"string"==typeof e?t[0]=e.slice(n):t.shift()}s>0&&t.push(e[a].slice(0,s))}return t}(s,e)}function d(){let{_bufferIndex:e,_index:A,line:t,column:n,offset:a}=r;return{_bufferIndex:e,_index:A,line:t,column:n,offset:a}}function p(e,A){A.restore()}function h(e,A){return function(t,n,a){var s;let c,u,p,h;return Array.isArray(t)?g(t):"tokenize"in t?g([t]):(s=t,function(e){let A=null!==e&&s[e],t=null!==e&&s.null;return g([...Array.isArray(A)?A:A?[A]:[],...Array.isArray(t)?t:t?[t]:[]])(e)});function g(e){return(c=e,u=0,0===e.length)?a:m(e[u])}function m(e){return function(t){return(h=function(){let e=d(),A=l.previous,t=l.currentConstruct,n=l.events.length,a=Array.from(i);return{from:n,restore:function(){r=e,l.previous=A,l.currentConstruct=t,l.events.length=n,i=a,f()}}}(),p=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name))?w(t):e.tokenize.call(A?Object.assign(Object.create(l),A):l,o,B,w)(t)}}function B(A){return e(p,h),n}function w(e){return(h.restore(),++u{let t=(A,t)=>(e.set(t,A),A),r=n=>{if(e.has(n))return e.get(n);let[a,s]=A[n];switch(a){case 0:case -1:return t(s,n);case 1:{let e=t([],n);for(let A of s)e.push(r(A));return e}case 2:{let e=t({},n);for(let[A,t]of s)e[r(A)]=r(t);return e}case 3:return t(new Date(s),n);case 4:{let{source:e,flags:A}=s;return t(new RegExp(e,A),n)}case 5:{let e=t(new Map,n);for(let[A,t]of s)e.set(r(A),r(t));return e}case 6:{let e=t(new Set,n);for(let A of s)e.add(r(A));return e}case 7:{let{name:e,message:A}=s;return t(new gF[e](A),n)}case 8:return t(BigInt(s),n);case"BigInt":return t(Object(BigInt(s)),n);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return t(new DataView(e),s)}}return t(new gF[a](s),n)};return r},gE=e=>gU(new Map,e)(0),{toString:gk}={},{keys:gj}=Object,gI=e=>{let A=typeof e;if("object"!==A||!e)return[0,A];let t=gk.call(e).slice(8,-1);switch(t){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,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},gH=([e,A])=>0===e&&("function"===A||"symbol"===A),gS=(e,A,t,r)=>{let n=(e,A)=>{let n=r.push(e)-1;return t.set(A,n),n},a=r=>{if(t.has(r))return t.get(r);let[s,i]=gI(r);switch(s){case 0:{let A=r;switch(i){case"bigint":s=8,A=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+i);A=null;break;case"undefined":return n([-1],r)}return n([s,A],r)}case 1:{if(i){let e=r;return"DataView"===i?e=new Uint8Array(r.buffer):"ArrayBuffer"===i&&(e=new Uint8Array(r)),n([i,[...e]],r)}let e=[],A=n([s,e],r);for(let A of r)e.push(a(A));return A}case 2:{if(i)switch(i){case"BigInt":return n([i,r.toString()],r);case"Boolean":case"Number":case"String":return n([i,r.valueOf()],r)}if(A&&"toJSON"in r)return a(r.toJSON());let t=[],o=n([s,t],r);for(let A of gj(r))(e||!gH(gI(r[A])))&&t.push([a(A),a(r[A])]);return o}case 3:return n([s,r.toISOString()],r);case 4:{let{source:e,flags:A}=r;return n([s,{source:e,flags:A}],r)}case 5:{let A=[],t=n([s,A],r);for(let[t,n]of r)(e||!(gH(gI(t))||gH(gI(n))))&&A.push([a(t),a(n)]);return t}case 6:{let A=[],t=n([s,A],r);for(let t of r)(e||!gH(gI(t)))&&A.push(a(t));return t}}let{message:o}=r;return n([s,{name:i,message:o}],r)};return a},gN=(e,{json:A,lossy:t}={})=>{let r=[];return gS(!(A||t),!!A,new Map,r)(e),r},gL="function"==typeof structuredClone?(e,A)=>A&&("json"in A||"lossy"in A)?gE(gN(e,A)):structuredClone(e):(e,A)=>gE(gN(e,A));function gD(e){let A=[],t=-1,r=0,n=0;for(;++t55295&&a<57344){let A=e.charCodeAt(t+1);a<56320&&A>56319&&A<57344?(s=String.fromCharCode(a,A),n=1):s="�"}else s=String.fromCharCode(a);s&&(A.push(e.slice(r,t),encodeURIComponent(s)),r=t+n+1,s=""),n&&(t+=n,n=0)}return A.join("")+e.slice(r)}function gT(e,A){let t=[{type:"text",value:"↩"}];return A>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(A)}]}),t}function gM(e,A){return"Back to reference "+(e+1)+(A>1?"-"+A:"")}let gK=function(e){var A,t;if(null==e)return gR;if("function"==typeof e)return gP(e);if("object"==typeof e){return Array.isArray(e)?function(e){let A=[],t=-1;for(;++t":"")+"\x1b[39m)"})}return a;function a(){var n;let a,s,i,p=gO;if((!o||u(A,t,r[r.length-1]||void 0))&&!1===(p=Array.isArray(n=l(A,r))?n:"number"==typeof n?[!0,n]:null==n?gO:[n])[0])return p;if("children"in A&&A.children&&A.children&&"skip"!==p[0])for(s=(c?A.children.length:-1)+d,i=r.concat(A);s>-1&&s1:A}function gq(e,A,t){let r=0,n=e.length;if(A){let A=e.codePointAt(r);for(;9===A||32===A;)r++,A=e.codePointAt(r)}if(t){let A=e.codePointAt(n-1);for(;9===A||32===A;)n--,A=e.codePointAt(n-1)}return n>r?e.slice(r,n):""}let gW={blockquote:function(e,A){let t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(A),!0)};return e.patch(A,t),e.applyData(A,t)},break:function(e,A){let t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(A,t),[e.applyData(A,t),{type:"text",value:"\n"}]},code:function(e,A){let t=A.value?A.value+"\n":"",r={};A.lang&&(r.className=["language-"+A.lang]);let n={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return A.meta&&(n.data={meta:A.meta}),e.patch(A,n),n={type:"element",tagName:"pre",properties:{},children:[n=e.applyData(A,n)]},e.patch(A,n),n},delete:function(e,A){let t={type:"element",tagName:"del",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},emphasis:function(e,A){let t={type:"element",tagName:"em",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},footnoteReference:function(e,A){let t,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=String(A.identifier).toUpperCase(),a=gD(n.toLowerCase()),s=e.footnoteOrder.indexOf(n),i=e.footnoteCounts.get(n);void 0===i?(i=0,e.footnoteOrder.push(n),t=e.footnoteOrder.length):t=s+1,i+=1,e.footnoteCounts.set(n,i);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(t)}]};e.patch(A,o);let l={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(A,l),e.applyData(A,l)},heading:function(e,A){let t={type:"element",tagName:"h"+A.depth,properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},html:function(e,A){if(e.options.allowDangerousHtml){let t={type:"raw",value:A.value};return e.patch(A,t),e.applyData(A,t)}},imageReference:function(e,A){let t=String(A.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return gG(e,A);let n={src:gD(r.url||""),alt:A.alt};null!==r.title&&void 0!==r.title&&(n.title=r.title);let a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(A,a),e.applyData(A,a)},image:function(e,A){let t={src:gD(A.url)};null!==A.alt&&void 0!==A.alt&&(t.alt=A.alt),null!==A.title&&void 0!==A.title&&(t.title=A.title);let r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(A,r),e.applyData(A,r)},inlineCode:function(e,A){let t={type:"text",value:A.value.replace(/\r?\n|\r/g," ")};e.patch(A,t);let r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(A,r),e.applyData(A,r)},linkReference:function(e,A){let t=String(A.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return gG(e,A);let n={href:gD(r.url||"")};null!==r.title&&void 0!==r.title&&(n.title=r.title);let a={type:"element",tagName:"a",properties:n,children:e.all(A)};return e.patch(A,a),e.applyData(A,a)},link:function(e,A){let t={href:gD(A.url)};null!==A.title&&void 0!==A.title&&(t.title=A.title);let r={type:"element",tagName:"a",properties:t,children:e.all(A)};return e.patch(A,r),e.applyData(A,r)},listItem:function(e,A,t){let r=e.all(A),n=t?function(e){let A=!1;if("list"===e.type){A=e.spread||!1;let t=e.children,r=-1;for(;!A&&++r0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:A.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let i=-1;for(;++i0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=pG(A.children[1]),s=pV(A.children[A.children.length-1]);a&&s&&(r.position={start:a,end:s}),n.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(n,!0)};return e.patch(A,a),e.applyData(A,a)},tableCell:function(e,A){let t={type:"element",tagName:"td",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},tableRow:function(e,A,t){let r=t?t.children:void 0,n=0===(r?r.indexOf(A):1)?"th":"td",a=t&&"table"===t.type?t.align:void 0,s=a?a.length:A.children.length,i=-1,o=[];for(;++i0,!0),r[0]),n=r.index+r[0].length,r=t.exec(A);return a.push(gq(A.slice(n),n>0,!1)),a.join("")}(String(A.value))};return e.patch(A,t),e.applyData(A,t)},thematicBreak:function(e,A){let t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(A,t),e.applyData(A,t)},toml:gJ,yaml:gJ,definition:gJ,footnoteDefinition:gJ};function gJ(){}let gX={}.hasOwnProperty,g_={};function gY(e,A){e.position&&(A.position=function(e){let A=pG(e),t=pV(e);if(A&&t)return{start:A,end:t}}(e))}function g$(e,A){let t=A;if(e&&e.data){let A=e.data.hName,r=e.data.hChildren,n=e.data.hProperties;"string"==typeof A&&("element"===t.type?t.tagName=A:t={type:"element",tagName:A,properties:{},children:"children"in t?t.children:[t]}),"element"===t.type&&n&&Object.assign(t.properties,gL(n)),"children"in t&&t.children&&null!=r&&(t.children=r)}return t}function gZ(e,A){let t=[],r=-1;for(A&&t.push({type:"text",value:"\n"});++r0&&t.push({type:"text",value:"\n"}),t}function g0(e){let A=0,t=e.charCodeAt(A);for(;9===t||32===t;)A++,t=e.charCodeAt(A);return e.slice(A)}function g1(e,A){let t=function(e,A){let t=A||g_,r=new Map,n=new Map,a={all:function(e){let A=[];if("children"in e){let t=e.children,r=-1;for(;++r0&&u.push({type:"text",value:" "});let e="string"==typeof t?t:t(o,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+A+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let h={type:"element",tagName:"li",properties:{id:A+"fn-"+l},children:e.wrap(a,!0)};e.patch(n,h),i.push(h)}if(0!==i.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gL(s),id:"footnote-label"},children:[{type:"text",value:n}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:"\n"}]}}(t),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return n&&a.children.push({type:"text",value:"\n"},n),a}function g2(e,A){return e&&"run"in e?async function(t,r){let n=g1(t,{file:r,...A});await e.run(n,r)}:function(t,r){return g1(t,{file:r,...e||A})}}function g4(e){if(e)throw e}var g3=t(9566);function g5(e){if("object"!=typeof e||null===e)return!1;let A=Object.getPrototypeOf(e);return(null===A||A===Object.prototype||null===Object.getPrototypeOf(A))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let g6=require("node:path"),g8=require("node:process");function g9(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let g7=require("node:url"),fe=["history","path","basename","stem","extname","dirname"];class fA{constructor(e){let A,t;A=e?g9(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 A?"":g8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++rA.length;s&&A.push(r);try{a=e.apply(this,A)}catch(e){if(s&&t)throw e;return r(e)}s||(a&&a.then&&"function"==typeof a.then?a.then(n,r):a instanceof Error?r(a):n(a))};function r(e,...n){t||(t=!0,A(e,...n))}function n(e){r(null,e)}})(i,n)(...s):r(null,...s)}(null,...A)},use:function(t){if("function"!=typeof t)throw TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),A}};return A}()}copy(){let e=new fi,A=-1;for(;++A0){let[r,...a]=A,s=t[n][1];g5(s)&&g5(r)&&(r=g3(!0,s,r)),t[n]=[e,r,...a]}}}}let fo=new fi().freeze();function fl(e,A){if("function"!=typeof A)throw TypeError("Cannot `"+e+"` without `parser`")}function fc(e,A){if("function"!=typeof A)throw TypeError("Cannot `"+e+"` without `compiler`")}function fu(e,A){if(A)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fd(e){if(!g5(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function fp(e,A,t){if(!t)throw Error("`"+e+"` finished async. Use `"+A+"` instead")}function fh(e){var A;return(A=e)&&"object"==typeof A&&"message"in A&&"messages"in A?e:new fA(e)}let fg=[],ff={allowDangerousHtml:!0},fm=/^(https?|ircs?|mailto|xmpp)$/i,fB=[{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 fw(e){let A=function(e){let A=e.rehypePlugins||fg,t=e.remarkPlugins||fg,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ff}:ff;return fo().use(gQ).use(t).use(g2,r).use(A)}(e),t=function(e){let A=e.children||"",t=new fA;return"string"==typeof A&&(t.value=A),t}(e);return function(e,A){let t=A.allowedElements,r=A.allowElement,n=A.components,a=A.disallowedElements,s=A.skipHtml,i=A.unwrapDisallowed,o=A.urlTransform||fv;for(let e of fB)Object.hasOwn(A,e.from)&&(e.from,e.to&&e.to,e.id);return gV(e,function(e,A,n){if("raw"===e.type&&n&&"number"==typeof A)return s?n.children.splice(A,1):n.children[A]={type:"text",value:e.value},A;if("element"===e.type){let A;for(A in he)if(Object.hasOwn(he,A)&&Object.hasOwn(e.properties,A)){let t=e.properties[A],r=he[A];(null===r||r.includes(e.tagName))&&(e.properties[A]=o(String(t||""),A,e))}}if("element"===e.type){let s=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof A&&(s=!r(e,A,n)),s&&n&&"number"==typeof A)return i&&e.children?n.children.splice(A,1,...e.children):n.children.splice(A,1),A}}),function(e,A){var t,r,n,a,s;let i;if(!A||void 0===A.Fragment)throw TypeError("Expected `Fragment` in options");let o=A.filePath||void 0;if(A.development){if("function"!=typeof A.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");t=o,r=A.jsxDEV,i=function(e,A,n,a){let s=Array.isArray(n.children),i=pG(e);return r(A,n,a,s,{columnNumber:i?i.column-1:void 0,fileName:t,lineNumber:i?i.line:void 0},void 0)}}else{if("function"!=typeof A.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof A.jsxs)throw TypeError("Expected `jsxs` in production options");n=0,a=A.jsx,s=A.jsxs,i=function(e,A,t,r){let n=Array.isArray(t.children)?s:a;return r?n(A,t,r):n(A,t)}}let l={Fragment:A.Fragment,ancestors:[],components:A.components||{},create:i,elementAttributeNameCase:A.elementAttributeNameCase||"react",evaluater:A.createEvaluater?A.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:A.ignoreInvalidStyle||!1,passKeys:!1!==A.passKeys,passNode:A.passNode||!1,schema:"svg"===A.space?pL:pN,stylePropertyNameCase:A.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==A.tableCellAlignToStyle},c=p4(l,e,void 0);return c&&"string"!=typeof c?c:l.create(e,l.Fragment,{children:c||void 0},void 0)}(e,{Fragment:d.Fragment,components:n,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0})}(A.runSync(A.parse(t),t),e)}function fv(e){let A=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),n=e.indexOf("/");return -1===A||-1!==n&&A>n||-1!==t&&A>t||-1!==r&&A>r||fm.test(e.slice(0,A))?e:""}function fx({content:e,className:A}){return(0,d.jsx)("div",{className:(0,y.cn)("prose prose-sm dark:prose-invert max-w-none",A),children:(0,d.jsx)(fw,{components:{h1:({children:e})=>(0,d.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,d.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,d.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,d.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,d.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,d.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,d.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,d.jsx)("li",{className:"text-sm",children:e}),code:({className:e,children:A,...t})=>/language-(\w+)/.exec(e||"")?(0,d.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",children:(0,d.jsx)("code",{className:"font-mono text-xs",children:A})}):(0,d.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...t,children:A}),blockquote:({children:e})=>(0,d.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:A})=>(0,d.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:A}),strong:({children:e})=>(0,d.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,d.jsx)("em",{className:"italic",children:e}),hr:()=>(0,d.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,d.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,d.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,d.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,d.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,d.jsx)("tr",{children:e}),th:({children:e})=>(0,d.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,d.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:e})})}var fy="Toggle",fb=p.forwardRef((e,A)=>{let{pressed:t,defaultPressed:r,onPressedChange:n,...a}=e,[s,i]=(0,el.i)({prop:t,onChange:n,defaultProp:r??!1,caller:fy});return(0,d.jsx)(ec.sG.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:A,onClick:(0,es.mK)(e.onClick,()=>{e.disabled||i(!s)})})});fb.displayName=fy;var fC="ToggleGroup",[fQ,fF]=(0,eo.A)(fC,[eE]),fU=eE(),fE=p.forwardRef((e,A)=>{let{type:t,...r}=e;if("single"===t)return(0,d.jsx)(fI,{...r,ref:A});if("multiple"===t)return(0,d.jsx)(fH,{...r,ref:A});throw Error(`Missing prop \`type\` expected on \`${fC}\``)});fE.displayName=fC;var[fk,fj]=fQ(fC),fI=p.forwardRef((e,A)=>{let{value:t,defaultValue:r,onValueChange:n=()=>{},...a}=e,[s,i]=(0,el.i)({prop:t,defaultProp:r??"",onChange:n,caller:fC});return(0,d.jsx)(fk,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>s?[s]:[],[s]),onItemActivate:i,onItemDeactivate:p.useCallback(()=>i(""),[i]),children:(0,d.jsx)(fL,{...a,ref:A})})}),fH=p.forwardRef((e,A)=>{let{value:t,defaultValue:r,onValueChange:n=()=>{},...a}=e,[s,i]=(0,el.i)({prop:t,defaultProp:r??[],onChange:n,caller:fC}),o=p.useCallback(e=>i((A=[])=>[...A,e]),[i]),l=p.useCallback(e=>i((A=[])=>A.filter(A=>A!==e)),[i]);return(0,d.jsx)(fk,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:o,onItemDeactivate:l,children:(0,d.jsx)(fL,{...a,ref:A})})});fE.displayName=fC;var[fS,fN]=fQ(fC),fL=p.forwardRef((e,A)=>{let{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:n=!0,orientation:a,dir:s,loop:i=!0,...o}=e,l=fU(t),c=(0,ed.jH)(s),u={role:"group",dir:c,...o};return(0,d.jsx)(fS,{scope:t,rovingFocus:n,disabled:r,children:n?(0,d.jsx)(eI,{asChild:!0,...l,orientation:a,dir:c,loop:i,children:(0,d.jsx)(ec.sG.div,{...u,ref:A})}):(0,d.jsx)(ec.sG.div,{...u,ref:A})})}),fD="ToggleGroupItem",fT=p.forwardRef((e,A)=>{let t=fj(fD,e.__scopeToggleGroup),r=fN(fD,e.__scopeToggleGroup),n=fU(e.__scopeToggleGroup),a=t.value.includes(e.value),s=r.disabled||e.disabled,i={...e,pressed:a,disabled:s},o=p.useRef(null);return r.rovingFocus?(0,d.jsx)(eN,{asChild:!0,...n,focusable:!s,active:a,ref:o,children:(0,d.jsx)(fM,{...i,ref:A})}):(0,d.jsx)(fM,{...i,ref:A})});fT.displayName=fD;var fM=p.forwardRef((e,A)=>{let{__scopeToggleGroup:t,value:r,...n}=e,a=fj(fD,t),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i="single"===a.type?s:void 0;return(0,d.jsx)(fb,{...i,...n,ref:A,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})});let fK=(0,t(4224).F)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),fP=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(fE,{ref:t,className:(0,y.cn)("inline-flex items-center justify-center gap-1 rounded-md bg-muted p-1",e),...A}));fP.displayName=fE.displayName;let fR=p.forwardRef(({className:e,variant:A,size:t,...r},n)=>(0,d.jsx)(fT,{ref:n,className:(0,y.cn)(fK({variant:A,size:t}),e),...r}));fR.displayName=fT.displayName;var fO=t(9929);let fV={shell:(0,d.jsx)(A9,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,d.jsx)(k,{className:"h-3 w-3 text-orange-500"})},fG={pending:(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,d.jsx)(d9.A,{className:"h-3 w-3 text-green-500"}),failed:(0,d.jsx)(d7.A,{className:"h-3 w-3 text-red-500"})};function fz({events:e,onRestore:A,onRetry:t,prompt:r,setPrompt:n,generating:a,onGenerate:s,onStop:i,focusContext:o,setFocusContext:l,focusPreviewSnippet:c,chatMode:u,setChatMode:h,currentModel:g,setCurrentModel:f,getModelDisplayName:m,isTourLockingInput:B=!1,onClearChat:w,onClose:v}){let x=(0,p.useRef)(null),[y,b]=(0,p.useState)(!0),[C,F]=(0,p.useState)(!1),[E,k]=(0,p.useState)(new Set);(0,p.useRef)(!1);let j=(0,p.useRef)(0),I=(0,p.useRef)(new Map),H=(0,p.useRef)({result:[],currentTurn:{id:`turn-${Date.now()}`,items:[]},currentToolBatch:0,toolsByBatchAndIndex:new Map,itemIdCounter:0}),S=(0,p.useMemo)(()=>{let A,t=H.current,r=e.length-j.current;if(0===e.length||j.current>e.length)return j.current=0,I.current=new Map,H.current={result:[],currentTurn:{id:`turn-${Date.now()}`,items:[]},currentToolBatch:0,toolsByBatchAndIndex:new Map,itemIdCounter:0},[];let n=e[e.length-1],a=n&&("assistant_delta"===n.event||"tool_param_delta"===n.event),s=I.current.get(n?.id||""),i=a&&n.version&&s!==n.version;if(0===r&&!i)return[...t.result,...t.currentTurn.items.length>0?[t.currentTurn]:[]];for(let r of(i?(A=[n],I.current.set(n.id,n.version)):A=e.slice(j.current),A))switch(r.event){case"thinking":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"thinking",timestamp:r.timestamp,data:null});break;case"toolCalls":let e=r.data?.toolCalls||[];for(let A=0;A"thinking"!==e.type);break;case"tool_status":let{toolIndex:A,status:n,result:a,error:s}=r.data||{},i=`${t.currentToolBatch-1}-${A}`,o=t.toolsByBatchAndIndex.get(i);o&&(o.status=n,a&&(o.result=a),s&&(o.error=s));break;case"tool_result":let l=r.data?.toolIndex,c=`${t.currentToolBatch-1}-${l}`,u=t.toolsByBatchAndIndex.get(c);u&&r.data?.result&&(u.result=r.data.result);break;case"tool_param_delta":for(let e of r.data?.all||[r.data]){let{toolId:A,partialArguments:r}=e||{};if(!A)continue;let n=t.currentTurn.items.find(e=>"tool"===e.type&&e.data?.id===A);if(n){let e=n.data;try{e.parameters=JSON.parse(r)}catch{e.parameters={_raw:r}}}}break;case"assistant_delta":let d=r.data?.all||[r.data],p=t.currentTurn.items.findLast(e=>"text"===e.type);for(let e of d){let A=e?.text||"",n=e?.snapshot;void 0!==n?p?p.data=n:(p={id:`item-${t.itemIdCounter++}`,type:"text",timestamp:r.timestamp,data:n},t.currentTurn.items.push(p)):A&&(p?p.data+=A:(p={id:`item-${t.itemIdCounter++}`,type:"text",timestamp:r.timestamp,data:A},t.currentTurn.items.push(p)))}t.currentTurn.items=t.currentTurn.items.filter(e=>"thinking"!==e.type);break;case"plan_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"plan",timestamp:r.timestamp,data:r.data?.content||""});break;case"agent_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"agent",timestamp:r.timestamp,data:r.data?.content||""});break;case"task_progress":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"progress",timestamp:r.timestamp,data:r.data?.content||""});break;case"conversation_message":let h=r.data?.message;if(h?.role==="user"){if(h.content?.includes("Before finishing, you must call the evaluation tool"))break;t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"user",timestamp:r.timestamp,data:h.content||""})}break;case"user_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"user",timestamp:r.timestamp,data:r.data?.content||""});break;case"error":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"error",timestamp:r.timestamp,data:r.data}),t.currentTurn.items=t.currentTurn.items.filter(e=>"thinking"!==e.type);break;case"usage":t.currentTurn.usage=r.data;break;case"checkpoint_created":t.currentTurn.checkpointId=r.data?.checkpointId;break;case"iteration":t.currentTurn.iteration=r.data?.iteration,t.currentTurn.items.length>0&&(t.result.push(t.currentTurn),t.currentTurn={id:`turn-${Date.now()}-${t.result.length}`,items:[]})}return i||(j.current=e.length),[...t.result,...t.currentTurn.items.length>0?[t.currentTurn]:[]]},[e]),L=e=>{k(A=>{let t=new Set(A);return t.has(e)?t.delete(e):t.add(e),t})},D=c?.trim()??"",T=o?(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,d.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,d.jsx)(Q.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>l(null),title:"Clear focus context",children:"Clear"})]}),(0,d.jsxs)("div",{className:"mt-2 space-y-2",children:[o.domPath&&(0,d.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:o.domPath}),D&&(0,d.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,d.jsx)("code",{children:D})})]})]}):null;return(0,d.jsxs)("div",{className:"h-full flex flex-col bg-card border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-border bg-muted/30 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(u_,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),v?(0,d.jsxs)("button",{type:"button",onClick:v,"aria-label":"Hide chat panel",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,d.jsx)(u_,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(u_,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-assistant-active)"}}),(0,d.jsx)("span",{className:"font-semibold text-sm",children:"Chat"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:w&&(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:w,className:"h-7 px-2 hover:bg-muted",title:"Clear chat",children:(0,d.jsx)(G,{className:"h-3 w-3"})})})]}),(0,d.jsx)("div",{ref:x,className:"flex-1 overflow-y-auto p-4 space-y-4",children:0===S.length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center p-4",children:"No messages yet. Start a conversation to see it here."}):S.map(e=>(0,d.jsx)(fq,{turn:e,onRestore:A,onRetry:t,expandedItems:E,onToggleExpanded:L},e.id))}),(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[T,(0,d.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,d.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,d.jsx)(U,{value:r,onChange:e=>n(e.target.value),onKeyDown:e=>{!B&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),s())},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:a||B}),(0,d.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,d.jsx)(Q.$,{onClick:a?i:s,disabled:B?!a:!a&&!r.trim(),size:"sm",className:"flex items-center gap-2",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l7.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(pe,{className:"h-4 w-4"}),"Send"]})})})]}),(0,d.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)(lw.AM,{open:C,onOpenChange:F,children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"h-7 text-xs",children:[(0,d.jsx)("span",{children:m(g)}),C?(0,d.jsx)(lD.A,{className:"h-3 w-3 ml-1"}):(0,d.jsx)(d5.A,{className:"h-3 w-3 ml-1"})]})}),(0,d.jsx)(lw.hl,{className:"w-[36rem] max-w-[calc(100vw-2rem)]",align:"start",children:(0,d.jsx)(fO.t,{onClose:()=>F(!1),onModelChange:e=>f(e)})})]}),(0,d.jsxs)(fP,{type:"single",value:u?"chat":"code",onValueChange:e=>{e&&h("chat"===e)},className:"gap-1",children:[(0,d.jsxs)(fR,{value:"chat",className:"h-7 text-xs px-2",children:[(0,d.jsx)(u_,{className:"h-3 w-3 mr-1"}),"Chat"]}),(0,d.jsxs)(fR,{value:"code",className:"h-7 text-xs px-2",children:[(0,d.jsx)(pA,{className:"h-3 w-3 mr-1"}),"Code"]})]})]})})]})]})]})}function fq({turn:e,onRestore:A,onRetry:t,expandedItems:r,onToggleExpanded:n}){return(0,d.jsxs)("div",{className:"space-y-2",children:[e.items.map(e=>{switch(e.type){case"thinking":return(0,d.jsx)("div",{className:"bg-muted/30 rounded-md p-2 opacity-70",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-400"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Thinking..."})]})},e.id);case"plan":return(0,d.jsx)(fJ,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"agent":return(0,d.jsx)(fX,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"progress":return(0,d.jsx)(f_,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"tool":return(0,d.jsx)(fW,{itemId:e.id,tool:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"text":return(0,d.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,d.jsx)(fx,{content:e.data})},e.id);case"user":return(0,d.jsxs)("div",{className:"text-sm text-foreground bg-primary/10 px-3 py-2 rounded border border-primary/20",children:[(0,d.jsx)("div",{className:"font-semibold text-primary mb-1 text-xs",children:"User"}),(0,d.jsx)("div",{className:"whitespace-pre-wrap",children:e.data})]},e.id);case"error":return(0,d.jsx)("div",{className:"text-sm bg-destructive/10 border border-destructive/20 px-3 py-2 rounded",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(d7.A,{className:"h-4 w-4 text-destructive mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("div",{className:"font-semibold text-destructive mb-1",children:"Error"}),(0,d.jsx)("div",{className:"text-destructive/90 whitespace-pre-wrap font-mono text-xs",children:e.data?.message||JSON.stringify(e.data,null,2)}),e.data?.stack&&(0,d.jsxs)("details",{className:"mt-2",children:[(0,d.jsx)("summary",{className:"text-xs text-destructive/70 cursor-pointer hover:text-destructive",children:"Stack trace"}),(0,d.jsx)("pre",{className:"text-[10px] text-destructive/60 mt-1 overflow-x-auto",children:e.data.stack})]})]})]})},e.id);default:return null}}),(e.usage||e.checkpointId)&&(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[e.usage&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Tokens: ",(e.usage.usage?.totalTokens||e.usage.totalTokens)?.toLocaleString()||"N/A",(void 0!==e.usage.totalCost||void 0!==e.usage.cost)&&` • Cost: $${((e.usage.totalCost??e.usage.cost)||0).toFixed(4)}`]}),e.checkpointId&&(A||t)&&(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[A&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",onClick:()=>A(e.checkpointId),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,d.jsx)(uX,{className:"h-3 w-3 mr-1"}),"Restore"]}),t&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",onClick:()=>t(e.checkpointId),className:"h-6 px-2 text-xs",title:"Retry from this checkpoint",children:[(0,d.jsx)(A6.A,{className:"h-3 w-3 mr-1"}),"Retry"]})]})]})]})}function fW({itemId:e,tool:A,isExpanded:t,onToggle:r}){return(0,d.jsxs)("div",{className:`bg-muted/30 rounded-md transition-all ${"executing"===A.status?"ring-2 ring-blue-500/20 animate-pulse":""} ${t?"p-2":"p-1.5"}`,children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[fV[A.name]||(0,d.jsx)(A9,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:A.name})]}),"shell"===A.name&&A.parameters?.cmd&&(0,d.jsx)("code",{className:"text-xs text-muted-foreground",children:Array.isArray(A.parameters.cmd)?A.parameters.cmd.slice(1).join(" ").substring(0,50):String(A.parameters.cmd).substring(0,50)}),(A.parameters?.path||A.parameters?.file_path)&&(0,d.jsx)("code",{className:"text-xs text-muted-foreground",children:A.parameters.path||A.parameters.file_path}),(0,d.jsx)("div",{className:"ml-auto",children:fG[A.status||"completed"]})]}),t&&(0,d.jsxs)("div",{className:"mt-2 space-y-2",children:[A.parameters&&Object.keys(A.parameters).length>0&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Parameters"}),(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto",children:JSON.stringify(A.parameters,null,2)})]}),A.result&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Result"}),(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto max-h-40 overflow-y-auto",children:"string"==typeof A.result?A.result:JSON.stringify(A.result,null,2)})]}),A.error&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1",children:"Error"}),(0,d.jsx)("pre",{className:"text-xs bg-destructive/10 text-destructive p-2 rounded overflow-x-auto",children:A.error})]})]})]})}function fJ({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.split("\n"),a=n[0]?.replace(/^\*\*|\*\*$/g,"").substring(0,50)||"Plan";return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(pt,{className:"h-3 w-3 text-orange-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"plan"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function fX({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.split("\n"),a=n[0]?.replace(/^\*\*|\*\*$/g,"").replace(/^🤖\s*/,"").substring(0,50)||"Agent";return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(pr,{className:"h-3 w-3 text-purple-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"agent"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function f_({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.includes("✅"),a=A.replace(/^[✅🔄]\s*/,"").substring(0,50);return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[n?(0,d.jsx)(d9.A,{className:"h-3 w-3 text-green-500"}):(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"progress"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function fY({project:e,onBack:A}){let[t,r]=(0,p.useState)(0),[n,a]=(0,p.useState)(""),[s,i]=(0,p.useState)(!1),[o,l]=(0,p.useState)(null),[c,u]=(0,p.useState)(null),[h,g]=(0,p.useState)("preview"),[f,B]=(0,p.useState)(!1),[w,v]=(0,p.useState)(!1),[x,b]=(0,p.useState)(e.lastSavedAt??null),[C,F]=(0,p.useState)(null),[U,E]=(0,p.useState)(()=>!1),k=(0,p.useRef)(null),j=(0,p.useRef)(null),I=(0,p.useRef)(!1),[H,S]=(0,p.useState)(null),[N,L]=(0,p.useState)(lv.s.getDefaultModel()),[D,T]=(0,p.useState)(!1),[M,K]=(0,p.useState)(!1),[R,O]=(0,p.useState)(0),{state:V,start:G,setWorkspaceHandler:z}=l9(),q=V.currentStep?.id,W="running"===V.status&&"wrap-up"!==q,{shouldShowCosts:J}=function(){let[e,A]=(0,p.useState)(()=>lv.s.getCostSettings()),t=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:t}}(),[X,_]=(0,p.useState)(!0),[Y,$]=(0,p.useState)(!0),[Z,ee]=(0,p.useState)(!1),[eA,et]=(0,p.useState)(!0),[er,en]=(0,p.useState)(!1),[ea,es]=(0,p.useState)([]),ei=(0,p.useRef)(0),eo=(0,p.useRef)(null),el=(0,p.useCallback)(A=>{eo.current&&clearTimeout(eo.current),eo.current=setTimeout(()=>{u1.saveEvents(e.id,A).catch(e=>{y.v.error("Failed to persist debug events:",e)})},500)},[e.id]),ec=(0,p.useCallback)(async(e,A)=>{es(t=>{let r;if(("assistant_delta"===e||"tool_param_delta"===e)&&t.length>0){let n=t[t.length-1];if(n.event===e){let e={...n,timestamp:Date.now(),version:(n.version||1)+1,count:(n.count||1)+1,data:{all:n.data.all?[...n.data.all,A]:[n.data,A]}};return el(r=[...t.slice(0,-1),e]),r}}return el(r=[...t,{id:`${Date.now()}-${ei.current++}`,timestamp:Date.now(),event:e,data:A,count:1,version:1}]),r})},[e.id,el]),eu=(0,p.useCallback)(async()=>{es([]),await u1.clearEvents(e.id),u(null)},[e.id]),ed=(()=>{let e=[X,Y,Z,eA,er].filter(Boolean).length;return 5===e?{chat:20,files:15,editor:25,preview:20,debug:20}:4===e?{chat:25,files:15,editor:35,preview:25,debug:0}:3===e?{chat:33,files:33,editor:33,preview:33,debug:0}:2===e?{chat:50,files:50,editor:50,preview:50,debug:0}:{chat:100,files:100,editor:100,preview:100,debug:0}})(),ep=e=>{if(!e)return"Select Model";let A=e.split("/");return A[A.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},eh=(0,p.useCallback)((e,A=1200)=>{if(!e)return"";if(e.length<=A)return e;let t=Math.max(0,Math.floor(.6*A)),r=Math.max(0,Math.floor(.3*A)),n=e.slice(0,t),a=r>0?e.slice(-r):"";return`${n} +Choose OK to REPLACE all current data, or Cancel to MERGE with existing data.`);await lP.importAllData(A,{mode:t?"replace":"merge",onProgress:(e,A)=>{B(e),v(A)}}),A4.oR.success("Data imported successfully!"),setTimeout(()=>window.location.reload(),1e3)}catch(e){A4.oR.error(e instanceof Error?e.message:"Import failed")}finally{f(!1),B(0),v("")}},e.click()},disabled:g,className:"flex items-center gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),g?"Importing...":"Import"]})]}),g&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,d.jsx)("span",{children:w}),(0,d.jsxs)("span",{children:[m,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${m}%`}})})]})]})]})]})]}),(0,d.jsxs)("div",{className:"flex justify-between pt-4 px-3 border-t mt-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(Q.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(lv.s.clearSettings(),t({}),A4.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,d.jsxs)(Q.$,{variant:"outline",onClick:()=>c(!0),children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]})]}),e&&(0,d.jsx)(Q.$,{onClick:e,children:"Close"})]}),(0,d.jsx)(lA,{open:l,onOpenChange:c})]})}let l3=[{id:"welcome",title:"Welcome to Open Source Web Studio",body:(0,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,d.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,d.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,d.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,d.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,d.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,d.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,d.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,d.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var l5=t(4742);let l6=(0,p.createContext)(null);function l8({children:e}){let[A,r]=(0,p.useState)("idle"),[n,a]=(0,p.useState)(0),[s,i]=(0,p.useState)(0),[o,l]=(0,p.useState)([]),[c,u]=(0,p.useState)(!1),[h,g]=(0,p.useState)([]),[f,m]=(0,p.useState)(null),[B,w]=(0,p.useState)(null),[v,x]=(0,p.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),y=(0,p.useRef)(v),b=(0,p.useRef)(null),C=(0,p.useRef)(null),Q=(0,p.useRef)(null),F=(0,p.useRef)(null),U=(0,p.useRef)(null),E=(0,p.useRef)(null),k=(0,p.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=l3.length))return l3[e]})(n),[n]),j=(0,p.useCallback)(()=>{x({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),b.current=null,C.current=null,Q.current=null,F.current=null},[]),I=(0,p.useCallback)(()=>{"running"!==A&&(r("running"),a(0),i(e=>e+1),l([]),j())},[j,A]),H=(0,p.useCallback)(e=>{E.current=e},[]),S=(0,p.useCallback)(async(e="finish")=>{let A=y.current;if(A.projectId&&A.preCheckpointId&&A.postCheckpointId&&lf.$.runWithSuppressedDirty(A.projectId,async()=>{await l5.Y.restoreCheckpoint(A.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),B)try{if(h.filter(e=>e.id!==B).length>0){let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));await e.init(),await e.deleteProject(B)}}catch(e){console.error("[GuidedTour] Failed to cleanup tour demo project",e)}j(),l([]),a(0),i(e=>e+1),r("finish"===e?"completed":"idle"),lv.s.setHasSeenTour(!0),U.current?.abort(),E.current=null},[j,B,h]),N=(0,p.useCallback)(()=>{S("skip")},[S]),L=(0,p.useCallback)(()=>{a(e=>{let A=e+1;if(A>=l3.length)return S(),e;let t=l3[A];return t?.location==="workspace"&&B&&setTimeout(()=>{m(B)},100),i(e=>e+1),A})},[S,B]),D=(0,p.useCallback)(()=>{a(e=>{let A=Math.max(0,e-1);return A!==e&&i(e=>e+1),A})},[]),T=(0,p.useMemo)(()=>({state:{status:A,stepIndex:n,stepKey:s,currentStep:k,transcript:o,isBusy:c,projectList:h},start:I,skip:N,next:L,previous:D,setProjectList:e=>{g(e)},setActiveProjectId:m,setTranscript:l,setWorkspaceHandler:H,setTourDemoProjectId:w}),[A,n,s,k,o,c,h,I,N,L,D,H]);return(0,d.jsx)(l6.Provider,{value:T,children:e})}function l9(){let e=(0,p.useContext)(l6);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var l7=t(1862);function ce({location:e}){let{state:A,next:t,previous:r,skip:n}=l9(),{status:a,currentStep:s,stepKey:i,isBusy:o,stepIndex:l}=A,[c,u]=(0,p.useState)(null),h=l3.length,g=(0,p.useMemo)(()=>!!s&&!!o&&("workspace-edit"===s.id||"workspace-focus"===s.id||"workspace-checkpoint"===s.id),[s,o]);if("running"!==a||!s||s.location!==e)return null;let f=s.primaryLabel??"Next",m=s.secondaryLabel??"Skip";return(0,d.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-background/30"}),c&&(0,d.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:c.top,left:c.left,width:c.width,height:c.height}}),(0,d.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,d.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:s.title}),(0,d.jsxs)("span",{className:"text-sm text-muted-foreground font-medium",children:[l+1,"/",h]})]}),(0,d.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:s.body})]}),o&&(0,d.jsx)(l7.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,d.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[s.showBack?(0,d.jsx)(Q.$,{variant:"ghost",onClick:r,disabled:o,children:"Back"}):(0,d.jsx)("div",{}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(Q.$,{variant:"ghost",onClick:n,children:m}),(0,d.jsx)(Q.$,{onClick:t,disabled:g,children:f})]})]})]})})]})}var cA=t(4923);function ct({project:e,open:A,onOpenChange:t}){let[r,n]=(0,p.useState)(!1),[a,s]=(0,p.useState)({name:e?.name||"",description:e?.description||"",version:"1.0.0",author:"",authorUrl:"",license:"personal",tags:[],thumbnail:void 0,previewImages:[],downloadUrl:""}),[i,o]=(0,p.useState)(""),l=async()=>{if(e){if(!a.name||a.name.length<1||a.name.length>50)return void A4.oR.error("Template name must be between 1 and 50 characters");if(!a.description||a.description.length<10||a.description.length>500)return void A4.oR.error("Description must be between 10 and 500 characters");if(!a.version||!/^\d+\.\d+\.\d+$/.test(a.version))return void A4.oR.error("Version must be in format x.y.z (e.g., 1.0.0)");try{n(!0);let A=i.split(",").map(e=>e.trim()).filter(e=>e.length>0),r={...a,tags:A},l=await C.exportProjectAsTemplate(m.vfs,e.id,r),c=URL.createObjectURL(l),u=document.createElement("a");u.href=c,u.download=`${a.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c),A4.oR.success("Template exported successfully!"),t(!1),s({name:"",description:"",version:"1.0.0",author:"",authorUrl:"",license:"personal",tags:[],thumbnail:void 0,previewImages:[],downloadUrl:""}),o("")}catch(e){y.v.error("Failed to export template:",e),A4.oR.error(e instanceof Error?e.message:"Failed to export template")}finally{n(!1)}}},c=cA.N2.find(e=>e.value===a.license);return(0,d.jsx)(oZ,{open:A,onOpenChange:t,children:(0,d.jsxs)(o2,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,d.jsxs)(o4,{children:[(0,d.jsx)(o5,{children:"Export as Template"}),(0,d.jsx)(o6,{children:"Create a reusable template from this project"})]}),(0,d.jsxs)("div",{className:"space-y-4 py-4",children:[a.thumbnail&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{children:"Preview Thumbnail"}),(0,d.jsx)("div",{className:"w-full rounded-lg overflow-hidden bg-muted border",children:(0,d.jsx)("img",{src:a.thumbnail,alt:"Template preview",className:"w-full h-auto"})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"This preview was captured when you saved the project"})]}),!a.thumbnail&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{children:"Preview Thumbnail"}),(0,d.jsx)("div",{className:"w-full h-48 rounded-lg bg-muted flex items-center justify-center border",children:(0,d.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,d.jsx)(H,{className:"h-12 w-12 mx-auto mb-2"}),(0,d.jsx)("p",{className:"text-sm",children:"No preview available"}),(0,d.jsx)("p",{className:"text-xs",children:"Save your project to capture a preview"})]})})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-name",children:["Template Name ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.name.length,"/50"]})]}),(0,d.jsx)(F.p,{id:"template-name",value:a.name,onChange:e=>s({...a,name:e.target.value.slice(0,50)}),placeholder:"My Awesome Template",maxLength:50,required:!0})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-description",children:["Description ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[a.description.length,"/500"]})]}),(0,d.jsx)(U,{id:"template-description",value:a.description,onChange:e=>s({...a,description:e.target.value.slice(0,500)}),placeholder:"A complete multi-page template with...",className:"resize-none",rows:3,maxLength:500,required:!0})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-version",children:["Version ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsx)(F.p,{id:"template-version",value:a.version,onChange:e=>s({...a,version:e.target.value}),placeholder:"1.0.0",pattern:"^\\d+\\.\\d+\\.\\d+$",required:!0}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Semantic version format (e.g., 1.0.0)"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-author",children:"Author"}),(0,d.jsx)(F.p,{id:"template-author",value:a.author,onChange:e=>s({...a,author:e.target.value.slice(0,50)}),placeholder:"Your Name",maxLength:50})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-author-url",children:"Author URL"}),(0,d.jsx)(F.p,{id:"template-author-url",type:"url",value:a.authorUrl,onChange:e=>s({...a,authorUrl:e.target.value}),placeholder:"https://yourwebsite.com"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(lp.J,{htmlFor:"template-license",children:["License ",(0,d.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,d.jsxs)(tn.l6,{value:a.license,onValueChange:e=>s({...a,license:e}),children:[(0,d.jsx)(tn.bq,{id:"template-license",children:(0,d.jsx)(tn.yv,{})}),(0,d.jsx)(tn.gC,{children:cA.N2.map(e=>(0,d.jsx)(tn.eb,{value:e.value,children:e.label},e.value))})]}),c&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-md bg-muted text-xs",children:[(0,d.jsx)(lr,{className:"h-3 w-3 mt-0.5 shrink-0 text-muted-foreground"}),(0,d.jsx)("p",{className:"text-muted-foreground",children:c.description})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-tags",children:"Tags"}),(0,d.jsx)(F.p,{id:"template-tags",value:i,onChange:e=>o(e.target.value),placeholder:"saas, marketing, landing (comma-separated)"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add up to 10 tags, separated by commas"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(lp.J,{htmlFor:"template-download-url",children:"Marketplace URL"}),(0,d.jsx)(F.p,{id:"template-download-url",type:"url",value:a.downloadUrl,onChange:e=>s({...a,downloadUrl:e.target.value}),placeholder:"https://example.com/templates/..."}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Where users can find this template"})]})]}),(0,d.jsxs)(o3,{children:[(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>t(!1),disabled:r,children:"Cancel"}),(0,d.jsx)(Q.$,{onClick:l,disabled:r,children:r?"Exporting...":"Export Template"})]})]})})}let cr=(0,E.A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var cn=t(9024),[ca,cs]=(0,eo.A)("Tooltip",[em.Bk]),ci=(0,em.Bk)(),co="TooltipProvider",cl="tooltip.open",[cc,cu]=ca(co),cd=e=>{let{__scopeTooltip:A,delayDuration:t=700,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:a}=e,s=p.useRef(!0),i=p.useRef(!1),o=p.useRef(0);return p.useEffect(()=>{let e=o.current;return()=>window.clearTimeout(e)},[]),(0,d.jsx)(cc,{scope:A,isOpenDelayedRef:s,delayDuration:t,onOpen:p.useCallback(()=>{window.clearTimeout(o.current),s.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:p.useCallback(e=>{i.current=e},[]),disableHoverableContent:n,children:a})};cd.displayName=co;var cp="Tooltip",[ch,cg]=ca(cp),cf=e=>{let{__scopeTooltip:A,children:t,open:r,defaultOpen:n,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,o=cu(cp,e.__scopeTooltip),l=ci(A),[c,u]=p.useState(null),h=(0,ef.B)(),g=p.useRef(0),f=s??o.disableHoverableContent,m=i??o.delayDuration,B=p.useRef(!1),[w,v]=(0,el.i)({prop:r,defaultProp:n??!1,onChange:e=>{e?(o.onOpen(),document.dispatchEvent(new CustomEvent(cl))):o.onClose(),a?.(e)},caller:cp}),x=p.useMemo(()=>w?B.current?"delayed-open":"instant-open":"closed",[w]),y=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,B.current=!1,v(!0)},[v]),b=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v(!1)},[v]),C=p.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{B.current=!0,v(!0),g.current=0},m)},[m,v]);return p.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),(0,d.jsx)(em.bL,{...l,children:(0,d.jsx)(ch,{scope:A,contentId:h,open:w,stateAttribute:x,trigger:c,onTriggerChange:u,onTriggerEnter:p.useCallback(()=>{o.isOpenDelayedRef.current?C():y()},[o.isOpenDelayedRef,C,y]),onTriggerLeave:p.useCallback(()=>{f?b():(window.clearTimeout(g.current),g.current=0)},[b,f]),onOpen:y,onClose:b,disableHoverableContent:f,children:t})})};cf.displayName=cp;var cm="TooltipTrigger",cB=p.forwardRef((e,A)=>{let{__scopeTooltip:t,...r}=e,n=cg(cm,t),a=cu(cm,t),s=ci(t),i=p.useRef(null),o=(0,ei.s)(A,i,n.onTriggerChange),l=p.useRef(!1),c=p.useRef(!1),u=p.useCallback(()=>l.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,d.jsx)(em.Mz,{asChild:!0,...s,children:(0,d.jsx)(ec.sG.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:o,onPointerMove:(0,es.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||a.isPointerInTransitRef.current||(n.onTriggerEnter(),c.current=!0))}),onPointerLeave:(0,es.mK)(e.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:(0,es.mK)(e.onPointerDown,()=>{n.open&&n.onClose(),l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:(0,es.mK)(e.onFocus,()=>{l.current||n.onOpen()}),onBlur:(0,es.mK)(e.onBlur,n.onClose),onClick:(0,es.mK)(e.onClick,n.onClose)})})});cB.displayName=cm;var cw="TooltipPortal",[cv,cx]=ca(cw,{forceMount:void 0}),cy=e=>{let{__scopeTooltip:A,forceMount:t,children:r,container:n}=e,a=cg(cw,A);return(0,d.jsx)(cv,{scope:A,forceMount:t,children:(0,d.jsx)(ew.C,{present:t||a.open,children:(0,d.jsx)(eB.Z,{asChild:!0,container:n,children:r})})})};cy.displayName=cw;var cb="TooltipContent",cC=p.forwardRef((e,A)=>{let t=cx(cb,e.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...a}=e,s=cg(cb,e.__scopeTooltip);return(0,d.jsx)(ew.C,{present:r||s.open,children:s.disableHoverableContent?(0,d.jsx)(ck,{side:n,...a,ref:A}):(0,d.jsx)(cQ,{side:n,...a,ref:A})})}),cQ=p.forwardRef((e,A)=>{let t=cg(cb,e.__scopeTooltip),r=cu(cb,e.__scopeTooltip),n=p.useRef(null),a=(0,ei.s)(A,n),[s,i]=p.useState(null),{trigger:o,onClose:l}=t,c=n.current,{onPointerInTransitChange:u}=r,h=p.useCallback(()=>{i(null),u(!1)},[u]),g=p.useCallback((e,A)=>{let t=e.currentTarget,r={x:e.clientX,y:e.clientY},n=function(e,A){let t=Math.abs(A.top-e.y),r=Math.abs(A.bottom-e.y),n=Math.abs(A.right-e.x),a=Math.abs(A.left-e.x);switch(Math.min(t,r,n,a)){case a:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw Error("unreachable")}}(r,t.getBoundingClientRect());i(function(e){let A=e.slice();return A.sort((e,A)=>e.xA.x?1:e.yA.y)),function(e){if(e.length<=1)return e.slice();let A=[];for(let t=0;t=2;){let e=A[A.length-1],t=A[A.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))A.pop();else break}A.push(r)}A.pop();let t=[];for(let A=e.length-1;A>=0;A--){let r=e[A];for(;t.length>=2;){let e=t[t.length-1],A=t[t.length-2];if((e.x-A.x)*(r.y-A.y)>=(e.y-A.y)*(r.x-A.x))t.pop();else break}t.push(r)}return(t.pop(),1===A.length&&1===t.length&&A[0].x===t[0].x&&A[0].y===t[0].y)?A:A.concat(t)}(A)}([...function(e,A,t=5){let r=[];switch(A){case"top":r.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":r.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":r.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":r.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t})}return r}(r,n),...function(e){let{top:A,right:t,bottom:r,left:n}=e;return[{x:n,y:A},{x:t,y:A},{x:t,y:r},{x:n,y:r}]}(A.getBoundingClientRect())])),u(!0)},[u]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(o&&c){let e=e=>g(e,c),A=e=>g(e,o);return o.addEventListener("pointerleave",e),c.addEventListener("pointerleave",A),()=>{o.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",A)}}},[o,c,g,h]),p.useEffect(()=>{if(s){let e=e=>{let A=e.target,t={x:e.clientX,y:e.clientY},r=o?.contains(A)||c?.contains(A),n=!function(e,A){let{x:t,y:r}=e,n=!1;for(let e=0,a=A.length-1;er!=u>r&&t<(c-o)*(r-l)/(u-l)+o&&(n=!n)}return n}(t,s);r?h():n&&(h(),l())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[o,c,s,l,h]),(0,d.jsx)(ck,{...e,ref:a})}),[cF,cU]=ca(cp,{isInside:!1}),cE=(0,eT.Dc)("TooltipContent"),ck=p.forwardRef((e,A)=>{let{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,o=cg(cb,t),l=ci(t),{onClose:c}=o;return p.useEffect(()=>(document.addEventListener(cl,c),()=>document.removeEventListener(cl,c)),[c]),p.useEffect(()=>{if(o.trigger){let e=e=>{let A=e.target;A?.contains(o.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[o.trigger,c]),(0,d.jsx)(ep.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:c,children:(0,d.jsxs)(em.UC,{"data-state":o.stateAttribute,...l,...i,ref:A,style:{...i.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,d.jsx)(cE,{children:r}),(0,d.jsx)(cF,{scope:t,isInside:!0,children:(0,d.jsx)(cn.bL,{id:o.contentId,role:"tooltip",children:n||r})})]})})});cC.displayName=cb;var cj="TooltipArrow",cI=p.forwardRef((e,A)=>{let{__scopeTooltip:t,...r}=e,n=ci(t);return cU(cj,t).isInside?null:(0,d.jsx)(em.i3,{...n,...r,ref:A})});function cH({delayDuration:e=0,...A}){return(0,d.jsx)(cd,{"data-slot":"tooltip-provider",delayDuration:e,...A})}function cS({...e}){return(0,d.jsx)(cH,{children:(0,d.jsx)(cf,{"data-slot":"tooltip",...e})})}function cN({...e}){return(0,d.jsx)(cB,{"data-slot":"tooltip-trigger",...e})}function cL({className:e,sideOffset:A=0,children:t,arrowStyle:r,...n}){return(0,d.jsx)(cy,{children:(0,d.jsxs)(cC,{"data-slot":"tooltip-content",sideOffset:A,className:(0,y.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),...n,children:[t,(0,d.jsx)(cI,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:r})]})})}function cD({template:e,onSelect:A,onDelete:t,onExport:r,viewMode:n="grid"}){let a="isBuiltIn"in e&&e.isBuiltIn,s=a?null:e,i=e=>{let A=cA.N2.find(A=>A.value===e);return A?.label||e},o=A=>{A.stopPropagation(),!a&&t&&t(e.id)},l=A=>{A.stopPropagation(),r&&r(e)},c=e=>{if(!e)return"Never";try{return ea(e,{addSuffix:!0})}catch{return"Recently"}};return"list"===n?(0,d.jsx)("div",{className:"border border-border rounded-lg p-4 bg-card",children:(0,d.jsxs)("div",{className:"flex items-center gap-4",children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[s?.metadata.thumbnail?(0,d.jsx)("div",{className:"w-24 h-16 rounded-md overflow-hidden bg-muted",children:(0,d.jsx)("img",{src:s.metadata.thumbnail,alt:e.name,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-24 h-16 rounded-md bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-8 w-8 text-muted-foreground"})}),a&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{className:"absolute top-1 right-1 bg-background/90 rounded-full p-1",children:(0,d.jsx)(cr,{className:"h-3 w-3 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"Built-in template"})]})})]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 mb-1",children:[(0,d.jsx)("h3",{className:"font-semibold text-base truncate",title:e.name,children:e.name}),s&&(0,d.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["v",s.version]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1 mb-2",title:e.description,children:e.description}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[(s?.metadata.author||e.metadata?.author)&&(0,d.jsxs)("span",{className:"truncate max-w-[150px]",title:s?.metadata.author||e.metadata?.author,children:["by ",s?.metadata.author||e.metadata?.author]}),s?.metadata.license&&(0,d.jsxs)(d.Fragment,{children:[s.metadata.author&&(0,d.jsx)("span",{children:"•"}),(0,d.jsx)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0 h-auto",children:i(s.metadata.license)})]}),s?.files&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[s.files.length," files"]})]}),(s?.metadata.tags||e.metadata?.tags)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"•"}),(s?.metadata.tags||e.metadata?.tags||[]).slice(0,2).map(e=>(0,d.jsx)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:e},e)),(s?.metadata.tags||e.metadata?.tags||[]).length>2&&(0,d.jsxs)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:["+",(s?.metadata.tags||e.metadata?.tags||[]).length-2]})]})]})]}),(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-3 shrink-0",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:c(s?.updatedAt||e.updatedAt)}),(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),a&&(0,d.jsx)(cL,{children:"Built-in templates cannot be deleted"})]})})]})]})]})]}),(0,d.jsx)("div",{className:"md:hidden",children:(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]})}):(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden bg-card group",children:[(0,d.jsxs)("div",{className:"relative",children:[s?.metadata.thumbnail?(0,d.jsx)("div",{className:"w-full aspect-video bg-muted",children:(0,d.jsx)("img",{src:s.metadata.thumbnail,alt:e.name,className:"w-full h-full object-cover"})}):(0,d.jsx)("div",{className:"w-full aspect-video bg-muted flex items-center justify-center",children:(0,d.jsx)(H,{className:"h-16 w-16 text-muted-foreground"})}),a&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{className:"absolute top-2 right-2 bg-background/90 rounded-full p-1.5 shadow-sm",children:(0,d.jsx)(cr,{className:"h-4 w-4 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"Built-in template"})]})}),s?.metadata.downloadUrl&&(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("a",{href:s.metadata.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"absolute top-2 left-2 bg-background/90 hover:bg-background rounded-full p-1.5 shadow-sm transition-colors",onClick:e=>e.stopPropagation(),children:(0,d.jsx)(le.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,d.jsx)(cL,{children:"View on marketplace"})]})})]}),(0,d.jsxs)("div",{className:"p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("h3",{className:"font-semibold text-base line-clamp-1 flex-1",title:e.name,children:e.name}),s&&(0,d.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["v",s.version]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",title:e.description,children:e.description})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(s?.metadata.author||e.metadata?.author)&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:s?.metadata.authorUrl?(0,d.jsxs)("a",{href:s.metadata.authorUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",onClick:e=>e.stopPropagation(),children:["by ",s.metadata.author,(0,d.jsx)(le.A,{className:"h-3 w-3"})]}):(0,d.jsxs)("span",{children:["by ",s?.metadata.author||e.metadata?.author]})}),(s?.metadata.tags||e.metadata?.tags)&&(s?.metadata.tags||e.metadata?.tags||[]).length>0&&(0,d.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(s?.metadata.tags||e.metadata?.tags||[]).slice(0,3).map(e=>(0,d.jsx)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0.5",children:e},e)),(s?.metadata.tags||e.metadata?.tags||[]).length>3&&(0,d.jsxs)(o9.E,{variant:"secondary",className:"text-xs px-1.5 py-0.5",children:["+",(s?.metadata.tags||e.metadata?.tags||[]).length-3]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-wrap",children:[s?.metadata.license&&(0,d.jsx)(o9.E,{variant:"outline",className:"text-xs px-1.5 py-0 h-auto",children:i(s.metadata.license)}),s?.files&&(0,d.jsxs)(d.Fragment,{children:[s.metadata.license&&(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[s.files.length," files"]})]})]})]}),(0,d.jsxs)("div",{className:"pt-3 border-t flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:c(s?.updatedAt||e.updatedAt)}),(0,d.jsxs)(A$,{children:[(0,d.jsx)(AZ,{asChild:!0,children:(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,d.jsx)(K,{className:"h-4 w-4"})})}),(0,d.jsxs)(A0,{align:"end",children:[(0,d.jsxs)(A1,{onClick:()=>A(e),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsxs)(A1,{onClick:l,children:[(0,d.jsx)(V,{className:"mr-2 h-4 w-4"}),"Export Template"]})]}),t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A2,{}),(0,d.jsx)(cH,{children:(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsxs)(A1,{className:"text-destructive",onClick:o,disabled:a,children:[(0,d.jsx)(G,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),a&&(0,d.jsx)(cL,{children:"Built-in templates cannot be deleted"})]})})]})]})]})]})]})]})}function cT({onProjectCreated:e}){let[A,t]=(0,p.useState)([]),[r,n]=(0,p.useState)(!0),[a,s]=(0,p.useState)(""),[i,o]=(0,p.useState)("updated"),[l,c]=(0,p.useState)("grid"),u=(0,p.useCallback)(async()=>{try{n(!0);let e=await C.listCustomTemplates();t(e)}catch(e){y.v.error("Failed to load custom templates:",e),A4.oR.error("Failed to load custom templates")}finally{n(!1)}},[]),h=async()=>{let e=document.createElement("input");e.type="file",e.accept=".oswt",e.onchange=async e=>{let A=e.target.files?.[0];if(A)try{await C.importTemplateFile(A),A4.oR.success("Template imported successfully!"),await u()}catch(e){y.v.error("Failed to import template:",e),A4.oR.error(e instanceof Error?e.message:"Failed to import template")}},e.click()},g=async e=>{if(confirm("Are you sure you want to delete this template?"))try{await C.deleteCustomTemplate(e),A4.oR.success("Template deleted"),await u()}catch(e){y.v.error("Failed to delete template:",e),A4.oR.error("Failed to delete template")}},f=async e=>{try{if("isBuiltIn"in e&&e.isBuiltIn){A4.oR.info("Exporting built-in template as custom template...");let A=await m.vfs.createProject(e.name,e.description);"blank"===e.id?await lm(m.vfs,A.id,lg):"demo"===e.id&&await lm(m.vfs,A.id,lh,lh.assets);let t=await C.exportProjectAsTemplate(m.vfs,A.id,{name:e.name,description:e.description,version:"1.0.0",author:"OSW Studio",license:"mit",tags:e.metadata?.tags||[]});await m.vfs.deleteProject(A.id);let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),A4.oR.success("Template exported successfully!")}else{let A=await C.exportTemplateAsFile(e),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`${e.name.replace(/\s+/g,"-").toLowerCase()}.oswt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t),A4.oR.success("Template exported successfully!")}}catch(e){y.v.error("Failed to export template:",e),A4.oR.error("Failed to export template")}},B=async A=>{try{let t="Blank"===A.name||"Example Studios"===A.name?`New ${A.name} Project`:A.name,r=await m.vfs.createProject(t,A.description);"isBuiltIn"in A&&A.isBuiltIn?"blank"===A.id?await lm(m.vfs,r.id,lg):"demo"===A.id&&await lm(m.vfs,r.id,lh,lh.assets):await lm(m.vfs,r.id,{name:A.name,description:A.description,files:A.files.map(e=>({path:e.path,content:"string"==typeof e.content?e.content:new TextDecoder().decode(e.content)})),directories:A.directories,assets:A.assets}),A4.oR.success(`Project "${r.name}" created successfully!`),e&&e(r.id)}catch(e){y.v.error("Failed to create project from template:",e),A4.oR.error("Failed to create project")}},w=[...[...lB,...A].filter(e=>{let A=a.toLowerCase();return e.name.toLowerCase().includes(A)||e.description.toLowerCase().includes(A)||"metadata"in e&&e.metadata?.author?.toLowerCase().includes(A)||"metadata"in e&&e.metadata?.tags?.some(e=>e.toLowerCase().includes(A))})].sort((e,A)=>{switch(i){case"updated":let t="updatedAt"in e&&e.updatedAt?e.updatedAt:new Date("2024-01-01");return("updatedAt"in A&&A.updatedAt?A.updatedAt:new Date("2024-01-01")).getTime()-t.getTime();case"name":return e.name.localeCompare(A.name);case"author":let r="metadata"in e&&e.metadata?.author||"",n="metadata"in A&&A.metadata?.author||"";return r.localeCompare(n);case"files":let a="files"in e&&e.files?.length||0;return("files"in A&&A.files?.length||0)-a;default:return 0}});return r?(0,d.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,d.jsx)("p",{className:"mt-4",children:"Loading templates..."})]})}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)("div",{className:"pt-4 px-4 pb-3 sm:pt-6 sm:px-6 sm:pb-3 shrink-0",children:(0,d.jsxs)("div",{className:"mx-auto max-w-7xl flex flex-col sm:flex-row gap-3",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(ls.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,d.jsx)(F.p,{placeholder:"Search templates...",value:a,onChange:e=>s(e.target.value),className:"pl-9"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(li,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,d.jsx)(lw.hl,{className:"w-48",align:"end",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"font-semibold text-sm",children:"Sort by"}),(0,d.jsxs)(tn.l6,{value:i,onValueChange:e=>o(e),children:[(0,d.jsx)(tn.bq,{children:(0,d.jsx)(tn.yv,{})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsx)(tn.eb,{value:"updated",children:"Last Updated"}),(0,d.jsx)(tn.eb,{value:"name",children:"Name"}),(0,d.jsx)(tn.eb,{value:"author",children:"Author"}),(0,d.jsx)(tn.eb,{value:"files",children:"File Count"})]})]})]})})]}),(0,d.jsxs)("div",{className:"flex border rounded-full",children:[(0,d.jsx)(Q.$,{variant:"grid"===l?"secondary":"ghost",size:"sm",onClick:()=>c("grid"),className:"rounded-r-none rounded-l-full",children:(0,d.jsx)(lo,{className:"h-4 w-4"})}),(0,d.jsx)(Q.$,{variant:"list"===l?"secondary":"ghost",size:"sm",onClick:()=>c("list"),className:"rounded-l-none rounded-r-full",children:(0,d.jsx)(ll,{className:"h-4 w-4"})})]}),(0,d.jsxs)(Q.$,{onClick:h,size:"sm",className:"gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"Import"})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 px-4 pt-3 pb-4 sm:px-6 sm:pt-3 sm:pb-6",children:(0,d.jsx)("div",{className:"mx-auto max-w-7xl",children:0===w.length?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)("div",{className:"text-center max-w-md",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ls.A,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h3",{className:"font-semibold mb-2",children:"No templates found"}),(0,d.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:['No templates match your search query "',a,'"']}),(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>s(""),children:"Clear search"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(O,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h3",{className:"font-semibold mb-2",children:"No custom templates yet"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Import custom templates to get started with professional designs."}),(0,d.jsxs)(Q.$,{onClick:h,children:[(0,d.jsx)(lu,{className:"h-4 w-4 mr-2"}),"Import Template"]})]})})}):(0,d.jsx)("div",{className:"grid"===l?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4":"space-y-3",children:w.map(e=>(0,d.jsx)(cD,{template:e,onSelect:B,onDelete:g,onExport:f,viewMode:l},e.id))})})})]})}function cM({onProjectSelect:e}){let A=(0,f.useRouter)(),[t,r]=(0,p.useState)([]),[n,a]=(0,p.useState)(!0),[s,i]=(0,p.useState)(""),[o,l]=(0,p.useState)(!1),[c,u]=(0,p.useState)(""),[h,g]=(0,p.useState)(""),[B,w]=(0,p.useState)("blank"),[v,x]=(0,p.useState)([]),[b,E]=(0,p.useState)("updated"),[k,j]=(0,p.useState)("list"),[I,H]=(0,p.useState)(null),[S,N]=(0,p.useState)(!1),[L,T]=(0,p.useState)(null),[M,K]=(0,p.useState)("projects"),{state:P,setProjectList:R,start:O,setTourDemoProjectId:V}=l9(),G=P.currentStep?.id,z="running"===P.status,[q,W]=(0,p.useState)(!1),[J,X]=(0,p.useState)(null),_=(0,p.useRef)(!1),Y=(0,p.useRef)(!1),$=(0,p.useCallback)(async()=>{try{let e=await C.listCustomTemplates();x(e)}catch(e){y.v.error("Failed to load custom templates:",e)}},[]);(0,p.useCallback)(async()=>{if(!_.current){_.current=!0,a(!0);try{await m.vfs.init();let e=(await m.vfs.listProjects()).sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());r(e),R(e),await $()}catch(e){y.v.error("Failed to load projects:",e),A4.oR.error("Failed to load projects")}finally{a(!1),W(!0),_.current=!1}}},[R,$]);let Z=(0,p.useCallback)(async()=>{try{await m.vfs.init();let e=(await m.vfs.listProjects()).sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());r(e),R(e)}catch(e){y.v.error("Failed to reload projects:",e),A4.oR.error("Failed to reload projects")}},[R]),ee=async()=>{if(!Y.current){Y.current=!0;try{let A=await m.vfs.createProject("Multi-File Demo","Interactive examples showing how HTML, CSS, and JavaScript files work together");return await lm(m.vfs,A.id,lh,lh.assets),A4.oR.success("Demo project created successfully"),await Z(),e(A),A}catch(e){throw y.v.error("Failed to create demo project:",e),A4.oR.error("Failed to create demo project"),Y.current=!1,e}}},eA=async()=>{try{let e=await m.vfs.createProject("Example Studios (Tour)","Demo project for guided tour");await lm(m.vfs,e.id,lh,lh.assets),V(e.id),await Z(),O(),y.v.info("[Tour] Created tour demo project:",e.id)}catch(e){y.v.error("Failed to prepare for tour:",e),A4.oR.error("Failed to start tour - could not create demo project")}},et=async()=>{if(!c.trim())return void A4.oR.error("Please enter a project name");if(c.length>50)return void A4.oR.error("Project name must be 50 characters or less");if(h.length>200)return void A4.oR.error("Description must be 200 characters or less");try{let A=await m.vfs.createProject(c.trim().slice(0,50),h.trim().slice(0,200)||void 0);if(B.startsWith("custom:")){let e=B.replace("custom:",""),t=v.find(A=>A.id===e);t&&await lm(m.vfs,A.id,{name:t.name,description:t.description,files:t.files.map(e=>({path:e.path,content:"string"==typeof e.content?e.content:new TextDecoder().decode(e.content)})),directories:t.directories,assets:t.assets})}else"demo"===B?await lm(m.vfs,A.id,lh,lh.assets):await lm(m.vfs,A.id,lg);A4.oR.success("Project created successfully"),l(!1),u(""),g(""),w("blank"),await Z(),e(A)}catch(e){y.v.error("Failed to create project:",e),A4.oR.error("Failed to create project")}},er=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await m.vfs.deleteProject(e.id),A4.oR.success("Project deleted"),await Z()}catch(e){y.v.error("Failed to delete project:",e),A4.oR.error("Failed to delete project")}},en=async A=>{try{let t=await m.vfs.duplicateProject(A.id);A4.oR.success("Project duplicated successfully"),await Z(),e(t)}catch(e){y.v.error("Failed to duplicate project:",e),A4.oR.error("Failed to duplicate project")}},ea=async e=>{try{let A=await m.vfs.exportProject(e.id),t=JSON.stringify(A,null,2),r=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(r),a=document.createElement("a");a.href=n,a.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),A4.oR.success("Project exported")}catch(e){y.v.error("Failed to export project:",e),A4.oR.error("Failed to export project")}},es=async e=>{try{let A=await m.vfs.exportProjectAsZip(e.id),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t),A4.oR.success("Project exported as ZIP")}catch(e){y.v.error("Failed to export project as ZIP:",e),A4.oR.error("Failed to export project as ZIP")}},ei=async()=>{let A=document.createElement("input");A.type="file",A.accept=".json",A.onchange=async A=>{let t=A.target.files?.[0];if(t)try{let A=await t.text(),r=JSON.parse(A);if(!r.project||!r.files)throw Error("Invalid project file");let n=await m.vfs.importProject(r);A4.oR.success("Project imported successfully"),await Z(),e(n)}catch(e){y.v.error("Failed to import project:",e),A4.oR.error("Failed to import project")}},A.click()},eo=((e,A)=>{let t=[...e];switch(A){case"updated":return t.sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());case"created":return t.sort((e,A)=>A.createdAt.getTime()-e.createdAt.getTime());case"name":return t.sort((e,A)=>e.name.localeCompare(A.name));case"size":return t.sort((e,A)=>A.updatedAt.getTime()-e.updatedAt.getTime());default:return t}})(t.filter(e=>e.name.toLowerCase().includes(s.toLowerCase())||e.description?.toLowerCase().includes(s.toLowerCase())),b);if(n&&!q)return(0,d.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,d.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let el=(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsx)(Q.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,d.jsx)(lt,{className:"h-4 w-4"})})}),(0,d.jsx)(lw.hl,{className:"w-96",align:"end",children:(0,d.jsx)(l4,{})})]}),ec=(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,d.jsx)(lt,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,d.jsx)(lw.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,d.jsx)(l4,{})})]}),(0,d.jsx)("div",{className:"border-t my-2"}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:eA,disabled:z,className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>A.push("/test-generation"),className:"w-full justify-start",children:[(0,d.jsx)(ln,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>N(!0),className:"w-full justify-start",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]}),(0,d.jsx)(Q.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,d.jsxs)("a",{href:"https://github.com/o-stahl/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsx)(o7,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]}),eu=async A=>{await Z();let t=await m.vfs.getProject(A);t&&(K("projects"),e(t))};return(0,d.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,d.jsx)(ld.j,{onLogoClick:()=>N(!0),actions:[],mobileMenuContent:ec,desktopOnlyContent:el,leftText:"Open Source Web Studio",viewTabs:[{id:"projects",label:"Projects",icon:D},{id:"templates",label:"Templates",icon:la}],activeViewTab:M,onViewTabChange:e=>K(e)}),(0,d.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:"templates"===M?(0,d.jsx)(cT,{onProjectCreated:eu}):(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)("div",{className:"pt-4 px-4 pb-3 sm:pt-6 sm:px-6 sm:pb-3 shrink-0",children:(0,d.jsxs)("div",{className:"mx-auto max-w-7xl flex flex-col sm:flex-row gap-3","data-tour-id":"projects-actions",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(ls.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,d.jsx)(F.p,{placeholder:"Search projects...",value:s,onChange:e=>i(e.target.value),className:"pl-9"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(li,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Sort"})]})}),(0,d.jsx)(lw.hl,{className:"w-48",align:"end",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"font-semibold text-sm",children:"Sort by"}),(0,d.jsxs)(tn.l6,{value:b,onValueChange:e=>E(e),children:[(0,d.jsx)(tn.bq,{children:(0,d.jsx)(tn.yv,{})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsx)(tn.eb,{value:"updated",children:"Last Updated"}),(0,d.jsx)(tn.eb,{value:"created",children:"Date Created"}),(0,d.jsx)(tn.eb,{value:"name",children:"Name"})]})]})]})})]}),(0,d.jsxs)("div",{className:"flex border rounded-full",children:[(0,d.jsx)(Q.$,{variant:"grid"===k?"secondary":"ghost",size:"sm",onClick:()=>j("grid"),className:"rounded-r-none rounded-l-full",children:(0,d.jsx)(lo,{className:"h-4 w-4"})}),(0,d.jsx)(Q.$,{variant:"list"===k?"secondary":"ghost",size:"sm",onClick:()=>j("list"),className:"rounded-l-none rounded-r-full",children:(0,d.jsx)(ll,{className:"h-4 w-4"})})]}),(0,d.jsxs)(Q.$,{onClick:()=>l(!0),size:"sm",className:"gap-2","data-tour-id":"new-project-button",children:[(0,d.jsx)(lc,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"New"})]}),(0,d.jsxs)(Q.$,{onClick:ei,variant:"outline",size:"sm",className:"gap-2",children:[(0,d.jsx)(lu,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"Import"})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 px-4 pt-3 pb-4 sm:px-6 sm:pt-3 sm:pb-6",children:(0,d.jsx)("div",{className:"mx-auto max-w-7xl",children:0===eo.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)(D,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,d.jsx)("h2",{className:"text-xl font-semibold mb-2",children:s?"No projects found":"No projects yet"}),(0,d.jsx)("p",{className:"text-muted-foreground mb-6",children:s?"Try a different search term":"Create your first project to get started"}),!s&&(0,d.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,d.jsxs)(Q.$,{onClick:()=>l(!0),children:[(0,d.jsx)(lc,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,d.jsxs)(Q.$,{variant:"outline",onClick:ee,children:[(0,d.jsx)(D,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,d.jsx)("div",{className:"grid"===k?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4":"space-y-3","data-tour-id":"projects-list",children:eo.map(A=>"object"==typeof A&&A.id&&A.name?(0,d.jsx)(A3,{project:A,onSelect:e,onDelete:er,onExport:ea,onExportZip:es,onDuplicate:en,onPreview:H,onExportAsTemplate:T,onUpdate:e=>{r(t.map(A=>A.id===e.id?e:A))},viewMode:k,forceMenuOpen:J===A.id,highlightExport:z&&"project-controls"===G&&J===A.id},A.id):(y.v.error("Invalid project object:",A),null))})})})]})}),(0,d.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,d.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:eA,disabled:z,"data-tour-id":"footer-guided-tour",children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>A.push("/test-generation"),children:[(0,d.jsx)(ln,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",onClick:()=>N(!0),children:[(0,d.jsx)(lr,{className:"mr-2 h-4 w-4"}),"About OSW Studio"]}),(0,d.jsx)(Q.$,{variant:"outline",size:"sm",asChild:!0,children:(0,d.jsxs)("a",{href:"https://github.com/o-stahl/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsx)(o7,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]})}),(0,d.jsx)(oZ,{open:o,onOpenChange:l,children:(0,d.jsxs)(o2,{children:[(0,d.jsxs)(o4,{children:[(0,d.jsx)(o5,{children:"Create New Project"}),(0,d.jsx)(o6,{children:"Start a new multipage website project"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsx)(lp.J,{htmlFor:"name",children:"Project Name"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.length,"/50"]})]}),(0,d.jsx)(F.p,{id:"name",value:c,onChange:e=>u(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(lp.J,{htmlFor:"template",children:"Template"}),(0,d.jsxs)(tn.l6,{value:B,onValueChange:w,children:[(0,d.jsx)(tn.bq,{id:"template",className:"mt-2 w-full",children:(0,d.jsx)("div",{className:"truncate flex-1 text-left",children:(e=>{if(e.startsWith("custom:")){let A=e.replace("custom:",""),t=v.find(e=>e.id===A);return t?.name||"Custom Template"}let A=lB.find(A=>A.id===e);return A?.name||"Select a template"})(B)})}),(0,d.jsxs)(tn.gC,{children:[(0,d.jsxs)(tn.s3,{children:[(0,d.jsx)(tn.TR,{children:"Built-in Templates"}),lB.map(e=>(0,d.jsx)(tn.eb,{value:e.id,children:(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"font-medium",children:e.name}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})},e.id))]}),v.length>0&&(0,d.jsxs)(tn.s3,{children:[(0,d.jsx)(tn.TR,{children:"Custom Templates"}),v.map(e=>(0,d.jsx)(tn.eb,{value:`custom:${e.id}`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"font-medium",children:e.name}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})},e.id))]})]})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsx)(lp.J,{htmlFor:"description",children:"Description (optional)"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[h.length,"/200"]})]}),(0,d.jsx)(U,{id:"description",value:h,onChange:e=>g(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,d.jsxs)(o3,{children:[(0,d.jsx)(Q.$,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),(0,d.jsx)(Q.$,{onClick:et,children:"Create Project"})]})]})}),I&&(0,d.jsx)(oZ,{open:!!I,onOpenChange:()=>H(null),children:(0,d.jsxs)(o2,{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,d.jsx)(o4,{className:"p-4 border-b",children:(0,d.jsxs)(o5,{children:["Preview: ",I.name]})}),(0,d.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,d.jsx)(ow,{projectId:I.id})})]})}),(0,d.jsx)(ct,{project:L,open:!!L,onOpenChange:e=>{e||T(null)}}),(0,d.jsx)(lA,{open:S,onOpenChange:N}),(0,d.jsx)(ce,{location:"project-manager"})]})}cI.displayName=cj;let cK=(0,E.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"}]]),cP=(0,E.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"}]]),cR=(0,E.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"}]]),cO=(0,E.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 cV="ContextMenu",[cG,cz]=(0,eo.A)(cV,[e_]),cq=e_(),[cW,cJ]=cG(cV),cX=e=>{let{__scopeContextMenu:A,children:t,onOpenChange:r,dir:n,modal:a=!0}=e,[s,i]=p.useState(!1),o=cq(A),l=(0,ev.c)(r),c=p.useCallback(e=>{i(e),l(e)},[l]);return(0,d.jsx)(cW,{scope:A,open:s,onOpenChange:c,modal:a,children:(0,d.jsx)(e4,{...o,dir:n,open:s,onOpenChange:c,modal:a,children:t})})};cX.displayName=cV;var c_="ContextMenuTrigger",cY=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,disabled:r=!1,...n}=e,a=cJ(c_,t),s=cq(t),i=p.useRef({x:0,y:0}),o=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...i.current})}),l=p.useRef(0),c=p.useCallback(()=>window.clearTimeout(l.current),[]),u=e=>{i.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return p.useEffect(()=>c,[c]),p.useEffect(()=>void(r&&c()),[r,c]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(e3,{...s,virtualRef:o}),(0,d.jsx)(ec.sG.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...n,ref:A,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:(0,es.mK)(e.onContextMenu,e=>{c(),u(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:(0,es.mK)(e.onPointerDown,ue(e=>{c(),l.current=window.setTimeout(()=>u(e),700)})),onPointerMove:r?e.onPointerMove:(0,es.mK)(e.onPointerMove,ue(c)),onPointerCancel:r?e.onPointerCancel:(0,es.mK)(e.onPointerCancel,ue(c)),onPointerUp:r?e.onPointerUp:(0,es.mK)(e.onPointerUp,ue(c))})]})});cY.displayName=c_;var c$=e=>{let{__scopeContextMenu:A,...t}=e,r=cq(A);return(0,d.jsx)(e9,{...r,...t})};c$.displayName="ContextMenuPortal";var cZ="ContextMenuContent",c0=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cJ(cZ,t),a=cq(t),s=p.useRef(!1);return(0,d.jsx)(At,{...a,...r,ref:A,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:A=>{e.onCloseAutoFocus?.(A),!A.defaultPrevented&&s.current&&A.preventDefault(),s.current=!1},onInteractOutside:A=>{e.onInteractOutside?.(A),A.defaultPrevented||n.modal||(s.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)"}})});c0.displayName=cZ,p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ai,{...n,...r,ref:A})}).displayName="ContextMenuGroup";var c1=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ao,{...n,...r,ref:A})});c1.displayName="ContextMenuLabel";var c2=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Au,{...n,...r,ref:A})});c2.displayName="ContextMenuItem";var c4=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ap,{...n,...r,ref:A})});c4.displayName="ContextMenuCheckboxItem",p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Am,{...n,...r,ref:A})}).displayName="ContextMenuRadioGroup";var c3=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Aw,{...n,...r,ref:A})});c3.displayName="ContextMenuRadioItem";var c5=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(Ab,{...n,...r,ref:A})});c5.displayName="ContextMenuItemIndicator";var c6=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AC,{...n,...r,ref:A})});c6.displayName="ContextMenuSeparator",p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AQ,{...n,...r,ref:A})}).displayName="ContextMenuArrow";var c8="ContextMenuSub",c9=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AI,{...n,...r,ref:A})});c9.displayName="ContextMenuSubTrigger";var c7=p.forwardRef((e,A)=>{let{__scopeContextMenu:t,...r}=e,n=cq(t);return(0,d.jsx)(AS,{...n,...r,ref:A,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 ue(e){return A=>"mouse"!==A.pointerType?e(A):void 0}c7.displayName="ContextMenuSubContent";let uA=(0,E.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);p.forwardRef(({className:e,inset:A,children:t,...r},n)=>(0,d.jsxs)(c9,{ref:n,className:(0,y.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",A&&"pl-8",e),...r,children:[t,(0,d.jsx)(A9,{className:"ml-auto h-4 w-4"})]})).displayName=c9.displayName,p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c7,{ref:t,className:(0,y.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),...A})).displayName=c7.displayName;let ut=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c$,{children:(0,d.jsx)(c0,{ref:t,className:(0,y.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),...A})}));ut.displayName=c0.displayName;let ur=p.forwardRef(({className:e,inset:A,...t},r)=>(0,d.jsx)(c2,{ref:r,className:(0,y.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",A&&"pl-8",e),...t}));function un({projectId:e,onFileSelect:A,selectedPath:t,onClose:r}){let[n,a]=(0,p.useState)([]),[s,i]=(0,p.useState)([]),[o,l]=(0,p.useState)(new Set(["/"])),[c,u]=(0,p.useState)(null),[h,g]=(0,p.useState)(""),[f,B]=(0,p.useState)(!1),[w,v]=(0,p.useState)(null),[x,b]=(0,p.useState)(null),C=(0,p.useRef)(null),U=(0,p.useCallback)(async()=>{try{await m.vfs.init();let A=await m.vfs.getAllFilesAndDirectories(e),t=A.filter(e=>"directory"!==e.type);a(t),i(E(A))}catch(e){y.v.error("Failed to load files:",e)}},[e]),E=e=>{let A=[],t=new Map;e.forEach(e=>{if("directory"===e.type){let A=e.path.split("/").filter(Boolean),r={path:e.path,name:e.name||A[A.length-1]||"unnamed",type:"directory",children:[]};t.set(e.path,r)}}),e.forEach(e=>{if("directory"!==e.type){let A=e.path.split("/").filter(Boolean),r="";for(let e=0;e{let n=r.split("/").filter(Boolean);if(1===n.length)A.push(e);else{let A="/"+n.slice(0,-1).join("/"),r=t.get(A);r&&r.children&&r.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let r=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name,type:"file"};if(1===r.length)A.push(n);else{let e="/"+r.slice(0,-1).join("/"),A=t.get(e);A&&A.children?.push(n)}}});let r=e=>{e.sort((e,A)=>e.type===A.type?e.name.localeCompare(A.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&r(e.children)})};return r(A),A},k=e=>{l(A=>{let t=new Set(A);return t.has(e)?t.delete(e):t.add(e),t})},j=async e=>{if("directory"===e.type)k(e.path);else{let t=n.find(A=>A.path===e.path);t&&A&&A(t)}},H=async(A="/")=>{let t=prompt("Enter file name:");if(!t)return;let r="/"===A?`/${t}`:`${A}/${t}`;try{await m.vfs.createFile(e,r,""),await U()}catch(e){y.v.error("Failed to create file:",e)}},S=async(A="/")=>{let t=prompt("Enter directory name:");if(!t)return;let r="/"===A?`/${t}`:`${A}/${t}`;try{await m.vfs.createDirectory(e,r),await U()}catch(e){y.v.error("Failed to create directory:",e)}},L=async(A,t)=>{if(confirm(`Delete ${t} "${A}"?`))try{"file"===t?await m.vfs.deleteFile(e,A):await m.vfs.deleteDirectory(e,A),await U()}catch(e){y.v.error(`Failed to delete ${t}:`,e)}},T=async(A,t)=>{if(!h)return;let r=A.split("/");r[r.length-1]=h;let n=r.join("/");try{"directory"===t?await m.vfs.renameDirectory(e,A,n):await m.vfs.renameFile(e,A,n),await U(),u(null),g("")}catch(e){y.v.error(`Failed to rename ${t}:`,e)}},M=async e=>{for(let A of(e.preventDefault(),e.stopPropagation(),B(!1),Array.from(e.dataTransfer.items)))if("file"===A.kind){let e=A.getAsFile();e&&await K(e,"/")}},K=async(A,t)=>{if(!(0,cA.fu)(A.name))return void A4.oR.error(`File type not supported: ${A.name}`);let r=(0,cA.Gr)(A.name),n=cA.Q6[r];if(A.size>n)return void A4.oR.error(`File too large: ${A.name}. Maximum size is ${Math.round(n/1024/1024)}MB`);let a="/"===t?`/${A.name}`:`${t}/${A.name}`;try{let t;t="image"===r||"video"===r||"binary"===r?await A.arrayBuffer():await A.text(),await m.vfs.createFile(e,a,t),await U(),A4.oR.success(`Uploaded ${A.name}`)}catch(r){if(r.message?.includes("already exists")){if(confirm(`File "${A.name}" already exists. Overwrite?`))try{await m.vfs.deleteFile(e,a),await K(A,t)}catch(e){y.v.error("Failed to overwrite file:",e),A4.oR.error("Failed to overwrite file")}}else y.v.error("Failed to upload file:",r),A4.oR.error(`Failed to upload ${A.name}: ${r.message}`)}},P=(e,A)=>{e.stopPropagation(),v(A),e.dataTransfer.effectAllowed="move"},R=()=>{v(null),b(null)},O=(e,A)=>{e.preventDefault(),e.stopPropagation(),w&&A!==w.path&&(e.dataTransfer.dropEffect="move",b(A))},V=async(A,t)=>{if(A.preventDefault(),A.stopPropagation(),!w||t&&w.path===t.path)return void b(null);let r=t&&"directory"===t.type?t.path:"/";if("directory"===w.type){let e=w.path.endsWith("/")?w.path:w.path+"/";if((r.endsWith("/")?r:r+"/").startsWith(e)){A4.oR.error("Cannot move a folder into itself"),b(null);return}}let n=w.name,a="/"===r?`/${n}`:`${r}/${n}`;try{"directory"===w.type?await m.vfs.moveDirectory(e,w.path,a):await m.vfs.moveFile(e,w.path,a),await U(),A4.oR.success(`Moved ${w.name} to ${"/"===r?"root":r}`)}catch(e){y.v.error("Failed to move item:",e),A4.oR.error(`Failed to move: ${e.message}`)}b(null)},G=(e,A=0)=>{let r=o.has(e.path),n=t===e.path,a=c===e.path,s=x===e.path;return(0,d.jsxs)("div",{draggable:!a,onDragStart:A=>P(A,e),onDragEnd:R,onDragOver:A=>"directory"===e.type&&O(A,e.path),onDrop:A=>"directory"===e.type&&V(A,e),children:[(0,d.jsxs)(cX,{children:[(0,d.jsx)(cY,{children:(0,d.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",n&&"bg-accent text-accent-foreground",s&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",w?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*A+8}px`},onClick:()=>j(e),children:["directory"===e.type?(0,d.jsxs)(d.Fragment,{children:[r?(0,d.jsx)(lD.A,{className:"w-4 h-4 text-muted-foreground"}):(0,d.jsx)(A9,{className:"w-4 h-4 text-muted-foreground"}),r?(0,d.jsx)(D,{className:"w-4 h-4 text-blue-500"}):(0,d.jsx)(cK,{className:"w-4 h-4 text-blue-500"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"w-4"}),(()=>{let A=(0,cA.Gr)(e.path);return"image"===A?(0,d.jsx)(I,{className:"w-4 h-4 text-green-500"}):"video"===A?(0,d.jsx)(cP,{className:"w-4 h-4 text-purple-500"}):(0,d.jsx)(cR,{className:"w-4 h-4 text-muted-foreground"})})()]}),a?(0,d.jsx)(F.p,{value:h,onChange:e=>g(e.target.value),onBlur:()=>T(e.path,e.type),onKeyDown:A=>{"Enter"===A.key?T(e.path,e.type):"Escape"===A.key&&(u(null),g(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,d.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,d.jsxs)(ut,{children:["directory"===e.type&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ur,{onClick:()=>H(e.path),children:[(0,d.jsx)(cR,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,d.jsxs)(ur,{onClick:()=>S(e.path),children:[(0,d.jsx)(cK,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,d.jsxs)(ur,{onClick:()=>C.current?.click(),children:[(0,d.jsx)(lu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,d.jsx)(ur,{onClick:()=>{u(e.path),g(e.name)},children:"Rename"}),(0,d.jsx)(ur,{onClick:()=>L(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&r&&e.children&&(0,d.jsx)("div",{children:e.children.map(e=>G(e,A+1))})]},e.path)};return(0,d.jsxs)("div",{className:"h-full flex flex-col",onDrop:M,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),B(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let A=e.currentTarget.getBoundingClientRect(),t=e.clientX,r=e.clientY;(t=A.right||r=A.bottom)&&B(!1)},children:[(0,d.jsx)("input",{ref:C,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let A of Array.from(e.target.files||[]))await K(A,"/");C.current&&(C.current.value="")}}),(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(cO,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),r?(0,d.jsxs)("button",{type:"button",onClick:r,"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,d.jsx)(cO,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(cO,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>C.current?.click(),title:"Upload files",children:(0,d.jsx)(lu,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>H("/"),title:"New file",children:(0,d.jsx)(cR,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>S("/"),title:"New folder",children:(0,d.jsx)(cK,{className:"h-3 w-3"})})]})]}),(0,d.jsxs)(cX,{children:[(0,d.jsx)(cY,{asChild:!0,children:(0,d.jsxs)("div",{className:(0,y.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",f&&"bg-blue-500/10"),onDragOver:e=>{w&&(e.preventDefault(),e.stopPropagation(),b("/"))},onDrop:e=>{w&&V(e,null)},children:[f&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,d.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,d.jsx)(lu,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,d.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===s.length?(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,d.jsxs)("div",{className:"text-center space-y-3",children:[(0,d.jsx)(cK,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,d.jsx)("div",{className:"contents",children:s.map(e=>G(e))})]})}),(0,d.jsxs)(ut,{children:[(0,d.jsxs)(ur,{onClick:()=>H("/"),children:[(0,d.jsx)(cR,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,d.jsxs)(ur,{onClick:()=>S("/"),children:[(0,d.jsx)(cK,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,d.jsxs)(ur,{onClick:()=>C.current?.click(),children:[(0,d.jsx)(lu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function ua(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);A&&(r=r.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,r)}return t}ur.displayName=c2.displayName,p.forwardRef(({className:e,children:A,checked:t,...r},n)=>(0,d.jsxs)(c4,{ref:n,className:(0,y.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:t,...r,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(c5,{children:(0,d.jsx)(S.A,{className:"h-4 w-4"})})}),A]})).displayName=c4.displayName,p.forwardRef(({className:e,children:A,...t},r)=>(0,d.jsxs)(c3,{ref:r,className:(0,y.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),...t,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(c5,{children:(0,d.jsx)(uA,{className:"h-2 w-2 fill-current"})})}),A]})).displayName=c3.displayName,p.forwardRef(({className:e,inset:A,...t},r)=>(0,d.jsx)(c1,{ref:r,className:(0,y.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",A&&"pl-8",e),...t})).displayName=c1.displayName,p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(c6,{ref:t,className:(0,y.cn)("-mx-1 my-1 h-px bg-border",e),...A})).displayName=c6.displayName;function us(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,r=Array(A);t=e.length?e.apply(this,n):function(){for(var e=arguments.length,r=Array(e),a=0;a=e.length?e.apply(this,n):function(){for(var e=arguments.length,r=Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};up.initial(e),up.handler(A);var t={current:e},r=ul(uf)(t,A),n=ul(ug)(t),a=ul(up.changes)(e),s=ul(uh)(t);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return up.selector(e),e(t.current)},function(e){(function(){for(var e=arguments.length,A=Array(e),t=0;t{r.current=!1}:e,A)};function uT(){}function uM(e,A,t,r){var n,a,s,i,o,l;return n=e,a=r,n.editor.getModel(uK(n,a))||(s=e,i=A,o=t,l=r,s.editor.createModel(i,o,l?uK(s,l):void 0))}function uK(e,A){return e.Uri.parse(A)}(0,p.memo)(function({original:e,modified:A,language:t,originalLanguage:r,modifiedLanguage:n,originalModelPath:a,modifiedModelPath:s,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:o=!1,theme:l="light",loading:c="Loading...",options:u={},height:d="100%",width:h="100%",className:g,wrapperProps:f={},beforeMount:m=uT,onMount:B=uT}){let[w,v]=(0,p.useState)(!1),[x,y]=(0,p.useState)(!0),b=(0,p.useRef)(null),C=(0,p.useRef)(null),Q=(0,p.useRef)(null),F=(0,p.useRef)(B),U=(0,p.useRef)(m),E=(0,p.useRef)(!1);uL(()=>{let e=uj.init();return e.then(e=>(C.current=e)&&y(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let A;return b.current?(A=b.current?.getModel(),void(i||A?.original?.dispose(),o||A?.modified?.dispose(),b.current?.dispose())):e.cancel()}}),uD(()=>{if(b.current&&C.current){let A=b.current.getOriginalEditor(),n=uM(C.current,e||"",r||t||"text",a||"");n!==A.getModel()&&A.setModel(n)}},[a],w),uD(()=>{if(b.current&&C.current){let e=b.current.getModifiedEditor(),r=uM(C.current,A||"",n||t||"text",s||"");r!==e.getModel()&&e.setModel(r)}},[s],w),uD(()=>{let e=b.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(A||""):A!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:A||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[A],w),uD(()=>{b.current?.getModel()?.original.setValue(e||"")},[e],w),uD(()=>{let{original:e,modified:A}=b.current.getModel();C.current.editor.setModelLanguage(e,r||t||"text"),C.current.editor.setModelLanguage(A,n||t||"text")},[t,r,n],w),uD(()=>{C.current?.editor.setTheme(l)},[l],w),uD(()=>{b.current?.updateOptions(u)},[u],w);let k=(0,p.useCallback)(()=>{if(!C.current)return;U.current(C.current);let i=uM(C.current,e||"",r||t||"text",a||""),o=uM(C.current,A||"",n||t||"text",s||"");b.current?.setModel({original:i,modified:o})},[t,A,n,e,r,a,s]),j=(0,p.useCallback)(()=>{!E.current&&Q.current&&(b.current=C.current.editor.createDiffEditor(Q.current,{automaticLayout:!0,...u}),k(),C.current?.editor.setTheme(l),v(!0),E.current=!0)},[u,l,k]);return(0,p.useEffect)(()=>{w&&F.current(b.current,C.current)},[w]),(0,p.useEffect)(()=>{x||w||j()},[x,w,j]),p.createElement(uN,{width:h,height:d,isEditorReady:w,loading:c,_ref:Q,className:g,wrapperProps:f})});var uP=function(e){let A=(0,p.useRef)();return(0,p.useEffect)(()=>{A.current=e},[e]),A.current},uR=new Map,uO=(0,p.memo)(function({defaultValue:e,defaultLanguage:A,defaultPath:t,value:r,language:n,path:a,theme:s="light",line:i,loading:o="Loading...",options:l={},overrideServices:c={},saveViewState:u=!0,keepCurrentModel:d=!1,width:h="100%",height:g="100%",className:f,wrapperProps:m={},beforeMount:B=uT,onMount:w=uT,onChange:v,onValidate:x=uT}){let[y,b]=(0,p.useState)(!1),[C,Q]=(0,p.useState)(!0),F=(0,p.useRef)(null),U=(0,p.useRef)(null),E=(0,p.useRef)(null),k=(0,p.useRef)(w),j=(0,p.useRef)(B),I=(0,p.useRef)(),H=(0,p.useRef)(r),S=uP(a),N=(0,p.useRef)(!1),L=(0,p.useRef)(!1);uL(()=>{let e=uj.init();return e.then(e=>(F.current=e)&&Q(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>U.current?void(I.current?.dispose(),d?u&&uR.set(a,U.current.saveViewState()):U.current.getModel()?.dispose(),U.current.dispose()):e.cancel()}),uD(()=>{let s=uM(F.current,e||r||"",A||n||"",a||t||"");s!==U.current?.getModel()&&(u&&uR.set(S,U.current?.saveViewState()),U.current?.setModel(s),u&&U.current?.restoreViewState(uR.get(a)))},[a],y),uD(()=>{U.current?.updateOptions(l)},[l],y),uD(()=>{U.current&&void 0!==r&&(U.current.getOption(F.current.editor.EditorOption.readOnly)?U.current.setValue(r):r!==U.current.getValue()&&(L.current=!0,U.current.executeEdits("",[{range:U.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),U.current.pushUndoStop(),L.current=!1))},[r],y),uD(()=>{let e=U.current?.getModel();e&&n&&F.current?.editor.setModelLanguage(e,n)},[n],y),uD(()=>{void 0!==i&&U.current?.revealLine(i)},[i],y),uD(()=>{F.current?.editor.setTheme(s)},[s],y);let D=(0,p.useCallback)(()=>{if(!(!E.current||!F.current)&&!N.current){j.current(F.current);let o=a||t,d=uM(F.current,r||e||"",A||n||"",o||"");U.current=F.current?.editor.create(E.current,{model:d,automaticLayout:!0,...l},c),u&&U.current.restoreViewState(uR.get(o)),F.current.editor.setTheme(s),void 0!==i&&U.current.revealLine(i),b(!0),N.current=!0}},[e,A,t,r,n,a,l,c,u,s,i]);return(0,p.useEffect)(()=>{y&&k.current(U.current,F.current)},[y]),(0,p.useEffect)(()=>{C||y||D()},[C,y,D]),H.current=r,(0,p.useEffect)(()=>{y&&v&&(I.current?.dispose(),I.current=U.current?.onDidChangeModelContent(e=>{L.current||v(U.current.getValue(),e)}))},[y,v]),(0,p.useEffect)(()=>{if(y){let e=F.current.editor.onDidChangeMarkers(e=>{let A=U.current.getModel()?.uri;if(A&&e.find(e=>e.path===A.path)){let e=F.current.editor.getModelMarkers({resource:A});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[y,x]),p.createElement(uN,{width:h,height:g,isEditorReady:y,loading:o,_ref:E,className:f,wrapperProps:m})});let uV=(0,E.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"}]]),uG=(0,E.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 uz=t(3613);function uq({projectId:e,onFilesChange:A,onClose:t}){let[r,n]=(0,p.useState)(new Map),[a,s]=(0,p.useState)(null),{resolvedTheme:i}=(0,lN.D)(),[o,l]=(0,p.useState)(!1),c=g().useRef(new Set),u=(e,A)=>{A&&A.stopPropagation();let t=r.get(e);if((!t?.modified||confirm(`Close ${t.file.name} without saving?`))&&(n(A=>{let t=new Map(A);return t.delete(e),t}),a===e)){let A=Array.from(r.keys()).filter(A=>A!==e);s(A.length>0?A[A.length-1]:null)}},h=(0,p.useCallback)((e,A)=>{void 0!==e&&"text"===B(A).type&&n(t=>{let r=new Map(t),n=r.get(A);if(n){let t=n.content!==e;r.set(A,{...n,content:e,modified:t})}return r})},[]),f=(0,p.useCallback)(async A=>{let t=r.get(A);if(t&&t.modified){c.current.add(A);try{await m.vfs.init();let r=await m.vfs.updateFile(e,A,t.content);n(e=>{let n=new Map(e);return n.set(A,{file:r,content:t.content,modified:!1}),n})}catch(e){y.v.error("Failed to save file:",e)}finally{setTimeout(()=>{c.current.delete(A)},100)}}},[r,e]);(0,p.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),a&&f(a))},[a,f]);let B=e=>{let A=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(A||""))return{type:"image",language:"plaintext"};let t={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 t[A||""]?{type:"text",language:t[A||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(A||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},w=e=>B(e).language,v=a?r.get(a):null;return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(uV,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),t?(0,d.jsxs)("button",{type:"button",onClick:t,"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,d.jsx)(uV,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(uV,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,d.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),v?.modified&&"text"===B(v.file.path).type&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>f(a),children:[(0,d.jsx)(uG,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===r.size?(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,d.jsxs)("div",{className:"text-center space-y-3",children:[(0,d.jsx)(k,{className:"h-12 w-12 mx-auto opacity-50"}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,d.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"border-b bg-muted/70",children:(0,d.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(r.entries()).map(([e,A])=>(0,d.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",a===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>s(e),children:[(0,d.jsxs)("span",{className:"text-sm",children:[A.file.name,A.modified&&(0,d.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,d.jsx)(Q.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:A=>u(e,A),children:(0,d.jsx)(N.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),v&&(0,d.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=B(v.file.path);return"image"===e.type?(0,d.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,d.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,d.jsx)(I,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:v.file.name})]}),(0,d.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,d.jsx)("img",{src:`data:image/${v.file.path.split(".").pop()};base64,${v.content}`,alt:v.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let A=e.target;if(A.style.display="none",!A.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',A.parentElement?.appendChild(e)}}})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,d.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,d.jsxs)("div",{className:"text-center space-y-4",children:[(0,d.jsx)(uz.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:v.file.name}),(0,d.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,d.jsx)(uO,{height:"100%",language:w(v.file.path),value:v.content,onChange:e=>h(e,v.file.path),theme:o?"dark"===i?"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 uW(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var uJ=t(8559);let uX=(0,E.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"}]]),u_=(0,E.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"}]]),uY=(0,E.A)("bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);var u$=t(356),uZ=t(158);class u0{async initDB(){if(this.isInitialized)return;let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));await e.init(),this.isInitialized=!0}async getDB(){let{vfs:e}=await Promise.resolve().then(t.bind(t,1338));return e.db.getDatabase()}getDebugEventsId(e){return`debug_events_${e}`}async loadEvents(e){await this.initDB();let A=await this.getDB(),t=this.getDebugEventsId(e);return new Promise((r,n)=>{let a=A.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let A=a.result;A&&A.events?(this.eventsCache.set(e,A.events),r(A.events)):r([])},a.onerror=()=>{y.v.error("Failed to load debug events from DB"),n(a.error)}})}async saveEvents(e,A){await this.initDB();let t=await this.getDB(),r={id:this.getDebugEventsId(e),projectId:e,events:A,lastUpdated:new Date().toISOString()};return new Promise((n,a)=>{let s=t.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);s.onsuccess=()=>{this.eventsCache.set(e,A),n()},s.onerror=()=>{y.v.error("Failed to save debug events to DB"),a(s.error)}})}async appendEvent(e,A){let t=this.eventsCache.get(e);t||(t=await this.loadEvents(e)),t.push(A),this.eventsCache.set(e,t),await this.saveEvents(e,t)}async clearEvents(e){this.eventsCache.delete(e),await this.saveEvents(e,[]),y.v.debug(`[DebugEventsState] Cleared debug events for project ${e}`)}async truncateEvents(e,A){this.eventsCache.set(e,A),await this.saveEvents(e,A),y.v.debug(`[DebugEventsState] Truncated debug events for project ${e} to ${A.length} events`)}async getEvents(e){let A=this.eventsCache.get(e);return A||(A=await this.loadEvents(e)),A}async deleteProject(e){await this.initDB();let A=await this.getDB(),t=this.getDebugEventsId(e);return new Promise((r,n)=>{let a=A.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);a.onsuccess=()=>{this.eventsCache.delete(e),r()},a.onerror=()=>{y.v.error("Failed to delete debug events from DB"),n(a.error)}})}constructor(){this.eventsCache=new Map,this.storeName="debugEvents",this.isInitialized=!1}}let u1=new u0,u2=(0,E.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"}]]),u4=(0,p.createContext)(null);u4.displayName="PanelGroupContext";let u3={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"},u5=h["useId".toString()],u6="function"==typeof u5?u5:()=>null,u8=0;function u9(e=null){let A=u6(),t=(0,p.useRef)(e||A||null);return null===t.current&&(t.current=""+u8++),null!=e?e:t.current}function u7({children:e,className:A="",collapsedSize:t,collapsible:r,defaultSize:n,forwardedRef:a,id:s,maxSize:i,minSize:o,onCollapse:l,onExpand:c,onResize:u,order:d,style:h,tagName:g="div",...f}){let m=(0,p.useContext)(u4);if(null===m)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:B,expandPanel:w,getPanelSize:v,getPanelStyle:x,groupId:y,isPanelCollapsed:b,reevaluatePanelConstraints:C,registerPanel:Q,resizePanel:F,unregisterPanel:U}=m,E=u9(s),k=(0,p.useRef)({callbacks:{onCollapse:l,onExpand:c,onResize:u},constraints:{collapsedSize:t,collapsible:r,defaultSize:n,maxSize:i,minSize:o},id:E,idIsFromProps:void 0!==s,order:d});(0,p.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,p.useImperativeHandle)(a,()=>({collapse:()=>{B(k.current)},expand:e=>{w(k.current,e)},getId:()=>E,getSize:()=>v(k.current),isCollapsed:()=>b(k.current),isExpanded:()=>!b(k.current),resize:e=>{F(k.current,e)}}),[B,w,v,b,E,F]);let j=x(k.current,n);return(0,p.createElement)(g,{...f,children:e,className:A,id:E,style:{...j,...h},[u3.groupId]:y,[u3.panel]:"",[u3.panelCollapsible]:r||void 0,[u3.panelId]:E,[u3.panelSize]:parseFloat(""+j.flexGrow).toFixed(1)})}let de=(0,p.forwardRef)((e,A)=>(0,p.createElement)(u7,{...e,forwardedRef:A}));u7.displayName="Panel",de.displayName="forwardRef(Panel)";let dA=null,dt=-1,dr=null;function dn(e,A,t){var n,a,s;0;let i=function(e,A,t){let r=(A&dg)!=0,n=(A&df)!=0,a=(A&dm)!=0,s=(A&dB)!=0;!1;if(A){if(r)if(a)return"se-resize";else if(s)return"ne-resize";else return"e-resize";else if(n)if(a)return"sw-resize";else if(s)return"nw-resize";else return"w-resize";else if(a)return"s-resize";else if(s)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,A,t);if(dA!==i){if(dA=i,null===dr){dr=document.createElement("style");r&&dr.setAttribute("nonce",r),document.head.appendChild(dr)}dt>=0&&(null==(s=dr.sheet)||s.removeRule(dt)),dt=null!=(n=null==(a=dr.sheet)?void 0:a.insertRule(`*{cursor: ${i} !important;}`))?n:-1}}function da(e){return"keydown"===e.type}function ds(e){return e.type.startsWith("pointer")}function di(e){return e.type.startsWith("mouse")}function dl(e){if(ds(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(di(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let dc=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function du(e){let A=e.length;for(;A--;){let t=e[A];if(dS(t,"Missing node"),function(e){let A=getComputedStyle(e);return!!("fixed"===A.position||"auto"!==A.zIndex&&("static"!==A.position||function(e){var A;let t=getComputedStyle(null!=(A=dh(e))?A:e).display;return"flex"===t||"inline-flex"===t}(e))||1>+A.opacity||"transform"in A&&"none"!==A.transform||"webkitTransform"in A&&"none"!==A.webkitTransform||"mixBlendMode"in A&&"normal"!==A.mixBlendMode||"filter"in A&&"none"!==A.filter||"webkitFilter"in A&&"none"!==A.webkitFilter||"isolation"in A&&"isolate"===A.isolation||dc.test(A.willChange))||"touch"===A.webkitOverflowScrolling}(t))return t}return null}function dd(e){return e&&Number(getComputedStyle(e).zIndex)||0}function dp(e){let A=[];for(;e;)A.push(e),e=dh(e);return A}function dh(e){let{parentNode:A}=e;return A&&A instanceof ShadowRoot?A.host:A}let dg=1,df=2,dm=4,dB=8,dw="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),dv=[],dx=!1,dy=new Map,db=new Map,dC=new Set;function dQ(e){let{target:A}=e,{x:t,y:r}=dl(e);dx=!0,dk({target:A,x:t,y:r}),dI(),dv.length>0&&(dH("down",e),dj(),e.preventDefault(),dE(A)||e.stopImmediatePropagation())}function dF(e){let{x:A,y:t}=dl(e);if(dx&&"pointerleave"!==e.type&&0===e.buttons&&(dx=!1,dH("up",e)),!dx){let{target:r}=e;dk({target:r,x:A,y:t})}dH("move",e),dj(),dv.length>0&&e.preventDefault()}function dU(e){let{target:A}=e,{x:t,y:r}=dl(e);db.clear(),dx=!1,dv.length>0&&(e.preventDefault(),dE(A)||e.stopImmediatePropagation()),dH("up",e),dk({target:A,x:t,y:r}),dj(),dI()}function dE(e){let A=e;for(;A;){if(A.hasAttribute(u3.resizeHandle))return!0;A=A.parentElement}return!1}function dk({target:e,x:A,y:t}){dv.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),dC.forEach(e=>{let{element:n,hitAreaMargins:a}=e,s=n.getBoundingClientRect(),{bottom:i,left:o,right:l,top:c}=s,u=dw?a.coarse:a.fine;if(A>=o-u&&A<=l+u&&t>=c-u&&t<=i+u){if(null!==r&&document.contains(r)&&n!==r&&!n.contains(r)&&!r.contains(n)&&function(e,A){let t;if(e===A)throw Error("Cannot compare node with itself");let r={a:dp(e),b:dp(A)};for(;r.a.at(-1)===r.b.at(-1);)e=r.a.pop(),A=r.b.pop(),t=e;dS(t,"Stacking order can only be calculated for elements with a common ancestor");let n={a:dd(du(r.a)),b:dd(du(r.b))};if(n.a===n.b){let e=t.childNodes,A={a:r.a.at(-1),b:r.b.at(-1)},n=e.length;for(;n--;){let t=e[n];if(t===A.a)return 1;if(t===A.b)return -1}}return Math.sign(n.a-n.b)}(r,n)>0){let e=r,A=!1;for(;e&&!e.contains(n);){var d,p;if(d=e.getBoundingClientRect(),p=s,d.xp.x&&d.yp.y){A=!0;break}e=e.parentElement}if(A)return}dv.push(e)}})}function dj(){let e=!1,A=!1;dv.forEach(t=>{let{direction:r}=t;"horizontal"===r?e=!0:A=!0});let t=0;db.forEach(e=>{t|=e}),e&&A?dn("intersection",t,dx):e?dn("horizontal",t,dx):A?dn("vertical",t,dx):null!==dr&&(document.head.removeChild(dr),dA=null,dr=null,dt=-1)}function dI(){var e;null==(e=n)||e.abort();let A={capture:!0,signal:(n=new AbortController).signal};dC.size&&(dx?(dv.length>0&&dy.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("contextmenu",dU,A),r.addEventListener("pointerleave",dF,A),r.addEventListener("pointermove",dF,A))}),dy.forEach((e,t)=>{let{body:r}=t;r.addEventListener("pointerup",dU,A),r.addEventListener("pointercancel",dU,A)})):dy.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("pointerdown",dQ,A),r.addEventListener("pointermove",dF,A))}))}function dH(e,A){dC.forEach(t=>{let{setResizeHandlerState:r}=t;r(e,dv.includes(t),A)})}function dS(e,A){if(!e)throw console.error(A),Error(A)}function dN(e,A,t=10){return e.toFixed(t)===A.toFixed(t)?0:e>A?1:-1}function dL(e,A,t=10){return 0===dN(e,A,t)}function dD(e,A,t){return 0===dN(e,A,t)}function dT({panelConstraints:e,panelIndex:A,size:t}){let r=e[A];dS(null!=r,`Panel constraints not found for index ${A}`);let{collapsedSize:n=0,collapsible:a,maxSize:s=100,minSize:i=0}=r;return 0>dN(t,i)&&(t=a&&0>dN(t,(n+i)/2)?n:i),t=parseFloat((t=Math.min(s,t)).toFixed(10))}function dM({delta:e,initialLayout:A,panelConstraints:t,pivotIndices:r,prevLayout:n,trigger:a}){if(dD(e,0))return A;let s=[...A],[i,o]=r;dS(null!=i,"Invalid first pivot index"),dS(null!=o,"Invalid second pivot index");let l=0;if("keyboard"===a){{let r=e<0?o:i,n=t[r];dS(n,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:s,minSize:l=0}=n;if(s){let t=A[r];if(dS(null!=t,`Previous layout not found for panel index ${r}`),dD(t,a)){let A=l-t;dN(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}{let r=e<0?i:o,n=t[r];dS(n,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:s,minSize:l=0}=n;if(s){let t=A[r];if(dS(null!=t,`Previous layout not found for panel index ${r}`),dD(t,l)){let A=t-a;dN(A,Math.abs(e))>0&&(e=e<0?0-A:A)}}}}{let r=e<0?1:-1,n=e<0?o:i,a=0;for(;;){let e=A[n];if(dS(null!=e,`Previous layout not found for panel index ${n}`),a+=dT({panelConstraints:t,panelIndex:n,size:100})-e,(n+=r)<0||n>=t.length)break}let s=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-s:s}{let r=e<0?i:o;for(;r>=0&&r=0))break;e<0?r--:r++}}if(function(e,A,t){if(e.length!==A.length)return!1;for(let t=0;t=0&&r0?r--:r++}}}return dD(s.reduce((e,A)=>A+e,0),100)?s:n}function dK(e,A=document){return Array.from(A.querySelectorAll(`[${u3.resizeHandleId}][data-panel-group-id="${e}"]`))}function dP(e,A,t=document){let r=dK(e,t).findIndex(e=>e.getAttribute(u3.resizeHandleId)===A);return null!=r?r:null}function dR(e,A,t){let r=dP(e,A,t);return null!=r?[r,r+1]:[-1,-1]}function dO(e,A=document){if((A instanceof HTMLElement||"object"==typeof A&&null!==A&&"tagName"in A&&"getAttribute"in A)&&A.dataset.panelGroupId==e)return A;let t=A.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function dV(e,A=document){let t=A.querySelector(`[${u3.resizeHandleId}="${e}"]`);return t||null}function dG(e,A){let{x:t,y:r}=dl(A);return"horizontal"===e?t:r}function dz(e,A,t){A.forEach((A,r)=>{let n=e[r];dS(n,`Panel data not found for index ${r}`);let{callbacks:a,constraints:s,id:i}=n,{collapsedSize:o=0,collapsible:l}=s,c=t[i];if(null==c||A!==c){t[i]=A;let{onCollapse:e,onExpand:r,onResize:n}=a;n&&n(A,c),l&&(e||r)&&(r&&(null==c||dL(c,o))&&!dL(A,o)&&r(),e&&(null==c||!dL(c,o))&&dL(A,o)&&e())}})}function dq(e,A){if(e.length!==A.length)return!1;for(let t=0;tlocalStorage.getItem(e),e.setItem=(e,A)=>{localStorage.setItem(e,A)};else throw Error("localStorage not supported in this environment")}catch(A){console.error(A),e.getItem=()=>null,e.setItem=()=>{}}}function dJ(e){return`react-resizable-panels:${e}`}function dX(e,A,t,r,n){var a;let s=dJ(e),i=A.map(e=>{let{constraints:A,id:t,idIsFromProps:r,order:n}=e;return r?t:n?`${n}:${JSON.stringify(A)}`:JSON.stringify(A)}).sort((e,A)=>e.localeCompare(A)).join(","),o=null!=(a=function(e,A){try{let t=dJ(e),r=A.getItem(t);if(r){let e=JSON.parse(r);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,n))?a:{};o[i]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{n.setItem(s,JSON.stringify(o))}catch(e){console.error(e)}}let d_={getItem:e=>(dW(d_),d_.getItem(e)),setItem:(e,A)=>{dW(d_),d_.setItem(e,A)}},dY={};function d$({autoSaveId:e=null,children:A,className:t="",direction:r,forwardedRef:n,id:a=null,onLayout:s=null,keyboardResizeBy:i=null,storage:o=d_,style:l,tagName:c="div",...u}){let d=u9(a),h=(0,p.useRef)(null),[g,f]=(0,p.useState)(null),[m,B]=(0,p.useState)([]),w=function(){let[e,A]=(0,p.useState)(0);return(0,p.useCallback)(()=>A(e=>e+1),[])}(),v=(0,p.useRef)({}),x=(0,p.useRef)(new Map),y=(0,p.useRef)(0),b=(0,p.useRef)({autoSaveId:e,direction:r,dragState:g,id:d,keyboardResizeBy:i,onLayout:s,storage:o}),C=(0,p.useRef)({layout:m,panelDataArray:[],panelDataArrayChanged:!1});(0,p.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,p.useImperativeHandle)(n,()=>({getId:()=>b.current.id,getLayout:()=>{let{layout:e}=C.current;return e},setLayout:e=>{let{onLayout:A}=b.current,{layout:t,panelDataArray:r}=C.current,n=function({layout:e,panelConstraints:A}){let t=[...e],r=t.reduce((e,A)=>e+A,0);if(t.length!==A.length)throw Error(`Invalid ${A.length} panel layout: ${t.map(e=>`${e}%`).join(", ")}`);if(!dD(r,100)&&t.length>0)for(let e=0;ee.constraints)});!function(e,A){if(e.length!==A.length)return!1;for(let t=0;t{if(!a)return;let e=A.current;dS(e,"Eager values not found");let{panelDataArray:n}=e;dS(null!=dO(t,a),`No group found for id "${t}"`);let i=dK(t,a);dS(i,`No resize handles found for group id "${t}"`);let o=i.map(e=>{let A=e.getAttribute(u3.resizeHandleId);dS(A,"Resize handle element has no handle id attribute");let[i,o]=function(e,A,t,r=document){var n,a,s,i;let o=dV(A,r),l=dK(e,r),c=o?l.indexOf(o):-1;return[null!=(n=null==(a=t[c])?void 0:a.id)?n:null,null!=(s=null==(i=t[c+1])?void 0:i.id)?s:null]}(t,A,n,a);if(null==i||null==o)return()=>{};let l=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let o=n.findIndex(e=>e.id===i);if(o>=0){let e=n[o];dS(e,`No panel data found for index ${o}`);let i=r[o],{collapsedSize:l=0,collapsible:c,minSize:u=0}=e.constraints;if(null!=i&&c){let e=dM({delta:dD(i,l)?u-l:l-i,initialLayout:r,panelConstraints:n.map(e=>e.constraints),pivotIndices:dR(t,A,a),prevLayout:r,trigger:"keyboard"});r!==e&&s(e)}}}};return e.addEventListener("keydown",l),()=>{e.removeEventListener("keydown",l)}});return()=>{o.forEach(e=>e())}},[a,e,A,t,r,n,s])}({committedValuesRef:b,eagerValuesRef:C,groupId:d,layout:m,panelDataArray:C.current.panelDataArray,setLayout:B,panelGroupElement:h.current}),(0,p.useEffect)(()=>{let{panelDataArray:A}=C.current;if(e){if(0===m.length||m.length!==A.length)return;let t=dY[e];null==t&&(t=function(e,A=10){let t=null;return(...r)=>{null!==t&&clearTimeout(t),t=setTimeout(()=>{e(...r)},A)}}(dX,100),dY[e]=t),t(e,[...A],new Map(x.current),m,o)}},[e,m,o]),(0,p.useEffect)(()=>{});let Q=(0,p.useCallback)(e=>{let{onLayout:A}=b.current,{layout:t,panelDataArray:r}=C.current;if(e.constraints.collapsible){let n=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:s,pivotIndices:i}=d1(r,e,t);if(dS(null!=s,`Panel size not found for panel "${e.id}"`),!dL(s,a)){x.current.set(e.id,s);let o=dM({delta:d0(r,e)===r.length-1?s-a:a-s,initialLayout:t,panelConstraints:n,pivotIndices:i,prevLayout:t,trigger:"imperative-api"});dq(t,o)||(B(o),C.current.layout=o,A&&A(o),dz(r,o,v.current))}}},[]),F=(0,p.useCallback)((e,A)=>{let{onLayout:t}=b.current,{layout:r,panelDataArray:n}=C.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:s=0,panelSize:i=0,minSize:o=0,pivotIndices:l}=d1(n,e,r),c=null!=A?A:o;if(dL(i,s)){let A=x.current.get(e.id),s=null!=A&&A>=c?A:c,o=dM({delta:d0(n,e)===n.length-1?i-s:s-i,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:"imperative-api"});dq(r,o)||(B(o),C.current.layout=o,t&&t(o),dz(n,o,v.current))}}},[]),U=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{panelSize:r}=d1(t,e,A);return dS(null!=r,`Panel size not found for panel "${e.id}"`),r},[]),E=(0,p.useCallback)((e,A)=>{let{panelDataArray:t}=C.current,r=d0(t,e);return function({defaultSize:e,dragState:A,layout:t,panelData:r,panelIndex:n,precision:a=3}){let s,i=t[n];return{flexBasis:0,flexGrow:null==i?void 0!=e?e.toFixed(a):"1":1===r.length?"1":i.toFixed(a),flexShrink:1,overflow:"hidden",pointerEvents:null!==A?"none":void 0}}({defaultSize:A,dragState:g,layout:m,panelData:t,panelIndex:r})},[g,m]),k=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{collapsedSize:r=0,collapsible:n,panelSize:a}=d1(t,e,A);return dS(null!=a,`Panel size not found for panel "${e.id}"`),!0===n&&dL(a,r)},[]),j=(0,p.useCallback)(e=>{let{layout:A,panelDataArray:t}=C.current,{collapsedSize:r=0,collapsible:n,panelSize:a}=d1(t,e,A);return dS(null!=a,`Panel size not found for panel "${e.id}"`),!n||dN(a,r)>0},[]),I=(0,p.useCallback)(e=>{let{panelDataArray:A}=C.current;A.push(e),A.sort((e,A)=>{let t=e.order,r=A.order;return null==t&&null==r?0:null==t?-1:null==r?1:t-r}),C.current.panelDataArrayChanged=!0,w()},[w]),H=(0,p.useCallback)(e=>{let A=!1,t=h.current;return t&&"rtl"===window.getComputedStyle(t,null).getPropertyValue("direction")&&(A=!0),function(t){var r,n;t.preventDefault();let a=h.current;if(!a)return()=>null;let{direction:s,dragState:i,id:o,keyboardResizeBy:l,onLayout:c}=b.current,{layout:u,panelDataArray:d}=C.current,{initialLayout:p}=null!=i?i:{},g=dR(o,e,a),f=function(e,A,t,r,n,a){if(da(e)){let A="horizontal"===t,r=0;r=e.shiftKey?100:null!=n?n:10;let a=0;switch(e.key){case"ArrowDown":a=A?0:r;break;case"ArrowLeft":a=A?-r:0;break;case"ArrowRight":a=A?r:0;break;case"ArrowUp":a=A?0:-r;break;case"End":a=100;break;case"Home":a=-100}return a}return null==r?0:function(e,A,t,r,n){let a="horizontal"===t,s=dV(A,n);dS(s,`No resize handle element found for id "${A}"`);let i=s.getAttribute(u3.groupId);dS(i,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=r,l=dG(t,e),c=dO(i,n);dS(c,`No group element found for id "${i}"`);let u=c.getBoundingClientRect();return(l-o)/(a?u.width:u.height)*100}(e,A,t,r,a)}(t,e,s,i,l,a),m="horizontal"===s;m&&A&&(f=-f);let w=dM({delta:f,initialLayout:null!=p?p:u,panelConstraints:d.map(e=>e.constraints),pivotIndices:g,prevLayout:u,trigger:da(t)?"keyboard":"mouse-or-touch"}),x=!dq(u,w);(ds(t)||di(t))&&y.current!=f&&((y.current=f,x||0===f)?db.set(e,0):m?(r=f<0?dg:df,db.set(e,r)):(n=f<0?dm:dB,db.set(e,n))),x&&(B(w),C.current.layout=w,c&&c(w),dz(d,w,v.current))}},[]),S=(0,p.useCallback)((e,A)=>{let{onLayout:t}=b.current,{layout:r,panelDataArray:n}=C.current,a=n.map(e=>e.constraints),{panelSize:s,pivotIndices:i}=d1(n,e,r);dS(null!=s,`Panel size not found for panel "${e.id}"`);let o=dM({delta:d0(n,e)===n.length-1?s-A:A-s,initialLayout:r,panelConstraints:a,pivotIndices:i,prevLayout:r,trigger:"imperative-api"});dq(r,o)||(B(o),C.current.layout=o,t&&t(o),dz(n,o,v.current))},[]),N=(0,p.useCallback)((e,A)=>{let{layout:t,panelDataArray:r}=C.current,{collapsedSize:n=0,collapsible:a}=A,{collapsedSize:s=0,collapsible:i,maxSize:o=100,minSize:l=0}=e.constraints,{panelSize:c}=d1(r,e,t);null!=c&&(a&&i&&dL(c,n)?dL(n,s)||S(e,s):co&&S(e,o))},[S]),L=(0,p.useCallback)((e,A)=>{let{direction:t}=b.current,{layout:r}=C.current;if(!h.current)return;let n=dV(e,h.current);dS(n,`Drag handle element not found for id "${e}"`);let a=dG(t,A);f({dragHandleId:e,dragHandleRect:n.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),D=(0,p.useCallback)(()=>{f(null)},[]),T=(0,p.useCallback)(e=>{let{panelDataArray:A}=C.current,t=d0(A,e);t>=0&&(A.splice(t,1),delete v.current[e.id],C.current.panelDataArrayChanged=!0,w())},[w]),M=(0,p.useMemo)(()=>({collapsePanel:Q,direction:r,dragState:g,expandPanel:F,getPanelSize:U,getPanelStyle:E,groupId:d,isPanelCollapsed:k,isPanelExpanded:j,reevaluatePanelConstraints:N,registerPanel:I,registerResizeHandle:H,resizePanel:S,startDragging:L,stopDragging:D,unregisterPanel:T,panelGroupElement:h.current}),[Q,g,r,F,U,E,d,k,j,N,I,H,S,L,D,T]);return(0,p.createElement)(u4.Provider,{value:M},(0,p.createElement)(c,{...u,children:A,className:t,id:a,ref:h,style:{display:"flex",flexDirection:"horizontal"===r?"row":"column",height:"100%",overflow:"hidden",width:"100%",...l},[u3.group]:"",[u3.groupDirection]:r,[u3.groupId]:d}))}let dZ=(0,p.forwardRef)((e,A)=>(0,p.createElement)(d$,{...e,forwardedRef:A}));function d0(e,A){return e.findIndex(e=>e===A||e.id===A.id)}function d1(e,A,t){let r=d0(e,A),n=r===e.length-1,a=t[r];return{...A.constraints,panelSize:a,pivotIndices:n?[r-1,r]:[r,r+1]}}function d2({children:e=null,className:A="",disabled:t=!1,hitAreaMargins:r,id:n,onBlur:a,onClick:s,onDragging:i,onFocus:o,onPointerDown:l,onPointerUp:c,style:u={},tabIndex:d=0,tagName:h="div",...g}){var f,m;let B=(0,p.useRef)(null),w=(0,p.useRef)({onClick:s,onDragging:i,onPointerDown:l,onPointerUp:c});(0,p.useEffect)(()=>{w.current.onClick=s,w.current.onDragging=i,w.current.onPointerDown=l,w.current.onPointerUp=c});let v=(0,p.useContext)(u4);if(null===v)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:x,groupId:y,registerResizeHandle:b,startDragging:C,stopDragging:Q,panelGroupElement:F}=v,U=u9(n),[E,k]=(0,p.useState)("inactive"),[j,I]=(0,p.useState)(!1),[H,S]=(0,p.useState)(null),N=(0,p.useRef)({state:E});(0,p.useEffect)(()=>{if(t)S(null);else{let e=b(U);S(()=>e)}},[t,U,b]);let L=null!=(f=null==r?void 0:r.coarse)?f:15,D=null!=(m=null==r?void 0:r.fine)?m:5;return(0,p.useEffect)(()=>{if(t||null==H)return;let e=B.current;dS(e,"Element ref not attached");let A=!1;return function(e,A,t,r,n){var a;let{ownerDocument:s}=A,i={direction:t,element:A,hitAreaMargins:r,setResizeHandlerState:n},o=null!=(a=dy.get(s))?a:0;return dy.set(s,o+1),dC.add(i),dI(),function(){var A;db.delete(e),dC.delete(i);let t=null!=(A=dy.get(s))?A:1;if(dy.set(s,t-1),dI(),1===t&&dy.delete(s),dv.includes(i)){let e=dv.indexOf(i);e>=0&&dv.splice(e,1),dj(),n("up",!0,null)}}}(U,e,x,{coarse:L,fine:D},(e,t,r)=>{if(!t)return void k("inactive");switch(e){case"down":{k("drag"),A=!1,dS(r,'Expected event to be defined for "down" action'),C(U,r);let{onDragging:e,onPointerDown:t}=w.current;null==e||e(!0),null==t||t();break}case"move":{let{state:e}=N.current;A=!0,"drag"!==e&&k("hover"),dS(r,'Expected event to be defined for "move" action'),H(r);break}case"up":{k("hover"),Q();let{onClick:e,onDragging:t,onPointerUp:r}=w.current;null==t||t(!1),null==r||r(),A||null==e||e()}}})},[L,x,t,D,b,U,H,C,Q]),!function({disabled:e,handleId:A,resizeHandler:t,panelGroupElement:r}){(0,p.useEffect)(()=>{if(e||null==t||null==r)return;let n=dV(A,r);if(null==n)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),t(e);break;case"F6":{e.preventDefault();let t=n.getAttribute(u3.groupId);dS(t,`No group element found for id "${t}"`);let a=dK(t,r),s=dP(t,A,r);dS(null!==s,`No resize element found for id "${A}"`);let i=e.shiftKey?s>0?s-1:a.length-1:s+1{n.removeEventListener("keydown",a)}},[r,e,A,t])}({disabled:t,handleId:U,resizeHandler:H,panelGroupElement:F}),(0,p.createElement)(h,{...g,children:e,className:A,id:n,onBlur:()=>{I(!1),null==a||a()},onFocus:()=>{I(!0),null==o||o()},ref:B,role:"separator",style:{touchAction:"none",userSelect:"none",...u},tabIndex:d,[u3.groupDirection]:x,[u3.groupId]:y,[u3.resizeHandle]:"",[u3.resizeHandleActive]:"drag"===E?"pointer":j?"keyboard":void 0,[u3.resizeHandleEnabled]:!t,[u3.resizeHandleId]:U,[u3.resizeHandleState]:E})}d$.displayName="PanelGroup",dZ.displayName="forwardRef(PanelGroup)",d2.displayName="PanelResizeHandle";let d4=({className:e,...A})=>(0,d.jsx)(dZ,{className:(0,y.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...A}),d3=({withHandle:e,className:A,...t})=>(0,d.jsx)(d2,{className:(0,y.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",A),...t,children:e&&(0,d.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,d.jsx)(u2,{className:"h-3 w-3 text-muted-foreground/50"})})});var d5=t(3589);function d6({events:e,onClear:A,onClose:t}){let[r,n]=(0,p.useState)(""),[a,s]=(0,p.useState)(!0),i=(0,p.useRef)(null),[o,l]=(0,p.useState)(!0),c=(0,p.useMemo)(()=>{let A=[],t=null;for(let r of e)"assistant_delta"===r.event||"tool_param_delta"===r.event?t&&t.event===r.event?(t.count=(t.count||1)+1,t.data.all||(t.data={all:[t.data]}),t.data.all.push(r.data)):(t&&A.push(t),t={...r,count:1}):(t&&(A.push(t),t=null),A.push(r));return t&&A.push(t),A},[e]),u=r?c.filter(e=>e.event.toLowerCase().includes(r.toLowerCase())):c,h=e.reduce((e,A)=>(e[A.event]=(e[A.event]||0)+1,e),{});return(0,d.jsxs)("div",{className:"h-full flex flex-col bg-card border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-border bg-muted/30 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(uY,{className:"h-4 w-4 md:hidden"}),t?(0,d.jsxs)("button",{type:"button",onClick:t,"aria-label":"Hide debug panel",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,d.jsx)(uY,{className:"h-4 w-4 transition-opacity group-hover:opacity-0"}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(uY,{className:"hidden h-4 w-4 md:inline-flex"}),(0,d.jsx)("span",{className:"font-semibold text-sm",children:"Debug Events"}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",u.length,"/",e.length,")"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:()=>{A?.()},className:"h-7 px-2 hover:bg-muted",title:"Clear all events",children:(0,d.jsx)(G,{className:"h-3 w-3"})}),(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:()=>{let A=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),t=URL.createObjectURL(A),r=document.createElement("a");r.href=t,r.download=`debug-events-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},className:"h-7 px-2 text-xs hover:bg-muted",title:"Export to JSON",children:"Export"})]})]}),(0,d.jsx)("div",{className:"p-2 border-b border-border bg-muted/20 text-xs",children:(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(h).map(([e,A])=>(0,d.jsxs)("button",{onClick:()=>n(r===e?"":e),className:`px-2 py-1 rounded ${r===e?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:[e," (",A,")"]},e))})}),(0,d.jsx)("div",{className:"p-2 border-b border-border",children:(0,d.jsx)("input",{type:"text",placeholder:"Filter events...",value:r,onChange:e=>n(e.target.value),className:"w-full px-2 py-1 text-xs rounded bg-background border border-border"})}),(0,d.jsx)("div",{className:"p-2 border-b border-border flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-xs flex items-center gap-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:o,onChange:e=>l(e.target.checked),className:"rounded"}),"Auto-scroll"]})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[0===u.length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center p-4",children:"No events yet. Events will appear here as they occur."}):u.map(e=>(0,d.jsx)(d8,{event:e},e.id)),(0,d.jsx)("div",{ref:i})]})]})}function d8({event:e}){var A;let[t,r]=(0,p.useState)(!1),n=new Date(e.timestamp).toLocaleTimeString();return(0,d.jsxs)(l0,{open:t,onOpenChange:r,children:[(0,d.jsx)(l1,{className:"w-full text-left",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 p-1.5 rounded hover:bg-muted/50 text-xs",children:[t?(0,d.jsx)(d5.A,{className:"h-3 w-3"}):(0,d.jsx)(lD.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-muted-foreground font-mono",children:n}),(0,d.jsx)("span",{className:`font-semibold ${(A=e.event).includes("error")||A.includes("failed")?"text-red-500":A.includes("retry")?"text-yellow-500":A.includes("completed")||A.includes("success")?"text-green-500":A.includes("tool")?"text-blue-500":A.includes("agent")?"text-purple-500":A.includes("plan")?"text-orange-500":"text-foreground"}`,children:e.event}),e.count&&e.count>1&&(0,d.jsxs)("span",{className:"text-muted-foreground font-mono",children:["(",e.count,")"]})]})}),(0,d.jsx)(l2,{children:(0,d.jsx)("div",{className:"ml-6 p-2 bg-muted/30 rounded text-xs font-mono overflow-x-auto",children:(0,d.jsx)("pre",{children:JSON.stringify(e.data,null,2)})})})]})}var d9=t(5336),d7=t(5071);let pe=(0,E.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"}]]),pA=(0,E.A)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),pt=(0,E.A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),pr=(0,E.A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),pn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pa=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ps={};function pi(e,A){return((A||ps).jsx?pa:pn).test(e)}let po=/[ \t\n\f\r]/g;function pl(e){return""===e.replace(po,"")}class pc{constructor(e,A,t){this.normal=A,this.property=e,t&&(this.space=t)}}function pu(e,A){let t={},r={};for(let A of e)Object.assign(t,A.property),Object.assign(r,A.normal);return new pc(t,r,A)}function pd(e){return e.toLowerCase()}pc.prototype.normal={},pc.prototype.property={},pc.prototype.space=void 0;class pp{constructor(e,A){this.attribute=A,this.property=e}}pp.prototype.attribute="",pp.prototype.booleanish=!1,pp.prototype.boolean=!1,pp.prototype.commaOrSpaceSeparated=!1,pp.prototype.commaSeparated=!1,pp.prototype.defined=!1,pp.prototype.mustUseProperty=!1,pp.prototype.number=!1,pp.prototype.overloadedBoolean=!1,pp.prototype.property="",pp.prototype.spaceSeparated=!1,pp.prototype.space=void 0;let ph=0,pg=py(),pf=py(),pm=py(),pB=py(),pw=py(),pv=py(),px=py();function py(){return 2**++ph}let pb=Object.keys(c);class pC extends pp{constructor(e,A,t,r){let n=-1;if(super(e,A),function(e,A,t){t&&(e[A]=t)}(this,"space",r),"number"==typeof t)for(;++n"role"===A?A:"aria-"+A.slice(4).toLowerCase()});function pU(e,A){return A in e?e[A]:A}function pE(e,A){return pU(e,A.toLowerCase())}let pk=pQ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pv,acceptCharset:pw,accessKey:pw,action:null,allow:null,allowFullScreen:pg,allowPaymentRequest:pg,allowUserMedia:pg,alt:null,as:null,async:pg,autoCapitalize:null,autoComplete:pw,autoFocus:pg,autoPlay:pg,blocking:pw,capture:null,charSet:null,checked:pg,cite:null,className:pw,cols:pB,colSpan:null,content:null,contentEditable:pf,controls:pg,controlsList:pw,coords:pB|pv,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pg,defer:pg,dir:null,dirName:null,disabled:pg,download:pm,draggable:pf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pg,formTarget:null,headers:pw,height:pB,hidden:pm,high:pB,href:null,hrefLang:null,htmlFor:pw,httpEquiv:pw,id:null,imageSizes:null,imageSrcSet:null,inert:pg,inputMode:null,integrity:null,is:null,isMap:pg,itemId:null,itemProp:pw,itemRef:pw,itemScope:pg,itemType:pw,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pg,low:pB,manifest:null,max:null,maxLength:pB,media:null,method:null,min:null,minLength:pB,multiple:pg,muted:pg,name:null,nonce:null,noModule:pg,noValidate:pg,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:pg,optimum:pB,pattern:null,ping:pw,placeholder:null,playsInline:pg,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pg,referrerPolicy:null,rel:pw,required:pg,reversed:pg,rows:pB,rowSpan:pB,sandbox:pw,scope:null,scoped:pg,seamless:pg,selected:pg,shadowRootClonable:pg,shadowRootDelegatesFocus:pg,shadowRootMode:null,shape:null,size:pB,sizes:null,slot:null,span:pB,spellCheck:pf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pB,step:null,style:null,tabIndex:pB,target:null,title:null,translate:null,type:null,typeMustMatch:pg,useMap:null,value:pf,width:pB,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pw,axis:null,background:null,bgColor:null,border:pB,borderColor:null,bottomMargin:pB,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pg,declare:pg,event:null,face:null,frame:null,frameBorder:null,hSpace:pB,leftMargin:pB,link:null,longDesc:null,lowSrc:null,marginHeight:pB,marginWidth:pB,noResize:pg,noHref:pg,noShade:pg,noWrap:pg,object:null,profile:null,prompt:null,rev:null,rightMargin:pB,rules:null,scheme:null,scrolling:pf,standby:null,summary:null,text:null,topMargin:pB,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pB,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:pg,disableRemotePlayback:pg,prefix:null,property:null,results:pB,security:null,unselectable:null},space:"html",transform:pE}),pj=pQ({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:px,accentHeight:pB,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pB,amplitude:pB,arabicForm:null,ascent:pB,attributeName:null,attributeType:null,azimuth:pB,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pB,by:null,calcMode:null,capHeight:pB,className:pw,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:pB,diffuseConstant:pB,direction:null,display:null,dur:null,divisor:pB,dominantBaseline:null,download:pg,dx:null,dy:null,edgeMode:null,editable:null,elevation:pB,enableBackground:null,end:null,event:null,exponent:pB,externalResourcesRequired:null,fill:null,fillOpacity:pB,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:pv,g2:pv,glyphName:pv,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pB,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pB,horizOriginX:pB,horizOriginY:pB,id:null,ideographic:pB,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pB,k:pB,k1:pB,k2:pB,k3:pB,k4:pB,kernelMatrix:px,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pB,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:pB,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:pB,overlineThickness:pB,paintOrder:null,panose1:null,path:null,pathLength:pB,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pw,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pB,pointsAtY:pB,pointsAtZ:pB,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:px,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:px,rev:px,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:px,requiredFeatures:px,requiredFonts:px,requiredFormats:px,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:pB,specularExponent:pB,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pB,strikethroughThickness:pB,string:null,stroke:null,strokeDashArray:px,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pB,strokeOpacity:pB,strokeWidth:null,style:null,surfaceScale:pB,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:px,tabIndex:pB,tableValues:null,target:null,targetX:pB,targetY:pB,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:px,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pB,underlineThickness:pB,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pB,values:null,vAlphabetic:pB,vMathematical:pB,vectorEffect:null,vHanging:pB,vIdeographic:pB,version:null,vertAdvY:pB,vertOriginX:pB,vertOriginY:pB,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pB,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pU}),pI=pQ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,A)=>"xlink:"+A.slice(5).toLowerCase()}),pH=pQ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pE}),pS=pQ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,A)=>"xml:"+A.slice(3).toLowerCase()}),pN=pu([pF,pk,pI,pH,pS],"html"),pL=pu([pF,pj,pI,pH,pS],"svg"),pD=/[A-Z]/g,pT=/-[a-z]/g,pM=/^data[-\w.:]+$/i;function pK(e){return"-"+e.toLowerCase()}function pP(e){return e.charAt(1).toUpperCase()}let pR={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 pO=t(8739);let pV=pz("end"),pG=pz("start");function pz(e){return function(A){let t=A&&A.position&&A.position[e]||{};if("number"==typeof t.line&&t.line>0&&"number"==typeof t.column&&t.column>0)return{line:t.line,column:t.column,offset:"number"==typeof t.offset&&t.offset>-1?t.offset:void 0}}}function pq(e){return e&&"object"==typeof e?"position"in e||"type"in e?pJ(e.position):"start"in e||"end"in e?pJ(e):"line"in e||"column"in e?pW(e):"":""}function pW(e){return pX(e&&e.line)+":"+pX(e&&e.column)}function pJ(e){return pW(e&&e.start)+"-"+pW(e&&e.end)}function pX(e){return e&&"number"==typeof e?e:1}class p_ extends Error{constructor(e,A,t){super(),"string"==typeof A&&(t=A,A=void 0);let r="",n={},a=!1;if(A&&(n="line"in A&&"column"in A||"start"in A&&"end"in A?{place:A}:"type"in A?{ancestors:[A],place:A.position}:{...A}),"string"==typeof e?r=e:!n.cause&&e&&(a=!0,r=e.message,n.cause=e),!n.ruleId&&!n.source&&"string"==typeof t){let e=t.indexOf(":");-1===e?n.ruleId=t:(n.source=t.slice(0,e),n.ruleId=t.slice(e+1))}if(!n.place&&n.ancestors&&n.ancestors){let e=n.ancestors[n.ancestors.length-1];e&&(n.place=e.position)}let s=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=pq(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=a&&n.cause&&"string"==typeof n.cause.stack?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}p_.prototype.file="",p_.prototype.name="",p_.prototype.reason="",p_.prototype.message="",p_.prototype.stack="",p_.prototype.column=void 0,p_.prototype.line=void 0,p_.prototype.ancestors=void 0,p_.prototype.cause=void 0,p_.prototype.fatal=void 0,p_.prototype.place=void 0,p_.prototype.ruleId=void 0,p_.prototype.source=void 0;let pY={}.hasOwnProperty,p$=new Map,pZ=/[A-Z]/g,p0=new Set(["table","tbody","thead","tfoot","tr"]),p1=new Set(["td","th"]),p2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p4(e,A,t){var r;return"element"===A.type?function(e,A,t){let r=e.schema,n=r;"svg"===A.tagName.toLowerCase()&&"html"===r.space&&(e.schema=pL),e.ancestors.push(A);let a=p8(e,A.tagName,!1),s=function(e,A){let t,r,n={};for(r in A.properties)if("children"!==r&&pY.call(A.properties,r)){let a=function(e,A,t){let r=function(e,A){let t=pd(A),r=A,n=pp;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&pM.test(A)){if("-"===A.charAt(4)){let e=A.slice(5).replace(pT,pP);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=A.slice(4);if(!pT.test(e)){let t=e.replace(pD,pK);"-"!==t.charAt(0)&&(t="-"+t),A="data"+t}}n=pC}return new n(r,A)}(e.schema,A);if(!(null==t||"number"==typeof t&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?function(e,A){let t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(t):t.join(" ").trim()),"style"===r.property){let A="object"==typeof t?t:function(e,A){try{return pO(A,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let A=new p_("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw A.file=e.filePath||void 0,A.url=p2+"#cannot-parse-style-attribute",A}}(e,String(t));return"css"===e.stylePropertyNameCase&&(A=function(e){let A,t={};for(A in e)pY.call(e,A)&&(t[function(e){let A=e.replace(pZ,p7);return"ms-"===A.slice(0,3)&&(A="-"+A),A}(A)]=e[A]);return t}(A)),["style",A]}return["react"===e.elementAttributeNameCase&&r.space?pR[r.property]||r.property:r.attribute,t]}}(e,r,A.properties[r]);if(a){let[r,s]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&p1.has(A.tagName)?t=s:n[r]=s}}return t&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=t),n}(e,A),i=p6(e,A);return p0.has(A.tagName)&&(i=i.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&pl(e.value):pl(e))})),p3(e,s,a,A),p5(s,i),e.ancestors.pop(),e.schema=r,e.create(A,a,s,t)}(e,A,t):"mdxFlowExpression"===A.type||"mdxTextExpression"===A.type?function(e,A){if(A.data&&A.data.estree&&e.evaluater){let t=A.data.estree.body[0];return t.type,e.evaluater.evaluateExpression(t.expression)}p9(e,A.position)}(e,A):"mdxJsxFlowElement"===A.type||"mdxJsxTextElement"===A.type?function(e,A,t){let r=e.schema,n=r;"svg"===A.name&&"html"===r.space&&(e.schema=pL),e.ancestors.push(A);let a=null===A.name?e.Fragment:p8(e,A.name,!0),s=function(e,A){let t={};for(let r of A.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let A=r.data.estree.body[0];A.type;let n=A.expression;n.type;let a=n.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else p9(e,A.position);else{let n,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let A=r.value.data.estree.body[0];A.type,n=e.evaluater.evaluateExpression(A.expression)}else p9(e,A.position);else n=null===r.value||r.value;t[a]=n}return t}(e,A),i=p6(e,A);return p3(e,s,a,A),p5(s,i),e.ancestors.pop(),e.schema=r,e.create(A,a,s,t)}(e,A,t):"mdxjsEsm"===A.type?function(e,A){if(A.data&&A.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(A.data.estree);p9(e,A.position)}(e,A):"root"===A.type?function(e,A,t){let r={};return p5(r,p6(e,A)),e.create(A,e.Fragment,r,t)}(e,A,t):"text"===A.type?(r=0,A.value):void 0}function p3(e,A,t,r){"string"!=typeof t&&t!==e.Fragment&&e.passNode&&(A.node=r)}function p5(e,A){if(A.length>0){let t=A.length>1?A:A[0];t&&(e.children=t)}}function p6(e,A){let t=[],r=-1,n=e.passKeys?new Map:p$;for(;++ra?0:a+A:A>a?a:A,t=t>0?t:0,r.length<1e4)(n=Array.from(r)).unshift(A,t),e.splice(...n);else for(t&&e.splice(A,t);s0?(hn(e,e.length,0,A),e):A}class hs{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-t+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-t+this.left.length).reverse())}splice(e,A,t){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(A||0),Number.POSITIVE_INFINITY);return t&&hi(this.left,t),r.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),hi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hi(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(A))}}function hb(e,A,t,r){let n=r?r-1:Number.POSITIVE_INFINITY,a=0;return function(r){return hw(r)?(e.enter(t),function r(s){return hw(s)&&a++r))return;let i=n.events.length,o=i;for(;o--;)if("exit"===n.events[o][0]&&"chunkFlow"===n.events[o][1].type){if(e){t=n.events[o][1].end;break}e=!0}for(f(s),a=i;aA;){let A=a[t];n.containerState=A[1],A[0].exit.call(n,e)}a.length=A}function m(){A.write([null]),t=void 0,A=void 0,n.containerState._closeFlow=void 0}}},hF={tokenize:function(e,A,t){return hb(e,e.attempt(this.parser.constructs.document,A,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},hU={partial:!0,tokenize:function(e,A,t){return function(A){return hw(A)?hb(e,r,"linePrefix")(A):r(A)};function r(e){return null===e||hm(e)?A(e):t(e)}}},hE={resolve:function(e){return ho(e),e},tokenize:function(e,A){let t;return function(A){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),r(A)};function r(A){return null===A?n(A):hm(A)?e.check(hk,a,n)(A):(e.consume(A),r)}function n(t){return e.exit("chunkContent"),e.exit("content"),A(t)}function a(A){return e.consume(A),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}},hk={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),hb(e,n,"linePrefix")};function n(n){if(null===n||hm(n))return t(n);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?A(n):e.interrupt(r.parser.constructs.flow,t,A)(n)}}},hj={tokenize:function(e){let A=this,t=e.attempt(hU,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),A.currentConstruct=void 0,t)},e.attempt(this.parser.constructs.flowInitial,r,hb(e,e.attempt(this.parser.constructs.flow,r,e.attempt(hE,r)),"linePrefix")));return t;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),A.currentConstruct=void 0,t)}}},hI={resolveAll:hL()},hH=hN("string"),hS=hN("text");function hN(e){return{resolveAll:hL("text"===e?hD:void 0),tokenize:function(A){let t=this,r=this.parser.constructs[e],n=A.attempt(r,a,s);return a;function a(e){return o(e)?n(e):s(e)}function s(e){return null===e?void A.consume(e):(A.enter("data"),A.consume(e),i)}function i(e){return o(e)?(A.exit("data"),n(e)):(A.consume(e),i)}function o(e){if(null===e)return!0;let A=r[e],n=-1;if(A)for(;++n=3&&(null===s||hm(s))?(e.exit("thematicBreak"),A(s)):t(s)}(s)}}},hM={continuation:{tokenize:function(e,A,t){let r=this;return r.containerState._closeFlow=void 0,e.check(hU,function(t){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hb(e,A,"listItemIndent",r.containerState.size+1)(t)},function(t){return r.containerState.furtherBlankLines||!hw(t)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n(t)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hP,A,n)(t))});function n(n){return r.containerState._closeFlow=!0,r.interrupt=void 0,hb(e,e.attempt(hM,A,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,A,t){let r=this,n=r.events[r.events.length-1],a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,s=0;return function(A){let n=r.containerState.type||(42===A||43===A||45===A?"listUnordered":"listOrdered");if("listUnordered"===n?!r.containerState.marker||A===r.containerState.marker:hh(A)){if(r.containerState.type||(r.containerState.type=n,e.enter(n,{_container:!0})),"listUnordered"===n)return e.enter("listItemPrefix"),42===A||45===A?e.check(hT,t,i)(A):i(A);if(!r.interrupt||49===A)return e.enter("listItemPrefix"),e.enter("listItemValue"),function A(n){return hh(n)&&++s<10?(e.consume(n),A):(!r.interrupt||s<2)&&(r.containerState.marker?n===r.containerState.marker:41===n||46===n)?(e.exit("listItemValue"),i(n)):t(n)}(A)}return t(A)};function i(A){return e.enter("listItemMarker"),e.consume(A),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||A,e.check(hU,r.interrupt?t:o,e.attempt(hK,c,l))}function o(e){return r.containerState.initialBlankLine=!0,a++,c(e)}function l(A){return hw(A)?(e.enter("listItemPrefixWhitespace"),e.consume(A),e.exit("listItemPrefixWhitespace"),c):t(A)}function c(t){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,A(t)}}},hK={partial:!0,tokenize:function(e,A,t){let r=this;return hb(e,function(e){let n=r.events[r.events.length-1];return!hw(e)&&n&&"listItemPrefixWhitespace"===n[1].type?A(e):t(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},hP={partial:!0,tokenize:function(e,A,t){let r=this;return hb(e,function(e){let n=r.events[r.events.length-1];return n&&"listItemIndent"===n[1].type&&n[2].sliceSerialize(n[1],!0).length===r.containerState.size?A(e):t(e)},"listItemIndent",r.containerState.size+1)}},hR={continuation:{tokenize:function(e,A,t){let r=this;return function(A){return hw(A)?hb(e,n,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):n(A)};function n(r){return e.attempt(hR,A,t)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,A,t){let r=this;return function(A){if(62===A){let t=r.containerState;return t.open||(e.enter("blockQuote",{_container:!0}),t.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(A),e.exit("blockQuoteMarker"),n}return t(A)};function n(t){return hw(t)?(e.enter("blockQuotePrefixWhitespace"),e.consume(t),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),A):(e.exit("blockQuotePrefix"),A(t))}}};function hO(e,A,t,r,n,a,s,i,o){let l=o||Number.POSITIVE_INFINITY,c=0;return function(A){return 60===A?(e.enter(r),e.enter(n),e.enter(a),e.consume(A),e.exit(a),u):null===A||32===A||41===A||hp(A)?t(A):(e.enter(r),e.enter(s),e.enter(i),e.enter("chunkString",{contentType:"string"}),h(A))};function u(t){return 62===t?(e.enter(a),e.consume(t),e.exit(a),e.exit(n),e.exit(r),A):(e.enter(i),e.enter("chunkString",{contentType:"string"}),d(t))}function d(A){return 62===A?(e.exit("chunkString"),e.exit(i),u(A)):null===A||60===A||hm(A)?t(A):(e.consume(A),92===A?p:d)}function p(A){return 60===A||62===A||92===A?(e.consume(A),d):d(A)}function h(n){return!c&&(null===n||41===n||hB(n))?(e.exit("chunkString"),e.exit(i),e.exit(s),e.exit(r),A(n)):c999||null===u||91===u||93===u&&!s||94===u&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs?t(u):93===u?(e.exit(a),e.enter(n),e.consume(u),e.exit(n),e.exit(r),A):hm(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(A){return null===A||91===A||93===A||hm(A)||o++>999?(e.exit("chunkString"),l(A)):(e.consume(A),s||(s=!hw(A)),92===A?u:c)}function u(A){return 91===A||92===A||93===A?(e.consume(A),o++,c):c(A)}}function hG(e,A,t,r,n,a){let s;return function(A){return 34===A||39===A||40===A?(e.enter(r),e.enter(n),e.consume(A),e.exit(n),s=40===A?41:A,i):t(A)};function i(t){return t===s?(e.enter(n),e.consume(t),e.exit(n),e.exit(r),A):(e.enter(a),o(t))}function o(A){return A===s?(e.exit(a),i(s)):null===A?t(A):hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),hb(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(A))}function l(A){return A===s||null===A||hm(A)?(e.exit("chunkString"),o(A)):(e.consume(A),92===A?c:l)}function c(A){return A===s||92===A?(e.consume(A),l):l(A)}}function hz(e,A){let t;return function r(n){return hm(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t=!0,r):hw(n)?hb(e,r,t?"linePrefix":"lineSuffix")(n):A(n)}}function hq(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let hW={partial:!0,tokenize:function(e,A,t){return function(A){return hB(A)?hz(e,r)(A):t(A)};function r(A){return hG(e,n,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(A)}function n(A){return hw(A)?hb(e,a,"whitespace")(A):a(A)}function a(e){return null===e||hm(e)?A(e):t(e)}}},hJ={name:"codeIndented",tokenize:function(e,A,t){let r=this;return function(A){return e.enter("codeIndented"),hb(e,n,"linePrefix",5)(A)};function n(A){let n=r.events[r.events.length-1];return n&&"linePrefix"===n[1].type&&n[2].sliceSerialize(n[1],!0).length>=4?function A(t){return null===t?a(t):hm(t)?e.attempt(hX,A,a)(t):(e.enter("codeFlowValue"),function t(r){return null===r||hm(r)?(e.exit("codeFlowValue"),A(r)):(e.consume(r),t)}(t))}(A):t(A)}function a(t){return e.exit("codeIndented"),A(t)}}},hX={partial:!0,tokenize:function(e,A,t){let r=this;return n;function n(A){return r.parser.lazy[r.now().line]?t(A):hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n):hb(e,a,"linePrefix",5)(A)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?A(e):hm(e)?n(e):t(e)}}},h_={name:"setextUnderline",resolveTo:function(e,A){let t,r,n,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){t=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),n||"definition"!==e[a][1].type||(n=a);let s={type:"setextHeading",start:{...e[t][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",n?(e.splice(r,0,["enter",s,A]),e.splice(n+1,0,["exit",e[t][1],A]),e[t][1].end={...e[n][1].end}):e[t][1]=s,e.push(["exit",s,A]),e},tokenize:function(e,A,t){let r,n=this;return function(A){var s;let i,o=n.events.length;for(;o--;)if("lineEnding"!==n.events[o][1].type&&"linePrefix"!==n.events[o][1].type&&"content"!==n.events[o][1].type){i="paragraph"===n.events[o][1].type;break}return!n.parser.lazy[n.now().line]&&(n.interrupt||i)?(e.enter("setextHeadingLine"),r=A,s=A,e.enter("setextHeadingLineSequence"),function A(t){return t===r?(e.consume(t),A):(e.exit("setextHeadingLineSequence"),hw(t)?hb(e,a,"lineSuffix")(t):a(t))}(s)):t(A)};function a(r){return null===r||hm(r)?(e.exit("setextHeadingLine"),A(r)):t(r)}}},hY=["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"],h$=["pre","script","style","textarea"],hZ={partial:!0,tokenize:function(e,A,t){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(hU,A,t)}}},h0={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return hm(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n):t(A)};function n(e){return r.parser.lazy[r.now().line]?t(e):A(e)}}},h1={partial:!0,tokenize:function(e,A,t){let r=this;return function(A){return null===A?t(A):(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),n)};function n(e){return r.parser.lazy[r.now().line]?t(e):A(e)}}},h2={concrete:!0,name:"codeFenced",tokenize:function(e,A,t){let r,n=this,a={partial:!0,tokenize:function(e,A,t){let a=0;return function(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),s};function s(A){return e.enter("codeFencedFence"),hw(A)?hb(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):o(A)}function o(A){return A===r?(e.enter("codeFencedFenceSequence"),function A(n){return n===r?(a++,e.consume(n),A):a>=i?(e.exit("codeFencedFenceSequence"),hw(n)?hb(e,l,"whitespace")(n):l(n)):t(n)}(A)):t(A)}function l(r){return null===r||hm(r)?(e.exit("codeFencedFence"),A(r)):t(r)}}},s=0,i=0;return function(A){var a=A;let l=n.events[n.events.length-1];return s=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function A(n){return n===r?(i++,e.consume(n),A):i<3?t(n):(e.exit("codeFencedFenceSequence"),hw(n)?hb(e,o,"whitespace")(n):o(n))}(a)};function o(a){return null===a||hm(a)?(e.exit("codeFencedFence"),n.interrupt?A(a):e.check(h1,c,h)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function A(n){return null===n||hm(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),o(n)):hw(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),hb(e,l,"whitespace")(n)):96===n&&n===r?t(n):(e.consume(n),A)}(a))}function l(A){return null===A||hm(A)?o(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function A(n){return null===n||hm(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),o(n)):96===n&&n===r?t(n):(e.consume(n),A)}(A))}function c(A){return e.attempt(a,h,u)(A)}function u(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d}function d(A){return s>0&&hw(A)?hb(e,p,"linePrefix",s+1)(A):p(A)}function p(A){return null===A||hm(A)?e.check(h1,c,h)(A):(e.enter("codeFlowValue"),function A(t){return null===t||hm(t)?(e.exit("codeFlowValue"),p(t)):(e.consume(t),A)}(A))}function h(t){return e.exit("codeFenced"),A(t)}}},h4={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:"‌"},h3={}.hasOwnProperty;function h5(e){return!!h3.call(h4,e)&&h4[e]}let h6={name:"characterReference",tokenize:function(e,A,t){let r,n,a=this,s=0;return function(A){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(A),e.exit("characterReferenceMarker"),i};function i(A){return 35===A?(e.enter("characterReferenceMarkerNumeric"),e.consume(A),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),r=31,n=hu,l(A))}function o(A){return 88===A||120===A?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(A),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,n=hg,l):(e.enter("characterReferenceValue"),r=7,n=hh,l(A))}function l(i){if(59===i&&s){let r=e.exit("characterReferenceValue");return n!==hu||h5(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),e.exit("characterReference"),A):t(i)}return n(i)&&s++1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let u={...e[t][1].end},d={...e[c][1].start};gi(u,-i),gi(d,i),a={type:i>1?"strongSequence":"emphasisSequence",start:u,end:{...e[t][1].end}},s={type:i>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},n={type:i>1?"strongText":"emphasisText",start:{...e[t][1].end},end:{...e[c][1].start}},r={type:i>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[t][1].end={...a.start},e[c][1].start={...s.end},o=[],e[t][1].end.offset-e[t][1].start.offset&&(o=ha(o,[["enter",e[t][1],A],["exit",e[t][1],A]])),o=ha(o,[["enter",r,A],["enter",a,A],["exit",a,A],["enter",n,A]]),o=ha(o,h7(A.parser.constructs.insideSpan.null,e.slice(t+1,c),A)),o=ha(o,[["exit",n,A],["enter",s,A],["exit",s,A],["exit",r,A]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,o=ha(o,[["enter",e[c][1],A],["exit",e[c][1],A]])):l=0,hn(e,t-1,c-t+3,o),c=t+o.length-l-2;break}}for(c=-1;++ca&&"whitespace"===e[n][1].type&&(n-=2),"atxHeadingSequence"===e[n][1].type&&(a===n-1||n-4>a&&"whitespace"===e[n-2][1].type)&&(n-=a+1===n?2:4),n>a&&(t={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},r={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},hn(e,a,n-a+1,[["enter",t,A],["enter",r,A],["exit",r,A],["exit",t,A]])),e},tokenize:function(e,A,t){let r=0;return function(n){var a;return e.enter("atxHeading"),a=n,e.enter("atxHeadingSequence"),function n(a){return 35===a&&r++<6?(e.consume(a),n):null===a||hB(a)?(e.exit("atxHeadingSequence"),function t(r){return 35===r?(e.enter("atxHeadingSequence"),function A(r){return 35===r?(e.consume(r),A):(e.exit("atxHeadingSequence"),t(r))}(r)):null===r||hm(r)?(e.exit("atxHeading"),A(r)):hw(r)?hb(e,t,"whitespace")(r):(e.enter("atxHeadingText"),function A(r){return null===r||35===r||hB(r)?(e.exit("atxHeadingText"),t(r)):(e.consume(r),A)}(r))}(a)):t(a)}(a)}}},42:hT,45:[h_,hT],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let A=e.length;for(;A--&&("enter"!==e[A][0]||"htmlFlow"!==e[A][1].type););return A>1&&"linePrefix"===e[A-2][1].type&&(e[A][1].start=e[A-2][1].start,e[A+1][1].start=e[A-2][1].start,e.splice(A-2,2)),e},tokenize:function(e,A,t){let r,n,a,s,i,o=this;return function(A){var t;return t=A,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l};function l(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),n=!0,p):63===s?(e.consume(s),r=3,o.interrupt?A:H):hc(s)?(e.consume(s),a=String.fromCharCode(s),h):t(s)}function c(n){return 45===n?(e.consume(n),r=2,u):91===n?(e.consume(n),r=5,s=0,d):hc(n)?(e.consume(n),r=4,o.interrupt?A:H):t(n)}function u(r){return 45===r?(e.consume(r),o.interrupt?A:H):t(r)}function d(r){let n="CDATA[";return r===n.charCodeAt(s++)?(e.consume(r),s===n.length)?o.interrupt?A:C:d:t(r)}function p(A){return hc(A)?(e.consume(A),a=String.fromCharCode(A),h):t(A)}function h(s){if(null===s||47===s||62===s||hB(s)){let i=47===s,l=a.toLowerCase();return!i&&!n&&h$.includes(l)?(r=1,o.interrupt?A(s):C(s)):hY.includes(a.toLowerCase())?(r=6,i)?(e.consume(s),g):o.interrupt?A(s):C(s):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?t(s):n?function A(t){return hw(t)?(e.consume(t),A):y(t)}(s):f(s))}return 45===s||hu(s)?(e.consume(s),a+=String.fromCharCode(s),h):t(s)}function g(r){return 62===r?(e.consume(r),o.interrupt?A:C):t(r)}function f(A){return 47===A?(e.consume(A),y):58===A||95===A||hc(A)?(e.consume(A),m):hw(A)?(e.consume(A),f):y(A)}function m(A){return 45===A||46===A||58===A||95===A||hu(A)?(e.consume(A),m):B(A)}function B(A){return 61===A?(e.consume(A),w):hw(A)?(e.consume(A),B):f(A)}function w(A){return null===A||60===A||61===A||62===A||96===A?t(A):34===A||39===A?(e.consume(A),i=A,v):hw(A)?(e.consume(A),w):function A(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||hB(t)?B(t):(e.consume(t),A)}(A)}function v(A){return A===i?(e.consume(A),i=null,x):null===A||hm(A)?t(A):(e.consume(A),v)}function x(e){return 47===e||62===e||hw(e)?f(e):t(e)}function y(A){return 62===A?(e.consume(A),b):t(A)}function b(A){return null===A||hm(A)?C(A):hw(A)?(e.consume(A),b):t(A)}function C(A){return 45===A&&2===r?(e.consume(A),E):60===A&&1===r?(e.consume(A),k):62===A&&4===r?(e.consume(A),S):63===A&&3===r?(e.consume(A),H):93===A&&5===r?(e.consume(A),I):hm(A)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(hZ,N,Q)(A)):null===A||hm(A)?(e.exit("htmlFlowData"),Q(A)):(e.consume(A),C)}function Q(A){return e.check(h0,F,N)(A)}function F(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),U}function U(A){return null===A||hm(A)?Q(A):(e.enter("htmlFlowData"),C(A))}function E(A){return 45===A?(e.consume(A),H):C(A)}function k(A){return 47===A?(e.consume(A),a="",j):C(A)}function j(A){if(62===A){let t=a.toLowerCase();return h$.includes(t)?(e.consume(A),S):C(A)}return hc(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),j):C(A)}function I(A){return 93===A?(e.consume(A),H):C(A)}function H(A){return 62===A?(e.consume(A),S):45===A&&2===r?(e.consume(A),H):C(A)}function S(A){return null===A||hm(A)?(e.exit("htmlFlowData"),N(A)):(e.consume(A),S)}function N(t){return e.exit("htmlFlow"),A(t)}}},61:h_,95:hT,96:h2,126:h2},gp={38:h6,92:h8},gh={[-5]:h9,[-4]:h9,[-3]:h9,33:gn,38:h6,42:gs,60:[{name:"autolink",tokenize:function(e,A,t){let r=0;return function(A){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(A),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),n};function n(A){return hc(A)?(e.consume(A),a):64===A?t(A):i(A)}function a(A){return 43===A||45===A||46===A||hu(A)?(r=1,function A(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||hu(t))&&r++<32?(e.consume(t),A):(r=0,i(t))}(A)):i(A)}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),A):null===r||32===r||60===r||hp(r)?t(r):(e.consume(r),s)}function i(A){return 64===A?(e.consume(A),o):hd(A)?(e.consume(A),i):t(A)}function o(n){return hu(n)?function n(a){return 46===a?(e.consume(a),r=0,o):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),A):function A(a){if((45===a||hu(a))&&r++<63){let t=45===a?A:n;return e.consume(a),t}return t(a)}(a)}(n):t(n)}}},{name:"htmlText",tokenize:function(e,A,t){let r,n,a,s=this;return function(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),i};function i(A){return 33===A?(e.consume(A),o):47===A?(e.consume(A),v):63===A?(e.consume(A),B):hc(A)?(e.consume(A),y):t(A)}function o(A){return 45===A?(e.consume(A),l):91===A?(e.consume(A),n=0,p):hc(A)?(e.consume(A),m):t(A)}function l(A){return 45===A?(e.consume(A),d):t(A)}function c(A){return null===A?t(A):45===A?(e.consume(A),u):hm(A)?(a=c,j(A)):(e.consume(A),c)}function u(A){return 45===A?(e.consume(A),d):c(A)}function d(e){return 62===e?k(e):45===e?u(e):c(e)}function p(A){let r="CDATA[";return A===r.charCodeAt(n++)?(e.consume(A),n===r.length?h:p):t(A)}function h(A){return null===A?t(A):93===A?(e.consume(A),g):hm(A)?(a=h,j(A)):(e.consume(A),h)}function g(A){return 93===A?(e.consume(A),f):h(A)}function f(A){return 62===A?k(A):93===A?(e.consume(A),f):h(A)}function m(A){return null===A||62===A?k(A):hm(A)?(a=m,j(A)):(e.consume(A),m)}function B(A){return null===A?t(A):63===A?(e.consume(A),w):hm(A)?(a=B,j(A)):(e.consume(A),B)}function w(e){return 62===e?k(e):B(e)}function v(A){return hc(A)?(e.consume(A),x):t(A)}function x(A){return 45===A||hu(A)?(e.consume(A),x):function A(t){return hm(t)?(a=A,j(t)):hw(t)?(e.consume(t),A):k(t)}(A)}function y(A){return 45===A||hu(A)?(e.consume(A),y):47===A||62===A||hB(A)?b(A):t(A)}function b(A){return 47===A?(e.consume(A),k):58===A||95===A||hc(A)?(e.consume(A),C):hm(A)?(a=b,j(A)):hw(A)?(e.consume(A),b):k(A)}function C(A){return 45===A||46===A||58===A||95===A||hu(A)?(e.consume(A),C):function A(t){return 61===t?(e.consume(t),Q):hm(t)?(a=A,j(t)):hw(t)?(e.consume(t),A):b(t)}(A)}function Q(A){return null===A||60===A||61===A||62===A||96===A?t(A):34===A||39===A?(e.consume(A),r=A,F):hm(A)?(a=Q,j(A)):hw(A)?(e.consume(A),Q):(e.consume(A),U)}function F(A){return A===r?(e.consume(A),r=void 0,E):null===A?t(A):hm(A)?(a=F,j(A)):(e.consume(A),F)}function U(A){return null===A||34===A||39===A||60===A||61===A||96===A?t(A):47===A||62===A||hB(A)?b(A):(e.consume(A),U)}function E(e){return 47===e||62===e||hB(e)?b(e):t(e)}function k(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),A):t(r)}function j(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),I}function I(A){return hw(A)?hb(e,H,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):H(A)}function H(A){return e.enter("htmlTextData"),a(A)}}}],91:go,92:[{name:"hardBreakEscape",tokenize:function(e,A,t){return function(A){return e.enter("hardBreakEscape"),e.consume(A),r};function r(r){return hm(r)?(e.exit("hardBreakEscape"),A(r)):t(r)}}},h8],93:ge,95:gs,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let A,t,r=e.length-4,n=3;if(("lineEnding"===e[3][1].type||"space"===e[n][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(A=n;++A13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(65535&t)==65535||(65535&t)==65534||t>1114111?"�":String.fromCodePoint(t)}let gv=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gx(e,A,t){if(A)return A;if(35===t.charCodeAt(0)){let e=t.charCodeAt(1),A=120===e||88===e;return gw(t.slice(A?2:1),A?16:10)}return h5(t)||e}let gy={}.hasOwnProperty;function gb(e){return{line:e.line,column:e.column,offset:e.offset}}function gC(e,A){if(e)throw Error("Cannot close `"+e.type+"` ("+pq({start:e.start,end:e.end})+"): a different token (`"+A.type+"`, "+pq({start:A.start,end:A.end})+") is open");throw Error("Cannot close document, a token (`"+A.type+"`, "+pq({start:A.start,end:A.end})+") is still open")}function gQ(e){let A=this;A.parser=function(t){var r,n;let a,s,i,o;return"string"!=typeof(r={...A.data("settings"),...e,extensions:A.data("micromarkExtensions")||[],mdastExtensions:A.data("fromMarkdownExtensions")||[]})&&(n=r,r=void 0),(function(e){let A={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(m),autolinkProtocol:l,autolinkEmail:l,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:l,characterReference:l,codeFenced:r(p),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:r(p,n),codeText:r(function(){return{type:"inlineCode",value:""}},n),codeTextData:l,data:l,codeFlowValue:l,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(f,n),htmlFlowData:l,htmlText:r(f,n),htmlTextData:l,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:n,link:r(m),listItem:r(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:r(B,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(B),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let A=this.stack[this.stack.length-1];A.depth||(A.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:d,characterReferenceMarkerNumeric:d,characterReferenceValue:function(e){let A,t=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(A=gw(t,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):A=h5(t);let n=this.stack[this.stack.length-1];n.value+=A},characterReference:function(e){this.stack.pop().position.end=gb(e.end)},codeFenced:s(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:c,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let A=this.resume(),t=this.stack[this.stack.length-1];t.label=A,t.identifier=hq(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(u),hardBreakTrailing:s(u),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=A,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],A=this.resume(),t=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===t.type?t.children=e.children:t.alt=A},labelText:function(e){let A=this.sliceSerialize(e),t=this.stack[this.stack.length-2];t.label=A.replace(gv,gx),t.identifier=hq(A).toLowerCase()},lineEnding:function(e){let t=this.stack[this.stack.length-1];if(this.data.atHardBreak){t.children[t.children.length-1].position.end=gb(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&A.canContainEols.includes(t.type)&&(l.call(this,e),c.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=A,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let A=this.resume(),t=this.stack[this.stack.length-1];t.label=A,t.identifier=hq(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:s(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:s(),thematicBreak:s()}};!function e(A,t){let r=-1;for(;++r0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||gC).call(s,void 0,e[0])}for(r.position={start:gb(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:gb(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c-1){let e=t[0];"string"==typeof e?t[0]=e.slice(n):t.shift()}s>0&&t.push(e[a].slice(0,s))}return t}(s,e)}function d(){let{_bufferIndex:e,_index:A,line:t,column:n,offset:a}=r;return{_bufferIndex:e,_index:A,line:t,column:n,offset:a}}function p(e,A){A.restore()}function h(e,A){return function(t,n,a){var s;let c,u,p,h;return Array.isArray(t)?g(t):"tokenize"in t?g([t]):(s=t,function(e){let A=null!==e&&s[e],t=null!==e&&s.null;return g([...Array.isArray(A)?A:A?[A]:[],...Array.isArray(t)?t:t?[t]:[]])(e)});function g(e){return(c=e,u=0,0===e.length)?a:m(e[u])}function m(e){return function(t){return(h=function(){let e=d(),A=l.previous,t=l.currentConstruct,n=l.events.length,a=Array.from(i);return{from:n,restore:function(){r=e,l.previous=A,l.currentConstruct=t,l.events.length=n,i=a,f()}}}(),p=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name))?w(t):e.tokenize.call(A?Object.assign(Object.create(l),A):l,o,B,w)(t)}}function B(A){return e(p,h),n}function w(e){return(h.restore(),++u{let t=(A,t)=>(e.set(t,A),A),r=n=>{if(e.has(n))return e.get(n);let[a,s]=A[n];switch(a){case 0:case -1:return t(s,n);case 1:{let e=t([],n);for(let A of s)e.push(r(A));return e}case 2:{let e=t({},n);for(let[A,t]of s)e[r(A)]=r(t);return e}case 3:return t(new Date(s),n);case 4:{let{source:e,flags:A}=s;return t(new RegExp(e,A),n)}case 5:{let e=t(new Map,n);for(let[A,t]of s)e.set(r(A),r(t));return e}case 6:{let e=t(new Set,n);for(let A of s)e.add(r(A));return e}case 7:{let{name:e,message:A}=s;return t(new gF[e](A),n)}case 8:return t(BigInt(s),n);case"BigInt":return t(Object(BigInt(s)),n);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return t(new DataView(e),s)}}return t(new gF[a](s),n)};return r},gE=e=>gU(new Map,e)(0),{toString:gk}={},{keys:gj}=Object,gI=e=>{let A=typeof e;if("object"!==A||!e)return[0,A];let t=gk.call(e).slice(8,-1);switch(t){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,t]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},gH=([e,A])=>0===e&&("function"===A||"symbol"===A),gS=(e,A,t,r)=>{let n=(e,A)=>{let n=r.push(e)-1;return t.set(A,n),n},a=r=>{if(t.has(r))return t.get(r);let[s,i]=gI(r);switch(s){case 0:{let A=r;switch(i){case"bigint":s=8,A=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+i);A=null;break;case"undefined":return n([-1],r)}return n([s,A],r)}case 1:{if(i){let e=r;return"DataView"===i?e=new Uint8Array(r.buffer):"ArrayBuffer"===i&&(e=new Uint8Array(r)),n([i,[...e]],r)}let e=[],A=n([s,e],r);for(let A of r)e.push(a(A));return A}case 2:{if(i)switch(i){case"BigInt":return n([i,r.toString()],r);case"Boolean":case"Number":case"String":return n([i,r.valueOf()],r)}if(A&&"toJSON"in r)return a(r.toJSON());let t=[],o=n([s,t],r);for(let A of gj(r))(e||!gH(gI(r[A])))&&t.push([a(A),a(r[A])]);return o}case 3:return n([s,r.toISOString()],r);case 4:{let{source:e,flags:A}=r;return n([s,{source:e,flags:A}],r)}case 5:{let A=[],t=n([s,A],r);for(let[t,n]of r)(e||!(gH(gI(t))||gH(gI(n))))&&A.push([a(t),a(n)]);return t}case 6:{let A=[],t=n([s,A],r);for(let t of r)(e||!gH(gI(t)))&&A.push(a(t));return t}}let{message:o}=r;return n([s,{name:i,message:o}],r)};return a},gN=(e,{json:A,lossy:t}={})=>{let r=[];return gS(!(A||t),!!A,new Map,r)(e),r},gL="function"==typeof structuredClone?(e,A)=>A&&("json"in A||"lossy"in A)?gE(gN(e,A)):structuredClone(e):(e,A)=>gE(gN(e,A));function gD(e){let A=[],t=-1,r=0,n=0;for(;++t55295&&a<57344){let A=e.charCodeAt(t+1);a<56320&&A>56319&&A<57344?(s=String.fromCharCode(a,A),n=1):s="�"}else s=String.fromCharCode(a);s&&(A.push(e.slice(r,t),encodeURIComponent(s)),r=t+n+1,s=""),n&&(t+=n,n=0)}return A.join("")+e.slice(r)}function gT(e,A){let t=[{type:"text",value:"↩"}];return A>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(A)}]}),t}function gM(e,A){return"Back to reference "+(e+1)+(A>1?"-"+A:"")}let gK=function(e){var A,t;if(null==e)return gR;if("function"==typeof e)return gP(e);if("object"==typeof e){return Array.isArray(e)?function(e){let A=[],t=-1;for(;++t":"")+"\x1b[39m)"})}return a;function a(){var n;let a,s,i,p=gO;if((!o||u(A,t,r[r.length-1]||void 0))&&!1===(p=Array.isArray(n=l(A,r))?n:"number"==typeof n?[!0,n]:null==n?gO:[n])[0])return p;if("children"in A&&A.children&&A.children&&"skip"!==p[0])for(s=(c?A.children.length:-1)+d,i=r.concat(A);s>-1&&s1:A}function gq(e,A,t){let r=0,n=e.length;if(A){let A=e.codePointAt(r);for(;9===A||32===A;)r++,A=e.codePointAt(r)}if(t){let A=e.codePointAt(n-1);for(;9===A||32===A;)n--,A=e.codePointAt(n-1)}return n>r?e.slice(r,n):""}let gW={blockquote:function(e,A){let t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(A),!0)};return e.patch(A,t),e.applyData(A,t)},break:function(e,A){let t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(A,t),[e.applyData(A,t),{type:"text",value:"\n"}]},code:function(e,A){let t=A.value?A.value+"\n":"",r={};A.lang&&(r.className=["language-"+A.lang]);let n={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return A.meta&&(n.data={meta:A.meta}),e.patch(A,n),n={type:"element",tagName:"pre",properties:{},children:[n=e.applyData(A,n)]},e.patch(A,n),n},delete:function(e,A){let t={type:"element",tagName:"del",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},emphasis:function(e,A){let t={type:"element",tagName:"em",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},footnoteReference:function(e,A){let t,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=String(A.identifier).toUpperCase(),a=gD(n.toLowerCase()),s=e.footnoteOrder.indexOf(n),i=e.footnoteCounts.get(n);void 0===i?(i=0,e.footnoteOrder.push(n),t=e.footnoteOrder.length):t=s+1,i+=1,e.footnoteCounts.set(n,i);let o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(t)}]};e.patch(A,o);let l={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(A,l),e.applyData(A,l)},heading:function(e,A){let t={type:"element",tagName:"h"+A.depth,properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},html:function(e,A){if(e.options.allowDangerousHtml){let t={type:"raw",value:A.value};return e.patch(A,t),e.applyData(A,t)}},imageReference:function(e,A){let t=String(A.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return gG(e,A);let n={src:gD(r.url||""),alt:A.alt};null!==r.title&&void 0!==r.title&&(n.title=r.title);let a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(A,a),e.applyData(A,a)},image:function(e,A){let t={src:gD(A.url)};null!==A.alt&&void 0!==A.alt&&(t.alt=A.alt),null!==A.title&&void 0!==A.title&&(t.title=A.title);let r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(A,r),e.applyData(A,r)},inlineCode:function(e,A){let t={type:"text",value:A.value.replace(/\r?\n|\r/g," ")};e.patch(A,t);let r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(A,r),e.applyData(A,r)},linkReference:function(e,A){let t=String(A.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return gG(e,A);let n={href:gD(r.url||"")};null!==r.title&&void 0!==r.title&&(n.title=r.title);let a={type:"element",tagName:"a",properties:n,children:e.all(A)};return e.patch(A,a),e.applyData(A,a)},link:function(e,A){let t={href:gD(A.url)};null!==A.title&&void 0!==A.title&&(t.title=A.title);let r={type:"element",tagName:"a",properties:t,children:e.all(A)};return e.patch(A,r),e.applyData(A,r)},listItem:function(e,A,t){let r=e.all(A),n=t?function(e){let A=!1;if("list"===e.type){A=e.spread||!1;let t=e.children,r=-1;for(;!A&&++r0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:A.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let i=-1;for(;++i0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=pG(A.children[1]),s=pV(A.children[A.children.length-1]);a&&s&&(r.position={start:a,end:s}),n.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(n,!0)};return e.patch(A,a),e.applyData(A,a)},tableCell:function(e,A){let t={type:"element",tagName:"td",properties:{},children:e.all(A)};return e.patch(A,t),e.applyData(A,t)},tableRow:function(e,A,t){let r=t?t.children:void 0,n=0===(r?r.indexOf(A):1)?"th":"td",a=t&&"table"===t.type?t.align:void 0,s=a?a.length:A.children.length,i=-1,o=[];for(;++i0,!0),r[0]),n=r.index+r[0].length,r=t.exec(A);return a.push(gq(A.slice(n),n>0,!1)),a.join("")}(String(A.value))};return e.patch(A,t),e.applyData(A,t)},thematicBreak:function(e,A){let t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(A,t),e.applyData(A,t)},toml:gJ,yaml:gJ,definition:gJ,footnoteDefinition:gJ};function gJ(){}let gX={}.hasOwnProperty,g_={};function gY(e,A){e.position&&(A.position=function(e){let A=pG(e),t=pV(e);if(A&&t)return{start:A,end:t}}(e))}function g$(e,A){let t=A;if(e&&e.data){let A=e.data.hName,r=e.data.hChildren,n=e.data.hProperties;"string"==typeof A&&("element"===t.type?t.tagName=A:t={type:"element",tagName:A,properties:{},children:"children"in t?t.children:[t]}),"element"===t.type&&n&&Object.assign(t.properties,gL(n)),"children"in t&&t.children&&null!=r&&(t.children=r)}return t}function gZ(e,A){let t=[],r=-1;for(A&&t.push({type:"text",value:"\n"});++r0&&t.push({type:"text",value:"\n"}),t}function g0(e){let A=0,t=e.charCodeAt(A);for(;9===t||32===t;)A++,t=e.charCodeAt(A);return e.slice(A)}function g1(e,A){let t=function(e,A){let t=A||g_,r=new Map,n=new Map,a={all:function(e){let A=[];if("children"in e){let t=e.children,r=-1;for(;++r0&&u.push({type:"text",value:" "});let e="string"==typeof t?t:t(o,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+A+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(o,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let h={type:"element",tagName:"li",properties:{id:A+"fn-"+l},children:e.wrap(a,!0)};e.patch(n,h),i.push(h)}if(0!==i.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gL(s),id:"footnote-label"},children:[{type:"text",value:n}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:"\n"}]}}(t),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return n&&a.children.push({type:"text",value:"\n"},n),a}function g2(e,A){return e&&"run"in e?async function(t,r){let n=g1(t,{file:r,...A});await e.run(n,r)}:function(t,r){return g1(t,{file:r,...e||A})}}function g4(e){if(e)throw e}var g3=t(9566);function g5(e){if("object"!=typeof e||null===e)return!1;let A=Object.getPrototypeOf(e);return(null===A||A===Object.prototype||null===Object.getPrototypeOf(A))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let g6=require("node:path"),g8=require("node:process");function g9(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let g7=require("node:url"),fe=["history","path","basename","stem","extname","dirname"];class fA{constructor(e){let A,t;A=e?g9(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 A?"":g8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++rA.length;s&&A.push(r);try{a=e.apply(this,A)}catch(e){if(s&&t)throw e;return r(e)}s||(a&&a.then&&"function"==typeof a.then?a.then(n,r):a instanceof Error?r(a):n(a))};function r(e,...n){t||(t=!0,A(e,...n))}function n(e){r(null,e)}})(i,n)(...s):r(null,...s)}(null,...A)},use:function(t){if("function"!=typeof t)throw TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),A}};return A}()}copy(){let e=new fi,A=-1;for(;++A0){let[r,...a]=A,s=t[n][1];g5(s)&&g5(r)&&(r=g3(!0,s,r)),t[n]=[e,r,...a]}}}}let fo=new fi().freeze();function fl(e,A){if("function"!=typeof A)throw TypeError("Cannot `"+e+"` without `parser`")}function fc(e,A){if("function"!=typeof A)throw TypeError("Cannot `"+e+"` without `compiler`")}function fu(e,A){if(A)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fd(e){if(!g5(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function fp(e,A,t){if(!t)throw Error("`"+e+"` finished async. Use `"+A+"` instead")}function fh(e){var A;return(A=e)&&"object"==typeof A&&"message"in A&&"messages"in A?e:new fA(e)}let fg=[],ff={allowDangerousHtml:!0},fm=/^(https?|ircs?|mailto|xmpp)$/i,fB=[{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 fw(e){let A=function(e){let A=e.rehypePlugins||fg,t=e.remarkPlugins||fg,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ff}:ff;return fo().use(gQ).use(t).use(g2,r).use(A)}(e),t=function(e){let A=e.children||"",t=new fA;return"string"==typeof A&&(t.value=A),t}(e);return function(e,A){let t=A.allowedElements,r=A.allowElement,n=A.components,a=A.disallowedElements,s=A.skipHtml,i=A.unwrapDisallowed,o=A.urlTransform||fv;for(let e of fB)Object.hasOwn(A,e.from)&&(e.from,e.to&&e.to,e.id);return gV(e,function(e,A,n){if("raw"===e.type&&n&&"number"==typeof A)return s?n.children.splice(A,1):n.children[A]={type:"text",value:e.value},A;if("element"===e.type){let A;for(A in he)if(Object.hasOwn(he,A)&&Object.hasOwn(e.properties,A)){let t=e.properties[A],r=he[A];(null===r||r.includes(e.tagName))&&(e.properties[A]=o(String(t||""),A,e))}}if("element"===e.type){let s=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof A&&(s=!r(e,A,n)),s&&n&&"number"==typeof A)return i&&e.children?n.children.splice(A,1,...e.children):n.children.splice(A,1),A}}),function(e,A){var t,r,n,a,s;let i;if(!A||void 0===A.Fragment)throw TypeError("Expected `Fragment` in options");let o=A.filePath||void 0;if(A.development){if("function"!=typeof A.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");t=o,r=A.jsxDEV,i=function(e,A,n,a){let s=Array.isArray(n.children),i=pG(e);return r(A,n,a,s,{columnNumber:i?i.column-1:void 0,fileName:t,lineNumber:i?i.line:void 0},void 0)}}else{if("function"!=typeof A.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof A.jsxs)throw TypeError("Expected `jsxs` in production options");n=0,a=A.jsx,s=A.jsxs,i=function(e,A,t,r){let n=Array.isArray(t.children)?s:a;return r?n(A,t,r):n(A,t)}}let l={Fragment:A.Fragment,ancestors:[],components:A.components||{},create:i,elementAttributeNameCase:A.elementAttributeNameCase||"react",evaluater:A.createEvaluater?A.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:A.ignoreInvalidStyle||!1,passKeys:!1!==A.passKeys,passNode:A.passNode||!1,schema:"svg"===A.space?pL:pN,stylePropertyNameCase:A.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==A.tableCellAlignToStyle},c=p4(l,e,void 0);return c&&"string"!=typeof c?c:l.create(e,l.Fragment,{children:c||void 0},void 0)}(e,{Fragment:d.Fragment,components:n,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0})}(A.runSync(A.parse(t),t),e)}function fv(e){let A=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),n=e.indexOf("/");return -1===A||-1!==n&&A>n||-1!==t&&A>t||-1!==r&&A>r||fm.test(e.slice(0,A))?e:""}function fx({content:e,className:A,skipNormalization:t=!1}){let r=t?e:function(e){if(!e||"string"!=typeof e)return"";let A=e.split("\n"),t=[],r=!1,n=0,a=e=>{let A=e.trim();return/^```/.test(A)},s=e=>{let A=e.trim();return/^[-*+]\s/.test(A)||/^\d+\.\s/.test(A)},i=e=>/^\s*>/.test(e),o=e=>{let A=e.trim();return!!A&&!(A.length<3)&&[/^(const|let|var|function|class|import|export|return|if|for|while)\s/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*[=:({]/,/[{};()[\]]/,/^\/\//,/^#/].some(e=>e.test(A))};for(let e=0;e=4&&!o(l)||c>=2&&c<4){t.push(l.trim());continue}t.push(l)}return t.join("\n").trim()}(e);return(0,d.jsx)("div",{className:(0,y.cn)("prose prose-sm dark:prose-invert max-w-none",A),children:(0,d.jsx)(fw,{components:{h1:({children:e})=>(0,d.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,d.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,d.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,d.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,d.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,d.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,d.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,d.jsx)("li",{className:"text-sm",children:e}),pre:({children:e,...A})=>(0,d.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",...A,children:e}),code:({className:e,children:A,...t})=>/language-(\w+)/.exec(e||"")?(0,d.jsx)("code",{className:"font-mono text-xs",...t,children:A}):(0,d.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...t,children:A}),blockquote:({children:e})=>(0,d.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:A})=>(0,d.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:A}),strong:({children:e})=>(0,d.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,d.jsx)("em",{className:"italic",children:e}),hr:()=>(0,d.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,d.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,d.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,d.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,d.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,d.jsx)("tr",{children:e}),th:({children:e})=>(0,d.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,d.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:r})})}var fy="Toggle",fb=p.forwardRef((e,A)=>{let{pressed:t,defaultPressed:r,onPressedChange:n,...a}=e,[s,i]=(0,el.i)({prop:t,onChange:n,defaultProp:r??!1,caller:fy});return(0,d.jsx)(ec.sG.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:A,onClick:(0,es.mK)(e.onClick,()=>{e.disabled||i(!s)})})});fb.displayName=fy;var fC="ToggleGroup",[fQ,fF]=(0,eo.A)(fC,[eE]),fU=eE(),fE=p.forwardRef((e,A)=>{let{type:t,...r}=e;if("single"===t)return(0,d.jsx)(fI,{...r,ref:A});if("multiple"===t)return(0,d.jsx)(fH,{...r,ref:A});throw Error(`Missing prop \`type\` expected on \`${fC}\``)});fE.displayName=fC;var[fk,fj]=fQ(fC),fI=p.forwardRef((e,A)=>{let{value:t,defaultValue:r,onValueChange:n=()=>{},...a}=e,[s,i]=(0,el.i)({prop:t,defaultProp:r??"",onChange:n,caller:fC});return(0,d.jsx)(fk,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>s?[s]:[],[s]),onItemActivate:i,onItemDeactivate:p.useCallback(()=>i(""),[i]),children:(0,d.jsx)(fL,{...a,ref:A})})}),fH=p.forwardRef((e,A)=>{let{value:t,defaultValue:r,onValueChange:n=()=>{},...a}=e,[s,i]=(0,el.i)({prop:t,defaultProp:r??[],onChange:n,caller:fC}),o=p.useCallback(e=>i((A=[])=>[...A,e]),[i]),l=p.useCallback(e=>i((A=[])=>A.filter(A=>A!==e)),[i]);return(0,d.jsx)(fk,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:o,onItemDeactivate:l,children:(0,d.jsx)(fL,{...a,ref:A})})});fE.displayName=fC;var[fS,fN]=fQ(fC),fL=p.forwardRef((e,A)=>{let{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:n=!0,orientation:a,dir:s,loop:i=!0,...o}=e,l=fU(t),c=(0,ed.jH)(s),u={role:"group",dir:c,...o};return(0,d.jsx)(fS,{scope:t,rovingFocus:n,disabled:r,children:n?(0,d.jsx)(eI,{asChild:!0,...l,orientation:a,dir:c,loop:i,children:(0,d.jsx)(ec.sG.div,{...u,ref:A})}):(0,d.jsx)(ec.sG.div,{...u,ref:A})})}),fD="ToggleGroupItem",fT=p.forwardRef((e,A)=>{let t=fj(fD,e.__scopeToggleGroup),r=fN(fD,e.__scopeToggleGroup),n=fU(e.__scopeToggleGroup),a=t.value.includes(e.value),s=r.disabled||e.disabled,i={...e,pressed:a,disabled:s},o=p.useRef(null);return r.rovingFocus?(0,d.jsx)(eN,{asChild:!0,...n,focusable:!s,active:a,ref:o,children:(0,d.jsx)(fM,{...i,ref:A})}):(0,d.jsx)(fM,{...i,ref:A})});fT.displayName=fD;var fM=p.forwardRef((e,A)=>{let{__scopeToggleGroup:t,value:r,...n}=e,a=fj(fD,t),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i="single"===a.type?s:void 0;return(0,d.jsx)(fb,{...i,...n,ref:A,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})});let fK=(0,t(4224).F)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),fP=p.forwardRef(({className:e,...A},t)=>(0,d.jsx)(fE,{ref:t,className:(0,y.cn)("inline-flex items-center justify-center gap-1 rounded-md bg-muted p-1",e),...A}));fP.displayName=fE.displayName;let fR=p.forwardRef(({className:e,variant:A,size:t,...r},n)=>(0,d.jsx)(fT,{ref:n,className:(0,y.cn)(fK({variant:A,size:t}),e),...r}));fR.displayName=fT.displayName;var fO=t(9929);let fV={shell:(0,d.jsx)(A9,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,d.jsx)(k,{className:"h-3 w-3 text-orange-500"})},fG={pending:(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,d.jsx)(d9.A,{className:"h-3 w-3 text-green-500"}),failed:(0,d.jsx)(d7.A,{className:"h-3 w-3 text-red-500"})};function fz({events:e,onRestore:A,onRetry:t,prompt:r,setPrompt:n,generating:a,onGenerate:s,onStop:i,focusContext:o,setFocusContext:l,focusPreviewSnippet:c,chatMode:u,setChatMode:h,currentModel:g,setCurrentModel:f,getModelDisplayName:m,isTourLockingInput:B=!1,onClearChat:w,onClose:v}){let x=(0,p.useRef)(null),[y,b]=(0,p.useState)(!0),[C,F]=(0,p.useState)(!1),[E,k]=(0,p.useState)(new Set);(0,p.useRef)(!1);let j=(0,p.useRef)(0),I=(0,p.useRef)(new Map),H=(0,p.useRef)({result:[],currentTurn:{id:`turn-${Date.now()}`,items:[]},currentToolBatch:0,toolsByBatchAndIndex:new Map,itemIdCounter:0}),S=(0,p.useMemo)(()=>{let A,t=H.current,r=e.length-j.current;if(0===e.length||j.current>e.length)return j.current=0,I.current=new Map,H.current={result:[],currentTurn:{id:`turn-${Date.now()}`,items:[]},currentToolBatch:0,toolsByBatchAndIndex:new Map,itemIdCounter:0},[];let n=e[e.length-1],a=n&&("assistant_delta"===n.event||"tool_param_delta"===n.event),s=I.current.get(n?.id||""),i=a&&n.version&&s!==n.version;if(0===r&&!i)return[...t.result,...t.currentTurn.items.length>0?[t.currentTurn]:[]];for(let r of(i?(A=[n],I.current.set(n.id,n.version)):A=e.slice(j.current),A))switch(r.event){case"thinking":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"thinking",timestamp:r.timestamp,data:null});break;case"toolCalls":let e=r.data?.toolCalls||[];for(let A=0;A"thinking"!==e.type);break;case"tool_status":let{toolIndex:A,status:n,result:a,error:s}=r.data||{},i=`${t.currentToolBatch-1}-${A}`,o=t.toolsByBatchAndIndex.get(i);o&&(o.status=n,a&&(o.result=a),s&&(o.error=s));break;case"tool_result":let l=r.data?.toolIndex,c=`${t.currentToolBatch-1}-${l}`,u=t.toolsByBatchAndIndex.get(c);u&&r.data?.result&&(u.result=r.data.result);break;case"tool_param_delta":for(let e of r.data?.all||[r.data]){let{toolId:A,partialArguments:r}=e||{};if(!A)continue;let n=t.currentTurn.items.find(e=>"tool"===e.type&&e.data?.id===A);if(n){let e=n.data;try{e.parameters=JSON.parse(r)}catch{e.parameters={_raw:r}}}}break;case"assistant_delta":let d=r.data?.all||[r.data],p=t.currentTurn.items.findLast(e=>"text"===e.type);for(let e of d){let A=e?.text||"",n=e?.snapshot;void 0!==n?p?p.data=n:(p={id:`item-${t.itemIdCounter++}`,type:"text",timestamp:r.timestamp,data:n},t.currentTurn.items.push(p)):A&&(p?p.data+=A:(p={id:`item-${t.itemIdCounter++}`,type:"text",timestamp:r.timestamp,data:A},t.currentTurn.items.push(p)))}t.currentTurn.items=t.currentTurn.items.filter(e=>"thinking"!==e.type);break;case"plan_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"plan",timestamp:r.timestamp,data:r.data?.content||""});break;case"agent_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"agent",timestamp:r.timestamp,data:r.data?.content||""});break;case"task_progress":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"progress",timestamp:r.timestamp,data:r.data?.content||""});break;case"conversation_message":let h=r.data?.message;if(h?.role==="user"){if(h.content?.includes("Before finishing, you must call the evaluation tool"))break;t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"user",timestamp:r.timestamp,data:h.content||""})}break;case"user_message":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"user",timestamp:r.timestamp,data:r.data?.content||""});break;case"error":t.currentTurn.items.push({id:`item-${t.itemIdCounter++}`,type:"error",timestamp:r.timestamp,data:r.data}),t.currentTurn.items=t.currentTurn.items.filter(e=>"thinking"!==e.type);break;case"usage":t.currentTurn.usage=r.data;break;case"checkpoint_created":t.currentTurn.checkpointId=r.data?.checkpointId;break;case"iteration":t.currentTurn.iteration=r.data?.iteration,t.currentTurn.items.length>0&&(t.result.push(t.currentTurn),t.currentTurn={id:`turn-${Date.now()}-${t.result.length}`,items:[]})}return i||(j.current=e.length),[...t.result,...t.currentTurn.items.length>0?[t.currentTurn]:[]]},[e]),L=e=>{k(A=>{let t=new Set(A);return t.has(e)?t.delete(e):t.add(e),t})},D=c?.trim()??"",T=o?(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,d.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,d.jsx)(Q.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>l(null),title:"Clear focus context",children:"Clear"})]}),(0,d.jsxs)("div",{className:"mt-2 space-y-2",children:[o.domPath&&(0,d.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:o.domPath}),D&&(0,d.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,d.jsx)("code",{children:D})})]})]}):null;return(0,d.jsxs)("div",{className:"h-full flex flex-col bg-card border border-border rounded-lg overflow-hidden","data-tour-id":"assistant-panel",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-border bg-muted/30 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(u_,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),v?(0,d.jsxs)("button",{type:"button",onClick:v,"aria-label":"Hide chat panel",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,d.jsx)(u_,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,d.jsx)(N.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,d.jsx)(u_,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-assistant-active)"}}),(0,d.jsx)("span",{className:"font-semibold text-sm",children:"Chat"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:w&&(0,d.jsx)(Q.$,{variant:"ghost",size:"sm",onClick:w,className:"h-7 px-2 hover:bg-muted",title:"Clear chat","data-tour-id":"clear-chat-button",children:(0,d.jsx)(G,{className:"h-3 w-3"})})})]}),(0,d.jsx)("div",{ref:x,className:"flex-1 overflow-y-auto p-4 space-y-4",children:0===S.length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center p-4",children:"No messages yet. Start a conversation to see it here."}):S.map(e=>(0,d.jsx)(fq,{turn:e,onRestore:A,onRetry:t,expandedItems:E,onToggleExpanded:L},e.id))}),(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[T,(0,d.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,d.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,d.jsx)(U,{value:r,onChange:e=>n(e.target.value),onKeyDown:e=>{!B&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),s())},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:a||B}),(0,d.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,d.jsx)(Q.$,{onClick:a?i:s,disabled:B?!a:!a&&!r.trim(),size:"sm",className:"flex items-center gap-2",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l7.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(pe,{className:"h-4 w-4"}),"Send"]})})})]}),(0,d.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)(lw.AM,{open:C,onOpenChange:F,children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,d.jsx)("span",{children:m(g)}),C?(0,d.jsx)(lD.A,{className:"h-3 w-3 ml-1"}):(0,d.jsx)(d5.A,{className:"h-3 w-3 ml-1"})]})}),(0,d.jsx)(lw.hl,{className:"w-[36rem] max-w-[calc(100vw-2rem)]",align:"start","data-tour-id":"provider-settings-popup",children:(0,d.jsx)(fO.t,{onClose:()=>F(!1),onModelChange:e=>f(e)})})]}),(0,d.jsxs)(fP,{type:"single",value:u?"chat":"code",onValueChange:e=>{e&&h("chat"===e)},className:"gap-1",children:[(0,d.jsxs)(fR,{value:"chat",className:"h-7 text-xs px-2",children:[(0,d.jsx)(u_,{className:"h-3 w-3 mr-1"}),"Chat"]}),(0,d.jsxs)(fR,{value:"code",className:"h-7 text-xs px-2",children:[(0,d.jsx)(pA,{className:"h-3 w-3 mr-1"}),"Code"]})]})]})})]})]})]})}function fq({turn:e,onRestore:A,onRetry:t,expandedItems:r,onToggleExpanded:n}){return(0,d.jsxs)("div",{className:"space-y-2",children:[e.items.map(e=>{switch(e.type){case"thinking":return(0,d.jsx)("div",{className:"bg-muted/30 rounded-md p-2 opacity-70",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-400"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Thinking..."})]})},e.id);case"plan":return(0,d.jsx)(fJ,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"agent":return(0,d.jsx)(fX,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"progress":return(0,d.jsx)(f_,{itemId:e.id,content:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"tool":return(0,d.jsx)(fW,{itemId:e.id,tool:e.data,isExpanded:r.has(e.id),onToggle:()=>n(e.id)},e.id);case"text":return(0,d.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,d.jsx)(fx,{content:e.data})},e.id);case"user":return(0,d.jsxs)("div",{className:"text-sm text-foreground bg-primary/10 px-3 py-2 rounded border border-primary/20",children:[(0,d.jsx)("div",{className:"font-semibold text-primary mb-1 text-xs",children:"User"}),(0,d.jsx)("div",{className:"whitespace-pre-wrap",children:e.data})]},e.id);case"error":return(0,d.jsx)("div",{className:"text-sm bg-destructive/10 border border-destructive/20 px-3 py-2 rounded",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(d7.A,{className:"h-4 w-4 text-destructive mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("div",{className:"font-semibold text-destructive mb-1",children:"Error"}),(0,d.jsx)("div",{className:"text-destructive/90 whitespace-pre-wrap font-mono text-xs",children:e.data?.message||JSON.stringify(e.data,null,2)}),e.data?.stack&&(0,d.jsxs)("details",{className:"mt-2",children:[(0,d.jsx)("summary",{className:"text-xs text-destructive/70 cursor-pointer hover:text-destructive",children:"Stack trace"}),(0,d.jsx)("pre",{className:"text-[10px] text-destructive/60 mt-1 overflow-x-auto",children:e.data.stack})]})]})]})},e.id);default:return null}}),(e.usage||e.checkpointId)&&(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[e.usage&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Tokens: ",(e.usage.usage?.totalTokens||e.usage.totalTokens)?.toLocaleString()||"N/A",(void 0!==e.usage.totalCost||void 0!==e.usage.cost)&&` • Cost: $${((e.usage.totalCost??e.usage.cost)||0).toFixed(4)}`]}),e.checkpointId&&(A||t)&&(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[A&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",onClick:()=>A(e.checkpointId),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,d.jsx)(uX,{className:"h-3 w-3 mr-1"}),"Restore"]}),t&&(0,d.jsxs)(Q.$,{size:"sm",variant:"ghost",onClick:()=>t(e.checkpointId),className:"h-6 px-2 text-xs",title:"Retry from this checkpoint",children:[(0,d.jsx)(A6.A,{className:"h-3 w-3 mr-1"}),"Retry"]})]})]})]})}function fW({itemId:e,tool:A,isExpanded:t,onToggle:r}){return(0,d.jsxs)("div",{className:`bg-muted/30 rounded-md transition-all ${"executing"===A.status?"ring-2 ring-blue-500/20 animate-pulse":""} ${t?"p-2":"p-1.5"}`,children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[fV[A.name]||(0,d.jsx)(A9,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:A.name})]}),"shell"===A.name&&A.parameters?.cmd&&(0,d.jsx)("code",{className:"text-xs text-muted-foreground",children:Array.isArray(A.parameters.cmd)?A.parameters.cmd.slice(1).join(" ").substring(0,50):String(A.parameters.cmd).substring(0,50)}),(A.parameters?.path||A.parameters?.file_path)&&(0,d.jsx)("code",{className:"text-xs text-muted-foreground",children:A.parameters.path||A.parameters.file_path}),(0,d.jsx)("div",{className:"ml-auto",children:fG[A.status||"completed"]})]}),t&&(0,d.jsxs)("div",{className:"mt-2 space-y-2",children:[A.parameters&&Object.keys(A.parameters).length>0&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Parameters"}),(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto",children:JSON.stringify(A.parameters,null,2)})]}),A.result&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Result"}),(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto max-h-40 overflow-y-auto",children:"string"==typeof A.result?A.result:JSON.stringify(A.result,null,2)})]}),A.error&&(0,d.jsxs)("div",{className:"px-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1",children:"Error"}),(0,d.jsx)("pre",{className:"text-xs bg-destructive/10 text-destructive p-2 rounded overflow-x-auto",children:A.error})]})]})]})}function fJ({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.split("\n"),a=n[0]?.replace(/^\*\*|\*\*$/g,"").substring(0,50)||"Plan";return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(pt,{className:"h-3 w-3 text-orange-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"plan"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function fX({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.split("\n"),a=n[0]?.replace(/^\*\*|\*\*$/g,"").replace(/^🤖\s*/,"").substring(0,50)||"Agent";return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(pr,{className:"h-3 w-3 text-purple-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"agent"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function f_({itemId:e,content:A,isExpanded:t,onToggle:r}){let n=A.includes("��"),a=A.replace(/^[✅🔄]\s*/,"").substring(0,50);return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-md transition-all p-1.5",children:[(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[n?(0,d.jsx)(d9.A,{className:"h-3 w-3 text-green-500"}):(0,d.jsx)(l7.A,{className:"h-3 w-3 animate-spin text-blue-500"}),(0,d.jsx)("span",{className:"text-xs font-mono",children:"progress"})]}),(0,d.jsx)("code",{className:"text-xs text-muted-foreground truncate flex-1",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(A9,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`})})]}),t&&(0,d.jsx)("div",{className:"mt-2 px-2",children:(0,d.jsx)("pre",{className:"text-xs bg-muted/50 p-2 rounded overflow-x-auto whitespace-pre-wrap",children:A})})]})}function fY({project:e,onBack:A}){let[t,r]=(0,p.useState)(0),[n,a]=(0,p.useState)(""),[s,i]=(0,p.useState)(!1),[o,l]=(0,p.useState)(null),[c,u]=(0,p.useState)(null),[h,g]=(0,p.useState)("preview"),[f,B]=(0,p.useState)(!1),[w,v]=(0,p.useState)(!1),[x,b]=(0,p.useState)(e.lastSavedAt??null),[C,F]=(0,p.useState)(null),[U,E]=(0,p.useState)(()=>!1),k=(0,p.useRef)(null),j=(0,p.useRef)(null),I=(0,p.useRef)(!1),[H,S]=(0,p.useState)(null),[N,L]=(0,p.useState)(lv.s.getDefaultModel()),[D,T]=(0,p.useState)(!1),[M,K]=(0,p.useState)(!1),[R,O]=(0,p.useState)(0),{state:V,start:G,setWorkspaceHandler:z}=l9(),q=V.currentStep?.id,W="running"===V.status&&"wrap-up"!==q,{shouldShowCosts:J}=function(){let[e,A]=(0,p.useState)(()=>lv.s.getCostSettings()),t=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:t}}(),[X,_]=(0,p.useState)(!0),[Y,$]=(0,p.useState)(!0),[Z,ee]=(0,p.useState)(!1),[eA,et]=(0,p.useState)(!0),[er,en]=(0,p.useState)(!1),[ea,es]=(0,p.useState)([]),ei=(0,p.useRef)(0),eo=(0,p.useRef)(null),el=(0,p.useCallback)(A=>{eo.current&&clearTimeout(eo.current),eo.current=setTimeout(()=>{u1.saveEvents(e.id,A).catch(e=>{y.v.error("Failed to persist debug events:",e)})},500)},[e.id]),ec=(0,p.useCallback)(async(e,A)=>{es(t=>{let r;if(("assistant_delta"===e||"tool_param_delta"===e)&&t.length>0){let n=t[t.length-1];if(n.event===e){let e={...n,timestamp:Date.now(),version:(n.version||1)+1,count:(n.count||1)+1,data:{all:n.data.all?[...n.data.all,A]:[n.data,A]}};return el(r=[...t.slice(0,-1),e]),r}}return el(r=[...t,{id:`${Date.now()}-${ei.current++}`,timestamp:Date.now(),event:e,data:A,count:1,version:1}]),r})},[e.id,el]),eu=(0,p.useCallback)(async()=>{es([]),await u1.clearEvents(e.id),u(null)},[e.id]),ed=(()=>{let e=[X,Y,Z,eA,er].filter(Boolean).length;return 5===e?{chat:20,files:15,editor:25,preview:20,debug:20}:4===e?{chat:25,files:15,editor:35,preview:25,debug:0}:3===e?{chat:33,files:33,editor:33,preview:33,debug:0}:2===e?{chat:50,files:50,editor:50,preview:50,debug:0}:{chat:100,files:100,editor:100,preview:100,debug:0}})(),ep=e=>{if(!e)return"Select Model";let A=e.split("/");return A[A.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},eh=(0,p.useCallback)((e,A=1200)=>{if(!e)return"";if(e.length<=A)return e;let t=Math.max(0,Math.floor(.6*A)),r=Math.max(0,Math.floor(.3*A)),n=e.slice(0,t),a=r>0?e.slice(-r):"";return`${n} (...truncated...) ${a}`},[]),eg=(0,p.useCallback)(e=>{let A=Object.entries(e.attributes||{}).slice(0,6);if(0===A.length)return`<${e.tagName}>`;let t=A.map(([e,A])=>{let t=A.length>40?`${A.slice(0,37)}…`:A;return`${e}="${t}"`}).join(" ");return`<${e.tagName} ${t}>`},[]),ef=(0,p.useCallback)(e=>{let A=eg(e),t=eh(e.outerHTML,1200),r=e.domPath||"(unknown path)";return["Focus context:",`- Target: ${A}`,`- DOM path: ${r}`,"- HTML snippet:","```html",t,"```"].join("\n")},[eg,eh]),em=(0,p.useCallback)(e=>{if(!e){F(null),k.current=null;return}let A=`${e.domPath||""}::${e.tagName||""}::${e.outerHTML?e.outerHTML.length:0}`,t=Date.now();if(k.current&&k.current.signature===A&&t-k.current.timestamp<400)return;let r={...e,timestamp:t};F(r),A4.oR.info("Focus context set",{description:eg(r)}),k.current={signature:A,timestamp:t}},[eg]),eB=(0,p.useCallback)(()=>{et(!1)},[]);C&&eg(C);let ew=C?eh(C.outerHTML,240):"";ew?.trim(),C&&(Q.$,C.domPath&&C.domPath);let ev=(0,p.useCallback)(e=>{window.innerWidth<768?(g("editor"),setTimeout(()=>{uW(e)},0)):Z?uW(e):(ee(!0),setTimeout(()=>{uW(e)},0))},[Z]),ex=(0,p.useCallback)(()=>{r(e=>e+1),window.dispatchEvent(new CustomEvent("filesChanged"))},[]),ey=(0,p.useCallback)(async()=>{if(!w){v(!0);try{let A;if(j.current)try{let e=new Promise((e,A)=>{setTimeout(()=>A(Error("Screenshot capture timeout")),5e3)}),t=await Promise.race([j.current.captureScreenshot(),e]);t&&(A=t)}catch(e){y.v.warn("Failed to capture preview screenshot, continuing save:",e)}let t=await lf.$.save(e.id),r=await m.vfs.getProject(e.id);A&&(r.previewImage=A,r.previewUpdatedAt=new Date,await m.vfs.updateProject(r)),b(r.lastSavedAt??new Date(t.timestamp)),S(t.id),A4.oR.success("Project saved")}catch(e){y.v.error("Failed to save project",e),A4.oR.error("Failed to save project")}finally{v(!1)}}},[e.id,w]),eb=(0,p.useCallback)(async(A,t)=>{try{if(!await l5.Y.checkpointExists(A)){A4.oR.error("Checkpoint no longer exists - it may have been cleaned up"),y.v.warn(`[Workspace] Checkpoint ${A} no longer exists`);return}if(await lf.$.runWithSuppressedDirty(e.id,()=>l5.Y.restoreCheckpoint(A))){A4.oR.success(`Restored to: ${t||"checkpoint"}`),ex();let r=lf.$.getSavedCheckpointId(e.id);if(r&&r===A){lf.$.markClean(e.id);let A=await m.vfs.getProject(e.id);b(A.lastSavedAt??null)}else lf.$.markDirty(e.id)}else A4.oR.error("Failed to restore checkpoint")}catch(e){y.v.error("Error restoring checkpoint:",e),A4.oR.error("Failed to restore checkpoint")}},[ex,e.id]),eC=(0,p.useCallback)(async A=>{try{if(!await l5.Y.checkpointExists(A)){A4.oR.error("Checkpoint no longer exists - cannot retry"),y.v.warn(`[Workspace] Checkpoint ${A} no longer exists`);return}let t=null,r=ea.findIndex(e=>"checkpoint_created"===e.event&&e.data?.checkpointId===A);if(r>=0){for(let e=r-1;e>=0;e--)if("conversation_message"===ea[e].event&&ea[e].data?.message?.role==="user"){t=ea[e].data.message.content;break}}if(!t){A4.oR.error("Cannot find original user message to retry"),y.v.warn("[Workspace] No user message found before checkpoint");return}let n=-1;for(let e=r-1;e>=0;e--)if("conversation_message"===ea[e].event&&ea[e].data?.message?.role==="user"&&ea[e].data.message.content===t){n=e;break}if(-1===n){A4.oR.error("Cannot find user message event to truncate"),y.v.warn("[Workspace] User message event not found in debug events");return}if(!await lf.$.runWithSuppressedDirty(e.id,()=>l5.Y.restoreCheckpoint(A)))return void A4.oR.error("Failed to restore checkpoint");let s=lf.$.getSavedCheckpointId(e.id);if(s&&s===A){lf.$.markClean(e.id);let A=await m.vfs.getProject(e.id);b(A.lastSavedAt??null)}else lf.$.markDirty(e.id);let i=ea.slice(0,n+1);es(i),await u1.truncateEvents(e.id,i),u(null),A4.oR.success("Restored checkpoint and retrying..."),ex(),a(t),I.current=!0}catch(e){y.v.error("Error during retry:",e),A4.oR.error("Failed to retry")}},[ex,e.id,ea,a]),eQ=async()=>{if(W)return;let A=n.trim();if(!A)return void A4.oR.error("Please enter a prompt");let t=lv.s.getSelectedProvider(),r=(0,uZ.sO)(t),s=lv.s.getApiKey();if(r.apiKeyRequired&&!s)return void A4.oR.error(`Please set your ${r.name} API key in settings`);if(r.isLocal&&!lv.s.getProviderModel(t))return void A4.oR.error(`No model selected for ${r.name}. Please select a model in settings.`);let o=lv.s.getProviderModel(t)||lv.s.getDefaultModel();if(!o)return void A4.oR.error(`No model selected for ${U?"chat":"code"} mode. Please select a model in settings.`);i(!0);let d=C?`${ef(C)} -${A}`:A;try{let A=c;if(!A){A=new u$.t(e.id,"orchestrator",ec,{chatMode:U,model:o});let t=ea.filter(e=>"conversation_message"===e.event).map(e=>e.data.message);t.length>0&&(A.importConversation(t),y.v.debug(`[Workspace] Restored ${t.length} conversation messages from debug events`)),u(A)}l(A);let t=await A.execute(d);y.v.debug("[Workspace] Orchestrator result:",{success:t.success,summary:t.summary,totalCost:t.totalCost}),t.success?(ex(),A4.oR.success("Task completed")):A4.oR.error(t.summary||"Generation failed",{duration:5e3,position:"bottom-center"}),a(""),C&&F(null)}catch(A){y.v.error("Generation error:",A);let e=A instanceof Error?A.message:"Failed to generate";A4.oR.error(e,{duration:5e3,position:"bottom-center"})}finally{i(!1),l(null)}},eF=(0,p.useCallback)(()=>{o&&(o.stop(),A4.oR.info("Generation stopped"))},[o]),eU=[{id:"back",label:"Back to projects",icon:uJ.A,onClick:A,variant:"outline"}];eU.push({id:"save",label:w?"Saving…":f?"Save":"Saved",icon:uG,onClick:ey,variant:f?"default":"outline",disabled:!f||w}),H&&eU.push({id:"discard",label:"Discard Changes",icon:uX,onClick:()=>eb(H,"Last saved state"),variant:"outline",disabled:w||!f,dataTourId:"discard-changes-button"});let eE=(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[J&&(0,d.jsxs)("span",{className:"text-sm font-medium",children:["$",R.toFixed(3)]}),(0,d.jsx)(lt,{className:"h-4 w-4"})]})}),(0,d.jsx)(lw.hl,{className:"w-96",align:"end",children:(0,d.jsx)(l4,{})})]}),ek=(0,d.jsxs)("div",{className:"space-y-2",children:[J&&(0,d.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",R.toFixed(R>=10?2:3)]})}),(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,d.jsx)(lt,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,d.jsx)(lw.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,d.jsx)(l4,{})})]})]});return(0,d.jsxs)(cH,{children:[(0,d.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,d.jsx)(ld.j,{leftText:e.name,onLogoClick:A,actions:eU,mobileMenuContent:ek,desktopOnlyContent:eE,mobileVisibleActions:f?["save"]:[]}),(0,d.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,d.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${X?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:X?"var(--button-assistant-active)":void 0,color:X?"white":void 0},onClick:()=>_(!X),children:(0,d.jsx)(u_,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{side:"right",className:"border-0",style:{backgroundColor:"#ff6b35",color:"white"},arrowStyle:{backgroundColor:"#ff6b35",fill:"#ff6b35"},children:(0,d.jsx)("p",{children:"Chat"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${Y?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:Y?"var(--button-files-active)":void 0,color:Y?"white":void 0},onClick:()=>$(!Y),children:(0,d.jsx)(cO,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"File Explorer"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${Z?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:Z?"var(--button-editor-active)":void 0,color:Z?"white":void 0},onClick:()=>ee(!Z),children:(0,d.jsx)(uV,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"Code Editor"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 mx-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-preview-active)":void 0,color:eA?"white":void 0},onClick:()=>et(!eA),children:(0,d.jsx)(P.A,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"Preview"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${er?"bg-foreground shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{color:er?"var(--background)":void 0},onClick:()=>en(!er),children:(0,d.jsx)(uY,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{side:"right",className:"border-0 bg-foreground text-background",arrowStyle:{backgroundColor:"var(--foreground)",fill:"var(--foreground)"},children:(0,d.jsx)("p",{children:"Debug Events"})})]})]}),(0,d.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,d.jsxs)(d4,{direction:"horizontal",autoSaveId:"workspace-layout",children:[X&&(0,d.jsx)(de,{id:"chat",order:1,defaultSize:ed.chat,minSize:15,children:(0,d.jsx)(fz,{events:ea,onRestore:eb,onRetry:eC,prompt:n,setPrompt:a,generating:s,onGenerate:eQ,onStop:eF,focusContext:C,setFocusContext:F,focusPreviewSnippet:ew,chatMode:U,setChatMode:E,currentModel:N,setCurrentModel:L,getModelDisplayName:ep,isTourLockingInput:W,onClearChat:eu,onClose:()=>_(!1)})}),X&&(Y||Z||eA||er)&&(0,d.jsx)(d3,{withHandle:!0}),Y&&(0,d.jsx)(de,{id:"files",order:2,defaultSize:ed.files,minSize:14,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(un,{projectId:e.id,onFileSelect:ev,onClose:()=>$(!1)})})}),Y&&(Z||eA)&&(0,d.jsx)(d3,{withHandle:!0}),Z&&(0,d.jsx)(de,{id:"editor",order:3,defaultSize:ed.editor,minSize:20,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(uq,{projectId:e.id,onFilesChange:ex,onClose:()=>ee(!1)})})}),Z&&eA&&(0,d.jsx)(d3,{withHandle:!0}),eA&&(0,d.jsx)(de,{id:"preview",order:4,defaultSize:ed.preview,minSize:20,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(ow,{ref:j,projectId:e.id,refreshTrigger:t,onFocusSelection:em,hasFocusTarget:!!C,onClose:eB})})}),eA&&er&&(0,d.jsx)(d3,{withHandle:!0}),er&&(0,d.jsx)(de,{id:"debug",order:5,defaultSize:ed.debug,minSize:15,children:(0,d.jsx)(d6,{events:ea,onClear:eu,onClose:()=>en(!1)})})]})})]}),(0,d.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,d.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["chat"===h&&(0,d.jsx)(fz,{events:ea,onRestore:eb,onRetry:eC,prompt:n,setPrompt:a,generating:s,onGenerate:eQ,onStop:eF,focusContext:C,setFocusContext:F,focusPreviewSnippet:ew,chatMode:U,setChatMode:E,currentModel:N,setCurrentModel:L,getModelDisplayName:ep,isTourLockingInput:W,onClearChat:eu}),"files"===h&&(0,d.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,d.jsx)(un,{projectId:e.id,onFileSelect:ev,onClose:()=>$(!1)})}),"editor"===h&&(0,d.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,d.jsx)(uq,{projectId:e.id,onFilesChange:ex,onClose:()=>ee(!1)})}),"preview"===h&&(0,d.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,d.jsx)(ow,{ref:j,projectId:e.id,refreshTrigger:t,onFocusSelection:em,hasFocusTarget:!!C,onClose:eB})})]}),(0,d.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,d.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"chat"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"chat"===h?"var(--button-assistant-active)":void 0},onClick:()=>g("chat"),children:(0,d.jsx)(u_,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===h?"var(--button-files-active)":void 0},onClick:()=>g("files"),children:(0,d.jsx)(cO,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===h?"var(--button-editor-active)":void 0},onClick:()=>g("editor"),children:(0,d.jsx)(uV,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===h?"var(--button-preview-active)":void 0},onClick:()=>g("preview"),children:(0,d.jsx)(P.A,{className:"h-4 w-4"})})]})})]})]}),(0,d.jsx)(ce,{location:"workspace"}),(0,d.jsx)(ce,{location:"settings"})]})}function f$(){let[e,A]=(0,p.useState)(null),{state:t,setActiveProjectId:r}=l9();t.currentStep?.id,t.status;let n=(0,p.useMemo)(()=>e?(0,d.jsx)(fY,{project:e,onBack:()=>A(null)}):(0,d.jsx)(cM,{onProjectSelect:A}),[e]);return(0,d.jsxs)(d.Fragment,{children:[n,(0,d.jsx)(ce,{location:"global"})]})}function fZ(){return(0,d.jsx)(l8,{children:(0,d.jsx)(f$,{})})}},2501:(e,A,t)=>{"use strict";t.r(A),t.d(A,{GlobalError:()=>s.a,__next_app__:()=>u,pages:()=>c,routeModule:()=>d,tree:()=>l});var r=t(5239),n=t(8088),a=t(8170),s=t.n(a),i=t(893),o={};for(let e in i)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);t.d(A,o);let l=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,597)),"/Users/otto/Desktop/deepstudio/osw-studio-git/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(t.bind(t,8014)),"/Users/otto/Desktop/deepstudio/osw-studio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,7398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(t.t.bind(t,9999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(t.t.bind(t,5284,23)),"next/dist/client/components/unauthorized-error"]}],c=["/Users/otto/Desktop/deepstudio/osw-studio-git/app/page.tsx"],u={require:t,loadChunk:()=>Promise.resolve()},d=new r.AppPageRouteModule({definition:{kind:n.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:l}})},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4517:e=>{var A=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,o=/^\s+|\s+$/g;function l(e){return e?e.replace(o,""):""}e.exports=function(e,o){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];o=o||{};var c=1,u=1;function d(e){var A=e.match(t);A&&(c+=A.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function p(){var e={line:c,column:u};return function(A){return A.position=new h(e),m(r),A}}function h(e){this.start=e,this.end={line:c,column:u},this.source=o.source}h.prototype.content=e;var g=[];function f(A){var t=Error(o.source+":"+c+":"+u+": "+A);if(t.reason=A,t.filename=o.source,t.line=c,t.column=u,t.source=e,o.silent)g.push(t);else throw t}function m(A){var t=A.exec(e);if(t){var r=t[0];return d(r),e=e.slice(r.length),t}}function B(e){var A;for(e=e||[];A=w();)!1!==A&&e.push(A);return e}function w(){var A=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var t=2;""!=e.charAt(t)&&("*"!=e.charAt(t)||"/"!=e.charAt(t+1));)++t;if(t+=2,""===e.charAt(t-1))return f("End of comment missing");var r=e.slice(2,t-2);return u+=2,d(r),e=e.slice(t),u+=2,A({type:"comment",comment:r})}}m(r);var v,x=[];for(B(x);v=function(){var e=p(),t=m(n);if(t){if(w(),!m(a))return f("property missing ':'");var r=m(s),o=e({type:"declaration",property:l(t[0].replace(A,"")),value:r?l(r[0].replace(A,"")):""});return m(i),o}}();)!1!==v&&(x.push(v),B(x));return x}},4735:e=>{"use strict";e.exports=require("events")},5511:e=>{"use strict";e.exports=require("crypto")},5840:function(e,A,t){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0}),A.default=function(e,A){var t=null;if(!e||"string"!=typeof e)return t;var r=(0,n.default)(e),a="function"==typeof A;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,n=e.value;a?A(r,n,e):n&&((t=t||{})[r]=n)}}),t};var n=r(t(4517))},6291:(e,A,t)=>{Promise.resolve().then(t.bind(t,597))},6539:(e,A,t)=>{Promise.resolve().then(t.bind(t,1553))},6908:(e,A)=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(e,A){return A.toUpperCase()},o=function(e,A){return"".concat(A,"-")};A.camelCase=function(e,A){var l;return(void 0===A&&(A={}),!(l=e)||n.test(l)||t.test(l))?e:(e=e.toLowerCase(),(e=A.reactCompat?e.replace(s,o):e.replace(a,o)).replace(r,i))}},7910:e=>{"use strict";e.exports=require("stream")},8354:e=>{"use strict";e.exports=require("util")},8739:function(e,A,t){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(t(5840)),n=t(6908);function a(e,A){var t={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(t[(0,n.camelCase)(e,A)]=r)}),t}a.default=a,e.exports=a},9021:e=>{"use strict";e.exports=require("fs")},9121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9428:e=>{"use strict";e.exports=require("buffer")},9566:e=>{"use strict";var A=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},s=function(e){if(!e||"[object Object]"!==t.call(e))return!1;var r,n=A.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&A.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(r in e);return void 0===r||A.call(e,r)},i=function(e,A){r&&"__proto__"===A.name?r(e,A.name,{enumerable:!0,configurable:!0,value:A.newValue,writable:!0}):e[A.name]=A.newValue},o=function(e,t){if("__proto__"===t){if(!A.call(e,t))return;else if(n)return n(e,t).value}return e[t]};e.exports=function e(){var A,t,r,n,l,c,u=arguments[0],d=1,p=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});dA(A.s=e),r=A.X(0,[447,55,988,735],()=>t(2501));module.exports=r})(); \ No newline at end of file +${A}`:A;try{let A=c;if(!A){A=new u$.t(e.id,"orchestrator",ec,{chatMode:U,model:o});let t=ea.filter(e=>"conversation_message"===e.event).map(e=>e.data.message);t.length>0&&(A.importConversation(t),y.v.debug(`[Workspace] Restored ${t.length} conversation messages from debug events`)),u(A)}l(A);let t=await A.execute(d);y.v.debug("[Workspace] Orchestrator result:",{success:t.success,summary:t.summary,totalCost:t.totalCost}),t.success?(ex(),A4.oR.success("Task completed")):A4.oR.error(t.summary||"Generation failed",{duration:5e3,position:"bottom-center"}),a(""),C&&F(null)}catch(A){y.v.error("Generation error:",A);let e=A instanceof Error?A.message:"Failed to generate";A4.oR.error(e,{duration:5e3,position:"bottom-center"})}finally{i(!1),l(null)}},eF=(0,p.useCallback)(()=>{o&&(o.stop(),A4.oR.info("Generation stopped"))},[o]),eU=[{id:"back",label:"Back to projects",icon:uJ.A,onClick:A,variant:"outline"}];eU.push({id:"save",label:w?"Saving…":f?"Save":"Saved",icon:uG,onClick:ey,variant:f?"default":"outline",disabled:!f||w}),H&&eU.push({id:"discard",label:"Discard Changes",icon:uX,onClick:()=>eb(H,"Last saved state"),variant:"outline",disabled:w||!f,dataTourId:"discard-changes-button"});let eE=(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[J&&(0,d.jsxs)("span",{className:"text-sm font-medium",children:["$",R.toFixed(3)]}),(0,d.jsx)(lt,{className:"h-4 w-4"})]})}),(0,d.jsx)(lw.hl,{className:"w-96",align:"end",children:(0,d.jsx)(l4,{})})]}),ek=(0,d.jsxs)("div",{className:"space-y-2",children:[J&&(0,d.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",R.toFixed(R>=10?2:3)]})}),(0,d.jsxs)(lw.AM,{children:[(0,d.jsx)(lw.Wv,{asChild:!0,children:(0,d.jsxs)(Q.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,d.jsx)(lt,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,d.jsx)(lw.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,d.jsx)(l4,{})})]})]});return(0,d.jsxs)(cH,{children:[(0,d.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,d.jsx)(ld.j,{leftText:e.name,onLogoClick:A,actions:eU,mobileMenuContent:ek,desktopOnlyContent:eE,mobileVisibleActions:f?["save"]:[]}),(0,d.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,d.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${X?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:X?"var(--button-assistant-active)":void 0,color:X?"white":void 0},onClick:()=>_(!X),children:(0,d.jsx)(u_,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{side:"right",className:"border-0",style:{backgroundColor:"#ff6b35",color:"white"},arrowStyle:{backgroundColor:"#ff6b35",fill:"#ff6b35"},children:(0,d.jsx)("p",{children:"Chat"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${Y?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:Y?"var(--button-files-active)":void 0,color:Y?"white":void 0},onClick:()=>$(!Y),children:(0,d.jsx)(cO,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"File Explorer"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${Z?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:Z?"var(--button-editor-active)":void 0,color:Z?"white":void 0},onClick:()=>ee(!Z),children:(0,d.jsx)(uV,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"Code Editor"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 mx-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-preview-active)":void 0,color:eA?"white":void 0},onClick:()=>et(!eA),children:(0,d.jsx)(P.A,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{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,d.jsx)("p",{children:"Preview"})})]}),(0,d.jsxs)(cS,{children:[(0,d.jsx)(cN,{asChild:!0,children:(0,d.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${er?"bg-foreground shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{color:er?"var(--background)":void 0},onClick:()=>en(!er),children:(0,d.jsx)(uY,{className:"h-3.5 w-3.5"})})}),(0,d.jsx)(cL,{side:"right",className:"border-0 bg-foreground text-background",arrowStyle:{backgroundColor:"var(--foreground)",fill:"var(--foreground)"},children:(0,d.jsx)("p",{children:"Debug Events"})})]})]}),(0,d.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,d.jsxs)(d4,{direction:"horizontal",autoSaveId:"workspace-layout",children:[X&&(0,d.jsx)(de,{id:"chat",order:1,defaultSize:ed.chat,minSize:15,children:(0,d.jsx)(fz,{events:ea,onRestore:eb,onRetry:eC,prompt:n,setPrompt:a,generating:s,onGenerate:eQ,onStop:eF,focusContext:C,setFocusContext:F,focusPreviewSnippet:ew,chatMode:U,setChatMode:E,currentModel:N,setCurrentModel:L,getModelDisplayName:ep,isTourLockingInput:W,onClearChat:eu,onClose:()=>_(!1)})}),X&&(Y||Z||eA||er)&&(0,d.jsx)(d3,{withHandle:!0}),Y&&(0,d.jsx)(de,{id:"files",order:2,defaultSize:ed.files,minSize:14,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(un,{projectId:e.id,onFileSelect:ev,onClose:()=>$(!1)})})}),Y&&(Z||eA)&&(0,d.jsx)(d3,{withHandle:!0}),Z&&(0,d.jsx)(de,{id:"editor",order:3,defaultSize:ed.editor,minSize:20,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(uq,{projectId:e.id,onFilesChange:ex,onClose:()=>ee(!1)})})}),Z&&eA&&(0,d.jsx)(d3,{withHandle:!0}),eA&&(0,d.jsx)(de,{id:"preview",order:4,defaultSize:ed.preview,minSize:20,children:(0,d.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)",minWidth:"240px"},children:(0,d.jsx)(ow,{ref:j,projectId:e.id,refreshTrigger:t,onFocusSelection:em,hasFocusTarget:!!C,onClose:eB})})}),eA&&er&&(0,d.jsx)(d3,{withHandle:!0}),er&&(0,d.jsx)(de,{id:"debug",order:5,defaultSize:ed.debug,minSize:15,children:(0,d.jsx)(d6,{events:ea,onClear:eu,onClose:()=>en(!1)})})]})})]}),(0,d.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,d.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["chat"===h&&(0,d.jsx)(fz,{events:ea,onRestore:eb,onRetry:eC,prompt:n,setPrompt:a,generating:s,onGenerate:eQ,onStop:eF,focusContext:C,setFocusContext:F,focusPreviewSnippet:ew,chatMode:U,setChatMode:E,currentModel:N,setCurrentModel:L,getModelDisplayName:ep,isTourLockingInput:W,onClearChat:eu}),"files"===h&&(0,d.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,d.jsx)(un,{projectId:e.id,onFileSelect:ev,onClose:()=>$(!1)})}),"editor"===h&&(0,d.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,d.jsx)(uq,{projectId:e.id,onFilesChange:ex,onClose:()=>ee(!1)})}),"preview"===h&&(0,d.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,d.jsx)(ow,{ref:j,projectId:e.id,refreshTrigger:t,onFocusSelection:em,hasFocusTarget:!!C,onClose:eB})})]}),(0,d.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,d.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"chat"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"chat"===h?"var(--button-assistant-active)":void 0},onClick:()=>g("chat"),children:(0,d.jsx)(u_,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===h?"var(--button-files-active)":void 0},onClick:()=>g("files"),children:(0,d.jsx)(cO,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===h?"var(--button-editor-active)":void 0},onClick:()=>g("editor"),children:(0,d.jsx)(uV,{className:"h-4 w-4"})}),(0,d.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===h?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===h?"var(--button-preview-active)":void 0},onClick:()=>g("preview"),children:(0,d.jsx)(P.A,{className:"h-4 w-4"})})]})})]})]}),(0,d.jsx)(ce,{location:"workspace"}),(0,d.jsx)(ce,{location:"settings"})]})}function f$(){let[e,A]=(0,p.useState)(null),{state:t,setActiveProjectId:r}=l9();t.currentStep?.id,t.status;let n=(0,p.useMemo)(()=>e?(0,d.jsx)(fY,{project:e,onBack:()=>A(null)}):(0,d.jsx)(cM,{onProjectSelect:A}),[e]);return(0,d.jsxs)(d.Fragment,{children:[n,(0,d.jsx)(ce,{location:"global"})]})}function fZ(){return(0,d.jsx)(l8,{children:(0,d.jsx)(f$,{})})}},7910:e=>{"use strict";e.exports=require("stream")},8354:e=>{"use strict";e.exports=require("util")},8739:function(e,A,t){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(t(5840)),n=t(6908);function a(e,A){var t={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(t[(0,n.camelCase)(e,A)]=r)}),t}a.default=a,e.exports=a},9021:e=>{"use strict";e.exports=require("fs")},9121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9428:e=>{"use strict";e.exports=require("buffer")},9566:e=>{"use strict";var A=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},s=function(e){if(!e||"[object Object]"!==t.call(e))return!1;var r,n=A.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&A.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(r in e);return void 0===r||A.call(e,r)},i=function(e,A){r&&"__proto__"===A.name?r(e,A.name,{enumerable:!0,configurable:!0,value:A.newValue,writable:!0}):e[A.name]=A.newValue},o=function(e,t){if("__proto__"===t){if(!A.call(e,t))return;else if(n)return n(e,t).value}return e[t]};e.exports=function e(){var A,t,r,n,l,c,u=arguments[0],d=1,p=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});dA(A.s=e),r=A.X(0,[447,55,988,531],()=>t(2501));module.exports=r})(); \ No newline at end of file