@nodaro/shared 3.64.0 → 3.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-PJJAZQVZ.js → chunk-222QM7CO.js} +3 -3
- package/dist/{chunk-PJJAZQVZ.js.map → chunk-222QM7CO.js.map} +1 -1
- package/dist/chunk-27HA6YOL.cjs +377 -0
- package/dist/chunk-27HA6YOL.cjs.map +1 -0
- package/dist/{chunk-TTGZ2L3O.js → chunk-2NKF476Z.js} +3 -3
- package/dist/{chunk-TTGZ2L3O.js.map → chunk-2NKF476Z.js.map} +1 -1
- package/dist/chunk-3AU52TSW.js +143 -0
- package/dist/chunk-3AU52TSW.js.map +1 -0
- package/dist/{chunk-7AJGUI7L.cjs → chunk-5NVGKXJV.cjs} +34 -17
- package/dist/chunk-5NVGKXJV.cjs.map +1 -0
- package/dist/{chunk-3AYM47GW.js → chunk-5SSMPYE5.js} +99 -9
- package/dist/chunk-5SSMPYE5.js.map +1 -0
- package/dist/{chunk-KHH54GRP.cjs → chunk-6ET3KDO4.cjs} +15 -338
- package/dist/chunk-6ET3KDO4.cjs.map +1 -0
- package/dist/{chunk-ACZZHHFZ.cjs → chunk-6OSIOVF7.cjs} +44 -22
- package/dist/chunk-6OSIOVF7.cjs.map +1 -0
- package/dist/{chunk-OBOOHG3N.js → chunk-6X5PBAC4.js} +3 -3
- package/dist/{chunk-OBOOHG3N.js.map → chunk-6X5PBAC4.js.map} +1 -1
- package/dist/chunk-7BN4EDIC.cjs +185 -0
- package/dist/chunk-7BN4EDIC.cjs.map +1 -0
- package/dist/{chunk-IYSOVS7O.js → chunk-7OWXHW7Z.js} +31 -13
- package/dist/chunk-7OWXHW7Z.js.map +1 -0
- package/dist/{chunk-ZI3QDUHO.js → chunk-AT53ZQUC.js} +3 -3
- package/dist/{chunk-ZI3QDUHO.js.map → chunk-AT53ZQUC.js.map} +1 -1
- package/dist/{chunk-SHH2T4CR.js → chunk-BSTAAGLY.js} +3 -3
- package/dist/{chunk-SHH2T4CR.js.map → chunk-BSTAAGLY.js.map} +1 -1
- package/dist/{chunk-DZ4IOP3Q.js → chunk-CW6MMQNO.js} +277 -3
- package/dist/chunk-CW6MMQNO.js.map +1 -0
- package/dist/{chunk-Q2Y4JHF7.js → chunk-D5Y3EYRM.js} +5 -5
- package/dist/{chunk-Q2Y4JHF7.js.map → chunk-D5Y3EYRM.js.map} +1 -1
- package/dist/{chunk-EXEVT6D2.cjs → chunk-DQ2PARNH.cjs} +5 -5
- package/dist/{chunk-EXEVT6D2.cjs.map → chunk-DQ2PARNH.cjs.map} +1 -1
- package/dist/{chunk-OOZW2MM6.cjs → chunk-E66HSC2E.cjs} +9 -9
- package/dist/{chunk-OOZW2MM6.cjs.map → chunk-E66HSC2E.cjs.map} +1 -1
- package/dist/{chunk-NIAFR5EE.js → chunk-FGBGKBML.js} +32 -3
- package/dist/chunk-FGBGKBML.js.map +1 -0
- package/dist/{chunk-5OBTGNUQ.cjs → chunk-FI3HJZWM.cjs} +294 -2
- package/dist/chunk-FI3HJZWM.cjs.map +1 -0
- package/dist/{chunk-SPAHI7DY.cjs → chunk-FJZTQTF4.cjs} +4 -4
- package/dist/{chunk-SPAHI7DY.cjs.map → chunk-FJZTQTF4.cjs.map} +1 -1
- package/dist/{chunk-J6B7J73J.cjs → chunk-GJ3D5X4X.cjs} +49 -49
- package/dist/{chunk-J6B7J73J.cjs.map → chunk-GJ3D5X4X.cjs.map} +1 -1
- package/dist/{chunk-KB2SQAR3.js → chunk-H745DQ6V.js} +3 -3
- package/dist/{chunk-KB2SQAR3.js.map → chunk-H745DQ6V.js.map} +1 -1
- package/dist/{chunk-7KQ6W5DS.js → chunk-HAH2F7LT.js} +4 -4
- package/dist/{chunk-7KQ6W5DS.js.map → chunk-HAH2F7LT.js.map} +1 -1
- package/dist/{chunk-HDPJNNMF.cjs → chunk-JQMFJAYU.cjs} +21 -21
- package/dist/{chunk-HDPJNNMF.cjs.map → chunk-JQMFJAYU.cjs.map} +1 -1
- package/dist/{chunk-D4KWNDPH.cjs → chunk-JYU5EIRM.cjs} +12 -12
- package/dist/{chunk-D4KWNDPH.cjs.map → chunk-JYU5EIRM.cjs.map} +1 -1
- package/dist/{chunk-AZNZ5WNZ.cjs → chunk-K6RIN3LW.cjs} +142 -45
- package/dist/chunk-K6RIN3LW.cjs.map +1 -0
- package/dist/{chunk-YQV53HRR.cjs → chunk-KTCEKGBJ.cjs} +7 -7
- package/dist/{chunk-YQV53HRR.cjs.map → chunk-KTCEKGBJ.cjs.map} +1 -1
- package/dist/{chunk-W6VJAUGM.cjs → chunk-KWYS4IIM.cjs} +83 -37
- package/dist/chunk-KWYS4IIM.cjs.map +1 -0
- package/dist/{chunk-GTWUS6MQ.cjs → chunk-MIT2USTS.cjs} +61 -61
- package/dist/{chunk-GTWUS6MQ.cjs.map → chunk-MIT2USTS.cjs.map} +1 -1
- package/dist/{chunk-Y4GCJJPF.cjs → chunk-NYZQOIXJ.cjs} +35 -2
- package/dist/chunk-NYZQOIXJ.cjs.map +1 -0
- package/dist/{chunk-FHGRKQVZ.cjs → chunk-PGDR7CO3.cjs} +8 -8
- package/dist/{chunk-FHGRKQVZ.cjs.map → chunk-PGDR7CO3.cjs.map} +1 -1
- package/dist/{chunk-W7KHHNZR.js → chunk-PL7AQQV7.js} +53 -9
- package/dist/chunk-PL7AQQV7.js.map +1 -0
- package/dist/chunk-Q4YOLT4M.js +164 -0
- package/dist/chunk-Q4YOLT4M.js.map +1 -0
- package/dist/{chunk-CHS2SIP6.cjs → chunk-R5ILCNCC.cjs} +90 -76
- package/dist/chunk-R5ILCNCC.cjs.map +1 -0
- package/dist/chunk-RP4KQUNU.cjs +168 -0
- package/dist/chunk-RP4KQUNU.cjs.map +1 -0
- package/dist/{chunk-CHTZZRAL.cjs → chunk-SPU7MUWE.cjs} +6 -6
- package/dist/{chunk-CHTZZRAL.cjs.map → chunk-SPU7MUWE.cjs.map} +1 -1
- package/dist/{chunk-VPTA4Z7G.js → chunk-ST7OBB5J.js} +5 -5
- package/dist/{chunk-VPTA4Z7G.js.map → chunk-ST7OBB5J.js.map} +1 -1
- package/dist/{chunk-TPQJKS7D.js → chunk-V5NLQ4L5.js} +21 -7
- package/dist/{chunk-CHS2SIP6.cjs.map → chunk-V5NLQ4L5.js.map} +1 -1
- package/dist/{chunk-QYU7J5EQ.js → chunk-V6OXSXIX.js} +29 -18
- package/dist/chunk-V6OXSXIX.js.map +1 -0
- package/dist/{chunk-T2OVDF2M.cjs → chunk-WQMPIURW.cjs} +6 -6
- package/dist/{chunk-T2OVDF2M.cjs.map → chunk-WQMPIURW.cjs.map} +1 -1
- package/dist/{chunk-67CMMTLN.cjs → chunk-WZG6GZIL.cjs} +4 -4
- package/dist/{chunk-67CMMTLN.cjs.map → chunk-WZG6GZIL.cjs.map} +1 -1
- package/dist/{chunk-36VWLB4J.js → chunk-XJANKTIL.js} +3 -3
- package/dist/{chunk-36VWLB4J.js.map → chunk-XJANKTIL.js.map} +1 -1
- package/dist/{chunk-O7RZRUMZ.js → chunk-XJWED257.js} +14 -309
- package/dist/chunk-XJWED257.js.map +1 -0
- package/dist/chunk-XSSLNINL.js +346 -0
- package/dist/chunk-XSSLNINL.js.map +1 -0
- package/dist/{chunk-O4RPXBDZ.cjs → chunk-YD4XY74W.cjs} +8 -8
- package/dist/{chunk-O4RPXBDZ.cjs.map → chunk-YD4XY74W.cjs.map} +1 -1
- package/dist/{chunk-SXHHLZ22.js → chunk-YMZUE2IX.js} +9 -9
- package/dist/{chunk-SXHHLZ22.js.map → chunk-YMZUE2IX.js.map} +1 -1
- package/dist/{chunk-4IUE2JB7.js → chunk-Z77M7Q2R.js} +3 -3
- package/dist/{chunk-4IUE2JB7.js.map → chunk-Z77M7Q2R.js.map} +1 -1
- package/dist/{chunk-3KTWYYCN.js → chunk-ZSRXY5YT.js} +3 -3
- package/dist/{chunk-3KTWYYCN.js.map → chunk-ZSRXY5YT.js.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/captions.d.cts +1 -1
- package/dist/entries/captions.d.ts +1 -1
- package/dist/entries/credits.cjs +230 -214
- package/dist/entries/credits.d.cts +51 -14
- package/dist/entries/credits.d.ts +51 -14
- package/dist/entries/credits.js +10 -10
- package/dist/entries/entities.cjs +202 -193
- package/dist/entries/entities.d.cts +44 -9
- package/dist/entries/entities.d.ts +44 -9
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +86 -62
- package/dist/entries/llm-models.d.cts +46 -15
- package/dist/entries/llm-models.d.ts +46 -15
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +79 -63
- package/dist/entries/media.d.cts +154 -1
- package/dist/entries/media.d.ts +154 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +175 -119
- package/dist/entries/model-catalog.d.cts +4 -54
- package/dist/entries/model-catalog.d.ts +4 -54
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +491 -358
- package/dist/entries/models.d.cts +86 -7
- package/dist/entries/models.d.ts +86 -7
- package/dist/entries/models.js +6 -5
- package/dist/entries/nodes.cjs +212 -212
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +153 -153
- package/dist/entries/pipeline.d.cts +3 -3
- package/dist/entries/pipeline.d.ts +3 -3
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +174 -145
- package/dist/entries/video.d.cts +114 -2
- package/dist/entries/video.d.ts +114 -2
- package/dist/entries/video.js +7 -6
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/index.cjs +2074 -1793
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +24 -23
- package/dist/{model-catalog-Cf9fkEUp.d.ts → model-catalog-BoUKGFNl.d.cts} +167 -1
- package/dist/{model-catalog-Cf9fkEUp.d.cts → model-catalog-BoUKGFNl.d.ts} +167 -1
- package/dist/{model-constants-BxjiWVQ9.d.ts → model-constants-BElS3AeE.d.ts} +55 -6
- package/dist/{model-constants-C_Nyft_i.d.cts → model-constants-CpQz1bGa.d.cts} +55 -6
- package/dist/tts-capabilities-BtnDWK9K.d.ts +133 -0
- package/dist/tts-capabilities-C52UccTI.d.cts +133 -0
- package/package.json +1 -1
- package/src/__tests__/dialogue-capabilities.test.ts +167 -6
- package/src/__tests__/extend-providers.test.ts +87 -0
- package/src/__tests__/kling4-catalog.test.ts +1 -1
- package/src/__tests__/llm-models.test.ts +41 -4
- package/src/__tests__/speech-pricing.test.ts +62 -1
- package/src/__tests__/tts-capabilities.test.ts +160 -4
- package/src/__tests__/video-analysis-pricing.test.ts +13 -1
- package/src/__tests__/video-subjects.test.ts +192 -0
- package/src/__tests__/wired-character-names.test.ts +142 -0
- package/src/credit-estimators/index.ts +4 -0
- package/src/credit-estimators/speech.ts +57 -9
- package/src/credit-identifiers.ts +48 -13
- package/src/dialogue-capabilities.ts +220 -3
- package/src/dubbing-structure.ts +186 -0
- package/src/entries/entities.ts +2 -0
- package/src/entries/llm-models.ts +7 -0
- package/src/entries/media.ts +3 -1
- package/src/entries/model-catalog.ts +17 -0
- package/src/entries/models.ts +39 -0
- package/src/entries/video.ts +8 -1
- package/src/gemini-tts.ts +144 -0
- package/src/llm-models.ts +71 -21
- package/src/model-catalog.ts +259 -0
- package/src/model-constants.ts +101 -8
- package/src/tts-capabilities.ts +193 -1
- package/src/video-analysis-pricing.ts +11 -0
- package/src/video-character-refs.ts +160 -3
- package/src/wired-character-names.ts +134 -18
- package/src/wired-character-video-subjects.ts +63 -0
- package/dist/chunk-3AYM47GW.js.map +0 -1
- package/dist/chunk-5OBTGNUQ.cjs.map +0 -1
- package/dist/chunk-6YIV37V7.js +0 -31
- package/dist/chunk-6YIV37V7.js.map +0 -1
- package/dist/chunk-7AJGUI7L.cjs.map +0 -1
- package/dist/chunk-ACZZHHFZ.cjs.map +0 -1
- package/dist/chunk-AZNZ5WNZ.cjs.map +0 -1
- package/dist/chunk-DZ4IOP3Q.js.map +0 -1
- package/dist/chunk-IYSOVS7O.js.map +0 -1
- package/dist/chunk-KHH54GRP.cjs.map +0 -1
- package/dist/chunk-NIAFR5EE.js.map +0 -1
- package/dist/chunk-O7RZRUMZ.js.map +0 -1
- package/dist/chunk-QYU7J5EQ.js.map +0 -1
- package/dist/chunk-S3UGLZSF.js +0 -42
- package/dist/chunk-S3UGLZSF.js.map +0 -1
- package/dist/chunk-TPQJKS7D.js.map +0 -1
- package/dist/chunk-TQW3R44P.cjs +0 -38
- package/dist/chunk-TQW3R44P.cjs.map +0 -1
- package/dist/chunk-VZ6TE23U.cjs +0 -54
- package/dist/chunk-VZ6TE23U.cjs.map +0 -1
- package/dist/chunk-W6VJAUGM.cjs.map +0 -1
- package/dist/chunk-W7KHHNZR.js.map +0 -1
- package/dist/chunk-Y4GCJJPF.cjs.map +0 -1
|
@@ -638,11 +638,44 @@ function maskCompositeEffectiveAudioSource(s) {
|
|
|
638
638
|
return "background";
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
+
// src/dubbing-structure.ts
|
|
642
|
+
var DUBBING_CAPTION_FORMATS = ["srt", "vtt"];
|
|
643
|
+
var DUBBING_SOURCE_LANGUAGE = "source";
|
|
644
|
+
var DUBBING_LANGUAGE_STATUSES = ["processing", "completed", "stale", "failed"];
|
|
645
|
+
var DUBBING_ERROR_CODES = [
|
|
646
|
+
/** 422: the job is not a dub. */
|
|
647
|
+
"not_a_dubbing_job",
|
|
648
|
+
/** 409: the dub is still being made. */
|
|
649
|
+
"dubbing_not_ready",
|
|
650
|
+
/** 422: the dub was not made. */
|
|
651
|
+
"dubbing_failed",
|
|
652
|
+
/** 410: the dub is no longer held where it was made. */
|
|
653
|
+
"dubbing_unavailable",
|
|
654
|
+
/** 404: the dub has no such language. */
|
|
655
|
+
"dubbing_language_not_found",
|
|
656
|
+
/** 409: that language is still being made. */
|
|
657
|
+
"dubbing_language_processing",
|
|
658
|
+
/** 422: that language has no captions to export. */
|
|
659
|
+
"dubbing_captions_unavailable",
|
|
660
|
+
/** 409: the dub already speaks that language. */
|
|
661
|
+
"dubbing_language_exists",
|
|
662
|
+
/** 422: the length of the dub cannot be read, so a language cannot be priced. */
|
|
663
|
+
"unreadable_dubbing_source",
|
|
664
|
+
/** 413: the dub is longer than 30 minutes, so a language cannot be added to it. */
|
|
665
|
+
"media_duration_exceeds_limit",
|
|
666
|
+
/** 502: the dubbing service did not answer. */
|
|
667
|
+
"dubbing_read_failed"
|
|
668
|
+
];
|
|
669
|
+
|
|
641
670
|
exports.AUDIO_FX_PRESETS = AUDIO_FX_PRESETS;
|
|
642
671
|
exports.AUDIO_FX_PRESET_LABELS = AUDIO_FX_PRESET_LABELS;
|
|
643
672
|
exports.AUDIO_FX_PRESET_SET = AUDIO_FX_PRESET_SET;
|
|
644
673
|
exports.AUDIO_FX_REVERB_PRESETS = AUDIO_FX_REVERB_PRESETS;
|
|
645
674
|
exports.DEFAULT_VIDEO_MASK_PROVIDER = DEFAULT_VIDEO_MASK_PROVIDER;
|
|
675
|
+
exports.DUBBING_CAPTION_FORMATS = DUBBING_CAPTION_FORMATS;
|
|
676
|
+
exports.DUBBING_ERROR_CODES = DUBBING_ERROR_CODES;
|
|
677
|
+
exports.DUBBING_LANGUAGE_STATUSES = DUBBING_LANGUAGE_STATUSES;
|
|
678
|
+
exports.DUBBING_SOURCE_LANGUAGE = DUBBING_SOURCE_LANGUAGE;
|
|
646
679
|
exports.FREECUT_EXPORT_COMPLETE = FREECUT_EXPORT_COMPLETE;
|
|
647
680
|
exports.FREECUT_EXPORT_PROGRESS = FREECUT_EXPORT_PROGRESS;
|
|
648
681
|
exports.FREECUT_READY = FREECUT_READY;
|
|
@@ -700,5 +733,5 @@ exports.videoFaceMeshPartsOfLayers = videoFaceMeshPartsOfLayers;
|
|
|
700
733
|
exports.videoMaskBilledSeconds = videoMaskBilledSeconds;
|
|
701
734
|
exports.videoMaskCreditId = videoMaskCreditId;
|
|
702
735
|
exports.videoMaskCreditIds = videoMaskCreditIds;
|
|
703
|
-
//# sourceMappingURL=chunk-
|
|
704
|
-
//# sourceMappingURL=chunk-
|
|
736
|
+
//# sourceMappingURL=chunk-NYZQOIXJ.cjs.map
|
|
737
|
+
//# sourceMappingURL=chunk-NYZQOIXJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/freecut-protocol.ts","../src/inpaint-region.ts","../src/lottie-slots.ts","../src/lottie-overlay-catalog.ts","../src/audio-fx-presets.ts","../src/video-mask.ts","../src/video-face-mesh.ts","../src/generate-mask.ts","../src/mask-composite.ts","../src/dubbing-structure.ts"],"names":["clamp01","copy","pricedClipSeconds"],"mappings":";;;;;AAMO,IAAM,iBAAA,GAAoB;AAI1B,IAAM,oBAAA,GAAuB;AAC7B,IAAM,mBAAA,GAAsB;AAC5B,IAAM,oBAAA,GAAuB;AAG7B,IAAM,aAAA,GAAgB;AACtB,IAAM,uBAAA,GAA0B;AAChC,IAAM,uBAAA,GAA0B;AAChC,IAAM,sBAAA,GAAyB;;;ACPtC,SAAS,KAAK,MAAA,EAAwC;AACpD,EAAA,IAAI,MAAA,GAAS,CAAA,GAAI,CAAA,EAAG,OAAO,KAAA;AAC3B,EAAA,IAAI,MAAA,GAAS,CAAA,GAAI,CAAA,EAAG,OAAO,MAAA;AAC3B,EAAA,OAAO,KAAA;AACT;AAEA,IAAM,OAAO,EAAE,GAAA,EAAK,SAAS,GAAA,EAAK,QAAA,EAAU,MAAM,OAAA,EAAQ;AAC1D,IAAM,OAAO,EAAE,GAAA,EAAK,QAAQ,GAAA,EAAK,QAAA,EAAU,MAAM,OAAA,EAAQ;AAQlD,SAAS,kBAAA,CAAmB,KAAe,KA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IAAI,OAAA,GAAU,kBAAA;AAC5E;AAQO,SAAS,kCAAkC,CAAA,EAAkF;AAClI,EAAA,IAAI,2BAAA,CAA4B,CAAA,CAAE,IAAI,CAAA,SAAU,CAAA,CAAE,WAAA;AAClD,EAAA,OAAO,YAAA;AACT;;;ACrKO,IAAM,uBAAA,GAA0B,CAAC,KAAA,EAAO,KAAK;AAI7C,IAAM,uBAAA,GAA0B;AAShC,IAAM,yBAAA,GAA4B,CAAC,YAAA,EAAc,WAAA,EAAa,SAAS,QAAQ;AAgI/E,IAAM,mBAAA,GAAsB;AAAA;AAAA,EAEjC,mBAAA;AAAA;AAAA,EAEA,mBAAA;AAAA;AAAA,EAEA,gBAAA;AAAA;AAAA,EAEA,qBAAA;AAAA;AAAA,EAEA,4BAAA;AAAA;AAAA,EAEA,6BAAA;AAAA;AAAA,EAEA,8BAAA;AAAA;AAAA,EAEA,yBAAA;AAAA;AAAA,EAEA,2BAAA;AAAA;AAAA,EAEA,8BAAA;AAAA;AAAA,EAEA;AACF","file":"chunk-NYZQOIXJ.cjs","sourcesContent":["// Single source of truth for the Nodaro <-> FreeCut iframe postMessage protocol.\n// Imported by app's freecut-editor-modal and Studio's ported modal so the wire\n// format cannot drift. The fork (Nodaro-ai/freecut-fork) mirrors these strings in\n// src/features/embedded/services/embedded-message-handler.ts + use-send-back.ts.\n\n// Nodaro (parent) -> FreeCut (iframe)\nexport const NODARO_LOAD_VIDEO = \"NODARO_LOAD_VIDEO\"\n// Multi-clip analog of NODARO_LOAD_VIDEO: lay N ordered urls on the timeline as\n// sequential clips (FreeCut fetches them itself). Used by Studio's production\n// \"Edit in FreeCut\" to assemble the whole cut.\nexport const NODARO_LOAD_TIMELINE = \"NODARO_LOAD_TIMELINE\"\nexport const NODARO_IMPORT_FILES = \"NODARO_IMPORT_FILES\"\nexport const NODARO_RESET_PROJECT = \"NODARO_RESET_PROJECT\"\n\n// FreeCut (iframe) -> Nodaro (parent)\nexport const FREECUT_READY = \"FREECUT_READY\"\nexport const FREECUT_EXPORT_COMPLETE = \"FREECUT_EXPORT_COMPLETE\"\nexport const FREECUT_EXPORT_PROGRESS = \"FREECUT_EXPORT_PROGRESS\" // reserved; fork emits it, v1 parents ignore it\nexport const FREECUT_REQUEST_IMPORT = \"FREECUT_REQUEST_IMPORT\"\n\nexport interface FreecutImportFile {\n readonly name: string\n readonly type: string\n readonly size: number\n readonly buffer: ArrayBuffer\n}\n\nexport interface NodaroLoadVideoPayload {\n readonly videoUrl: string\n /** Display/file name for the primary video (\"Shot 1.mp4\") — optional; absent = URL-derived name (fork default). */\n readonly videoName?: string\n readonly videoBuffer?: ArrayBuffer\n readonly projectJson?: unknown\n readonly additionalFiles?: ReadonlyArray<FreecutImportFile>\n /**\n * What the editor's Save & Exit hands back. \"video\": it renders the timeline\n * and answers with FREECUT_EXPORT_COMPLETE (the video and the project JSON),\n * for a parent that keeps an edit as a new video (the workflow editor).\n * Absent or \"project\": it answers with the project JSON alone\n * (FREECUT_SAVE_EXIT), for a parent that renders the cut itself (Studio).\n */\n readonly saveExit?: \"video\" | \"project\"\n}\n\nexport interface NodaroLoadTimelinePayload {\n // Ordered clip urls; FreeCut fetches each and lays them end-to-end on the timeline.\n readonly clips: ReadonlyArray<string>\n}\n\nexport interface FreecutExportCompletePayload {\n readonly videoBuffer: ArrayBuffer\n readonly projectJson?: unknown\n}\n\nexport interface FreecutExportProgressPayload {\n readonly percent: number\n}\n\nexport interface FreecutRequestImportPayload {\n readonly accept?: string\n readonly multiple?: boolean\n}\n","export interface PixelBox { x: number; y: number; width: number; height: number }\n\nexport interface MaskRegionDescriptor {\n /** bbox normalized to 0..1 against the image, clamped so x+width ≤ 1 and y+height ≤ 1. */\n normBbox: PixelBox\n /** Natural-language location, e.g. \"the upper-left region\" / \"the center\". */\n location: string\n /** Prompt fragment to PREPEND to the user instruction. */\n fragment: string\n}\n\nfunction band(center: number): \"low\" | \"mid\" | \"high\" {\n if (center < 1 / 3) return \"low\"\n if (center > 2 / 3) return \"high\"\n return \"mid\"\n}\n\nconst VERT = { low: \"upper\", mid: \"middle\", high: \"lower\" } as const\nconst HORZ = { low: \"left\", mid: \"center\", high: \"right\" } as const\n\n/**\n * Turn a pixel bounding box of the masked (edit) region into a normalized bbox\n * + natural-language location + a prompt fragment. Pure — no IO. This is the\n * Tier-B descriptor injected for strong instruction-following editors, and the\n * exact primitive Phase 2 (named regions) will reuse.\n */\nexport function describeMaskRegion(box: PixelBox, image: { width: number; height: number }): MaskRegionDescriptor {\n const clamp01 = (n: number) => Math.max(0, Math.min(1, n))\n const round2 = (n: number) => Math.round(n * 100) / 100\n const nx = clamp01(box.x / image.width)\n const ny = clamp01(box.y / image.height)\n const normBbox: PixelBox = {\n x: round2(nx),\n y: round2(ny),\n width: round2(Math.max(0, Math.min(1 - nx, box.width / image.width))),\n height: round2(Math.max(0, Math.min(1 - ny, box.height / image.height))),\n }\n\n const cx = (box.x + box.width / 2) / image.width\n const cy = (box.y + box.height / 2) / image.height\n const v = VERT[band(cy)]\n const h = HORZ[band(cx)]\n const location = v === \"middle\" && h === \"center\" ? \"the center\" : `the ${v}-${h} region`\n\n const fragment =\n `Apply the following change ONLY to ${location} of the image ` +\n `(normalized region x=${normBbox.x} y=${normBbox.y} w=${normBbox.width} h=${normBbox.height}), ` +\n `leaving everything else unchanged: `\n\n return { normBbox, location, fragment }\n}\n","/**\n * Lottie slot substitution — single source of truth (design §5).\n *\n * A slotted property is an object containing a `sid` key (canonically exactly\n * `{\"sid\": \"name\"}`; tolerantly also the annotation form `{a, k, sid}`). The\n * slot manifest maps sid → { p: <whatever belongs at the reference position> }.\n * Overrides map sid → raw value (what UI controls write).\n *\n * KEY CONVENTION: a slot's `p` is, by design, EXACTLY what belongs at the\n * reference position — and we substitute it VERBATIM, never auto-wrapping it in\n * an `{a:0,k:...}` envelope. At a property position (a fill color, a shape size)\n * that means `p` is a property object like `{\"a\":0,\"k\":[1,0,0,1]}`. At a RAW\n * position inside a text document — `layers[].t.d.k[0].s.t`, where lottie-web's\n * `buildFinalText` iterates string characters — `p` is a BARE string, e.g.\n * `{ \"nameText\": { \"p\": \"John Smith\" } }` substitutes the string `\"John Smith\"`\n * straight onto `s.t`. (Auto-wrapping there produced `{a:0,k:\"John Smith\"}` and\n * broke text rendering — the defect this contract fixes.)\n *\n * An override is wrapped ONLY when it lands on a property-object default: the\n * `{...p, k: override}` form preserves the default's envelope (animated/static\n * flags). On a raw default (or a missing slot) the override is substituted\n * verbatim too — so a raw text override stays a bare string.\n *\n * Substitution is renderer-agnostic: we replace every sid node ourselves and\n * never rely on lottie-web's version-dependent native slot support.\n */\n\ntype JsonRecord = Record<string, unknown>\n\nfunction isPlainObject(v: unknown): v is JsonRecord {\n return typeof v === \"object\" && v !== null && !Array.isArray(v)\n}\n\n/** True when `p` already looks like a lottie animated-property object. */\nfunction isPropertyObject(v: unknown): v is JsonRecord {\n return isPlainObject(v) && \"k\" in v\n}\n\nfunction resolveSlotNode(\n node: JsonRecord,\n slots: JsonRecord,\n overrides: JsonRecord,\n): unknown {\n const sid = node.sid as string\n const slot = slots[sid]\n const slotP = isPlainObject(slot) ? (slot as JsonRecord).p : undefined\n const override = overrides[sid]\n\n if (override !== undefined) {\n // Wrap into the default's property-object envelope when the default IS one\n // (preserves animated/static flags); otherwise substitute the raw override\n // verbatim — a raw text override must stay a bare string at `s.t`.\n if (isPropertyObject(slotP)) return { ...slotP, k: structuredClone(override) }\n return structuredClone(override)\n }\n if (slotP !== undefined) {\n // `p` is by convention exactly what belongs at the reference position —\n // substitute it verbatim, never auto-wrap (a bare string stays a string).\n return structuredClone(slotP)\n }\n // No slot, no override — leave the node as-is (validator rule #6 should\n // prevent this; belt-and-braces for hand-fed documents).\n return node\n}\n\nfunction walk(value: unknown, slots: JsonRecord, overrides: JsonRecord): unknown {\n if (Array.isArray(value)) {\n return value.map((item) => walk(item, slots, overrides))\n }\n if (isPlainObject(value)) {\n if (typeof value.sid === \"string\") {\n const resolved = resolveSlotNode(value, slots, overrides)\n // The original node comes back only in the missing-slot case; replacements\n // are leaf property objects and need no further walking.\n if (resolved === value) {\n const copy: JsonRecord = {}\n for (const [k, v] of Object.entries(value)) copy[k] = walk(v, slots, overrides)\n return copy\n }\n return resolved\n }\n const copy: JsonRecord = {}\n for (const [k, v] of Object.entries(value)) copy[k] = walk(v, slots, overrides)\n return copy\n }\n return value\n}\n\n/** Pure: returns a new document; never mutates inputs. */\nexport function applySlots(\n lottie: JsonRecord,\n slots: JsonRecord | undefined,\n overrides: JsonRecord | undefined,\n): JsonRecord {\n return walk(lottie, slots ?? {}, overrides ?? {}) as JsonRecord\n}\n\n// ── Playback normalization ───────────────────────────────────────────────────\n//\n// lottie-web computes a layer's local time as `frame - layer.st` and gates the\n// layer on `local >= ip && local < op`. A layer missing `st` yields NaN, fails\n// the gate, and stays `display:none` forever — the document \"loads\" (DOMLoaded\n// fires) but every frame renders blank (prod incident 2026-06-12: all authored\n// lottie renders came out as empty frames in headless Chrome). `st` and `sr`\n// are spec-optional with defaults, so documents routinely omit them; complete\n// them at the playback boundary so any source — authored plan, baked export,\n// catalog asset, external URL — renders. Mutates `doc` in place and returns it\n// (callers pass freshly fetched or freshly copied documents).\n\nexport function normalizeLottieLayers<T>(doc: T): T {\n if (!isPlainObject(doc)) return doc\n const fix = (layers: unknown): void => {\n if (!Array.isArray(layers)) return\n for (const layer of layers) {\n if (!isPlainObject(layer)) continue\n if (typeof layer.st !== \"number\") layer.st = 0\n if (typeof layer.sr !== \"number\") layer.sr = 1\n }\n }\n fix((doc as JsonRecord).layers)\n const assets = (doc as JsonRecord).assets\n if (Array.isArray(assets)) {\n for (const asset of assets) {\n if (isPlainObject(asset)) fix(asset.layers)\n }\n }\n return doc\n}\n\n// ── Slot control descriptors (Phase 2 — UI mapping) ──────────────────────────\n//\n// A slot manifest entry is `{ p: <whatever belongs at the reference position> }`\n// (Amendment 1). `describeSlotControl` unwraps that envelope to the editable raw\n// value and classifies it into the control kind the config panel should render.\n// `p` is either a property object `{a, k}` (colors, sizes, scalars) whose `k`\n// holds the value, or a bare raw value (text strings live unwrapped at `s.t`).\n\nexport type SlotControlKind = \"color\" | \"text\" | \"number\" | \"point\"\nexport interface SlotControlDescriptor {\n kind: SlotControlKind\n value: unknown\n}\n\n/**\n * Unwraps a slot entry to its editable raw value and classifies it:\n * {p:{a:0,k:[1,0,0,1]}} → { kind:\"color\", value:[1,0,0,1] }\n * {p:\"John\"} → { kind:\"text\", value:\"John\" }\n * {p:{a:0,k:42}} → { kind:\"number\", value:42 }\n * {p:{a:0,k:[10,20]}} → { kind:\"point\", value:[10,20] }\n * Animated property objects (`a:1`) and anything that doesn't map to a known\n * control kind return null (no editable control).\n */\nexport function describeSlotControl(slot: unknown): SlotControlDescriptor | null {\n if (!isPlainObject(slot)) return null\n const p = (slot as JsonRecord).p\n let value: unknown = p\n if (isPropertyObject(p)) {\n if ((p as JsonRecord).a === 1) return null\n value = (p as JsonRecord).k\n }\n if (typeof value === \"string\") return { kind: \"text\", value }\n if (typeof value === \"number\") return { kind: \"number\", value }\n if (\n Array.isArray(value) &&\n value.length === 4 &&\n value.every((n) => typeof n === \"number\" && n >= 0 && n <= 1)\n ) {\n return { kind: \"color\", value }\n }\n if (Array.isArray(value) && value.length === 2 && value.every((n) => typeof n === \"number\")) {\n return { kind: \"point\", value }\n }\n return null\n}\n\nfunction clamp01(n: number): number {\n if (Number.isNaN(n)) return 0\n return n < 0 ? 0 : n > 1 ? 1 : n\n}\n\nfunction toHexByte(component: number): string {\n return Math.round(clamp01(component) * 255)\n .toString(16)\n .padStart(2, \"0\")\n}\n\n/**\n * RGBA array (components 0..1) → hex string. The alpha component is omitted\n * when it is exactly 1 (`[1,0,0,1]` → `\"#ff0000\"`); otherwise an 8-digit hex is\n * emitted (`[0,1,0,0.5]` → `\"#00ff0080\"`). Output is always lowercase.\n */\nexport function rgbaArrayToHex(rgba: number[]): string {\n const [r = 0, g = 0, b = 0, a = 1] = rgba\n const base = `#${toHexByte(r)}${toHexByte(g)}${toHexByte(b)}`\n return a >= 1 ? base : `${base}${toHexByte(a)}`\n}\n\n/**\n * Hex string → RGBA array (components 0..1). Accepts `#rgb`, `#rrggbb`, and\n * `#rrggbbaa`; alpha defaults to 1 when absent. Leading `#` is optional.\n */\nexport function hexToRgbaArray(hex: string): number[] {\n let h = hex.trim().replace(/^#/, \"\")\n if (h.length === 3) {\n h = h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n }\n const r = parseInt(h.slice(0, 2), 16) / 255\n const g = parseInt(h.slice(2, 4), 16) / 255\n const b = parseInt(h.slice(4, 6), 16) / 255\n const a = h.length >= 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1\n return [r, g, b, a]\n}\n\n/** Manifest sids in insertion order (drives the slot-control list ordering). */\nexport function listSlotSids(slots: Record<string, unknown>): string[] {\n return Object.keys(slots ?? {})\n}\n\n// ── Slot → app-field derivation (Phase 3 — single source of truth) ────────────\n//\n// `deriveLottieSlotFields` turns a lottie-graphic plan's slot manifest into\n// ExposableField-shaped descriptors. ONE function feeds three surfaces: the\n// editor's publish picker, the published-app runtime, and the backend MCP\n// schema extractor — so the set of slots an app exposes can never drift between\n// them. It deliberately mirrors `describeSlotControl`'s classification (the\n// editor's live slot controls use the same source of truth).\n\n/** Prefix for the synthetic field key of a derived slot field: `slot:<sid>`. */\nexport const LOTTIE_SLOT_FIELD_PREFIX = \"slot:\"\n\n/** \"primaryColor\" → \"Primary Color\"; \"bar_size\" → \"Bar Size\". */\nexport function humanizeSlotSid(sid: string): string {\n return sid\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim()\n .replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\n/** ExposableField-shaped descriptor derived from one slot. */\nexport interface LottieSlotField {\n /** Synthetic field key: `slot:<sid>`. */\n key: string\n /** Humanized sid (camelCase / snake_case → Title Case). */\n label: string\n /** Maps onto the `ExposableField.type` members used in apps. */\n type: \"color\" | \"text\" | \"slider\"\n min?: number\n max?: number\n step?: number\n /** Hex string for color; raw value for text/number. */\n defaultValue?: unknown\n}\n\n/**\n * Derive ExposableField-shaped descriptors from a motion-graphics node's plan.\n *\n * Returns [] unless `motionPlan.planType === \"lottie-graphic\"` and `slots` is a\n * non-empty object — the elements engine and absent plans expose nothing.\n *\n * Per slot, via `describeSlotControl`:\n * - color → `{ type: \"color\", defaultValue: rgbaArrayToHex(value) }`\n * - text → `{ type: \"text\", defaultValue: value }`\n * - number → `{ type: \"slider\", min, max, step, defaultValue: value }`\n * (0–1 values → 0..1 step 0.01; larger → 0..ceil(value*2) step 1)\n * - point / null → SKIPPED. Point-kind slots are intentionally not exposed in\n * apps (no paired-number card; positions are rarely end-user-meaningful).\n */\nexport function deriveLottieSlotFields(\n motionPlan: Record<string, unknown> | undefined,\n): LottieSlotField[] {\n if (!motionPlan || motionPlan.planType !== \"lottie-graphic\") return []\n const slots = motionPlan.slots\n if (!isPlainObject(slots)) return []\n\n const fields: LottieSlotField[] = []\n for (const [sid, slot] of Object.entries(slots)) {\n const control = describeSlotControl(slot)\n if (!control) continue\n const base = { key: `${LOTTIE_SLOT_FIELD_PREFIX}${sid}`, label: humanizeSlotSid(sid) }\n\n if (control.kind === \"color\") {\n fields.push({\n ...base,\n type: \"color\",\n defaultValue: rgbaArrayToHex(control.value as number[]),\n })\n } else if (control.kind === \"text\") {\n fields.push({ ...base, type: \"text\", defaultValue: control.value })\n } else if (control.kind === \"number\") {\n const value = Number(control.value)\n const isUnit = value <= 1\n fields.push({\n ...base,\n type: \"slider\",\n min: 0,\n max: isUnit ? 1 : Math.ceil(value * 2) || 100,\n step: isUnit ? 0.01 : 1,\n defaultValue: control.value,\n })\n }\n // point / unrecognized kinds are intentionally not exposed.\n }\n return fields\n}\n","/**\n * Built-in Lottie Overlay catalog — single source of truth.\n *\n * The Lottie Overlay node ships a curated set of 12 animations the overlay LLM\n * can pick from. They were originally served from the third-party lottie.host\n * CDN, which went dead (origin returns 403) and broke every catalog-based\n * overlay render in production. The replacements were authored with our own\n * Lottie engine, baked (slots resolved, no `sid` refs), and are now self-hosted\n * on the Nodaro CDN at `https://cdn.nodaro.ai/lottie-catalog/<slug>.json`.\n *\n * This module is the ONE place the catalog lives:\n * - `LOTTIE_OVERLAY_CATALOG` feeds the overlay system prompt (the LLM's menu).\n * - `LEGACY_LOTTIE_HOST_REMAP` + `resolveLottieOverlaySrc` heal saved overlay\n * plans at render time — a plan authored before the cut-over still points at\n * a dead lottie.host URL, so the renderer rewrites it to its self-hosted\n * replacement before fetching.\n */\n\nexport interface LottieOverlayCatalogEntry {\n /** Stable system key — the R2 object is `lottie-catalog/<slug>.json`. */\n readonly slug: string\n /** Display name — mirrors the original prompt's catalog labels. */\n readonly name: string\n /** Catalog group (drives the grouped layout in the system prompt). */\n readonly group:\n | \"Celebration\"\n | \"Social / Reactions\"\n | \"UI / Indicators\"\n | \"Ambient / Decorative\"\n /** One placement-intent line for the overlay LLM. */\n readonly description: string\n /** Public CDN URL: `https://cdn.nodaro.ai/lottie-catalog/<slug>.json`. */\n readonly url: string\n /** Whether the animation is continuous (loop) or a one-shot effect. */\n readonly loop: boolean\n}\n\nconst CDN_BASE = \"https://cdn.nodaro.ai/lottie-catalog\"\n\nexport const LOTTIE_OVERLAY_CATALOG: readonly LottieOverlayCatalogEntry[] = [\n // ── Celebration ────────────────────────────────────────────────────────────\n {\n slug: \"confetti-burst\",\n name: \"Confetti burst\",\n group: \"Celebration\",\n description: \"Multicolor confetti shower — large coverage at a celebratory peak; one-shot.\",\n url: `${CDN_BASE}/confetti-burst.json`,\n loop: false,\n },\n {\n slug: \"fireworks\",\n name: \"Fireworks\",\n group: \"Celebration\",\n description: \"Bursting fireworks against the sky — big-moment payoff over the upper frame; one-shot.\",\n url: `${CDN_BASE}/fireworks.json`,\n loop: false,\n },\n {\n slug: \"party-popper\",\n name: \"Party popper\",\n group: \"Celebration\",\n description: \"Party popper streamers from a corner — a quick celebratory accent; one-shot.\",\n url: `${CDN_BASE}/party-popper.json`,\n loop: false,\n },\n {\n slug: \"stars-sparkle\",\n name: \"Stars sparkle\",\n group: \"Celebration\",\n description: \"Twinkling stars/sparkles — small accent over a highlight; loops.\",\n url: `${CDN_BASE}/stars-sparkle.json`,\n loop: true,\n },\n // ── Social / Reactions ──────────────────────────────────────────────────────\n {\n slug: \"heart-pulse\",\n name: \"Heart pulse\",\n group: \"Social / Reactions\",\n description: \"Pulsing heart reaction — medium size at a corner or edge; loops.\",\n url: `${CDN_BASE}/heart-pulse.json`,\n loop: true,\n },\n {\n slug: \"thumbs-up\",\n name: \"Thumbs up\",\n group: \"Social / Reactions\",\n description: \"Thumbs-up approval reaction — medium size, pops in once; one-shot.\",\n url: `${CDN_BASE}/thumbs-up.json`,\n loop: false,\n },\n {\n slug: \"fire-flame\",\n name: \"Fire emoji\",\n group: \"Social / Reactions\",\n description: \"Flickering flame reaction (“this is fire”) — small size at an edge; loops.\",\n url: `${CDN_BASE}/fire-flame.json`,\n loop: true,\n },\n // ── UI / Indicators ─────────────────────────────────────────────────────────\n {\n slug: \"loading-spinner\",\n name: \"Loading spinner\",\n group: \"UI / Indicators\",\n description: \"Circular loading spinner — small, centered, signals progress; loops.\",\n url: `${CDN_BASE}/loading-spinner.json`,\n loop: true,\n },\n {\n slug: \"checkmark-success\",\n name: \"Checkmark success\",\n group: \"UI / Indicators\",\n description: \"Animated success checkmark — small, marks a completed/correct moment; one-shot.\",\n url: `${CDN_BASE}/checkmark-success.json`,\n loop: false,\n },\n {\n slug: \"arrow-pointer\",\n name: \"Arrow pointer\",\n group: \"UI / Indicators\",\n description: \"Animated arrow drawing attention to a spot — small, timed to a key area; loops.\",\n url: `${CDN_BASE}/arrow-pointer.json`,\n loop: true,\n },\n // ── Ambient / Decorative ────────────────────────────────────────────────────\n {\n slug: \"floating-particles\",\n name: \"Floating particles\",\n group: \"Ambient / Decorative\",\n description: \"Soft drifting particles — large coverage, low opacity, full-duration ambience; loops.\",\n url: `${CDN_BASE}/floating-particles.json`,\n loop: true,\n },\n {\n slug: \"glowing-ring\",\n name: \"Glowing ring\",\n group: \"Ambient / Decorative\",\n description: \"Pulsing glowing ring/halo — decorative accent around a focal point; loops.\",\n url: `${CDN_BASE}/glowing-ring.json`,\n loop: true,\n },\n] as const\n\n/**\n * Dead lottie.host URLs (origin returns 403) → their replacement catalog URLs.\n * Heals saved plans at render time. The keys are copied EXACTLY from the\n * original `lottie-overlay-system.ts` prompt — they are the literal `src`\n * strings the overlay LLM emitted before the cut-over.\n */\nexport const LEGACY_LOTTIE_HOST_REMAP: Readonly<Record<string, string>> = {\n // Celebration\n \"https://lottie.host/d7313e87-e4c9-4e0d-8e03-c3a59e87d8fb/TjHnrCGBjI.json\": `${CDN_BASE}/confetti-burst.json`,\n \"https://lottie.host/d5cad0dd-4e93-4bbe-b023-e94a04bc1581/JHEZMrqfMk.json\": `${CDN_BASE}/fireworks.json`,\n \"https://lottie.host/0060c9cd-75da-42d5-af7c-1a191fa8a8fd/c1xHMRnGTO.json\": `${CDN_BASE}/party-popper.json`,\n \"https://lottie.host/c04a2758-a1d9-40a9-b81f-6f3e4e13a88c/xKCYDU2w0O.json\": `${CDN_BASE}/stars-sparkle.json`,\n // Social / Reactions\n \"https://lottie.host/44c9e8d1-856c-4641-bfbe-d0e2a5c9850e/GIBsMSIkkq.json\": `${CDN_BASE}/heart-pulse.json`,\n \"https://lottie.host/9a611d56-1f35-4f51-9fa4-6a4daa6b8714/EH71MjHKPD.json\": `${CDN_BASE}/thumbs-up.json`,\n \"https://lottie.host/66db1de9-c1a8-4d0b-bb03-47a8932a8a86/q5JBGQ8fxu.json\": `${CDN_BASE}/fire-flame.json`,\n // UI / Indicators\n \"https://lottie.host/b03d748c-3b4a-4c07-a10c-e9eb3c967349/eMVAVEnb5x.json\": `${CDN_BASE}/loading-spinner.json`,\n \"https://lottie.host/3ffaab4a-58b0-4a72-9f1c-5eaa484d8c88/g27v7IPaJc.json\": `${CDN_BASE}/checkmark-success.json`,\n \"https://lottie.host/6f831c6e-693a-4d1d-90a0-d7e2b3f00e68/PFj0MwSPrj.json\": `${CDN_BASE}/arrow-pointer.json`,\n // Ambient / Decorative\n \"https://lottie.host/9c8e1aef-f8e5-4ce8-bc80-1647ffb0724d/mNDClfKJVB.json\": `${CDN_BASE}/floating-particles.json`,\n \"https://lottie.host/b5d3e7e7-40bc-44fa-9a53-78b98ad66e80/pQVdNsVDmQ.json\": `${CDN_BASE}/glowing-ring.json`,\n}\n\n/**\n * Resolve an overlay `src` through the legacy remap: a dead lottie.host URL is\n * rewritten to its self-hosted replacement; everything else (already-migrated\n * catalog URLs, user-provided assets) passes through unchanged.\n */\nexport function resolveLottieOverlaySrc(src: string): string {\n return LEGACY_LOTTIE_HOST_REMAP[src] ?? src\n}\n","/**\n * Audio FX node — preset id union (single source of truth).\n *\n * Shared so the backend Zod route enum, the frontend config dropdown, and the\n * `AudioFxData` node type can't drift. The per-preset FFmpeg filter chains\n * (IR DUR/SHAPE, delay/EQ knobs) live in the backend provider's PRESET_CHAINS\n * map — this file only fixes the id set + their human labels.\n *\n * Reverb presets are named by ON-SCREEN SCENARIO (where the voice is happening\n * in the scene) rather than abstract size, so a creator picking \"Church\" or\n * \"Car\" gets a believable space for that shot.\n */\n\nexport const AUDIO_FX_PRESETS = [\n // — reverb / spaces (afir + inline-synth IR), ordered small → large —\n \"room\", // ordinary indoor room — bedroom / office dialogue\n \"bathroom\", // small, bright, tiled — hard early reflections\n \"car\", // tight, very damped cabin\n \"hall\", // lobby / corridor / large room\n \"concert-hall\", // big, lush, musical tail\n \"church\", // cathedral — long, dark, reverberant\n \"cave\", // dark, diffuse, long\n \"arena\", // stadium / PA — huge, bright tail\n \"outdoor\", // open air — almost dry, faint early reflections\n // — character / non-reverb —\n \"telephone\", // band-limited phone line\n \"megaphone\", // PA / bullhorn — mid-forward + light grit\n \"echo\", // discrete echo / slap-back\n \"custom\", // manual: reverb wet · delay · EQ\n] as const\n\nexport type AudioFxPreset = (typeof AUDIO_FX_PRESETS)[number]\n\nexport const AUDIO_FX_PRESET_SET: ReadonlySet<string> = new Set(AUDIO_FX_PRESETS)\n\n/** Display labels for the config dropdown. */\nexport const AUDIO_FX_PRESET_LABELS: Record<AudioFxPreset, string> = {\n room: \"Room (indoor)\",\n bathroom: \"Bathroom\",\n car: \"Car interior\",\n hall: \"Hall / Lobby\",\n \"concert-hall\": \"Concert Hall\",\n church: \"Church\",\n cave: \"Cave\",\n arena: \"Arena / Stadium\",\n outdoor: \"Outdoor (open air)\",\n telephone: \"Telephone\",\n megaphone: \"Megaphone / PA\",\n echo: \"Echo / Slap-back\",\n custom: \"Custom\",\n}\n\n/** Presets that apply convolution reverb (afir + inline-synth IR). */\nexport const AUDIO_FX_REVERB_PRESETS: ReadonlySet<AudioFxPreset> = new Set<AudioFxPreset>([\n \"room\",\n \"bathroom\",\n \"car\",\n \"hall\",\n \"concert-hall\",\n \"church\",\n \"cave\",\n \"arena\",\n \"outdoor\",\n])\n","/**\n * Video Mask — text-prompted video segmentation (SAM 3.1 / SAM 3). The wire contract of\n * the `video-mask` node, `POST /v1/video-mask`, the `video_mask` MCP verb,\n * `client.media.videoMask` and `nodaro media video-mask`, defined ONCE:\n * - every bound the route schema, the node panel and the MCP verb read;\n * - `videoMaskBilledSeconds`: the length a run is priced at — the clip's\n * length at the 30 fps basis, so a 60 fps clip is priced at twice its\n * length (the segmentation works per FRAME);\n * - `videoMaskCreditId`: which price row (`model_pricing`) that length is\n * charged from. The credit amounts live in the rows, never here.\n *\n * Worked examples (repeated in docs/nodes/ai-video/video-mask.md):\n * 4 s at 30 fps → `sam-3.1-video:5s`, 5.005 s at 29.97 fps → `sam-3.1-video:5s`, 12 s at 24 fps → `sam-3.1-video:15s`,\n * 10 s at 60 fps (priced as 20 s) → `sam-3.1-video:30s`, 45 s at 30 fps → `sam-3.1-video:60s`,\n * 100 s at 30 fps → `sam-3.1-video:120s`, 4 min at 30 fps on SAM 3 → `sam-3-video:240s`.\n *\n * Wire contract only — no I/O.\n */\nimport { pricedClipSeconds } from \"./priced-clip-seconds.js\"\n\n/** Segmentation models a Video Mask run can use. SAM 3.1 (the default)\n * tracks several objects in one pass and runs faster; SAM 3 costs half. */\nexport const VIDEO_MASK_PROVIDERS = [\"sam-3.1\", \"sam-3\"] as const\nexport type VideoMaskProvider = (typeof VIDEO_MASK_PROVIDERS)[number]\nexport const DEFAULT_VIDEO_MASK_PROVIDER: VideoMaskProvider = \"sam-3.1\"\n\n/**\n * `zone`: keep only the subjects whose bounding-box CENTRE lies inside an\n * inner rectangle, given as margins in % of the frame (each\n * `VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN`–`ZONE_MARGIN_PCT_MAX`). All zero, or\n * no zone, = off.\n */\nexport interface VideoMaskZone {\n readonly leftPct: number\n readonly rightPct: number\n readonly topPct: number\n readonly bottomPct: number\n}\n\n/** A new Video Mask node's settings — spread into its node definition. */\nexport const VIDEO_MASK_DEFAULTS = {\n threshold: 0.5,\n provider: \"sam-3.1\" as VideoMaskProvider,\n /** Off: the mask is the model's, frame for frame (see `HOLD_EMPTY_BELOW_FRACTION`). */\n holdLastMask: false,\n /** 0 = off: every region the model finds is kept (see `MIN_SUBJECT_HEIGHT_PCT_*`). */\n minSubjectHeightPct: 0,\n /** 0 = off: no ceiling on a region's height (see `MAX_SUBJECT_HEIGHT_PCT_*`). */\n maxSubjectHeightPct: 0,\n /** Off: subjects anywhere in the frame are kept (see `ZONE_MARGIN_PCT_*`). */\n zone: null as VideoMaskZone | null,\n /**\n * Off: one pass over the whole clip. On: the clip's scene cuts are found\n * first and each shot is segmented on its own — the model starts afresh\n * after every cut (finding the new shot's subjects), and `holdLastMask`\n * never carries a mask across a cut. A clip with no cut (a flash is\n * usually not one) is one shot: the same mask, fitted to the clip's exact\n * frame count.\n */\n perShot: false,\n /**\n * 0 = off: a new detection only where a request starts anyway (the clip's\n * start, every 1,800 frames, and every cut with `perShot`). Above 0: the\n * model is also sent a new request every this many seconds of footage, so a\n * subject that first appears mid-shot is found within that time (see\n * `REDETECT_EVERY_SEC_*`). These boundaries are not cuts: `holdLastMask`\n * keeps holding across them.\n */\n redetectEverySec: 0,\n} as const\n\nexport const VIDEO_MASK_LIMITS = {\n /** The longest input clip a run accepts, in seconds of PRICED length (see `videoMaskBilledSeconds`). */\n MAX_BILLED_SEC: 300,\n /** Frame rate the price rows assume. A faster clip is priced proportionally longer. */\n FPS_BASIS: 30,\n /** Subject description length cap. */\n PROMPT_MAX_LENGTH: 500,\n /** Detection confidence bounds (the model's own range, narrowed to useful values). */\n THRESHOLD_MIN: 0.05,\n THRESHOLD_MAX: 0.95,\n THRESHOLD_STEP: 0.05,\n /** Default detection confidence. Lower finds more (and less precise) regions. */\n THRESHOLD_DEFAULT: VIDEO_MASK_DEFAULTS.threshold,\n /**\n * `holdLastMask`: a frame whose mask covers less than this fraction of the\n * picture (0.002 % — about 41 px at 1080p: a stray speck, never a subject) counts as empty — the subject lost (hidden behind a\n * hand, turned away) — and shows the most recent non-empty frame's mask\n * instead. Frames before the first detection stay as they are.\n */\n HOLD_EMPTY_BELOW_FRACTION: 0.00002,\n /**\n * `holdLastMask`: the longest a mask is held, in seconds of frames (at the\n * clip's rate). The hold is for a subject hidden for a moment; a run of\n * empty frames longer than this shows the held mask for its first second\n * and then nothing, until the model finds the subject again — a mask held\n * on for longer sits where the subject no longer is.\n */\n HOLD_MAX_SEC: 1,\n /**\n * `minSubjectHeightPct`: drop every connected white region (8-connected)\n * whose bounding box is shorter than this % of the frame height — extras'\n * small faces behind the main subject. 0 = off. Applied before\n * `holdLastMask`, so a frame left with only small regions counts as empty\n * and is held from the last frame with a big subject.\n */\n MIN_SUBJECT_HEIGHT_PCT_MIN: 0,\n MIN_SUBJECT_HEIGHT_PCT_MAX: 100,\n /**\n * `maxSubjectHeightPct`, the mirror: drop every region whose bounding box is\n * TALLER than this % of the frame height (keep only the small subjects — a\n * paste-back mask of the background faces). 0 = off. With both set, a\n * region is kept when min ≤ height ≤ max (min > max is refused). Same pass,\n * same order (before `holdLastMask`).\n */\n MAX_SUBJECT_HEIGHT_PCT_MIN: 0,\n MAX_SUBJECT_HEIGHT_PCT_MAX: 100,\n /**\n * `zone` margins (left / right / top / bottom, % of the frame width or\n * height): drop every connected region whose bounding-box centre lies\n * outside `[w·left/100, w·(1−right/100)] × [h·top/100, h·(1−bottom/100)]`\n * — the faces at the edges of the picture. At most 49 % a side, so the\n * inner rectangle is never empty. Applied after the size cut and before\n * `holdLastMask`, so a frame left with nothing inside counts as empty.\n */\n ZONE_MARGIN_PCT_MIN: 0,\n ZONE_MARGIN_PCT_MAX: 49,\n /**\n * `redetectEverySec`: 0 (off) or `REDETECT_EVERY_SEC_MIN`–`MAX` seconds. The\n * model picks up its subjects near the start of each request; a face that\n * turns to the camera, or a person who walks in, partway through a request is\n * never masked. On, the clip (each shot, with `perShot`) is cut into requests\n * of at most this many seconds of frames — counted from the shot's start, a\n * last piece shorter than `VIDEO_MASK_MIN_SHOT_FRAMES` joining the one before\n * — so the subjects are detected again at every such boundary. Each request\n * adds wall time (they run three at a time); the price follows the clip's\n * length and does not change.\n */\n REDETECT_EVERY_SEC_MIN: 1,\n REDETECT_EVERY_SEC_MAX: 10,\n /** The panel's step (the API takes any value in range). */\n REDETECT_EVERY_SEC_STEP: 1,\n} as const\n\n/**\n * The version of what a Video Mask run's mask looks like for a given clip and\n * settings: every finished `video-mask` job reports it as `output_data.recipe`.\n * A mask stored ahead of time and reused (a trend's approved face mask) is\n * held to it, and reads as out of date once it changes.\n *\n * BUMP IT (to the date of the change) whenever the algorithm changes the mask\n * a run produces from the same clip and settings: the cut rule (`perShot`),\n * the hold (`holdLastMask`, `HOLD_*`), the size and zone filters, the\n * rendering. Never for a change that leaves every mask the same (pricing,\n * limits on what is accepted, messages). `\"2026-10-25\"`: the lone-spike cut\n * rule and the 1 s hold cap.\n */\nexport const VIDEO_MASK_RECIPE = \"2026-10-25\"\n\nconst VIDEO_MASK_BUCKETS_SEC = [5, 10, 15, 30, 60, 90, 120, 180, 240, 300] as const\n\n/** Every price row a provider can be charged from, smallest first. */\nexport function videoMaskCreditIds(provider: VideoMaskProvider = DEFAULT_VIDEO_MASK_PROVIDER): string[] {\n return VIDEO_MASK_BUCKETS_SEC.map((sec) => `${provider}-video:${sec}s`)\n}\n\n/**\n * The length a clip is priced at: its duration at the 30 fps basis. A clip\n * at or under 30 fps is priced at its own length; a 60 fps clip at twice it.\n * An unknown frame rate counts as the basis. The cap reads this figure; the\n * price row reads it through `pricedClipSeconds`.\n */\nexport function videoMaskBilledSeconds(durationSec: number, fps?: number | null): number {\n const rate = typeof fps === \"number\" && Number.isFinite(fps) && fps > 0 ? fps : VIDEO_MASK_LIMITS.FPS_BASIS\n return durationSec * Math.max(1, rate / VIDEO_MASK_LIMITS.FPS_BASIS)\n}\n\n/**\n * The price row for a clip priced at `billedSec` seconds: the smallest that\n * holds it, after `pricedClipSeconds` (up to 0.05 s past a row's length stays in\n * that row). An unknown or non-positive length prices the LONGEST row (a clip\n * the route could not measure is refused, so this is only the pre-run quote for\n * a clip whose length is not known yet); anything past the cap prices the last\n * row.\n */\nexport function videoMaskCreditId(\n billedSec: number | null | undefined,\n provider: VideoMaskProvider = DEFAULT_VIDEO_MASK_PROVIDER,\n): string {\n const ids = videoMaskCreditIds(provider)\n if (typeof billedSec !== \"number\" || !Number.isFinite(billedSec) || billedSec <= 0) return ids[ids.length - 1]!\n const priced = pricedClipSeconds(billedSec)\n const i = VIDEO_MASK_BUCKETS_SEC.findIndex((b) => priced <= b)\n return ids[i === -1 ? ids.length - 1 : i]!\n}\n\n/** Narrow an arbitrary value to a known provider, falling back to the default. */\nexport function resolveVideoMaskProvider(value: unknown): VideoMaskProvider {\n return (VIDEO_MASK_PROVIDERS as readonly string[]).includes(value as string)\n ? (value as VideoMaskProvider)\n : DEFAULT_VIDEO_MASK_PROVIDER\n}\n\n/**\n * A zone as the region filter reads it: each margin a finite number clamped\n * to `ZONE_MARGIN_PCT_MIN`–`ZONE_MARGIN_PCT_MAX` (anything else is 0), and\n * null when there is no zone or every margin is 0 (off). The one reading\n * shared by the worker, a workflow run's payload and the node's own run.\n */\nexport function resolveVideoMaskZone(value: unknown): VideoMaskZone | null {\n if (!value || typeof value !== \"object\") return null\n const v = value as Record<string, unknown>\n const margin = (x: unknown) =>\n typeof x === \"number\" && Number.isFinite(x)\n ? Math.min(VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX, Math.max(VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN, x))\n : 0\n const zone = { leftPct: margin(v.leftPct), rightPct: margin(v.rightPct), topPct: margin(v.topPct), bottomPct: margin(v.bottomPct) }\n return zone.leftPct > 0 || zone.rightPct > 0 || zone.topPct > 0 || zone.bottomPct > 0 ? zone : null\n}\n\n/**\n * `redetectEverySec` as a run reads it: a finite number above 0 clamped to\n * `REDETECT_EVERY_SEC_MIN`–`MAX` (a value between 0 and the minimum snaps up\n * to it — it asked for re-detection); anything else (absent, 0, negative,\n * not a number) is 0 = off. The one reading shared by the worker, a workflow\n * run's payload, the node's own run and its panel (the route refuses a value\n * out of range instead).\n */\nexport function resolveVideoMaskRedetectSec(value: unknown): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) return 0\n return Math.min(VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX, Math.max(VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN, value))\n}\n\n/** `POST /v1/video-mask` request body. */\nexport interface VideoMaskRequest {\n /** The clip to segment. */\n readonly videoUrl: string\n /** What to track: a short noun phrase; separate several with commas. */\n readonly prompt: string\n /** Detection confidence, `VIDEO_MASK_LIMITS.THRESHOLD_MIN`–`THRESHOLD_MAX` (default 0.5). */\n readonly threshold?: number\n readonly provider?: VideoMaskProvider\n /** Hold the last mask where the subject is lost (default false): an empty frame\n * after the first detection repeats the most recent non-empty one. */\n readonly holdLastMask?: boolean\n /** Ignore subjects smaller than this % of the frame height, 0–100 (default 0 = off):\n * connected regions whose bounding box is shorter are dropped from every frame. */\n readonly minSubjectHeightPct?: number\n /** Ignore subjects larger than this % of the frame height, 0–100 (default 0 = off):\n * connected regions whose bounding box is taller are dropped from every frame. */\n readonly maxSubjectHeightPct?: number\n /** Keep only the subjects whose bounding-box centre is inside these margins, each\n * 0–49 % of the frame (a margin left out is 0). null / omitted / all 0 = off. */\n readonly zone?: Partial<VideoMaskZone> | null\n /** Segment each shot on its own (default false): the clip's scene cuts are found\n * first and the subjects are detected again in every shot; `holdLastMask` never\n * carries a mask across a cut. The output then carries `shots`. */\n readonly perShot?: boolean\n /** Detect the subjects again every this many seconds (0 = off, the default, or\n * `VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN`–`MAX`): the clip — each shot, with\n * `perShot` — is sent to the model in pieces of at most that length, so a subject\n * that first appears mid-shot is masked from the next boundary on. Not a cut:\n * `holdLastMask` holds across these boundaries. Slower (more requests); same price. */\n readonly redetectEverySec?: number\n}\n","/**\n * Video Face Mesh (`POST /v1/video-face-mesh`, job type `video-face-mesh`):\n * thin GRAY face lines — a wireframe, and darker eye and lip outlines, each a\n * tone of the picture under it — drawn on the faces of a clip, frame for\n * frame. An internal step of Nodaro Motion's face masking: the lines go on\n * the masked (or depth) clip so the video model still sees where the mouth\n * and the eyes are. A request may draw only the eye and lip outlines, only\n * the lip outline, or the face's contours (`parts`).\n *\n * Priced by the clip's length at the 30 fps basis Video Mask uses\n * (`videoMaskBilledSeconds`), one row per length bucket.\n */\nimport { pricedClipSeconds } from \"./priced-clip-seconds.js\"\nimport { VIDEO_MASK_LIMITS, type VideoMaskZone } from \"./video-mask.js\"\nimport type { VideoDepthColormap } from \"./video-depth.js\"\n\n/** The route, as the Cast Swap engine calls it. */\nexport const VIDEO_FACE_MESH_PATH = \"/v1/video-face-mesh\"\n\nexport const VIDEO_FACE_MESH_LIMITS = {\n /** The longest clip a run accepts, in seconds of PRICED length (the 30 fps basis): Video Mask's own cap. */\n MAX_BILLED_SEC: VIDEO_MASK_LIMITS.MAX_BILLED_SEC,\n /** `minFaceHeightPct` / `maxFaceHeightPct` bounds (0 = off). */\n FACE_HEIGHT_PCT_MIN: 0,\n FACE_HEIGHT_PCT_MAX: 100,\n /** `zone` margin bounds, as Video Mask's. */\n ZONE_MARGIN_PCT_MIN: VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN,\n ZONE_MARGIN_PCT_MAX: VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX,\n} as const\n\n/**\n * What a face mesh run draws on each face (`VideoFaceMeshRequest.parts`):\n * `\"full\"` (the default) the thin wireframe and the darker eye and lip\n * outlines; `\"features\"` the eye outlines and the lip outline only, no\n * wireframe; `\"mouth\"` the lip outline only; `\"contours\"` the face oval,\n * both eyebrows, the nose and the eye and lip outlines, no wireframe (a host\n * that draws them says so to its engine: `videoFaceMeshContours`).\n */\nexport const VIDEO_FACE_MESH_PARTS = [\"full\", \"features\", \"mouth\", \"contours\"] as const\nexport type VideoFaceMeshParts = (typeof VIDEO_FACE_MESH_PARTS)[number]\n\n/**\n * The face mesh's layers (`VideoFaceMeshRequest.layers`), each drawn or not\n * on its own:\n * - `wireframe`: the thin mesh over the whole face;\n * - `eyes`: the eye outlines; `lips`: the lip outline, outer and inner;\n * - `contours`: the face oval, both eyebrows and the nose. With it on, every\n * line drawn leaves out what the face hides (a turned face's far side);\n * with it off, nothing is left out;\n * - `irises`: a circle round each iris and a dot at its centre, drawn only\n * inside the eye's opening (an eyelid covers it, a closed eye hides it);\n * - `bold`: the lines drawn thicker and in a deeper tone. It draws nothing\n * of its own: it changes the lines of the other layers.\n * Every `parts` value is one set of layers (`videoFaceMeshLayersOfParts`),\n * drawn exactly as that value is.\n */\nexport const VIDEO_FACE_MESH_LAYERS = [\"wireframe\", \"eyes\", \"lips\", \"contours\", \"irises\", \"bold\"] as const\nexport type VideoFaceMeshLayer = (typeof VIDEO_FACE_MESH_LAYERS)[number]\n/** The layers that draw lines of their own (all but `bold`): a set needs at least one. */\nexport const VIDEO_FACE_MESH_LINE_LAYERS = [\"wireframe\", \"eyes\", \"lips\", \"contours\", \"irises\"] as const satisfies readonly VideoFaceMeshLayer[]\n/** A set of layers: each one on when `true`; left out or `false` is off. */\nexport type VideoFaceMeshLayers = { readonly [K in VideoFaceMeshLayer]?: boolean }\n\nconst PARTS_LAYERS: Readonly<Record<VideoFaceMeshParts, readonly VideoFaceMeshLayer[]>> = {\n full: [\"wireframe\", \"eyes\", \"lips\"],\n features: [\"eyes\", \"lips\"],\n mouth: [\"lips\"],\n contours: [\"eyes\", \"lips\", \"contours\"],\n}\n\n/** The set of layers a `parts` value draws (left out: `\"full\"`), a new object with only its layers, each `true`. */\nexport function videoFaceMeshLayersOfParts(parts: VideoFaceMeshParts = \"full\"): VideoFaceMeshLayers {\n return Object.fromEntries(PARTS_LAYERS[parts].map((l) => [l, true]))\n}\n\n/** The set with only its layers that are on, each `true`, in `VIDEO_FACE_MESH_LAYERS` order: a new object. */\nexport function videoFaceMeshLayersOn(layers: VideoFaceMeshLayers | null | undefined): VideoFaceMeshLayers {\n return Object.fromEntries(VIDEO_FACE_MESH_LAYERS.filter((l) => layers?.[l] === true).map((l) => [l, true]))\n}\n\n/** Whether the set draws any line (a layer other than `bold` on). */\nexport function videoFaceMeshLayersDrawLines(layers: VideoFaceMeshLayers | null | undefined): boolean {\n return VIDEO_FACE_MESH_LINE_LAYERS.some((l) => layers?.[l] === true)\n}\n\n/**\n * The `parts` value that draws exactly this set of layers, or undefined when\n * none does (a set only layers can name: the irises, bold lines, the eyes\n * alone…). `among` limits the values it may answer (a setting that takes only\n * some of them).\n */\nexport function videoFaceMeshPartsOfLayers(\n layers: VideoFaceMeshLayers | null | undefined,\n among: readonly VideoFaceMeshParts[] = VIDEO_FACE_MESH_PARTS,\n): VideoFaceMeshParts | undefined {\n const on = VIDEO_FACE_MESH_LAYERS.filter((l) => layers?.[l] === true)\n return among.find((p) => PARTS_LAYERS[p].length === on.length && PARTS_LAYERS[p].every((l) => on.includes(l)))\n}\n\n/**\n * The version of what a face mesh run draws for a given clip and settings:\n * every finished `video-face-mesh` job reports it as `output_data.recipe`,\n * for the caller to record beside a clip it stores with the lines on it (a\n * trend's approved face mask). Nothing on the platform compares it yet: a\n * stored mask is held to Video Mask's recipe and the engine's own.\n *\n * BUMP IT (to the date of the change) whenever the drawing changes for the\n * same input: the model, the crop, the smoothing, the filters, the colours or\n * the widths. Never for pricing, limits or messages. 2026-11-02: MediaPipe's\n * refined landmark model (478 points, a 256 × 256 crop) in place of the basic\n * one; the lines' colours and widths are 2026-11-01's. 2026-11-03: a face gets\n * lines only when it is found in at least 3 frames of its track (found faces\n * at the same place in frames at most 2 apart): one found in a frame or two\n * is never drawn.\n */\nexport const VIDEO_FACE_MESH_RECIPE = \"2026-11-03\"\n\nconst VIDEO_FACE_MESH_BUCKETS_SEC = [5, 10, 15, 30, 60, 120, 300] as const\n\n/** Every price row, smallest first (`video-face-mesh:<n>s`). */\nexport function videoFaceMeshCreditIds(): string[] {\n return VIDEO_FACE_MESH_BUCKETS_SEC.map((sec) => `video-face-mesh:${sec}s`)\n}\n\n/**\n * The price row for a clip priced at `billedSec` seconds: the smallest bucket\n * that holds it, after `pricedClipSeconds` (up to 0.05 s past a bucket's length\n * stays in that bucket). An unknown or non-positive length, or one past the cap,\n * prices the LONGEST row (the route measures every clip and refuses one past\n * the cap, so this is only ever a ceiling).\n */\nexport function videoFaceMeshCreditId(billedSec: number | null | undefined): string {\n const ids = videoFaceMeshCreditIds()\n if (typeof billedSec !== \"number\" || !Number.isFinite(billedSec) || billedSec <= 0) return ids[ids.length - 1]!\n const priced = pricedClipSeconds(billedSec)\n const i = VIDEO_FACE_MESH_BUCKETS_SEC.findIndex((b) => priced <= b)\n return ids[i === -1 ? ids.length - 1 : i]!\n}\n\n/** `POST /v1/video-face-mesh` request body. */\nexport interface VideoFaceMeshRequest {\n /** The clip the faces are FOUND in (the original). */\n readonly videoUrl: string\n /** The clip the lines are DRAWN on (default `videoUrl`): the masked or depth clip. Same frame count. */\n readonly drawOnUrl?: string\n /** A mask video (white = covered, same frame count): only faces whose box centre lies inside it are drawn. */\n readonly maskUrl?: string\n /** Draw only faces at least this % of the frame's height (default 0 = off). */\n readonly minFaceHeightPct?: number\n /** Draw only faces at most this % of the frame's height (0 = no cap). */\n readonly maxFaceHeightPct?: number\n /** Margins (% of the frame) where no face is drawn. */\n readonly zone?: Partial<VideoMaskZone> | null\n /**\n * The depth map's colormap (Video Depth's `VIDEO_DEPTH_COLORMAPS`) when the\n * lines go on a depth map: each line is then a colour OF that map — the map\n * at the line's tone of the depth under it. Needs `depthUrl`, except\n * `grayscale` (a gray depth clip is its own depth). Left out with a\n * `depthUrl`: `grayscale`.\n */\n readonly colormap?: VideoDepthColormap\n /**\n * The GRAYSCALE depth render of the clip (Video Depth with `colormap:\n * \"grayscale\"`, same frame count as `videoUrl`, any size): the depth each\n * line's colour is read from. Left out (a blurred mask, a gray depth clip\n * drawn on directly): each line is a gray tone of the pixel under it.\n */\n readonly depthUrl?: string\n /**\n * What is drawn on each face (`VIDEO_FACE_MESH_PARTS`): left out or\n * `\"full\"`, the wireframe and the eye and lip outlines; `\"features\"`, the\n * eye and lip outlines only; `\"mouth\"`, the lip outline only. The outlines\n * are drawn as they are in the full mesh (the same tone and width).\n */\n readonly parts?: VideoFaceMeshParts\n /**\n * What is drawn, layer by layer (`VIDEO_FACE_MESH_LAYERS`), in place of\n * `parts` (never both). At least one layer other than `bold`. A set that is\n * a `parts` value's draws exactly as that value does.\n */\n readonly layers?: VideoFaceMeshLayers\n}\n\n/** A finished `video-face-mesh` job's `output_data`. */\nexport interface VideoFaceMeshOutput {\n /** The drawn clip: `drawOnUrl`'s frame count, size and frame rate, its audio copied untouched. */\n readonly videoUrl: string\n readonly width: number\n readonly height: number\n readonly frames: number\n /** Frames with at least one face drawn. */\n readonly framesWithFaces: number\n /** Faces drawn, summed over the frames (0 = nothing drawn; the clip comes back as it was sent). */\n readonly facesDrawn: number\n /** The map the lines were coloured from (a request with `depthUrl`); absent = gray tones of the pixel under them. */\n readonly colormap?: VideoDepthColormap\n /** What was drawn when it was not the full mesh (a request with `parts` `\"features\"` or `\"mouth\"`); absent = the full mesh. */\n readonly parts?: Exclude<VideoFaceMeshParts, \"full\">\n /** The layers drawn, for a request that named `layers` (only those on, each `true`); absent: `parts` says. */\n readonly layers?: VideoFaceMeshLayers\n readonly recipe: string\n}\n","/**\n * Generate Mask — text-prompted IMAGE segmentation (Grounded SAM). The wire\n * contract of `POST /v1/generate-mask`, the `generate_mask` MCP verb, the SDK's\n * `nodes.run(\"generate-mask\", …)` and `nodaro media generate-mask`, defined ONCE:\n * every bound the route schema and the SDK/CLI read.\n *\n * The finished job's output is `{ maskUrl, imageUrl }`: `maskUrl` is the\n * black-and-white mask PNG (white = the subject), `imageUrl` is the SOURCE\n * image passed through unchanged, so an inpainting step can take the pair.\n *\n * Wire contract only — no I/O.\n */\n\nexport const GENERATE_MASK_LIMITS = {\n /** Subject description length cap. */\n PROMPT_MAX_LENGTH: 500,\n /** Segmentation confidence bounds. */\n THRESHOLD_MIN: 0,\n THRESHOLD_MAX: 1,\n /** Default segmentation confidence. Lower selects more (and less precise) regions. */\n THRESHOLD_DEFAULT: 0.3,\n} as const\n\n/** `POST /v1/generate-mask` request body. */\nexport interface GenerateMaskRequest {\n /** The image to segment. */\n readonly imageUrl: string\n /** What to select, in plain words (e.g. \"the person\", \"sky and clouds\"). 1–500 characters. */\n readonly prompt: string\n /** Segmentation confidence, `GENERATE_MASK_LIMITS.THRESHOLD_MIN`–`THRESHOLD_MAX` (default 0.3). */\n readonly threshold?: number\n}\n\n/** A completed Generate Mask job's `output_data`. */\nexport interface GenerateMaskOutput {\n /** The mask: a black-and-white PNG, white = the subject. */\n readonly maskUrl: string\n /** The source image, passed through unchanged. */\n readonly imageUrl: string\n}\n","/**\n * Mask Composite — place a foreground video over a background video through a\n * mask video (white = keep the foreground, black = show the background). The\n * wire contract of the `mask-composite` node, `POST /v1/mask-composite`, the\n * `mask_composite` MCP verb, `client.media.maskComposite` and\n * `nodaro media mask-composite`, defined ONCE. Pair it with Video Mask, whose\n * output is exactly such a mask.\n *\n * The render follows the FOREGROUND: its size, frame rate and length. The\n * background is fitted to that frame (`backgroundFit`) and loops when shorter;\n * the mask is stretched to the frame and holds its last frame when shorter.\n *\n * `fill` picks what fills the masked area. `\"video\"` (the default) is the\n * foreground, as above. `\"pixelate\"` and `\"blur\"` fill it with the BACKGROUND\n * itself, pixelated or blurred: there is no foreground then (a sent\n * `foregroundUrl` is ignored), so the render follows the BACKGROUND (its size,\n * frame rate and length; `backgroundFit` has nothing to fit), and the run is\n * priced on the background's length. With no foreground the result always\n * carries the background's sound — `audioSource` is ignored there\n * ({@link maskCompositeEffectiveAudioSource}); the canvas hides the control.\n *\n * Priced per started 5 seconds of the result (the foreground's length), like\n * Trim / Loop / Combine Videos: the node's own `model_pricing` row is ONE unit\n * (`maskCompositeUnits` counts them). Worked examples (repeated in\n * docs/nodes/processing-video/mask-composite.md, at the 10-credit row):\n * 3 s → 1 unit (10), 10 s → 2 units (20), 61 s → 13 units (130), 5 min → 60 units (600).\n *\n * Wire contract only — no I/O.\n */\nimport { pricedClipSeconds } from \"./priced-clip-seconds.js\"\n\n/** How the background is fitted to the foreground's frame. */\nexport const MASK_COMPOSITE_BACKGROUND_FITS = [\"cover\", \"contain\", \"stretch\"] as const\nexport type MaskCompositeBackgroundFit = (typeof MASK_COMPOSITE_BACKGROUND_FITS)[number]\n\n/** What fills the masked area: the foreground video, or the background itself pixelated or blurred. */\nexport const MASK_COMPOSITE_FILLS = [\"video\", \"pixelate\", \"blur\"] as const\nexport type MaskCompositeFill = (typeof MASK_COMPOSITE_FILLS)[number]\n\n/** Which sound the result carries. `mix` blends both tracks at equal level. */\nexport const MASK_COMPOSITE_AUDIO_SOURCES = [\"foreground\", \"background\", \"mix\", \"none\"] as const\nexport type MaskCompositeAudioSource = (typeof MASK_COMPOSITE_AUDIO_SOURCES)[number]\n\nexport const MASK_COMPOSITE_BOUNDS = {\n /** Edge softening, pixels of blur radius on the mask (0 = hard edge). */\n FEATHER_MIN: 0,\n FEATHER_MAX: 20,\n /** Grow (+) or shrink (−) the white region, pixels. */\n GROW_MIN: -10,\n GROW_MAX: 10,\n /** How strongly the foreground covers the background inside the mask\n * (1 = fully, today's output; 0 = not at all). */\n OPACITY_MIN: 0,\n OPACITY_MAX: 1,\n /** Pixelate: the block size as a % of the frame's WIDTH (relative, so a\n * setting looks the same at any resolution); the worker makes the blocks\n * max(2, round(width × pct / 100)) px. 1.25 % = 16 px on a 1280-wide frame. */\n PIXEL_SIZE_PCT_MIN: 0.2,\n PIXEL_SIZE_PCT_MAX: 10,\n /** Blur: the gaussian's sigma as a % of the frame's WIDTH (2 % ≈ sigma 25 px on a 1280-wide frame). */\n BLUR_STRENGTH_PCT_MIN: 0.1,\n BLUR_STRENGTH_PCT_MAX: 5,\n /** The longest leading video (the foreground; the background when `fill` is not video) a run accepts, seconds. */\n MAX_DURATION_SEC: 300,\n} as const\n\n/** Seconds of result one pricing unit covers. */\nexport const MASK_COMPOSITE_UNIT_SEC = 5\n\n/**\n * How much longer, in seconds, the leading video the render downloads may run\n * than the one measured before the run was charged, before the render refuses\n * it as changed: a re-measure can read a hair longer (a re-encode, a\n * container's rounding), and that is not a different file. Applied to the\n * seconds, never to the units, before the price's own 0.05 s grace\n * (`pricedClipSeconds`): a run billed for 10 s renders a lead of up to about\n * 10.55 s. The same slack as Video Overlay's base.\n */\nexport const MASK_COMPOSITE_REMEASURE_SLACK_SEC = 0.5\n\n/**\n * Pricing units for a result `durationSec` long: one per started 5 seconds,\n * at least one, after `pricedClipSeconds` (up to 0.05 s past a whole second is\n * ignored, so a 10.01 s result is 2 units, not 3). An unknown length counts the\n * longest result a run accepts (an upper bound — the pre-run quote for a clip\n * whose length is not known yet; every run measures its foreground).\n */\nexport function maskCompositeUnits(durationSec: number | null | undefined): number {\n const sec =\n typeof durationSec === \"number\" && Number.isFinite(durationSec) && durationSec > 0\n ? Math.min(durationSec, MASK_COMPOSITE_BOUNDS.MAX_DURATION_SEC)\n : MASK_COMPOSITE_BOUNDS.MAX_DURATION_SEC\n return Math.ceil(pricedClipSeconds(sec) / MASK_COMPOSITE_UNIT_SEC)\n}\n\nexport const MASK_COMPOSITE_DEFAULTS = {\n invertMask: false,\n feather: 2,\n grow: 0,\n opacity: 1,\n fill: \"video\" as MaskCompositeFill,\n pixelSizePct: 1.25,\n blurStrengthPct: 2,\n backgroundFit: \"cover\" as MaskCompositeBackgroundFit,\n audioSource: \"foreground\" as MaskCompositeAudioSource,\n} as const\n\nexport interface MaskCompositeSettings {\n readonly invertMask: boolean\n readonly feather: number\n readonly grow: number\n /** Inside the mask: opacity × foreground + (1 − opacity) × background. */\n readonly opacity: number\n /** What fills the masked area (`video` = the foreground). */\n readonly fill: MaskCompositeFill\n /** Pixelate block size, % of the frame width (used when `fill` is `pixelate`). */\n readonly pixelSizePct: number\n /** Blur strength: the gaussian's sigma as a % of the frame width (used when `fill` is `blur`). */\n readonly blurStrengthPct: number\n readonly backgroundFit: MaskCompositeBackgroundFit\n readonly audioSource: MaskCompositeAudioSource\n}\n\nconst clampInt = (v: unknown, min: number, max: number, fallback: number): number =>\n typeof v === \"number\" && Number.isFinite(v) ? Math.min(max, Math.max(min, Math.round(v))) : fallback\n\nconst clampNumber = (v: unknown, min: number, max: number, fallback: number): number =>\n typeof v === \"number\" && Number.isFinite(v) ? Math.min(max, Math.max(min, v)) : fallback\n\n/**\n * Node data (or any loose object) → settings every engine renders with.\n * Unknown enum values fall back to the default and numbers are clamped, so a\n * node written straight into workflow JSON renders the same as one set in the\n * panel. The ONE normaliser both workflow engines and the worker call.\n */\nexport function resolveMaskCompositeSettings(data: Readonly<Record<string, unknown>>): MaskCompositeSettings {\n const d = MASK_COMPOSITE_DEFAULTS\n const b = MASK_COMPOSITE_BOUNDS\n return {\n invertMask: typeof data.invertMask === \"boolean\" ? data.invertMask : d.invertMask,\n feather: clampInt(data.feather, b.FEATHER_MIN, b.FEATHER_MAX, d.feather),\n grow: clampInt(data.grow, b.GROW_MIN, b.GROW_MAX, d.grow),\n opacity: clampNumber(data.opacity, b.OPACITY_MIN, b.OPACITY_MAX, d.opacity),\n fill: maskCompositeFillOf(data),\n pixelSizePct: clampNumber(data.pixelSizePct, b.PIXEL_SIZE_PCT_MIN, b.PIXEL_SIZE_PCT_MAX, d.pixelSizePct),\n blurStrengthPct: clampNumber(data.blurStrengthPct, b.BLUR_STRENGTH_PCT_MIN, b.BLUR_STRENGTH_PCT_MAX, d.blurStrengthPct),\n backgroundFit: (MASK_COMPOSITE_BACKGROUND_FITS as readonly string[]).includes(data.backgroundFit as string)\n ? (data.backgroundFit as MaskCompositeBackgroundFit)\n : d.backgroundFit,\n audioSource: (MASK_COMPOSITE_AUDIO_SOURCES as readonly string[]).includes(data.audioSource as string)\n ? (data.audioSource as MaskCompositeAudioSource)\n : d.audioSource,\n }\n}\n\n/** The fill a node, payload or request body asks for: an unknown value is `video` (the default). */\nexport function maskCompositeFillOf(data: Readonly<Record<string, unknown>> | null | undefined): MaskCompositeFill {\n const f = data?.fill\n return (MASK_COMPOSITE_FILLS as readonly string[]).includes(f as string) ? (f as MaskCompositeFill) : MASK_COMPOSITE_DEFAULTS.fill\n}\n\n/** Does this fill take a foreground video? Only `video` does; pixelate and blur fill from the background. */\nexport function maskCompositeUsesForeground(fill: MaskCompositeFill): boolean {\n return fill === \"video\"\n}\n\n/**\n * The input whose size, rate and length the result has (and so the one a run\n * is measured and priced on): the canvas handle — `video` (the foreground) for\n * the video fill, `background-video` for pixelate and blur. The one rule the\n * route, the workflow run, the run estimates and the length walks read.\n */\nexport function maskCompositeLeadHandle(data: Readonly<Record<string, unknown>> | null | undefined): \"video\" | \"background-video\" {\n return maskCompositeUsesForeground(maskCompositeFillOf(data)) ? \"video\" : \"background-video\"\n}\n\n/**\n * The sound a render actually carries. With no foreground (pixelate / blur) it\n * is ALWAYS the background's — the only track there is — whatever\n * `audioSource` says (the canvas hides that control for these fills, so a\n * stored `none` from the Video fill can never silently mute the result).\n */\nexport function maskCompositeEffectiveAudioSource(s: Pick<MaskCompositeSettings, \"fill\" | \"audioSource\">): MaskCompositeAudioSource {\n if (maskCompositeUsesForeground(s.fill)) return s.audioSource\n return \"background\"\n}\n\n/** `POST /v1/mask-composite` request body. */\nexport interface MaskCompositeRequest extends Partial<MaskCompositeSettings> {\n /** The video whose white-masked region is kept (its size, rate and length lead).\n * Required when `fill` is `video` (the default); not used by `pixelate` / `blur`. */\n readonly foregroundUrl?: string\n /** The video shown where the mask is black. */\n readonly backgroundUrl: string\n /** The mask video — white = foreground (Video Mask's output). */\n readonly maskUrl: string\n}\n","/**\n * Dubbing structure — the wire contract of a dub read back by its job id\n * (`GET /v1/dubbing/:jobId`), and of the captions export beside it\n * (`GET /v1/dubbing/:jobId/captions`).\n *\n * One shape whichever engine made the dub, so a client is written once. A\n * field an engine does not tell is null, never absent:\n * - `sourceSegmentId` names the source line a language's line translates.\n * It is null where the dub's lines carry no link to the source lines; the\n * two lists are then read side by side, by time.\n * - `sourceText` is the original text a line translates, as the dub keeps\n * it beside the line; null where the dub keeps none. Each of the two is\n * told on its own: a line can carry `sourceText` and no `sourceSegmentId`.\n * - a speaker's `name` and `voice` are null until they can be read.\n *\n * `capabilities` says what can be done to this dub now. A client offers an\n * action only when its capability is true.\n */\n\n/** The caption file formats a dub exports. */\nexport const DUBBING_CAPTION_FORMATS = [\"srt\", \"vtt\"] as const\nexport type DubbingCaptionFormat = (typeof DUBBING_CAPTION_FORMATS)[number]\n\n/** The `language` value that names the original speech in a captions request. */\nexport const DUBBING_SOURCE_LANGUAGE = \"source\"\n\n/**\n * Where a language of a dub stands:\n * - `processing`: being made; its lines are not readable yet.\n * - `completed`: it is made; its lines and captions are readable where the dubbing service gives them.\n * - `stale`: its lines changed after its media was last made.\n * - `failed`: it was not made.\n */\nexport const DUBBING_LANGUAGE_STATUSES = [\"processing\", \"completed\", \"stale\", \"failed\"] as const\nexport type DubbingLanguageStatus = (typeof DUBBING_LANGUAGE_STATUSES)[number]\n\n/** One line of the original speech. Times are seconds from the start of the media. */\nexport interface DubbingSourceSegment {\n /** Unique within the source lines. */\n id: string\n speakerId: string | null\n start: number\n end: number\n text: string\n}\n\n/** One line of a dubbed language. Times are seconds from the start of the media. */\nexport interface DubbingSegment {\n /** Unique within this language's lines. */\n id: string\n speakerId: string | null\n start: number\n end: number\n /**\n * The `id` of the source line this one translates; null where the dub's\n * lines carry no link to the source lines.\n */\n sourceSegmentId: string | null\n /**\n * The original text this line translates, as the dub keeps it beside the\n * line; null where it keeps none. It can be told where `sourceSegmentId` is\n * null.\n */\n sourceText: string | null\n text: string\n}\n\n/** One language a dub speaks. */\nexport interface DubbingLanguage {\n /** The language code the dub was asked for (`es`, `pt-BR`); unique within a dub. */\n code: string\n /**\n * The job whose result is this language's dubbed media. null when the\n * language was made but no job of the account holds its media: adding the\n * language again delivers it, unless its status is `stale` (its lines\n * changed after its media was made), when adding it is refused.\n */\n jobId: string | null\n status: DubbingLanguageStatus\n /** Empty unless `status` is `completed` or `stale`, and where the dubbing service does not give the language's lines. */\n segments: DubbingSegment[]\n}\n\n/** The voice a speaker is dubbed in. */\nexport interface DubbingSpeakerVoice {\n id: string\n name: string | null\n previewUrl: string | null\n}\n\n/** One speaker the dub tells apart. */\nexport interface DubbingSpeaker {\n /** The `speakerId` its lines carry. */\n id: string\n name: string | null\n voice: DubbingSpeakerVoice | null\n /** How many source lines the speaker has (lines of the first language when the source is not readable). */\n segmentCount: number\n}\n\n/** What can be done to a dub now. */\nexport interface DubbingCapabilities {\n /** Change a line's text. */\n editSegments: boolean\n /** Make chosen lines again. */\n regenerate: boolean\n /** Replace a speaker's voice. */\n setSpeakerVoice: boolean\n /** Render the media again after edits. */\n render: boolean\n /** Add a target language (`POST /v1/dubbing/:jobId/languages`). */\n addLanguage: boolean\n /** Export captions (`GET /v1/dubbing/:jobId/captions`). */\n captions: boolean\n}\n\n/**\n * What adding a language to this dub is charged. The price is the answer of\n * `POST /v1/credits/model-costs` for `creditIdByLanguage[language] ?? creditId`.\n */\nexport interface DubbingAddLanguagePrice {\n /** Whole minutes an added language is charged for; null when the length is only known once it runs. */\n billableMinutes: number | null\n /** The price id of an added language; null with `billableMinutes`. */\n creditId: string | null\n /** The languages priced by another id than `creditId`, by lowercase language code. */\n creditIdByLanguage: Record<string, string>\n}\n\n/** `GET /v1/dubbing/:jobId`. */\nexport interface DubbingStructure {\n /** The job the dub was created by. Languages added later hang off it. */\n jobId: string\n /** Seconds of media the dub covers; null when not known. */\n durationSec: number | null\n /** The original speech; null when its lines are not readable. */\n source: { language: string | null; segments: DubbingSourceSegment[] } | null\n languages: DubbingLanguage[]\n speakers: DubbingSpeaker[]\n capabilities: DubbingCapabilities\n addLanguage: DubbingAddLanguagePrice\n}\n\n/** `POST /v1/dubbing/:jobId/languages` request. */\nexport interface DubbingAddLanguageInput {\n /** The language to add (`es`, `pt-BR`). */\n targetLanguage: string\n /** The rights confirmation, when the dub was made from a link the deployment asks one for. */\n confirmationId?: string\n}\n\n/** `POST /v1/dubbing/:jobId/languages` response: the job that delivers the added language. */\nexport interface DubbingAddLanguageResult {\n jobId: string\n}\n\n/**\n * The error codes the dubbing reads and the add-language call answer beside\n * the platform's own (`not_found`, `unauthorized`, `validation_error`). Each\n * is the `error.code` of the response body.\n */\nexport const DUBBING_ERROR_CODES = [\n /** 422: the job is not a dub. */\n \"not_a_dubbing_job\",\n /** 409: the dub is still being made. */\n \"dubbing_not_ready\",\n /** 422: the dub was not made. */\n \"dubbing_failed\",\n /** 410: the dub is no longer held where it was made. */\n \"dubbing_unavailable\",\n /** 404: the dub has no such language. */\n \"dubbing_language_not_found\",\n /** 409: that language is still being made. */\n \"dubbing_language_processing\",\n /** 422: that language has no captions to export. */\n \"dubbing_captions_unavailable\",\n /** 409: the dub already speaks that language. */\n \"dubbing_language_exists\",\n /** 422: the length of the dub cannot be read, so a language cannot be priced. */\n \"unreadable_dubbing_source\",\n /** 413: the dub is longer than 30 minutes, so a language cannot be added to it. */\n \"media_duration_exceeds_limit\",\n /** 502: the dubbing service did not answer. */\n \"dubbing_read_failed\",\n] as const\nexport type DubbingErrorCode = (typeof DUBBING_ERROR_CODES)[number]\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5NVGKXJV_cjs = require('./chunk-5NVGKXJV.cjs');
|
|
4
4
|
var chunkT3TOSWVH_cjs = require('./chunk-T3TOSWVH.cjs');
|
|
5
5
|
|
|
6
6
|
// src/pinterest-url.ts
|
|
@@ -113,7 +113,7 @@ var META_ADS_SCRAPE_MAX_SOURCES = 5;
|
|
|
113
113
|
var META_ADS_SCRAPE_MAX_QUERY_LENGTH = 100;
|
|
114
114
|
var META_ADS_SCRAPE_DEFAULT_COUNTRY = "ALL";
|
|
115
115
|
var META_ADS_SCRAPE_TIERS = [10, 20, 50, 100, 200, 500];
|
|
116
|
-
var META_ADS_ANALYSIS_TIERS =
|
|
116
|
+
var META_ADS_ANALYSIS_TIERS = chunk5NVGKXJV_cjs.LLM_CREDIT_RUNGS;
|
|
117
117
|
var META_ADS_ANALYSIS_CREDITS_PER_AD = { economy: 1, standard: 3, premium: 4, "premium-direct": 10 };
|
|
118
118
|
var META_ADS_ANALYSIS_CREDIT_ID = "meta-ads-analysis";
|
|
119
119
|
var META_ADS_ANALYSIS_FOCUS_MAX = 500;
|
|
@@ -121,8 +121,8 @@ function metaAdsAnalysisCreditId(tier) {
|
|
|
121
121
|
return tier === "standard" ? META_ADS_ANALYSIS_CREDIT_ID : `${META_ADS_ANALYSIS_CREDIT_ID}:${tier}`;
|
|
122
122
|
}
|
|
123
123
|
function metaAdsAnalysisTier(modelId) {
|
|
124
|
-
const id = typeof modelId === "string" && modelId ? modelId :
|
|
125
|
-
return
|
|
124
|
+
const id = typeof modelId === "string" && modelId ? modelId : chunk5NVGKXJV_cjs.LLM_FEATURE_DEFAULTS["meta-ads-analysis"];
|
|
125
|
+
return chunk5NVGKXJV_cjs.llmCreditRung(id);
|
|
126
126
|
}
|
|
127
127
|
var strList = (v) => Array.isArray(v) ? v.filter((s) => typeof s === "string" && s.trim().length > 0) : [];
|
|
128
128
|
var str = (v) => typeof v === "string" ? v : "";
|
|
@@ -387,7 +387,7 @@ var SCRAPE_ANALYSIS_FEATURE = "meta-ads-analysis";
|
|
|
387
387
|
var clamp = (n, max) => Math.min(Math.max(Math.trunc(n) || 1, 1), max);
|
|
388
388
|
function scrapeAnalysisPriceParts(node) {
|
|
389
389
|
const data = node.data ?? {};
|
|
390
|
-
const analysisModel = typeof data.analysisModel === "string" && data.analysisModel ? data.analysisModel :
|
|
390
|
+
const analysisModel = typeof data.analysisModel === "string" && data.analysisModel ? data.analysisModel : chunk5NVGKXJV_cjs.LLM_FEATURE_DEFAULTS[SCRAPE_ANALYSIS_FEATURE];
|
|
391
391
|
if (node.type === "meta-ads-scrape" && metaAdsAnalysisTierFrom(data)) {
|
|
392
392
|
const count = typeof data.count === "number" ? data.count : META_ADS_SCRAPE_DEFAULT_COUNT;
|
|
393
393
|
const sources = metaAdsScrapeSources(data);
|
|
@@ -402,7 +402,7 @@ function scrapeAnalysisPriceParts(node) {
|
|
|
402
402
|
return null;
|
|
403
403
|
}
|
|
404
404
|
function scrapeAnalysisQuoteId(parts) {
|
|
405
|
-
return chunkT3TOSWVH_cjs.unitQuoteCreditId(
|
|
405
|
+
return chunkT3TOSWVH_cjs.unitQuoteCreditId(chunk5NVGKXJV_cjs.llmPriceKey(SCRAPE_ANALYSIS_FEATURE, parts.analysisModel), parts.items);
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
// src/scraper-output-schemas.ts
|
|
@@ -1250,5 +1250,5 @@ exports.telegramFeedDigest = telegramFeedDigest;
|
|
|
1250
1250
|
exports.telegramPostsFrom = telegramPostsFrom;
|
|
1251
1251
|
exports.telegramSendAsOf = telegramSendAsOf;
|
|
1252
1252
|
exports.telegramSendDestinationOf = telegramSendDestinationOf;
|
|
1253
|
-
//# sourceMappingURL=chunk-
|
|
1254
|
-
//# sourceMappingURL=chunk-
|
|
1253
|
+
//# sourceMappingURL=chunk-PGDR7CO3.cjs.map
|
|
1254
|
+
//# sourceMappingURL=chunk-PGDR7CO3.cjs.map
|