@edugate/ai-agent 0.1.0 → 0.1.2

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.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var zo=Object.create;var de=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var g=(a,i)=>()=>{try{return i||a((i={exports:{}}).exports,i),i.exports}catch(n){throw i=0,n}},Be=(a,i)=>{for(var n in i)de(a,n,{get:i[n],enumerable:!0})},me=(a,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of bo(i))!yo.call(a,l)&&l!==n&&de(a,l,{get:()=>i[l],enumerable:!(c=So(i,l))||c.enumerable});return a},I=(a,i,n)=>(me(a,i,"default"),n&&me(n,i,"default")),Qe=(a,i,n)=>(n=a!=null?zo(go(a)):{},me(i||!a||!a.__esModule?de(n,"default",{value:a,enumerable:!0}):n,a)),fo=a=>me(de({},"__esModule",{value:!0}),a);var _e=g(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.BlockTypeSchema=oe.BLOCK_TYPES=void 0;var To=require("zod");oe.BLOCK_TYPES=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"];oe.BlockTypeSchema=To.z.enum(oe.BLOCK_TYPES)});var L=g(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.MediaRefSchema=S.MediaItemSchema=S.VideoSettingsSchema=S.CropDataSchema=S.MediaSourceSchema=S.MediaTypeSchema=S.GridSizeSchema=S.SizeSchema=S.PositionSchema=void 0;var m=require("zod");S.PositionSchema=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()});S.SizeSchema=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()});S.GridSizeSchema=m.z.object({rows:m.z.number(),cols:m.z.number()});S.MediaTypeSchema=m.z.enum(["image","color","gif","shape","illustration","video","audio"]);S.MediaSourceSchema=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]);S.CropDataSchema=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()});S.VideoSettingsSchema=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.MediaItemSchema=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:S.MediaTypeSchema,source:S.MediaSourceSchema.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:S.CropDataSchema.optional(),duration:m.z.number().optional(),videoSettings:S.VideoSettingsSchema.optional()});S.MediaRefSchema=S.MediaItemSchema});var pe=g(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ShapeBlockThemeSchema=r.MatchPairsBlockThemeSchema=r.FlashcardBlockThemeSchema=r.CardDeckBlockThemeSchema=r.ClozeBlockThemeSchema=r.SpinningWheelBlockThemeSchema=r.MemoryBlockThemeSchema=r.WordSearchBlockThemeSchema=r.CrosswordBlockThemeSchema=r.DiceBlockThemeSchema=r.AnagramBlockThemeSchema=r.EditorBlockThemeSchema=r.DragAndDropBlockThemeSchema=r.QuizBlockThemeSchema=r.HotpointBlockThemeSchema=r.BlockThemeSchema=r.TextStylesSchema=r.BoxStylesSchema=r.RadiusSchema=r.BoxSideSchema=r.AnimationSchema=void 0;var o=require("zod"),je=L();r.AnimationSchema=o.z.object({type:o.z.union([o.z.enum(["none","fade","direction","bounce","scale","rotate"]),o.z.string()]),duration:o.z.number().optional(),delay:o.z.number().optional(),phase:o.z.enum(["in","both","out"]).optional(),direction:o.z.enum(["up","right","down","left"]).optional()});r.BoxSideSchema=o.z.object({top:o.z.union([o.z.string(),o.z.number()]).optional(),right:o.z.union([o.z.string(),o.z.number()]).optional(),bottom:o.z.union([o.z.string(),o.z.number()]).optional(),left:o.z.union([o.z.string(),o.z.number()]).optional()});r.RadiusSchema=o.z.object({topLeft:o.z.union([o.z.string(),o.z.number()]).optional(),topRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomLeft:o.z.union([o.z.string(),o.z.number()]).optional()});r.BoxStylesSchema=o.z.object({background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),backgroundOpacity:o.z.number().optional(),backgroundMedia:je.MediaItemSchema.optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:r.BoxSideSchema.optional(),borderRadius:r.RadiusSchema.optional(),padding:o.z.union([o.z.string(),o.z.number(),r.BoxSideSchema]).optional()});r.TextStylesSchema=o.z.object({color:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),fontWeight:o.z.union([o.z.string(),o.z.number()]).optional(),textAlign:o.z.enum(["left","center","right","justify"]).optional()});var K=r.BoxStylesSchema.merge(r.TextStylesSchema);r.BlockThemeSchema=o.z.object({spacing:o.z.enum(["no-spacing","small","medium","large"]).optional(),animation:r.AnimationSchema.optional(),styles:o.z.record(o.z.record(o.z.any())).optional()});r.HotpointBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({hotpoint:o.z.object({icon:o.z.string().optional(),iconPosition:o.z.enum(["left","right"]).optional(),iconSize:o.z.string().optional(),iconColor:o.z.string().optional(),image:je.MediaItemSchema.optional(),imageFormat:o.z.enum(["circle","square","custom"]).optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:o.z.string().optional(),borderRadius:o.z.string().optional(),glow:o.z.boolean().optional(),glowColor:o.z.string().optional(),background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),textColor:o.z.string().optional()}).optional()}).optional()});r.QuizBlockThemeSchema=r.BlockThemeSchema.extend({layout:o.z.enum(["horizontal","vertical","grid"]),gridColumns:o.z.number().optional(),preset:o.z.enum(["default","modern","trivia","custom"]),styles:o.z.object({general:K,question:K,answers:K.extend({customStyles:o.z.array(o.z.object({color:o.z.string().optional(),backgroundColor:o.z.string().optional(),targets:o.z.string().optional()})).optional(),hover:K.optional()}),button:K.extend({variant:o.z.enum(["default","outline","ghost"]).optional(),hover:K.optional()})}).optional()});r.DragAndDropBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),gridColumns:o.z.number().optional(),gridGap:o.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.z.object({x:o.z.number().optional(),y:o.z.number().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.z.object({title:r.TextStylesSchema.optional(),sandbox:r.BoxStylesSchema.optional(),item:K.optional(),group:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.extend({url:o.z.string().optional(),type:je.MediaTypeSchema.optional()}).optional(),groups:K.optional(),feedback:o.z.object({correct:o.z.string().optional(),incorrect:o.z.string().optional(),active:o.z.string().optional()}).optional(),referenceSize:o.z.object({width:o.z.number(),height:o.z.number()}).optional()}).optional()});r.EditorBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({editor:r.BoxStylesSchema.optional()}).optional()});r.AnagramBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({letter:r.BoxStylesSchema.optional(),letterText:r.TextStylesSchema.optional(),slot:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.DiceBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({button:r.BoxStylesSchema.extend({hover:K.optional()}).optional(),buttonText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.CrosswordBlockThemeSchema=r.BlockThemeSchema.extend({primaryColor:o.z.string().optional(),layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),clueContainer:r.BoxStylesSchema.optional(),clueText:r.TextStylesSchema.optional(),clueTitle:r.TextStylesSchema.optional()}).optional()});r.WordSearchBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({wordSearch:o.z.object({primaryColor:o.z.string().optional(),highlightColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),textColor:o.z.string().optional(),cellBackgroundColor:o.z.string().optional()}).optional(),text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),wordListContainer:r.BoxStylesSchema.optional(),wordListText:r.TextStylesSchema.optional(),wordListTitle:r.TextStylesSchema.optional()}).optional()});r.MemoryBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),infoContainer:r.BoxStylesSchema.optional(),infoText:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional()}).optional()});r.SpinningWheelBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({wheelText:r.TextStylesSchema.optional()}).optional()});r.ClozeBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),wordBank:r.BoxStylesSchema.optional(),word:r.BoxStylesSchema.optional(),blank:r.BoxStylesSchema.optional()}).optional()});r.CardDeckBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({card:r.BoxStylesSchema.optional(),cardText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.FlashcardBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({cardFront:r.BoxStylesSchema.optional(),cardBack:r.BoxStylesSchema.optional(),frontText:r.TextStylesSchema.optional(),backText:r.TextStylesSchema.optional(),navigation:r.BoxStylesSchema.optional(),navigationText:r.TextStylesSchema.optional()}).optional()});r.MatchPairsBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.ShapeBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({shape:K.extend({fillColor:o.z.string().optional(),textColor:o.z.string().optional(),borderStyle:o.z.enum(["solid","dashed","dotted"]).optional(),padding:o.z.number().optional()}).optional()}).optional()})});var Ve=g(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.UNSTYLEABLE_BLOCKS=C.BLOCK_STYLE_KEYS=C.STYLE_TARGET_MAP=void 0;C.realStyleKeysFor=xo;C.styleTargetsHelpFor=Co;C.mapLogicalThemeStyles=Ie;C.mergeTheme=wo;C.STYLE_TARGET_MAP={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 xo(a){let i=C.STYLE_TARGET_MAP[a.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let l of c??[])n.add(l);return[...n]}C.BLOCK_STYLE_KEYS={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"]};C.UNSTYLEABLE_BLOCKS=new Set(["chart","media","image","puzzle"]);function Co(a){if(!a)return"";let i=a.toLowerCase();if(C.UNSTYLEABLE_BLOCKS.has(i))return`
2
- [STYLE TARGETS] Il blocco "${a}" 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=C.BLOCK_STYLE_KEYS[i];if(!n||n.length===0)return"";let c=C.STYLE_TARGET_MAP[i]??{},l=["general","title","answers","button"].filter(h=>c[h]).map(h=>`${h}\u2192${c[h].join("/")}`).join(", ");return`
3
- [STYLE TARGETS for ${a}] Logical targets (update_block_theme): ${l}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Ie(a,i){if(!a)return a;let n={...a};for(let[Z,W]of Object.entries(n))if(W&&typeof W=="object"){let E={...W},k=!1;E.backgroundColor!==void 0&&E.background===void 0&&(E.background=!0,k=!0),E.borderColor!==void 0&&E.border===void 0&&(E.border=!0,k=!0),k&&(n[Z]=E)}if(!i)return n;let c=C.STYLE_TARGET_MAP[i.toLowerCase()];if(!c)return n;let l=(Z,W)=>{W&&(n[Z]={...n[Z]||{},...W})},h=["title","answers","button","general"],u={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let Z of h){let W=u[Z],E=c[Z];if(W&&E)for(let k of E)l(k,W)}return n}function wo(a,i,n){if(!a){let u={...i};return u.styles&&(u.styles=Ie(u.styles,n)),u}if(!i)return a;let c={...a,...i},l=Ie(i.styles,n),h=a.styles||{};if(a.styles||l){c.styles={...h,...l};for(let u of Object.keys(c.styles))h[u]&&l?.[u]&&(c.styles[u]={...h[u],...l[u]})}return c}});var Me=g(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.BlockEventSchema=d.ActivityVariableSchema=d.ActionSchema=d.ActionVariableSchema=d.ActionTypeSchema=d.MathOperationSchema=d.ActionConditionSchema=d.KeyPressConditionSchema=d.ClickConditionSchema=d.TimerConditionSchema=d.QuizConditionSchema=d.ConditionOperatorSchema=d.BlockEventTypeSchema=void 0;var s=require("zod");d.BlockEventTypeSchema=s.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]);d.ConditionOperatorSchema=s.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]);d.QuizConditionSchema=s.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]);d.TimerConditionSchema=s.z.enum(["completed","half_way"]);d.ClickConditionSchema=s.z.enum(["single_click","double_click"]);d.KeyPressConditionSchema=s.z.literal("key_pressed");d.ActionConditionSchema=s.z.object({event:d.BlockEventTypeSchema.optional(),variableName:s.z.string().optional(),operator:d.ConditionOperatorSchema.optional(),value:s.z.any()});d.MathOperationSchema=s.z.enum(["set","add","subtract","multiply","divide"]);d.ActionTypeSchema=s.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]);d.ActionVariableSchema=s.z.object({name:s.z.string(),value:s.z.union([s.z.number(),s.z.string(),s.z.boolean()]),operation:d.MathOperationSchema.optional()});d.ActionSchema=s.z.object({id:s.z.string(),type:d.ActionTypeSchema,condition:d.ActionConditionSchema.optional(),conditions:s.z.array(d.ActionConditionSchema).optional(),conditionsOperator:s.z.enum(["and","or"]).optional(),modalContent:s.z.string().optional(),audioUrl:s.z.string().optional(),linkUrl:s.z.string().optional(),targetSceneId:s.z.string().optional(),targetBlockId:s.z.string().optional(),direction:s.z.enum(["up","down","left","right"]).optional(),distance:s.z.number().optional(),variable:d.ActionVariableSchema.optional()});d.ActivityVariableSchema=s.z.object({name:s.z.string(),defaultValue:s.z.union([s.z.string(),s.z.number(),s.z.boolean()])});d.BlockEventSchema=s.z.object({type:d.BlockEventTypeSchema,blockId:s.z.string(),data:s.z.record(s.z.any()).optional()})});var ue=g(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.QuestionSchema=z.TextQuestionSchema=z.TrueFalseQuestionSchema=z.ChoiceQuestionSchema=z.QuestionOptionSchema=z.ImageSizeSchema=z.ImageAlignSchema=z.QuestionTypeSchema=void 0;var b=require("zod"),Ue=L();z.QuestionTypeSchema=b.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);z.ImageAlignSchema=b.z.enum(["left","right","center"]);z.ImageSizeSchema=b.z.object({width:b.z.number().optional(),height:b.z.number().optional()});z.QuestionOptionSchema=b.z.object({id:b.z.string(),text:b.z.string(),isCorrect:b.z.boolean(),image:Ue.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()});var ve={id:b.z.string(),text:b.z.string(),score:b.z.number().optional(),image:Ue.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()};z.ChoiceQuestionSchema=b.z.object({...ve,type:b.z.enum(["single-choice","multiple-choice"]),options:b.z.array(z.QuestionOptionSchema)});z.TrueFalseQuestionSchema=b.z.object({...ve,type:b.z.literal("true-false"),correctAnswer:b.z.boolean()});z.TextQuestionSchema=b.z.object({...ve,type:b.z.enum(["short-answers","long-answers"]),minCharacters:b.z.number().optional(),maxCharacters:b.z.number().optional()});z.QuestionSchema=b.z.discriminatedUnion("type",[z.ChoiceQuestionSchema,z.TrueFalseQuestionSchema,z.TextQuestionSchema])});var Ae=g(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.PuzzleContentSchema=Y.PuzzleTypeSchema=Y.PuzzleGameModeSchema=void 0;var H=require("zod"),_o=L();Y.PuzzleGameModeSchema=H.z.enum(["scattered","rotated","scattered_rotated"]);Y.PuzzleTypeSchema=H.z.enum(["swap","slide"]);Y.PuzzleContentSchema=H.z.object({image:H.z.union([H.z.string(),_o.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:H.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:Y.PuzzleGameModeSchema.optional(),puzzleType:Y.PuzzleTypeSchema.optional(),showNumbers:H.z.union([H.z.boolean(),H.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:H.z.string().optional().describe("Deterministic seed for piece placement.")})});var Je=g(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CanvasDragItemSchema=t.ActivityContentSchema=t.SceneSchema=t.BlockGroupSchema=t.BlockSchema=t.ArrowBlockSchema=t.ShapeBlockSchema=t.CardDeckBlockSchema=t.ClozeBlockSchema=t.MatchPairsBlockSchema=t.ChartBlockSchema=t.SpinningWheelBlockSchema=t.FlashcardBlockSchema=t.MemoryBlockSchema=t.WordSearchBlockSchema=t.WordSearchDifficultySchema=t.CrosswordBlockSchema=t.PuzzleBlockSchema=t.DiceBlockSchema=t.AnagramBlockSchema=t.DragAndDropBlockSchema=t.EmbedBlockSchema=t.MediaBlockSchema=t.EditorBlockSchema=t.HotpointBlockSchema=t.QuizBlockSchema=t.ArrowLabelSchema=t.ArrowHeadTypeSchema=t.ShapeTypeSchema=t.MatchPairsPairSchema=t.CardItemSchema=t.FlashcardItemSchema=t.FlashcardContentSchema=t.WheelSliceSchema=t.MemoryPairSchema=t.WordSearchDataSchema=t.CrosswordLayoutOutputSchema=t.CrosswordLayoutWordSchema=t.CrosswordCellSchema=t.DiceTypeSchema=t.DragAndDropGroupSchema=t.DragAndDropItemSchema=t.ActionBlockSchema=t.SceneTypeSchema=void 0;var e=require("zod"),jo=_e(),B=L(),y=pe(),Io=ue(),Mo=Me(),vo=Ae();t.SceneTypeSchema=e.z.enum(["2D","360\xB0"]);var se={id:e.z.string(),type:jo.BlockTypeSchema,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:B.PositionSchema.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:B.SizeSchema.optional(),minSize:B.SizeSchema.optional(),maxSize:B.SizeSchema.optional(),theme:y.BlockThemeSchema.optional()},w={...se,actions:e.z.array(Mo.ActionSchema).optional(),score:e.z.number().optional()};t.ActionBlockSchema=e.z.object(w);t.DragAndDropItemSchema=e.z.object({id:e.z.string(),text:e.z.string(),background:B.MediaItemSchema.optional(),opacity:e.z.number().optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional()});t.DragAndDropGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),background:B.MediaItemSchema.optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),singleItem:e.z.boolean().optional(),opacity:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional(),items:e.z.array(t.DragAndDropItemSchema)});t.DiceTypeSchema=e.z.enum(["d4","d6","d8","d10","d12","d20"]);t.CrosswordCellSchema=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()});t.CrosswordLayoutWordSchema=e.z.object({answer:e.z.string(),clue:e.z.string(),image:B.MediaItemSchema.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()});t.CrosswordLayoutOutputSchema=e.z.object({grid:e.z.array(e.z.array(t.CrosswordCellSchema)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(t.CrosswordLayoutWordSchema)});t.WordSearchDataSchema=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()}))}))});t.MemoryPairSchema=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]),content:e.z.tuple([e.z.string(),e.z.string()])});t.WheelSliceSchema=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional(),image:B.MediaItemSchema.optional()});t.FlashcardContentSchema=e.z.object({type:e.z.enum(["text","image"]),content:e.z.any()});t.FlashcardItemSchema=e.z.object({id:e.z.string(),front:t.FlashcardContentSchema,back:t.FlashcardContentSchema});t.CardItemSchema=e.z.object({id:e.z.string(),frontImage:B.MediaItemSchema.optional(),frontText:e.z.string().optional()});t.MatchPairsPairSchema=e.z.object({id:e.z.string(),leftLabel:e.z.string(),rightLabel:e.z.string(),leftImage:e.z.any().optional(),rightImage:e.z.any().optional()});t.ShapeTypeSchema=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"]);t.ArrowHeadTypeSchema=e.z.enum(["none","arrow","circle","square"]);t.ArrowLabelSchema=e.z.object({id:e.z.string(),text:e.z.string(),t:e.z.number(),offsetX:e.z.number().optional(),offsetY:e.z.number().optional(),fontSize:e.z.number().optional(),color:e.z.string().optional(),backgroundColor:e.z.string().optional()});t.QuizBlockSchema=e.z.object({...w,type:e.z.literal("Quiz"),questions:e.z.array(Io.QuestionSchema).optional(),previewIndex:e.z.number().optional(),required:e.z.boolean().optional(),showResults:e.z.boolean().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional(),submitText:e.z.string().optional(),timer:e.z.string().optional(),showQuestionCount:e.z.boolean().optional(),theme:y.QuizBlockThemeSchema});t.HotpointBlockSchema=e.z.object({...w,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional(),element:e.z.enum(["image","button"]),theme:y.HotpointBlockThemeSchema.optional()});t.EditorBlockSchema=e.z.object({...w,type:e.z.literal("Editor"),content:e.z.any().optional(),readonly:e.z.boolean().optional(),theme:y.EditorBlockThemeSchema.optional()});t.MediaBlockSchema=e.z.object({...se,type:e.z.literal("Media"),media:B.MediaItemSchema.optional()});t.EmbedBlockSchema=e.z.object({...se,type:e.z.literal("Embed"),url:e.z.string().optional(),readOnly:e.z.boolean().optional()});t.DragAndDropBlockSchema=e.z.object({...w,type:e.z.literal("DragAndDrop"),groups:e.z.array(t.DragAndDropGroupSchema),theme:y.DragAndDropBlockThemeSchema.optional(),showResults:e.z.boolean().optional(),layout:e.z.enum(["manual","split"]).optional(),itemArrangement:e.z.enum(["random","list","grid"]).optional(),groupBackground:B.MediaItemSchema.optional(),enableWrongAnswers:e.z.boolean().optional(),itemBackground:B.MediaItemSchema.optional(),groupBackgroundOpacity:e.z.number().optional(),itemBackgroundOpacity:e.z.number().optional(),splitRatio:e.z.number().optional()});t.AnagramBlockSchema=e.z.object({...w,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()),correctWord:e.z.string(),theme:y.AnagramBlockThemeSchema.optional(),clue:e.z.string().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional()});t.DiceBlockSchema=e.z.object({...w,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional(),diceType:t.DiceTypeSchema.optional(),faceOverrides:e.z.any().optional(),color:e.z.string().optional(),showNumber:e.z.boolean().optional(),diceCount:e.z.number().optional(),dicePool:e.z.record(e.z.number()).optional(),persistent:e.z.boolean().optional(),theme:y.DiceBlockThemeSchema.optional()});t.PuzzleBlockSchema=e.z.object({...w,type:e.z.literal("Puzzle"),image:B.MediaItemSchema.optional(),pieces:e.z.number().optional(),gameMode:vo.PuzzleGameModeSchema.optional(),puzzleType:e.z.enum(["swap","slide"]).optional(),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional(),seed:e.z.string().optional()});t.CrosswordBlockSchema=e.z.object({...w,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string(),clue:e.z.string(),image:B.MediaItemSchema.optional()})).optional(),layout:t.CrosswordLayoutOutputSchema.optional(),theme:y.CrosswordBlockThemeSchema.optional()});t.WordSearchDifficultySchema=e.z.enum(["easy","medium","hard"]);t.WordSearchBlockSchema=e.z.object({...w,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional(),gridSize:B.GridSizeSchema.optional(),difficulty:t.WordSearchDifficultySchema.optional(),data:t.WordSearchDataSchema.optional(),theme:y.WordSearchBlockThemeSchema.optional()});t.MemoryBlockSchema=e.z.object({...w,type:e.z.literal("Memory"),pairs:e.z.array(t.MemoryPairSchema),gridSize:B.GridSizeSchema.optional(),hideScore:e.z.boolean().optional(),theme:y.MemoryBlockThemeSchema.optional()});t.FlashcardBlockSchema=e.z.object({...w,type:e.z.literal("Flashcard"),cards:e.z.array(t.FlashcardItemSchema),theme:y.FlashcardBlockThemeSchema.optional()});t.SpinningWheelBlockSchema=e.z.object({...w,type:e.z.literal("SpinningWheel"),slices:e.z.array(t.WheelSliceSchema),spinDuration:e.z.number().optional(),theme:y.SpinningWheelBlockThemeSchema.optional()});t.ChartBlockSchema=e.z.object({...w,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.z.array(e.z.any()),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional(),xAxisLabel:e.z.string().optional(),yAxisLabel:e.z.string().optional(),showLegend:e.z.boolean().optional(),showTooltip:e.z.boolean().optional(),stacked:e.z.boolean().optional(),seriesNames:e.z.record(e.z.string()).optional()})});t.MatchPairsBlockSchema=e.z.object({...w,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional(),pairs:e.z.array(t.MatchPairsPairSchema),theme:y.MatchPairsBlockThemeSchema.optional()});t.ClozeBlockSchema=e.z.object({...w,type:e.z.literal("Cloze"),templateText:e.z.string().optional(),theme:y.ClozeBlockThemeSchema.optional(),mode:e.z.enum(["write","drag-drop"]).optional()});t.CardDeckBlockSchema=e.z.object({...w,type:e.z.literal("CardDeck"),cards:e.z.array(t.CardItemSchema),backImage:B.MediaItemSchema.optional(),discardLogic:e.z.enum(["delete","return"]),theme:y.CardDeckBlockThemeSchema.optional()});t.ShapeBlockSchema=e.z.object({...se,type:e.z.literal("Shape"),shapeType:t.ShapeTypeSchema.optional(),text:e.z.string().optional(),theme:y.ShapeBlockThemeSchema.optional()});t.ArrowBlockSchema=e.z.object({...se,type:e.z.literal("Arrow"),startBlockId:e.z.string(),endBlockId:e.z.string().optional(),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional(),startHandle:e.z.enum(["top","right","bottom","left"]),endHandle:e.z.enum(["top","right","bottom","left"]).optional(),connectionType:e.z.enum(["straight","orthogonal","curved"]),strokeColor:e.z.string().optional(),strokeWidth:e.z.number().optional(),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional(),showHead:e.z.boolean().optional(),startHead:t.ArrowHeadTypeSchema.optional(),endHead:t.ArrowHeadTypeSchema.optional(),bendOffsetX:e.z.number().optional(),bendOffsetY:e.z.number().optional(),segmentCount:e.z.number().optional(),bendOffsets:e.z.array(e.z.number()).optional(),labels:e.z.array(t.ArrowLabelSchema).optional()});t.BlockSchema=e.z.discriminatedUnion("type",[t.QuizBlockSchema,t.HotpointBlockSchema,t.EditorBlockSchema,t.EmbedBlockSchema,t.MediaBlockSchema,t.DragAndDropBlockSchema,t.AnagramBlockSchema,t.DiceBlockSchema,t.PuzzleBlockSchema,t.CrosswordBlockSchema,t.WordSearchBlockSchema,t.MemoryBlockSchema,t.FlashcardBlockSchema,t.SpinningWheelBlockSchema,t.ChartBlockSchema,t.MatchPairsBlockSchema,t.ShapeBlockSchema,t.ArrowBlockSchema,t.ClozeBlockSchema,t.CardDeckBlockSchema]);t.BlockGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()});t.SceneSchema=e.z.object({id:e.z.string(),title:e.z.string(),type:t.SceneTypeSchema,background:e.z.union([e.z.string(),e.z.array(e.z.string()),B.MediaItemSchema]).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(t.BlockSchema),groups:e.z.array(t.BlockGroupSchema).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()});t.ActivityContentSchema=e.z.object({id:e.z.string(),title:e.z.string(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(t.SceneSchema),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:B.MediaItemSchema.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()});t.CanvasDragItemSchema=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:t.BlockSchema})});var Xe=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.ActivityContextSchema=$.SceneSummarySchema=$.SceneBlockRefSchema=void 0;var M=require("zod");$.SceneBlockRefSchema=M.z.object({id:M.z.string(),type:M.z.string(),title:M.z.string()});$.SceneSummarySchema=M.z.object({id:M.z.string(),title:M.z.string(),position:M.z.number(),blocks:M.z.array($.SceneBlockRefSchema).default([])});$.ActivityContextSchema=M.z.object({activity:M.z.object({id:M.z.string(),title:M.z.string(),scenes:M.z.array($.SceneSummarySchema).default([])}),activeSceneId:M.z.string().nullable().optional()})});var eo=g(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.QuizContentSchema=P.QuizQuestionSchema=P.QuizOptionSchema=P.QuizQuestionTypeSchema=void 0;var f=require("zod"),Ze=L(),he=ue();P.QuizQuestionTypeSchema=f.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);P.QuizOptionSchema=f.z.object({id:f.z.string().optional(),text:f.z.string(),isCorrect:f.z.boolean(),image:Ze.MediaItemSchema.optional().describe("Option image."),imageAlign:he.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:he.ImageSizeSchema.optional().describe("Option image size.")});P.QuizQuestionSchema=f.z.object({id:f.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:P.QuizQuestionTypeSchema,text:f.z.string().describe("The question text."),score:f.z.number().optional(),options:f.z.array(P.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:f.z.boolean().optional().describe("Required for true-false."),image:Ze.MediaItemSchema.optional().describe("Question image."),imageAlign:he.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:he.ImageSizeSchema.optional().describe("Question image size.")});P.QuizContentSchema=f.z.object({questions:f.z.array(P.QuizQuestionSchema).describe("Array of question objects."),showResults:f.z.boolean().optional(),allowRetry:f.z.boolean().optional(),maxRetry:f.z.string().optional(),required:f.z.boolean().optional(),submitText:f.z.string().optional().describe("Label for submit button."),timer:f.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:f.z.boolean().optional().describe("Show current/total questions count.")})});var oo=g(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.ClozeContentSchema=te.ClozeModeSchema=void 0;var Oe=require("zod");te.ClozeModeSchema=Oe.z.enum(["write","drag-drop"]);te.ClozeContentSchema=Oe.z.object({templateText:Oe.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:te.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var no=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.AnagramContentSchema=D.WordSearchContentSchema=D.CrosswordContentSchema=D.CrosswordWordSchema=D.WordGameBlockTypeSchema=void 0;var v=require("zod"),to=L();D.WordGameBlockTypeSchema=v.z.enum(["Crossword","WordSearch","Anagram"]);D.CrosswordWordSchema=v.z.object({answer:v.z.string(),clue:v.z.string(),image:to.MediaItemSchema.optional().describe("Clue image.")});D.CrosswordContentSchema=v.z.object({words:v.z.array(D.CrosswordWordSchema)});D.WordSearchContentSchema=v.z.object({words:v.z.array(v.z.string()),gridSize:to.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:v.z.enum(["easy","medium","hard"]).optional()});D.AnagramContentSchema=v.z.object({correctWord:v.z.string().describe("The correct word."),letters:v.z.array(v.z.string()).optional(),clue:v.z.string().optional().describe("A hint.")})});var ao=g(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.PairGameContentSchema=F.PairSchema=F.MemoryPairTypeSchema=F.PairGameBlockTypeSchema=void 0;var N=require("zod"),Pe=L();F.PairGameBlockTypeSchema=N.z.enum(["Memory","MatchPairs"]);F.MemoryPairTypeSchema=N.z.enum(["img-img","img-word","word-word"]);F.PairSchema=N.z.object({id:N.z.string().optional(),type:F.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:N.z.array(N.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:N.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:N.z.string().optional().describe("For MatchPairs: right side text."),leftImage:Pe.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:Pe.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});F.PairGameContentSchema=N.z.object({pairs:N.z.array(F.PairSchema).describe("Array of pair objects."),gridSize:Pe.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:N.z.string().optional().describe("For MatchPairs: instruction text.")})});var io=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DeckContentSchema=q.CardSchema=q.CardFaceSchema=q.DeckBlockTypeSchema=void 0;var R=require("zod");q.DeckBlockTypeSchema=R.z.enum(["Flashcard","CardDeck"]);q.CardFaceSchema=R.z.object({type:R.z.enum(["text","image"]),content:R.z.any()});q.CardSchema=R.z.object({id:R.z.string().optional(),front:q.CardFaceSchema.optional().describe("For Flashcard: front side."),back:q.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:R.z.string().optional().describe("For CardDeck: front text."),frontImage:R.z.any().optional().describe("For CardDeck: front image.")});q.DeckContentSchema=R.z.object({cards:R.z.array(q.CardSchema).describe("Array of card objects."),backImage:R.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:R.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var ro=g(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.DiceContentSchema=ne.DieTypeSchema=void 0;var ce=require("zod");ne.DieTypeSchema=ce.z.enum(["d4","d6","d8","d10","d12","d20"]);ne.DiceContentSchema=ce.z.object({diceType:ne.DieTypeSchema.optional(),diceCount:ce.z.number().int().min(1).max(10).optional(),color:ce.z.string().optional().describe("CSS color for dice."),showNumber:ce.z.boolean().optional(),persistent:ce.z.boolean().optional().describe("Keep dice visible after roll.")})});var co=g(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.SpinnerContentSchema=ie.SpinnerSliceSchema=void 0;var ae=require("zod"),Ao=L();ie.SpinnerSliceSchema=ae.z.object({id:ae.z.string().optional(),text:ae.z.string(),color:ae.z.string().optional().describe("CSS color for slice."),image:Ao.MediaItemSchema.optional().describe("Slice image.")});ie.SpinnerContentSchema=ae.z.object({slices:ae.z.array(ie.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:ae.z.number().optional().describe("Spin duration in seconds.")})});var lo=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.DragAndDropContentSchema=V.DragGroupSchema=V.DragItemSchema=void 0;var p=require("zod"),ze=L(),Se=pe();V.DragItemSchema=p.z.object({id:p.z.string().optional(),text:p.z.string(),background:ze.MediaItemSchema.optional().describe("Background image/color for item."),opacity:p.z.number().optional().describe("Opacity of the item (0-1)."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),styles:Se.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:Se.TextStylesSchema.optional().describe("Text custom styling styles.")});V.DragGroupSchema=p.z.object({id:p.z.string().optional(),name:p.z.string().describe("Group/dropzone name."),singleItem:p.z.boolean().optional().describe("Accept only one item inside."),background:ze.MediaItemSchema.optional().describe("Background image/color for group."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),opacity:p.z.number().optional().describe("Opacity of the group (0-1)."),styles:Se.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:Se.TextStylesSchema.optional().describe("Text custom styling styles."),items:p.z.array(V.DragItemSchema).describe("Items that belong in this group.")});V.DragAndDropContentSchema=p.z.object({groups:p.z.array(V.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:p.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:p.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:p.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:p.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:p.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:ze.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:ze.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:p.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:p.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:p.z.number().optional().describe("Proportion ratio for split layout.")})});var so=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.ChartContentSchema=U.ChartConfigSchema=U.ChartTypeSchema=void 0;var A=require("zod");U.ChartTypeSchema=A.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);U.ChartConfigSchema=A.z.object({colors:A.z.array(A.z.string()).optional(),xAxisLabel:A.z.string().optional(),yAxisLabel:A.z.string().optional(),showLegend:A.z.boolean().optional(),showTooltip:A.z.boolean().optional(),stacked:A.z.boolean().optional(),seriesNames:A.z.record(A.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});U.ChartContentSchema=A.z.object({chartType:U.ChartTypeSchema.optional(),chartData:A.z.array(A.z.record(A.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:U.ChartConfigSchema.optional()})});var mo=g(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.BasicContentSchema=void 0;var be=require("zod"),Oo=L();ge.BasicContentSchema=be.z.object({content:be.z.any().optional().describe("For Editor: Plate JSON content array."),url:be.z.string().optional().describe("For Media or Embed: content URL."),text:be.z.string().optional().describe("For Shape: text inside shape."),mediaType:Oo.MediaTypeSchema.optional().describe("For Media: media type.")})});var De=g(_=>{"use strict";var Po=_&&_.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),G=_&&_.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Po(i,a,n)};Object.defineProperty(_,"__esModule",{value:!0});G(eo(),_);G(oo(),_);G(no(),_);G(ao(),_);G(io(),_);G(ro(),_);G(co(),_);G(lo(),_);G(so(),_);G(Ae(),_);G(mo(),_)});var po=g(Q=>{"use strict";var Do=Q&&Q.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),qo=Q&&Q.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),Eo=Q&&Q.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(n){var c=[];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c[c.length]=l);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var n={};if(i!=null)for(var c=a(i),l=0;l<c.length;l++)c[l]!=="default"&&Do(n,i,c[l]);return qo(n,i),n}})();Object.defineProperty(Q,"__esModule",{value:!0});Q.BLOCK_CONTENT_SCHEMAS=void 0;Q.generateBlockReference=Qo;var Lo=Eo(require("zod-to-json-schema")),Fo=Lo.zodToJsonSchema,T=De();Q.BLOCK_CONTENT_SCHEMAS={Quiz:T.QuizContentSchema,Cloze:T.ClozeContentSchema,Crossword:T.CrosswordContentSchema,WordSearch:T.WordSearchContentSchema,Anagram:T.AnagramContentSchema,Memory:T.PairGameContentSchema,MatchPairs:T.PairGameContentSchema,Flashcard:T.DeckContentSchema,CardDeck:T.DeckContentSchema,Dice:T.DiceContentSchema,SpinningWheel:T.SpinnerContentSchema,DragAndDrop:T.DragAndDropContentSchema,Chart:T.ChartContentSchema,Puzzle:T.PuzzleContentSchema,Editor:T.BasicContentSchema,Media:T.BasicContentSchema,Embed:T.BasicContentSchema,Shape:T.BasicContentSchema};function Ro(a,i,n,c){let l=n?"*required*":"optional",h=qe(i),u=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${a}\` (${h}, ${l})${u}`}function qe(a){return a.enum?`enum: ${a.enum.map(i=>JSON.stringify(i)).join(" | ")}`:a.anyOf||a.oneOf?(a.anyOf||a.oneOf).map(qe).join(" | "):Array.isArray(a.type)?a.type.join(" | "):a.type==="array"&&a.items?`array<${qe(a.items)}>`:a.type==="object"?"object":a.type??"any"}function Ee(a,i){let n=[],c=new Set(a.required??[]),l=a.properties??{};for(let[h,u]of Object.entries(l))n.push(Ro(h,u,c.has(h),i)),u.type==="object"&&u.properties?n.push(Ee(u,i+" ")):u.type==="array"&&u.items?.type==="object"&&n.push(Ee(u.items,i+" "));return n.join(`
4
- `)}function Qo(){let a=[],i=new Map;for(let[n,c]of Object.entries(Q.BLOCK_CONTENT_SCHEMAS)){let l=i.get(c)??[];l.push(n),i.set(c,l)}for(let[n,c]of i.entries()){let l=c.join(" / "),h=Fo(n,{target:"jsonSchema7"}),u=Ee(h,"");a.push(`### ${l}
5
- ${u||"_(no configurable fields)_"}`)}return a.join(`
1
+ "use strict";var Mt=Object.create;var V=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Qt=(t,r)=>{for(var n in r)V(t,n,{get:r[n],enumerable:!0})},tt=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ot(r))!Et.call(t,a)&&a!==n&&V(t,a,{get:()=>r[a],enumerable:!(i=Pt(r,a))||i.enumerable});return t};var Lt=(t,r,n)=>(n=t!=null?Mt(vt(t)):{},tt(r||!t||!t.__esModule?V(n,"default",{value:t,enumerable:!0}):n,t)),_t=t=>tt(V({},"__esModule",{value:!0}),t);var Ut={};Qt(Ut,{ActionBlockSchema:()=>bt,ActionConditionSchema:()=>ye,ActionSchema:()=>Se,ActionTypeSchema:()=>He,ActionVariableSchema:()=>Ke,ActivityContentSchema:()=>ft,ActivityContextSchema:()=>kt,ActivityVariableSchema:()=>yt,AnagramBlockSchema:()=>ko,AnagramBlockThemeSchema:()=>ne,AnagramContentSchema:()=>je,AnimationSchema:()=>Re,ArrowBlockSchema:()=>Eo,ArrowHeadTypeSchema:()=>ke,ArrowLabelSchema:()=>uo,BLOCK_CONTENT_SCHEMAS:()=>F,BLOCK_STYLE_KEYS:()=>We,BLOCK_TYPES:()=>Ee,BasicContentSchema:()=>_,BlockEventSchema:()=>gt,BlockEventTypeSchema:()=>ge,BlockGroupSchema:()=>Qo,BlockSchema:()=>ze,BlockThemeSchema:()=>b,BlockTypeSchema:()=>Y,BoxSideSchema:()=>Z,BoxStylesSchema:()=>s,CANVAS_OP_NAMES:()=>Rt,CANVAS_OP_REQUIRED:()=>$,CanvasDragItemSchema:()=>xt,CardDeckBlockSchema:()=>Oo,CardDeckBlockThemeSchema:()=>se,CardFaceSchema:()=>Ie,CardItemSchema:()=>so,CardSchema:()=>Jo,ChartBlockSchema:()=>Do,ChartConfigSchema:()=>Xo,ChartContentSchema:()=>Oe,ChartTypeSchema:()=>Zo,ChoiceQuestionSchema:()=>$e,ClickConditionSchema:()=>ht,ClozeBlockSchema:()=>Po,ClozeBlockThemeSchema:()=>pe,ClozeContentSchema:()=>Te,ClozeModeSchema:()=>No,ConditionOperatorSchema:()=>Ne,CropDataSchema:()=>Le,CrosswordBlockSchema:()=>Bo,CrosswordBlockThemeSchema:()=>ae,CrosswordCellSchema:()=>no,CrosswordContentSchema:()=>we,CrosswordLayoutOutputSchema:()=>ao,CrosswordLayoutWordSchema:()=>ro,CrosswordWordSchema:()=>qo,DeckBlockTypeSchema:()=>Bt,DeckContentSchema:()=>K,DiceBlockSchema:()=>zo,DiceBlockThemeSchema:()=>re,DiceContentSchema:()=>De,DiceTypeSchema:()=>to,DieTypeSchema:()=>Vo,DragAndDropBlockSchema:()=>xo,DragAndDropBlockThemeSchema:()=>oe,DragAndDropContentSchema:()=>Pe,DragAndDropGroupSchema:()=>oo,DragAndDropItemSchema:()=>eo,DragGroupSchema:()=>Uo,DragItemSchema:()=>Yo,EditorBlockSchema:()=>So,EditorBlockThemeSchema:()=>te,EmbedBlockSchema:()=>fo,FlashcardBlockSchema:()=>jo,FlashcardBlockThemeSchema:()=>me,FlashcardContentSchema:()=>xe,FlashcardItemSchema:()=>po,GridSizeSchema:()=>M,HotpointBlockSchema:()=>go,HotpointBlockThemeSchema:()=>X,ImageAlignSchema:()=>E,ImageSizeSchema:()=>Q,KeyPressConditionSchema:()=>ut,MatchPairsBlockSchema:()=>Mo,MatchPairsBlockThemeSchema:()=>de,MatchPairsPairSchema:()=>mo,MathOperationSchema:()=>qe,MediaBlockSchema:()=>bo,MediaItemSchema:()=>c,MediaRefSchema:()=>ct,MediaSourceSchema:()=>Qe,MediaTypeSchema:()=>v,MemoryBlockSchema:()=>Ao,MemoryBlockThemeSchema:()=>ce,MemoryPairSchema:()=>co,MemoryPairTypeSchema:()=>Ho,PairGameBlockTypeSchema:()=>Ct,PairGameContentSchema:()=>H,PairSchema:()=>Ko,PositionSchema:()=>U,PuzzleBlockSchema:()=>Co,PuzzleContentSchema:()=>fe,PuzzleGameModeSchema:()=>N,PuzzleTypeSchema:()=>Ze,QuestionOptionSchema:()=>Je,QuestionSchema:()=>be,QuestionTypeSchema:()=>St,QuizBlockSchema:()=>yo,QuizBlockThemeSchema:()=>ee,QuizConditionSchema:()=>mt,QuizContentSchema:()=>Ce,QuizOptionSchema:()=>Wo,QuizQuestionSchema:()=>Go,QuizQuestionTypeSchema:()=>Fo,RadiusSchema:()=>Fe,STYLE_TARGET_MAP:()=>G,SceneBlockRefSchema:()=>_o,SceneSchema:()=>Lo,SceneSummarySchema:()=>Ro,SceneTypeSchema:()=>Xe,ShapeBlockSchema:()=>vo,ShapeBlockThemeSchema:()=>he,ShapeTypeSchema:()=>ho,SizeSchema:()=>R,SpinnerContentSchema:()=>Me,SpinnerSliceSchema:()=>$o,SpinningWheelBlockSchema:()=>Io,SpinningWheelBlockThemeSchema:()=>le,TextQuestionSchema:()=>Ue,TextStylesSchema:()=>u,TimerConditionSchema:()=>dt,TrueFalseQuestionSchema:()=>Ye,UNSTYLEABLE_BLOCKS:()=>Ge,VideoSettingsSchema:()=>_e,WheelSliceSchema:()=>lo,WordGameBlockTypeSchema:()=>zt,WordSearchBlockSchema:()=>wo,WordSearchBlockThemeSchema:()=>ie,WordSearchContentSchema:()=>Ae,WordSearchDataSchema:()=>io,WordSearchDifficultySchema:()=>To,applyItemPatch:()=>Wt,detectConflict:()=>qt,entitySignature:()=>at,generateBlockReference:()=>wt,getAllBlockJsonSchemas:()=>Yt,getBlockJsonSchema:()=>It,isKnownCanvasOp:()=>nt,listBlockTypes:()=>jt,mapLogicalThemeStyles:()=>ue,mergeTheme:()=>st,opConflictStamp:()=>Ht,opTarget:()=>rt,parseMentions:()=>Kt,realStyleKeysFor:()=>lt,resolveMentions:()=>Jt,stableStringify:()=>W,styleTargetsHelpFor:()=>pt,validateCanvasOp:()=>Ft});module.exports=_t(Ut);var $={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"]},Rt=Object.keys($);function nt(t){return Object.prototype.hasOwnProperty.call($,t)}function Ft(t,r){if(!nt(t))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${t}"`]};if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=r,i=$[t].filter(a=>n[a]===void 0||n[a]===null);return i.length>0?{ok:!1,code:"MISSING_FIELDS",errors:i.map(a=>`missing field: ${a}`)}:t==="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 Wt(t,r,n){let i=Array.isArray(t)?[...t]:[];if(r==="insertItem"){if(n.item===void 0||n.item===null)return i;let a=typeof n.at=="number"?n.at:i.length;return i.splice(Math.max(0,Math.min(a,i.length)),0,n.item),i}return r==="updateItem"?i.map(a=>a&&typeof a=="object"&&a.id===n.itemId?{...a,...n.item??{}}:a):i.filter(a=>!(a&&typeof a=="object"&&a.id===n.itemId))}var Gt=new Set(["position","size","rotation","zIndex","z"]);function W(t){return t===null||typeof t!="object"?JSON.stringify(t)??"null":Array.isArray(t)?"["+t.map(W).join(",")+"]":"{"+Object.keys(t).sort().map(n=>JSON.stringify(n)+":"+W(t[n])).join(",")+"}"}function rt(t,r){let n=r??{};switch(t){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 Nt(t,r){if(Array.isArray(t))for(let n of t){let i=n?.blocks?.find?.(a=>a&&a.id===r);if(i)return i}}function at(t,r){if(r.kind==="untracked")return null;let n=r.blockId?Nt(t,r.blockId):void 0;if(!n)return null;if(r.kind==="block"){let h={};for(let d of Object.keys(n))Gt.has(d)||(h[d]=n[d]);return W(h)}let i=n[r.collection];if(!Array.isArray(i))return null;let a=i.find(h=>h&&h.id===r.itemId);return a?W(a):null}function qt(t,r){return t==null?"apply":r==null?"missing":t===r?"apply":"stale"}function Ht(t,r,n){let i=rt(t,r);return{target:i,baseSignature:at(n,i)}}var ve=/@\[([^\]|]+)\|([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 Kt(t){let r=[];for(let n of(t??"").matchAll(ve))r.push({name:n[1].trim(),id:n[2]});return r}function Jt(t,r){let n=new Map,i=new Map;for(let S of r?.scenes??[]){S?.id&&n.set(S.id,S);for(let f of S?.blocks??[])f?.id&&i.set(f.id,{block:f,sceneId:S.id})}let a=[],h=new Set,d=S=>i.has(S)?"il blocco selezionato":n.has(S)?"la scena selezionata":"l'elemento selezionato",D=(S,f)=>{if(!h.has(f))if(i.has(f)){let{block:O,sceneId:Dt}=i.get(f);a.push({id:f,name:S,kind:"block",blockType:O?.type,sceneId:Dt}),h.add(f)}else n.has(f)&&(a.push({id:f,name:S,kind:"scene"}),h.add(f))},A=(t??"").replace(ve,(S,f,O)=>(D(f.trim(),O),f.trim())),T=(t??"").replace(ve,(S,f,O)=>i.has(O)||n.has(O)?d(O):f.trim());return{cleanedText:A,agentText:T,entities:a}}var At=require("zod-to-json-schema");var it=require("zod"),Ee=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Y=it.z.enum(Ee);var p=require("zod"),U=p.z.object({x:p.z.number(),y:p.z.number(),z:p.z.number().optional()}),R=p.z.object({width:p.z.number().optional(),height:p.z.number().optional()}),M=p.z.object({rows:p.z.number(),cols:p.z.number()}),v=p.z.enum(["image","color","gif","shape","illustration","video","audio"]),Qe=p.z.enum(["unsplash","pexels","upload","url","library","tenor"]),Le=p.z.object({x:p.z.number(),y:p.z.number(),width:p.z.number(),height:p.z.number(),zoom:p.z.number().optional(),rotation:p.z.number().optional(),aspect:p.z.number().optional()}),_e=p.z.object({autoplay:p.z.boolean().optional(),loop:p.z.boolean().optional(),muted:p.z.boolean().optional(),controls:p.z.boolean().optional(),poster:p.z.string().optional(),volume:p.z.number().optional()}),c=p.z.object({id:p.z.string().optional(),url:p.z.string().optional(),title:p.z.string().optional(),type:v,source:Qe.optional(),alt:p.z.string().optional(),width:p.z.number().optional(),height:p.z.number().optional(),format:p.z.enum(["cover","contain"]).optional(),color:p.z.string().optional(),cropData:Le.optional(),duration:p.z.number().optional(),videoSettings:_e.optional()}),ct=c;var o=require("zod");var Re=o.z.object({type:o.z.union([o.z.enum(["none","fade","direction","bounce","scale","rotate"]),o.z.string()]),duration:o.z.number().optional(),delay:o.z.number().optional(),phase:o.z.enum(["in","both","out"]).optional(),direction:o.z.enum(["up","right","down","left"]).optional()}),Z=o.z.object({top:o.z.union([o.z.string(),o.z.number()]).optional(),right:o.z.union([o.z.string(),o.z.number()]).optional(),bottom:o.z.union([o.z.string(),o.z.number()]).optional(),left:o.z.union([o.z.string(),o.z.number()]).optional()}),Fe=o.z.object({topLeft:o.z.union([o.z.string(),o.z.number()]).optional(),topRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomLeft:o.z.union([o.z.string(),o.z.number()]).optional()}),s=o.z.object({background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),backgroundOpacity:o.z.number().optional(),backgroundMedia:c.optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:Z.optional(),borderRadius:Fe.optional(),padding:o.z.union([o.z.string(),o.z.number(),Z]).optional()}),u=o.z.object({color:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),fontWeight:o.z.union([o.z.string(),o.z.number()]).optional(),textAlign:o.z.enum(["left","center","right","justify"]).optional()}),I=s.merge(u),b=o.z.object({spacing:o.z.enum(["no-spacing","small","medium","large"]).optional(),animation:Re.optional(),styles:o.z.record(o.z.record(o.z.any())).optional()}),X=b.extend({styles:o.z.object({hotpoint:o.z.object({icon:o.z.string().optional(),iconPosition:o.z.enum(["left","right"]).optional(),iconSize:o.z.string().optional(),iconColor:o.z.string().optional(),image:c.optional(),imageFormat:o.z.enum(["circle","square","custom"]).optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:o.z.string().optional(),borderRadius:o.z.string().optional(),glow:o.z.boolean().optional(),glowColor:o.z.string().optional(),background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),textColor:o.z.string().optional()}).optional()}).optional()}),ee=b.extend({layout:o.z.enum(["horizontal","vertical","grid"]),gridColumns:o.z.number().optional(),preset:o.z.enum(["default","modern","trivia","custom"]),styles:o.z.object({general:I,question:I,answers:I.extend({customStyles:o.z.array(o.z.object({color:o.z.string().optional(),backgroundColor:o.z.string().optional(),targets:o.z.string().optional()})).optional(),hover:I.optional()}),button:I.extend({variant:o.z.enum(["default","outline","ghost"]).optional(),hover:I.optional()})}).optional()}),oe=b.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),gridColumns:o.z.number().optional(),gridGap:o.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.z.object({x:o.z.number().optional(),y:o.z.number().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.z.object({title:u.optional(),sandbox:s.optional(),item:I.optional(),group:s.optional(),container:s.extend({url:o.z.string().optional(),type:v.optional()}).optional(),groups:I.optional(),feedback:o.z.object({correct:o.z.string().optional(),incorrect:o.z.string().optional(),active:o.z.string().optional()}).optional(),referenceSize:o.z.object({width:o.z.number(),height:o.z.number()}).optional()}).optional()}),te=b.extend({styles:o.z.object({editor:s.optional()}).optional()}),ne=b.extend({styles:o.z.object({letter:s.optional(),letterText:u.optional(),slot:s.optional(),container:s.optional()}).optional()}),re=b.extend({styles:o.z.object({button:s.extend({hover:I.optional()}).optional(),buttonText:u.optional(),container:s.optional()}).optional()}),ae=b.extend({primaryColor:o.z.string().optional(),layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({text:u.optional(),cell:s.optional(),grid:s.optional(),clueContainer:s.optional(),clueText:u.optional(),clueTitle:u.optional()}).optional()}),ie=b.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({wordSearch:o.z.object({primaryColor:o.z.string().optional(),highlightColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),textColor:o.z.string().optional(),cellBackgroundColor:o.z.string().optional()}).optional(),text:u.optional(),cell:s.optional(),grid:s.optional(),wordListContainer:s.optional(),wordListText:u.optional(),wordListTitle:u.optional()}).optional()}),ce=b.extend({styles:o.z.object({text:u.optional(),container:s.optional(),infoContainer:s.optional(),infoText:u.optional(),card:s.optional()}).optional()}),le=b.extend({styles:o.z.object({wheelText:u.optional()}).optional()}),pe=b.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:u.optional(),container:s.optional(),wordBank:s.optional(),word:s.optional(),blank:s.optional()}).optional()}),se=b.extend({styles:o.z.object({card:s.optional(),cardText:u.optional(),container:s.optional()}).optional()}),me=b.extend({styles:o.z.object({cardFront:s.optional(),cardBack:s.optional(),frontText:u.optional(),backText:u.optional(),navigation:s.optional(),navigationText:u.optional()}).optional()}),de=b.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:u.optional(),card:s.optional(),container:s.optional()}).optional()}),he=b.extend({styles:o.z.object({shape:I.extend({fillColor:o.z.string().optional(),textColor:o.z.string().optional(),borderStyle:o.z.enum(["solid","dashed","dotted"]).optional(),padding:o.z.number().optional()}).optional()}).optional()});var G={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 lt(t){let r=G[t.toLowerCase()];if(!r)return[];let n=new Set;for(let i of Object.values(r))for(let a of i??[])n.add(a);return[...n]}var We={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"]},Ge=new Set(["chart","media","image","puzzle"]);function pt(t){if(!t)return"";let r=t.toLowerCase();if(Ge.has(r))return`
2
+ [STYLE TARGETS] Il blocco "${t}" 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=We[r];if(!n||n.length===0)return"";let i=G[r]??{},a=["general","title","answers","button"].filter(h=>i[h]).map(h=>`${h}\u2192${i[h].join("/")}`).join(", ");return`
3
+ [STYLE TARGETS for ${t}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function ue(t,r){if(!t)return t;let n={...t};for(let[D,A]of Object.entries(n))if(A&&typeof A=="object"){let T={...A},S=!1;T.backgroundColor!==void 0&&T.background===void 0&&(T.background=!0,S=!0),T.borderColor!==void 0&&T.border===void 0&&(T.border=!0,S=!0),S&&(n[D]=T)}if(!r)return n;let i=G[r.toLowerCase()];if(!i)return n;let a=(D,A)=>{A&&(n[D]={...n[D]||{},...A})},h=["title","answers","button","general"],d={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let D of h){let A=d[D],T=i[D];if(A&&T)for(let S of T)a(S,A)}return n}function st(t,r,n){if(!t){let d={...r};return d.styles&&(d.styles=ue(d.styles,n)),d}if(!r)return t;let i={...t,...r},a=ue(r.styles,n),h=t.styles||{};if(t.styles||a){i.styles={...h,...a};for(let d of Object.keys(i.styles))h[d]&&a?.[d]&&(i.styles[d]={...h[d],...a[d]})}return i}var l=require("zod"),ge=l.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),Ne=l.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),mt=l.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),dt=l.z.enum(["completed","half_way"]),ht=l.z.enum(["single_click","double_click"]),ut=l.z.literal("key_pressed"),ye=l.z.object({event:ge.optional(),variableName:l.z.string().optional(),operator:Ne.optional(),value:l.z.any()}),qe=l.z.enum(["set","add","subtract","multiply","divide"]),He=l.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),Ke=l.z.object({name:l.z.string(),value:l.z.union([l.z.number(),l.z.string(),l.z.boolean()]),operation:qe.optional()}),Se=l.z.object({id:l.z.string(),type:He,condition:ye.optional(),conditions:l.z.array(ye).optional(),conditionsOperator:l.z.enum(["and","or"]).optional(),modalContent:l.z.string().optional(),audioUrl:l.z.string().optional(),linkUrl:l.z.string().optional(),targetSceneId:l.z.string().optional(),targetBlockId:l.z.string().optional(),direction:l.z.enum(["up","down","left","right"]).optional(),distance:l.z.number().optional(),variable:Ke.optional()}),yt=l.z.object({name:l.z.string(),defaultValue:l.z.union([l.z.string(),l.z.number(),l.z.boolean()])}),gt=l.z.object({type:ge,blockId:l.z.string(),data:l.z.record(l.z.any()).optional()});var y=require("zod");var St=y.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),E=y.z.enum(["left","right","center"]),Q=y.z.object({width:y.z.number().optional(),height:y.z.number().optional()}),Je=y.z.object({id:y.z.string(),text:y.z.string(),isCorrect:y.z.boolean(),image:c.optional(),imageAlign:E.optional(),imageSize:Q.optional()}),Ve={id:y.z.string(),text:y.z.string(),score:y.z.number().optional(),image:c.optional(),imageAlign:E.optional(),imageSize:Q.optional()},$e=y.z.object({...Ve,type:y.z.enum(["single-choice","multiple-choice"]),options:y.z.array(Je)}),Ye=y.z.object({...Ve,type:y.z.literal("true-false"),correctAnswer:y.z.boolean()}),Ue=y.z.object({...Ve,type:y.z.enum(["short-answers","long-answers"]),minCharacters:y.z.number().optional(),maxCharacters:y.z.number().optional()}),be=y.z.discriminatedUnion("type",[$e,Ye,Ue]);var e=require("zod");var j=require("zod");var N=j.z.enum(["scattered","rotated","scattered_rotated"]),Ze=j.z.enum(["swap","slide"]),fe=j.z.object({image:j.z.union([j.z.string(),c]).optional().describe("Image URL or MediaItem for puzzle."),pieces:j.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:N.optional(),puzzleType:Ze.optional(),showNumbers:j.z.union([j.z.boolean(),j.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:j.z.string().optional().describe("Deterministic seed for piece placement.")});var Xe=e.z.enum(["2D","360\xB0"]),q={id:e.z.string(),type:Y,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:U.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:R.optional(),minSize:R.optional(),maxSize:R.optional(),theme:b.optional()},x={...q,actions:e.z.array(Se).optional(),score:e.z.number().optional()},bt=e.z.object(x),eo=e.z.object({id:e.z.string(),text:e.z.string(),background:c.optional(),opacity:e.z.number().optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),styles:s.optional(),textStyles:u.optional()}),oo=e.z.object({id:e.z.string(),name:e.z.string(),background:c.optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),singleItem:e.z.boolean().optional(),opacity:e.z.number().optional(),styles:s.optional(),textStyles:u.optional(),items:e.z.array(eo)}),to=e.z.enum(["d4","d6","d8","d10","d12","d20"]),no=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()}),ro=e.z.object({answer:e.z.string(),clue:e.z.string(),image:c.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()}),ao=e.z.object({grid:e.z.array(e.z.array(no)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(ro)}),io=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()}))}))}),co=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]),content:e.z.tuple([e.z.string(),e.z.string()])}),lo=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional(),image:c.optional()}),xe=e.z.object({type:e.z.enum(["text","image"]),content:e.z.any()}),po=e.z.object({id:e.z.string(),front:xe,back:xe}),so=e.z.object({id:e.z.string(),frontImage:c.optional(),frontText:e.z.string().optional()}),mo=e.z.object({id:e.z.string(),leftLabel:e.z.string(),rightLabel:e.z.string(),leftImage:e.z.any().optional(),rightImage:e.z.any().optional()}),ho=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"]),ke=e.z.enum(["none","arrow","circle","square"]),uo=e.z.object({id:e.z.string(),text:e.z.string(),t:e.z.number(),offsetX:e.z.number().optional(),offsetY:e.z.number().optional(),fontSize:e.z.number().optional(),color:e.z.string().optional(),backgroundColor:e.z.string().optional()}),yo=e.z.object({...x,type:e.z.literal("Quiz"),questions:e.z.array(be).optional(),previewIndex:e.z.number().optional(),required:e.z.boolean().optional(),showResults:e.z.boolean().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional(),submitText:e.z.string().optional(),timer:e.z.string().optional(),showQuestionCount:e.z.boolean().optional(),theme:ee}),go=e.z.object({...x,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional(),element:e.z.enum(["image","button"]),theme:X.optional()}),So=e.z.object({...x,type:e.z.literal("Editor"),content:e.z.any().optional(),readonly:e.z.boolean().optional(),theme:te.optional()}),bo=e.z.object({...q,type:e.z.literal("Media"),media:c.optional()}),fo=e.z.object({...q,type:e.z.literal("Embed"),url:e.z.string().optional(),readOnly:e.z.boolean().optional()}),xo=e.z.object({...x,type:e.z.literal("DragAndDrop"),groups:e.z.array(oo),theme:oe.optional(),showResults:e.z.boolean().optional(),layout:e.z.enum(["manual","split"]).optional(),itemArrangement:e.z.enum(["random","list","grid"]).optional(),groupBackground:c.optional(),enableWrongAnswers:e.z.boolean().optional(),itemBackground:c.optional(),groupBackgroundOpacity:e.z.number().optional(),itemBackgroundOpacity:e.z.number().optional(),splitRatio:e.z.number().optional()}),ko=e.z.object({...x,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()),correctWord:e.z.string(),theme:ne.optional(),clue:e.z.string().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional()}),zo=e.z.object({...x,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional(),diceType:to.optional(),faceOverrides:e.z.any().optional(),color:e.z.string().optional(),showNumber:e.z.boolean().optional(),diceCount:e.z.number().optional(),dicePool:e.z.record(e.z.number()).optional(),persistent:e.z.boolean().optional(),theme:re.optional()}),Co=e.z.object({...x,type:e.z.literal("Puzzle"),image:c.optional(),pieces:e.z.number().optional(),gameMode:N.optional(),puzzleType:e.z.enum(["swap","slide"]).optional(),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional(),seed:e.z.string().optional()}),Bo=e.z.object({...x,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string(),clue:e.z.string(),image:c.optional()})).optional(),layout:ao.optional(),theme:ae.optional()}),To=e.z.enum(["easy","medium","hard"]),wo=e.z.object({...x,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional(),gridSize:M.optional(),difficulty:To.optional(),data:io.optional(),theme:ie.optional()}),Ao=e.z.object({...x,type:e.z.literal("Memory"),pairs:e.z.array(co),gridSize:M.optional(),hideScore:e.z.boolean().optional(),theme:ce.optional()}),jo=e.z.object({...x,type:e.z.literal("Flashcard"),cards:e.z.array(po),theme:me.optional()}),Io=e.z.object({...x,type:e.z.literal("SpinningWheel"),slices:e.z.array(lo),spinDuration:e.z.number().optional(),theme:le.optional()}),Do=e.z.object({...x,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.z.array(e.z.any()),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional(),xAxisLabel:e.z.string().optional(),yAxisLabel:e.z.string().optional(),showLegend:e.z.boolean().optional(),showTooltip:e.z.boolean().optional(),stacked:e.z.boolean().optional(),seriesNames:e.z.record(e.z.string()).optional()})}),Mo=e.z.object({...x,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional(),pairs:e.z.array(mo),theme:de.optional()}),Po=e.z.object({...x,type:e.z.literal("Cloze"),templateText:e.z.string().optional(),theme:pe.optional(),mode:e.z.enum(["write","drag-drop"]).optional()}),Oo=e.z.object({...x,type:e.z.literal("CardDeck"),cards:e.z.array(so),backImage:c.optional(),discardLogic:e.z.enum(["delete","return"]),theme:se.optional()}),vo=e.z.object({...q,type:e.z.literal("Shape"),shapeType:ho.optional(),text:e.z.string().optional(),theme:he.optional()}),Eo=e.z.object({...q,type:e.z.literal("Arrow"),startBlockId:e.z.string(),endBlockId:e.z.string().optional(),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional(),startHandle:e.z.enum(["top","right","bottom","left"]),endHandle:e.z.enum(["top","right","bottom","left"]).optional(),connectionType:e.z.enum(["straight","orthogonal","curved"]),strokeColor:e.z.string().optional(),strokeWidth:e.z.number().optional(),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional(),showHead:e.z.boolean().optional(),startHead:ke.optional(),endHead:ke.optional(),bendOffsetX:e.z.number().optional(),bendOffsetY:e.z.number().optional(),segmentCount:e.z.number().optional(),bendOffsets:e.z.array(e.z.number()).optional(),labels:e.z.array(uo).optional()}),ze=e.z.discriminatedUnion("type",[yo,go,So,fo,bo,xo,ko,zo,Co,Bo,wo,Ao,jo,Io,Do,Mo,vo,Eo,Po,Oo]),Qo=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()}),Lo=e.z.object({id:e.z.string(),title:e.z.string(),type:Xe,background:e.z.union([e.z.string(),e.z.array(e.z.string()),c]).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(ze),groups:e.z.array(Qo).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()}),ft=e.z.object({id:e.z.string(),title:e.z.string(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(Lo),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:c.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()}),xt=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:ze});var k=require("zod"),_o=k.z.object({id:k.z.string(),type:k.z.string(),title:k.z.string()}),Ro=k.z.object({id:k.z.string(),title:k.z.string(),position:k.z.number(),blocks:k.z.array(_o).default([])}),kt=k.z.object({activity:k.z.object({id:k.z.string(),title:k.z.string(),scenes:k.z.array(Ro).default([])}),activeSceneId:k.z.string().nullable().optional()});var g=require("zod");var Fo=g.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Wo=g.z.object({id:g.z.string().optional(),text:g.z.string(),isCorrect:g.z.boolean(),image:c.optional().describe("Option image."),imageAlign:E.optional().describe("Option image alignment."),imageSize:Q.optional().describe("Option image size.")}),Go=g.z.object({id:g.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:Fo,text:g.z.string().describe("The question text."),score:g.z.number().optional(),options:g.z.array(Wo).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:g.z.boolean().optional().describe("Required for true-false."),image:c.optional().describe("Question image."),imageAlign:E.optional().describe("Question image alignment."),imageSize:Q.optional().describe("Question image size.")}),Ce=g.z.object({questions:g.z.array(Go).describe("Array of question objects."),showResults:g.z.boolean().optional(),allowRetry:g.z.boolean().optional(),maxRetry:g.z.string().optional(),required:g.z.boolean().optional(),submitText:g.z.string().optional().describe("Label for submit button."),timer:g.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:g.z.boolean().optional().describe("Show current/total questions count.")});var Be=require("zod"),No=Be.z.enum(["write","drag-drop"]),Te=Be.z.object({templateText:Be.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:No.optional().describe("Input mode. Default: write.")});var z=require("zod");var zt=z.z.enum(["Crossword","WordSearch","Anagram"]),qo=z.z.object({answer:z.z.string(),clue:z.z.string(),image:c.optional().describe("Clue image.")}),we=z.z.object({words:z.z.array(qo)}),Ae=z.z.object({words:z.z.array(z.z.string()),gridSize:M.optional().describe("Grid dimensions."),difficulty:z.z.enum(["easy","medium","hard"]).optional()}),je=z.z.object({correctWord:z.z.string().describe("The correct word."),letters:z.z.array(z.z.string()).optional(),clue:z.z.string().optional().describe("A hint.")});var w=require("zod");var Ct=w.z.enum(["Memory","MatchPairs"]),Ho=w.z.enum(["img-img","img-word","word-word"]),Ko=w.z.object({id:w.z.string().optional(),type:Ho.optional().describe("For Memory: pair type."),content:w.z.array(w.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:w.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:w.z.string().optional().describe("For MatchPairs: right side text."),leftImage:c.optional().describe("For MatchPairs: left side image."),rightImage:c.optional().describe("For MatchPairs: right side image.")}),H=w.z.object({pairs:w.z.array(Ko).describe("Array of pair objects."),gridSize:M.optional().describe("For Memory: grid dimensions."),instructions:w.z.string().optional().describe("For MatchPairs: instruction text.")});var B=require("zod"),Bt=B.z.enum(["Flashcard","CardDeck"]),Ie=B.z.object({type:B.z.enum(["text","image"]),content:B.z.any()}),Jo=B.z.object({id:B.z.string().optional(),front:Ie.optional().describe("For Flashcard: front side."),back:Ie.optional().describe("For Flashcard: back side."),frontText:B.z.string().optional().describe("For CardDeck: front text."),frontImage:B.z.any().optional().describe("For CardDeck: front image.")}),K=B.z.object({cards:B.z.array(Jo).describe("Array of card objects."),backImage:B.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:B.z.enum(["delete","return"]).optional().describe("For CardDeck.")});var L=require("zod"),Vo=L.z.enum(["d4","d6","d8","d10","d12","d20"]),De=L.z.object({diceType:Vo.optional(),diceCount:L.z.number().int().min(1).max(10).optional(),color:L.z.string().optional().describe("CSS color for dice."),showNumber:L.z.boolean().optional(),persistent:L.z.boolean().optional().describe("Keep dice visible after roll.")});var P=require("zod");var $o=P.z.object({id:P.z.string().optional(),text:P.z.string(),color:P.z.string().optional().describe("CSS color for slice."),image:c.optional().describe("Slice image.")}),Me=P.z.object({slices:P.z.array($o).min(2).describe("Wheel slices (min 2)."),spinDuration:P.z.number().optional().describe("Spin duration in seconds.")});var m=require("zod");var Yo=m.z.object({id:m.z.string().optional(),text:m.z.string(),background:c.optional().describe("Background image/color for item."),opacity:m.z.number().optional().describe("Opacity of the item (0-1)."),x:m.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:m.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:m.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:m.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:m.z.number().optional().describe("Manual width in pixels."),height:m.z.number().optional().describe("Manual height in pixels."),styles:s.optional().describe("Box custom styling styles."),textStyles:u.optional().describe("Text custom styling styles.")}),Uo=m.z.object({id:m.z.string().optional(),name:m.z.string().describe("Group/dropzone name."),singleItem:m.z.boolean().optional().describe("Accept only one item inside."),background:c.optional().describe("Background image/color for group."),x:m.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:m.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:m.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:m.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:m.z.number().optional().describe("Manual width in pixels."),height:m.z.number().optional().describe("Manual height in pixels."),opacity:m.z.number().optional().describe("Opacity of the group (0-1)."),styles:s.optional().describe("Box custom styling styles."),textStyles:u.optional().describe("Text custom styling styles."),items:m.z.array(Yo).describe("Items that belong in this group.")}),Pe=m.z.object({groups:m.z.array(Uo).min(1).describe("Drag-and-drop groups."),layout:m.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:m.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:m.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:m.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:m.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:c.optional().describe("Shared background image/color for all groups."),itemBackground:c.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:m.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:m.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:m.z.number().optional().describe("Proportion ratio for split layout.")});var C=require("zod"),Zo=C.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),Xo=C.z.object({colors:C.z.array(C.z.string()).optional(),xAxisLabel:C.z.string().optional(),yAxisLabel:C.z.string().optional(),showLegend:C.z.boolean().optional(),showTooltip:C.z.boolean().optional(),stacked:C.z.boolean().optional(),seriesNames:C.z.record(C.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")}),Oe=C.z.object({chartType:Zo.optional(),chartData:C.z.array(C.z.record(C.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:Xo.optional()});var J=require("zod");var _=J.z.object({content:J.z.any().optional().describe("For Editor: Plate JSON content array."),url:J.z.string().optional().describe("For Media or Embed: content URL."),text:J.z.string().optional().describe("For Shape: text inside shape."),mediaType:v.optional().describe("For Media: media type.")});var Tt=Lt(require("zod-to-json-schema"));var Vt=Tt.zodToJsonSchema,F={Quiz:Ce,Cloze:Te,Crossword:we,WordSearch:Ae,Anagram:je,Memory:H,MatchPairs:H,Flashcard:K,CardDeck:K,Dice:De,SpinningWheel:Me,DragAndDrop:Pe,Chart:Oe,Puzzle:fe,Editor:_,Media:_,Embed:_,Shape:_};function $t(t,r,n,i){let a=n?"*required*":"optional",h=et(r),d=r.description?` \u2014 ${r.description}`:"";return`${i}- \`${t}\` (${h}, ${a})${d}`}function et(t){return t.enum?`enum: ${t.enum.map(r=>JSON.stringify(r)).join(" | ")}`:t.anyOf||t.oneOf?(t.anyOf||t.oneOf).map(et).join(" | "):Array.isArray(t.type)?t.type.join(" | "):t.type==="array"&&t.items?`array<${et(t.items)}>`:t.type==="object"?"object":t.type??"any"}function ot(t,r){let n=[],i=new Set(t.required??[]),a=t.properties??{};for(let[h,d]of Object.entries(a))n.push($t(h,d,i.has(h),r)),d.type==="object"&&d.properties?n.push(ot(d,r+" ")):d.type==="array"&&d.items?.type==="object"&&n.push(ot(d.items,r+" "));return n.join(`
4
+ `)}function wt(){let t=[],r=new Map;for(let[n,i]of Object.entries(F)){let a=r.get(i)??[];a.push(n),r.set(i,a)}for(let[n,i]of r.entries()){let a=i.join(" / "),h=Vt(n,{target:"jsonSchema7"}),d=ot(h,"");t.push(`### ${a}
5
+ ${d||"_(no configurable fields)_"}`)}return t.join(`
6
6
 
7
- `)}});var Le=g(j=>{"use strict";var Wo=j&&j.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),J=j&&j.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Wo(i,a,n)};Object.defineProperty(j,"__esModule",{value:!0});J(_e(),j);J(L(),j);J(pe(),j);J(Ve(),j);J(Me(),j);J(ue(),j);J(Je(),j);J(Xe(),j);J(De(),j);J(po(),j)});var ke={};Be(ke,{CANVAS_OP_NAMES:()=>We,CANVAS_OP_REQUIRED:()=>le,applyItemPatch:()=>Ge,detectConflict:()=>Ke,entitySignature:()=>Ce,getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,isKnownCanvasOp:()=>Te,listBlockTypes:()=>ye,opConflictStamp:()=>He,opTarget:()=>xe,parseMentions:()=>Ye,resolveMentions:()=>$e,stableStringify:()=>re,validateCanvasOp:()=>Ne});module.exports=fo(ke);var X={};Be(X,{CANVAS_OP_NAMES:()=>We,CANVAS_OP_REQUIRED:()=>le,applyItemPatch:()=>Ge,detectConflict:()=>Ke,entitySignature:()=>Ce,getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,isKnownCanvasOp:()=>Te,listBlockTypes:()=>ye,opConflictStamp:()=>He,opTarget:()=>xe,parseMentions:()=>Ye,resolveMentions:()=>$e,stableStringify:()=>re,validateCanvasOp:()=>Ne});var le={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"]},We=Object.keys(le);function Te(a){return Object.prototype.hasOwnProperty.call(le,a)}function Ne(a,i){if(!Te(a))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${a}"`]};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=le[a].filter(l=>n[l]===void 0||n[l]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(l=>`missing field: ${l}`)}:a==="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 Ge(a,i,n){let c=Array.isArray(a)?[...a]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let l=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(l,c.length)),0,n.item),c}return i==="updateItem"?c.map(l=>l&&typeof l=="object"&&l.id===n.itemId?{...l,...n.item??{}}:l):c.filter(l=>!(l&&typeof l=="object"&&l.id===n.itemId))}var ko=new Set(["position","size","rotation","zIndex","z"]);function re(a){return a===null||typeof a!="object"?JSON.stringify(a)??"null":Array.isArray(a)?"["+a.map(re).join(",")+"]":"{"+Object.keys(a).sort().map(n=>JSON.stringify(n)+":"+re(a[n])).join(",")+"}"}function xe(a,i){let n=i??{};switch(a){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 Bo(a,i){if(Array.isArray(a))for(let n of a){let c=n?.blocks?.find?.(l=>l&&l.id===i);if(c)return c}}function Ce(a,i){if(i.kind==="untracked")return null;let n=i.blockId?Bo(a,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let h={};for(let u of Object.keys(n))ko.has(u)||(h[u]=n[u]);return re(h)}let c=n[i.collection];if(!Array.isArray(c))return null;let l=c.find(h=>h&&h.id===i.itemId);return l?re(l):null}function Ke(a,i){return a==null?"apply":i==null?"missing":a===i?"apply":"stale"}function He(a,i,n){let c=xe(a,i);return{target:c,baseSignature:Ce(n,c)}}var we=/@\[([^\]|]+)\|([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 Ye(a){let i=[];for(let n of(a??"").matchAll(we))i.push({name:n[1].trim(),id:n[2]});return i}function $e(a,i){let n=new Map,c=new Map;for(let k of i?.scenes??[]){k?.id&&n.set(k.id,k);for(let x of k?.blocks??[])x?.id&&c.set(x.id,{block:x,sceneId:k.id})}let l=[],h=new Set,u=k=>c.has(k)?"il blocco selezionato":n.has(k)?"la scena selezionata":"l'elemento selezionato",Z=(k,x)=>{if(!h.has(x))if(c.has(x)){let{block:ee,sceneId:ho}=c.get(x);l.push({id:x,name:k,kind:"block",blockType:ee?.type,sceneId:ho}),h.add(x)}else n.has(x)&&(l.push({id:x,name:k,kind:"scene"}),h.add(x))},W=(a??"").replace(we,(k,x,ee)=>(Z(x.trim(),ee),x.trim())),E=(a??"").replace(we,(k,x,ee)=>c.has(ee)||n.has(ee)?u(ee):x.trim());return{cleanedText:W,agentText:E,entities:l}}var O={};Be(O,{getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,listBlockTypes:()=>ye});var uo=require("zod-to-json-schema"),Fe=Qe(Le());I(O,Qe(Le()));function ye(){return Object.keys(Fe.BLOCK_CONTENT_SCHEMAS)}function fe(a){let i=Fe.BLOCK_CONTENT_SCHEMAS[a];if(i)return(0,uo.zodToJsonSchema)(i,{target:"jsonSchema7",$refStrategy:"none"})}function Re(){return Object.fromEntries(ye().map(a=>[a,fe(a)]))}I(X,O);I(ke,X,module.exports);0&&(module.exports={CANVAS_OP_NAMES,CANVAS_OP_REQUIRED,applyItemPatch,detectConflict,entitySignature,getAllBlockJsonSchemas,getBlockJsonSchema,isKnownCanvasOp,listBlockTypes,opConflictStamp,opTarget,parseMentions,resolveMentions,stableStringify,validateCanvasOp});
7
+ `)}function jt(){return Object.keys(F)}function It(t){let r=F[t];if(r)return(0,At.zodToJsonSchema)(r,{target:"jsonSchema7",$refStrategy:"none"})}function Yt(){return Object.fromEntries(jt().map(t=>[t,It(t)]))}0&&(module.exports={ActionBlockSchema,ActionConditionSchema,ActionSchema,ActionTypeSchema,ActionVariableSchema,ActivityContentSchema,ActivityContextSchema,ActivityVariableSchema,AnagramBlockSchema,AnagramBlockThemeSchema,AnagramContentSchema,AnimationSchema,ArrowBlockSchema,ArrowHeadTypeSchema,ArrowLabelSchema,BLOCK_CONTENT_SCHEMAS,BLOCK_STYLE_KEYS,BLOCK_TYPES,BasicContentSchema,BlockEventSchema,BlockEventTypeSchema,BlockGroupSchema,BlockSchema,BlockThemeSchema,BlockTypeSchema,BoxSideSchema,BoxStylesSchema,CANVAS_OP_NAMES,CANVAS_OP_REQUIRED,CanvasDragItemSchema,CardDeckBlockSchema,CardDeckBlockThemeSchema,CardFaceSchema,CardItemSchema,CardSchema,ChartBlockSchema,ChartConfigSchema,ChartContentSchema,ChartTypeSchema,ChoiceQuestionSchema,ClickConditionSchema,ClozeBlockSchema,ClozeBlockThemeSchema,ClozeContentSchema,ClozeModeSchema,ConditionOperatorSchema,CropDataSchema,CrosswordBlockSchema,CrosswordBlockThemeSchema,CrosswordCellSchema,CrosswordContentSchema,CrosswordLayoutOutputSchema,CrosswordLayoutWordSchema,CrosswordWordSchema,DeckBlockTypeSchema,DeckContentSchema,DiceBlockSchema,DiceBlockThemeSchema,DiceContentSchema,DiceTypeSchema,DieTypeSchema,DragAndDropBlockSchema,DragAndDropBlockThemeSchema,DragAndDropContentSchema,DragAndDropGroupSchema,DragAndDropItemSchema,DragGroupSchema,DragItemSchema,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,MemoryPairTypeSchema,PairGameBlockTypeSchema,PairGameContentSchema,PairSchema,PositionSchema,PuzzleBlockSchema,PuzzleContentSchema,PuzzleGameModeSchema,PuzzleTypeSchema,QuestionOptionSchema,QuestionSchema,QuestionTypeSchema,QuizBlockSchema,QuizBlockThemeSchema,QuizConditionSchema,QuizContentSchema,QuizOptionSchema,QuizQuestionSchema,QuizQuestionTypeSchema,RadiusSchema,STYLE_TARGET_MAP,SceneBlockRefSchema,SceneSchema,SceneSummarySchema,SceneTypeSchema,ShapeBlockSchema,ShapeBlockThemeSchema,ShapeTypeSchema,SizeSchema,SpinnerContentSchema,SpinnerSliceSchema,SpinningWheelBlockSchema,SpinningWheelBlockThemeSchema,TextQuestionSchema,TextStylesSchema,TimerConditionSchema,TrueFalseQuestionSchema,UNSTYLEABLE_BLOCKS,VideoSettingsSchema,WheelSliceSchema,WordGameBlockTypeSchema,WordSearchBlockSchema,WordSearchBlockThemeSchema,WordSearchContentSchema,WordSearchDataSchema,WordSearchDifficultySchema,applyItemPatch,detectConflict,entitySignature,generateBlockReference,getAllBlockJsonSchemas,getBlockJsonSchema,isKnownCanvasOp,listBlockTypes,mapLogicalThemeStyles,mergeTheme,opConflictStamp,opTarget,parseMentions,realStyleKeysFor,resolveMentions,stableStringify,styleTargetsHelpFor,validateCanvasOp});
package/dist/index.mjs CHANGED
@@ -1,8 +1,7 @@
1
- import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
2
- var zo=Object.create;var Be=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var B=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(i,n)=>(typeof require<"u"?require:i)[n]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var g=(a,i)=>()=>{try{return i||a((i={exports:{}}).exports,i),i.exports}catch(n){throw i=0,n}},Te=(a,i)=>{for(var n in i)Be(a,n,{get:i[n],enumerable:!0})},ke=(a,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of bo(i))!yo.call(a,l)&&l!==n&&Be(a,l,{get:()=>i[l],enumerable:!(c=So(i,l))||c.enumerable});return a},M=(a,i,n)=>(ke(a,i,"default"),n&&ke(n,i,"default")),We=(a,i,n)=>(n=a!=null?zo(go(a)):{},ke(i||!a||!a.__esModule?Be(n,"default",{value:a,enumerable:!0}):n,a));var je=g(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.BlockTypeSchema=te.BLOCK_TYPES=void 0;var Bo=B("zod");te.BLOCK_TYPES=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"];te.BlockTypeSchema=Bo.z.enum(te.BLOCK_TYPES)});var F=g(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.MediaRefSchema=S.MediaItemSchema=S.VideoSettingsSchema=S.CropDataSchema=S.MediaSourceSchema=S.MediaTypeSchema=S.GridSizeSchema=S.SizeSchema=S.PositionSchema=void 0;var m=B("zod");S.PositionSchema=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()});S.SizeSchema=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()});S.GridSizeSchema=m.z.object({rows:m.z.number(),cols:m.z.number()});S.MediaTypeSchema=m.z.enum(["image","color","gif","shape","illustration","video","audio"]);S.MediaSourceSchema=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]);S.CropDataSchema=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()});S.VideoSettingsSchema=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.MediaItemSchema=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:S.MediaTypeSchema,source:S.MediaSourceSchema.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:S.CropDataSchema.optional(),duration:m.z.number().optional(),videoSettings:S.VideoSettingsSchema.optional()});S.MediaRefSchema=S.MediaItemSchema});var de=g(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ShapeBlockThemeSchema=r.MatchPairsBlockThemeSchema=r.FlashcardBlockThemeSchema=r.CardDeckBlockThemeSchema=r.ClozeBlockThemeSchema=r.SpinningWheelBlockThemeSchema=r.MemoryBlockThemeSchema=r.WordSearchBlockThemeSchema=r.CrosswordBlockThemeSchema=r.DiceBlockThemeSchema=r.AnagramBlockThemeSchema=r.EditorBlockThemeSchema=r.DragAndDropBlockThemeSchema=r.QuizBlockThemeSchema=r.HotpointBlockThemeSchema=r.BlockThemeSchema=r.TextStylesSchema=r.BoxStylesSchema=r.RadiusSchema=r.BoxSideSchema=r.AnimationSchema=void 0;var o=B("zod"),Ie=F();r.AnimationSchema=o.z.object({type:o.z.union([o.z.enum(["none","fade","direction","bounce","scale","rotate"]),o.z.string()]),duration:o.z.number().optional(),delay:o.z.number().optional(),phase:o.z.enum(["in","both","out"]).optional(),direction:o.z.enum(["up","right","down","left"]).optional()});r.BoxSideSchema=o.z.object({top:o.z.union([o.z.string(),o.z.number()]).optional(),right:o.z.union([o.z.string(),o.z.number()]).optional(),bottom:o.z.union([o.z.string(),o.z.number()]).optional(),left:o.z.union([o.z.string(),o.z.number()]).optional()});r.RadiusSchema=o.z.object({topLeft:o.z.union([o.z.string(),o.z.number()]).optional(),topRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomLeft:o.z.union([o.z.string(),o.z.number()]).optional()});r.BoxStylesSchema=o.z.object({background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),backgroundOpacity:o.z.number().optional(),backgroundMedia:Ie.MediaItemSchema.optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:r.BoxSideSchema.optional(),borderRadius:r.RadiusSchema.optional(),padding:o.z.union([o.z.string(),o.z.number(),r.BoxSideSchema]).optional()});r.TextStylesSchema=o.z.object({color:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),fontWeight:o.z.union([o.z.string(),o.z.number()]).optional(),textAlign:o.z.enum(["left","center","right","justify"]).optional()});var H=r.BoxStylesSchema.merge(r.TextStylesSchema);r.BlockThemeSchema=o.z.object({spacing:o.z.enum(["no-spacing","small","medium","large"]).optional(),animation:r.AnimationSchema.optional(),styles:o.z.record(o.z.record(o.z.any())).optional()});r.HotpointBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({hotpoint:o.z.object({icon:o.z.string().optional(),iconPosition:o.z.enum(["left","right"]).optional(),iconSize:o.z.string().optional(),iconColor:o.z.string().optional(),image:Ie.MediaItemSchema.optional(),imageFormat:o.z.enum(["circle","square","custom"]).optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:o.z.string().optional(),borderRadius:o.z.string().optional(),glow:o.z.boolean().optional(),glowColor:o.z.string().optional(),background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),textColor:o.z.string().optional()}).optional()}).optional()});r.QuizBlockThemeSchema=r.BlockThemeSchema.extend({layout:o.z.enum(["horizontal","vertical","grid"]),gridColumns:o.z.number().optional(),preset:o.z.enum(["default","modern","trivia","custom"]),styles:o.z.object({general:H,question:H,answers:H.extend({customStyles:o.z.array(o.z.object({color:o.z.string().optional(),backgroundColor:o.z.string().optional(),targets:o.z.string().optional()})).optional(),hover:H.optional()}),button:H.extend({variant:o.z.enum(["default","outline","ghost"]).optional(),hover:H.optional()})}).optional()});r.DragAndDropBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),gridColumns:o.z.number().optional(),gridGap:o.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.z.object({x:o.z.number().optional(),y:o.z.number().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.z.object({title:r.TextStylesSchema.optional(),sandbox:r.BoxStylesSchema.optional(),item:H.optional(),group:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.extend({url:o.z.string().optional(),type:Ie.MediaTypeSchema.optional()}).optional(),groups:H.optional(),feedback:o.z.object({correct:o.z.string().optional(),incorrect:o.z.string().optional(),active:o.z.string().optional()}).optional(),referenceSize:o.z.object({width:o.z.number(),height:o.z.number()}).optional()}).optional()});r.EditorBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({editor:r.BoxStylesSchema.optional()}).optional()});r.AnagramBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({letter:r.BoxStylesSchema.optional(),letterText:r.TextStylesSchema.optional(),slot:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.DiceBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({button:r.BoxStylesSchema.extend({hover:H.optional()}).optional(),buttonText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.CrosswordBlockThemeSchema=r.BlockThemeSchema.extend({primaryColor:o.z.string().optional(),layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),clueContainer:r.BoxStylesSchema.optional(),clueText:r.TextStylesSchema.optional(),clueTitle:r.TextStylesSchema.optional()}).optional()});r.WordSearchBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({wordSearch:o.z.object({primaryColor:o.z.string().optional(),highlightColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),textColor:o.z.string().optional(),cellBackgroundColor:o.z.string().optional()}).optional(),text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),wordListContainer:r.BoxStylesSchema.optional(),wordListText:r.TextStylesSchema.optional(),wordListTitle:r.TextStylesSchema.optional()}).optional()});r.MemoryBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),infoContainer:r.BoxStylesSchema.optional(),infoText:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional()}).optional()});r.SpinningWheelBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({wheelText:r.TextStylesSchema.optional()}).optional()});r.ClozeBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),wordBank:r.BoxStylesSchema.optional(),word:r.BoxStylesSchema.optional(),blank:r.BoxStylesSchema.optional()}).optional()});r.CardDeckBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({card:r.BoxStylesSchema.optional(),cardText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.FlashcardBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({cardFront:r.BoxStylesSchema.optional(),cardBack:r.BoxStylesSchema.optional(),frontText:r.TextStylesSchema.optional(),backText:r.TextStylesSchema.optional(),navigation:r.BoxStylesSchema.optional(),navigationText:r.TextStylesSchema.optional()}).optional()});r.MatchPairsBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.ShapeBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({shape:H.extend({fillColor:o.z.string().optional(),textColor:o.z.string().optional(),borderStyle:o.z.enum(["solid","dashed","dotted"]).optional(),padding:o.z.number().optional()}).optional()}).optional()})});var Ue=g(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.UNSTYLEABLE_BLOCKS=w.BLOCK_STYLE_KEYS=w.STYLE_TARGET_MAP=void 0;w.realStyleKeysFor=To;w.styleTargetsHelpFor=xo;w.mapLogicalThemeStyles=Me;w.mergeTheme=Co;w.STYLE_TARGET_MAP={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 To(a){let i=w.STYLE_TARGET_MAP[a.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let l of c??[])n.add(l);return[...n]}w.BLOCK_STYLE_KEYS={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"]};w.UNSTYLEABLE_BLOCKS=new Set(["chart","media","image","puzzle"]);function xo(a){if(!a)return"";let i=a.toLowerCase();if(w.UNSTYLEABLE_BLOCKS.has(i))return`
3
- [STYLE TARGETS] Il blocco "${a}" 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=w.BLOCK_STYLE_KEYS[i];if(!n||n.length===0)return"";let c=w.STYLE_TARGET_MAP[i]??{},l=["general","title","answers","button"].filter(h=>c[h]).map(h=>`${h}\u2192${c[h].join("/")}`).join(", ");return`
4
- [STYLE TARGETS for ${a}] Logical targets (update_block_theme): ${l}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Me(a,i){if(!a)return a;let n={...a};for(let[ee,N]of Object.entries(n))if(N&&typeof N=="object"){let L={...N},k=!1;L.backgroundColor!==void 0&&L.background===void 0&&(L.background=!0,k=!0),L.borderColor!==void 0&&L.border===void 0&&(L.border=!0,k=!0),k&&(n[ee]=L)}if(!i)return n;let c=w.STYLE_TARGET_MAP[i.toLowerCase()];if(!c)return n;let l=(ee,N)=>{N&&(n[ee]={...n[ee]||{},...N})},h=["title","answers","button","general"],u={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let ee of h){let N=u[ee],L=c[ee];if(N&&L)for(let k of L)l(k,N)}return n}function Co(a,i,n){if(!a){let u={...i};return u.styles&&(u.styles=Me(u.styles,n)),u}if(!i)return a;let c={...a,...i},l=Me(i.styles,n),h=a.styles||{};if(a.styles||l){c.styles={...h,...l};for(let u of Object.keys(c.styles))h[u]&&l?.[u]&&(c.styles[u]={...h[u],...l[u]})}return c}});var ve=g(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.BlockEventSchema=d.ActivityVariableSchema=d.ActionSchema=d.ActionVariableSchema=d.ActionTypeSchema=d.MathOperationSchema=d.ActionConditionSchema=d.KeyPressConditionSchema=d.ClickConditionSchema=d.TimerConditionSchema=d.QuizConditionSchema=d.ConditionOperatorSchema=d.BlockEventTypeSchema=void 0;var s=B("zod");d.BlockEventTypeSchema=s.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]);d.ConditionOperatorSchema=s.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]);d.QuizConditionSchema=s.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]);d.TimerConditionSchema=s.z.enum(["completed","half_way"]);d.ClickConditionSchema=s.z.enum(["single_click","double_click"]);d.KeyPressConditionSchema=s.z.literal("key_pressed");d.ActionConditionSchema=s.z.object({event:d.BlockEventTypeSchema.optional(),variableName:s.z.string().optional(),operator:d.ConditionOperatorSchema.optional(),value:s.z.any()});d.MathOperationSchema=s.z.enum(["set","add","subtract","multiply","divide"]);d.ActionTypeSchema=s.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]);d.ActionVariableSchema=s.z.object({name:s.z.string(),value:s.z.union([s.z.number(),s.z.string(),s.z.boolean()]),operation:d.MathOperationSchema.optional()});d.ActionSchema=s.z.object({id:s.z.string(),type:d.ActionTypeSchema,condition:d.ActionConditionSchema.optional(),conditions:s.z.array(d.ActionConditionSchema).optional(),conditionsOperator:s.z.enum(["and","or"]).optional(),modalContent:s.z.string().optional(),audioUrl:s.z.string().optional(),linkUrl:s.z.string().optional(),targetSceneId:s.z.string().optional(),targetBlockId:s.z.string().optional(),direction:s.z.enum(["up","down","left","right"]).optional(),distance:s.z.number().optional(),variable:d.ActionVariableSchema.optional()});d.ActivityVariableSchema=s.z.object({name:s.z.string(),defaultValue:s.z.union([s.z.string(),s.z.number(),s.z.boolean()])});d.BlockEventSchema=s.z.object({type:d.BlockEventTypeSchema,blockId:s.z.string(),data:s.z.record(s.z.any()).optional()})});var pe=g(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.QuestionSchema=z.TextQuestionSchema=z.TrueFalseQuestionSchema=z.ChoiceQuestionSchema=z.QuestionOptionSchema=z.ImageSizeSchema=z.ImageAlignSchema=z.QuestionTypeSchema=void 0;var b=B("zod"),Je=F();z.QuestionTypeSchema=b.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);z.ImageAlignSchema=b.z.enum(["left","right","center"]);z.ImageSizeSchema=b.z.object({width:b.z.number().optional(),height:b.z.number().optional()});z.QuestionOptionSchema=b.z.object({id:b.z.string(),text:b.z.string(),isCorrect:b.z.boolean(),image:Je.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()});var Ae={id:b.z.string(),text:b.z.string(),score:b.z.number().optional(),image:Je.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()};z.ChoiceQuestionSchema=b.z.object({...Ae,type:b.z.enum(["single-choice","multiple-choice"]),options:b.z.array(z.QuestionOptionSchema)});z.TrueFalseQuestionSchema=b.z.object({...Ae,type:b.z.literal("true-false"),correctAnswer:b.z.boolean()});z.TextQuestionSchema=b.z.object({...Ae,type:b.z.enum(["short-answers","long-answers"]),minCharacters:b.z.number().optional(),maxCharacters:b.z.number().optional()});z.QuestionSchema=b.z.discriminatedUnion("type",[z.ChoiceQuestionSchema,z.TrueFalseQuestionSchema,z.TextQuestionSchema])});var Oe=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.PuzzleContentSchema=$.PuzzleTypeSchema=$.PuzzleGameModeSchema=void 0;var Y=B("zod"),wo=F();$.PuzzleGameModeSchema=Y.z.enum(["scattered","rotated","scattered_rotated"]);$.PuzzleTypeSchema=Y.z.enum(["swap","slide"]);$.PuzzleContentSchema=Y.z.object({image:Y.z.union([Y.z.string(),wo.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:Y.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:$.PuzzleGameModeSchema.optional(),puzzleType:$.PuzzleTypeSchema.optional(),showNumbers:Y.z.union([Y.z.boolean(),Y.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:Y.z.string().optional().describe("Deterministic seed for piece placement.")})});var Xe=g(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CanvasDragItemSchema=t.ActivityContentSchema=t.SceneSchema=t.BlockGroupSchema=t.BlockSchema=t.ArrowBlockSchema=t.ShapeBlockSchema=t.CardDeckBlockSchema=t.ClozeBlockSchema=t.MatchPairsBlockSchema=t.ChartBlockSchema=t.SpinningWheelBlockSchema=t.FlashcardBlockSchema=t.MemoryBlockSchema=t.WordSearchBlockSchema=t.WordSearchDifficultySchema=t.CrosswordBlockSchema=t.PuzzleBlockSchema=t.DiceBlockSchema=t.AnagramBlockSchema=t.DragAndDropBlockSchema=t.EmbedBlockSchema=t.MediaBlockSchema=t.EditorBlockSchema=t.HotpointBlockSchema=t.QuizBlockSchema=t.ArrowLabelSchema=t.ArrowHeadTypeSchema=t.ShapeTypeSchema=t.MatchPairsPairSchema=t.CardItemSchema=t.FlashcardItemSchema=t.FlashcardContentSchema=t.WheelSliceSchema=t.MemoryPairSchema=t.WordSearchDataSchema=t.CrosswordLayoutOutputSchema=t.CrosswordLayoutWordSchema=t.CrosswordCellSchema=t.DiceTypeSchema=t.DragAndDropGroupSchema=t.DragAndDropItemSchema=t.ActionBlockSchema=t.SceneTypeSchema=void 0;var e=B("zod"),_o=je(),T=F(),y=de(),jo=pe(),Io=ve(),Mo=Oe();t.SceneTypeSchema=e.z.enum(["2D","360\xB0"]);var me={id:e.z.string(),type:_o.BlockTypeSchema,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:T.PositionSchema.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:T.SizeSchema.optional(),minSize:T.SizeSchema.optional(),maxSize:T.SizeSchema.optional(),theme:y.BlockThemeSchema.optional()},_={...me,actions:e.z.array(Io.ActionSchema).optional(),score:e.z.number().optional()};t.ActionBlockSchema=e.z.object(_);t.DragAndDropItemSchema=e.z.object({id:e.z.string(),text:e.z.string(),background:T.MediaItemSchema.optional(),opacity:e.z.number().optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional()});t.DragAndDropGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),background:T.MediaItemSchema.optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),singleItem:e.z.boolean().optional(),opacity:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional(),items:e.z.array(t.DragAndDropItemSchema)});t.DiceTypeSchema=e.z.enum(["d4","d6","d8","d10","d12","d20"]);t.CrosswordCellSchema=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()});t.CrosswordLayoutWordSchema=e.z.object({answer:e.z.string(),clue:e.z.string(),image:T.MediaItemSchema.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()});t.CrosswordLayoutOutputSchema=e.z.object({grid:e.z.array(e.z.array(t.CrosswordCellSchema)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(t.CrosswordLayoutWordSchema)});t.WordSearchDataSchema=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()}))}))});t.MemoryPairSchema=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]),content:e.z.tuple([e.z.string(),e.z.string()])});t.WheelSliceSchema=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional(),image:T.MediaItemSchema.optional()});t.FlashcardContentSchema=e.z.object({type:e.z.enum(["text","image"]),content:e.z.any()});t.FlashcardItemSchema=e.z.object({id:e.z.string(),front:t.FlashcardContentSchema,back:t.FlashcardContentSchema});t.CardItemSchema=e.z.object({id:e.z.string(),frontImage:T.MediaItemSchema.optional(),frontText:e.z.string().optional()});t.MatchPairsPairSchema=e.z.object({id:e.z.string(),leftLabel:e.z.string(),rightLabel:e.z.string(),leftImage:e.z.any().optional(),rightImage:e.z.any().optional()});t.ShapeTypeSchema=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"]);t.ArrowHeadTypeSchema=e.z.enum(["none","arrow","circle","square"]);t.ArrowLabelSchema=e.z.object({id:e.z.string(),text:e.z.string(),t:e.z.number(),offsetX:e.z.number().optional(),offsetY:e.z.number().optional(),fontSize:e.z.number().optional(),color:e.z.string().optional(),backgroundColor:e.z.string().optional()});t.QuizBlockSchema=e.z.object({..._,type:e.z.literal("Quiz"),questions:e.z.array(jo.QuestionSchema).optional(),previewIndex:e.z.number().optional(),required:e.z.boolean().optional(),showResults:e.z.boolean().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional(),submitText:e.z.string().optional(),timer:e.z.string().optional(),showQuestionCount:e.z.boolean().optional(),theme:y.QuizBlockThemeSchema});t.HotpointBlockSchema=e.z.object({..._,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional(),element:e.z.enum(["image","button"]),theme:y.HotpointBlockThemeSchema.optional()});t.EditorBlockSchema=e.z.object({..._,type:e.z.literal("Editor"),content:e.z.any().optional(),readonly:e.z.boolean().optional(),theme:y.EditorBlockThemeSchema.optional()});t.MediaBlockSchema=e.z.object({...me,type:e.z.literal("Media"),media:T.MediaItemSchema.optional()});t.EmbedBlockSchema=e.z.object({...me,type:e.z.literal("Embed"),url:e.z.string().optional(),readOnly:e.z.boolean().optional()});t.DragAndDropBlockSchema=e.z.object({..._,type:e.z.literal("DragAndDrop"),groups:e.z.array(t.DragAndDropGroupSchema),theme:y.DragAndDropBlockThemeSchema.optional(),showResults:e.z.boolean().optional(),layout:e.z.enum(["manual","split"]).optional(),itemArrangement:e.z.enum(["random","list","grid"]).optional(),groupBackground:T.MediaItemSchema.optional(),enableWrongAnswers:e.z.boolean().optional(),itemBackground:T.MediaItemSchema.optional(),groupBackgroundOpacity:e.z.number().optional(),itemBackgroundOpacity:e.z.number().optional(),splitRatio:e.z.number().optional()});t.AnagramBlockSchema=e.z.object({..._,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()),correctWord:e.z.string(),theme:y.AnagramBlockThemeSchema.optional(),clue:e.z.string().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional()});t.DiceBlockSchema=e.z.object({..._,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional(),diceType:t.DiceTypeSchema.optional(),faceOverrides:e.z.any().optional(),color:e.z.string().optional(),showNumber:e.z.boolean().optional(),diceCount:e.z.number().optional(),dicePool:e.z.record(e.z.number()).optional(),persistent:e.z.boolean().optional(),theme:y.DiceBlockThemeSchema.optional()});t.PuzzleBlockSchema=e.z.object({..._,type:e.z.literal("Puzzle"),image:T.MediaItemSchema.optional(),pieces:e.z.number().optional(),gameMode:Mo.PuzzleGameModeSchema.optional(),puzzleType:e.z.enum(["swap","slide"]).optional(),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional(),seed:e.z.string().optional()});t.CrosswordBlockSchema=e.z.object({..._,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string(),clue:e.z.string(),image:T.MediaItemSchema.optional()})).optional(),layout:t.CrosswordLayoutOutputSchema.optional(),theme:y.CrosswordBlockThemeSchema.optional()});t.WordSearchDifficultySchema=e.z.enum(["easy","medium","hard"]);t.WordSearchBlockSchema=e.z.object({..._,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional(),gridSize:T.GridSizeSchema.optional(),difficulty:t.WordSearchDifficultySchema.optional(),data:t.WordSearchDataSchema.optional(),theme:y.WordSearchBlockThemeSchema.optional()});t.MemoryBlockSchema=e.z.object({..._,type:e.z.literal("Memory"),pairs:e.z.array(t.MemoryPairSchema),gridSize:T.GridSizeSchema.optional(),hideScore:e.z.boolean().optional(),theme:y.MemoryBlockThemeSchema.optional()});t.FlashcardBlockSchema=e.z.object({..._,type:e.z.literal("Flashcard"),cards:e.z.array(t.FlashcardItemSchema),theme:y.FlashcardBlockThemeSchema.optional()});t.SpinningWheelBlockSchema=e.z.object({..._,type:e.z.literal("SpinningWheel"),slices:e.z.array(t.WheelSliceSchema),spinDuration:e.z.number().optional(),theme:y.SpinningWheelBlockThemeSchema.optional()});t.ChartBlockSchema=e.z.object({..._,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.z.array(e.z.any()),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional(),xAxisLabel:e.z.string().optional(),yAxisLabel:e.z.string().optional(),showLegend:e.z.boolean().optional(),showTooltip:e.z.boolean().optional(),stacked:e.z.boolean().optional(),seriesNames:e.z.record(e.z.string()).optional()})});t.MatchPairsBlockSchema=e.z.object({..._,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional(),pairs:e.z.array(t.MatchPairsPairSchema),theme:y.MatchPairsBlockThemeSchema.optional()});t.ClozeBlockSchema=e.z.object({..._,type:e.z.literal("Cloze"),templateText:e.z.string().optional(),theme:y.ClozeBlockThemeSchema.optional(),mode:e.z.enum(["write","drag-drop"]).optional()});t.CardDeckBlockSchema=e.z.object({..._,type:e.z.literal("CardDeck"),cards:e.z.array(t.CardItemSchema),backImage:T.MediaItemSchema.optional(),discardLogic:e.z.enum(["delete","return"]),theme:y.CardDeckBlockThemeSchema.optional()});t.ShapeBlockSchema=e.z.object({...me,type:e.z.literal("Shape"),shapeType:t.ShapeTypeSchema.optional(),text:e.z.string().optional(),theme:y.ShapeBlockThemeSchema.optional()});t.ArrowBlockSchema=e.z.object({...me,type:e.z.literal("Arrow"),startBlockId:e.z.string(),endBlockId:e.z.string().optional(),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional(),startHandle:e.z.enum(["top","right","bottom","left"]),endHandle:e.z.enum(["top","right","bottom","left"]).optional(),connectionType:e.z.enum(["straight","orthogonal","curved"]),strokeColor:e.z.string().optional(),strokeWidth:e.z.number().optional(),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional(),showHead:e.z.boolean().optional(),startHead:t.ArrowHeadTypeSchema.optional(),endHead:t.ArrowHeadTypeSchema.optional(),bendOffsetX:e.z.number().optional(),bendOffsetY:e.z.number().optional(),segmentCount:e.z.number().optional(),bendOffsets:e.z.array(e.z.number()).optional(),labels:e.z.array(t.ArrowLabelSchema).optional()});t.BlockSchema=e.z.discriminatedUnion("type",[t.QuizBlockSchema,t.HotpointBlockSchema,t.EditorBlockSchema,t.EmbedBlockSchema,t.MediaBlockSchema,t.DragAndDropBlockSchema,t.AnagramBlockSchema,t.DiceBlockSchema,t.PuzzleBlockSchema,t.CrosswordBlockSchema,t.WordSearchBlockSchema,t.MemoryBlockSchema,t.FlashcardBlockSchema,t.SpinningWheelBlockSchema,t.ChartBlockSchema,t.MatchPairsBlockSchema,t.ShapeBlockSchema,t.ArrowBlockSchema,t.ClozeBlockSchema,t.CardDeckBlockSchema]);t.BlockGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()});t.SceneSchema=e.z.object({id:e.z.string(),title:e.z.string(),type:t.SceneTypeSchema,background:e.z.union([e.z.string(),e.z.array(e.z.string()),T.MediaItemSchema]).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(t.BlockSchema),groups:e.z.array(t.BlockGroupSchema).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()});t.ActivityContentSchema=e.z.object({id:e.z.string(),title:e.z.string(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(t.SceneSchema),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:T.MediaItemSchema.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()});t.CanvasDragItemSchema=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:t.BlockSchema})});var Ze=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ActivityContextSchema=V.SceneSummarySchema=V.SceneBlockRefSchema=void 0;var v=B("zod");V.SceneBlockRefSchema=v.z.object({id:v.z.string(),type:v.z.string(),title:v.z.string()});V.SceneSummarySchema=v.z.object({id:v.z.string(),title:v.z.string(),position:v.z.number(),blocks:v.z.array(V.SceneBlockRefSchema).default([])});V.ActivityContextSchema=v.z.object({activity:v.z.object({id:v.z.string(),title:v.z.string(),scenes:v.z.array(V.SceneSummarySchema).default([])}),activeSceneId:v.z.string().nullable().optional()})});var oo=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.QuizContentSchema=D.QuizQuestionSchema=D.QuizOptionSchema=D.QuizQuestionTypeSchema=void 0;var f=B("zod"),eo=F(),ue=pe();D.QuizQuestionTypeSchema=f.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);D.QuizOptionSchema=f.z.object({id:f.z.string().optional(),text:f.z.string(),isCorrect:f.z.boolean(),image:eo.MediaItemSchema.optional().describe("Option image."),imageAlign:ue.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:ue.ImageSizeSchema.optional().describe("Option image size.")});D.QuizQuestionSchema=f.z.object({id:f.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:D.QuizQuestionTypeSchema,text:f.z.string().describe("The question text."),score:f.z.number().optional(),options:f.z.array(D.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:f.z.boolean().optional().describe("Required for true-false."),image:eo.MediaItemSchema.optional().describe("Question image."),imageAlign:ue.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:ue.ImageSizeSchema.optional().describe("Question image size.")});D.QuizContentSchema=f.z.object({questions:f.z.array(D.QuizQuestionSchema).describe("Array of question objects."),showResults:f.z.boolean().optional(),allowRetry:f.z.boolean().optional(),maxRetry:f.z.string().optional(),required:f.z.boolean().optional(),submitText:f.z.string().optional().describe("Label for submit button."),timer:f.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:f.z.boolean().optional().describe("Show current/total questions count.")})});var to=g(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.ClozeContentSchema=ne.ClozeModeSchema=void 0;var Pe=B("zod");ne.ClozeModeSchema=Pe.z.enum(["write","drag-drop"]);ne.ClozeContentSchema=Pe.z.object({templateText:Pe.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:ne.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var ao=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.AnagramContentSchema=q.WordSearchContentSchema=q.CrosswordContentSchema=q.CrosswordWordSchema=q.WordGameBlockTypeSchema=void 0;var A=B("zod"),no=F();q.WordGameBlockTypeSchema=A.z.enum(["Crossword","WordSearch","Anagram"]);q.CrosswordWordSchema=A.z.object({answer:A.z.string(),clue:A.z.string(),image:no.MediaItemSchema.optional().describe("Clue image.")});q.CrosswordContentSchema=A.z.object({words:A.z.array(q.CrosswordWordSchema)});q.WordSearchContentSchema=A.z.object({words:A.z.array(A.z.string()),gridSize:no.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:A.z.enum(["easy","medium","hard"]).optional()});q.AnagramContentSchema=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 io=g(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.PairGameContentSchema=R.PairSchema=R.MemoryPairTypeSchema=R.PairGameBlockTypeSchema=void 0;var G=B("zod"),De=F();R.PairGameBlockTypeSchema=G.z.enum(["Memory","MatchPairs"]);R.MemoryPairTypeSchema=G.z.enum(["img-img","img-word","word-word"]);R.PairSchema=G.z.object({id:G.z.string().optional(),type:R.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:G.z.array(G.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:G.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:G.z.string().optional().describe("For MatchPairs: right side text."),leftImage:De.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:De.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});R.PairGameContentSchema=G.z.object({pairs:G.z.array(R.PairSchema).describe("Array of pair objects."),gridSize:De.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:G.z.string().optional().describe("For MatchPairs: instruction text.")})});var ro=g(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.DeckContentSchema=E.CardSchema=E.CardFaceSchema=E.DeckBlockTypeSchema=void 0;var Q=B("zod");E.DeckBlockTypeSchema=Q.z.enum(["Flashcard","CardDeck"]);E.CardFaceSchema=Q.z.object({type:Q.z.enum(["text","image"]),content:Q.z.any()});E.CardSchema=Q.z.object({id:Q.z.string().optional(),front:E.CardFaceSchema.optional().describe("For Flashcard: front side."),back:E.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:Q.z.string().optional().describe("For CardDeck: front text."),frontImage:Q.z.any().optional().describe("For CardDeck: front image.")});E.DeckContentSchema=Q.z.object({cards:Q.z.array(E.CardSchema).describe("Array of card objects."),backImage:Q.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:Q.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var co=g(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.DiceContentSchema=ae.DieTypeSchema=void 0;var le=B("zod");ae.DieTypeSchema=le.z.enum(["d4","d6","d8","d10","d12","d20"]);ae.DiceContentSchema=le.z.object({diceType:ae.DieTypeSchema.optional(),diceCount:le.z.number().int().min(1).max(10).optional(),color:le.z.string().optional().describe("CSS color for dice."),showNumber:le.z.boolean().optional(),persistent:le.z.boolean().optional().describe("Keep dice visible after roll.")})});var lo=g(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SpinnerContentSchema=re.SpinnerSliceSchema=void 0;var ie=B("zod"),vo=F();re.SpinnerSliceSchema=ie.z.object({id:ie.z.string().optional(),text:ie.z.string(),color:ie.z.string().optional().describe("CSS color for slice."),image:vo.MediaItemSchema.optional().describe("Slice image.")});re.SpinnerContentSchema=ie.z.object({slices:ie.z.array(re.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:ie.z.number().optional().describe("Spin duration in seconds.")})});var so=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.DragAndDropContentSchema=U.DragGroupSchema=U.DragItemSchema=void 0;var p=B("zod"),he=F(),ze=de();U.DragItemSchema=p.z.object({id:p.z.string().optional(),text:p.z.string(),background:he.MediaItemSchema.optional().describe("Background image/color for item."),opacity:p.z.number().optional().describe("Opacity of the item (0-1)."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),styles:ze.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:ze.TextStylesSchema.optional().describe("Text custom styling styles.")});U.DragGroupSchema=p.z.object({id:p.z.string().optional(),name:p.z.string().describe("Group/dropzone name."),singleItem:p.z.boolean().optional().describe("Accept only one item inside."),background:he.MediaItemSchema.optional().describe("Background image/color for group."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),opacity:p.z.number().optional().describe("Opacity of the group (0-1)."),styles:ze.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:ze.TextStylesSchema.optional().describe("Text custom styling styles."),items:p.z.array(U.DragItemSchema).describe("Items that belong in this group.")});U.DragAndDropContentSchema=p.z.object({groups:p.z.array(U.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:p.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:p.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:p.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:p.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:p.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:he.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:he.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:p.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:p.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:p.z.number().optional().describe("Proportion ratio for split layout.")})});var mo=g(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.ChartContentSchema=J.ChartConfigSchema=J.ChartTypeSchema=void 0;var O=B("zod");J.ChartTypeSchema=O.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);J.ChartConfigSchema=O.z.object({colors:O.z.array(O.z.string()).optional(),xAxisLabel:O.z.string().optional(),yAxisLabel:O.z.string().optional(),showLegend:O.z.boolean().optional(),showTooltip:O.z.boolean().optional(),stacked:O.z.boolean().optional(),seriesNames:O.z.record(O.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});J.ChartContentSchema=O.z.object({chartType:J.ChartTypeSchema.optional(),chartData:O.z.array(O.z.record(O.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:J.ChartConfigSchema.optional()})});var po=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.BasicContentSchema=void 0;var Se=B("zod"),Ao=F();be.BasicContentSchema=Se.z.object({content:Se.z.any().optional().describe("For Editor: Plate JSON content array."),url:Se.z.string().optional().describe("For Media or Embed: content URL."),text:Se.z.string().optional().describe("For Shape: text inside shape."),mediaType:Ao.MediaTypeSchema.optional().describe("For Media: media type.")})});var qe=g(j=>{"use strict";var Oo=j&&j.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),K=j&&j.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Oo(i,a,n)};Object.defineProperty(j,"__esModule",{value:!0});K(oo(),j);K(to(),j);K(ao(),j);K(io(),j);K(ro(),j);K(co(),j);K(lo(),j);K(so(),j);K(mo(),j);K(Oe(),j);K(po(),j)});var uo=g(W=>{"use strict";var Po=W&&W.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),Do=W&&W.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),qo=W&&W.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(n){var c=[];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c[c.length]=l);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var n={};if(i!=null)for(var c=a(i),l=0;l<c.length;l++)c[l]!=="default"&&Po(n,i,c[l]);return Do(n,i),n}})();Object.defineProperty(W,"__esModule",{value:!0});W.BLOCK_CONTENT_SCHEMAS=void 0;W.generateBlockReference=Ro;var Eo=qo(B("zod-to-json-schema")),Lo=Eo.zodToJsonSchema,x=qe();W.BLOCK_CONTENT_SCHEMAS={Quiz:x.QuizContentSchema,Cloze:x.ClozeContentSchema,Crossword:x.CrosswordContentSchema,WordSearch:x.WordSearchContentSchema,Anagram:x.AnagramContentSchema,Memory:x.PairGameContentSchema,MatchPairs:x.PairGameContentSchema,Flashcard:x.DeckContentSchema,CardDeck:x.DeckContentSchema,Dice:x.DiceContentSchema,SpinningWheel:x.SpinnerContentSchema,DragAndDrop:x.DragAndDropContentSchema,Chart:x.ChartContentSchema,Puzzle:x.PuzzleContentSchema,Editor:x.BasicContentSchema,Media:x.BasicContentSchema,Embed:x.BasicContentSchema,Shape:x.BasicContentSchema};function Fo(a,i,n,c){let l=n?"*required*":"optional",h=Ee(i),u=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${a}\` (${h}, ${l})${u}`}function Ee(a){return a.enum?`enum: ${a.enum.map(i=>JSON.stringify(i)).join(" | ")}`:a.anyOf||a.oneOf?(a.anyOf||a.oneOf).map(Ee).join(" | "):Array.isArray(a.type)?a.type.join(" | "):a.type==="array"&&a.items?`array<${Ee(a.items)}>`:a.type==="object"?"object":a.type??"any"}function Le(a,i){let n=[],c=new Set(a.required??[]),l=a.properties??{};for(let[h,u]of Object.entries(l))n.push(Fo(h,u,c.has(h),i)),u.type==="object"&&u.properties?n.push(Le(u,i+" ")):u.type==="array"&&u.items?.type==="object"&&n.push(Le(u.items,i+" "));return n.join(`
5
- `)}function Ro(){let a=[],i=new Map;for(let[n,c]of Object.entries(W.BLOCK_CONTENT_SCHEMAS)){let l=i.get(c)??[];l.push(n),i.set(c,l)}for(let[n,c]of i.entries()){let l=c.join(" / "),h=Lo(n,{target:"jsonSchema7"}),u=Le(h,"");a.push(`### ${l}
6
- ${u||"_(no configurable fields)_"}`)}return a.join(`
1
+ var V={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"]},Ot=Object.keys(V);function nt(t){return Object.prototype.hasOwnProperty.call(V,t)}function vt(t,r){if(!nt(t))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${t}"`]};if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=r,a=V[t].filter(i=>n[i]===void 0||n[i]===null);return a.length>0?{ok:!1,code:"MISSING_FIELDS",errors:a.map(i=>`missing field: ${i}`)}:t==="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 Et(t,r,n){let a=Array.isArray(t)?[...t]:[];if(r==="insertItem"){if(n.item===void 0||n.item===null)return a;let i=typeof n.at=="number"?n.at:a.length;return a.splice(Math.max(0,Math.min(i,a.length)),0,n.item),a}return r==="updateItem"?a.map(i=>i&&typeof i=="object"&&i.id===n.itemId?{...i,...n.item??{}}:i):a.filter(i=>!(i&&typeof i=="object"&&i.id===n.itemId))}var rt=new Set(["position","size","rotation","zIndex","z"]);function G(t){return t===null||typeof t!="object"?JSON.stringify(t)??"null":Array.isArray(t)?"["+t.map(G).join(",")+"]":"{"+Object.keys(t).sort().map(n=>JSON.stringify(n)+":"+G(t[n])).join(",")+"}"}function at(t,r){let n=r??{};switch(t){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 it(t,r){if(Array.isArray(t))for(let n of t){let a=n?.blocks?.find?.(i=>i&&i.id===r);if(a)return a}}function ct(t,r){if(r.kind==="untracked")return null;let n=r.blockId?it(t,r.blockId):void 0;if(!n)return null;if(r.kind==="block"){let h={};for(let d of Object.keys(n))rt.has(d)||(h[d]=n[d]);return G(h)}let a=n[r.collection];if(!Array.isArray(a))return null;let i=a.find(h=>h&&h.id===r.itemId);return i?G(i):null}function Lt(t,r){return t==null?"apply":r==null?"missing":t===r?"apply":"stale"}function _t(t,r,n){let a=at(t,r);return{target:a,baseSignature:ct(n,a)}}var $=/@\[([^\]|]+)\|([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 Ft(t){let r=[];for(let n of(t??"").matchAll($))r.push({name:n[1].trim(),id:n[2]});return r}function Wt(t,r){let n=new Map,a=new Map;for(let S of r?.scenes??[]){S?.id&&n.set(S.id,S);for(let f of S?.blocks??[])f?.id&&a.set(f.id,{block:f,sceneId:S.id})}let i=[],h=new Set,d=S=>a.has(S)?"il blocco selezionato":n.has(S)?"la scena selezionata":"l'elemento selezionato",D=(S,f)=>{if(!h.has(f))if(a.has(f)){let{block:P,sceneId:tt}=a.get(f);i.push({id:f,name:S,kind:"block",blockType:P?.type,sceneId:tt}),h.add(f)}else n.has(f)&&(i.push({id:f,name:S,kind:"scene"}),h.add(f))},w=(t??"").replace($,(S,f,P)=>(D(f.trim(),P),f.trim())),B=(t??"").replace($,(S,f,P)=>a.has(P)||n.has(P)?d(P):f.trim());return{cleanedText:w,agentText:B,entities:i}}import{zodToJsonSchema as Dt}from"zod-to-json-schema";import{z as lt}from"zod";var Le=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Y=lt.enum(Le);import{z as p}from"zod";var U=p.object({x:p.number(),y:p.number(),z:p.number().optional()}),R=p.object({width:p.number().optional(),height:p.number().optional()}),M=p.object({rows:p.number(),cols:p.number()}),v=p.enum(["image","color","gif","shape","illustration","video","audio"]),_e=p.enum(["unsplash","pexels","upload","url","library","tenor"]),Re=p.object({x:p.number(),y:p.number(),width:p.number(),height:p.number(),zoom:p.number().optional(),rotation:p.number().optional(),aspect:p.number().optional()}),Fe=p.object({autoplay:p.boolean().optional(),loop:p.boolean().optional(),muted:p.boolean().optional(),controls:p.boolean().optional(),poster:p.string().optional(),volume:p.number().optional()}),c=p.object({id:p.string().optional(),url:p.string().optional(),title:p.string().optional(),type:v,source:_e.optional(),alt:p.string().optional(),width:p.number().optional(),height:p.number().optional(),format:p.enum(["cover","contain"]).optional(),color:p.string().optional(),cropData:Re.optional(),duration:p.number().optional(),videoSettings:Fe.optional()}),pt=c;import{z as o}from"zod";var We=o.object({type:o.union([o.enum(["none","fade","direction","bounce","scale","rotate"]),o.string()]),duration:o.number().optional(),delay:o.number().optional(),phase:o.enum(["in","both","out"]).optional(),direction:o.enum(["up","right","down","left"]).optional()}),Z=o.object({top:o.union([o.string(),o.number()]).optional(),right:o.union([o.string(),o.number()]).optional(),bottom:o.union([o.string(),o.number()]).optional(),left:o.union([o.string(),o.number()]).optional()}),Ge=o.object({topLeft:o.union([o.string(),o.number()]).optional(),topRight:o.union([o.string(),o.number()]).optional(),bottomRight:o.union([o.string(),o.number()]).optional(),bottomLeft:o.union([o.string(),o.number()]).optional()}),s=o.object({background:o.boolean().optional(),backgroundColor:o.string().optional(),backgroundOpacity:o.number().optional(),backgroundMedia:c.optional(),border:o.boolean().optional(),borderColor:o.string().optional(),borderWidth:Z.optional(),borderRadius:Ge.optional(),padding:o.union([o.string(),o.number(),Z]).optional()}),u=o.object({color:o.string().optional(),fontSize:o.number().optional(),fontFamily:o.string().optional(),fontStyle:o.string().optional(),fontWeight:o.union([o.string(),o.number()]).optional(),textAlign:o.enum(["left","center","right","justify"]).optional()}),j=s.merge(u),b=o.object({spacing:o.enum(["no-spacing","small","medium","large"]).optional(),animation:We.optional(),styles:o.record(o.record(o.any())).optional()}),X=b.extend({styles:o.object({hotpoint:o.object({icon:o.string().optional(),iconPosition:o.enum(["left","right"]).optional(),iconSize:o.string().optional(),iconColor:o.string().optional(),image:c.optional(),imageFormat:o.enum(["circle","square","custom"]).optional(),border:o.boolean().optional(),borderColor:o.string().optional(),borderWidth:o.string().optional(),borderRadius:o.string().optional(),glow:o.boolean().optional(),glowColor:o.string().optional(),background:o.boolean().optional(),backgroundColor:o.string().optional(),fontSize:o.number().optional(),fontFamily:o.string().optional(),fontStyle:o.string().optional(),textColor:o.string().optional()}).optional()}).optional()}),ee=b.extend({layout:o.enum(["horizontal","vertical","grid"]),gridColumns:o.number().optional(),preset:o.enum(["default","modern","trivia","custom"]),styles:o.object({general:j,question:j,answers:j.extend({customStyles:o.array(o.object({color:o.string().optional(),backgroundColor:o.string().optional(),targets:o.string().optional()})).optional(),hover:j.optional()}),button:j.extend({variant:o.enum(["default","outline","ghost"]).optional(),hover:j.optional()})}).optional()}),oe=b.extend({layoutPosition:o.enum(["left","right","top","bottom"]).optional(),splitRatio:o.number().optional(),gridColumns:o.number().optional(),gridGap:o.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.object({x:o.number().optional(),y:o.number().optional(),width:o.number().optional(),height:o.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.object({title:u.optional(),sandbox:s.optional(),item:j.optional(),group:s.optional(),container:s.extend({url:o.string().optional(),type:v.optional()}).optional(),groups:j.optional(),feedback:o.object({correct:o.string().optional(),incorrect:o.string().optional(),active:o.string().optional()}).optional(),referenceSize:o.object({width:o.number(),height:o.number()}).optional()}).optional()}),te=b.extend({styles:o.object({editor:s.optional()}).optional()}),ne=b.extend({styles:o.object({letter:s.optional(),letterText:u.optional(),slot:s.optional(),container:s.optional()}).optional()}),re=b.extend({styles:o.object({button:s.extend({hover:j.optional()}).optional(),buttonText:u.optional(),container:s.optional()}).optional()}),ae=b.extend({primaryColor:o.string().optional(),layoutPosition:o.enum(["left","right","top","bottom"]).optional(),splitRatio:o.number().optional(),styles:o.object({text:u.optional(),cell:s.optional(),grid:s.optional(),clueContainer:s.optional(),clueText:u.optional(),clueTitle:u.optional()}).optional()}),ie=b.extend({layoutPosition:o.enum(["left","right","top","bottom"]).optional(),splitRatio:o.number().optional(),styles:o.object({wordSearch:o.object({primaryColor:o.string().optional(),highlightColor:o.string().optional(),fontSize:o.number().optional(),fontFamily:o.string().optional(),textColor:o.string().optional(),cellBackgroundColor:o.string().optional()}).optional(),text:u.optional(),cell:s.optional(),grid:s.optional(),wordListContainer:s.optional(),wordListText:u.optional(),wordListTitle:u.optional()}).optional()}),ce=b.extend({styles:o.object({text:u.optional(),container:s.optional(),infoContainer:s.optional(),infoText:u.optional(),card:s.optional()}).optional()}),le=b.extend({styles:o.object({wheelText:u.optional()}).optional()}),pe=b.extend({layoutPosition:o.enum(["left","right","top","bottom"]).optional(),styles:o.object({text:u.optional(),container:s.optional(),wordBank:s.optional(),word:s.optional(),blank:s.optional()}).optional()}),se=b.extend({styles:o.object({card:s.optional(),cardText:u.optional(),container:s.optional()}).optional()}),me=b.extend({styles:o.object({cardFront:s.optional(),cardBack:s.optional(),frontText:u.optional(),backText:u.optional(),navigation:s.optional(),navigationText:u.optional()}).optional()}),de=b.extend({layoutPosition:o.enum(["left","right","top","bottom"]).optional(),styles:o.object({text:u.optional(),card:s.optional(),container:s.optional()}).optional()}),he=b.extend({styles:o.object({shape:j.extend({fillColor:o.string().optional(),textColor:o.string().optional(),borderStyle:o.enum(["solid","dashed","dotted"]).optional(),padding:o.number().optional()}).optional()}).optional()});var N={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 st(t){let r=N[t.toLowerCase()];if(!r)return[];let n=new Set;for(let a of Object.values(r))for(let i of a??[])n.add(i);return[...n]}var Ne={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"]},qe=new Set(["chart","media","image","puzzle"]);function mt(t){if(!t)return"";let r=t.toLowerCase();if(qe.has(r))return`
2
+ [STYLE TARGETS] Il blocco "${t}" 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=Ne[r];if(!n||n.length===0)return"";let a=N[r]??{},i=["general","title","answers","button"].filter(h=>a[h]).map(h=>`${h}\u2192${a[h].join("/")}`).join(", ");return`
3
+ [STYLE TARGETS for ${t}] Logical targets (update_block_theme): ${i}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function ue(t,r){if(!t)return t;let n={...t};for(let[D,w]of Object.entries(n))if(w&&typeof w=="object"){let B={...w},S=!1;B.backgroundColor!==void 0&&B.background===void 0&&(B.background=!0,S=!0),B.borderColor!==void 0&&B.border===void 0&&(B.border=!0,S=!0),S&&(n[D]=B)}if(!r)return n;let a=N[r.toLowerCase()];if(!a)return n;let i=(D,w)=>{w&&(n[D]={...n[D]||{},...w})},h=["title","answers","button","general"],d={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let D of h){let w=d[D],B=a[D];if(w&&B)for(let S of B)i(S,w)}return n}function dt(t,r,n){if(!t){let d={...r};return d.styles&&(d.styles=ue(d.styles,n)),d}if(!r)return t;let a={...t,...r},i=ue(r.styles,n),h=t.styles||{};if(t.styles||i){a.styles={...h,...i};for(let d of Object.keys(a.styles))h[d]&&i?.[d]&&(a.styles[d]={...h[d],...i[d]})}return a}import{z as l}from"zod";var ge=l.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),He=l.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),ht=l.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),ut=l.enum(["completed","half_way"]),yt=l.enum(["single_click","double_click"]),gt=l.literal("key_pressed"),ye=l.object({event:ge.optional(),variableName:l.string().optional(),operator:He.optional(),value:l.any()}),Ke=l.enum(["set","add","subtract","multiply","divide"]),Je=l.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),Ve=l.object({name:l.string(),value:l.union([l.number(),l.string(),l.boolean()]),operation:Ke.optional()}),Se=l.object({id:l.string(),type:Je,condition:ye.optional(),conditions:l.array(ye).optional(),conditionsOperator:l.enum(["and","or"]).optional(),modalContent:l.string().optional(),audioUrl:l.string().optional(),linkUrl:l.string().optional(),targetSceneId:l.string().optional(),targetBlockId:l.string().optional(),direction:l.enum(["up","down","left","right"]).optional(),distance:l.number().optional(),variable:Ve.optional()}),St=l.object({name:l.string(),defaultValue:l.union([l.string(),l.number(),l.boolean()])}),bt=l.object({type:ge,blockId:l.string(),data:l.record(l.any()).optional()});import{z as y}from"zod";var ft=y.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),E=y.enum(["left","right","center"]),Q=y.object({width:y.number().optional(),height:y.number().optional()}),$e=y.object({id:y.string(),text:y.string(),isCorrect:y.boolean(),image:c.optional(),imageAlign:E.optional(),imageSize:Q.optional()}),be={id:y.string(),text:y.string(),score:y.number().optional(),image:c.optional(),imageAlign:E.optional(),imageSize:Q.optional()},Ye=y.object({...be,type:y.enum(["single-choice","multiple-choice"]),options:y.array($e)}),Ue=y.object({...be,type:y.literal("true-false"),correctAnswer:y.boolean()}),Ze=y.object({...be,type:y.enum(["short-answers","long-answers"]),minCharacters:y.number().optional(),maxCharacters:y.number().optional()}),fe=y.discriminatedUnion("type",[Ye,Ue,Ze]);import{z as e}from"zod";import{z as I}from"zod";var q=I.enum(["scattered","rotated","scattered_rotated"]),Xe=I.enum(["swap","slide"]),xe=I.object({image:I.union([I.string(),c]).optional().describe("Image URL or MediaItem for puzzle."),pieces:I.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:q.optional(),puzzleType:Xe.optional(),showNumbers:I.union([I.boolean(),I.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:I.string().optional().describe("Deterministic seed for piece placement.")});var eo=e.enum(["2D","360\xB0"]),F={id:e.string(),type:Y,title:e.string(),showTitle:e.boolean().optional(),locked:e.boolean().optional(),groupId:e.string().optional(),position:U.optional(),rotation:e.number(),hidden:e.boolean().optional(),draggable:e.boolean().optional(),size:R.optional(),minSize:R.optional(),maxSize:R.optional(),theme:b.optional()},x={...F,actions:e.array(Se).optional(),score:e.number().optional()},xt=e.object(x),oo=e.object({id:e.string(),text:e.string(),background:c.optional(),opacity:e.number().optional(),x:e.number().optional(),y:e.number().optional(),width:e.number().optional(),height:e.number().optional(),styles:s.optional(),textStyles:u.optional()}),to=e.object({id:e.string(),name:e.string(),background:c.optional(),x:e.number().optional(),y:e.number().optional(),width:e.number().optional(),height:e.number().optional(),singleItem:e.boolean().optional(),opacity:e.number().optional(),styles:s.optional(),textStyles:u.optional(),items:e.array(oo)}),no=e.enum(["d4","d6","d8","d10","d12","d20"]),ro=e.object({char:e.string(),isBlack:e.boolean(),number:e.number().optional(),row:e.number(),col:e.number()}),ao=e.object({answer:e.string(),clue:e.string(),image:c.optional(),startx:e.number(),starty:e.number(),orientation:e.enum(["across","down","none"]),position:e.number()}),io=e.object({grid:e.array(e.array(ro)),rows:e.number(),cols:e.number(),words:e.array(ao)}),co=e.object({grid:e.array(e.array(e.string())),placedWords:e.array(e.object({word:e.string(),clean:e.string(),path:e.array(e.object({x:e.number(),y:e.number()}))}))}),lo=e.object({id:e.string(),type:e.enum(["img-img","img-word","word-word"]),content:e.tuple([e.string(),e.string()])}),po=e.object({id:e.string(),text:e.string(),color:e.string().optional(),image:c.optional()}),ke=e.object({type:e.enum(["text","image"]),content:e.any()}),so=e.object({id:e.string(),front:ke,back:ke}),mo=e.object({id:e.string(),frontImage:c.optional(),frontText:e.string().optional()}),ho=e.object({id:e.string(),leftLabel:e.string(),rightLabel:e.string(),leftImage:e.any().optional(),rightImage:e.any().optional()}),uo=e.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"]),ze=e.enum(["none","arrow","circle","square"]),yo=e.object({id:e.string(),text:e.string(),t:e.number(),offsetX:e.number().optional(),offsetY:e.number().optional(),fontSize:e.number().optional(),color:e.string().optional(),backgroundColor:e.string().optional()}),go=e.object({...x,type:e.literal("Quiz"),questions:e.array(fe).optional(),previewIndex:e.number().optional(),required:e.boolean().optional(),showResults:e.boolean().optional(),allowRetry:e.boolean().optional(),maxRetry:e.string().optional(),submitText:e.string().optional(),timer:e.string().optional(),showQuestionCount:e.boolean().optional(),theme:ee}),So=e.object({...x,type:e.literal("Hotpoint"),showIcon:e.boolean().optional(),element:e.enum(["image","button"]),theme:X.optional()}),bo=e.object({...x,type:e.literal("Editor"),content:e.any().optional(),readonly:e.boolean().optional(),theme:te.optional()}),fo=e.object({...F,type:e.literal("Media"),media:c.optional()}),xo=e.object({...F,type:e.literal("Embed"),url:e.string().optional(),readOnly:e.boolean().optional()}),ko=e.object({...x,type:e.literal("DragAndDrop"),groups:e.array(to),theme:oe.optional(),showResults:e.boolean().optional(),layout:e.enum(["manual","split"]).optional(),itemArrangement:e.enum(["random","list","grid"]).optional(),groupBackground:c.optional(),enableWrongAnswers:e.boolean().optional(),itemBackground:c.optional(),groupBackgroundOpacity:e.number().optional(),itemBackgroundOpacity:e.number().optional(),splitRatio:e.number().optional()}),zo=e.object({...x,type:e.literal("Anagram"),letters:e.array(e.string()),correctWord:e.string(),theme:ne.optional(),clue:e.string().optional(),allowRetry:e.boolean().optional(),maxRetry:e.string().optional()}),Co=e.object({...x,type:e.literal("Dice"),rollHistory:e.array(e.number()).optional(),diceType:no.optional(),faceOverrides:e.any().optional(),color:e.string().optional(),showNumber:e.boolean().optional(),diceCount:e.number().optional(),dicePool:e.record(e.number()).optional(),persistent:e.boolean().optional(),theme:re.optional()}),Bo=e.object({...x,type:e.literal("Puzzle"),image:c.optional(),pieces:e.number().optional(),gameMode:q.optional(),puzzleType:e.enum(["swap","slide"]).optional(),showNumbers:e.union([e.boolean(),e.string()]).optional(),seed:e.string().optional()}),To=e.object({...x,type:e.literal("Crossword"),words:e.array(e.object({answer:e.string(),clue:e.string(),image:c.optional()})).optional(),layout:io.optional(),theme:ae.optional()}),wo=e.enum(["easy","medium","hard"]),Ao=e.object({...x,type:e.literal("WordSearch"),words:e.array(e.string()).optional(),gridSize:M.optional(),difficulty:wo.optional(),data:co.optional(),theme:ie.optional()}),jo=e.object({...x,type:e.literal("Memory"),pairs:e.array(lo),gridSize:M.optional(),hideScore:e.boolean().optional(),theme:ce.optional()}),Io=e.object({...x,type:e.literal("Flashcard"),cards:e.array(so),theme:me.optional()}),Do=e.object({...x,type:e.literal("SpinningWheel"),slices:e.array(po),spinDuration:e.number().optional(),theme:le.optional()}),Mo=e.object({...x,type:e.literal("Chart"),chartType:e.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.array(e.any()),chartConfig:e.object({colors:e.array(e.string()).optional(),xAxisLabel:e.string().optional(),yAxisLabel:e.string().optional(),showLegend:e.boolean().optional(),showTooltip:e.boolean().optional(),stacked:e.boolean().optional(),seriesNames:e.record(e.string()).optional()})}),Po=e.object({...x,type:e.literal("MatchPairs"),instructions:e.string().optional(),pairs:e.array(ho),theme:de.optional()}),Oo=e.object({...x,type:e.literal("Cloze"),templateText:e.string().optional(),theme:pe.optional(),mode:e.enum(["write","drag-drop"]).optional()}),vo=e.object({...x,type:e.literal("CardDeck"),cards:e.array(mo),backImage:c.optional(),discardLogic:e.enum(["delete","return"]),theme:se.optional()}),Eo=e.object({...F,type:e.literal("Shape"),shapeType:uo.optional(),text:e.string().optional(),theme:he.optional()}),Qo=e.object({...F,type:e.literal("Arrow"),startBlockId:e.string(),endBlockId:e.string().optional(),endPos:e.object({x:e.number(),y:e.number()}).optional(),startHandle:e.enum(["top","right","bottom","left"]),endHandle:e.enum(["top","right","bottom","left"]).optional(),connectionType:e.enum(["straight","orthogonal","curved"]),strokeColor:e.string().optional(),strokeWidth:e.number().optional(),strokeStyle:e.enum(["solid","dashed","dotted"]).optional(),showHead:e.boolean().optional(),startHead:ze.optional(),endHead:ze.optional(),bendOffsetX:e.number().optional(),bendOffsetY:e.number().optional(),segmentCount:e.number().optional(),bendOffsets:e.array(e.number()).optional(),labels:e.array(yo).optional()}),Ce=e.discriminatedUnion("type",[go,So,bo,xo,fo,ko,zo,Co,Bo,To,Ao,jo,Io,Do,Mo,Po,Eo,Qo,Oo,vo]),Lo=e.object({id:e.string(),name:e.string(),locked:e.boolean().optional()}),_o=e.object({id:e.string(),title:e.string(),type:eo,background:e.union([e.string(),e.array(e.string()),c]).optional(),backgroundColor:e.string().optional(),backgroundAutoplay:e.boolean().optional(),backgroundLoop:e.boolean().optional(),secretCode:e.string().optional(),hidden:e.boolean().optional(),blocks:e.array(Ce),groups:e.array(Lo).optional(),canvas:e.object({width:e.number().optional(),height:e.number().optional(),preset:e.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),kt=e.object({id:e.string(),title:e.string(),hasTimer:e.boolean(),timer:e.string().optional(),allowNavigation:e.boolean(),scenes:e.array(_o),variables:e.array(e.object({name:e.string(),defaultValue:e.union([e.string(),e.number(),e.boolean()])})).optional(),audio:e.array(e.object({id:e.string(),media:c.optional(),scenes:e.string().optional(),autoplay:e.boolean().optional(),loop:e.boolean().optional()})).optional()}),zt=e.object({id:e.string(),type:e.literal("BLOCK"),sceneId:e.string(),blockData:Ce});import{z as k}from"zod";var Ro=k.object({id:k.string(),type:k.string(),title:k.string()}),Fo=k.object({id:k.string(),title:k.string(),position:k.number(),blocks:k.array(Ro).default([])}),Ct=k.object({activity:k.object({id:k.string(),title:k.string(),scenes:k.array(Fo).default([])}),activeSceneId:k.string().nullable().optional()});import{z as g}from"zod";var Wo=g.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Go=g.object({id:g.string().optional(),text:g.string(),isCorrect:g.boolean(),image:c.optional().describe("Option image."),imageAlign:E.optional().describe("Option image alignment."),imageSize:Q.optional().describe("Option image size.")}),No=g.object({id:g.string().optional().describe("Question ID. Auto-generated if omitted."),type:Wo,text:g.string().describe("The question text."),score:g.number().optional(),options:g.array(Go).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:g.boolean().optional().describe("Required for true-false."),image:c.optional().describe("Question image."),imageAlign:E.optional().describe("Question image alignment."),imageSize:Q.optional().describe("Question image size.")}),Be=g.object({questions:g.array(No).describe("Array of question objects."),showResults:g.boolean().optional(),allowRetry:g.boolean().optional(),maxRetry:g.string().optional(),required:g.boolean().optional(),submitText:g.string().optional().describe("Label for submit button."),timer:g.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:g.boolean().optional().describe("Show current/total questions count.")});import{z as Te}from"zod";var qo=Te.enum(["write","drag-drop"]),we=Te.object({templateText:Te.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:qo.optional().describe("Input mode. Default: write.")});import{z}from"zod";var Bt=z.enum(["Crossword","WordSearch","Anagram"]),Ho=z.object({answer:z.string(),clue:z.string(),image:c.optional().describe("Clue image.")}),Ae=z.object({words:z.array(Ho)}),je=z.object({words:z.array(z.string()),gridSize:M.optional().describe("Grid dimensions."),difficulty:z.enum(["easy","medium","hard"]).optional()}),Ie=z.object({correctWord:z.string().describe("The correct word."),letters:z.array(z.string()).optional(),clue:z.string().optional().describe("A hint.")});import{z as A}from"zod";var Tt=A.enum(["Memory","MatchPairs"]),Ko=A.enum(["img-img","img-word","word-word"]),Jo=A.object({id:A.string().optional(),type:Ko.optional().describe("For Memory: pair type."),content:A.array(A.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:A.string().optional().describe("For MatchPairs: left side text."),rightLabel:A.string().optional().describe("For MatchPairs: right side text."),leftImage:c.optional().describe("For MatchPairs: left side image."),rightImage:c.optional().describe("For MatchPairs: right side image.")}),H=A.object({pairs:A.array(Jo).describe("Array of pair objects."),gridSize:M.optional().describe("For Memory: grid dimensions."),instructions:A.string().optional().describe("For MatchPairs: instruction text.")});import{z as T}from"zod";var wt=T.enum(["Flashcard","CardDeck"]),De=T.object({type:T.enum(["text","image"]),content:T.any()}),Vo=T.object({id:T.string().optional(),front:De.optional().describe("For Flashcard: front side."),back:De.optional().describe("For Flashcard: back side."),frontText:T.string().optional().describe("For CardDeck: front text."),frontImage:T.any().optional().describe("For CardDeck: front image.")}),K=T.object({cards:T.array(Vo).describe("Array of card objects."),backImage:T.any().optional().describe("For CardDeck: shared back image."),discardLogic:T.enum(["delete","return"]).optional().describe("For CardDeck.")});import{z as L}from"zod";var $o=L.enum(["d4","d6","d8","d10","d12","d20"]),Me=L.object({diceType:$o.optional(),diceCount:L.number().int().min(1).max(10).optional(),color:L.string().optional().describe("CSS color for dice."),showNumber:L.boolean().optional(),persistent:L.boolean().optional().describe("Keep dice visible after roll.")});import{z as O}from"zod";var Yo=O.object({id:O.string().optional(),text:O.string(),color:O.string().optional().describe("CSS color for slice."),image:c.optional().describe("Slice image.")}),Pe=O.object({slices:O.array(Yo).min(2).describe("Wheel slices (min 2)."),spinDuration:O.number().optional().describe("Spin duration in seconds.")});import{z as m}from"zod";var Uo=m.object({id:m.string().optional(),text:m.string(),background:c.optional().describe("Background image/color for item."),opacity:m.number().optional().describe("Opacity of the item (0-1)."),x:m.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:m.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:m.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:m.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:m.number().optional().describe("Manual width in pixels."),height:m.number().optional().describe("Manual height in pixels."),styles:s.optional().describe("Box custom styling styles."),textStyles:u.optional().describe("Text custom styling styles.")}),Zo=m.object({id:m.string().optional(),name:m.string().describe("Group/dropzone name."),singleItem:m.boolean().optional().describe("Accept only one item inside."),background:c.optional().describe("Background image/color for group."),x:m.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:m.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:m.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:m.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:m.number().optional().describe("Manual width in pixels."),height:m.number().optional().describe("Manual height in pixels."),opacity:m.number().optional().describe("Opacity of the group (0-1)."),styles:s.optional().describe("Box custom styling styles."),textStyles:u.optional().describe("Text custom styling styles."),items:m.array(Uo).describe("Items that belong in this group.")}),Oe=m.object({groups:m.array(Zo).min(1).describe("Drag-and-drop groups."),layout:m.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:m.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:m.boolean().optional().describe("Show result feedback immediately."),requireSubmit:m.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:m.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:c.optional().describe("Shared background image/color for all groups."),itemBackground:c.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:m.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:m.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:m.number().optional().describe("Proportion ratio for split layout.")});import{z as C}from"zod";var Xo=C.enum(["line","bar","pie","doughnut","radar","area","scatter"]),et=C.object({colors:C.array(C.string()).optional(),xAxisLabel:C.string().optional(),yAxisLabel:C.string().optional(),showLegend:C.boolean().optional(),showTooltip:C.boolean().optional(),stacked:C.boolean().optional(),seriesNames:C.record(C.string()).optional().describe("Dictionary mapping series keys to custom labels.")}),ve=C.object({chartType:Xo.optional(),chartData:C.array(C.record(C.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:et.optional()});import{z as J}from"zod";var _=J.object({content:J.any().optional().describe("For Editor: Plate JSON content array."),url:J.string().optional().describe("For Media or Embed: content URL."),text:J.string().optional().describe("For Shape: text inside shape."),mediaType:v.optional().describe("For Media: media type.")});import*as ot from"zod-to-json-schema";var At=ot.zodToJsonSchema,W={Quiz:Be,Cloze:we,Crossword:Ae,WordSearch:je,Anagram:Ie,Memory:H,MatchPairs:H,Flashcard:K,CardDeck:K,Dice:Me,SpinningWheel:Pe,DragAndDrop:Oe,Chart:ve,Puzzle:xe,Editor:_,Media:_,Embed:_,Shape:_};function jt(t,r,n,a){let i=n?"*required*":"optional",h=Ee(r),d=r.description?` \u2014 ${r.description}`:"";return`${a}- \`${t}\` (${h}, ${i})${d}`}function Ee(t){return t.enum?`enum: ${t.enum.map(r=>JSON.stringify(r)).join(" | ")}`:t.anyOf||t.oneOf?(t.anyOf||t.oneOf).map(Ee).join(" | "):Array.isArray(t.type)?t.type.join(" | "):t.type==="array"&&t.items?`array<${Ee(t.items)}>`:t.type==="object"?"object":t.type??"any"}function Qe(t,r){let n=[],a=new Set(t.required??[]),i=t.properties??{};for(let[h,d]of Object.entries(i))n.push(jt(h,d,a.has(h),r)),d.type==="object"&&d.properties?n.push(Qe(d,r+" ")):d.type==="array"&&d.items?.type==="object"&&n.push(Qe(d.items,r+" "));return n.join(`
4
+ `)}function It(){let t=[],r=new Map;for(let[n,a]of Object.entries(W)){let i=r.get(a)??[];i.push(n),r.set(a,i)}for(let[n,a]of r.entries()){let i=a.join(" / "),h=At(n,{target:"jsonSchema7"}),d=Qe(h,"");t.push(`### ${i}
5
+ ${d||"_(no configurable fields)_"}`)}return t.join(`
7
6
 
8
- `)}});var Fe=g(I=>{"use strict";var Qo=I&&I.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),X=I&&I.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Qo(i,a,n)};Object.defineProperty(I,"__esModule",{value:!0});X(je(),I);X(F(),I);X(de(),I);X(Ue(),I);X(ve(),I);X(pe(),I);X(Xe(),I);X(Ze(),I);X(qe(),I);X(uo(),I)});var fe={};Te(fe,{CANVAS_OP_NAMES:()=>Ne,CANVAS_OP_REQUIRED:()=>se,applyItemPatch:()=>Ke,detectConflict:()=>He,entitySignature:()=>we,getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,isKnownCanvasOp:()=>xe,listBlockTypes:()=>ge,opConflictStamp:()=>Ye,opTarget:()=>Ce,parseMentions:()=>$e,resolveMentions:()=>Ve,stableStringify:()=>ce,validateCanvasOp:()=>Ge});var Z={};Te(Z,{CANVAS_OP_NAMES:()=>Ne,CANVAS_OP_REQUIRED:()=>se,applyItemPatch:()=>Ke,detectConflict:()=>He,entitySignature:()=>we,getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,isKnownCanvasOp:()=>xe,listBlockTypes:()=>ge,opConflictStamp:()=>Ye,opTarget:()=>Ce,parseMentions:()=>$e,resolveMentions:()=>Ve,stableStringify:()=>ce,validateCanvasOp:()=>Ge});var se={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"]},Ne=Object.keys(se);function xe(a){return Object.prototype.hasOwnProperty.call(se,a)}function Ge(a,i){if(!xe(a))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${a}"`]};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=se[a].filter(l=>n[l]===void 0||n[l]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(l=>`missing field: ${l}`)}:a==="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 Ke(a,i,n){let c=Array.isArray(a)?[...a]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let l=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(l,c.length)),0,n.item),c}return i==="updateItem"?c.map(l=>l&&typeof l=="object"&&l.id===n.itemId?{...l,...n.item??{}}:l):c.filter(l=>!(l&&typeof l=="object"&&l.id===n.itemId))}var fo=new Set(["position","size","rotation","zIndex","z"]);function ce(a){return a===null||typeof a!="object"?JSON.stringify(a)??"null":Array.isArray(a)?"["+a.map(ce).join(",")+"]":"{"+Object.keys(a).sort().map(n=>JSON.stringify(n)+":"+ce(a[n])).join(",")+"}"}function Ce(a,i){let n=i??{};switch(a){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 ko(a,i){if(Array.isArray(a))for(let n of a){let c=n?.blocks?.find?.(l=>l&&l.id===i);if(c)return c}}function we(a,i){if(i.kind==="untracked")return null;let n=i.blockId?ko(a,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let h={};for(let u of Object.keys(n))fo.has(u)||(h[u]=n[u]);return ce(h)}let c=n[i.collection];if(!Array.isArray(c))return null;let l=c.find(h=>h&&h.id===i.itemId);return l?ce(l):null}function He(a,i){return a==null?"apply":i==null?"missing":a===i?"apply":"stale"}function Ye(a,i,n){let c=Ce(a,i);return{target:c,baseSignature:we(n,c)}}var _e=/@\[([^\]|]+)\|([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 $e(a){let i=[];for(let n of(a??"").matchAll(_e))i.push({name:n[1].trim(),id:n[2]});return i}function Ve(a,i){let n=new Map,c=new Map;for(let k of i?.scenes??[]){k?.id&&n.set(k.id,k);for(let C of k?.blocks??[])C?.id&&c.set(C.id,{block:C,sceneId:k.id})}let l=[],h=new Set,u=k=>c.has(k)?"il blocco selezionato":n.has(k)?"la scena selezionata":"l'elemento selezionato",ee=(k,C)=>{if(!h.has(C))if(c.has(C)){let{block:oe,sceneId:ho}=c.get(C);l.push({id:C,name:k,kind:"block",blockType:oe?.type,sceneId:ho}),h.add(C)}else n.has(C)&&(l.push({id:C,name:k,kind:"scene"}),h.add(C))},N=(a??"").replace(_e,(k,C,oe)=>(ee(C.trim(),oe),C.trim())),L=(a??"").replace(_e,(k,C,oe)=>c.has(oe)||n.has(oe)?u(oe):C.trim());return{cleanedText:N,agentText:L,entities:l}}var P={};Te(P,{getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,listBlockTypes:()=>ge});var Re=We(Fe());M(P,We(Fe()));import{zodToJsonSchema as Wo}from"zod-to-json-schema";function ge(){return Object.keys(Re.BLOCK_CONTENT_SCHEMAS)}function ye(a){let i=Re.BLOCK_CONTENT_SCHEMAS[a];if(i)return Wo(i,{target:"jsonSchema7",$refStrategy:"none"})}function Qe(){return Object.fromEntries(ge().map(a=>[a,ye(a)]))}M(Z,P);M(fe,Z);export{Ne as CANVAS_OP_NAMES,se as CANVAS_OP_REQUIRED,Ke as applyItemPatch,He as detectConflict,we as entitySignature,Qe as getAllBlockJsonSchemas,ye as getBlockJsonSchema,xe as isKnownCanvasOp,ge as listBlockTypes,Ye as opConflictStamp,Ce as opTarget,$e as parseMentions,Ve as resolveMentions,ce as stableStringify,Ge as validateCanvasOp};
7
+ `)}function Mt(){return Object.keys(W)}function Pt(t){let r=W[t];if(r)return Dt(r,{target:"jsonSchema7",$refStrategy:"none"})}function Sr(){return Object.fromEntries(Mt().map(t=>[t,Pt(t)]))}export{xt as ActionBlockSchema,ye as ActionConditionSchema,Se as ActionSchema,Je as ActionTypeSchema,Ve as ActionVariableSchema,kt as ActivityContentSchema,Ct as ActivityContextSchema,St as ActivityVariableSchema,zo as AnagramBlockSchema,ne as AnagramBlockThemeSchema,Ie as AnagramContentSchema,We as AnimationSchema,Qo as ArrowBlockSchema,ze as ArrowHeadTypeSchema,yo as ArrowLabelSchema,W as BLOCK_CONTENT_SCHEMAS,Ne as BLOCK_STYLE_KEYS,Le as BLOCK_TYPES,_ as BasicContentSchema,bt as BlockEventSchema,ge as BlockEventTypeSchema,Lo as BlockGroupSchema,Ce as BlockSchema,b as BlockThemeSchema,Y as BlockTypeSchema,Z as BoxSideSchema,s as BoxStylesSchema,Ot as CANVAS_OP_NAMES,V as CANVAS_OP_REQUIRED,zt as CanvasDragItemSchema,vo as CardDeckBlockSchema,se as CardDeckBlockThemeSchema,De as CardFaceSchema,mo as CardItemSchema,Vo as CardSchema,Mo as ChartBlockSchema,et as ChartConfigSchema,ve as ChartContentSchema,Xo as ChartTypeSchema,Ye as ChoiceQuestionSchema,yt as ClickConditionSchema,Oo as ClozeBlockSchema,pe as ClozeBlockThemeSchema,we as ClozeContentSchema,qo as ClozeModeSchema,He as ConditionOperatorSchema,Re as CropDataSchema,To as CrosswordBlockSchema,ae as CrosswordBlockThemeSchema,ro as CrosswordCellSchema,Ae as CrosswordContentSchema,io as CrosswordLayoutOutputSchema,ao as CrosswordLayoutWordSchema,Ho as CrosswordWordSchema,wt as DeckBlockTypeSchema,K as DeckContentSchema,Co as DiceBlockSchema,re as DiceBlockThemeSchema,Me as DiceContentSchema,no as DiceTypeSchema,$o as DieTypeSchema,ko as DragAndDropBlockSchema,oe as DragAndDropBlockThemeSchema,Oe as DragAndDropContentSchema,to as DragAndDropGroupSchema,oo as DragAndDropItemSchema,Zo as DragGroupSchema,Uo as DragItemSchema,bo as EditorBlockSchema,te as EditorBlockThemeSchema,xo as EmbedBlockSchema,Io as FlashcardBlockSchema,me as FlashcardBlockThemeSchema,ke as FlashcardContentSchema,so as FlashcardItemSchema,M as GridSizeSchema,So as HotpointBlockSchema,X as HotpointBlockThemeSchema,E as ImageAlignSchema,Q as ImageSizeSchema,gt as KeyPressConditionSchema,Po as MatchPairsBlockSchema,de as MatchPairsBlockThemeSchema,ho as MatchPairsPairSchema,Ke as MathOperationSchema,fo as MediaBlockSchema,c as MediaItemSchema,pt as MediaRefSchema,_e as MediaSourceSchema,v as MediaTypeSchema,jo as MemoryBlockSchema,ce as MemoryBlockThemeSchema,lo as MemoryPairSchema,Ko as MemoryPairTypeSchema,Tt as PairGameBlockTypeSchema,H as PairGameContentSchema,Jo as PairSchema,U as PositionSchema,Bo as PuzzleBlockSchema,xe as PuzzleContentSchema,q as PuzzleGameModeSchema,Xe as PuzzleTypeSchema,$e as QuestionOptionSchema,fe as QuestionSchema,ft as QuestionTypeSchema,go as QuizBlockSchema,ee as QuizBlockThemeSchema,ht as QuizConditionSchema,Be as QuizContentSchema,Go as QuizOptionSchema,No as QuizQuestionSchema,Wo as QuizQuestionTypeSchema,Ge as RadiusSchema,N as STYLE_TARGET_MAP,Ro as SceneBlockRefSchema,_o as SceneSchema,Fo as SceneSummarySchema,eo as SceneTypeSchema,Eo as ShapeBlockSchema,he as ShapeBlockThemeSchema,uo as ShapeTypeSchema,R as SizeSchema,Pe as SpinnerContentSchema,Yo as SpinnerSliceSchema,Do as SpinningWheelBlockSchema,le as SpinningWheelBlockThemeSchema,Ze as TextQuestionSchema,u as TextStylesSchema,ut as TimerConditionSchema,Ue as TrueFalseQuestionSchema,qe as UNSTYLEABLE_BLOCKS,Fe as VideoSettingsSchema,po as WheelSliceSchema,Bt as WordGameBlockTypeSchema,Ao as WordSearchBlockSchema,ie as WordSearchBlockThemeSchema,je as WordSearchContentSchema,co as WordSearchDataSchema,wo as WordSearchDifficultySchema,Et as applyItemPatch,Lt as detectConflict,ct as entitySignature,It as generateBlockReference,Sr as getAllBlockJsonSchemas,Pt as getBlockJsonSchema,nt as isKnownCanvasOp,Mt as listBlockTypes,ue as mapLogicalThemeStyles,dt as mergeTheme,_t as opConflictStamp,at as opTarget,Ft as parseMentions,st as realStyleKeysFor,Wt as resolveMentions,G as stableStringify,mt as styleTargetsHelpFor,vt as validateCanvasOp};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edugate/ai-agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "source": "src/index.ts",