@tawaship/pixi-animate-runtime 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +462 -2
- package/bin/pixi-animate-runtime.js +27 -0
- package/dist/generator.cjs.js +1056 -0
- package/dist/generator.cjs.js.map +1 -0
- package/dist/pixi-animate-runtime.cjs.js +3742 -0
- package/dist/pixi-animate-runtime.cjs.js.map +1 -0
- package/dist/pixi-animate-runtime.esm.js +3677 -0
- package/dist/pixi-animate-runtime.esm.js.map +1 -0
- package/dist/pixi-animate-runtime.js +3744 -0
- package/dist/pixi-animate-runtime.js.map +1 -0
- package/dist-skills/animate-data-converter-guide/SKILL.md +86 -0
- package/dist-skills/pixi-animate-runtime-guide/SKILL.md +146 -0
- package/package.json +70 -4
- package/tools/pixi-animate-runtime.bat +8 -0
- package/types/generator/generator/cli.d.ts +17 -0
- package/types/generator/generator/converter-version.d.ts +7 -0
- package/types/generator/generator/generate.d.ts +33 -0
- package/types/generator/generator/index.d.ts +6 -0
- package/types/generator/generator/plan.d.ts +87 -0
- package/types/generator/player/data.d.ts +141 -0
- package/types/generator/player/ease.d.ts +11 -0
- package/types/generator/player/semver.d.ts +27 -0
- package/types/generator/player/version.d.ts +2 -0
- package/types/player/animate-container.d.ts +73 -0
- package/types/player/content.d.ts +181 -0
- package/types/player/data.d.ts +141 -0
- package/types/player/display.d.ts +192 -0
- package/types/player/ease.d.ts +11 -0
- package/types/player/events.d.ts +60 -0
- package/types/player/geom.d.ts +19 -0
- package/types/player/index.d.ts +20 -0
- package/types/player/loader.d.ts +53 -0
- package/types/player/movieclip.d.ts +191 -0
- package/types/player/objects.d.ts +320 -0
- package/types/player/semver.d.ts +27 -0
- package/types/player/transform.d.ts +32 -0
- package/types/player/version.d.ts +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.cjs.js","sources":["../src/player/semver.ts","../src/player/version.ts","../src/generator/converter-version.ts","../src/player/ease.ts","../src/player/data.ts","../src/generator/generate.ts","../src/generator/plan.ts","../src/generator/cli.ts"],"sourcesContent":["/**\n * Semantic version numbers and ranges, as far as the version checks of\n * definitions and runtime content need them: versions are MAJOR.MINOR.PATCH,\n * and ranges are written as npm writes them (`1.2.3`, `1.x`, `^1.2.0`,\n * `~1.2.0`, `>=1.0.0 <2.0.0`, `0.x || 1.x`). Pre-release tags are not handled.\n */\n\ntype TVersion = [number, number, number];\n\n/** A version as its three numbers, or null when it is not MAJOR.MINOR.PATCH */\nexport function parseVersion(text: string): TVersion | null {\n\tconst match = /^\\s*v?(\\d+)\\.(\\d+)\\.(\\d+)\\s*$/.exec(text);\n\treturn match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;\n}\n\nfunction compareParsed(a: TVersion, b: TVersion): number {\n\tfor (let i = 0; i < 3; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn a[i] < b[i] ? -1 : 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/** -1, 0 or 1 as a is lower than, the same as or higher than b (both have to be versions) */\nexport function compareVersions(a: string, b: string): number {\n\tconst pa = parseVersion(a);\n\tconst pb = parseVersion(b);\n\tif (!pa || !pb) {\n\t\tthrow new Error('not a version: ' + (pa ? b : a));\n\t}\n\treturn compareParsed(pa, pb);\n}\n\n/** A test on a version: the version compared with a bound */\ninterface IComparator {\n\top: '>=' | '<';\n\tbound: TVersion;\n}\n\n/** A partial version (1, 1.2, 1.x, *): the numbers given, the rest left open */\nfunction parsePartial(text: string): number[] | null {\n\tif (text === '*' || text === 'x' || text === 'X') {\n\t\treturn [];\n\t}\n\tconst parts = text.split('.');\n\tif (parts.length > 3) {\n\t\treturn null;\n\t}\n\tconst numbers: number[] = [];\n\tfor (let i = 0; i < parts.length; i++) {\n\t\tconst part = parts[i];\n\t\tif (part === 'x' || part === 'X' || part === '*') {\n\t\t\tbreak;\n\t\t}\n\t\tif (!/^\\d+$/.test(part)) {\n\t\t\treturn null;\n\t\t}\n\t\tnumbers.push(Number(part));\n\t}\n\treturn numbers;\n}\n\nfunction lowest(numbers: number[]): TVersion {\n\treturn [numbers[0] || 0, numbers[1] || 0, numbers[2] || 0];\n}\n\n/** The first version above every version the given numbers start (1.2 -> 1.3.0); null for none (*) */\nfunction above(numbers: number[]): TVersion | null {\n\tif (numbers.length === 0) {\n\t\treturn null;\n\t}\n\tif (numbers.length === 1) {\n\t\treturn [numbers[0] + 1, 0, 0];\n\t}\n\tif (numbers.length === 2) {\n\t\treturn [numbers[0], numbers[1] + 1, 0];\n\t}\n\treturn [numbers[0], numbers[1], numbers[2] + 1];\n}\n\n/** The tests one word of a range stands for, or null when the word is not understood */\nfunction parseComparator(word: string): IComparator[] | null {\n\tconst match = /^(\\^|~|>=|<=|>|<|=)?(.+)$/.exec(word);\n\tif (!match) {\n\t\treturn null;\n\t}\n\tconst op = match[1] || '=';\n\tconst numbers = parsePartial(match[2]);\n\tif (!numbers) {\n\t\treturn null;\n\t}\n\tconst low = lowest(numbers);\n\tconst result: IComparator[] = [];\n\tconst atLeast = (bound: TVersion): void => {\n\t\tresult.push({ op: '>=', bound });\n\t};\n\tconst below = (bound: TVersion | null): void => {\n\t\tif (bound) {\n\t\t\tresult.push({ op: '<', bound });\n\t\t}\n\t};\n\tif (op === '=') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers));\n\t} else if (op === '^') {\n\t\t// The left-most non-zero number given stays the same (^1.2.3 <2.0.0, ^0.2.3 <0.3.0, ^0.0.3 <0.0.4)\n\t\tlet fixed = 0;\n\t\twhile (fixed < numbers.length - 1 && numbers[fixed] === 0) {\n\t\t\tfixed++;\n\t\t}\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, fixed + 1)));\n\t} else if (op === '~') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, numbers.length > 1 ? 2 : 1)));\n\t} else if (op === '>=') {\n\t\tatLeast(low);\n\t} else if (op === '>') {\n\t\tconst next = above(numbers);\n\t\tif (!next) {\n\t\t\treturn null;\n\t\t}\n\t\tatLeast(next);\n\t} else if (op === '<') {\n\t\tbelow(low);\n\t} else {\n\t\t// <=\n\t\tbelow(above(numbers));\n\t}\n\treturn result;\n}\n\n/** Whether a version is in a range (npm's notation, see above); a range not understood throws */\nexport function satisfies(version: string, range: string): boolean {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn false;\n\t}\n\treturn range.split('||').some(set => {\n\t\tconst words = set.trim().split(/\\s+/).filter(word => word !== '');\n\t\tif (!words.length) {\n\t\t\tthrow new Error('not a version range: ' + range);\n\t\t}\n\t\treturn words.every(word => {\n\t\t\tconst comparators = parseComparator(word);\n\t\t\tif (!comparators) {\n\t\t\t\tthrow new Error('not a version range: ' + range);\n\t\t\t}\n\t\t\treturn comparators.every(c => {\n\t\t\t\tconst order = compareParsed(parsed, c.bound);\n\t\t\t\treturn c.op === '>=' ? order >= 0 : order < 0;\n\t\t\t});\n\t\t});\n\t});\n}\n\n/**\n * Whether data a reader is given can be read: `error` when its writer's\n * version is outside the range the reader reads, `warning` when it is in the\n * range but newer than the version the reader knows of (the data may hold\n * what the reader does not know and leaves out). Both null when it reads.\n */\nexport interface IVersionCheck {\n\terror: string | null;\n\twarning: string | null;\n\t/** With an error: whether the writer is newer than the reader (update the reader) or older (write the data again) */\n\tnewer: boolean;\n}\n\nexport function checkVersion(version: string, range: string, known: string): IVersionCheck {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn { error: 'no version (' + JSON.stringify(version) + ')', warning: null, newer: false };\n\t}\n\tconst newer = compareVersions(version, known) > 0;\n\tif (!satisfies(version, range)) {\n\t\treturn { error: version + ' is outside ' + range, warning: null, newer };\n\t}\n\treturn { error: null, warning: newer ? version + ' is newer than ' + known : null, newer };\n}\n","/** The version of this package (written in from package.json when the package is built) */\nexport const VERSION: string = '__PACKAGE_VERSION__';\n","/**\n * The animate-data-converter versions this generator reads definitions of:\n * the range this package depends on, and the version it was built with\n * (written in from package.json when the package is built).\n */\nexport const CONVERTER_RANGE: string = '__CONVERTER_RANGE__';\nexport const CONVERTER_KNOWN: string = '__CONVERTER_VERSION__';\n","/**\n * The eases of CreateJS (createjs.Ease), computed as CreateJS computes them,\n * by name. Runtime content names the ease of an interpolated stretch of a\n * tween; the player computes the stretch's values with it once, when a symbol's\n * class is made. `get:<amount>` is Ease.get(amount) (Animate's classic ease).\n */\n\nexport type TEase = (t: number) => number;\n\nfunction powIn(pow: number): TEase {\n\treturn t => Math.pow(t, pow);\n}\n\nfunction powOut(pow: number): TEase {\n\treturn t => 1 - Math.pow(1 - t, pow);\n}\n\nfunction powInOut(pow: number): TEase {\n\treturn t => ((t *= 2) < 1 ? 0.5 * Math.pow(t, pow) : 1 - 0.5 * Math.abs(Math.pow(2 - t, pow)));\n}\n\nfunction backIn(amount: number): TEase {\n\treturn t => t * t * ((amount + 1) * t - amount);\n}\n\nfunction backOut(amount: number): TEase {\n\treturn t => --t * t * ((amount + 1) * t + amount) + 1;\n}\n\nfunction backInOut(amount: number): TEase {\n\tamount *= 1.525;\n\treturn t => ((t *= 2) < 1 ? 0.5 * (t * t * ((amount + 1) * t - amount)) : 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2));\n}\n\nfunction elasticIn(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));\n\t};\n}\n\nfunction elasticOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1;\n\t};\n}\n\nfunction elasticInOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn (t *= 2) < 1\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period))\n\t\t\t: amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;\n\t};\n}\n\nfunction bounceOut(t: number): number {\n\treturn 1 / 2.75 > t ? 7.5625 * t * t\n\t\t: 2 / 2.75 > t ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75\n\t\t: 2.5 / 2.75 > t ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375\n\t\t: 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n}\n\nfunction bounceIn(t: number): number {\n\treturn 1 - bounceOut(1 - t);\n}\n\n/** Ease.get(amount): Animate's classic ease, amount from -1 (in) to 1 (out) */\nfunction classic(amount: number): TEase {\n\tamount = amount < -1 ? -1 : amount > 1 ? 1 : amount;\n\treturn t => (amount == 0 ? t : amount < 0 ? t * (t * -amount + 1 + amount) : t * ((2 - t) * amount + (1 - amount)));\n}\n\nconst EASES: { [name: string]: TEase } = {\n\tlinear: t => t,\n\tquadIn: powIn(2), quadOut: powOut(2), quadInOut: powInOut(2),\n\tcubicIn: powIn(3), cubicOut: powOut(3), cubicInOut: powInOut(3),\n\tquartIn: powIn(4), quartOut: powOut(4), quartInOut: powInOut(4),\n\tquintIn: powIn(5), quintOut: powOut(5), quintInOut: powInOut(5),\n\tsineIn: t => 1 - Math.cos(t * Math.PI / 2),\n\tsineOut: t => Math.sin(t * Math.PI / 2),\n\tsineInOut: t => -0.5 * (Math.cos(Math.PI * t) - 1),\n\tbackIn: backIn(1.7), backOut: backOut(1.7), backInOut: backInOut(1.7),\n\tcircIn: t => -(Math.sqrt(1 - t * t) - 1),\n\tcircOut: t => Math.sqrt(1 - --t * t),\n\tcircInOut: t => ((t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1)),\n\tbounceIn, bounceOut,\n\tbounceInOut: t => (0.5 > t ? 0.5 * bounceIn(2 * t) : 0.5 * bounceOut(2 * t - 1) + 0.5),\n\telasticIn: elasticIn(1, 0.3), elasticOut: elasticOut(1, 0.3), elasticInOut: elasticInOut(1, 0.3 * 1.5)\n};\n\n/** The ease runtime content names (null for a name the player does not know) */\nexport function easeOf(id: string): TEase | null {\n\tif (id.indexOf('get:') === 0) {\n\t\treturn classic(Number(id.slice(4)));\n\t}\n\treturn Object.prototype.hasOwnProperty.call(EASES, id) ? EASES[id] : null;\n}\n\n/** The eases the generator tries for a stretch of a tween, by name: the named ones, then Ease.get(-1 .. 1) in hundredths */\nexport function easeIds(): string[] {\n\tconst ids = Object.keys(EASES);\n\tfor (let n = -100; n <= 100; n++) {\n\t\tids.push('get:' + n / 100);\n\t}\n\treturn ids;\n}\n","/**\n * The data of runtime content (what the generator writes and the player reads): the definition\n * extracted by @tawaship/animate-data-converter, with every frame script\n * taken out of the data and referenced by its index in the runtime content's\n * script list (the scripts themselves are code in the runtime content), and with\n * the writes of each tween and of each instance's initial values compiled\n * into writer functions (code in the runtime content as well, referenced by index).\n * Drawings are gathered into one table for the whole content, identical\n * ones merged, and a symbol refers to them by index.\n */\n\nimport type {\n\tIMovieClipSymbolDef, ISpriteSymbolDef, IBitmapSymbolDef, ITweenDef, IPropMapDef, ISlotDef,\n\tIManifestEntryDef, ISpriteSheetDef, IGraphicsCommandDef, IStateEntryDef, IDataMap, TDataValue, TFrameValue\n} from '@tawaship/animate-data-converter';\nimport { easeOf, TEase } from './ease';\n\n/** A kind of drawing command: its type and the names of its props, in order */\nexport type TRuntimeCommandKind = [string, string[]];\n\n/** A drawing command as written in runtime content: the index of its kind, then its props' values in the kind's order */\nexport type TRuntimeCommand = TDataValue[];\n\n/** A drawing as written in runtime content */\nexport interface IRuntimeGraphicsData {\n\tcommands: TRuntimeCommand[];\n}\n\n/** A drawing's commands as the player draws them, from their written form */\nexport function commandsOf(kinds: TRuntimeCommandKind[], graphics: IRuntimeGraphicsData): IGraphicsCommandDef[] {\n\treturn graphics.commands.map(command => {\n\t\tconst kind = kinds[typeof command[0] === 'number' ? command[0] : 0];\n\t\tconst props: IDataMap = {};\n\t\tkind[1].forEach((name, i) => {\n\t\t\tprops[name] = command[i + 1];\n\t\t});\n\t\treturn { type: kind[0], props };\n\t});\n}\n\nexport type {\n\tISlotDef, ITweenDef, IStateEntryDef, IGraphicsDef, IGraphicsCommandDef, ISpriteDef, IBitmapDef,\n\tIFilterDef, ICacheDef, IButtonDef, IFilterCacheEntryDef, IRectDef, IDataMap, IPropMapDef,\n\tIManifestEntryDef, ISpriteSheetDef, ILabelDef, IMemberDef, TTargetDef, TFrameValue, TDataValue,\n\tISpriteSymbolDef, IBitmapSymbolDef\n} from '@tawaship/animate-data-converter';\n\n/**\n * The pixi-animate-runtime versions whose runtime content this player plays\n * (npm's range notation). Raised when the player stops playing runtime\n * content older versions made.\n */\nexport const RUNTIME_CONTENT_RANGE = '0.x';\n\nexport interface IRuntimeActionDef {\n\t/** Timeline position the action sits on */\n\tposition: number;\n\t/** Index into the runtime content's script list */\n\tscript: number;\n\tparams: TFrameValue[] | null;\n}\n\nexport interface IRuntimeTweenDef extends Omit<ITweenDef, 'actions' | 'frames'> {\n\tactions: IRuntimeActionDef[];\n\t/** The tween's distinct frame values (each the values of its props, in order) */\n\tvalues: TFrameValue[][];\n\t/** For every position, the index of its values in values (a position holding the same values as another shares them) */\n\tframes: number[];\n\t/**\n\t * Index into the runtime content's writer list: the function that writes a frame's\n\t * values (values[frames[position]]) to the target, one property after another by\n\t * name (null when the tween writes no property)\n\t */\n\twriter: number | null;\n}\n\n/**\n * A slot as the player uses it. Its initial values are in code only (the\n * writer), not in the data.\n */\n/**\n * A frame value as written in runtime content: a display list (`state`) may\n * give an entry that places a slot as it is (no props) as the slot's index\n */\nexport type TRuntimeFrameValue = TFrameValue | Array<IStateEntryDef | number>;\n\n/**\n * A position, or a stretch of positions, of a tween as written in runtime\n * content: the index of the position's values, or an interpolated stretch\n * [from, to, length, ease] whose positions run from values[from] toward\n * values[to] (the position after the stretch) as CreateJS interpolates a\n * step with that ease (see interpolated)\n */\nexport type TRuntimeFrameRef = number | [number, number, number, string];\n\n/** A tween as written in runtime content (tweenOf makes its values for every position) */\nexport interface IRuntimeTweenData extends Omit<IRuntimeTweenDef, 'values' | 'frames'> {\n\tvalues: TRuntimeFrameValue[][];\n\tframes: TRuntimeFrameRef[];\n}\n\n/**\n * The values at a position of a step, as CreateJS's Tween computes them: the\n * ratio of the position in the step, eased, then each value from its start\n * toward its end (a value that is not a number, or does not change, keeps its\n * start until the eased ratio reaches 1).\n */\nexport function interpolated(from: TFrameValue[], to: TFrameValue[], position: number, length: number, ease: TEase | null): TFrameValue[] {\n\tlet ratio = position / length;\n\tif (ease) {\n\t\tratio = ease(ratio);\n\t}\n\treturn from.map((v0, i) => {\n\t\tconst v1 = to[i];\n\t\treturn v0 !== v1 && typeof v0 === 'number' && typeof v1 === 'number' ? v0 + (v1 - v0) * ratio : ratio >= 1 ? v1 : v0;\n\t});\n}\n\n/** A display list entry as the player uses it, from its written form */\nfunction stateEntryOf(entry: IStateEntryDef | number): IStateEntryDef {\n\treturn typeof entry === 'number' ? { target: { type: 'slot', slot: entry }, props: null } : entry;\n}\n\n/**\n * A tween with the values of every position: its display lists (the values of\n * its `state` prop) as entries, and its interpolated stretches computed (each\n * position of a stretch gets values of its own)\n */\nexport function tweenOf(data: IRuntimeTweenData): IRuntimeTweenDef {\n\tconst state = data.props.indexOf('state');\n\tconst values = data.values.map(frame => frame.map((value, i): TFrameValue => {\n\t\tif (i === state && Array.isArray(value)) {\n\t\t\treturn value.map(stateEntryOf);\n\t\t}\n\t\treturn isFrameValue(value) ? value : null;\n\t}));\n\tconst frames: number[] = [];\n\tdata.frames.forEach(ref => {\n\t\tif (typeof ref === 'number') {\n\t\t\tframes.push(ref);\n\t\t\treturn;\n\t\t}\n\t\tconst ease = easeOf(ref[3]);\n\t\tfor (let position = 0; position < ref[2]; position++) {\n\t\t\tframes.push(values.push(interpolated(values[ref[0]], values[ref[1]], position, ref[2], ease)) - 1);\n\t\t}\n\t});\n\treturn Object.assign({}, data, { values, frames });\n}\n\n/** Whether a written value is a frame value as it is (all but a display list with slot indexes) */\nfunction isFrameValue(value: TRuntimeFrameValue): value is TFrameValue {\n\treturn !Array.isArray(value) || value.every(entry => typeof entry !== 'number');\n}\n\nexport interface IRuntimeSlotDef extends Omit<ISlotDef, 'init'> {\n\t/** Index into the runtime content's writer list: the function that writes the slot's initial values (initValues) */\n\tinitWriter: number | null;\n\t/** The slot's initial values, in the order its writer writes them */\n\tinitValues: TFrameValue[] | null;\n}\n\n/** The values a slot's fields have when runtime content leaves them out */\nexport const SLOT_DEFAULTS: Omit<IRuntimeSlotDef, 'kind'> = {\n\tsymbol: null, mode: null, startPosition: null, loop: null, graphics: null, sprite: null, bitmap: null, text: null,\n\tmask: null, hitArea: null, filters: null, cache: null, button: null, filterCacheListener: false, parentSet: false,\n\tinitWriter: null, initValues: null\n};\n\n/**\n * A slot template as written in runtime content: its kind, and the fields not\n * at their defaults (SLOT_DEFAULTS); its initial values are the slot's own\n */\nexport type TRuntimeSlotData = Pick<IRuntimeSlotDef, 'kind'> & Partial<Omit<IRuntimeSlotDef, 'kind' | 'initValues'>>;\n\n/**\n * A slot as written in a symbol: the index of its template in the content's\n * slotTemplates, with its initial values when it has some\n */\nexport type TRuntimeSlotRef = number | [number, TFrameValue[]];\n\n/** A slot from its template (the fields left out at their defaults) and its initial values */\nexport function slotOf(templates: TRuntimeSlotData[], ref: TRuntimeSlotRef): IRuntimeSlotDef {\n\tconst template = templates[typeof ref === 'number' ? ref : ref[0]];\n\treturn Object.assign({}, SLOT_DEFAULTS, template, { initValues: typeof ref === 'number' ? null : ref[1] });\n}\n\nexport interface IRuntimeMovieClipDef extends Omit<IMovieClipSymbolDef, 'tweens' | 'slots' | 'graphics' | 'members'> {\n\t/** The slots as written (templates and initial values; slotOf makes them whole) */\n\tslots: TRuntimeSlotRef[];\n\t/** The tweens as written (display lists with slot indexes; tweenOf turns them back into entries) */\n\ttweens: IRuntimeTweenData[];\n\t/**\n\t * Index into the runtime content's member writer list: the function that\n\t * gives an instance its named children (`this.instance = ...`), or null\n\t * when it has none\n\t */\n\tmemberWriter: number | null;\n\t/**\n\t * The symbol's drawings as indexes into the content's drawing table\n\t * (graphics[n] is the drawing the symbol's slots and tween values call n)\n\t */\n\tgraphics: number[];\n}\n\nexport type TRuntimeSymbolDef = IRuntimeMovieClipDef | ISpriteSymbolDef | IBitmapSymbolDef;\n\nexport interface IRuntimeData {\n\t/** The version of pixi-animate-runtime that generated the runtime content */\n\truntimeVersion: string;\n\t/** Primitive entries of the published lib.properties (width, height, fps, color, ...) */\n\tproperties: IPropMapDef;\n\t/** Images of the published manifest (sounds are left out) */\n\timages: IManifestEntryDef[];\n\t/** The published lib.ssMetadata */\n\tspriteSheets: ISpriteSheetDef[];\n\t/** Every drawing of the content, identical ones merged (shared by every symbol that shows them); commandsOf reads them */\n\tgraphics: IRuntimeGraphicsData[];\n\t/** The kinds of the drawings' commands (a type and the names of its props) */\n\tcommandKinds: TRuntimeCommandKind[];\n\t/** The slots of every symbol but their initial values, identical ones merged */\n\tslotTemplates: TRuntimeSlotData[];\n\tsymbols: { [id: string]: TRuntimeSymbolDef };\n}\n","import * as path from 'path';\nimport { extractPublishedFile } from '@tawaship/animate-data-converter';\nimport type { IDefinition, IIssue, ICompactMovieClipSymbolDef, ICompactTweenDef, IMemberDef, IPropMapDef, IStateEntryDef, TCompactFrameValue, TFrameValue, TSlotRefDef, TSlotTemplateDef } from '@tawaship/animate-data-converter';\nimport { checkVersion } from '../player/semver';\nimport { VERSION } from '../player/version';\nimport { CONVERTER_RANGE, CONVERTER_KNOWN } from './converter-version';\nimport { SLOT_DEFAULTS, interpolated } from '../player/data';\nimport { easeOf, easeIds } from '../player/ease';\nimport type { IRuntimeData, IRuntimeMovieClipDef, IRuntimeSlotDef, TRuntimeSlotData, TRuntimeSlotRef, TRuntimeSymbolDef, TRuntimeFrameValue, TRuntimeFrameRef } from '../player/data';\n\n/** Manifest entries kept as images (sounds and other files are left out) */\nconst IMAGE_SOURCE = /\\.(png|jpe?g|gif|webp|svg)(\\?.*)?$/i;\n\nexport interface IGenerated {\n\t/** The composition id the runtime content is registered under */\n\tid: string;\n\t/** The content's data (what the runtime content returns as `data`) */\n\tdata: IRuntimeData;\n\t/** Frame script sources, by the index the data refers to them with */\n\tscripts: string[];\n\t/** Writer function sources, by the index the data refers to them with */\n\twriters: string[];\n\t/** Member writer function sources, by the index the data refers to them with */\n\tmemberWriters: string[];\n\t/** The runtime content (JavaScript source) */\n\tsource: string;\n\t/** Unsupported features the converter found */\n\tissues: IIssue[];\n\t/** Things to look at that did not stop the generation (a definition from a newer converter) */\n\twarnings: string[];\n}\n\nconst IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\n/** A property access written out in code: o.name, or o[\"name\"] for other names */\nfunction access(name: string): string {\n\treturn IDENTIFIER.test(name) ? 'o.' + name : 'o[' + JSON.stringify(name) + ']';\n}\n\n/** The ease ids tried for a stretch, with their eases (made once) */\nconst EASE_CANDIDATES = easeIds().map(id => ({ id, ease: easeOf(id) }));\n\n/**\n * A tween's frame values as written: each step (from one keyframe to the next)\n * that interpolation reproduces exactly (the player's own interpolated, with\n * a CreateJS ease, gives every position's values as recorded) is written as a\n * stretch [from, to, length, ease]; any other position as the index of its\n * values, written once each. What cannot be reproduced exactly (a motion\n * guide, a step cut short by a jump) stays as recorded values.\n */\nfunction interpolatedFrames(frames: TFrameValue[][], keyframes: number[]): { values: TFrameValue[][]; frames: TRuntimeFrameRef[] } {\n\tconst values: TFrameValue[][] = [];\n\tconst indexes = new Map<string, number>();\n\tconst indexOf = (frame: TFrameValue[]): number => {\n\t\tconst key = JSON.stringify(frame);\n\t\tlet index = indexes.get(key);\n\t\tif (index === undefined) {\n\t\t\tindex = values.push(frame) - 1;\n\t\t\tindexes.set(key, index);\n\t\t}\n\t\treturn index;\n\t};\n\tconst last = frames.length - 1;\n\tconst starts = keyframes.filter((key, i) => key > 0 && key < last && keyframes.indexOf(key) === i).sort((a, b) => a - b);\n\tconst bounds = [0].concat(starts, [last]);\n\tconst refs: TRuntimeFrameRef[] = [];\n\tfor (let i = 0; i + 1 < bounds.length; i++) {\n\t\tconst start = bounds[i];\n\t\tconst length = bounds[i + 1] - start;\n\t\tconst found = length > 1 ? EASE_CANDIDATES.find(candidate => {\n\t\t\tfor (let position = 0; position < length; position++) {\n\t\t\t\tif (JSON.stringify(interpolated(frames[start], frames[start + length], position, length, candidate.ease)) !== JSON.stringify(frames[start + position])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}) : undefined;\n\t\tif (found) {\n\t\t\trefs.push([indexOf(frames[start]), indexOf(frames[start + length]), length, found.id]);\n\t\t} else {\n\t\t\tfor (let position = start; position < start + length; position++) {\n\t\t\t\trefs.push(indexOf(frames[position]));\n\t\t\t}\n\t\t}\n\t}\n\trefs.push(indexOf(frames[last]));\n\treturn { values, frames: refs };\n}\n\n/**\n * A tween's distinct values as written: in a display list (the `state` prop),\n * an entry that places a slot as it is (no props) is written as the slot's\n * index. The player turns them back into entries once per symbol.\n */\nfunction writtenFrames(props: string[], frames: TFrameValue[][], keyframes: number[]): { values: TRuntimeFrameValue[][]; frames: TRuntimeFrameRef[] } {\n\tconst distinct = interpolatedFrames(frames, keyframes);\n\tconst state = props.indexOf('state');\n\treturn {\n\t\tframes: distinct.frames,\n\t\tvalues: distinct.values.map(frame => frame.map((value, i): TRuntimeFrameValue => {\n\t\t\tif (i !== state || !Array.isArray(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\treturn value.map(entry => entry.target.type === 'slot' && entry.props === null ? entry.target.slot : entry);\n\t\t}))\n\t};\n}\n\n/** A recorded Graphics reference ({ graphics: n }): the value has to be resolved to the instance's Graphics */\nfunction isGraphicsReference(value: TFrameValue): boolean {\n\treturn value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * The writer of a tween: one assignment per property, the name written in the\n * code (so the engine resolves each write once instead of looking a name up\n * on every frame). values[i] goes to props[i]; a property that ever holds a\n * Graphics reference goes through resolve.\n */\nfunction tweenWriter(props: string[], frames: TFrameValue[][]): string {\n\tconst lines = props.map((name, i) => {\n\t\tconst resolved = frames.some(frame => isGraphicsReference(frame[i]));\n\t\treturn access(name) + ' = ' + (resolved ? 'g(v[' + i + '])' : 'v[' + i + ']') + ';';\n\t});\n\treturn 'function (o, v, g) { ' + lines.join(' ') + ' }';\n}\n\n/**\n * A slot's template as written in runtime content: the definition's template\n * with the writer of its initial values, the fields at their defaults\n * (SLOT_DEFAULTS) left out, the player filling them in. Its initial values are\n * not in it (the slot gives them).\n */\nfunction slotTemplate(template: TSlotTemplateDef, initWriter: number | null): TRuntimeSlotData {\n\tconst full: IRuntimeSlotDef = Object.assign({}, SLOT_DEFAULTS, template, { initWriter, initValues: null });\n\tconst data: TRuntimeSlotData = { kind: full.kind };\n\tObject.keys(SLOT_DEFAULTS).forEach(key => {\n\t\tconst value = Reflect.get(full, key);\n\t\tif (JSON.stringify(value) !== JSON.stringify(Reflect.get(SLOT_DEFAULTS, key))) {\n\t\t\tReflect.set(data, key, value);\n\t\t}\n\t});\n\treturn data;\n}\n\n/** A table of values written once each, identical ones (compared as JSON) sharing one index */\nclass JsonTable<T> {\n\treadonly list: T[] = [];\n\tprivate readonly _indexes = new Map<string, number>();\n\n\tadd(value: T): number {\n\t\tconst key = JSON.stringify(value);\n\t\tconst known = this._indexes.get(key);\n\t\tif (known !== undefined) {\n\t\t\treturn known;\n\t\t}\n\t\tthis.list.push(value);\n\t\tthis._indexes.set(key, this.list.length - 1);\n\t\treturn this.list.length - 1;\n\t}\n}\n\n/**\n * Initial values a display object of the player already has when it is made\n * (as a createjs one has): writing them changes nothing, so they are left out.\n * `name` is not among them: writing null gives the Pixi node the name ''\n * (its own default is null).\n */\nconst INIT_DEFAULTS: IPropMapDef = {\n\tx: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0, skewX: 0, skewY: 0, regX: 0, regY: 0,\n\talpha: 1, visible: true, compositeOperation: null\n};\n\n/**\n * The initial values of a slot to write (those not at INIT_DEFAULTS), and the\n * writer that writes them: one assignment per property, the name written in\n * the code and the value taken from the values, so that slots setting the\n * same properties share one writer.\n */\nfunction initWrite(init: IPropMapDef): { source: string; values: TFrameValue[] } | null {\n\tconst names = Object.keys(init).filter(name => init[name] !== undefined && !(name in INIT_DEFAULTS && init[name] === INIT_DEFAULTS[name]));\n\tif (!names.length) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tsource: 'function (o, v) { ' + names.map((name, i) => access(name) + ' = v[' + i + '];').join(' ') + ' }',\n\t\tvalues: names.map(name => init[name])\n\t};\n}\n\n/**\n * The member writer of a symbol: one assignment per named child, the name\n * written in the code (as the published constructor's `this.<name> = ...`),\n * so that no name is looked up when an instance is made.\n */\nfunction memberWriter(members: IMemberDef[]): string {\n\treturn 'function (o, s) { ' + members.map(member => access(member.name) + ' = s[' + member.slot + '];').join(' ') + ' }';\n}\n\n/** Function sources written once each, identical ones sharing one index */\nclass CodeTable {\n\treadonly list: string[] = [];\n\tprivate readonly _indexes = new Map<string, number>();\n\n\t/** The index of a function's source: functions written the same are one entry (they hold no state) */\n\tadd(source: string): number {\n\t\tconst known = this._indexes.get(source);\n\t\tif (known !== undefined) {\n\t\t\treturn known;\n\t\t}\n\t\tthis.list.push(source);\n\t\tthis._indexes.set(source, this.list.length - 1);\n\t\treturn this.list.length - 1;\n\t}\n}\n\n/** A display list entry from its compact form (a slot placed as it is is the slot's index) */\nfunction stateEntryOf(entry: IStateEntryDef | number): IStateEntryDef {\n\treturn typeof entry === 'number' ? { target: { type: 'slot', slot: entry }, props: null } : entry;\n}\n\n/** Whether a compact value is a frame value as it is (all but a display list with slot indexes) */\nfunction isFrameValue(value: TCompactFrameValue): value is TFrameValue {\n\treturn !Array.isArray(value) || value.every(entry => typeof entry !== 'number');\n}\n\n/**\n * A tween's values at every position (frames[position][i] is the value of\n * props[i]), from its compact form: interpolated stretches are found among\n * these. Display list entries are whole.\n */\nfunction framesOf(tween: ICompactTweenDef): TFrameValue[][] {\n\tconst state = tween.props.indexOf('state');\n\tconst values = tween.values.map(row => row.map((value, i): TFrameValue => {\n\t\tif (i === state && Array.isArray(value)) {\n\t\t\treturn value.map(stateEntryOf);\n\t\t}\n\t\treturn isFrameValue(value) ? value : null;\n\t}));\n\treturn tween.frames.map(index => values[index]);\n}\n\nfunction convertMovieClip(def: ICompactMovieClipSymbolDef, templates: TSlotTemplateDef[], scripts: string[], writers: CodeTable, memberWriters: CodeTable, slotTemplates: JsonTable<TRuntimeSlotData>): IRuntimeMovieClipDef {\n\tconst add = (source: string): number => writers.add(source);\n\treturn {\n\t\tkind: def.kind, id: def.id, nominalBounds: def.nominalBounds, frameBounds: def.frameBounds,\n\t\tdefaults: def.defaults, labels: def.labels, duration: def.duration,\n\t\t// A slot is its template (shared by the slots that differ only in their initial values) and its initial values\n\t\tslots: def.slots.map((slot: TSlotRefDef): TRuntimeSlotRef => {\n\t\t\tconst write = initWrite(typeof slot === 'number' ? {} : slot[1]);\n\t\t\tconst template = slotTemplates.add(slotTemplate(templates[typeof slot === 'number' ? slot : slot[0]], write ? add(write.source) : null));\n\t\t\treturn write ? [template, write.values] : template;\n\t\t}),\n\t\tmemberWriter: def.members.length ? memberWriters.add(memberWriter(def.members)) : null,\n\t\tunmanaged: def.unmanaged, graphics: def.graphics, filterCacheList: def.filterCacheList,\n\t\ttweens: def.tweens.map(tween => {\n\t\t\tconst frames = framesOf(tween);\n\t\t\treturn Object.assign({\n\t\t\t\ttarget: tween.target, duration: tween.duration, props: tween.props,\n\t\t\t\tkeyframes: tween.keyframes,\n\t\t\t\tactions: tween.actions.map(action => {\n\t\t\t\t\tscripts.push(action.source);\n\t\t\t\t\treturn { position: action.position, script: scripts.length - 1, params: action.params };\n\t\t\t\t}),\n\t\t\t\twriter: tween.props.length ? add(tweenWriter(tween.props, frames)) : null\n\t\t\t}, writtenFrames(tween.props, frames, tween.keyframes));\n\t\t})\n\t};\n}\n\n/**\n * The runtime content file: a factory that takes the names frame scripts\n * refer to (cjs, createjs, lib, exportRoot, stage, playSound) and returns the\n * data, the scripts and the writers. The scripts are written as code, as\n * published (not rewritten), and the writers are code too, so no code is\n * compiled at run time. Loaded (by a script tag or any other way), the file\n * registers the factory in `window.PixiAnimateRuntimeContents` under the\n * content's composition id. One registered under the same id before is\n * replaced, with a warning: which content an id stands for is the\n * application's to decide (one id may be given contents of the same make in\n * turn); contents already built keep working.\n */\nfunction runtimeContentSource(data: IRuntimeData, scripts: string[], writers: string[], memberWriters: string[], id: string, sourceName: string): string {\n\tconst comment = sourceName.replace(/\\*\\//g, '* /');\n\treturn [\n\t\t'/* Generated by @tawaship/pixi-animate-runtime from Adobe Animate HTML5 Canvas output.',\n\t\t' * Runtime content ' + JSON.stringify(id).replace(/\\*\\//g, '* /') + ' (composition id), from ' + comment + ' */',\n\t\t'(function (contents, id, source, factory) {',\n\t\t'\\tvar known = contents[id];',\n\t\t'\\tif (known && typeof console !== \"undefined\") {',\n\t\t'\\t\\tconsole.warn(\"Runtime content \" + JSON.stringify(id) + \" (\" + source + \") replaces the one registered under the same composition id (\" + (known.source || \"unknown\") + \").\");',\n\t\t'\\t}',\n\t\t'\\tfactory.source = source;',\n\t\t'\\tcontents[id] = factory;',\n\t\t'})(window.PixiAnimateRuntimeContents = window.PixiAnimateRuntimeContents || {}, ' + JSON.stringify(id) + ', ' + JSON.stringify(sourceName) + ', function (cjs, createjs, lib, exportRoot, stage, playSound) {',\n\t\t'\\treturn {',\n\t\t'\\t\\tdata: ' + JSON.stringify(data) + ',',\n\t\t'\\t\\tscripts: [',\n\t\tscripts.map(script => '\\t\\t\\t' + script).join(',\\n'),\n\t\t'\\t\\t],',\n\t\t'\\t\\twriters: [',\n\t\twriters.map(writer => '\\t\\t\\t' + writer).join(',\\n'),\n\t\t'\\t\\t],',\n\t\t'\\t\\tmemberWriters: [',\n\t\tmemberWriters.map(writer => '\\t\\t\\t' + writer).join(',\\n'),\n\t\t'\\t\\t]',\n\t\t'\\t};',\n\t\t'});',\n\t\t''\n\t].join('\\n');\n}\n\n/**\n * Whether this generator reads a definition: an error when the version of\n * animate-data-converter that extracted it is outside the range this package\n * depends on, a warning when it is newer than the converter this generator\n * was built with (it may hold what the generator does not know and leaves out).\n */\nfunction checkDefinition(definition: IDefinition): string[] {\n\tconst made = typeof definition.converterVersion === 'string' ? definition.converterVersion : '';\n\tconst check = checkVersion(made, CONVERTER_RANGE, CONVERTER_KNOWN);\n\tconst by = 'The definition was extracted by animate-data-converter ' + (made || '(no version)');\n\tif (check.error) {\n\t\tthrow new Error(by + ', which this generator (pixi-animate-runtime ' + VERSION + ') does not read (it reads definitions from ' + CONVERTER_RANGE + '). '\n\t\t\t+ (check.newer ? 'Update pixi-animate-runtime.' : 'Extract the definition again with animate-data-converter ' + CONVERTER_RANGE + '.'));\n\t}\n\treturn check.warning ? [by + ', newer than the version this generator knows of (' + CONVERTER_KNOWN + '). What the newer version added may be left out; update pixi-animate-runtime.'] : [];\n}\n\n/** The composition id of a content (lib.properties.id): the id its runtime content is registered and loaded under */\nexport function compositionId(definition: IDefinition): string {\n\tconst id = definition.properties.id;\n\tif (typeof id !== 'string' || !id) {\n\t\tthrow new Error('The published content has no composition id (lib.properties.id): its runtime content could not be registered.');\n\t}\n\treturn id;\n}\n\n/**\n * Generates the runtime content of a content from its extracted definition.\n * It is registered under the content's composition id; `sourceName` (the\n * published file it came from) is written into it to tell contents apart in\n * messages.\n */\nexport function generate(definition: IDefinition, sourceName?: string): IGenerated {\n\tconst warnings = checkDefinition(definition);\n\tif (definition.form !== 'compact') {\n\t\tthrow new Error('The definition is not in its compact form (form: ' + JSON.stringify(definition.form) + '): generate takes the definition as animate-data-converter extracts it (compact() of animate-data-converter gives it from an expanded one).');\n\t}\n\tconst id = compositionId(definition);\n\tconst scripts: string[] = [];\n\t// Writers written the same (the same values set, the same names given) are written once and shared\n\tconst writers = new CodeTable();\n\tconst memberWriters = new CodeTable();\n\tconst slotTemplates = new JsonTable<TRuntimeSlotData>();\n\tconst symbols: { [id: string]: TRuntimeSymbolDef } = {};\n\tObject.keys(definition.symbols).forEach(key => {\n\t\tconst def = definition.symbols[key];\n\t\tsymbols[key] = def.kind === 'movieclip' ? convertMovieClip(def, definition.slotTemplates, scripts, writers, memberWriters, slotTemplates) : def;\n\t});\n\n\tconst data: IRuntimeData = {\n\t\truntimeVersion: VERSION,\n\t\tproperties: definition.properties,\n\t\timages: definition.manifest.filter(entry => IMAGE_SOURCE.test(entry.src)),\n\t\tspriteSheets: definition.spriteSheets,\n\t\tgraphics: definition.graphics,\n\t\tcommandKinds: definition.commandKinds,\n\t\tslotTemplates: slotTemplates.list,\n\t\tsymbols\n\t};\n\n\tconst source = runtimeContentSource(data, scripts, writers.list, memberWriters.list, id, sourceName || '(unknown)');\n\treturn { id, data, scripts, writers: writers.list, memberWriters: memberWriters.list, source, issues: definition.issues, warnings };\n}\n\n/**\n * Extracts a published file and generates its runtime content.\n */\nexport function generateFromPublishedFile(publishedPath: string): Promise<IGenerated> {\n\treturn extractPublishedFile(publishedPath).then(definition => generate(definition, path.basename(publishedPath)));\n}\n\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport { extractPublishedFile } from '@tawaship/animate-data-converter';\nimport type { IIssue } from '@tawaship/animate-data-converter';\nimport { generate, compositionId } from './generate';\nimport type { IGenerated } from './generate';\n\nexport interface IPlanOptions {\n\t/** A directory of published content (every published JavaScript file directly in it), or one published file */\n\tinput: string;\n\t/**\n\t * Where to write: each content below it, at the path of its published file\n\t * from the input directory. Absent or null: generated/ next to each published file\n\t */\n\toutDir?: string | null;\n\t/** Also look in the directories below the input directory (not node_modules, nor directories whose name starts with \".\") */\n\trecursive?: boolean;\n\t/** Write runtime content even when the content uses unsupported features */\n\tforce?: boolean;\n\t/** The directory relative paths are taken from (default: the current directory) */\n\tcwd?: string;\n}\n\nexport interface IPlannedImage {\n\t/** The image file next to the published file */\n\tfrom: string;\n\t/** Where it is copied */\n\tto: string;\n}\n\nexport interface IPlannedContent {\n\t/** The published file */\n\tpublished: string;\n\t/** Its path from the input directory (\"/\" separated) */\n\tname: string;\n\t/** The composition id it registers under; null when the published file could not be read */\n\tid: string | null;\n\t/** Where its runtime content is written */\n\tout: string;\n\t/** Whether a file is already there (writing replaces it) */\n\texists: boolean;\n\t/** The images it uses, copied next to its runtime content at the same relative paths */\n\timages: IPlannedImage[];\n\t/** The runtime content (JavaScript source) that is written; null when it is not written */\n\tsource: string | null;\n\t/** Unsupported features the content uses (written anyway only with force) */\n\tissues: IIssue[];\n\t/** Things to look at that did not stop the generation */\n\twarnings: string[];\n\t/** Why it is not written; null when it is */\n\tproblem: string | null;\n}\n\nexport interface IGenerationPlan {\n\t/** The directory the names are taken from: the input directory, or the directory of the input file */\n\troot: string;\n\t/** The output directory; null when each content goes into generated/ next to its published file */\n\toutDir: string | null;\n\t/** Every published file found, in order */\n\tcontents: IPlannedContent[];\n\t/** Files already in the output directories; the ones the plan does not write are left as they are */\n\texisting: string[];\n}\n\nexport interface IWriteResult {\n\t/** The files written (runtime content and images) */\n\twritten: string[];\n\t/** The files already in the output directories that were not written (nothing is deleted) */\n\tleft: string[];\n}\n\n/** Whether a JavaScript file is Animate HTML5 Canvas output (it registers a composition) */\nfunction isPublished(file: string): boolean {\n\treturn /\\.compositions\\s*\\[/.test(fs.readFileSync(file, 'utf8'));\n}\n\nfunction publishedFiles(dir: string): string[] {\n\treturn fs.readdirSync(dir, { withFileTypes: true })\n\t\t.filter(entry => entry.isFile() && /\\.js$/i.test(entry.name))\n\t\t.map(entry => path.join(dir, entry.name))\n\t\t.filter(isPublished)\n\t\t.sort();\n}\n\n/** Directories the recursive search does not enter: packages, and hidden ones (.git and the like) */\nfunction isSkipped(name: string): boolean {\n\treturn name === 'node_modules' || name.charAt(0) === '.';\n}\n\n/** The published files in a directory and in the directories below it */\nfunction publishedFilesBelow(dir: string): string[] {\n\tconst files = publishedFiles(dir);\n\tfs.readdirSync(dir, { withFileTypes: true })\n\t\t.filter(entry => entry.isDirectory() && !isSkipped(entry.name))\n\t\t.map(entry => entry.name)\n\t\t.sort()\n\t\t.forEach(name => {\n\t\t\tpublishedFilesBelow(path.join(dir, name)).forEach(file => files.push(file));\n\t\t});\n\treturn files;\n}\n\n/** The local file of an image path of the manifest (its query and hash left out), or null for a URL that is not a file */\nfunction localImagePath(src: string): string | null {\n\tif (/^(data:|blob:|[a-z][a-z0-9+.-]*:\\/\\/)/i.test(src) || src.charAt(0) === '/') {\n\t\treturn null;\n\t}\n\treturn src.split('#')[0].split('?')[0];\n}\n\n/** Whether a relative path stays inside a directory (not absolute, and not leading up out of it) */\nfunction isBelow(dir: string, relativePath: string): boolean {\n\tif (path.isAbsolute(relativePath)) {\n\t\treturn false;\n\t}\n\tconst fromDir = path.relative(dir, path.resolve(dir, relativePath));\n\treturn fromDir !== '' && !fromDir.startsWith('..') && !path.isAbsolute(fromDir);\n}\n\nfunction listFiles(dir: string): string[] {\n\tif (!fs.existsSync(dir)) {\n\t\treturn [];\n\t}\n\tconst files: string[] = [];\n\tfs.readdirSync(dir, { withFileTypes: true }).forEach(entry => {\n\t\tconst full = path.join(dir, entry.name);\n\t\tif (entry.isDirectory()) {\n\t\t\tlistFiles(full).forEach(file => files.push(file));\n\t\t} else {\n\t\t\tfiles.push(full);\n\t\t}\n\t});\n\treturn files;\n}\n\n/** A path from a directory, \"/\" separated */\nexport function relativePath(from: string, file: string): string {\n\treturn path.relative(from, file).split(path.sep).join('/') || '.';\n}\n\n/**\n * The published files an input names, and the directory their names are\n * taken from. Only reads the files (nothing is run). Throws when the input\n * does not exist or has no published file.\n */\nexport function findPublished(input: string, recursive?: boolean, cwd?: string): { root: string; files: string[] } {\n\tconst inputPath = path.resolve(cwd || process.cwd(), input);\n\tif (!fs.existsSync(inputPath)) {\n\t\tthrow new Error('not found: ' + inputPath);\n\t}\n\tconst single = fs.statSync(inputPath).isFile();\n\tconst files = single ? [inputPath] : recursive ? publishedFilesBelow(inputPath) : publishedFiles(inputPath);\n\tif (!files.length) {\n\t\tthrow new Error('no published content (Animate HTML5 Canvas JavaScript) in ' + inputPath + (recursive ? ' or below it' : ''));\n\t}\n\treturn { root: single ? path.dirname(inputPath) : inputPath, files };\n}\n\n/** The local images a generated content uses (paths from its published directory), and why it cannot be written if it cannot */\nfunction imagesOf(generated: IGenerated, publishedDir: string): { images: string[]; problem: string | null } {\n\tconst images: string[] = [];\n\tconst missing: string[] = [];\n\tconst outside: string[] = [];\n\tgenerated.data.images.forEach(entry => {\n\t\tconst local = localImagePath(entry.src);\n\t\tif (local === null) {\n\t\t\treturn;\n\t\t}\n\t\t// Animate writes image paths relative to the published file, below its directory: a path\n\t\t// that leads elsewhere (up out of it, or absolute) is neither read nor copied\n\t\tif (!isBelow(publishedDir, local)) {\n\t\t\toutside.push(entry.src);\n\t\t} else if (fs.existsSync(path.join(publishedDir, local))) {\n\t\t\timages.push(local);\n\t\t} else {\n\t\t\tmissing.push(entry.src);\n\t\t}\n\t});\n\tif (outside.length) {\n\t\treturn { images, problem: 'image paths that lead out of its directory: ' + outside.join(', ') };\n\t}\n\tif (missing.length) {\n\t\treturn { images, problem: 'images it uses are missing: ' + missing.join(', ') };\n\t}\n\treturn { images, problem: null };\n}\n\n/**\n * Finds the published files, makes their runtime content and works out where\n * everything would be written, without writing anything. Each published file\n * is run in a sandbox of its own, one after another. What cannot be written\n * (a file that cannot be read, unsupported features without force, missing\n * images) is in the plan with its problem. Throws when the input does not\n * exist, has no published file, or the output would be a published directory.\n * {@link writeGeneration} writes the plan.\n */\nexport async function planGeneration(options: IPlanOptions): Promise<IGenerationPlan> {\n\tconst cwd = options.cwd || process.cwd();\n\tconst found = findPublished(options.input, options.recursive, cwd);\n\tconst root = found.root;\n\tconst outRoot = options.outDir !== undefined && options.outDir !== null ? path.resolve(cwd, options.outDir) : null;\n\t// Below the output directory at the path of its published file from the root, or into generated/ next to its published file\n\tconst outDirOf = (file: string): string => outRoot !== null ? path.join(outRoot, path.relative(root, path.dirname(file))) : path.join(path.dirname(file), 'generated');\n\tif (found.files.some(file => path.resolve(outDirOf(file)) === path.resolve(path.dirname(file)))) {\n\t\tthrow new Error('the output directory is the published directory: runtime content would overwrite the published files of the same names');\n\t}\n\n\tconst contents: IPlannedContent[] = [];\n\t// One after another: each is run in a sandbox of its own\n\tfor (const file of found.files) {\n\t\tconst outDir = outDirOf(file);\n\t\tconst out = path.join(outDir, path.basename(file));\n\t\tconst content: IPlannedContent = {\n\t\t\tpublished: file,\n\t\t\tname: relativePath(root, file),\n\t\t\tid: null,\n\t\t\tout,\n\t\t\texists: fs.existsSync(out),\n\t\t\timages: [],\n\t\t\tsource: null,\n\t\t\tissues: [],\n\t\t\twarnings: [],\n\t\t\tproblem: null\n\t\t};\n\t\tcontents.push(content);\n\t\ttry {\n\t\t\tconst definition = await extractPublishedFile(file);\n\t\t\tcontent.id = compositionId(definition);\n\t\t\tconst generated = generate(definition, path.basename(file));\n\t\t\tcontent.issues = generated.issues;\n\t\t\tcontent.warnings = generated.warnings;\n\t\t\tconst images = imagesOf(generated, path.dirname(file));\n\t\t\tcontent.images = images.images.map(image => ({ from: path.join(path.dirname(file), image), to: path.join(outDir, image) }));\n\t\t\tif (generated.issues.length && !options.force) {\n\t\t\t\tcontent.problem = generated.issues.length + ' unsupported feature(s)';\n\t\t\t} else if (images.problem !== null) {\n\t\t\t\tcontent.problem = images.problem;\n\t\t\t} else {\n\t\t\t\tcontent.source = generated.source;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tcontent.problem = (content.id === null ? 'could not read: ' : '') + (e instanceof Error ? e.message : String(e));\n\t\t}\n\t}\n\n\tconst existing: string[] = [];\n\t(outRoot !== null ? [outRoot] : contents.map(content => path.dirname(content.out)).filter((dir, i, all) => all.indexOf(dir) === i)).forEach(dir => {\n\t\tlistFiles(dir).forEach(file => existing.push(file));\n\t});\n\treturn { root, outDir: outRoot, contents, existing };\n}\n\n/**\n * Writes a plan made by {@link planGeneration}: the runtime content it made\n * (as it was when the plan was made) and copies of the images. The contents\n * with a problem are not written. Nothing is deleted.\n */\nexport function writeGeneration(plan: IGenerationPlan): IWriteResult {\n\tconst written: { [file: string]: boolean } = {};\n\tconst files: string[] = [];\n\tconst add = (file: string): void => {\n\t\twritten[path.resolve(file)] = true;\n\t\tfiles.push(file);\n\t};\n\tplan.contents.forEach(content => {\n\t\tif (content.source === null || content.problem !== null) {\n\t\t\treturn;\n\t\t}\n\t\tfs.mkdirSync(path.dirname(content.out), { recursive: true });\n\t\tfs.writeFileSync(content.out, content.source);\n\t\tadd(content.out);\n\t\tcontent.images.forEach(image => {\n\t\t\tif (!written[path.resolve(image.to)]) {\n\t\t\t\tfs.mkdirSync(path.dirname(image.to), { recursive: true });\n\t\t\t\tfs.copyFileSync(image.from, image.to);\n\t\t\t\tadd(image.to);\n\t\t\t}\n\t\t});\n\t});\n\treturn { written: files, left: plan.existing.filter(file => !written[path.resolve(file)]) };\n}\n","import * as path from 'path';\nimport { findPublished, planGeneration, writeGeneration, relativePath } from './plan';\nimport type { IGenerationPlan } from './plan';\n\nexport interface ICliIO {\n\tstdout(text: string): void;\n\tstderr(text: string): void;\n\t/** Asks a question and gives the answer; absent when nobody can answer (not a terminal) */\n\task?(question: string): Promise<string>;\n\t/** The directory relative paths are taken from */\n\tcwd?: string;\n}\n\nconst USAGE = [\n\t'Usage: pixi-animate-runtime [<published directory or file>] [-o <directory>] [-r] [-y] [-f]',\n\t'',\n\t' <published directory> a directory Animate published HTML5 Canvas content into: every published',\n\t' JavaScript file directly in it is turned into runtime content',\n\t' <published file> one published JavaScript file',\n\t' -o, --out-dir <directory> where to write (default: generated/ in the published directory)',\n\t' -r, --recursive also look in the directories below it (not node_modules, nor directories',\n\t' whose name starts with \".\"); with -o, each content is written below it at',\n\t' the same relative path, and otherwise into generated/ next to its file',\n\t' -y, --yes write without asking anything (needed when not run in a terminal)',\n\t' -f, --force write runtime content even when the content uses unsupported features',\n\t' -h, --help show this',\n\t'',\n\t'Each runtime content file gets the name of its published file, and the images it uses are copied',\n\t'next to it at the same relative paths. What would be written is listed first, and written only',\n\t'when you answer \"y\" (or with -y; run from a script or CI without -y, nothing is written). In a',\n\t'terminal, you are also asked for the directories that are not given. Nothing is ever deleted:',\n\t'files already in the output directory that this run did not write are listed.'\n].join('\\n');\n\n/** A composition id as listed: its first characters (the whole id is in the published file and at the top of the runtime content) */\nfunction shortId(id: string | null): string {\n\treturn id === null ? '-' : id.length > 8 ? id.slice(0, 8) + '...' : id;\n}\n\nfunction pad(text: string, width: number): string {\n\treturn text.length >= width ? text : text + ' '.repeat(width - text.length);\n}\n\n/**\n * Lists a plan as a table: where from and where to once, then a row for each\n * published file (its composition id shortened, the number of images, and\n * whether it is new, replaces a file, or is not written and why).\n * Unsupported features and warnings go to stderr.\n */\nfunction showPlan(plan: IGenerationPlan, force: boolean, cwd: string, io: ICliIO): void {\n\tplan.contents.forEach(content => {\n\t\tcontent.warnings.forEach(warning => {\n\t\t\tio.stderr(content.name + ': warning: ' + warning + '\\n');\n\t\t});\n\t\tcontent.issues.forEach(issue => {\n\t\t\tio.stderr(content.name + ': unsupported: ' + (issue.symbol ? issue.symbol : '(content)') + (issue.slot !== null ? ' slot ' + issue.slot : '') + ': ' + issue.message + '\\n');\n\t\t});\n\t});\n\tio.stdout('From: ' + relativePath(cwd, plan.root) + '\\n');\n\tio.stdout('To: ' + (plan.outDir !== null ? relativePath(cwd, plan.outDir) + ' (each at its path from \"From\")' : 'generated/ next to each published file') + '\\n\\n');\n\tconst header = ['published', 'composition id', 'images', ''];\n\tconst rows = plan.contents.map(content => [\n\t\tcontent.name,\n\t\tshortId(content.id),\n\t\tcontent.images.length ? String(content.images.length) : '',\n\t\tcontent.problem !== null ? 'not written: ' + content.problem + (content.issues.length && !force ? ' (--force writes it anyway)' : '') : content.exists ? 'replace' : 'new'\n\t]);\n\tconst widths = [0, 1, 2].map(column => Math.max(header[column].length, ...rows.map(row => row[column].length)));\n\t[header].concat(rows).forEach(row => {\n\t\tio.stdout((' ' + pad(row[0], widths[0]) + ' ' + pad(row[1], widths[1]) + ' ' + ' '.repeat(widths[2] - row[2].length) + row[2] + ' ' + row[3]).replace(/\\s+$/, '') + '\\n');\n\t});\n\n\tconst writes = plan.contents.filter(content => content.problem === null).length;\n\tconst notWritten = plan.contents.length - writes;\n\tconst counts: { [id: string]: number } = {};\n\tplan.contents.forEach(content => {\n\t\tif (content.id !== null) {\n\t\t\tcounts[content.id] = (counts[content.id] || 0) + 1;\n\t\t}\n\t});\n\tconst shared = Object.keys(counts).filter(id => counts[id] > 1).length;\n\tio.stdout('\\n' + writes + ' to write' + (notWritten ? ', ' + notWritten + ' not written' : '') + '.' +\n\t\t(shared ? ' ' + shared + ' composition id(s) shared by several files (on one page, the later replaces the earlier).' : '') + '\\n');\n}\n\n/**\n * The command line tool: {@link planGeneration}, the plan listed (and, in a\n * terminal, confirmed; without one, written only with -y), then\n * {@link writeGeneration}. Returns the exit code: 0 when every content was\n * written, 1 when some could not be (unsupported features without --force,\n * images the content uses that are missing) or nothing was written for want of\n * a \"y\", 2 for usage and loading errors.\n */\nexport async function runCli(args: string[], io: ICliIO): Promise<number> {\n\tconst cwd = io.cwd || process.cwd();\n\tlet input: string | null = null;\n\tlet outDir: string | null = null;\n\tlet force = false;\n\tlet recursive = false;\n\tlet yes = false;\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\t\tif (arg === '--out-dir' || arg === '-o') {\n\t\t\tconst value = args[++i];\n\t\t\tif (value === undefined) {\n\t\t\t\tio.stderr(arg + ' needs a directory\\n\\n' + USAGE + '\\n');\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\toutDir = value;\n\t\t} else if (arg === '--force' || arg === '-f') {\n\t\t\tforce = true;\n\t\t} else if (arg === '--recursive' || arg === '-r') {\n\t\t\trecursive = true;\n\t\t} else if (arg === '--yes' || arg === '-y') {\n\t\t\tyes = true;\n\t\t} else if (arg === '--help' || arg === '-h') {\n\t\t\tio.stdout(USAGE + '\\n');\n\t\t\treturn 0;\n\t\t} else if (arg.charAt(0) === '-' || input !== null) {\n\t\t\tio.stderr('unexpected argument: ' + arg + '\\n\\n' + USAGE + '\\n');\n\t\t\treturn 2;\n\t\t} else {\n\t\t\tinput = arg;\n\t\t}\n\t}\n\n\t// -y: no questions at all (what is not given takes its default)\n\tconst ask = yes ? undefined : io.ask;\n\tif (input === null) {\n\t\tinput = ask ? (await ask('Directory of the published content (empty: the current directory): ')).trim() : '';\n\t}\n\tinput = input || '.';\n\tif (outDir === null && ask) {\n\t\t// The published files found (by name: they are run when the plan is made), then where to write them\n\t\tlet found: { root: string; files: string[] };\n\t\ttry {\n\t\t\tfound = findPublished(input, recursive, cwd);\n\t\t} catch (e) {\n\t\t\tio.stderr((e instanceof Error ? e.message : String(e)) + '\\n');\n\t\t\treturn 2;\n\t\t}\n\t\tio.stdout('Published content in ' + relativePath(cwd, found.root) + ':\\n');\n\t\tfound.files.forEach(file => {\n\t\t\tio.stdout(' ' + relativePath(found.root, file) + '\\n');\n\t\t});\n\t\tconst answer = (await ask('Output directory (empty: ' + (recursive ? 'generated/ next to each published file' : relativePath(cwd, path.join(found.root, 'generated'))) + '): ')).trim();\n\t\toutDir = answer || null;\n\t}\n\n\tlet plan: IGenerationPlan;\n\ttry {\n\t\tplan = await planGeneration({ input, outDir, recursive, force, cwd });\n\t} catch (e) {\n\t\tio.stderr((e instanceof Error ? e.message : String(e)) + '\\n');\n\t\treturn 2;\n\t}\n\tshowPlan(plan, force, cwd, io);\n\tif (plan.contents.every(content => content.id === null)) {\n\t\treturn 2;\n\t}\n\tconst failed = plan.contents.some(content => content.problem !== null);\n\tif (plan.contents.every(content => content.problem !== null)) {\n\t\tio.stdout('Nothing to write.\\n');\n\t\treturn 1;\n\t}\n\tif (!yes) {\n\t\t// Nobody to ask (not a terminal): written only with -y\n\t\tif (!ask) {\n\t\t\tio.stdout('Nothing written: not run in a terminal, so nobody could be asked. Run with -y to write.\\n');\n\t\t\treturn 1;\n\t\t}\n\t\tconst answer = (await ask('Write these? (y/N): ')).trim().toLowerCase();\n\t\tif (answer !== 'y' && answer !== 'yes') {\n\t\t\tio.stdout('Nothing written.\\n');\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tconst result = writeGeneration(plan);\n\tio.stdout('Written: ' + result.written.length + ' file(s).\\n');\n\tif (result.left.length) {\n\t\tio.stdout('Not written by this run (remove them if no longer needed):\\n');\n\t\tresult.left.forEach(file => {\n\t\t\tio.stdout(' ' + relativePath(cwd, file) + '\\n');\n\t\t});\n\t}\n\treturn failed ? 1 : 0;\n}\n"],"names":["extractPublishedFile","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAIH;AACM,SAAU,YAAY,CAAC,IAAY,EAAA;IACxC,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC;AACxD,IAAA,OAAO,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;AAC7E;AAEA,SAAS,aAAa,CAAC,CAAW,EAAE,CAAW,EAAA;AAC9C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AAClB,YAAA,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CA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