// File API polyfill for CommonJS (required by undici/fetch)
if (typeof globalThis.File === 'undefined') {
  try {
    const undici = require('undici');
    if (undici.File) {
      globalThis.File = undici.File;
    } else {
      globalThis.File = class File {
        constructor(bits, name, options = {}) {
          this.name = name;
          this.size = bits.length || bits.byteLength || 0;
          this.type = options.type || '';
          this.lastModified = options.lastModified || Date.now();
          this._bits = bits;
        }
        async arrayBuffer() {
          if (this._bits instanceof ArrayBuffer) return this._bits;
          if (Buffer.isBuffer(this._bits)) {
            return this._bits.buffer.slice(this._bits.byteOffset, this._bits.byteOffset + this._bits.byteLength);
          }
          return new ArrayBuffer(0);
        }
        async text() {
          if (Buffer.isBuffer(this._bits)) return this._bits.toString('utf8');
          return String(this._bits);
        }
      };
    }
  } catch (e) {
    globalThis.File = class File {
      constructor(bits, name, options = {}) {
        this.name = name;
        this.size = bits.length || bits.byteLength || 0;
        this.type = options.type || '';
        this.lastModified = options.lastModified || Date.now();
        this._bits = bits;
      }
      async arrayBuffer() {
        if (this._bits instanceof ArrayBuffer) return this._bits;
        if (Buffer.isBuffer(this._bits)) {
          return this._bits.buffer.slice(this._bits.byteOffset, this._bits.byteOffset + this._bits.byteLength);
        }
        return new ArrayBuffer(0);
      }
      async text() {
        if (Buffer.isBuffer(this._bits)) return this._bits.toString('utf8');
        return String(this._bits);
      }
    };
  }
}
if (typeof globalThis.FileReader === 'undefined') {
  globalThis.FileReader = class FileReader {
    constructor() {
      this.result = null;
      this.error = null;
      this.readyState = 0;
    }
    readAsArrayBuffer(file) {
      this.result = file;
      this.readyState = 2;
      if (this.onload) this.onload({ target: this });
    }
  };
}

'use strict';

var core_VideoMaker = require('./core/VideoMaker.cjs');
var core_Timeline = require('./core/Timeline.cjs');
var core_Renderer = require('./core/Renderer.cjs');
var core_VideoExporter = require('./core/VideoExporter.cjs');
var layers_BaseLayer = require('./layers/BaseLayer.cjs');
var layers_ElementLayer = require('./layers/ElementLayer.cjs');
var layers_BackgroundLayer = require('./layers/BackgroundLayer.cjs');
var layers_OverlayLayer = require('./layers/OverlayLayer.cjs');
var elements_BaseElement = require('./elements/BaseElement.cjs');
var elements_TextElement = require('./elements/TextElement.cjs');
var elements_SubtitleElement = require('./elements/SubtitleElement.cjs');
var elements_ImageElement = require('./elements/ImageElement.cjs');
var elements_VideoElement = require('./elements/VideoElement.cjs');
var elements_RectElement = require('./elements/RectElement.cjs');
var elements_CircleElement = require('./elements/CircleElement.cjs');
var elements_PathElement = require('./elements/PathElement.cjs');
var elements_SVGElement = require('./elements/SVGElement.cjs');
var elements_SpriteElement = require('./elements/SpriteElement.cjs');
var elements_OscilloscopeElement = require('./elements/OscilloscopeElement.cjs');
var animations_Animation = require('./animations/Animation.cjs');
var animations_KeyframeAnimation = require('./animations/KeyframeAnimation.cjs');
var animations_TransformAnimation = require('./animations/TransformAnimation.cjs');
var animations_presetAnimations = require('./animations/preset-animations.cjs');
var utils_ffmpeg = require('./utils/ffmpeg.cjs');
var utils_imageLoader = require('./utils/image-loader.cjs');
var types_enums = require('./types/enums.cjs');
var types_constants = require('./types/constants.cjs');
var builder_VideoBuilder = require('./builder/VideoBuilder.cjs');
var builder_Track = require('./builder/Track.cjs');
var builder_Scene = require('./builder/Scene.cjs');
var builder_Component = require('./builder/Component.cjs');
var builder_Transition = require('./builder/Transition.cjs');
var elements_CodeElement = require('./elements/CodeElement.cjs');
var elements_EChartsElement = require('./elements/EChartsElement.cjs');
var utils_helpers = require('./utils/helpers.cjs');
var utils_validator = require('./utils/validator.cjs');
var utils_unitConverter = require('./utils/unit-converter.cjs');
var utils_subtitleUtils = require('./utils/subtitle-utils.cjs');
var utils_audioUtils = require('./utils/audio-utils.cjs');
var utils_transitionRenderer = require('./utils/transition-renderer.cjs');
var elements_TransitionElement = require('./elements/TransitionElement.cjs');
var utils_fontManager = require('./utils/font-manager.cjs');



exports.Composition = core_VideoMaker.VideoMaker;
exports.VideoMaker = core_VideoMaker.VideoMaker;
exports.Timeline = core_Timeline.Timeline;
exports.Renderer = core_Renderer.Renderer;
exports.VideoExporter = core_VideoExporter.VideoExporter;
exports.BaseLayer = layers_BaseLayer.BaseLayer;
exports.ElementLayer = layers_ElementLayer.ElementLayer;
exports.BackgroundLayer = layers_BackgroundLayer.BackgroundLayer;
exports.OverlayLayer = layers_OverlayLayer.OverlayLayer;
exports.BaseElement = elements_BaseElement.BaseElement;
exports.TextElement = elements_TextElement.TextElement;
exports.SubtitleElement = elements_SubtitleElement.SubtitleElement;
exports.ImageElement = elements_ImageElement.ImageElement;
exports.VideoElement = elements_VideoElement.VideoElement;
exports.RectElement = elements_RectElement.RectElement;
exports.CircleElement = elements_CircleElement.CircleElement;
exports.PathElement = elements_PathElement.PathElement;
exports.SVGElement = elements_SVGElement.SVGElement;
exports.SpriteElement = elements_SpriteElement.SpriteElement;
exports.OscilloscopeElement = elements_OscilloscopeElement.OscilloscopeElement;
exports.Animation = animations_Animation.Animation;
exports.KeyframeAnimation = animations_KeyframeAnimation.KeyframeAnimation;
exports.TransformAnimation = animations_TransformAnimation.TransformAnimation;
exports.PRESET_ANIMATIONS = animations_presetAnimations.PRESET_ANIMATIONS;
exports.getPresetAnimation = animations_presetAnimations.getPresetAnimation;
exports.getPresetAnimationNames = animations_presetAnimations.getPresetAnimationNames;
exports.FFmpegUtil = utils_ffmpeg.FFmpegUtil;
exports.ImageLoader = utils_imageLoader.ImageLoader;
exports.imageLoader = utils_imageLoader.imageLoader;
exports.AnimationType = types_enums.AnimationType;
exports.EasingType = types_enums.EasingType;
exports.ElementType = types_enums.ElementType;
exports.ExportFormat = types_enums.ExportFormat;
exports.LayerType = types_enums.LayerType;
exports.RenderQuality = types_enums.RenderQuality;
exports.DEFAULT_ANIMATION_CONFIG = types_constants.DEFAULT_ANIMATION_CONFIG;
exports.DEFAULT_AUDIO_CONFIG = types_constants.DEFAULT_AUDIO_CONFIG;
exports.DEFAULT_CIRCLE_CONFIG = types_constants.DEFAULT_CIRCLE_CONFIG;
exports.DEFAULT_CONFIG = types_constants.DEFAULT_CONFIG;
exports.DEFAULT_ELEMENT_CONFIG = types_constants.DEFAULT_ELEMENT_CONFIG;
exports.DEFAULT_FFMPEG_CONFIG = types_constants.DEFAULT_FFMPEG_CONFIG;
exports.DEFAULT_IMAGE_CONFIG = types_constants.DEFAULT_IMAGE_CONFIG;
exports.DEFAULT_JSON_CONFIG = types_constants.DEFAULT_JSON_CONFIG;
exports.DEFAULT_OSCILLOSCOPE_CONFIG = types_constants.DEFAULT_OSCILLOSCOPE_CONFIG;
exports.DEFAULT_PATH_CONFIG = types_constants.DEFAULT_PATH_CONFIG;
exports.DEFAULT_RECT_CONFIG = types_constants.DEFAULT_RECT_CONFIG;
exports.DEFAULT_SPINE_CONFIG = types_constants.DEFAULT_SPINE_CONFIG;
exports.DEFAULT_SPRITE_CONFIG = types_constants.DEFAULT_SPRITE_CONFIG;
exports.DEFAULT_SUBTITLE_CONFIG = types_constants.DEFAULT_SUBTITLE_CONFIG;
exports.DEFAULT_SVG_CONFIG = types_constants.DEFAULT_SVG_CONFIG;
exports.DEFAULT_TEXT_CONFIG = types_constants.DEFAULT_TEXT_CONFIG;
exports.DEFAULT_TRANSITION_CONFIG = types_constants.DEFAULT_TRANSITION_CONFIG;
exports.DEFAULT_VIDEO_CONFIG = types_constants.DEFAULT_VIDEO_CONFIG;
exports.VideoBuilder = builder_VideoBuilder.VideoBuilder;
exports.Track = builder_Track.Track;
exports.Scene = builder_Scene.Scene;
exports.Component = builder_Component.Component;
exports.Transition = builder_Transition.Transition;
exports.CodeElement = elements_CodeElement.CodeElement;
exports.EChartsElement = elements_EChartsElement.EChartsElement;
exports.applyEasing = utils_helpers.applyEasing;
exports.autoContext = utils_helpers.autoContext;
exports.captureContext = utils_helpers.captureContext;
exports.clamp = utils_helpers.clamp;
exports.deepMerge = utils_helpers.deepMerge;
exports.degToRad = utils_helpers.degToRad;
exports.easingFunctions = utils_helpers.easingFunctions;
exports.formatTime = utils_helpers.formatTime;
exports.framesToTime = utils_helpers.framesToTime;
exports.generateId = utils_helpers.generateId;
exports.lerp = utils_helpers.lerp;
exports.radToDeg = utils_helpers.radToDeg;
exports.smartContext = utils_helpers.smartContext;
exports.timeToFrames = utils_helpers.timeToFrames;
exports.withContext = utils_helpers.withContext;
exports.AnimationConfigSchema = utils_validator.AnimationConfigSchema;
exports.AnimationInputSchema = utils_validator.AnimationInputSchema;
exports.AudioElementSchema = utils_validator.AudioElementSchema;
exports.CircleElementSchema = utils_validator.CircleElementSchema;
exports.CodeElementSchema = utils_validator.CodeElementSchema;
exports.EChartsElementSchema = utils_validator.EChartsElementSchema;
exports.EasingNamesSchema = utils_validator.EasingNamesSchema;
exports.ElementConfigSchema = utils_validator.ElementConfigSchema;
exports.ElementSchema = utils_validator.ElementSchema;
exports.ImageElementSchema = utils_validator.ImageElementSchema;
exports.JSONElementSchema = utils_validator.JSONElementSchema;
exports.OscilloscopeElementSchema = utils_validator.OscilloscopeElementSchema;
exports.PathElementSchema = utils_validator.PathElementSchema;
exports.PresetAnimationNamesSchema = utils_validator.PresetAnimationNamesSchema;
exports.RectElementSchema = utils_validator.RectElementSchema;
exports.SVGElementSchema = utils_validator.SVGElementSchema;
exports.SceneConfigSchema = utils_validator.SceneConfigSchema;
exports.SpriteElementSchema = utils_validator.SpriteElementSchema;
exports.SubtitleElementSchema = utils_validator.SubtitleElementSchema;
exports.TextElementSchema = utils_validator.TextElementSchema;
exports.TrackConfigSchema = utils_validator.TrackConfigSchema;
exports.TransitionNamesSchema = utils_validator.TransitionNamesSchema;
exports.VideoBuilderConfigSchema = utils_validator.VideoBuilderConfigSchema;
exports.VideoElementSchema = utils_validator.VideoElementSchema;
exports.validateColor = utils_validator.validateColor;
exports.validatePoint = utils_validator.validatePoint;
exports.validateRange = utils_validator.validateRange;
exports.validateSize = utils_validator.validateSize;
exports.validateTime = utils_validator.validateTime;
exports.convertUnits = utils_unitConverter.convertUnits;
exports.parseUnit = utils_unitConverter.parseUnit;
exports.toFontSizePixels = utils_unitConverter.toFontSizePixels;
exports.toPixels = utils_unitConverter.toPixels;
exports.calculateMixedTextCapacity = utils_subtitleUtils.calculateMixedTextCapacity;
exports.calculateSpeechTimeMixed = utils_subtitleUtils.calculateSpeechTimeMixed;
exports.parseSubtitles = utils_subtitleUtils.parseSubtitles;
exports.getAudioDuration = utils_audioUtils.getAudioDuration;
exports.AllTransitions = utils_transitionRenderer.AllTransitions;
exports.TransitionRenderer = utils_transitionRenderer.TransitionRenderer;
exports.TransitionElement = elements_TransitionElement.TransitionElement;
exports.getFontFallbackChain = utils_fontManager.getFontFallbackChain;
exports.getRegisteredFontNames = utils_fontManager.getRegisteredFontNames;
exports.initDefaultFont = utils_fontManager.initDefaultFont;
exports.registerFontFile = utils_fontManager.registerFontFile;
//# sourceMappingURL=index.cjs.map
