@vue-skuilder/cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/studio.d.ts +3 -0
- package/dist/commands/studio.d.ts.map +1 -0
- package/dist/commands/studio.js +396 -0
- package/dist/commands/studio.js.map +1 -0
- package/dist/commands/unpack.d.ts +3 -0
- package/dist/commands/unpack.d.ts.map +1 -0
- package/dist/commands/unpack.js +228 -0
- package/dist/commands/unpack.js.map +1 -0
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js +2 -0
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js.map +1 -0
- package/dist/studio-ui-assets/assets/BrowseView-CM4HBO4j.css +1 -0
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js +2 -0
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js.map +1 -0
- package/dist/studio-ui-assets/assets/BulkImportView-g4wQUfPA.css +1 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js +2 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js.map +1 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-WuPNLVKp.css +1 -0
- package/dist/studio-ui-assets/assets/CreateCardView-CyNOKCkm.css +1 -0
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js +2 -0
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js.map +1 -0
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js +330 -0
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js.map +1 -0
- package/dist/studio-ui-assets/assets/index--zY88pg6.css +14 -0
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js +287 -0
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js.map +1 -0
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js +192 -0
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js.map +1 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-B7mPwVP_.ttf +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-CSr8KVlo.eot +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-PXm3-2wK.woff +0 -0
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js +28 -0
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js.map +1 -0
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js +6 -0
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js.map +1 -0
- package/dist/studio-ui-assets/index.html +16 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts +14 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts.map +1 -0
- package/dist/utils/NodeFileSystemAdapter.js +55 -0
- package/dist/utils/NodeFileSystemAdapter.js.map +1 -0
- package/dist/utils/template.d.ts +1 -1
- package/dist/utils/template.d.ts.map +1 -1
- package/dist/utils/template.js +19 -5
- package/dist/utils/template.js.map +1 -1
- package/package.json +7 -4
- package/src/cli.ts +8 -0
- package/src/commands/studio.ts +497 -0
- package/src/commands/unpack.ts +259 -0
- package/src/utils/NodeFileSystemAdapter.ts +72 -0
- package/src/utils/template.ts +26 -7
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import PouchDB from 'pouchdb';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { StaticToCouchDBMigrator, validateStaticCourse, CourseLookup, ENV } from '@vue-skuilder/db';
|
|
6
|
+
import { NodeFileSystemAdapter } from '../utils/NodeFileSystemAdapter.js';
|
|
7
|
+
export function createUnpackCommand() {
|
|
8
|
+
return new Command('unpack')
|
|
9
|
+
.description('Unpack a static course directory into CouchDB')
|
|
10
|
+
.argument('<coursePath>', 'Path to static course directory')
|
|
11
|
+
.option('-s, --server <url>', 'CouchDB server URL', 'http://localhost:5984')
|
|
12
|
+
.option('-u, --username <username>', 'CouchDB username')
|
|
13
|
+
.option('-p, --password <password>', 'CouchDB password')
|
|
14
|
+
.option('-d, --database <name>', 'Target database name (auto-generated if not provided)')
|
|
15
|
+
.option('--as <name>', 'Set a custom name for the unpacked course')
|
|
16
|
+
.option('--chunk-size <size>', 'Documents per batch', '100')
|
|
17
|
+
.option('--validate', 'Run migration validation')
|
|
18
|
+
.option('--cleanup-on-error', 'Clean up database if migration fails')
|
|
19
|
+
.action(unpackCourse);
|
|
20
|
+
}
|
|
21
|
+
async function unpackCourse(coursePath, options) {
|
|
22
|
+
// Store original ENV values for cleanup
|
|
23
|
+
const originalEnv = {
|
|
24
|
+
COUCHDB_SERVER_PROTOCOL: ENV.COUCHDB_SERVER_PROTOCOL,
|
|
25
|
+
COUCHDB_SERVER_URL: ENV.COUCHDB_SERVER_URL,
|
|
26
|
+
COUCHDB_USERNAME: ENV.COUCHDB_USERNAME,
|
|
27
|
+
COUCHDB_PASSWORD: ENV.COUCHDB_PASSWORD,
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
console.log(chalk.cyan(`🔧 Unpacking static course to CouchDB...`));
|
|
31
|
+
console.log(chalk.gray(`📁 Source: ${path.resolve(coursePath)}`));
|
|
32
|
+
// Create file system adapter
|
|
33
|
+
const fileSystemAdapter = new NodeFileSystemAdapter();
|
|
34
|
+
// Validate static course directory
|
|
35
|
+
console.log(chalk.cyan('🔍 Validating static course...'));
|
|
36
|
+
const validation = await validateStaticCourse(coursePath, fileSystemAdapter);
|
|
37
|
+
if (!validation.valid) {
|
|
38
|
+
console.log(chalk.red('❌ Static course validation failed:'));
|
|
39
|
+
validation.errors.forEach((error) => {
|
|
40
|
+
console.log(chalk.red(` • ${error}`));
|
|
41
|
+
});
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
if (validation.warnings.length > 0) {
|
|
45
|
+
console.log(chalk.yellow('⚠️ Validation warnings:'));
|
|
46
|
+
validation.warnings.forEach((warning) => {
|
|
47
|
+
console.log(chalk.yellow(` • ${warning}`));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
console.log(chalk.green('✅ Static course validation passed'));
|
|
51
|
+
console.log(chalk.gray(`📋 Course: ${validation.courseName || 'Unknown'} (${validation.courseId || 'Unknown ID'})`));
|
|
52
|
+
// Generate studio course ID and database name if not provided
|
|
53
|
+
let targetDbName = options.database;
|
|
54
|
+
let studioCourseId;
|
|
55
|
+
if (!targetDbName) {
|
|
56
|
+
const timestamp = new Date().toISOString().slice(0, 10).replace(/-/g, '');
|
|
57
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
58
|
+
studioCourseId = `unpacked_${validation.courseId || 'unknown'}_${timestamp}_${random}`;
|
|
59
|
+
targetDbName = `coursedb-${studioCourseId}`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// If user provided custom database name, extract studio course ID from it
|
|
63
|
+
studioCourseId = targetDbName.startsWith('coursedb-')
|
|
64
|
+
? targetDbName.substring(9)
|
|
65
|
+
: targetDbName;
|
|
66
|
+
}
|
|
67
|
+
// Construct database URL
|
|
68
|
+
const dbUrl = `${options.server}/${targetDbName}`;
|
|
69
|
+
console.log(chalk.gray(`📡 Target: ${dbUrl}`));
|
|
70
|
+
// Setup database connection options
|
|
71
|
+
const dbOptions = {};
|
|
72
|
+
if (options.username && options.password) {
|
|
73
|
+
dbOptions.auth = {
|
|
74
|
+
username: options.username,
|
|
75
|
+
password: options.password,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// Create and connect to target database
|
|
79
|
+
console.log(chalk.cyan('🔄 Creating target database...'));
|
|
80
|
+
const targetDB = new PouchDB(dbUrl, dbOptions);
|
|
81
|
+
// Test connection by trying to get database info
|
|
82
|
+
try {
|
|
83
|
+
await targetDB.info();
|
|
84
|
+
console.log(chalk.green('✅ Connected to target database'));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
let errorMessage = 'Unknown error';
|
|
88
|
+
if (error instanceof Error) {
|
|
89
|
+
errorMessage = error.message;
|
|
90
|
+
}
|
|
91
|
+
else if (typeof error === 'string') {
|
|
92
|
+
errorMessage = error;
|
|
93
|
+
}
|
|
94
|
+
else if (error && typeof error === 'object' && 'message' in error) {
|
|
95
|
+
errorMessage = String(error.message);
|
|
96
|
+
}
|
|
97
|
+
throw new Error(`Failed to connect to target database: ${errorMessage}`);
|
|
98
|
+
}
|
|
99
|
+
// Setup ENV variables for CourseLookup (temporarily override for this operation)
|
|
100
|
+
try {
|
|
101
|
+
// Parse server URL to extract protocol and host
|
|
102
|
+
const serverUrl = new URL(options.server);
|
|
103
|
+
ENV.COUCHDB_SERVER_PROTOCOL = serverUrl.protocol.slice(0, -1); // Remove trailing ':'
|
|
104
|
+
ENV.COUCHDB_SERVER_URL = serverUrl.host;
|
|
105
|
+
if (options.username)
|
|
106
|
+
ENV.COUCHDB_USERNAME = options.username;
|
|
107
|
+
if (options.password)
|
|
108
|
+
ENV.COUCHDB_PASSWORD = options.password;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
throw new Error(`Invalid server URL: ${options.server}`);
|
|
112
|
+
}
|
|
113
|
+
// Configure migrator
|
|
114
|
+
const migratorOptions = {
|
|
115
|
+
chunkBatchSize: parseInt(options.chunkSize),
|
|
116
|
+
validateRoundTrip: options.validate,
|
|
117
|
+
cleanupOnFailure: options.cleanupOnError,
|
|
118
|
+
};
|
|
119
|
+
console.log(chalk.gray(`📦 Batch size: ${migratorOptions.chunkBatchSize} documents`));
|
|
120
|
+
console.log(chalk.gray(`🔍 Validation enabled: ${migratorOptions.validateRoundTrip}`));
|
|
121
|
+
// Setup progress reporting
|
|
122
|
+
const migrator = new StaticToCouchDBMigrator(migratorOptions, fileSystemAdapter);
|
|
123
|
+
migrator.setProgressCallback((progress) => {
|
|
124
|
+
const percentage = progress.total > 0 ? Math.round((progress.current / progress.total) * 100) : 0;
|
|
125
|
+
console.log(chalk.cyan(`🔄 ${progress.phase}: ${progress.message} (${progress.current}/${progress.total} - ${percentage}%)`));
|
|
126
|
+
});
|
|
127
|
+
// Perform migration
|
|
128
|
+
console.log(chalk.cyan('🚀 Starting migration...'));
|
|
129
|
+
const result = await migrator.migrateCourse(coursePath, targetDB);
|
|
130
|
+
if (!result.success) {
|
|
131
|
+
console.log(chalk.red('\n❌ Migration failed:'));
|
|
132
|
+
result.errors.forEach((error) => {
|
|
133
|
+
console.log(chalk.red(` • ${error}`));
|
|
134
|
+
});
|
|
135
|
+
if (result.warnings.length > 0) {
|
|
136
|
+
console.log(chalk.yellow('\n⚠️ Warnings:'));
|
|
137
|
+
result.warnings.forEach((warning) => {
|
|
138
|
+
console.log(chalk.yellow(` • ${warning}`));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
const courseName = options.as || validation.courseName || 'Unknown Course';
|
|
144
|
+
// Update CourseConfig with new name if provided
|
|
145
|
+
if (options.as) {
|
|
146
|
+
try {
|
|
147
|
+
console.log(chalk.cyan(`🔄 Updating course name to "${courseName}"...`));
|
|
148
|
+
const courseConfig = await targetDB.get('CourseConfig');
|
|
149
|
+
courseConfig.name = courseName;
|
|
150
|
+
await targetDB.put(courseConfig);
|
|
151
|
+
console.log(chalk.green('✅ Course name updated.'));
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.log(chalk.yellow('⚠️ Warning: Failed to update course name in CourseConfig.'));
|
|
155
|
+
console.log(chalk.yellow(` ${error instanceof Error ? error.message : String(error)}`));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Success! Register course in lookup and display results
|
|
159
|
+
console.log(chalk.green('\n✅ Successfully unpacked course!'));
|
|
160
|
+
try {
|
|
161
|
+
console.log(chalk.cyan('🔄 Registering course in course lookup...'));
|
|
162
|
+
await CourseLookup.addWithId(studioCourseId, courseName);
|
|
163
|
+
console.log(chalk.green('✅ Course registered in course lookup'));
|
|
164
|
+
}
|
|
165
|
+
catch (lookupError) {
|
|
166
|
+
console.log(chalk.yellow('⚠️ Warning: Failed to register course in lookup database'));
|
|
167
|
+
console.log(chalk.yellow(` ${lookupError instanceof Error ? lookupError.message : String(lookupError)}`));
|
|
168
|
+
console.log(chalk.yellow(' The unpacked course data is still available, but may not appear in the course browser.'));
|
|
169
|
+
}
|
|
170
|
+
console.log('');
|
|
171
|
+
console.log(chalk.white(`📊 Course: ${courseName}`));
|
|
172
|
+
console.log(chalk.white(`📄 Documents: ${result.documentsRestored}`));
|
|
173
|
+
console.log(chalk.white(`🗃️ Design Docs: ${result.designDocsRestored}`));
|
|
174
|
+
console.log(chalk.white(`📎 Attachments: ${result.attachmentsRestored}`));
|
|
175
|
+
console.log(chalk.white(`⏱️ Migration Time: ${(result.migrationTime / 1000).toFixed(1)}s`));
|
|
176
|
+
console.log(chalk.white(`📡 Database: ${targetDbName}`));
|
|
177
|
+
if (result.warnings.length > 0) {
|
|
178
|
+
console.log(chalk.yellow('\n⚠️ Migration warnings:'));
|
|
179
|
+
result.warnings.forEach((warning) => {
|
|
180
|
+
console.log(chalk.yellow(` • ${warning}`));
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Display next steps
|
|
184
|
+
console.log('');
|
|
185
|
+
console.log(chalk.cyan('📝 Next steps:'));
|
|
186
|
+
console.log(chalk.gray(' • Test the migrated course data in your application'));
|
|
187
|
+
console.log(chalk.gray(' • Verify document counts and content manually if needed'));
|
|
188
|
+
console.log(chalk.gray(` • Use database: ${targetDbName}`));
|
|
189
|
+
if (!options.validate) {
|
|
190
|
+
console.log(chalk.gray(' • Consider running with --validate flag for comprehensive verification'));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
console.error(chalk.red('\n❌ Unpacking failed:'));
|
|
195
|
+
let errorMessage = 'Unknown error';
|
|
196
|
+
if (error instanceof Error) {
|
|
197
|
+
errorMessage = error.message;
|
|
198
|
+
// Show stack trace in development/debug mode
|
|
199
|
+
if (process.env.DEBUG || process.env.NODE_ENV === 'development') {
|
|
200
|
+
console.error(chalk.gray('\nStack trace:'));
|
|
201
|
+
console.error(chalk.gray(error.stack || 'No stack trace available'));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else if (typeof error === 'string') {
|
|
205
|
+
errorMessage = error;
|
|
206
|
+
}
|
|
207
|
+
else if (error && typeof error === 'object' && 'message' in error) {
|
|
208
|
+
errorMessage = String(error.message);
|
|
209
|
+
}
|
|
210
|
+
console.error(chalk.red(errorMessage));
|
|
211
|
+
console.error('');
|
|
212
|
+
console.error(chalk.yellow('💡 Troubleshooting tips:'));
|
|
213
|
+
console.error(chalk.gray(' • Verify the static course directory path is correct'));
|
|
214
|
+
console.error(chalk.gray(' • Ensure CouchDB is running and accessible'));
|
|
215
|
+
console.error(chalk.gray(' • Check that manifest.json and chunks/ directory exist'));
|
|
216
|
+
console.error(chalk.gray(' • Verify database permissions if using authentication'));
|
|
217
|
+
console.error(chalk.gray(' • Use --validate flag for detailed error information'));
|
|
218
|
+
process.exit(1);
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
// Restore original ENV values
|
|
222
|
+
ENV.COUCHDB_SERVER_PROTOCOL = originalEnv.COUCHDB_SERVER_PROTOCOL;
|
|
223
|
+
ENV.COUCHDB_SERVER_URL = originalEnv.COUCHDB_SERVER_URL;
|
|
224
|
+
ENV.COUCHDB_USERNAME = originalEnv.COUCHDB_USERNAME;
|
|
225
|
+
ENV.COUCHDB_PASSWORD = originalEnv.COUCHDB_PASSWORD;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=unpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpack.js","sourceRoot":"","sources":["../../src/commands/unpack.ts"],"names":[],"mappings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C,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC,CAAC;QACpF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC,CAAC;QACtF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC,CAAC;QACrF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC,CAAC;QAEpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,8BAA8B;QAC9B,GAAG,CAAC,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC;QAClE,GAAG,CAAC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC;QACxD,GAAG,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;QACpD,GAAG,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g as _,a as w,C as g,_ as k}from"./index-DHMXQY3-.js";import{a as C}from"./index-BnAv1C72.js";import{h as x,d as u,x as y,X as m,ai as s,aj as r,m as a,ak as t,ao as d,Q as c,V as B,u as v}from"./vue-DZcMATiC.js";import"./vuetify-qg7mRxy_.js";const V={class:"browse-view"},E={key:0,class:"text-center pa-4"},N={key:1,class:"text-center pa-4"},b={key:2},z={key:3,class:"text-center pa-4"},I=x({__name:"BrowseView",setup(L){const n=u(!0),i=u(null),l=u(null);return y(async()=>{try{const o=_();if(!o)throw new Error(w());l.value=o.database.name,n.value=!1}catch(o){console.error("Browse view initialization error:",o),i.value=o instanceof Error?o.message:"Unknown error",n.value=!1}}),(o,e)=>{const f=m("v-progress-circular"),p=m("v-icon");return r(),s("div",V,[n.value?(r(),s("div",E,[a(f,{indeterminate:""}),e[0]||(e[0]=t("p",{class:"mt-2"},"Loading course...",-1))])):i.value?(r(),s("div",N,[a(p,{color:"error",size:"48"},{default:d(()=>e[1]||(e[1]=[c("mdi-alert-circle")])),_:1}),e[2]||(e[2]=t("h2",{class:"mt-2"},"Browse Error",-1)),t("p",null,B(i.value),1)])):l.value?(r(),s("div",b,[a(v(g),{"course-id":l.value,"view-lookup-function":v(C).getView,"edit-mode":"full"},{actions:d(()=>e[3]||(e[3]=[c(" ")])),_:1},8,["course-id","view-lookup-function"])])):(r(),s("div",z,[a(p,{size:"48"},{default:d(()=>e[4]||(e[4]=[c("mdi-school")])),_:1}),e[5]||(e[5]=t("h2",{class:"mt-2"},"No Course Loaded",-1)),e[6]||(e[6]=t("p",null,"Please load a course to start browsing.",-1))]))])}}}),P=k(I,[["__scopeId","data-v-2c3c618e"]]);export{P as default};
|
|
2
|
+
//# sourceMappingURL=BrowseView-BJbixGOU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseView-BJbixGOU.js","sources":["../../src/views/BrowseView.vue"],"sourcesContent":["<template>\n <div class=\"browse-view\">\n <div v-if=\"loading\" class=\"text-center pa-4\">\n <v-progress-circular indeterminate />\n <p class=\"mt-2\">Loading course...</p>\n </div>\n\n <div v-else-if=\"error\" class=\"text-center pa-4\">\n <v-icon color=\"error\" size=\"48\">mdi-alert-circle</v-icon>\n <h2 class=\"mt-2\">Browse Error</h2>\n <p>{{ error }}</p>\n </div>\n\n <div v-else-if=\"courseId\">\n <course-information :course-id=\"courseId\" :view-lookup-function=\"allCourses.getView\" :edit-mode=\"'full'\">\n <template #actions> </template>\n </course-information>\n </div>\n\n <div v-else class=\"text-center pa-4\">\n <v-icon size=\"48\">mdi-school</v-icon>\n <h2 class=\"mt-2\">No Course Loaded</h2>\n <p>Please load a course to start browsing.</p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted } from 'vue';\nimport { CourseInformation } from '@vue-skuilder/common-ui';\nimport { allCourses } from '@vue-skuilder/courses';\nimport { getStudioConfig, getConfigErrorMessage } from '../config/development';\n\n// Browse view state\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst courseId = ref<string | null>(null);\n\n// Initialize browse view\nonMounted(async () => {\n try {\n // Get studio configuration (CLI-injected or environment variables)\n const studioConfig = getStudioConfig();\n\n if (!studioConfig) {\n throw new Error(getConfigErrorMessage());\n }\n\n courseId.value = studioConfig.database.name;\n loading.value = false;\n } catch (err) {\n console.error('Browse view initialization error:', err);\n error.value = err instanceof Error ? err.message : 'Unknown error';\n loading.value = false;\n }\n});\n</script>\n\n<style scoped>\n.browse-view {\n height: 100%;\n}\n\n.studio-header {\n padding: 16px 0;\n}\n\n.studio-header h1 {\n color: rgb(var(--v-theme-primary));\n font-weight: 500;\n}\n\n.studio-header p {\n color: rgb(var(--v-theme-on-surface-variant));\n margin: 0;\n}\n</style>\n"],"names":["loading","ref","error","courseId","onMounted","studioConfig","getStudioConfig","getConfigErrorMessage","err"],"mappings":"6aAkCM,MAAAA,EAAUC,EAAI,EAAI,EAClBC,EAAQD,EAAmB,IAAI,EAC/BE,EAAWF,EAAmB,IAAI,EAGxC,OAAAG,EAAU,SAAY,CAChB,GAAA,CAEF,MAAMC,EAAeC,EAAgB,EAErC,GAAI,CAACD,EACG,MAAA,IAAI,MAAME,GAAuB,EAGhCJ,EAAA,MAAQE,EAAa,SAAS,KACvCL,EAAQ,MAAQ,SACTQ,EAAK,CACJ,QAAA,MAAM,oCAAqCA,CAAG,EACtDN,EAAM,MAAQM,aAAe,MAAQA,EAAI,QAAU,gBACnDR,EAAQ,MAAQ,EAAA,CAClB,CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.browse-view[data-v-2c3c618e]{height:100%}.studio-header[data-v-2c3c618e]{padding:16px 0}.studio-header h1[data-v-2c3c618e]{color:rgb(var(--v-theme-primary));font-weight:500}.studio-header p[data-v-2c3c618e]{color:rgb(var(--v-theme-on-surface-variant));margin:0}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{B as x}from"./edit-ui.es-DiUxqbgF.js";import{a as B}from"./index-BnAv1C72.js";import{g as y,a as I,b as V,_ as b}from"./index-DHMXQY3-.js";import{h as D,d as i,x as E,X as r,ai as s,aj as a,m as t,ao as n,Q as m,ak as _,V as L,u as v}from"./vue-DZcMATiC.js";import"./vuetify-qg7mRxy_.js";const N={class:"bulk-import-view"},z={key:0,class:"text-center pa-4"},M={key:1,class:"text-center pa-4"},S={class:"mt-2 text-error"},h={key:2},j={key:3},Q=D({__name:"BulkImportView",setup(T){const c=i(!0),u=i(null),d=i(null),p=i(null);E(async()=>{try{const o=y();if(!o)throw new Error(I());d.value=o.database.name;const l=V().getCourseDB(d.value);p.value=await l.getCourseConfig(),c.value=!1}catch(o){console.error("Bulk import initialization error:",o),u.value=o instanceof Error?o.message:"Unknown error",c.value=!1}});const f=o=>{console.log("Import completed:",o)};return(o,e)=>{const l=r("v-icon"),g=r("v-card-title"),k=r("v-progress-circular"),C=r("v-card-text"),w=r("v-card");return a(),s("div",N,[t(w,null,{default:n(()=>[t(g,null,{default:n(()=>[t(l,{left:""},{default:n(()=>e[0]||(e[0]=[m("mdi-file-import")])),_:1}),e[1]||(e[1]=m(" Bulk Import Cards "))]),_:1}),t(C,null,{default:n(()=>[c.value?(a(),s("div",z,[t(k,{indeterminate:""}),e[2]||(e[2]=_("p",{class:"mt-2"},"Loading bulk import tool...",-1))])):u.value?(a(),s("div",M,[t(l,{color:"error",size:"24"},{default:n(()=>e[3]||(e[3]=[m("mdi-alert-circle")])),_:1}),_("p",S,L(u.value),1)])):d.value&&p.value?(a(),s("div",h,[t(v(x),{"course-cfg":p.value,"view-lookup-function":v(B).getView,onImportCompleted:f},null,8,["course-cfg","view-lookup-function"])])):(a(),s("div",j,e[4]||(e[4]=[_("p",{class:"text-center"},"No course loaded",-1)])))]),_:1})]),_:1})])}}}),F=b(Q,[["__scopeId","data-v-ba3b5194"]]);export{F as default};
|
|
2
|
+
//# sourceMappingURL=BulkImportView-DB6DYDJU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulkImportView-DB6DYDJU.js","sources":["../../src/views/BulkImportView.vue"],"sourcesContent":["<template>\n <div class=\"bulk-import-view\">\n <v-card>\n <v-card-title>\n <v-icon left>mdi-file-import</v-icon>\n Bulk Import Cards\n </v-card-title>\n \n <v-card-text>\n <div v-if=\"loading\" class=\"text-center pa-4\">\n <v-progress-circular indeterminate />\n <p class=\"mt-2\">Loading bulk import tool...</p>\n </div>\n\n <div v-else-if=\"error\" class=\"text-center pa-4\">\n <v-icon color=\"error\" size=\"24\">mdi-alert-circle</v-icon>\n <p class=\"mt-2 text-error\">{{ error }}</p>\n </div>\n\n <div v-else-if=\"courseId && courseConfig\">\n <!-- Bulk Import View from edit-ui package -->\n <bulk-import-view \n :course-cfg=\"courseConfig\"\n :view-lookup-function=\"allCourses.getView\"\n @import-completed=\"onImportCompleted\"\n />\n </div>\n\n <div v-else>\n <p class=\"text-center\">No course loaded</p>\n </div>\n </v-card-text>\n </v-card>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted } from 'vue';\nimport { BulkImportView } from '@vue-skuilder/edit-ui';\nimport { allCourses } from '@vue-skuilder/courses';\nimport { getStudioConfig, getConfigErrorMessage } from '../config/development';\nimport { getDataLayer } from '@vue-skuilder/db';\nimport type { CourseConfig } from '@vue-skuilder/common';\n\n// Bulk import state\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst courseId = ref<string | null>(null);\nconst courseConfig = ref<CourseConfig | null>(null);\n\n// Initialize bulk import view\nonMounted(async () => {\n try {\n // Get studio configuration (CLI-injected or environment variables)\n const studioConfig = getStudioConfig();\n\n if (!studioConfig) {\n throw new Error(getConfigErrorMessage());\n }\n\n courseId.value = studioConfig.database.name;\n\n // Load course configuration\n const dataLayer = getDataLayer();\n const courseDB = dataLayer.getCourseDB(courseId.value);\n courseConfig.value = await courseDB.getCourseConfig();\n\n loading.value = false;\n } catch (err) {\n console.error('Bulk import initialization error:', err);\n error.value = err instanceof Error ? err.message : 'Unknown error';\n loading.value = false;\n }\n});\n\n// Handle import completion\nconst onImportCompleted = (result: any) => {\n console.log('Import completed:', result);\n // Could add success notification here\n};\n</script>\n\n<style scoped>\n.bulk-import-view {\n max-width: 1200px;\n margin: 0 auto;\n padding: 16px;\n}\n</style>"],"names":["loading","ref","error","courseId","courseConfig","onMounted","studioConfig","getStudioConfig","getConfigErrorMessage","courseDB","getDataLayer","err","onImportCompleted","result"],"mappings":"seA6CM,MAAAA,EAAUC,EAAI,EAAI,EAClBC,EAAQD,EAAmB,IAAI,EAC/BE,EAAWF,EAAmB,IAAI,EAClCG,EAAeH,EAAyB,IAAI,EAGlDI,EAAU,SAAY,CAChB,GAAA,CAEF,MAAMC,EAAeC,EAAgB,EAErC,GAAI,CAACD,EACG,MAAA,IAAI,MAAME,GAAuB,EAGhCL,EAAA,MAAQG,EAAa,SAAS,KAIvC,MAAMG,EADYC,EAAa,EACJ,YAAYP,EAAS,KAAK,EACxCC,EAAA,MAAQ,MAAMK,EAAS,gBAAgB,EAEpDT,EAAQ,MAAQ,SACTW,EAAK,CACJ,QAAA,MAAM,oCAAqCA,CAAG,EACtDT,EAAM,MAAQS,aAAe,MAAQA,EAAI,QAAU,gBACnDX,EAAQ,MAAQ,EAAA,CAClB,CACD,EAGK,MAAAY,EAAqBC,GAAgB,CACjC,QAAA,IAAI,oBAAqBA,CAAM,CAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bulk-import-view[data-v-ba3b5194]{max-width:1200px;margin:0 auto;padding:16px}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as _}from"./edit-ui.es-DiUxqbgF.js";import{a as g}from"./index-BnAv1C72.js";import{g as C,a as k,_ as w}from"./index-DHMXQY3-.js";import{h as x,d as u,x as E,X as c,ai as r,aj as s,m as a,ak as t,ao as p,Q as m,V as y,u as v}from"./vue-DZcMATiC.js";import"./vuetify-qg7mRxy_.js";const V={class:"course-editor-view"},N={key:0,class:"text-center pa-4"},z={key:1,class:"text-center pa-4"},B={key:2},I={key:3,class:"text-center pa-4"},L=x({__name:"CourseEditorView",setup(M){const n=u(!0),i=u(null),l=u(null);return E(async()=>{try{const o=C();if(!o)throw new Error(k());l.value=o.database.name,n.value=!1}catch(o){console.error("Course editor initialization error:",o),i.value=o instanceof Error?o.message:"Unknown error",n.value=!1}}),(o,e)=>{const f=c("v-progress-circular"),d=c("v-icon");return s(),r("div",V,[n.value?(s(),r("div",N,[a(f,{indeterminate:""}),e[0]||(e[0]=t("p",{class:"mt-2"},"Loading course editor...",-1))])):i.value?(s(),r("div",z,[a(d,{color:"error",size:"48"},{default:p(()=>e[1]||(e[1]=[m("mdi-alert-circle")])),_:1}),e[2]||(e[2]=t("h2",{class:"mt-2"},"Editor Error",-1)),t("p",null,y(i.value),1)])):l.value?(s(),r("div",B,[a(v(_),{course:l.value,"view-lookup-function":v(g).getView},null,8,["course","view-lookup-function"])])):(s(),r("div",I,[a(d,{size:"48"},{default:p(()=>e[3]||(e[3]=[m("mdi-school")])),_:1}),e[4]||(e[4]=t("h2",{class:"mt-2"},"No Course Loaded",-1)),e[5]||(e[5]=t("p",null,"Please load a course to start editing.",-1))]))])}}}),P=w(L,[["__scopeId","data-v-c575e95c"]]);export{P as default};
|
|
2
|
+
//# sourceMappingURL=CourseEditorView-BIlhlhw1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CourseEditorView-BIlhlhw1.js","sources":["../../src/views/CourseEditorView.vue"],"sourcesContent":["<template>\n <div class=\"course-editor-view\">\n <div v-if=\"loading\" class=\"text-center pa-4\">\n <v-progress-circular indeterminate />\n <p class=\"mt-2\">Loading course editor...</p>\n </div>\n\n <div v-else-if=\"error\" class=\"text-center pa-4\">\n <v-icon color=\"error\" size=\"48\">mdi-alert-circle</v-icon>\n <h2 class=\"mt-2\">Editor Error</h2>\n <p>{{ error }}</p>\n </div>\n\n <div v-else-if=\"courseId\">\n <!-- Course Editor from edit-ui package -->\n <course-editor :course=\"courseId\" :view-lookup-function=\"allCourses.getView\" />\n </div>\n\n <div v-else class=\"text-center pa-4\">\n <v-icon size=\"48\">mdi-school</v-icon>\n <h2 class=\"mt-2\">No Course Loaded</h2>\n <p>Please load a course to start editing.</p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted } from 'vue';\nimport { CourseEditor } from '@vue-skuilder/edit-ui';\nimport { allCourses } from '@vue-skuilder/courses';\nimport { getStudioConfig, getConfigErrorMessage } from '../config/development';\n\n// Course editor state\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst courseId = ref<string | null>(null);\n\n// Initialize course editor\nonMounted(async () => {\n try {\n // Get studio configuration (CLI-injected or environment variables)\n const studioConfig = getStudioConfig();\n\n if (!studioConfig) {\n throw new Error(getConfigErrorMessage());\n }\n\n courseId.value = studioConfig.database.name;\n loading.value = false;\n } catch (err) {\n console.error('Course editor initialization error:', err);\n error.value = err instanceof Error ? err.message : 'Unknown error';\n loading.value = false;\n }\n});\n</script>\n\n<style scoped>\n.course-editor-view {\n height: 100%;\n}\n</style>\n"],"names":["loading","ref","error","courseId","onMounted","studioConfig","getStudioConfig","getConfigErrorMessage","err"],"mappings":"geAiCM,MAAAA,EAAUC,EAAI,EAAI,EAClBC,EAAQD,EAAmB,IAAI,EAC/BE,EAAWF,EAAmB,IAAI,EAGxC,OAAAG,EAAU,SAAY,CAChB,GAAA,CAEF,MAAMC,EAAeC,EAAgB,EAErC,GAAI,CAACD,EACG,MAAA,IAAI,MAAME,GAAuB,EAGhCJ,EAAA,MAAQE,EAAa,SAAS,KACvCL,EAAQ,MAAQ,SACTQ,EAAK,CACJ,QAAA,MAAM,sCAAuCA,CAAG,EACxDN,EAAM,MAAQM,aAAe,MAAQA,EAAI,QAAU,gBACnDR,EAAQ,MAAQ,EAAA,CAClB,CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.course-editor-view[data-v-c575e95c]{height:100%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.create-card-view[data-v-6c9210e9]{max-width:1200px;margin:0 auto;padding:16px}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D as I}from"./edit-ui.es-DiUxqbgF.js";import{a as x}from"./index-BnAv1C72.js";import{g as L,a as z,b as q,_ as M}from"./index-DHMXQY3-.js";import{h as T,d as c,c as w,x as U,X as r,ai as n,aj as t,m as s,ao as l,Q as v,ak as m,V as j,an as h,am as V,u as D}from"./vue-DZcMATiC.js";import"./vuetify-qg7mRxy_.js";const F={class:"create-card-view"},Q={key:0,class:"text-center pa-4"},X={key:1,class:"text-center pa-4"},A={class:"mt-2 text-error"},G={key:2},H={key:2,class:"text-center pa-4"},J={key:3},K=T({__name:"CreateCardView",setup(O){const f=c(!0),_=c(null),i=c(null),u=c(null),g=c(0),d=w(()=>u.value?.dataShapes?u.value.dataShapes:[]),k=w(()=>{const a=d.value;if(a.length===0)return null;const e=a[g.value]?.name;if(!e)return null;for(const o of x.courses)for(const C of o.questions)for(const p of C.dataShapes)if(p.name===e.split(".").pop())return p;return null});U(async()=>{try{const a=L();if(!a)throw new Error(z());i.value=a.database.name;const o=q().getCourseDB(i.value);u.value=await o.getCourseConfig(),f.value=!1}catch(a){console.error("Create card initialization error:",a),_.value=a instanceof Error?a.message:"Unknown error",f.value=!1}});const S=a=>{console.log("Card created:",a)};return(a,e)=>{const o=r("v-icon"),C=r("v-card-title"),p=r("v-progress-circular"),N=r("v-select"),b=r("v-card-text"),B=r("v-card");return t(),n("div",F,[s(B,null,{default:l(()=>[s(C,null,{default:l(()=>[s(o,{left:""},{default:l(()=>e[1]||(e[1]=[v("mdi-card-plus")])),_:1}),e[2]||(e[2]=v(" Create New Card "))]),_:1}),s(b,null,{default:l(()=>[f.value?(t(),n("div",Q,[s(p,{indeterminate:""}),e[3]||(e[3]=m("p",{class:"mt-2"},"Loading card creation form...",-1))])):_.value?(t(),n("div",X,[s(o,{color:"error",size:"24"},{default:l(()=>e[4]||(e[4]=[v("mdi-alert-circle")])),_:1}),m("p",A,j(_.value),1)])):i.value&&u.value?(t(),n("div",G,[d.value.length>1?(t(),h(N,{key:0,modelValue:g.value,"onUpdate:modelValue":e[0]||(e[0]=y=>g.value=y),items:d.value.map((y,E)=>({title:y.name.replace(/^.*\./,""),value:E})),label:"Card Type",class:"mb-4"},null,8,["modelValue","items"])):V("",!0),k.value?(t(),h(D(I),{key:1,"course-id":i.value,"course-cfg":u.value,"data-shape":k.value,"view-lookup-function":D(x).getView,onCardCreated:S},null,8,["course-id","course-cfg","data-shape","view-lookup-function"])):d.value.length===0?(t(),n("div",H,[s(o,{color:"warning",size:"24"},{default:l(()=>e[5]||(e[5]=[v("mdi-alert")])),_:1}),e[6]||(e[6]=m("p",{class:"mt-2"},"No card types available in this course",-1))])):V("",!0)])):(t(),n("div",J,e[7]||(e[7]=[m("p",{class:"text-center"},"No course loaded",-1)])))]),_:1})]),_:1})])}}}),$=M(K,[["__scopeId","data-v-6c9210e9"]]);export{$ as default};
|
|
2
|
+
//# sourceMappingURL=CreateCardView-DPjPvzzt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateCardView-DPjPvzzt.js","sources":["../../src/views/CreateCardView.vue"],"sourcesContent":["<template>\n <div class=\"create-card-view\">\n <v-card>\n <v-card-title>\n <v-icon left>mdi-card-plus</v-icon>\n Create New Card\n </v-card-title>\n\n <v-card-text>\n <div v-if=\"loading\" class=\"text-center pa-4\">\n <v-progress-circular indeterminate />\n <p class=\"mt-2\">Loading card creation form...</p>\n </div>\n\n <div v-else-if=\"error\" class=\"text-center pa-4\">\n <v-icon color=\"error\" size=\"24\">mdi-alert-circle</v-icon>\n <p class=\"mt-2 text-error\">{{ error }}</p>\n </div>\n\n <div v-else-if=\"courseId && courseConfig\">\n <!-- Card type selector -->\n <v-select\n v-if=\"availableDataShapes.length > 1\"\n v-model=\"selectedDataShapeIndex\"\n :items=\"\n availableDataShapes.map((shape, index) => ({\n title: shape.name.replace(/^.*\\./, ''),\n value: index,\n }))\n \"\n label=\"Card Type\"\n class=\"mb-4\"\n />\n\n <!-- Data Input Form from edit-ui package -->\n <data-input-form\n v-if=\"selectedDataShape\"\n :course-id=\"courseId\"\n :course-cfg=\"courseConfig\"\n :data-shape=\"selectedDataShape\"\n :view-lookup-function=\"allCourses.getView\"\n @card-created=\"onCardCreated\"\n />\n\n <div v-else-if=\"availableDataShapes.length === 0\" class=\"text-center pa-4\">\n <v-icon color=\"warning\" size=\"24\">mdi-alert</v-icon>\n <p class=\"mt-2\">No card types available in this course</p>\n </div>\n </div>\n\n <div v-else>\n <p class=\"text-center\">No course loaded</p>\n </div>\n </v-card-text>\n </v-card>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, computed } from 'vue';\nimport { DataInputForm } from '@vue-skuilder/edit-ui';\nimport { allCourses } from '@vue-skuilder/courses';\nimport { getStudioConfig, getConfigErrorMessage } from '../config/development';\nimport { getDataLayer } from '@vue-skuilder/db';\nimport type { CourseConfig, DataShape } from '@vue-skuilder/common';\n\n// Create card state\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst courseId = ref<string | null>(null);\nconst courseConfig = ref<CourseConfig | null>(null);\nconst selectedDataShapeIndex = ref<number>(0);\n\n// Get available data shapes\nconst availableDataShapes = computed(() => {\n if (!courseConfig.value?.dataShapes) return [];\n return courseConfig.value.dataShapes;\n});\n\n// Get currently selected data shape\nconst selectedDataShape = computed((): DataShape | null => {\n const shapes = availableDataShapes.value;\n if (shapes.length === 0) return null;\n\n // Find the corresponding DataShape from allCourses\n const shapeName = shapes[selectedDataShapeIndex.value]?.name;\n if (!shapeName) return null;\n\n // Search through all courses to find the DataShape\n for (const course of allCourses.courses) {\n for (const question of course.questions) {\n for (const dataShape of question.dataShapes) {\n if (dataShape.name === shapeName.split('.').pop()) {\n return dataShape;\n }\n }\n }\n }\n return null;\n});\n\n// Initialize create card view\nonMounted(async () => {\n try {\n // Get studio configuration (CLI-injected or environment variables)\n const studioConfig = getStudioConfig();\n\n if (!studioConfig) {\n throw new Error(getConfigErrorMessage());\n }\n\n courseId.value = studioConfig.database.name;\n\n // Load course configuration\n const dataLayer = getDataLayer();\n const courseDB = dataLayer.getCourseDB(courseId.value);\n courseConfig.value = await courseDB.getCourseConfig();\n\n loading.value = false;\n } catch (err) {\n console.error('Create card initialization error:', err);\n error.value = err instanceof Error ? err.message : 'Unknown error';\n loading.value = false;\n }\n});\n\n// Handle card creation\nconst onCardCreated = (cardData: any) => {\n console.log('Card created:', cardData);\n // Could add success notification or redirect here\n};\n</script>\n\n<style scoped>\n.create-card-view {\n max-width: 1200px;\n margin: 0 auto;\n padding: 16px;\n}\n</style>\n"],"names":["loading","ref","error","courseId","courseConfig","selectedDataShapeIndex","availableDataShapes","computed","selectedDataShape","shapes","shapeName","course","allCourses","question","dataShape","onMounted","studioConfig","getStudioConfig","getConfigErrorMessage","courseDB","getDataLayer","err","onCardCreated","cardData"],"mappings":"giBAmEM,MAAAA,EAAUC,EAAI,EAAI,EAClBC,EAAQD,EAAmB,IAAI,EAC/BE,EAAWF,EAAmB,IAAI,EAClCG,EAAeH,EAAyB,IAAI,EAC5CI,EAAyBJ,EAAY,CAAC,EAGtCK,EAAsBC,EAAS,IAC9BH,EAAa,OAAO,WAClBA,EAAa,MAAM,WADkB,CAAC,CAE9C,EAGKI,EAAoBD,EAAS,IAAwB,CACzD,MAAME,EAASH,EAAoB,MAC/B,GAAAG,EAAO,SAAW,EAAU,OAAA,KAGhC,MAAMC,EAAYD,EAAOJ,EAAuB,KAAK,GAAG,KACpD,GAAA,CAACK,EAAkB,OAAA,KAGZ,UAAAC,KAAUC,EAAW,QACnB,UAAAC,KAAYF,EAAO,UACjB,UAAAG,KAAaD,EAAS,WAC/B,GAAIC,EAAU,OAASJ,EAAU,MAAM,GAAG,EAAE,MACnC,OAAAI,EAKR,OAAA,IAAA,CACR,EAGDC,EAAU,SAAY,CAChB,GAAA,CAEF,MAAMC,EAAeC,EAAgB,EAErC,GAAI,CAACD,EACG,MAAA,IAAI,MAAME,GAAuB,EAGhCf,EAAA,MAAQa,EAAa,SAAS,KAIvC,MAAMG,EADYC,EAAa,EACJ,YAAYjB,EAAS,KAAK,EACxCC,EAAA,MAAQ,MAAMe,EAAS,gBAAgB,EAEpDnB,EAAQ,MAAQ,SACTqB,EAAK,CACJ,QAAA,MAAM,oCAAqCA,CAAG,EACtDnB,EAAM,MAAQmB,aAAe,MAAQA,EAAI,QAAU,gBACnDrB,EAAQ,MAAQ,EAAA,CAClB,CACD,EAGK,MAAAsB,EAAiBC,GAAkB,CAC/B,QAAA,IAAI,gBAAiBA,CAAQ,CAEvC"}
|