@edugate/ai-agent 0.2.0 → 0.3.0
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/index.d.mts +16 -8225
- package/dist/index.d.ts +16 -8225
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Cr=Object.create;var Ve=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Ar=Object.getPrototypeOf,Dr=Object.prototype.hasOwnProperty;var Ir=(o,i)=>{for(var n in i)Ve(o,n,{get:i[n],enumerable:!0})},po=(o,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of wr(i))!Dr.call(o,a)&&a!==n&&Ve(o,a,{get:()=>i[a],enumerable:!(c=zr(i,a))||c.enumerable});return o};var jr=(o,i,n)=>(n=o!=null?Cr(Ar(o)):{},po(i||!o||!o.__esModule?Ve(n,"default",{value:o,enumerable:!0}):n,o)),Mr=o=>po(Ve({},"__esModule",{value:!0}),o);var un={};Ir(un,{ActionBlockSchema:()=>Io,ActionConditionSchema:()=>Ze,ActionSchema:()=>et,ActionTypeSchema:()=>Bt,ActionVariableSchema:()=>Tt,ActivityContentMigrationError:()=>Qe,ActivityContentSchema:()=>jo,ActivityContextSchema:()=>vo,ActivityVariableSchema:()=>zo,AnagramBlockSchema:()=>Ie,AnagramBlockThemeSchema:()=>Y,AnagramContentSchema:()=>_o,AnimationSchema:()=>yt,ArrowBlockSchema:()=>Fe,ArrowHeadTypeSchema:()=>ot,ArrowLabelSchema:()=>_t,BASE_BLOCK_FIELDS:()=>rt,BLOCK_CONTENT_SCHEMAS:()=>pe,BLOCK_REGISTRY:()=>P,BLOCK_STYLE_KEYS:()=>gt,BLOCK_TYPES:()=>R,BasicContentSchema:()=>qo,BlockEventSchema:()=>wo,BlockEventTypeSchema:()=>Xe,BlockGroupSchema:()=>Ft,BlockSchema:()=>nt,BlockThemeSchema:()=>C,BlockTypeSchema:()=>$e,BoxSideSchema:()=>Je,BoxStylesSchema:()=>h,CANVAS_OP_NAMES:()=>vr,CANVAS_OP_REQUIRED:()=>He,CURRENT_SCHEMA_VERSION:()=>st,CanvasDragItemSchema:()=>Mo,CanvasOpSchema:()=>dt,CardDeckBlockSchema:()=>_e,CardDeckBlockThemeSchema:()=>oe,CardFaceSchema:()=>at,CardItemSchema:()=>xe,CardSchema:()=>Ut,ChartBlockSchema:()=>Ee,ChartConfigSchema:()=>ro,ChartContentSchema:()=>Ho,ChartTypeSchema:()=>oo,ChoiceQuestionSchema:()=>wt,ClickConditionSchema:()=>To,ClozeBlockSchema:()=>Re,ClozeBlockThemeSchema:()=>te,ClozeContentSchema:()=>Po,ClozeModeSchema:()=>qt,ConditionOperatorSchema:()=>kt,CropDataSchema:()=>ut,CrosswordBlockSchema:()=>se,CrosswordBlockThemeSchema:()=>U,CrosswordCellSchema:()=>Ot,CrosswordContentSchema:()=>Lo,CrosswordLayoutOutputSchema:()=>Et,CrosswordLayoutWordSchema:()=>Pt,CrosswordWordSchema:()=>$t,DeckBlockTypeSchema:()=>No,DeckContentSchema:()=>Qo,DiceBlockSchema:()=>je,DiceBlockThemeSchema:()=>J,DiceContentSchema:()=>Go,DiceTypeSchema:()=>vt,DieTypeSchema:()=>Zt,DragAndDropBlockSchema:()=>De,DragAndDropBlockThemeSchema:()=>q,DragAndDropContentSchema:()=>Vo,DragAndDropGroupSchema:()=>be,DragAndDropItemSchema:()=>Mt,DragGroupSchema:()=>to,DragItemSchema:()=>eo,EditorBlockSchema:()=>ze,EditorBlockThemeSchema:()=>$,EmbedBlockSchema:()=>Ae,FlashcardBlockSchema:()=>Oe,FlashcardBlockThemeSchema:()=>re,FlashcardContentSchema:()=>tt,FlashcardItemSchema:()=>ke,GridSizeSchema:()=>E,HotpointBlockSchema:()=>Ce,HotpointBlockThemeSchema:()=>V,ImageAlignSchema:()=>N,ImageSizeSchema:()=>Q,KeyPressConditionSchema:()=>Co,MatchPairsBlockSchema:()=>Le,MatchPairsBlockThemeSchema:()=>ne,MatchPairsPairSchema:()=>Be,MathOperationSchema:()=>xt,MediaBlockSchema:()=>we,MediaItemSchema:()=>p,MediaRefSchema:()=>bo,MediaSourceSchema:()=>ht,MediaTypeSchema:()=>F,MemoryBlockSchema:()=>ve,MemoryBlockThemeSchema:()=>X,MemoryPairSchema:()=>ge,MemoryPairTypeSchema:()=>Yt,PairGameBlockTypeSchema:()=>Wo,PairGameContentSchema:()=>Fo,PairSchema:()=>Jt,PositionSchema:()=>Ye,PuzzleBlockSchema:()=>Me,PuzzleContentSchema:()=>Do,PuzzleGameModeSchema:()=>ye,PuzzleTypeSchema:()=>It,QuestionOptionSchema:()=>Ct,QuestionSchema:()=>ae,QuestionTypeSchema:()=>Ao,QuizBlockSchema:()=>Te,QuizBlockThemeSchema:()=>H,QuizConditionSchema:()=>xo,QuizContentSchema:()=>Oo,QuizOptionSchema:()=>Vt,QuizQuestionSchema:()=>Ht,QuizQuestionTypeSchema:()=>Kt,REGISTRY_CONTENT_SCHEMAS:()=>ct,REGISTRY_STYLE_TARGETS:()=>fr,RadiusSchema:()=>bt,STYLE_TARGET_MAP:()=>fe,SceneBlockRefSchema:()=>Qt,SceneSchema:()=>Nt,SceneSummarySchema:()=>Gt,SceneTypeSchema:()=>jt,ShapeBlockSchema:()=>We,ShapeBlockThemeSchema:()=>ie,ShapeTypeSchema:()=>Rt,SizeSchema:()=>K,SpinnerContentSchema:()=>Ko,SpinnerSliceSchema:()=>Xt,SpinningWheelBlockSchema:()=>Pe,SpinningWheelBlockThemeSchema:()=>ee,TextQuestionSchema:()=>Dt,TextStylesSchema:()=>f,TimerConditionSchema:()=>Bo,TrueFalseQuestionSchema:()=>At,UNSTYLEABLE_BLOCKS:()=>St,VideoSettingsSchema:()=>ft,WheelSliceSchema:()=>Se,WordGameBlockTypeSchema:()=>Eo,WordSearchBlockSchema:()=>le,WordSearchBlockThemeSchema:()=>Z,WordSearchContentSchema:()=>Ro,WordSearchDataSchema:()=>Lt,WordSearchDifficultySchema:()=>Wt,actionsV1toV2:()=>kr,applyItemPatch:()=>Pr,createCanvasOpValidator:()=>en,defineBlock:()=>x,detectConflict:()=>rn,entitySignature:()=>fo,generateBlockReference:()=>br,getAllBlockJsonSchemas:()=>hn,getBlockDefinition:()=>ur,getBlockJsonSchema:()=>Tr,getCapabilitiesManifest:()=>pn,isKnownCanvasOp:()=>mo,listBlockTypes:()=>Br,mapLogicalThemeStyles:()=>Ue,mergeTheme:()=>ko,migrateActivityContent:()=>Sr,opConflictStamp:()=>nn,opTarget:()=>uo,parseMentions:()=>mn,realStyleKeysFor:()=>go,resolveMentions:()=>dn,stableStringify:()=>ue,styleTargetsHelpFor:()=>So,validateCanvasOp:()=>Or});module.exports=Mr(un);var He={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},vr=Object.keys(He);function mo(o){return Object.prototype.hasOwnProperty.call(He,o)}function Or(o,i){if(!mo(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=He[o].filter(a=>n[a]===void 0||n[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Pr(o,i,n){let c=Array.isArray(o)?[...o]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let a=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,n.item),c}return i==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===n.itemId?{...a,...n.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===n.itemId))}var r=require("zod"),W=()=>r.z.record(r.z.string(),r.z.unknown()),Er=r.z.object({scene:W().optional(),newIndex:r.z.number().optional()}).passthrough(),Lr=r.z.object({sceneId:r.z.string()}),Rr=r.z.object({sceneId:r.z.string(),block:W()}),_r=r.z.object({sceneId:r.z.string(),updates:W().optional(),newIndex:r.z.number().optional()}),Wr=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Fr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),updates:W()}),Nr=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Qr=r.z.object({blockIds:r.z.array(r.z.string())}),Gr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),theme:W()}),Kr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),elementId:r.z.string(),customStyle:W()}),Vr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),action:W()}),Hr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),actionId:r.z.string()}),qr=r.z.object({operation:r.z.string(),name:r.z.string(),defaultValue:r.z.unknown().optional()}).passthrough(),$r=r.z.object({scope:r.z.string().optional(),sceneId:r.z.string().optional(),blockId:r.z.string().optional(),hasTimer:r.z.boolean().optional(),timer:r.z.unknown().optional()}).passthrough(),Yr=r.z.object({sceneId:r.z.string(),newIndex:r.z.number()}),Jr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),item:r.z.unknown(),at:r.z.number().optional()}),Ur=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string(),item:r.z.unknown()}),Zr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string()}),Xr=r.z.object({activity:r.z.unknown()}),dt=r.z.discriminatedUnion("action",[r.z.object({action:r.z.literal("createScene"),data:Er}),r.z.object({action:r.z.literal("deleteScene"),data:Lr}),r.z.object({action:r.z.literal("addBlock"),data:Rr}),r.z.object({action:r.z.literal("updateScene"),data:_r}),r.z.object({action:r.z.literal("deleteBlock"),data:Wr}),r.z.object({action:r.z.literal("updateBlock"),data:Fr}),r.z.object({action:r.z.literal("duplicateBlock"),data:Nr}),r.z.object({action:r.z.literal("groupBlocks"),data:Qr}),r.z.object({action:r.z.literal("updateBlockTheme"),data:Gr}),r.z.object({action:r.z.literal("updateBlockElementStyle"),data:Kr}),r.z.object({action:r.z.literal("addAction"),data:Vr}),r.z.object({action:r.z.literal("removeAction"),data:Hr}),r.z.object({action:r.z.literal("manageVariables"),data:qr}),r.z.object({action:r.z.literal("configureTimer"),data:$r}),r.z.object({action:r.z.literal("reorderScenes"),data:Yr}),r.z.object({action:r.z.literal("insertItem"),data:Jr}),r.z.object({action:r.z.literal("updateItem"),data:Ur}),r.z.object({action:r.z.literal("deleteItem"),data:Zr}),r.z.object({action:r.z.literal("replaceActivity"),data:Xr})]);var ho=require("zod");function qe(o){return o.issues.map(i=>{let n=i.path.join(".");return n?`${n}: ${i.message}`:i.message})}function en(o,i){return n=>{let c=dt.safeParse(n);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:qe(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,y=typeof s.type=="string"?s.type:void 0,b=y?o.getContentSchema(y):void 0;if(!y||!b)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let g=b.safeParse(s);return g.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:qe(g.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=i?.(l.blockId);if(!s)return{ok:!0};let y=o.getCollectionSchema(s,l.collection);if(!y)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let b=y.safeParse(l.item);if(!b.success)return{ok:!1,code:"ITEM_INVALID",errors:qe(b.error)}}return{ok:!0}}if(a==="updateBlock"){let s=i?.(l.blockId),y=s?o.getContentSchema(s):void 0;if(!y)return{ok:!0};if(y instanceof ho.z.ZodObject){let g=y.deepPartial().safeParse(l.updates);if(!g.success)return{ok:!1,code:"CONTENT_INVALID",errors:qe(g.error)}}return{ok:!0}}return{ok:!0}}}var tn=new Set(["position","size","rotation","zIndex","z"]);function ue(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(ue).join(",")+"]":"{"+Object.keys(o).sort().map(n=>JSON.stringify(n)+":"+ue(o[n])).join(",")+"}"}function uo(o,i){let n=i??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function on(o,i){if(Array.isArray(o))for(let n of o){let c=n?.blocks?.find?.(a=>a&&a.id===i);if(c)return c}}function fo(o,i){if(i.kind==="untracked")return null;let n=i.blockId?on(o,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let l={};for(let s of Object.keys(n))tn.has(s)||(l[s]=n[s]);return ue(l)}let c=n[i.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===i.itemId);return a?ue(a):null}function rn(o,i){return o==null?"apply":i==null?"missing":o===i?"apply":"stale"}function nn(o,i,n){let c=uo(o,i);return{target:c,baseSignature:fo(n,c)}}var yo=require("zod"),R=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],$e=yo.z.enum(R);var d=require("zod"),Ye=d.z.object({x:d.z.number(),y:d.z.number(),z:d.z.number().optional()}),K=d.z.object({width:d.z.number().optional(),height:d.z.number().optional()}),E=d.z.object({rows:d.z.number(),cols:d.z.number()}),F=d.z.enum(["image","color","gif","shape","illustration","video","audio"]),ht=d.z.enum(["unsplash","pexels","upload","url","library","tenor"]),ut=d.z.object({x:d.z.number(),y:d.z.number(),width:d.z.number(),height:d.z.number(),zoom:d.z.number().optional(),rotation:d.z.number().optional(),aspect:d.z.number().optional()}),ft=d.z.object({autoplay:d.z.boolean().optional(),loop:d.z.boolean().optional(),muted:d.z.boolean().optional(),controls:d.z.boolean().optional(),poster:d.z.string().optional(),volume:d.z.number().optional()}),p=d.z.object({id:d.z.string().optional(),url:d.z.string().optional(),title:d.z.string().optional(),type:F.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:ht.optional(),alt:d.z.string().optional(),width:d.z.number().optional(),height:d.z.number().optional(),format:d.z.enum(["cover","contain"]).optional(),color:d.z.string().optional(),cropData:ut.optional(),duration:d.z.number().optional(),videoSettings:ft.optional()}),bo=p;var t=require("zod");var yt=t.z.object({type:t.z.union([t.z.enum(["none","fade","direction","bounce","scale","rotate"]),t.z.string()]),duration:t.z.number().optional(),delay:t.z.number().optional(),phase:t.z.enum(["in","both","out"]).optional(),direction:t.z.enum(["up","right","down","left"]).optional()}),Je=t.z.object({top:t.z.union([t.z.string(),t.z.number()]).optional(),right:t.z.union([t.z.string(),t.z.number()]).optional(),bottom:t.z.union([t.z.string(),t.z.number()]).optional(),left:t.z.union([t.z.string(),t.z.number()]).optional()}),bt=t.z.object({topLeft:t.z.union([t.z.string(),t.z.number()]).optional(),topRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomLeft:t.z.union([t.z.string(),t.z.number()]).optional()}),h=t.z.object({background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),backgroundOpacity:t.z.number().optional(),backgroundMedia:p.optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:Je.optional(),borderRadius:bt.optional(),padding:t.z.union([t.z.string(),t.z.number(),Je]).optional()}),f=t.z.object({color:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),fontWeight:t.z.union([t.z.string(),t.z.number()]).optional(),textAlign:t.z.enum(["left","center","right","justify"]).optional()}),O=h.merge(f),C=t.z.object({spacing:t.z.enum(["no-spacing","small","medium","large"]).optional(),animation:yt.optional(),styles:t.z.record(t.z.record(t.z.any())).optional()}),V=C.extend({styles:t.z.object({hotpoint:t.z.object({icon:t.z.string().optional(),iconPosition:t.z.enum(["left","right"]).optional(),iconSize:t.z.string().optional(),iconColor:t.z.string().optional(),image:p.optional(),imageFormat:t.z.enum(["circle","square","custom"]).optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:t.z.string().optional(),borderRadius:t.z.string().optional(),glow:t.z.boolean().optional(),glowColor:t.z.string().optional(),background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),textColor:t.z.string().optional()}).optional()}).optional()}),H=C.extend({layout:t.z.enum(["horizontal","vertical","grid"]),gridColumns:t.z.number().optional(),preset:t.z.enum(["default","modern","trivia","custom"]),styles:t.z.object({general:O,question:O,answers:O.extend({customStyles:t.z.array(t.z.object({color:t.z.string().optional(),backgroundColor:t.z.string().optional(),targets:t.z.string().optional()})).optional(),hover:O.optional()}),button:O.extend({variant:t.z.enum(["default","outline","ghost"]).optional(),hover:O.optional()})}).optional()}),q=C.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),gridColumns:t.z.number().optional(),gridGap:t.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.z.object({x:t.z.number().optional(),y:t.z.number().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.z.object({title:f.optional(),sandbox:h.optional(),item:O.optional(),group:h.optional(),container:h.extend({url:t.z.string().optional(),type:F.optional()}).optional(),groups:O.optional(),feedback:t.z.object({correct:t.z.string().optional(),incorrect:t.z.string().optional(),active:t.z.string().optional()}).optional(),referenceSize:t.z.object({width:t.z.number(),height:t.z.number()}).optional()}).optional()}),$=C.extend({styles:t.z.object({editor:h.optional()}).optional()}),Y=C.extend({styles:t.z.object({letter:h.optional(),letterText:f.optional(),slot:h.optional(),container:h.optional()}).optional()}),J=C.extend({styles:t.z.object({button:h.extend({hover:O.optional()}).optional(),buttonText:f.optional(),container:h.optional()}).optional()}),U=C.extend({primaryColor:t.z.string().optional(),layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({text:f.optional(),cell:h.optional(),grid:h.optional(),clueContainer:h.optional(),clueText:f.optional(),clueTitle:f.optional()}).optional()}),Z=C.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({wordSearch:t.z.object({primaryColor:t.z.string().optional(),highlightColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),textColor:t.z.string().optional(),cellBackgroundColor:t.z.string().optional()}).optional(),text:f.optional(),cell:h.optional(),grid:h.optional(),wordListContainer:h.optional(),wordListText:f.optional(),wordListTitle:f.optional()}).optional()}),X=C.extend({styles:t.z.object({text:f.optional(),container:h.optional(),infoContainer:h.optional(),infoText:f.optional(),card:h.optional()}).optional()}),ee=C.extend({styles:t.z.object({wheelText:f.optional()}).optional()}),te=C.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:f.optional(),container:h.optional(),wordBank:h.optional(),word:h.optional(),blank:h.optional()}).optional()}),oe=C.extend({styles:t.z.object({card:h.optional(),cardText:f.optional(),container:h.optional()}).optional()}),re=C.extend({styles:t.z.object({cardFront:h.optional(),cardBack:h.optional(),frontText:f.optional(),backText:f.optional(),navigation:h.optional(),navigationText:f.optional()}).optional()}),ne=C.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:f.optional(),card:h.optional(),container:h.optional()}).optional()}),ie=C.extend({styles:t.z.object({shape:O.extend({fillColor:t.z.string().optional(),textColor:t.z.string().optional(),borderStyle:t.z.enum(["solid","dashed","dotted"]).optional(),padding:t.z.number().optional()}).optional()}).optional()});var fe={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function go(o){let i=fe[o.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let a of c??[])n.add(a);return[...n]}var gt={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]},St=new Set(["chart","media","image","puzzle"]);function So(o){if(!o)return"";let i=o.toLowerCase();if(St.has(i))return`
|
|
2
|
-
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let n=
|
|
3
|
-
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Ue(o,i){if(!o)return o;let n={...o};for(let[y,b]of Object.entries(n))if(b&&typeof b=="object"){let g={...b},S=!1;g.backgroundColor!==void 0&&g.background===void 0&&(g.background=!0,S=!0),g.borderColor!==void 0&&g.border===void 0&&(g.border=!0,S=!0),S&&(n[y]=g)}if(!i)return n;let c=fe[i.toLowerCase()];if(!c)return n;let a=(y,b)=>{b&&(n[y]={...n[y]||{},...b})},l=["title","answers","button","general"],s={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let y of l){let b=s[y],g=c[y];if(b&&g)for(let S of g)a(S,b)}return n}function ko(o,i,n){if(!o){let s={...i};return s.styles&&(s.styles=Ue(s.styles,n)),s}if(!i)return o;let c={...o,...i},a=Ue(i.styles,n),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}var m=require("zod"),Xe=m.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),kt=m.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),xo=m.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),Bo=m.z.enum(["completed","half_way"]),To=m.z.enum(["single_click","double_click"]),Co=m.z.literal("key_pressed"),Ze=m.z.object({event:Xe.optional(),variableName:m.z.string().optional(),operator:kt.optional(),value:m.z.any()}),xt=m.z.enum(["set","add","subtract","multiply","divide"]),Bt=m.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),Tt=m.z.object({name:m.z.string(),value:m.z.union([m.z.number(),m.z.string(),m.z.boolean()]),operation:xt.optional()}),et=m.z.object({id:m.z.string(),type:Bt,condition:Ze.optional(),conditions:m.z.array(Ze).optional(),conditionsOperator:m.z.enum(["and","or"]).optional(),modalContent:m.z.string().optional(),audioUrl:m.z.string().optional(),linkUrl:m.z.string().optional(),targetSceneId:m.z.string().optional(),targetBlockId:m.z.string().optional(),direction:m.z.enum(["up","down","left","right"]).optional(),distance:m.z.number().optional(),variable:Tt.optional()}),zo=m.z.object({name:m.z.string(),defaultValue:m.z.union([m.z.string(),m.z.number(),m.z.boolean()])}),wo=m.z.object({type:Xe,blockId:m.z.string(),data:m.z.record(m.z.any()).optional()});var k=require("zod");var Ao=k.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),N=k.z.enum(["left","right","center"]),Q=k.z.object({width:k.z.number().optional(),height:k.z.number().optional()}),Ct=k.z.object({id:k.z.string(),text:k.z.string().describe("The option's answer text."),isCorrect:k.z.boolean().describe("Whether this option is a correct answer."),image:p.optional().describe("Option image."),imageAlign:N.optional().describe("Option image alignment."),imageSize:Q.optional().describe("Option image size.")}),zt={id:k.z.string(),text:k.z.string().describe("The question text."),score:k.z.number().optional(),image:p.optional().describe("Question image."),imageAlign:N.optional().describe("Question image alignment."),imageSize:Q.optional().describe("Question image size.")},wt=k.z.object({...zt,type:k.z.enum(["single-choice","multiple-choice"]),options:k.z.array(Ct).describe("Answer options for this choice question.")}),At=k.z.object({...zt,type:k.z.literal("true-false"),correctAnswer:k.z.boolean().describe("The correct answer (true or false).")}),Dt=k.z.object({...zt,type:k.z.enum(["short-answers","long-answers"]),minCharacters:k.z.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:k.z.number().optional().describe("Maximum number of characters allowed in the answer.")}),ae=k.z.discriminatedUnion("type",[wt,At,Dt]);var e=require("zod");var M=require("zod");var ye=M.z.enum(["scattered","rotated","scattered_rotated"]),It=M.z.enum(["swap","slide"]),Do=M.z.object({image:M.z.union([M.z.string(),p]).optional().describe("Image URL or MediaItem for puzzle."),pieces:M.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:ye.optional(),puzzleType:It.optional(),showNumbers:M.z.union([M.z.boolean(),M.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:M.z.string().optional().describe("Deterministic seed for piece placement.")});var jt=e.z.enum(["2D","360\xB0"]),ce={id:e.z.string(),type:$e,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:Ye.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:K.optional(),minSize:K.optional(),maxSize:K.optional(),theme:C.optional()},z={...ce,actions:e.z.array(et).optional(),score:e.z.number().optional()},rt=Object.freeze(Object.keys(ce)),Io=e.z.object(z),Mt=e.z.object({id:e.z.string(),text:e.z.string(),background:p.optional().describe("Background image/color for item."),opacity:e.z.number().optional().describe("Opacity of the item (0-1)."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),styles:h.optional().describe("Box custom styling styles."),textStyles:f.optional().describe("Text custom styling styles.")}),be=e.z.object({id:e.z.string(),name:e.z.string().describe("Group/dropzone name."),background:p.optional().describe("Background image/color for group."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),singleItem:e.z.boolean().optional().describe("Accept only one item inside."),opacity:e.z.number().optional().describe("Opacity of the group (0-1)."),styles:h.optional().describe("Box custom styling styles."),textStyles:f.optional().describe("Text custom styling styles."),items:e.z.array(Mt).describe("Items that belong in this group.")}),vt=e.z.enum(["d4","d6","d8","d10","d12","d20"]),Ot=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()}),Pt=e.z.object({answer:e.z.string(),clue:e.z.string(),image:p.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()}),Et=e.z.object({grid:e.z.array(e.z.array(Ot)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(Pt)}),Lt=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))}),ge=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.z.tuple([e.z.string(),e.z.string()]).describe("Pair content [item1, item2].")}),Se=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional().describe("CSS color for the slice."),image:p.optional().describe("Slice image.")}),tt=e.z.object({type:e.z.enum(["text","image"]).describe("Content type: text or image."),content:e.z.any().describe("The content value: a string for text, or a MediaItem for image.")}),ke=e.z.object({id:e.z.string(),front:tt.describe("Front side."),back:tt.describe("Back side.")}),xe=e.z.object({id:e.z.string(),frontImage:p.optional().describe("Front image."),frontText:e.z.string().optional().describe("Front text.")}),Be=e.z.object({id:e.z.string(),leftLabel:e.z.string().describe("Left side text."),rightLabel:e.z.string().describe("Right side text."),leftImage:e.z.any().optional().describe("Left side image."),rightImage:e.z.any().optional().describe("Right side image.")}),Rt=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),ot=e.z.enum(["none","arrow","circle","square"]),_t=e.z.object({id:e.z.string(),text:e.z.string().describe("Label text."),t:e.z.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.z.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.z.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.z.number().optional().describe("Label font size."),color:e.z.string().optional().describe("Label text color."),backgroundColor:e.z.string().optional().describe("Label background color.")}),Te=e.z.object({...z,type:e.z.literal("Quiz"),questions:e.z.array(ae).optional().describe("Array of question objects."),previewIndex:e.z.number().optional().describe("Index of the question currently previewed in the editor."),required:e.z.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.z.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.z.string().optional().describe("Label for submit button."),timer:e.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.z.boolean().optional().describe("Show current/total questions count."),theme:H}),Ce=e.z.object({...z,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.z.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:V.optional()}),ze=e.z.object({...z,type:e.z.literal("Editor"),content:e.z.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.z.boolean().optional().describe("Make the editor content read-only during play."),theme:$.optional()}),we=e.z.object({...ce,type:e.z.literal("Media"),media:p.optional().describe("Media asset displayed by this block.")}),Ae=e.z.object({...ce,type:e.z.literal("Embed"),url:e.z.string().optional().describe("Embed content URL."),readOnly:e.z.boolean().optional().describe("Prevent interaction with the embedded content.")}),De=e.z.object({...z,type:e.z.literal("DragAndDrop"),groups:e.z.array(be).describe("Drag-and-drop groups."),theme:q.optional(),showResults:e.z.boolean().optional().describe("Show result feedback immediately."),layout:e.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:p.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.z.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:p.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.z.number().optional().describe("Proportion ratio for split layout.")}),Ie=e.z.object({...z,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.z.string().describe("The correct word."),theme:Y.optional(),clue:e.z.string().optional().describe("A hint."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed.")}),je=e.z.object({...z,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional().describe("History of previous roll results."),diceType:vt.optional().describe("Type of die (number of faces)."),faceOverrides:e.z.any().optional().describe("Custom overrides for individual die faces."),color:e.z.string().optional().describe("CSS color for dice."),showNumber:e.z.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.z.number().optional().describe("Number of dice to roll together."),dicePool:e.z.record(e.z.number()).optional().describe("Named pool of dice configurations."),persistent:e.z.boolean().optional().describe("Keep dice visible after roll."),theme:J.optional()}),Me=e.z.object({...z,type:e.z.literal("Puzzle"),image:p.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.z.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:ye.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.z.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.z.string().optional().describe("Deterministic seed for piece placement.")}),se=e.z.object({...z,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string().describe("The answer for this clue."),clue:e.z.string().describe("The clue text shown to the learner."),image:p.optional().describe("Clue image.")})).optional(),layout:Et.optional(),theme:U.optional()}),Wt=e.z.enum(["easy","medium","hard"]),le=e.z.object({...z,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional().describe("List of words to hide in the grid."),gridSize:E.optional().describe("Grid dimensions."),difficulty:Wt.optional().describe("Difficulty level, affecting word placement and grid noise."),data:Lt.optional(),theme:Z.optional()}),ve=e.z.object({...z,type:e.z.literal("Memory"),pairs:e.z.array(ge).describe("Array of pair objects."),gridSize:E.optional().describe("Grid dimensions."),hideScore:e.z.boolean().optional().describe("Hide the score display during play."),theme:X.optional()}),Oe=e.z.object({...z,type:e.z.literal("Flashcard"),cards:e.z.array(ke).describe("Array of card objects."),theme:re.optional()}),Pe=e.z.object({...z,type:e.z.literal("SpinningWheel"),slices:e.z.array(Se).describe("Wheel slices (min 2)."),spinDuration:e.z.number().optional().describe("Spin duration in seconds."),theme:ee.optional()}),Ee=e.z.object({...z,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.z.array(e.z.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.z.string().optional().describe("Label for the X axis."),yAxisLabel:e.z.string().optional().describe("Label for the Y axis."),showLegend:e.z.boolean().optional().describe("Show the chart legend."),showTooltip:e.z.boolean().optional().describe("Show tooltips on hover."),stacked:e.z.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.z.record(e.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),Le=e.z.object({...z,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional().describe("Instruction text."),pairs:e.z.array(Be).describe("Array of pair objects."),theme:ne.optional()}),Re=e.z.object({...z,type:e.z.literal("Cloze"),templateText:e.z.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:te.optional(),mode:e.z.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),_e=e.z.object({...z,type:e.z.literal("CardDeck"),cards:e.z.array(xe).describe("Array of card objects."),backImage:p.optional().describe("Shared back image for all cards."),discardLogic:e.z.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:oe.optional()}),We=e.z.object({...ce,type:e.z.literal("Shape"),shapeType:Rt.optional().describe("Shape outline to render."),text:e.z.string().optional().describe("Text inside shape."),theme:ie.optional()}),Fe=e.z.object({...ce,type:e.z.literal("Arrow"),startBlockId:e.z.string().describe("ID of the block this arrow starts from."),endBlockId:e.z.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.z.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.z.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.z.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.z.string().optional().describe("Line color."),strokeWidth:e.z.number().optional().describe("Line thickness in pixels."),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.z.boolean().optional().describe("Show arrowheads on the line."),startHead:ot.optional().describe("Arrowhead style at the start."),endHead:ot.optional().describe("Arrowhead style at the end."),bendOffsetX:e.z.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.z.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.z.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.z.array(e.z.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.z.array(_t).optional().describe("Text labels placed along the arrow.")}),nt=e.z.discriminatedUnion("type",[Te,Ce,ze,Ae,we,De,Ie,je,Me,se,le,ve,Oe,Pe,Ee,Le,We,Fe,Re,_e]),Ft=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()}),Nt=e.z.object({id:e.z.string(),title:e.z.string(),type:jt,background:e.z.union([e.z.string(),e.z.array(e.z.string()),p]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array(nt),groups:e.z.array(Ft).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),jo=e.z.object({id:e.z.string(),title:e.z.string(),schemaVersion:e.z.number().optional(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(Nt),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:p.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()}),Mo=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:nt});var w=require("zod"),Qt=w.z.object({id:w.z.string(),type:w.z.string(),title:w.z.string()}),Gt=w.z.object({id:w.z.string(),title:w.z.string(),position:w.z.number(),blocks:w.z.array(Qt).default([])}),vo=w.z.object({activity:w.z.object({id:w.z.string(),title:w.z.string(),scenes:w.z.array(Gt).default([])}),activeSceneId:w.z.string().nullable().optional()});var B=require("zod");var Kt=B.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Vt=B.z.object({id:B.z.string().optional(),text:B.z.string(),isCorrect:B.z.boolean(),image:p.optional().describe("Option image."),imageAlign:N.optional().describe("Option image alignment."),imageSize:Q.optional().describe("Option image size.")}),Ht=B.z.object({id:B.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:Kt,text:B.z.string().describe("The question text."),score:B.z.number().optional(),options:B.z.array(Vt).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:B.z.boolean().optional().describe("Required for true-false."),image:p.optional().describe("Question image."),imageAlign:N.optional().describe("Question image alignment."),imageSize:Q.optional().describe("Question image size.")}),Oo=B.z.object({questions:B.z.array(Ht).describe("Array of question objects."),showResults:B.z.boolean().optional(),allowRetry:B.z.boolean().optional(),maxRetry:B.z.string().optional(),required:B.z.boolean().optional(),submitText:B.z.string().optional().describe("Label for submit button."),timer:B.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:B.z.boolean().optional().describe("Show current/total questions count.")});var it=require("zod"),qt=it.z.enum(["write","drag-drop"]),Po=it.z.object({templateText:it.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:qt.optional().describe("Input mode. Default: write.")});var A=require("zod");var Eo=A.z.enum(["Crossword","WordSearch","Anagram"]),$t=A.z.object({answer:A.z.string(),clue:A.z.string(),image:p.optional().describe("Clue image.")}),Lo=A.z.object({words:A.z.array($t)}),Ro=A.z.object({words:A.z.array(A.z.string()),gridSize:E.optional().describe("Grid dimensions."),difficulty:A.z.enum(["easy","medium","hard"]).optional()}),_o=A.z.object({correctWord:A.z.string().describe("The correct word."),letters:A.z.array(A.z.string()).optional(),clue:A.z.string().optional().describe("A hint.")});var j=require("zod");var Wo=j.z.enum(["Memory","MatchPairs"]),Yt=j.z.enum(["img-img","img-word","word-word"]),Jt=j.z.object({id:j.z.string().optional(),type:Yt.optional().describe("For Memory: pair type."),content:j.z.array(j.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:j.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:j.z.string().optional().describe("For MatchPairs: right side text."),leftImage:p.optional().describe("For MatchPairs: left side image."),rightImage:p.optional().describe("For MatchPairs: right side image.")}),Fo=j.z.object({pairs:j.z.array(Jt).describe("Array of pair objects."),gridSize:E.optional().describe("For Memory: grid dimensions."),instructions:j.z.string().optional().describe("For MatchPairs: instruction text.")});var I=require("zod"),No=I.z.enum(["Flashcard","CardDeck"]),at=I.z.object({type:I.z.enum(["text","image"]),content:I.z.any()}),Ut=I.z.object({id:I.z.string().optional(),front:at.optional().describe("For Flashcard: front side."),back:at.optional().describe("For Flashcard: back side."),frontText:I.z.string().optional().describe("For CardDeck: front text."),frontImage:I.z.any().optional().describe("For CardDeck: front image.")}),Qo=I.z.object({cards:I.z.array(Ut).describe("Array of card objects."),backImage:I.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:I.z.enum(["delete","return"]).optional().describe("For CardDeck.")});var G=require("zod"),Zt=G.z.enum(["d4","d6","d8","d10","d12","d20"]),Go=G.z.object({diceType:Zt.optional(),diceCount:G.z.number().int().min(1).max(10).optional(),color:G.z.string().optional().describe("CSS color for dice."),showNumber:G.z.boolean().optional(),persistent:G.z.boolean().optional().describe("Keep dice visible after roll.")});var _=require("zod");var Xt=_.z.object({id:_.z.string().optional(),text:_.z.string(),color:_.z.string().optional().describe("CSS color for slice."),image:p.optional().describe("Slice image.")}),Ko=_.z.object({slices:_.z.array(Xt).min(2).describe("Wheel slices (min 2)."),spinDuration:_.z.number().optional().describe("Spin duration in seconds.")});var u=require("zod");var eo=u.z.object({id:u.z.string().optional(),text:u.z.string(),background:p.optional().describe("Background image/color for item."),opacity:u.z.number().optional().describe("Opacity of the item (0-1)."),x:u.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:u.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:u.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:u.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:u.z.number().optional().describe("Manual width in pixels."),height:u.z.number().optional().describe("Manual height in pixels."),styles:h.optional().describe("Box custom styling styles."),textStyles:f.optional().describe("Text custom styling styles.")}),to=u.z.object({id:u.z.string().optional(),name:u.z.string().describe("Group/dropzone name."),singleItem:u.z.boolean().optional().describe("Accept only one item inside."),background:p.optional().describe("Background image/color for group."),x:u.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:u.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:u.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:u.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:u.z.number().optional().describe("Manual width in pixels."),height:u.z.number().optional().describe("Manual height in pixels."),opacity:u.z.number().optional().describe("Opacity of the group (0-1)."),styles:h.optional().describe("Box custom styling styles."),textStyles:f.optional().describe("Text custom styling styles."),items:u.z.array(eo).describe("Items that belong in this group.")}),Vo=u.z.object({groups:u.z.array(to).min(1).describe("Drag-and-drop groups."),layout:u.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:u.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:u.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:u.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:u.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:p.optional().describe("Shared background image/color for all groups."),itemBackground:p.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:u.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:u.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:u.z.number().optional().describe("Proportion ratio for split layout.")});var D=require("zod"),oo=D.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),ro=D.z.object({colors:D.z.array(D.z.string()).optional(),xAxisLabel:D.z.string().optional(),yAxisLabel:D.z.string().optional(),showLegend:D.z.boolean().optional(),showTooltip:D.z.boolean().optional(),stacked:D.z.boolean().optional(),seriesNames:D.z.record(D.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")}),Ho=D.z.object({chartType:oo.optional(),chartData:D.z.array(D.z.record(D.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:ro.optional()});var Ne=require("zod");var qo=Ne.z.object({content:Ne.z.any().optional().describe("For Editor: Plate JSON content array."),url:Ne.z.string().optional().describe("For Media or Embed: content URL."),text:Ne.z.string().optional().describe("For Shape: text inside shape."),mediaType:F.optional().describe("For Media: media type.")});var yr=jr(require("zod-to-json-schema"));function x(o){return o}var $o={type:"Quiz",contentSchema:Te,themeSchema:H,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:ae},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Yo={type:"Editor",contentSchema:ze,themeSchema:$,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var Jo={type:"Hotpoint",contentSchema:Ce,themeSchema:V,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},vrMode:"custom",analytics:{scorable:!1}},version:1};var Uo={type:"Embed",contentSchema:Ae,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var Zo={type:"Media",contentSchema:we,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var Xo={type:"DragAndDrop",contentSchema:De,themeSchema:q,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:be},styleTargets:{title:["title"],answers:["item"],general:["container"]},vrMode:"raster",analytics:{scorable:!0}},version:1};var er={type:"Anagram",contentSchema:Ie,themeSchema:Y,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var tr={type:"Dice",contentSchema:je,themeSchema:J,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},vrMode:"interactive",analytics:{scorable:!1}},version:1};var an=se.shape.words.unwrap().element,or={type:"Crossword",contentSchema:se,themeSchema:U,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:an},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var cn=le.shape.words.unwrap().element,rr={type:"WordSearch",contentSchema:le,themeSchema:Z,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:cn},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var nr={type:"Puzzle",contentSchema:Me,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var ir={type:"Memory",contentSchema:ve,themeSchema:X,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:ge},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var ar={type:"Flashcard",contentSchema:Oe,themeSchema:re,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:ke},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var cr={type:"SpinningWheel",contentSchema:Pe,themeSchema:ee,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:Se},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var sr={type:"Chart",contentSchema:Ee,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var lr={type:"MatchPairs",contentSchema:Le,themeSchema:ne,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:Be},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var pr={type:"Shape",contentSchema:We,themeSchema:ie,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var mr={type:"Arrow",contentSchema:Fe,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var dr={type:"Cloze",contentSchema:Re,themeSchema:te,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var hr={type:"CardDeck",contentSchema:_e,themeSchema:oe,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:xe},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var P={Quiz:$o,Editor:Yo,Hotpoint:Jo,Embed:Uo,Media:Zo,DragAndDrop:Xo,Anagram:er,Dice:tr,Crossword:or,WordSearch:rr,Puzzle:nr,Memory:ir,Flashcard:ar,SpinningWheel:cr,Chart:sr,MatchPairs:lr,Shape:pr,Arrow:mr,Cloze:dr,CardDeck:hr};function ur(o){return P[o]}var ct=Object.fromEntries(R.map(o=>[o,P[o].contentSchema])),fr=Object.fromEntries(R.map(o=>[o,P[o].capabilities.styleTargets??{}]));var sn=yr.zodToJsonSchema,pe=ct;function ln(o,i,n,c){let a=n?"*required*":"optional",l=no(i),s=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function no(o){return o.enum?`enum: ${o.enum.map(i=>JSON.stringify(i)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(no).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${no(o.items)}>`:o.type==="object"?"object":o.type??"any"}function io(o,i){let n=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))n.push(ln(l,s,c.has(l),i)),s.type==="object"&&s.properties?n.push(io(s,i+" ")):s.type==="array"&&s.items?.type==="object"&&n.push(io(s.items,i+" "));return n.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
${
|
|
1
|
+
"use strict";var Po=Object.create;var Me=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Lo=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,No=Object.prototype.hasOwnProperty;var Wo=(o,i)=>{for(var n in i)Me(o,n,{get:i[n],enumerable:!0})},Lt=(o,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of Lo(i))!No.call(o,a)&&a!==n&&Me(o,a,{get:()=>i[a],enumerable:!(c=_o(i,a))||c.enumerable});return o};var Fo=(o,i,n)=>(n=o!=null?Po(Ro(o)):{},Lt(i||!o||!o.__esModule?Me(n,"default",{value:o,enumerable:!0}):n,o)),Qo=o=>Lt(Me({},"__esModule",{value:!0}),o);var Cr={};Wo(Cr,{ActionBlockSchema:()=>eo,ActionConditionSchema:()=>Ne,ActionSchema:()=>Fe,ActionTypeSchema:()=>lt,ActionVariableSchema:()=>pt,ActivityContentMigrationError:()=>Ie,ActivityContentSchema:()=>to,ActivityContextSchema:()=>ro,ActivityVariableSchema:()=>Zt,AnagramBlockSchema:()=>be,AnagramBlockThemeSchema:()=>_,AnimationSchema:()=>rt,ArrowBlockSchema:()=>De,ArrowHeadTypeSchema:()=>He,ArrowLabelSchema:()=>Ct,BASE_BLOCK_FIELDS:()=>Ge,BLOCK_CONTENT_SCHEMAS:()=>Z,BLOCK_REGISTRY:()=>A,BLOCK_STYLE_KEYS:()=>it,BLOCK_TYPES:()=>I,BlockEventSchema:()=>Ut,BlockEventTypeSchema:()=>We,BlockGroupSchema:()=>At,BlockSchema:()=>$e,BlockThemeSchema:()=>B,BlockTypeSchema:()=>Pe,BoxSideSchema:()=>Le,BoxStylesSchema:()=>d,CANVAS_OP_NAMES:()=>Ko,CANVAS_OP_REQUIRED:()=>Ee,CURRENT_SCHEMA_VERSION:()=>Ye,CanvasDragItemSchema:()=>oo,CanvasOpSchema:()=>Xe,CardDeckBlockSchema:()=>ze,CardDeckBlockThemeSchema:()=>K,CardItemSchema:()=>le,ChartBlockSchema:()=>Te,ChoiceQuestionSchema:()=>ht,ClickConditionSchema:()=>Yt,ClozeBlockSchema:()=>we,ClozeBlockThemeSchema:()=>Q,ConditionOperatorSchema:()=>ct,CropDataSchema:()=>tt,CrosswordBlockSchema:()=>Y,CrosswordBlockThemeSchema:()=>R,CrosswordCellSchema:()=>St,CrosswordLayoutOutputSchema:()=>xt,CrosswordLayoutWordSchema:()=>kt,DiceBlockSchema:()=>ge,DiceBlockThemeSchema:()=>L,DiceTypeSchema:()=>gt,DragAndDropBlockSchema:()=>ye,DragAndDropBlockThemeSchema:()=>O,DragAndDropGroupSchema:()=>ie,DragAndDropItemSchema:()=>bt,EditorBlockSchema:()=>he,EditorBlockThemeSchema:()=>P,EmbedBlockSchema:()=>fe,FlashcardBlockSchema:()=>xe,FlashcardBlockThemeSchema:()=>V,FlashcardContentSchema:()=>Ve,FlashcardItemSchema:()=>se,GridSizeSchema:()=>oe,HotpointBlockSchema:()=>de,HotpointBlockThemeSchema:()=>M,ImageAlignSchema:()=>Qe,ImageSizeSchema:()=>Ke,KeyPressConditionSchema:()=>Jt,MatchPairsBlockSchema:()=>Ce,MatchPairsBlockThemeSchema:()=>H,MatchPairsPairSchema:()=>pe,MathOperationSchema:()=>st,MediaBlockSchema:()=>ue,MediaItemSchema:()=>S,MediaRefSchema:()=>Kt,MediaSourceSchema:()=>et,MediaTypeSchema:()=>re,MemoryBlockSchema:()=>ke,MemoryBlockThemeSchema:()=>W,MemoryPairSchema:()=>ae,PositionSchema:()=>_e,PuzzleBlockSchema:()=>Se,PuzzleGameModeSchema:()=>wt,QuestionOptionSchema:()=>mt,QuestionSchema:()=>$,QuestionTypeSchema:()=>Xt,QuizBlockSchema:()=>me,QuizBlockThemeSchema:()=>E,QuizConditionSchema:()=>$t,REGISTRY_CONTENT_SCHEMAS:()=>qe,REGISTRY_STYLE_TARGETS:()=>zo,RadiusSchema:()=>nt,STYLE_TARGET_MAP:()=>ne,SceneBlockRefSchema:()=>It,SceneSchema:()=>Dt,SceneSummarySchema:()=>jt,SceneTypeSchema:()=>yt,ShapeBlockSchema:()=>Ae,ShapeBlockThemeSchema:()=>G,ShapeTypeSchema:()=>Tt,SizeSchema:()=>v,SpinningWheelBlockSchema:()=>Be,SpinningWheelBlockThemeSchema:()=>F,TextQuestionSchema:()=>ft,TextStylesSchema:()=>b,TimerConditionSchema:()=>qt,TrueFalseQuestionSchema:()=>ut,UNSTYLEABLE_BLOCKS:()=>at,VideoSettingsSchema:()=>ot,WheelSliceSchema:()=>ce,WordSearchBlockSchema:()=>J,WordSearchBlockThemeSchema:()=>N,WordSearchDataSchema:()=>Bt,WordSearchDifficultySchema:()=>zt,actionsV1toV2:()=>vo,applyItemPatch:()=>Ho,createCanvasOpValidator:()=>mr,defineBlock:()=>k,detectConflict:()=>ur,entitySignature:()=>Ft,generateBlockReference:()=>Do,getAllBlockJsonSchemas:()=>Tr,getBlockDefinition:()=>wo,getBlockJsonSchema:()=>Oo,getCapabilitiesManifest:()=>kr,isKnownCanvasOp:()=>Rt,listBlockTypes:()=>Eo,mapLogicalThemeStyles:()=>Re,mergeTheme:()=>Gt,migrateActivityContent:()=>jo,opConflictStamp:()=>fr,opTarget:()=>Wt,parseMentions:()=>xr,realStyleKeysFor:()=>Vt,resolveMentions:()=>Br,stableStringify:()=>te,styleTargetsHelpFor:()=>Ht,validateCanvasOp:()=>Vo});module.exports=Qo(Cr);var Ee={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},Ko=Object.keys(Ee);function Rt(o){return Object.prototype.hasOwnProperty.call(Ee,o)}function Vo(o,i){if(!Rt(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=Ee[o].filter(a=>n[a]===void 0||n[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Ho(o,i,n){let c=Array.isArray(o)?[...o]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let a=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,n.item),c}return i==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===n.itemId?{...a,...n.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===n.itemId))}var r=require("zod"),j=()=>r.z.record(r.z.string(),r.z.unknown()),Go=r.z.object({scene:j().optional(),newIndex:r.z.number().optional()}).passthrough(),$o=r.z.object({sceneId:r.z.string()}),qo=r.z.object({sceneId:r.z.string(),block:j()}),Yo=r.z.object({sceneId:r.z.string(),updates:j().optional(),newIndex:r.z.number().optional()}),Jo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Zo=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),updates:j()}),Uo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Xo=r.z.object({blockIds:r.z.array(r.z.string())}),er=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),theme:j()}),tr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),elementId:r.z.string(),customStyle:j()}),or=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),action:j()}),rr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),actionId:r.z.string()}),nr=r.z.object({operation:r.z.string(),name:r.z.string(),defaultValue:r.z.unknown().optional()}).passthrough(),ir=r.z.object({scope:r.z.string().optional(),sceneId:r.z.string().optional(),blockId:r.z.string().optional(),hasTimer:r.z.boolean().optional(),timer:r.z.unknown().optional()}).passthrough(),ar=r.z.object({sceneId:r.z.string(),newIndex:r.z.number()}),cr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),item:r.z.unknown(),at:r.z.number().optional()}),sr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string(),item:r.z.unknown()}),lr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string()}),pr=r.z.object({activity:r.z.unknown()}),Xe=r.z.discriminatedUnion("action",[r.z.object({action:r.z.literal("createScene"),data:Go}),r.z.object({action:r.z.literal("deleteScene"),data:$o}),r.z.object({action:r.z.literal("addBlock"),data:qo}),r.z.object({action:r.z.literal("updateScene"),data:Yo}),r.z.object({action:r.z.literal("deleteBlock"),data:Jo}),r.z.object({action:r.z.literal("updateBlock"),data:Zo}),r.z.object({action:r.z.literal("duplicateBlock"),data:Uo}),r.z.object({action:r.z.literal("groupBlocks"),data:Xo}),r.z.object({action:r.z.literal("updateBlockTheme"),data:er}),r.z.object({action:r.z.literal("updateBlockElementStyle"),data:tr}),r.z.object({action:r.z.literal("addAction"),data:or}),r.z.object({action:r.z.literal("removeAction"),data:rr}),r.z.object({action:r.z.literal("manageVariables"),data:nr}),r.z.object({action:r.z.literal("configureTimer"),data:ir}),r.z.object({action:r.z.literal("reorderScenes"),data:ar}),r.z.object({action:r.z.literal("insertItem"),data:cr}),r.z.object({action:r.z.literal("updateItem"),data:sr}),r.z.object({action:r.z.literal("deleteItem"),data:lr}),r.z.object({action:r.z.literal("replaceActivity"),data:pr})]);var Nt=require("zod");function Oe(o){return o.issues.map(i=>{let n=i.path.join(".");return n?`${n}: ${i.message}`:i.message})}function mr(o,i){return n=>{let c=Xe.safeParse(n);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:Oe(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,h=typeof s.type=="string"?s.type:void 0,u=h?o.getContentSchema(h):void 0;if(!h||!u)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let f=u.safeParse(s);return f.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:Oe(f.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=i?.(l.blockId);if(!s)return{ok:!0};let h=o.getCollectionSchema(s,l.collection);if(!h)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let u=h.safeParse(l.item);if(!u.success)return{ok:!1,code:"ITEM_INVALID",errors:Oe(u.error)}}return{ok:!0}}if(a==="updateBlock"){let s=i?.(l.blockId),h=s?o.getContentSchema(s):void 0;if(!h)return{ok:!0};if(h instanceof Nt.z.ZodObject){let f=h.deepPartial().safeParse(l.updates);if(!f.success)return{ok:!1,code:"CONTENT_INVALID",errors:Oe(f.error)}}return{ok:!0}}return{ok:!0}}}var dr=new Set(["position","size","rotation","zIndex","z"]);function te(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(te).join(",")+"]":"{"+Object.keys(o).sort().map(n=>JSON.stringify(n)+":"+te(o[n])).join(",")+"}"}function Wt(o,i){let n=i??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function hr(o,i){if(Array.isArray(o))for(let n of o){let c=n?.blocks?.find?.(a=>a&&a.id===i);if(c)return c}}function Ft(o,i){if(i.kind==="untracked")return null;let n=i.blockId?hr(o,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let l={};for(let s of Object.keys(n))dr.has(s)||(l[s]=n[s]);return te(l)}let c=n[i.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===i.itemId);return a?te(a):null}function ur(o,i){return o==null?"apply":i==null?"missing":o===i?"apply":"stale"}function fr(o,i,n){let c=Wt(o,i);return{target:c,baseSignature:Ft(n,c)}}var Qt=require("zod"),I=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Pe=Qt.z.enum(I);var m=require("zod"),_e=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()}),v=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()}),oe=m.z.object({rows:m.z.number(),cols:m.z.number()}),re=m.z.enum(["image","color","gif","shape","illustration","video","audio"]),et=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]),tt=m.z.object({x:m.z.number(),y:m.z.number(),width:m.z.number(),height:m.z.number(),zoom:m.z.number().optional(),rotation:m.z.number().optional(),aspect:m.z.number().optional()}),ot=m.z.object({autoplay:m.z.boolean().optional(),loop:m.z.boolean().optional(),muted:m.z.boolean().optional(),controls:m.z.boolean().optional(),poster:m.z.string().optional(),volume:m.z.number().optional()}),S=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:re.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:et.optional(),alt:m.z.string().optional(),width:m.z.number().optional(),height:m.z.number().optional(),format:m.z.enum(["cover","contain"]).optional(),color:m.z.string().optional(),cropData:tt.optional(),duration:m.z.number().optional(),videoSettings:ot.optional()}),Kt=S;var t=require("zod");var rt=t.z.object({type:t.z.union([t.z.enum(["none","fade","direction","bounce","scale","rotate"]),t.z.string()]),duration:t.z.number().optional(),delay:t.z.number().optional(),phase:t.z.enum(["in","both","out"]).optional(),direction:t.z.enum(["up","right","down","left"]).optional()}),Le=t.z.object({top:t.z.union([t.z.string(),t.z.number()]).optional(),right:t.z.union([t.z.string(),t.z.number()]).optional(),bottom:t.z.union([t.z.string(),t.z.number()]).optional(),left:t.z.union([t.z.string(),t.z.number()]).optional()}),nt=t.z.object({topLeft:t.z.union([t.z.string(),t.z.number()]).optional(),topRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomLeft:t.z.union([t.z.string(),t.z.number()]).optional()}),d=t.z.object({background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),backgroundOpacity:t.z.number().optional(),backgroundMedia:S.optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:Le.optional(),borderRadius:nt.optional(),padding:t.z.union([t.z.string(),t.z.number(),Le]).optional()}),b=t.z.object({color:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),fontWeight:t.z.union([t.z.string(),t.z.number()]).optional(),textAlign:t.z.enum(["left","center","right","justify"]).optional()}),z=d.merge(b),B=t.z.object({spacing:t.z.enum(["no-spacing","small","medium","large"]).optional(),animation:rt.optional(),styles:t.z.record(t.z.record(t.z.any())).optional()}),M=B.extend({styles:t.z.object({hotpoint:t.z.object({icon:t.z.string().optional(),iconPosition:t.z.enum(["left","right"]).optional(),iconSize:t.z.string().optional(),iconColor:t.z.string().optional(),image:S.optional(),imageFormat:t.z.enum(["circle","square","custom"]).optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:t.z.string().optional(),borderRadius:t.z.string().optional(),glow:t.z.boolean().optional(),glowColor:t.z.string().optional(),background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),textColor:t.z.string().optional()}).optional()}).optional()}),E=B.extend({layout:t.z.enum(["horizontal","vertical","grid"]),gridColumns:t.z.number().optional(),preset:t.z.enum(["default","modern","trivia","custom"]),styles:t.z.object({general:z,question:z,answers:z.extend({customStyles:t.z.array(t.z.object({color:t.z.string().optional(),backgroundColor:t.z.string().optional(),targets:t.z.string().optional()})).optional(),hover:z.optional()}),button:z.extend({variant:t.z.enum(["default","outline","ghost"]).optional(),hover:z.optional()})}).optional()}),O=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),gridColumns:t.z.number().optional(),gridGap:t.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.z.object({x:t.z.number().optional(),y:t.z.number().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.z.object({title:b.optional(),sandbox:d.optional(),item:z.optional(),group:d.optional(),container:d.extend({url:t.z.string().optional(),type:re.optional()}).optional(),groups:z.optional(),feedback:t.z.object({correct:t.z.string().optional(),incorrect:t.z.string().optional(),active:t.z.string().optional()}).optional(),referenceSize:t.z.object({width:t.z.number(),height:t.z.number()}).optional()}).optional()}),P=B.extend({styles:t.z.object({editor:d.optional()}).optional()}),_=B.extend({styles:t.z.object({letter:d.optional(),letterText:b.optional(),slot:d.optional(),container:d.optional()}).optional()}),L=B.extend({styles:t.z.object({button:d.extend({hover:z.optional()}).optional(),buttonText:b.optional(),container:d.optional()}).optional()}),R=B.extend({primaryColor:t.z.string().optional(),layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({text:b.optional(),cell:d.optional(),grid:d.optional(),clueContainer:d.optional(),clueText:b.optional(),clueTitle:b.optional()}).optional()}),N=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({wordSearch:t.z.object({primaryColor:t.z.string().optional(),highlightColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),textColor:t.z.string().optional(),cellBackgroundColor:t.z.string().optional()}).optional(),text:b.optional(),cell:d.optional(),grid:d.optional(),wordListContainer:d.optional(),wordListText:b.optional(),wordListTitle:b.optional()}).optional()}),W=B.extend({styles:t.z.object({text:b.optional(),container:d.optional(),infoContainer:d.optional(),infoText:b.optional(),card:d.optional()}).optional()}),F=B.extend({styles:t.z.object({wheelText:b.optional()}).optional()}),Q=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),container:d.optional(),wordBank:d.optional(),word:d.optional(),blank:d.optional()}).optional()}),K=B.extend({styles:t.z.object({card:d.optional(),cardText:b.optional(),container:d.optional()}).optional()}),V=B.extend({styles:t.z.object({cardFront:d.optional(),cardBack:d.optional(),frontText:b.optional(),backText:b.optional(),navigation:d.optional(),navigationText:b.optional()}).optional()}),H=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),card:d.optional(),container:d.optional()}).optional()}),G=B.extend({styles:t.z.object({shape:z.extend({fillColor:t.z.string().optional(),textColor:t.z.string().optional(),borderStyle:t.z.enum(["solid","dashed","dotted"]).optional(),padding:t.z.number().optional()}).optional()}).optional()});var ne={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function Vt(o){let i=ne[o.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let a of c??[])n.add(a);return[...n]}var it={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]},at=new Set(["chart","media","image","puzzle"]);function Ht(o){if(!o)return"";let i=o.toLowerCase();if(at.has(i))return`
|
|
2
|
+
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let n=it[i];if(!n||n.length===0)return"";let c=ne[i]??{},a=["general","title","answers","button"].filter(l=>c[l]).map(l=>`${l}\u2192${c[l].join("/")}`).join(", ");return`
|
|
3
|
+
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Re(o,i){if(!o)return o;let n={...o};for(let[h,u]of Object.entries(n))if(u&&typeof u=="object"){let f={...u},y=!1;f.backgroundColor!==void 0&&f.background===void 0&&(f.background=!0,y=!0),f.borderColor!==void 0&&f.border===void 0&&(f.border=!0,y=!0),y&&(n[h]=f)}if(!i)return n;let c=ne[i.toLowerCase()];if(!c)return n;let a=(h,u)=>{u&&(n[h]={...n[h]||{},...u})},l=["title","answers","button","general"],s={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let h of l){let u=s[h],f=c[h];if(u&&f)for(let y of f)a(y,u)}return n}function Gt(o,i,n){if(!o){let s={...i};return s.styles&&(s.styles=Re(s.styles,n)),s}if(!i)return o;let c={...o,...i},a=Re(i.styles,n),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}var p=require("zod"),We=p.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),ct=p.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),$t=p.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),qt=p.z.enum(["completed","half_way"]),Yt=p.z.enum(["single_click","double_click"]),Jt=p.z.literal("key_pressed"),Ne=p.z.object({event:We.optional(),variableName:p.z.string().optional(),operator:ct.optional(),value:p.z.any()}),st=p.z.enum(["set","add","subtract","multiply","divide"]),lt=p.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),pt=p.z.object({name:p.z.string(),value:p.z.union([p.z.number(),p.z.string(),p.z.boolean()]),operation:st.optional()}),Fe=p.z.object({id:p.z.string(),type:lt,condition:Ne.optional(),conditions:p.z.array(Ne).optional(),conditionsOperator:p.z.enum(["and","or"]).optional(),modalContent:p.z.string().optional(),audioUrl:p.z.string().optional(),linkUrl:p.z.string().optional(),targetSceneId:p.z.string().optional(),targetBlockId:p.z.string().optional(),direction:p.z.enum(["up","down","left","right"]).optional(),distance:p.z.number().optional(),variable:pt.optional()}),Zt=p.z.object({name:p.z.string(),defaultValue:p.z.union([p.z.string(),p.z.number(),p.z.boolean()])}),Ut=p.z.object({type:We,blockId:p.z.string(),data:p.z.record(p.z.any()).optional()});var g=require("zod");var Xt=g.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Qe=g.z.enum(["left","right","center"]),Ke=g.z.object({width:g.z.number().optional(),height:g.z.number().optional()}),mt=g.z.object({id:g.z.string(),text:g.z.string().describe("The option's answer text."),isCorrect:g.z.boolean().describe("Whether this option is a correct answer."),image:S.optional().describe("Option image."),imageAlign:Qe.optional().describe("Option image alignment."),imageSize:Ke.optional().describe("Option image size.")}),dt={id:g.z.string(),text:g.z.string().describe("The question text."),score:g.z.number().optional(),image:S.optional().describe("Question image."),imageAlign:Qe.optional().describe("Question image alignment."),imageSize:Ke.optional().describe("Question image size.")},ht=g.z.object({...dt,type:g.z.enum(["single-choice","multiple-choice"]),options:g.z.array(mt).describe("Answer options for this choice question.")}),ut=g.z.object({...dt,type:g.z.literal("true-false"),correctAnswer:g.z.boolean().describe("The correct answer (true or false).")}),ft=g.z.object({...dt,type:g.z.enum(["short-answers","long-answers"]),minCharacters:g.z.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:g.z.number().optional().describe("Maximum number of characters allowed in the answer.")}),$=g.z.discriminatedUnion("type",[ht,ut,ft]);var e=require("zod");var yt=e.z.enum(["2D","360\xB0"]),q={id:e.z.string(),type:Pe,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:_e.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:v.optional(),minSize:v.optional(),maxSize:v.optional(),theme:B.optional()},T={...q,actions:e.z.array(Fe).optional(),score:e.z.number().optional()},Ge=Object.freeze(Object.keys(q)),eo=e.z.object(T),bt=e.z.object({id:e.z.string(),text:e.z.string(),background:S.optional().describe("Background image/color for item."),opacity:e.z.number().optional().describe("Opacity of the item (0-1)."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles.")}),ie=e.z.object({id:e.z.string(),name:e.z.string().describe("Group/dropzone name."),background:S.optional().describe("Background image/color for group."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),singleItem:e.z.boolean().optional().describe("Accept only one item inside."),opacity:e.z.number().optional().describe("Opacity of the group (0-1)."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles."),items:e.z.array(bt).describe("Items that belong in this group.")}),gt=e.z.enum(["d4","d6","d8","d10","d12","d20"]),St=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()}),kt=e.z.object({answer:e.z.string(),clue:e.z.string(),image:S.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()}),xt=e.z.object({grid:e.z.array(e.z.array(St)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(kt)}),Bt=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))}),ae=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.z.tuple([e.z.string(),e.z.string()]).describe("Pair content [item1, item2].")}),ce=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional().describe("CSS color for the slice."),image:S.optional().describe("Slice image.")}),Ve=e.z.object({type:e.z.enum(["text","image"]).describe("Content type: text or image."),content:e.z.any().describe("The content value: a string for text, or a MediaItem for image.")}),se=e.z.object({id:e.z.string(),front:Ve.describe("Front side."),back:Ve.describe("Back side.")}),le=e.z.object({id:e.z.string(),frontImage:S.optional().describe("Front image."),frontText:e.z.string().optional().describe("Front text.")}),pe=e.z.object({id:e.z.string(),leftLabel:e.z.string().describe("Left side text."),rightLabel:e.z.string().describe("Right side text."),leftImage:e.z.any().optional().describe("Left side image."),rightImage:e.z.any().optional().describe("Right side image.")}),Tt=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),He=e.z.enum(["none","arrow","circle","square"]),Ct=e.z.object({id:e.z.string(),text:e.z.string().describe("Label text."),t:e.z.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.z.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.z.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.z.number().optional().describe("Label font size."),color:e.z.string().optional().describe("Label text color."),backgroundColor:e.z.string().optional().describe("Label background color.")}),me=e.z.object({...T,type:e.z.literal("Quiz"),questions:e.z.array($).optional().describe("Array of question objects."),previewIndex:e.z.number().optional().describe("Index of the question currently previewed in the editor."),required:e.z.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.z.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.z.string().optional().describe("Label for submit button."),timer:e.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.z.boolean().optional().describe("Show current/total questions count."),theme:E}),de=e.z.object({...T,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.z.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:M.optional()}),he=e.z.object({...T,type:e.z.literal("Editor"),content:e.z.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.z.boolean().optional().describe("Make the editor content read-only during play."),theme:P.optional()}),ue=e.z.object({...q,type:e.z.literal("Media"),media:S.optional().describe("Media asset displayed by this block.")}),fe=e.z.object({...q,type:e.z.literal("Embed"),url:e.z.string().optional().describe("Embed content URL."),readOnly:e.z.boolean().optional().describe("Prevent interaction with the embedded content.")}),ye=e.z.object({...T,type:e.z.literal("DragAndDrop"),groups:e.z.array(ie).describe("Drag-and-drop groups."),theme:O.optional(),showResults:e.z.boolean().optional().describe("Show result feedback immediately."),layout:e.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:S.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.z.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:S.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.z.number().optional().describe("Proportion ratio for split layout.")}),be=e.z.object({...T,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.z.string().describe("The correct word."),theme:_.optional(),clue:e.z.string().optional().describe("A hint."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed.")}),ge=e.z.object({...T,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional().describe("History of previous roll results."),diceType:gt.optional().describe("Type of die (number of faces)."),faceOverrides:e.z.any().optional().describe("Custom overrides for individual die faces."),color:e.z.string().optional().describe("CSS color for dice."),showNumber:e.z.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.z.number().optional().describe("Number of dice to roll together."),dicePool:e.z.record(e.z.number()).optional().describe("Named pool of dice configurations."),persistent:e.z.boolean().optional().describe("Keep dice visible after roll."),theme:L.optional()}),wt=e.z.enum(["scattered","rotated","scattered_rotated"]),Se=e.z.object({...T,type:e.z.literal("Puzzle"),image:S.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.z.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:wt.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.z.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.z.string().optional().describe("Deterministic seed for piece placement.")}),Y=e.z.object({...T,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string().describe("The answer for this clue."),clue:e.z.string().describe("The clue text shown to the learner."),image:S.optional().describe("Clue image.")})).optional(),layout:xt.optional(),theme:R.optional()}),zt=e.z.enum(["easy","medium","hard"]),J=e.z.object({...T,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional().describe("List of words to hide in the grid."),gridSize:oe.optional().describe("Grid dimensions."),difficulty:zt.optional().describe("Difficulty level, affecting word placement and grid noise."),data:Bt.optional(),theme:N.optional()}),ke=e.z.object({...T,type:e.z.literal("Memory"),pairs:e.z.array(ae).describe("Array of pair objects."),gridSize:oe.optional().describe("Grid dimensions."),hideScore:e.z.boolean().optional().describe("Hide the score display during play."),theme:W.optional()}),xe=e.z.object({...T,type:e.z.literal("Flashcard"),cards:e.z.array(se).describe("Array of card objects."),theme:V.optional()}),Be=e.z.object({...T,type:e.z.literal("SpinningWheel"),slices:e.z.array(ce).describe("Wheel slices (min 2)."),spinDuration:e.z.number().optional().describe("Spin duration in seconds."),theme:F.optional()}),Te=e.z.object({...T,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.z.array(e.z.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.z.string().optional().describe("Label for the X axis."),yAxisLabel:e.z.string().optional().describe("Label for the Y axis."),showLegend:e.z.boolean().optional().describe("Show the chart legend."),showTooltip:e.z.boolean().optional().describe("Show tooltips on hover."),stacked:e.z.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.z.record(e.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),Ce=e.z.object({...T,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional().describe("Instruction text."),pairs:e.z.array(pe).describe("Array of pair objects."),theme:H.optional()}),we=e.z.object({...T,type:e.z.literal("Cloze"),templateText:e.z.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:Q.optional(),mode:e.z.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),ze=e.z.object({...T,type:e.z.literal("CardDeck"),cards:e.z.array(le).describe("Array of card objects."),backImage:S.optional().describe("Shared back image for all cards."),discardLogic:e.z.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:K.optional()}),Ae=e.z.object({...q,type:e.z.literal("Shape"),shapeType:Tt.optional().describe("Shape outline to render."),text:e.z.string().optional().describe("Text inside shape."),theme:G.optional()}),De=e.z.object({...q,type:e.z.literal("Arrow"),startBlockId:e.z.string().describe("ID of the block this arrow starts from."),endBlockId:e.z.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.z.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.z.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.z.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.z.string().optional().describe("Line color."),strokeWidth:e.z.number().optional().describe("Line thickness in pixels."),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.z.boolean().optional().describe("Show arrowheads on the line."),startHead:He.optional().describe("Arrowhead style at the start."),endHead:He.optional().describe("Arrowhead style at the end."),bendOffsetX:e.z.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.z.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.z.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.z.array(e.z.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.z.array(Ct).optional().describe("Text labels placed along the arrow.")}),$e=e.z.discriminatedUnion("type",[me,de,he,fe,ue,ye,be,ge,Se,Y,J,ke,xe,Be,Te,Ce,Ae,De,we,ze]),At=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()}),Dt=e.z.object({id:e.z.string(),title:e.z.string(),type:yt,background:e.z.union([e.z.string(),e.z.array(e.z.string()),S]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array($e),groups:e.z.array(At).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),to=e.z.object({id:e.z.string(),title:e.z.string(),schemaVersion:e.z.number().optional(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(Dt),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:S.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()}),oo=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:$e});var C=require("zod"),It=C.z.object({id:C.z.string(),type:C.z.string(),title:C.z.string()}),jt=C.z.object({id:C.z.string(),title:C.z.string(),position:C.z.number(),blocks:C.z.array(It).default([])}),ro=C.z.object({activity:C.z.object({id:C.z.string(),title:C.z.string(),scenes:C.z.array(jt).default([])}),activeSceneId:C.z.string().nullable().optional()});var Ao=Fo(require("zod-to-json-schema"));function k(o){return o}var no={type:"Quiz",contentSchema:me,themeSchema:E,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:$},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var io={type:"Editor",contentSchema:he,themeSchema:P,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var ao={type:"Hotpoint",contentSchema:de,themeSchema:M,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},vrMode:"custom",analytics:{scorable:!1}},version:1};var co={type:"Embed",contentSchema:fe,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var so={type:"Media",contentSchema:ue,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var lo={type:"DragAndDrop",contentSchema:ye,themeSchema:O,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:ie},styleTargets:{title:["title"],answers:["item"],general:["container"]},vrMode:"raster",analytics:{scorable:!0}},version:1};var po={type:"Anagram",contentSchema:be,themeSchema:_,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var mo={type:"Dice",contentSchema:ge,themeSchema:L,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},vrMode:"interactive",analytics:{scorable:!1}},version:1};var yr=Y.shape.words.unwrap().element,ho={type:"Crossword",contentSchema:Y,themeSchema:R,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:yr},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var br=J.shape.words.unwrap().element,uo={type:"WordSearch",contentSchema:J,themeSchema:N,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:br},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var fo={type:"Puzzle",contentSchema:Se,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var yo={type:"Memory",contentSchema:ke,themeSchema:W,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:ae},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var bo={type:"Flashcard",contentSchema:xe,themeSchema:V,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:se},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var go={type:"SpinningWheel",contentSchema:Be,themeSchema:F,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:ce},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var So={type:"Chart",contentSchema:Te,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var ko={type:"MatchPairs",contentSchema:Ce,themeSchema:H,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:pe},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var xo={type:"Shape",contentSchema:Ae,themeSchema:G,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var Bo={type:"Arrow",contentSchema:De,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var To={type:"Cloze",contentSchema:we,themeSchema:Q,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Co={type:"CardDeck",contentSchema:ze,themeSchema:K,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:le},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var A={Quiz:no,Editor:io,Hotpoint:ao,Embed:co,Media:so,DragAndDrop:lo,Anagram:po,Dice:mo,Crossword:ho,WordSearch:uo,Puzzle:fo,Memory:yo,Flashcard:bo,SpinningWheel:go,Chart:So,MatchPairs:ko,Shape:xo,Arrow:Bo,Cloze:To,CardDeck:Co};function wo(o){return A[o]}var qe=Object.fromEntries(I.map(o=>[o,A[o].contentSchema])),zo=Object.fromEntries(I.map(o=>[o,A[o].capabilities.styleTargets??{}]));var gr=Ao.zodToJsonSchema,Z=qe;function Sr(o,i,n,c){let a=n?"*required*":"optional",l=vt(i),s=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function vt(o){return o.enum?`enum: ${o.enum.map(i=>JSON.stringify(i)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(vt).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${vt(o.items)}>`:o.type==="object"?"object":o.type??"any"}function Mt(o,i){let n=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))n.push(Sr(l,s,c.has(l),i)),s.type==="object"&&s.properties?n.push(Mt(s,i+" ")):s.type==="array"&&s.items?.type==="object"&&n.push(Mt(s.items,i+" "));return n.join(`
|
|
4
|
+
`)}function Do(o={}){let i=[],n=new Map,c=Object.fromEntries(Ge.map(a=>[a,!0]));for(let[a,l]of Object.entries(Z)){let s=o.contentOnly?l.omit(c):l,h=n.get(s)??[];h.push(a),n.set(s,h)}for(let[a,l]of n.entries()){let s=l.join(" / "),h=gr(a,{target:"jsonSchema7"}),u=Mt(h,"");i.push(`### ${s}
|
|
5
|
+
${u||"_(no configurable fields)_"}`)}return i.join(`
|
|
6
6
|
|
|
7
|
-
`)}var
|
|
7
|
+
`)}var Ye=1,Io="__blockSchemaVersion",Ie=class extends Error{constructor(i){super(i),this.name="ActivityContentMigrationError"}};function jo(o,i=A){if(typeof o!="object"||o===null||Array.isArray(o))throw new Ie(`migrateActivityContent expects a non-null, non-array object; got ${o===null?"null":typeof o}`);let n=[],c=!1,a=o,s=(Array.isArray(a.scenes)?a.scenes:[]).map((u,f)=>{if(typeof u!="object"||u===null||Array.isArray(u))return n.push(`scenes[${f}]: not an object, left intact`),u;let y=u,x=Array.isArray(y.blocks)?y.blocks:[],w=!1,Je=x.map((U,je)=>{if(typeof U!="object"||U===null||Array.isArray(U))return n.push(`scenes[${f}].blocks[${je}]: not an object, left intact`),U;let X=U,ee=X.type,Ze=typeof ee=="string"?i[ee]:void 0;if(!Ze)return n.push(`scenes[${f}].blocks[${je}]: unknown block type "${String(ee)}", left intact`),X;let Ot=X[Io],D=typeof Ot=="number"?Ot:1,Ue=X,Pt=!1;for(;D<Ze.version;){let _t=Ze.migrations?.[D];if(!_t){n.push(`scenes[${f}].blocks[${je}]: missing migration from v${D} for type "${ee}", stopped at v${D}`);break}let ve=_t(Ue);if(typeof ve!="object"||ve===null||Array.isArray(ve)){n.push(`scenes[${f}].blocks[${je}]: migration from v${D} for type "${ee}" returned a non-object, stopped at v${D}`);break}Ue={...ve},Pt=!0,D+=1}return Pt?(w=!0,{...Ue,[Io]:D}):X});return w?(c=!0,{...y,blocks:Je}):y});return a.schemaVersion!==Ye&&(c=!0),{content:{...a,scenes:s,schemaVersion:Ye},changed:c,issues:n}}var vo=o=>{if(typeof o!="object"||o===null||Array.isArray(o))return o;let i=o;if(!Array.isArray(i.actions))return o;let n=i.actions.map(c=>{if(typeof c!="object"||c===null||Array.isArray(c))return c;let a=c;if(a.condition===void 0||Array.isArray(a.conditions))return a;let{condition:l,...s}=a;return{...s,conditions:[l],conditionsOperator:a.conditionsOperator??"and"}});return{...i,actions:n}};function kr(){return I.map(o=>{let i=A[o];return{type:o,version:i.version,hasActions:i.capabilities.hasActions,hasScore:i.capabilities.hasScore,collections:Object.keys(i.capabilities.collections??{}),styleTargets:i.capabilities.styleTargets??{},vrMode:i.capabilities.vrMode}})}var Et=/@\[([^\]|]+)\|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\]/g;function xr(o){let i=[];for(let n of(o??"").matchAll(Et))i.push({name:n[1].trim(),id:n[2]});return i}function Br(o,i){let n=new Map,c=new Map;for(let y of i?.scenes??[]){y?.id&&n.set(y.id,y);for(let x of y?.blocks??[])x?.id&&c.set(x.id,{block:x,sceneId:y.id})}let a=[],l=new Set,s=y=>c.has(y)?"il blocco selezionato":n.has(y)?"la scena selezionata":"l'elemento selezionato",h=(y,x)=>{if(!l.has(x))if(c.has(x)){let{block:w,sceneId:Je}=c.get(x);a.push({id:x,name:y,kind:"block",blockType:w?.type,sceneId:Je}),l.add(x)}else n.has(x)&&(a.push({id:x,name:y,kind:"scene"}),l.add(x))},u=(o??"").replace(Et,(y,x,w)=>(h(x.trim(),w),x.trim())),f=(o??"").replace(Et,(y,x,w)=>c.has(w)||n.has(w)?s(w):x.trim());return{cleanedText:u,agentText:f,entities:a}}var Mo=require("zod-to-json-schema");function Eo(){return Object.keys(Z)}function Oo(o){let i=Z[o];if(i)return(0,Mo.zodToJsonSchema)(i,{target:"jsonSchema7",$refStrategy:"none"})}function Tr(){return Object.fromEntries(Eo().map(o=>[o,Oo(o)]))}0&&(module.exports={ActionBlockSchema,ActionConditionSchema,ActionSchema,ActionTypeSchema,ActionVariableSchema,ActivityContentMigrationError,ActivityContentSchema,ActivityContextSchema,ActivityVariableSchema,AnagramBlockSchema,AnagramBlockThemeSchema,AnimationSchema,ArrowBlockSchema,ArrowHeadTypeSchema,ArrowLabelSchema,BASE_BLOCK_FIELDS,BLOCK_CONTENT_SCHEMAS,BLOCK_REGISTRY,BLOCK_STYLE_KEYS,BLOCK_TYPES,BlockEventSchema,BlockEventTypeSchema,BlockGroupSchema,BlockSchema,BlockThemeSchema,BlockTypeSchema,BoxSideSchema,BoxStylesSchema,CANVAS_OP_NAMES,CANVAS_OP_REQUIRED,CURRENT_SCHEMA_VERSION,CanvasDragItemSchema,CanvasOpSchema,CardDeckBlockSchema,CardDeckBlockThemeSchema,CardItemSchema,ChartBlockSchema,ChoiceQuestionSchema,ClickConditionSchema,ClozeBlockSchema,ClozeBlockThemeSchema,ConditionOperatorSchema,CropDataSchema,CrosswordBlockSchema,CrosswordBlockThemeSchema,CrosswordCellSchema,CrosswordLayoutOutputSchema,CrosswordLayoutWordSchema,DiceBlockSchema,DiceBlockThemeSchema,DiceTypeSchema,DragAndDropBlockSchema,DragAndDropBlockThemeSchema,DragAndDropGroupSchema,DragAndDropItemSchema,EditorBlockSchema,EditorBlockThemeSchema,EmbedBlockSchema,FlashcardBlockSchema,FlashcardBlockThemeSchema,FlashcardContentSchema,FlashcardItemSchema,GridSizeSchema,HotpointBlockSchema,HotpointBlockThemeSchema,ImageAlignSchema,ImageSizeSchema,KeyPressConditionSchema,MatchPairsBlockSchema,MatchPairsBlockThemeSchema,MatchPairsPairSchema,MathOperationSchema,MediaBlockSchema,MediaItemSchema,MediaRefSchema,MediaSourceSchema,MediaTypeSchema,MemoryBlockSchema,MemoryBlockThemeSchema,MemoryPairSchema,PositionSchema,PuzzleBlockSchema,PuzzleGameModeSchema,QuestionOptionSchema,QuestionSchema,QuestionTypeSchema,QuizBlockSchema,QuizBlockThemeSchema,QuizConditionSchema,REGISTRY_CONTENT_SCHEMAS,REGISTRY_STYLE_TARGETS,RadiusSchema,STYLE_TARGET_MAP,SceneBlockRefSchema,SceneSchema,SceneSummarySchema,SceneTypeSchema,ShapeBlockSchema,ShapeBlockThemeSchema,ShapeTypeSchema,SizeSchema,SpinningWheelBlockSchema,SpinningWheelBlockThemeSchema,TextQuestionSchema,TextStylesSchema,TimerConditionSchema,TrueFalseQuestionSchema,UNSTYLEABLE_BLOCKS,VideoSettingsSchema,WheelSliceSchema,WordSearchBlockSchema,WordSearchBlockThemeSchema,WordSearchDataSchema,WordSearchDifficultySchema,actionsV1toV2,applyItemPatch,createCanvasOpValidator,defineBlock,detectConflict,entitySignature,generateBlockReference,getAllBlockJsonSchemas,getBlockDefinition,getBlockJsonSchema,getCapabilitiesManifest,isKnownCanvasOp,listBlockTypes,mapLogicalThemeStyles,mergeTheme,migrateActivityContent,opConflictStamp,opTarget,parseMentions,realStyleKeysFor,resolveMentions,stableStringify,styleTargetsHelpFor,validateCanvasOp});
|