/*! For license information please see 3013.265ac0fd.js.LICENSE.txt */ (self.__LOADABLE_LOADED_CHUNKS__ = self.__LOADABLE_LOADED_CHUNKS__ || []).push([ ["3013"], { 487059: function (e, t, i) { "use strict"; var n, r, a; i.d(t, { Kr: function () { return c; }, U_: function () { return n; }, hR: function () { return s; }, hm: function () { return r; }, j7: function () { return l; }, vJ: function () { return o; }, }), !(function (e) { (e.CurveHSL = "curve-hsl"), (e.VoiceChange = "voice-change"), (e.ShootProject = "shoot-project"), (e.ManualFigure = "manual-figure"), (e.LiveshortenPanEntertainment = "liveshorten-pan-entertainment"), (e.FaceProp = "face-prop"), (e.Beauty2 = "beauty2"), (e.SkeletonBody = "skeleton-body"), (e.TextTemplate = "text-template"), (e.ShootProp = "shoot-prop"), (e.Shoot = "shoot"), (e.Play = "play"), (e.SystemFonts = "system-fonts"), (e.Beauty = "beauty"), (e.Flower2 = "flower2"), (e.Filter2 = "filter2"), (e.Bubble2 = "bubble2"), (e.Default = "default"), (e.Effects = "effects2"), (e.Tone = "tone"), (e.Filter = "filter"), (e.Canvas = "canvas"), (e.Bubble = "bubble"), (e.Flower = "flower"), (e.SubtitleTemplate = "subtitle-templates"), (e.ObjectLock = "camera_tracking"), (e.Video = "video"), (e.Transitions = "transitions"), (e.Mix = "mix"), (e.Sticker = "sticker"), (e.Text = "text"), (e.Insert = "insert"), (e.Fonts = "fonts"), (e.Videomask = "videomask"), (e.Curvespeed = "curvespeed"), (e.Integration = "integration"), (e.Iosemojinew = "iosemojinew"), (e.Emoji = "emoji"), (e.Emojiandroid = "emojiandroid"), (e.Emojiios = "emojiios"), (e.AutoBeautyShape = "auto-beauty"), (e.AutoBeauty = "auto-beauty2"), (e.AutoBeautyBody = "auto-beauty3"), (e.AutoBeautyMakeup = "makeup"), (e.Graffiti = "graffiti"), (e.SmartColorAdjust = "smart_color_adjust"), (e.TextGlow = "text_glow"), (e.CC4BGsEdit = "cc4b_gs_edit"), (e.Shape = "shape"), (e.ShapeAnimation = "shape-animation"), (e.PathAnimation = "path-animation"), (e.CurveAdjustPreset = "curve_adjust_preset"), (e.AiavatarMask = "aiavatarmask"), (e.ColorMatch = "color_match"), (e.SmartRelight = "smart-relight"), (e.ToolbarFonts = ""), (e.MattingStroke = "matting_stroke"); })(n || (n = {})), !(function (e) { (e.SaleDesign = "sales-design"), (e.SalesSticker = "sales-sticker"), (e.SalesFont = "fonts"), (e.SalesTextTemplate = "sales-text-template"), (e.Svg = "svg"), (e.SalesFrame = "sales-frame"), (e.SalesFilter = "sales-filter"), (e.SalesImageEffect = "sales-image-effect"), (e.YkImage = "yk-image"), (e.AIBackground = "ai_background"), (e.SalesTextPreset = "sales-text-preset"), (e.SalesTextGlow = "sales-text-glow"), (e.SalesGrid = "sales-grid"), (e.SalesRetouchFace = "sales-beauty-face"), (e.SalesRetouchReshape = "sales-beauty-reshape"), (e.SalesRetouchBody = "sales-beauty-body"), (e.SalesRetouchMakeup = "sales-beauty-makeup"), (e.LokiTemplate = "loki-template"), (e.EcomAIBackground = "ecom-ai_background"), (e.PhotoDreamina = "dreamina"), (e.FlowerTextMarketing = "flower_text_marketing"), (e.TextTemplateMarketing = "text_template_marketing"), (e.FontMarketing = "font_marketing"); })(r || (r = {})), !(function (e) { (e.CNSalesSticker = "cn-sales-sticker"), (e.CNSalesFont = "cn-fonts"), (e.CNSalesTextTemplate = "cn-sales-text-template"); })(a || (a = {})); let o = { "sales-design": "sales-design", "sales-sticker": "sales-sticker", fonts: "fonts", "sales-image-effect": "sales-image-effect", "sales-beauty-body": "sales-beauty-body", "sales-beauty-face": "sales-beauty-face", "sales-beauty-reshape": "sales-beauty-reshape", "sales-beauty-makeup": "sales-beauty-makeup", "sales-filter": "sales-filter", "sales-frame": "sales-frame", svg: "svg", "sales-text-glow": "sales-text-glow", "sales-text-template": "sales-text-template", text_template_marketing: "text_template_marketing", font_marketing: "fonts", }, s = { text: "text", fonts: "fonts", flower: "flower", default: "default", sticker: "sticker", "shape-animation": "shape-animation", }, l = { text: "text", fonts: "fonts", flower: "flower", default: "default", sticker: "sticker", "shape-animation": "shape-animation", }, c = { "curve-hsl": "curve-hsl", "voice-change": "voice-change", "shoot-project": "shoot-project", "manual-figure": "manual-figure", "liveshorten-pan-entertainment": "liveshorten-pan-entertainment", "face-prop": "face-prop", beauty2: "beauty2", "skeleton-body": "skeleton-body", "text-template": "text-template", "shoot-prop": "shoot-prop", shoot: "shoot", play: "play", "system-fonts": "system-fonts", beauty: "beauty", flower2: "flower2", filter2: "filter2", bubble2: "bubble2", default: "default", effects2: "effects2", tone: "tone", filter: "filter", canvas: "canvas", bubble: "bubble", flower: "flower", video: "video", transitions: "transitions", mix: "mix", sticker: "sticker", text: "text", insert: "insert", fonts: "fonts", videomask: "videomask", curvespeed: "curvespeed", integration: "integration", iosemojinew: "iosemojinew", emoji: "emoji", emojiandroid: "emojiandroid", emojiios: "emojiios", "auto-beauty": "auto-beauty", "auto-beauty2": "auto-beauty2", "auto-beauty3": "auto-beauty3", makeup: "makeup", graffiti: "graffiti", smart_color_adjust: "smart_color_adjust", text_glow: "text_glow", cc4b_gs_edit: "cc4b_gs_edit", shape: "shape", "shape-animation": "shape-animation", "path-animation": "path-animation", curve_adjust_preset: "curve_adjust_preset", aiavatarmask: "aiavatarmask", }; }, 810413: function (e, t, i) { "use strict"; i.d(t, { AF: function () { return n; }, }); let n = 548669; }, 815112: function (e, t) { "use strict"; t.Z = { promptWithImgWrapperHeight: "24px", promptWithImgWrapperWidth: "123px", promptSeedIconSize: "12px", videoPromptPaddingVertical: "12px", videoControlsHeight: "32px", videoPaddingTop: "20px", videoMarginBottom: "28px", generateListPadding: "24px", generateListDateWidth: "46px", videoContainerPaddingRight: "86px", feedCarouselHeight: "220px", videoFeedHeaderHeight: "45px", generatePanelMarginLeft: "16px", masonryGap: "8px", generationEntryHeight: "172px", generationEntryMarginBottom: "16px", videoMenuItemWidth: "184px", videoMenuWidth: "160px", exploreFeedTabHeight: "32px", exploreFeedTabPaddingBottom: "20px", headerHeight: "76px", exploreFeedCategoryHeight: "32px", exploreFeedCategoryPaddingBottom: "16px", videoMoreWidth: "16px", generateListPaddingTop: "4px", videoFailPaddingH: "12px", videoFailPaddingV: "8px", videoFailIconMargin: "8px", videoFailIconSize: "16px", personalMarginTop: "100px", personalProfileHeight: "250px", personalProfileWidthLarge: "360px", personalProfileWidthSmall: "320px", personalProfileWidthBreakPoint: "1536px", personalScrollHeaderGap: "24px", storyEditorPadding: "8px", storyExSmallScreenWidth: "1146px", storySmallScreenWidth: "1280px", storyMiddleScreenWidth: "1280px", storyLargeScreenWidth: "1280px", storyExLargeScreenWidth: "1536px", storySmallPromptWidth: "240px", storyMiddlePromptWidth: "280px", storyLargePromptWidth: "320px", pageIconColor: "#8f9ca5", videoRelaxProcessingHeight: "68px", timelineLargeGap: "16px", timelineThumbnailHeightTime: "125px", timelineScrollWidth: "6px", timelineInsertSegmentBtnWidth: "16px", characterGenerateModalPanelWidth: "280px", characterGenerateModalHeaderHeight: "48px", largestScreenWidth: "1920px", largeContainerWidth: "1650px", smallScreenWidth: "1024px", scrollBarWidth: "2px", "largeScreenGenerate-Width": "1398px", largeScreenGenerateWidth: "1398px", middleScreenGenerateWidth: "1366px", smallestScreenGenerateWidth: "1024px", generateVideoCardMaxWidth: "526px", generateVideoCardMinWidth: "383px", generateCardMarginLeft: "12px", generateCardSideBarWidth: "24px", generateCardHoverButtonSize: "28px", generateCardBgmButtonWidth: "68px", storyboardContainerPadding: "16px", storyboardGap: "4px", generateContainerAnimationDuration: ".5s", videoPromptTabHeight: "36px", videoPromptTabMarginBottom: "8px", agentChatMinHeight: "132px", promptTabHeight: "44px", contextMenu: "contextMenu-UrULv8", contextMenuDivide: "contextMenuDivide-TSc7DW", rotating: "rotating-M0Gk_b", }; }, 331730: function (e, t) { "use strict"; t.Z = { menu: "menu-SDQR5C", menuItem: "menuItem-CEBGRb" }; }, 570878: function (e, t) { "use strict"; t.Z = { graphicToolIconActive: "graphicToolIconActive-xsS5fZ", graphicToolIconHover: "graphicToolIconHover-V1S3Gf", paintStandardButton: "paintStandardButton-VgxmId", closeBtn: "closeBtn-k9tzKH", paintStandardButtonIcon: "paintStandardButtonIcon-Vd4HqF", }; }, 79532: function (e, t) { "use strict"; t.Z = { promptWithImgWrapperHeight: "24px", promptWithImgWrapperWidth: "123px", promptSeedIconSize: "12px", videoPromptPaddingVertical: "12px", videoControlsHeight: "32px", videoPaddingTop: "20px", videoMarginBottom: "28px", generateListPadding: "24px", generateListDateWidth: "46px", videoContainerPaddingRight: "86px", feedCarouselHeight: "220px", videoFeedHeaderHeight: "45px", generatePanelMarginLeft: "16px", masonryGap: "8px", generationEntryHeight: "172px", generationEntryMarginBottom: "16px", videoMenuItemWidth: "184px", videoMenuWidth: "160px", exploreFeedTabHeight: "32px", exploreFeedTabPaddingBottom: "20px", headerHeight: "76px", exploreFeedCategoryHeight: "32px", exploreFeedCategoryPaddingBottom: "16px", videoMoreWidth: "16px", generateListPaddingTop: "4px", videoFailPaddingH: "12px", videoFailPaddingV: "8px", videoFailIconMargin: "8px", videoFailIconSize: "16px", personalMarginTop: "100px", personalProfileHeight: "250px", personalProfileWidthLarge: "360px", personalProfileWidthSmall: "320px", personalProfileWidthBreakPoint: "1536px", personalScrollHeaderGap: "24px", storyEditorPadding: "8px", storyExSmallScreenWidth: "1146px", storySmallScreenWidth: "1280px", storyMiddleScreenWidth: "1280px", storyLargeScreenWidth: "1280px", storyExLargeScreenWidth: "1536px", storySmallPromptWidth: "240px", storyMiddlePromptWidth: "280px", storyLargePromptWidth: "320px", pageIconColor: "#8f9ca5", videoRelaxProcessingHeight: "68px", timelineLargeGap: "16px", timelineThumbnailHeightTime: "125px", timelineScrollWidth: "6px", timelineInsertSegmentBtnWidth: "16px", characterGenerateModalPanelWidth: "280px", characterGenerateModalHeaderHeight: "48px", largestScreenWidth: "1920px", largeContainerWidth: "1650px", smallScreenWidth: "1024px", scrollBarWidth: "2px", "largeScreenGenerate-Width": "1398px", largeScreenGenerateWidth: "1398px", middleScreenGenerateWidth: "1366px", smallestScreenGenerateWidth: "1024px", generateVideoCardMaxWidth: "526px", generateVideoCardMinWidth: "383px", generateCardMarginLeft: "12px", generateCardSideBarWidth: "24px", generateCardHoverButtonSize: "28px", generateCardBgmButtonWidth: "68px", storyboardContainerPadding: "16px", storyboardGap: "4px", generateContainerAnimationDuration: ".5s", videoPromptTabHeight: "36px", videoPromptTabMarginBottom: "8px", agentChatMinHeight: "132px", promptTabHeight: "44px", textLabelContainer: "textLabelContainer-f3FvpQ", textLabel: "textLabel-PPnrOg", forceInputIcon: "forceInputIcon-zHuVo_", rotating: "rotating-AQMLNQ", }; }, 53453: function (e, t, i) { var n = t; (n.bignum = i(984826)), (n.define = i(10938).define), (n.base = i(701926)), (n.constants = i(585202)), (n.decoders = i(897128)), (n.encoders = i(20815)); }, 10938: function (e, t, i) { var n = i(53453), r = i(32016); function a(e, t) { (this.name = e), (this.body = t), (this.decoders = {}), (this.encoders = {}); } (t.define = function (e, t) { return new a(e, t); }), (a.prototype._createNamed = function (e) { var t; try { t = i(185608).runInThisContext( "(function " + this.name + "(entity) {\n this._initNamed(entity);\n})" ); } catch (e) { t = function (e) { this._initNamed(e); }; } return ( r(t, e), (t.prototype._initNamed = function (t) { e.call(this, t); }), new t(this) ); }), (a.prototype._getDecoder = function (e) { return ( (e = e || "der"), !this.decoders.hasOwnProperty(e) && (this.decoders[e] = this._createNamed(n.decoders[e])), this.decoders[e] ); }), (a.prototype.decode = function (e, t, i) { return this._getDecoder(t).decode(e, i); }), (a.prototype._getEncoder = function (e) { return ( (e = e || "der"), !this.encoders.hasOwnProperty(e) && (this.encoders[e] = this._createNamed(n.encoders[e])), this.encoders[e] ); }), (a.prototype.encode = function (e, t, i) { return this._getEncoder(t).encode(e, i); }); }, 987090: function (e, t, i) { var n = i(32016), r = i(701926).Reporter, a = i(966465).Buffer; function o(e, t) { if ((r.call(this, t), !a.isBuffer(e))) { this.error("Input not Buffer"); return; } (this.base = e), (this.offset = 0), (this.length = e.length); } function s(e, t) { if (Array.isArray(e)) (this.length = 0), (this.value = e.map(function (e) { return ( !(e instanceof s) && (e = new s(e, t)), (this.length += e.length), e ); }, this)); else if ("number" == typeof e) { if (!(0 <= e && e <= 255)) return t.error("non-byte EncoderBuffer value"); (this.value = e), (this.length = 1); } else if ("string" == typeof e) (this.value = e), (this.length = a.byteLength(e)); else { if (!a.isBuffer(e)) return t.error("Unsupported type: " + typeof e); (this.value = e), (this.length = e.length); } } n(o, r), (t.DecoderBuffer = o), (o.prototype.save = function () { return { offset: this.offset, reporter: r.prototype.save.call(this) }; }), (o.prototype.restore = function (e) { var t = new o(this.base); return ( (t.offset = e.offset), (t.length = this.offset), (this.offset = e.offset), r.prototype.restore.call(this, e.reporter), t ); }), (o.prototype.isEmpty = function () { return this.offset === this.length; }), (o.prototype.readUInt8 = function (e) { return this.offset + 1 <= this.length ? this.base.readUInt8(this.offset++, !0) : this.error(e || "DecoderBuffer overrun"); }), (o.prototype.skip = function (e, t) { if (!(this.offset + e <= this.length)) return this.error(t || "DecoderBuffer overrun"); var i = new o(this.base); return ( (i._reporterState = this._reporterState), (i.offset = this.offset), (i.length = this.offset + e), (this.offset += e), i ); }), (o.prototype.raw = function (e) { return this.base.slice(e ? e.offset : this.offset, this.length); }), (t.EncoderBuffer = s), (s.prototype.join = function (e, t) { return (!e && (e = new a(this.length)), !t && (t = 0), 0 === this.length) ? e : (Array.isArray(this.value) ? this.value.forEach(function (i) { i.join(e, t), (t += i.length); }) : ("number" == typeof this.value ? (e[t] = this.value) : "string" == typeof this.value ? e.write(this.value, t) : a.isBuffer(this.value) && this.value.copy(e, t), (t += this.length)), e); }); }, 701926: function (e, t, i) { var n = t; (n.Reporter = i(188555).Reporter), (n.DecoderBuffer = i(987090).DecoderBuffer), (n.EncoderBuffer = i(987090).EncoderBuffer), (n.Node = i(311588)); }, 311588: function (e, t, i) { var n = i(701926).Reporter, r = i(701926).EncoderBuffer, a = i(701926).DecoderBuffer, o = i(422555), s = [ "seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr", ], l = [ "key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains", ].concat(s), c = [ "_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool", ]; function d(e, t) { var i = {}; (this._baseState = i), (i.enc = e), (i.parent = t || null), (i.children = null), (i.tag = null), (i.args = null), (i.reverseArgs = null), (i.choice = null), (i.optional = !1), (i.any = !1), (i.obj = !1), (i.use = null), (i.useDecoder = null), (i.key = null), (i.default = null), (i.explicit = null), (i.implicit = null), (i.contains = null), !i.parent && ((i.children = []), this._wrap()); } e.exports = d; var u = [ "enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains", ]; (d.prototype.clone = function () { var e = this._baseState, t = {}; u.forEach(function (i) { t[i] = e[i]; }); var i = new this.constructor(t.parent); return (i._baseState = t), i; }), (d.prototype._wrap = function () { var e = this._baseState; l.forEach(function (t) { this[t] = function () { var i = new this.constructor(this); return e.children.push(i), i[t].apply(i, arguments); }; }, this); }), (d.prototype._init = function (e) { var t = this._baseState; o(null === t.parent), e.call(this), (t.children = t.children.filter(function (e) { return e._baseState.parent === this; }, this)), o.equal(t.children.length, 1, "Root node can have only one child"); }), (d.prototype._useArgs = function (e) { var t = this._baseState, i = e.filter(function (e) { return e instanceof this.constructor; }, this); (e = e.filter(function (e) { return !(e instanceof this.constructor); }, this)), 0 !== i.length && (o(null === t.children), (t.children = i), i.forEach(function (e) { e._baseState.parent = this; }, this)), 0 !== e.length && (o(null === t.args), (t.args = e), (t.reverseArgs = e.map(function (e) { if ("object" != typeof e || e.constructor !== Object) return e; var t = {}; return ( Object.keys(e).forEach(function (i) { i == (0 | i) && (i |= 0), (t[e[i]] = i); }), t ); }))); }), c.forEach(function (e) { d.prototype[e] = function () { throw Error( e + " not implemented for encoding: " + this._baseState.enc ); }; }), s.forEach(function (e) { d.prototype[e] = function () { var t = this._baseState, i = Array.prototype.slice.call(arguments); return o(null === t.tag), (t.tag = e), this._useArgs(i), this; }; }), (d.prototype.use = function (e) { o(e); var t = this._baseState; return o(null === t.use), (t.use = e), this; }), (d.prototype.optional = function () { return (this._baseState.optional = !0), this; }), (d.prototype.def = function (e) { var t = this._baseState; return ( o(null === t.default), (t.default = e), (t.optional = !0), this ); }), (d.prototype.explicit = function (e) { var t = this._baseState; return ( o(null === t.explicit && null === t.implicit), (t.explicit = e), this ); }), (d.prototype.implicit = function (e) { var t = this._baseState; return ( o(null === t.explicit && null === t.implicit), (t.implicit = e), this ); }), (d.prototype.obj = function () { var e = this._baseState, t = Array.prototype.slice.call(arguments); return (e.obj = !0), 0 !== t.length && this._useArgs(t), this; }), (d.prototype.key = function (e) { var t = this._baseState; return o(null === t.key), (t.key = e), this; }), (d.prototype.any = function () { return (this._baseState.any = !0), this; }), (d.prototype.choice = function (e) { var t = this._baseState; return ( o(null === t.choice), (t.choice = e), this._useArgs( Object.keys(e).map(function (t) { return e[t]; }) ), this ); }), (d.prototype.contains = function (e) { var t = this._baseState; return o(null === t.use), (t.contains = e), this; }), (d.prototype._decode = function (e, t) { var i, n = this._baseState; if (null === n.parent) return e.wrapResult(n.children[0]._decode(e, t)); var r = n.default, o = !0, s = null; if ((null !== n.key && (s = e.enterKey(n.key)), n.optional)) { var l = null; if ( (null !== n.explicit ? (l = n.explicit) : null !== n.implicit ? (l = n.implicit) : null !== n.tag && (l = n.tag), null !== l || n.any) ) { if (((o = this._peekTag(e, l, n.any)), e.isError(o))) return o; } else { var c = e.save(); try { null === n.choice ? this._decodeGeneric(n.tag, e, t) : this._decodeChoice(e, t), (o = !0); } catch (e) { o = !1; } e.restore(c); } } if ((n.obj && o && (i = e.enterObject()), o)) { if (null !== n.explicit) { var d = this._decodeTag(e, n.explicit); if (e.isError(d)) return d; e = d; } var u = e.offset; if (null === n.use && null === n.choice) { if (n.any) var c = e.save(); var f = this._decodeTag( e, null !== n.implicit ? n.implicit : n.tag, n.any ); if (e.isError(f)) return f; n.any ? (r = e.raw(c)) : (e = f); } if ( (t && t.track && null !== n.tag && t.track(e.path(), u, e.length, "tagged"), t && t.track && null !== n.tag && t.track(e.path(), e.offset, e.length, "content"), n.any || (r = null === n.choice ? this._decodeGeneric(n.tag, e, t) : this._decodeChoice(e, t)), e.isError(r)) ) return r; if ( (!n.any && null === n.choice && null !== n.children && n.children.forEach(function (i) { i._decode(e, t); }), n.contains && ("octstr" === n.tag || "bitstr" === n.tag)) ) { var h = new a(r); r = this._getUse(n.contains, e._reporterState.obj)._decode(h, t); } } return ( n.obj && o && (r = e.leaveObject(i)), null !== n.key && (null !== r || !0 === o) ? e.leaveKey(s, n.key, r) : null !== s && e.exitKey(s), r ); }), (d.prototype._decodeGeneric = function (e, t, i) { var n = this._baseState; if ("seq" === e || "set" === e) return null; if ("seqof" === e || "setof" === e) return this._decodeList(t, e, n.args[0], i); if (/str$/.test(e)) return this._decodeStr(t, e, i); if ("objid" === e && n.args) return this._decodeObjid(t, n.args[0], n.args[1], i); else if ("objid" === e) return this._decodeObjid(t, null, null, i); else if ("gentime" === e || "utctime" === e) return this._decodeTime(t, e, i); else if ("null_" === e) return this._decodeNull(t, i); else if ("bool" === e) return this._decodeBool(t, i); else if ("objDesc" === e) return this._decodeStr(t, e, i); else if ("int" === e || "enum" === e) return this._decodeInt(t, n.args && n.args[0], i); return null !== n.use ? this._getUse(n.use, t._reporterState.obj)._decode(t, i) : t.error("unknown tag: " + e); }), (d.prototype._getUse = function (e, t) { var i = this._baseState; return ( (i.useDecoder = this._use(e, t)), o(null === i.useDecoder._baseState.parent), (i.useDecoder = i.useDecoder._baseState.children[0]), i.implicit !== i.useDecoder._baseState.implicit && ((i.useDecoder = i.useDecoder.clone()), (i.useDecoder._baseState.implicit = i.implicit)), i.useDecoder ); }), (d.prototype._decodeChoice = function (e, t) { var i = this._baseState, n = null, r = !1; return (Object.keys(i.choice).some(function (a) { var o = e.save(), s = i.choice[a]; try { var l = s._decode(e, t); if (e.isError(l)) return !1; (n = { type: a, value: l }), (r = !0); } catch (t) { return e.restore(o), !1; } return !0; }, this), r) ? n : e.error("Choice not matched"); }), (d.prototype._createEncoderBuffer = function (e) { return new r(e, this.reporter); }), (d.prototype._encode = function (e, t, i) { var n = this._baseState; if (null !== n.default && n.default === e) return; var r = this._encodeValue(e, t, i); if (void 0 !== r) { if (!this._skipDefault(r, t, i)) return r; } }), (d.prototype._encodeValue = function (e, t, i) { var r, a = this._baseState; if (null === a.parent) return a.children[0]._encode(e, t || new n()); var r = null; if (((this.reporter = t), a.optional && void 0 === e)) { if (null === a.default) return; e = a.default; } var o = null, s = !1; if (a.any) r = this._createEncoderBuffer(e); else if (a.choice) r = this._encodeChoice(e, t); else if (a.contains) (o = this._getUse(a.contains, i)._encode(e, t)), (s = !0); else if (a.children) (o = a.children .map(function (i) { if ("null_" === i._baseState.tag) return i._encode(null, t, e); if (null === i._baseState.key) return t.error("Child should have a key"); var n = t.enterKey(i._baseState.key); if ("object" != typeof e) return t.error("Child expected, but input is not object"); var r = i._encode(e[i._baseState.key], t, e); return t.leaveKey(n), r; }, this) .filter(function (e) { return e; })), (o = this._createEncoderBuffer(o)); else if ("seqof" === a.tag || "setof" === a.tag) { if (!(a.args && 1 === a.args.length)) return t.error("Too many args for : " + a.tag); if (!Array.isArray(e)) return t.error("seqof/setof, but data is not Array"); var l = this.clone(); (l._baseState.implicit = null), (o = this._createEncoderBuffer( e.map(function (i) { var n = this._baseState; return this._getUse(n.args[0], e)._encode(i, t); }, l) )); } else null !== a.use ? (r = this._getUse(a.use, i)._encode(e, t)) : ((o = this._encodePrimitive(a.tag, e)), (s = !0)); if (!a.any && null === a.choice) { var c = null !== a.implicit ? a.implicit : a.tag, d = null === a.implicit ? "universal" : "context"; null === c ? null === a.use && t.error("Tag could be omitted only for .use()") : null === a.use && (r = this._encodeComposite(c, s, d, o)); } return ( null !== a.explicit && (r = this._encodeComposite(a.explicit, !1, "context", r)), r ); }), (d.prototype._encodeChoice = function (e, t) { var i = this._baseState, n = i.choice[e.type]; return ( !n && o( !1, e.type + " not found in " + JSON.stringify(Object.keys(i.choice)) ), n._encode(e.value, t) ); }), (d.prototype._encodePrimitive = function (e, t) { var i = this._baseState; if (/str$/.test(e)) return this._encodeStr(t, e); if ("objid" === e && i.args) return this._encodeObjid(t, i.reverseArgs[0], i.args[1]); if ("objid" === e) return this._encodeObjid(t, null, null); else if ("gentime" === e || "utctime" === e) return this._encodeTime(t, e); else if ("null_" === e) return this._encodeNull(); else if ("int" === e || "enum" === e) return this._encodeInt(t, i.args && i.reverseArgs[0]); else if ("bool" === e) return this._encodeBool(t); else if ("objDesc" === e) return this._encodeStr(t, e); else throw Error("Unsupported tag: " + e); }), (d.prototype._isNumstr = function (e) { return /^[0-9 ]*$/.test(e); }), (d.prototype._isPrintstr = function (e) { return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e); }); }, 188555: function (e, t, i) { var n = i(32016); function r(e) { this._reporterState = { obj: null, path: [], options: e || {}, errors: [], }; } function a(e, t) { (this.path = e), this.rethrow(t); } (t.Reporter = r), (r.prototype.isError = function (e) { return e instanceof a; }), (r.prototype.save = function () { var e = this._reporterState; return { obj: e.obj, pathLen: e.path.length }; }), (r.prototype.restore = function (e) { var t = this._reporterState; (t.obj = e.obj), (t.path = t.path.slice(0, e.pathLen)); }), (r.prototype.enterKey = function (e) { return this._reporterState.path.push(e); }), (r.prototype.exitKey = function (e) { var t = this._reporterState; t.path = t.path.slice(0, e - 1); }), (r.prototype.leaveKey = function (e, t, i) { var n = this._reporterState; this.exitKey(e), null !== n.obj && (n.obj[t] = i); }), (r.prototype.path = function () { return this._reporterState.path.join("/"); }), (r.prototype.enterObject = function () { var e = this._reporterState, t = e.obj; return (e.obj = {}), t; }), (r.prototype.leaveObject = function (e) { var t = this._reporterState, i = t.obj; return (t.obj = e), i; }), (r.prototype.error = function (e) { var t, i = this._reporterState, n = e instanceof a; if ( ((t = n ? e : new a( i.path .map(function (e) { return "[" + JSON.stringify(e) + "]"; }) .join(""), e.message || e, e.stack )), !i.options.partial) ) throw t; return !n && i.errors.push(t), t; }), (r.prototype.wrapResult = function (e) { var t = this._reporterState; return t.options.partial ? { result: this.isError(e) ? null : e, errors: t.errors } : e; }), n(a, Error), (a.prototype.rethrow = function (e) { if ( ((this.message = e + " at: " + (this.path || "(shallow)")), Error.captureStackTrace && Error.captureStackTrace(this, a), !this.stack) ) try { throw Error(this.message); } catch (e) { this.stack = e.stack; } return this; }); }, 994440: function (e, t, i) { var n = i(585202); (t.tagClass = { 0: "universal", 1: "application", 2: "context", 3: "private", }), (t.tagClassByName = n._reverse(t.tagClass)), (t.tag = { 0: "end", 1: "bool", 2: "int", 3: "bitstr", 4: "octstr", 5: "null_", 6: "objid", 7: "objDesc", 8: "external", 9: "real", 10: "enum", 11: "embed", 12: "utf8str", 13: "relativeOid", 16: "seq", 17: "set", 18: "numstr", 19: "printstr", 20: "t61str", 21: "videostr", 22: "ia5str", 23: "utctime", 24: "gentime", 25: "graphstr", 26: "iso646str", 27: "genstr", 28: "unistr", 29: "charstr", 30: "bmpstr", }), (t.tagByName = n._reverse(t.tag)); }, 585202: function (e, t, i) { var n = t; (n._reverse = function (e) { var t = {}; return ( Object.keys(e).forEach(function (i) { (0 | i) == i && (i |= 0), (t[e[i]] = i); }), t ); }), (n.der = i(994440)); }, 821712: function (e, t, i) { var n = i(32016), r = i(53453), a = r.base, o = r.bignum, s = r.constants.der; function l(e) { (this.enc = "der"), (this.name = e.name), (this.entity = e), (this.tree = new c()), this.tree._init(e.body); } function c(e) { a.Node.call(this, "der", e); } function d(e, t) { var i = e.readUInt8(t); if (e.isError(i)) return i; var n = s.tagClass[i >> 6], r = (32 & i) == 0; if ((31 & i) == 31) { var a = i; for (i = 0; (128 & a) == 128; ) { if (((a = e.readUInt8(t)), e.isError(a))) return a; (i <<= 7), (i |= 127 & a); } } else i &= 31; var o = s.tag[i]; return { cls: n, primitive: r, tag: i, tagStr: o }; } function u(e, t, i) { var n = e.readUInt8(i); if (e.isError(n)) return n; if (!t && 128 === n) return null; if ((128 & n) == 0) return n; var r = 127 & n; if (r > 4) return e.error("length octect is too long"); n = 0; for (var a = 0; a < r; a++) { n <<= 8; var o = e.readUInt8(i); if (e.isError(o)) return o; n |= o; } return n; } (e.exports = l), (l.prototype.decode = function (e, t) { return ( !(e instanceof a.DecoderBuffer) && (e = new a.DecoderBuffer(e, t)), this.tree._decode(e, t) ); }), n(c, a.Node), (c.prototype._peekTag = function (e, t, i) { if (e.isEmpty()) return !1; var n = e.save(), r = d(e, 'Failed to peek tag: "' + t + '"'); return e.isError(r) ? r : (e.restore(n), r.tag === t || r.tagStr === t || r.tagStr + "of" === t || i); }), (c.prototype._decodeTag = function (e, t, i) { var n = d(e, 'Failed to decode tag of "' + t + '"'); if (e.isError(n)) return n; var r = u(e, n.primitive, 'Failed to get length of "' + t + '"'); if (e.isError(r)) return r; if (!i && n.tag !== t && n.tagStr !== t && n.tagStr + "of" !== t) return e.error('Failed to match tag: "' + t + '"'); if (n.primitive || null !== r) return e.skip(r, 'Failed to match body of: "' + t + '"'); var a = e.save(), o = this._skipUntilEnd( e, 'Failed to skip indefinite length body: "' + this.tag + '"' ); return e.isError(o) ? o : ((r = e.offset - a.offset), e.restore(a), e.skip(r, 'Failed to match body of: "' + t + '"')); }), (c.prototype._skipUntilEnd = function (e, t) { for (;;) { var i, n = d(e, t); if (e.isError(n)) return n; var r = u(e, n.primitive, t); if (e.isError(r)) return r; if ( ((i = n.primitive || null !== r ? e.skip(r) : this._skipUntilEnd(e, t)), e.isError(i)) ) return i; if ("end" === n.tagStr) break; } }), (c.prototype._decodeList = function (e, t, i, n) { for (var r = []; !e.isEmpty(); ) { var a = this._peekTag(e, "end"); if (e.isError(a)) return a; var o = i.decode(e, "der", n); if (e.isError(o) && a) break; r.push(o); } return r; }), (c.prototype._decodeStr = function (e, t) { if ("bitstr" === t) { var i = e.readUInt8(); return e.isError(i) ? i : { unused: i, data: e.raw() }; } if ("bmpstr" === t) { var n = e.raw(); if (n.length % 2 == 1) return e.error("Decoding of string type: bmpstr length mismatch"); for (var r = "", a = 0; a < n.length / 2; a++) r += String.fromCharCode(n.readUInt16BE(2 * a)); return r; } if ("numstr" === t) { var o = e.raw().toString("ascii"); return this._isNumstr(o) ? o : e.error( "Decoding of string type: numstr unsupported characters" ); } else if ("octstr" === t) return e.raw(); else if ("objDesc" === t) return e.raw(); else if ("printstr" === t) { var s = e.raw().toString("ascii"); return this._isPrintstr(s) ? s : e.error( "Decoding of string type: printstr unsupported characters" ); } else if (/str$/.test(t)) return e.raw().toString(); else return e.error("Decoding of string type: " + t + " unsupported"); }), (c.prototype._decodeObjid = function (e, t, i) { for (var n, r = [], a = 0; !e.isEmpty(); ) { var o = e.readUInt8(); (a <<= 7), (a |= 127 & o), (128 & o) == 0 && (r.push(a), (a = 0)); } 128 & o && r.push(a); var s = (r[0] / 40) | 0, l = r[0] % 40; if (((n = i ? r : [s, l].concat(r.slice(1))), t)) { var c = t[n.join(" ")]; void 0 === c && (c = t[n.join(".")]), void 0 !== c && (n = c); } return n; }), (c.prototype._decodeTime = function (e, t) { var i = e.raw().toString(); if ("gentime" === t) { var n = 0 | i.slice(0, 4), r = 0 | i.slice(4, 6), a = 0 | i.slice(6, 8), o = 0 | i.slice(8, 10), s = 0 | i.slice(10, 12), l = 0 | i.slice(12, 14); } else { if ("utctime" !== t) return e.error("Decoding " + t + " time is not supported yet"); var n = 0 | i.slice(0, 2), r = 0 | i.slice(2, 4), a = 0 | i.slice(4, 6), o = 0 | i.slice(6, 8), s = 0 | i.slice(8, 10), l = 0 | i.slice(10, 12); n = n < 70 ? 2e3 + n : 1900 + n; } return Date.UTC(n, r - 1, a, o, s, l, 0); }), (c.prototype._decodeNull = function (e) { return null; }), (c.prototype._decodeBool = function (e) { var t = e.readUInt8(); return e.isError(t) ? t : 0 !== t; }), (c.prototype._decodeInt = function (e, t) { var i = new o(e.raw()); return t && (i = t[i.toString(10)] || i), i; }), (c.prototype._use = function (e, t) { return ( "function" == typeof e && (e = e(t)), e._getDecoder("der").tree ); }); }, 897128: function (e, t, i) { var n = t; (n.der = i(821712)), (n.pem = i(19682)); }, 19682: function (e, t, i) { var n = i(32016), r = i(966465).Buffer, a = i(821712); function o(e) { a.call(this, e), (this.enc = "pem"); } n(o, a), (e.exports = o), (o.prototype.decode = function (e, t) { for ( var i = e.toString().split(/[\r\n]+/g), n = t.label.toUpperCase(), o = /^-----(BEGIN|END) ([^-]+)-----$/, s = -1, l = -1, c = 0; c < i.length; c++ ) { var d = i[c].match(o); if (null !== d) { if (d[2] === n) { if (-1 === s) { if ("BEGIN" !== d[1]) break; s = c; } else { if ("END" !== d[1]) break; l = c; break; } } } } if (-1 === s || -1 === l) throw Error("PEM section not found for: " + n); var u = i.slice(s + 1, l).join(""); u.replace(/[^a-z0-9\+\/=]+/gi, ""); var f = new r(u, "base64"); return a.prototype.decode.call(this, f, t); }); }, 128884: function (e, t, i) { var n = i(32016), r = i(966465).Buffer, a = i(53453), o = a.base, s = a.constants.der; function l(e) { (this.enc = "der"), (this.name = e.name), (this.entity = e), (this.tree = new c()), this.tree._init(e.body); } function c(e) { o.Node.call(this, "der", e); } function d(e) { return e < 10 ? "0" + e : e; } function u(e, t, i, n) { var r; if ( ("seqof" === e ? (e = "seq") : "setof" === e && (e = "set"), s.tagByName.hasOwnProperty(e)) ) r = s.tagByName[e]; else { if ("number" != typeof e || (0 | e) !== e) return n.error("Unknown tag: " + e); r = e; } return r >= 31 ? n.error("Multi-octet tag encoding unsupported") : (!t && (r |= 32), (r |= s.tagClassByName[i || "universal"] << 6)); } (e.exports = l), (l.prototype.encode = function (e, t) { return this.tree._encode(e, t).join(); }), n(c, o.Node), (c.prototype._encodeComposite = function (e, t, i, n) { var a = u(e, t, i, this.reporter); if (n.length < 128) { var o = new r(2); return ( (o[0] = a), (o[1] = n.length), this._createEncoderBuffer([o, n]) ); } for (var s = 1, l = n.length; l >= 256; l >>= 8) s++; var o = new r(2 + s); (o[0] = a), (o[1] = 128 | s); for (var l = 1 + s, c = n.length; c > 0; l--, c >>= 8) o[l] = 255 & c; return this._createEncoderBuffer([o, n]); }), (c.prototype._encodeStr = function (e, t) { if ("bitstr" === t) return this._createEncoderBuffer([0 | e.unused, e.data]); if ("bmpstr" === t) { for (var i = new r(2 * e.length), n = 0; n < e.length; n++) i.writeUInt16BE(e.charCodeAt(n), 2 * n); return this._createEncoderBuffer(i); } if ("numstr" === t) return this._isNumstr(e) ? this._createEncoderBuffer(e) : this.reporter.error( "Encoding of string type: numstr supports only digits and space" ); else if ("printstr" === t) return this._isPrintstr(e) ? this._createEncoderBuffer(e) : this.reporter.error( "Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark" ); else if (/str$/.test(t)) return this._createEncoderBuffer(e); else if ("objDesc" === t) return this._createEncoderBuffer(e); else return this.reporter.error( "Encoding of string type: " + t + " unsupported" ); }), (c.prototype._encodeObjid = function (e, t, i) { if ("string" == typeof e) { if (!t) return this.reporter.error( "string objid given, but no values map found" ); if (!t.hasOwnProperty(e)) return this.reporter.error("objid not found in values map"); e = t[e].split(/[\s\.]+/g); for (var n = 0; n < e.length; n++) e[n] |= 0; } else if (Array.isArray(e)) { e = e.slice(); for (var n = 0; n < e.length; n++) e[n] |= 0; } if (!Array.isArray(e)) return this.reporter.error( "objid() should be either array or string, got: " + JSON.stringify(e) ); if (!i) { if (e[1] >= 40) return this.reporter.error("Second objid identifier OOB"); e.splice(0, 2, 40 * e[0] + e[1]); } for (var a = 0, n = 0; n < e.length; n++) { var o = e[n]; for (a++; o >= 128; o >>= 7) a++; } for ( var s = new r(a), l = s.length - 1, n = e.length - 1; n >= 0; n-- ) { var o = e[n]; for (s[l--] = 127 & o; (o >>= 7) > 0; ) s[l--] = 128 | (127 & o); } return this._createEncoderBuffer(s); }), (c.prototype._encodeTime = function (e, t) { var i, n = new Date(e); return ( "gentime" === t ? (i = [ d(n.getFullYear()), d(n.getUTCMonth() + 1), d(n.getUTCDate()), d(n.getUTCHours()), d(n.getUTCMinutes()), d(n.getUTCSeconds()), "Z", ].join("")) : "utctime" === t ? (i = [ d(n.getFullYear() % 100), d(n.getUTCMonth() + 1), d(n.getUTCDate()), d(n.getUTCHours()), d(n.getUTCMinutes()), d(n.getUTCSeconds()), "Z", ].join("")) : this.reporter.error( "Encoding " + t + " time is not supported yet" ), this._encodeStr(i, "octstr") ); }), (c.prototype._encodeNull = function () { return this._createEncoderBuffer(""); }), (c.prototype._encodeInt = function (e, t) { if ("string" == typeof e) { if (!t) return this.reporter.error( "String int or enum given, but no values map" ); if (!t.hasOwnProperty(e)) return this.reporter.error( "Values map doesn't contain: " + JSON.stringify(e) ); e = t[e]; } if ("number" != typeof e && !r.isBuffer(e)) { var i = e.toArray(); !e.sign && 128 & i[0] && i.unshift(0), (e = new r(i)); } if (r.isBuffer(e)) { var n = e.length; 0 === e.length && n++; var a = new r(n); return ( e.copy(a), 0 === e.length && (a[0] = 0), this._createEncoderBuffer(a) ); } if (e < 128) return this._createEncoderBuffer(e); if (e < 256) return this._createEncoderBuffer([0, e]); for (var n = 1, o = e; o >= 256; o >>= 8) n++; for (var a = Array(n), o = a.length - 1; o >= 0; o--) (a[o] = 255 & e), (e >>= 8); return ( 128 & a[0] && a.unshift(0), this._createEncoderBuffer(new r(a)) ); }), (c.prototype._encodeBool = function (e) { return this._createEncoderBuffer(e ? 255 : 0); }), (c.prototype._use = function (e, t) { return ( "function" == typeof e && (e = e(t)), e._getEncoder("der").tree ); }), (c.prototype._skipDefault = function (e, t, i) { var n, r = this._baseState; if (null === r.default) return !1; var a = e.join(); if ( (void 0 === r.defaultBuffer && (r.defaultBuffer = this._encodeValue(r.default, t, i).join()), a.length !== r.defaultBuffer.length) ) return !1; for (n = 0; n < a.length; n++) if (a[n] !== r.defaultBuffer[n]) return !1; return !0; }); }, 20815: function (e, t, i) { var n = t; (n.der = i(128884)), (n.pem = i(871382)); }, 871382: function (e, t, i) { var n = i(32016), r = i(128884); function a(e) { r.call(this, e), (this.enc = "pem"); } n(a, r), (e.exports = a), (a.prototype.encode = function (e, t) { for ( var i = r.prototype.encode.call(this, e).toString("base64"), n = ["-----BEGIN " + t.label + "-----"], a = 0; a < i.length; a += 64 ) n.push(i.slice(a, a + 64)); return n.push("-----END " + t.label + "-----"), n.join("\n"); }); }, 984826: function (e, t, i) { !(function (e, t) { "use strict"; function n(e, t) { if (!e) throw Error(t || "Assertion failed"); } function r(e, t) { e.super_ = t; var i = function () {}; (i.prototype = t.prototype), (e.prototype = new i()), (e.prototype.constructor = e); } function a(e, t, i) { if (a.isBN(e)) return e; (this.negative = 0), (this.words = null), (this.length = 0), (this.red = null), null !== e && (("le" === t || "be" === t) && ((i = t), (t = 10)), this._init(e || 0, t || 10, i || "be")); } "object" == typeof e ? (e.exports = a) : (t.BN = a), (a.BN = a), (a.wordSize = 26); try { c = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : i(678244).Buffer; } catch (e) {} function o(e, t) { var i = e.charCodeAt(t); return i >= 65 && i <= 70 ? i - 55 : i >= 97 && i <= 102 ? i - 87 : (i - 48) & 15; } function s(e, t, i) { var n = o(e, i); return i - 1 >= t && (n |= o(e, i - 1) << 4), n; } function l(e, t, i, n) { for (var r = 0, a = Math.min(e.length, i), o = t; o < a; o++) { var s = e.charCodeAt(o) - 48; (r *= n), s >= 49 ? (r += s - 49 + 10) : s >= 17 ? (r += s - 17 + 10) : (r += s); } return r; } (a.isBN = function (e) { return ( e instanceof a || (null !== e && "object" == typeof e && e.constructor.wordSize === a.wordSize && Array.isArray(e.words)) ); }), (a.max = function (e, t) { return e.cmp(t) > 0 ? e : t; }), (a.min = function (e, t) { return 0 > e.cmp(t) ? e : t; }), (a.prototype._init = function (e, t, i) { if ("number" == typeof e) return this._initNumber(e, t, i); if ("object" == typeof e) return this._initArray(e, t, i); "hex" === t && (t = 16), n(t === (0 | t) && t >= 2 && t <= 36), (e = e.toString().replace(/\s+/g, "")); var r = 0; "-" === e[0] && (r++, (this.negative = 1)), r < e.length && (16 === t ? this._parseHex(e, r, i) : (this._parseBase(e, t, r), "le" === i && this._initArray(this.toArray(), t, i))); }), (a.prototype._initNumber = function (e, t, i) { e < 0 && ((this.negative = 1), (e = -e)), e < 0x4000000 ? ((this.words = [0x3ffffff & e]), (this.length = 1)) : e < 0x10000000000000 ? ((this.words = [0x3ffffff & e, (e / 0x4000000) & 0x3ffffff]), (this.length = 2)) : (n(e < 0x20000000000000), (this.words = [ 0x3ffffff & e, (e / 0x4000000) & 0x3ffffff, 1, ]), (this.length = 3)), "le" === i && this._initArray(this.toArray(), t, i); }), (a.prototype._initArray = function (e, t, i) { if ((n("number" == typeof e.length), e.length <= 0)) return (this.words = [0]), (this.length = 1), this; (this.length = Math.ceil(e.length / 3)), (this.words = Array(this.length)); for (var r, a, o = 0; o < this.length; o++) this.words[o] = 0; var s = 0; if ("be" === i) for (o = e.length - 1, r = 0; o >= 0; o -= 3) (a = e[o] | (e[o - 1] << 8) | (e[o - 2] << 16)), (this.words[r] |= (a << s) & 0x3ffffff), (this.words[r + 1] = (a >>> (26 - s)) & 0x3ffffff), (s += 24) >= 26 && ((s -= 26), r++); else if ("le" === i) for (o = 0, r = 0; o < e.length; o += 3) (a = e[o] | (e[o + 1] << 8) | (e[o + 2] << 16)), (this.words[r] |= (a << s) & 0x3ffffff), (this.words[r + 1] = (a >>> (26 - s)) & 0x3ffffff), (s += 24) >= 26 && ((s -= 26), r++); return this.strip(); }), (a.prototype._parseHex = function (e, t, i) { (this.length = Math.ceil((e.length - t) / 6)), (this.words = Array(this.length)); for (var n, r = 0; r < this.length; r++) this.words[r] = 0; var a = 0, o = 0; if ("be" === i) for (r = e.length - 1; r >= t; r -= 2) (n = s(e, t, r) << a), (this.words[o] |= 0x3ffffff & n), a >= 18 ? ((a -= 18), (o += 1), (this.words[o] |= n >>> 26)) : (a += 8); else for ( r = (e.length - t) % 2 == 0 ? t + 1 : t; r < e.length; r += 2 ) (n = s(e, t, r) << a), (this.words[o] |= 0x3ffffff & n), a >= 18 ? ((a -= 18), (o += 1), (this.words[o] |= n >>> 26)) : (a += 8); this.strip(); }), (a.prototype._parseBase = function (e, t, i) { (this.words = [0]), (this.length = 1); for (var n = 0, r = 1; r <= 0x3ffffff; r *= t) n++; n--, (r = (r / t) | 0); for ( var a = e.length - i, o = a % n, s = Math.min(a, a - o) + i, c = 0, d = i; d < s; d += n ) (c = l(e, d, d + n, t)), this.imuln(r), this.words[0] + c < 0x4000000 ? (this.words[0] += c) : this._iaddn(c); if (0 !== o) { var u = 1; for (c = l(e, d, e.length, t), d = 0; d < o; d++) u *= t; this.imuln(u), this.words[0] + c < 0x4000000 ? (this.words[0] += c) : this._iaddn(c); } this.strip(); }), (a.prototype.copy = function (e) { e.words = Array(this.length); for (var t = 0; t < this.length; t++) e.words[t] = this.words[t]; (e.length = this.length), (e.negative = this.negative), (e.red = this.red); }), (a.prototype.clone = function () { var e = new a(null); return this.copy(e), e; }), (a.prototype._expand = function (e) { for (; this.length < e; ) this.words[this.length++] = 0; return this; }), (a.prototype.strip = function () { for (; this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--; return this._normSign(); }), (a.prototype._normSign = function () { return ( 1 === this.length && 0 === this.words[0] && (this.negative = 0), this ); }), (a.prototype.inspect = function () { return (this.red ? ""; }); var c, d = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000", ], u = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, ], f = [ 0, 0, 0x2000000, 0x290d741, 0x1000000, 0x2e90edd, 0x39aa400, 0x267bf47, 0x1000000, 0x290d741, 1e7, 0x12959c3, 0x222c000, 0x3bd7765, 7529536, 0xadcea1, 0x1000000, 0x1704f61, 0x206fc40, 0x2cddcf9, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 0xb54ba0, 0xdaf26b, 0x1069c00, 0x138f9ad, 243e5, 0x1b4d89f, 0x2000000, 0x25528a1, 0x2b54a20, 0x3216b93, 0x39aa400, ]; function h(e) { for (var t = Array(e.bitLength()), i = 0; i < t.length; i++) { var n = (i / 26) | 0, r = i % 26; t[i] = (e.words[n] & (1 << r)) >>> r; } return t; } function p(e, t, i) { i.negative = t.negative ^ e.negative; var n = (e.length + t.length) | 0; (i.length = n), (n = (n - 1) | 0); var r = 0 | e.words[0], a = 0 | t.words[0], o = r * a, s = 0x3ffffff & o, l = (o / 0x4000000) | 0; i.words[0] = s; for (var c = 1; c < n; c++) { for ( var d = l >>> 26, u = 0x3ffffff & l, f = Math.min(c, t.length - 1), h = Math.max(0, c - e.length + 1); h <= f; h++ ) { var p = (c - h) | 0; (r = 0 | e.words[p]), (d += ((o = r * (a = 0 | t.words[h]) + u) / 0x4000000) | 0), (u = 0x3ffffff & o); } (i.words[c] = 0 | u), (l = 0 | d); } return 0 !== l ? (i.words[c] = 0 | l) : i.length--, i.strip(); } (a.prototype.toString = function (e, t) { if (((t = 0 | t || 1), 16 === (e = e || 10) || "hex" === e)) { i = ""; for (var i, r = 0, a = 0, o = 0; o < this.length; o++) { var s = this.words[o], l = (((s << r) | a) & 0xffffff).toString(16); (i = 0 != (a = (s >>> (24 - r)) & 0xffffff) || o !== this.length - 1 ? d[6 - l.length] + l + i : l + i), (r += 2) >= 26 && ((r -= 26), o--); } for (0 !== a && (i = a.toString(16) + i); i.length % t != 0; ) i = "0" + i; return 0 !== this.negative && (i = "-" + i), i; } if (e === (0 | e) && e >= 2 && e <= 36) { var c = u[e], h = f[e]; i = ""; var p = this.clone(); for (p.negative = 0; !p.isZero(); ) { var v = p.modn(h).toString(e); i = (p = p.idivn(h)).isZero() ? v + i : d[c - v.length] + v + i; } for (this.isZero() && (i = "0" + i); i.length % t != 0; ) i = "0" + i; return 0 !== this.negative && (i = "-" + i), i; } n(!1, "Base should be between 2 and 36"); }), (a.prototype.toNumber = function () { var e = this.words[0]; return ( 2 === this.length ? (e += 0x4000000 * this.words[1]) : 3 === this.length && 1 === this.words[2] ? (e += 0x10000000000000 + 0x4000000 * this.words[1]) : this.length > 2 && n(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e : e ); }), (a.prototype.toJSON = function () { return this.toString(16); }), (a.prototype.toBuffer = function (e, t) { return n(void 0 !== c), this.toArrayLike(c, e, t); }), (a.prototype.toArray = function (e, t) { return this.toArrayLike(Array, e, t); }), (a.prototype.toArrayLike = function (e, t, i) { var r, a, o = this.byteLength(), s = i || Math.max(1, o); n(o <= s, "byte array longer than desired length"), n(s > 0, "Requested array length <= 0"), this.strip(); var l = "le" === t, c = new e(s), d = this.clone(); if (l) { for (a = 0; !d.isZero(); a++) (r = d.andln(255)), d.iushrn(8), (c[a] = r); for (; a < s; a++) c[a] = 0; } else { for (a = 0; a < s - o; a++) c[a] = 0; for (a = 0; !d.isZero(); a++) (r = d.andln(255)), d.iushrn(8), (c[s - a - 1] = r); } return c; }), Math.clz32 ? (a.prototype._countBits = function (e) { return 32 - Math.clz32(e); }) : (a.prototype._countBits = function (e) { var t = e, i = 0; return ( t >= 4096 && ((i += 13), (t >>>= 13)), t >= 64 && ((i += 7), (t >>>= 7)), t >= 8 && ((i += 4), (t >>>= 4)), t >= 2 && ((i += 2), (t >>>= 2)), i + t ); }), (a.prototype._zeroBits = function (e) { if (0 === e) return 26; var t = e, i = 0; return ( (8191 & t) == 0 && ((i += 13), (t >>>= 13)), (127 & t) == 0 && ((i += 7), (t >>>= 7)), (15 & t) == 0 && ((i += 4), (t >>>= 4)), (3 & t) == 0 && ((i += 2), (t >>>= 2)), (1 & t) == 0 && i++, i ); }), (a.prototype.bitLength = function () { var e = this.words[this.length - 1], t = this._countBits(e); return (this.length - 1) * 26 + t; }), (a.prototype.zeroBits = function () { if (this.isZero()) return 0; for (var e = 0, t = 0; t < this.length; t++) { var i = this._zeroBits(this.words[t]); if (((e += i), 26 !== i)) break; } return e; }), (a.prototype.byteLength = function () { return Math.ceil(this.bitLength() / 8); }), (a.prototype.toTwos = function (e) { return 0 !== this.negative ? this.abs().inotn(e).iaddn(1) : this.clone(); }), (a.prototype.fromTwos = function (e) { return this.testn(e - 1) ? this.notn(e).iaddn(1).ineg() : this.clone(); }), (a.prototype.isNeg = function () { return 0 !== this.negative; }), (a.prototype.neg = function () { return this.clone().ineg(); }), (a.prototype.ineg = function () { return !this.isZero() && (this.negative ^= 1), this; }), (a.prototype.iuor = function (e) { for (; this.length < e.length; ) this.words[this.length++] = 0; for (var t = 0; t < e.length; t++) this.words[t] = this.words[t] | e.words[t]; return this.strip(); }), (a.prototype.ior = function (e) { return n((this.negative | e.negative) == 0), this.iuor(e); }), (a.prototype.or = function (e) { return this.length > e.length ? this.clone().ior(e) : e.clone().ior(this); }), (a.prototype.uor = function (e) { return this.length > e.length ? this.clone().iuor(e) : e.clone().iuor(this); }), (a.prototype.iuand = function (e) { var t; t = this.length > e.length ? e : this; for (var i = 0; i < t.length; i++) this.words[i] = this.words[i] & e.words[i]; return (this.length = t.length), this.strip(); }), (a.prototype.iand = function (e) { return n((this.negative | e.negative) == 0), this.iuand(e); }), (a.prototype.and = function (e) { return this.length > e.length ? this.clone().iand(e) : e.clone().iand(this); }), (a.prototype.uand = function (e) { return this.length > e.length ? this.clone().iuand(e) : e.clone().iuand(this); }), (a.prototype.iuxor = function (e) { this.length > e.length ? ((t = this), (i = e)) : ((t = e), (i = this)); for (var t, i, n = 0; n < i.length; n++) this.words[n] = t.words[n] ^ i.words[n]; if (this !== t) for (; n < t.length; n++) this.words[n] = t.words[n]; return (this.length = t.length), this.strip(); }), (a.prototype.ixor = function (e) { return n((this.negative | e.negative) == 0), this.iuxor(e); }), (a.prototype.xor = function (e) { return this.length > e.length ? this.clone().ixor(e) : e.clone().ixor(this); }), (a.prototype.uxor = function (e) { return this.length > e.length ? this.clone().iuxor(e) : e.clone().iuxor(this); }), (a.prototype.inotn = function (e) { n("number" == typeof e && e >= 0); var t = 0 | Math.ceil(e / 26), i = e % 26; this._expand(t), i > 0 && t--; for (var r = 0; r < t; r++) this.words[r] = 0x3ffffff & ~this.words[r]; return ( i > 0 && (this.words[r] = ~this.words[r] & (0x3ffffff >> (26 - i))), this.strip() ); }), (a.prototype.notn = function (e) { return this.clone().inotn(e); }), (a.prototype.setn = function (e, t) { n("number" == typeof e && e >= 0); var i = (e / 26) | 0, r = e % 26; return ( this._expand(i + 1), t ? (this.words[i] = this.words[i] | (1 << r)) : (this.words[i] = this.words[i] & ~(1 << r)), this.strip() ); }), (a.prototype.iadd = function (e) { if (0 !== this.negative && 0 === e.negative) return ( (this.negative = 0), (t = this.isub(e)), (this.negative ^= 1), this._normSign() ); if (0 === this.negative && 0 !== e.negative) return ( (e.negative = 0), (t = this.isub(e)), (e.negative = 1), t._normSign() ); this.length > e.length ? ((i = this), (n = e)) : ((i = e), (n = this)); for (var t, i, n, r = 0, a = 0; a < n.length; a++) (t = (0 | i.words[a]) + (0 | n.words[a]) + r), (this.words[a] = 0x3ffffff & t), (r = t >>> 26); for (; 0 !== r && a < i.length; a++) (t = (0 | i.words[a]) + r), (this.words[a] = 0x3ffffff & t), (r = t >>> 26); if (((this.length = i.length), 0 !== r)) (this.words[this.length] = r), this.length++; else if (i !== this) for (; a < i.length; a++) this.words[a] = i.words[a]; return this; }), (a.prototype.add = function (e) { var t; return 0 !== e.negative && 0 === this.negative ? ((e.negative = 0), (t = this.sub(e)), (e.negative ^= 1), t) : 0 === e.negative && 0 !== this.negative ? ((this.negative = 0), (t = e.sub(this)), (this.negative = 1), t) : this.length > e.length ? this.clone().iadd(e) : e.clone().iadd(this); }), (a.prototype.isub = function (e) { if (0 !== e.negative) { e.negative = 0; var t, i, n = this.iadd(e); return (e.negative = 1), n._normSign(); } if (0 !== this.negative) return ( (this.negative = 0), this.iadd(e), (this.negative = 1), this._normSign() ); var r = this.cmp(e); if (0 === r) return ( (this.negative = 0), (this.length = 1), (this.words[0] = 0), this ); r > 0 ? ((t = this), (i = e)) : ((t = e), (i = this)); for (var a = 0, o = 0; o < i.length; o++) (a = (n = (0 | t.words[o]) - (0 | i.words[o]) + a) >> 26), (this.words[o] = 0x3ffffff & n); for (; 0 !== a && o < t.length; o++) (a = (n = (0 | t.words[o]) + a) >> 26), (this.words[o] = 0x3ffffff & n); if (0 === a && o < t.length && t !== this) for (; o < t.length; o++) this.words[o] = t.words[o]; return ( (this.length = Math.max(this.length, o)), t !== this && (this.negative = 1), this.strip() ); }), (a.prototype.sub = function (e) { return this.clone().isub(e); }); var v = function (e, t, i) { var n, r, a, o = e.words, s = t.words, l = i.words, c = 0, d = 0 | o[0], u = 8191 & d, f = d >>> 13, h = 0 | o[1], p = 8191 & h, v = h >>> 13, m = 0 | o[2], g = 8191 & m, _ = m >>> 13, y = 0 | o[3], b = 8191 & y, I = y >>> 13, w = 0 | o[4], x = 8191 & w, S = w >>> 13, M = 0 | o[5], C = 8191 & M, T = M >>> 13, A = 0 | o[6], k = 8191 & A, P = A >>> 13, E = 0 | o[7], D = 8191 & E, R = E >>> 13, N = 0 | o[8], L = 8191 & N, j = N >>> 13, O = 0 | o[9], B = 8191 & O, F = O >>> 13, U = 0 | s[0], G = 8191 & U, z = U >>> 13, V = 0 | s[1], W = 8191 & V, Z = V >>> 13, K = 0 | s[2], H = 8191 & K, q = K >>> 13, J = 0 | s[3], Y = 8191 & J, Q = J >>> 13, X = 0 | s[4], $ = 8191 & X, ee = X >>> 13, et = 0 | s[5], ei = 8191 & et, en = et >>> 13, er = 0 | s[6], ea = 8191 & er, eo = er >>> 13, es = 0 | s[7], el = 8191 & es, ec = es >>> 13, ed = 0 | s[8], eu = 8191 & ed, ef = ed >>> 13, eh = 0 | s[9], ep = 8191 & eh, ev = eh >>> 13; (i.negative = e.negative ^ t.negative), (i.length = 19), (n = Math.imul(u, G)), (r = ((r = Math.imul(u, z)) + Math.imul(f, G)) | 0); var em = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = Math.imul(f, z)) + (r >>> 13)) | 0) + (em >>> 26)) | 0), (em &= 0x3ffffff), (n = Math.imul(p, G)), (r = ((r = Math.imul(p, z)) + Math.imul(v, G)) | 0), (a = Math.imul(v, z)), (n = (n + Math.imul(u, W)) | 0), (r = ((r = (r + Math.imul(u, Z)) | 0) + Math.imul(f, W)) | 0); var eg = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, Z)) | 0) + (r >>> 13)) | 0) + (eg >>> 26)) | 0), (eg &= 0x3ffffff), (n = Math.imul(g, G)), (r = ((r = Math.imul(g, z)) + Math.imul(_, G)) | 0), (a = Math.imul(_, z)), (n = (n + Math.imul(p, W)) | 0), (r = ((r = (r + Math.imul(p, Z)) | 0) + Math.imul(v, W)) | 0), (a = (a + Math.imul(v, Z)) | 0), (n = (n + Math.imul(u, H)) | 0), (r = ((r = (r + Math.imul(u, q)) | 0) + Math.imul(f, H)) | 0); var e_ = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, q)) | 0) + (r >>> 13)) | 0) + (e_ >>> 26)) | 0), (e_ &= 0x3ffffff), (n = Math.imul(b, G)), (r = ((r = Math.imul(b, z)) + Math.imul(I, G)) | 0), (a = Math.imul(I, z)), (n = (n + Math.imul(g, W)) | 0), (r = ((r = (r + Math.imul(g, Z)) | 0) + Math.imul(_, W)) | 0), (a = (a + Math.imul(_, Z)) | 0), (n = (n + Math.imul(p, H)) | 0), (r = ((r = (r + Math.imul(p, q)) | 0) + Math.imul(v, H)) | 0), (a = (a + Math.imul(v, q)) | 0), (n = (n + Math.imul(u, Y)) | 0), (r = ((r = (r + Math.imul(u, Q)) | 0) + Math.imul(f, Y)) | 0); var ey = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, Q)) | 0) + (r >>> 13)) | 0) + (ey >>> 26)) | 0), (ey &= 0x3ffffff), (n = Math.imul(x, G)), (r = ((r = Math.imul(x, z)) + Math.imul(S, G)) | 0), (a = Math.imul(S, z)), (n = (n + Math.imul(b, W)) | 0), (r = ((r = (r + Math.imul(b, Z)) | 0) + Math.imul(I, W)) | 0), (a = (a + Math.imul(I, Z)) | 0), (n = (n + Math.imul(g, H)) | 0), (r = ((r = (r + Math.imul(g, q)) | 0) + Math.imul(_, H)) | 0), (a = (a + Math.imul(_, q)) | 0), (n = (n + Math.imul(p, Y)) | 0), (r = ((r = (r + Math.imul(p, Q)) | 0) + Math.imul(v, Y)) | 0), (a = (a + Math.imul(v, Q)) | 0), (n = (n + Math.imul(u, $)) | 0), (r = ((r = (r + Math.imul(u, ee)) | 0) + Math.imul(f, $)) | 0); var eb = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ee)) | 0) + (r >>> 13)) | 0) + (eb >>> 26)) | 0), (eb &= 0x3ffffff), (n = Math.imul(C, G)), (r = ((r = Math.imul(C, z)) + Math.imul(T, G)) | 0), (a = Math.imul(T, z)), (n = (n + Math.imul(x, W)) | 0), (r = ((r = (r + Math.imul(x, Z)) | 0) + Math.imul(S, W)) | 0), (a = (a + Math.imul(S, Z)) | 0), (n = (n + Math.imul(b, H)) | 0), (r = ((r = (r + Math.imul(b, q)) | 0) + Math.imul(I, H)) | 0), (a = (a + Math.imul(I, q)) | 0), (n = (n + Math.imul(g, Y)) | 0), (r = ((r = (r + Math.imul(g, Q)) | 0) + Math.imul(_, Y)) | 0), (a = (a + Math.imul(_, Q)) | 0), (n = (n + Math.imul(p, $)) | 0), (r = ((r = (r + Math.imul(p, ee)) | 0) + Math.imul(v, $)) | 0), (a = (a + Math.imul(v, ee)) | 0), (n = (n + Math.imul(u, ei)) | 0), (r = ((r = (r + Math.imul(u, en)) | 0) + Math.imul(f, ei)) | 0); var eI = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, en)) | 0) + (r >>> 13)) | 0) + (eI >>> 26)) | 0), (eI &= 0x3ffffff), (n = Math.imul(k, G)), (r = ((r = Math.imul(k, z)) + Math.imul(P, G)) | 0), (a = Math.imul(P, z)), (n = (n + Math.imul(C, W)) | 0), (r = ((r = (r + Math.imul(C, Z)) | 0) + Math.imul(T, W)) | 0), (a = (a + Math.imul(T, Z)) | 0), (n = (n + Math.imul(x, H)) | 0), (r = ((r = (r + Math.imul(x, q)) | 0) + Math.imul(S, H)) | 0), (a = (a + Math.imul(S, q)) | 0), (n = (n + Math.imul(b, Y)) | 0), (r = ((r = (r + Math.imul(b, Q)) | 0) + Math.imul(I, Y)) | 0), (a = (a + Math.imul(I, Q)) | 0), (n = (n + Math.imul(g, $)) | 0), (r = ((r = (r + Math.imul(g, ee)) | 0) + Math.imul(_, $)) | 0), (a = (a + Math.imul(_, ee)) | 0), (n = (n + Math.imul(p, ei)) | 0), (r = ((r = (r + Math.imul(p, en)) | 0) + Math.imul(v, ei)) | 0), (a = (a + Math.imul(v, en)) | 0), (n = (n + Math.imul(u, ea)) | 0), (r = ((r = (r + Math.imul(u, eo)) | 0) + Math.imul(f, ea)) | 0); var ew = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, eo)) | 0) + (r >>> 13)) | 0) + (ew >>> 26)) | 0), (ew &= 0x3ffffff), (n = Math.imul(D, G)), (r = ((r = Math.imul(D, z)) + Math.imul(R, G)) | 0), (a = Math.imul(R, z)), (n = (n + Math.imul(k, W)) | 0), (r = ((r = (r + Math.imul(k, Z)) | 0) + Math.imul(P, W)) | 0), (a = (a + Math.imul(P, Z)) | 0), (n = (n + Math.imul(C, H)) | 0), (r = ((r = (r + Math.imul(C, q)) | 0) + Math.imul(T, H)) | 0), (a = (a + Math.imul(T, q)) | 0), (n = (n + Math.imul(x, Y)) | 0), (r = ((r = (r + Math.imul(x, Q)) | 0) + Math.imul(S, Y)) | 0), (a = (a + Math.imul(S, Q)) | 0), (n = (n + Math.imul(b, $)) | 0), (r = ((r = (r + Math.imul(b, ee)) | 0) + Math.imul(I, $)) | 0), (a = (a + Math.imul(I, ee)) | 0), (n = (n + Math.imul(g, ei)) | 0), (r = ((r = (r + Math.imul(g, en)) | 0) + Math.imul(_, ei)) | 0), (a = (a + Math.imul(_, en)) | 0), (n = (n + Math.imul(p, ea)) | 0), (r = ((r = (r + Math.imul(p, eo)) | 0) + Math.imul(v, ea)) | 0), (a = (a + Math.imul(v, eo)) | 0), (n = (n + Math.imul(u, el)) | 0), (r = ((r = (r + Math.imul(u, ec)) | 0) + Math.imul(f, el)) | 0); var ex = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ec)) | 0) + (r >>> 13)) | 0) + (ex >>> 26)) | 0), (ex &= 0x3ffffff), (n = Math.imul(L, G)), (r = ((r = Math.imul(L, z)) + Math.imul(j, G)) | 0), (a = Math.imul(j, z)), (n = (n + Math.imul(D, W)) | 0), (r = ((r = (r + Math.imul(D, Z)) | 0) + Math.imul(R, W)) | 0), (a = (a + Math.imul(R, Z)) | 0), (n = (n + Math.imul(k, H)) | 0), (r = ((r = (r + Math.imul(k, q)) | 0) + Math.imul(P, H)) | 0), (a = (a + Math.imul(P, q)) | 0), (n = (n + Math.imul(C, Y)) | 0), (r = ((r = (r + Math.imul(C, Q)) | 0) + Math.imul(T, Y)) | 0), (a = (a + Math.imul(T, Q)) | 0), (n = (n + Math.imul(x, $)) | 0), (r = ((r = (r + Math.imul(x, ee)) | 0) + Math.imul(S, $)) | 0), (a = (a + Math.imul(S, ee)) | 0), (n = (n + Math.imul(b, ei)) | 0), (r = ((r = (r + Math.imul(b, en)) | 0) + Math.imul(I, ei)) | 0), (a = (a + Math.imul(I, en)) | 0), (n = (n + Math.imul(g, ea)) | 0), (r = ((r = (r + Math.imul(g, eo)) | 0) + Math.imul(_, ea)) | 0), (a = (a + Math.imul(_, eo)) | 0), (n = (n + Math.imul(p, el)) | 0), (r = ((r = (r + Math.imul(p, ec)) | 0) + Math.imul(v, el)) | 0), (a = (a + Math.imul(v, ec)) | 0), (n = (n + Math.imul(u, eu)) | 0), (r = ((r = (r + Math.imul(u, ef)) | 0) + Math.imul(f, eu)) | 0); var eS = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ef)) | 0) + (r >>> 13)) | 0) + (eS >>> 26)) | 0), (eS &= 0x3ffffff), (n = Math.imul(B, G)), (r = ((r = Math.imul(B, z)) + Math.imul(F, G)) | 0), (a = Math.imul(F, z)), (n = (n + Math.imul(L, W)) | 0), (r = ((r = (r + Math.imul(L, Z)) | 0) + Math.imul(j, W)) | 0), (a = (a + Math.imul(j, Z)) | 0), (n = (n + Math.imul(D, H)) | 0), (r = ((r = (r + Math.imul(D, q)) | 0) + Math.imul(R, H)) | 0), (a = (a + Math.imul(R, q)) | 0), (n = (n + Math.imul(k, Y)) | 0), (r = ((r = (r + Math.imul(k, Q)) | 0) + Math.imul(P, Y)) | 0), (a = (a + Math.imul(P, Q)) | 0), (n = (n + Math.imul(C, $)) | 0), (r = ((r = (r + Math.imul(C, ee)) | 0) + Math.imul(T, $)) | 0), (a = (a + Math.imul(T, ee)) | 0), (n = (n + Math.imul(x, ei)) | 0), (r = ((r = (r + Math.imul(x, en)) | 0) + Math.imul(S, ei)) | 0), (a = (a + Math.imul(S, en)) | 0), (n = (n + Math.imul(b, ea)) | 0), (r = ((r = (r + Math.imul(b, eo)) | 0) + Math.imul(I, ea)) | 0), (a = (a + Math.imul(I, eo)) | 0), (n = (n + Math.imul(g, el)) | 0), (r = ((r = (r + Math.imul(g, ec)) | 0) + Math.imul(_, el)) | 0), (a = (a + Math.imul(_, ec)) | 0), (n = (n + Math.imul(p, eu)) | 0), (r = ((r = (r + Math.imul(p, ef)) | 0) + Math.imul(v, eu)) | 0), (a = (a + Math.imul(v, ef)) | 0), (n = (n + Math.imul(u, ep)) | 0), (r = ((r = (r + Math.imul(u, ev)) | 0) + Math.imul(f, ep)) | 0); var eM = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ev)) | 0) + (r >>> 13)) | 0) + (eM >>> 26)) | 0), (eM &= 0x3ffffff), (n = Math.imul(B, W)), (r = ((r = Math.imul(B, Z)) + Math.imul(F, W)) | 0), (a = Math.imul(F, Z)), (n = (n + Math.imul(L, H)) | 0), (r = ((r = (r + Math.imul(L, q)) | 0) + Math.imul(j, H)) | 0), (a = (a + Math.imul(j, q)) | 0), (n = (n + Math.imul(D, Y)) | 0), (r = ((r = (r + Math.imul(D, Q)) | 0) + Math.imul(R, Y)) | 0), (a = (a + Math.imul(R, Q)) | 0), (n = (n + Math.imul(k, $)) | 0), (r = ((r = (r + Math.imul(k, ee)) | 0) + Math.imul(P, $)) | 0), (a = (a + Math.imul(P, ee)) | 0), (n = (n + Math.imul(C, ei)) | 0), (r = ((r = (r + Math.imul(C, en)) | 0) + Math.imul(T, ei)) | 0), (a = (a + Math.imul(T, en)) | 0), (n = (n + Math.imul(x, ea)) | 0), (r = ((r = (r + Math.imul(x, eo)) | 0) + Math.imul(S, ea)) | 0), (a = (a + Math.imul(S, eo)) | 0), (n = (n + Math.imul(b, el)) | 0), (r = ((r = (r + Math.imul(b, ec)) | 0) + Math.imul(I, el)) | 0), (a = (a + Math.imul(I, ec)) | 0), (n = (n + Math.imul(g, eu)) | 0), (r = ((r = (r + Math.imul(g, ef)) | 0) + Math.imul(_, eu)) | 0), (a = (a + Math.imul(_, ef)) | 0), (n = (n + Math.imul(p, ep)) | 0), (r = ((r = (r + Math.imul(p, ev)) | 0) + Math.imul(v, ep)) | 0); var eC = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(v, ev)) | 0) + (r >>> 13)) | 0) + (eC >>> 26)) | 0), (eC &= 0x3ffffff), (n = Math.imul(B, H)), (r = ((r = Math.imul(B, q)) + Math.imul(F, H)) | 0), (a = Math.imul(F, q)), (n = (n + Math.imul(L, Y)) | 0), (r = ((r = (r + Math.imul(L, Q)) | 0) + Math.imul(j, Y)) | 0), (a = (a + Math.imul(j, Q)) | 0), (n = (n + Math.imul(D, $)) | 0), (r = ((r = (r + Math.imul(D, ee)) | 0) + Math.imul(R, $)) | 0), (a = (a + Math.imul(R, ee)) | 0), (n = (n + Math.imul(k, ei)) | 0), (r = ((r = (r + Math.imul(k, en)) | 0) + Math.imul(P, ei)) | 0), (a = (a + Math.imul(P, en)) | 0), (n = (n + Math.imul(C, ea)) | 0), (r = ((r = (r + Math.imul(C, eo)) | 0) + Math.imul(T, ea)) | 0), (a = (a + Math.imul(T, eo)) | 0), (n = (n + Math.imul(x, el)) | 0), (r = ((r = (r + Math.imul(x, ec)) | 0) + Math.imul(S, el)) | 0), (a = (a + Math.imul(S, ec)) | 0), (n = (n + Math.imul(b, eu)) | 0), (r = ((r = (r + Math.imul(b, ef)) | 0) + Math.imul(I, eu)) | 0), (a = (a + Math.imul(I, ef)) | 0), (n = (n + Math.imul(g, ep)) | 0), (r = ((r = (r + Math.imul(g, ev)) | 0) + Math.imul(_, ep)) | 0); var eT = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(_, ev)) | 0) + (r >>> 13)) | 0) + (eT >>> 26)) | 0), (eT &= 0x3ffffff), (n = Math.imul(B, Y)), (r = ((r = Math.imul(B, Q)) + Math.imul(F, Y)) | 0), (a = Math.imul(F, Q)), (n = (n + Math.imul(L, $)) | 0), (r = ((r = (r + Math.imul(L, ee)) | 0) + Math.imul(j, $)) | 0), (a = (a + Math.imul(j, ee)) | 0), (n = (n + Math.imul(D, ei)) | 0), (r = ((r = (r + Math.imul(D, en)) | 0) + Math.imul(R, ei)) | 0), (a = (a + Math.imul(R, en)) | 0), (n = (n + Math.imul(k, ea)) | 0), (r = ((r = (r + Math.imul(k, eo)) | 0) + Math.imul(P, ea)) | 0), (a = (a + Math.imul(P, eo)) | 0), (n = (n + Math.imul(C, el)) | 0), (r = ((r = (r + Math.imul(C, ec)) | 0) + Math.imul(T, el)) | 0), (a = (a + Math.imul(T, ec)) | 0), (n = (n + Math.imul(x, eu)) | 0), (r = ((r = (r + Math.imul(x, ef)) | 0) + Math.imul(S, eu)) | 0), (a = (a + Math.imul(S, ef)) | 0), (n = (n + Math.imul(b, ep)) | 0), (r = ((r = (r + Math.imul(b, ev)) | 0) + Math.imul(I, ep)) | 0); var eA = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(I, ev)) | 0) + (r >>> 13)) | 0) + (eA >>> 26)) | 0), (eA &= 0x3ffffff), (n = Math.imul(B, $)), (r = ((r = Math.imul(B, ee)) + Math.imul(F, $)) | 0), (a = Math.imul(F, ee)), (n = (n + Math.imul(L, ei)) | 0), (r = ((r = (r + Math.imul(L, en)) | 0) + Math.imul(j, ei)) | 0), (a = (a + Math.imul(j, en)) | 0), (n = (n + Math.imul(D, ea)) | 0), (r = ((r = (r + Math.imul(D, eo)) | 0) + Math.imul(R, ea)) | 0), (a = (a + Math.imul(R, eo)) | 0), (n = (n + Math.imul(k, el)) | 0), (r = ((r = (r + Math.imul(k, ec)) | 0) + Math.imul(P, el)) | 0), (a = (a + Math.imul(P, ec)) | 0), (n = (n + Math.imul(C, eu)) | 0), (r = ((r = (r + Math.imul(C, ef)) | 0) + Math.imul(T, eu)) | 0), (a = (a + Math.imul(T, ef)) | 0), (n = (n + Math.imul(x, ep)) | 0), (r = ((r = (r + Math.imul(x, ev)) | 0) + Math.imul(S, ep)) | 0); var ek = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(S, ev)) | 0) + (r >>> 13)) | 0) + (ek >>> 26)) | 0), (ek &= 0x3ffffff), (n = Math.imul(B, ei)), (r = ((r = Math.imul(B, en)) + Math.imul(F, ei)) | 0), (a = Math.imul(F, en)), (n = (n + Math.imul(L, ea)) | 0), (r = ((r = (r + Math.imul(L, eo)) | 0) + Math.imul(j, ea)) | 0), (a = (a + Math.imul(j, eo)) | 0), (n = (n + Math.imul(D, el)) | 0), (r = ((r = (r + Math.imul(D, ec)) | 0) + Math.imul(R, el)) | 0), (a = (a + Math.imul(R, ec)) | 0), (n = (n + Math.imul(k, eu)) | 0), (r = ((r = (r + Math.imul(k, ef)) | 0) + Math.imul(P, eu)) | 0), (a = (a + Math.imul(P, ef)) | 0), (n = (n + Math.imul(C, ep)) | 0), (r = ((r = (r + Math.imul(C, ev)) | 0) + Math.imul(T, ep)) | 0); var eP = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(T, ev)) | 0) + (r >>> 13)) | 0) + (eP >>> 26)) | 0), (eP &= 0x3ffffff), (n = Math.imul(B, ea)), (r = ((r = Math.imul(B, eo)) + Math.imul(F, ea)) | 0), (a = Math.imul(F, eo)), (n = (n + Math.imul(L, el)) | 0), (r = ((r = (r + Math.imul(L, ec)) | 0) + Math.imul(j, el)) | 0), (a = (a + Math.imul(j, ec)) | 0), (n = (n + Math.imul(D, eu)) | 0), (r = ((r = (r + Math.imul(D, ef)) | 0) + Math.imul(R, eu)) | 0), (a = (a + Math.imul(R, ef)) | 0), (n = (n + Math.imul(k, ep)) | 0), (r = ((r = (r + Math.imul(k, ev)) | 0) + Math.imul(P, ep)) | 0); var eE = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(P, ev)) | 0) + (r >>> 13)) | 0) + (eE >>> 26)) | 0), (eE &= 0x3ffffff), (n = Math.imul(B, el)), (r = ((r = Math.imul(B, ec)) + Math.imul(F, el)) | 0), (a = Math.imul(F, ec)), (n = (n + Math.imul(L, eu)) | 0), (r = ((r = (r + Math.imul(L, ef)) | 0) + Math.imul(j, eu)) | 0), (a = (a + Math.imul(j, ef)) | 0), (n = (n + Math.imul(D, ep)) | 0), (r = ((r = (r + Math.imul(D, ev)) | 0) + Math.imul(R, ep)) | 0); var eD = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(R, ev)) | 0) + (r >>> 13)) | 0) + (eD >>> 26)) | 0), (eD &= 0x3ffffff), (n = Math.imul(B, eu)), (r = ((r = Math.imul(B, ef)) + Math.imul(F, eu)) | 0), (a = Math.imul(F, ef)), (n = (n + Math.imul(L, ep)) | 0), (r = ((r = (r + Math.imul(L, ev)) | 0) + Math.imul(j, ep)) | 0); var eR = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(j, ev)) | 0) + (r >>> 13)) | 0) + (eR >>> 26)) | 0), (eR &= 0x3ffffff), (n = Math.imul(B, ep)), (r = ((r = Math.imul(B, ev)) + Math.imul(F, ep)) | 0); var eN = (((c + n) | 0) + ((8191 & r) << 13)) | 0; return ( (c = ((((a = Math.imul(F, ev)) + (r >>> 13)) | 0) + (eN >>> 26)) | 0), (eN &= 0x3ffffff), (l[0] = em), (l[1] = eg), (l[2] = e_), (l[3] = ey), (l[4] = eb), (l[5] = eI), (l[6] = ew), (l[7] = ex), (l[8] = eS), (l[9] = eM), (l[10] = eC), (l[11] = eT), (l[12] = eA), (l[13] = ek), (l[14] = eP), (l[15] = eE), (l[16] = eD), (l[17] = eR), (l[18] = eN), 0 !== c && ((l[19] = c), i.length++), i ); }; function m(e, t, i) { (i.negative = t.negative ^ e.negative), (i.length = e.length + t.length); for (var n = 0, r = 0, a = 0; a < i.length - 1; a++) { var o = r; r = 0; for ( var s = 0x3ffffff & n, l = Math.min(a, t.length - 1), c = Math.max(0, a - e.length + 1); c <= l; c++ ) { var d = a - c, u = (0 | e.words[d]) * (0 | t.words[c]), f = 0x3ffffff & u; (o = (o + ((u / 0x4000000) | 0)) | 0), (s = 0x3ffffff & (f = (f + s) | 0)), (r += (o = (o + (f >>> 26)) | 0) >>> 26), (o &= 0x3ffffff); } (i.words[a] = s), (n = o), (o = r); } return 0 !== n ? (i.words[a] = n) : i.length--, i.strip(); } function g(e, t, i) { return new _().mulp(e, t, i); } function _(e, t) { (this.x = e), (this.y = t); } !Math.imul && (v = p), (a.prototype.mulTo = function (e, t) { var i, n = this.length + e.length; return (i = 10 === this.length && 10 === e.length ? v(this, e, t) : n < 63 ? p(this, e, t) : n < 1024 ? m(this, e, t) : g(this, e, t)); }), (_.prototype.makeRBT = function (e) { for ( var t = Array(e), i = a.prototype._countBits(e) - 1, n = 0; n < e; n++ ) t[n] = this.revBin(n, i, e); return t; }), (_.prototype.revBin = function (e, t, i) { if (0 === e || e === i - 1) return e; for (var n = 0, r = 0; r < t; r++) (n |= (1 & e) << (t - r - 1)), (e >>= 1); return n; }), (_.prototype.permute = function (e, t, i, n, r, a) { for (var o = 0; o < a; o++) (n[o] = t[e[o]]), (r[o] = i[e[o]]); }), (_.prototype.transform = function (e, t, i, n, r, a) { this.permute(a, e, t, i, n, r); for (var o = 1; o < r; o <<= 1) { for ( var s = o << 1, l = Math.cos((2 * Math.PI) / s), c = Math.sin((2 * Math.PI) / s), d = 0; d < r; d += s ) { for (var u = l, f = c, h = 0; h < o; h++) { var p = i[d + h], v = n[d + h], m = i[d + h + o], g = n[d + h + o], _ = u * m - f * g; (g = u * g + f * m), (m = _), (i[d + h] = p + m), (n[d + h] = v + g), (i[d + h + o] = p - m), (n[d + h + o] = v - g), h !== s && ((_ = l * u - c * f), (f = l * f + c * u), (u = _)); } } } }), (_.prototype.guessLen13b = function (e, t) { var i = 1 | Math.max(t, e), n = 1 & i, r = 0; for (i = (i / 2) | 0; i; i >>>= 1) r++; return 1 << (r + 1 + n); }), (_.prototype.conjugate = function (e, t, i) { if (!(i <= 1)) for (var n = 0; n < i / 2; n++) { var r = e[n]; (e[n] = e[i - n - 1]), (e[i - n - 1] = r), (r = t[n]), (t[n] = -t[i - n - 1]), (t[i - n - 1] = -r); } }), (_.prototype.normalize13b = function (e, t) { for (var i = 0, n = 0; n < t / 2; n++) { var r = 8192 * Math.round(e[2 * n + 1] / t) + Math.round(e[2 * n] / t) + i; (e[n] = 0x3ffffff & r), (i = r < 0x4000000 ? 0 : (r / 0x4000000) | 0); } return e; }), (_.prototype.convert13b = function (e, t, i, r) { for (var a = 0, o = 0; o < t; o++) (a += 0 | e[o]), (i[2 * o] = 8191 & a), (a >>>= 13), (i[2 * o + 1] = 8191 & a), (a >>>= 13); for (o = 2 * t; o < r; ++o) i[o] = 0; n(0 === a), n((-8192 & a) == 0); }), (_.prototype.stub = function (e) { for (var t = Array(e), i = 0; i < e; i++) t[i] = 0; return t; }), (_.prototype.mulp = function (e, t, i) { var n = 2 * this.guessLen13b(e.length, t.length), r = this.makeRBT(n), a = this.stub(n), o = Array(n), s = Array(n), l = Array(n), c = Array(n), d = Array(n), u = Array(n), f = i.words; (f.length = n), this.convert13b(e.words, e.length, o, n), this.convert13b(t.words, t.length, c, n), this.transform(o, a, s, l, n, r), this.transform(c, a, d, u, n, r); for (var h = 0; h < n; h++) { var p = s[h] * d[h] - l[h] * u[h]; (l[h] = s[h] * u[h] + l[h] * d[h]), (s[h] = p); } return ( this.conjugate(s, l, n), this.transform(s, l, f, a, n, r), this.conjugate(f, a, n), this.normalize13b(f, n), (i.negative = e.negative ^ t.negative), (i.length = e.length + t.length), i.strip() ); }), (a.prototype.mul = function (e) { var t = new a(null); return (t.words = Array(this.length + e.length)), this.mulTo(e, t); }), (a.prototype.mulf = function (e) { var t = new a(null); return (t.words = Array(this.length + e.length)), g(this, e, t); }), (a.prototype.imul = function (e) { return this.clone().mulTo(e, this); }), (a.prototype.imuln = function (e) { n("number" == typeof e), n(e < 0x4000000); for (var t = 0, i = 0; i < this.length; i++) { var r = (0 | this.words[i]) * e, a = (0x3ffffff & r) + (0x3ffffff & t); (t >>= 26), (t += ((r / 0x4000000) | 0) + (a >>> 26)), (this.words[i] = 0x3ffffff & a); } return 0 !== t && ((this.words[i] = t), this.length++), this; }), (a.prototype.muln = function (e) { return this.clone().imuln(e); }), (a.prototype.sqr = function () { return this.mul(this); }), (a.prototype.isqr = function () { return this.imul(this.clone()); }), (a.prototype.pow = function (e) { var t = h(e); if (0 === t.length) return new a(1); for ( var i = this, n = 0; n < t.length && 0 === t[n]; n++, i = i.sqr() ); if (++n < t.length) for (var r = i.sqr(); n < t.length; n++, r = r.sqr()) 0 !== t[n] && (i = i.mul(r)); return i; }), (a.prototype.iushln = function (e) { n("number" == typeof e && e >= 0); var t, i = e % 26, r = (e - i) / 26, a = (0x3ffffff >>> (26 - i)) << (26 - i); if (0 !== i) { var o = 0; for (t = 0; t < this.length; t++) { var s = this.words[t] & a, l = ((0 | this.words[t]) - s) << i; (this.words[t] = l | o), (o = s >>> (26 - i)); } o && ((this.words[t] = o), this.length++); } if (0 !== r) { for (t = this.length - 1; t >= 0; t--) this.words[t + r] = this.words[t]; for (t = 0; t < r; t++) this.words[t] = 0; this.length += r; } return this.strip(); }), (a.prototype.ishln = function (e) { return n(0 === this.negative), this.iushln(e); }), (a.prototype.iushrn = function (e, t, i) { n("number" == typeof e && e >= 0), (r = t ? (t - (t % 26)) / 26 : 0); var r, a = e % 26, o = Math.min((e - a) / 26, this.length), s = 0x3ffffff ^ ((0x3ffffff >>> a) << a), l = i; if (((r -= o), (r = Math.max(0, r)), l)) { for (var c = 0; c < o; c++) l.words[c] = this.words[c]; l.length = o; } if (0 === o); else if (this.length > o) for (this.length -= o, c = 0; c < this.length; c++) this.words[c] = this.words[c + o]; else (this.words[0] = 0), (this.length = 1); var d = 0; for (c = this.length - 1; c >= 0 && (0 !== d || c >= r); c--) { var u = 0 | this.words[c]; (this.words[c] = (d << (26 - a)) | (u >>> a)), (d = u & s); } return ( l && 0 !== d && (l.words[l.length++] = d), 0 === this.length && ((this.words[0] = 0), (this.length = 1)), this.strip() ); }), (a.prototype.ishrn = function (e, t, i) { return n(0 === this.negative), this.iushrn(e, t, i); }), (a.prototype.shln = function (e) { return this.clone().ishln(e); }), (a.prototype.ushln = function (e) { return this.clone().iushln(e); }), (a.prototype.shrn = function (e) { return this.clone().ishrn(e); }), (a.prototype.ushrn = function (e) { return this.clone().iushrn(e); }), (a.prototype.testn = function (e) { n("number" == typeof e && e >= 0); var t = e % 26, i = (e - t) / 26, r = 1 << t; return !(this.length <= i) && !!(this.words[i] & r); }), (a.prototype.imaskn = function (e) { n("number" == typeof e && e >= 0); var t = e % 26, i = (e - t) / 26; if ( (n( 0 === this.negative, "imaskn works only with positive numbers" ), this.length <= i) ) return this; if ( (0 !== t && i++, (this.length = Math.min(i, this.length)), 0 !== t) ) { var r = 0x3ffffff ^ ((0x3ffffff >>> t) << t); this.words[this.length - 1] &= r; } return this.strip(); }), (a.prototype.maskn = function (e) { return this.clone().imaskn(e); }), (a.prototype.iaddn = function (e) { if ((n("number" == typeof e), n(e < 0x4000000), e < 0)) return this.isubn(-e); if (0 !== this.negative) return 1 === this.length && (0 | this.words[0]) < e ? ((this.words[0] = e - (0 | this.words[0])), (this.negative = 0), this) : ((this.negative = 0), this.isubn(e), (this.negative = 1), this); return this._iaddn(e); }), (a.prototype._iaddn = function (e) { this.words[0] += e; for (var t = 0; t < this.length && this.words[t] >= 0x4000000; t++) (this.words[t] -= 0x4000000), t === this.length - 1 ? (this.words[t + 1] = 1) : this.words[t + 1]++; return (this.length = Math.max(this.length, t + 1)), this; }), (a.prototype.isubn = function (e) { if ((n("number" == typeof e), n(e < 0x4000000), e < 0)) return this.iaddn(-e); if (0 !== this.negative) return ( (this.negative = 0), this.iaddn(e), (this.negative = 1), this ); if (((this.words[0] -= e), 1 === this.length && this.words[0] < 0)) (this.words[0] = -this.words[0]), (this.negative = 1); else for (var t = 0; t < this.length && this.words[t] < 0; t++) (this.words[t] += 0x4000000), (this.words[t + 1] -= 1); return this.strip(); }), (a.prototype.addn = function (e) { return this.clone().iaddn(e); }), (a.prototype.subn = function (e) { return this.clone().isubn(e); }), (a.prototype.iabs = function () { return (this.negative = 0), this; }), (a.prototype.abs = function () { return this.clone().iabs(); }), (a.prototype._ishlnsubmul = function (e, t, i) { var r, a, o = e.length + i; this._expand(o); var s = 0; for (r = 0; r < e.length; r++) { a = (0 | this.words[r + i]) + s; var l = (0 | e.words[r]) * t; (a -= 0x3ffffff & l), (s = (a >> 26) - ((l / 0x4000000) | 0)), (this.words[r + i] = 0x3ffffff & a); } for (; r < this.length - i; r++) (s = (a = (0 | this.words[r + i]) + s) >> 26), (this.words[r + i] = 0x3ffffff & a); if (0 === s) return this.strip(); for (n(-1 === s), s = 0, r = 0; r < this.length; r++) (s = (a = -(0 | this.words[r]) + s) >> 26), (this.words[r] = 0x3ffffff & a); return (this.negative = 1), this.strip(); }), (a.prototype._wordDiv = function (e, t) { var i, n = this.length - e.length, r = this.clone(), o = e, s = 0 | o.words[o.length - 1]; 0 != (n = 26 - this._countBits(s)) && ((o = o.ushln(n)), r.iushln(n), (s = 0 | o.words[o.length - 1])); var l = r.length - o.length; if ("mod" !== t) { ((i = new a(null)).length = l + 1), (i.words = Array(i.length)); for (var c = 0; c < i.length; c++) i.words[c] = 0; } var d = r.clone()._ishlnsubmul(o, 1, l); 0 === d.negative && ((r = d), i && (i.words[l] = 1)); for (var u = l - 1; u >= 0; u--) { var f = (0 | r.words[o.length + u]) * 0x4000000 + (0 | r.words[o.length + u - 1]); for ( f = Math.min((f / s) | 0, 0x3ffffff), r._ishlnsubmul(o, f, u); 0 !== r.negative; ) f--, (r.negative = 0), r._ishlnsubmul(o, 1, u), !r.isZero() && (r.negative ^= 1); i && (i.words[u] = f); } return ( i && i.strip(), r.strip(), "div" !== t && 0 !== n && r.iushrn(n), { div: i || null, mod: r } ); }), (a.prototype.divmod = function (e, t, i) { var r, o, s; if ((n(!e.isZero()), this.isZero())) return { div: new a(0), mod: new a(0) }; if (0 !== this.negative && 0 === e.negative) return ( (s = this.neg().divmod(e, t)), "mod" !== t && (r = s.div.neg()), "div" !== t && ((o = s.mod.neg()), i && 0 !== o.negative && o.iadd(e)), { div: r, mod: o } ); if (0 === this.negative && 0 !== e.negative) return ( (s = this.divmod(e.neg(), t)), "mod" !== t && (r = s.div.neg()), { div: r, mod: s.mod } ); if ((this.negative & e.negative) != 0) return ( (s = this.neg().divmod(e.neg(), t)), "div" !== t && ((o = s.mod.neg()), i && 0 !== o.negative && o.isub(e)), { div: s.div, mod: o } ); if (e.length > this.length || 0 > this.cmp(e)) return { div: new a(0), mod: this }; if (1 === e.length) return "div" === t ? { div: this.divn(e.words[0]), mod: null } : "mod" === t ? { div: null, mod: new a(this.modn(e.words[0])) } : { div: this.divn(e.words[0]), mod: new a(this.modn(e.words[0])), }; return this._wordDiv(e, t); }), (a.prototype.div = function (e) { return this.divmod(e, "div", !1).div; }), (a.prototype.mod = function (e) { return this.divmod(e, "mod", !1).mod; }), (a.prototype.umod = function (e) { return this.divmod(e, "mod", !0).mod; }), (a.prototype.divRound = function (e) { var t = this.divmod(e); if (t.mod.isZero()) return t.div; var i = 0 !== t.div.negative ? t.mod.isub(e) : t.mod, n = e.ushrn(1), r = e.andln(1), a = i.cmp(n); return a < 0 || (1 === r && 0 === a) ? t.div : 0 !== t.div.negative ? t.div.isubn(1) : t.div.iaddn(1); }), (a.prototype.modn = function (e) { n(e <= 0x3ffffff); for (var t = 0x4000000 % e, i = 0, r = this.length - 1; r >= 0; r--) i = (t * i + (0 | this.words[r])) % e; return i; }), (a.prototype.idivn = function (e) { n(e <= 0x3ffffff); for (var t = 0, i = this.length - 1; i >= 0; i--) { var r = (0 | this.words[i]) + 0x4000000 * t; (this.words[i] = (r / e) | 0), (t = r % e); } return this.strip(); }), (a.prototype.divn = function (e) { return this.clone().idivn(e); }), (a.prototype.egcd = function (e) { n(0 === e.negative), n(!e.isZero()); var t = this, i = e.clone(); t = 0 !== t.negative ? t.umod(e) : t.clone(); for ( var r = new a(1), o = new a(0), s = new a(0), l = new a(1), c = 0; t.isEven() && i.isEven(); ) t.iushrn(1), i.iushrn(1), ++c; for (var d = i.clone(), u = t.clone(); !t.isZero(); ) { for ( var f = 0, h = 1; (t.words[0] & h) == 0 && f < 26; ++f, h <<= 1 ); if (f > 0) for (t.iushrn(f); f-- > 0; ) (r.isOdd() || o.isOdd()) && (r.iadd(d), o.isub(u)), r.iushrn(1), o.iushrn(1); for ( var p = 0, v = 1; (i.words[0] & v) == 0 && p < 26; ++p, v <<= 1 ); if (p > 0) for (i.iushrn(p); p-- > 0; ) (s.isOdd() || l.isOdd()) && (s.iadd(d), l.isub(u)), s.iushrn(1), l.iushrn(1); t.cmp(i) >= 0 ? (t.isub(i), r.isub(s), o.isub(l)) : (i.isub(t), s.isub(r), l.isub(o)); } return { a: s, b: l, gcd: i.iushln(c) }; }), (a.prototype._invmp = function (e) { n(0 === e.negative), n(!e.isZero()); var t, i = this, r = e.clone(); i = 0 !== i.negative ? i.umod(e) : i.clone(); for ( var o = new a(1), s = new a(0), l = r.clone(); i.cmpn(1) > 0 && r.cmpn(1) > 0; ) { for ( var c = 0, d = 1; (i.words[0] & d) == 0 && c < 26; ++c, d <<= 1 ); if (c > 0) for (i.iushrn(c); c-- > 0; ) o.isOdd() && o.iadd(l), o.iushrn(1); for ( var u = 0, f = 1; (r.words[0] & f) == 0 && u < 26; ++u, f <<= 1 ); if (u > 0) for (r.iushrn(u); u-- > 0; ) s.isOdd() && s.iadd(l), s.iushrn(1); i.cmp(r) >= 0 ? (i.isub(r), o.isub(s)) : (r.isub(i), s.isub(o)); } return 0 > (t = 0 === i.cmpn(1) ? o : s).cmpn(0) && t.iadd(e), t; }), (a.prototype.gcd = function (e) { if (this.isZero()) return e.abs(); if (e.isZero()) return this.abs(); var t = this.clone(), i = e.clone(); (t.negative = 0), (i.negative = 0); for (var n = 0; t.isEven() && i.isEven(); n++) t.iushrn(1), i.iushrn(1); for (;;) { for (; t.isEven(); ) t.iushrn(1); for (; i.isEven(); ) i.iushrn(1); var r = t.cmp(i); if (r < 0) { var a = t; (t = i), (i = a); } else if (0 === r || 0 === i.cmpn(1)) break; t.isub(i); } return i.iushln(n); }), (a.prototype.invm = function (e) { return this.egcd(e).a.umod(e); }), (a.prototype.isEven = function () { return (1 & this.words[0]) == 0; }), (a.prototype.isOdd = function () { return (1 & this.words[0]) == 1; }), (a.prototype.andln = function (e) { return this.words[0] & e; }), (a.prototype.bincn = function (e) { n("number" == typeof e); var t = e % 26, i = (e - t) / 26, r = 1 << t; if (this.length <= i) return this._expand(i + 1), (this.words[i] |= r), this; for (var a = r, o = i; 0 !== a && o < this.length; o++) { var s = 0 | this.words[o]; (s += a), (a = s >>> 26), (s &= 0x3ffffff), (this.words[o] = s); } return 0 !== a && ((this.words[o] = a), this.length++), this; }), (a.prototype.isZero = function () { return 1 === this.length && 0 === this.words[0]; }), (a.prototype.cmpn = function (e) { var t, i = e < 0; if (0 !== this.negative && !i) return -1; if (0 === this.negative && i) return 1; if ((this.strip(), this.length > 1)) t = 1; else { i && (e = -e), n(e <= 0x3ffffff, "Number is too big"); var r = 0 | this.words[0]; t = r === e ? 0 : r < e ? -1 : 1; } return 0 !== this.negative ? 0 | -t : t; }), (a.prototype.cmp = function (e) { if (0 !== this.negative && 0 === e.negative) return -1; if (0 === this.negative && 0 !== e.negative) return 1; var t = this.ucmp(e); return 0 !== this.negative ? 0 | -t : t; }), (a.prototype.ucmp = function (e) { if (this.length > e.length) return 1; if (this.length < e.length) return -1; for (var t = 0, i = this.length - 1; i >= 0; i--) { var n = 0 | this.words[i], r = 0 | e.words[i]; if (n !== r) { n < r ? (t = -1) : n > r && (t = 1); break; } } return t; }), (a.prototype.gtn = function (e) { return 1 === this.cmpn(e); }), (a.prototype.gt = function (e) { return 1 === this.cmp(e); }), (a.prototype.gten = function (e) { return this.cmpn(e) >= 0; }), (a.prototype.gte = function (e) { return this.cmp(e) >= 0; }), (a.prototype.ltn = function (e) { return -1 === this.cmpn(e); }), (a.prototype.lt = function (e) { return -1 === this.cmp(e); }), (a.prototype.lten = function (e) { return 0 >= this.cmpn(e); }), (a.prototype.lte = function (e) { return 0 >= this.cmp(e); }), (a.prototype.eqn = function (e) { return 0 === this.cmpn(e); }), (a.prototype.eq = function (e) { return 0 === this.cmp(e); }), (a.red = function (e) { return new M(e); }), (a.prototype.toRed = function (e) { return ( n(!this.red, "Already a number in reduction context"), n(0 === this.negative, "red works only with positives"), e.convertTo(this)._forceRed(e) ); }), (a.prototype.fromRed = function () { return ( n( this.red, "fromRed works only with numbers in reduction context" ), this.red.convertFrom(this) ); }), (a.prototype._forceRed = function (e) { return (this.red = e), this; }), (a.prototype.forceRed = function (e) { return ( n(!this.red, "Already a number in reduction context"), this._forceRed(e) ); }), (a.prototype.redAdd = function (e) { return ( n(this.red, "redAdd works only with red numbers"), this.red.add(this, e) ); }), (a.prototype.redIAdd = function (e) { return ( n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e) ); }), (a.prototype.redSub = function (e) { return ( n(this.red, "redSub works only with red numbers"), this.red.sub(this, e) ); }), (a.prototype.redISub = function (e) { return ( n(this.red, "redISub works only with red numbers"), this.red.isub(this, e) ); }), (a.prototype.redShl = function (e) { return ( n(this.red, "redShl works only with red numbers"), this.red.shl(this, e) ); }), (a.prototype.redMul = function (e) { return ( n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e), this.red.mul(this, e) ); }), (a.prototype.redIMul = function (e) { return ( n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e), this.red.imul(this, e) ); }), (a.prototype.redSqr = function () { return ( n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this) ); }), (a.prototype.redISqr = function () { return ( n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this) ); }), (a.prototype.redSqrt = function () { return ( n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this) ); }), (a.prototype.redInvm = function () { return ( n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this) ); }), (a.prototype.redNeg = function () { return ( n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this) ); }), (a.prototype.redPow = function (e) { return ( n(this.red && !e.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e) ); }); var y = { k256: null, p224: null, p192: null, p25519: null }; function b(e, t) { (this.name = e), (this.p = new a(t, 16)), (this.n = this.p.bitLength()), (this.k = new a(1).iushln(this.n).isub(this.p)), (this.tmp = this._tmp()); } function I() { b.call( this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" ); } function w() { b.call( this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" ); } function x() { b.call( this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" ); } function S() { b.call( this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" ); } function M(e) { if ("string" == typeof e) { var t = a._prime(e); (this.m = t.p), (this.prime = t); } else n(e.gtn(1), "modulus must be greater than 1"), (this.m = e), (this.prime = null); } function C(e) { M.call(this, e), (this.shift = this.m.bitLength()), this.shift % 26 != 0 && (this.shift += 26 - (this.shift % 26)), (this.r = new a(1).iushln(this.shift)), (this.r2 = this.imod(this.r.sqr())), (this.rinv = this.r._invmp(this.m)), (this.minv = this.rinv.mul(this.r).isubn(1).div(this.m)), (this.minv = this.minv.umod(this.r)), (this.minv = this.r.sub(this.minv)); } (b.prototype._tmp = function () { var e = new a(null); return (e.words = Array(Math.ceil(this.n / 13))), e; }), (b.prototype.ireduce = function (e) { var t, i = e; do this.split(i, this.tmp), (t = (i = (i = this.imulK(i)).iadd(this.tmp)).bitLength()); while (t > this.n); var n = t < this.n ? -1 : i.ucmp(this.p); return ( 0 === n ? ((i.words[0] = 0), (i.length = 1)) : n > 0 ? i.isub(this.p) : void 0 !== i.strip ? i.strip() : i._strip(), i ); }), (b.prototype.split = function (e, t) { e.iushrn(this.n, 0, t); }), (b.prototype.imulK = function (e) { return e.imul(this.k); }), r(I, b), (I.prototype.split = function (e, t) { for (var i = 4194303, n = Math.min(e.length, 9), r = 0; r < n; r++) t.words[r] = e.words[r]; if (((t.length = n), e.length <= 9)) { (e.words[0] = 0), (e.length = 1); return; } var a = e.words[9]; for (r = 10, t.words[t.length++] = a & i; r < e.length; r++) { var o = 0 | e.words[r]; (e.words[r - 10] = ((o & i) << 4) | (a >>> 22)), (a = o); } (a >>>= 22), (e.words[r - 10] = a), 0 === a && e.length > 10 ? (e.length -= 10) : (e.length -= 9); }), (I.prototype.imulK = function (e) { (e.words[e.length] = 0), (e.words[e.length + 1] = 0), (e.length += 2); for (var t = 0, i = 0; i < e.length; i++) { var n = 0 | e.words[i]; (t += 977 * n), (e.words[i] = 0x3ffffff & t), (t = 64 * n + ((t / 0x4000000) | 0)); } return ( 0 === e.words[e.length - 1] && (e.length--, 0 === e.words[e.length - 1] && e.length--), e ); }), r(w, b), r(x, b), r(S, b), (S.prototype.imulK = function (e) { for (var t = 0, i = 0; i < e.length; i++) { var n = (0 | e.words[i]) * 19 + t, r = 0x3ffffff & n; (n >>>= 26), (e.words[i] = r), (t = n); } return 0 !== t && (e.words[e.length++] = t), e; }), (a._prime = function (e) { var t; if (y[e]) return y[e]; if ("k256" === e) t = new I(); else if ("p224" === e) t = new w(); else if ("p192" === e) t = new x(); else if ("p25519" === e) t = new S(); else throw Error("Unknown prime " + e); return (y[e] = t), t; }), (M.prototype._verify1 = function (e) { n(0 === e.negative, "red works only with positives"), n(e.red, "red works only with red numbers"); }), (M.prototype._verify2 = function (e, t) { n((e.negative | t.negative) == 0, "red works only with positives"), n(e.red && e.red === t.red, "red works only with red numbers"); }), (M.prototype.imod = function (e) { return this.prime ? this.prime.ireduce(e)._forceRed(this) : e.umod(this.m)._forceRed(this); }), (M.prototype.neg = function (e) { return e.isZero() ? e.clone() : this.m.sub(e)._forceRed(this); }), (M.prototype.add = function (e, t) { this._verify2(e, t); var i = e.add(t); return i.cmp(this.m) >= 0 && i.isub(this.m), i._forceRed(this); }), (M.prototype.iadd = function (e, t) { this._verify2(e, t); var i = e.iadd(t); return i.cmp(this.m) >= 0 && i.isub(this.m), i; }), (M.prototype.sub = function (e, t) { this._verify2(e, t); var i = e.sub(t); return 0 > i.cmpn(0) && i.iadd(this.m), i._forceRed(this); }), (M.prototype.isub = function (e, t) { this._verify2(e, t); var i = e.isub(t); return 0 > i.cmpn(0) && i.iadd(this.m), i; }), (M.prototype.shl = function (e, t) { return this._verify1(e), this.imod(e.ushln(t)); }), (M.prototype.imul = function (e, t) { return this._verify2(e, t), this.imod(e.imul(t)); }), (M.prototype.mul = function (e, t) { return this._verify2(e, t), this.imod(e.mul(t)); }), (M.prototype.isqr = function (e) { return this.imul(e, e.clone()); }), (M.prototype.sqr = function (e) { return this.mul(e, e); }), (M.prototype.sqrt = function (e) { if (e.isZero()) return e.clone(); var t = this.m.andln(3); if ((n(t % 2 == 1), 3 === t)) { var i = this.m.add(new a(1)).iushrn(2); return this.pow(e, i); } for ( var r = this.m.subn(1), o = 0; !r.isZero() && 0 === r.andln(1); ) o++, r.iushrn(1); n(!r.isZero()); var s = new a(1).toRed(this), l = s.redNeg(), c = this.m.subn(1).iushrn(1), d = this.m.bitLength(); for ( d = new a(2 * d * d).toRed(this); 0 !== this.pow(d, c).cmp(l); ) d.redIAdd(l); for ( var u = this.pow(d, r), f = this.pow(e, r.addn(1).iushrn(1)), h = this.pow(e, r), p = o; 0 !== h.cmp(s); ) { for (var v = h, m = 0; 0 !== v.cmp(s); m++) v = v.redSqr(); n(m < p); var g = this.pow(u, new a(1).iushln(p - m - 1)); (f = f.redMul(g)), (u = g.redSqr()), (h = h.redMul(u)), (p = m); } return f; }), (M.prototype.invm = function (e) { var t = e._invmp(this.m); return 0 !== t.negative ? ((t.negative = 0), this.imod(t).redNeg()) : this.imod(t); }), (M.prototype.pow = function (e, t) { if (t.isZero()) return new a(1).toRed(this); if (0 === t.cmpn(1)) return e.clone(); var i = 4, n = Array(16); (n[0] = new a(1).toRed(this)), (n[1] = e); for (var r = 2; r < n.length; r++) n[r] = this.mul(n[r - 1], e); var o = n[0], s = 0, l = 0, c = t.bitLength() % 26; for (0 === c && (c = 26), r = t.length - 1; r >= 0; r--) { for (var d = t.words[r], u = c - 1; u >= 0; u--) { var f = (d >> u) & 1; if ((o !== n[0] && (o = this.sqr(o)), 0 === f && 0 === s)) { l = 0; continue; } (s <<= 1), (s |= f), (++l === i || (0 === r && 0 === u)) && ((o = this.mul(o, n[s])), (l = 0), (s = 0)); } c = 26; } return o; }), (M.prototype.convertTo = function (e) { var t = e.umod(this.m); return t === e ? t.clone() : t; }), (M.prototype.convertFrom = function (e) { var t = e.clone(); return (t.red = null), t; }), (a.mont = function (e) { return new C(e); }), r(C, M), (C.prototype.convertTo = function (e) { return this.imod(e.ushln(this.shift)); }), (C.prototype.convertFrom = function (e) { var t = this.imod(e.mul(this.rinv)); return (t.red = null), t; }), (C.prototype.imul = function (e, t) { if (e.isZero() || t.isZero()) return (e.words[0] = 0), (e.length = 1), e; var i = e.imul(t), n = i .maskn(this.shift) .mul(this.minv) .imaskn(this.shift) .mul(this.m), r = i.isub(n).iushrn(this.shift), a = r; return ( r.cmp(this.m) >= 0 ? (a = r.isub(this.m)) : 0 > r.cmpn(0) && (a = r.iadd(this.m)), a._forceRed(this) ); }), (C.prototype.mul = function (e, t) { if (e.isZero() || t.isZero()) return new a(0)._forceRed(this); var i = e.mul(t), n = i .maskn(this.shift) .mul(this.minv) .imaskn(this.shift) .mul(this.m), r = i.isub(n).iushrn(this.shift), o = r; return ( r.cmp(this.m) >= 0 ? (o = r.isub(this.m)) : 0 > r.cmpn(0) && (o = r.iadd(this.m)), o._forceRed(this) ); }), (C.prototype.invm = function (e) { return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this); }); })((e = i.nmd(e)), this); }, 937385: function (e, t, i) { !(function (e, t) { "use strict"; function n(e, t) { if (!e) throw Error(t || "Assertion failed"); } function r(e, t) { e.super_ = t; var i = function () {}; (i.prototype = t.prototype), (e.prototype = new i()), (e.prototype.constructor = e); } function a(e, t, i) { if (a.isBN(e)) return e; (this.negative = 0), (this.words = null), (this.length = 0), (this.red = null), null !== e && (("le" === t || "be" === t) && ((i = t), (t = 10)), this._init(e || 0, t || 10, i || "be")); } "object" == typeof e ? (e.exports = a) : (t.BN = a), (a.BN = a), (a.wordSize = 26); try { u = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : i(639416).Buffer; } catch (e) {} function o(e, t) { var i = e.charCodeAt(t); if (i >= 48 && i <= 57) return i - 48; if (i >= 65 && i <= 70) return i - 55; if (i >= 97 && i <= 102) return i - 87; else n(!1, "Invalid character in " + e); } function s(e, t, i) { var n = o(e, i); return i - 1 >= t && (n |= o(e, i - 1) << 4), n; } function l(e, t, i, r) { for (var a = 0, o = 0, s = Math.min(e.length, i), l = t; l < s; l++) { var c = e.charCodeAt(l) - 48; (a *= r), (o = c >= 49 ? c - 49 + 10 : c >= 17 ? c - 17 + 10 : c), n(c >= 0 && o < r, "Invalid character"), (a += o); } return a; } function c(e, t) { (e.words = t.words), (e.length = t.length), (e.negative = t.negative), (e.red = t.red); } if ( ((a.isBN = function (e) { return ( e instanceof a || (null !== e && "object" == typeof e && e.constructor.wordSize === a.wordSize && Array.isArray(e.words)) ); }), (a.max = function (e, t) { return e.cmp(t) > 0 ? e : t; }), (a.min = function (e, t) { return 0 > e.cmp(t) ? e : t; }), (a.prototype._init = function (e, t, i) { if ("number" == typeof e) return this._initNumber(e, t, i); if ("object" == typeof e) return this._initArray(e, t, i); "hex" === t && (t = 16), n(t === (0 | t) && t >= 2 && t <= 36), (e = e.toString().replace(/\s+/g, "")); var r = 0; "-" === e[0] && (r++, (this.negative = 1)), r < e.length && (16 === t ? this._parseHex(e, r, i) : (this._parseBase(e, t, r), "le" === i && this._initArray(this.toArray(), t, i))); }), (a.prototype._initNumber = function (e, t, i) { e < 0 && ((this.negative = 1), (e = -e)), e < 0x4000000 ? ((this.words = [0x3ffffff & e]), (this.length = 1)) : e < 0x10000000000000 ? ((this.words = [0x3ffffff & e, (e / 0x4000000) & 0x3ffffff]), (this.length = 2)) : (n(e < 0x20000000000000), (this.words = [ 0x3ffffff & e, (e / 0x4000000) & 0x3ffffff, 1, ]), (this.length = 3)), "le" === i && this._initArray(this.toArray(), t, i); }), (a.prototype._initArray = function (e, t, i) { if ((n("number" == typeof e.length), e.length <= 0)) return (this.words = [0]), (this.length = 1), this; (this.length = Math.ceil(e.length / 3)), (this.words = Array(this.length)); for (var r, a, o = 0; o < this.length; o++) this.words[o] = 0; var s = 0; if ("be" === i) for (o = e.length - 1, r = 0; o >= 0; o -= 3) (a = e[o] | (e[o - 1] << 8) | (e[o - 2] << 16)), (this.words[r] |= (a << s) & 0x3ffffff), (this.words[r + 1] = (a >>> (26 - s)) & 0x3ffffff), (s += 24) >= 26 && ((s -= 26), r++); else if ("le" === i) for (o = 0, r = 0; o < e.length; o += 3) (a = e[o] | (e[o + 1] << 8) | (e[o + 2] << 16)), (this.words[r] |= (a << s) & 0x3ffffff), (this.words[r + 1] = (a >>> (26 - s)) & 0x3ffffff), (s += 24) >= 26 && ((s -= 26), r++); return this._strip(); }), (a.prototype._parseHex = function (e, t, i) { (this.length = Math.ceil((e.length - t) / 6)), (this.words = Array(this.length)); for (var n, r = 0; r < this.length; r++) this.words[r] = 0; var a = 0, o = 0; if ("be" === i) for (r = e.length - 1; r >= t; r -= 2) (n = s(e, t, r) << a), (this.words[o] |= 0x3ffffff & n), a >= 18 ? ((a -= 18), (o += 1), (this.words[o] |= n >>> 26)) : (a += 8); else for ( r = (e.length - t) % 2 == 0 ? t + 1 : t; r < e.length; r += 2 ) (n = s(e, t, r) << a), (this.words[o] |= 0x3ffffff & n), a >= 18 ? ((a -= 18), (o += 1), (this.words[o] |= n >>> 26)) : (a += 8); this._strip(); }), (a.prototype._parseBase = function (e, t, i) { (this.words = [0]), (this.length = 1); for (var n = 0, r = 1; r <= 0x3ffffff; r *= t) n++; n--, (r = (r / t) | 0); for ( var a = e.length - i, o = a % n, s = Math.min(a, a - o) + i, c = 0, d = i; d < s; d += n ) (c = l(e, d, d + n, t)), this.imuln(r), this.words[0] + c < 0x4000000 ? (this.words[0] += c) : this._iaddn(c); if (0 !== o) { var u = 1; for (c = l(e, d, e.length, t), d = 0; d < o; d++) u *= t; this.imuln(u), this.words[0] + c < 0x4000000 ? (this.words[0] += c) : this._iaddn(c); } this._strip(); }), (a.prototype.copy = function (e) { e.words = Array(this.length); for (var t = 0; t < this.length; t++) e.words[t] = this.words[t]; (e.length = this.length), (e.negative = this.negative), (e.red = this.red); }), (a.prototype._move = function (e) { c(e, this); }), (a.prototype.clone = function () { var e = new a(null); return this.copy(e), e; }), (a.prototype._expand = function (e) { for (; this.length < e; ) this.words[this.length++] = 0; return this; }), (a.prototype._strip = function () { for (; this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--; return this._normSign(); }), (a.prototype._normSign = function () { return ( 1 === this.length && 0 === this.words[0] && (this.negative = 0), this ); }), "undefined" != typeof Symbol && "function" == typeof Symbol.for) ) try { a.prototype[Symbol.for("nodejs.util.inspect.custom")] = d; } catch (e) { a.prototype.inspect = d; } else a.prototype.inspect = d; function d() { return (this.red ? ""; } var u, f = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000", ], h = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, ], p = [ 0, 0, 0x2000000, 0x290d741, 0x1000000, 0x2e90edd, 0x39aa400, 0x267bf47, 0x1000000, 0x290d741, 1e7, 0x12959c3, 0x222c000, 0x3bd7765, 7529536, 0xadcea1, 0x1000000, 0x1704f61, 0x206fc40, 0x2cddcf9, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 0xb54ba0, 0xdaf26b, 0x1069c00, 0x138f9ad, 243e5, 0x1b4d89f, 0x2000000, 0x25528a1, 0x2b54a20, 0x3216b93, 0x39aa400, ]; (a.prototype.toString = function (e, t) { if (((t = 0 | t || 1), 16 === (e = e || 10) || "hex" === e)) { i = ""; for (var i, r = 0, a = 0, o = 0; o < this.length; o++) { var s = this.words[o], l = (((s << r) | a) & 0xffffff).toString(16); (a = (s >>> (24 - r)) & 0xffffff), (r += 2) >= 26 && ((r -= 26), o--), (i = 0 !== a || o !== this.length - 1 ? f[6 - l.length] + l + i : l + i); } for (0 !== a && (i = a.toString(16) + i); i.length % t != 0; ) i = "0" + i; return 0 !== this.negative && (i = "-" + i), i; } if (e === (0 | e) && e >= 2 && e <= 36) { var c = h[e], d = p[e]; i = ""; var u = this.clone(); for (u.negative = 0; !u.isZero(); ) { var v = u.modrn(d).toString(e); i = (u = u.idivn(d)).isZero() ? v + i : f[c - v.length] + v + i; } for (this.isZero() && (i = "0" + i); i.length % t != 0; ) i = "0" + i; return 0 !== this.negative && (i = "-" + i), i; } n(!1, "Base should be between 2 and 36"); }), (a.prototype.toNumber = function () { var e = this.words[0]; return ( 2 === this.length ? (e += 0x4000000 * this.words[1]) : 3 === this.length && 1 === this.words[2] ? (e += 0x10000000000000 + 0x4000000 * this.words[1]) : this.length > 2 && n(!1, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e : e ); }), (a.prototype.toJSON = function () { return this.toString(16, 2); }), u && (a.prototype.toBuffer = function (e, t) { return this.toArrayLike(u, e, t); }), (a.prototype.toArray = function (e, t) { return this.toArrayLike(Array, e, t); }); var v = function (e, t) { return e.allocUnsafe ? e.allocUnsafe(t) : new e(t); }; function m(e) { for (var t = Array(e.bitLength()), i = 0; i < t.length; i++) { var n = (i / 26) | 0, r = i % 26; t[i] = (e.words[n] >>> r) & 1; } return t; } function g(e, t, i) { i.negative = t.negative ^ e.negative; var n = (e.length + t.length) | 0; (i.length = n), (n = (n - 1) | 0); var r = 0 | e.words[0], a = 0 | t.words[0], o = r * a, s = 0x3ffffff & o, l = (o / 0x4000000) | 0; i.words[0] = s; for (var c = 1; c < n; c++) { for ( var d = l >>> 26, u = 0x3ffffff & l, f = Math.min(c, t.length - 1), h = Math.max(0, c - e.length + 1); h <= f; h++ ) { var p = (c - h) | 0; (r = 0 | e.words[p]), (d += ((o = r * (a = 0 | t.words[h]) + u) / 0x4000000) | 0), (u = 0x3ffffff & o); } (i.words[c] = 0 | u), (l = 0 | d); } return 0 !== l ? (i.words[c] = 0 | l) : i.length--, i._strip(); } (a.prototype.toArrayLike = function (e, t, i) { this._strip(); var r = this.byteLength(), a = i || Math.max(1, r); n(r <= a, "byte array longer than desired length"), n(a > 0, "Requested array length <= 0"); var o = v(e, a); return this["_toArrayLike" + ("le" === t ? "LE" : "BE")](o, r), o; }), (a.prototype._toArrayLikeLE = function (e, t) { for (var i = 0, n = 0, r = 0, a = 0; r < this.length; r++) { var o = (this.words[r] << a) | n; (e[i++] = 255 & o), i < e.length && (e[i++] = (o >> 8) & 255), i < e.length && (e[i++] = (o >> 16) & 255), 6 === a ? (i < e.length && (e[i++] = (o >> 24) & 255), (n = 0), (a = 0)) : ((n = o >>> 24), (a += 2)); } if (i < e.length) for (e[i++] = n; i < e.length; ) e[i++] = 0; }), (a.prototype._toArrayLikeBE = function (e, t) { for ( var i = e.length - 1, n = 0, r = 0, a = 0; r < this.length; r++ ) { var o = (this.words[r] << a) | n; (e[i--] = 255 & o), i >= 0 && (e[i--] = (o >> 8) & 255), i >= 0 && (e[i--] = (o >> 16) & 255), 6 === a ? (i >= 0 && (e[i--] = (o >> 24) & 255), (n = 0), (a = 0)) : ((n = o >>> 24), (a += 2)); } if (i >= 0) for (e[i--] = n; i >= 0; ) e[i--] = 0; }), Math.clz32 ? (a.prototype._countBits = function (e) { return 32 - Math.clz32(e); }) : (a.prototype._countBits = function (e) { var t = e, i = 0; return ( t >= 4096 && ((i += 13), (t >>>= 13)), t >= 64 && ((i += 7), (t >>>= 7)), t >= 8 && ((i += 4), (t >>>= 4)), t >= 2 && ((i += 2), (t >>>= 2)), i + t ); }), (a.prototype._zeroBits = function (e) { if (0 === e) return 26; var t = e, i = 0; return ( (8191 & t) == 0 && ((i += 13), (t >>>= 13)), (127 & t) == 0 && ((i += 7), (t >>>= 7)), (15 & t) == 0 && ((i += 4), (t >>>= 4)), (3 & t) == 0 && ((i += 2), (t >>>= 2)), (1 & t) == 0 && i++, i ); }), (a.prototype.bitLength = function () { var e = this.words[this.length - 1], t = this._countBits(e); return (this.length - 1) * 26 + t; }), (a.prototype.zeroBits = function () { if (this.isZero()) return 0; for (var e = 0, t = 0; t < this.length; t++) { var i = this._zeroBits(this.words[t]); if (((e += i), 26 !== i)) break; } return e; }), (a.prototype.byteLength = function () { return Math.ceil(this.bitLength() / 8); }), (a.prototype.toTwos = function (e) { return 0 !== this.negative ? this.abs().inotn(e).iaddn(1) : this.clone(); }), (a.prototype.fromTwos = function (e) { return this.testn(e - 1) ? this.notn(e).iaddn(1).ineg() : this.clone(); }), (a.prototype.isNeg = function () { return 0 !== this.negative; }), (a.prototype.neg = function () { return this.clone().ineg(); }), (a.prototype.ineg = function () { return !this.isZero() && (this.negative ^= 1), this; }), (a.prototype.iuor = function (e) { for (; this.length < e.length; ) this.words[this.length++] = 0; for (var t = 0; t < e.length; t++) this.words[t] = this.words[t] | e.words[t]; return this._strip(); }), (a.prototype.ior = function (e) { return n((this.negative | e.negative) == 0), this.iuor(e); }), (a.prototype.or = function (e) { return this.length > e.length ? this.clone().ior(e) : e.clone().ior(this); }), (a.prototype.uor = function (e) { return this.length > e.length ? this.clone().iuor(e) : e.clone().iuor(this); }), (a.prototype.iuand = function (e) { var t; t = this.length > e.length ? e : this; for (var i = 0; i < t.length; i++) this.words[i] = this.words[i] & e.words[i]; return (this.length = t.length), this._strip(); }), (a.prototype.iand = function (e) { return n((this.negative | e.negative) == 0), this.iuand(e); }), (a.prototype.and = function (e) { return this.length > e.length ? this.clone().iand(e) : e.clone().iand(this); }), (a.prototype.uand = function (e) { return this.length > e.length ? this.clone().iuand(e) : e.clone().iuand(this); }), (a.prototype.iuxor = function (e) { this.length > e.length ? ((t = this), (i = e)) : ((t = e), (i = this)); for (var t, i, n = 0; n < i.length; n++) this.words[n] = t.words[n] ^ i.words[n]; if (this !== t) for (; n < t.length; n++) this.words[n] = t.words[n]; return (this.length = t.length), this._strip(); }), (a.prototype.ixor = function (e) { return n((this.negative | e.negative) == 0), this.iuxor(e); }), (a.prototype.xor = function (e) { return this.length > e.length ? this.clone().ixor(e) : e.clone().ixor(this); }), (a.prototype.uxor = function (e) { return this.length > e.length ? this.clone().iuxor(e) : e.clone().iuxor(this); }), (a.prototype.inotn = function (e) { n("number" == typeof e && e >= 0); var t = 0 | Math.ceil(e / 26), i = e % 26; this._expand(t), i > 0 && t--; for (var r = 0; r < t; r++) this.words[r] = 0x3ffffff & ~this.words[r]; return ( i > 0 && (this.words[r] = ~this.words[r] & (0x3ffffff >> (26 - i))), this._strip() ); }), (a.prototype.notn = function (e) { return this.clone().inotn(e); }), (a.prototype.setn = function (e, t) { n("number" == typeof e && e >= 0); var i = (e / 26) | 0, r = e % 26; return ( this._expand(i + 1), t ? (this.words[i] = this.words[i] | (1 << r)) : (this.words[i] = this.words[i] & ~(1 << r)), this._strip() ); }), (a.prototype.iadd = function (e) { if (0 !== this.negative && 0 === e.negative) return ( (this.negative = 0), (t = this.isub(e)), (this.negative ^= 1), this._normSign() ); if (0 === this.negative && 0 !== e.negative) return ( (e.negative = 0), (t = this.isub(e)), (e.negative = 1), t._normSign() ); this.length > e.length ? ((i = this), (n = e)) : ((i = e), (n = this)); for (var t, i, n, r = 0, a = 0; a < n.length; a++) (t = (0 | i.words[a]) + (0 | n.words[a]) + r), (this.words[a] = 0x3ffffff & t), (r = t >>> 26); for (; 0 !== r && a < i.length; a++) (t = (0 | i.words[a]) + r), (this.words[a] = 0x3ffffff & t), (r = t >>> 26); if (((this.length = i.length), 0 !== r)) (this.words[this.length] = r), this.length++; else if (i !== this) for (; a < i.length; a++) this.words[a] = i.words[a]; return this; }), (a.prototype.add = function (e) { var t; return 0 !== e.negative && 0 === this.negative ? ((e.negative = 0), (t = this.sub(e)), (e.negative ^= 1), t) : 0 === e.negative && 0 !== this.negative ? ((this.negative = 0), (t = e.sub(this)), (this.negative = 1), t) : this.length > e.length ? this.clone().iadd(e) : e.clone().iadd(this); }), (a.prototype.isub = function (e) { if (0 !== e.negative) { e.negative = 0; var t, i, n = this.iadd(e); return (e.negative = 1), n._normSign(); } if (0 !== this.negative) return ( (this.negative = 0), this.iadd(e), (this.negative = 1), this._normSign() ); var r = this.cmp(e); if (0 === r) return ( (this.negative = 0), (this.length = 1), (this.words[0] = 0), this ); r > 0 ? ((t = this), (i = e)) : ((t = e), (i = this)); for (var a = 0, o = 0; o < i.length; o++) (a = (n = (0 | t.words[o]) - (0 | i.words[o]) + a) >> 26), (this.words[o] = 0x3ffffff & n); for (; 0 !== a && o < t.length; o++) (a = (n = (0 | t.words[o]) + a) >> 26), (this.words[o] = 0x3ffffff & n); if (0 === a && o < t.length && t !== this) for (; o < t.length; o++) this.words[o] = t.words[o]; return ( (this.length = Math.max(this.length, o)), t !== this && (this.negative = 1), this._strip() ); }), (a.prototype.sub = function (e) { return this.clone().isub(e); }); var _ = function (e, t, i) { var n, r, a, o = e.words, s = t.words, l = i.words, c = 0, d = 0 | o[0], u = 8191 & d, f = d >>> 13, h = 0 | o[1], p = 8191 & h, v = h >>> 13, m = 0 | o[2], g = 8191 & m, _ = m >>> 13, y = 0 | o[3], b = 8191 & y, I = y >>> 13, w = 0 | o[4], x = 8191 & w, S = w >>> 13, M = 0 | o[5], C = 8191 & M, T = M >>> 13, A = 0 | o[6], k = 8191 & A, P = A >>> 13, E = 0 | o[7], D = 8191 & E, R = E >>> 13, N = 0 | o[8], L = 8191 & N, j = N >>> 13, O = 0 | o[9], B = 8191 & O, F = O >>> 13, U = 0 | s[0], G = 8191 & U, z = U >>> 13, V = 0 | s[1], W = 8191 & V, Z = V >>> 13, K = 0 | s[2], H = 8191 & K, q = K >>> 13, J = 0 | s[3], Y = 8191 & J, Q = J >>> 13, X = 0 | s[4], $ = 8191 & X, ee = X >>> 13, et = 0 | s[5], ei = 8191 & et, en = et >>> 13, er = 0 | s[6], ea = 8191 & er, eo = er >>> 13, es = 0 | s[7], el = 8191 & es, ec = es >>> 13, ed = 0 | s[8], eu = 8191 & ed, ef = ed >>> 13, eh = 0 | s[9], ep = 8191 & eh, ev = eh >>> 13; (i.negative = e.negative ^ t.negative), (i.length = 19), (n = Math.imul(u, G)), (r = ((r = Math.imul(u, z)) + Math.imul(f, G)) | 0); var em = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = Math.imul(f, z)) + (r >>> 13)) | 0) + (em >>> 26)) | 0), (em &= 0x3ffffff), (n = Math.imul(p, G)), (r = ((r = Math.imul(p, z)) + Math.imul(v, G)) | 0), (a = Math.imul(v, z)), (n = (n + Math.imul(u, W)) | 0), (r = ((r = (r + Math.imul(u, Z)) | 0) + Math.imul(f, W)) | 0); var eg = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, Z)) | 0) + (r >>> 13)) | 0) + (eg >>> 26)) | 0), (eg &= 0x3ffffff), (n = Math.imul(g, G)), (r = ((r = Math.imul(g, z)) + Math.imul(_, G)) | 0), (a = Math.imul(_, z)), (n = (n + Math.imul(p, W)) | 0), (r = ((r = (r + Math.imul(p, Z)) | 0) + Math.imul(v, W)) | 0), (a = (a + Math.imul(v, Z)) | 0), (n = (n + Math.imul(u, H)) | 0), (r = ((r = (r + Math.imul(u, q)) | 0) + Math.imul(f, H)) | 0); var e_ = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, q)) | 0) + (r >>> 13)) | 0) + (e_ >>> 26)) | 0), (e_ &= 0x3ffffff), (n = Math.imul(b, G)), (r = ((r = Math.imul(b, z)) + Math.imul(I, G)) | 0), (a = Math.imul(I, z)), (n = (n + Math.imul(g, W)) | 0), (r = ((r = (r + Math.imul(g, Z)) | 0) + Math.imul(_, W)) | 0), (a = (a + Math.imul(_, Z)) | 0), (n = (n + Math.imul(p, H)) | 0), (r = ((r = (r + Math.imul(p, q)) | 0) + Math.imul(v, H)) | 0), (a = (a + Math.imul(v, q)) | 0), (n = (n + Math.imul(u, Y)) | 0), (r = ((r = (r + Math.imul(u, Q)) | 0) + Math.imul(f, Y)) | 0); var ey = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, Q)) | 0) + (r >>> 13)) | 0) + (ey >>> 26)) | 0), (ey &= 0x3ffffff), (n = Math.imul(x, G)), (r = ((r = Math.imul(x, z)) + Math.imul(S, G)) | 0), (a = Math.imul(S, z)), (n = (n + Math.imul(b, W)) | 0), (r = ((r = (r + Math.imul(b, Z)) | 0) + Math.imul(I, W)) | 0), (a = (a + Math.imul(I, Z)) | 0), (n = (n + Math.imul(g, H)) | 0), (r = ((r = (r + Math.imul(g, q)) | 0) + Math.imul(_, H)) | 0), (a = (a + Math.imul(_, q)) | 0), (n = (n + Math.imul(p, Y)) | 0), (r = ((r = (r + Math.imul(p, Q)) | 0) + Math.imul(v, Y)) | 0), (a = (a + Math.imul(v, Q)) | 0), (n = (n + Math.imul(u, $)) | 0), (r = ((r = (r + Math.imul(u, ee)) | 0) + Math.imul(f, $)) | 0); var eb = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ee)) | 0) + (r >>> 13)) | 0) + (eb >>> 26)) | 0), (eb &= 0x3ffffff), (n = Math.imul(C, G)), (r = ((r = Math.imul(C, z)) + Math.imul(T, G)) | 0), (a = Math.imul(T, z)), (n = (n + Math.imul(x, W)) | 0), (r = ((r = (r + Math.imul(x, Z)) | 0) + Math.imul(S, W)) | 0), (a = (a + Math.imul(S, Z)) | 0), (n = (n + Math.imul(b, H)) | 0), (r = ((r = (r + Math.imul(b, q)) | 0) + Math.imul(I, H)) | 0), (a = (a + Math.imul(I, q)) | 0), (n = (n + Math.imul(g, Y)) | 0), (r = ((r = (r + Math.imul(g, Q)) | 0) + Math.imul(_, Y)) | 0), (a = (a + Math.imul(_, Q)) | 0), (n = (n + Math.imul(p, $)) | 0), (r = ((r = (r + Math.imul(p, ee)) | 0) + Math.imul(v, $)) | 0), (a = (a + Math.imul(v, ee)) | 0), (n = (n + Math.imul(u, ei)) | 0), (r = ((r = (r + Math.imul(u, en)) | 0) + Math.imul(f, ei)) | 0); var eI = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, en)) | 0) + (r >>> 13)) | 0) + (eI >>> 26)) | 0), (eI &= 0x3ffffff), (n = Math.imul(k, G)), (r = ((r = Math.imul(k, z)) + Math.imul(P, G)) | 0), (a = Math.imul(P, z)), (n = (n + Math.imul(C, W)) | 0), (r = ((r = (r + Math.imul(C, Z)) | 0) + Math.imul(T, W)) | 0), (a = (a + Math.imul(T, Z)) | 0), (n = (n + Math.imul(x, H)) | 0), (r = ((r = (r + Math.imul(x, q)) | 0) + Math.imul(S, H)) | 0), (a = (a + Math.imul(S, q)) | 0), (n = (n + Math.imul(b, Y)) | 0), (r = ((r = (r + Math.imul(b, Q)) | 0) + Math.imul(I, Y)) | 0), (a = (a + Math.imul(I, Q)) | 0), (n = (n + Math.imul(g, $)) | 0), (r = ((r = (r + Math.imul(g, ee)) | 0) + Math.imul(_, $)) | 0), (a = (a + Math.imul(_, ee)) | 0), (n = (n + Math.imul(p, ei)) | 0), (r = ((r = (r + Math.imul(p, en)) | 0) + Math.imul(v, ei)) | 0), (a = (a + Math.imul(v, en)) | 0), (n = (n + Math.imul(u, ea)) | 0), (r = ((r = (r + Math.imul(u, eo)) | 0) + Math.imul(f, ea)) | 0); var ew = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, eo)) | 0) + (r >>> 13)) | 0) + (ew >>> 26)) | 0), (ew &= 0x3ffffff), (n = Math.imul(D, G)), (r = ((r = Math.imul(D, z)) + Math.imul(R, G)) | 0), (a = Math.imul(R, z)), (n = (n + Math.imul(k, W)) | 0), (r = ((r = (r + Math.imul(k, Z)) | 0) + Math.imul(P, W)) | 0), (a = (a + Math.imul(P, Z)) | 0), (n = (n + Math.imul(C, H)) | 0), (r = ((r = (r + Math.imul(C, q)) | 0) + Math.imul(T, H)) | 0), (a = (a + Math.imul(T, q)) | 0), (n = (n + Math.imul(x, Y)) | 0), (r = ((r = (r + Math.imul(x, Q)) | 0) + Math.imul(S, Y)) | 0), (a = (a + Math.imul(S, Q)) | 0), (n = (n + Math.imul(b, $)) | 0), (r = ((r = (r + Math.imul(b, ee)) | 0) + Math.imul(I, $)) | 0), (a = (a + Math.imul(I, ee)) | 0), (n = (n + Math.imul(g, ei)) | 0), (r = ((r = (r + Math.imul(g, en)) | 0) + Math.imul(_, ei)) | 0), (a = (a + Math.imul(_, en)) | 0), (n = (n + Math.imul(p, ea)) | 0), (r = ((r = (r + Math.imul(p, eo)) | 0) + Math.imul(v, ea)) | 0), (a = (a + Math.imul(v, eo)) | 0), (n = (n + Math.imul(u, el)) | 0), (r = ((r = (r + Math.imul(u, ec)) | 0) + Math.imul(f, el)) | 0); var ex = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ec)) | 0) + (r >>> 13)) | 0) + (ex >>> 26)) | 0), (ex &= 0x3ffffff), (n = Math.imul(L, G)), (r = ((r = Math.imul(L, z)) + Math.imul(j, G)) | 0), (a = Math.imul(j, z)), (n = (n + Math.imul(D, W)) | 0), (r = ((r = (r + Math.imul(D, Z)) | 0) + Math.imul(R, W)) | 0), (a = (a + Math.imul(R, Z)) | 0), (n = (n + Math.imul(k, H)) | 0), (r = ((r = (r + Math.imul(k, q)) | 0) + Math.imul(P, H)) | 0), (a = (a + Math.imul(P, q)) | 0), (n = (n + Math.imul(C, Y)) | 0), (r = ((r = (r + Math.imul(C, Q)) | 0) + Math.imul(T, Y)) | 0), (a = (a + Math.imul(T, Q)) | 0), (n = (n + Math.imul(x, $)) | 0), (r = ((r = (r + Math.imul(x, ee)) | 0) + Math.imul(S, $)) | 0), (a = (a + Math.imul(S, ee)) | 0), (n = (n + Math.imul(b, ei)) | 0), (r = ((r = (r + Math.imul(b, en)) | 0) + Math.imul(I, ei)) | 0), (a = (a + Math.imul(I, en)) | 0), (n = (n + Math.imul(g, ea)) | 0), (r = ((r = (r + Math.imul(g, eo)) | 0) + Math.imul(_, ea)) | 0), (a = (a + Math.imul(_, eo)) | 0), (n = (n + Math.imul(p, el)) | 0), (r = ((r = (r + Math.imul(p, ec)) | 0) + Math.imul(v, el)) | 0), (a = (a + Math.imul(v, ec)) | 0), (n = (n + Math.imul(u, eu)) | 0), (r = ((r = (r + Math.imul(u, ef)) | 0) + Math.imul(f, eu)) | 0); var eS = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ef)) | 0) + (r >>> 13)) | 0) + (eS >>> 26)) | 0), (eS &= 0x3ffffff), (n = Math.imul(B, G)), (r = ((r = Math.imul(B, z)) + Math.imul(F, G)) | 0), (a = Math.imul(F, z)), (n = (n + Math.imul(L, W)) | 0), (r = ((r = (r + Math.imul(L, Z)) | 0) + Math.imul(j, W)) | 0), (a = (a + Math.imul(j, Z)) | 0), (n = (n + Math.imul(D, H)) | 0), (r = ((r = (r + Math.imul(D, q)) | 0) + Math.imul(R, H)) | 0), (a = (a + Math.imul(R, q)) | 0), (n = (n + Math.imul(k, Y)) | 0), (r = ((r = (r + Math.imul(k, Q)) | 0) + Math.imul(P, Y)) | 0), (a = (a + Math.imul(P, Q)) | 0), (n = (n + Math.imul(C, $)) | 0), (r = ((r = (r + Math.imul(C, ee)) | 0) + Math.imul(T, $)) | 0), (a = (a + Math.imul(T, ee)) | 0), (n = (n + Math.imul(x, ei)) | 0), (r = ((r = (r + Math.imul(x, en)) | 0) + Math.imul(S, ei)) | 0), (a = (a + Math.imul(S, en)) | 0), (n = (n + Math.imul(b, ea)) | 0), (r = ((r = (r + Math.imul(b, eo)) | 0) + Math.imul(I, ea)) | 0), (a = (a + Math.imul(I, eo)) | 0), (n = (n + Math.imul(g, el)) | 0), (r = ((r = (r + Math.imul(g, ec)) | 0) + Math.imul(_, el)) | 0), (a = (a + Math.imul(_, ec)) | 0), (n = (n + Math.imul(p, eu)) | 0), (r = ((r = (r + Math.imul(p, ef)) | 0) + Math.imul(v, eu)) | 0), (a = (a + Math.imul(v, ef)) | 0), (n = (n + Math.imul(u, ep)) | 0), (r = ((r = (r + Math.imul(u, ev)) | 0) + Math.imul(f, ep)) | 0); var eM = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(f, ev)) | 0) + (r >>> 13)) | 0) + (eM >>> 26)) | 0), (eM &= 0x3ffffff), (n = Math.imul(B, W)), (r = ((r = Math.imul(B, Z)) + Math.imul(F, W)) | 0), (a = Math.imul(F, Z)), (n = (n + Math.imul(L, H)) | 0), (r = ((r = (r + Math.imul(L, q)) | 0) + Math.imul(j, H)) | 0), (a = (a + Math.imul(j, q)) | 0), (n = (n + Math.imul(D, Y)) | 0), (r = ((r = (r + Math.imul(D, Q)) | 0) + Math.imul(R, Y)) | 0), (a = (a + Math.imul(R, Q)) | 0), (n = (n + Math.imul(k, $)) | 0), (r = ((r = (r + Math.imul(k, ee)) | 0) + Math.imul(P, $)) | 0), (a = (a + Math.imul(P, ee)) | 0), (n = (n + Math.imul(C, ei)) | 0), (r = ((r = (r + Math.imul(C, en)) | 0) + Math.imul(T, ei)) | 0), (a = (a + Math.imul(T, en)) | 0), (n = (n + Math.imul(x, ea)) | 0), (r = ((r = (r + Math.imul(x, eo)) | 0) + Math.imul(S, ea)) | 0), (a = (a + Math.imul(S, eo)) | 0), (n = (n + Math.imul(b, el)) | 0), (r = ((r = (r + Math.imul(b, ec)) | 0) + Math.imul(I, el)) | 0), (a = (a + Math.imul(I, ec)) | 0), (n = (n + Math.imul(g, eu)) | 0), (r = ((r = (r + Math.imul(g, ef)) | 0) + Math.imul(_, eu)) | 0), (a = (a + Math.imul(_, ef)) | 0), (n = (n + Math.imul(p, ep)) | 0), (r = ((r = (r + Math.imul(p, ev)) | 0) + Math.imul(v, ep)) | 0); var eC = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(v, ev)) | 0) + (r >>> 13)) | 0) + (eC >>> 26)) | 0), (eC &= 0x3ffffff), (n = Math.imul(B, H)), (r = ((r = Math.imul(B, q)) + Math.imul(F, H)) | 0), (a = Math.imul(F, q)), (n = (n + Math.imul(L, Y)) | 0), (r = ((r = (r + Math.imul(L, Q)) | 0) + Math.imul(j, Y)) | 0), (a = (a + Math.imul(j, Q)) | 0), (n = (n + Math.imul(D, $)) | 0), (r = ((r = (r + Math.imul(D, ee)) | 0) + Math.imul(R, $)) | 0), (a = (a + Math.imul(R, ee)) | 0), (n = (n + Math.imul(k, ei)) | 0), (r = ((r = (r + Math.imul(k, en)) | 0) + Math.imul(P, ei)) | 0), (a = (a + Math.imul(P, en)) | 0), (n = (n + Math.imul(C, ea)) | 0), (r = ((r = (r + Math.imul(C, eo)) | 0) + Math.imul(T, ea)) | 0), (a = (a + Math.imul(T, eo)) | 0), (n = (n + Math.imul(x, el)) | 0), (r = ((r = (r + Math.imul(x, ec)) | 0) + Math.imul(S, el)) | 0), (a = (a + Math.imul(S, ec)) | 0), (n = (n + Math.imul(b, eu)) | 0), (r = ((r = (r + Math.imul(b, ef)) | 0) + Math.imul(I, eu)) | 0), (a = (a + Math.imul(I, ef)) | 0), (n = (n + Math.imul(g, ep)) | 0), (r = ((r = (r + Math.imul(g, ev)) | 0) + Math.imul(_, ep)) | 0); var eT = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(_, ev)) | 0) + (r >>> 13)) | 0) + (eT >>> 26)) | 0), (eT &= 0x3ffffff), (n = Math.imul(B, Y)), (r = ((r = Math.imul(B, Q)) + Math.imul(F, Y)) | 0), (a = Math.imul(F, Q)), (n = (n + Math.imul(L, $)) | 0), (r = ((r = (r + Math.imul(L, ee)) | 0) + Math.imul(j, $)) | 0), (a = (a + Math.imul(j, ee)) | 0), (n = (n + Math.imul(D, ei)) | 0), (r = ((r = (r + Math.imul(D, en)) | 0) + Math.imul(R, ei)) | 0), (a = (a + Math.imul(R, en)) | 0), (n = (n + Math.imul(k, ea)) | 0), (r = ((r = (r + Math.imul(k, eo)) | 0) + Math.imul(P, ea)) | 0), (a = (a + Math.imul(P, eo)) | 0), (n = (n + Math.imul(C, el)) | 0), (r = ((r = (r + Math.imul(C, ec)) | 0) + Math.imul(T, el)) | 0), (a = (a + Math.imul(T, ec)) | 0), (n = (n + Math.imul(x, eu)) | 0), (r = ((r = (r + Math.imul(x, ef)) | 0) + Math.imul(S, eu)) | 0), (a = (a + Math.imul(S, ef)) | 0), (n = (n + Math.imul(b, ep)) | 0), (r = ((r = (r + Math.imul(b, ev)) | 0) + Math.imul(I, ep)) | 0); var eA = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(I, ev)) | 0) + (r >>> 13)) | 0) + (eA >>> 26)) | 0), (eA &= 0x3ffffff), (n = Math.imul(B, $)), (r = ((r = Math.imul(B, ee)) + Math.imul(F, $)) | 0), (a = Math.imul(F, ee)), (n = (n + Math.imul(L, ei)) | 0), (r = ((r = (r + Math.imul(L, en)) | 0) + Math.imul(j, ei)) | 0), (a = (a + Math.imul(j, en)) | 0), (n = (n + Math.imul(D, ea)) | 0), (r = ((r = (r + Math.imul(D, eo)) | 0) + Math.imul(R, ea)) | 0), (a = (a + Math.imul(R, eo)) | 0), (n = (n + Math.imul(k, el)) | 0), (r = ((r = (r + Math.imul(k, ec)) | 0) + Math.imul(P, el)) | 0), (a = (a + Math.imul(P, ec)) | 0), (n = (n + Math.imul(C, eu)) | 0), (r = ((r = (r + Math.imul(C, ef)) | 0) + Math.imul(T, eu)) | 0), (a = (a + Math.imul(T, ef)) | 0), (n = (n + Math.imul(x, ep)) | 0), (r = ((r = (r + Math.imul(x, ev)) | 0) + Math.imul(S, ep)) | 0); var ek = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(S, ev)) | 0) + (r >>> 13)) | 0) + (ek >>> 26)) | 0), (ek &= 0x3ffffff), (n = Math.imul(B, ei)), (r = ((r = Math.imul(B, en)) + Math.imul(F, ei)) | 0), (a = Math.imul(F, en)), (n = (n + Math.imul(L, ea)) | 0), (r = ((r = (r + Math.imul(L, eo)) | 0) + Math.imul(j, ea)) | 0), (a = (a + Math.imul(j, eo)) | 0), (n = (n + Math.imul(D, el)) | 0), (r = ((r = (r + Math.imul(D, ec)) | 0) + Math.imul(R, el)) | 0), (a = (a + Math.imul(R, ec)) | 0), (n = (n + Math.imul(k, eu)) | 0), (r = ((r = (r + Math.imul(k, ef)) | 0) + Math.imul(P, eu)) | 0), (a = (a + Math.imul(P, ef)) | 0), (n = (n + Math.imul(C, ep)) | 0), (r = ((r = (r + Math.imul(C, ev)) | 0) + Math.imul(T, ep)) | 0); var eP = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(T, ev)) | 0) + (r >>> 13)) | 0) + (eP >>> 26)) | 0), (eP &= 0x3ffffff), (n = Math.imul(B, ea)), (r = ((r = Math.imul(B, eo)) + Math.imul(F, ea)) | 0), (a = Math.imul(F, eo)), (n = (n + Math.imul(L, el)) | 0), (r = ((r = (r + Math.imul(L, ec)) | 0) + Math.imul(j, el)) | 0), (a = (a + Math.imul(j, ec)) | 0), (n = (n + Math.imul(D, eu)) | 0), (r = ((r = (r + Math.imul(D, ef)) | 0) + Math.imul(R, eu)) | 0), (a = (a + Math.imul(R, ef)) | 0), (n = (n + Math.imul(k, ep)) | 0), (r = ((r = (r + Math.imul(k, ev)) | 0) + Math.imul(P, ep)) | 0); var eE = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(P, ev)) | 0) + (r >>> 13)) | 0) + (eE >>> 26)) | 0), (eE &= 0x3ffffff), (n = Math.imul(B, el)), (r = ((r = Math.imul(B, ec)) + Math.imul(F, el)) | 0), (a = Math.imul(F, ec)), (n = (n + Math.imul(L, eu)) | 0), (r = ((r = (r + Math.imul(L, ef)) | 0) + Math.imul(j, eu)) | 0), (a = (a + Math.imul(j, ef)) | 0), (n = (n + Math.imul(D, ep)) | 0), (r = ((r = (r + Math.imul(D, ev)) | 0) + Math.imul(R, ep)) | 0); var eD = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(R, ev)) | 0) + (r >>> 13)) | 0) + (eD >>> 26)) | 0), (eD &= 0x3ffffff), (n = Math.imul(B, eu)), (r = ((r = Math.imul(B, ef)) + Math.imul(F, eu)) | 0), (a = Math.imul(F, ef)), (n = (n + Math.imul(L, ep)) | 0), (r = ((r = (r + Math.imul(L, ev)) | 0) + Math.imul(j, ep)) | 0); var eR = (((c + n) | 0) + ((8191 & r) << 13)) | 0; (c = ((((a = (a + Math.imul(j, ev)) | 0) + (r >>> 13)) | 0) + (eR >>> 26)) | 0), (eR &= 0x3ffffff), (n = Math.imul(B, ep)), (r = ((r = Math.imul(B, ev)) + Math.imul(F, ep)) | 0); var eN = (((c + n) | 0) + ((8191 & r) << 13)) | 0; return ( (c = ((((a = Math.imul(F, ev)) + (r >>> 13)) | 0) + (eN >>> 26)) | 0), (eN &= 0x3ffffff), (l[0] = em), (l[1] = eg), (l[2] = e_), (l[3] = ey), (l[4] = eb), (l[5] = eI), (l[6] = ew), (l[7] = ex), (l[8] = eS), (l[9] = eM), (l[10] = eC), (l[11] = eT), (l[12] = eA), (l[13] = ek), (l[14] = eP), (l[15] = eE), (l[16] = eD), (l[17] = eR), (l[18] = eN), 0 !== c && ((l[19] = c), i.length++), i ); }; function y(e, t, i) { (i.negative = t.negative ^ e.negative), (i.length = e.length + t.length); for (var n = 0, r = 0, a = 0; a < i.length - 1; a++) { var o = r; r = 0; for ( var s = 0x3ffffff & n, l = Math.min(a, t.length - 1), c = Math.max(0, a - e.length + 1); c <= l; c++ ) { var d = a - c, u = (0 | e.words[d]) * (0 | t.words[c]), f = 0x3ffffff & u; (o = (o + ((u / 0x4000000) | 0)) | 0), (s = 0x3ffffff & (f = (f + s) | 0)), (r += (o = (o + (f >>> 26)) | 0) >>> 26), (o &= 0x3ffffff); } (i.words[a] = s), (n = o), (o = r); } return 0 !== n ? (i.words[a] = n) : i.length--, i._strip(); } function b(e, t, i) { return y(e, t, i); } function I(e, t) { (this.x = e), (this.y = t); } !Math.imul && (_ = g), (a.prototype.mulTo = function (e, t) { var i, n = this.length + e.length; return (i = 10 === this.length && 10 === e.length ? _(this, e, t) : n < 63 ? g(this, e, t) : n < 1024 ? y(this, e, t) : b(this, e, t)); }), (I.prototype.makeRBT = function (e) { for ( var t = Array(e), i = a.prototype._countBits(e) - 1, n = 0; n < e; n++ ) t[n] = this.revBin(n, i, e); return t; }), (I.prototype.revBin = function (e, t, i) { if (0 === e || e === i - 1) return e; for (var n = 0, r = 0; r < t; r++) (n |= (1 & e) << (t - r - 1)), (e >>= 1); return n; }), (I.prototype.permute = function (e, t, i, n, r, a) { for (var o = 0; o < a; o++) (n[o] = t[e[o]]), (r[o] = i[e[o]]); }), (I.prototype.transform = function (e, t, i, n, r, a) { this.permute(a, e, t, i, n, r); for (var o = 1; o < r; o <<= 1) { for ( var s = o << 1, l = Math.cos((2 * Math.PI) / s), c = Math.sin((2 * Math.PI) / s), d = 0; d < r; d += s ) { for (var u = l, f = c, h = 0; h < o; h++) { var p = i[d + h], v = n[d + h], m = i[d + h + o], g = n[d + h + o], _ = u * m - f * g; (g = u * g + f * m), (m = _), (i[d + h] = p + m), (n[d + h] = v + g), (i[d + h + o] = p - m), (n[d + h + o] = v - g), h !== s && ((_ = l * u - c * f), (f = l * f + c * u), (u = _)); } } } }), (I.prototype.guessLen13b = function (e, t) { var i = 1 | Math.max(t, e), n = 1 & i, r = 0; for (i = (i / 2) | 0; i; i >>>= 1) r++; return 1 << (r + 1 + n); }), (I.prototype.conjugate = function (e, t, i) { if (!(i <= 1)) for (var n = 0; n < i / 2; n++) { var r = e[n]; (e[n] = e[i - n - 1]), (e[i - n - 1] = r), (r = t[n]), (t[n] = -t[i - n - 1]), (t[i - n - 1] = -r); } }), (I.prototype.normalize13b = function (e, t) { for (var i = 0, n = 0; n < t / 2; n++) { var r = 8192 * Math.round(e[2 * n + 1] / t) + Math.round(e[2 * n] / t) + i; (e[n] = 0x3ffffff & r), (i = r < 0x4000000 ? 0 : (r / 0x4000000) | 0); } return e; }), (I.prototype.convert13b = function (e, t, i, r) { for (var a = 0, o = 0; o < t; o++) (a += 0 | e[o]), (i[2 * o] = 8191 & a), (a >>>= 13), (i[2 * o + 1] = 8191 & a), (a >>>= 13); for (o = 2 * t; o < r; ++o) i[o] = 0; n(0 === a), n((-8192 & a) == 0); }), (I.prototype.stub = function (e) { for (var t = Array(e), i = 0; i < e; i++) t[i] = 0; return t; }), (I.prototype.mulp = function (e, t, i) { var n = 2 * this.guessLen13b(e.length, t.length), r = this.makeRBT(n), a = this.stub(n), o = Array(n), s = Array(n), l = Array(n), c = Array(n), d = Array(n), u = Array(n), f = i.words; (f.length = n), this.convert13b(e.words, e.length, o, n), this.convert13b(t.words, t.length, c, n), this.transform(o, a, s, l, n, r), this.transform(c, a, d, u, n, r); for (var h = 0; h < n; h++) { var p = s[h] * d[h] - l[h] * u[h]; (l[h] = s[h] * u[h] + l[h] * d[h]), (s[h] = p); } return ( this.conjugate(s, l, n), this.transform(s, l, f, a, n, r), this.conjugate(f, a, n), this.normalize13b(f, n), (i.negative = e.negative ^ t.negative), (i.length = e.length + t.length), i._strip() ); }), (a.prototype.mul = function (e) { var t = new a(null); return (t.words = Array(this.length + e.length)), this.mulTo(e, t); }), (a.prototype.mulf = function (e) { var t = new a(null); return (t.words = Array(this.length + e.length)), b(this, e, t); }), (a.prototype.imul = function (e) { return this.clone().mulTo(e, this); }), (a.prototype.imuln = function (e) { var t = e < 0; t && (e = -e), n("number" == typeof e), n(e < 0x4000000); for (var i = 0, r = 0; r < this.length; r++) { var a = (0 | this.words[r]) * e, o = (0x3ffffff & a) + (0x3ffffff & i); (i >>= 26), (i += ((a / 0x4000000) | 0) + (o >>> 26)), (this.words[r] = 0x3ffffff & o); } return ( 0 !== i && ((this.words[r] = i), this.length++), t ? this.ineg() : this ); }), (a.prototype.muln = function (e) { return this.clone().imuln(e); }), (a.prototype.sqr = function () { return this.mul(this); }), (a.prototype.isqr = function () { return this.imul(this.clone()); }), (a.prototype.pow = function (e) { var t = m(e); if (0 === t.length) return new a(1); for ( var i = this, n = 0; n < t.length && 0 === t[n]; n++, i = i.sqr() ); if (++n < t.length) for (var r = i.sqr(); n < t.length; n++, r = r.sqr()) 0 !== t[n] && (i = i.mul(r)); return i; }), (a.prototype.iushln = function (e) { n("number" == typeof e && e >= 0); var t, i = e % 26, r = (e - i) / 26, a = (0x3ffffff >>> (26 - i)) << (26 - i); if (0 !== i) { var o = 0; for (t = 0; t < this.length; t++) { var s = this.words[t] & a, l = ((0 | this.words[t]) - s) << i; (this.words[t] = l | o), (o = s >>> (26 - i)); } o && ((this.words[t] = o), this.length++); } if (0 !== r) { for (t = this.length - 1; t >= 0; t--) this.words[t + r] = this.words[t]; for (t = 0; t < r; t++) this.words[t] = 0; this.length += r; } return this._strip(); }), (a.prototype.ishln = function (e) { return n(0 === this.negative), this.iushln(e); }), (a.prototype.iushrn = function (e, t, i) { n("number" == typeof e && e >= 0), (r = t ? (t - (t % 26)) / 26 : 0); var r, a = e % 26, o = Math.min((e - a) / 26, this.length), s = 0x3ffffff ^ ((0x3ffffff >>> a) << a), l = i; if (((r -= o), (r = Math.max(0, r)), l)) { for (var c = 0; c < o; c++) l.words[c] = this.words[c]; l.length = o; } if (0 === o); else if (this.length > o) for (this.length -= o, c = 0; c < this.length; c++) this.words[c] = this.words[c + o]; else (this.words[0] = 0), (this.length = 1); var d = 0; for (c = this.length - 1; c >= 0 && (0 !== d || c >= r); c--) { var u = 0 | this.words[c]; (this.words[c] = (d << (26 - a)) | (u >>> a)), (d = u & s); } return ( l && 0 !== d && (l.words[l.length++] = d), 0 === this.length && ((this.words[0] = 0), (this.length = 1)), this._strip() ); }), (a.prototype.ishrn = function (e, t, i) { return n(0 === this.negative), this.iushrn(e, t, i); }), (a.prototype.shln = function (e) { return this.clone().ishln(e); }), (a.prototype.ushln = function (e) { return this.clone().iushln(e); }), (a.prototype.shrn = function (e) { return this.clone().ishrn(e); }), (a.prototype.ushrn = function (e) { return this.clone().iushrn(e); }), (a.prototype.testn = function (e) { n("number" == typeof e && e >= 0); var t = e % 26, i = (e - t) / 26, r = 1 << t; return !(this.length <= i) && !!(this.words[i] & r); }), (a.prototype.imaskn = function (e) { n("number" == typeof e && e >= 0); var t = e % 26, i = (e - t) / 26; if ( (n( 0 === this.negative, "imaskn works only with positive numbers" ), this.length <= i) ) return this; if ( (0 !== t && i++, (this.length = Math.min(i, this.length)), 0 !== t) ) { var r = 0x3ffffff ^ ((0x3ffffff >>> t) << t); this.words[this.length - 1] &= r; } return this._strip(); }), (a.prototype.maskn = function (e) { return this.clone().imaskn(e); }), (a.prototype.iaddn = function (e) { if ((n("number" == typeof e), n(e < 0x4000000), e < 0)) return this.isubn(-e); if (0 !== this.negative) return 1 === this.length && (0 | this.words[0]) <= e ? ((this.words[0] = e - (0 | this.words[0])), (this.negative = 0), this) : ((this.negative = 0), this.isubn(e), (this.negative = 1), this); return this._iaddn(e); }), (a.prototype._iaddn = function (e) { this.words[0] += e; for (var t = 0; t < this.length && this.words[t] >= 0x4000000; t++) (this.words[t] -= 0x4000000), t === this.length - 1 ? (this.words[t + 1] = 1) : this.words[t + 1]++; return (this.length = Math.max(this.length, t + 1)), this; }), (a.prototype.isubn = function (e) { if ((n("number" == typeof e), n(e < 0x4000000), e < 0)) return this.iaddn(-e); if (0 !== this.negative) return ( (this.negative = 0), this.iaddn(e), (this.negative = 1), this ); if (((this.words[0] -= e), 1 === this.length && this.words[0] < 0)) (this.words[0] = -this.words[0]), (this.negative = 1); else for (var t = 0; t < this.length && this.words[t] < 0; t++) (this.words[t] += 0x4000000), (this.words[t + 1] -= 1); return this._strip(); }), (a.prototype.addn = function (e) { return this.clone().iaddn(e); }), (a.prototype.subn = function (e) { return this.clone().isubn(e); }), (a.prototype.iabs = function () { return (this.negative = 0), this; }), (a.prototype.abs = function () { return this.clone().iabs(); }), (a.prototype._ishlnsubmul = function (e, t, i) { var r, a, o = e.length + i; this._expand(o); var s = 0; for (r = 0; r < e.length; r++) { a = (0 | this.words[r + i]) + s; var l = (0 | e.words[r]) * t; (a -= 0x3ffffff & l), (s = (a >> 26) - ((l / 0x4000000) | 0)), (this.words[r + i] = 0x3ffffff & a); } for (; r < this.length - i; r++) (s = (a = (0 | this.words[r + i]) + s) >> 26), (this.words[r + i] = 0x3ffffff & a); if (0 === s) return this._strip(); for (n(-1 === s), s = 0, r = 0; r < this.length; r++) (s = (a = -(0 | this.words[r]) + s) >> 26), (this.words[r] = 0x3ffffff & a); return (this.negative = 1), this._strip(); }), (a.prototype._wordDiv = function (e, t) { var i, n = this.length - e.length, r = this.clone(), o = e, s = 0 | o.words[o.length - 1]; 0 != (n = 26 - this._countBits(s)) && ((o = o.ushln(n)), r.iushln(n), (s = 0 | o.words[o.length - 1])); var l = r.length - o.length; if ("mod" !== t) { ((i = new a(null)).length = l + 1), (i.words = Array(i.length)); for (var c = 0; c < i.length; c++) i.words[c] = 0; } var d = r.clone()._ishlnsubmul(o, 1, l); 0 === d.negative && ((r = d), i && (i.words[l] = 1)); for (var u = l - 1; u >= 0; u--) { var f = (0 | r.words[o.length + u]) * 0x4000000 + (0 | r.words[o.length + u - 1]); for ( f = Math.min((f / s) | 0, 0x3ffffff), r._ishlnsubmul(o, f, u); 0 !== r.negative; ) f--, (r.negative = 0), r._ishlnsubmul(o, 1, u), !r.isZero() && (r.negative ^= 1); i && (i.words[u] = f); } return ( i && i._strip(), r._strip(), "div" !== t && 0 !== n && r.iushrn(n), { div: i || null, mod: r } ); }), (a.prototype.divmod = function (e, t, i) { var r, o, s; if ((n(!e.isZero()), this.isZero())) return { div: new a(0), mod: new a(0) }; if (0 !== this.negative && 0 === e.negative) return ( (s = this.neg().divmod(e, t)), "mod" !== t && (r = s.div.neg()), "div" !== t && ((o = s.mod.neg()), i && 0 !== o.negative && o.iadd(e)), { div: r, mod: o } ); if (0 === this.negative && 0 !== e.negative) return ( (s = this.divmod(e.neg(), t)), "mod" !== t && (r = s.div.neg()), { div: r, mod: s.mod } ); if ((this.negative & e.negative) != 0) return ( (s = this.neg().divmod(e.neg(), t)), "div" !== t && ((o = s.mod.neg()), i && 0 !== o.negative && o.isub(e)), { div: s.div, mod: o } ); if (e.length > this.length || 0 > this.cmp(e)) return { div: new a(0), mod: this }; if (1 === e.length) return "div" === t ? { div: this.divn(e.words[0]), mod: null } : "mod" === t ? { div: null, mod: new a(this.modrn(e.words[0])) } : { div: this.divn(e.words[0]), mod: new a(this.modrn(e.words[0])), }; return this._wordDiv(e, t); }), (a.prototype.div = function (e) { return this.divmod(e, "div", !1).div; }), (a.prototype.mod = function (e) { return this.divmod(e, "mod", !1).mod; }), (a.prototype.umod = function (e) { return this.divmod(e, "mod", !0).mod; }), (a.prototype.divRound = function (e) { var t = this.divmod(e); if (t.mod.isZero()) return t.div; var i = 0 !== t.div.negative ? t.mod.isub(e) : t.mod, n = e.ushrn(1), r = e.andln(1), a = i.cmp(n); return a < 0 || (1 === r && 0 === a) ? t.div : 0 !== t.div.negative ? t.div.isubn(1) : t.div.iaddn(1); }), (a.prototype.modrn = function (e) { var t = e < 0; t && (e = -e), n(e <= 0x3ffffff); for (var i = 0x4000000 % e, r = 0, a = this.length - 1; a >= 0; a--) r = (i * r + (0 | this.words[a])) % e; return t ? -r : r; }), (a.prototype.modn = function (e) { return this.modrn(e); }), (a.prototype.idivn = function (e) { var t = e < 0; t && (e = -e), n(e <= 0x3ffffff); for (var i = 0, r = this.length - 1; r >= 0; r--) { var a = (0 | this.words[r]) + 0x4000000 * i; (this.words[r] = (a / e) | 0), (i = a % e); } return this._strip(), t ? this.ineg() : this; }), (a.prototype.divn = function (e) { return this.clone().idivn(e); }), (a.prototype.egcd = function (e) { n(0 === e.negative), n(!e.isZero()); var t = this, i = e.clone(); t = 0 !== t.negative ? t.umod(e) : t.clone(); for ( var r = new a(1), o = new a(0), s = new a(0), l = new a(1), c = 0; t.isEven() && i.isEven(); ) t.iushrn(1), i.iushrn(1), ++c; for (var d = i.clone(), u = t.clone(); !t.isZero(); ) { for ( var f = 0, h = 1; (t.words[0] & h) == 0 && f < 26; ++f, h <<= 1 ); if (f > 0) for (t.iushrn(f); f-- > 0; ) (r.isOdd() || o.isOdd()) && (r.iadd(d), o.isub(u)), r.iushrn(1), o.iushrn(1); for ( var p = 0, v = 1; (i.words[0] & v) == 0 && p < 26; ++p, v <<= 1 ); if (p > 0) for (i.iushrn(p); p-- > 0; ) (s.isOdd() || l.isOdd()) && (s.iadd(d), l.isub(u)), s.iushrn(1), l.iushrn(1); t.cmp(i) >= 0 ? (t.isub(i), r.isub(s), o.isub(l)) : (i.isub(t), s.isub(r), l.isub(o)); } return { a: s, b: l, gcd: i.iushln(c) }; }), (a.prototype._invmp = function (e) { n(0 === e.negative), n(!e.isZero()); var t, i = this, r = e.clone(); i = 0 !== i.negative ? i.umod(e) : i.clone(); for ( var o = new a(1), s = new a(0), l = r.clone(); i.cmpn(1) > 0 && r.cmpn(1) > 0; ) { for ( var c = 0, d = 1; (i.words[0] & d) == 0 && c < 26; ++c, d <<= 1 ); if (c > 0) for (i.iushrn(c); c-- > 0; ) o.isOdd() && o.iadd(l), o.iushrn(1); for ( var u = 0, f = 1; (r.words[0] & f) == 0 && u < 26; ++u, f <<= 1 ); if (u > 0) for (r.iushrn(u); u-- > 0; ) s.isOdd() && s.iadd(l), s.iushrn(1); i.cmp(r) >= 0 ? (i.isub(r), o.isub(s)) : (r.isub(i), s.isub(o)); } return 0 > (t = 0 === i.cmpn(1) ? o : s).cmpn(0) && t.iadd(e), t; }), (a.prototype.gcd = function (e) { if (this.isZero()) return e.abs(); if (e.isZero()) return this.abs(); var t = this.clone(), i = e.clone(); (t.negative = 0), (i.negative = 0); for (var n = 0; t.isEven() && i.isEven(); n++) t.iushrn(1), i.iushrn(1); for (;;) { for (; t.isEven(); ) t.iushrn(1); for (; i.isEven(); ) i.iushrn(1); var r = t.cmp(i); if (r < 0) { var a = t; (t = i), (i = a); } else if (0 === r || 0 === i.cmpn(1)) break; t.isub(i); } return i.iushln(n); }), (a.prototype.invm = function (e) { return this.egcd(e).a.umod(e); }), (a.prototype.isEven = function () { return (1 & this.words[0]) == 0; }), (a.prototype.isOdd = function () { return (1 & this.words[0]) == 1; }), (a.prototype.andln = function (e) { return this.words[0] & e; }), (a.prototype.bincn = function (e) { n("number" == typeof e); var t = e % 26, i = (e - t) / 26, r = 1 << t; if (this.length <= i) return this._expand(i + 1), (this.words[i] |= r), this; for (var a = r, o = i; 0 !== a && o < this.length; o++) { var s = 0 | this.words[o]; (s += a), (a = s >>> 26), (s &= 0x3ffffff), (this.words[o] = s); } return 0 !== a && ((this.words[o] = a), this.length++), this; }), (a.prototype.isZero = function () { return 1 === this.length && 0 === this.words[0]; }), (a.prototype.cmpn = function (e) { var t, i = e < 0; if (0 !== this.negative && !i) return -1; if (0 === this.negative && i) return 1; if ((this._strip(), this.length > 1)) t = 1; else { i && (e = -e), n(e <= 0x3ffffff, "Number is too big"); var r = 0 | this.words[0]; t = r === e ? 0 : r < e ? -1 : 1; } return 0 !== this.negative ? 0 | -t : t; }), (a.prototype.cmp = function (e) { if (0 !== this.negative && 0 === e.negative) return -1; if (0 === this.negative && 0 !== e.negative) return 1; var t = this.ucmp(e); return 0 !== this.negative ? 0 | -t : t; }), (a.prototype.ucmp = function (e) { if (this.length > e.length) return 1; if (this.length < e.length) return -1; for (var t = 0, i = this.length - 1; i >= 0; i--) { var n = 0 | this.words[i], r = 0 | e.words[i]; if (n !== r) { n < r ? (t = -1) : n > r && (t = 1); break; } } return t; }), (a.prototype.gtn = function (e) { return 1 === this.cmpn(e); }), (a.prototype.gt = function (e) { return 1 === this.cmp(e); }), (a.prototype.gten = function (e) { return this.cmpn(e) >= 0; }), (a.prototype.gte = function (e) { return this.cmp(e) >= 0; }), (a.prototype.ltn = function (e) { return -1 === this.cmpn(e); }), (a.prototype.lt = function (e) { return -1 === this.cmp(e); }), (a.prototype.lten = function (e) { return 0 >= this.cmpn(e); }), (a.prototype.lte = function (e) { return 0 >= this.cmp(e); }), (a.prototype.eqn = function (e) { return 0 === this.cmpn(e); }), (a.prototype.eq = function (e) { return 0 === this.cmp(e); }), (a.red = function (e) { return new A(e); }), (a.prototype.toRed = function (e) { return ( n(!this.red, "Already a number in reduction context"), n(0 === this.negative, "red works only with positives"), e.convertTo(this)._forceRed(e) ); }), (a.prototype.fromRed = function () { return ( n( this.red, "fromRed works only with numbers in reduction context" ), this.red.convertFrom(this) ); }), (a.prototype._forceRed = function (e) { return (this.red = e), this; }), (a.prototype.forceRed = function (e) { return ( n(!this.red, "Already a number in reduction context"), this._forceRed(e) ); }), (a.prototype.redAdd = function (e) { return ( n(this.red, "redAdd works only with red numbers"), this.red.add(this, e) ); }), (a.prototype.redIAdd = function (e) { return ( n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e) ); }), (a.prototype.redSub = function (e) { return ( n(this.red, "redSub works only with red numbers"), this.red.sub(this, e) ); }), (a.prototype.redISub = function (e) { return ( n(this.red, "redISub works only with red numbers"), this.red.isub(this, e) ); }), (a.prototype.redShl = function (e) { return ( n(this.red, "redShl works only with red numbers"), this.red.shl(this, e) ); }), (a.prototype.redMul = function (e) { return ( n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e), this.red.mul(this, e) ); }), (a.prototype.redIMul = function (e) { return ( n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e), this.red.imul(this, e) ); }), (a.prototype.redSqr = function () { return ( n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this) ); }), (a.prototype.redISqr = function () { return ( n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this) ); }), (a.prototype.redSqrt = function () { return ( n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this) ); }), (a.prototype.redInvm = function () { return ( n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this) ); }), (a.prototype.redNeg = function () { return ( n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this) ); }), (a.prototype.redPow = function (e) { return ( n(this.red && !e.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e) ); }); var w = { k256: null, p224: null, p192: null, p25519: null }; function x(e, t) { (this.name = e), (this.p = new a(t, 16)), (this.n = this.p.bitLength()), (this.k = new a(1).iushln(this.n).isub(this.p)), (this.tmp = this._tmp()); } function S() { x.call( this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" ); } function M() { x.call( this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" ); } function C() { x.call( this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" ); } function T() { x.call( this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" ); } function A(e) { if ("string" == typeof e) { var t = a._prime(e); (this.m = t.p), (this.prime = t); } else n(e.gtn(1), "modulus must be greater than 1"), (this.m = e), (this.prime = null); } function k(e) { A.call(this, e), (this.shift = this.m.bitLength()), this.shift % 26 != 0 && (this.shift += 26 - (this.shift % 26)), (this.r = new a(1).iushln(this.shift)), (this.r2 = this.imod(this.r.sqr())), (this.rinv = this.r._invmp(this.m)), (this.minv = this.rinv.mul(this.r).isubn(1).div(this.m)), (this.minv = this.minv.umod(this.r)), (this.minv = this.r.sub(this.minv)); } (x.prototype._tmp = function () { var e = new a(null); return (e.words = Array(Math.ceil(this.n / 13))), e; }), (x.prototype.ireduce = function (e) { var t, i = e; do this.split(i, this.tmp), (t = (i = (i = this.imulK(i)).iadd(this.tmp)).bitLength()); while (t > this.n); var n = t < this.n ? -1 : i.ucmp(this.p); return ( 0 === n ? ((i.words[0] = 0), (i.length = 1)) : n > 0 ? i.isub(this.p) : void 0 !== i.strip ? i.strip() : i._strip(), i ); }), (x.prototype.split = function (e, t) { e.iushrn(this.n, 0, t); }), (x.prototype.imulK = function (e) { return e.imul(this.k); }), r(S, x), (S.prototype.split = function (e, t) { for (var i = 4194303, n = Math.min(e.length, 9), r = 0; r < n; r++) t.words[r] = e.words[r]; if (((t.length = n), e.length <= 9)) { (e.words[0] = 0), (e.length = 1); return; } var a = e.words[9]; for (r = 10, t.words[t.length++] = a & i; r < e.length; r++) { var o = 0 | e.words[r]; (e.words[r - 10] = ((o & i) << 4) | (a >>> 22)), (a = o); } (a >>>= 22), (e.words[r - 10] = a), 0 === a && e.length > 10 ? (e.length -= 10) : (e.length -= 9); }), (S.prototype.imulK = function (e) { (e.words[e.length] = 0), (e.words[e.length + 1] = 0), (e.length += 2); for (var t = 0, i = 0; i < e.length; i++) { var n = 0 | e.words[i]; (t += 977 * n), (e.words[i] = 0x3ffffff & t), (t = 64 * n + ((t / 0x4000000) | 0)); } return ( 0 === e.words[e.length - 1] && (e.length--, 0 === e.words[e.length - 1] && e.length--), e ); }), r(M, x), r(C, x), r(T, x), (T.prototype.imulK = function (e) { for (var t = 0, i = 0; i < e.length; i++) { var n = (0 | e.words[i]) * 19 + t, r = 0x3ffffff & n; (n >>>= 26), (e.words[i] = r), (t = n); } return 0 !== t && (e.words[e.length++] = t), e; }), (a._prime = function (e) { var t; if (w[e]) return w[e]; if ("k256" === e) t = new S(); else if ("p224" === e) t = new M(); else if ("p192" === e) t = new C(); else if ("p25519" === e) t = new T(); else throw Error("Unknown prime " + e); return (w[e] = t), t; }), (A.prototype._verify1 = function (e) { n(0 === e.negative, "red works only with positives"), n(e.red, "red works only with red numbers"); }), (A.prototype._verify2 = function (e, t) { n((e.negative | t.negative) == 0, "red works only with positives"), n(e.red && e.red === t.red, "red works only with red numbers"); }), (A.prototype.imod = function (e) { return this.prime ? this.prime.ireduce(e)._forceRed(this) : (c(e, e.umod(this.m)._forceRed(this)), e); }), (A.prototype.neg = function (e) { return e.isZero() ? e.clone() : this.m.sub(e)._forceRed(this); }), (A.prototype.add = function (e, t) { this._verify2(e, t); var i = e.add(t); return i.cmp(this.m) >= 0 && i.isub(this.m), i._forceRed(this); }), (A.prototype.iadd = function (e, t) { this._verify2(e, t); var i = e.iadd(t); return i.cmp(this.m) >= 0 && i.isub(this.m), i; }), (A.prototype.sub = function (e, t) { this._verify2(e, t); var i = e.sub(t); return 0 > i.cmpn(0) && i.iadd(this.m), i._forceRed(this); }), (A.prototype.isub = function (e, t) { this._verify2(e, t); var i = e.isub(t); return 0 > i.cmpn(0) && i.iadd(this.m), i; }), (A.prototype.shl = function (e, t) { return this._verify1(e), this.imod(e.ushln(t)); }), (A.prototype.imul = function (e, t) { return this._verify2(e, t), this.imod(e.imul(t)); }), (A.prototype.mul = function (e, t) { return this._verify2(e, t), this.imod(e.mul(t)); }), (A.prototype.isqr = function (e) { return this.imul(e, e.clone()); }), (A.prototype.sqr = function (e) { return this.mul(e, e); }), (A.prototype.sqrt = function (e) { if (e.isZero()) return e.clone(); var t = this.m.andln(3); if ((n(t % 2 == 1), 3 === t)) { var i = this.m.add(new a(1)).iushrn(2); return this.pow(e, i); } for ( var r = this.m.subn(1), o = 0; !r.isZero() && 0 === r.andln(1); ) o++, r.iushrn(1); n(!r.isZero()); var s = new a(1).toRed(this), l = s.redNeg(), c = this.m.subn(1).iushrn(1), d = this.m.bitLength(); for ( d = new a(2 * d * d).toRed(this); 0 !== this.pow(d, c).cmp(l); ) d.redIAdd(l); for ( var u = this.pow(d, r), f = this.pow(e, r.addn(1).iushrn(1)), h = this.pow(e, r), p = o; 0 !== h.cmp(s); ) { for (var v = h, m = 0; 0 !== v.cmp(s); m++) v = v.redSqr(); n(m < p); var g = this.pow(u, new a(1).iushln(p - m - 1)); (f = f.redMul(g)), (u = g.redSqr()), (h = h.redMul(u)), (p = m); } return f; }), (A.prototype.invm = function (e) { var t = e._invmp(this.m); return 0 !== t.negative ? ((t.negative = 0), this.imod(t).redNeg()) : this.imod(t); }), (A.prototype.pow = function (e, t) { if (t.isZero()) return new a(1).toRed(this); if (0 === t.cmpn(1)) return e.clone(); var i = 4, n = Array(16); (n[0] = new a(1).toRed(this)), (n[1] = e); for (var r = 2; r < n.length; r++) n[r] = this.mul(n[r - 1], e); var o = n[0], s = 0, l = 0, c = t.bitLength() % 26; for (0 === c && (c = 26), r = t.length - 1; r >= 0; r--) { for (var d = t.words[r], u = c - 1; u >= 0; u--) { var f = (d >> u) & 1; if ((o !== n[0] && (o = this.sqr(o)), 0 === f && 0 === s)) { l = 0; continue; } (s <<= 1), (s |= f), (++l === i || (0 === r && 0 === u)) && ((o = this.mul(o, n[s])), (l = 0), (s = 0)); } c = 26; } return o; }), (A.prototype.convertTo = function (e) { var t = e.umod(this.m); return t === e ? t.clone() : t; }), (A.prototype.convertFrom = function (e) { var t = e.clone(); return (t.red = null), t; }), (a.mont = function (e) { return new k(e); }), r(k, A), (k.prototype.convertTo = function (e) { return this.imod(e.ushln(this.shift)); }), (k.prototype.convertFrom = function (e) { var t = this.imod(e.mul(this.rinv)); return (t.red = null), t; }), (k.prototype.imul = function (e, t) { if (e.isZero() || t.isZero()) return (e.words[0] = 0), (e.length = 1), e; var i = e.imul(t), n = i .maskn(this.shift) .mul(this.minv) .imaskn(this.shift) .mul(this.m), r = i.isub(n).iushrn(this.shift), a = r; return ( r.cmp(this.m) >= 0 ? (a = r.isub(this.m)) : 0 > r.cmpn(0) && (a = r.iadd(this.m)), a._forceRed(this) ); }), (k.prototype.mul = function (e, t) { if (e.isZero() || t.isZero()) return new a(0)._forceRed(this); var i = e.mul(t), n = i .maskn(this.shift) .mul(this.minv) .imaskn(this.shift) .mul(this.m), r = i.isub(n).iushrn(this.shift), o = r; return ( r.cmp(this.m) >= 0 ? (o = r.isub(this.m)) : 0 > r.cmpn(0) && (o = r.iadd(this.m)), o._forceRed(this) ); }), (k.prototype.invm = function (e) { return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this); }); })((e = i.nmd(e)), this); }, 462810: function (e, t, i) { var n; function r(e) { this.rand = e; } if ( ((e.exports = function (e) { return !n && (n = new r(null)), n.generate(e); }), (e.exports.Rand = r), (r.prototype.generate = function (e) { return this._rand(e); }), (r.prototype._rand = function (e) { if (this.rand.getBytes) return this.rand.getBytes(e); for (var t = new Uint8Array(e), i = 0; i < t.length; i++) t[i] = this.rand.getByte(); return t; }), "object" == typeof self) ) self.crypto && self.crypto.getRandomValues ? (r.prototype._rand = function (e) { var t = new Uint8Array(e); return self.crypto.getRandomValues(t), t; }) : self.msCrypto && self.msCrypto.getRandomValues ? (r.prototype._rand = function (e) { var t = new Uint8Array(e); return self.msCrypto.getRandomValues(t), t; }) : "object" == typeof window && (r.prototype._rand = function () { throw Error("Not implemented yet"); }); else try { var a = i(285499); if ("function" != typeof a.randomBytes) throw Error("Not supported"); r.prototype._rand = function (e) { return a.randomBytes(e); }; } catch (e) {} }, 869298: function (e, t, i) { var n = i(140860).Buffer; function r(e) { !n.isBuffer(e) && (e = n.from(e)); for (var t = (e.length / 4) | 0, i = Array(t), r = 0; r < t; r++) i[r] = e.readUInt32BE(4 * r); return i; } function a(e) { for (var t = 0; t < e.length; e++) e[t] = 0; } function o(e, t, i, n, r) { for ( var a, o, s, l, c = i[0], d = i[1], u = i[2], f = i[3], h = e[0] ^ t[0], p = e[1] ^ t[1], v = e[2] ^ t[2], m = e[3] ^ t[3], g = 4, _ = 1; _ < r; _++ ) (a = c[h >>> 24] ^ d[(p >>> 16) & 255] ^ u[(v >>> 8) & 255] ^ f[255 & m] ^ t[g++]), (o = c[p >>> 24] ^ d[(v >>> 16) & 255] ^ u[(m >>> 8) & 255] ^ f[255 & h] ^ t[g++]), (s = c[v >>> 24] ^ d[(m >>> 16) & 255] ^ u[(h >>> 8) & 255] ^ f[255 & p] ^ t[g++]), (l = c[m >>> 24] ^ d[(h >>> 16) & 255] ^ u[(p >>> 8) & 255] ^ f[255 & v] ^ t[g++]), (h = a), (p = o), (v = s), (m = l); return ( (a = ((n[h >>> 24] << 24) | (n[(p >>> 16) & 255] << 16) | (n[(v >>> 8) & 255] << 8) | n[255 & m]) ^ t[g++]), (o = ((n[p >>> 24] << 24) | (n[(v >>> 16) & 255] << 16) | (n[(m >>> 8) & 255] << 8) | n[255 & h]) ^ t[g++]), (s = ((n[v >>> 24] << 24) | (n[(m >>> 16) & 255] << 16) | (n[(h >>> 8) & 255] << 8) | n[255 & p]) ^ t[g++]), (l = ((n[m >>> 24] << 24) | (n[(h >>> 16) & 255] << 16) | (n[(p >>> 8) & 255] << 8) | n[255 & v]) ^ t[g++]), [(a >>>= 0), (o >>>= 0), (s >>>= 0), (l >>>= 0)] ); } var s = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], l = (function () { for (var e = Array(256), t = 0; t < 256; t++) t < 128 ? (e[t] = t << 1) : (e[t] = (t << 1) ^ 283); for ( var i = [], n = [], r = [[], [], [], []], a = [[], [], [], []], o = 0, s = 0, l = 0; l < 256; ++l ) { var c = s ^ (s << 1) ^ (s << 2) ^ (s << 3) ^ (s << 4); (c = (c >>> 8) ^ (255 & c) ^ 99), (i[o] = c), (n[c] = o); var d = e[o], u = e[d], f = e[u], h = (257 * e[c]) ^ (0x1010100 * c); (r[0][o] = (h << 24) | (h >>> 8)), (r[1][o] = (h << 16) | (h >>> 16)), (r[2][o] = (h << 8) | (h >>> 24)), (r[3][o] = h), (h = (0x1010101 * f) ^ (65537 * u) ^ (257 * d) ^ (0x1010100 * o)), (a[0][c] = (h << 24) | (h >>> 8)), (a[1][c] = (h << 16) | (h >>> 16)), (a[2][c] = (h << 8) | (h >>> 24)), (a[3][c] = h), 0 === o ? (o = s = 1) : ((o = d ^ e[e[e[f ^ d]]]), (s ^= e[e[s]])); } return { SBOX: i, INV_SBOX: n, SUB_MIX: r, INV_SUB_MIX: a }; })(); function c(e) { (this._key = r(e)), this._reset(); } (c.blockSize = 16), (c.keySize = 32), (c.prototype.blockSize = c.blockSize), (c.prototype.keySize = c.keySize), (c.prototype._reset = function () { for ( var e = this._key, t = e.length, i = t + 6, n = (i + 1) * 4, r = [], a = 0; a < t; a++ ) r[a] = e[a]; for (a = t; a < n; a++) { var o = r[a - 1]; a % t == 0 ? ((o = (o << 8) | (o >>> 24)), (o = ((l.SBOX[o >>> 24] << 24) | (l.SBOX[(o >>> 16) & 255] << 16) | (l.SBOX[(o >>> 8) & 255] << 8) | l.SBOX[255 & o]) ^ (s[(a / t) | 0] << 24))) : t > 6 && a % t == 4 && (o = (l.SBOX[o >>> 24] << 24) | (l.SBOX[(o >>> 16) & 255] << 16) | (l.SBOX[(o >>> 8) & 255] << 8) | l.SBOX[255 & o]), (r[a] = r[a - t] ^ o); } for (var c = [], d = 0; d < n; d++) { var u = n - d, f = r[u - (d % 4 ? 0 : 4)]; d < 4 || u <= 4 ? (c[d] = f) : (c[d] = l.INV_SUB_MIX[0][l.SBOX[f >>> 24]] ^ l.INV_SUB_MIX[1][l.SBOX[(f >>> 16) & 255]] ^ l.INV_SUB_MIX[2][l.SBOX[(f >>> 8) & 255]] ^ l.INV_SUB_MIX[3][l.SBOX[255 & f]]); } (this._nRounds = i), (this._keySchedule = r), (this._invKeySchedule = c); }), (c.prototype.encryptBlockRaw = function (e) { return o( (e = r(e)), this._keySchedule, l.SUB_MIX, l.SBOX, this._nRounds ); }), (c.prototype.encryptBlock = function (e) { var t = this.encryptBlockRaw(e), i = n.allocUnsafe(16); return ( i.writeUInt32BE(t[0], 0), i.writeUInt32BE(t[1], 4), i.writeUInt32BE(t[2], 8), i.writeUInt32BE(t[3], 12), i ); }), (c.prototype.decryptBlock = function (e) { var t = (e = r(e))[1]; (e[1] = e[3]), (e[3] = t); var i = o( e, this._invKeySchedule, l.INV_SUB_MIX, l.INV_SBOX, this._nRounds ), a = n.allocUnsafe(16); return ( a.writeUInt32BE(i[0], 0), a.writeUInt32BE(i[3], 4), a.writeUInt32BE(i[2], 8), a.writeUInt32BE(i[1], 12), a ); }), (c.prototype.scrub = function () { a(this._keySchedule), a(this._invKeySchedule), a(this._key); }), (e.exports.AES = c); }, 176135: function (e, t, i) { var n = i(869298), r = i(140860).Buffer, a = i(23420), o = i(32016), s = i(901422), l = i(355595), c = i(662440); function d(e, t) { var i = 0; e.length !== t.length && i++; for (var n = Math.min(e.length, t.length), r = 0; r < n; ++r) i += e[r] ^ t[r]; return i; } function u(e, t, i) { if (12 === t.length) return ( (e._finID = r.concat([t, r.from([0, 0, 0, 1])])), r.concat([t, r.from([0, 0, 0, 2])]) ); var n = new s(i), a = t.length, o = a % 16; n.update(t), o && ((o = 16 - o), n.update(r.alloc(o, 0))), n.update(r.alloc(8, 0)); var l = 8 * a, d = r.alloc(8); d.writeUIntBE(l, 0, 8), n.update(d), (e._finID = n.state); var u = r.from(e._finID); return c(u), u; } function f(e, t, i, o) { a.call(this); var l = r.alloc(4, 0); this._cipher = new n.AES(t); var c = this._cipher.encryptBlock(l); (this._ghash = new s(c)), (i = u(this, i, c)), (this._prev = r.from(i)), (this._cache = r.allocUnsafe(0)), (this._secCache = r.allocUnsafe(0)), (this._decrypt = o), (this._alen = 0), (this._len = 0), (this._mode = e), (this._authTag = null), (this._called = !1); } o(f, a), (f.prototype._update = function (e) { if (!this._called && this._alen) { var t = 16 - (this._alen % 16); t < 16 && ((t = r.alloc(t, 0)), this._ghash.update(t)); } this._called = !0; var i = this._mode.encrypt(this, e); return ( this._decrypt ? this._ghash.update(e) : this._ghash.update(i), (this._len += e.length), i ); }), (f.prototype._final = function () { if (this._decrypt && !this._authTag) throw Error("Unsupported state or unable to authenticate data"); var e = l( this._ghash.final(8 * this._alen, 8 * this._len), this._cipher.encryptBlock(this._finID) ); if (this._decrypt && d(e, this._authTag)) throw Error("Unsupported state or unable to authenticate data"); (this._authTag = e), this._cipher.scrub(); }), (f.prototype.getAuthTag = function () { if (this._decrypt || !r.isBuffer(this._authTag)) throw Error("Attempting to get auth tag in unsupported state"); return this._authTag; }), (f.prototype.setAuthTag = function (e) { if (!this._decrypt) throw Error("Attempting to set auth tag in unsupported state"); this._authTag = e; }), (f.prototype.setAAD = function (e) { if (this._called) throw Error("Attempting to set AAD in unsupported state"); this._ghash.update(e), (this._alen += e.length); }), (e.exports = f); }, 652217: function (e, t, i) { var n = i(336744), r = i(981966), a = i(641601); function o() { return Object.keys(a); } (t.createCipher = t.Cipher = n.createCipher), (t.createCipheriv = t.Cipheriv = n.createCipheriv), (t.createDecipher = t.Decipher = r.createDecipher), (t.createDecipheriv = t.Decipheriv = r.createDecipheriv), (t.listCiphers = t.getCiphers = o); }, 981966: function (e, t, i) { var n = i(176135), r = i(140860).Buffer, a = i(675464), o = i(922539), s = i(23420), l = i(869298), c = i(948881); function d(e, t, i) { s.call(this), (this._cache = new u()), (this._last = void 0), (this._cipher = new l.AES(t)), (this._prev = r.from(i)), (this._mode = e), (this._autopadding = !0); } function u() { this.cache = r.allocUnsafe(0); } function f(e) { var t = e[15]; if (t < 1 || t > 16) throw Error("unable to decrypt data"); for (var i = -1; ++i < t; ) if (e[i + (16 - t)] !== t) throw Error("unable to decrypt data"); if (16 !== t) return e.slice(0, 16 - t); } function h(e, t, i) { var s = a[e.toLowerCase()]; if (!s) throw TypeError("invalid suite type"); if ( ("string" == typeof i && (i = r.from(i)), "GCM" !== s.mode && i.length !== s.iv) ) throw TypeError("invalid iv length " + i.length); if (("string" == typeof t && (t = r.from(t)), t.length !== s.key / 8)) throw TypeError("invalid key length " + t.length); return "stream" === s.type ? new o(s.module, t, i, !0) : "auth" === s.type ? new n(s.module, t, i, !0) : new d(s.module, t, i); } function p(e, t) { var i = a[e.toLowerCase()]; if (!i) throw TypeError("invalid suite type"); var n = c(t, !1, i.key, i.iv); return h(e, n.key, n.iv); } i(32016)(d, s), (d.prototype._update = function (e) { this._cache.add(e); for (var t, i, n = []; (t = this._cache.get(this._autopadding)); ) (i = this._mode.decrypt(this, t)), n.push(i); return r.concat(n); }), (d.prototype._final = function () { var e = this._cache.flush(); if (this._autopadding) return f(this._mode.decrypt(this, e)); if (e) throw Error("data not multiple of block length"); }), (d.prototype.setAutoPadding = function (e) { return (this._autopadding = !!e), this; }), (u.prototype.add = function (e) { this.cache = r.concat([this.cache, e]); }), (u.prototype.get = function (e) { var t; if (e) { if (this.cache.length > 16) return ( (t = this.cache.slice(0, 16)), (this.cache = this.cache.slice(16)), t ); } else if (this.cache.length >= 16) return ( (t = this.cache.slice(0, 16)), (this.cache = this.cache.slice(16)), t ); return null; }), (u.prototype.flush = function () { if (this.cache.length) return this.cache; }), (t.createDecipher = p), (t.createDecipheriv = h); }, 336744: function (e, t, i) { var n = i(675464), r = i(176135), a = i(140860).Buffer, o = i(922539), s = i(23420), l = i(869298), c = i(948881); function d(e, t, i) { s.call(this), (this._cache = new f()), (this._cipher = new l.AES(t)), (this._prev = a.from(i)), (this._mode = e), (this._autopadding = !0); } i(32016)(d, s), (d.prototype._update = function (e) { this._cache.add(e); for (var t, i, n = []; (t = this._cache.get()); ) (i = this._mode.encrypt(this, t)), n.push(i); return a.concat(n); }); var u = a.alloc(16, 16); function f() { this.cache = a.allocUnsafe(0); } function h(e, t, i) { var s = n[e.toLowerCase()]; if (!s) throw TypeError("invalid suite type"); if (("string" == typeof t && (t = a.from(t)), t.length !== s.key / 8)) throw TypeError("invalid key length " + t.length); if ( ("string" == typeof i && (i = a.from(i)), "GCM" !== s.mode && i.length !== s.iv) ) throw TypeError("invalid iv length " + i.length); return "stream" === s.type ? new o(s.module, t, i) : "auth" === s.type ? new r(s.module, t, i) : new d(s.module, t, i); } function p(e, t) { var i = n[e.toLowerCase()]; if (!i) throw TypeError("invalid suite type"); var r = c(t, !1, i.key, i.iv); return h(e, r.key, r.iv); } (d.prototype._final = function () { var e = this._cache.flush(); if (this._autopadding) return (e = this._mode.encrypt(this, e)), this._cipher.scrub(), e; if (!e.equals(u)) throw ( (this._cipher.scrub(), Error("data not multiple of block length")) ); }), (d.prototype.setAutoPadding = function (e) { return (this._autopadding = !!e), this; }), (f.prototype.add = function (e) { this.cache = a.concat([this.cache, e]); }), (f.prototype.get = function () { if (this.cache.length > 15) { var e = this.cache.slice(0, 16); return (this.cache = this.cache.slice(16)), e; } return null; }), (f.prototype.flush = function () { for ( var e = 16 - this.cache.length, t = a.allocUnsafe(e), i = -1; ++i < e; ) t.writeUInt8(e, i); return a.concat([this.cache, t]); }), (t.createCipheriv = h), (t.createCipher = p); }, 901422: function (e, t, i) { var n = i(140860).Buffer, r = n.alloc(16, 0); function a(e) { return [ e.readUInt32BE(0), e.readUInt32BE(4), e.readUInt32BE(8), e.readUInt32BE(12), ]; } function o(e) { var t = n.allocUnsafe(16); return ( t.writeUInt32BE(e[0] >>> 0, 0), t.writeUInt32BE(e[1] >>> 0, 4), t.writeUInt32BE(e[2] >>> 0, 8), t.writeUInt32BE(e[3] >>> 0, 12), t ); } function s(e) { (this.h = e), (this.state = n.alloc(16, 0)), (this.cache = n.allocUnsafe(0)); } (s.prototype.ghash = function (e) { for (var t = -1; ++t < e.length; ) this.state[t] ^= e[t]; this._multiply(); }), (s.prototype._multiply = function () { for (var e, t, i = a(this.h), n = [0, 0, 0, 0], r = -1; ++r < 128; ) { for ( (this.state[~~(r / 8)] & (1 << (7 - (r % 8)))) != 0 && ((n[0] ^= i[0]), (n[1] ^= i[1]), (n[2] ^= i[2]), (n[3] ^= i[3])), t = (1 & i[3]) != 0, e = 3; e > 0; e-- ) i[e] = (i[e] >>> 1) | ((1 & i[e - 1]) << 31); (i[0] = i[0] >>> 1), t && (i[0] = -0x1f000000 ^ i[0]); } this.state = o(n); }), (s.prototype.update = function (e) { var t; for ( this.cache = n.concat([this.cache, e]); this.cache.length >= 16; ) (t = this.cache.slice(0, 16)), (this.cache = this.cache.slice(16)), this.ghash(t); }), (s.prototype.final = function (e, t) { return ( this.cache.length && this.ghash(n.concat([this.cache, r], 16)), this.ghash(o([0, e, 0, t])), this.state ); }), (e.exports = s); }, 662440: function (e) { function t(e) { for (var t, i = e.length; i--; ) if (255 === (t = e.readUInt8(i))) e.writeUInt8(0, i); else { t++, e.writeUInt8(t, i); break; } } e.exports = t; }, 113781: function (e, t, i) { var n = i(355595); (t.encrypt = function (e, t) { var i = n(t, e._prev); return (e._prev = e._cipher.encryptBlock(i)), e._prev; }), (t.decrypt = function (e, t) { var i = e._prev; return (e._prev = t), n(e._cipher.decryptBlock(t), i); }); }, 735287: function (e, t, i) { var n = i(140860).Buffer, r = i(355595); function a(e, t, i) { var a = t.length, o = r(t, e._cache); return ( (e._cache = e._cache.slice(a)), (e._prev = n.concat([e._prev, i ? t : o])), o ); } t.encrypt = function (e, t, i) { for (var r, o = n.allocUnsafe(0); t.length; ) if ( (0 === e._cache.length && ((e._cache = e._cipher.encryptBlock(e._prev)), (e._prev = n.allocUnsafe(0))), e._cache.length <= t.length) ) (r = e._cache.length), (o = n.concat([o, a(e, t.slice(0, r), i)])), (t = t.slice(r)); else { o = n.concat([o, a(e, t, i)]); break; } return o; }; }, 222386: function (e, t, i) { var n = i(140860).Buffer; function r(e, t, i) { for (var n, r, o, s = -1, l = 8, c = 0; ++s < l; ) (n = e._cipher.encryptBlock(e._prev)), (r = t & (1 << (7 - s)) ? 128 : 0), (c += (128 & (o = n[0] ^ r)) >> s % 8), (e._prev = a(e._prev, i ? r : o)); return c; } function a(e, t) { var i = e.length, r = -1, a = n.allocUnsafe(e.length); for (e = n.concat([e, n.from([t])]); ++r < i; ) a[r] = (e[r] << 1) | (e[r + 1] >> 7); return a; } t.encrypt = function (e, t, i) { for (var a = t.length, o = n.allocUnsafe(a), s = -1; ++s < a; ) o[s] = r(e, t[s], i); return o; }; }, 409789: function (e, t, i) { var n = i(140860).Buffer; function r(e, t, i) { var r = e._cipher.encryptBlock(e._prev)[0] ^ t; return (e._prev = n.concat([e._prev.slice(1), n.from([i ? t : r])])), r; } t.encrypt = function (e, t, i) { for (var a = t.length, o = n.allocUnsafe(a), s = -1; ++s < a; ) o[s] = r(e, t[s], i); return o; }; }, 868937: function (e, t, i) { var n = i(355595), r = i(140860).Buffer, a = i(662440); function o(e) { var t = e._cipher.encryptBlockRaw(e._prev); return a(e._prev), t; } var s = 16; t.encrypt = function (e, t) { var i = Math.ceil(t.length / s), a = e._cache.length; e._cache = r.concat([e._cache, r.allocUnsafe(i * s)]); for (var l = 0; l < i; l++) { var c = o(e), d = a + l * s; e._cache.writeUInt32BE(c[0], d + 0), e._cache.writeUInt32BE(c[1], d + 4), e._cache.writeUInt32BE(c[2], d + 8), e._cache.writeUInt32BE(c[3], d + 12); } var u = e._cache.slice(0, t.length); return (e._cache = e._cache.slice(t.length)), n(t, u); }; }, 507714: function (e, t) { (t.encrypt = function (e, t) { return e._cipher.encryptBlock(t); }), (t.decrypt = function (e, t) { return e._cipher.decryptBlock(t); }); }, 675464: function (e, t, i) { var n = { ECB: i(507714), CBC: i(113781), CFB: i(735287), CFB8: i(409789), CFB1: i(222386), OFB: i(82760), CTR: i(868937), GCM: i(868937), }, r = i(641601); for (var a in r) r[a].module = n[r[a].mode]; e.exports = r; }, 82760: function (e, t, i) { var n = i(966465).Buffer, r = i(355595); function a(e) { return (e._prev = e._cipher.encryptBlock(e._prev)), e._prev; } t.encrypt = function (e, t) { for (; e._cache.length < t.length; ) e._cache = n.concat([e._cache, a(e)]); var i = e._cache.slice(0, t.length); return (e._cache = e._cache.slice(t.length)), r(t, i); }; }, 922539: function (e, t, i) { var n = i(869298), r = i(140860).Buffer, a = i(23420); function o(e, t, i, o) { a.call(this), (this._cipher = new n.AES(t)), (this._prev = r.from(i)), (this._cache = r.allocUnsafe(0)), (this._secCache = r.allocUnsafe(0)), (this._decrypt = o), (this._mode = e); } i(32016)(o, a), (o.prototype._update = function (e) { return this._mode.encrypt(this, e, this._decrypt); }), (o.prototype._final = function () { this._cipher.scrub(); }), (e.exports = o); }, 731600: function (e, t, i) { var n = i(169923), r = i(652217), a = i(675464), o = i(203708), s = i(948881); function l(e, t) { if (a[(e = e.toLowerCase())]) (i = a[e].key), (n = a[e].iv); else if (o[e]) (i = 8 * o[e].key), (n = o[e].iv); else throw TypeError("invalid suite type"); var i, n, r = s(t, !1, i, n); return d(e, r.key, r.iv); } function c(e, t) { if (a[(e = e.toLowerCase())]) (i = a[e].key), (n = a[e].iv); else if (o[e]) (i = 8 * o[e].key), (n = o[e].iv); else throw TypeError("invalid suite type"); var i, n, r = s(t, !1, i, n); return u(e, r.key, r.iv); } function d(e, t, i) { if (a[(e = e.toLowerCase())]) return r.createCipheriv(e, t, i); if (o[e]) return new n({ key: t, iv: i, mode: e }); throw TypeError("invalid suite type"); } function u(e, t, i) { if (a[(e = e.toLowerCase())]) return r.createDecipheriv(e, t, i); if (o[e]) return new n({ key: t, iv: i, mode: e, decrypt: !0 }); throw TypeError("invalid suite type"); } function f() { return Object.keys(o).concat(r.getCiphers()); } (t.createCipher = t.Cipher = l), (t.createCipheriv = t.Cipheriv = d), (t.createDecipher = t.Decipher = c), (t.createDecipheriv = t.Decipheriv = u), (t.listCiphers = t.getCiphers = f); }, 169923: function (e, t, i) { var n = i(23420), r = i(445624), a = i(32016), o = i(140860).Buffer, s = { "des-ede3-cbc": r.CBC.instantiate(r.EDE), "des-ede3": r.EDE, "des-ede-cbc": r.CBC.instantiate(r.EDE), "des-ede": r.EDE, "des-cbc": r.CBC.instantiate(r.DES), "des-ecb": r.DES, }; function l(e) { n.call(this); var t, i = e.mode.toLowerCase(), r = s[i]; t = e.decrypt ? "decrypt" : "encrypt"; var a = e.key; !o.isBuffer(a) && (a = o.from(a)), ("des-ede" === i || "des-ede-cbc" === i) && (a = o.concat([a, a.slice(0, 8)])); var l = e.iv; !o.isBuffer(l) && (l = o.from(l)), (this._des = r.create({ key: a, iv: l, type: t })); } (s.des = s["des-cbc"]), (s.des3 = s["des-ede3-cbc"]), (e.exports = l), a(l, n), (l.prototype._update = function (e) { return o.from(this._des.update(e)); }), (l.prototype._final = function () { return o.from(this._des.final()); }); }, 203708: function (e, t) { (t["des-ecb"] = { key: 8, iv: 0 }), (t["des-cbc"] = t.des = { key: 8, iv: 8 }), (t["des-ede3-cbc"] = t.des3 = { key: 24, iv: 8 }), (t["des-ede3"] = { key: 24, iv: 0 }), (t["des-ede-cbc"] = { key: 16, iv: 8 }), (t["des-ede"] = { key: 16, iv: 0 }); }, 134558: function (e, t, i) { var n = i(966465).Buffer, r = i(937385), a = i(203960); function o(e) { var t = s(e); return { blinder: t .toRed(r.mont(e.modulus)) .redPow(new r(e.publicExponent)) .fromRed(), unblinder: t.invm(e.modulus), }; } function s(e) { var t, i = e.modulus.byteLength(); do t = new r(a(i)); while (t.cmp(e.modulus) >= 0 || !t.umod(e.prime1) || !t.umod(e.prime2)); return t; } function l(e, t) { var i = o(t), a = t.modulus.byteLength(), s = new r(e).mul(i.blinder).umod(t.modulus), l = s.toRed(r.mont(t.prime1)), c = s.toRed(r.mont(t.prime2)), d = t.coefficient, u = t.prime1, f = t.prime2, h = l.redPow(t.exponent1).fromRed(), p = c.redPow(t.exponent2).fromRed(), v = h.isub(p).imul(d).umod(u).imul(f); return p .iadd(v) .imul(i.unblinder) .umod(t.modulus) .toArrayLike(n, "be", a); } (l.getr = s), (e.exports = l); }, 339515: function (e, t, i) { "use strict"; e.exports = i(773777); }, 182620: function (e, t, i) { "use strict"; var n = i(140860).Buffer, r = i(669683), a = i(324727), o = i(32016), s = i(872902), l = i(812435), c = i(773777); function d(e) { a.Writable.call(this); var t = c[e]; if (!t) throw Error("Unknown message digest"); (this._hashType = t.hash), (this._hash = r(t.hash)), (this._tag = t.id), (this._signType = t.sign); } function u(e) { a.Writable.call(this); var t = c[e]; if (!t) throw Error("Unknown message digest"); (this._hash = r(t.hash)), (this._tag = t.id), (this._signType = t.sign); } function f(e) { return new d(e); } function h(e) { return new u(e); } Object.keys(c).forEach(function (e) { (c[e].id = n.from(c[e].id, "hex")), (c[e.toLowerCase()] = c[e]); }), o(d, a.Writable), (d.prototype._write = function (e, t, i) { this._hash.update(e), i(); }), (d.prototype.update = function (e, t) { return ( this._hash.update("string" == typeof e ? n.from(e, t) : e), this ); }), (d.prototype.sign = function (e, t) { this.end(); var i = s( this._hash.digest(), e, this._hashType, this._signType, this._tag ); return t ? i.toString(t) : i; }), o(u, a.Writable), (u.prototype._write = function (e, t, i) { this._hash.update(e), i(); }), (u.prototype.update = function (e, t) { return ( this._hash.update("string" == typeof e ? n.from(e, t) : e), this ); }), (u.prototype.verify = function (e, t, i) { var r = "string" == typeof t ? n.from(t, i) : t; return ( this.end(), l(r, this._hash.digest(), e, this._signType, this._tag) ); }), (e.exports = { Sign: f, Verify: h, createSign: f, createVerify: h }); }, 872902: function (e, t, i) { "use strict"; var n = i(140860).Buffer, r = i(193790), a = i(134558), o = i(506434).ec, s = i(937385), l = i(189939), c = i(963079), d = 1; function u(e, t, i, r, o) { var s = l(t); if (s.curve) { if ("ecdsa" !== r && "ecdsa/rsa" !== r) throw Error("wrong private key type"); return f(e, s); } if ("dsa" === s.type) { if ("dsa" !== r) throw Error("wrong private key type"); return h(e, s, i); } if ("rsa" !== r && "ecdsa/rsa" !== r) throw Error("wrong private key type"); if (void 0 !== t.padding && t.padding !== d) throw Error("illegal or unsupported padding mode"); e = n.concat([o, e]); for ( var c = s.modulus.byteLength(), u = [0, 1]; e.length + u.length + 1 < c; ) u.push(255); u.push(0); for (var p = -1; ++p < e.length; ) u.push(e[p]); return a(u, s); } function f(e, t) { var i = c[t.curve.join(".")]; if (!i) throw Error("unknown curve " + t.curve.join(".")); var r = new o(i).keyFromPrivate(t.privateKey).sign(e); return n.from(r.toDER()); } function h(e, t, i) { for ( var n, r = t.params.priv_key, a = t.params.p, o = t.params.q, l = t.params.g, c = new s(0), d = m(e, o).mod(o), u = !1, f = v(r, o, e, i); !1 === u; ) (c = y(l, (n = _(o, f, i)), a, o)), 0 === (u = n .invm(o) .imul(d.add(r.mul(c))) .mod(o)).cmpn(0) && ((u = !1), (c = new s(0))); return p(c, u); } function p(e, t) { (e = e.toArray()), (t = t.toArray()), 128 & e[0] && (e = [0].concat(e)), 128 & t[0] && (t = [0].concat(t)); var i = [48, e.length + t.length + 4, 2, e.length]; return (i = i.concat(e, [2, t.length], t)), n.from(i); } function v(e, t, i, a) { if ((e = n.from(e.toArray())).length < t.byteLength()) { var o = n.alloc(t.byteLength() - e.length); e = n.concat([o, e]); } var s = i.length, l = g(i, t), c = n.alloc(s); c.fill(1); var d = n.alloc(s); return ( (d = r(a, d) .update(c) .update(n.from([0])) .update(e) .update(l) .digest()), (c = r(a, d).update(c).digest()), (d = r(a, d) .update(c) .update(n.from([1])) .update(e) .update(l) .digest()), (c = r(a, d).update(c).digest()), { k: d, v: c } ); } function m(e, t) { var i = new s(e), n = (e.length << 3) - t.bitLength(); return n > 0 && i.ishrn(n), i; } function g(e, t) { e = (e = m(e, t)).mod(t); var i = n.from(e.toArray()); if (i.length < t.byteLength()) { var r = n.alloc(t.byteLength() - i.length); i = n.concat([r, i]); } return i; } function _(e, t, i) { var a, o; do { for (a = n.alloc(0); 8 * a.length < e.bitLength(); ) (t.v = r(i, t.k).update(t.v).digest()), (a = n.concat([a, t.v])); (o = m(a, e)), (t.k = r(i, t.k) .update(t.v) .update(n.from([0])) .digest()), (t.v = r(i, t.k).update(t.v).digest()); } while (-1 !== o.cmp(e)); return o; } function y(e, t, i, n) { return e.toRed(s.mont(i)).redPow(t).fromRed().mod(n); } (e.exports = u), (e.exports.getKey = v), (e.exports.makeKey = _); }, 812435: function (e, t, i) { "use strict"; var n = i(140860).Buffer, r = i(937385), a = i(506434).ec, o = i(189939), s = i(963079); function l(e, t, i, a, s) { var l = o(i); if ("ec" === l.type) { if ("ecdsa" !== a && "ecdsa/rsa" !== a) throw Error("wrong public key type"); return c(e, t, l); } if ("dsa" === l.type) { if ("dsa" !== a) throw Error("wrong public key type"); return d(e, t, l); } if ("rsa" !== a && "ecdsa/rsa" !== a) throw Error("wrong public key type"); t = n.concat([s, t]); for ( var u = l.modulus.byteLength(), f = [1], h = 0; t.length + f.length + 2 < u; ) f.push(255), (h += 1); f.push(0); for (var p = -1; ++p < t.length; ) f.push(t[p]); f = n.from(f); var v = r.mont(l.modulus); (e = (e = new r(e).toRed(v)).redPow(new r(l.publicExponent))), (e = n.from(e.fromRed().toArray())); var m = h < 8 ? 1 : 0; for ( u = Math.min(e.length, f.length), e.length !== f.length && (m = 1), p = -1; ++p < u; ) m |= e[p] ^ f[p]; return 0 === m; } function c(e, t, i) { var n = s[i.data.algorithm.curve.join(".")]; if (!n) throw Error("unknown curve " + i.data.algorithm.curve.join(".")); var r = new a(n), o = i.data.subjectPrivateKey.data; return r.verify(t, e, o); } function d(e, t, i) { var n = i.data.p, a = i.data.q, s = i.data.g, l = i.data.pub_key, c = o.signature.decode(e, "der"), d = c.s, f = c.r; u(d, a), u(f, a); var h = r.mont(n), p = d.invm(a); return ( 0 === s .toRed(h) .redPow(new r(t).mul(p).mod(a)) .fromRed() .mul(l.toRed(h).redPow(f.mul(p).mod(a)).fromRed()) .mod(n) .mod(a) .cmp(f) ); } function u(e, t) { if (0 >= e.cmpn(0) || e.cmp(t) >= 0) throw Error("invalid sig"); } e.exports = l; }, 355595: function (e, t, i) { var n = i(966465).Buffer; e.exports = function (e, t) { for ( var i = Math.min(e.length, t.length), r = new n(i), a = 0; a < i; ++a ) r[a] = e[a] ^ t[a]; return r; }; }, 23420: function (e, t, i) { var n = i(140860).Buffer, r = i(328266).Transform, a = i(450251).StringDecoder; function o(e) { r.call(this), (this.hashMode = "string" == typeof e), this.hashMode ? (this[e] = this._finalOrDigest) : (this.final = this._finalOrDigest), this._final && ((this.__final = this._final), (this._final = null)), (this._decoder = null), (this._encoding = null); } i(32016)(o, r), (o.prototype.update = function (e, t, i) { "string" == typeof e && (e = n.from(e, t)); var r = this._update(e); return this.hashMode ? this : (i && (r = this._toString(r, i)), r); }), (o.prototype.setAutoPadding = function () {}), (o.prototype.getAuthTag = function () { throw Error("trying to get auth tag in unsupported state"); }), (o.prototype.setAuthTag = function () { throw Error("trying to set auth tag in unsupported state"); }), (o.prototype.setAAD = function () { throw Error("trying to set aad in unsupported state"); }), (o.prototype._transform = function (e, t, i) { var n; try { this.hashMode ? this._update(e) : this.push(this._update(e)); } catch (e) { n = e; } finally { i(n); } }), (o.prototype._flush = function (e) { var t; try { this.push(this.__final()); } catch (e) { t = e; } e(t); }), (o.prototype._finalOrDigest = function (e) { var t = this.__final() || n.alloc(0); return e && (t = this._toString(t, e, !0)), t; }), (o.prototype._toString = function (e, t, i) { if ( (!this._decoder && ((this._decoder = new a(t)), (this._encoding = t)), this._encoding !== t) ) throw Error("can't switch encodings"); var n = this._decoder.write(e); return i && (n += this._decoder.end()), n; }), (e.exports = o); }, 975952: function (e, t, i) { function n(e) { return Array.isArray ? Array.isArray(e) : "[object Array]" === g(e); } function r(e) { return "boolean" == typeof e; } function a(e) { return null === e; } function o(e) { return null == e; } function s(e) { return "number" == typeof e; } function l(e) { return "string" == typeof e; } function c(e) { return "symbol" == typeof e; } function d(e) { return void 0 === e; } function u(e) { return "[object RegExp]" === g(e); } function f(e) { return "object" == typeof e && null !== e; } function h(e) { return "[object Date]" === g(e); } function p(e) { return "[object Error]" === g(e) || e instanceof Error; } function v(e) { return "function" == typeof e; } function m(e) { return ( null === e || "boolean" == typeof e || "number" == typeof e || "string" == typeof e || "symbol" == typeof e || void 0 === e ); } function g(e) { return Object.prototype.toString.call(e); } (t.isArray = n), (t.isBoolean = r), (t.isNull = a), (t.isNullOrUndefined = o), (t.isNumber = s), (t.isString = l), (t.isSymbol = c), (t.isUndefined = d), (t.isRegExp = u), (t.isObject = f), (t.isDate = h), (t.isError = p), (t.isFunction = v), (t.isPrimitive = m), (t.isBuffer = i(966465).Buffer.isBuffer); }, 41518: function (e, t, i) { var n = i(966465).Buffer, r = i(506434), a = i(984826); e.exports = function (e) { return new s(e); }; var o = { secp256k1: { name: "secp256k1", byteLength: 32 }, secp224r1: { name: "p224", byteLength: 28 }, prime256v1: { name: "p256", byteLength: 32 }, prime192v1: { name: "p192", byteLength: 24 }, ed25519: { name: "ed25519", byteLength: 32 }, secp384r1: { name: "p384", byteLength: 48 }, secp521r1: { name: "p521", byteLength: 66 }, }; function s(e) { (this.curveType = o[e]), !this.curveType && (this.curveType = { name: e }), (this.curve = new r.ec(this.curveType.name)), (this.keys = void 0); } function l(e, t, i) { !Array.isArray(e) && (e = e.toArray()); var r = new n(e); if (i && r.length < i) { var a = new n(i - r.length); a.fill(0), (r = n.concat([a, r])); } return t ? r.toString(t) : r; } (o.p224 = o.secp224r1), (o.p256 = o.secp256r1 = o.prime256v1), (o.p192 = o.secp192r1 = o.prime192v1), (o.p384 = o.secp384r1), (o.p521 = o.secp521r1), (s.prototype.generateKeys = function (e, t) { return (this.keys = this.curve.genKeyPair()), this.getPublicKey(e, t); }), (s.prototype.computeSecret = function (e, t, i) { return ( (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)), l( this.curve .keyFromPublic(e) .getPublic() .mul(this.keys.getPrivate()) .getX(), i, this.curveType.byteLength ) ); }), (s.prototype.getPublicKey = function (e, t) { var i = this.keys.getPublic("compressed" === t, !0); return ( "hybrid" === t && (i[i.length - 1] % 2 ? (i[0] = 7) : (i[0] = 6)), l(i, e) ); }), (s.prototype.getPrivateKey = function (e) { return l(this.keys.getPrivate(), e); }), (s.prototype.setPublicKey = function (e, t) { return ( (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)), this.keys._importPublic(e), this ); }), (s.prototype.setPrivateKey = function (e, t) { (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)); var i = new a(e); return ( (i = i.toString(16)), (this.keys = this.curve.genKeyPair()), this.keys._importPrivate(i), this ); }); }, 669683: function (e, t, i) { "use strict"; var n = i(32016), r = i(317511), a = i(866818), o = i(673664), s = i(23420); function l(e) { s.call(this, "digest"), (this._hash = e); } n(l, s), (l.prototype._update = function (e) { this._hash.update(e); }), (l.prototype._final = function () { return this._hash.digest(); }), (e.exports = function (e) { return "md5" === (e = e.toLowerCase()) ? new r() : "rmd160" === e || "ripemd160" === e ? new a() : new l(o(e)); }); }, 318042: function (e, t, i) { var n = i(317511); e.exports = function (e) { return new n().update(e).digest(); }; }, 193790: function (e, t, i) { "use strict"; var n = i(32016), r = i(724779), a = i(23420), o = i(140860).Buffer, s = i(318042), l = i(866818), c = i(673664), d = o.alloc(128); function u(e, t) { a.call(this, "digest"), "string" == typeof t && (t = o.from(t)); var i = "sha512" === e || "sha384" === e ? 128 : 64; (this._alg = e), (this._key = t), t.length > i ? (t = ("rmd160" === e ? new l() : c(e)).update(t).digest()) : t.length < i && (t = o.concat([t, d], i)); for ( var n = (this._ipad = o.allocUnsafe(i)), r = (this._opad = o.allocUnsafe(i)), s = 0; s < i; s++ ) (n[s] = 54 ^ t[s]), (r[s] = 92 ^ t[s]); (this._hash = "rmd160" === e ? new l() : c(e)), this._hash.update(n); } n(u, a), (u.prototype._update = function (e) { this._hash.update(e); }), (u.prototype._final = function () { var e = this._hash.digest(); return ("rmd160" === this._alg ? new l() : c(this._alg)) .update(this._opad) .update(e) .digest(); }), (e.exports = function (e, t) { return "rmd160" === (e = e.toLowerCase()) || "ripemd160" === e ? new u("rmd160", t) : "md5" === e ? new r(s, t) : new u(e, t); }); }, 724779: function (e, t, i) { "use strict"; var n = i(32016), r = i(140860).Buffer, a = i(23420), o = r.alloc(128), s = 64; function l(e, t) { a.call(this, "digest"), "string" == typeof t && (t = r.from(t)), (this._alg = e), (this._key = t), t.length > s ? (t = e(t)) : t.length < s && (t = r.concat([t, o], s)); for ( var i = (this._ipad = r.allocUnsafe(s)), n = (this._opad = r.allocUnsafe(s)), l = 0; l < s; l++ ) (i[l] = 54 ^ t[l]), (n[l] = 92 ^ t[l]); this._hash = [i]; } n(l, a), (l.prototype._update = function (e) { this._hash.push(e); }), (l.prototype._final = function () { var e = this._alg(r.concat(this._hash)); return this._alg(r.concat([this._opad, e])); }), (e.exports = l); }, 909854: function (e) { !(function (t, i) { e.exports = i(); })(0, function () { function e(a, o) { if (!(this instanceof e)) return new e(a, o); var s = Math.pow(10, (o = Object.assign({}, i, o)).precision); (this.intValue = a = t(a, o)), (this.value = a / s), (o.increment = o.increment || 1 / s), (o.groups = o.useVedic ? r : n), (this.s = o), (this.p = s); } function t(t, i) { var n = !(2 < arguments.length) || void 0 === arguments[2] || arguments[2], r = i.decimal, a = i.errorOnInvalid, o = i.fromCents, s = Math.pow(10, i.precision), l = t instanceof e; if (l && o) return t.intValue; if ("number" == typeof t || l) r = l ? t.value : t; else if ("string" == typeof t) (a = RegExp("[^-\\d" + r + "]", "g")), (r = RegExp("\\" + r, "g")), (r = (r = t .replace(/\((.*)\)/, "-$1") .replace(a, "") .replace(r, ".")) || 0); else { if (a) throw Error("Invalid Input"); r = 0; } return o || (r = (r * s).toFixed(4)), n ? Math.round(r) : r; } var i = { symbol: "$", separator: ",", decimal: ".", errorOnInvalid: !1, precision: 2, pattern: "!#", negativePattern: "-!#", format: function (e, t) { var i = t.pattern, n = t.negativePattern, r = t.symbol, a = t.separator, o = t.decimal; t = t.groups; var s = ("" + e).replace(/^-/, "").split("."), l = s[0]; return ( (s = s[1]), (0 <= e.value ? i : n) .replace("!", r) .replace("#", l.replace(t, "$1" + a) + (s ? o + s : "")) ); }, fromCents: !1, }, n = /(\d)(?=(\d{3})+\b)/g, r = /(\d)(?=(\d\d)+\d\b)/g; return ( (e.prototype = { add: function (i) { var n = this.s, r = this.p; return e((this.intValue + t(i, n)) / (n.fromCents ? 1 : r), n); }, subtract: function (i) { var n = this.s, r = this.p; return e((this.intValue - t(i, n)) / (n.fromCents ? 1 : r), n); }, multiply: function (t) { var i = this.s; return e( (this.intValue * t) / (i.fromCents ? 1 : Math.pow(10, i.precision)), i ); }, divide: function (i) { var n = this.s; return e(this.intValue / t(i, n, !1), n); }, distribute: function (t) { var i = this.intValue, n = this.p, r = this.s, a = [], o = Math[0 <= i ? "floor" : "ceil"](i / t), s = Math.abs(i - o * t); for (n = r.fromCents ? 1 : n; 0 !== t; t--) { var l = e(o / n, r); 0 < s-- && (l = l[0 <= i ? "add" : "subtract"](1 / n)), a.push(l); } return a; }, dollars: function () { return ~~this.value; }, cents: function () { return ~~(this.intValue % this.p); }, format: function (e) { var t = this.s; return "function" == typeof e ? e(this, t) : t.format(this, Object.assign({}, t, e)); }, toString: function () { var e = this.s, t = e.increment; return (Math.round(this.intValue / this.p / t) * t).toFixed( e.precision ); }, toJSON: function () { return this.value; }, }), e ); }); }, 445624: function (e, t, i) { "use strict"; (t.utils = i(757426)), (t.Cipher = i(150852)), (t.DES = i(103722)), (t.CBC = i(834068)), (t.EDE = i(621099)); }, 834068: function (e, t, i) { "use strict"; var n = i(422555), r = i(32016), a = {}; function o(e) { n.equal(e.length, 8, "Invalid IV length"), (this.iv = Array(8)); for (var t = 0; t < this.iv.length; t++) this.iv[t] = e[t]; } function s(e) { function t(t) { e.call(this, t), this._cbcInit(); } r(t, e); for (var i = Object.keys(a), n = 0; n < i.length; n++) { var o = i[n]; t.prototype[o] = a[o]; } return ( (t.create = function (e) { return new t(e); }), t ); } (t.instantiate = s), (a._cbcInit = function () { var e = new o(this.options.iv); this._cbcState = e; }), (a._update = function (e, t, i, n) { var r = this._cbcState, a = this.constructor.super_.prototype, o = r.iv; if ("encrypt" === this.type) { for (var s = 0; s < this.blockSize; s++) o[s] ^= e[t + s]; a._update.call(this, o, 0, i, n); for (var s = 0; s < this.blockSize; s++) o[s] = i[n + s]; } else { a._update.call(this, e, t, i, n); for (var s = 0; s < this.blockSize; s++) i[n + s] ^= o[s]; for (var s = 0; s < this.blockSize; s++) o[s] = e[t + s]; } }); }, 150852: function (e, t, i) { "use strict"; var n = i(422555); function r(e) { (this.options = e), (this.type = this.options.type), (this.blockSize = 8), this._init(), (this.buffer = Array(this.blockSize)), (this.bufferOff = 0), (this.padding = !1 !== e.padding); } (e.exports = r), (r.prototype._init = function () {}), (r.prototype.update = function (e) { return 0 === e.length ? [] : "decrypt" === this.type ? this._updateDecrypt(e) : this._updateEncrypt(e); }), (r.prototype._buffer = function (e, t) { for ( var i = Math.min(this.buffer.length - this.bufferOff, e.length - t), n = 0; n < i; n++ ) this.buffer[this.bufferOff + n] = e[t + n]; return (this.bufferOff += i), i; }), (r.prototype._flushBuffer = function (e, t) { return ( this._update(this.buffer, 0, e, t), (this.bufferOff = 0), this.blockSize ); }), (r.prototype._updateEncrypt = function (e) { var t = 0, i = 0, n = Array( (((this.bufferOff + e.length) / this.blockSize) | 0) * this.blockSize ); 0 !== this.bufferOff && ((t += this._buffer(e, t)), this.bufferOff === this.buffer.length && (i += this._flushBuffer(n, i))); for ( var r = e.length - ((e.length - t) % this.blockSize); t < r; t += this.blockSize ) this._update(e, t, n, i), (i += this.blockSize); for (; t < e.length; t++, this.bufferOff++) this.buffer[this.bufferOff] = e[t]; return n; }), (r.prototype._updateDecrypt = function (e) { for ( var t = 0, i = 0, n = Math.ceil((this.bufferOff + e.length) / this.blockSize) - 1, r = Array(n * this.blockSize); n > 0; n-- ) (t += this._buffer(e, t)), (i += this._flushBuffer(r, i)); return (t += this._buffer(e, t)), r; }), (r.prototype.final = function (e) { var t, i; return (e && (t = this.update(e)), (i = "encrypt" === this.type ? this._finalEncrypt() : this._finalDecrypt()), t) ? t.concat(i) : i; }), (r.prototype._pad = function (e, t) { if (0 === t) return !1; for (; t < e.length; ) e[t++] = 0; return !0; }), (r.prototype._finalEncrypt = function () { if (!this._pad(this.buffer, this.bufferOff)) return []; var e = Array(this.blockSize); return this._update(this.buffer, 0, e, 0), e; }), (r.prototype._unpad = function (e) { return e; }), (r.prototype._finalDecrypt = function () { n.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); var e = Array(this.blockSize); return this._flushBuffer(e, 0), this._unpad(e); }); }, 103722: function (e, t, i) { "use strict"; var n = i(422555), r = i(32016), a = i(757426), o = i(150852); function s() { (this.tmp = [, ,]), (this.keys = null); } function l(e) { o.call(this, e); var t = new s(); (this._desState = t), this.deriveKeys(t, e.key); } r(l, o), (e.exports = l), (l.create = function (e) { return new l(e); }); var c = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; (l.prototype.deriveKeys = function (e, t) { (e.keys = Array(32)), n.equal(t.length, this.blockSize, "Invalid key length"); var i = a.readUInt32BE(t, 0), r = a.readUInt32BE(t, 4); a.pc1(i, r, e.tmp, 0), (i = e.tmp[0]), (r = e.tmp[1]); for (var o = 0; o < e.keys.length; o += 2) { var s = c[o >>> 1]; (i = a.r28shl(i, s)), (r = a.r28shl(r, s)), a.pc2(i, r, e.keys, o); } }), (l.prototype._update = function (e, t, i, n) { var r = this._desState, o = a.readUInt32BE(e, t), s = a.readUInt32BE(e, t + 4); a.ip(o, s, r.tmp, 0), (o = r.tmp[0]), (s = r.tmp[1]), "encrypt" === this.type ? this._encrypt(r, o, s, r.tmp, 0) : this._decrypt(r, o, s, r.tmp, 0), (o = r.tmp[0]), (s = r.tmp[1]), a.writeUInt32BE(i, o, n), a.writeUInt32BE(i, s, n + 4); }), (l.prototype._pad = function (e, t) { if (!1 === this.padding) return !1; for (var i = e.length - t, n = t; n < e.length; n++) e[n] = i; return !0; }), (l.prototype._unpad = function (e) { if (!1 === this.padding) return e; for (var t = e[e.length - 1], i = e.length - t; i < e.length; i++) n.equal(e[i], t); return e.slice(0, e.length - t); }), (l.prototype._encrypt = function (e, t, i, n, r) { for (var o = t, s = i, l = 0; l < e.keys.length; l += 2) { var c = e.keys[l], d = e.keys[l + 1]; a.expand(s, e.tmp, 0), (c ^= e.tmp[0]), (d ^= e.tmp[1]); var u = a.substitute(c, d), f = a.permute(u), h = s; (s = (o ^ f) >>> 0), (o = h); } a.rip(s, o, n, r); }), (l.prototype._decrypt = function (e, t, i, n, r) { for (var o = i, s = t, l = e.keys.length - 2; l >= 0; l -= 2) { var c = e.keys[l], d = e.keys[l + 1]; a.expand(o, e.tmp, 0), (c ^= e.tmp[0]), (d ^= e.tmp[1]); var u = a.substitute(c, d), f = a.permute(u), h = o; (o = (s ^ f) >>> 0), (s = h); } a.rip(o, s, n, r); }); }, 621099: function (e, t, i) { "use strict"; var n = i(422555), r = i(32016), a = i(150852), o = i(103722); function s(e, t) { n.equal(t.length, 24, "Invalid key length"); var i = t.slice(0, 8), r = t.slice(8, 16), a = t.slice(16, 24); "encrypt" === e ? (this.ciphers = [ o.create({ type: "encrypt", key: i }), o.create({ type: "decrypt", key: r }), o.create({ type: "encrypt", key: a }), ]) : (this.ciphers = [ o.create({ type: "decrypt", key: a }), o.create({ type: "encrypt", key: r }), o.create({ type: "decrypt", key: i }), ]); } function l(e) { a.call(this, e); var t = new s(this.type, this.options.key); this._edeState = t; } r(l, a), (e.exports = l), (l.create = function (e) { return new l(e); }), (l.prototype._update = function (e, t, i, n) { var r = this._edeState; r.ciphers[0]._update(e, t, i, n), r.ciphers[1]._update(i, n, i, n), r.ciphers[2]._update(i, n, i, n); }), (l.prototype._pad = o.prototype._pad), (l.prototype._unpad = o.prototype._unpad); }, 757426: function (e, t) { "use strict"; (t.readUInt32BE = function (e, t) { return ( ((e[0 + t] << 24) | (e[1 + t] << 16) | (e[2 + t] << 8) | e[3 + t]) >>> 0 ); }), (t.writeUInt32BE = function (e, t, i) { (e[0 + i] = t >>> 24), (e[1 + i] = (t >>> 16) & 255), (e[2 + i] = (t >>> 8) & 255), (e[3 + i] = 255 & t); }), (t.ip = function (e, t, i, n) { for (var r = 0, a = 0, o = 6; o >= 0; o -= 2) { for (var s = 0; s <= 24; s += 8) (r <<= 1), (r |= (t >>> (s + o)) & 1); for (var s = 0; s <= 24; s += 8) (r <<= 1), (r |= (e >>> (s + o)) & 1); } for (var o = 6; o >= 0; o -= 2) { for (var s = 1; s <= 25; s += 8) (a <<= 1), (a |= (t >>> (s + o)) & 1); for (var s = 1; s <= 25; s += 8) (a <<= 1), (a |= (e >>> (s + o)) & 1); } (i[n + 0] = r >>> 0), (i[n + 1] = a >>> 0); }), (t.rip = function (e, t, i, n) { for (var r = 0, a = 0, o = 0; o < 4; o++) for (var s = 24; s >= 0; s -= 8) (r <<= 1), (r |= (t >>> (s + o)) & 1), (r <<= 1), (r |= (e >>> (s + o)) & 1); for (var o = 4; o < 8; o++) for (var s = 24; s >= 0; s -= 8) (a <<= 1), (a |= (t >>> (s + o)) & 1), (a <<= 1), (a |= (e >>> (s + o)) & 1); (i[n + 0] = r >>> 0), (i[n + 1] = a >>> 0); }), (t.pc1 = function (e, t, i, n) { for (var r = 0, a = 0, o = 7; o >= 5; o--) { for (var s = 0; s <= 24; s += 8) (r <<= 1), (r |= (t >> (s + o)) & 1); for (var s = 0; s <= 24; s += 8) (r <<= 1), (r |= (e >> (s + o)) & 1); } for (var s = 0; s <= 24; s += 8) (r <<= 1), (r |= (t >> (s + o)) & 1); for (var o = 1; o <= 3; o++) { for (var s = 0; s <= 24; s += 8) (a <<= 1), (a |= (t >> (s + o)) & 1); for (var s = 0; s <= 24; s += 8) (a <<= 1), (a |= (e >> (s + o)) & 1); } for (var s = 0; s <= 24; s += 8) (a <<= 1), (a |= (e >> (s + o)) & 1); (i[n + 0] = r >>> 0), (i[n + 1] = a >>> 0); }), (t.r28shl = function (e, t) { return ((e << t) & 0xfffffff) | (e >>> (28 - t)); }); var i = [ 14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24, ]; (t.pc2 = function (e, t, n, r) { for (var a = 0, o = 0, s = i.length >>> 1, l = 0; l < s; l++) (a <<= 1), (a |= (e >>> i[l]) & 1); for (var l = s; l < i.length; l++) (o <<= 1), (o |= (t >>> i[l]) & 1); (n[r + 0] = a >>> 0), (n[r + 1] = o >>> 0); }), (t.expand = function (e, t, i) { var n = 0, r = 0; n = ((1 & e) << 5) | (e >>> 27); for (var a = 23; a >= 15; a -= 4) (n <<= 6), (n |= (e >>> a) & 63); for (var a = 11; a >= 3; a -= 4) (r |= (e >>> a) & 63), (r <<= 6); (r |= ((31 & e) << 1) | (e >>> 31)), (t[i + 0] = n >>> 0), (t[i + 1] = r >>> 0); }); var n = [ 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11, ]; t.substitute = function (e, t) { for (var i = 0, r = 0; r < 4; r++) { var a = (e >>> (18 - 6 * r)) & 63, o = n[64 * r + a]; (i <<= 4), (i |= o); } for (var r = 0; r < 4; r++) { var a = (t >>> (18 - 6 * r)) & 63, o = n[256 + 64 * r + a]; (i <<= 4), (i |= o); } return i >>> 0; }; var r = [ 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7, ]; (t.permute = function (e) { for (var t = 0, i = 0; i < r.length; i++) (t <<= 1), (t |= (e >>> r[i]) & 1); return t >>> 0; }), (t.padSplit = function (e, t, i) { for (var n = e.toString(2); n.length < t; ) n = "0" + n; for (var r = [], a = 0; a < t; a += i) r.push(n.slice(a, a + i)); return r.join(" "); }); }, 785091: function (e, t, i) { var n = i(966465).Buffer, r = i(686927), a = i(895968), o = i(249111); function s(e) { return new o(new n(a[e].prime, "hex"), new n(a[e].gen, "hex")); } var l = { binary: !0, hex: !0, base64: !0 }; function c(e, t, i, a) { return n.isBuffer(t) || void 0 === l[t] ? c(e, "binary", t, i) : ((t = t || "binary"), (a = a || "binary"), (i = i || new n([2])), !n.isBuffer(i) && (i = new n(i, a)), "number" == typeof e) ? new o(r(e, i), i, !0) : (!n.isBuffer(e) && (e = new n(e, t)), new o(e, i, !0)); } (t.DiffieHellmanGroup = t.createDiffieHellmanGroup = t.getDiffieHellman = s), (t.createDiffieHellman = t.DiffieHellman = c); }, 249111: function (e, t, i) { var n = i(966465).Buffer, r = i(984826), a = new (i(350724))(), o = new r(24), s = new r(11), l = new r(10), c = new r(3), d = new r(7), u = i(686927), f = i(203960); function h(e, t) { return ( (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)), (this._pub = new r(e)), this ); } function p(e, t) { return ( (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)), (this._priv = new r(e)), this ); } e.exports = g; var v = {}; function m(e, t) { var i, n = t.toString("hex"), r = [n, e.toString(16)].join("_"); if (r in v) return v[r]; var f = 0; if (e.isEven() || !u.simpleSieve || !u.fermatTest(e) || !a.test(e)) return ( (f += 1), "02" === n || "05" === n ? (f += 8) : (f += 4), (v[r] = f), f ); switch ((!a.test(e.shrn(1)) && (f += 2), n)) { case "02": e.mod(o).cmp(s) && (f += 8); break; case "05": (i = e.mod(l)).cmp(c) && i.cmp(d) && (f += 8); break; default: f += 4; } return (v[r] = f), f; } function g(e, t, i) { this.setGenerator(t), (this.__prime = new r(e)), (this._prime = r.mont(this.__prime)), (this._primeLen = e.length), (this._pub = void 0), (this._priv = void 0), (this._primeCode = void 0), i ? ((this.setPublicKey = h), (this.setPrivateKey = p)) : (this._primeCode = 8); } function _(e, t) { var i = new n(e.toArray()); return t ? i.toString(t) : i; } Object.defineProperty(g.prototype, "verifyError", { enumerable: !0, get: function () { return ( "number" != typeof this._primeCode && (this._primeCode = m(this.__prime, this.__gen)), this._primeCode ); }, }), (g.prototype.generateKeys = function () { return ( !this._priv && (this._priv = new r(f(this._primeLen))), (this._pub = this._gen .toRed(this._prime) .redPow(this._priv) .fromRed()), this.getPublicKey() ); }), (g.prototype.computeSecret = function (e) { var t = new n( (e = (e = new r(e)).toRed(this._prime)) .redPow(this._priv) .fromRed() .toArray() ), i = this.getPrime(); if (t.length < i.length) { var a = new n(i.length - t.length); a.fill(0), (t = n.concat([a, t])); } return t; }), (g.prototype.getPublicKey = function (e) { return _(this._pub, e); }), (g.prototype.getPrivateKey = function (e) { return _(this._priv, e); }), (g.prototype.getPrime = function (e) { return _(this.__prime, e); }), (g.prototype.getGenerator = function (e) { return _(this._gen, e); }), (g.prototype.setGenerator = function (e, t) { return ( (t = t || "utf8"), !n.isBuffer(e) && (e = new n(e, t)), (this.__gen = e), (this._gen = new r(e)), this ); }); }, 686927: function (e, t, i) { var n = i(203960); (e.exports = _), (_.simpleSieve = m), (_.fermatTest = g); var r = i(984826), a = new r(24), o = new (i(350724))(), s = new r(1), l = new r(2), c = new r(5); new r(16), new r(8); var d = new r(10), u = new r(3); new r(7); var f = new r(11), h = new r(4); new r(12); var p = null; function v() { if (null !== p) return p; var e = 1048576, t = []; t[0] = 2; for (var i = 1, n = 3; n < e; n += 2) { for ( var r = Math.ceil(Math.sqrt(n)), a = 0; a < i && t[a] <= r && n % t[a] != 0; a++ ); (i === a || !(t[a] <= r)) && (t[i++] = n); } return (p = t), t; } function m(e) { for (var t = v(), i = 0; i < t.length; i++) if (0 === e.modn(t[i])) { if (0 !== e.cmpn(t[i])) return !1; break; } return !0; } function g(e) { var t = r.mont(e); return 0 === l.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1); } function _(e, t) { var i, p; if (e < 16) return 2 === t || 5 === t ? new r([140, 123]) : new r([140, 39]); for (t = new r(t); ; ) { for (i = new r(n(Math.ceil(e / 8))); i.bitLength() > e; ) i.ishrn(1); if ((i.isEven() && i.iadd(s), !i.testn(1) && i.iadd(l), t.cmp(l))) { if (!t.cmp(c)) for (; i.mod(d).cmp(u); ) i.iadd(h); } else for (; i.mod(a).cmp(f); ) i.iadd(h); if ( m((p = i.shrn(1))) && m(i) && g(p) && g(i) && o.test(p) && o.test(i) ) return i; } } }, 506434: function (e, t, i) { "use strict"; var n = t; (n.version = i(172353).i8), (n.utils = i(252372)), (n.rand = i(462810)), (n.curve = i(774784)), (n.curves = i(244043)), (n.ec = i(983272)), (n.eddsa = i(180800)); }, 105634: function (e, t, i) { "use strict"; var n = i(984826), r = i(252372), a = r.getNAF, o = r.getJSF, s = r.assert; function l(e, t) { (this.type = e), (this.p = new n(t.p, 16)), (this.red = t.prime ? n.red(t.prime) : n.mont(this.p)), (this.zero = new n(0).toRed(this.red)), (this.one = new n(1).toRed(this.red)), (this.two = new n(2).toRed(this.red)), (this.n = t.n && new n(t.n, 16)), (this.g = t.g && this.pointFromJSON(t.g, t.gRed)), (this._wnafT1 = [, , , ,]), (this._wnafT2 = [, , , ,]), (this._wnafT3 = [, , , ,]), (this._wnafT4 = [, , , ,]), (this._bitLength = this.n ? this.n.bitLength() : 0); var i = this.n && this.p.div(this.n); !i || i.cmpn(100) > 0 ? (this.redN = null) : ((this._maxwellTrick = !0), (this.redN = this.n.toRed(this.red))); } function c(e, t) { (this.curve = e), (this.type = t), (this.precomputed = null); } (e.exports = l), (l.prototype.point = function () { throw Error("Not implemented"); }), (l.prototype.validate = function () { throw Error("Not implemented"); }), (l.prototype._fixedNafMul = function (e, t) { s(e.precomputed); var i, n, r = e._getDoubles(), o = a(t, 1, this._bitLength), l = (1 << (r.step + 1)) - (r.step % 2 == 0 ? 2 : 1); l /= 3; var c = []; for (i = 0; i < o.length; i += r.step) { n = 0; for (var d = i + r.step - 1; d >= i; d--) n = (n << 1) + o[d]; c.push(n); } for ( var u = this.jpoint(null, null, null), f = this.jpoint(null, null, null), h = l; h > 0; h-- ) { for (i = 0; i < c.length; i++) (n = c[i]) === h ? (f = f.mixedAdd(r.points[i])) : n === -h && (f = f.mixedAdd(r.points[i].neg())); u = u.add(f); } return u.toP(); }), (l.prototype._wnafMul = function (e, t) { var i = 4, n = e._getNAFPoints(i); i = n.wnd; for ( var r = n.points, o = a(t, i, this._bitLength), l = this.jpoint(null, null, null), c = o.length - 1; c >= 0; c-- ) { for (var d = 0; c >= 0 && 0 === o[c]; c--) d++; if ((c >= 0 && d++, (l = l.dblp(d)), c < 0)) break; var u = o[c]; s(0 !== u), (l = "affine" === e.type ? u > 0 ? l.mixedAdd(r[(u - 1) >> 1]) : l.mixedAdd(r[(-u - 1) >> 1].neg()) : u > 0 ? l.add(r[(u - 1) >> 1]) : l.add(r[(-u - 1) >> 1].neg())); } return "affine" === e.type ? l.toP() : l; }), (l.prototype._wnafMulAdd = function (e, t, i, n, r) { var s, l, c, d = this._wnafT1, u = this._wnafT2, f = this._wnafT3, h = 0; for (s = 0; s < n; s++) { var p = (c = t[s])._getNAFPoints(e); (d[s] = p.wnd), (u[s] = p.points); } for (s = n - 1; s >= 1; s -= 2) { var v = s - 1, m = s; if (1 !== d[v] || 1 !== d[m]) { (f[v] = a(i[v], d[v], this._bitLength)), (f[m] = a(i[m], d[m], this._bitLength)), (h = Math.max(f[v].length, h)), (h = Math.max(f[m].length, h)); continue; } var g = [t[v], null, null, t[m]]; 0 === t[v].y.cmp(t[m].y) ? ((g[1] = t[v].add(t[m])), (g[2] = t[v].toJ().mixedAdd(t[m].neg()))) : 0 === t[v].y.cmp(t[m].y.redNeg()) ? ((g[1] = t[v].toJ().mixedAdd(t[m])), (g[2] = t[v].add(t[m].neg()))) : ((g[1] = t[v].toJ().mixedAdd(t[m])), (g[2] = t[v].toJ().mixedAdd(t[m].neg()))); var _ = [-3, -1, -5, -7, 0, 7, 5, 1, 3], y = o(i[v], i[m]); for ( l = 0, h = Math.max(y[0].length, h), f[v] = Array(h), f[m] = Array(h); l < h; l++ ) { var b = 0 | y[0][l], I = 0 | y[1][l]; (f[v][l] = _[(b + 1) * 3 + (I + 1)]), (f[m][l] = 0), (u[v] = g); } } var w = this.jpoint(null, null, null), x = this._wnafT4; for (s = h; s >= 0; s--) { for (var S = 0; s >= 0; ) { var M = !0; for (l = 0; l < n; l++) (x[l] = 0 | f[l][s]), 0 !== x[l] && (M = !1); if (!M) break; S++, s--; } if ((s >= 0 && S++, (w = w.dblp(S)), s < 0)) break; for (l = 0; l < n; l++) { var C = x[l]; if (0 !== C) { C > 0 ? (c = u[l][(C - 1) >> 1]) : C < 0 && (c = u[l][(-C - 1) >> 1].neg()); w = "affine" === c.type ? w.mixedAdd(c) : w.add(c); } } } for (s = 0; s < n; s++) u[s] = null; return r ? w : w.toP(); }), (l.BasePoint = c), (c.prototype.eq = function () { throw Error("Not implemented"); }), (c.prototype.validate = function () { return this.curve.validate(this); }), (l.prototype.decodePoint = function (e, t) { e = r.toArray(e, t); var i = this.p.byteLength(); if ((4 === e[0] || 6 === e[0] || 7 === e[0]) && e.length - 1 == 2 * i) return ( 6 === e[0] ? s(e[e.length - 1] % 2 == 0) : 7 === e[0] && s(e[e.length - 1] % 2 == 1), this.point(e.slice(1, 1 + i), e.slice(1 + i, 1 + 2 * i)) ); if ((2 === e[0] || 3 === e[0]) && e.length - 1 === i) return this.pointFromX(e.slice(1, 1 + i), 3 === e[0]); throw Error("Unknown point format"); }), (c.prototype.encodeCompressed = function (e) { return this.encode(e, !0); }), (c.prototype._encode = function (e) { var t = this.curve.p.byteLength(), i = this.getX().toArray("be", t); return e ? [this.getY().isEven() ? 2 : 3].concat(i) : [4].concat(i, this.getY().toArray("be", t)); }), (c.prototype.encode = function (e, t) { return r.encode(this._encode(t), e); }), (c.prototype.precompute = function (e) { if (this.precomputed) return this; var t = { doubles: null, naf: null, beta: null }; return ( (t.naf = this._getNAFPoints(8)), (t.doubles = this._getDoubles(4, e)), (t.beta = this._getBeta()), (this.precomputed = t), this ); }), (c.prototype._hasDoubles = function (e) { if (!this.precomputed) return !1; var t = this.precomputed.doubles; return ( !!t && t.points.length >= Math.ceil((e.bitLength() + 1) / t.step) ); }), (c.prototype._getDoubles = function (e, t) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; for (var i = [this], n = this, r = 0; r < t; r += e) { for (var a = 0; a < e; a++) n = n.dbl(); i.push(n); } return { step: e, points: i }; }), (c.prototype._getNAFPoints = function (e) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; for ( var t = [this], i = (1 << e) - 1, n = 1 === i ? null : this.dbl(), r = 1; r < i; r++ ) t[r] = t[r - 1].add(n); return { wnd: e, points: t }; }), (c.prototype._getBeta = function () { return null; }), (c.prototype.dblp = function (e) { for (var t = this, i = 0; i < e; i++) t = t.dbl(); return t; }); }, 438800: function (e, t, i) { "use strict"; var n = i(252372), r = i(984826), a = i(32016), o = i(105634), s = n.assert; function l(e) { (this.twisted = (0 | e.a) != 1), (this.mOneA = this.twisted && (0 | e.a) == -1), (this.extended = this.mOneA), o.call(this, "edwards", e), (this.a = new r(e.a, 16).umod(this.red.m)), (this.a = this.a.toRed(this.red)), (this.c = new r(e.c, 16).toRed(this.red)), (this.c2 = this.c.redSqr()), (this.d = new r(e.d, 16).toRed(this.red)), (this.dd = this.d.redAdd(this.d)), s(!this.twisted || 0 === this.c.fromRed().cmpn(1)), (this.oneC = (0 | e.c) == 1); } function c(e, t, i, n, a) { o.BasePoint.call(this, e, "projective"), null === t && null === i && null === n ? ((this.x = this.curve.zero), (this.y = this.curve.one), (this.z = this.curve.one), (this.t = this.curve.zero), (this.zOne = !0)) : ((this.x = new r(t, 16)), (this.y = new r(i, 16)), (this.z = n ? new r(n, 16) : this.curve.one), (this.t = a && new r(a, 16)), !this.x.red && (this.x = this.x.toRed(this.curve.red)), !this.y.red && (this.y = this.y.toRed(this.curve.red)), !this.z.red && (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), (this.zOne = this.z === this.curve.one), this.curve.extended && !this.t && ((this.t = this.x.redMul(this.y)), !this.zOne && (this.t = this.t.redMul(this.z.redInvm())))); } a(l, o), (e.exports = l), (l.prototype._mulA = function (e) { return this.mOneA ? e.redNeg() : this.a.redMul(e); }), (l.prototype._mulC = function (e) { return this.oneC ? e : this.c.redMul(e); }), (l.prototype.jpoint = function (e, t, i, n) { return this.point(e, t, i, n); }), (l.prototype.pointFromX = function (e, t) { !(e = new r(e, 16)).red && (e = e.toRed(this.red)); var i = e.redSqr(), n = this.c2.redSub(this.a.redMul(i)), a = this.one.redSub(this.c2.redMul(this.d).redMul(i)), o = n.redMul(a.redInvm()), s = o.redSqrt(); if (0 !== s.redSqr().redSub(o).cmp(this.zero)) throw Error("invalid point"); var l = s.fromRed().isOdd(); return ((t && !l) || (!t && l)) && (s = s.redNeg()), this.point(e, s); }), (l.prototype.pointFromY = function (e, t) { !(e = new r(e, 16)).red && (e = e.toRed(this.red)); var i = e.redSqr(), n = i.redSub(this.c2), a = i.redMul(this.d).redMul(this.c2).redSub(this.a), o = n.redMul(a.redInvm()); if (0 === o.cmp(this.zero)) { if (!t) return this.point(this.zero, e); throw Error("invalid point"); } var s = o.redSqrt(); if (0 !== s.redSqr().redSub(o).cmp(this.zero)) throw Error("invalid point"); return ( s.fromRed().isOdd() !== t && (s = s.redNeg()), this.point(s, e) ); }), (l.prototype.validate = function (e) { if (e.isInfinity()) return !0; e.normalize(); var t = e.x.redSqr(), i = e.y.redSqr(), n = t.redMul(this.a).redAdd(i), r = this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i))); return 0 === n.cmp(r); }), a(c, o.BasePoint), (l.prototype.pointFromJSON = function (e) { return c.fromJSON(this, e); }), (l.prototype.point = function (e, t, i, n) { return new c(this, e, t, i, n); }), (c.fromJSON = function (e, t) { return new c(e, t[0], t[1], t[2]); }), (c.prototype.inspect = function () { return this.isInfinity() ? "" : ""; }), (c.prototype.isInfinity = function () { return ( 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || (this.zOne && 0 === this.y.cmp(this.curve.c))) ); }), (c.prototype._extDbl = function () { var e = this.x.redSqr(), t = this.y.redSqr(), i = this.z.redSqr(); i = i.redIAdd(i); var n = this.curve._mulA(e), r = this.x.redAdd(this.y).redSqr().redISub(e).redISub(t), a = n.redAdd(t), o = a.redSub(i), s = n.redSub(t), l = r.redMul(o), c = a.redMul(s), d = r.redMul(s), u = o.redMul(a); return this.curve.point(l, c, u, d); }), (c.prototype._projDbl = function () { var e, t, i, n, r, a, o = this.x.redAdd(this.y).redSqr(), s = this.x.redSqr(), l = this.y.redSqr(); if (this.curve.twisted) { var c = (n = this.curve._mulA(s)).redAdd(l); this.zOne ? ((e = o.redSub(s).redSub(l).redMul(c.redSub(this.curve.two))), (t = c.redMul(n.redSub(l))), (i = c.redSqr().redSub(c).redSub(c))) : ((r = this.z.redSqr()), (a = c.redSub(r).redISub(r)), (e = o.redSub(s).redISub(l).redMul(a)), (t = c.redMul(n.redSub(l))), (i = c.redMul(a))); } else (n = s.redAdd(l)), (r = this.curve._mulC(this.z).redSqr()), (a = n.redSub(r).redSub(r)), (e = this.curve._mulC(o.redISub(n)).redMul(a)), (t = this.curve._mulC(n).redMul(s.redISub(l))), (i = n.redMul(a)); return this.curve.point(e, t, i); }), (c.prototype.dbl = function () { return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl(); }), (c.prototype._extAdd = function (e) { var t = this.y.redSub(this.x).redMul(e.y.redSub(e.x)), i = this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)), n = this.t.redMul(this.curve.dd).redMul(e.t), r = this.z.redMul(e.z.redAdd(e.z)), a = i.redSub(t), o = r.redSub(n), s = r.redAdd(n), l = i.redAdd(t), c = a.redMul(o), d = s.redMul(l), u = a.redMul(l), f = o.redMul(s); return this.curve.point(c, d, f, u); }), (c.prototype._projAdd = function (e) { var t, i, n = this.z.redMul(e.z), r = n.redSqr(), a = this.x.redMul(e.x), o = this.y.redMul(e.y), s = this.curve.d.redMul(a).redMul(o), l = r.redSub(s), c = r.redAdd(s), d = this.x .redAdd(this.y) .redMul(e.x.redAdd(e.y)) .redISub(a) .redISub(o), u = n.redMul(l).redMul(d); return ( this.curve.twisted ? ((t = n.redMul(c).redMul(o.redSub(this.curve._mulA(a)))), (i = l.redMul(c))) : ((t = n.redMul(c).redMul(o.redSub(a))), (i = this.curve._mulC(l).redMul(c))), this.curve.point(u, t, i) ); }), (c.prototype.add = function (e) { return this.isInfinity() ? e : e.isInfinity() ? this : this.curve.extended ? this._extAdd(e) : this._projAdd(e); }), (c.prototype.mul = function (e) { return this._hasDoubles(e) ? this.curve._fixedNafMul(this, e) : this.curve._wnafMul(this, e); }), (c.prototype.mulAdd = function (e, t, i) { return this.curve._wnafMulAdd(1, [this, t], [e, i], 2, !1); }), (c.prototype.jmulAdd = function (e, t, i) { return this.curve._wnafMulAdd(1, [this, t], [e, i], 2, !0); }), (c.prototype.normalize = function () { if (this.zOne) return this; var e = this.z.redInvm(); return ( (this.x = this.x.redMul(e)), (this.y = this.y.redMul(e)), this.t && (this.t = this.t.redMul(e)), (this.z = this.curve.one), (this.zOne = !0), this ); }), (c.prototype.neg = function () { return this.curve.point( this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg() ); }), (c.prototype.getX = function () { return this.normalize(), this.x.fromRed(); }), (c.prototype.getY = function () { return this.normalize(), this.y.fromRed(); }), (c.prototype.eq = function (e) { return ( this === e || (0 === this.getX().cmp(e.getX()) && 0 === this.getY().cmp(e.getY())) ); }), (c.prototype.eqXToP = function (e) { var t = e.toRed(this.curve.red).redMul(this.z); if (0 === this.x.cmp(t)) return !0; for (var i = e.clone(), n = this.curve.redN.redMul(this.z); ; ) { if ((i.iadd(this.curve.n), i.cmp(this.curve.p) >= 0)) return !1; if ((t.redIAdd(n), 0 === this.x.cmp(t))) return !0; } }), (c.prototype.toP = c.prototype.normalize), (c.prototype.mixedAdd = c.prototype.add); }, 774784: function (e, t, i) { "use strict"; var n = t; (n.base = i(105634)), (n.short = i(777879)), (n.mont = i(604458)), (n.edwards = i(438800)); }, 604458: function (e, t, i) { "use strict"; var n = i(984826), r = i(32016), a = i(105634), o = i(252372); function s(e) { a.call(this, "mont", e), (this.a = new n(e.a, 16).toRed(this.red)), (this.b = new n(e.b, 16).toRed(this.red)), (this.i4 = new n(4).toRed(this.red).redInvm()), (this.two = new n(2).toRed(this.red)), (this.a24 = this.i4.redMul(this.a.redAdd(this.two))); } function l(e, t, i) { a.BasePoint.call(this, e, "projective"), null === t && null === i ? ((this.x = this.curve.one), (this.z = this.curve.zero)) : ((this.x = new n(t, 16)), (this.z = new n(i, 16)), !this.x.red && (this.x = this.x.toRed(this.curve.red)), !this.z.red && (this.z = this.z.toRed(this.curve.red))); } r(s, a), (e.exports = s), (s.prototype.validate = function (e) { var t = e.normalize().x, i = t.redSqr(), n = i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t); return 0 === n.redSqrt().redSqr().cmp(n); }), r(l, a.BasePoint), (s.prototype.decodePoint = function (e, t) { return this.point(o.toArray(e, t), 1); }), (s.prototype.point = function (e, t) { return new l(this, e, t); }), (s.prototype.pointFromJSON = function (e) { return l.fromJSON(this, e); }), (l.prototype.precompute = function () {}), (l.prototype._encode = function () { return this.getX().toArray("be", this.curve.p.byteLength()); }), (l.fromJSON = function (e, t) { return new l(e, t[0], t[1] || e.one); }), (l.prototype.inspect = function () { return this.isInfinity() ? "" : ""; }), (l.prototype.isInfinity = function () { return 0 === this.z.cmpn(0); }), (l.prototype.dbl = function () { var e = this.x.redAdd(this.z).redSqr(), t = this.x.redSub(this.z).redSqr(), i = e.redSub(t), n = e.redMul(t), r = i.redMul(t.redAdd(this.curve.a24.redMul(i))); return this.curve.point(n, r); }), (l.prototype.add = function () { throw Error("Not supported on Montgomery curve"); }), (l.prototype.diffAdd = function (e, t) { var i = this.x.redAdd(this.z), n = this.x.redSub(this.z), r = e.x.redAdd(e.z), a = e.x.redSub(e.z).redMul(i), o = r.redMul(n), s = t.z.redMul(a.redAdd(o).redSqr()), l = t.x.redMul(a.redISub(o).redSqr()); return this.curve.point(s, l); }), (l.prototype.mul = function (e) { for ( var t = e.clone(), i = this, n = this.curve.point(null, null), r = this, a = []; 0 !== t.cmpn(0); t.iushrn(1) ) a.push(t.andln(1)); for (var o = a.length - 1; o >= 0; o--) 0 === a[o] ? ((i = i.diffAdd(n, r)), (n = n.dbl())) : ((n = i.diffAdd(n, r)), (i = i.dbl())); return n; }), (l.prototype.mulAdd = function () { throw Error("Not supported on Montgomery curve"); }), (l.prototype.jumlAdd = function () { throw Error("Not supported on Montgomery curve"); }), (l.prototype.eq = function (e) { return 0 === this.getX().cmp(e.getX()); }), (l.prototype.normalize = function () { return ( (this.x = this.x.redMul(this.z.redInvm())), (this.z = this.curve.one), this ); }), (l.prototype.getX = function () { return this.normalize(), this.x.fromRed(); }); }, 777879: function (e, t, i) { "use strict"; var n = i(252372), r = i(984826), a = i(32016), o = i(105634), s = n.assert; function l(e) { o.call(this, "short", e), (this.a = new r(e.a, 16).toRed(this.red)), (this.b = new r(e.b, 16).toRed(this.red)), (this.tinv = this.two.redInvm()), (this.zeroA = 0 === this.a.fromRed().cmpn(0)), (this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3)), (this.endo = this._getEndomorphism(e)), (this._endoWnafT1 = [, , , ,]), (this._endoWnafT2 = [, , , ,]); } function c(e, t, i, n) { o.BasePoint.call(this, e, "affine"), null === t && null === i ? ((this.x = null), (this.y = null), (this.inf = !0)) : ((this.x = new r(t, 16)), (this.y = new r(i, 16)), n && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), !this.x.red && (this.x = this.x.toRed(this.curve.red)), !this.y.red && (this.y = this.y.toRed(this.curve.red)), (this.inf = !1)); } function d(e, t, i, n) { o.BasePoint.call(this, e, "jacobian"), null === t && null === i && null === n ? ((this.x = this.curve.one), (this.y = this.curve.one), (this.z = new r(0))) : ((this.x = new r(t, 16)), (this.y = new r(i, 16)), (this.z = new r(n, 16))), !this.x.red && (this.x = this.x.toRed(this.curve.red)), !this.y.red && (this.y = this.y.toRed(this.curve.red)), !this.z.red && (this.z = this.z.toRed(this.curve.red)), (this.zOne = this.z === this.curve.one); } a(l, o), (e.exports = l), (l.prototype._getEndomorphism = function (e) { if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { if (e.beta) t = new r(e.beta, 16).toRed(this.red); else { var t, i, n, a = this._getEndoRoots(this.p); t = (t = 0 > a[0].cmp(a[1]) ? a[0] : a[1]).toRed(this.red); } if (e.lambda) i = new r(e.lambda, 16); else { var o = this._getEndoRoots(this.n); 0 === this.g.mul(o[0]).x.cmp(this.g.x.redMul(t)) ? (i = o[0]) : ((i = o[1]), s(0 === this.g.mul(i).x.cmp(this.g.x.redMul(t)))); } return ( (n = e.basis ? e.basis.map(function (e) { return { a: new r(e.a, 16), b: new r(e.b, 16) }; }) : this._getEndoBasis(i)), { beta: t, lambda: i, basis: n } ); } }), (l.prototype._getEndoRoots = function (e) { var t = e === this.p ? this.red : r.mont(e), i = new r(2).toRed(t).redInvm(), n = i.redNeg(), a = new r(3).toRed(t).redNeg().redSqrt().redMul(i); return [n.redAdd(a).fromRed(), n.redSub(a).fromRed()]; }), (l.prototype._getEndoBasis = function (e) { for ( var t, i, n, a, o, s, l, c, d, u = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), f = e, h = this.n.clone(), p = new r(1), v = new r(0), m = new r(0), g = new r(1), _ = 0; 0 !== f.cmpn(0); ) { var y = h.div(f); (c = h.sub(y.mul(f))), (d = m.sub(y.mul(p))); var b = g.sub(y.mul(v)); if (!n && 0 > c.cmp(u)) (t = l.neg()), (i = p), (n = c.neg()), (a = d); else if (n && 2 == ++_) break; (l = c), (h = f), (f = c), (m = p), (p = d), (g = v), (v = b); } (o = c.neg()), (s = d); var I = n.sqr().add(a.sqr()); return ( o.sqr().add(s.sqr()).cmp(I) >= 0 && ((o = t), (s = i)), n.negative && ((n = n.neg()), (a = a.neg())), o.negative && ((o = o.neg()), (s = s.neg())), [ { a: n, b: a }, { a: o, b: s }, ] ); }), (l.prototype._endoSplit = function (e) { var t = this.endo.basis, i = t[0], n = t[1], r = n.b.mul(e).divRound(this.n), a = i.b.neg().mul(e).divRound(this.n), o = r.mul(i.a), s = a.mul(n.a), l = r.mul(i.b), c = a.mul(n.b); return { k1: e.sub(o).sub(s), k2: l.add(c).neg() }; }), (l.prototype.pointFromX = function (e, t) { !(e = new r(e, 16)).red && (e = e.toRed(this.red)); var i = e .redSqr() .redMul(e) .redIAdd(e.redMul(this.a)) .redIAdd(this.b), n = i.redSqrt(); if (0 !== n.redSqr().redSub(i).cmp(this.zero)) throw Error("invalid point"); var a = n.fromRed().isOdd(); return ((t && !a) || (!t && a)) && (n = n.redNeg()), this.point(e, n); }), (l.prototype.validate = function (e) { if (e.inf) return !0; var t = e.x, i = e.y, n = this.a.redMul(t), r = t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b); return 0 === i.redSqr().redISub(r).cmpn(0); }), (l.prototype._endoWnafMulAdd = function (e, t, i) { for ( var n = this._endoWnafT1, r = this._endoWnafT2, a = 0; a < e.length; a++ ) { var o = this._endoSplit(t[a]), s = e[a], l = s._getBeta(); o.k1.negative && (o.k1.ineg(), (s = s.neg(!0))), o.k2.negative && (o.k2.ineg(), (l = l.neg(!0))), (n[2 * a] = s), (n[2 * a + 1] = l), (r[2 * a] = o.k1), (r[2 * a + 1] = o.k2); } for ( var c = this._wnafMulAdd(1, n, r, 2 * a, i), d = 0; d < 2 * a; d++ ) (n[d] = null), (r[d] = null); return c; }), a(c, o.BasePoint), (l.prototype.point = function (e, t, i) { return new c(this, e, t, i); }), (l.prototype.pointFromJSON = function (e, t) { return c.fromJSON(this, e, t); }), (c.prototype._getBeta = function () { if (this.curve.endo) { var e = this.precomputed; if (e && e.beta) return e.beta; var t = this.curve.point( this.x.redMul(this.curve.endo.beta), this.y ); if (e) { var i = this.curve, n = function (e) { return i.point(e.x.redMul(i.endo.beta), e.y); }; (e.beta = t), (t.precomputed = { beta: null, naf: e.naf && { wnd: e.naf.wnd, points: e.naf.points.map(n) }, doubles: e.doubles && { step: e.doubles.step, points: e.doubles.points.map(n), }, }); } return t; } }), (c.prototype.toJSON = function () { return this.precomputed ? [ this.x, this.y, this.precomputed && { doubles: this.precomputed.doubles && { step: this.precomputed.doubles.step, points: this.precomputed.doubles.points.slice(1), }, naf: this.precomputed.naf && { wnd: this.precomputed.naf.wnd, points: this.precomputed.naf.points.slice(1), }, }, ] : [this.x, this.y]; }), (c.fromJSON = function (e, t, i) { "string" == typeof t && (t = JSON.parse(t)); var n = e.point(t[0], t[1], i); if (!t[2]) return n; function r(t) { return e.point(t[0], t[1], i); } var a = t[2]; return ( (n.precomputed = { beta: null, doubles: a.doubles && { step: a.doubles.step, points: [n].concat(a.doubles.points.map(r)), }, naf: a.naf && { wnd: a.naf.wnd, points: [n].concat(a.naf.points.map(r)), }, }), n ); }), (c.prototype.inspect = function () { return this.isInfinity() ? "" : ""; }), (c.prototype.isInfinity = function () { return this.inf; }), (c.prototype.add = function (e) { if (this.inf) return e; if (e.inf) return this; if (this.eq(e)) return this.dbl(); if (this.neg().eq(e) || 0 === this.x.cmp(e.x)) return this.curve.point(null, null); var t = this.y.redSub(e.y); 0 !== t.cmpn(0) && (t = t.redMul(this.x.redSub(e.x).redInvm())); var i = t.redSqr().redISub(this.x).redISub(e.x), n = t.redMul(this.x.redSub(i)).redISub(this.y); return this.curve.point(i, n); }), (c.prototype.dbl = function () { if (this.inf) return this; var e = this.y.redAdd(this.y); if (0 === e.cmpn(0)) return this.curve.point(null, null); var t = this.curve.a, i = this.x.redSqr(), n = e.redInvm(), r = i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n), a = r.redSqr().redISub(this.x.redAdd(this.x)), o = r.redMul(this.x.redSub(a)).redISub(this.y); return this.curve.point(a, o); }), (c.prototype.getX = function () { return this.x.fromRed(); }), (c.prototype.getY = function () { return this.y.fromRed(); }), (c.prototype.mul = function (e) { if (((e = new r(e, 16)), this.isInfinity())) return this; if (this._hasDoubles(e)) return this.curve._fixedNafMul(this, e); if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [e]); else return this.curve._wnafMul(this, e); }), (c.prototype.mulAdd = function (e, t, i) { var n = [this, t], r = [e, i]; return this.curve.endo ? this.curve._endoWnafMulAdd(n, r) : this.curve._wnafMulAdd(1, n, r, 2); }), (c.prototype.jmulAdd = function (e, t, i) { var n = [this, t], r = [e, i]; return this.curve.endo ? this.curve._endoWnafMulAdd(n, r, !0) : this.curve._wnafMulAdd(1, n, r, 2, !0); }), (c.prototype.eq = function (e) { return ( this === e || (this.inf === e.inf && (this.inf || (0 === this.x.cmp(e.x) && 0 === this.y.cmp(e.y)))) ); }), (c.prototype.neg = function (e) { if (this.inf) return this; var t = this.curve.point(this.x, this.y.redNeg()); if (e && this.precomputed) { var i = this.precomputed, n = function (e) { return e.neg(); }; t.precomputed = { naf: i.naf && { wnd: i.naf.wnd, points: i.naf.points.map(n) }, doubles: i.doubles && { step: i.doubles.step, points: i.doubles.points.map(n), }, }; } return t; }), (c.prototype.toJ = function () { return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); }), a(d, o.BasePoint), (l.prototype.jpoint = function (e, t, i) { return new d(this, e, t, i); }), (d.prototype.toP = function () { if (this.isInfinity()) return this.curve.point(null, null); var e = this.z.redInvm(), t = e.redSqr(), i = this.x.redMul(t), n = this.y.redMul(t).redMul(e); return this.curve.point(i, n); }), (d.prototype.neg = function () { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }), (d.prototype.add = function (e) { if (this.isInfinity()) return e; if (e.isInfinity()) return this; var t = e.z.redSqr(), i = this.z.redSqr(), n = this.x.redMul(t), r = e.x.redMul(i), a = this.y.redMul(t.redMul(e.z)), o = e.y.redMul(i.redMul(this.z)), s = n.redSub(r), l = a.redSub(o); if (0 === s.cmpn(0)) return 0 !== l.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var c = s.redSqr(), d = c.redMul(s), u = n.redMul(c), f = l.redSqr().redIAdd(d).redISub(u).redISub(u), h = l.redMul(u.redISub(f)).redISub(a.redMul(d)), p = this.z.redMul(e.z).redMul(s); return this.curve.jpoint(f, h, p); }), (d.prototype.mixedAdd = function (e) { if (this.isInfinity()) return e.toJ(); if (e.isInfinity()) return this; var t = this.z.redSqr(), i = this.x, n = e.x.redMul(t), r = this.y, a = e.y.redMul(t).redMul(this.z), o = i.redSub(n), s = r.redSub(a); if (0 === o.cmpn(0)) return 0 !== s.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var l = o.redSqr(), c = l.redMul(o), d = i.redMul(l), u = s.redSqr().redIAdd(c).redISub(d).redISub(d), f = s.redMul(d.redISub(u)).redISub(r.redMul(c)), h = this.z.redMul(o); return this.curve.jpoint(u, f, h); }), (d.prototype.dblp = function (e) { if (0 === e || this.isInfinity()) return this; if (!e) return this.dbl(); if (this.curve.zeroA || this.curve.threeA) { var t, i = this; for (t = 0; t < e; t++) i = i.dbl(); return i; } var n = this.curve.a, r = this.curve.tinv, a = this.x, o = this.y, s = this.z, l = s.redSqr().redSqr(), c = o.redAdd(o); for (t = 0; t < e; t++) { var d = a.redSqr(), u = c.redSqr(), f = u.redSqr(), h = d.redAdd(d).redIAdd(d).redIAdd(n.redMul(l)), p = a.redMul(u), v = h.redSqr().redISub(p.redAdd(p)), m = p.redISub(v), g = h.redMul(m); g = g.redIAdd(g).redISub(f); var _ = c.redMul(s); t + 1 < e && (l = l.redMul(f)), (a = v), (s = _), (c = g); } return this.curve.jpoint(a, c.redMul(r), s); }), (d.prototype.dbl = function () { return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); }), (d.prototype._zeroDbl = function () { if (this.zOne) { var e, t, i, n = this.x.redSqr(), r = this.y.redSqr(), a = r.redSqr(), o = this.x.redAdd(r).redSqr().redISub(n).redISub(a); o = o.redIAdd(o); var s = n.redAdd(n).redIAdd(n), l = s.redSqr().redISub(o).redISub(o), c = a.redIAdd(a); (c = (c = c.redIAdd(c)).redIAdd(c)), (e = l), (t = s.redMul(o.redISub(l)).redISub(c)), (i = this.y.redAdd(this.y)); } else { var d = this.x.redSqr(), u = this.y.redSqr(), f = u.redSqr(), h = this.x.redAdd(u).redSqr().redISub(d).redISub(f); h = h.redIAdd(h); var p = d.redAdd(d).redIAdd(d), v = p.redSqr(), m = f.redIAdd(f); (m = (m = m.redIAdd(m)).redIAdd(m)), (e = v.redISub(h).redISub(h)), (t = p.redMul(h.redISub(e)).redISub(m)), (i = (i = this.y.redMul(this.z)).redIAdd(i)); } return this.curve.jpoint(e, t, i); }), (d.prototype._threeDbl = function () { if (this.zOne) { var e, t, i, n = this.x.redSqr(), r = this.y.redSqr(), a = r.redSqr(), o = this.x.redAdd(r).redSqr().redISub(n).redISub(a); o = o.redIAdd(o); var s = n.redAdd(n).redIAdd(n).redIAdd(this.curve.a), l = s.redSqr().redISub(o).redISub(o); e = l; var c = a.redIAdd(a); (c = (c = c.redIAdd(c)).redIAdd(c)), (t = s.redMul(o.redISub(l)).redISub(c)), (i = this.y.redAdd(this.y)); } else { var d = this.z.redSqr(), u = this.y.redSqr(), f = this.x.redMul(u), h = this.x.redSub(d).redMul(this.x.redAdd(d)); h = h.redAdd(h).redIAdd(h); var p = f.redIAdd(f), v = (p = p.redIAdd(p)).redAdd(p); (e = h.redSqr().redISub(v)), (i = this.y.redAdd(this.z).redSqr().redISub(u).redISub(d)); var m = u.redSqr(); (m = (m = (m = m.redIAdd(m)).redIAdd(m)).redIAdd(m)), (t = h.redMul(p.redISub(e)).redISub(m)); } return this.curve.jpoint(e, t, i); }), (d.prototype._dbl = function () { var e = this.curve.a, t = this.x, i = this.y, n = this.z, r = n.redSqr().redSqr(), a = t.redSqr(), o = i.redSqr(), s = a.redAdd(a).redIAdd(a).redIAdd(e.redMul(r)), l = t.redAdd(t), c = (l = l.redIAdd(l)).redMul(o), d = s.redSqr().redISub(c.redAdd(c)), u = c.redISub(d), f = o.redSqr(); f = (f = (f = f.redIAdd(f)).redIAdd(f)).redIAdd(f); var h = s.redMul(u).redISub(f), p = i.redAdd(i).redMul(n); return this.curve.jpoint(d, h, p); }), (d.prototype.trpl = function () { if (!this.curve.zeroA) return this.dbl().add(this); var e = this.x.redSqr(), t = this.y.redSqr(), i = this.z.redSqr(), n = t.redSqr(), r = e.redAdd(e).redIAdd(e), a = r.redSqr(), o = this.x.redAdd(t).redSqr().redISub(e).redISub(n), s = (o = (o = (o = o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub( a )).redSqr(), l = n.redIAdd(n); l = (l = (l = l.redIAdd(l)).redIAdd(l)).redIAdd(l); var c = r.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(l), d = t.redMul(c); d = (d = d.redIAdd(d)).redIAdd(d); var u = this.x.redMul(s).redISub(d); u = (u = u.redIAdd(u)).redIAdd(u); var f = this.y.redMul(c.redMul(l.redISub(c)).redISub(o.redMul(s))); f = (f = (f = f.redIAdd(f)).redIAdd(f)).redIAdd(f); var h = this.z.redAdd(o).redSqr().redISub(i).redISub(s); return this.curve.jpoint(u, f, h); }), (d.prototype.mul = function (e, t) { return (e = new r(e, t)), this.curve._wnafMul(this, e); }), (d.prototype.eq = function (e) { if ("affine" === e.type) return this.eq(e.toJ()); if (this === e) return !0; var t = this.z.redSqr(), i = e.z.redSqr(); if (0 !== this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0)) return !1; var n = t.redMul(this.z), r = i.redMul(e.z); return 0 === this.y.redMul(r).redISub(e.y.redMul(n)).cmpn(0); }), (d.prototype.eqXToP = function (e) { var t = this.z.redSqr(), i = e.toRed(this.curve.red).redMul(t); if (0 === this.x.cmp(i)) return !0; for (var n = e.clone(), r = this.curve.redN.redMul(t); ; ) { if ((n.iadd(this.curve.n), n.cmp(this.curve.p) >= 0)) return !1; if ((i.redIAdd(r), 0 === this.x.cmp(i))) return !0; } }), (d.prototype.inspect = function () { return this.isInfinity() ? "" : ""; }), (d.prototype.isInfinity = function () { return 0 === this.z.cmpn(0); }); }, 244043: function (e, t, i) { "use strict"; var n, r = t, a = i(917474), o = i(774784), s = i(252372).assert; function l(e) { "short" === e.type ? (this.curve = new o.short(e)) : "edwards" === e.type ? (this.curve = new o.edwards(e)) : (this.curve = new o.mont(e)), (this.g = this.curve.g), (this.n = this.curve.n), (this.hash = e.hash), s(this.g.validate(), "Invalid curve"), s(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); } function c(e, t) { Object.defineProperty(r, e, { configurable: !0, enumerable: !0, get: function () { var i = new l(t); return ( Object.defineProperty(r, e, { configurable: !0, enumerable: !0, value: i, }), i ); }, }); } (r.PresetCurve = l), c("p192", { type: "short", prime: "p192", p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", hash: a.sha256, gRed: !1, g: [ "188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811", ], }), c("p224", { type: "short", prime: "p224", p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", hash: a.sha256, gRed: !1, g: [ "b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34", ], }), c("p256", { type: "short", prime: null, p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", hash: a.sha256, gRed: !1, g: [ "6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5", ], }), c("p384", { type: "short", prime: null, p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", hash: a.sha384, gRed: !1, g: [ "aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f", ], }), c("p521", { type: "short", prime: null, p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", hash: a.sha512, gRed: !1, g: [ "000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650", ], }), c("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: a.sha256, gRed: !1, g: ["9"], }), c("ed25519", { type: "edwards", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "-1", c: "1", d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: a.sha256, gRed: !1, g: [ "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658", ], }); try { n = i(830948); } catch (e) { n = void 0; } c("secp256k1", { type: "short", prime: "k256", p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", a: "0", b: "7", n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", h: "1", hash: a.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [ { a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3", }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15", }, ], gRed: !1, g: [ "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", n, ], }); }, 983272: function (e, t, i) { "use strict"; var n = i(984826), r = i(458436), a = i(252372), o = i(244043), s = i(462810), l = a.assert, c = i(679289), d = i(35971); function u(e) { if (!(this instanceof u)) return new u(e); "string" == typeof e && (l(Object.prototype.hasOwnProperty.call(o, e), "Unknown curve " + e), (e = o[e])), e instanceof o.PresetCurve && (e = { curve: e }), (this.curve = e.curve.curve), (this.n = this.curve.n), (this.nh = this.n.ushrn(1)), (this.g = this.curve.g), (this.g = e.curve.g), this.g.precompute(e.curve.n.bitLength() + 1), (this.hash = e.hash || e.curve.hash); } (e.exports = u), (u.prototype.keyPair = function (e) { return new c(this, e); }), (u.prototype.keyFromPrivate = function (e, t) { return c.fromPrivate(this, e, t); }), (u.prototype.keyFromPublic = function (e, t) { return c.fromPublic(this, e, t); }), (u.prototype.genKeyPair = function (e) { !e && (e = {}); for ( var t = new r({ hash: this.hash, pers: e.pers, persEnc: e.persEnc || "utf8", entropy: e.entropy || s(this.hash.hmacStrength), entropyEnc: (e.entropy && e.entropyEnc) || "utf8", nonce: this.n.toArray(), }), i = this.n.byteLength(), a = this.n.sub(new n(2)); ; ) { var o = new n(t.generate(i)); if (!(o.cmp(a) > 0)) return o.iaddn(1), this.keyFromPrivate(o); } }), (u.prototype._truncateToN = function (e, t) { var i = 8 * e.byteLength() - this.n.bitLength(); return (i > 0 && (e = e.ushrn(i)), !t && e.cmp(this.n) >= 0) ? e.sub(this.n) : e; }), (u.prototype.sign = function (e, t, i, a) { "object" == typeof i && ((a = i), (i = null)), !a && (a = {}), (t = this.keyFromPrivate(t, i)), (e = this._truncateToN(new n(e, 16))); for ( var o = this.n.byteLength(), s = t.getPrivate().toArray("be", o), l = e.toArray("be", o), c = new r({ hash: this.hash, entropy: s, nonce: l, pers: a.pers, persEnc: a.persEnc || "utf8", }), u = this.n.sub(new n(1)), f = 0; ; f++ ) { var h = a.k ? a.k(f) : new n(c.generate(this.n.byteLength())); if (0 >= (h = this._truncateToN(h, !0)).cmpn(1) || h.cmp(u) >= 0) continue; var p = this.g.mul(h); if (p.isInfinity()) continue; var v = p.getX(), m = v.umod(this.n); if (0 !== m.cmpn(0)) { var g = h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e)); if (0 !== (g = g.umod(this.n)).cmpn(0)) { var _ = (p.getY().isOdd() ? 1 : 0) | (0 !== v.cmp(m) ? 2 : 0); return ( a.canonical && g.cmp(this.nh) > 0 && ((g = this.n.sub(g)), (_ ^= 1)), new d({ r: m, s: g, recoveryParam: _ }) ); } } } }), (u.prototype.verify = function (e, t, i, r) { (e = this._truncateToN(new n(e, 16))), (i = this.keyFromPublic(i, r)); var a, o = (t = new d(t, "hex")).r, s = t.s; if ( 0 > o.cmpn(1) || o.cmp(this.n) >= 0 || 0 > s.cmpn(1) || s.cmp(this.n) >= 0 ) return !1; var l = s.invm(this.n), c = l.mul(e).umod(this.n), u = l.mul(o).umod(this.n); if (!this.curve._maxwellTrick) return ( !(a = this.g.mulAdd(c, i.getPublic(), u)).isInfinity() && 0 === a.getX().umod(this.n).cmp(o) ); return ( !(a = this.g.jmulAdd(c, i.getPublic(), u)).isInfinity() && a.eqXToP(o) ); }), (u.prototype.recoverPubKey = function (e, t, i, r) { l((3 & i) === i, "The recovery param is more than two bits"), (t = new d(t, r)); var a = this.n, o = new n(e), s = t.r, c = t.s, u = 1 & i, f = i >> 1; if (s.cmp(this.curve.p.umod(this.curve.n)) >= 0 && f) throw Error("Unable to find sencond key candinate"); s = f ? this.curve.pointFromX(s.add(this.curve.n), u) : this.curve.pointFromX(s, u); var h = t.r.invm(a), p = a.sub(o).mul(h).umod(a), v = c.mul(h).umod(a); return this.g.mulAdd(p, s, v); }), (u.prototype.getKeyRecoveryParam = function (e, t, i, n) { if (null !== (t = new d(t, n)).recoveryParam) return t.recoveryParam; for (var r, a = 0; a < 4; a++) { try { r = this.recoverPubKey(e, t, a); } catch (e) { continue; } if (r.eq(i)) return a; } throw Error("Unable to find valid recovery factor"); }); }, 679289: function (e, t, i) { "use strict"; var n = i(984826), r = i(252372).assert; function a(e, t) { (this.ec = e), (this.priv = null), (this.pub = null), t.priv && this._importPrivate(t.priv, t.privEnc), t.pub && this._importPublic(t.pub, t.pubEnc); } (e.exports = a), (a.fromPublic = function (e, t, i) { return t instanceof a ? t : new a(e, { pub: t, pubEnc: i }); }), (a.fromPrivate = function (e, t, i) { return t instanceof a ? t : new a(e, { priv: t, privEnc: i }); }), (a.prototype.validate = function () { var e = this.getPublic(); return e.isInfinity() ? { result: !1, reason: "Invalid public key" } : e.validate() ? e.mul(this.ec.curve.n).isInfinity() ? { result: !0, reason: null } : { result: !1, reason: "Public key * N != O" } : { result: !1, reason: "Public key is not a point" }; }), (a.prototype.getPublic = function (e, t) { return ("string" == typeof e && ((t = e), (e = null)), !this.pub && (this.pub = this.ec.g.mul(this.priv)), t) ? this.pub.encode(t, e) : this.pub; }), (a.prototype.getPrivate = function (e) { return "hex" === e ? this.priv.toString(16, 2) : this.priv; }), (a.prototype._importPrivate = function (e, t) { (this.priv = new n(e, t || 16)), (this.priv = this.priv.umod(this.ec.curve.n)); }), (a.prototype._importPublic = function (e, t) { if (e.x || e.y) { "mont" === this.ec.curve.type ? r(e.x, "Need x coordinate") : ("short" === this.ec.curve.type || "edwards" === this.ec.curve.type) && r(e.x && e.y, "Need both x and y coordinate"), (this.pub = this.ec.curve.point(e.x, e.y)); return; } this.pub = this.ec.curve.decodePoint(e, t); }), (a.prototype.derive = function (e) { return ( !e.validate() && r(e.validate(), "public point not validated"), e.mul(this.priv).getX() ); }), (a.prototype.sign = function (e, t, i) { return this.ec.sign(e, this, t, i); }), (a.prototype.verify = function (e, t) { return this.ec.verify(e, t, this); }), (a.prototype.inspect = function () { return ( "" ); }); }, 35971: function (e, t, i) { "use strict"; var n = i(984826), r = i(252372), a = r.assert; function o(e, t) { if (e instanceof o) return e; !this._importDER(e, t) && (a(e.r && e.s, "Signature without r or s"), (this.r = new n(e.r, 16)), (this.s = new n(e.s, 16)), void 0 === e.recoveryParam ? (this.recoveryParam = null) : (this.recoveryParam = e.recoveryParam)); } function s() { this.place = 0; } function l(e, t) { var i = e[t.place++]; if (!(128 & i)) return i; var n = 15 & i; if (0 === n || n > 4) return !1; for (var r = 0, a = 0, o = t.place; a < n; a++, o++) (r <<= 8), (r |= e[o]), (r >>>= 0); return !(r <= 127) && ((t.place = o), r); } function c(e) { for (var t = 0, i = e.length - 1; !e[t] && !(128 & e[t + 1]) && t < i; ) t++; return 0 === t ? e : e.slice(t); } function d(e, t) { if (t < 128) { e.push(t); return; } var i = 1 + ((Math.log(t) / Math.LN2) >>> 3); for (e.push(128 | i); --i; ) e.push((t >>> (i << 3)) & 255); e.push(t); } (e.exports = o), (o.prototype._importDER = function (e, t) { e = r.toArray(e, t); var i = new s(); if (48 !== e[i.place++]) return !1; var a = l(e, i); if (!1 === a || a + i.place !== e.length || 2 !== e[i.place++]) return !1; var o = l(e, i); if (!1 === o) return !1; var c = e.slice(i.place, o + i.place); if (((i.place += o), 2 !== e[i.place++])) return !1; var d = l(e, i); if (!1 === d || e.length !== d + i.place) return !1; var u = e.slice(i.place, d + i.place); if (0 === c[0]) { if (!(128 & c[1])) return !1; c = c.slice(1); } if (0 === u[0]) { if (!(128 & u[1])) return !1; u = u.slice(1); } return ( (this.r = new n(c)), (this.s = new n(u)), (this.recoveryParam = null), !0 ); }), (o.prototype.toDER = function (e) { var t = this.r.toArray(), i = this.s.toArray(); for ( 128 & t[0] && (t = [0].concat(t)), 128 & i[0] && (i = [0].concat(i)), t = c(t), i = c(i); !i[0] && !(128 & i[1]); ) i = i.slice(1); var n = [2]; d(n, t.length), (n = n.concat(t)).push(2), d(n, i.length); var a = n.concat(i), o = [48]; return d(o, a.length), (o = o.concat(a)), r.encode(o, e); }); }, 180800: function (e, t, i) { "use strict"; var n = i(917474), r = i(244043), a = i(252372), o = a.assert, s = a.parseBytes, l = i(151010), c = i(976501); function d(e) { if ( (o("ed25519" === e, "only tested with ed25519 so far"), !(this instanceof d)) ) return new d(e); (e = r[e].curve), (this.curve = e), (this.g = e.g), this.g.precompute(e.n.bitLength() + 1), (this.pointClass = e.point().constructor), (this.encodingLength = Math.ceil(e.n.bitLength() / 8)), (this.hash = n.sha512); } (e.exports = d), (d.prototype.sign = function (e, t) { e = s(e); var i = this.keyFromSecret(t), n = this.hashInt(i.messagePrefix(), e), r = this.g.mul(n), a = this.encodePoint(r), o = this.hashInt(a, i.pubBytes(), e).mul(i.priv()), l = n.add(o).umod(this.curve.n); return this.makeSignature({ R: r, S: l, Rencoded: a }); }), (d.prototype.verify = function (e, t, i) { (e = s(e)), (t = this.makeSignature(t)); var n = this.keyFromPublic(i), r = this.hashInt(t.Rencoded(), n.pubBytes(), e), a = this.g.mul(t.S()); return t.R().add(n.pub().mul(r)).eq(a); }), (d.prototype.hashInt = function () { for (var e = this.hash(), t = 0; t < arguments.length; t++) e.update(arguments[t]); return a.intFromLE(e.digest()).umod(this.curve.n); }), (d.prototype.keyFromPublic = function (e) { return l.fromPublic(this, e); }), (d.prototype.keyFromSecret = function (e) { return l.fromSecret(this, e); }), (d.prototype.makeSignature = function (e) { return e instanceof c ? e : new c(this, e); }), (d.prototype.encodePoint = function (e) { var t = e.getY().toArray("le", this.encodingLength); return (t[this.encodingLength - 1] |= e.getX().isOdd() ? 128 : 0), t; }), (d.prototype.decodePoint = function (e) { var t = (e = a.parseBytes(e)).length - 1, i = e.slice(0, t).concat(-129 & e[t]), n = (128 & e[t]) != 0, r = a.intFromLE(i); return this.curve.pointFromY(r, n); }), (d.prototype.encodeInt = function (e) { return e.toArray("le", this.encodingLength); }), (d.prototype.decodeInt = function (e) { return a.intFromLE(e); }), (d.prototype.isPoint = function (e) { return e instanceof this.pointClass; }); }, 151010: function (e, t, i) { "use strict"; var n = i(252372), r = n.assert, a = n.parseBytes, o = n.cachedProperty; function s(e, t) { (this.eddsa = e), (this._secret = a(t.secret)), e.isPoint(t.pub) ? (this._pub = t.pub) : (this._pubBytes = a(t.pub)); } (s.fromPublic = function (e, t) { return t instanceof s ? t : new s(e, { pub: t }); }), (s.fromSecret = function (e, t) { return t instanceof s ? t : new s(e, { secret: t }); }), (s.prototype.secret = function () { return this._secret; }), o(s, "pubBytes", function () { return this.eddsa.encodePoint(this.pub()); }), o(s, "pub", function () { return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv()); }), o(s, "privBytes", function () { var e = this.eddsa, t = this.hash(), i = e.encodingLength - 1, n = t.slice(0, e.encodingLength); return (n[0] &= 248), (n[i] &= 127), (n[i] |= 64), n; }), o(s, "priv", function () { return this.eddsa.decodeInt(this.privBytes()); }), o(s, "hash", function () { return this.eddsa.hash().update(this.secret()).digest(); }), o(s, "messagePrefix", function () { return this.hash().slice(this.eddsa.encodingLength); }), (s.prototype.sign = function (e) { return ( r(this._secret, "KeyPair can only verify"), this.eddsa.sign(e, this) ); }), (s.prototype.verify = function (e, t) { return this.eddsa.verify(e, t, this); }), (s.prototype.getSecret = function (e) { return ( r(this._secret, "KeyPair is public only"), n.encode(this.secret(), e) ); }), (s.prototype.getPublic = function (e) { return n.encode(this.pubBytes(), e); }), (e.exports = s); }, 976501: function (e, t, i) { "use strict"; var n = i(984826), r = i(252372), a = r.assert, o = r.cachedProperty, s = r.parseBytes; function l(e, t) { (this.eddsa = e), "object" != typeof t && (t = s(t)), Array.isArray(t) && (t = { R: t.slice(0, e.encodingLength), S: t.slice(e.encodingLength), }), a(t.R && t.S, "Signature without R or S"), e.isPoint(t.R) && (this._R = t.R), t.S instanceof n && (this._S = t.S), (this._Rencoded = Array.isArray(t.R) ? t.R : t.Rencoded), (this._Sencoded = Array.isArray(t.S) ? t.S : t.Sencoded); } o(l, "S", function () { return this.eddsa.decodeInt(this.Sencoded()); }), o(l, "R", function () { return this.eddsa.decodePoint(this.Rencoded()); }), o(l, "Rencoded", function () { return this.eddsa.encodePoint(this.R()); }), o(l, "Sencoded", function () { return this.eddsa.encodeInt(this.S()); }), (l.prototype.toBytes = function () { return this.Rencoded().concat(this.Sencoded()); }), (l.prototype.toHex = function () { return r.encode(this.toBytes(), "hex").toUpperCase(); }), (e.exports = l); }, 830948: function (e) { e.exports = { doubles: { step: 4, points: [ [ "e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821", ], [ "8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf", ], [ "175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695", ], [ "363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9", ], [ "8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36", ], [ "723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f", ], [ "eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999", ], [ "100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09", ], [ "e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d", ], [ "feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088", ], [ "da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d", ], [ "53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8", ], [ "8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a", ], [ "385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453", ], [ "6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160", ], [ "3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0", ], [ "85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6", ], [ "948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589", ], [ "6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17", ], [ "e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda", ], [ "e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd", ], [ "213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2", ], [ "4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6", ], [ "fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f", ], [ "76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01", ], [ "c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3", ], [ "d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f", ], [ "b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7", ], [ "e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78", ], [ "a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1", ], [ "90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150", ], [ "8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82", ], [ "e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc", ], [ "8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b", ], [ "e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51", ], [ "b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45", ], [ "d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120", ], [ "324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84", ], [ "4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d", ], [ "9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d", ], [ "6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8", ], [ "a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8", ], [ "7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac", ], [ "928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f", ], [ "85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962", ], [ "ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907", ], [ "827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec", ], [ "eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d", ], [ "e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414", ], [ "1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd", ], [ "146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0", ], [ "fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811", ], [ "da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1", ], [ "a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c", ], [ "174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73", ], [ "959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd", ], [ "d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405", ], [ "64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589", ], [ "8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e", ], [ "13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27", ], [ "bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1", ], [ "8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482", ], [ "8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945", ], [ "dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573", ], [ "f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82", ], ], }, naf: { wnd: 7, points: [ [ "f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672", ], [ "2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6", ], [ "5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da", ], [ "acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37", ], [ "774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b", ], [ "f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81", ], [ "d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58", ], [ "defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77", ], [ "2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a", ], [ "352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c", ], [ "2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67", ], [ "9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402", ], [ "daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55", ], [ "c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482", ], [ "6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82", ], [ "1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396", ], [ "605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49", ], [ "62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf", ], [ "80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a", ], [ "7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7", ], [ "d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933", ], [ "49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a", ], [ "77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6", ], [ "f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37", ], [ "463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e", ], [ "f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6", ], [ "caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476", ], [ "2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40", ], [ "7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61", ], [ "754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683", ], [ "e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5", ], [ "186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b", ], [ "df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417", ], [ "5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868", ], [ "290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a", ], [ "af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6", ], [ "766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996", ], [ "59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e", ], [ "f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d", ], [ "7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2", ], [ "948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e", ], [ "7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437", ], [ "3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311", ], [ "d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4", ], [ "1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575", ], [ "733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d", ], [ "15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d", ], [ "a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629", ], [ "e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06", ], [ "311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374", ], [ "34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee", ], [ "f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1", ], [ "d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b", ], [ "32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661", ], [ "7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6", ], [ "ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e", ], [ "16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d", ], [ "eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc", ], [ "78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4", ], [ "494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c", ], [ "a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b", ], [ "c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913", ], [ "841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154", ], [ "5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865", ], [ "36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc", ], [ "336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224", ], [ "8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e", ], [ "1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6", ], [ "85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511", ], [ "29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b", ], [ "a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2", ], [ "4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c", ], [ "d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3", ], [ "ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d", ], [ "af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700", ], [ "e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4", ], [ "591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196", ], [ "11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4", ], [ "3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257", ], [ "cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13", ], [ "c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096", ], [ "c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38", ], [ "a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f", ], [ "347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448", ], [ "da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a", ], [ "c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4", ], [ "4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437", ], [ "3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7", ], [ "cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d", ], [ "b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a", ], [ "d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54", ], [ "48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77", ], [ "dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517", ], [ "6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10", ], [ "e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125", ], [ "eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e", ], [ "13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1", ], [ "ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2", ], [ "b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423", ], [ "ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8", ], [ "8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758", ], [ "52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375", ], [ "e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d", ], [ "7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec", ], [ "5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0", ], [ "32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c", ], [ "e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4", ], [ "8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f", ], [ "4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649", ], [ "3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826", ], [ "674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5", ], [ "d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87", ], [ "30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b", ], [ "be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc", ], [ "93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c", ], [ "b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f", ], [ "d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a", ], [ "d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46", ], [ "463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f", ], [ "7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03", ], [ "74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08", ], [ "30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8", ], [ "9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373", ], [ "176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3", ], [ "75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8", ], [ "809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1", ], [ "1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9", ], ], }, }; }, 252372: function (e, t, i) { "use strict"; var n = t, r = i(984826), a = i(422555), o = i(354845); function s(e, t, i) { var n = Array(Math.max(e.bitLength(), i) + 1); for (o = 0; o < n.length; o += 1) n[o] = 0; var r = 1 << (t + 1), a = e.clone(); for (o = 0; o < n.length; o++) { var o, s, l = a.andln(r - 1); a.isOdd() ? ((s = l > (r >> 1) - 1 ? (r >> 1) - l : l), a.isubn(s)) : (s = 0), (n[o] = s), a.iushrn(1); } return n; } function l(e, t) { var i = [[], []]; (e = e.clone()), (t = t.clone()); for (var n = 0, r = 0; e.cmpn(-n) > 0 || t.cmpn(-r) > 0; ) { var a, o, s, l = (e.andln(3) + n) & 3, c = (t.andln(3) + r) & 3; 3 === l && (l = -1), 3 === c && (c = -1), (o = (1 & l) == 0 ? 0 : (3 == (a = (e.andln(7) + n) & 7) || 5 === a) && 2 === c ? -l : l), i[0].push(o), (s = (1 & c) == 0 ? 0 : (3 == (a = (t.andln(7) + r) & 7) || 5 === a) && 2 === l ? -c : c), i[1].push(s), 2 * n === o + 1 && (n = 1 - n), 2 * r === s + 1 && (r = 1 - r), e.iushrn(1), t.iushrn(1); } return i; } function c(e, t, i) { var n = "_" + t; e.prototype[t] = function () { return void 0 !== this[n] ? this[n] : (this[n] = i.call(this)); }; } function d(e) { return "string" == typeof e ? n.toArray(e, "hex") : e; } function u(e) { return new r(e, "hex", "le"); } (n.assert = a), (n.toArray = o.toArray), (n.zero2 = o.zero2), (n.toHex = o.toHex), (n.encode = o.encode), (n.getNAF = s), (n.getJSF = l), (n.cachedProperty = c), (n.parseBytes = d), (n.intFromLE = u); }, 122582: function (e) { function t() { (this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0); } function i(e) { return "function" == typeof e; } function n(e) { return "number" == typeof e; } function r(e) { return "object" == typeof e && null !== e; } function a(e) { return void 0 === e; } (e.exports = t), (t.EventEmitter = t), (t.prototype._events = void 0), (t.prototype._maxListeners = void 0), (t.defaultMaxListeners = 10), (t.prototype.setMaxListeners = function (e) { if (!n(e) || e < 0 || isNaN(e)) throw TypeError("n must be a positive number"); return (this._maxListeners = e), this; }), (t.prototype.emit = function (e) { var t, n, o, s, l, c; if ( (!this._events && (this._events = {}), "error" === e && (!this._events.error || (r(this._events.error) && !this._events.error.length))) ) { if (((t = arguments[1]), t instanceof Error)) throw t; var d = Error('Uncaught, unspecified "error" event. (' + t + ")"); throw ((d.context = t), d); } if (a((n = this._events[e]))) return !1; if (i(n)) switch (arguments.length) { case 1: n.call(this); break; case 2: n.call(this, arguments[1]); break; case 3: n.call(this, arguments[1], arguments[2]); break; default: (s = Array.prototype.slice.call(arguments, 1)), n.apply(this, s); } else if (r(n)) for ( l = 0, s = Array.prototype.slice.call(arguments, 1), o = (c = n.slice()).length; l < o; l++ ) c[l].apply(this, s); return !0; }), (t.prototype.addListener = function (e, n) { var o; if (!i(n)) throw TypeError("listener must be a function"); return ( !this._events && (this._events = {}), this._events.newListener && this.emit("newListener", e, i(n.listener) ? n.listener : n), this._events[e] ? r(this._events[e]) ? this._events[e].push(n) : (this._events[e] = [this._events[e], n]) : (this._events[e] = n), r(this._events[e]) && !this._events[e].warned && (o = a(this._maxListeners) ? t.defaultMaxListeners : this._maxListeners) && o > 0 && this._events[e].length > o && ((this._events[e].warned = !0), console.error( "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length ), "function" == typeof console.trace && console.trace()), this ); }), (t.prototype.on = t.prototype.addListener), (t.prototype.once = function (e, t) { if (!i(t)) throw TypeError("listener must be a function"); var n = !1; function r() { this.removeListener(e, r), !n && ((n = !0), t.apply(this, arguments)); } return (r.listener = t), this.on(e, r), this; }), (t.prototype.removeListener = function (e, t) { var n, a, o, s; if (!i(t)) throw TypeError("listener must be a function"); if (!this._events || !this._events[e]) return this; if ( ((o = (n = this._events[e]).length), (a = -1), n === t || (i(n.listener) && n.listener === t)) ) delete this._events[e], this._events.removeListener && this.emit("removeListener", e, t); else if (r(n)) { for (s = o; s-- > 0; ) if (n[s] === t || (n[s].listener && n[s].listener === t)) { a = s; break; } if (a < 0) return this; 1 === n.length ? ((n.length = 0), delete this._events[e]) : n.splice(a, 1), this._events.removeListener && this.emit("removeListener", e, t); } return this; }), (t.prototype.removeAllListeners = function (e) { var t, n; if (!this._events) return this; if (!this._events.removeListener) return ( 0 == arguments.length ? (this._events = {}) : this._events[e] && delete this._events[e], this ); if (0 == arguments.length) { for (t in this._events) "removeListener" !== t && this.removeAllListeners(t); return ( this.removeAllListeners("removeListener"), (this._events = {}), this ); } if (i((n = this._events[e]))) this.removeListener(e, n); else if (n) for (; n.length; ) this.removeListener(e, n[n.length - 1]); return delete this._events[e], this; }), (t.prototype.listeners = function (e) { var t; return (t = this._events && this._events[e] ? i(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []); }), (t.prototype.listenerCount = function (e) { if (this._events) { var t = this._events[e]; if (i(t)) return 1; if (t) return t.length; } return 0; }), (t.listenerCount = function (e, t) { return e.listenerCount(t); }); }, 948881: function (e, t, i) { var n = i(140860).Buffer, r = i(317511); function a(e, t, i, a) { if ( (!n.isBuffer(e) && (e = n.from(e, "binary")), t && (!n.isBuffer(t) && (t = n.from(t, "binary")), 8 !== t.length)) ) throw RangeError("salt should be Buffer with 8 byte length"); for ( var o = i / 8, s = n.alloc(o), l = n.alloc(a || 0), c = n.alloc(0); o > 0 || a > 0; ) { var d = new r(); d.update(c), d.update(e), t && d.update(t), (c = d.digest()); var u = 0; if (o > 0) { var f = s.length - o; (u = Math.min(o, c.length)), c.copy(s, f, 0, u), (o -= u); } if (u < c.length && a > 0) { var h = l.length - a, p = Math.min(a, c.length - u); c.copy(l, h, u, u + p), (a -= p); } } return c.fill(0), { key: s, iv: l }; } e.exports = a; }, 277514: function (e, t, i) { "use strict"; var n = i(140860).Buffer, r = i(235521).Transform; function a(e, t) { if (!n.isBuffer(e) && "string" != typeof e) throw TypeError(t + " must be a string or a buffer"); } function o(e) { r.call(this), (this._block = n.allocUnsafe(e)), (this._blockSize = e), (this._blockOffset = 0), (this._length = [0, 0, 0, 0]), (this._finalized = !1); } i(32016)(o, r), (o.prototype._transform = function (e, t, i) { var n = null; try { this.update(e, t); } catch (e) { n = e; } i(n); }), (o.prototype._flush = function (e) { var t = null; try { this.push(this.digest()); } catch (e) { t = e; } e(t); }), (o.prototype.update = function (e, t) { if ((a(e, "Data"), this._finalized)) throw Error("Digest already called"); !n.isBuffer(e) && (e = n.from(e, t)); for ( var i = this._block, r = 0; this._blockOffset + e.length - r >= this._blockSize; ) { for (var o = this._blockOffset; o < this._blockSize; ) i[o++] = e[r++]; this._update(), (this._blockOffset = 0); } for (; r < e.length; ) i[this._blockOffset++] = e[r++]; for (var s = 0, l = 8 * e.length; l > 0; ++s) (this._length[s] += l), (l = (this._length[s] / 0x100000000) | 0) > 0 && (this._length[s] -= 0x100000000 * l); return this; }), (o.prototype._update = function () { throw Error("_update is not implemented"); }), (o.prototype.digest = function (e) { if (this._finalized) throw Error("Digest already called"); this._finalized = !0; var t = this._digest(); void 0 !== e && (t = t.toString(e)), this._block.fill(0), (this._blockOffset = 0); for (var i = 0; i < 4; ++i) this._length[i] = 0; return t; }), (o.prototype._digest = function () { throw Error("_digest is not implemented"); }), (e.exports = o); }, 917474: function (e, t, i) { var n = t; (n.utils = i(696225)), (n.common = i(199408)), (n.sha = i(397443)), (n.ripemd = i(830748)), (n.hmac = i(511450)), (n.sha1 = n.sha.sha1), (n.sha256 = n.sha.sha256), (n.sha224 = n.sha.sha224), (n.sha384 = n.sha.sha384), (n.sha512 = n.sha.sha512), (n.ripemd160 = n.ripemd.ripemd160); }, 199408: function (e, t, i) { "use strict"; var n = i(696225), r = i(422555); function a() { (this.pending = null), (this.pendingTotal = 0), (this.blockSize = this.constructor.blockSize), (this.outSize = this.constructor.outSize), (this.hmacStrength = this.constructor.hmacStrength), (this.padLength = this.constructor.padLength / 8), (this.endian = "big"), (this._delta8 = this.blockSize / 8), (this._delta32 = this.blockSize / 32); } (t.BlockHash = a), (a.prototype.update = function (e, t) { if ( ((e = n.toArray(e, t)), this.pending ? (this.pending = this.pending.concat(e)) : (this.pending = e), (this.pendingTotal += e.length), this.pending.length >= this._delta8) ) { var i = (e = this.pending).length % this._delta8; (this.pending = e.slice(e.length - i, e.length)), 0 === this.pending.length && (this.pending = null), (e = n.join32(e, 0, e.length - i, this.endian)); for (var r = 0; r < e.length; r += this._delta32) this._update(e, r, r + this._delta32); } return this; }), (a.prototype.digest = function (e) { return ( this.update(this._pad()), r(null === this.pending), this._digest(e) ); }), (a.prototype._pad = function () { var e = this.pendingTotal, t = this._delta8, i = t - ((e + this.padLength) % t), n = Array(i + this.padLength); n[0] = 128; for (var r = 1; r < i; r++) n[r] = 0; if (((e <<= 3), "big" === this.endian)) { for (var a = 8; a < this.padLength; a++) n[r++] = 0; (n[r++] = 0), (n[r++] = 0), (n[r++] = 0), (n[r++] = 0), (n[r++] = (e >>> 24) & 255), (n[r++] = (e >>> 16) & 255), (n[r++] = (e >>> 8) & 255), (n[r++] = 255 & e); } else for ( a = 8, n[r++] = 255 & e, n[r++] = (e >>> 8) & 255, n[r++] = (e >>> 16) & 255, n[r++] = (e >>> 24) & 255, n[r++] = 0, n[r++] = 0, n[r++] = 0, n[r++] = 0; a < this.padLength; a++ ) n[r++] = 0; return n; }); }, 511450: function (e, t, i) { "use strict"; var n = i(696225), r = i(422555); function a(e, t, i) { if (!(this instanceof a)) return new a(e, t, i); (this.Hash = e), (this.blockSize = e.blockSize / 8), (this.outSize = e.outSize / 8), (this.inner = null), (this.outer = null), this._init(n.toArray(t, i)); } (e.exports = a), (a.prototype._init = function (e) { e.length > this.blockSize && (e = new this.Hash().update(e).digest()), r(e.length <= this.blockSize); for (var t = e.length; t < this.blockSize; t++) e.push(0); for (t = 0; t < e.length; t++) e[t] ^= 54; for (t = 0, this.inner = new this.Hash().update(e); t < e.length; t++) e[t] ^= 106; this.outer = new this.Hash().update(e); }), (a.prototype.update = function (e, t) { return this.inner.update(e, t), this; }), (a.prototype.digest = function (e) { return this.outer.update(this.inner.digest()), this.outer.digest(e); }); }, 830748: function (e, t, i) { "use strict"; var n = i(696225), r = i(199408), a = n.rotl32, o = n.sum32, s = n.sum32_3, l = n.sum32_4, c = r.BlockHash; function d() { if (!(this instanceof d)) return new d(); c.call(this), (this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, ]), (this.endian = "little"); } function u(e, t, i, n) { if (e <= 15) return t ^ i ^ n; if (e <= 31) return (t & i) | (~t & n); if (e <= 47) return (t | ~i) ^ n; else if (e <= 63) return (t & n) | (i & ~n); else return t ^ (i | ~n); } function f(e) { if (e <= 15) return 0; if (e <= 31) return 0x5a827999; if (e <= 47) return 0x6ed9eba1; else if (e <= 63) return 0x8f1bbcdc; else return 0xa953fd4e; } function h(e) { if (e <= 15) return 0x50a28be6; if (e <= 31) return 0x5c4dd124; if (e <= 47) return 0x6d703ef3; else if (e <= 63) return 0x7a6d76e9; else return 0; } n.inherits(d, c), (t.ripemd160 = d), (d.blockSize = 512), (d.outSize = 160), (d.hmacStrength = 192), (d.padLength = 64), (d.prototype._update = function (e, t) { for ( var i = this.h[0], n = this.h[1], r = this.h[2], c = this.h[3], d = this.h[4], _ = i, y = n, b = r, I = c, w = d, x = 0; x < 80; x++ ) { var S = o(a(l(i, u(x, n, r, c), e[p[x] + t], f(x)), m[x]), d); (i = d), (d = c), (c = a(r, 10)), (r = n), (n = S), (S = o(a(l(_, u(79 - x, y, b, I), e[v[x] + t], h(x)), g[x]), w)), (_ = w), (w = I), (I = a(b, 10)), (b = y), (y = S); } (S = s(this.h[1], r, I)), (this.h[1] = s(this.h[2], c, w)), (this.h[2] = s(this.h[3], d, _)), (this.h[3] = s(this.h[4], i, y)), (this.h[4] = s(this.h[0], n, b)), (this.h[0] = S); }), (d.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h, "little") : n.split32(this.h, "little"); }); var p = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, ], v = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, ], m = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, ], g = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11, ]; }, 397443: function (e, t, i) { "use strict"; (t.sha1 = i(799078)), (t.sha224 = i(21291)), (t.sha256 = i(611179)), (t.sha384 = i(647005)), (t.sha512 = i(866923)); }, 799078: function (e, t, i) { "use strict"; var n = i(696225), r = i(199408), a = i(957356), o = n.rotl32, s = n.sum32, l = n.sum32_5, c = a.ft_1, d = r.BlockHash, u = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; function f() { if (!(this instanceof f)) return new f(); d.call(this), (this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, ]), (this.W = Array(80)); } n.inherits(f, d), (e.exports = f), (f.blockSize = 512), (f.outSize = 160), (f.hmacStrength = 80), (f.padLength = 64), (f.prototype._update = function (e, t) { for (var i = this.W, n = 0; n < 16; n++) i[n] = e[t + n]; for (; n < i.length; n++) i[n] = o(i[n - 3] ^ i[n - 8] ^ i[n - 14] ^ i[n - 16], 1); var r = this.h[0], a = this.h[1], d = this.h[2], f = this.h[3], h = this.h[4]; for (n = 0; n < i.length; n++) { var p = ~~(n / 20), v = l(o(r, 5), c(p, a, d, f), h, i[n], u[p]); (h = f), (f = d), (d = o(a, 30)), (a = r), (r = v); } (this.h[0] = s(this.h[0], r)), (this.h[1] = s(this.h[1], a)), (this.h[2] = s(this.h[2], d)), (this.h[3] = s(this.h[3], f)), (this.h[4] = s(this.h[4], h)); }), (f.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h, "big") : n.split32(this.h, "big"); }); }, 21291: function (e, t, i) { "use strict"; var n = i(696225), r = i(611179); function a() { if (!(this instanceof a)) return new a(); r.call(this), (this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, ]); } n.inherits(a, r), (e.exports = a), (a.blockSize = 512), (a.outSize = 224), (a.hmacStrength = 192), (a.padLength = 64), (a.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h.slice(0, 7), "big") : n.split32(this.h.slice(0, 7), "big"); }); }, 611179: function (e, t, i) { "use strict"; var n = i(696225), r = i(199408), a = i(957356), o = i(422555), s = n.sum32, l = n.sum32_4, c = n.sum32_5, d = a.ch32, u = a.maj32, f = a.s0_256, h = a.s1_256, p = a.g0_256, v = a.g1_256, m = r.BlockHash, g = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0xfc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x6ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, ]; function _() { if (!(this instanceof _)) return new _(); m.call(this), (this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, ]), (this.k = g), (this.W = Array(64)); } n.inherits(_, m), (e.exports = _), (_.blockSize = 512), (_.outSize = 256), (_.hmacStrength = 192), (_.padLength = 64), (_.prototype._update = function (e, t) { for (var i = this.W, n = 0; n < 16; n++) i[n] = e[t + n]; for (; n < i.length; n++) i[n] = l(v(i[n - 2]), i[n - 7], p(i[n - 15]), i[n - 16]); var r = this.h[0], a = this.h[1], m = this.h[2], g = this.h[3], _ = this.h[4], y = this.h[5], b = this.h[6], I = this.h[7]; for (o(this.k.length === i.length), n = 0; n < i.length; n++) { var w = c(I, h(_), d(_, y, b), this.k[n], i[n]), x = s(f(r), u(r, a, m)); (I = b), (b = y), (y = _), (_ = s(g, w)), (g = m), (m = a), (a = r), (r = s(w, x)); } (this.h[0] = s(this.h[0], r)), (this.h[1] = s(this.h[1], a)), (this.h[2] = s(this.h[2], m)), (this.h[3] = s(this.h[3], g)), (this.h[4] = s(this.h[4], _)), (this.h[5] = s(this.h[5], y)), (this.h[6] = s(this.h[6], b)), (this.h[7] = s(this.h[7], I)); }), (_.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h, "big") : n.split32(this.h, "big"); }); }, 647005: function (e, t, i) { "use strict"; var n = i(696225), r = i(866923); function a() { if (!(this instanceof a)) return new a(); r.call(this), (this.h = [ 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, ]); } n.inherits(a, r), (e.exports = a), (a.blockSize = 1024), (a.outSize = 384), (a.hmacStrength = 192), (a.padLength = 128), (a.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h.slice(0, 12), "big") : n.split32(this.h.slice(0, 12), "big"); }); }, 866923: function (e, t, i) { "use strict"; var n = i(696225), r = i(199408), a = i(422555), o = n.rotr64_hi, s = n.rotr64_lo, l = n.shr64_hi, c = n.shr64_lo, d = n.sum64, u = n.sum64_hi, f = n.sum64_lo, h = n.sum64_4_hi, p = n.sum64_4_lo, v = n.sum64_5_hi, m = n.sum64_5_lo, g = r.BlockHash, _ = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0xfc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x6ca6351, 0xe003826f, 0x14292967, 0xa0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x6f067aa, 0x72176fba, 0xa637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817, ]; function y() { if (!(this instanceof y)) return new y(); g.call(this), (this.h = [ 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, ]), (this.k = _), (this.W = Array(160)); } function b(e, t, i, n, r) { var a = (e & i) ^ (~e & r); return a < 0 && (a += 0x100000000), a; } function I(e, t, i, n, r, a) { var o = (t & n) ^ (~t & a); return o < 0 && (o += 0x100000000), o; } function w(e, t, i, n, r) { var a = (e & i) ^ (e & r) ^ (i & r); return a < 0 && (a += 0x100000000), a; } function x(e, t, i, n, r, a) { var o = (t & n) ^ (t & a) ^ (n & a); return o < 0 && (o += 0x100000000), o; } function S(e, t) { var i = o(e, t, 28) ^ o(t, e, 2) ^ o(t, e, 7); return i < 0 && (i += 0x100000000), i; } function M(e, t) { var i = s(e, t, 28) ^ s(t, e, 2) ^ s(t, e, 7); return i < 0 && (i += 0x100000000), i; } function C(e, t) { var i = o(e, t, 14) ^ o(e, t, 18) ^ o(t, e, 9); return i < 0 && (i += 0x100000000), i; } function T(e, t) { var i = s(e, t, 14) ^ s(e, t, 18) ^ s(t, e, 9); return i < 0 && (i += 0x100000000), i; } function A(e, t) { var i = o(e, t, 1) ^ o(e, t, 8) ^ l(e, t, 7); return i < 0 && (i += 0x100000000), i; } function k(e, t) { var i = s(e, t, 1) ^ s(e, t, 8) ^ c(e, t, 7); return i < 0 && (i += 0x100000000), i; } function P(e, t) { var i = o(e, t, 19) ^ o(t, e, 29) ^ l(e, t, 6); return i < 0 && (i += 0x100000000), i; } function E(e, t) { var i = s(e, t, 19) ^ s(t, e, 29) ^ c(e, t, 6); return i < 0 && (i += 0x100000000), i; } n.inherits(y, g), (e.exports = y), (y.blockSize = 1024), (y.outSize = 512), (y.hmacStrength = 192), (y.padLength = 128), (y.prototype._prepareBlock = function (e, t) { for (var i = this.W, n = 0; n < 32; n++) i[n] = e[t + n]; for (; n < i.length; n += 2) { var r = P(i[n - 4], i[n - 3]), a = E(i[n - 4], i[n - 3]), o = i[n - 14], s = i[n - 13], l = A(i[n - 30], i[n - 29]), c = k(i[n - 30], i[n - 29]), d = i[n - 32], u = i[n - 31]; (i[n] = h(r, a, o, s, l, c, d, u)), (i[n + 1] = p(r, a, o, s, l, c, d, u)); } }), (y.prototype._update = function (e, t) { this._prepareBlock(e, t); var i = this.W, n = this.h[0], r = this.h[1], o = this.h[2], s = this.h[3], l = this.h[4], c = this.h[5], h = this.h[6], p = this.h[7], g = this.h[8], _ = this.h[9], y = this.h[10], A = this.h[11], k = this.h[12], P = this.h[13], E = this.h[14], D = this.h[15]; a(this.k.length === i.length); for (var R = 0; R < i.length; R += 2) { var N = E, L = D, j = C(g, _), O = T(g, _), B = b(g, _, y, A, k, P), F = I(g, _, y, A, k, P), U = this.k[R], G = this.k[R + 1], z = i[R], V = i[R + 1], W = v(N, L, j, O, B, F, U, G, z, V), Z = m(N, L, j, O, B, F, U, G, z, V); (N = S(n, r)), (L = M(n, r)), (j = w(n, r, o, s, l, c)); var K = u(N, L, j, (O = x(n, r, o, s, l, c))), H = f(N, L, j, O); (E = k), (D = P), (k = y), (P = A), (y = g), (A = _), (g = u(h, p, W, Z)), (_ = f(p, p, W, Z)), (h = l), (p = c), (l = o), (c = s), (o = n), (s = r), (n = u(W, Z, K, H)), (r = f(W, Z, K, H)); } d(this.h, 0, n, r), d(this.h, 2, o, s), d(this.h, 4, l, c), d(this.h, 6, h, p), d(this.h, 8, g, _), d(this.h, 10, y, A), d(this.h, 12, k, P), d(this.h, 14, E, D); }), (y.prototype._digest = function (e) { return "hex" === e ? n.toHex32(this.h, "big") : n.split32(this.h, "big"); }); }, 957356: function (e, t, i) { "use strict"; var n = i(696225).rotr32; function r(e, t, i, n) { return 0 === e ? a(t, i, n) : 1 === e || 3 === e ? s(t, i, n) : 2 === e ? o(t, i, n) : void 0; } function a(e, t, i) { return (e & t) ^ (~e & i); } function o(e, t, i) { return (e & t) ^ (e & i) ^ (t & i); } function s(e, t, i) { return e ^ t ^ i; } function l(e) { return n(e, 2) ^ n(e, 13) ^ n(e, 22); } function c(e) { return n(e, 6) ^ n(e, 11) ^ n(e, 25); } function d(e) { return n(e, 7) ^ n(e, 18) ^ (e >>> 3); } function u(e) { return n(e, 17) ^ n(e, 19) ^ (e >>> 10); } (t.ft_1 = r), (t.ch32 = a), (t.maj32 = o), (t.p32 = s), (t.s0_256 = l), (t.s1_256 = c), (t.g0_256 = d), (t.g1_256 = u); }, 696225: function (e, t, i) { "use strict"; var n = i(422555), r = i(32016); function a(e, t) { return ( (64512 & e.charCodeAt(t)) == 55296 && !(t < 0) && !(t + 1 >= e.length) && (64512 & e.charCodeAt(t + 1)) == 56320 ); } function o(e, t) { if (Array.isArray(e)) return e.slice(); if (!e) return []; var i = []; if ("string" == typeof e) { if (t) { if ("hex" === t) for ( (e = e.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e = "0" + e), r = 0; r < e.length; r += 2 ) i.push(parseInt(e[r] + e[r + 1], 16)); } else { for (var n = 0, r = 0; r < e.length; r++) { var o = e.charCodeAt(r); o < 128 ? (i[n++] = o) : (o < 2048 ? (i[n++] = (o >> 6) | 192) : (a(e, r) ? ((o = 65536 + ((1023 & o) << 10) + (1023 & e.charCodeAt(++r))), (i[n++] = (o >> 18) | 240), (i[n++] = ((o >> 12) & 63) | 128)) : (i[n++] = (o >> 12) | 224), (i[n++] = ((o >> 6) & 63) | 128)), (i[n++] = (63 & o) | 128)); } } } else for (r = 0; r < e.length; r++) i[r] = 0 | e[r]; return i; } function s(e) { for (var t = "", i = 0; i < e.length; i++) t += d(e[i].toString(16)); return t; } function l(e) { return ( ((e >>> 24) | ((e >>> 8) & 65280) | ((e << 8) & 0xff0000) | ((255 & e) << 24)) >>> 0 ); } function c(e, t) { for (var i = "", n = 0; n < e.length; n++) { var r = e[n]; "little" === t && (r = l(r)), (i += u(r.toString(16))); } return i; } function d(e) { return 1 === e.length ? "0" + e : e; } function u(e) { if (7 === e.length) return "0" + e; if (6 === e.length) return "00" + e; if (5 === e.length) return "000" + e; else if (4 === e.length) return "0000" + e; else if (3 === e.length) return "00000" + e; else if (2 === e.length) return "000000" + e; else if (1 === e.length) return "0000000" + e; else return e; } function f(e, t, i, r) { var a, o = i - t; n(o % 4 == 0); for (var s = Array(o / 4), l = 0, c = t; l < s.length; l++, c += 4) (a = "big" === r ? (e[c] << 24) | (e[c + 1] << 16) | (e[c + 2] << 8) | e[c + 3] : (e[c + 3] << 24) | (e[c + 2] << 16) | (e[c + 1] << 8) | e[c]), (s[l] = a >>> 0); return s; } function h(e, t) { for ( var i = Array(4 * e.length), n = 0, r = 0; n < e.length; n++, r += 4 ) { var a = e[n]; "big" === t ? ((i[r] = a >>> 24), (i[r + 1] = (a >>> 16) & 255), (i[r + 2] = (a >>> 8) & 255), (i[r + 3] = 255 & a)) : ((i[r + 3] = a >>> 24), (i[r + 2] = (a >>> 16) & 255), (i[r + 1] = (a >>> 8) & 255), (i[r] = 255 & a)); } return i; } function p(e, t) { return (e >>> t) | (e << (32 - t)); } function v(e, t) { return (e << t) | (e >>> (32 - t)); } function m(e, t) { return (e + t) >>> 0; } function g(e, t, i) { return (e + t + i) >>> 0; } function _(e, t, i, n) { return (e + t + i + n) >>> 0; } function y(e, t, i, n, r) { return (e + t + i + n + r) >>> 0; } function b(e, t, i, n) { var r = e[t], a = (n + e[t + 1]) >>> 0, o = (a < n ? 1 : 0) + i + r; (e[t] = o >>> 0), (e[t + 1] = a); } function I(e, t, i, n) { return (((t + n) >>> 0 < t ? 1 : 0) + e + i) >>> 0; } function w(e, t, i, n) { return (t + n) >>> 0; } function x(e, t, i, n, r, a, o, s) { var l, c = t; return ( (l = 0 + ((c = (c + n) >>> 0) < t ? 1 : 0)), (l += (c = (c + a) >>> 0) < a ? 1 : 0), (e + i + r + o + (l += (c = (c + s) >>> 0) < s ? 1 : 0)) >>> 0 ); } function S(e, t, i, n, r, a, o, s) { return (t + n + a + s) >>> 0; } function M(e, t, i, n, r, a, o, s, l, c) { var d, u = t; return ( (d = 0 + ((u = (u + n) >>> 0) < t ? 1 : 0)), (d += (u = (u + a) >>> 0) < a ? 1 : 0), (d += (u = (u + s) >>> 0) < s ? 1 : 0), (e + i + r + o + l + (d += (u = (u + c) >>> 0) < c ? 1 : 0)) >>> 0 ); } function C(e, t, i, n, r, a, o, s, l, c) { return (t + n + a + s + c) >>> 0; } function T(e, t, i) { return ((t << (32 - i)) | (e >>> i)) >>> 0; } function A(e, t, i) { return ((e << (32 - i)) | (t >>> i)) >>> 0; } function k(e, t, i) { return e >>> i; } function P(e, t, i) { return ((e << (32 - i)) | (t >>> i)) >>> 0; } (t.inherits = r), (t.toArray = o), (t.toHex = s), (t.htonl = l), (t.toHex32 = c), (t.zero2 = d), (t.zero8 = u), (t.join32 = f), (t.split32 = h), (t.rotr32 = p), (t.rotl32 = v), (t.sum32 = m), (t.sum32_3 = g), (t.sum32_4 = _), (t.sum32_5 = y), (t.sum64 = b), (t.sum64_hi = I), (t.sum64_lo = w), (t.sum64_4_hi = x), (t.sum64_4_lo = S), (t.sum64_5_hi = M), (t.sum64_5_lo = C), (t.rotr64_hi = T), (t.rotr64_lo = A), (t.shr64_hi = k), (t.shr64_lo = P); }, 458436: function (e, t, i) { "use strict"; var n = i(917474), r = i(354845), a = i(422555); function o(e) { if (!(this instanceof o)) return new o(e); (this.hash = e.hash), (this.predResist = !!e.predResist), (this.outLen = this.hash.outSize), (this.minEntropy = e.minEntropy || this.hash.hmacStrength), (this._reseed = null), (this.reseedInterval = null), (this.K = null), (this.V = null); var t = r.toArray(e.entropy, e.entropyEnc || "hex"), i = r.toArray(e.nonce, e.nonceEnc || "hex"), n = r.toArray(e.pers, e.persEnc || "hex"); a( t.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits" ), this._init(t, i, n); } (e.exports = o), (o.prototype._init = function (e, t, i) { var n = e.concat(t).concat(i); (this.K = Array(this.outLen / 8)), (this.V = Array(this.outLen / 8)); for (var r = 0; r < this.V.length; r++) (this.K[r] = 0), (this.V[r] = 1); this._update(n), (this._reseed = 1), (this.reseedInterval = 0x1000000000000); }), (o.prototype._hmac = function () { return new n.hmac(this.hash, this.K); }), (o.prototype._update = function (e) { var t = this._hmac().update(this.V).update([0]); e && (t = t.update(e)), (this.K = t.digest()), (this.V = this._hmac().update(this.V).digest()), e && ((this.K = this._hmac() .update(this.V) .update([1]) .update(e) .digest()), (this.V = this._hmac().update(this.V).digest())); }), (o.prototype.reseed = function (e, t, i, n) { "string" != typeof t && ((n = i), (i = t), (t = null)), (e = r.toArray(e, t)), (i = r.toArray(i, n)), a( e.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits" ), this._update(e.concat(i || [])), (this._reseed = 1); }), (o.prototype.generate = function (e, t, i, n) { if (this._reseed > this.reseedInterval) throw Error("Reseed is required"); "string" != typeof t && ((n = i), (i = t), (t = null)), i && ((i = r.toArray(i, n || "hex")), this._update(i)); for (var a = []; a.length < e; ) (this.V = this._hmac().update(this.V).digest()), (a = a.concat(this.V)); var o = a.slice(0, e); return this._update(i), this._reseed++, r.encode(o, t); }); }, 32016: function (e) { "function" == typeof Object.create ? (e.exports = function (e, t) { t && ((e.super_ = t), (e.prototype = Object.create(t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0, }, }))); }) : (e.exports = function (e, t) { if (t) { e.super_ = t; var i = function () {}; (i.prototype = t.prototype), (e.prototype = new i()), (e.prototype.constructor = e); } }); }, 991546: function (e) { var t = {}.toString; e.exports = Array.isArray || function (e) { return "[object Array]" == t.call(e); }; }, 317511: function (e, t, i) { "use strict"; var n = i(32016), r = i(277514), a = i(140860).Buffer, o = Array(16); function s() { r.call(this, 64), (this._a = 0x67452301), (this._b = 0xefcdab89), (this._c = 0x98badcfe), (this._d = 0x10325476); } function l(e, t) { return (e << t) | (e >>> (32 - t)); } function c(e, t, i, n, r, a, o) { return (l((e + ((t & i) | (~t & n)) + r + a) | 0, o) + t) | 0; } function d(e, t, i, n, r, a, o) { return (l((e + ((t & n) | (i & ~n)) + r + a) | 0, o) + t) | 0; } function u(e, t, i, n, r, a, o) { return (l((e + (t ^ i ^ n) + r + a) | 0, o) + t) | 0; } function f(e, t, i, n, r, a, o) { return (l((e + (i ^ (t | ~n)) + r + a) | 0, o) + t) | 0; } n(s, r), (s.prototype._update = function () { for (var e = o, t = 0; t < 16; ++t) e[t] = this._block.readInt32LE(4 * t); var i = this._a, n = this._b, r = this._c, a = this._d; (i = c(i, n, r, a, e[0], 0xd76aa478, 7)), (a = c(a, i, n, r, e[1], 0xe8c7b756, 12)), (r = c(r, a, i, n, e[2], 0x242070db, 17)), (n = c(n, r, a, i, e[3], 0xc1bdceee, 22)), (i = c(i, n, r, a, e[4], 0xf57c0faf, 7)), (a = c(a, i, n, r, e[5], 0x4787c62a, 12)), (r = c(r, a, i, n, e[6], 0xa8304613, 17)), (n = c(n, r, a, i, e[7], 0xfd469501, 22)), (i = c(i, n, r, a, e[8], 0x698098d8, 7)), (a = c(a, i, n, r, e[9], 0x8b44f7af, 12)), (r = c(r, a, i, n, e[10], 0xffff5bb1, 17)), (n = c(n, r, a, i, e[11], 0x895cd7be, 22)), (i = c(i, n, r, a, e[12], 0x6b901122, 7)), (a = c(a, i, n, r, e[13], 0xfd987193, 12)), (r = c(r, a, i, n, e[14], 0xa679438e, 17)), (n = c(n, r, a, i, e[15], 0x49b40821, 22)), (i = d(i, n, r, a, e[1], 0xf61e2562, 5)), (a = d(a, i, n, r, e[6], 0xc040b340, 9)), (r = d(r, a, i, n, e[11], 0x265e5a51, 14)), (n = d(n, r, a, i, e[0], 0xe9b6c7aa, 20)), (i = d(i, n, r, a, e[5], 0xd62f105d, 5)), (a = d(a, i, n, r, e[10], 0x2441453, 9)), (r = d(r, a, i, n, e[15], 0xd8a1e681, 14)), (n = d(n, r, a, i, e[4], 0xe7d3fbc8, 20)), (i = d(i, n, r, a, e[9], 0x21e1cde6, 5)), (a = d(a, i, n, r, e[14], 0xc33707d6, 9)), (r = d(r, a, i, n, e[3], 0xf4d50d87, 14)), (n = d(n, r, a, i, e[8], 0x455a14ed, 20)), (i = d(i, n, r, a, e[13], 0xa9e3e905, 5)), (a = d(a, i, n, r, e[2], 0xfcefa3f8, 9)), (r = d(r, a, i, n, e[7], 0x676f02d9, 14)), (n = d(n, r, a, i, e[12], 0x8d2a4c8a, 20)), (i = u(i, n, r, a, e[5], 0xfffa3942, 4)), (a = u(a, i, n, r, e[8], 0x8771f681, 11)), (r = u(r, a, i, n, e[11], 0x6d9d6122, 16)), (n = u(n, r, a, i, e[14], 0xfde5380c, 23)), (i = u(i, n, r, a, e[1], 0xa4beea44, 4)), (a = u(a, i, n, r, e[4], 0x4bdecfa9, 11)), (r = u(r, a, i, n, e[7], 0xf6bb4b60, 16)), (n = u(n, r, a, i, e[10], 0xbebfbc70, 23)), (i = u(i, n, r, a, e[13], 0x289b7ec6, 4)), (a = u(a, i, n, r, e[0], 0xeaa127fa, 11)), (r = u(r, a, i, n, e[3], 0xd4ef3085, 16)), (n = u(n, r, a, i, e[6], 0x4881d05, 23)), (i = u(i, n, r, a, e[9], 0xd9d4d039, 4)), (a = u(a, i, n, r, e[12], 0xe6db99e5, 11)), (r = u(r, a, i, n, e[15], 0x1fa27cf8, 16)), (n = u(n, r, a, i, e[2], 0xc4ac5665, 23)), (i = f(i, n, r, a, e[0], 0xf4292244, 6)), (a = f(a, i, n, r, e[7], 0x432aff97, 10)), (r = f(r, a, i, n, e[14], 0xab9423a7, 15)), (n = f(n, r, a, i, e[5], 0xfc93a039, 21)), (i = f(i, n, r, a, e[12], 0x655b59c3, 6)), (a = f(a, i, n, r, e[3], 0x8f0ccc92, 10)), (r = f(r, a, i, n, e[10], 0xffeff47d, 15)), (n = f(n, r, a, i, e[1], 0x85845dd1, 21)), (i = f(i, n, r, a, e[8], 0x6fa87e4f, 6)), (a = f(a, i, n, r, e[15], 0xfe2ce6e0, 10)), (r = f(r, a, i, n, e[6], 0xa3014314, 15)), (n = f(n, r, a, i, e[13], 0x4e0811a1, 21)), (i = f(i, n, r, a, e[4], 0xf7537e82, 6)), (a = f(a, i, n, r, e[11], 0xbd3af235, 10)), (r = f(r, a, i, n, e[2], 0x2ad7d2bb, 15)), (n = f(n, r, a, i, e[9], 0xeb86d391, 21)), (this._a = (this._a + i) | 0), (this._b = (this._b + n) | 0), (this._c = (this._c + r) | 0), (this._d = (this._d + a) | 0); }), (s.prototype._digest = function () { (this._block[this._blockOffset++] = 128), this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), (this._blockOffset = 0)), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); var e = a.allocUnsafe(16); return ( e.writeInt32LE(this._a, 0), e.writeInt32LE(this._b, 4), e.writeInt32LE(this._c, 8), e.writeInt32LE(this._d, 12), e ); }), (e.exports = s); }, 350724: function (e, t, i) { var n = i(984826), r = i(462810); function a(e) { this.rand = e || new r.Rand(); } (e.exports = a), (a.create = function (e) { return new a(e); }), (a.prototype._randbelow = function (e) { var t = Math.ceil(e.bitLength() / 8); do var i = new n(this.rand.generate(t)); while (i.cmp(e) >= 0); return i; }), (a.prototype._randrange = function (e, t) { var i = t.sub(e); return e.add(this._randbelow(i)); }), (a.prototype.test = function (e, t, i) { var r = e.bitLength(), a = n.mont(e), o = new n(1).toRed(a); !t && (t = Math.max(1, (r / 48) | 0)); for (var s = e.subn(1), l = 0; !s.testn(l); l++); for (var c = e.shrn(l), d = s.toRed(a), u = !0; t > 0; t--) { var f = this._randrange(new n(2), s); i && i(f); var h = f.toRed(a).redPow(c); if (0 !== h.cmp(o) && 0 !== h.cmp(d)) { for (var p = 1; p < l; p++) { if (0 === (h = h.redSqr()).cmp(o)) return !1; if (0 === h.cmp(d)) break; } if (p === l) return !1; } } return u; }), (a.prototype.getDivisor = function (e, t) { var i = e.bitLength(), r = n.mont(e), a = new n(1).toRed(r); !t && (t = Math.max(1, (i / 48) | 0)); for (var o = e.subn(1), s = 0; !o.testn(s); s++); for (var l = e.shrn(s), c = o.toRed(r); t > 0; t--) { var d = this._randrange(new n(2), o), u = e.gcd(d); if (0 !== u.cmpn(1)) return u; var f = d.toRed(r).redPow(l); if (0 !== f.cmp(a) && 0 !== f.cmp(c)) { for (var h = 1; h < s; h++) { if (0 === (f = f.redSqr()).cmp(a)) return f.fromRed().subn(1).gcd(e); if (0 === f.cmp(c)) break; } if (h === s) return (f = f.redSqr()).fromRed().subn(1).gcd(e); } } return !1; }); }, 422555: function (e) { function t(e, t) { if (!e) throw Error(t || "Assertion failed"); } (e.exports = t), (t.equal = function (e, t, i) { if (e != t) throw Error(i || "Assertion failed: " + e + " != " + t); }); }, 354845: function (e, t) { "use strict"; var i = t; function n(e, t) { if (Array.isArray(e)) return e.slice(); if (!e) return []; var i = []; if ("string" != typeof e) { for (var n = 0; n < e.length; n++) i[n] = 0 | e[n]; return i; } if ("hex" === t) { (e = e.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e = "0" + e); for (var n = 0; n < e.length; n += 2) i.push(parseInt(e[n] + e[n + 1], 16)); } else for (var n = 0; n < e.length; n++) { var r = e.charCodeAt(n), a = r >> 8, o = 255 & r; a ? i.push(a, o) : i.push(o); } return i; } function r(e) { return 1 === e.length ? "0" + e : e; } function a(e) { for (var t = "", i = 0; i < e.length; i++) t += r(e[i].toString(16)); return t; } (i.toArray = n), (i.zero2 = r), (i.toHex = a), (i.encode = function (e, t) { return "hex" === t ? a(e) : e; }); }, 447462: function (e, t, i) { "use strict"; function n(e, t) { return void 0 === t && (t = 15), +parseFloat(Number(e).toPrecision(t)); } function r(e) { var t = e.toString().split(/[eE]/), i = (t[0].split(".")[1] || "").length - +(t[1] || 0); return i > 0 ? i : 0; } function a(e) { if (-1 === e.toString().indexOf("e")) return Number(e.toString().replace(".", "")); var t = r(e); return t > 0 ? n(Number(e) * Math.pow(10, t)) : Number(e); } function o(e) { h && (e > Number.MAX_SAFE_INTEGER || e < Number.MIN_SAFE_INTEGER) && console.warn( e + " is beyond boundary when transfer to integer, the results may not be accurate" ); } function s(e) { return function () { for (var t = [], i = 0; i < arguments.length; i++) t[i] = arguments[i]; var n = t[0]; return t.slice(1).reduce(function (t, i) { return e(t, i); }, n); }; } i.d(t, { DZ: function () { return l; }, PD: function () { return c; }, cs: function () { return u; }, h9: function () { return d; }, }); var l = s(function (e, t) { var i = a(e), n = a(t), s = r(e) + r(t), l = i * n; return o(l), l / Math.pow(10, s); }), c = s(function (e, t) { var i = Math.pow(10, Math.max(r(e), r(t))); return (l(e, i) + l(t, i)) / i; }), d = s(function (e, t) { var i = Math.pow(10, Math.max(r(e), r(t))); return (l(e, i) - l(t, i)) / i; }), u = s(function (e, t) { var i = a(e), s = a(t); return o(i), o(s), l(i / s, n(Math.pow(10, r(t) - r(e)))); }); function f(e, t) { var i = Math.pow(10, t), n = u(Math.round(Math.abs(l(e, i))), i); return e < 0 && 0 !== n && (n = l(n, -1)), n; } var h = !0, p = { strip: n, plus: c, minus: d, times: l, divide: u, round: f, digitLength: r, float2Fixed: a, enableBoundaryChecking: function e(e) { void 0 === e && (e = !0), (h = e); }, }; t.ZP = p; }, 753177: function (e, t, i) { "use strict"; var n = i(53453); t.certificate = i(2716); var r = n.define("RSAPrivateKey", function () { this.seq().obj( this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int() ); }); t.RSAPrivateKey = r; var a = n.define("RSAPublicKey", function () { this.seq().obj( this.key("modulus").int(), this.key("publicExponent").int() ); }); t.RSAPublicKey = a; var o = n.define("AlgorithmIdentifier", function () { this.seq().obj( this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params") .seq() .obj( this.key("p").int(), this.key("q").int(), this.key("g").int() ) .optional() ); }), s = n.define("SubjectPublicKeyInfo", function () { this.seq().obj( this.key("algorithm").use(o), this.key("subjectPublicKey").bitstr() ); }); t.PublicKey = s; var l = n.define("PrivateKeyInfo", function () { this.seq().obj( this.key("version").int(), this.key("algorithm").use(o), this.key("subjectPrivateKey").octstr() ); }); t.PrivateKey = l; var c = n.define("EncryptedPrivateKeyInfo", function () { this.seq().obj( this.key("algorithm") .seq() .obj( this.key("id").objid(), this.key("decrypt") .seq() .obj( this.key("kde") .seq() .obj( this.key("id").objid(), this.key("kdeparams") .seq() .obj(this.key("salt").octstr(), this.key("iters").int()) ), this.key("cipher") .seq() .obj(this.key("algo").objid(), this.key("iv").octstr()) ) ), this.key("subjectPrivateKey").octstr() ); }); t.EncryptedPrivateKey = c; var d = n.define("DSAPrivateKey", function () { this.seq().obj( this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int() ); }); (t.DSAPrivateKey = d), (t.DSAparam = n.define("DSAparam", function () { this.int(); })); var u = n.define("ECParameters", function () { this.choice({ namedCurve: this.objid() }); }), f = n.define("ECPrivateKey", function () { this.seq().obj( this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(u), this.key("publicKey").optional().explicit(1).bitstr() ); }); (t.ECPrivateKey = f), (t.signature = n.define("signature", function () { this.seq().obj(this.key("r").int(), this.key("s").int()); })); }, 2716: function (e, t, i) { "use strict"; var n = i(53453), r = n.define("Time", function () { this.choice({ utcTime: this.utctime(), generalTime: this.gentime() }); }), a = n.define("AttributeTypeValue", function () { this.seq().obj(this.key("type").objid(), this.key("value").any()); }), o = n.define("AlgorithmIdentifier", function () { this.seq().obj( this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional() ); }), s = n.define("SubjectPublicKeyInfo", function () { this.seq().obj( this.key("algorithm").use(o), this.key("subjectPublicKey").bitstr() ); }), l = n.define("RelativeDistinguishedName", function () { this.setof(a); }), c = n.define("RDNSequence", function () { this.seqof(l); }), d = n.define("Name", function () { this.choice({ rdnSequence: this.use(c) }); }), u = n.define("Validity", function () { this.seq().obj( this.key("notBefore").use(r), this.key("notAfter").use(r) ); }), f = n.define("Extension", function () { this.seq().obj( this.key("extnID").objid(), this.key("critical").bool().def(!1), this.key("extnValue").octstr() ); }), h = n.define("TBSCertificate", function () { this.seq().obj( this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(o), this.key("issuer").use(d), this.key("validity").use(u), this.key("subject").use(d), this.key("subjectPublicKeyInfo").use(s), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(f).optional() ); }), p = n.define("X509Certificate", function () { this.seq().obj( this.key("tbsCertificate").use(h), this.key("signatureAlgorithm").use(o), this.key("signatureValue").bitstr() ); }); e.exports = p; }, 39847: function (e, t, i) { "use strict"; var n = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, r = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, a = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, o = i(948881), s = i(652217), l = i(140860).Buffer; e.exports = function (e, t) { var i, c = e.toString(), d = c.match(n); if (d) { var u = "aes" + d[1], f = l.from(d[2], "hex"), h = l.from(d[3].replace(/[\r\n]/g, ""), "base64"), p = o(t, f.slice(0, 8), parseInt(d[1], 10)).key, v = [], m = s.createDecipheriv(u, p, f); v.push(m.update(h)), v.push(m.final()), (i = l.concat(v)); } else { var g = c.match(a); i = l.from(g[2].replace(/[\r\n]/g, ""), "base64"); } return { tag: c.match(r)[1], data: i }; }; }, 189939: function (e, t, i) { "use strict"; var n = i(753177), r = i(431163), a = i(39847), o = i(652217), s = i(818724), l = i(140860).Buffer; function c(e, t) { var i = e.algorithm.decrypt.kde.kdeparams.salt, n = parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), a = r[e.algorithm.decrypt.cipher.algo.join(".")], c = e.algorithm.decrypt.cipher.iv, d = e.subjectPrivateKey, u = parseInt(a.split("-")[1], 10) / 8, f = s.pbkdf2Sync(t, i, n, u, "sha1"), h = o.createDecipheriv(a, f, c), p = []; return p.push(h.update(d)), p.push(h.final()), l.concat(p); } function d(e) { "object" == typeof e && !l.isBuffer(e) && ((t = e.passphrase), (e = e.key)), "string" == typeof e && (e = l.from(e)); var t, i, r, o = a(e, t), s = o.tag, d = o.data; switch (s) { case "CERTIFICATE": r = n.certificate.decode(d, "der").tbsCertificate .subjectPublicKeyInfo; case "PUBLIC KEY": switch ( (!r && (r = n.PublicKey.decode(d, "der")), (i = r.algorithm.algorithm.join("."))) ) { case "1.2.840.113549.1.1.1": return n.RSAPublicKey.decode(r.subjectPublicKey.data, "der"); case "1.2.840.10045.2.1": return ( (r.subjectPrivateKey = r.subjectPublicKey), { type: "ec", data: r } ); case "1.2.840.10040.4.1": return ( (r.algorithm.params.pub_key = n.DSAparam.decode( r.subjectPublicKey.data, "der" )), { type: "dsa", data: r.algorithm.params } ); default: throw Error("unknown key id " + i); } case "ENCRYPTED PRIVATE KEY": d = c((d = n.EncryptedPrivateKey.decode(d, "der")), t); case "PRIVATE KEY": switch ( (i = (r = n.PrivateKey.decode(d, "der")).algorithm.algorithm.join( "." )) ) { case "1.2.840.113549.1.1.1": return n.RSAPrivateKey.decode(r.subjectPrivateKey, "der"); case "1.2.840.10045.2.1": return { curve: r.algorithm.curve, privateKey: n.ECPrivateKey.decode(r.subjectPrivateKey, "der") .privateKey, }; case "1.2.840.10040.4.1": return ( (r.algorithm.params.priv_key = n.DSAparam.decode( r.subjectPrivateKey, "der" )), { type: "dsa", params: r.algorithm.params } ); default: throw Error("unknown key id " + i); } case "RSA PUBLIC KEY": return n.RSAPublicKey.decode(d, "der"); case "RSA PRIVATE KEY": return n.RSAPrivateKey.decode(d, "der"); case "DSA PRIVATE KEY": return { type: "dsa", params: n.DSAPrivateKey.decode(d, "der") }; case "EC PRIVATE KEY": return { curve: (d = n.ECPrivateKey.decode(d, "der")).parameters.value, privateKey: d.privateKey, }; default: throw Error("unknown key type " + s); } } (d.signature = n.signature), (e.exports = d); }, 818724: function (e, t, i) { (t.pbkdf2 = i(182693)), (t.pbkdf2Sync = i(294374)); }, 182693: function (e, t, i) { var n, r, a = i(140860).Buffer, o = i(947889), s = i(365330), l = i(294374), c = i(414712), d = i.g.crypto && i.g.crypto.subtle, u = { sha: "SHA-1", "sha-1": "SHA-1", sha1: "SHA-1", sha256: "SHA-256", "sha-256": "SHA-256", sha384: "SHA-384", "sha-384": "SHA-384", "sha-512": "SHA-512", sha512: "SHA-512", }, f = []; function h(e) { if ( (i.g.process && !i.g.process.browser) || !d || !d.importKey || !d.deriveBits ) return Promise.resolve(!1); if (void 0 !== f[e]) return f[e]; var t = v((n = n || a.alloc(8)), n, 10, 128, e) .then(function () { return !0; }) .catch(function () { return !1; }); return (f[e] = t), t; } function p() { return r ? r : (r = i.g.process && i.g.process.nextTick ? i.g.process.nextTick : i.g.queueMicrotask ? i.g.queueMicrotask : i.g.setImmediate ? i.g.setImmediate : i.g.setTimeout); } function v(e, t, i, n, r) { return d .importKey("raw", e, { name: "PBKDF2" }, !1, ["deriveBits"]) .then(function (e) { return d.deriveBits( { name: "PBKDF2", salt: t, iterations: i, hash: { name: r } }, e, n << 3 ); }) .then(function (e) { return a.from(e); }); } function m(e, t) { e.then( function (e) { p()(function () { t(null, e); }); }, function (e) { p()(function () { t(e); }); } ); } e.exports = function (e, t, n, r, a, d) { "function" == typeof a && ((d = a), (a = void 0)); var f = u[(a = a || "sha1").toLowerCase()]; if (!f || "function" != typeof i.g.Promise) { p()(function () { var i; try { i = l(e, t, n, r, a); } catch (e) { return d(e); } d(null, i); }); return; } if ( (o(n, r), (e = c(e, s, "Password")), (t = c(t, s, "Salt")), "function" != typeof d) ) throw Error("No callback provided to pbkdf2"); m( h(f).then(function (i) { return i ? v(e, t, n, r, f) : l(e, t, n, r, a); }), d ); }; }, 365330: function (e, t, i) { var n, r = i(499845); (n = i.g.process && i.g.process.browser ? "utf-8" : i.g.process && i.g.process.version ? parseInt(r.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary" : "utf-8"), (e.exports = n); }, 947889: function (e) { var t = 0x3fffffff; e.exports = function (e, i) { if ("number" != typeof e) throw TypeError("Iterations not a number"); if (e < 0) throw TypeError("Bad iterations"); if ("number" != typeof i) throw TypeError("Key length not a number"); if (i < 0 || i > t || i != i) throw TypeError("Bad key length"); }; }, 294374: function (e, t, i) { var n = i(318042), r = i(866818), a = i(673664), o = i(140860).Buffer, s = i(947889), l = i(365330), c = i(414712), d = o.alloc(128), u = { md5: 16, sha1: 20, sha224: 28, sha256: 32, sha384: 48, sha512: 64, rmd160: 20, ripemd160: 20, }; function f(e, t, i) { var n = h(e), r = "sha512" === e || "sha384" === e ? 128 : 64; t.length > r ? (t = n(t)) : t.length < r && (t = o.concat([t, d], r)); for ( var a = o.allocUnsafe(r + u[e]), s = o.allocUnsafe(r + u[e]), l = 0; l < r; l++ ) (a[l] = 54 ^ t[l]), (s[l] = 92 ^ t[l]); var c = o.allocUnsafe(r + i + 4); a.copy(c, 0, 0, r), (this.ipad1 = c), (this.ipad2 = a), (this.opad = s), (this.alg = e), (this.blocksize = r), (this.hash = n), (this.size = u[e]); } function h(e) { function t(t) { return a(e).update(t).digest(); } function i(e) { return new r().update(e).digest(); } return "rmd160" === e || "ripemd160" === e ? i : "md5" === e ? n : t; } function p(e, t, i, n, r) { s(i, n), (e = c(e, l, "Password")), (t = c(t, l, "Salt")); var a = new f((r = r || "sha1"), e, t.length), d = o.allocUnsafe(n), h = o.allocUnsafe(t.length + 4); t.copy(h, 0, 0, t.length); for (var p = 0, v = u[r], m = Math.ceil(n / v), g = 1; g <= m; g++) { h.writeUInt32BE(g, t.length); for (var _ = a.run(h, a.ipad1), y = _, b = 1; b < i; b++) { y = a.run(y, a.ipad2); for (var I = 0; I < v; I++) _[I] ^= y[I]; } _.copy(d, p), (p += v); } return d; } (f.prototype.run = function (e, t) { return ( e.copy(t, this.blocksize), this.hash(t).copy(this.opad, this.blocksize), this.hash(this.opad) ); }), (e.exports = p); }, 414712: function (e, t, i) { var n = i(140860).Buffer; e.exports = function (e, t, i) { if (n.isBuffer(e)) return e; if ("string" == typeof e) return n.from(e, t); if (ArrayBuffer.isView(e)) return n.from(e.buffer); else throw TypeError( i + " must be a string, a Buffer, a typed array or a DataView" ); }; }, 229867: function (e, t, i) { "use strict"; var n = i(499845); function r(e, t, i, r) { if ("function" != typeof e) throw TypeError('"callback" argument must be a function'); var a, o, s = arguments.length; switch (s) { case 0: case 1: return n.nextTick(e); case 2: return n.nextTick(function () { e.call(null, t); }); case 3: return n.nextTick(function () { e.call(null, t, i); }); case 4: return n.nextTick(function () { e.call(null, t, i, r); }); default: for (a = Array(s - 1), o = 0; o < a.length; ) a[o++] = arguments[o]; return n.nextTick(function () { e.apply(null, a); }); } } void 0 !== n && n.version && 0 !== n.version.indexOf("v0.") && (0 !== n.version.indexOf("v1.") || 0 === n.version.indexOf("v1.8.")) ? (e.exports = n) : (e.exports = { nextTick: r }); }, 196589: function (e, t, i) { (t.publicEncrypt = i(286413)), (t.privateDecrypt = i(304944)), (t.privateEncrypt = function (e, i) { return t.publicEncrypt(e, i, !0); }), (t.publicDecrypt = function (e, i) { return t.privateDecrypt(e, i, !0); }); }, 9810: function (e, t, i) { var n = i(669683), r = i(140860).Buffer; function a(e) { var t = r.allocUnsafe(4); return t.writeUInt32BE(e, 0), t; } e.exports = function (e, t) { for (var i, o = r.alloc(0), s = 0; o.length < t; ) (i = a(s++)), (o = r.concat([o, n("sha1").update(e).update(i).digest()])); return o.slice(0, t); }; }, 304944: function (e, t, i) { var n = i(189939), r = i(9810), a = i(597875), o = i(984826), s = i(134558), l = i(669683), c = i(719355), d = i(140860).Buffer; function u(e, t) { var i = e.modulus.byteLength(), n = l("sha1").update(d.alloc(0)).digest(), o = n.length; if (0 !== t[0]) throw Error("decryption error"); var s = t.slice(1, o + 1), c = t.slice(o + 1), u = a(s, r(c, o)), f = a(c, r(u, i - o - 1)); if (h(n, f.slice(0, o))) throw Error("decryption error"); for (var p = o; 0 === f[p]; ) p++; if (1 !== f[p++]) throw Error("decryption error"); return f.slice(p); } function f(e, t, i) { for (var n = t.slice(0, 2), r = 2, a = 0; 0 !== t[r++]; ) if (r >= t.length) { a++; break; } var o = t.slice(2, r - 1); if ( ((("0002" !== n.toString("hex") && !i) || ("0001" !== n.toString("hex") && i)) && a++, o.length < 8 && a++, a) ) throw Error("decryption error"); return t.slice(r); } function h(e, t) { (e = d.from(e)), (t = d.from(t)); var i = 0, n = e.length; e.length !== t.length && (i++, (n = Math.min(e.length, t.length))); for (var r = -1; ++r < n; ) i += e[r] ^ t[r]; return i; } e.exports = function (e, t, i) { r = e.padding ? e.padding : i ? 1 : 4; var r, a, l = n(e), h = l.modulus.byteLength(); if (t.length > h || new o(t).cmp(l.modulus) >= 0) throw Error("decryption error"); a = i ? c(new o(t), l) : s(t, l); var p = d.alloc(h - a.length); if (((a = d.concat([p, a], h)), 4 === r)) return u(l, a); if (1 === r) return f(l, a, i); if (3 === r) return a; else throw Error("unknown padding"); }; }, 286413: function (e, t, i) { var n = i(189939), r = i(203960), a = i(669683), o = i(9810), s = i(597875), l = i(984826), c = i(719355), d = i(134558), u = i(140860).Buffer; function f(e, t) { var i = e.modulus.byteLength(), n = t.length, c = a("sha1").update(u.alloc(0)).digest(), d = c.length, f = 2 * d; if (n > i - f - 2) throw Error("message too long"); var h = u.alloc(i - n - f - 2), p = i - d - 1, v = r(d), m = s(u.concat([c, h, u.alloc(1, 1), t], p), o(v, p)), g = s(v, o(m, d)); return new l(u.concat([u.alloc(1), g, m], i)); } function h(e, t, i) { var n, r = t.length, a = e.modulus.byteLength(); if (r > a - 11) throw Error("message too long"); return ( (n = i ? u.alloc(a - r - 3, 255) : p(a - r - 3)), new l(u.concat([u.from([0, i ? 1 : 2]), n, u.alloc(1), t], a)) ); } function p(e) { for (var t, i = u.allocUnsafe(e), n = 0, a = r(2 * e), o = 0; n < e; ) o === a.length && ((a = r(2 * e)), (o = 0)), (t = a[o++]) && (i[n++] = t); return i; } e.exports = function (e, t, i) { r = e.padding ? e.padding : i ? 1 : 4; var r, a, o = n(e); if (4 === r) a = f(o, t); else if (1 === r) a = h(o, t, i); else if (3 === r) { if ((a = new l(t)).cmp(o.modulus) >= 0) throw Error("data too long for modulus"); } else throw Error("unknown padding"); return i ? d(a, o) : c(a, o); }; }, 719355: function (e, t, i) { var n = i(984826), r = i(140860).Buffer; function a(e, t) { return r.from( e .toRed(n.mont(t.modulus)) .redPow(new n(t.publicExponent)) .fromRed() .toArray() ); } e.exports = a; }, 597875: function (e) { e.exports = function (e, t) { for (var i = e.length, n = -1; ++n < i; ) e[n] ^= t[n]; return e; }; }, 203960: function (e, t, i) { "use strict"; var n = i(499845), r = 65536, a = 0xffffffff; function o() { throw Error( "Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11" ); } var s = i(140860).Buffer, l = i.g.crypto || i.g.msCrypto; function c(e, t) { if (e > a) throw RangeError("requested too many random bytes"); var i = s.allocUnsafe(e); if (e > 0) { if (e > r) for (var o = 0; o < e; o += r) l.getRandomValues(i.slice(o, o + r)); else l.getRandomValues(i); } return "function" == typeof t ? n.nextTick(function () { t(null, i); }) : i; } l && l.getRandomValues ? (e.exports = c) : (e.exports = o); }, 278056: function (e, t, i) { "use strict"; var n = i(499845); function r() { throw Error( "secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11" ); } var a = i(140860), o = i(203960), s = a.Buffer, l = a.kMaxLength, c = i.g.crypto || i.g.msCrypto, d = 0xffffffff; function u(e, t) { if ("number" != typeof e || e != e) throw TypeError("offset must be a number"); if (e > d || e < 0) throw TypeError("offset must be a uint32"); if (e > l || e > t) throw RangeError("offset out of range"); } function f(e, t, i) { if ("number" != typeof e || e != e) throw TypeError("size must be a number"); if (e > d || e < 0) throw TypeError("size must be a uint32"); if (e + t > i || e > l) throw RangeError("buffer too small"); } function h(e, t, n, r) { if (!s.isBuffer(e) && !(e instanceof i.g.Uint8Array)) throw TypeError('"buf" argument must be a Buffer or Uint8Array'); if ("function" == typeof t) (r = t), (t = 0), (n = e.length); else if ("function" == typeof n) (r = n), (n = e.length - t); else if ("function" != typeof r) throw TypeError('"cb" argument must be a function'); return u(t, e.length), f(n, t, e.length), p(e, t, n, r); } function p(e, t, i, r) { if (n.browser) { var a = new Uint8Array(e.buffer, t, i); if ((c.getRandomValues(a), r)) { n.nextTick(function () { r(null, e); }); return; } return e; } if (r) { o(i, function (i, n) { if (i) return r(i); n.copy(e, t), r(null, e); }); return; } return o(i).copy(e, t), e; } function v(e, t, n) { if ( (void 0 === t && (t = 0), !s.isBuffer(e) && !(e instanceof i.g.Uint8Array)) ) throw TypeError('"buf" argument must be a Buffer or Uint8Array'); return ( u(t, e.length), void 0 === n && (n = e.length - t), f(n, t, e.length), p(e, t, n) ); } (c && c.getRandomValues) || !n.browser ? ((t.randomFill = h), (t.randomFillSync = v)) : ((t.randomFill = r), (t.randomFillSync = r)); }, 414024: function (e, t, i) { "use strict"; var n = i(229867), r = Object.keys || function (e) { var t = []; for (var i in e) t.push(i); return t; }; e.exports = u; var a = Object.create(i(975952)); a.inherits = i(32016); var o = i(752644), s = i(762308); a.inherits(u, o); for (var l = r(s.prototype), c = 0; c < l.length; c++) { var d = l[c]; !u.prototype[d] && (u.prototype[d] = s.prototype[d]); } function u(e) { if (!(this instanceof u)) return new u(e); o.call(this, e), s.call(this, e), e && !1 === e.readable && (this.readable = !1), e && !1 === e.writable && (this.writable = !1), (this.allowHalfOpen = !0), e && !1 === e.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", f); } function f() { !this.allowHalfOpen && !this._writableState.ended && n.nextTick(h, this); } function h(e) { e.end(); } Object.defineProperty(u.prototype, "writableHighWaterMark", { enumerable: !1, get: function () { return this._writableState.highWaterMark; }, }), Object.defineProperty(u.prototype, "destroyed", { get: function () { return ( void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed ); }, set: function (e) { if ( void 0 !== this._readableState && void 0 !== this._writableState ) (this._readableState.destroyed = e), (this._writableState.destroyed = e); }, }), (u.prototype._destroy = function (e, t) { this.push(null), this.end(), n.nextTick(t, e); }); }, 877797: function (e, t, i) { "use strict"; e.exports = a; var n = i(930377), r = Object.create(i(975952)); function a(e) { if (!(this instanceof a)) return new a(e); n.call(this, e); } (r.inherits = i(32016)), r.inherits(a, n), (a.prototype._transform = function (e, t, i) { i(null, e); }); }, 752644: function (e, t, i) { "use strict"; var n, r, a = i(499845), o = i(229867); e.exports = w; var s = i(991546); (w.ReadableState = I), i(122582).EventEmitter; var l = function (e, t) { return e.listeners(t).length; }, c = i(429775), d = i(225877).Buffer, u = (void 0 !== i.g ? i.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {} ).Uint8Array || function () {}; function f(e) { return d.from(e); } function h(e) { return d.isBuffer(e) || e instanceof u; } var p = Object.create(i(975952)); p.inherits = i(32016); var v = i(14059), m = void 0; m = v && v.debuglog ? v.debuglog("stream") : function () {}; var g = i(983015), _ = i(786949); p.inherits(w, c); var y = ["error", "close", "destroy", "pause", "resume"]; function b(e, t, i) { if ("function" == typeof e.prependListener) return e.prependListener(t, i); e._events && e._events[t] ? s(e._events[t]) ? e._events[t].unshift(i) : (e._events[t] = [i, e._events[t]]) : e.on(t, i); } function I(e, t) { (n = n || i(414024)), (e = e || {}); var a = t instanceof n; (this.objectMode = !!e.objectMode), a && (this.objectMode = this.objectMode || !!e.readableObjectMode); var o = e.highWaterMark, s = e.readableHighWaterMark, l = this.objectMode ? 16 : 16384; o || 0 === o ? (this.highWaterMark = o) : a && (s || 0 === s) ? (this.highWaterMark = s) : (this.highWaterMark = l), (this.highWaterMark = Math.floor(this.highWaterMark)), (this.buffer = new g()), (this.length = 0), (this.pipes = null), (this.pipesCount = 0), (this.flowing = null), (this.ended = !1), (this.endEmitted = !1), (this.reading = !1), (this.sync = !0), (this.needReadable = !1), (this.emittedReadable = !1), (this.readableListening = !1), (this.resumeScheduled = !1), (this.destroyed = !1), (this.defaultEncoding = e.defaultEncoding || "utf8"), (this.awaitDrain = 0), (this.readingMore = !1), (this.decoder = null), (this.encoding = null), e.encoding && (!r && (r = i(659406).StringDecoder), (this.decoder = new r(e.encoding)), (this.encoding = e.encoding)); } function w(e) { if (((n = n || i(414024)), !(this instanceof w))) return new w(e); (this._readableState = new I(e, this)), (this.readable = !0), e && ("function" == typeof e.read && (this._read = e.read), "function" == typeof e.destroy && (this._destroy = e.destroy)), c.call(this); } function x(e, t, i, n, r) { var a, o = e._readableState; return ( null === t ? ((o.reading = !1), P(e, o)) : (!r && (a = M(o, t)), a ? e.emit("error", a) : o.objectMode || (t && t.length > 0) ? ("string" != typeof t && !o.objectMode && Object.getPrototypeOf(t) !== d.prototype && (t = f(t)), n ? o.endEmitted ? e.emit( "error", Error("stream.unshift() after end event") ) : S(e, o, t, !0) : o.ended ? e.emit("error", Error("stream.push() after EOF")) : ((o.reading = !1), o.decoder && !i ? ((t = o.decoder.write(t)), o.objectMode || 0 !== t.length ? S(e, o, t, !1) : R(e, o)) : S(e, o, t, !1))) : !n && (o.reading = !1)), C(o) ); } function S(e, t, i, n) { t.flowing && 0 === t.length && !t.sync ? (e.emit("data", i), e.read(0)) : ((t.length += t.objectMode ? 1 : i.length), n ? t.buffer.unshift(i) : t.buffer.push(i), t.needReadable && E(e)), R(e, t); } function M(e, t) { var i; return ( !h(t) && "string" != typeof t && void 0 !== t && !e.objectMode && (i = TypeError("Invalid non-string/buffer chunk")), i ); } function C(e) { return ( !e.ended && (e.needReadable || e.length < e.highWaterMark || 0 === e.length) ); } Object.defineProperty(w.prototype, "destroyed", { get: function () { return ( void 0 !== this._readableState && this._readableState.destroyed ); }, set: function (e) { if (!!this._readableState) this._readableState.destroyed = e; }, }), (w.prototype.destroy = _.destroy), (w.prototype._undestroy = _.undestroy), (w.prototype._destroy = function (e, t) { this.push(null), t(e); }), (w.prototype.push = function (e, t) { var i, n = this._readableState; return ( n.objectMode ? (i = !0) : "string" == typeof e && ((t = t || n.defaultEncoding) !== n.encoding && ((e = d.from(e, t)), (t = "")), (i = !0)), x(this, e, t, !1, i) ); }), (w.prototype.unshift = function (e) { return x(this, e, null, !0, !1); }), (w.prototype.isPaused = function () { return !1 === this._readableState.flowing; }), (w.prototype.setEncoding = function (e) { return ( !r && (r = i(659406).StringDecoder), (this._readableState.decoder = new r(e)), (this._readableState.encoding = e), this ); }); var T = 8388608; function A(e) { return ( e >= T ? (e = T) : (e--, (e |= e >>> 1), (e |= e >>> 2), (e |= e >>> 4), (e |= e >>> 8), (e |= e >>> 16), e++), e ); } function k(e, t) { if (e <= 0 || (0 === t.length && t.ended)) return 0; if (t.objectMode) return 1; if (e != e) return t.flowing && t.length ? t.buffer.head.data.length : t.length; return (e > t.highWaterMark && (t.highWaterMark = A(e)), e <= t.length) ? e : t.ended ? t.length : ((t.needReadable = !0), 0); } function P(e, t) { if (!t.ended) { if (t.decoder) { var i = t.decoder.end(); i && i.length && (t.buffer.push(i), (t.length += t.objectMode ? 1 : i.length)); } (t.ended = !0), E(e); } } function E(e) { var t = e._readableState; (t.needReadable = !1), !t.emittedReadable && (m("emitReadable", t.flowing), (t.emittedReadable = !0), t.sync ? o.nextTick(D, e) : D(e)); } function D(e) { m("emit readable"), e.emit("readable"), F(e); } function R(e, t) { !t.readingMore && ((t.readingMore = !0), o.nextTick(N, e, t)); } function N(e, t) { for ( var i = t.length; !t.reading && !t.flowing && !t.ended && t.length < t.highWaterMark && (m("maybeReadMore read 0"), e.read(0), i !== t.length); ) { i = t.length; } t.readingMore = !1; } function L(e) { return function () { var t = e._readableState; m("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain--, 0 === t.awaitDrain && l(e, "data") && ((t.flowing = !0), F(e)); }; } function j(e) { m("readable nexttick read 0"), e.read(0); } function O(e, t) { !t.resumeScheduled && ((t.resumeScheduled = !0), o.nextTick(B, e, t)); } function B(e, t) { !t.reading && (m("resume read 0"), e.read(0)), (t.resumeScheduled = !1), (t.awaitDrain = 0), e.emit("resume"), F(e), t.flowing && !t.reading && e.read(0); } function F(e) { var t = e._readableState; for (m("flow", t.flowing); t.flowing && null !== e.read(); ); } function U(e, t) { var i; return 0 === t.length ? null : (t.objectMode ? (i = t.buffer.shift()) : !e || e >= t.length ? ((i = t.decoder ? t.buffer.join("") : 1 === t.buffer.length ? t.buffer.head.data : t.buffer.concat(t.length)), t.buffer.clear()) : (i = G(e, t.buffer, t.decoder)), i); } function G(e, t, i) { var n; return ( e < t.head.data.length ? ((n = t.head.data.slice(0, e)), (t.head.data = t.head.data.slice(e))) : (n = e === t.head.data.length ? t.shift() : i ? z(e, t) : V(e, t)), n ); } function z(e, t) { var i = t.head, n = 1, r = i.data; for (e -= r.length; (i = i.next); ) { var a = i.data, o = e > a.length ? a.length : e; if ( (o === a.length ? (r += a) : (r += a.slice(0, e)), 0 == (e -= o)) ) { o === a.length ? (++n, i.next ? (t.head = i.next) : (t.head = t.tail = null)) : ((t.head = i), (i.data = a.slice(o))); break; } ++n; } return (t.length -= n), r; } function V(e, t) { var i = d.allocUnsafe(e), n = t.head, r = 1; for (n.data.copy(i), e -= n.data.length; (n = n.next); ) { var a = n.data, o = e > a.length ? a.length : e; if ((a.copy(i, i.length - e, 0, o), 0 == (e -= o))) { o === a.length ? (++r, n.next ? (t.head = n.next) : (t.head = t.tail = null)) : ((t.head = n), (n.data = a.slice(o))); break; } ++r; } return (t.length -= r), i; } function W(e) { var t = e._readableState; if (t.length > 0) throw Error('"endReadable()" called on non-empty stream'); !t.endEmitted && ((t.ended = !0), o.nextTick(Z, t, e)); } function Z(e, t) { !e.endEmitted && 0 === e.length && ((e.endEmitted = !0), (t.readable = !1), t.emit("end")); } function K(e, t) { for (var i = 0, n = e.length; i < n; i++) if (e[i] === t) return i; return -1; } (w.prototype.read = function (e) { m("read", e), (e = parseInt(e, 10)); var t, i = this._readableState, n = e; if ( (0 !== e && (i.emittedReadable = !1), 0 === e && i.needReadable && (i.length >= i.highWaterMark || i.ended)) ) return ( m("read: emitReadable", i.length, i.ended), 0 === i.length && i.ended ? W(this) : E(this), null ); if (0 === (e = k(e, i)) && i.ended) return 0 === i.length && W(this), null; var r = i.needReadable; return ( m("need readable", r), (0 === i.length || i.length - e < i.highWaterMark) && m("length less than watermark", (r = !0)), i.ended || i.reading ? m("reading or ended", (r = !1)) : r && (m("do read"), (i.reading = !0), (i.sync = !0), 0 === i.length && (i.needReadable = !0), this._read(i.highWaterMark), (i.sync = !1), !i.reading && (e = k(n, i))), null === (t = e > 0 ? U(e, i) : null) ? ((i.needReadable = !0), (e = 0)) : (i.length -= e), 0 === i.length && (!i.ended && (i.needReadable = !0), n !== e && i.ended && W(this)), null !== t && this.emit("data", t), t ); }), (w.prototype._read = function (e) { this.emit("error", Error("_read() is not implemented")); }), (w.prototype.pipe = function (e, t) { var i = this, n = this._readableState; switch (n.pipesCount) { case 0: n.pipes = e; break; case 1: n.pipes = [n.pipes, e]; break; default: n.pipes.push(e); } (n.pipesCount += 1), m("pipe count=%d opts=%j", n.pipesCount, t); var r = (t && !1 === t.end) || e === a.stdout || e === a.stderr ? y : c; function s(e, t) { m("onunpipe"), e === i && t && !1 === t.hasUnpiped && ((t.hasUnpiped = !0), f()); } function c() { m("onend"), e.end(); } n.endEmitted ? o.nextTick(r) : i.once("end", r), e.on("unpipe", s); var d = L(i); e.on("drain", d); var u = !1; function f() { m("cleanup"), e.removeListener("close", g), e.removeListener("finish", _), e.removeListener("drain", d), e.removeListener("error", v), e.removeListener("unpipe", s), i.removeListener("end", c), i.removeListener("end", y), i.removeListener("data", p), (u = !0), n.awaitDrain && (!e._writableState || e._writableState.needDrain) && d(); } var h = !1; function p(t) { m("ondata"), (h = !1), !1 === e.write(t) && !h && (((1 === n.pipesCount && n.pipes === e) || (n.pipesCount > 1 && -1 !== K(n.pipes, e))) && !u && (m("false write response, pause", n.awaitDrain), n.awaitDrain++, (h = !0)), i.pause()); } function v(t) { m("onerror", t), y(), e.removeListener("error", v), 0 === l(e, "error") && e.emit("error", t); } function g() { e.removeListener("finish", _), y(); } function _() { m("onfinish"), e.removeListener("close", g), y(); } function y() { m("unpipe"), i.unpipe(e); } return ( i.on("data", p), b(e, "error", v), e.once("close", g), e.once("finish", _), e.emit("pipe", i), !n.flowing && (m("pipe resume"), i.resume()), e ); }), (w.prototype.unpipe = function (e) { var t = this._readableState, i = { hasUnpiped: !1 }; if (0 === t.pipesCount) return this; if (1 === t.pipesCount) return e && e !== t.pipes ? this : (!e && (e = t.pipes), (t.pipes = null), (t.pipesCount = 0), (t.flowing = !1), e && e.emit("unpipe", this, i), this); if (!e) { var n = t.pipes, r = t.pipesCount; (t.pipes = null), (t.pipesCount = 0), (t.flowing = !1); for (var a = 0; a < r; a++) n[a].emit("unpipe", this, { hasUnpiped: !1 }); return this; } var o = K(t.pipes, e); return -1 === o ? this : (t.pipes.splice(o, 1), (t.pipesCount -= 1), 1 === t.pipesCount && (t.pipes = t.pipes[0]), e.emit("unpipe", this, i), this); }), (w.prototype.on = function (e, t) { var i = c.prototype.on.call(this, e, t); if ("data" === e) !1 !== this._readableState.flowing && this.resume(); else if ("readable" === e) { var n = this._readableState; !n.endEmitted && !n.readableListening && ((n.readableListening = n.needReadable = !0), (n.emittedReadable = !1), n.reading ? n.length && E(this) : o.nextTick(j, this)); } return i; }), (w.prototype.addListener = w.prototype.on), (w.prototype.resume = function () { var e = this._readableState; return ( !e.flowing && (m("resume"), (e.flowing = !0), O(this, e)), this ); }), (w.prototype.pause = function () { return ( m("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (m("pause"), (this._readableState.flowing = !1), this.emit("pause")), this ); }), (w.prototype.wrap = function (e) { var t = this, i = this._readableState, n = !1; for (var r in (e.on("end", function () { if ((m("wrapped end"), i.decoder && !i.ended)) { var e = i.decoder.end(); e && e.length && t.push(e); } t.push(null); }), e.on("data", function (r) { if ( (m("wrapped data"), i.decoder && (r = i.decoder.write(r)), i.objectMode && null == r) ) return; if (!!i.objectMode || (!!r && !!r.length)) !t.push(r) && ((n = !0), e.pause()); }), e)) void 0 === this[r] && "function" == typeof e[r] && (this[r] = (function (t) { return function () { return e[t].apply(e, arguments); }; })(r)); for (var a = 0; a < y.length; a++) e.on(y[a], this.emit.bind(this, y[a])); return ( (this._read = function (t) { m("wrapped _read", t), n && ((n = !1), e.resume()); }), this ); }), Object.defineProperty(w.prototype, "readableHighWaterMark", { enumerable: !1, get: function () { return this._readableState.highWaterMark; }, }), (w._fromList = U); }, 930377: function (e, t, i) { "use strict"; e.exports = o; var n = i(414024), r = Object.create(i(975952)); function a(e, t) { var i = this._transformState; i.transforming = !1; var n = i.writecb; if (!n) return this.emit( "error", Error("write callback called multiple times") ); (i.writechunk = null), (i.writecb = null), null != t && this.push(t), n(e); var r = this._readableState; (r.reading = !1), (r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark); } function o(e) { if (!(this instanceof o)) return new o(e); n.call(this, e), (this._transformState = { afterTransform: a.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null, }), (this._readableState.needReadable = !0), (this._readableState.sync = !1), e && ("function" == typeof e.transform && (this._transform = e.transform), "function" == typeof e.flush && (this._flush = e.flush)), this.on("prefinish", s); } function s() { var e = this; "function" == typeof this._flush ? this._flush(function (t, i) { l(e, t, i); }) : l(this, null, null); } function l(e, t, i) { if (t) return e.emit("error", t); if ((null != i && e.push(i), e._writableState.length)) throw Error("Calling transform done when ws.length != 0"); if (e._transformState.transforming) throw Error("Calling transform done when still transforming"); return e.push(null); } (r.inherits = i(32016)), r.inherits(o, n), (o.prototype.push = function (e, t) { return ( (this._transformState.needTransform = !1), n.prototype.push.call(this, e, t) ); }), (o.prototype._transform = function (e, t, i) { throw Error("_transform() is not implemented"); }), (o.prototype._write = function (e, t, i) { var n = this._transformState; if ( ((n.writecb = i), (n.writechunk = e), (n.writeencoding = t), !n.transforming) ) { var r = this._readableState; (n.needTransform || r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark); } }), (o.prototype._read = function (e) { var t = this._transformState; null !== t.writechunk && t.writecb && !t.transforming ? ((t.transforming = !0), this._transform(t.writechunk, t.writeencoding, t.afterTransform)) : (t.needTransform = !0); }), (o.prototype._destroy = function (e, t) { var i = this; n.prototype._destroy.call(this, e, function (e) { t(e), i.emit("close"); }); }); }, 762308: function (e, t, i) { "use strict"; var n, r, a = i(499845), o = i(229867); function s(e) { var t = this; (this.next = null), (this.entry = null), (this.finish = function () { j(t, e); }); } e.exports = y; var l = !a.browser && ["v0.10", "v0.9."].indexOf(a.version.slice(0, 5)) > -1 ? setImmediate : o.nextTick; y.WritableState = _; var c = Object.create(i(975952)); c.inherits = i(32016); var d = { deprecate: i(708333) }, u = i(429775), f = i(225877).Buffer, h = (void 0 !== i.g ? i.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {} ).Uint8Array || function () {}; function p(e) { return f.from(e); } function v(e) { return f.isBuffer(e) || e instanceof h; } var m = i(786949); function g() {} function _(e, t) { (n = n || i(414024)), (e = e || {}); var r = t instanceof n; (this.objectMode = !!e.objectMode), r && (this.objectMode = this.objectMode || !!e.writableObjectMode); var a = e.highWaterMark, o = e.writableHighWaterMark, l = this.objectMode ? 16 : 16384; a || 0 === a ? (this.highWaterMark = a) : r && (o || 0 === o) ? (this.highWaterMark = o) : (this.highWaterMark = l), (this.highWaterMark = Math.floor(this.highWaterMark)), (this.finalCalled = !1), (this.needDrain = !1), (this.ending = !1), (this.ended = !1), (this.finished = !1), (this.destroyed = !1); var c = !1 === e.decodeStrings; (this.decodeStrings = !c), (this.defaultEncoding = e.defaultEncoding || "utf8"), (this.length = 0), (this.writing = !1), (this.corked = 0), (this.sync = !0), (this.bufferProcessing = !1), (this.onwrite = function (e) { T(t, e); }), (this.writecb = null), (this.writelen = 0), (this.bufferedRequest = null), (this.lastBufferedRequest = null), (this.pendingcb = 0), (this.prefinished = !1), (this.errorEmitted = !1), (this.bufferedRequestCount = 0), (this.corkedRequestsFree = new s(this)); } function y(e) { if (((n = n || i(414024)), !r.call(y, this) && !(this instanceof n))) return new y(e); (this._writableState = new _(e, this)), (this.writable = !0), e && ("function" == typeof e.write && (this._write = e.write), "function" == typeof e.writev && (this._writev = e.writev), "function" == typeof e.destroy && (this._destroy = e.destroy), "function" == typeof e.final && (this._final = e.final)), u.call(this); } function b(e, t) { var i = Error("write after end"); e.emit("error", i), o.nextTick(t, i); } function I(e, t, i, n) { var r = !0, a = !1; return ( null === i ? (a = TypeError("May not write null values to stream")) : "string" != typeof i && void 0 !== i && !t.objectMode && (a = TypeError("Invalid non-string/buffer chunk")), a && (e.emit("error", a), o.nextTick(n, a), (r = !1)), r ); } function w(e, t, i) { return ( !e.objectMode && !1 !== e.decodeStrings && "string" == typeof t && (t = f.from(t, i)), t ); } function x(e, t, i, n, r, a) { if (!i) { var o = w(t, n, r); n !== o && ((i = !0), (r = "buffer"), (n = o)); } var s = t.objectMode ? 1 : n.length; t.length += s; var l = t.length < t.highWaterMark; if ((!l && (t.needDrain = !0), t.writing || t.corked)) { var c = t.lastBufferedRequest; (t.lastBufferedRequest = { chunk: n, encoding: r, isBuf: i, callback: a, next: null, }), c ? (c.next = t.lastBufferedRequest) : (t.bufferedRequest = t.lastBufferedRequest), (t.bufferedRequestCount += 1); } else S(e, t, !1, s, n, r, a); return l; } function S(e, t, i, n, r, a, o) { (t.writelen = n), (t.writecb = o), (t.writing = !0), (t.sync = !0), i ? e._writev(r, t.onwrite) : e._write(r, a, t.onwrite), (t.sync = !1); } function M(e, t, i, n, r) { --t.pendingcb, i ? (o.nextTick(r, n), o.nextTick(N, e, t), (e._writableState.errorEmitted = !0), e.emit("error", n)) : (r(n), (e._writableState.errorEmitted = !0), e.emit("error", n), N(e, t)); } function C(e) { (e.writing = !1), (e.writecb = null), (e.length -= e.writelen), (e.writelen = 0); } function T(e, t) { var i = e._writableState, n = i.sync, r = i.writecb; if ((C(i), t)) M(e, i, n, t, r); else { var a = E(i); !a && !i.corked && !i.bufferProcessing && i.bufferedRequest && P(e, i), n ? l(A, e, i, a, r) : A(e, i, a, r); } } function A(e, t, i, n) { !i && k(e, t), t.pendingcb--, n(), N(e, t); } function k(e, t) { 0 === t.length && t.needDrain && ((t.needDrain = !1), e.emit("drain")); } function P(e, t) { t.bufferProcessing = !0; var i = t.bufferedRequest; if (e._writev && i && i.next) { var n = Array(t.bufferedRequestCount), r = t.corkedRequestsFree; r.entry = i; for (var a = 0, o = !0; i; ) (n[a] = i), !i.isBuf && (o = !1), (i = i.next), (a += 1); (n.allBuffers = o), S(e, t, !0, t.length, n, "", r.finish), t.pendingcb++, (t.lastBufferedRequest = null), r.next ? ((t.corkedRequestsFree = r.next), (r.next = null)) : (t.corkedRequestsFree = new s(t)), (t.bufferedRequestCount = 0); } else { for (; i; ) { var l = i.chunk, c = i.encoding, d = i.callback, u = t.objectMode ? 1 : l.length; if ( (S(e, t, !1, u, l, c, d), (i = i.next), t.bufferedRequestCount--, t.writing) ) break; } null === i && (t.lastBufferedRequest = null); } (t.bufferedRequest = i), (t.bufferProcessing = !1); } function E(e) { return ( e.ending && 0 === e.length && null === e.bufferedRequest && !e.finished && !e.writing ); } function D(e, t) { e._final(function (i) { t.pendingcb--, i && e.emit("error", i), (t.prefinished = !0), e.emit("prefinish"), N(e, t); }); } function R(e, t) { !t.prefinished && !t.finalCalled && ("function" == typeof e._final ? (t.pendingcb++, (t.finalCalled = !0), o.nextTick(D, e, t)) : ((t.prefinished = !0), e.emit("prefinish"))); } function N(e, t) { var i = E(t); return ( i && (R(e, t), 0 === t.pendingcb && ((t.finished = !0), e.emit("finish"))), i ); } function L(e, t, i) { (t.ending = !0), N(e, t), i && (t.finished ? o.nextTick(i) : e.once("finish", i)), (t.ended = !0), (e.writable = !1); } function j(e, t, i) { var n = e.entry; for (e.entry = null; n; ) { var r = n.callback; t.pendingcb--, r(i), (n = n.next); } t.corkedRequestsFree.next = e; } c.inherits(y, u), (_.prototype.getBuffer = function () { for (var e = this.bufferedRequest, t = []; e; ) t.push(e), (e = e.next); return t; }), !(function () { try { Object.defineProperty(_.prototype, "buffer", { get: d.deprecate( function () { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003" ), }); } catch (e) {} })(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? ((r = Function.prototype[Symbol.hasInstance]), Object.defineProperty(y, Symbol.hasInstance, { value: function (e) { return ( !!r.call(this, e) || (this === y && e && e._writableState instanceof _) ); }, })) : (r = function (e) { return e instanceof this; }), (y.prototype.pipe = function () { this.emit("error", Error("Cannot pipe, not readable")); }), (y.prototype.write = function (e, t, i) { var n = this._writableState, r = !1, a = !n.objectMode && v(e); return ( a && !f.isBuffer(e) && (e = p(e)), "function" == typeof t && ((i = t), (t = null)), a ? (t = "buffer") : !t && (t = n.defaultEncoding), "function" != typeof i && (i = g), n.ended ? b(this, i) : (a || I(this, n, e, i)) && (n.pendingcb++, (r = x(this, n, a, e, t, i))), r ); }), (y.prototype.cork = function () { var e = this._writableState; e.corked++; }), (y.prototype.uncork = function () { var e = this._writableState; e.corked && (e.corked--, !e.writing && !e.corked && !e.bufferProcessing && e.bufferedRequest && P(this, e)); }), (y.prototype.setDefaultEncoding = function (e) { if ( ("string" == typeof e && (e = e.toLowerCase()), !( [ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw", ].indexOf((e + "").toLowerCase()) > -1 )) ) throw TypeError("Unknown encoding: " + e); return (this._writableState.defaultEncoding = e), this; }), Object.defineProperty(y.prototype, "writableHighWaterMark", { enumerable: !1, get: function () { return this._writableState.highWaterMark; }, }), (y.prototype._write = function (e, t, i) { i(Error("_write() is not implemented")); }), (y.prototype._writev = null), (y.prototype.end = function (e, t, i) { var n = this._writableState; "function" == typeof e ? ((i = e), (e = null), (t = null)) : "function" == typeof t && ((i = t), (t = null)), null != e && this.write(e, t), n.corked && ((n.corked = 1), this.uncork()), !n.ending && L(this, n, i); }), Object.defineProperty(y.prototype, "destroyed", { get: function () { return ( void 0 !== this._writableState && this._writableState.destroyed ); }, set: function (e) { if (!!this._writableState) this._writableState.destroyed = e; }, }), (y.prototype.destroy = m.destroy), (y.prototype._undestroy = m.undestroy), (y.prototype._destroy = function (e, t) { this.end(), t(e); }); }, 983015: function (e, t, i) { "use strict"; function n(e, t) { if (!(e instanceof t)) throw TypeError("Cannot call a class as a function"); } var r = i(225877).Buffer, a = i(403204); function o(e, t, i) { e.copy(t, i); } (e.exports = (function () { function e() { n(this, e), (this.head = null), (this.tail = null), (this.length = 0); } return ( (e.prototype.push = function (e) { var t = { data: e, next: null }; this.length > 0 ? (this.tail.next = t) : (this.head = t), (this.tail = t), ++this.length; }), (e.prototype.unshift = function (e) { var t = { data: e, next: this.head }; 0 === this.length && (this.tail = t), (this.head = t), ++this.length; }), (e.prototype.shift = function () { if (0 !== this.length) { var e = this.head.data; return ( 1 === this.length ? (this.head = this.tail = null) : (this.head = this.head.next), --this.length, e ); } }), (e.prototype.clear = function () { (this.head = this.tail = null), (this.length = 0); }), (e.prototype.join = function (e) { if (0 === this.length) return ""; for (var t = this.head, i = "" + t.data; (t = t.next); ) i += e + t.data; return i; }), (e.prototype.concat = function (e) { if (0 === this.length) return r.alloc(0); for (var t = r.allocUnsafe(e >>> 0), i = this.head, n = 0; i; ) o(i.data, t, n), (n += i.data.length), (i = i.next); return t; }), e ); })()), a && a.inspect && a.inspect.custom && (e.exports.prototype[a.inspect.custom] = function () { var e = a.inspect({ length: this.length }); return this.constructor.name + " " + e; }); }, 786949: function (e, t, i) { "use strict"; var n = i(229867); function r(e, t) { var i = this, r = this._readableState && this._readableState.destroyed, a = this._writableState && this._writableState.destroyed; return r || a ? (t ? t(e) : e && (this._writableState ? !this._writableState.errorEmitted && ((this._writableState.errorEmitted = !0), n.nextTick(o, this, e)) : n.nextTick(o, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function (e) { !t && e ? i._writableState ? !i._writableState.errorEmitted && ((i._writableState.errorEmitted = !0), n.nextTick(o, i, e)) : n.nextTick(o, i, e) : t && t(e); }), this); } function a() { this._readableState && ((this._readableState.destroyed = !1), (this._readableState.reading = !1), (this._readableState.ended = !1), (this._readableState.endEmitted = !1)), this._writableState && ((this._writableState.destroyed = !1), (this._writableState.ended = !1), (this._writableState.ending = !1), (this._writableState.finalCalled = !1), (this._writableState.prefinished = !1), (this._writableState.finished = !1), (this._writableState.errorEmitted = !1)); } function o(e, t) { e.emit("error", t); } e.exports = { destroy: r, undestroy: a }; }, 429775: function (e, t, i) { e.exports = i(122582).EventEmitter; }, 324727: function (e, t, i) { ((t = e.exports = i(752644)).Stream = t), (t.Readable = t), (t.Writable = i(762308)), (t.Duplex = i(414024)), (t.Transform = i(930377)), (t.PassThrough = i(877797)); }, 376298: function (e) { "use strict"; function t(e, t) { (e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), (e.__proto__ = t); } var i = {}; function n(e, n, r) { function a(e, t, i) { return "string" == typeof n ? n : n(e, t, i); } !r && (r = Error); var o = (function (e) { function i(t, i, n) { return e.call(this, a(t, i, n)) || this; } return t(i, e), i; })(r); (o.prototype.name = r.name), (o.prototype.code = e), (i[e] = o); } function r(e, t) { if (!Array.isArray(e)) return "of ".concat(t, " ").concat(String(e)); var i = e.length; return ((e = e.map(function (e) { return String(e); })), i > 2) ? "one of " .concat(t, " ") .concat(e.slice(0, i - 1).join(", "), ", or ") + e[i - 1] : 2 === i ? "one of ".concat(t, " ").concat(e[0], " or ").concat(e[1]) : "of ".concat(t, " ").concat(e[0]); } function a(e, t, i) { return e.substr(!i || i < 0 ? 0 : +i, t.length) === t; } function o(e, t, i) { return ( (void 0 === i || i > e.length) && (i = e.length), e.substring(i - t.length, i) === t ); } function s(e, t, i) { return ( "number" != typeof i && (i = 0), !(i + t.length > e.length) && -1 !== e.indexOf(t, i) ); } n( "ERR_INVALID_OPT_VALUE", function (e, t) { return 'The value "' + t + '" is invalid for option "' + e + '"'; }, TypeError ), n( "ERR_INVALID_ARG_TYPE", function (e, t, i) { if ( ("string" == typeof t && a(t, "not ") ? ((n = "must not be"), (t = t.replace(/^not /, ""))) : (n = "must be"), o(e, " argument")) ) l = "The ".concat(e, " ").concat(n, " ").concat(r(t, "type")); else { var n, l, c = s(e, ".") ? "property" : "argument"; l = 'The "' .concat(e, '" ') .concat(c, " ") .concat(n, " ") .concat(r(t, "type")); } return (l += ". Received type ".concat(typeof i)); }, TypeError ), n("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), n("ERR_METHOD_NOT_IMPLEMENTED", function (e) { return "The " + e + " method is not implemented"; }), n("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), n("ERR_STREAM_DESTROYED", function (e) { return "Cannot call " + e + " after a stream was destroyed"; }), n("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), n("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), n("ERR_STREAM_WRITE_AFTER_END", "write after end"), n( "ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError ), n( "ERR_UNKNOWN_ENCODING", function (e) { return "Unknown encoding: " + e; }, TypeError ), n( "ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event" ), (e.exports.codes = i); }, 73411: function (e, t, i) { "use strict"; var n = i(499845), r = Object.keys || function (e) { var t = []; for (var i in e) t.push(i); return t; }; e.exports = d; var a = i(318200), o = i(623832); i(32016)(d, a); for (var s = r(o.prototype), l = 0; l < s.length; l++) { var c = s[l]; !d.prototype[c] && (d.prototype[c] = o.prototype[c]); } function d(e) { if (!(this instanceof d)) return new d(e); a.call(this, e), o.call(this, e), (this.allowHalfOpen = !0), e && (!1 === e.readable && (this.readable = !1), !1 === e.writable && (this.writable = !1), !1 === e.allowHalfOpen && ((this.allowHalfOpen = !1), this.once("end", u))); } function u() { !this._writableState.ended && n.nextTick(f, this); } function f(e) { e.end(); } Object.defineProperty(d.prototype, "writableHighWaterMark", { enumerable: !1, get: function () { return this._writableState.highWaterMark; }, }), Object.defineProperty(d.prototype, "writableBuffer", { enumerable: !1, get: function () { return this._writableState && this._writableState.getBuffer(); }, }), Object.defineProperty(d.prototype, "writableLength", { enumerable: !1, get: function () { return this._writableState.length; }, }), Object.defineProperty(d.prototype, "destroyed", { enumerable: !1, get: function () { return ( void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed ); }, set: function (e) { if ( void 0 !== this._readableState && void 0 !== this._writableState ) (this._readableState.destroyed = e), (this._writableState.destroyed = e); }, }); }, 423764: function (e, t, i) { "use strict"; e.exports = r; var n = i(450099); function r(e) { if (!(this instanceof r)) return new r(e); n.call(this, e); } i(32016)(r, n), (r.prototype._transform = function (e, t, i) { i(null, e); }); }, 318200: function (e, t, i) { "use strict"; var n, r, a, o, s, l = i(499845); (e.exports = A), (A.ReadableState = T), i(122582).EventEmitter; var c = function (e, t) { return e.listeners(t).length; }, d = i(908689), u = i(966465).Buffer, f = (void 0 !== i.g ? i.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {} ).Uint8Array || function () {}; function h(e) { return u.from(e); } function p(e) { return u.isBuffer(e) || e instanceof f; } var v = i(711900); r = v && v.debuglog ? v.debuglog("stream") : function () {}; var m = i(997265), g = i(352001), _ = i(184314).getHighWaterMark, y = i(376298).codes, b = y.ERR_INVALID_ARG_TYPE, I = y.ERR_STREAM_PUSH_AFTER_EOF, w = y.ERR_METHOD_NOT_IMPLEMENTED, x = y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; i(32016)(A, d); var S = g.errorOrDestroy, M = ["error", "close", "destroy", "pause", "resume"]; function C(e, t, i) { if ("function" == typeof e.prependListener) return e.prependListener(t, i); e._events && e._events[t] ? Array.isArray(e._events[t]) ? e._events[t].unshift(i) : (e._events[t] = [i, e._events[t]]) : e.on(t, i); } function T(e, t, r) { (n = n || i(73411)), (e = e || {}), "boolean" != typeof r && (r = t instanceof n), (this.objectMode = !!e.objectMode), r && (this.objectMode = this.objectMode || !!e.readableObjectMode), (this.highWaterMark = _(this, e, "readableHighWaterMark", r)), (this.buffer = new m()), (this.length = 0), (this.pipes = null), (this.pipesCount = 0), (this.flowing = null), (this.ended = !1), (this.endEmitted = !1), (this.reading = !1), (this.sync = !0), (this.needReadable = !1), (this.emittedReadable = !1), (this.readableListening = !1), (this.resumeScheduled = !1), (this.paused = !0), (this.emitClose = !1 !== e.emitClose), (this.autoDestroy = !!e.autoDestroy), (this.destroyed = !1), (this.defaultEncoding = e.defaultEncoding || "utf8"), (this.awaitDrain = 0), (this.readingMore = !1), (this.decoder = null), (this.encoding = null), e.encoding && (!a && (a = i(450251).StringDecoder), (this.decoder = new a(e.encoding)), (this.encoding = e.encoding)); } function A(e) { if (((n = n || i(73411)), !(this instanceof A))) return new A(e); var t = this instanceof n; (this._readableState = new T(e, this, t)), (this.readable = !0), e && ("function" == typeof e.read && (this._read = e.read), "function" == typeof e.destroy && (this._destroy = e.destroy)), d.call(this); } function k(e, t, i, n, a) { r("readableAddChunk", t); var o, s = e._readableState; if (null === t) (s.reading = !1), L(e, s); else if ((!a && (o = E(s, t)), o)) S(e, o); else if (s.objectMode || (t && t.length > 0)) { if ( ("string" != typeof t && !s.objectMode && Object.getPrototypeOf(t) !== u.prototype && (t = h(t)), n) ) s.endEmitted ? S(e, new x()) : P(e, s, t, !0); else if (s.ended) S(e, new I()); else { if (s.destroyed) return !1; (s.reading = !1), s.decoder && !i ? ((t = s.decoder.write(t)), s.objectMode || 0 !== t.length ? P(e, s, t, !1) : B(e, s)) : P(e, s, t, !1); } } else !n && ((s.reading = !1), B(e, s)); return !s.ended && (s.length < s.highWaterMark || 0 === s.length); } function P(e, t, i, n) { t.flowing && 0 === t.length && !t.sync ? ((t.awaitDrain = 0), e.emit("data", i)) : ((t.length += t.objectMode ? 1 : i.length), n ? t.buffer.unshift(i) : t.buffer.push(i), t.needReadable && j(e)), B(e, t); } function E(e, t) { var i; return ( !p(t) && "string" != typeof t && void 0 !== t && !e.objectMode && (i = new b("chunk", ["string", "Buffer", "Uint8Array"], t)), i ); } Object.defineProperty(A.prototype, "destroyed", { enumerable: !1, get: function () { return ( void 0 !== this._readableState && this._readableState.destroyed ); }, set: function (e) { if (!!this._readableState) this._readableState.destroyed = e; }, }), (A.prototype.destroy = g.destroy), (A.prototype._undestroy = g.undestroy), (A.prototype._destroy = function (e, t) { t(e); }), (A.prototype.push = function (e, t) { var i, n = this._readableState; return ( n.objectMode ? (i = !0) : "string" == typeof e && ((t = t || n.defaultEncoding) !== n.encoding && ((e = u.from(e, t)), (t = "")), (i = !0)), k(this, e, t, !1, i) ); }), (A.prototype.unshift = function (e) { return k(this, e, null, !0, !1); }), (A.prototype.isPaused = function () { return !1 === this._readableState.flowing; }), (A.prototype.setEncoding = function (e) { !a && (a = i(450251).StringDecoder); var t = new a(e); (this._readableState.decoder = t), (this._readableState.encoding = this._readableState.decoder.encoding); for (var n = this._readableState.buffer.head, r = ""; null !== n; ) (r += t.write(n.data)), (n = n.next); return ( this._readableState.buffer.clear(), "" !== r && this._readableState.buffer.push(r), (this._readableState.length = r.length), this ); }); var D = 0x40000000; function R(e) { return ( e >= D ? (e = D) : (e--, (e |= e >>> 1), (e |= e >>> 2), (e |= e >>> 4), (e |= e >>> 8), (e |= e >>> 16), e++), e ); } function N(e, t) { if (e <= 0 || (0 === t.length && t.ended)) return 0; if (t.objectMode) return 1; if (e != e) return t.flowing && t.length ? t.buffer.head.data.length : t.length; return (e > t.highWaterMark && (t.highWaterMark = R(e)), e <= t.length) ? e : t.ended ? t.length : ((t.needReadable = !0), 0); } function L(e, t) { if ((r("onEofChunk"), !t.ended)) { if (t.decoder) { var i = t.decoder.end(); i && i.length && (t.buffer.push(i), (t.length += t.objectMode ? 1 : i.length)); } (t.ended = !0), t.sync ? j(e) : ((t.needReadable = !1), !t.emittedReadable && ((t.emittedReadable = !0), O(e))); } } function j(e) { var t = e._readableState; r("emitReadable", t.needReadable, t.emittedReadable), (t.needReadable = !1), !t.emittedReadable && (r("emitReadable", t.flowing), (t.emittedReadable = !0), l.nextTick(O, e)); } function O(e) { var t = e._readableState; r("emitReadable_", t.destroyed, t.length, t.ended), !t.destroyed && (t.length || t.ended) && (e.emit("readable"), (t.emittedReadable = !1)), (t.needReadable = !t.flowing && !t.ended && t.length <= t.highWaterMark), Z(e); } function B(e, t) { !t.readingMore && ((t.readingMore = !0), l.nextTick(F, e, t)); } function F(e, t) { for ( ; !t.reading && !t.ended && (t.length < t.highWaterMark || (t.flowing && 0 === t.length)); ) { var i = t.length; if ((r("maybeReadMore read 0"), e.read(0), i === t.length)) break; } t.readingMore = !1; } function U(e) { return function () { var t = e._readableState; r("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain--, 0 === t.awaitDrain && c(e, "data") && ((t.flowing = !0), Z(e)); }; } function G(e) { var t = e._readableState; (t.readableListening = e.listenerCount("readable") > 0), t.resumeScheduled && !t.paused ? (t.flowing = !0) : e.listenerCount("data") > 0 && e.resume(); } function z(e) { r("readable nexttick read 0"), e.read(0); } function V(e, t) { !t.resumeScheduled && ((t.resumeScheduled = !0), l.nextTick(W, e, t)); } function W(e, t) { r("resume", t.reading), !t.reading && e.read(0), (t.resumeScheduled = !1), e.emit("resume"), Z(e), t.flowing && !t.reading && e.read(0); } function Z(e) { var t = e._readableState; for (r("flow", t.flowing); t.flowing && null !== e.read(); ); } function K(e, t) { var i; return 0 === t.length ? null : (t.objectMode ? (i = t.buffer.shift()) : !e || e >= t.length ? ((i = t.decoder ? t.buffer.join("") : 1 === t.buffer.length ? t.buffer.first() : t.buffer.concat(t.length)), t.buffer.clear()) : (i = t.buffer.consume(e, t.decoder)), i); } function H(e) { var t = e._readableState; r("endReadable", t.endEmitted), !t.endEmitted && ((t.ended = !0), l.nextTick(q, t, e)); } function q(e, t) { if ( (r("endReadableNT", e.endEmitted, e.length), !e.endEmitted && 0 === e.length && ((e.endEmitted = !0), (t.readable = !1), t.emit("end"), e.autoDestroy)) ) { var i = t._writableState; (!i || (i.autoDestroy && i.finished)) && t.destroy(); } } function J(e, t) { for (var i = 0, n = e.length; i < n; i++) if (e[i] === t) return i; return -1; } (A.prototype.read = function (e) { r("read", e), (e = parseInt(e, 10)); var t, i = this._readableState, n = e; if ( (0 !== e && (i.emittedReadable = !1), 0 === e && i.needReadable && ((0 !== i.highWaterMark ? i.length >= i.highWaterMark : i.length > 0) || i.ended)) ) return ( r("read: emitReadable", i.length, i.ended), 0 === i.length && i.ended ? H(this) : j(this), null ); if (0 === (e = N(e, i)) && i.ended) return 0 === i.length && H(this), null; var a = i.needReadable; return ( r("need readable", a), (0 === i.length || i.length - e < i.highWaterMark) && r("length less than watermark", (a = !0)), i.ended || i.reading ? r("reading or ended", (a = !1)) : a && (r("do read"), (i.reading = !0), (i.sync = !0), 0 === i.length && (i.needReadable = !0), this._read(i.highWaterMark), (i.sync = !1), !i.reading && (e = N(n, i))), null === (t = e > 0 ? K(e, i) : null) ? ((i.needReadable = i.length <= i.highWaterMark), (e = 0)) : ((i.length -= e), (i.awaitDrain = 0)), 0 === i.length && (!i.ended && (i.needReadable = !0), n !== e && i.ended && H(this)), null !== t && this.emit("data", t), t ); }), (A.prototype._read = function (e) { S(this, new w("_read()")); }), (A.prototype.pipe = function (e, t) { var i = this, n = this._readableState; switch (n.pipesCount) { case 0: n.pipes = e; break; case 1: n.pipes = [n.pipes, e]; break; default: n.pipes.push(e); } (n.pipesCount += 1), r("pipe count=%d opts=%j", n.pipesCount, t); var a = (t && !1 === t.end) || e === l.stdout || e === l.stderr ? g : s; function o(e, t) { r("onunpipe"), e === i && t && !1 === t.hasUnpiped && ((t.hasUnpiped = !0), f()); } function s() { r("onend"), e.end(); } n.endEmitted ? l.nextTick(a) : i.once("end", a), e.on("unpipe", o); var d = U(i); e.on("drain", d); var u = !1; function f() { r("cleanup"), e.removeListener("close", v), e.removeListener("finish", m), e.removeListener("drain", d), e.removeListener("error", p), e.removeListener("unpipe", o), i.removeListener("end", s), i.removeListener("end", g), i.removeListener("data", h), (u = !0), n.awaitDrain && (!e._writableState || e._writableState.needDrain) && d(); } function h(t) { r("ondata"); var a = e.write(t); r("dest.write", a), !1 === a && (((1 === n.pipesCount && n.pipes === e) || (n.pipesCount > 1 && -1 !== J(n.pipes, e))) && !u && (r("false write response, pause", n.awaitDrain), n.awaitDrain++), i.pause()); } function p(t) { r("onerror", t), g(), e.removeListener("error", p), 0 === c(e, "error") && S(e, t); } function v() { e.removeListener("finish", m), g(); } function m() { r("onfinish"), e.removeListener("close", v), g(); } function g() { r("unpipe"), i.unpipe(e); } return ( i.on("data", h), C(e, "error", p), e.once("close", v), e.once("finish", m), e.emit("pipe", i), !n.flowing && (r("pipe resume"), i.resume()), e ); }), (A.prototype.unpipe = function (e) { var t = this._readableState, i = { hasUnpiped: !1 }; if (0 === t.pipesCount) return this; if (1 === t.pipesCount) return e && e !== t.pipes ? this : (!e && (e = t.pipes), (t.pipes = null), (t.pipesCount = 0), (t.flowing = !1), e && e.emit("unpipe", this, i), this); if (!e) { var n = t.pipes, r = t.pipesCount; (t.pipes = null), (t.pipesCount = 0), (t.flowing = !1); for (var a = 0; a < r; a++) n[a].emit("unpipe", this, { hasUnpiped: !1 }); return this; } var o = J(t.pipes, e); return -1 === o ? this : (t.pipes.splice(o, 1), (t.pipesCount -= 1), 1 === t.pipesCount && (t.pipes = t.pipes[0]), e.emit("unpipe", this, i), this); }), (A.prototype.on = function (e, t) { var i = d.prototype.on.call(this, e, t), n = this._readableState; return ( "data" === e ? ((n.readableListening = this.listenerCount("readable") > 0), !1 !== n.flowing && this.resume()) : "readable" === e && !n.endEmitted && !n.readableListening && ((n.readableListening = n.needReadable = !0), (n.flowing = !1), (n.emittedReadable = !1), r("on readable", n.length, n.reading), n.length ? j(this) : !n.reading && l.nextTick(z, this)), i ); }), (A.prototype.addListener = A.prototype.on), (A.prototype.removeListener = function (e, t) { var i = d.prototype.removeListener.call(this, e, t); return "readable" === e && l.nextTick(G, this), i; }), (A.prototype.removeAllListeners = function (e) { var t = d.prototype.removeAllListeners.apply(this, arguments); return ("readable" === e || void 0 === e) && l.nextTick(G, this), t; }), (A.prototype.resume = function () { var e = this._readableState; return ( !e.flowing && (r("resume"), (e.flowing = !e.readableListening), V(this, e)), (e.paused = !1), this ); }), (A.prototype.pause = function () { return ( r("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (r("pause"), (this._readableState.flowing = !1), this.emit("pause")), (this._readableState.paused = !0), this ); }), (A.prototype.wrap = function (e) { var t = this, i = this._readableState, n = !1; for (var a in (e.on("end", function () { if ((r("wrapped end"), i.decoder && !i.ended)) { var e = i.decoder.end(); e && e.length && t.push(e); } t.push(null); }), e.on("data", function (a) { if ( (r("wrapped data"), i.decoder && (a = i.decoder.write(a)), i.objectMode && null == a) ) return; if (!!i.objectMode || (!!a && !!a.length)) !t.push(a) && ((n = !0), e.pause()); }), e)) void 0 === this[a] && "function" == typeof e[a] && (this[a] = (function (t) { return function () { return e[t].apply(e, arguments); }; })(a)); for (var o = 0; o < M.length; o++) e.on(M[o], this.emit.bind(this, M[o])); return ( (this._read = function (t) { r("wrapped _read", t), n && ((n = !1), e.resume()); }), this ); }), "function" == typeof Symbol && (A.prototype[Symbol.asyncIterator] = function () { return void 0 === o && (o = i(412003)), o(this); }), Object.defineProperty(A.prototype, "readableHighWaterMark", { enumerable: !1, get: function () { return this._readableState.highWaterMark; }, }), Object.defineProperty(A.prototype, "readableBuffer", { enumerable: !1, get: function () { return this._readableState && this._readableState.buffer; }, }), Object.defineProperty(A.prototype, "readableFlowing", { enumerable: !1, get: function () { return this._readableState.flowing; }, set: function (e) { this._readableState && (this._readableState.flowing = e); }, }), (A._fromList = K), Object.defineProperty(A.prototype, "readableLength", { enumerable: !1, get: function () { return this._readableState.length; }, }), "function" == typeof Symbol && (A.from = function (e, t) { return void 0 === s && (s = i(985267)), s(A, e, t); }); }, 450099: function (e, t, i) { "use strict"; e.exports = d; var n = i(376298).codes, r = n.ERR_METHOD_NOT_IMPLEMENTED, a = n.ERR_MULTIPLE_CALLBACK, o = n.ERR_TRANSFORM_ALREADY_TRANSFORMING, s = n.ERR_TRANSFORM_WITH_LENGTH_0, l = i(73411); function c(e, t) { var i = this._transformState; i.transforming = !1; var n = i.writecb; if (null === n) return this.emit("error", new a()); (i.writechunk = null), (i.writecb = null), null != t && this.push(t), n(e); var r = this._readableState; (r.reading = !1), (r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark); } function d(e) { if (!(this instanceof d)) return new d(e); l.call(this, e), (this._transformState = { afterTransform: c.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null, }), (this._readableState.needReadable = !0), (this._readableState.sync = !1), e && ("function" == typeof e.transform && (this._transform = e.transform), "function" == typeof e.flush && (this._flush = e.flush)), this.on("prefinish", u); } function u() { var e = this; "function" != typeof this._flush || this._readableState.destroyed ? f(this, null, null) : this._flush(function (t, i) { f(e, t, i); }); } function f(e, t, i) { if (t) return e.emit("error", t); if ((null != i && e.push(i), e._writableState.length)) throw new s(); if (e._transformState.transforming) throw new o(); return e.push(null); } i(32016)(d, l), (d.prototype.push = function (e, t) { return ( (this._transformState.needTransform = !1), l.prototype.push.call(this, e, t) ); }), (d.prototype._transform = function (e, t, i) { i(new r("_transform()")); }), (d.prototype._write = function (e, t, i) { var n = this._transformState; if ( ((n.writecb = i), (n.writechunk = e), (n.writeencoding = t), !n.transforming) ) { var r = this._readableState; (n.needTransform || r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark); } }), (d.prototype._read = function (e) { var t = this._transformState; null === t.writechunk || t.transforming ? (t.needTransform = !0) : ((t.transforming = !0), this._transform(t.writechunk, t.writeencoding, t.afterTransform)); }), (d.prototype._destroy = function (e, t) { l.prototype._destroy.call(this, e, function (e) { t(e); }); }); }, 623832: function (e, t, i) { "use strict"; var n, r, a = i(499845); function o(e) { var t = this; (this.next = null), (this.entry = null), (this.finish = function () { W(t, e); }); } (e.exports = T), (T.WritableState = C); var s = { deprecate: i(708333) }, l = i(908689), c = i(966465).Buffer, d = (void 0 !== i.g ? i.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {} ).Uint8Array || function () {}; function u(e) { return c.from(e); } function f(e) { return c.isBuffer(e) || e instanceof d; } var h = i(352001), p = i(184314).getHighWaterMark, v = i(376298).codes, m = v.ERR_INVALID_ARG_TYPE, g = v.ERR_METHOD_NOT_IMPLEMENTED, _ = v.ERR_MULTIPLE_CALLBACK, y = v.ERR_STREAM_CANNOT_PIPE, b = v.ERR_STREAM_DESTROYED, I = v.ERR_STREAM_NULL_VALUES, w = v.ERR_STREAM_WRITE_AFTER_END, x = v.ERR_UNKNOWN_ENCODING, S = h.errorOrDestroy; function M() {} function C(e, t, r) { (n = n || i(73411)), (e = e || {}), "boolean" != typeof r && (r = t instanceof n), (this.objectMode = !!e.objectMode), r && (this.objectMode = this.objectMode || !!e.writableObjectMode), (this.highWaterMark = p(this, e, "writableHighWaterMark", r)), (this.finalCalled = !1), (this.needDrain = !1), (this.ending = !1), (this.ended = !1), (this.finished = !1), (this.destroyed = !1); var a = !1 === e.decodeStrings; (this.decodeStrings = !a), (this.defaultEncoding = e.defaultEncoding || "utf8"), (this.length = 0), (this.writing = !1), (this.corked = 0), (this.sync = !0), (this.bufferProcessing = !1), (this.onwrite = function (e) { L(t, e); }), (this.writecb = null), (this.writelen = 0), (this.bufferedRequest = null), (this.lastBufferedRequest = null), (this.pendingcb = 0), (this.prefinished = !1), (this.errorEmitted = !1), (this.emitClose = !1 !== e.emitClose), (this.autoDestroy = !!e.autoDestroy), (this.bufferedRequestCount = 0), (this.corkedRequestsFree = new o(this)); } function T(e) { var t = this instanceof (n = n || i(73411)); if (!t && !r.call(T, this)) return new T(e); (this._writableState = new C(e, this, t)), (this.writable = !0), e && ("function" == typeof e.write && (this._write = e.write), "function" == typeof e.writev && (this._writev = e.writev), "function" == typeof e.destroy && (this._destroy = e.destroy), "function" == typeof e.final && (this._final = e.final)), l.call(this); } function A(e, t) { var i = new w(); S(e, i), a.nextTick(t, i); } function k(e, t, i, n) { var r; return ( null === i ? (r = new I()) : "string" != typeof i && !t.objectMode && (r = new m("chunk", ["string", "Buffer"], i)), !r || (S(e, r), a.nextTick(n, r), !1) ); } function P(e, t, i) { return ( !e.objectMode && !1 !== e.decodeStrings && "string" == typeof t && (t = c.from(t, i)), t ); } function E(e, t, i, n, r, a) { if (!i) { var o = P(t, n, r); n !== o && ((i = !0), (r = "buffer"), (n = o)); } var s = t.objectMode ? 1 : n.length; t.length += s; var l = t.length < t.highWaterMark; if ((!l && (t.needDrain = !0), t.writing || t.corked)) { var c = t.lastBufferedRequest; (t.lastBufferedRequest = { chunk: n, encoding: r, isBuf: i, callback: a, next: null, }), c ? (c.next = t.lastBufferedRequest) : (t.bufferedRequest = t.lastBufferedRequest), (t.bufferedRequestCount += 1); } else D(e, t, !1, s, n, r, a); return l; } function D(e, t, i, n, r, a, o) { (t.writelen = n), (t.writecb = o), (t.writing = !0), (t.sync = !0), t.destroyed ? t.onwrite(new b("write")) : i ? e._writev(r, t.onwrite) : e._write(r, a, t.onwrite), (t.sync = !1); } function R(e, t, i, n, r) { --t.pendingcb, i ? (a.nextTick(r, n), a.nextTick(z, e, t), (e._writableState.errorEmitted = !0), S(e, n)) : (r(n), (e._writableState.errorEmitted = !0), S(e, n), z(e, t)); } function N(e) { (e.writing = !1), (e.writecb = null), (e.length -= e.writelen), (e.writelen = 0); } function L(e, t) { var i = e._writableState, n = i.sync, r = i.writecb; if ("function" != typeof r) throw new _(); if ((N(i), t)) R(e, i, n, t, r); else { var o = F(i) || e.destroyed; !o && !i.corked && !i.bufferProcessing && i.bufferedRequest && B(e, i), n ? a.nextTick(j, e, i, o, r) : j(e, i, o, r); } } function j(e, t, i, n) { !i && O(e, t), t.pendingcb--, n(), z(e, t); } function O(e, t) { 0 === t.length && t.needDrain && ((t.needDrain = !1), e.emit("drain")); } function B(e, t) { t.bufferProcessing = !0; var i = t.bufferedRequest; if (e._writev && i && i.next) { var n = Array(t.bufferedRequestCount), r = t.corkedRequestsFree; r.entry = i; for (var a = 0, s = !0; i; ) (n[a] = i), !i.isBuf && (s = !1), (i = i.next), (a += 1); (n.allBuffers = s), D(e, t, !0, t.length, n, "", r.finish), t.pendingcb++, (t.lastBufferedRequest = null), r.next ? ((t.corkedRequestsFree = r.next), (r.next = null)) : (t.corkedRequestsFree = new o(t)), (t.bufferedRequestCount = 0); } else { for (; i; ) { var l = i.chunk, c = i.encoding, d = i.callback, u = t.objectMode ? 1 : l.length; if ( (D(e, t, !1, u, l, c, d), (i = i.next), t.bufferedRequestCount--, t.writing) ) break; } null === i && (t.lastBufferedRequest = null); } (t.bufferedRequest = i), (t.bufferProcessing = !1); } function F(e) { return ( e.ending && 0 === e.length && null === e.bufferedRequest && !e.finished && !e.writing ); } function U(e, t) { e._final(function (i) { t.pendingcb--, i && S(e, i), (t.prefinished = !0), e.emit("prefinish"), z(e, t); }); } function G(e, t) { !t.prefinished && !t.finalCalled && ("function" != typeof e._final || t.destroyed ? ((t.prefinished = !0), e.emit("prefinish")) : (t.pendingcb++, (t.finalCalled = !0), a.nextTick(U, e, t))); } function z(e, t) { var i = F(t); if ( i && (G(e, t), 0 === t.pendingcb && ((t.finished = !0), e.emit("finish"), t.autoDestroy)) ) { var n = e._readableState; (!n || (n.autoDestroy && n.endEmitted)) && e.destroy(); } return i; } function V(e, t, i) { (t.ending = !0), z(e, t), i && (t.finished ? a.nextTick(i) : e.once("finish", i)), (t.ended = !0), (e.writable = !1); } function W(e, t, i) { var n = e.entry; for (e.entry = null; n; ) { var r = n.callback; t.pendingcb--, r(i), (n = n.next); } t.corkedRequestsFree.next = e; } i(32016)(T, l), (C.prototype.getBuffer = function () { for (var e = this.bufferedRequest, t = []; e; ) t.push(e), (e = e.next); return t; }), !(function () { try { Object.defineProperty(C.prototype, "buffer", { get: s.deprecate( function () { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003" ), }); } catch (e) {} })(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? ((r = Function.prototype[Symbol.hasInstance]), Object.defineProperty(T, Symbol.hasInstance, { value: function (e) { return ( !!r.call(this, e) || (this === T && e && e._writableState instanceof C) ); }, })) : (r = function (e) { return e instanceof this; }), (T.prototype.pipe = function () { S(this, new y()); }), (T.prototype.write = function (e, t, i) { var n = this._writableState, r = !1, a = !n.objectMode && f(e); return ( a && !c.isBuffer(e) && (e = u(e)), "function" == typeof t && ((i = t), (t = null)), a ? (t = "buffer") : !t && (t = n.defaultEncoding), "function" != typeof i && (i = M), n.ending ? A(this, i) : (a || k(this, n, e, i)) && (n.pendingcb++, (r = E(this, n, a, e, t, i))), r ); }), (T.prototype.cork = function () { this._writableState.corked++; }), (T.prototype.uncork = function () { var e = this._writableState; e.corked && (e.corked--, !e.writing && !e.corked && !e.bufferProcessing && e.bufferedRequest && B(this, e)); }), (T.prototype.setDefaultEncoding = function (e) { if ( ("string" == typeof e && (e = e.toLowerCase()), !( [ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw", ].indexOf((e + "").toLowerCase()) > -1 )) ) throw new x(e); return (this._writableState.defaultEncoding = e), this; }), Object.defineProperty(T.prototype, "writableBuffer", { enumerable: !1, get: function () { return this._writableState && this._writableState.getBuffer(); }, }), Object.defineProperty(T.prototype, "writableHighWaterMark", { enumerable: !1, get: function () { return this._writableState.highWaterMark; }, }), (T.prototype._write = function (e, t, i) { i(new g("_write()")); }), (T.prototype._writev = null), (T.prototype.end = function (e, t, i) { var n = this._writableState; return ( "function" == typeof e ? ((i = e), (e = null), (t = null)) : "function" == typeof t && ((i = t), (t = null)), null != e && this.write(e, t), n.corked && ((n.corked = 1), this.uncork()), !n.ending && V(this, n, i), this ); }), Object.defineProperty(T.prototype, "writableLength", { enumerable: !1, get: function () { return this._writableState.length; }, }), Object.defineProperty(T.prototype, "destroyed", { enumerable: !1, get: function () { return ( void 0 !== this._writableState && this._writableState.destroyed ); }, set: function (e) { if (!!this._writableState) this._writableState.destroyed = e; }, }), (T.prototype.destroy = h.destroy), (T.prototype._undestroy = h.undestroy), (T.prototype._destroy = function (e, t) { t(e); }); }, 412003: function (e, t, i) { "use strict"; var n, r = i(499845); function a(e, t, i) { return ( (t = o(t)) in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = i), e ); } function o(e) { var t = s(e, "string"); return "symbol" == typeof t ? t : String(t); } function s(e, t) { if ("object" != typeof e || null === e) return e; var i = e[Symbol.toPrimitive]; if (void 0 !== i) { var n = i.call(e, t || "default"); if ("object" != typeof n) return n; throw TypeError("@@toPrimitive must return a primitive value."); } return ("string" === t ? String : Number)(e); } var l = i(640916), c = Symbol("lastResolve"), d = Symbol("lastReject"), u = Symbol("error"), f = Symbol("ended"), h = Symbol("lastPromise"), p = Symbol("handlePromise"), v = Symbol("stream"); function m(e, t) { return { value: e, done: t }; } function g(e) { var t = e[c]; if (null !== t) { var i = e[v].read(); null !== i && ((e[h] = null), (e[c] = null), (e[d] = null), t(m(i, !1))); } } function _(e) { r.nextTick(g, e); } function y(e, t) { return function (i, n) { e.then(function () { if (t[f]) { i(m(void 0, !0)); return; } t[p](i, n); }, n); }; } var b = Object.getPrototypeOf(function () {}), I = Object.setPrototypeOf( (a( (n = { get stream() { return this[v]; }, next: function () { var e, t = this, i = this[u]; if (null !== i) return Promise.reject(i); if (this[f]) return Promise.resolve(m(void 0, !0)); if (this[v].destroyed) return new Promise(function (e, i) { r.nextTick(function () { t[u] ? i(t[u]) : e(m(void 0, !0)); }); }); var n = this[h]; if (n) e = new Promise(y(n, this)); else { var a = this[v].read(); if (null !== a) return Promise.resolve(m(a, !1)); e = new Promise(this[p]); } return (this[h] = e), e; }, }), Symbol.asyncIterator, function () { return this; } ), a(n, "return", function () { var e = this; return new Promise(function (t, i) { e[v].destroy(null, function (e) { if (e) { i(e); return; } t(m(void 0, !0)); }); }); }), n), b ), w = function (e) { var t, i = Object.create( I, (a((t = {}), v, { value: e, writable: !0 }), a(t, c, { value: null, writable: !0 }), a(t, d, { value: null, writable: !0 }), a(t, u, { value: null, writable: !0 }), a(t, f, { value: e._readableState.endEmitted, writable: !0 }), a(t, p, { value: function (e, t) { var n = i[v].read(); n ? ((i[h] = null), (i[c] = null), (i[d] = null), e(m(n, !1))) : ((i[c] = e), (i[d] = t)); }, writable: !0, }), t) ); return ( (i[h] = null), l(e, function (e) { if (e && "ERR_STREAM_PREMATURE_CLOSE" !== e.code) { var t = i[d]; null !== t && ((i[h] = null), (i[c] = null), (i[d] = null), t(e)), (i[u] = e); return; } var n = i[c]; null !== n && ((i[h] = null), (i[c] = null), (i[d] = null), n(m(void 0, !0))), (i[f] = !0); }), e.on("readable", _.bind(null, i)), i ); }; e.exports = w; }, 997265: function (e, t, i) { "use strict"; function n(e, t) { var i = Object.keys(e); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); t && (n = n.filter(function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable; })), i.push.apply(i, n); } return i; } function r(e) { for (var t = 1; t < arguments.length; t++) { var i = null != arguments[t] ? arguments[t] : {}; t % 2 ? n(Object(i), !0).forEach(function (t) { a(e, t, i[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : n(Object(i)).forEach(function (t) { Object.defineProperty( e, t, Object.getOwnPropertyDescriptor(i, t) ); }); } return e; } function a(e, t, i) { return ( (t = c(t)) in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = i), e ); } function o(e, t) { if (!(e instanceof t)) throw TypeError("Cannot call a class as a function"); } function s(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; (n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(e, c(n.key), n); } } function l(e, t, i) { return ( t && s(e.prototype, t), i && s(e, i), Object.defineProperty(e, "prototype", { writable: !1 }), e ); } function c(e) { var t = d(e, "string"); return "symbol" == typeof t ? t : String(t); } function d(e, t) { if ("object" != typeof e || null === e) return e; var i = e[Symbol.toPrimitive]; if (void 0 !== i) { var n = i.call(e, t || "default"); if ("object" != typeof n) return n; throw TypeError("@@toPrimitive must return a primitive value."); } return ("string" === t ? String : Number)(e); } var u = i(966465).Buffer, f = i(821353).inspect, h = (f && f.custom) || "inspect"; function p(e, t, i) { u.prototype.copy.call(e, t, i); } e.exports = (function () { function e() { o(this, e), (this.head = null), (this.tail = null), (this.length = 0); } return ( l(e, [ { key: "push", value: function (e) { var t = { data: e, next: null }; this.length > 0 ? (this.tail.next = t) : (this.head = t), (this.tail = t), ++this.length; }, }, { key: "unshift", value: function (e) { var t = { data: e, next: this.head }; 0 === this.length && (this.tail = t), (this.head = t), ++this.length; }, }, { key: "shift", value: function () { if (0 !== this.length) { var e = this.head.data; return ( 1 === this.length ? (this.head = this.tail = null) : (this.head = this.head.next), --this.length, e ); } }, }, { key: "clear", value: function () { (this.head = this.tail = null), (this.length = 0); }, }, { key: "join", value: function (e) { if (0 === this.length) return ""; for (var t = this.head, i = "" + t.data; (t = t.next); ) i += e + t.data; return i; }, }, { key: "concat", value: function (e) { if (0 === this.length) return u.alloc(0); for (var t = u.allocUnsafe(e >>> 0), i = this.head, n = 0; i; ) p(i.data, t, n), (n += i.data.length), (i = i.next); return t; }, }, { key: "consume", value: function (e, t) { var i; return ( e < this.head.data.length ? ((i = this.head.data.slice(0, e)), (this.head.data = this.head.data.slice(e))) : (i = e === this.head.data.length ? this.shift() : t ? this._getString(e) : this._getBuffer(e)), i ); }, }, { key: "first", value: function () { return this.head.data; }, }, { key: "_getString", value: function (e) { var t = this.head, i = 1, n = t.data; for (e -= n.length; (t = t.next); ) { var r = t.data, a = e > r.length ? r.length : e; if ( (a === r.length ? (n += r) : (n += r.slice(0, e)), 0 == (e -= a)) ) { a === r.length ? (++i, t.next ? (this.head = t.next) : (this.head = this.tail = null)) : ((this.head = t), (t.data = r.slice(a))); break; } ++i; } return (this.length -= i), n; }, }, { key: "_getBuffer", value: function (e) { var t = u.allocUnsafe(e), i = this.head, n = 1; for (i.data.copy(t), e -= i.data.length; (i = i.next); ) { var r = i.data, a = e > r.length ? r.length : e; if ((r.copy(t, t.length - e, 0, a), 0 == (e -= a))) { a === r.length ? (++n, i.next ? (this.head = i.next) : (this.head = this.tail = null)) : ((this.head = i), (i.data = r.slice(a))); break; } ++n; } return (this.length -= n), t; }, }, { key: h, value: function (e, t) { return f( this, r(r({}, t), {}, { depth: 0, customInspect: !1 }) ); }, }, ]), e ); })(); }, 352001: function (e, t, i) { "use strict"; var n = i(499845); function r(e, t) { var i = this, r = this._readableState && this._readableState.destroyed, s = this._writableState && this._writableState.destroyed; return r || s ? (t ? t(e) : e && (this._writableState ? !this._writableState.errorEmitted && ((this._writableState.errorEmitted = !0), n.nextTick(l, this, e)) : n.nextTick(l, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function (e) { !t && e ? i._writableState ? i._writableState.errorEmitted ? n.nextTick(o, i) : ((i._writableState.errorEmitted = !0), n.nextTick(a, i, e)) : n.nextTick(a, i, e) : t ? (n.nextTick(o, i), t(e)) : n.nextTick(o, i); }), this); } function a(e, t) { l(e, t), o(e); } function o(e) { if (!e._writableState || !!e._writableState.emitClose) (!e._readableState || e._readableState.emitClose) && e.emit("close"); } function s() { this._readableState && ((this._readableState.destroyed = !1), (this._readableState.reading = !1), (this._readableState.ended = !1), (this._readableState.endEmitted = !1)), this._writableState && ((this._writableState.destroyed = !1), (this._writableState.ended = !1), (this._writableState.ending = !1), (this._writableState.finalCalled = !1), (this._writableState.prefinished = !1), (this._writableState.finished = !1), (this._writableState.errorEmitted = !1)); } function l(e, t) { e.emit("error", t); } function c(e, t) { var i = e._readableState, n = e._writableState; (i && i.autoDestroy) || (n && n.autoDestroy) ? e.destroy(t) : e.emit("error", t); } e.exports = { destroy: r, undestroy: s, errorOrDestroy: c }; }, 640916: function (e, t, i) { "use strict"; var n = i(376298).codes.ERR_STREAM_PREMATURE_CLOSE; function r(e) { var t = !1; return function () { if (!t) { t = !0; for (var i = arguments.length, n = Array(i), r = 0; r < i; r++) n[r] = arguments[r]; e.apply(this, n); } }; } function a() {} function o(e) { return e.setHeader && "function" == typeof e.abort; } function s(e, t, i) { if ("function" == typeof t) return s(e, null, t); !t && (t = {}), (i = r(i || a)); var l = t.readable || (!1 !== t.readable && e.readable), c = t.writable || (!1 !== t.writable && e.writable), d = function () { !e.writable && f(); }, u = e._writableState && e._writableState.finished, f = function () { (c = !1), (u = !0), !l && i.call(e); }, h = e._readableState && e._readableState.endEmitted, p = function () { (l = !1), (h = !0), !c && i.call(e); }, v = function (t) { i.call(e, t); }, m = function () { var t; return l && !h ? ((!e._readableState || !e._readableState.ended) && (t = new n()), i.call(e, t)) : c && !u ? ((!e._writableState || !e._writableState.ended) && (t = new n()), i.call(e, t)) : void 0; }, g = function () { e.req.on("finish", f); }; return ( o(e) ? (e.on("complete", f), e.on("abort", m), e.req ? g() : e.on("request", g)) : c && !e._writableState && (e.on("end", d), e.on("close", d)), e.on("end", p), e.on("finish", f), !1 !== t.error && e.on("error", v), e.on("close", m), function () { e.removeListener("complete", f), e.removeListener("abort", m), e.removeListener("request", g), e.req && e.req.removeListener("finish", f), e.removeListener("end", d), e.removeListener("close", d), e.removeListener("finish", f), e.removeListener("end", p), e.removeListener("error", v), e.removeListener("close", m); } ); } e.exports = s; }, 985267: function (e) { e.exports = function () { throw Error("Readable.from is not available in the browser"); }; }, 221902: function (e, t, i) { "use strict"; function n(e) { var t = !1; return function () { !t && ((t = !0), e.apply(void 0, arguments)); }; } var r, a = i(376298).codes, o = a.ERR_MISSING_ARGS, s = a.ERR_STREAM_DESTROYED; function l(e) { if (e) throw e; } function c(e) { return e.setHeader && "function" == typeof e.abort; } function d(e, t, a, o) { o = n(o); var l = !1; e.on("close", function () { l = !0; }), void 0 === r && (r = i(640916)), r(e, { readable: t, writable: a }, function (e) { if (e) return o(e); (l = !0), o(); }); var d = !1; return function (t) { if (!l) { if (!d) { if (((d = !0), c(e))) return e.abort(); if ("function" == typeof e.destroy) return e.destroy(); o(t || new s("pipe")); } } }; } function u(e) { e(); } function f(e, t) { return e.pipe(t); } function h(e) { return e.length && "function" == typeof e[e.length - 1] ? e.pop() : l; } function p() { for (var e, t = arguments.length, i = Array(t), n = 0; n < t; n++) i[n] = arguments[n]; var r = h(i); if ((Array.isArray(i[0]) && (i = i[0]), i.length < 2)) throw new o("streams"); var a = i.map(function (t, n) { var o = n < i.length - 1; return d(t, o, n > 0, function (t) { !e && (e = t), t && a.forEach(u), !o && (a.forEach(u), r(e)); }); }); return i.reduce(f); } e.exports = p; }, 184314: function (e, t, i) { "use strict"; var n = i(376298).codes.ERR_INVALID_OPT_VALUE; function r(e, t, i) { return null != e.highWaterMark ? e.highWaterMark : t ? e[i] : null; } function a(e, t, i, a) { var o = r(t, a, i); if (null != o) { if (!(isFinite(o) && Math.floor(o) === o) || o < 0) throw new n(a ? i : "highWaterMark", o); return Math.floor(o); } return e.objectMode ? 16 : 16384; } e.exports = { getHighWaterMark: a }; }, 908689: function (e, t, i) { e.exports = i(122582).EventEmitter; }, 235521: function (e, t, i) { ((t = e.exports = i(318200)).Stream = t), (t.Readable = t), (t.Writable = i(623832)), (t.Duplex = i(73411)), (t.Transform = i(450099)), (t.PassThrough = i(423764)), (t.finished = i(640916)), (t.pipeline = i(221902)); }, 866818: function (e, t, i) { "use strict"; var n = i(966465).Buffer, r = i(32016), a = i(277514), o = Array(16), s = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, ], l = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, ], c = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, ], d = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11, ], u = [0, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e], f = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0]; function h() { a.call(this, 64), (this._a = 0x67452301), (this._b = 0xefcdab89), (this._c = 0x98badcfe), (this._d = 0x10325476), (this._e = 0xc3d2e1f0); } function p(e, t) { return (e << t) | (e >>> (32 - t)); } function v(e, t, i, n, r, a, o, s) { return (p((e + (t ^ i ^ n) + a + o) | 0, s) + r) | 0; } function m(e, t, i, n, r, a, o, s) { return (p((e + ((t & i) | (~t & n)) + a + o) | 0, s) + r) | 0; } function g(e, t, i, n, r, a, o, s) { return (p((e + ((t | ~i) ^ n) + a + o) | 0, s) + r) | 0; } function _(e, t, i, n, r, a, o, s) { return (p((e + ((t & n) | (i & ~n)) + a + o) | 0, s) + r) | 0; } function y(e, t, i, n, r, a, o, s) { return (p((e + (t ^ (i | ~n)) + a + o) | 0, s) + r) | 0; } r(h, a), (h.prototype._update = function () { for (var e, t, i = o, n = 0; n < 16; ++n) i[n] = this._block.readInt32LE(4 * n); for ( var r = 0 | this._a, a = 0 | this._b, h = 0 | this._c, b = 0 | this._d, I = 0 | this._e, w = 0 | this._a, x = 0 | this._b, S = 0 | this._c, M = 0 | this._d, C = 0 | this._e, T = 0; T < 80; T += 1 ) T < 16 ? ((e = v(r, a, h, b, I, i[s[T]], u[0], c[T])), (t = y(w, x, S, M, C, i[l[T]], f[0], d[T]))) : T < 32 ? ((e = m(r, a, h, b, I, i[s[T]], u[1], c[T])), (t = _(w, x, S, M, C, i[l[T]], f[1], d[T]))) : T < 48 ? ((e = g(r, a, h, b, I, i[s[T]], u[2], c[T])), (t = g(w, x, S, M, C, i[l[T]], f[2], d[T]))) : T < 64 ? ((e = _(r, a, h, b, I, i[s[T]], u[3], c[T])), (t = m(w, x, S, M, C, i[l[T]], f[3], d[T]))) : ((e = y(r, a, h, b, I, i[s[T]], u[4], c[T])), (t = v(w, x, S, M, C, i[l[T]], f[4], d[T]))), (r = I), (I = b), (b = p(h, 10)), (h = a), (a = e), (w = C), (C = M), (M = p(S, 10)), (S = x), (x = t); var A = (this._b + h + M) | 0; (this._b = (this._c + b + C) | 0), (this._c = (this._d + I + w) | 0), (this._d = (this._e + r + x) | 0), (this._e = (this._a + a + S) | 0), (this._a = A); }), (h.prototype._digest = function () { (this._block[this._blockOffset++] = 128), this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), (this._blockOffset = 0)), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); var e = n.alloc ? n.alloc(20) : new n(20); return ( e.writeInt32LE(this._a, 0), e.writeInt32LE(this._b, 4), e.writeInt32LE(this._c, 8), e.writeInt32LE(this._d, 12), e.writeInt32LE(this._e, 16), e ); }), (e.exports = h); }, 225877: function (e, t, i) { var n = i(966465), r = n.Buffer; function a(e, t) { for (var i in e) t[i] = e[i]; } function o(e, t, i) { return r(e, t, i); } r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? (e.exports = n) : (a(n, t), (t.Buffer = o)), a(r, o), (o.from = function (e, t, i) { if ("number" == typeof e) throw TypeError("Argument must not be a number"); return r(e, t, i); }), (o.alloc = function (e, t, i) { if ("number" != typeof e) throw TypeError("Argument must be a number"); var n = r(e); return ( void 0 !== t ? "string" == typeof i ? n.fill(t, i) : n.fill(t) : n.fill(0), n ); }), (o.allocUnsafe = function (e) { if ("number" != typeof e) throw TypeError("Argument must be a number"); return r(e); }), (o.allocUnsafeSlow = function (e) { if ("number" != typeof e) throw TypeError("Argument must be a number"); return n.SlowBuffer(e); }); }, 140860: function (e, t, i) { var n = i(966465), r = n.Buffer; function a(e, t) { for (var i in e) t[i] = e[i]; } function o(e, t, i) { return r(e, t, i); } r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? (e.exports = n) : (a(n, t), (t.Buffer = o)), (o.prototype = Object.create(r.prototype)), a(r, o), (o.from = function (e, t, i) { if ("number" == typeof e) throw TypeError("Argument must not be a number"); return r(e, t, i); }), (o.alloc = function (e, t, i) { if ("number" != typeof e) throw TypeError("Argument must be a number"); var n = r(e); return ( void 0 !== t ? "string" == typeof i ? n.fill(t, i) : n.fill(t) : n.fill(0), n ); }), (o.allocUnsafe = function (e) { if ("number" != typeof e) throw TypeError("Argument must be a number"); return r(e); }), (o.allocUnsafeSlow = function (e) { if ("number" != typeof e) throw TypeError("Argument must be a number"); return n.SlowBuffer(e); }); }, 696772: function (e, t, i) { var n = i(140860).Buffer; function r(e, t) { (this._block = n.alloc(e)), (this._finalSize = t), (this._blockSize = e), (this._len = 0); } (r.prototype.update = function (e, t) { "string" == typeof e && ((t = t || "utf8"), (e = n.from(e, t))); for ( var i = this._block, r = this._blockSize, a = e.length, o = this._len, s = 0; s < a; ) { for (var l = o % r, c = Math.min(a - s, r - l), d = 0; d < c; d++) i[l + d] = e[s + d]; (o += c), (s += c), o % r == 0 && this._update(i); } return (this._len += a), this; }), (r.prototype.digest = function (e) { var t = this._len % this._blockSize; (this._block[t] = 128), this._block.fill(0, t + 1), t >= this._finalSize && (this._update(this._block), this._block.fill(0)); var i = 8 * this._len; if (i <= 0xffffffff) this._block.writeUInt32BE(i, this._blockSize - 4); else { var n = (0xffffffff & i) >>> 0, r = (i - n) / 0x100000000; this._block.writeUInt32BE(r, this._blockSize - 8), this._block.writeUInt32BE(n, this._blockSize - 4); } this._update(this._block); var a = this._hash(); return e ? a.toString(e) : a; }), (r.prototype._update = function () { throw Error("_update must be implemented by subclass"); }), (e.exports = r); }, 673664: function (e, t, i) { var n = (e.exports = function (e) { var t = n[(e = e.toLowerCase())]; if (!t) throw Error(e + " is not supported (we accept pull requests)"); return new t(); }); (n.sha = i(726087)), (n.sha1 = i(881606)), (n.sha224 = i(559601)), (n.sha256 = i(965183)), (n.sha384 = i(985919)), (n.sha512 = i(131837)); }, 726087: function (e, t, i) { var n = i(32016), r = i(696772), a = i(140860).Buffer, o = [0x5a827999, 0x6ed9eba1, -0x70e44324, -0x359d3e2a], s = Array(80); function l() { this.init(), (this._w = s), r.call(this, 64, 56); } function c(e) { return (e << 5) | (e >>> 27); } function d(e) { return (e << 30) | (e >>> 2); } function u(e, t, i, n) { return 0 === e ? (t & i) | (~t & n) : 2 === e ? (t & i) | (t & n) | (i & n) : t ^ i ^ n; } n(l, r), (l.prototype.init = function () { return ( (this._a = 0x67452301), (this._b = 0xefcdab89), (this._c = 0x98badcfe), (this._d = 0x10325476), (this._e = 0xc3d2e1f0), this ); }), (l.prototype._update = function (e) { for ( var t = this._w, i = 0 | this._a, n = 0 | this._b, r = 0 | this._c, a = 0 | this._d, s = 0 | this._e, l = 0; l < 16; ++l ) t[l] = e.readInt32BE(4 * l); for (; l < 80; ++l) t[l] = t[l - 3] ^ t[l - 8] ^ t[l - 14] ^ t[l - 16]; for (var f = 0; f < 80; ++f) { var h = ~~(f / 20), p = (c(i) + u(h, n, r, a) + s + t[f] + o[h]) | 0; (s = a), (a = r), (r = d(n)), (n = i), (i = p); } (this._a = (i + this._a) | 0), (this._b = (n + this._b) | 0), (this._c = (r + this._c) | 0), (this._d = (a + this._d) | 0), (this._e = (s + this._e) | 0); }), (l.prototype._hash = function () { var e = a.allocUnsafe(20); return ( e.writeInt32BE(0 | this._a, 0), e.writeInt32BE(0 | this._b, 4), e.writeInt32BE(0 | this._c, 8), e.writeInt32BE(0 | this._d, 12), e.writeInt32BE(0 | this._e, 16), e ); }), (e.exports = l); }, 881606: function (e, t, i) { var n = i(32016), r = i(696772), a = i(140860).Buffer, o = [0x5a827999, 0x6ed9eba1, -0x70e44324, -0x359d3e2a], s = Array(80); function l() { this.init(), (this._w = s), r.call(this, 64, 56); } function c(e) { return (e << 1) | (e >>> 31); } function d(e) { return (e << 5) | (e >>> 27); } function u(e) { return (e << 30) | (e >>> 2); } function f(e, t, i, n) { return 0 === e ? (t & i) | (~t & n) : 2 === e ? (t & i) | (t & n) | (i & n) : t ^ i ^ n; } n(l, r), (l.prototype.init = function () { return ( (this._a = 0x67452301), (this._b = 0xefcdab89), (this._c = 0x98badcfe), (this._d = 0x10325476), (this._e = 0xc3d2e1f0), this ); }), (l.prototype._update = function (e) { for ( var t = this._w, i = 0 | this._a, n = 0 | this._b, r = 0 | this._c, a = 0 | this._d, s = 0 | this._e, l = 0; l < 16; ++l ) t[l] = e.readInt32BE(4 * l); for (; l < 80; ++l) t[l] = c(t[l - 3] ^ t[l - 8] ^ t[l - 14] ^ t[l - 16]); for (var h = 0; h < 80; ++h) { var p = ~~(h / 20), v = (d(i) + f(p, n, r, a) + s + t[h] + o[p]) | 0; (s = a), (a = r), (r = u(n)), (n = i), (i = v); } (this._a = (i + this._a) | 0), (this._b = (n + this._b) | 0), (this._c = (r + this._c) | 0), (this._d = (a + this._d) | 0), (this._e = (s + this._e) | 0); }), (l.prototype._hash = function () { var e = a.allocUnsafe(20); return ( e.writeInt32BE(0 | this._a, 0), e.writeInt32BE(0 | this._b, 4), e.writeInt32BE(0 | this._c, 8), e.writeInt32BE(0 | this._d, 12), e.writeInt32BE(0 | this._e, 16), e ); }), (e.exports = l); }, 559601: function (e, t, i) { var n = i(32016), r = i(965183), a = i(696772), o = i(140860).Buffer, s = Array(64); function l() { this.init(), (this._w = s), a.call(this, 64, 56); } n(l, r), (l.prototype.init = function () { return ( (this._a = 0xc1059ed8), (this._b = 0x367cd507), (this._c = 0x3070dd17), (this._d = 0xf70e5939), (this._e = 0xffc00b31), (this._f = 0x68581511), (this._g = 0x64f98fa7), (this._h = 0xbefa4fa4), this ); }), (l.prototype._hash = function () { var e = o.allocUnsafe(28); return ( e.writeInt32BE(this._a, 0), e.writeInt32BE(this._b, 4), e.writeInt32BE(this._c, 8), e.writeInt32BE(this._d, 12), e.writeInt32BE(this._e, 16), e.writeInt32BE(this._f, 20), e.writeInt32BE(this._g, 24), e ); }), (e.exports = l); }, 965183: function (e, t, i) { var n = i(32016), r = i(696772), a = i(140860).Buffer, o = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0xfc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x6ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, ], s = Array(64); function l() { this.init(), (this._w = s), r.call(this, 64, 56); } function c(e, t, i) { return i ^ (e & (t ^ i)); } function d(e, t, i) { return (e & t) | (i & (e | t)); } function u(e) { return ( ((e >>> 2) | (e << 30)) ^ ((e >>> 13) | (e << 19)) ^ ((e >>> 22) | (e << 10)) ); } function f(e) { return ( ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)) ); } function h(e) { return ((e >>> 7) | (e << 25)) ^ ((e >>> 18) | (e << 14)) ^ (e >>> 3); } function p(e) { return ((e >>> 17) | (e << 15)) ^ ((e >>> 19) | (e << 13)) ^ (e >>> 10); } n(l, r), (l.prototype.init = function () { return ( (this._a = 0x6a09e667), (this._b = 0xbb67ae85), (this._c = 0x3c6ef372), (this._d = 0xa54ff53a), (this._e = 0x510e527f), (this._f = 0x9b05688c), (this._g = 0x1f83d9ab), (this._h = 0x5be0cd19), this ); }), (l.prototype._update = function (e) { for ( var t = this._w, i = 0 | this._a, n = 0 | this._b, r = 0 | this._c, a = 0 | this._d, s = 0 | this._e, l = 0 | this._f, v = 0 | this._g, m = 0 | this._h, g = 0; g < 16; ++g ) t[g] = e.readInt32BE(4 * g); for (; g < 64; ++g) t[g] = (p(t[g - 2]) + t[g - 7] + h(t[g - 15]) + t[g - 16]) | 0; for (var _ = 0; _ < 64; ++_) { var y = (m + f(s) + c(s, l, v) + o[_] + t[_]) | 0, b = (u(i) + d(i, n, r)) | 0; (m = v), (v = l), (l = s), (s = (a + y) | 0), (a = r), (r = n), (n = i), (i = (y + b) | 0); } (this._a = (i + this._a) | 0), (this._b = (n + this._b) | 0), (this._c = (r + this._c) | 0), (this._d = (a + this._d) | 0), (this._e = (s + this._e) | 0), (this._f = (l + this._f) | 0), (this._g = (v + this._g) | 0), (this._h = (m + this._h) | 0); }), (l.prototype._hash = function () { var e = a.allocUnsafe(32); return ( e.writeInt32BE(this._a, 0), e.writeInt32BE(this._b, 4), e.writeInt32BE(this._c, 8), e.writeInt32BE(this._d, 12), e.writeInt32BE(this._e, 16), e.writeInt32BE(this._f, 20), e.writeInt32BE(this._g, 24), e.writeInt32BE(this._h, 28), e ); }), (e.exports = l); }, 985919: function (e, t, i) { var n = i(32016), r = i(131837), a = i(696772), o = i(140860).Buffer, s = Array(160); function l() { this.init(), (this._w = s), a.call(this, 128, 112); } n(l, r), (l.prototype.init = function () { return ( (this._ah = 0xcbbb9d5d), (this._bh = 0x629a292a), (this._ch = 0x9159015a), (this._dh = 0x152fecd8), (this._eh = 0x67332667), (this._fh = 0x8eb44a87), (this._gh = 0xdb0c2e0d), (this._hh = 0x47b5481d), (this._al = 0xc1059ed8), (this._bl = 0x367cd507), (this._cl = 0x3070dd17), (this._dl = 0xf70e5939), (this._el = 0xffc00b31), (this._fl = 0x68581511), (this._gl = 0x64f98fa7), (this._hl = 0xbefa4fa4), this ); }), (l.prototype._hash = function () { var e = o.allocUnsafe(48); function t(t, i, n) { e.writeInt32BE(t, n), e.writeInt32BE(i, n + 4); } return ( t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, this._el, 32), t(this._fh, this._fl, 40), e ); }), (e.exports = l); }, 131837: function (e, t, i) { var n = i(32016), r = i(696772), a = i(140860).Buffer, o = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0xfc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x6ca6351, 0xe003826f, 0x14292967, 0xa0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x6f067aa, 0x72176fba, 0xa637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817, ], s = Array(160); function l() { this.init(), (this._w = s), r.call(this, 128, 112); } function c(e, t, i) { return i ^ (e & (t ^ i)); } function d(e, t, i) { return (e & t) | (i & (e | t)); } function u(e, t) { return ( ((e >>> 28) | (t << 4)) ^ ((t >>> 2) | (e << 30)) ^ ((t >>> 7) | (e << 25)) ); } function f(e, t) { return ( ((e >>> 14) | (t << 18)) ^ ((e >>> 18) | (t << 14)) ^ ((t >>> 9) | (e << 23)) ); } function h(e, t) { return ((e >>> 1) | (t << 31)) ^ ((e >>> 8) | (t << 24)) ^ (e >>> 7); } function p(e, t) { return ( ((e >>> 1) | (t << 31)) ^ ((e >>> 8) | (t << 24)) ^ ((e >>> 7) | (t << 25)) ); } function v(e, t) { return ((e >>> 19) | (t << 13)) ^ ((t >>> 29) | (e << 3)) ^ (e >>> 6); } function m(e, t) { return ( ((e >>> 19) | (t << 13)) ^ ((t >>> 29) | (e << 3)) ^ ((e >>> 6) | (t << 26)) ); } function g(e, t) { return e >>> 0 < t >>> 0 ? 1 : 0; } n(l, r), (l.prototype.init = function () { return ( (this._ah = 0x6a09e667), (this._bh = 0xbb67ae85), (this._ch = 0x3c6ef372), (this._dh = 0xa54ff53a), (this._eh = 0x510e527f), (this._fh = 0x9b05688c), (this._gh = 0x1f83d9ab), (this._hh = 0x5be0cd19), (this._al = 0xf3bcc908), (this._bl = 0x84caa73b), (this._cl = 0xfe94f82b), (this._dl = 0x5f1d36f1), (this._el = 0xade682d1), (this._fl = 0x2b3e6c1f), (this._gl = 0xfb41bd6b), (this._hl = 0x137e2179), this ); }), (l.prototype._update = function (e) { for ( var t = this._w, i = 0 | this._ah, n = 0 | this._bh, r = 0 | this._ch, a = 0 | this._dh, s = 0 | this._eh, l = 0 | this._fh, _ = 0 | this._gh, y = 0 | this._hh, b = 0 | this._al, I = 0 | this._bl, w = 0 | this._cl, x = 0 | this._dl, S = 0 | this._el, M = 0 | this._fl, C = 0 | this._gl, T = 0 | this._hl, A = 0; A < 32; A += 2 ) (t[A] = e.readInt32BE(4 * A)), (t[A + 1] = e.readInt32BE(4 * A + 4)); for (; A < 160; A += 2) { var k = t[A - 30], P = t[A - 30 + 1], E = h(k, P), D = p(P, k); k = t[A - 4]; var R = v(k, (P = t[A - 4 + 1])), N = m(P, k), L = t[A - 14], j = t[A - 14 + 1], O = t[A - 32], B = t[A - 32 + 1], F = (D + j) | 0, U = (E + L + g(F, D)) | 0; (U = (U + R + g((F = (F + N) | 0), N)) | 0), (U = (U + O + g((F = (F + B) | 0), B)) | 0), (t[A] = U), (t[A + 1] = F); } for (var G = 0; G < 160; G += 2) { (U = t[G]), (F = t[G + 1]); var z = d(i, n, r), V = d(b, I, w), W = u(i, b), Z = u(b, i), K = f(s, S), H = f(S, s), q = o[G], J = o[G + 1], Y = c(s, l, _), Q = c(S, M, C), X = (T + H) | 0, $ = (y + K + g(X, T)) | 0; ($ = ($ + Y + g((X = (X + Q) | 0), Q)) | 0), ($ = ($ + q + g((X = (X + J) | 0), J)) | 0), ($ = ($ + U + g((X = (X + F) | 0), F)) | 0); var ee = (Z + V) | 0, et = (W + z + g(ee, Z)) | 0; (y = _), (T = C), (_ = l), (C = M), (l = s), (M = S), (s = (a + $ + g((S = (x + X) | 0), x)) | 0), (a = r), (x = w), (r = n), (w = I), (n = i), (I = b), (i = ($ + et + g((b = (X + ee) | 0), X)) | 0); } (this._al = (this._al + b) | 0), (this._bl = (this._bl + I) | 0), (this._cl = (this._cl + w) | 0), (this._dl = (this._dl + x) | 0), (this._el = (this._el + S) | 0), (this._fl = (this._fl + M) | 0), (this._gl = (this._gl + C) | 0), (this._hl = (this._hl + T) | 0), (this._ah = (this._ah + i + g(this._al, b)) | 0), (this._bh = (this._bh + n + g(this._bl, I)) | 0), (this._ch = (this._ch + r + g(this._cl, w)) | 0), (this._dh = (this._dh + a + g(this._dl, x)) | 0), (this._eh = (this._eh + s + g(this._el, S)) | 0), (this._fh = (this._fh + l + g(this._fl, M)) | 0), (this._gh = (this._gh + _ + g(this._gl, C)) | 0), (this._hh = (this._hh + y + g(this._hl, T)) | 0); }), (l.prototype._hash = function () { var e = a.allocUnsafe(64); function t(t, i, n) { e.writeInt32BE(t, n), e.writeInt32BE(i, n + 4); } return ( t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, this._el, 32), t(this._fh, this._fl, 40), t(this._gh, this._gl, 48), t(this._hh, this._hl, 56), e ); }), (e.exports = l); }, 328266: function (e, t, i) { e.exports = r; var n = i(122582).EventEmitter; function r() { n.call(this); } i(32016)(r, n), (r.Readable = i(318200)), (r.Writable = i(623832)), (r.Duplex = i(73411)), (r.Transform = i(450099)), (r.PassThrough = i(423764)), (r.finished = i(640916)), (r.pipeline = i(221902)), (r.Stream = r), (r.prototype.pipe = function (e, t) { var i = this; function r(t) { e.writable && !1 === e.write(t) && i.pause && i.pause(); } function a() { i.readable && i.resume && i.resume(); } i.on("data", r), e.on("drain", a), !e._isStdio && (!t || !1 !== t.end) && (i.on("end", s), i.on("close", l)); var o = !1; function s() { !o && ((o = !0), e.end()); } function l() { !o && ((o = !0), "function" == typeof e.destroy && e.destroy()); } function c(e) { if ((d(), 0 === n.listenerCount(this, "error"))) throw e; } function d() { i.removeListener("data", r), e.removeListener("drain", a), i.removeListener("end", s), i.removeListener("close", l), i.removeListener("error", c), e.removeListener("error", c), i.removeListener("end", d), i.removeListener("close", d), e.removeListener("close", d); } return ( i.on("error", c), e.on("error", c), i.on("end", d), i.on("close", d), e.on("close", d), e.emit("pipe", i), e ); }); }, 659406: function (e, t, i) { "use strict"; var n = i(225877).Buffer, r = n.isEncoding || function (e) { switch ((e = "" + e) && e.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function a(e) { var t; if (!e) return "utf8"; for (;;) switch (e) { case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return e; default: if (t) return; (e = ("" + e).toLowerCase()), (t = !0); } } function o(e) { var t = a(e); if ("string" != typeof t && (n.isEncoding === r || !r(e))) throw Error("Unknown encoding: " + e); return t || e; } function s(e) { var t; switch (((this.encoding = o(e)), this.encoding)) { case "utf16le": (this.text = p), (this.end = v), (t = 4); break; case "utf8": (this.fillLast = u), (t = 4); break; case "base64": (this.text = m), (this.end = g), (t = 3); break; default: (this.write = _), (this.end = y); return; } (this.lastNeed = 0), (this.lastTotal = 0), (this.lastChar = n.allocUnsafe(t)); } function l(e) { if (e <= 127) return 0; if (e >> 5 == 6) return 2; if (e >> 4 == 14) return 3; else if (e >> 3 == 30) return 4; return e >> 6 == 2 ? -1 : -2; } function c(e, t, i) { var n = t.length - 1; if (n < i) return 0; var r = l(t[n]); return r >= 0 ? (r > 0 && (e.lastNeed = r - 1), r) : --n < i || -2 === r ? 0 : (r = l(t[n])) >= 0 ? (r > 0 && (e.lastNeed = r - 2), r) : --n < i || -2 === r ? 0 : (r = l(t[n])) >= 0 ? (r > 0 && (2 === r ? (r = 0) : (e.lastNeed = r - 3)), r) : 0; } function d(e, t, i) { if ((192 & t[0]) != 128) return (e.lastNeed = 0), "\uFFFD"; if (e.lastNeed > 1 && t.length > 1) { if ((192 & t[1]) != 128) return (e.lastNeed = 1), "\uFFFD"; if (e.lastNeed > 2 && t.length > 2 && (192 & t[2]) != 128) return (e.lastNeed = 2), "\uFFFD"; } } function u(e) { var t = this.lastTotal - this.lastNeed, i = d(this, e, t); return void 0 !== i ? i : this.lastNeed <= e.length ? (e.copy(this.lastChar, t, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : void (e.copy(this.lastChar, t, 0, e.length), (this.lastNeed -= e.length)); } function f(e, t) { var i = c(this, e, t); if (!this.lastNeed) return e.toString("utf8", t); this.lastTotal = i; var n = e.length - (i - this.lastNeed); return e.copy(this.lastChar, 0, n), e.toString("utf8", t, n); } function h(e) { var t = e && e.length ? this.write(e) : ""; return this.lastNeed ? t + "\uFFFD" : t; } function p(e, t) { if ((e.length - t) % 2 == 0) { var i = e.toString("utf16le", t); if (i) { var n = i.charCodeAt(i.length - 1); if (n >= 55296 && n <= 56319) return ( (this.lastNeed = 2), (this.lastTotal = 4), (this.lastChar[0] = e[e.length - 2]), (this.lastChar[1] = e[e.length - 1]), i.slice(0, -1) ); } return i; } return ( (this.lastNeed = 1), (this.lastTotal = 2), (this.lastChar[0] = e[e.length - 1]), e.toString("utf16le", t, e.length - 1) ); } function v(e) { var t = e && e.length ? this.write(e) : ""; if (this.lastNeed) { var i = this.lastTotal - this.lastNeed; return t + this.lastChar.toString("utf16le", 0, i); } return t; } function m(e, t) { var i = (e.length - t) % 3; return 0 === i ? e.toString("base64", t) : ((this.lastNeed = 3 - i), (this.lastTotal = 3), 1 === i ? (this.lastChar[0] = e[e.length - 1]) : ((this.lastChar[0] = e[e.length - 2]), (this.lastChar[1] = e[e.length - 1])), e.toString("base64", t, e.length - i)); } function g(e) { var t = e && e.length ? this.write(e) : ""; return this.lastNeed ? t + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t; } function _(e) { return e.toString(this.encoding); } function y(e) { return e && e.length ? this.write(e) : ""; } (t.StringDecoder = s), (s.prototype.write = function (e) { var t, i; if (0 === e.length) return ""; if (this.lastNeed) { if (void 0 === (t = this.fillLast(e))) return ""; (i = this.lastNeed), (this.lastNeed = 0); } else i = 0; return i < e.length ? t ? t + this.text(e, i) : this.text(e, i) : t || ""; }), (s.prototype.end = h), (s.prototype.text = f), (s.prototype.fillLast = function (e) { if (this.lastNeed <= e.length) return ( e.copy( this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed ), this.lastChar.toString(this.encoding, 0, this.lastTotal) ); e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e.length), (this.lastNeed -= e.length); }); }, 450251: function (e, t, i) { "use strict"; var n = i(140860).Buffer, r = n.isEncoding || function (e) { switch ((e = "" + e) && e.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function a(e) { var t; if (!e) return "utf8"; for (;;) switch (e) { case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return e; default: if (t) return; (e = ("" + e).toLowerCase()), (t = !0); } } function o(e) { var t = a(e); if ("string" != typeof t && (n.isEncoding === r || !r(e))) throw Error("Unknown encoding: " + e); return t || e; } function s(e) { var t; switch (((this.encoding = o(e)), this.encoding)) { case "utf16le": (this.text = p), (this.end = v), (t = 4); break; case "utf8": (this.fillLast = u), (t = 4); break; case "base64": (this.text = m), (this.end = g), (t = 3); break; default: (this.write = _), (this.end = y); return; } (this.lastNeed = 0), (this.lastTotal = 0), (this.lastChar = n.allocUnsafe(t)); } function l(e) { if (e <= 127) return 0; if (e >> 5 == 6) return 2; if (e >> 4 == 14) return 3; else if (e >> 3 == 30) return 4; return e >> 6 == 2 ? -1 : -2; } function c(e, t, i) { var n = t.length - 1; if (n < i) return 0; var r = l(t[n]); return r >= 0 ? (r > 0 && (e.lastNeed = r - 1), r) : --n < i || -2 === r ? 0 : (r = l(t[n])) >= 0 ? (r > 0 && (e.lastNeed = r - 2), r) : --n < i || -2 === r ? 0 : (r = l(t[n])) >= 0 ? (r > 0 && (2 === r ? (r = 0) : (e.lastNeed = r - 3)), r) : 0; } function d(e, t, i) { if ((192 & t[0]) != 128) return (e.lastNeed = 0), "\uFFFD"; if (e.lastNeed > 1 && t.length > 1) { if ((192 & t[1]) != 128) return (e.lastNeed = 1), "\uFFFD"; if (e.lastNeed > 2 && t.length > 2 && (192 & t[2]) != 128) return (e.lastNeed = 2), "\uFFFD"; } } function u(e) { var t = this.lastTotal - this.lastNeed, i = d(this, e, t); return void 0 !== i ? i : this.lastNeed <= e.length ? (e.copy(this.lastChar, t, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : void (e.copy(this.lastChar, t, 0, e.length), (this.lastNeed -= e.length)); } function f(e, t) { var i = c(this, e, t); if (!this.lastNeed) return e.toString("utf8", t); this.lastTotal = i; var n = e.length - (i - this.lastNeed); return e.copy(this.lastChar, 0, n), e.toString("utf8", t, n); } function h(e) { var t = e && e.length ? this.write(e) : ""; return this.lastNeed ? t + "\uFFFD" : t; } function p(e, t) { if ((e.length - t) % 2 == 0) { var i = e.toString("utf16le", t); if (i) { var n = i.charCodeAt(i.length - 1); if (n >= 55296 && n <= 56319) return ( (this.lastNeed = 2), (this.lastTotal = 4), (this.lastChar[0] = e[e.length - 2]), (this.lastChar[1] = e[e.length - 1]), i.slice(0, -1) ); } return i; } return ( (this.lastNeed = 1), (this.lastTotal = 2), (this.lastChar[0] = e[e.length - 1]), e.toString("utf16le", t, e.length - 1) ); } function v(e) { var t = e && e.length ? this.write(e) : ""; if (this.lastNeed) { var i = this.lastTotal - this.lastNeed; return t + this.lastChar.toString("utf16le", 0, i); } return t; } function m(e, t) { var i = (e.length - t) % 3; return 0 === i ? e.toString("base64", t) : ((this.lastNeed = 3 - i), (this.lastTotal = 3), 1 === i ? (this.lastChar[0] = e[e.length - 1]) : ((this.lastChar[0] = e[e.length - 2]), (this.lastChar[1] = e[e.length - 1])), e.toString("base64", t, e.length - i)); } function g(e) { var t = e && e.length ? this.write(e) : ""; return this.lastNeed ? t + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t; } function _(e) { return e.toString(this.encoding); } function y(e) { return e && e.length ? this.write(e) : ""; } (t.StringDecoder = s), (s.prototype.write = function (e) { var t, i; if (0 === e.length) return ""; if (this.lastNeed) { if (void 0 === (t = this.fillLast(e))) return ""; (i = this.lastNeed), (this.lastNeed = 0); } else i = 0; return i < e.length ? t ? t + this.text(e, i) : this.text(e, i) : t || ""; }), (s.prototype.end = h), (s.prototype.text = f), (s.prototype.fillLast = function (e) { if (this.lastNeed <= e.length) return ( e.copy( this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed ), this.lastChar.toString(this.encoding, 0, this.lastTotal) ); e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e.length), (this.lastNeed -= e.length); }); }, 708333: function (e, t, i) { function n(e, t) { if (r("noDeprecation")) return e; var i = !1; return function n() { if (!i) { if (r("throwDeprecation")) throw Error(t); r("traceDeprecation") ? console.trace(t) : console.warn(t); i = !0; } return e.apply(this, arguments); }; } function r(e) { try { if (!i.g.localStorage) return !1; } catch (e) { return !1; } var t = i.g.localStorage[e]; return null != t && "true" === String(t).toLowerCase(); } e.exports = n; }, 185608: function (__unused_webpack_module, exports) { var indexOf = function (e, t) { if (e.indexOf) return e.indexOf(t); for (var i = 0; i < e.length; i++) if (e[i] === t) return i; return -1; }, Object_keys = function (e) { if (Object.keys) return Object.keys(e); var t = []; for (var i in e) t.push(i); return t; }, forEach = function (e, t) { if (e.forEach) return e.forEach(t); for (var i = 0; i < e.length; i++) t(e[i], i, e); }, defineProp = (function () { try { return ( Object.defineProperty({}, "_", {}), function (e, t, i) { Object.defineProperty(e, t, { writable: !0, enumerable: !1, configurable: !0, value: i, }); } ); } catch (e) { return function (e, t, i) { e[t] = i; }; } })(), globals = [ "Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape", ]; function Context() {} Context.prototype = {}; var Script = (exports.Script = function (e) { if (!(this instanceof Script)) return new Script(e); this.code = e; }); (Script.prototype.runInContext = function (e) { if (!(e instanceof Context)) throw TypeError("needs a 'context' argument."); var t = document.createElement("iframe"); !t.style && (t.style = {}), (t.style.display = "none"), document.body.appendChild(t); var i = t.contentWindow, n = i.eval, r = i.execScript; !n && r && (r.call(i, "null"), (n = i.eval)), forEach(Object_keys(e), function (t) { i[t] = e[t]; }), forEach(globals, function (t) { e[t] && (i[t] = e[t]); }); var a = Object_keys(i), o = n.call(i, this.code); return ( forEach(Object_keys(i), function (t) { (t in e || -1 === indexOf(a, t)) && (e[t] = i[t]); }), forEach(globals, function (t) { !(t in e) && defineProp(e, t, i[t]); }), document.body.removeChild(t), o ); }), (Script.prototype.runInThisContext = function () { return eval(this.code); }), (Script.prototype.runInNewContext = function (e) { var t = Script.createContext(e), i = this.runInContext(t); return ( e && forEach(Object_keys(t), function (i) { e[i] = t[i]; }), i ); }), forEach(Object_keys(Script.prototype), function (e) { exports[e] = Script[e] = function (t) { var i = Script(t); return i[e].apply(i, [].slice.call(arguments, 1)); }; }), (exports.isContext = function (e) { return e instanceof Context; }), (exports.createScript = function (e) { return exports.Script(e); }), (exports.createContext = Script.createContext = function (e) { var t = new Context(); return ( "object" == typeof e && forEach(Object_keys(e), function (i) { t[i] = e[i]; }), t ); }); }, 150022: function (e, t, i) { "use strict"; e.exports = i.p + "static/image/image-high-resolution.bbee723a.webp"; }, 522394: function (e, t, i) { "use strict"; i.d(t, { W: () => v }); var n = i("625572"), r = i("639880"), a = i("844969"), o = i("976699"), s = i("614022"), l = "cc_web", c = "mon-sg.capcutapi.com", d = "https://sf16-web-tos-buz.capcutstatic.com/obj/capcut-web-buz-sg/slardar-web-sdk/plugins", u = (function (e) { return ( (e.Lang = "lang"), (e.Theme = "theme"), (e.PcSessionId = "pcSessionId"), (e.AppChannel = "appChannel"), (e.Did = "did"), e ); })({}); function f(e, t) { try { var i = JSON.parse(null != e ? e : "{}"); if ( "0" !== i.ret && 0 !== i.status_code && 0 !== i.code && 0 !== i.e && (!i.BaseResp || 0 !== i.BaseResp.StatusCode) && "success" !== i.message && (!i.ResponseMetadata || i.ResponseMetadata.Error) ) { var a, o, s, l, c = i.log_id || (null == t ? void 0 : null === (o = t.response) || void 0 === o ? void 0 : null === (a = o.headers) || void 0 === a ? void 0 : a["x-tt-logid"]) || "", d = (i.message || i.errmsg || "").slice(0, 50), u = i.ret || (null === (s = i.BaseResp) || void 0 === s ? void 0 : s.StatusCode) || i.status_code || i.code || i.e || (null === (l = i.data) || void 0 === l ? void 0 : l.error_code) || ""; return (0, r._)((0, n._)({}, t.extra), { ret: u.toString(), msg: d.toString(), logId: c.toString(), }); } } catch (e) {} return !1; } var h = { bid: l, domain: c, pluginPathPrefix: d }; class p { get sdk() { var e; if ("undefined" != typeof window) return null === (e = window) || void 0 === e ? void 0 : e.ccWebSlardar; } init(e) { var t, i; this._initEnv(), null === (t = (i = this).sdk) || void 0 === t || t.call( i, "init", (0, r._)((0, n._)({}, h, e), { plugins: (0, n._)( { fetch: { extraExtractor: (e, t) => { var i, n; return ( null === (i = (n = window).__lookiExtraHeaders) || void 0 === i || i.call(n, e, t), f(e, t) ); }, }, ajax: { extraExtractor: (e, t) => { var i, n; return ( null === (i = (n = window).__lookiExtraHeaders) || void 0 === i || i.call(n, e, t), f(e, t) ); }, }, }, e.plugins ), }) ); } start() { var e, t; null === (e = (t = this).sdk) || void 0 === e || e.call(t, "start"); } config(e) { var t, i; null === (t = (i = this).sdk) || void 0 === t || t.call(i, "config", e); } error(e, t) { var i, o, s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, l = (null == s ? void 0 : s.level) ? null == s ? void 0 : s.level : "warn", c = (e) => { var t = Error(e.message); return ( (t.name = e.name), (t.stack = e.stack), (t.message = e.message), t ); }, d = (0, a.Z)(t) ? c(t) : Error(JSON.stringify(t)), { message: u } = d; (d.message = "\u3010Custom-Error\u3011:" .concat(e, "-") .concat( s.toGroup ? "MoreDataInExternal" : null == d ? void 0 : d.message )), s.toGroup && (Object.assign(s, { message: u }), delete s.toGroup), null === (i = (o = this).sdk) || void 0 === i || i.call( o, "captureException", d, (0, r._)((0, n._)({}, s), { level: l }) ); } dataEvent(e) { var t, i, a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, l = (null == a ? void 0 : a.level) ? null == a ? void 0 : a.level : "info", c = (0, o.Z)(a, s.Z); null === (t = (i = this).sdk) || void 0 === t || t.call(i, "sendEvent", { name: "\u3010Custom-Data\u3011: ".concat(e), metrics: c, categories: (0, r._)((0, n._)({}, a), { level: l }), }); } event(e) { var t, i, a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, l = (null == a ? void 0 : a.level) ? null == a ? void 0 : a.level : "info", c = (0, o.Z)(a, s.Z); null === (t = (i = this).sdk) || void 0 === t || t.call(i, "sendEvent", { name: e, metrics: c, categories: (0, r._)((0, n._)({}, a), { level: l }), }); } log(e) { var t, i, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, a = (null == r ? void 0 : r.level) ? null == r ? void 0 : r.level : "info"; null === (t = (i = this).sdk) || void 0 === t || t.call(i, "sendLog", { content: "\u3010Custom-Log\u3011: ".concat(e), level: a, extra: (0, n._)({}, r), }); } sendCustomPerfMetric(e) { var t, i; null === (t = (i = this).sdk) || void 0 === t || t.call(i, "sendCustomPerfMetric", e); } setCurrentBranch() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; this._setContext("branch", e); } reportServerTiming() { try { var e = new Set(), t = "navigation"; for (var i of performance .getEntriesByType(t) .reduce( (e, t) => (t && t.serverTiming && e.push(...t.serverTiming), e), [] )) { var n, r, a, o, { name: s, description: l, duration: c } = i; if (!(!i.name || e.has(s))) e.add(s), null === (a = (o = this).sdk) || void 0 === a || a.call(o, "sendCustomPerfMetric", { type: "perf", name: s, value: c, extra: l ? { description: l } : void 0, }); } null === (r = this.sdk) || void 0 === r || null === (n = r.getSender()) || void 0 === n || n.flush(); } catch (e) { this.error("report_server_timing_error", e); } } _initEnv() { if ("undefined" != typeof window) { var e, t, i, n, r, a, o = new URLSearchParams(window.location.search); this._setContext("branch", window._currentBranch), this._setContext("tag", window._tag), this._setContext("gray_config_key", window.__gray_config_key), this._setContext("lvweb_env", window.__lvweb_env), this._setContext("psm", window.__agw_psm), this._setContext( "idc", null === (e = window.gfdatav1) || void 0 === e ? void 0 : e.idc ), this._setContext( "pc_session_id", null !== (i = o.get(u.PcSessionId)) && void 0 !== i ? i : "" ), this._setContext( "app_channel", null !== (n = o.get(u.AppChannel)) && void 0 !== n ? n : "" ), this._setContext( "pc_did", null !== (r = o.get(u.Did)) && void 0 !== r ? r : "" ), this._setContext( "ssr_render_level", "".concat( null !== (a = null === (t = window._SSR_DATA) || void 0 === t ? void 0 : t.renderLevel) && void 0 !== a ? a : 0 ) ); } } _setContext(e) { var t, i, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; n && (null === (t = (i = this).sdk) || void 0 === t || t.call(i, "context.set", e, n)); } } var v = new p(); }, 855421: function (e, t, i) { "use strict"; i.d(t, { t: () => g }); var n = i("625572"), r = i("639880"), a = i("989719"), o = i("522394"), s = i("51522"), l = i("823764"), c = i("52533"), d = i("737451"), u = i("614022"); function f(e) { return ( (0, s.Z)(e) && (0, l.Z)(e, (e) => (0, c.Z)(e) || (0, d.Z)(e) || (0, u.Z)(e)) ); } function h(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; return [e, ...i].join(" "); } class p { static _sendLog(e, t) { for ( var i, n, r = arguments.length, a = Array(r > 2 ? r - 2 : 0), s = 2; s < r; s++ ) a[s - 2] = arguments[s]; var l = Object.create(null), c = []; a.forEach((e) => { f(e) ? Object.assign(l, e) : c.push(e); }), null === (n = o.W.sdk) || void 0 === n || null === (i = n.sendLog) || void 0 === i || i.call(n, { content: h(t, c), level: e, extra: l }); } static info(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; p._sendLog("info", e, i); } static warn(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; p._sendLog("warn", e, i); } static error(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; p._sendLog("error", e, i); } } var v = Object.keys(console).reduce( (e, t) => (0, r._)((0, n._)({}, e), { [t]: a.Z }), {} ), m = console; class g { static setEnvironment(e) { g._isProduction = e; } static showConsole() { g._console = m; } static hideConsole() { g._console = v; } static debug() { for (var e = arguments.length, t = Array(e), i = 0; i < e; i++) t[i] = arguments[i]; if (!g._isProduction) g._console.debug(...t); } static time(e) { if (!g._isProduction) g._console.time(e); } static timeEnd(e) { if (!g._isProduction) g._console.timeEnd(e); } static log(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; if (!g._isProduction) g._console.log(e, ...i); } static info(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; g._isProduction && p.info(e, ...i), g._console.info(e, ...i); } static warn(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; g._isProduction && p.warn(e, ...i), g._console.warn(e, ...i); } static error(e) { for ( var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++ ) i[n - 1] = arguments[n]; g._isProduction && p.error(e, ...i), g._console.error(e, ...i); } } (g._isProduction = !1), (g._console = m); }, 898758: function (e, t, i) { "use strict"; function n() { var e = new Uint32Array(8); crypto.getRandomValues(e); var t = 0; return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (i) => { var n = (e[t >> 3] >> ((t % 8) * 4)) & 15; return t++, ("x" === i ? n : (3 & n) | 8).toString(16); }); } i.d(t, { V: function () { return n; }, }); }, 733437: function (e, t, i) { "use strict"; i.d(t, { k: function () { return c; }, }); var n = i(218571), r = i(260963); function a(e) { return e && e.$$typeof === Symbol.for("react.element"); } function o(e) { if ("object" != typeof e) return e; if (e instanceof Array) return e.map((e) => o(e)); if (e instanceof Object) { if (a(e)) return e; var t = {}; for (var i in e) "object" == typeof e[i] ? (t[i] = o(e[i])) : (t[i] = e[i]); return t; } return e; } function s() { var [, e] = (0, n.useState)(0); return (0, n.useCallback)(() => { e((e) => e + 1); }, []); } var l = (e, t) => e === t; function c(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { isEqual: a = l, deps: c, shouldUpdateOnlyOnChange: d = !1 } = i, u = s(), f = (e) => o(t(e)), h = (0, n.useRef)(); if (!h.current) { if (e) { var p = (0, r.wM)(!0); try { h.current = f(e); } finally { (0, r.mJ)(p); } } else h.current = void 0; } return ( (0, n.useEffect)(() => { if (!!e) { var t = (0, r.U5)( () => f(e), (e, t) => { (h.current = e), d ? !a(e, t) && u() : u(); }, { fireImmediately: !0 } ); return () => { t(); }; } }, [e, ...(null != c ? c : [])]), h.current ); } }, 158316: function (e, t, i) { "use strict"; function n(e) { var t = ""; t = e < 102.4 ? "".concat(e.toFixed(2), "B") : e < 104857.6 ? "".concat((e / 1024).toFixed(2), "KB") : e < 0x40000000 ? "".concat((e / 1048576).toFixed(2), "MB") : e < 0x10000000000 ? "".concat((e / 0x40000000).toFixed(2), "GB") : "".concat((e / 0x10000000000).toFixed(2), "TB"); var i = "".concat(t), n = i.indexOf("."); return "00" == i.substr(n + 1, 2) ? i.substring(0, n) + i.substr(n + 3, 2) : t; } function r(e) { var t = "".concat((e / 0x40000000).toFixed(2)), i = t.indexOf("."); return "00" == t.substr(i + 1, 2) ? t.substring(0, i) + t.substr(i + 3, 2) : t; } i.d(t, { W: function () { return r; }, y: function () { return n; }, }); }, 119814: function (e, t, i) { "use strict"; i.d(t, { p: function () { return s; }, }); var n = i(2910), r = i(465201), a = i(636971), o = new r.z6({ _capacity: 1e3, _cacheKey: a.or }), s = (e) => new Promise((t, i) => { if (!e) { i(); return; } var r = o.get(e); if (r) { t(r); return; } ((r = new Image()).crossOrigin = "anonymous"), (r.onload = function () { o.set(r.getAttribute("src"), r), t(r); }), (r.onerror = (t) => { o.remove(e), i(t); }), (r.src = (0, n.C)(e, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })); }); }, 465201: function (e, t, i) { "use strict"; i.d(t, { z6: function () { return n; }, }); class n { get(e) { var t = this.getCache(); if (t.FIFO.includes(e)) { var i = t.data[e]; return this._resetKeyByFIFO(t, e), i; } } set(e, t) { var i = this._put(e, t); this.db.set(this._cacheKey, i); } remove(e) { var t = this.getCache(); delete t.data[e], this._removeKeyByFIFO(t, e), this.db.set(this._cacheKey, t); } getCache() { var e = this.db.get(this._cacheKey); return e ? e : this._generateCache(); } _put(e, t) { var i = this.getCache(); i.data[e] = t; var n = this._resetKeyByFIFO(i, e), r = n.FIFO.length; if (void 0 !== this._capacity && r > this._capacity) { var a = n.FIFO[r - 1]; a && (n.FIFO.pop(), delete n.data[a]); } return n; } _removeKeyByFIFO(e, t) { var i = e.FIFO.indexOf(t); return -1 !== i && e.FIFO.splice(i, 1), e; } _resetKeyByFIFO(e, t) { var i = this._removeKeyByFIFO(e, t); return i.FIFO.unshift(t), i; } _generateCache() { return { FIFO: [], data: {} }; } constructor(e) { (this.db = new Map()), (this._cacheKey = e._cacheKey), (this._capacity = e._capacity); var { db: t } = e; t && (this.db = t); } } }, 636971: function (e, t, i) { "use strict"; i.d(t, { or: function () { return n; }, vw: function () { return r; }, }); var n = "COMMON_IMAGE_ELEMENT_MAP_KEY", r = "PERSISTENT_CACHE"; }, 685665: function (e, t, i) { "use strict"; i.d(t, { w: function () { return n; }, }); class n { get isLocked() { return this._locked; } acquire() { return this._locked ? new Promise((e, t) => { this._awaitQueue.push({ resolve: e, reject: t }); }) : ((this._locked = !0), Promise.resolve()); } release() { if (!this._locked) throw Error("mutex lock is not locked."); this._locked = !1; var e = this._awaitQueue.pop(); e && ((this._locked = !0), e.resolve()); } constructor() { (this._awaitQueue = []), (this._locked = !1); } } }, 460029: function (e, t, i) { "use strict"; i.d(t, { Ie: function () { return r; }, XH: function () { return o; }, YO: function () { return n; }, oe: function () { return a; }, wc: function () { return s; }, }); var n = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!!e) !performance.getEntriesByName(e).length && performance.mark(e, { detail: t }); }, r = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!!e) n("".concat(e, "_START"), t); }, a = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!!e) n("".concat(e, "_END"), t); }, o = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "".concat(e, "_START"), i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "".concat(e, "_END"); try { return performance.measure(e, t, i); } catch (e) {} }, s = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e; if (!!e) performance.clearMarks("".concat(e, "_START")), performance.clearMarks("".concat(e, "_END")), performance.clearMeasures(t); }; }, 219974: function (e, t, i) { "use strict"; i.d(t, { CE: function () { return a; }, Sw: function () { return r; }, kJ: function () { return n; }, }); var n = (e) => "[object Array]" === Object.prototype.toString.call(e), r = (e) => { var t = new Map(), i = (e) => { if ("function" == typeof e) return e; if ("object" == typeof e) { if (null === e) return e; if (t.has(e)) return t.get(e); var r = n(e) ? [] : {}; return ( t.set(e, r), n(e) ? e.forEach((e) => { r.push(i(e)); }) : Object.keys(e).forEach((t) => { r[t] = i(e[t]); }), r ); } return e; }; return i(e); }, a = (e, t) => { var i = Object.assign({}, e); return ( t.forEach((e) => { delete i[e]; }), i ); }; }, 936226: function (e, t, i) { "use strict"; i.d(t, { Gw: function () { return o; }, d: function () { return a; }, }); var n = i(333597), r = i(490165), a = (function (e) { return ( (e.EditorLoginPopup = "editor_login_popup"), (e.PageHeader = "page_header"), (e.Export = "export"), (e.GoogleDrive = "google_drive"), (e.DropBox = "dropbox"), (e.FromPhone = "from_phone"), (e.FromComputer = "from_computer"), (e.CollectionTab = "collection_tab"), (e.useLimit = "smart_tool_use_limit"), (e.uploadResult = "smart_tool_upload_results"), (e.copyToClipboard = "copy_to_clipboard"), (e.ThirdpartyPlugin = "thirdparty_plugin"), (e.Brand = "brand"), (e.ScreenRecorder = "screen_recorder"), (e.PartExport = "part_export"), (e.PartExportSameTime = "part_export_sametime"), (e.Cover = "cover"), (e.CheckList = "checklist"), (e.Shopify = "shopify"), (e.CreateCloneVoice = "voice_create"), (e.TTSClickGenerate = "tts_click_generate"), (e.AvTranslatorClickGenerate = "click_generate"), (e.TTSEntry = "tts_entry"), (e.AICaptionsEntry = "ai_captions_entry"), e ); })({}), o = (0, n.LO)(r.D); }, 904337: function (e, t, i) { "use strict"; i.d(t, { $: function () { return s; }, }); var n = i(625572), r = i(639880); i(810413); var a = () => "513695"; function o() { var e = document.cookie.match(RegExp("(^| )_tea_web_id=([^;]+)")), t = window.GATEWAY_INJECTED_WEB_ID || ""; return !t && null !== e && (t = e[2]), t; } function s(e) { var t = o(); e.interceptors.request.use((e) => (0, r._)((0, n._)({}, e), { params: (0, r._)((0, n._)({}, e.params || {}), { aid: a(), device_platform: "web", region: window.__locationCountryCode || "cn", web_id: t, }), }) ); } }, 243494: function (e, t, i) { "use strict"; i.d(t, { ib: function () { return r; }, ky: function () { return a; }, yt: function () { return n; }, }); class n { combineConfig(e) { this._config = Object.assign({}, this._config, e); } get config() { return this._config; } set hasMore(e) { this._hasMore = e; } get hasMore() { return this._hasMore; } set offset(e) { this._offset = e; } get offset() { return this._offset; } set searchId(e) { this._searchId = e; } get searchId() { return this._searchId; } set requestId(e) { this._requestId = e; } get requestId() { return this._requestId; } set logId(e) { this._logId = e; } get logId() { return this._logId; } constructor(e, t, i) { (this._config = {}), (this.value = e), (this._hasMore = t.hasMore), (this._offset = t.offset), (this._searchId = t.searchId), (this._requestId = t.requestId), (this._logId = t.logId), this.combineConfig(null != i ? i : {}); } } function r(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { hasMore: !0, offset: 0 }; return new n(t, i, e); } function a(e) { return e instanceof n; } }, 655901: function (e, t, i) { "use strict"; i.d(t, { B0: function () { return r; }, PM: function () { return o; }, qZ: function () { return l; }, }); var n = i(139646); function r(e, t, i) { return a.apply(this, arguments); } function a() { return (a = (0, n._)(function* (e, t, i) { var n, a, o, s, l, c, d, u, f, h, p, v = []; if ( ((null === (n = t.commonAttr) || void 0 === n ? void 0 : n.coverUrl) && v.push( e(t.commonAttr.coverUrl, i).then((e) => { t.commonAttr.coverUrl = e; }) ), null === (a = t.commonAttr) || void 0 === a ? void 0 : a.coverUrlMap) ) { var m = function (n, r) { v.push( e(r, i).then((e) => { t.commonAttr.coverUrlMap[n] = e; }) ); }; for (var [g, _] of Object.entries(t.commonAttr.coverUrlMap)) m(g, _); } if ( null === (s = t.commonAttr) || void 0 === s ? void 0 : null === (o = s.itemUrls) || void 0 === o ? void 0 : o.length ) { var y = function (n, r) { if (!r) return "continue"; v.push( e(r, i).then((e) => { t.commonAttr.itemUrls[n] = e; }) ); }; for (var [b, I] of t.commonAttr.itemUrls.entries()) y(b, I); } if (null === (l = t.image) || void 0 === l ? void 0 : l.largeImages) { var w = function (t) { v.push( e(t.imageUrl, i).then((e) => { t.imageUrl = e; }) ); }; for (var x of t.image.largeImages) w(x); } if ( ((null === (d = t.video) || void 0 === d ? void 0 : null === (c = d.originVideo) || void 0 === c ? void 0 : c.videoUrl) && v.push( e( null === (p = t.video) || void 0 === p ? void 0 : p.originVideo.videoUrl, i ).then((e) => { t.video.originVideo.videoUrl = e; }) ), null === (u = t.video) || void 0 === u ? void 0 : u.transcodedVideo) ) { var S = function (t, n) { v.push( e(n.videoUrl, i).then((e) => { n.videoUrl = e; }) ), v.push( e(n.coverUrl, i).then((e) => { n.coverUrl = e; }) ); }; for (var [M, C] of Object.entries(t.video.transcodedVideo)) S(M, C); } if ( ((null === (f = t.video) || void 0 === f ? void 0 : f.coverUrl) && v.push( e(t.video.coverUrl, i).then((e) => { t.video.coverUrl = e; }) ), null === (h = t.collection) || void 0 === h ? void 0 : h.itemList) ) for (var T of t.collection.itemList) v.push(r(e, T, i)); yield Promise.all(v); })).apply(this, arguments); } function o(e, t, i) { return s.apply(this, arguments); } function s() { return (s = (0, n._)(function* (e, t, i) { if (!!i) { var n = []; for (var a of t) n.push(r(e, a, i)); yield Promise.all(n); } })).apply(this, arguments); } function l(e, t, i) { var n, r, a, o, s, c, d, u, f, h, p; if ( ((null === (n = t.commonAttr) || void 0 === n ? void 0 : n.coverUrl) && (t.commonAttr.coverUrl = e(t.commonAttr.coverUrl, i)), null === (r = t.commonAttr) || void 0 === r ? void 0 : r.coverUrlMap) ) for (var [v, m] of Object.entries(t.commonAttr.coverUrlMap)) t.commonAttr.coverUrlMap[v] = e(m, i); if ( null === (o = t.commonAttr) || void 0 === o ? void 0 : null === (a = o.itemUrls) || void 0 === a ? void 0 : a.length ) for (var [g, _] of Object.entries(t.commonAttr.itemUrls)) t.commonAttr.itemUrls[g] = e(_, i); if (null === (s = t.image) || void 0 === s ? void 0 : s.largeImages) for (var y of t.image.largeImages) y.imageUrl = e(y.imageUrl, i); if ( ((null === (d = t.video) || void 0 === d ? void 0 : null === (c = d.originVideo) || void 0 === c ? void 0 : c.videoUrl) && (t.video.originVideo.videoUrl = e( null === (p = t.video) || void 0 === p ? void 0 : p.originVideo.videoUrl, i )), null === (u = t.video) || void 0 === u ? void 0 : u.transcodedVideo) ) for (var [b, I] of Object.entries(t.video.transcodedVideo)) (I.videoUrl = e(I.videoUrl, i)), (I.coverUrl = e(I.coverUrl, i)); if ( ((null === (f = t.video) || void 0 === f ? void 0 : f.coverUrl) && (t.video.coverUrl = e(t.video.coverUrl, i)), null === (h = t.collection) || void 0 === h ? void 0 : h.itemList) ) for (var w of t.collection.itemList) l(e, w, i); } }, 340733: function (e, t, i) { "use strict"; function n(e, t, i) { var r, a, o, s, l, c, d; if (!!i) { if ( null === (a = t.commonAttr) || void 0 === a ? void 0 : null === (r = a.itemUrls) || void 0 === r ? void 0 : r.length ) for (var [u, f] of Object.entries(t.commonAttr.itemUrls)) t.commonAttr.itemUrls[u] = e(f, i); if ( ((null === (s = t.video) || void 0 === s ? void 0 : null === (o = s.originVideo) || void 0 === o ? void 0 : o.videoUrl) && (t.video.originVideo.videoUrl = e( null === (d = t.video) || void 0 === d ? void 0 : d.originVideo.videoUrl, i )), null === (l = t.video) || void 0 === l ? void 0 : l.transcodedVideo) ) for (var [h, p] of Object.entries(t.video.transcodedVideo)) (p.videoUrl = e(p.videoUrl, i)), (p.coverUrl = e(p.coverUrl, i)); if (null === (c = t.collection) || void 0 === c ? void 0 : c.itemList) for (var v of t.collection.itemList) n(e, v, i); } } function r(e, t, i) { if (!!i) for (var r of t) n(e, r, i); } i.d(t, { H8: function () { return n; }, PY: function () { return r; }, }); }, 972394: function (e, t, i) { "use strict"; i.d(t, { N9: function () { return a; }, VD: function () { return n; }, yl: function () { return r; }, }); var n = (function (e) { return ( (e[(e.EMPTY = -1)] = "EMPTY"), (e[(e.BREAK = 3)] = "BREAK"), (e[(e.BACKSPACE = 8)] = "BACKSPACE"), (e[(e.TAB = 9)] = "TAB"), (e[(e.CLEAR = 12)] = "CLEAR"), (e[(e.ENTER = 13)] = "ENTER"), (e[(e.SHIFT = 16)] = "SHIFT"), (e[(e.CTRL = 17)] = "CTRL"), (e[(e.ALT = 18)] = "ALT"), (e[(e.PAUSE = 19)] = "PAUSE"), (e[(e.CAPS_LOCK = 20)] = "CAPS_LOCK"), (e[(e.ESCAPE = 27)] = "ESCAPE"), (e[(e.SPACE = 32)] = "SPACE"), (e[(e.PAGE_UP = 33)] = "PAGE_UP"), (e[(e.PAGE_DOWN = 34)] = "PAGE_DOWN"), (e[(e.END = 35)] = "END"), (e[(e.HOME = 36)] = "HOME"), (e[(e.ARROW_LEFT = 37)] = "ARROW_LEFT"), (e[(e.ARROW_UP = 38)] = "ARROW_UP"), (e[(e.ARROW_RIGHT = 39)] = "ARROW_RIGHT"), (e[(e.ARROW_DOWN = 40)] = "ARROW_DOWN"), (e[(e.SELECT = 41)] = "SELECT"), (e[(e.PRINT = 42)] = "PRINT"), (e[(e.EXECUTE = 43)] = "EXECUTE"), (e[(e.PRINT_SCREEN = 44)] = "PRINT_SCREEN"), (e[(e.INSERT = 45)] = "INSERT"), (e[(e.DELETE = 46)] = "DELETE"), (e[(e.HELP = 47)] = "HELP"), (e[(e.NUM_0 = 48)] = "NUM_0"), (e[(e.NUM_1 = 49)] = "NUM_1"), (e[(e.NUM_2 = 50)] = "NUM_2"), (e[(e.NUM_3 = 51)] = "NUM_3"), (e[(e.NUM_4 = 52)] = "NUM_4"), (e[(e.NUM_5 = 53)] = "NUM_5"), (e[(e.NUM_6 = 54)] = "NUM_6"), (e[(e.NUM_7 = 55)] = "NUM_7"), (e[(e.NUM_8 = 56)] = "NUM_8"), (e[(e.NUM_9 = 57)] = "NUM_9"), (e[(e.A = 65)] = "A"), (e[(e.B = 66)] = "B"), (e[(e.C = 67)] = "C"), (e[(e.D = 68)] = "D"), (e[(e.E = 69)] = "E"), (e[(e.F = 70)] = "F"), (e[(e.G = 71)] = "G"), (e[(e.H = 72)] = "H"), (e[(e.I = 73)] = "I"), (e[(e.J = 74)] = "J"), (e[(e.K = 75)] = "K"), (e[(e.L = 76)] = "L"), (e[(e.M = 77)] = "M"), (e[(e.N = 78)] = "N"), (e[(e.O = 79)] = "O"), (e[(e.P = 80)] = "P"), (e[(e.Q = 81)] = "Q"), (e[(e.R = 82)] = "R"), (e[(e.S = 83)] = "S"), (e[(e.T = 84)] = "T"), (e[(e.U = 85)] = "U"), (e[(e.V = 86)] = "V"), (e[(e.W = 87)] = "W"), (e[(e.X = 88)] = "X"), (e[(e.Y = 89)] = "Y"), (e[(e.Z = 90)] = "Z"), (e[(e.META_LEFT = 91)] = "META_LEFT"), (e[(e.META_RIGHT = 93)] = "META_RIGHT"), (e[(e.NUM_TIMES = 106)] = "NUM_TIMES"), (e[(e.NUM_PLUS = 107)] = "NUM_PLUS"), (e[(e.NUM_MINUS = 109)] = "NUM_MINUS"), (e[(e.NUM_POINT = 110)] = "NUM_POINT"), (e[(e.NUM_DIVIDE = 111)] = "NUM_DIVIDE"), (e[(e.F1 = 112)] = "F1"), (e[(e.F2 = 113)] = "F2"), (e[(e.F3 = 114)] = "F3"), (e[(e.F4 = 115)] = "F4"), (e[(e.F5 = 116)] = "F5"), (e[(e.F6 = 117)] = "F6"), (e[(e.F7 = 118)] = "F7"), (e[(e.F8 = 119)] = "F8"), (e[(e.F9 = 120)] = "F9"), (e[(e.F10 = 121)] = "F10"), (e[(e.F11 = 122)] = "F11"), (e[(e.F12 = 123)] = "F12"), (e[(e.SEMI = 186)] = "SEMI"), (e[(e.EQUAL = 187)] = "EQUAL"), (e[(e.COMMA = 188)] = "COMMA"), (e[(e.MINUS = 189)] = "MINUS"), (e[(e.PERIOD = 190)] = "PERIOD"), (e[(e.SLASH = 191)] = "SLASH"), (e[(e.BACKQUOTE = 192)] = "BACKQUOTE"), (e[(e.BRACKET_LEFT = 219)] = "BRACKET_LEFT"), (e[(e.BACK_SLASH = 220)] = "BACK_SLASH"), (e[(e.BRACKET_RIGHT = 221)] = "BRACKET_RIGHT"), (e[(e.QUOTE = 222)] = "QUOTE"), e ); })({}), r = (function (e) { return ( (e[(e.EQUAL = 61)] = "EQUAL"), (e[(e.MINUS = 173)] = "MINUS"), (e[(e.SEMI = 59)] = "SEMI"), (e[(e.META_FIREFOX = 224)] = "META_FIREFOX"), e ); })({}), a = (function (e) { return ( (e[(e.SHIFT = 1e3)] = "SHIFT"), (e[(e.ALT = 1e4)] = "ALT"), (e[(e.CTRL_WIN = 1e5)] = "CTRL_WIN"), (e[(e.CTRL_MAC = 2e5)] = "CTRL_MAC"), (e[(e.WIN = 1e6)] = "WIN"), (e[(e.COMMAND = 2e6)] = "COMMAND"), e ); })({}); }, 70137: function (e, t, i) { "use strict"; i.d(t, { Pi: function () { return r; }, aG: function () { return a; }, }); var n = i(333597), r = (function (e) { return ( (e.NOT_LIMITED = "NOT_LIMITED"), (e.ISSUED = "ISSUED"), (e.CONSUMED = "CONSUMED"), e ); })({}), a = (0, n.yh)("commercial-credit-service"); }, 603026: function (e, t, i) { "use strict"; i.d(t, { K: function () { return n; }, }); var n = (0, i(333597).yh)("commercial-goods-service"); }, 484702: function (e, t, i) { "use strict"; i.d(t, { N: function () { return n; }, }); var n = (0, i(333597).yh)("commercial-strategy-service"); }, 451733: function (e, t, i) { "use strict"; i.d(t, { $T: function () { return o; }, $l: function () { return l; }, Bh: function () { return s; }, HX: function () { return a; }, Jo: function () { return r; }, bK: function () { return d; }, e8: function () { return u; }, f3: function () { return f; }, ht: function () { return c; }, lq: function () { return n; }, }); var n = [ "image/jpeg", "image/jpg", "image/png", "image/bmp", "image/webp", ".jpeg", ".jpg", ".png", ".bmp", ".webp", ], r = 20, a = [ "video/quicktime", "video/x-msvideo", "video/avi", "video/x-m4v", "video/x-flv", "video/x-matroska", "application/vnd.rn-realmedia-vbr", ".mp4", ".mov", ".avi", ".m4v", ".flv", ".mkv", ".rmvb", ], o = 50, s = ["image/jpeg", "image/jpg", "image/png", ".jpeg", ".jpg", ".png"], l = ["video/mp4", "video/quicktime", ".mp4", ".mov"], c = ["image/jpeg", "image/jpg", "image/png", ".jpeg", ".jpg", ".png"], d = ["video/mp4", "video/quicktime", ".mp4", ".mov"], u = 3e3, f = 4096; }, 627420: function (e, t, i) { "use strict"; i.d(t, { I: function () { return n; }, o: function () { return r; }, }); var n = 5, r = ""; }, 915814: function (e, t, i) { "use strict"; i.d(t, { $P: function () { return r; }, FV: function () { return o; }, Td: function () { return n; }, cH: function () { return a; }, }); var n = 36, r = 44, a = 2, o = 8; }, 799108: function (e, t, i) { "use strict"; i.d(t, { jk: () => b, SN: () => m, cf: () => S, Zw: () => y, TK: () => P, KV: () => k, Y: () => E, VG: () => D, d8: () => A, J2: () => T, sG: () => C, oV: () => R, sV: () => g, jJ: () => _, Nf: () => x, wZ: () => v, qT: () => N, CU: () => w, vJ: () => p, O6: () => I, lK: () => h, HR: () => M, hO: () => f, }); var n = i("71129"), r = i("604488"), a = i("839141"), o = i("949274"), s = i.p + "static/image/extend-poster.1b7bd457.png", l = i.p + "static/image/lip-sync-poster.df849365.png", c = i.p + "static/image/upscale-poster.70fc9709.png", d = i.p + "static/image/frame-interpolation-poster.754ff61a.png", u = i("150022"), f = (function (e) { return ( (e.GenerateButton = "GenerateButton"), (e.RetryButton = "RetryButton"), (e.ExtendSeconds = "ExtendSeconds"), (e.Download = "Download"), (e.LipSync = "LipSync"), (e.ActionCopy = "ActionCopy"), (e.RegenerateActionCopy = "RegenerateActionCopy"), (e.Character2Video = "Character2Video"), (e.RetryCharacter2Video = "RetryCharacter2Video"), (e.VideoFrameInterpolation = "VideoFrameInterpolation"), (e.VideoUpscale = "VideoUpscale"), (e.ReDub = "ReDub"), (e.LipSyncButton = "LipSyncButton"), (e.ReDubButton = "ReDubButton"), (e.RelaxedGenerateVideo = "RelaxedGenerateVideo"), (e.BatchGenerateVideo = "BatchGenerateVideo"), (e.ContinueLabUpscaleVideo = "ContinueLabUpscaleVideo"), (e.GenerateVideoBGM = "GenerateVideoBGM"), (e.ReGenerateVideoBGM = "ReGenerateVideoBGM"), (e.VideoAudioEffect = "VideoAudioEffect"), (e.VideoModelSwitch = "VideoModelSwitch"), (e.Character2VideoSwitch = "Character2VideoSwitch"), (e.ImageBasicGenerate = "ImageBasicGenerate"), (e.ImagePromptEditor = "ImagePromptEditor"), (e.ImageRetryButton = "ImageRetryButton"), (e.ImageOutPaintButton = "ImageOutPaintButton"), (e.ImageOutPaintTextArea = "ImageOutPaintTextArea"), (e.ImageInPaintRepaintButton = "ImageInPaintRepaintButton"), (e.ImageInPaintRepaintTextArea = "ImageInPaintRepaintTextArea"), (e.ImageInPaintEraserButton = "ImageInPaintEraserButton"), (e.ImageInPaintEraserTextArea = "ImageInPaintEraserTextArea"), (e.ImageMattingButton = "ImageMattingButton"), (e.ImageMagnificButton = "ImageMagnificButton"), (e.ImageControlNetReference = "ImageControlNetReference"), (e.ImageControlNetHumanFace = "ImageControlNetHumanFace"), (e.ImageControlNetObject = "ImageControlNetObject"), (e.ImageControlNetCanny = "ImageControlNetCanny"), (e.ImageControlNetDepth = "ImageControlNetDepth"), (e.ImageControlNetPose = "ImageControlNetPose"), (e.ImageStyleReference = "ImageStyleReference"), (e.ImageIpKeep = "ImageIpKeep"), (e.ImageByteEdit = "ImageByteEdit"), (e.ImageFusion = "ImageFusion"), (e.ImageInstaDragButton = "ImageInstaDragButton"), (e.ImagePostEditor = "ImagePostEditor"), (e.ImageUhd = "ImageUhd"), (e.TextArtGenerationButton = "TextArtGenerationButton"), (e.TextArtGenerationRetryButton = "TextArtGenerationRetryButton"), (e.AudioBasicGenerate = "AudioGenerate"), (e.AudioBasicReGenerate = "AudioBasicReGenerate"), (e.GenerateFreeMock = "GenerateFreeMock"), e ); })({}), h = (function (e) { return ( (e.Video = "video"), (e.Image = "image"), (e.Audio = "audio"), e ); })({}), p = (function (e) { return ( (e.BasicVideoOperation = "basicVideoOperation"), (e.RetryVideoOperation = "retryVideoOperation"), (e.ExtendVideo = "extendVideo"), (e.LipSync = "lipSync"), (e.BasicVideoOperationVideoTemplate = "basicVideoOperationVideoTemplate"), (e.BasicVideoOperation1 = "basicVideoOperationStd2"), (e.RetryVideoOperation1 = "retryVideoOperationStd2"), (e.ExtendVideo1 = "extendVideoStd2"), (e.LipSync1 = "lipSyncStd2"), (e.VideoContinueGenerate1 = "videoContinueGenerateStd2"), (e.BatchGenerateVideo = "batchGenerateVideo"), (e.BasicVideoOperation2 = "basicVideoOperationSmooth2"), (e.RetryVideoOperation2 = "retryVideoOperationSmooth2"), (e.ExtendVideo2 = "extendVideoSmooth2"), (e.LipSync2 = "lipSyncSmooth2"), (e.VideoContinueGenerate2 = "videoContinueGenerateSmooth2"), (e.VideoFrameInterpolation = "videoFrameInterpolation"), (e.VideoUpscale = "videoUpscale"), (e.RemoveWatermark = "removeWatermark"), (e.VideoBgmGeneration = "videoBgmGeneration"), (e.BasicVideoOperationVgfm = "basicVideoOperationVgfm"), (e.BasicVideoOperationLab14 = "basicVideoOperationLab14"), (e.BasicVideoOperationVgfmVip = "basicVideoOperationVgfmVip"), (e.BasicVideoOperationLab14Vip = "basicVideoOperationLab14Vip"), (e.BasicVideoOperationDit = "basicVideoOperationDit"), (e.BasicVideoOperationVgfmLite = "basicVideoOperationVgfmLite"), (e.lipSyncAvatarStd = "lipSyncAvatarStd"), (e.lipSyncAvatarLively = "lipSyncAvatarLively"), (e.VideoAudioEffect = "videoAudioEffectGeneration"), (e.lipSyncAvatarMaster = "lipSyncAvatarMasterFreeTrial"), (e.lipSyncAvatarMasterVip = "lipSyncAvatarMasterFreeTrialVip"), (e.lipSyncAvatarMasterFast = "lipSyncAvatarOmni480"), (e.ImageBasicGenerate = "imageBasicGenerate"), (e.ImageControlNetHumanFace = "imageControlnetHumanFace"), (e.ImageControlNetObject = "imageControlnetObject"), (e.ImageControlNetReference = "imageControlnetReference"), (e.ImageControlNetCanny = "imageControlnetCanny"), (e.ImageControlNetDepth = "imageControlnetDepth"), (e.ImageControlNetPose = "imageControlnetPose"), (e.ImageStyleReference = "imageStyleReference"), (e.ImageStyleCode = "imageStyleCode"), (e.ImageByteEdit = "imageByteEdit"), (e.ImageOutPainting = "imageOutpainting"), (e.ImageInPaintingRepaint = "imageInpaintingRepaint"), (e.ImageInPaintingEraser = "imageInpaintingEraser"), (e.ImageMatting = "imageMatting"), (e.ImageMagnific = "imageMagnific"), (e.ImageIpKeep = "imageIpKeep"), (e.ImageFusion = "imageFusion"), (e.ImageInstaDrag = "imageInstaDrag"), (e.ImageFluxModelGenerate = "imageFluxGenerate"), (e.ImagePostEditor = "imagePostEditor"), (e.ImageUhd = "imageUhd"), (e.AudioSongGenerate = "audioSongGenerate"), (e.TextArtGeneration = "textArtGeneration"), (e.GenerateFreeMock = "GenerateFreeMock"), e ); })({}), v = { basicVideoOperation: "video", retryVideoOperation: "video", extendVideo: "video", lipSync: "video", basicVideoOperationVideoTemplate: "video", basicVideoOperationStd2: "video", retryVideoOperationStd2: "video", basicVideoOperationSmooth2: "video", extendVideoStd2: "video", lipSyncStd2: "video", retryVideoOperationSmooth2: "video", extendVideoSmooth2: "video", lipSyncSmooth2: "video", videoFrameInterpolation: "video", videoUpscale: "video", removeWatermark: "video", batchGenerateVideo: "video", videoContinueGenerateSmooth2: "video", videoContinueGenerateStd2: "video", videoBgmGeneration: "video", basicVideoOperationVgfm: "video", basicVideoOperationLab14: "video", basicVideoOperationDit: "video", basicVideoOperationVgfmLite: "video", lipSyncAvatarStd: "video", lipSyncAvatarLively: "video", videoAudioEffectGeneration: "video", lipSyncAvatarMasterFreeTrial: "video", lipSyncAvatarOmni480: "video", lipSyncAvatarMasterFreeTrialVip: "video", basicVideoOperationVgfmVip: "video", basicVideoOperationLab14Vip: "video", imageBasicGenerate: "image", imageControlnetHumanFace: "image", imageControlnetObject: "image", imageControlnetReference: "image", imageControlnetCanny: "image", imageControlnetDepth: "image", imageControlnetPose: "image", imageStyleReference: "image", imageStyleCode: "image", imageByteEdit: "image", imageOutpainting: "image", imageInpaintingRepaint: "image", imageInpaintingEraser: "image", imageMatting: "image", imageMagnific: "image", imageIpKeep: "image", imageFusion: "image", imageInstaDrag: "image", imageFluxGenerate: "image", textArtGeneration: "image", imagePostEditor: "image", imageUhd: "image", GenerateFreeMock: "image", audioSongGenerate: "audio", }, m = new Set([ "imageControlnetHumanFace", "imageControlnetObject", "imageControlnetReference", "imageControlnetCanny", "imageControlnetDepth", "imageControlnetPose", "imageIpKeep", "imageStyleReference", "imageByteEdit", "imageStyleCode", ]), g = { GenerateButton: "basicVideoOperation", RetryButton: "retryVideoOperation", ExtendSeconds: "extendVideo", Download: "removeWatermark", LipSync: "lipSync", ReDub: "lipSync", LipSyncButton: "lipSync", ReDubButton: "lipSync", ActionCopy: "basicVideoOperationVideoTemplate", RegenerateActionCopy: "basicVideoOperationVideoTemplate", RelaxedGenerateVideo: "basicVideoOperation", VideoUpscale: "videoUpscale", VideoFrameInterpolation: "videoFrameInterpolation", ContinueLabUpscaleVideo: "videoContinueGenerateStd2", BatchGenerateVideo: "batchGenerateVideo", GenerateVideoBGM: "videoBgmGeneration", ReGenerateVideoBGM: "videoBgmGeneration", Character2Video: "lipSyncAvatarStd", RetryCharacter2Video: "lipSyncAvatarLively", VideoAudioEffect: "videoAudioEffectGeneration", VideoModelSwitch: "basicVideoOperation", Character2VideoSwitch: "lipSyncAvatarMasterFreeTrialVip", ImageBasicGenerate: "imageBasicGenerate", ImagePromptEditor: "imageBasicGenerate", ImageRetryButton: "imageBasicGenerate", ImageOutPaintButton: "imageOutpainting", ImageOutPaintTextArea: "imageOutpainting", ImageInPaintRepaintButton: "imageInpaintingRepaint", ImageInPaintRepaintTextArea: "imageInpaintingRepaint", ImageInPaintEraserButton: "imageInpaintingEraser", ImageInPaintEraserTextArea: "imageInpaintingEraser", ImageMattingButton: "imageMatting", ImageMagnificButton: "imageMagnific", ImageControlNetReference: "imageControlnetReference", ImageControlNetHumanFace: "imageControlnetHumanFace", ImageControlNetObject: "imageControlnetObject", ImageControlNetCanny: "imageControlnetCanny", ImageControlNetDepth: "imageControlnetDepth", ImageControlNetPose: "imageControlnetPose", ImageIpKeep: "imageIpKeep", ImageFusion: "imageFusion", ImageStyleReference: "imageStyleReference", ImageByteEdit: "imageByteEdit", ImageInstaDragButton: "imageInstaDrag", ImagePostEditor: "imagePostEditor", ImageUhd: "imageUhd", AudioGenerate: "audioSongGenerate", AudioBasicReGenerate: "audioSongGenerate", TextArtGenerationButton: "textArtGeneration", TextArtGenerationRetryButton: "textArtGeneration", GenerateFreeMock: "GenerateFreeMock", }, _ = { GenerateButton: n.s.CLICK_GENERATE_BUTTON, RetryButton: n.s.CLICK_REGENERATE_BUTTON, ExtendSeconds: n.s.CLICK_VIP_FUNCTION_3s, Download: n.s.CLICK_VIP_FUNCTION_DELETE_WATERMARK, LipSync: n.s.LIP_SYNC, ReDub: n.s.RE_DUB, LipSyncButton: n.s.LIP_SYNC, ReDubButton: n.s.RE_DUB, ActionCopy: n.s.ACTION_COPY, RegenerateActionCopy: n.s.ACTION_COPY, RelaxedGenerateVideo: n.s.RELAXED_GENERATE_MODE_VIP_GUIDE_ENTRANCE, VideoUpscale: n.s.VIDEO_UPSCALE, VideoFrameInterpolation: n.s.VIDEO_FRAME_INTERPLATION, ContinueLabUpscaleVideo: n.s.CONTINUE_LAB_UPSCALE_VIDEO, BatchGenerateVideo: n.s.CLICK_VIDEO_BATCH_GENERATE_BUTTON, GenerateVideoBGM: n.s.GENERATE_VIDEO_BGM, ReGenerateVideoBGM: n.s.RE_GENERATE_VIDEO_BGM, Character2Video: n.s.LIP_SYNC, RetryCharacter2Video: n.s.LIP_SYNC, VideoAudioEffect: n.s.VIDEO_AUDIO_EFFECT, VideoModelSwitch: n.s.BASIC_VIDEO_OPERATION_VGFM, Character2VideoSwitch: n.s.LIP_SYNC_AVATAR_SWITCH, ImageBasicGenerate: n.s.CLICK_TEXT_TO_IMAGE_GENERATE_BUTTON, ImagePromptEditor: n.s.TEXT_GENERATE_PROMPT_EDITOR, ImageRetryButton: n.s.TEXT_GENERATE_RETRY_BUTTON, ImageOutPaintButton: n.s.TEXT_GENERATE_OUTPAINT_BUTTON, ImageOutPaintTextArea: n.s.TEXT_GENERATE_OUTPAINT_BUTTON, ImageInPaintRepaintButton: n.s.TEXT_GENERATE_INPAINT_REPAINT_BUTTON, ImageInPaintRepaintTextArea: n.s.TEXT_GENERATE_INPAINT_REPAINT_BUTTON, ImageInPaintEraserButton: n.s.TEXT_GENERATE_INPAINT_ERASER_BUTTON, ImageInPaintEraserTextArea: n.s.TEXT_GENERATE_INPAINT_ERASER_BUTTON, ImageMattingButton: n.s.TEXT_GENERATE_MATTING_BUTTON, ImageMagnificButton: n.s.TEXT_GENERATE_MAGNIFIC_BUTTON, ImageControlNetReference: n.s.CLICK_CONTROL_NET, ImageControlNetHumanFace: n.s.CLICK_CONTROL_NET, ImageControlNetObject: n.s.CLICK_CONTROL_NET, ImageControlNetCanny: n.s.CLICK_CONTROL_NET, ImageControlNetDepth: n.s.CLICK_CONTROL_NET, ImageControlNetPose: n.s.CLICK_CONTROL_NET, ImageIpKeep: n.s.TEXT_GENERATE_IMAGE_IP_KEEP, ImageFusion: n.s.TEXT_GENERATE_FUSION_BUTTON, ImageStyleReference: n.s.CLICK_CONTROL_NET, ImageByteEdit: n.s.TEXT_GENERATE_IMAGE_BYTE_EDIT, ImageInstaDragButton: n.s.CLICK_IMAGE_INSTA_DRAG_GENERATION_BUTTON, ImagePostEditor: n.s.CLICK_IMAGE_PAINT_EDIT, ImageUhd: n.s.CLICK_IMAGE_UHD_BUTTON, AudioGenerate: n.s.CLICK_TEXT_TO_AUDIO_GENERATE_BUTTON, AudioBasicReGenerate: n.s.CLICK_TEXT_TO_AUDIO_REGENERATE_BUTTON, TextArtGenerationButton: n.s.CLICK_TEXT_ART_GENERATION_BUTTON, TextArtGenerationRetryButton: n.s.CLICK_TEXT_ART_GENERATION_RETRY_BUTTON, GenerateFreeMock: void 0, }, y = "generate_video", b = "generate_img", I = "generate_audio", w = 24, x = 86400, S = 1e6, M = (function (e) { return ( (e.Violation = "34010421"), (e.HostedPageNotAvailable = "36010113"), (e.GenerateViolation = "3003"), (e.OverseaViolation = "-5"), e ); })({}), C = (e) => { var { level: t } = e; return t ? { [a.d.None]: "", [a.d.Standard]: o.ZP.t( "dre_m10n_subscription_plans_standard", {}, "Standard Plan" ), [a.d.Artisan]: o.ZP.t( "dre_m10n_subscription_plans_artisan", {}, "Artisan Plan" ), [a.d.Maestro]: o.ZP.t( "dre_m10n_subscription_plans_maestro", {}, "Maestro Plan" ), }[t] : ""; }, T = (e) => { var { level: t } = e; return t ? { [a.d.None]: "", [a.d.Standard]: o.ZP.t( "dre_m10n_management_page_membership_standard", {}, "Standard" ), [a.d.Artisan]: o.ZP.t( "dre_m10n_management_page_membership_artisan", {}, "Artisan" ), [a.d.Maestro]: o.ZP.t( "dre_m10n_management_page_membership_maestro", {}, "Maestro" ), }[t] : ""; }, A = (e, t) => { if (t) return o.ZP.t( "dre_m10n_subscription_page_staus_oneoff", {}, "1-month" ); switch (e) { case "YEAR": return o.ZP.t( "dre_m10n_subscription_page_staus_yearly", {}, "Yearly" ); case "MONTH": return o.ZP.t( "dre_m10n_subscription_page_staus_monthly", {}, "Monthly" ); default: return e; } }, k = { [a.d.None]: 0, [a.d.Standard]: 1, [a.d.Artisan]: 2, [a.d.Maestro]: 3, }, P = { [a.d.None]: 0, [a.d.Standard]: 1, [a.d.Artisan]: 2, [a.d.Maestro]: 3, }, E = { YEAR: "pay_annually", MONTH: "pay_monthly" }, D = { dre_m10n_subscription_page_plans_yearly: "pay_annually", dre_m10n_subscription_page_plans_monthly: "pay_monthly", dre_m10n_subscription_page_plans_oneoff: "single_purchase", }, R = (e) => { var { scene: t, isOversea: i } = e, n = { coverType: "image", coverUrl: "" }, a = { ExtendSeconds: { coverType: "video", coverUrl: "https://lf3-static." .concat(r.an, "yte") .concat(r.WU, "nsdoc.com/obj/eden-c") .concat(r.zQ, "/fdeh7nulwpgps/extend.mp4"), poster: s, }, LipSync: { coverType: "video", coverUrl: "https://lf3-static." .concat(r.an, "yte") .concat(r.WU, "nsdoc.com/obj/eden-c") .concat(r.zQ, "/fdeh7nulwpgps/lip-sync.mp4"), poster: l, }, ReDub: { coverType: "video", coverUrl: "https://lf3-static." .concat(r.an, "yte") .concat(r.WU, "nsdoc.com/obj/eden-c") .concat(r.zQ, "/fdeh7nulwpgps/lip-sync.mp4"), poster: l, }, VideoUpscale: { coverType: "video", coverUrl: "https://lf3-static." .concat(r.an, "yte") .concat(r.WU, "nsdoc.com/obj/eden-c") .concat(r.zQ, "/nuhonupabps/upscale.mp4"), poster: c, }, VideoFrameInterpolation: { coverType: "video", coverUrl: "https://lf3-static." .concat(r.an, "yte") .concat(r.WU, "nsdoc.com/obj/eden-c") .concat(r.zQ, "/nuhonupabps/frame-interpolation.mp4"), poster: d, }, ImageUhd: { coverType: "image", coverUrl: u }, }, o = { ExtendSeconds: { coverType: "video", coverUrl: "https://sf16-sg." .concat(r._8, "ik") .concat( r._8, "okcdn.com/obj/eden-sg/fdeh7nulwpgps/extend.mp4" ), poster: s, }, LipSync: { coverType: "video", coverUrl: "https://sf16-sg." .concat(r._8, "ik") .concat( r._8, "okcdn.com/obj/eden-sg/fdeh7nulwpgps/lip-sync.mp4" ), poster: l, }, ReDub: { coverType: "video", coverUrl: "https://sf16-sg." .concat(r._8, "ik") .concat( r._8, "okcdn.com/obj/eden-sg/fdeh7nulwpgps/lip-sync.mp4" ), poster: l, }, VideoUpscale: { coverType: "video", coverUrl: "https://sf16-sg." .concat(r._8, "ik") .concat( r._8, "okcdn.com/obj/eden-sg/nuhonupabps/upscale.mp4" ), poster: c, }, VideoFrameInterpolation: { coverType: "video", coverUrl: "https://sf16-sg." .concat(r._8, "ik") .concat( r._8, "okcdn.com/obj/nuhonupabps/frame-interpolation.mp4" ), poster: d, }, ImageUhd: { coverType: "image", coverUrl: u }, }; return t && "boolean" == typeof i ? (i ? o[t] || n : a[t] || n) : n; }, N = "creditWrapper"; }, 37454: function (e, t, i) { "use strict"; i.d(t, { j: function () { return n; }, }); var n = (function (e) { return ( (e.INIT_COMMERCIAL_DATA_FIRST_STEP = "init_commercial_data_first_step"), (e.INIT_COMMERCIAL_DATA_SECOND_STEP = "init_commercial_data_second_step"), (e.INIT_COMMERCIAL_DATA = "init_commercial_data"), (e.RECEIVE_CREDIT = "receive_credit"), (e.MAKE_ORDER_VIP = "make_order_vip"), (e.MAKE_ORDER_CREDIT = "make_order_credit"), (e.QUERY_CREDIT_ORDER = "query_credit_order"), (e.QUERY_VIP_ORDER = "query_vip_order"), (e.PAY = "pay"), e ); })({}); }, 409625: function (e, t, i) { "use strict"; i.d(t, { L_: function () { return n; }, U7: function () { return s; }, iE: function () { return o; }, i_: function () { return a; }, v2: function () { return r; }, }); var n = "GET_FEED_JSONP", r = "GET_WEEKLY_JSONP", a = "COMMUNITY_FETCH_COMMUNITY_PANEL", o = "COMMUNITY_PRELOAD_DEFAULT_COMMUNITY_FEED_LIST", s = "COMMUNITY_GET_DEFAULT_COMMUNITY_FEED_LIST"; }, 487736: function (e, t, i) { "use strict"; i.d(t, { M: function () { return n; }, }); var n = (function (e) { return ( (e.VIP_MODAL = "VIP_MODAL"), (e.CREDIT_MODAL = "CREDIT_MODAL"), (e.NoviceQuestionnaire = "NoviceQuestionnaire"), (e.CharacterGenerateModal = "CharacterGenerateModal"), (e.CommercialLandingModal = "CommercialLandingModal"), (e.VideoExtendModal = "VideoExtendModal"), (e.UpscaleModal = "UpscaleModal"), (e.ImgZoomInModal = "ImgZoomInModal"), (e.OutPaintModal = "OutPaintModal"), (e.InPaintRepaintModal = "InPaintRepaintModal"), (e.InPaintEraserModal = "InPaintEraserModal"), (e.ReportModal = "ReportModal"), (e.PublishModal = "PublishModal"), (e.WorkCollectionDetailModal = "WorkCollectionDetailModal"), (e.PostEditorModal = "PostEditorModal"), (e.ProductHuntModal = "ProductHuntModal"), (e.PrivacyPolicyDialog = "PrivacyPolicyDialog"), e ); })({}); }, 314068: function (e, t, i) { "use strict"; i.d(t, { BN: function () { return r; }, D1: function () { return o; }, U7: function () { return s; }, eF: function () { return c; }, jg: function () { return l; }, vS: function () { return a; }, }); var n = i(224671), r = { [n.jP.OneOne]: { width: 1024, height: 1024, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.FourThree]: { width: 1024, height: 768, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.ThreeFour]: { width: 768, height: 1024, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.TwoThree]: { width: 682, height: 1024, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.ThreeTwo]: { width: 1024, height: 682, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.NineSixteen]: { width: 576, height: 1024, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.SixteenNine]: { width: 1024, height: 576, resolutionType: n.YD.ImageResolutionType_1k, }, [n.jP.TwentyOneNine]: { width: 1195, height: 512, resolutionType: n.YD.ImageResolutionType_1k, }, }, a = 512, o = 1360, s = 1048576, l = r[n.jP.OneOne], c = 1; }, 991303: function (e, t, i) { "use strict"; i.d(t, { AK: function () { return n; }, H$: function () { return s; }, I5: function () { return p; }, Uj: function () { return h; }, Yg: function () { return l; }, dJ: function () { return d; }, do: function () { return a; }, jc: function () { return u; }, jn: function () { return f; }, lA: function () { return o; }, qr: function () { return c; }, w8: function () { return r; }, }); var n = [ "video/quicktime", "video/x-msvideo", "video/avi", "video/x-m4v", "video/x-flv", "video/x-matroska", "application/vnd.rn-realmedia-vbr", ], r = [".mp4", ".mov", ".avi", ".m4v", ".flv", ".mkv", ".rmvb"], a = ["image/png", "image/jpg", "image/jpeg", "image/bmp", "image/webp"], o = [".png", ".jpg", ".jpeg", ".bmp", ".webp"], s = [ "audio/mpeg", "audio/wav", "audio/x-wav", "audio/x-ms-wma", "video/x-ms-wma", "audio/x-m4a", ], l = [".mp3", ".wav", ".wma", ".m4a"], c = 0xa00000, d = 3, u = 7e3, f = 7e3, h = 3, p = "image/jpeg,image/jpg,image/png,image/webp"; }, 469320: function (e, t, i) { "use strict"; i.d(t, { y: function () { return n; }, }); var n = "upload_audio_placeholder_tone_id"; }, 44938: function (e, t, i) { "use strict"; i.d(t, { O: function () { return r; }, u: function () { return n; }, }); var n = { ugCampaignKey: "mweb_campaign_key", ugInviteParams: "mweb_invite_params", ugSecFromUid: "mweb_sec_from_uid", authorInviteCode: "mweb_author_invite_code", authorInviteCodeHasResumedPrefix: "mweb_author_invite_code_has_resumed_", hasFinishVideoQuestion: "mweb_has_finish_video_question", userPortraitSurveyTriggerCount: "user_portrait_trigger_count", userPortraitSurveyHasDone: "user_portrait_has_done", hasDownloadDialogAutoShow: "has_download_dialog_auto_show", userPortraitSurvey1QuestionOptionKey: "user_portrait_survey_first_question_option_key", inpaintBrushSize: "inpaint_brush_size", hasPublished: "has_published", operationAuthorityTypeHasConsumedRedDot: "operation_authority_type_has_consumed_redDot", isBeenOpenedInpaint: "is_been_opened_inpaint", isAgreeUploadImageLaw: "is_agree_upload_image_law", bgPaintBrushSize: "bg_paint_brush_size", isShowBGPaintMessage: "is_show_bg_paint_message", vipExpiryTooltipShowedTime: "vip_expiry_reminder_showed_time", loginStatus: "LV_LOGIN_STATUS", isRedirectFromUnLoginStatus: "is_redirect_from_unlogin_status", isShowCanvasEditorGuide: "is_show_canvas_editor_guide", canvasEditorHdHoverTipsShowCount: "canvas_editor_hd_hover_tips_show_count", isShowStoryEditorTimelineUploadGuide: "is_show_story_editor_timeline_upload_guide", isShowStoryEditorImageGenerateVideoGuide: "is_show_story_editor_image_generate_video_guide", storyboardBackupCollapseStatus: "storyboard_backup_collapse_status", isUsedRelaxMode: "is_used_relax_mode", storyboardTimelineMode: "storyboard_timeline_mode", firstFreeTrialMark: "firstFreeTrialMark", freeTrialConsumedMark: "freeTrialConsumedMark", previewDiscountMark: "previewDiscountMark", previewLimitNotRelaxMark: "previewLimitNotRelaxMark", relaxLimitNotPreviewMark: "relaxLimitNotPreviewMark", previewUpscaleMark: "previewUpscaleMark", groupFeedSelectorMark: "groupFeedSelectorMark", hasOpenedStyleModal: "has_open_style_modal", latestStyleControlId: "latestStyleControlId", isShowLyricsEditorGuide: "is_show_lyrics_editor_guide", userPortraitSurveyAnswer: "user_portrait_survey_answer", imageEditorItemId2DraftId: "image_editor_item_id_to_draft_id", isShowImageEditorGuide: "is_show_image_editor_guide", isShowImageEttaGuide: "is_show_image_etta_guide", receiveCreditsTime: "receive_credits_cache_time", ugNewCampaignDialog: "ug_new_campaign_dialog", ugNewCampaignModelSuccess: "ug_new_campaign_model_success", ugUnfinishedBeforeExpireDialog: "ugUnfinishedBeforeExpireDialog", ugUnClaimedBeforeExpireDialog: "ugUnClaimedBeforeExpireDialog", ugUnClaimedAfterOfflineDialog: "ugUnClaimedAfterOfflineDialog", ugInviteBackDialog: "ugInviteBackDialog", hasShowProductHuntDialog: "has_show_product_hunt_dialog", hiddenCreateToneNewMark: "hidden_create_tone_new_mark", lipSyncMasterFirstFreeTrialMark: "lip_sync_master_first_free_trial_mark", lipSyncMasterFastFirstFreeTrialMark: "lip_sync_master_fast_first_free_trial_mark", }, r = (function (e) { return (e.True = "true"), (e.False = "false"), e; })({}); }, 241047: function (e, t, i) { "use strict"; i.d(t, { GT: function () { return d; }, JI: function () { return a; }, UN: function () { return c; }, Zc: function () { return r; }, fk: function () { return s; }, iV: function () { return o; }, qs: function () { return l; }, }); var n = i(902519), r = { firstTimeFetchCount: 20, count: 40, panel: "image_aigc" }, a = { count: 40, panel: "dreamina_test_area" }, o = { count: 60 }, s = { [n.Ym.Template]: [ n.PK.SINGLE_AND_COLLECTION, n.PK.VIDEO, n.PK.CANVAS_PRODUCTION, ], [n.Ym.Story]: [n.PK.MASTERPIECE], }, l = 1006, c = (function (e) { return (e.Publish = "publish"), (e.Delete = "delete"), e; })({}), d = 2e3; }, 441361: function (e, t, i) { "use strict"; i.d(t, { R3: function () { return c; }, Y4: function () { return d; }, Y9: function () { return f; }, _u: function () { return u; }, a3: function () { return s; }, e1: function () { return o; }, hQ: function () { return a; }, lr: function () { return l; }, qi: function () { return n; }, rO: function () { return r; }, }); var n = "##", r = RegExp("(".concat(n, ")"), "g"), a = RegExp("(\\s*".concat(n, "\\s*)|"), "g"), o = "", s = RegExp("(".concat(o, ")"), "g"), l = RegExp("(\\s*".concat(o, "\\s*)|"), "g"), c = /[\s\u200B]+/g, d = /\u200B/g, u = "web_t2i_quotation_marks_first_half", f = "web_t2i_quotation_marks_second_half"; }, 68442: function (e, t, i) { "use strict"; i.d(t, { s: function () { return r; }, z: function () { return n; }, }); var n = 20, r = 500; }, 720979: function (e, t, i) { "use strict"; i.d(t, { i: function () { return n; }, }); var n = (function (e) { return (e.activeTab = "activeTab"), (e.category = "category"), e; })({}); }, 373177: function (e, t, i) { "use strict"; i.d(t, { o: function () { return n; }, }); var n = (function (e) { return (e.MWEB_BLEND_FILE_INFORMATION = "mwebBlendFileInformation"), e; })({}); }, 949057: function (e, t, i) { "use strict"; i.d(t, { B9: function () { return u; }, FN: function () { return a; }, Fy: function () { return s; }, lo: function () { return c; }, }); var n = i(218571), r = { isOverSea: !1, buildRegion: "sg" }, a = n.createContext(r), o = { assetManager: void 0, boxSelectionManager: void 0 }, s = n.createContext(o), l = { dsrDownloadManager: void 0 }, c = n.createContext(l), d = { dsrManager: void 0 }, u = n.createContext(d); }, 54764: function (e, t, i) { "use strict"; i.d(t, { c: function () { return r; }, r: function () { return o; }, }); var n = i(218571); function r(e, t, i) { var r = (0, n.useRef)({ x: 0, y: 0 }), a = (0, n.useRef)(!1), [o, s] = (0, n.useState)(!1), l = (e) => { (a.current = !0), (r.current = { x: e.clientX, y: e.clientY }); }, c = (0, n.useCallback)( (e) => { if (a.current) { var i = e.clientX - r.current.x, n = e.clientY - r.current.y; if (0 !== i || 0 !== n) s(!0), t(i, n, e), (r.current = { x: e.clientX, y: e.clientY }); } }, [t] ), d = () => { s(!1), (a.current = !1), null == i || i(); }, u = () => { s(!1), (a.current = !1); }; return ( (0, n.useEffect)(() => { var t = e.current; return ( t && (t.addEventListener("mousedown", l), t.addEventListener("mousemove", c), t.addEventListener("mouseup", d), t.addEventListener("mouseleave", u)), () => { t && (t.removeEventListener("mousedown", l), t.removeEventListener("mousemove", c), t.removeEventListener("mouseup", d), t.removeEventListener("mouseleave", u)); } ); }, [e, o, c]), [o] ); } function a() { var e = (0, n.useRef)(!1), t = (0, n.useRef)(), i = (i) => { (e.current = i), t.current && clearTimeout(t.current), (t.current = setTimeout(() => { e.current = !i; }, 30)); }; return ( (0, n.useEffect)( () => () => { t.current && clearTimeout(t.current); }, [] ), [e, i] ); } function o(e, t, i) { var [r, o] = a(), s = (0, n.useCallback)( (n) => { if ( (n.preventDefault(), n.stopPropagation(), null === (a = e.current) || void 0 === a || a.click(), n.ctrlKey) ) s = n.deltaY > 0; else { var a, s, l = null == n ? void 0 : n.wheelDeltaY, c = window.navigator.platform.toUpperCase().indexOf("MAC") >= 0, d = l ? 2 >= Math.abs(l + 3 * n.deltaY) : 0 === n.deltaMode; if (!r.current && d) { i(-n.deltaX, -n.deltaY); return; } (s = c ? n.deltaY < 0 : n.deltaY > 0), o(!0); } t(s); }, [i, e, t, r, o] ); (0, n.useEffect)(() => { e.current && (e.current.onwheel = s); }, [e, s]); } }, 932616: function (e, t, i) { "use strict"; i.d(t, { h: function () { return l; }, }); var n = i(417699), r = i(699267), a = i(218571), o = i(652494), s = i(603026), l = () => { var e = (0, r.G)(n.e), t = (0, r.G)(s.K), { isOversea: i } = e, [l, c] = (0, a.useState)(o.y.CREDITS_RULE(i)); return ( (0, a.useEffect)(() => { if (i) { c( null !== (n = null === (e = t.displayInfo) || void 0 === e ? void 0 : e.creditsRule) && void 0 !== n ? n : l ); var e, n, r = t.onDisplayInfoChange((e) => { var t; c( null !== (t = null == e ? void 0 : e.creditsRule) && void 0 !== t ? t : l ); }); return () => { r.dispose(); }; } }, []), l ); }; }, 522692: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return o; }, }); var n = i(484702), r = i(699267), a = i(218571), o = () => { var e = (0, r.G)(n.N), [t, i] = (0, a.useState)(e.isInFreemiumStage); return ( (0, a.useEffect)(() => { i(e.isInFreemiumStage); var t = e.onIsInFreemiumStageChange((e) => { i(e); }); return () => { t.dispose(); }; }, []), t ); }; }, 529531: function (e, t, i) { "use strict"; i.d(t, { p: function () { return s; }, }); var n = i(699267), r = i(218571), a = i(522692), o = i(70137), s = () => { var e = (0, n.G)(o.aG), [t, i] = (0, r.useState)(null == e ? void 0 : e.localCredit), s = (0, a.Z)(); return ( (0, r.useEffect)(() => { i(e.localCredit), e.onLocalCreditChange(() => { i(e.localCredit); }); }, []), s || t < 0 ? 0 : t ); }; }, 969197: function (e, t, i) { "use strict"; i.d(t, { P: function () { return u; }, }); var n = i(293793), r = i(278978), a = i(73021), o = i(699267), s = i(27433), l = i(899229), c = i(218571), d = i(484702), u = (e) => { var t, i = (0, o.G)(d.N), u = (0, a.default)(e.extraBenefits), { batchNumber: f = 1 } = e, h = (0, n.default)(() => (0, s.Qp)({ scene: e.scene, extraBenefits: u, videoDuration: e.videoDuration, commercialStrategyService: i, discount: e.discount, sceneOptions: e.sceneOptions, batchNumber: f, }) ), p = (0, c.useMemo)(() => { var t; return (null === (t = e.sceneOptions) || void 0 === t ? void 0 : t.version) === l.dt.V2CharVideo ? e.sceneOptions.characterMode : e.sceneOptions && "mode" in e.sceneOptions ? e.sceneOptions.mode : void 0; }, [e.sceneOptions]), v = e.sceneOptions && "modelReqKey" in e.sceneOptions ? e.sceneOptions.modelReqKey : "", m = (0, r.default)(); return ( (0, c.useEffect)(() => { var e = i.onAllPaidStrategyChange(() => { m(); }); return () => { e.dispose(); }; }, [i, m]), (0, c.useMemo)( () => h(), [ e.scene, p, u, i.getAllPaidStrategy(), f, e.videoDuration, e.discount, null === (t = e.sceneOptions) || void 0 === t ? void 0 : t.version, v, h, ] ) ); }; }, 472159: function (e, t, i) { "use strict"; i.d(t, { R: function () { return s; }, }); var n = i(293793), r = i(218571), a = i(997166); function o(e, t, i, n) { return e.slice(0, t) + n + e.slice(i); } function s(e, t, i) { var s = (0, r.useRef)(-1), l = (0, r.useRef)(-1), c = (0, n.default)(() => { var n, r, c, d = null === (n = i.current) || void 0 === n ? void 0 : n.dom; if (!!d) { var u = null !== (r = d.selectionStart) && void 0 !== r ? r : 0, f = null !== (c = d.selectionEnd) && void 0 !== c ? c : 0, { leftQuote: h, rightQuote: p } = (0, a.wc)(), v = e.slice(u, f); t(o(e, u, f, h + v + p)), (s.current = u + 1), (l.current = f + 1); } }); return ( (0, r.useEffect)(() => { var e, t = null === (e = i.current) || void 0 === e ? void 0 : e.dom; if (!!t && -1 !== s.current) t.focus(), t.setSelectionRange(s.current, l.current), (s.current = -1), (l.current = -1); }, [e]), { handleInsertQuotes: c } ); } }, 528498: function (e, t, i) { "use strict"; i.d(t, { CY: function () { return o; }, UY: function () { return s; }, uy: function () { return l; }, }); var n = i(218571); class r { observe(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; this._observedElementList.push(e), this._callbackMap.set(e, { callback: t, isCallbackOnce: i }), this._observer.observe(e); } unobserve(e) { var t, i = this._observedElementList.indexOf(e); i >= 0 && (this._observedElementList.splice(i, 1), this._callbackMap.delete(e), null === (t = this._observer) || void 0 === t || t.unobserve(e)); } disconnect() { var e; (this._observedElementList = []), this._callbackMap.clear(), null === (e = this._observer) || void 0 === e || e.disconnect(); } constructor(e) { (this._callbackMap = new Map()), (this._observedElementList = []), (this._handleIntersection = (e) => { e.forEach((e) => { var { target: t, isIntersecting: i, intersectionRatio: n } = e, r = i && n >= this._threshold, a = this._callbackMap.get(t); if (!!a) { var { callback: o, isCallbackOnce: s } = a; s && r && this.unobserve(t), o(r); } }); }); var t, { threshold: i } = null != e ? e : {}, n = 1; (this._observer = new IntersectionObserver( this._handleIntersection, e )), (this._threshold = null !== (t = Array.isArray(i) ? i[0] : i) && void 0 !== t ? t : n); } } var a = new r({ threshold: 0.2 }); function o(e, t) { var i = (0, n.useRef)(null), r = (0, n.useRef)(a), [o, s] = (0, n.useState)(!1); return ( (0, n.useEffect)(() => { var n = i.current; return ( n && r.current.observe( n, (e) => { s(e), null == t || t(e); }, e ), () => { n && r.current.unobserve(n); } ); }, [i, e]), [i, o] ); } function s(e, t) { var i = (0, n.useRef)(null), r = (0, n.useRef)(a); return ( (0, n.useEffect)(() => { var n = i.current; return ( n && r.current.observe( n, (e) => { null == t || t(e); }, e ), () => { n && r.current.unobserve(n); } ); }, [e, t]), i ); } function l() { var e = !(arguments.length > 0) || void 0 === arguments[0] || arguments[0], t = (0, n.useRef)(null), i = (0, n.useRef)(a), [r, o] = (0, n.useState)(!1), s = (0, n.useRef)(!1), l = (0, n.useCallback)(() => { if (!s.current) { s.current = !0; var e = t.current; e && i.current.observe(e, (e) => o(e)); } }, []), c = (0, n.useCallback)(() => { s.current = !1; var e = t.current; e && i.current.unobserve(e); }, []); return ( (0, n.useEffect)(() => (e && l(), c), []), { elementRef: t, isIntersecting: r, observe: l, unobserve: c } ); } }, 887073: function (e, t, i) { "use strict"; i.d(t, { r: function () { return r; }, }); var n = i(218571); function r(e, t, i) { var r = (0, n.useCallback)( (i) => { i.keyCode === e && (null == t || t(i)); }, [t, e] ); (0, n.useEffect)( () => ( document.addEventListener("keydown", r, i), () => { document.removeEventListener("keydown", r, i); } ), [r, i] ); } }, 626291: function (e, t, i) { "use strict"; i.d(t, { M: function () { return a; }, }); var n = i(471605), r = i(699267), a = () => { var e, t = ( (null === (e = window.__locationInfo) || void 0 === e ? void 0 : e.code) || "" ).toLowerCase(), i = (0, r.G)(n.S); return { region: t, lang: null == i ? void 0 : i.currentLocale }; }; }, 884619: function (e, t, i) { "use strict"; i.d(t, { D: function () { return s; }, }); var n = i(14606), r = i(699267), a = i(218571), o = i(694545); function s() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : (0, o.I)(), [t, i] = (0, a.useState)(), [s, l] = (0, a.useState)(""), [c, d] = (0, a.useState)(), u = (0, r.G)(n.A); return ( (0, a.useEffect)(() => { d(!0), null == u || u.aggregate .getCommonConfigByKey("secUid") .then((t) => { i(e === t), l(null != t ? t : ""); }) .finally(() => { d(!1); }); }, [u, e]), { isMyself: t, mySecUid: s, secUidLoading: c } ); } }, 691563: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return a; }, }); var n = i(218571); class r { dispose() { document.removeEventListener( "visibilitychange", this._onVisibilityChange ); } addListener(e, t) { this._listenerMap[e] = t; } clearListener() { this._listenerMap = {}; } removeListener(e) { delete this._listenerMap[e]; } constructor() { (this._listenerMap = {}), (this._onVisibilityChange = () => { var e = "visible" === document.visibilityState; for (var t of Object.values(this._listenerMap)) null == t || t(e); }), document.addEventListener( "visibilitychange", this._onVisibilityChange ); } } function a(e) { var [t, i] = (0, n.useState)(!0), a = (e) => { i(e); }; return ( (0, n.useEffect)( () => ( r.instance.addListener(e, a), () => { r.instance.removeListener(e); } ), [] ), [t] ); } r.instance = new r(); }, 351066: function (e, t, i) { "use strict"; i.d(t, { C: function () { return n; }, }); var n = (function (e) { return ( (e.INIT = "init"), (e.LOADING = "loading"), (e.FAIL = "fail"), (e.SUCCESS = "success"), (e.RETRYABLE_FAIL = "can_retry_fail"), e ); })({}); }, 870730: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return r; }, a: function () { return n; }, }); var n = (function (e) { return ( (e.limitTimes = "limit_times"), (e.limitDuration = "limit_duration"), (e.limitCredits = "limit_credits"), (e.nonTrial = "non_trial"), e ); })({}), r = (function (e) { return ( (e.none = "none"), (e.freeTrial = "free_trial"), (e.firstMonthDiscount = "first_month_discount"), (e.multiDiscount = "multi_discount"), e ); })({}); }, 894803: function (e, t, i) { "use strict"; i.d(t, { m: function () { return o; }, }); var n = i(369617), r = i(100470), a = i(949274); function o(e) { e === r.b.ErrSharkNotPass && n.s.error( a.ZP.t( "dreamina_web_user_violate_operation", {}, "\u60A8\u6D89\u53CA\u8FDD\u89C4\u64CD\u4F5C\uFF0C\u6682\u65F6\u65E0\u6CD5\u4F7F\u7528\u8BE5\u529F\u80FD" ) ); } }, 817585: function (e, t, i) { "use strict"; i.d(t, { V: function () { return a; }, }); var n = i(537201), r = i(108982), a = (e) => { var t = 0; return ( null == e || e.forEach((e) => { n.i[e.name] === r.s.FaceGan && ++t; }), t > 1 ); }; }, 182688: function (e, t, i) { "use strict"; i.d(t, { DR: function () { return D; }, DY: function () { return R; }, Ej: function () { return S; }, KZ: function () { return b; }, Kx: function () { return w; }, LW: function () { return L; }, NC: function () { return A; }, NG: function () { return M; }, RW: function () { return P; }, Sz: function () { return B; }, TE: function () { return k; }, b2: function () { return C; }, h5: function () { return N; }, pF: function () { return x; }, sk: function () { return T; }, t_: function () { return I; }, }); var n = i(139646), r = i(351066), a = i(584531), o = i(243302), s = i(56168), l = i(128468), c = i(111709), d = i(201636), u = i(417281), f = i(804274), h = i(881607), p = i(369617), v = i(708171), m = i(949274), g = i(699813), _ = i(997166), y = i(13523); function b(e) { switch (e) { case o.Pd.Init: return r.C.INIT; case o.Pd.SubmitOk: return r.C.LOADING; case o.Pd.FinalGenerateFail: case o.Pd.PreTnsCheckNotPass: return r.C.FAIL; case o.Pd.FinalSuccess: case o.Pd.Deleted: return r.C.SUCCESS; default: return r.C.FAIL; } } function I(e) { if ( (arguments.length > 1 && void 0 !== arguments[1] && arguments[1], null === (t = e.itemList) || void 0 === t ? void 0 : t[0]) ) { var t, i = (0, s.C)(e.itemList[0], e.historyRecordId); e.videoDreamina = i; } return (0, a.o)(e); } function w(e) { var t = e[0], { aigcImageParams: i } = t, { generateType: n } = i; return ( n !== o.pi.Text2Image && n !== o.pi.Blend && n !== o.pi.SuperResolution && n !== o.pi.FineTunePromptWithText2Image && n !== o.pi.FineTunePromptWithSuperResolution && n !== o.pi.InPaint && n !== o.pi.OutPaint && n !== o.pi.InPaintRemove && n !== o.pi.SuperDefinition && n !== o.pi.Matting && n !== o.pi.Fusion && n !== o.pi.InstaDrag && (0, g.ss)( "image record could only be created from image record[type: ".concat( n, "]" ) ), { generateType: null != n ? n : o.pi.Text2Image, historyRecordId: "", originHistoryRecordId: "", createdTime: t.commonAttr.createTime, itemList: e, task: { taskId: "", submitId: "", aid: 0, status: o.Pd.FinalSuccess, finishTime: 0, historyId: "", }, assetOption: { hasFavorited: !1 }, status: o.Pd.FinalSuccess, mode: l.JU.Workbench, submitId: "", finishTime: 0, } ); } function x(e) { var t, i, { aigcImageParams: n } = e, { generateType: r } = n; return { generateType: null != r ? r : o.pi.Text2Video, historyRecordId: "", originHistoryRecordId: "", createdTime: e.commonAttr.createTime, itemList: [e], task: { taskId: "", submitId: "", aid: 0, status: o.Pd.FinalSuccess, finishTime: 0, historyId: "", originalInput: (0, h.fs)(n.text2videoParams, f.zW), firstFrameImage: { imageUrl: e.commonAttr.coverUrl, imageUri: null !== (i = null === (t = e.video) || void 0 === t ? void 0 : t.coverUri) && void 0 !== i ? i : "", }, }, assetOption: { hasFavorited: !1 }, status: o.Pd.FinalSuccess, mode: l.JU.Workbench, submitId: "", }; } var S = (e) => [r.C.INIT, r.C.LOADING].includes(e), M = (e) => e === o.pi.VideoBGM, C = (e) => e === o.pi.VideoAudioEffect, T = (e) => M(e) || C(e), A = (e) => e === o.pi.AudioVideoMix || e === o.pi.VideoAudioEffectMix; function k(e, t) { var i = e.selectModel, n = (0, v.Y)(t); if (!(i && n(i))) { var r = e.getValidModel(void 0, n); e.updateSelectModel(r); var a = r ? m.ZP.t( "dre_auto_match_model_toast", {}, "The best model has been matched for you" ) : m.ZP.t("dre_toast_no_available_model", {}, "No available models"); p.s.normal(a); } } function P(e) { return E.apply(this, arguments); } function E() { return (E = (0, n._)(function* (e) { var t = yield null == e ? void 0 : e.tryToUpdateSelectModel(); if (t !== y.F.NotUpdated) { var i = t === y.F.NoAvailableModel ? m.ZP.t( "dre_toast_no_available_model", {}, "No available models" ) : m.ZP.t( "dre_auto_match_model_toast", {}, "The best model has been matched for you" ); p.s.normal(i); } })).apply(this, arguments); } function D(e) { return !!(null == e ? void 0 : e.includes(c.Wn.Etta)); } function R(e) { var { leftQuote: t, rightQuote: i } = (0, _.wc)(); return new RegExp( "(".concat(t, "[^").concat(t).concat(i, "]+").concat(i, ')|("[^"]+")') ).test(e); } function N(e, t, i) { return R(e) && i ? m.ZP.t( "web_image_edit_draw_words_placeholder_text", {}, 'Enter the copy you want to change through ""' ) : t; } function L(e) { var t; return ( (null == e ? void 0 : null === (t = e.idInfo) || void 0 === t ? void 0 : t.itemPlatform) === d.oH.Local ); } var j = [u.UI.StyleCode, u.UI.StyleReference], O = [o.pi.Blend, o.pi.SuperDefinition, o.pi.SuperResolution]; function B(e, t) { return e.some((e) => j.includes(e.name)) && O.includes(t); } }, 727280: function (e, t, i) { "use strict"; i.d(t, { aY: () => x, Jf: () => E, AE: () => I, DX: () => y, PS: () => p, Tt: () => T, Ip: () => w, DH: () => D, uA: () => _, ec: () => R, }); var n = i("625572"), r = i("639880"), a = i("441361"), o = i("417281"), s = i("128468"), l = i("639985"), c = i("949274"), d = i("997166"); function u(e) { return e.replace(a.rO, "__$1__").split("__"); } var f = i("172834"), h = i("627420"), p = [o.UI.ByteEdit, o.UI.IpKeep, o.UI.StyleReference]; function v() { var e = c.ZP.t("dre_t2i_style_ref_trigger_word", {}, "style"); return RegExp("#(".concat(e, "|style)\\s?([a-zA-Z0-9]{6})"), "gi"); } function m() { var { leftQuote: e, rightQuote: t } = (0, d.wc)(); return new RegExp("".concat(e, "[^").concat(t, "]+").concat(t)); } function g(e) { var { uri: t = "", url: i = "", width: a = 0, height: o = 0, imageWeightList: s, } = e; return { image: (0, r._)((0, n._)({}, e), { imageUri: t, imageUrl: i, width: a, height: o, }), styleWeight: s[0], }; } function _(e, t) { var i, a = e.reduce( (e, t) => (t.name === o.UI.StyleReference && e.push(t), e), [] ); if (!a.length) return null; var l = a.map((e) => { var t, i, a, o; return { image: (0, r._)((0, n._)({}, e), { imageUri: null !== (t = e.uri) && void 0 !== t ? t : "", imageUrl: null !== (i = e.url) && void 0 !== i ? i : "", width: null !== (a = e.width) && void 0 !== a ? a : 0, height: null !== (o = e.height) && void 0 !== o ? o : 0, }), styleWeight: e.imageWeightList[0], }; }); if (!t) { var [c] = e; return { id: c.id, name: o.UI.StyleCode, commonAsset: { assetType: s.d_.Style, assetCode: "", referImageList: l, }, }; } return (0, o.iB)(t) ? { id: t.id, name: o.UI.StyleCode, commonAsset: (0, r._)((0, n._)({}, t.commonAsset), { referImageList: [ ...(null !== (i = t.commonAsset.referImageList) && void 0 !== i ? i : []), ...l, ], }), } : (0, o.D3)(t) ? { id: t.id, name: o.UI.StyleCode, commonAsset: { assetType: s.d_.Style, assetCode: h.o, referImageList: [g(t)].concat(l), }, } : null; } function y(e) { return (0, o.iB)(e) && e.commonAsset.assetCode === h.o; } function b(e, t) { for (var i = [], n = e.indexOf(t); -1 !== n; ) i.push(n), (n = e.indexOf(t, n + 1)); return i; } function I(e) { var t = v(); return !!e.match(t); } function w(e, t) { var i = m(), n = !!e.match(i); return !t.length && n; } function x(e, t) { var i = I(e), n = w(e, t); return i && !n; } function S(e, t) { for (var i = [], n = null; (n = t.exec(e)); ) i.push({ start: n.index, length: n[0].length }); return i; } var M = RegExp(a.qi, "g"); function C(e, t, i) { var n = S(e, M), r = t.filter((e) => e >= 0 && e < n.length).sort((e, t) => t - e), a = e; for (var o of r) { var s = n[o], l = i(o); a = a.slice(0, s.start) + l + a.slice(s.start + s.length); } return a; } function T(e, t) { var { image: i, styleWeight: a } = e, s = { png: l.uF.Png, jpeg: l.uF.Jpeg, webp: l.uF.Webp }; return (0, r._)((0, n._)({}, t), { name: o.UI.StyleReference, imageUriList: [i.imageUri], imageWeightList: [a], styleReference: { image: { imageUri: i.imageUri, imageUrl: i.imageUrl, width: i.width, height: i.height, format: i.format ? s[i.format] : void 0, everPhoto: i.everPhoto, coverUrlMap: i.coverUrlMap, }, styleWeight: a, }, uri: i.imageUri, url: i.imageUrl, coverUrl: i.imageUrl, width: i.width, height: i.height, }); } function A(e, t) { for (var i, n = []; null !== (i = t.exec(e)); ) { var r = i.index; if (!(r > 0) || "#" !== e[r - 1] || (1 !== r && "#" === e[r - 2])) n.push({ index: i.index, match: i[2] }); } return n; } function k(e, t) { for ( var i = b(e, a.qi), n = v(), r = A(e, n), l = [], c = 0, d = 0; c < i.length && d < r.length; ) { var u = i[c], f = r[d]; f.index < u ? (l.push({ name: o.UI.StyleCode, commonAsset: { assetCode: f.match, assetType: s.d_.Style }, }), d++) : (l.push(t[c]), c++); } return ( d === r.length ? (l = l.concat(t.slice(c))) : c === i.length && (l = l.concat( r .slice(d) .map((e) => ({ name: o.UI.StyleCode, commonAsset: { assetCode: e.match, assetType: s.d_.Style }, })) )), { prompt: e.replace(n, a.qi), imagePromptList: l.filter((e) => !!e) } ); } function P(e, t) { for (var i = [], n = 0; n < t.length; n++) y(t[n]) && i.push(n); return { prompt: C(e, i, (e) => { var i, n = t[e]; return y(n) ? Array( null === (i = n.commonAsset.referImageList) || void 0 === i ? void 0 : i.length ) .fill(a.qi) .join("") : a.qi; }), imagePromptList: t.reduce((e, t) => { if (y(t)) { var i, n = ( null !== (i = t.commonAsset.referImageList) && void 0 !== i ? i : [] ).map((e) => T(e, t)); return e.concat(n); } return e.concat(t); }, []), }; } function E(e) { var { prompt: t, imagePromptList: i } = e, r = x(t, i), a = i.some((e) => y(e)); if (!r && !a) return e; var o = (0, n._)({}, e); if (r) { var { prompt: s, imagePromptList: l } = k(t, i); (o.prompt = s), (o.imagePromptList = l); } if (a) { var { prompt: c, imagePromptList: d } = P( o.prompt, o.imagePromptList ); (o.prompt = c), (o.imagePromptList = d); } return o; } function D(e) { var t = function (e) { if (e !== a.qi) return v.push(e), "continue"; if (p >= l.length) return "break"; var { abilityIndex: t } = l[p], i = n[t]; if ((0, o.U0)(i)) return ( v.push(e), -1 === _ && (m.push(i), (_ = m.length - 1)), g.push({ abilityIndex: _ }), p++, "continue" ); if (!(0, o.D3)(i)) return ( v.push(e), m.push(i), g.push({ abilityIndex: m.length - 1 }), p++, "continue" ); p++; var r = i.styleReference.image.imageUri, s = c.find((e) => { var t; return null === (t = e.referImageList) || void 0 === t ? void 0 : t.some((e) => e.image.imageUri === r); }); return r && d.includes(r) && s ? h.some((e) => e.assetCode === s.assetCode) ? "continue" : void h.push(s) : (v.push(e), m.push(i), g.push({ abilityIndex: m.length - 1 }), "continue"); }, { prompt: i, imagePromptList: n, commonAssetList: r, promptPlaceholderInfoList: l, } = e, c = r.filter((e) => e.assetType === s.d_.Style); if (!c.length) return null; var d = c.reduce((e, t) => { var i, n; return e.concat( null !== (n = null === (i = t.referImageList) || void 0 === i ? void 0 : i.map((e) => e.image.imageUri)) && void 0 !== n ? n : [] ); }, []), f = u(i), h = [], p = 0, v = [], m = [], g = [], _ = -1; for (var y of f) if ("break" === t(y)) break; var b = h.map((e) => ({ name: o.UI.StyleCode, commonAsset: { assetType: s.d_.Style, assetCode: e.assetCode, referImageList: e.referImageList, }, imageList: [], ipKeepList: [], })), I = g, w = b.length; w && (I = Array(b.length) .fill(0) .map((e, t) => ({ abilityIndex: t })) .concat(g.map((e) => ({ abilityIndex: e.abilityIndex + w })))); var x = b.concat(m); return { prompt: a.qi.repeat(w).concat(v.join("")), abilityList: x, promptPlaceholderInfoList: I, }; } function R(e, t, i) { if ( !e || !(null == t ? void 0 : t.length) || !(null == i ? void 0 : i.length) || t.filter((e) => e.name === f.DABlendAbilityName.StyleReference) .length <= 1 ) return e; var n = u(e), r = [], o = [], s = 0, l = !1, c = null !== (h = null == i ? void 0 : i.length) && void 0 !== h ? h : 0; for (var d of n) { var h, p, v = d === a.qi; if (!d) { r.push(d); continue; } if (!v) { r.push(d), (l = !d.trim() && l); continue; } if (s >= c) break; var m = t[ null !== (p = null == i ? void 0 : i[s].abilityIndex) && void 0 !== p ? p : 0 ]; m.name === f.DABlendAbilityName.StyleReference ? (!l && (o.push(m), r.push(d)), (l = !0)) : ((l = !1), r.push(d)), s++; } return r.join(""); } }, 412961: function (e, t, i) { "use strict"; i.d(t, { AX: function () { return G; }, CU: function () { return j; }, Gl: function () { return N; }, Iu: function () { return A; }, J8: function () { return L; }, JK: function () { return z; }, LN: function () { return K; }, NF: function () { return Z; }, Pd: function () { return H; }, Wo: function () { return D; }, bN: function () { return T; }, gv: function () { return E; }, iP: function () { return W; }, iS: function () { return R; }, lE: function () { return V; }, pw: function () { return k; }, wu: function () { return O; }, }); var n = i(625572), r = i(639880), a = i(475578), o = i(227700), s = i(593187), l = i(822040), c = i(424437), d = i(455091), u = i(773820), f = i(561658), h = i(869919), p = i(733787), v = i(599045), m = i(549654), g = i(202401), _ = i(224671), y = i(52533), b = i(755769), I = i(899229), w = i(388977), x = i(182688), S = i(673326), M = i(469320), C = i(586961), T = (e) => { var t, { originalInput: i, processFlows: n } = e; return ( (null !== (t = null == i ? void 0 : i.videoGenInputs[0].videoMode) && void 0 !== t ? t : h.tB.Default) === h.tB.Preview || (!!n && !!(n.length > 0) && n[n.length - 1].curProcessFlows[0] === p.v8.LabSR) ); }, A = (e) => e === h.tB.Preview, k = function (e) { var t, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : h.tB.LipSyncDefault; if (!e) return null; i === h.tB.LipSyncDefault && (t = "standard"), i === h.tB.LipSyncLively && (t = "vivid"), i === h.tB.LipSyncMaster && (t = "high_quality"), i === h.tB.LipSyncMasterFast && (t = "hq_480"); var { sourceType: n, toneCategoryId: r, toneCategoryKey: a, toneId: o, toneKey: s, } = e; if (n === v.M.LocalFile) return { lip_sync_type: "upload_audio", lip_sync_mode: t, voice_category_id: r ? "".concat(r) : "all", voice_category_key: a, voice_id: o === M.y ? "" : o, voice_key: s, }; var { text: l, speed: c } = e; return { lip_sync_type: "text_to_speech", lip_sync_mode: t, script: l, audio_speed: c.toFixed(1), voice_category_id: r ? "".concat(r) : "all", voice_category_key: a, voice_id: o, voice_key: s, }; }, P = (e) => { var t = { frameInterpolationCnt: 0, upscaleCnt: 0, lipSyncCnt: 0, addMoreCnt: 0, }; return ( e && e.forEach((e) => { e.curProcessFlows.forEach((e) => { switch (e) { case p.v8.Extend: t.addMoreCnt += 1; break; case p.v8.LipSync: case p.v8.LipSyncImage: case p.v8.LipSyncUserVideo: t.lipSyncCnt += 1; break; case p.v8.SuperResolution: t.upscaleCnt += 1; break; case p.v8.InsertFrame: t.frameInterpolationCnt += 1; } }); }), t ); }, E = (e) => { var t, i, { processFlows: a, taskPayload: o, originalInput: s } = e, { v2vOpt: l } = s.videoGenInputs[0], { promptSource: c } = o.taskExtra, d = P(a); return (0, r._)( (0, n._)( { currentProcess: a ? a[(null == a ? void 0 : a.length) - 1].curProcessFlows[0] : void 0, operater: c, }, d ), { originalFrameRate: c === u.K.FrameInterpolation ? null == l ? void 0 : null === (t = l.insertFrame) || void 0 === t ? void 0 : t.originFps : void 0, newFrameRate: c === u.K.FrameInterpolation ? null == l ? void 0 : null === (i = l.insertFrame) || void 0 === i ? void 0 : i.targetFps : void 0, newResolution: c === u.K.Upscale && (null == l ? void 0 : l.superResolution) ? "" .concat(l.superResolution.targetWidth, " * ") .concat(l.superResolution.targetHeight) : void 0, originalResolution: c === u.K.Upscale && (null == l ? void 0 : l.superResolution) ? "" .concat(l.superResolution.targetWidth / 2, " * ") .concat(l.superResolution.targetHeight / 2) : void 0, } ); }, D = (e, t) => { var i, a, o, s, l = null == t ? void 0 : t.processFlows, { v2vOpt: c } = null !== (o = null == t ? void 0 : t.originalInput.videoGenInputs[0]) && void 0 !== o ? o : e, { promptSource: d } = null !== (s = null == t ? void 0 : t.taskPayload.taskExtra) && void 0 !== s ? s : null == e ? void 0 : e.extra, f = P(l); return (0, r._)( (0, n._)( { currentProcess: l ? l[(null == l ? void 0 : l.length) - 1].curProcessFlows[0] : void 0, operater: d, }, f ), { originalFrameRate: d === u.K.FrameInterpolation ? null == c ? void 0 : null === (i = c.insertFrame) || void 0 === i ? void 0 : i.originFps : void 0, newFrameRate: d === u.K.FrameInterpolation ? null == c ? void 0 : null === (a = c.insertFrame) || void 0 === a ? void 0 : a.targetFps : void 0, newResolution: d === u.K.Upscale && (null == c ? void 0 : c.superResolution) ? "" .concat(c.superResolution.targetWidth, " * ") .concat(c.superResolution.targetHeight) : void 0, originalResolution: d === u.K.Upscale && (null == c ? void 0 : c.superResolution) ? "" .concat(c.superResolution.targetWidth / 2, " * ") .concat(c.superResolution.targetHeight / 2) : void 0, } ); }, R = (e, t, i, r, a) => { var s, l, c, d, f, v, m, g, _, y, b, I, w, S, M, T, A, P, E, D, R, N, L, j, O, B = null == t ? void 0 : t.originalInput.videoGenInputs[0], F = null !== (y = null == B ? void 0 : null === (s = B.firstFrameImage) || void 0 === s ? void 0 : s.imageUrl) && void 0 !== y ? y : null === (c = r.inputImages) || void 0 === c ? void 0 : null === (l = c[0]) || void 0 === l ? void 0 : l.imageUrl, U = null !== (b = null == B ? void 0 : null === (d = B.endFrameImage) || void 0 === d ? void 0 : d.imageUrl) && void 0 !== b ? b : null === (v = r.inputImages) || void 0 === v ? void 0 : null === (f = v[1]) || void 0 === f ? void 0 : f.imageUrl, G = Number(!!F) + Number(!!U), z = null !== (I = null == t ? void 0 : null === (m = t.taskPayload) || void 0 === m ? void 0 : m.taskExtra) && void 0 !== I ? I : r.extra, V = (w = a && (0, x.sk)(a) ? null !== (M = null === (S = r.extra) || void 0 === S ? void 0 : S.promptSource) && void 0 !== M ? M : u.K.Custom : null !== (T = null == z ? void 0 : z.promptSource) && void 0 !== T ? T : u.K.Custom) === u.K.Remix, W = [ u.K.AddMore, u.K.LipSync, u.K.Redub, u.K.Upscale, u.K.FrameInterpolation, ].includes(w) ? "postedit" : "generate", Z = null == z ? void 0 : z.lipSyncInfo, K = null !== (A = null == B ? void 0 : B.prompt) && void 0 !== A ? A : r.textPrompt, H = null !== (P = null == B ? void 0 : B.lensMotionType) && void 0 !== P ? P : null == r ? void 0 : r.motionType, q = null !== (E = null == B ? void 0 : B.durationMs) && void 0 !== E ? E : r.originDurationMs, J = null !== (D = null == B ? void 0 : B.fps) && void 0 !== D ? D : r.originFps, Y = null !== (R = null == t ? void 0 : t.originalInput.videoAspectRatio) && void 0 !== R ? R : r.videoRatio, Q = null !== (N = null == t ? void 0 : t.originalInput.seed) && void 0 !== N ? N : r.seed, X = null !== (L = null == B ? void 0 : B.videoMode) && void 0 !== L ? L : r.videoMode; return (0, n._)( { video_id: null !== (j = null == t ? void 0 : null === (g = t.videoBGMInfo) || void 0 === g ? void 0 : g.originHistoryId) && void 0 !== j ? j : i, task_id: "".concat(null == t ? void 0 : t.taskId), prompt_source: w, aigc_type: W, prompt: null != K ? K : "", prompt_cnt: null !== (O = null == K ? void 0 : K.length) && void 0 !== O ? O : 0, image_prompt_cnt: (0, C.sG)(r) ? 1 : G, movement_type: o.QN[null != H ? H : p.H7.StillShot], movement_strength: (null == B ? void 0 : B.cameraStrength) ? o.Ep[B.cameraStrength] : void 0, origin_video_duration: q, generate_mode: J === h.WP.Fluency ? o.oT.fluent : o.oT.normal, aspect_ratio: G > 0 ? "custom" : Y, video_speed: "".concat(r.motionSpeed), seed: "".concat(Q), is_default_seed: (null == z ? void 0 : z.isDefaultSeed) ? 1 : 0, ai_video_id: V ? "".concat(null == t ? void 0 : t.taskId) : void 0, ai_video_name: V ? K : void 0, author_id: V ? "".concat( null == e ? void 0 : null === (_ = e.author) || void 0 === _ ? void 0 : _.uid ) : void 0, origin_submit_id: null == z ? void 0 : z.originSubmitId, last_submit_id: null == z ? void 0 : z.previewSubmitId, batch_number: null == z ? void 0 : z.batchNumber, }, k(Z, X) ); }, N = (e) => { var t, i, n, { uid: r, taskDetail: a, inputParams: o } = e; if ( !r || (null == o ? void 0 : null === (t = o.boximator) || void 0 === t ? void 0 : t.boxes.length) ) return !1; var s = "DREAMINA_VIDEO_SETTINGS_".concat(r), l = window.localStorage.getItem(s); if (!l) return !1; try { n = JSON.parse(l); } catch (e) { return !1; } var c = { useLastFrame: n.useLastFrame, useImage: n.useImage, ratio: n.ratio, motion: n.motion, speed: n.speed, originDurationMs: n.originDurationMs, originFps: n.originFps, motionIntensity: n.motionIntensity, }; if ( a && (null === (i = a.originalInput) || void 0 === i ? void 0 : i.videoGenInputs.length) > 0 ) { var d = a.originalInput.videoGenInputs[0], u = !!d.firstFrameImage, f = !!d.endFrameImage; return ( u === c.useImage && f === c.useLastFrame && m.E[d.motionSpeed] === c.speed && d.durationMs === c.originDurationMs && d.fps === c.originFps && d.lensMotionType === c.motion && a.originalInput.videoAspectRatio === c.ratio ); } if (o) { var h = o.inputImages && o.inputImages.length > 0, p = o.inputImages && o.inputImages.length > 1; return ( h === c.useImage && p === c.useLastFrame && o.motionSpeed === c.speed && o.originDurationMs === c.originDurationMs && o.originFps === c.originFps && o.motionType === c.motion && o.videoRatio === c.ratio ); } return !1; }, L = (e) => { var t, i, n, { taskDetail: r, videoDetail: a } = e, o = null == a ? void 0 : a.aigcParams.text2videoParams, s = null !== (n = null == o ? void 0 : o.videoGenInputs[0]) && void 0 !== n ? n : null == r ? void 0 : null === (t = r.originalInput) || void 0 === t ? void 0 : t.videoGenInputs[0]; return null == s ? void 0 : null === (i = s.firstFrameImage) || void 0 === i ? void 0 : i.aigcImage; }, j = (e) => { var t, i, n, r, { taskDetail: a, videoDetail: o } = e, s = null == o ? void 0 : o.aigcParams.text2videoParams; return null !== (r = null == s ? void 0 : null === (t = s.videoModelConfig) || void 0 === t ? void 0 : t.modelNameStarlingKey) && void 0 !== r ? r : null == a ? void 0 : null === (n = a.originalInput) || void 0 === n ? void 0 : null === (i = n.videoModelConfig) || void 0 === i ? void 0 : i.modelNameStarlingKey; }, O = (e) => { var t, i, n, r, a, o; return ( null == e ? void 0 : null === (i = e.videoTemplateItem) || void 0 === i ? void 0 : null === (t = i.extra) || void 0 === t ? void 0 : t.videoTemplateOfficial ) ? { video_action_template_id: null == e ? void 0 : null === (r = e.videoTemplateItem) || void 0 === r ? void 0 : null === (n = r.commonAttr) || void 0 === n ? void 0 : n.id, video_action_template_name: null == e ? void 0 : null === (o = e.videoTemplateItem) || void 0 === o ? void 0 : null === (a = o.commonAttr) || void 0 === a ? void 0 : a.title, } : {}; }, B = (e, t, i) => { if (i && (0, x.NG)(i)) { var n, r, a, s, l, c = null == t ? void 0 : null === (n = t.audioList) || void 0 === n ? void 0 : n.findIndex((e) => { var i; return ( e.audio.vid === (null == t ? void 0 : null === (i = t.default) || void 0 === i ? void 0 : i.vid) ); }), d = (null == e ? void 0 : null === (r = e.videoBGMInfo) || void 0 === r ? void 0 : r.promptSource) === h.X2.Tag ? o.hp.custom : o.hp.frame; return { ai_music_id: null == t ? void 0 : null === (a = t.default) || void 0 === a ? void 0 : a.vid, ai_music_type: (null == e ? void 0 : e.videoBGMInfo) ? d : void 0, ai_music_submitid: null == e ? void 0 : e.submitId, ai_music_taskid: null == e ? void 0 : e.taskId, music_prompt: null == e ? void 0 : null === (l = e.videoBGMInfo) || void 0 === l ? void 0 : null === (s = l.tags) || void 0 === s ? void 0 : s.map((e) => e.name).join(","), ai_music_rank: void 0 !== c ? c + 1 : void 0, }; } }, F = 3, U = (e, t) => { if (t && (0, x.b2)(t)) { var i, n, r, a = null !== (r = null == e ? void 0 : null === (i = e.audioList) || void 0 === i ? void 0 : i.filter((e) => "fail" === e.audio.status).length) && void 0 !== r ? r : F, o = 0 !== a ? "fail_".concat(a) : "success"; return { audio_vid: a === F ? "0,0,0" : null == e ? void 0 : null === (n = e.audioList) || void 0 === n ? void 0 : n .map((e) => { var t; return null !== (t = e.audio.vid) && void 0 !== t ? t : 0; }) .join(","), audio_generate_result: o, }; } }, G = (e, t) => { var i, a; return t ? (0, x.b2)(t) ? (0, r._)((0, n._)({}, U(e, t)), { audio_generate_fail_code: null == e ? void 0 : null === (i = e.audioList) || void 0 === i ? void 0 : i .map((e) => { var { audio: t } = e; return "success" === t.status ? "0" : t.failCode; }) .join(","), }) : (0, x.NG)(t) ? { ai_music_id: null == e ? void 0 : null === (a = e.audioList) || void 0 === a ? void 0 : a .map((e) => { var { audio: t } = e; return t.vid; }) .join(","), } : void 0 : void 0; }, z = (e, t, i) => { if (!!i) { if ((0, x.b2)(i)) { var a, o, s, l, c = { [g.O.Init]: 0, [g.O.Processing]: 0, [g.O.Success]: 1, [g.O.Fail]: -1, }, d = null == t ? void 0 : null === (s = t.audioList) || void 0 === s ? void 0 : null === (o = s.find((e) => { var i, { audio: n } = e; return ( (null == n ? void 0 : n.vid) === (null === (i = t.default) || void 0 === i ? void 0 : i.vid) ); })) || void 0 === o ? void 0 : null === (a = o.mixAudioVideo) || void 0 === a ? void 0 : a.status; return (0, r._)((0, n._)({}, U(t, i)), { audio_vid_chosen: null == t ? void 0 : null === (l = t.default) || void 0 === l ? void 0 : l.vid, audio_synthesize_status: d ? c[d] : -1, }); } if ((0, x.NG)(i)) return B(e, t, i); } }, V = (e) => { var t, i, l, c, d, p, v, m, g, _, y, x, M, A, P, E, D, R, B, F, U, G, V, W, { id: Z, input: K, taskDetail: H, videoDetail: q, containerService: J, options: Y, accountService: Q, page: X, generateType: $, } = e, ee = null === (i = K.inputImages) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.imageUrl, et = null === (c = K.inputImages) || void 0 === c ? void 0 : null === (l = c[1]) || void 0 === l ? void 0 : l.imageUrl, ei = Number(!!ee) + Number(!!et), en = null !== (E = K.extra) && void 0 !== E ? E : null == H ? void 0 : null === (d = H.taskPayload) || void 0 === d ? void 0 : d.taskExtra; null == H || H.processFlows; var er = null == en ? void 0 : en.lipSyncInfo, { task_id: ea, author_id: eo } = Y, es = null == q ? void 0 : q.originVideo, el = (null == en ? void 0 : en.promptSource) === u.K.Remix, ec = null !== (D = null == en ? void 0 : en.promptSource) && void 0 !== D ? D : u.K.Custom, ed = [ u.K.AddMore, u.K.LipSync, u.K.Redub, u.K.Upscale, u.K.FrameInterpolation, ].includes(ec) ? "postedit" : "generate", eu = null == Q ? void 0 : Q.userProfile.uid, ef = null === (p = K.boximator) || void 0 === p ? void 0 : p.boxes.map((e, t) => { var i, n = e.motionPath.length ? 1 : 0, r = (null === (i = e.boundingBox) || void 0 === i ? void 0 : i.length) > 1 ? 1 : 0; return { ["Box".concat(t + 1)]: { is_path_added: n, is_end_added: r, }, }; }), eh = null == q ? void 0 : q.aigcParams.text2videoParams, ep = null == Y ? void 0 : Y.show_type; try { var { isGroupView: ev } = (0, w.ko)( J, f.N ).contentRecordListManager; ep = ev ? o.mb.Collect : o.mb.Normal; } catch (e) {} var em = L({ taskDetail: H, videoDetail: q }), eg = null == H ? void 0 : null === (m = H.originalInput) || void 0 === m ? void 0 : null === (v = m.videoGenInputs[0]) || void 0 === v ? void 0 : v.v2vOpt, e_ = null == H ? void 0 : null === (_ = H.originalInput) || void 0 === _ ? void 0 : null === (g = _.videoGenInputs[0]) || void 0 === g ? void 0 : g.i2vOpt, ey = (0, n._)( (0, r._)( (0, n._)( (0, r._)( (0, n._)( { video_id: Z, item_id: null == q ? void 0 : q.aigcItemId, task_id: ea, submit_id: null == H ? void 0 : H.submitId, prompt_source: ec, aigc_type: ed, prompt: "" .concat(ee ? "".concat(ee, " ") : "") .concat( null !== (R = K.textPrompt) && void 0 !== R ? R : "" ) .concat(et ? "".concat(et, " ") : ""), prompt_cnt: null !== (B = null === (y = K.textPrompt) || void 0 === y ? void 0 : y.length) && void 0 !== B ? B : 0, image_prompt_cnt: (0, C.sG)(K) ? 1 : ei, movement_type: K.motionType ? o.QN[K.motionType] : void 0, movement_strength: K.motionIntensity ? o.Ep[K.motionIntensity] : void 0, generate_mode: K.originFps === h.WP.Fluency ? o.oT.fluent : o.oT.normal, origin_video_duration: K.originDurationMs, aspect_ratio: ei > 0 ? "custom" : K.videoRatio, video_speed: "".concat(K.motionSpeed), seed: "".concat(K.seed), is_default_seed: ( null == en ? void 0 : en.isDefaultSeed ) ? 1 : 0, ai_video_id: el ? ea : void 0, author_id: el ? eo : void 0, page: null != X ? X : a.WZ.AigcVideo, video_duration: null !== (U = null !== (F = null == q ? void 0 : q.duration) && void 0 !== F ? F : (0, b.M)({ taskDetail: H, videoDetail: q, inputParams: K, })) && void 0 !== U ? U : void 0, frame_rate: (null == es ? void 0 : es.fps) ? "".concat(null == es ? void 0 : es.fps, "fps") : void 0, resolution: es ? "".concat(es.width, "x").concat(es.height) : void 0, scene_options: { version: I.dt.V2, mode: (0, I.xc)(K.originFps), containerService: J, }, }, k(er, K.videoMode) ), { is_from_preview: H && T(H) ? 1 : 0, is_quick_preview: K.videoMode === h.tB.Preview ? 1 : 0, is_preset: N({ uid: eu, inputParams: K, taskDetail: H }) ? 1 : 0, origin_submit_id: null == en ? void 0 : en.originSubmitId, last_submit_id: null == en ? void 0 : en.previewSubmitId, generate_num: null !== (G = null == en ? void 0 : en.batchNumber) && void 0 !== G ? G : 1, magic_box_cnt: null !== (V = null === (x = K.boximator) || void 0 === x ? void 0 : x.boxes.length) && void 0 !== V ? V : 0, magic_box_info: JSON.stringify(ef), model_key: null == eh ? void 0 : eh.modelReqKey, model_name: j({ taskDetail: H, videoDetail: q }), last_picture_id: null == em ? void 0 : em.itemId, last_generate_id: null == em ? void 0 : null === (M = em.aigcImageParams) || void 0 === M ? void 0 : M.generateId, picture_generate_type: null == em ? void 0 : null === (A = em.aigcImageParams) || void 0 === A ? void 0 : A.generateType, template_id: null == en ? void 0 : en.originTemplateId, impression_id: null == en ? void 0 : en.impressionId, result_vid: null == q ? void 0 : q.videoId, generate_type: $, } ), z(H, q, $) ), { emotion_key: null == er ? void 0 : null === (P = er.toneEmotion) || void 0 === P ? void 0 : P.nameKey, is_voice_clone: (0, S.$l)(eg, e_) ? 1 : 0, is_audio_to_audio: (0, S.eE)(er) ? 1 : 0, } ), O(H) ); (0, s.$)( J, (0, r._)((0, n._)({}, ey, Y), { show_type: null !== (W = null == Y ? void 0 : Y.show_type) && void 0 !== W ? W : ep, }) ); }, W = (e) => { var t, i, s, c, d, f, p, v, m, g, b, w, x, M, A, P, E, { resourceId: D, inputParams: R, containerService: j, accountService: B, promptSource: F, authorId: U, originId: G, isDefaultSeed: z, enterFrom: V, seed: W, scene: Z, creditNow: K, discount: H, withRelaxedGenerateModeSwitch: q, isRelaxedGenerate: J, aiType: Y, aiSubType: Q, videoDuration: X, isVoiceVipExclusive: $, lipSyncInfo: ee, taskDetail: et, videoDetail: ei, submitId: en, lipSyncMode: er, page: ea = a.WZ.AigcVideo, impressionId: eo, lastPictureId: es, lastGenerateId: el, pictureGenerateType: ec, modelName: ed, generateType: eu, emotionKey: ef, isVoiceClone: eh, replyMessageId: ep, templateTypeId: ev, } = e, em = F === u.K.Remix, eg = null === (i = R.inputImages) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.imageUrl, e_ = null === (c = R.inputImages) || void 0 === c ? void 0 : null === (s = c[1]) || void 0 === s ? void 0 : s.imageUrl, ey = Number(!!eg) + Number(!!e_), eb = [ u.K.AddMore, u.K.LipSync, u.K.Redub, u.K.FrameInterpolation, u.K.Upscale, ].includes(F) ? "postedit" : "generate"; function eI() { var { pathname: e } = location, t = { "/home": _.Q8.Home, "/explore": _.Q8.Explore, "/activity": _.Q8.ActivityDetail, "/personal": _.Q8.OthersProfile, }; for (var i in t) if (e.includes(i)) return t[i]; return _.Q8.Default; } var ew = null == B ? void 0 : B.userProfile.uid, ex = null === (d = R.boximator) || void 0 === d ? void 0 : d.boxes.map((e, t) => { var i, n = e.motionPath.length ? 1 : 0, r = (null === (i = e.boundingBox) || void 0 === i ? void 0 : i.length) > 1 ? 1 : 0; return { ["Box".concat(t + 1)]: { is_path_added: n, is_end_added: r, }, }; }), eS = L({ taskDetail: et, videoDetail: ei }); (0, l.s)( j, (0, r._)( (0, n._)( (0, r._)( (0, n._)( { page: ea, submit_id: en, prompt_source: F, aigc_type: eb, prompt: "" .concat(eg ? "".concat(eg, " ") : "") .concat( null !== (M = R.textPrompt) && void 0 !== M ? M : "" ) .concat(e_ ? "".concat(e_) : ""), prompt_cnt: null !== (A = null === (f = R.textPrompt) || void 0 === f ? void 0 : f.length) && void 0 !== A ? A : 0, image_prompt_cnt: (0, C.sG)(R) ? 1 : ey, movement_type: R.motionType ? o.QN[R.motionType] : void 0, aspect_ratio: ey > 0 ? "custom" : R.videoRatio, video_speed: "".concat(R.motionSpeed), seed: "".concat(null != W ? W : R.seed), ai_video_id: em ? D : void 0, template_id: em ? D : void 0, template_source: eI(), author_id: em ? U : void 0, source_video_vid: G, is_default_seed: z ? 1 : 0, enter_from: V, movement_strength: R.motionIntensity ? o.Ep[R.motionIntensity] : void 0, generate_mode: R.originFps === h.WP.Fluency ? o.oT.fluent : o.oT.normal, origin_video_duration: R.originDurationMs, video_duration: null != X ? X : (null == R ? void 0 : R.originDurationMs) ? (null == R ? void 0 : R.originDurationMs) / 1e3 : void 0, scene_options: { version: I.dt.V2, mode: (0, I.xc)(R.originFps), containerService: j, }, is_voice_vip_exclusive: (0, y.Z)($) ? void 0 : Number($), credits_now: K, scene: Z, discount: H, withRelaxedGenerateModeSwitch: q, isRelaxedGenerate: J, aiType: Y, aiSubType: Q, }, k(ee, er) ), { is_from_preview: et && T(et) ? 1 : 0, is_quick_preview: R.videoMode === h.tB.Preview ? 1 : 0, is_preset: N({ uid: ew, inputParams: R, taskDetail: et }) ? 1 : 0, extend_duration_ms: null === (v = R.v2vOpt) || void 0 === v ? void 0 : null === (p = v.extend) || void 0 === p ? void 0 : p.extendDurationMs, generate_num: null !== (P = R.batchNumber) && void 0 !== P ? P : 1, magic_box_cnt: null !== (E = null === (m = R.boximator) || void 0 === m ? void 0 : m.boxes.length) && void 0 !== E ? E : 0, magic_box_info: JSON.stringify(ex), impression_id: eo, model_key: R.modelReqKey, model_name: null != ed ? ed : null == et ? void 0 : null === (b = et.originalInput) || void 0 === b ? void 0 : null === (g = b.videoModelConfig) || void 0 === g ? void 0 : g.modelNameStarlingKey, last_picture_id: null != es ? es : null == eS ? void 0 : eS.itemId, last_generate_id: null != el ? el : null == eS ? void 0 : null === (w = eS.aigcImageParams) || void 0 === w ? void 0 : w.generateId, picture_generate_type: null != ec ? ec : null == eS ? void 0 : null === (x = eS.aigcImageParams) || void 0 === x ? void 0 : x.generateType, generate_type: eu, emotion_key: ef, is_voice_clone: eh, is_audio_to_audio: (0, S.eE)(ee) ? 1 : 0, reply_message_id: ep, } ), O(et) ), { template_type_id: ev } ) ); }, Z = (e, t, i, n, r) => { (0, c.M)(t, { action: i, video_id: e, is_usable: n ? 1 : 0, page: r, }); }, K = (e) => { var t, i, n, r, s, l, c, f, p, v, m, g, _, y, b, I, w, x, M, A, k, P, D, R, N, { taskDetail: L, inputParams: O, videoDetail: B, containerService: F, status: U, failReason: G, enterFrom: z, generateType: V, } = e; if (!!L) { var W = L.originalInput.videoGenInputs[0], Z = null === (t = O.boximator) || void 0 === t ? void 0 : t.boxes.map((e, t) => { var i, n = e.motionPath.length ? 1 : 0, r = (null === (i = e.boundingBox) || void 0 === i ? void 0 : i.length) > 1 ? 1 : 0; return { ["Box".concat(t + 1)]: { is_path_added: n, is_end_added: r, }, }; }), K = Number( !!(null === (i = W.firstFrameImage) || void 0 === i ? void 0 : i.imageUrl) ) + Number( !!(null === (n = W.endFrameImage) || void 0 === n ? void 0 : n.imageUrl) ), H = null === (r = L.taskPayload) || void 0 === r ? void 0 : r.taskExtra, q = (null == H ? void 0 : H.promptSource) === u.K.Remix, J = null !== (I = null == H ? void 0 : H.promptSource) && void 0 !== I ? I : u.K.Custom, Y = [ u.K.AddMore, u.K.LipSync, u.K.Redub, u.K.FrameInterpolation, u.K.Upscale, ].includes(J) ? "postedit" : "generate", Q = E(L), X = null == B ? void 0 : B.aigcParams.text2videoParams, $ = null === (l = ( null !== (w = null == X ? void 0 : X.videoGenInputs[0]) && void 0 !== w ? w : null === (s = L.originalInput) || void 0 === s ? void 0 : s.videoGenInputs[0] ).firstFrameImage) || void 0 === l ? void 0 : l.aigcImage, { v2vOpt: ee, i2vOpt: et } = L.originalInput.videoGenInputs[0]; (0, d.k)(F, { submit_id: L.submitId, status: U, video_id: null !== (x = null == B ? void 0 : B.videoId) && void 0 !== x ? x : "", is_draft_gen: L.isUseDraftGen ? a._O.True : a._O.False, task_id: "".concat(L.taskId), export_ai_video_taskid: "".concat(L.taskId), prompt_source: J, aigc_type: Y, prompt: "" .concat( null !== (M = null === (c = W.firstFrameImage) || void 0 === c ? void 0 : c.imageUrl) && void 0 !== M ? M : "" ) .concat(null !== (A = W.prompt) && void 0 !== A ? A : "") .concat( null !== (k = null === (f = W.endFrameImage) || void 0 === f ? void 0 : f.imageUrl) && void 0 !== k ? k : "" ), prompt_cnt: null !== (P = null === (p = W.prompt) || void 0 === p ? void 0 : p.length) && void 0 !== P ? P : 0, image_prompt_cnt: (0, C.sG)(O) ? 1 : K, movement_type: o.QN[W.lensMotionType], aspect_ratio: K > 0 ? "custom" : L.originalInput.videoAspectRatio, video_speed: "".concat(O.motionSpeed), seed: "".concat(L.originalInput.seed), ai_video_id: q ? "".concat(L.taskId) : void 0, author_id: q ? "".concat( null !== (D = null == B ? void 0 : null === (v = B.author) || void 0 === v ? void 0 : v.uid) && void 0 !== D ? D : "" ) : void 0, source_video_vid: null == H ? void 0 : H.originId, edit_type: "ai_video", is_default_seed: (null == H ? void 0 : H.isDefaultSeed) ? 1 : 0, page: a.WZ.StoryEditor, video_duration: null !== (R = null == B ? void 0 : B.durationMs) && void 0 !== R ? R : 0, frame_interpolation_cnt: null == Q ? void 0 : Q.frameInterpolationCnt, upscale_cnt: null == Q ? void 0 : Q.upscaleCnt, lip_sync_cnt: null == Q ? void 0 : Q.lipSyncCnt, add_more_cnt: null == Q ? void 0 : Q.addMoreCnt, frame_rate: (null == B ? void 0 : B.originVideo.fps) ? "".concat(null == B ? void 0 : B.originVideo.fps, "fps") : void 0, resolution: (null == B ? void 0 : B.originVideo) ? "" .concat(null == B ? void 0 : B.originVideo.width, "x") .concat(null == B ? void 0 : B.originVideo.height) : void 0, movement_strength: O.motionIntensity ? o.Ep[O.motionIntensity] : void 0, generate_mode: O.originFps === h.WP.Fluency ? o.oT.fluent : o.oT.normal, is_from_preview: L && T(L) ? 1 : 0, enter_from: z, failReason: G, export_ai_video_id: null == B ? void 0 : B.aigcItemId, magic_box_cnt: null !== (N = null === (m = O.boximator) || void 0 === m ? void 0 : m.boxes.length) && void 0 !== N ? N : 0, magic_box_info: JSON.stringify(Z), model_key: null == X ? void 0 : X.modelReqKey, model_name: j({ taskDetail: L, videoDetail: B }), last_picture_id: null == $ ? void 0 : $.itemId, last_generate_id: null == $ ? void 0 : null === (g = $.aigcImageParams) || void 0 === g ? void 0 : g.generateId, picture_generate_type: null == $ ? void 0 : null === (_ = $.aigcImageParams) || void 0 === _ ? void 0 : _.generateType, generate_type: V, emotion_key: null == H ? void 0 : null === (b = H.lipSyncInfo) || void 0 === b ? void 0 : null === (y = b.toneEmotion) || void 0 === y ? void 0 : y.nameKey, is_voice_clone: (0, S.$l)(ee, et) ? 1 : 0, is_audio_to_audio: (0, S.eE)(null == H ? void 0 : H.lipSyncInfo) ? 1 : 0, }); } }; function H(e) { var t, i, n, r; return ( null == e ? void 0 : null === (r = e.videoGenInputs) || void 0 === r ? void 0 : null === (n = r[0]) || void 0 === n ? void 0 : null === (i = n.firstFrameImage) || void 0 === i ? void 0 : null === (t = i.aigcImage) || void 0 === t ? void 0 : t.itemId ) ? a.px.TextToImageTOVideo : a.px.Video; } }, 193931: function (e, t, i) { "use strict"; i.d(t, { DM: function () { return l; }, Dx: function () { return h; }, TH: function () { return c; }, aV: function () { return u; }, }); var n = i(139646), r = i(552786), a = i(349817), o = i(388977), s = i(34878), l = (e) => e.status === r.Ve.BETA_AVAILABLE || e.status === r.Ve.RELEASED; function c(e, t) { return d.apply(this, arguments); } function d() { return (d = (0, n._)(function* (e, t) { var i = (0, o.ko)(e, a.q), n = i.getValue(t); return ( !n && (yield new Promise((e) => { (0, s.V)(i.onInit)(() => { (n = i.getValue(t)), e(void 0); }); })), n && l(n) ); })).apply(this, arguments); } function u(e, t) { return f.apply(this, arguments); } function f() { return (f = (0, n._)(function* (e, t) { var i = (0, o.ko)(e, a.q), n = i.getValue(t); return ( !n && (yield new Promise((e) => { (0, s.V)(i.onInit)(() => { (n = i.getValue(t)), e(void 0); }); })), n && n.status !== r.Ve.UNAVAILABLE ); })).apply(this, arguments); } var h = (e) => { var { featureDataReady: t, featureData: i } = e, n = (null == i ? void 0 : i.status) !== r.Ve.RELEASED; return { showIcon: n, disabled: !t || (null == i ? void 0 : i.status) === r.Ve.UNAVAILABLE || (null == i ? void 0 : i.status) === r.Ve.BETA_INAVAILABLE, }; }; }, 519171: function (e, t, i) { "use strict"; function n(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 175, i = 1.5, n = 0.67, { width: r = t, height: a = t } = e, o = r / a; return o > 1.5 ? { width: "".concat(t, "px"), height: "".concat(t * n, "px") } : o < n ? { width: "".concat(t, "px"), height: "".concat(t * i, "px") } : { width: "".concat(t, "px"), height: "".concat(t, "px") }; } i.d(t, { T: function () { return n; }, }); }, 644866: function (e, t, i) { "use strict"; i.d(t, { O: function () { return o; }, }); var n = i(537201), r = i(108982), a = i(417281), o = (e) => { if (!e) return r.s.Unknown; var t, i, { name: o, controlNetList: s } = e; return o === a.UI.ControlNet ? n.i[ null !== (i = null == s ? void 0 : null === (t = s[0]) || void 0 === t ? void 0 : t.name) && void 0 !== i ? i : r.s.Unknown ] : n.i[o]; }; }, 540611: function (e, t, i) { "use strict"; i.d(t, { CI: function () { return b; }, N3: function () { return v; }, NN: function () { return w; }, U7: function () { return y; }, }); var n = i(139646), r = i(489897), a = i(108982), o = i(111709), s = i(417281), l = i(128468), c = i(552786), d = i(949274), u = i(441361), f = i(193931), h = i(644866), p = i(891602); function v(e, t) { return m.apply(this, arguments); } function m() { return (m = (0, n._)(function* (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], [n, r, o] = yield Promise.all([ (0, f.TH)(t, c.em.HUMAN_FACE_ENABLE), (0, f.TH)(t, c.em.BG_PAINT_ENABLE), (0, f.TH)(t, c.em.DREAMINA_SMART_REFERENCE), ]), s = []; return ( o && !i && s.push(a.s.ByteEdit), r && s.push(a.s.BgPaint), n && s.push(a.s.FaceGan), !i && s.push(a.s.IpKeep), !i && !e && s.push(a.s.StyleReference), s.push( a.s.ControlNetCanny, a.s.ControlNetDepth, a.s.ControlNetPose ), s ); })).apply(this, arguments); } function g(e, t) { var i; if ( (null == t ? void 0 : null === (i = t.feats) || void 0 === i ? void 0 : i.includes(o.oo.IpKeep)) && e.find((e) => e.name === s.UI.IpKeep) ) return !0; } function _(e, t) { if (g(t, e) || !(null == e ? void 0 : e.feats)) return []; var i = []; for (var n of t) { var r = (0, h.O)(n), a = (0, p.CD)(r); (!a || !e.feats.includes(a)) && i.push(r); } return i; } function y(e, t) { var i = _(e, t), n = {}, a = i.length; if (!a) return ""; for (var o = 0; o < a; o++) n["string".concat(o)] = d.ZP.t(r.rj[i[o]]); var s = [ "", "Can\u2019t reference {string0} with this model", "Can\u2019t reference {string0} and {string1} with this model", "Can\u2019t reference {string0}, {string1}, and {string2} with this model", ]; return d.ZP.t("controlnet_model_".concat(a), n, s[a]); } function b(e, t) { var i; return ( !t.length || ((null === (i = e.feats) || void 0 === i ? !!void 0 : !!i.length) && (0, p.ox)(e, t)) ); } function I(e) { return new RegExp("(".concat(u.e1, ")")).test(null != e ? e : ""); } function w(e) { var t, { text2ImageParams: i, mode: n } = e; return ( n !== l.JU.Workbench && I(null !== (t = i.prompt) && void 0 !== t ? t : "") ); } }, 891602: function (e, t, i) { "use strict"; i.d(t, { CD: function () { return s; }, bN: function () { return c; }, ox: function () { return f; }, }); var n = i(338023), r = i(108982), a = i(111709), o = i(644866); function s(e) { return { [r.s.ControlNetCanny]: a.oo.Canny, [r.s.ControlNetDepth]: a.oo.Depth, [r.s.ControlNetPose]: a.oo.Pose, [r.s.FaceGan]: a.oo.FaceWrap, [r.s.BgPaint]: a.oo.BgPaint, [r.s.IpKeep]: a.oo.IpKeep, [r.s.StyleReference]: a.oo.StyleReference, [r.s.ByteEdit]: a.oo.ByteEdit, [r.s.BasicBlend]: void 0, [r.s.ControlNet]: void 0, [r.s.Image2image]: void 0, [r.s.Text2image]: void 0, [r.s.Unknown]: void 0, [r.s.StyleCode]: a.oo.StyleCode, }[e]; } function l(e) { var t = new Map(); for (var i of e) { var n = t.get(i) || 0; t.set(i, n + 1); } var r = [], a = []; for (var [o, s] of t) s > 1 && r.push(Array(s).fill(o)), a.push(o); return { duplicateFeatures: r, standaloneFeatures: a }; } function c(e) { return 1 === new Set(e).size; } function d(e, t) { var i = function (t) { var i; if ( null === (i = e.featsCantCombine) || void 0 === i ? void 0 : i.some((e) => c(e) && e.length <= t.length) ) return { v: !1 }; }; for (var r of t) { var a = i(r); if ("object" === (0, n._)(a)) return a.v; } return !0; } function u(e, t) { var i; return !(null === (i = e.featsCantCombine) || void 0 === i ? void 0 : i.some((e) => !c(e) && e.every((e) => t.includes(e)))); } function f(e, t) { var i = t.map((e) => s((0, o.O)(e))).filter((e) => !!e); if (!i.every((t) => e.feats.includes(t))) return !1; if (i.length <= 1) return !0; var { duplicateFeatures: n, standaloneFeatures: r } = l(i); return !!d(e, n) && u(e, r); } }, 880139: function (e, t, i) { "use strict"; i.d(t, { _: function () { return o; }, }); var n = i(660178), r = i(139646), a = i(2910); n.w.setConfig({ projectId: 532, subProjectName: "cc_dreamina", customRoute: "", reportOnly: !1, storageKey: "ARGUS_STORAGE_OPEN_REDIRECT", frontWhiteUrl: '["._______________",".vlabstatic.com"]', frontBlackUrl: "[]", bid: "cc_dreamina", region: "cn", cacheTimeFront: 12, checkTimeLimit: 1.5, limitLevel: 5, }); var o = (function () { var e = (0, r._)(function* (e, t) { var i = e, r = null, o = setTimeout(() => { r = window.open( n.w.protectUrl({ targetUrl: (0, a.C)(i, null, { logType: "js.window.location", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), filename: "$ERJNWQy%kRP$EJo$jJSc1kyaz$hb%l5T$hkaF-zaHNXRE5D-%dSSFozWmpNMHBx$ERKT2RscEhWWFZa-m13d1dsZFJk$0l6%201T%1teHNZM2s1-zJSd$pHeFph$*w2WTIxTmRtTklTblph%0Zac$pFTT$kR1F5$m1sT%0wNT$XW*s1-W1Je%1-%mlNalIyWkZo%2NHSkl%WFpa-mtwMlpETk9iR05wT1haalIxWjF%Rz$TZW1WSFJub*FNM$o2", isBlank: !0, }), "_blank" ); }, 200); try { (i = yield t()), r && !r.closed ? (r.location.href = (0, a.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })) : (r = window.open( n.w.protectUrl({ targetUrl: (0, a.C)(i, null, { logType: "js.window.location", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), filename: "$ERJNWQy%kRP$EJo$jJSc1kyaz$hb%l5T$hkaF-zaHNXRE5D-%dSSFozWmpNMHBx$ERKT2RscEhWWFZa-m13d1dsZFJk$0l6%201T%1teHNZM2s1-zJSd$pHeFph$*w2WTIxTmRtTklTblph%0Zac$pFTT$kR1F5$m1sT%0wNT$XW*s1-W1Je%1-%mlNalIyWkZo%2NHSkl%WFpa-mtwMlpETk9iR05wT1haalIxWjF%Rz$TZW1WSFJub*FNM$o2", isBlank: !0, }), "_blank" )); } catch (e) { o && clearTimeout(o), null == r || r.close(); } }); return function (t, i) { return e.apply(this, arguments); }; })(); }, 6080: function (e, t, i) { "use strict"; function n(e) { var t = { ratioWidth: 1, ratioHeight: 0.66 }, i = { ratioWidth: 1, ratioHeight: 1.33 }, n = { ratioWidth: 1, ratioHeight: 1.16 }, r = { ratioWidth: 1, ratioHeight: 1 }; switch (e) { case 2: return t; case 3: return n; case 4: default: return r; case 5: case 6: case 7: case 8: case 9: return i; } } function r(e, t, i) { var r = { ratioWidth: 1, ratioHeight: 1 }; return t && i ? 1 === e ? { ratioWidth: 1, ratioHeight: i / t } : n(e) : r; } i.d(t, { q: function () { return r; }, y: function () { return n; }, }); }, 899229: function (e, t, i) { "use strict"; i.d(t, { S9: function () { return w; }, cq: function () { return M; }, dt: function () { return f; }, xc: function () { return C; }, }); var n = i(799108), r = i(869919), a = i(388977), o = i(19658), s = i(561658), l = i(949274), c = i(540457), d = i(418188), u = i(760021), f = (function (e) { return ( (e.V1 = "v1"), (e.V2CharVideo = "v2_char_video"), (e.V2 = "v2"), (e.V2Audio = "v2_audio"), (e.V2ThirdParty = "v2_third_party"), (e.V2ImageResolutionType = "v2_image_resolution_type"), (e.V2ImagePostEdit = "v2_image_post_edit"), e ); })({}), h = { normal: n.vJ.LipSync1, fluency: n.vJ.LipSync2, cinematic: n.vJ.LipSync2, }, p = { [n.hO.GenerateButton]: { normal: n.vJ.BasicVideoOperation1, fluency: n.vJ.BasicVideoOperation2, cinematic: n.vJ.BasicVideoOperation2, }, [n.hO.RetryButton]: { normal: n.vJ.RetryVideoOperation1, fluency: n.vJ.RetryVideoOperation2, cinematic: n.vJ.RetryVideoOperation2, }, [n.hO.ExtendSeconds]: { normal: n.vJ.ExtendVideo1, fluency: n.vJ.ExtendVideo2, cinematic: n.vJ.ExtendVideo2, }, [n.hO.ContinueLabUpscaleVideo]: { normal: n.vJ.VideoContinueGenerate1, fluency: n.vJ.VideoContinueGenerate2, cinematic: n.vJ.VideoContinueGenerate2, }, [n.hO.LipSync]: h, [n.hO.LipSyncButton]: h, [n.hO.ReDub]: h, [n.hO.ReDubButton]: h, [n.hO.GenerateVideoBGM]: { normal: n.vJ.VideoBgmGeneration, fluency: n.vJ.VideoBgmGeneration, cinematic: n.vJ.VideoBgmGeneration, }, }, v = "model_generate_flux", m = { [n.hO.ImageBasicGenerate]: { image_model_mode: { [v]: n.vJ.ImageFluxModelGenerate }, }, [n.hO.ImageRetryButton]: { image_model_mode: { [v]: n.vJ.ImageFluxModelGenerate }, }, }, g = (e) => [n.hO.ImageBasicGenerate, n.hO.ImageRetryButton].includes(e), _ = { [n.hO.AudioBasicGenerate]: { audioSong: n.vJ.AudioSongGenerate, audioInstrumental: n.vJ.AudioSongGenerate, }, [n.hO.AudioBasicReGenerate]: { audioSong: n.vJ.AudioSongGenerate, audioInstrumental: n.vJ.AudioSongGenerate, }, }, y = (e) => [n.hO.AudioBasicGenerate, n.hO.AudioBasicReGenerate].includes(e), b = { [r.tB.LipSyncDefault]: n.vJ.lipSyncAvatarStd, [r.tB.Default]: n.vJ.lipSyncAvatarStd, [r.tB.Livephoto]: n.vJ.lipSyncAvatarStd, [r.tB.Preview]: n.vJ.lipSyncAvatarStd, [r.tB.LipSyncLively]: n.vJ.lipSyncAvatarLively, [r.tB.LipSyncMaster]: n.vJ.lipSyncAvatarMaster, [r.tB.LipSyncMasterFast]: n.vJ.lipSyncAvatarMasterFast, }, I = (e, t) => { if (e === r.tB.LipSyncMaster) { var i; return (0, a.ko)(t, o.S).serverAbTestManager.getBooleanAbTestValue( u.G.dreaminaOmniVip ) ? n.vJ.lipSyncAvatarMasterVip : n.vJ.lipSyncAvatarMaster; } return null !== (i = b[e]) && void 0 !== i ? i : b[r.tB.LipSyncDefault]; }, w = (e) => !!e && [ n.hO.Character2Video, n.hO.Character2VideoSwitch, n.hO.RetryCharacter2Video, ].includes(e), x = (e) => [ n.hO.GenerateButton, n.hO.RetryButton, n.hO.ExtendSeconds, n.hO.LipSync, n.hO.LipSyncButton, n.hO.ReDub, n.hO.ReDubButton, n.hO.ContinueLabUpscaleVideo, n.hO.GenerateVideoBGM, ].includes(e), S = { normal: r.WP.Normal, fluency: r.WP.Fluency, cinematic: r.WP.Cinematic, }, M = (e) => { var { scene: t, sceneOptions: i } = e; try { switch (null == i ? void 0 : i.version) { case "v1": default: return n.sV[t]; case "v2": var { mode: r, modelReqKey: o, containerService: u } = i; if ( o && [ n.hO.GenerateButton, n.hO.RetryButton, n.hO.VideoModelSwitch, ].includes(t) ) { var f, h, v, b, M, C = (0, a.ko)(u, s.N).videoModelManager, T = null === (f = C.getModelByReqKey(o)) || void 0 === f ? void 0 : f.commercialConfig, A = null == T ? void 0 : null === (h = T.default) || void 0 === h ? void 0 : h.benefitType, k = l.ZP.t( null !== (M = null == T ? void 0 : T.format) && void 0 !== M ? M : "", { fps: S[r] }, null == T ? void 0 : T.format ), P = null == T ? void 0 : null === (b = T.formatConf) || void 0 === b ? void 0 : null === (v = b[k]) || void 0 === v ? void 0 : v.benefitType; if ((P && (A = P), A)) return (0, c.Z)(A); } if (x(t)) return p[t][r]; return n.sV[t]; case "v2_audio": var { mode: E } = i; if (y(t)) return _[t][E]; return n.sV[t]; case "v2_char_video": if (w(t)) { var { characterMode: D } = i; return I(D, i.containerService); } return n.sV[t]; case "v2_third_party": if (g(t)) { var R, { modelReqKey: N, mode: L } = i; if ( N && (null === (R = m[t][L]) || void 0 === R ? void 0 : R[N]) ) return m[t][L][N]; } return n.sV[t]; case "v2_image_resolution_type": return n.sV[n.hO.ImageUhd]; case "v2_image_post_edit": var j, { generateType: O } = i; return n.sV[ null !== (j = d.Od[O]) && void 0 !== j ? j : n.hO.ImageBasicGenerate ]; } } catch (e) {} return n.sV[t]; }, C = (e) => { switch (e) { case r.WP.Normal: return "normal"; case r.WP.Fluency: return "fluency"; case r.WP.Cinematic: return "cinematic"; default: return "normal"; } }; }, 664306: function (e, t, i) { "use strict"; i.d(t, { K6: function () { return o; }, MJ: function () { return r; }, XA: function () { return a; }, }); var n = i(799108), r = (e) => { var { scene: t } = e; return n.wZ[n.sV[t]] === n.lK.Video; }, a = (e) => { var { scene: t } = e; return n.wZ[n.sV[t]] === n.lK.Image; }, o = (e) => { var { scene: t } = e; return n.wZ[n.sV[t]] === n.lK.Audio; }; }, 27433: function (e, t, i) { "use strict"; i.d(t, { A6: function () { return M; }, HU: function () { return D; }, J3: function () { return k; }, KC: function () { return w; }, Mz: function () { return g; }, Qp: function () { return b; }, Rg: function () { return L; }, Rn: function () { return T; }, Rp: function () { return S; }, Tz: function () { return N; }, VM: function () { return A; }, X4: function () { return P; }, be: function () { return _; }, c3: function () { return E; }, e6: function () { return m; }, fS: function () { return C; }, ru: function () { return I; }, uL: function () { return x; }, zh: function () { return R; }, }); var n = i(799108), r = i(870730), a = i(839141), o = i(417281), s = i(111709), l = i(804362), c = i(194488), d = i(664306), u = i(899229), f = i(727280), h = i(949274); a.d.None, a.d.Standard, a.d.Artisan, a.d.Maestro; var p = { [a.d.None]: "free", [a.d.Standard]: "standard", [a.d.Artisan]: "artisan", [a.d.Maestro]: "maestro", }, v = (e) => { var { scene: t } = e; switch (!0) { case (0, d.MJ)({ scene: t }): return n.Zw; case (0, d.XA)({ scene: t }): return n.jk; case (0, d.K6)({ scene: t }): return n.O6; default: return ""; } }, m = (e) => { var { scene: t, extraBenefits: i = [], sceneOptions: n, commercialStrategyService: r, } = e; if (!(null == r ? void 0 : r.isReady)) return !1; var a = v({ scene: t }); return (0, c.Z)([ (0, u.cq)({ scene: t, sceneOptions: n }), ...i, ]).some((e) => { var t, i = r.getBenefitPaidStrategyFromResource(a, e); return ( i.length > 0 && ("vip" === i[0].userLimit || !!(null == i ? void 0 : null === (t = i[0].vipLevelLimit) || void 0 === t ? void 0 : t.length)) ); }); }, g = (e) => { var t, { scene: i, sceneOptions: r, extraBenefits: o = [], commercialStrategyService: s, } = e; if (!(null == s ? void 0 : s.isReady)) return a.d.None; var l = v({ scene: i }), d = (0, c.Z)([(0, u.cq)({ scene: i, sceneOptions: r }), ...o]), f = []; for (var h of d) { var p, m, g, _, y = s.getBenefitPaidStrategyFromResource(l, h); y.length > 0 && ("vip" === y[0].userLimit || (null == y ? void 0 : null === (g = y[0]) || void 0 === g ? void 0 : null === (m = g.vipLevelLimit) || void 0 === m ? void 0 : m.length)) && f.push( ...(null !== (_ = null == y ? void 0 : y[0].vipLevelLimit) && void 0 !== _ ? _ : [a.d.Standard]) ); } return null !== (t = null === (p = (0, c.Z)(f).sort((e, t) => n.KV[e] - n.KV[t])) || void 0 === p ? void 0 : p[0]) && void 0 !== t ? t : a.d.None; }, _ = (e) => { var { scene: t, sceneOptions: i, extraBenefits: n = [], commercialStrategyService: a, } = e; if ( !(null == a ? void 0 : a.isReady) || (null == a ? void 0 : a.isInFreemiumStage) ) return { isStrategyFreeTrial: !1, strategyFreeTrialTimes: 0, trialType: r.a.nonTrial, }; var o = v({ scene: t }), s = (0, c.Z)([(0, u.cq)({ scene: t, sceneOptions: i }), ...n]), l = 0, d = r.a.nonTrial; return ( s.forEach((e) => { for (var t of a.getBenefitPaidStrategyFromResource(o, e)) { var i, n = null === (i = t.promotion) || void 0 === i ? void 0 : i.remainTrialInfo, s = (null == n ? void 0 : n.trialType) === "times", c = s && n.remainValue > 0; if ((s && (d = r.a.limitTimes), n && c)) { l = n.remainValue; continue; } } }), { isStrategyFreeTrial: !!l, strategyFreeTrialTimes: l, trialType: d, } ); }, y = (e) => { var { scene: t, videoDuration: i = 0 } = e; return Number.isFinite(i) ? t === n.hO.ActionCopy || t === n.hO.RegenerateActionCopy ? Math.min(i, 30) : i : 3; }, b = (e) => { var { scene: t, extraBenefits: i = [], sceneOptions: r, commercialStrategyService: a, batchNumber: o = 1, discount: s = 0, } = e; if ( !(null == a ? void 0 : a.isReady) || (null == a ? void 0 : a.isInFreemiumStage) ) return { credits: 0, originalCredits: 0, details: [], strategyFreeTrialTimes: 0, }; var l = y(e), f = v({ scene: t }), h = (0, c.Z)([(0, u.cq)({ scene: t, sceneOptions: r }), ...i]), p = [], m = [], g = 0; h.forEach((e) => { for (var i of a.getBenefitPaidStrategyFromResource(f, e)) { if ( "user_credit" === i.paidMode && !!(null === (r = i.consumeInfo) || void 0 === r ? void 0 : r.length) ) { var r, c, u = null === (c = i.promotion) || void 0 === c ? void 0 : c.remainTrialInfo, h = (null == u ? void 0 : u.trialType) === "times" && u.remainValue > 0; if (u && h) { g = u.remainValue; continue; } for (var v of i.consumeInfo) { if ( "user_credit" === v.consumeBenefitType && !!v.creditExchange ) { var { creditAmount: _, curBenefitAmount: y } = v.creditExchange, b = _ / y, I = (0, d.MJ)({ scene: t }) ? l : 1, w = s ? b * Math.round(I) * o : Math.floor(b * Math.round(I)) * o; n.SN.has(e) ? m.push({ benefit: e, amount: I, creditsPerUnit: b, credits: w, }) : p.push({ benefit: e, amount: I, creditsPerUnit: b, credits: w, }); } } } } }); var _ = m.sort((e, t) => t.credits - e.credits).at(0); _ && p.push(_); var b = p.reduce((e, t) => e + t.credits, 0); return { credits: s ? Math.round((s * b) / o / 100) * o : Math.floor(b), originalCredits: b, details: p, strategyFreeTrialTimes: g, }; }, I = (e) => { var t = []; return ( e.forEach((e) => { switch (e.name) { case o.UI.ControlNet: (e.controlNetList || []).forEach((e) => { var i = { [o.kR.ControlNetCanny]: n.vJ.ImageControlNetCanny, [o.kR.ControlNetDepth]: n.vJ.ImageControlNetDepth, [o.kR.ControlNetPose]: n.vJ.ImageControlNetPose, [o.kR.ControlNetBgPaint]: n.vJ.ImageControlNetObject, }[e.name]; i && t.push(i); }); break; case o.UI.FaceGan: t.push(n.vJ.ImageControlNetHumanFace); break; case o.UI.BgPaint: t.push(n.vJ.ImageControlNetObject); break; case o.UI.IpKeep: t.push(n.vJ.ImageIpKeep); break; case o.UI.StyleReference: t.push(n.vJ.ImageStyleReference); break; case o.UI.ByteEdit: t.push(n.vJ.ImageByteEdit); break; case o.UI.StyleCode: var i = (0, f.DX)(e) ? n.vJ.ImageStyleReference : n.vJ.ImageStyleCode; t.push(i); } }), t ); }, w = (e) => e.feats.includes(s.Wn.ThirdParty), x = (e) => w(e) ? { version: u.dt.V2ThirdParty, modelReqKey: e.modelReqKey, mode: "image_model_mode", } : void 0, S = () => ({ version: u.dt.V2ImageResolutionType }), M = (e) => ({ version: u.dt.V2ImagePostEdit, generateType: e }), C = (e) => { var t, i, r, a, o, s, l, c, d, f, h, v, m, { scene: g, sceneOptions: _, commercialStrategyService: y, vipService: b, discountType: I, } = e; if ( !(null == y ? void 0 : y.isReady) || !(null == b ? void 0 : b.isVipReady) || (null == y ? void 0 : y.isInFreemiumStage) ) return { discount: void 0, disabled: !0 }; var w = y.getBenefitPaidStrategyFromResource( n.Zw, (0, u.cq)({ scene: g, sceneOptions: _ }) ); if (w.length <= 0) return { discount: void 0, disabled: !0 }; var { relaxModeInfo: x, discount: S } = w[0], M = b.currentVipLevel, C = I ? (null == S ? void 0 : S[I]) : void 0, T = !0; switch (I) { case "previewMode": (t = { free: null !== (i = null == C ? void 0 : C.free) && void 0 !== i ? i : 0, standard: null !== (r = null == C ? void 0 : C.standard) && void 0 !== r ? r : 0, artisan: null !== (a = null == C ? void 0 : C.artisan) && void 0 !== a ? a : 0, maestro: null !== (o = null == C ? void 0 : C.maestro) && void 0 !== o ? o : 0, }), (T = void 0 === C); break; case "relaxMode": (t = { free: null !== (l = null !== (s = null == C ? void 0 : C.free) && void 0 !== s ? s : null == x ? void 0 : x.freeUserRelaxDiscount) && void 0 !== l ? l : 0, standard: null !== (d = null !== (c = null == C ? void 0 : C.standard) && void 0 !== c ? c : null == x ? void 0 : x.standardVipRelaxDiscount) && void 0 !== d ? d : 0, artisan: null !== (h = null !== (f = null == C ? void 0 : C.artisan) && void 0 !== f ? f : null == x ? void 0 : x.artisanVipRelaxDiscount) && void 0 !== h ? h : 0, maestro: null !== (m = null !== (v = null == C ? void 0 : C.maestro) && void 0 !== v ? v : null == x ? void 0 : x.maestroVipRelaxDiscount) && void 0 !== m ? m : 0, }), (T = x ? 0 === Object.keys(x).length : void 0 === C); } return { discount: null == t ? void 0 : t[p[M]], disabled: T, discountMap: t, }; }, T = (e) => { var { isRelaxMode: t, isPreviewMode: i } = e; switch (!0) { case t: return "relaxMode"; case i: return "previewMode"; default: return null; } }, A = (e) => { if (!!e) return (100 - e).toFixed(0); }, k = (e) => { var { canLowPriceTrial: t, lowPriceTrialInfo: i } = e || {}, { trialCycle: n, trialCycleUnit: r } = i || {}; return !!(t && Number(n) > 0 && r); }, P = (e) => { if ((null == e ? void 0 : e.priceType) === "un-auto") return !1; var { secondPromoteInfo: t, promoteType: i } = e || {}, { introPeriod: n, introCycleUnit: r } = t || {}; return i === l.I.INTRO || !!("number" == typeof n && r); }, E = (e) => e.find( (e) => e.level === a.d.Standard && "auto" === e.priceType && 1 === e.subscribeCycle && k(e) ), D = (e) => { var t = 10 * e; return Number.isInteger(t) ? "".concat(t.toFixed(0)) : "".concat(Math.ceil(t)); }, R = (e, t) => { var i = e / 100, n = 2; return (t >= 0 && t <= 20 && (n = t), Number.isInteger(i)) ? "".concat(i) : "".concat(i.toFixed(n)); }, N = (e) => { if (!e) return h.ZP.t("dre_m10n_sub_btn_upgrade", {}, "Upgrade"); var { lowPriceTrialInfo: t } = e, { trialPrice: i } = t, n = R(i, 2); return h.ZP.t("free_trial_normal_des", { price: n }); }, L = (e) => { var t, i, n, a, o = { user_trial_type: r.Z.none, user_trial_days: 0, user_trial_price: -1, }; return e ? k(e) && P(e) ? { user_trial_type: r.Z.multiDiscount, user_trial_days: (null == e ? void 0 : null === (t = e.lowPriceTrialInfo) || void 0 === t ? void 0 : t.trialCycle) || 0, user_trial_price: (null == e ? void 0 : null === (i = e.lowPriceTrialInfo) || void 0 === i ? void 0 : i.trialPrice) || -1, } : k(e) ? { user_trial_type: r.Z.freeTrial, user_trial_days: (null == e ? void 0 : null === (n = e.lowPriceTrialInfo) || void 0 === n ? void 0 : n.trialCycle) || 0, user_trial_price: (null == e ? void 0 : null === (a = e.lowPriceTrialInfo) || void 0 === a ? void 0 : a.trialPrice) || -1, } : o : o; }; }, 755769: function (e, t, i) { "use strict"; i.d(t, { M: function () { return o; }, t: function () { return s; }, }); var n = i(799108), r = i(899229), a = i(27433), o = (e) => { if (!(null == e ? void 0 : e.taskDetail)) return 1 / 0; var t, i, n, r, a, o, s, l, c, d, u, f, h = null == e ? void 0 : null === (i = e.inputParams) || void 0 === i ? void 0 : null === (t = i.v2vOpt) || void 0 === t ? void 0 : t.videoTemplate, p = null === (n = e.taskDetail.lipSyncInfo) || void 0 === n ? void 0 : n.lipSyncExtra; return ( (null == p ? void 0 : null === (r = p.video) || void 0 === r ? void 0 : r.duration) || (null == p ? void 0 : null === (a = p.audio) || void 0 === a ? void 0 : a.duration) || ((null == h ? void 0 : null === (o = h.videoInfo) || void 0 === o ? void 0 : o.durationMs) || (null == h ? void 0 : null === (l = h.videoTemplateItem) || void 0 === l ? void 0 : null === (s = l.video) || void 0 === s ? void 0 : s.durationMs) || 0) / 1e3 || (null == h ? void 0 : null === (c = h.videoInfo) || void 0 === c ? void 0 : c.duration) || (null === (d = e.videoDetail) || void 0 === d ? void 0 : d.duration) || (( null == e ? void 0 : null === (u = e.inputParams) || void 0 === u ? void 0 : u.originDurationMs ) ? (null == e ? void 0 : null === (f = e.inputParams) || void 0 === f ? void 0 : f.originDurationMs) / 1e3 : void 0) || 1 / 0 ); }, s = (e, t, i) => { var { disabled: o } = (0, a.fS)({ scene: n.hO.GenerateButton, sceneOptions: { version: r.dt.V2, mode: (0, r.xc)(i), modelReqKey: t, containerService: e, }, discountType: (0, a.Rn)({ isPreviewMode: !0 }), }); return !o; }; }, 259435: function (e, t, i) { "use strict"; i.d(t, { C: function () { return o; }, X: function () { return a; }, }); var n = i(388977), r = i(555192), a = (e, t) => (0, n.ko)(e, r.u).getContextViewById(t), o = (e, t) => { var i = (0, n.ko)(e, r.u), a = document.createElement("div"); return ( (a.id = "#modal_context_".concat(t)), i.createContextView({ id: t, component: null }, a) ); }; }, 228342: function (e, t, i) { "use strict"; i.d(t, { O: function () { return r; }, U: function () { return o; }, }); var n = i(331359); function r(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = parseInt(e.substring(1, 3), 16), n = parseInt(e.substring(3, 5), 16), r = parseInt(e.substring(5, 7), 16); return "rgba(" .concat(i, ",") .concat(n, ",") .concat(r, ",") .concat(t, ")"); } var a = /^\#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$/i; function o(e, t) { a.test(e) && (e = r(e)); var i, o = ( null !== (i = e.match(/\d+(\.?\d+)?/g)) && void 0 !== i ? i : [] ).map(Number); return t && o[3] <= 1 && (o[3] *= n.fL), o; } }, 863209: function (e, t, i) { "use strict"; i.d(t, { FT: function () { return b; }, X: function () { return w; }, Zw: function () { return m; }, eB: function () { return g; }, gp: function () { return C; }, pT: function () { return y; }, ue: function () { return _; }, zb: function () { return S; }, }); var n = i(139646), r = i(2910), a = i(68809), o = i(591586), s = i(229025), l = i(997166), c = i(405013), d = i(334766), u = i(719494), f = 100, h = /\([\d+]+\)$/g, p = Math.floor(1e3 * Math.random()); function v() { return ++p; } function m(e) { var t = /[<>:"\/\\|?*\x00-\x1F]/g; return e.replace(t, "_"); } function g(e) { var t, i, n = e.split("."), r = n.length > 1 ? n[n.length - 1] : "", a = e.slice(0, e.length - (r ? ".".concat(r).length : 0)), o = null !== (i = null === (t = a.match(h)) || void 0 === t ? void 0 : t[0]) && void 0 !== i ? i : "", s = a .slice(0, a.length - o.length) .replace(/\n/g, " ") .trim(); return "" .concat(s.slice(0, f)) .concat(s.length > f ? "..." : "") .concat(o, ".") .concat(r); } var _ = (function () { var e = (0, n._)(function* (e, t, i, n) { if (!e) return !1; try { var a = yield fetch(e); if (null == n ? void 0 : n()) return Promise.reject(Error("cancel")); var o = yield a.blob(); if (null == n ? void 0 : n()) return Promise.reject(Error("cancel")); var s = URL.createObjectURL(o), l = document.createElement("a"); return ( (l.href = (0, r.C)(s, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })), (l.download = g(t)), document.body.appendChild(l), l.click(), document.body.removeChild(l), window.URL.revokeObjectURL(s), !0 ); } catch (n) { return ( null == i || i.reportDevError("handleDownloadImage", n, { url: e, fileName: t, }), !1 ); } }); return function (t, i, n, r) { return e.apply(this, arguments); }; })(); function y(e, t) { return fetch(e) .then((e) => { if (!e.ok) throw Error("HTTP error! Status: ".concat(e.status)); return e.blob(); }) .then((e) => { if (0 === e.size) throw Error("Downloaded file is empty."); var i = window.URL.createObjectURL(e), n = document.createElement("a"); (n.href = (0, r.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })), (n.download = g(t)), document.body.appendChild(n), n.click(), setTimeout(() => { window.URL.revokeObjectURL(i), n.remove(); }, 100); }) .catch((e) => { throw (o.t.error(e), e); }); } function b(e) { return I.apply(this, arguments); } function I() { return (I = (0, n._)(function* (e) { var t, i, n, r, o, { record: s, contentGenerateService: f, imageIndex: h = 0 } = e, p = yield (0, d.J5)({ itemId: null === (t = s.imageList[h]) || void 0 === t ? void 0 : t.itemId, publishedItemId: null === (i = s.imageList[h]) || void 0 === i ? void 0 : i.publishedItemId, contentGenerateService: f, }), m = "jimeng-" .concat((0, c.vc)("yyyy-MM-dd", s.createdTime), "-") .concat(v(), "-") .concat( (0, u.Lr)( (0, a.h)((0, l.IA)(s.itemList[0].aigcImageParams)), 100 ) ), g = null !== (o = null === (r = s.itemList[h]) || void 0 === r ? void 0 : null === (n = r.image) || void 0 === n ? void 0 : n.format) && void 0 !== o ? o : "png"; return { url: null != p ? p : "", fileName: "".concat(m, ".").concat(g), fileNameWithoutExt: m, format: g, }; })).apply(this, arguments); } function w(e, t, i) { return x.apply(this, arguments); } function x() { return (x = (0, n._)(function* (e, t, i) { if (!(null == e ? void 0 : e.image)) return { url: "", fileName: "" }; var n, r, o, u = null !== (r = yield (0, d.J5)({ contentGenerateService: t, itemId: e.commonAttr.id, publishedItemId: e.commonAttr.publishedItemId, })) && void 0 !== r ? r : "", f = (0, a.h)((0, l.IA)(e.aigcImageParams)), h = null !== (o = null === (n = e.image) || void 0 === n ? void 0 : n.format) && void 0 !== o ? o : "png"; return { url: u, fileName: (f = "" .concat( f || (0, c.vc)( "yyyy-MM-dd hh:mm:ss", (0, s.Qd)(null != i ? i : e.commonAttr.createTime) ), "." ) .concat(h)), }; })).apply(this, arguments); } function S(e, t, i) { return M.apply(this, arguments); } function M() { return (M = (0, n._)(function* (e, t, i) { var r, o, s, l, f = null !== (s = ( (null == i ? void 0 : i.selectedImageList) ? i.selectedImageList : e.imageList ).map( (function () { var e = (0, n._)(function* (e) { var i; return null !== (i = yield (0, d.J5)({ itemId: e.itemId, publishedItemId: e.publishedItemId, contentGenerateService: t, })) && void 0 !== i ? i : ""; }); return function (t) { return e.apply(this, arguments); }; })() )) && void 0 !== s ? s : [], h = yield Promise.all(f), p = (0, a.h)(e.text2ImageParams.prompt), g = "jimeng-" .concat((0, c.vc)("yyyy-MM-dd", e.createdTime), "-") .concat(v(), "-") .concat((0, u.Lr)(m(p) || "", 100)), _ = null !== (l = null === (o = e.itemList[0]) || void 0 === o ? void 0 : null === (r = o.image) || void 0 === r ? void 0 : r.format) && void 0 !== l ? l : "png"; return { urls: h, fileName: "".concat(g, ".").concat(_), fileNameWithoutExt: g, format: _, }; })).apply(this, arguments); } function C(e, t) { var i = document.createElement("a"); i.href = (0, r.C)(e, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }); var n = g("".concat(t, ".zip")); (i.download = n), i.click(), i.remove(); } }, 460537: function (e, t, i) { "use strict"; function n(e) { if (e instanceof Error) return e; try { return Error(JSON.stringify(e)); } catch (t) { return Error(String(e)); } } i.d(t, { b: function () { return n; }, }); }, 741310: function (e, t, i) { "use strict"; i.d(t, { fK: function () { return p; }, oO: function () { return f; }, rA: function () { return d; }, z8: function () { return h; }, }); var n = i(139646), r = i(625572), a = i(700689), o = i(712942), s = i(949274), l = (0, o.nk)(), c = (0, a.e)(); c.interceptors.request.use( (e) => (Object.assign(e.headers, l.header), e) ); var d = (e) => { var { aid: t, app_name: i } = l, n = new FormData(); return ( n.append("aid", t), n.append("watermark", "1"), n.append("app_name", i), n.append("image", e), c({ method: "post", url: l.url, data: n }) ); }, u = (function () { var e = (0, n._)(function* (e) { var { aid: t, appkey: i, app_name: n } = l; return ( e.append("aid", t), e.append("app_name", n), e.append("appkey", i), e.append("multi_image", "1"), (yield c({ method: "post", url: "/feedback/2/post_message/?appkey=" .concat(i, "&app_name=") .concat(n, "&aid=") .concat(t), data: e, headers: { "Content-Type": "multipart/form-data" }, })).data ); }); return function (t) { return e.apply(this, arguments); }; })(), f = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", { contact: i, questionDesc: n, uploadedMap: a, selectedQuestionList: o, } = e, l = Object.values(a).map((e) => ({ image_width: e.ImageWidth, image_height: e.ImageHeight, image_uri: e.ImageUri, })), c = { is_private_image: 1, web_id: t }, d = new FormData(); return ( d.append("contact", i), d.append("content", n), d.append("image_list", JSON.stringify(l)), d.append("extra_params", JSON.stringify((0, r._)({}, c))), d.append("selected_question_list", JSON.stringify(o)), d.append( "extra_persistent_params", JSON.stringify({ custom_field_info: { selected_question_list: JSON.stringify( o.map((e) => s.oc.t(e, {}, e)).join(";") ), }, }) ), u(d) ); }, h = (e) => { var { suggestion: t } = e, i = new FormData(); return i.append("content", t), u(i); }, p = (e) => { var { reasonDescList: t, reasonKeyList: i, localItemId: n } = e, r = new FormData(); return ( r.append("content", t.join(";")), r.append("reason_key_list", i.join(";")), r.append("local_item_id", n), r.append( "extra_persistent_params", JSON.stringify({ custom_field_info: { reason_key_list: i.map((e) => s.oc.t(e, {}, e)).join(";"), }, }) ), u(r) ); }; }, 645078: function (e, t, i) { "use strict"; i.d(t, { V: function () { return o; }, r: function () { return s; }, }); var n = i(139646), r = i(226737), a = i(966465).Buffer, o = (e) => { var t = r.createHash("md5"); return t.update(e), t.digest("hex"); }, s = (function () { var e = (0, n._)(function* (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; try { var i = yield e.arrayBuffer(), n = r.createHash("md5").update(a.from(i)).digest("hex"); if (t) { var s = o(e.name); return "".concat(n, "-").concat(s); } return n; } catch (t) { return "".concat(e.name, "-").concat(e.size, "-").concat(e.type); } }); return function (t) { return e.apply(this, arguments); }; })(); }, 187796: function (e, t, i) { "use strict"; i.d(t, { $N: function () { return r; }, MK: function () { return s; }, iI: function () { return a; }, }); var n = i(248928), r = (e) => (0, n.$N)(e), a = (e) => { if (!!e) { var t = Object.keys(e) .filter((e) => isFinite(Number(e))) .sort((e, t) => Number(e) - Number(t)); return e[t[0]]; } }, o = (e) => { var t = Object.keys(e) .filter((e) => isFinite(Number(e))) .sort((e, t) => Number(e) - Number(t)); return e[t[t.length - 1]]; }, s = (e, t) => { if (!e) return t; var i = o(e); return i || t; }; }, 200953: function (e, t, i) { "use strict"; function n(e, t) { var { x: i, y: n } = e, { x: r, y: a } = t, o = (a - n) / (r - i), s = n - o * i; return { k: o, b: s }; } i.d(t, { j: function () { return n; }, }); }, 717742: function (e, t, i) { "use strict"; i.d(t, { c: function () { return n; }, }); var n = (e, t) => parseFloat(e.toFixed(t)); }, 217940: function (e, t, i) { "use strict"; i.d(t, { Y: function () { return r; }, }); var n = i(460029); function r(e) { (0, n.oe)(e); var t, { duration: i } = null !== (t = (0, n.XH)(e)) && void 0 !== t ? t : {}; return (0, n.wc)(e), i; } }, 464974: function (e, t, i) { "use strict"; i.d(t, { I: function () { return r; }, }); var n = i(243302); function r(e) { var t, i, r, { inPaintingParams: a, outPaintingParams: o, text2imageParams: s, generateType: l, } = e; return l === n.pi.InPaint ? null !== (t = null == a ? void 0 : a.originPrompt) && void 0 !== t ? t : "" : l === n.pi.OutPaint ? null !== (i = null == o ? void 0 : o.originPrompt) && void 0 !== i ? i : "" : null !== (r = null == s ? void 0 : s.prompt) && void 0 !== r ? r : ""; } }, 997166: function (e, t, i) { "use strict"; i.d(t, { IA: function () { return c; }, Sz: function () { return d; }, ti: function () { return l; }, wc: function () { return u; }, }); var n = i(369617), r = i(766663), a = i(243302), o = i(949274), s = i(441361); function l(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (!t && /^\s*$/.test(e)) return n.s.warningByThrottle(o.ZP.t("tool_text_input_bottom")), !1; var i = RegExp( "[^\\u0370-\\u03FF\\u1F00-\\u1FFF\\u4e00-\\u9fa5\\u3002\\uff1f\\uff01\\uff0c\\u3001\\uff1b\\uff1a\\u201c\\u201d\\u2018\\u2019\\uff08\\uff09\\u300a\\u300b\\u3008\\u3009\\u3010\\u3011\\u300e\\u300f\\u300c\\u300d\\ufe43\\ufe44\\u3014\\u3015\\u2026\\u2014\\uff5e\\ufe4f\\uffe5\\u200b\\w_!@#$%^&*\xd7\u2103\xb0\xb2\xb3\xf7\xb1\u2260\u2248\u221A\u221E\u2220\u03C0\u2211\u20AC\xa3\xa5\u20B9\u20BD\u20A9\u20BF\u0E3F\xa2\u20A6\u20BA\u2191\u2193\u2190\u2192()\\[\\]{}\\-+=|\\\\:;\"',.\u30FB\xb7<>/?`~\\s\\u200D\\u{1F300}-\\u{1F9FF}\\u{1F000}-\\u{1FAFF}\\u{2600}-\\u{26FF}\\u{2700}-\\u{27BF}\\u{FE00}-\\u{FE0F}\\u{1F900}-\\u{1F9FF}\\u{1FA70}-\\u{1FAFF}\\u{1F3FB}-\\u{1F3FF}]", "gu" ), r = /(ftp|http|https):\/\/[^ "]+/; return i.test(e) ? (n.s.warningByThrottle(o.ZP.t("input_language_support")), !1) : !r.test(e) || (n.s.warningByThrottle(o.ZP.t("input_content_try")), !1); } function c(e) { var t, i, n, { inPaintingParams: r, outPaintingParams: o, text2imageParams: s, generateType: l, } = e; return l === a.pi.InPaint ? null !== (t = null == r ? void 0 : r.originPrompt) && void 0 !== t ? t : "" : l === a.pi.OutPaint ? null !== (i = null == o ? void 0 : o.originPrompt) && void 0 !== i ? i : "" : null !== (n = null == s ? void 0 : s.prompt) && void 0 !== n ? n : ""; } var d = (e) => { var { lyrics: t, separator: i = " " } = e, n = []; for (var a of t) switch (a.type) { case r.j6.Text: n.push(a.content); break; case r.j6.Paragraph: n.push(d({ lyrics: a.children })); } return n.filter((e) => !!e).join(i); }; function u() { return { leftQuote: o.ZP.t(s._u, {}, '"'), rightQuote: o.ZP.t(s.Y9, {}, '"'), }; } }, 798181: function (e, t, i) { "use strict"; i.d(t, { Wf: function () { return c; }, Xj: function () { return l; }, cW: function () { return u; }, vu: function () { return d; }, }); var n = i(727279), r = i(76252), a = i(433965), o = i(128468), s = i(949274); function l() { if ((0, r.H)()) return { isFromActivity: !1, weeklyActivityKey: null }; var e = new URLSearchParams(location.search).get(n.m.weeklyActivityKey); return { isFromActivity: !!e, weeklyActivityKey: e }; } function c(e) { var { searchParamsStr: t, keepSearchList: i } = e, n = new URLSearchParams(location.search), r = new URLSearchParams(t); i.forEach((e) => { var t = n.get(e); t && r.set(e, t); }); var a = r.toString(); return a ? "?".concat(a) : a; } function d(e) { if (!!e) { if ((0, a.Rb)(e)) return e.collection.itemList.reduce((e, t) => { var i = d(t); return (null == i ? void 0 : i.length) && e.push(...i), e; }, []); if ((0, a.DF)(e)) { var t, { publishAssetList: i = [] } = null !== (t = e.aigcImageParams) && void 0 !== t ? t : {}; return i.reduce((e, t) => { var { assetType: i, assetCode: n } = t; return i === o.d_.Style && n && e.push(n), e; }, []); } } } function u(e) { var t = d(e); return (null == t ? void 0 : t.length) === 1 ? s.ZP.t( "dre_t2i_style_code_success_toast", { style_code: null == t ? void 0 : t[0] }, "Posted. Here is your style code: #style{style_code}." ) : t && t.length > 1 ? s.ZP.t( "dre_t2i_style_code_success_toast_multiple", { style_code: null == t ? void 0 : t[0] }, "Posted. Here are your style codes: #style{style_code} and more." ) : void 0; } }, 752134: function (e, t, i) { "use strict"; i.d(t, { d$: function () { return o; }, rO: function () { return s; }, }); var n = i(224671), r = i(639985), a = { [n.jP.OneOne]: { widthRatio: 1, heightRatio: 1, errorDiff: 1 }, [n.jP.ThreeTwo]: { widthRatio: 3, heightRatio: 2, errorDiff: 6 }, [n.jP.TwoThree]: { widthRatio: 2, heightRatio: 3, errorDiff: 6 }, [n.jP.ThreeFour]: { widthRatio: 3, heightRatio: 4, errorDiff: 8 }, [n.jP.FourThree]: { widthRatio: 4, heightRatio: 3, errorDiff: 8 }, [n.jP.SixteenNine]: { widthRatio: 16, heightRatio: 9, errorDiff: 32 }, [n.jP.TwentyOneNine]: { widthRatio: 21, heightRatio: 9, errorDiff: 21, }, [n.jP.NineSixteen]: { widthRatio: 9, heightRatio: 16, errorDiff: 32 }, }; function o(e, t) { if (!t) return !1; var { widthRatio: i, heightRatio: n, errorDiff: r } = a[e], { width: o, height: s } = t; return Math.abs(o * n - s * i) < r; } function s(e) { if (!!e) for (var t of r.L2) { var { type: i } = t; if (o(i, e)) return i; } } }, 418188: function (e, t, i) { "use strict"; i.d(t, { uV: () => eZ, r_: () => tt, tS: () => e5, $y: () => eT, pV: () => e3, X: () => te, RO: () => eC, ND: () => eV, Ay: () => eP, OR: () => eA, pk: () => eQ, xb: () => eJ, xR: () => tn, dJ: () => e7, Jc: () => ep, $h: () => em, I6: () => ev, oL: () => eM, eb: () => e2, BN: () => ex, wA: () => eg, ee: () => ti, ei: () => e6, Od: () => eh, lT: () => e_, bG: () => eI, qE: () => e8, LZ: () => tr, }); var n = i("660178"), r = i("139646"), a = i("625572"), o = i("639880"), s = i("2910"), l = i("526967"), c = i("243302"), d = i("224671"), u = i("100470"), f = i("936690"), h = i("128468"), p = i("417281"), v = i("104170"), m = i("229025"), g = i("257843"), _ = i("712942"), y = i("863209"), b = i("799108"), I = i("441361"), w = i("331359"), x = i("314068"), S = i("27433"), M = i("880821"), C = i("798181"), T = i("474297"), A = i("965245"), k = i("924086"), P = i("987689"), E = i("882598"), D = i("976112"), R = i("284858"), N = i("40853"), L = i("480963"), j = i("369617"), O = i("898678"), B = i("897905"), F = i("140772"), U = i("708274"), G = i("69529"); class z { static addEventListener(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; !this._eventMap[e] && (this._eventMap[e] = []), this._eventMap[e].push({ name: e, callback: t, isListenOnce: i }); } static removeEventListener(e, t) { var i = this._eventMap[e]; if (!!(null == i ? void 0 : i.length)) this._eventMap[e] = i.filter((e) => e.callback !== t); } static triggerEvent(e, t) { var i = this._eventMap[e]; if (!!(null == i ? void 0 : i.length)) { var n = []; i.forEach((e) => { var { callback: i, isListenOnce: r } = e; null == i || i(t), r && n.push(e); }), (this._eventMap[e] = i.filter((e) => !n.includes(e))); } } } z._eventMap = {}; var V = i("761615"), W = i("168511"), Z = i("475578"), K = i("102678"), H = i("474182"), q = i("932683"), J = i("561658"), Y = i("735138"), Q = i("604488"), X = i("950835"), $ = i("938678"), ee = i("586315"), et = i("949274"), ei = i("540611"), en = i("683973"), er = i("379311"); class ea { getEventParams() { return this._params; } constructor(e) { (this._params = e), (this.eventName = "inpaint_mask_size_error"); } } function eo(e, t) { (0, er.S$)(e, ea, [t]); } var es = i("182688"), el = i("187796"), ec = i("934669"), ed = i("288632"); n.w.setConfig({ projectId: 532, subProjectName: "cc_dreamina", customRoute: "", reportOnly: !1, storageKey: "ARGUS_STORAGE_OPEN_REDIRECT", frontWhiteUrl: '["._______________",".vlabstatic.com"]', frontBlackUrl: "[]", bid: "cc_dreamina", region: "cn", cacheTimeFront: 12, checkTimeLimit: 1.5, limitLevel: 5, }); var eu = 100, ef = 100, eh = { [c.pi.InPaint]: b.hO.ImageInPaintRepaintButton, [c.pi.InPaintRemove]: b.hO.ImageInPaintEraserButton, [c.pi.OutPaint]: b.hO.ImageOutPaintButton, [c.pi.Text2Image]: b.hO.ImageBasicGenerate, [c.pi.Blend]: b.hO.ImageBasicGenerate, [c.pi.SuperDefinition]: b.hO.GenerateFreeMock, [c.pi.SuperResolution]: b.hO.GenerateFreeMock, }; function ep(e) { return ( !!e && [ c.pi.InPaint, c.pi.OutPaint, c.pi.InPaintRemove, c.pi.InPaintAndOutPaint, c.pi.ByteEditPainting, ].includes(e) ); } function ev(e) { return ( !!e && [ c.pi.InPaint, c.pi.OutPaint, c.pi.InPaintAndOutPaint, c.pi.ByteEditPainting, ].includes(e) ); } function em(e) { var t, i = e.itemList[0]; if ( !i || ![c.pi.Blend, c.pi.Text2Image].includes( i.aigcImageParams.generateType ) ) return !1; var n = null === (t = i.aigcImageParams.text2imageParams) || void 0 === t ? void 0 : t.modelConfig; return !!n && (0, S.KC)(n); } function eg(e) { if (!em(e)) return; var t, i = e.itemList[0]; if (!i) return; var n = null === (t = i.aigcImageParams.text2imageParams) || void 0 === t ? void 0 : t.modelConfig; if (!!n) return (0, S.uL)(n); } function e_(e) { var t, i = e.itemList[0]; if (!!i) { var { text2imageParams: n, generateType: r } = i.aigcImageParams; switch (r) { case c.pi.Text2Image: case c.pi.Blend: if ( (null == n ? void 0 : null === (t = n.largeImageInfo) || void 0 === t ? void 0 : t.resolutionType) === d.YD.ImageResolutionType_2k ) return (0, S.Rp)(); break; default: if (eh[r]) return (0, S.A6)(r); } } } function ey(e, t, i, n) { return eb.apply(this, arguments); } function eb() { return (eb = (0, r._)(function* (e, t, i, n) { var r, a, { width: o = ef, height: s = eu } = null !== (a = null === (r = i.image) || void 0 === r ? void 0 : r.largeImages[0]) && void 0 !== a ? a : {}, { width: l, height: c } = yield (0, M.po)(t), d = t; return ( (o !== l || s !== c) && (eo(e, { tool: n, item: JSON.stringify(i), mask: JSON.stringify({ width: l, height: c }), }), (d = yield (0, M.tg)(t, o, s))), yield (0, M.Ax)(null != d ? d : "", e) ); })).apply(this, arguments); } function eI(e, t, i) { return ew.apply(this, arguments); } function ew() { return (ew = (0, r._)(function* (e, t, i) { var n = i.generateContentList.find((e) => e.historyRecordId === t); if (n) return n; var r = yield i.getHistoryById(e, t); if (!r) { var a = "result_toast_abnormal_retry", o = "Something went wrong. Try again later."; throw ( (j.s.warning(et.oc.t(a, {}, o)), Error("not found target historyId")) ); } return r; })).apply(this, arguments); } function ex(e) { var t; return null !== (t = { [u.b.ErrPreImgRiskNotPass]: { color: "var(--text-placeholder)" }, [u.b.ErrPreTextRiskNotPass]: { color: "var(--text-placeholder)" }, [u.b.ErrPreTextIPBlockList]: { color: "var(--text-placeholder)" }, }[e]) && void 0 !== t ? t : {}; } function eS(e, t, i) { var { historyRecordId: n, text2ImageParams: r, isSuperResolution: a, firstGenerateType: o, } = e; return { page: Z.WZ.AigcImage, recordId: n, itemId: t, generateParam: r, isSuperResolution: a, reportService: i, templateSource: d.Q8.AigcImage, isReference: o === c.pi.Blend, }; } function eM(e, t, i) { var { operationAuthorityList: n, reportParam: r } = e, { itemId: s, requestId: l } = t; if (((0, en.PJ)(e, t, i), n.includes(d.Zz.Publish))) { var c = eS(e, s, i); (0, T.NS)( (0, o._)((0, a._)({}, c), { requestId: l, action: Z.tz.ShowButton, reportParam: r, }) ); } } function eC(e, t, i, n) { var { reportParam: r, text2ImageParams: s, blendImageParams: l, paintingParam: c, } = e, u = (0, o._)((0, a._)({}, r), { promptSource: d.U_.Reedit }); (0, A.s)( { generateParams: s, blendImageParams: l, reportParams: u, paintingParam: c, needUpdateSeed: !0, }, t ), (0, es.RW)(t), n.switchPromptTab(U.vK.Image), (0, en.xi)(e, Z.tz.Reedit, i); } function eT(e, t, i) { if (!!i) { var { text2ImageParams: n, reportParam: r, isSuperResolution: a, historyRecordId: o, blendImageParams: s, } = e, { coverUrl: l, itemId: c } = t; (0, A.s)( { generateParams: n, blendImageParams: s, reportParams: r, needUpdateSeed: !0, }, i ), i.updateMicroAdjustParam({ itemId: c, reportParam: r, historyRecordId: o, imageUrl: l, isSuperResolution: a, }); } } function eA(e, t) { return ek.apply(this, arguments); } function ek() { return (ek = (0, r._)(function* (e, t) { var i, n, r, o, { record: s, image: l, isRetry: d, instance: u, reportService: f, containerService: h, onGenerateContentUpdate: p, reportParams: v, } = t, m = Date.now(), { itemId: g } = l; d && (null == f || f.reportBusinessEvent("super_resolution_retry_action", { action: Z.tz.ClickButton, page: Z.WZ.AigcImage, })); var { text2ImageParams: _, reportParam: y, historyRecordId: b, blendImageParams: I, generateType: w, draftContent: x, } = s; (0, en.YA)(s, l, Z.tz.SuperResolution, f, { showType: null == v ? void 0 : v.showType, secondPage: null == v ? void 0 : v.secondPage }, h); var S = (0, a._)({}, _); s.paintingParam && (S.prompt = null !== (i = s.paintingParam.originPrompt) && void 0 !== i ? i : ""), (0, W.N)(h, { generateType: c.pi.SuperResolution, generateParam: S, reportParam: y, isRetry: d, lastRecord: s, scene: void 0, benefits: void 0, }); var M = null !== (r = yield null == u ? void 0 : u.generateSuperResolutionContent(e, { generateParam: S, reportParam: y, itemId: g, historyRecordId: b, blendParams: I, historyGroupKeyMd5: null !== (n = s.historyGroupKeyMd5) && void 0 !== n ? n : "", onGenerateContentUpdate: p, generateType: w, isQueue: !0, draftContent: x, })) && void 0 !== r ? r : null, { code: C, record: T, errMsg: A } = null != M ? M : {}; return ( null == f || f.reportDevEvent("superResoluteContent", { cost_time: Date.now() - m, item_Id: g, record_Id: null !== (o = null == T ? void 0 : T.historyRecordId) && void 0 !== o ? o : 0, code: C, prompt: null == _ ? void 0 : _.prompt, errMsg: A, }), (0, en.l)(d, M, g, f, h), M ); })).apply(this, arguments); } function eP(e, t) { return eE.apply(this, arguments); } function eE() { return (eE = (0, r._)(function* (e, t) { var i, n, r, o, { record: s, image: l, instance: d, reportService: u, containerService: f, onGenerateContentUpdate: h, generateImageParamsManager: p, reportParams: v, } = t, m = Date.now(), { itemId: g } = l, { text2ImageParams: _, reportParam: y, historyRecordId: b, blendImageParams: I, generateType: w, draftContent: x, } = s; (0, en.YA)(s, l, Z.tz.SuperDefinition, u, { showType: null == v ? void 0 : v.showType, secondPage: null == v ? void 0 : v.secondPage }, f); var S = (0, a._)({}, _); s.paintingParam && (S.prompt = null !== (i = s.paintingParam.originPrompt) && void 0 !== i ? i : ""), (0, W.N)(f, { generateType: c.pi.SuperDefinition, generateParam: _, reportParam: y, lastRecord: s, scene: void 0, benefits: void 0, }); var M = null !== (r = yield null == d ? void 0 : d.generateSuperDefinitionContent(e, { generateParam: S, historyGroupKeyMd5: null !== (n = s.historyGroupKeyMd5) && void 0 !== n ? n : "", reportParam: y, itemId: g, historyRecordId: b, blendParams: I, onGenerateContentUpdate: h, generateType: w, isQueue: !0, draftContent: x, })) && void 0 !== r ? r : null, { code: C, record: T, errMsg: A } = null != M ? M : {}; return ( null == u || u.reportDevEvent("superDefinition", { cost_time: Date.now() - m, item_Id: g, record_Id: null !== (o = null == T ? void 0 : T.historyRecordId) && void 0 !== o ? o : 0, code: C, prompt: null == _ ? void 0 : _.prompt, errMsg: A, }), (0, en.TQ)({ result: M, lastPictureId: g, customSizeReportParams: (0, k.bz)(p), reportService: u, containerService: f, }), M ); })).apply(this, arguments); } function eD(e, t) { return eR.apply(this, arguments); } function eR() { return (eR = (0, r._)(function* (e, t) { var i, { record: n, instance: r, onGenerateContentUpdate: s } = t, { text2ImageParams: l, reportParam: c, paintingParam: d, generateType: u, originRecord: p, blendImageParams: v, draftContent: m, } = n, g = (0, f.Hp)(n) ? { mode: h.JU.PostEditor } : void 0, { historyRecordId: _ = "" } = null != p ? p : {}; if (!d) return null; var y = (0, o._)((0, a._)({}, d), { canvasData: n.canvasData, isRegenerate: !0, }); return yield null == r ? void 0 : r.generatePaintingContent( e, { blendImageParams: v, generateType: u, reportParam: c, historyGroupKeyMd5: null !== (i = n.historyGroupKeyMd5) && void 0 !== i ? i : "", generateParam: l, paintingParam: y, historyRecordId: _, onGenerateContentUpdate: s, originPrompt: d.originPrompt, isQueue: !0, draftContent: m, }, void 0, g ); })).apply(this, arguments); } function eN(e, t, i) { return eL.apply(this, arguments); } function eL() { return (eL = (0, r._)(function* (e, t, i) { var { record: n, instance: r, onGenerateContentUpdate: o } = t; if (null == r ? void 0 : r.isPendingGenerate) { j.s.warning( et.oc.t("attempt_max", {}, "Too many attempts. Try again later.") ); return; } null == r || r.increasePendingGenerateCount(); var { text2ImageParams: s, reportParam: l, historyGroupKeyMd5: c, } = n, d = yield null == r ? void 0 : r.generateContent(e, { reportParam: l, param: i ? (0, a._)({}, s, i) : (0, a._)({}, s), onGenerateContentUpdate: o, historyGroupKeyMd5: c, isQueue: !0, }); return null == r || r.decreasePendingGenerateCount(), d; })).apply(this, arguments); } function ej(e) { var t, i, n, { record: r, generateImageParamsManager: a } = e, { text2ImageParams: o, blendImageParams: s } = r, l = null == s ? void 0 : null === (t = s.imagePromptList) || void 0 === t ? void 0 : t.find((e) => e.name === p.UI.IpKeep), c = { needDegrade: !1, resetPrompt: o.prompt }; return l ? !( !(null == a ? void 0 : null === (n = a.characterListManager) || void 0 === n ? void 0 : null === (i = n.listData) || void 0 === i ? void 0 : i.find((e) => { var t, i; return ( e.characterId === (null === (i = l.ipKeepList) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.characterId) ); })) && (0, ei.NN)(r) ) ? c : { resetPrompt: o.prompt.replace(I.e1, ""), needDegrade: !0 } : c; } function eO(e, t) { return eB.apply(this, arguments); } function eB() { return (eB = (0, r._)(function* (e, t) { var i, n, r, { record: a, instance: o, onGenerateContentUpdate: s, generateImageParamsManager: l, } = t; if (null == o ? void 0 : o.isPendingGenerate) { j.s.warning( et.oc.t("attempt_max", {}, "Too many attempts. Try again later.") ); return; } var { needDegrade: c, resetPrompt: d } = ej(t); if (c) return eN(e, t, { prompt: d, model: null == l ? void 0 : null === (n = l.modelList) || void 0 === n ? void 0 : null === (i = n[0]) || void 0 === i ? void 0 : i.modelReqKey, }); null == o || o.increasePendingGenerateCount(); var { text2ImageParams: u, blendImageParams: f, reportParam: h } = a, p = yield null == o ? void 0 : o.generateBlendContent(e, { reportParam: h, params: u, historyGroupKeyMd5: null !== (r = a.historyGroupKeyMd5) && void 0 !== r ? r : "", blendParams: f, onGenerateContentUpdate: s, isQueue: !0, }); return null == o || o.decreasePendingGenerateCount(), p; })).apply(this, arguments); } function eF(e, t) { return eU.apply(this, arguments); } function eU() { return (eU = (0, r._)(function* (e, t) { var i, n, r, { record: a, imageIndex: o, generateImageParamsManager: s, instance: l, onGenerateContentUpdate: c, } = t, { text2ImageParams: d, blendImageParams: u, reportParam: f, originRecord: h, generateType: p, paintingParam: v, itemList: m, draftContent: g, } = a, { historyRecordId: _ = "" } = null != h ? h : {}, y = null === (n = m[0]) || void 0 === n ? void 0 : null === (i = n.aigcImageParams.superResolutionParams) || void 0 === i ? void 0 : i.originItemId; return yield null == l ? void 0 : l.generateSuperResolutionContent(e, { generateParam: d, reportParam: f, itemId: y, historyRecordId: _, blendParams: u, historyGroupKeyMd5: null !== (r = a.historyGroupKeyMd5) && void 0 !== r ? r : "", onGenerateContentUpdate: c, generateType: p, isQueue: !0, draftContent: g, isRegenerate: !0, }); })).apply(this, arguments); } function eG(e, t) { return ez.apply(this, arguments); } function ez() { return (ez = (0, r._)(function* (e, t) { var i, n, r, { record: a, imageIndex: o, instance: s, onGenerateContentUpdate: l, } = t, { text2ImageParams: c, blendImageParams: d, reportParam: u, originRecord: f, imageList: h, generateType: p, itemList: v, draftContent: m, } = a, { historyRecordId: g = "" } = null != f ? f : {}, _ = null === (n = v[0]) || void 0 === n ? void 0 : null === (i = n.aigcImageParams.normalHdParams) || void 0 === i ? void 0 : i.originItemId; return yield null == s ? void 0 : s.generateSuperDefinitionContent(e, { generateParam: c, reportParam: u, itemId: _, historyRecordId: g, blendParams: d, onGenerateContentUpdate: l, historyGroupKeyMd5: null !== (r = a.historyGroupKeyMd5) && void 0 !== r ? r : "", generateType: p, draftContent: m, isQueue: !0, isRegenerate: !0, }); })).apply(this, arguments); } function eV(e, t) { return eW.apply(this, arguments); } function eW() { return (eW = (0, r._)(function* (e, t) { var i, n, r, s, l, u, { record: h, containerService: p, reportService: v, generateImageParamsManager: m, } = t, g = Date.now(), { text2ImageParams: _, reportParam: y, generateType: I, blendImageParams: w, } = h, { imageRatio: M, largeImageInfo: C } = _, T = (0, o._)((0, a._)({}, y), { promptSource: d.U_.Regenerate }), A = (0, f.Hp)(h) ? b.hO.ImagePostEditor : eh[I], { canCustomSize: P, commercialSceneOptions: E } = null != m ? m : {}, D = P ? { customSizeReportParam: (0, k.GV)(M, null != C ? C : x.jg) } : {}, R = I === c.pi.Blend && (null == w ? void 0 : w.imagePromptList) ? (0, S.ru)(null == w ? void 0 : w.imagePromptList) : []; (0, W.N)( p, (0, a._)( { generateType: I, generateParam: _, reportParam: T, isRetry: !0, lastRecord: h, scene: A, benefits: R, commercialSceneOptions: I === c.pi.Text2Image || I === c.pi.Blend ? E : void 0, }, D ) ), (0, en.xi)(h, Z.tz.Regenerate, p); var N = null !== (r = { [c.pi.SuperResolution]: eF, [c.pi.SuperDefinition]: eG, [c.pi.InPaint]: eD, [c.pi.InPaintRemove]: eD, [c.pi.OutPaint]: eD, [c.pi.Blend]: eO, [c.pi.InPaintAndOutPaint]: eD, [c.pi.ByteEditPainting]: eD, }[I]) && void 0 !== r ? r : eN, L = null !== (s = yield N(e, t)) && void 0 !== s ? s : null; null == v || v.reportDevEvent("regenerateContent", { cost_time: Date.now() - g, record_Id: null !== (l = null == L ? void 0 : null === (i = L.record) || void 0 === i ? void 0 : i.historyRecordId) && void 0 !== l ? l : 0, }), (0, en.TQ)({ result: L, isRetry: !0, reportService: v, clickGenerateReportParam: (0, o._)( (0, a._)( {}, null !== (u = null == L ? void 0 : null === (n = L.record) || void 0 === n ? void 0 : n.reportParam) && void 0 !== u ? u : T ), { promptSource: d.U_.Regenerate } ), customSizeReportParams: (0, k.bz)(m), containerService: p, }); })).apply(this, arguments); } function eZ(e) { var { record: t, image: i, costTime: n, isSuccessful: r, reportService: a, reportParams: o, containerService: s, } = e; r ? j.s.success( et.oc.t("result_toast_saved_success", {}, "Image downloaded") ) : j.s.warning( et.oc.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ), (0, en.YA)( t, i, Z.tz.Download, a, { download_source: "download_button", showType: null == o ? void 0 : o.showType, secondPage: null == o ? void 0 : o.secondPage, }, s ); var { downloadUrl: l, itemId: c, requestId: u } = i, { promptSource: f, generateId: h } = t.reportParam; null == a || a.reportDevEvent("downloadWork", { cost_time: n, source: d.Q8.AigcImage, isSuccessful: r ? "success" : "fail", downloadUrl: l, itemId: c, requestId: u, promptSource: f, generateId: h, }); } function eK(e, t) { if (!!e.itemList[0]) null == t || t.reportBusinessEvent("check_publish_button_show", { page: Z.WZ.AigcImage, }); } function eH(e) { return eq.apply(this, arguments); } function eq() { return (eq = (0, r._)(function* (e) { var t, { containerService: i, record: n, image: r, instance: s, reportService: l, title: c, description: f, weeklyActivityKey: h, reportParams: p, } = e; if (!s) return (0, ee.wf)(u.b.ErrPublish, "Publish no instance"); var { itemId: m, requestId: g } = r, _ = Date.now(), y = eS(n, m, l), { reportParam: b } = n; (0, T.NS)((0, o._)((0, a._)({}, y), { requestId: g, action: Z.tz.ClickButton, reportParam: b })); var I = yield s.publish( (0, a._)( { itemType: v.$.Image, itemIdList: [m], title: c, description: f, }, h ? { actKeyList: [h] } : {} ) ), { code: w = u.b.ErrCommon } = I; return ( w === u.b.ErrSuccess && I.ok && (Y.e.publishProduction(m, I.value.itemId, s), z.triggerEvent("publish_product"), (t = (0, ed.y)(I.value))), null == l || l.reportDevEvent("publishWork", { cost_time: Date.now() - _, record_Id: n.historyRecordId, source: d.Q8.AigcImage, }), eK(n, l), (0, H.dx)( i, (0, H.D8)( (0, a._)( { itemId: m, record: n, resultCode: w, title: c, description: f, publishStyleCode: t, }, p ) ) ), I ); })).apply(this, arguments); } function eJ(e) { return eY.apply(this, arguments); } function eY() { return (eY = (0, r._)(function* (e) { var { containerService: t, mwebActivityService: i, navigate: n, record: r, image: s, instance: l, reportService: c, hasPublishAuthority: d, defaultSelectedIndex: u, multiple: f, reportParams: h, beforeRouteLeave: p, } = e; (0, en.YA)(r, s, Z.tz.Publish, c, { showType: null == h ? void 0 : h.showType, secondPage: null == h ? void 0 : h.secondPage }, t); var { isFromActivity: v } = (0, C.Xj)(), g = d ? Z.nQ.Creator : Z.nQ.GeneralUser, _ = v ? "activity" : "generation"; if ("denied" !== (yield (0, F.D)())) { var y = (e) => { var i, { singleItem: n, weeklyActivityKey: d, weeklyActivityName: u, } = e; return ( n && ([i] = (0, m.KG)([n], !1)), eH( (0, o._)((0, a._)({ containerService: t, record: r }, e), { image: null != i ? i : s, instance: l, reportService: c, reportParams: { authorType: g, activity: u, activityId: d, channel: _, }, }) ) ); }; (0, B.e)({ containerService: t, mwebActivityService: i, navigate: n, record: r, showGotoCollection: !0, defaultSelectedIndex: u, multiple: f, beforeRouteLeave: p, onClickPublish: y, onPublishSuccess: (e) => { var { weeklyActivityKey: i, resultItem: n } = e; (0, ec.T)({ containerService: t, weeklyActivityKey: i, customToastText: (0, C.cW)(n), beforeRouteLeave: p, }); }, reportParams: { author_type: g, page: Z.WZ.AigcImage, channel: _, }, }); } })).apply(this, arguments); } function eQ(e, t, i, n) { (0, en.X2)(e, t, i, n); } function eX(e, t) { return e$.apply(this, arguments); } function e$() { return (e$ = (0, r._)(function* (e, t) { var i, n, r, { url: a, record: o, imageIndex: s, generateImageParamsManager: l, instance: d, generateReportParams: u, reportService: f, onGenerateContentUpdate: h, originPrompt: p, containerService: v, } = t, { reportParam: m, text2ImageParams: g, itemList: _, historyRecordId: y, blendImageParams: b, draftContent: I, } = o, { id: w } = null !== (n = null === (i = _[s]) || void 0 === i ? void 0 : i.commonAttr) && void 0 !== n ? n : {}; if (!w || !a) { j.s.error( et.oc.t("fail2generate_sorry_retry", {}, "Couldn\u2019t generate") ); return; } var { prompt: x } = g, S = c.pi.InPaint, M = yield null == d ? void 0 : d.generatePaintingContent(e, { generateType: S, reportParam: m, generateParam: g, paintingParam: { generateType: S, prompt: x, maskUri: a, itemId: w, submitId: (0, X.Rl)(), }, historyGroupKeyMd5: null !== (r = o.historyGroupKeyMd5) && void 0 !== r ? r : "", historyRecordId: y, blendImageParams: b, onGenerateContentUpdate: h, originPrompt: p, isQueue: !0, draftContent: I, }); (0, en.TQ)({ result: M, lastPictureId: w, customSizeReportParams: (0, k.bz)(l), reportService: f, generateReportParams: u, containerService: v }); })).apply(this, arguments); } function e0(e, t) { return e1.apply(this, arguments); } function e1() { return (e1 = (0, r._)(function* (e, t) { var i, n, r, { url: a, record: o, imageIndex: s, instance: l, generateReportParams: d, reportService: u, onGenerateContentUpdate: f, generateImageParamsManager: h, containerService: p, } = t, { reportParam: v, text2ImageParams: m, itemList: g, historyRecordId: _, blendImageParams: y, draftContent: b, } = o, { id: I } = null !== (n = null === (i = g[s]) || void 0 === i ? void 0 : i.commonAttr) && void 0 !== n ? n : {}; if (!!I) { var { prompt: w } = m, x = c.pi.InPaintRemove, S = yield null == l ? void 0 : l.generatePaintingContent(e, { generateType: x, reportParam: v, generateParam: m, paintingParam: { generateType: x, prompt: w, maskUri: a, itemId: I, submitId: (0, X.Rl)(), }, historyGroupKeyMd5: null !== (r = o.historyGroupKeyMd5) && void 0 !== r ? r : "", historyRecordId: _, blendImageParams: y, onGenerateContentUpdate: f, isQueue: !0, draftContent: b, }); (0, en.TQ)({ result: S, lastPictureId: I, reportService: u, customSizeReportParams: (0, k.bz)(h), generateReportParams: d, containerService: p, }); } })).apply(this, arguments); } function e2(e, t) { var { record: i, image: n, imageIndex: s, instance: l, containerService: d, reportService: u, onGenerateInpaint: f, onGenerateContentUpdate: h, generateImageParamsManager: p, reportParams: v, } = t, m = (0, $.I)(i), g = m.itemList[s]; if (!!g && !!l) { var _ = (0, N.Z)({ tool: Z.vh.Inpaint, item: g, generateType: c.pi.InPaint, extraParams: { brushContainerOverrideConfig: { brushConfig: { defaultOpen: !0 }, }, customMaskUpload: (e) => Promise.resolve(), }, closeModalHandler: () => { _.close(); }, handleGenerate: (function () { var t = (0, r._)(function* (t, i, n, r) { if (!!d) { var c, v = Date.now(), { dataURL: y } = r, [b] = yield (0, M.CG)(y, w.cI, w.Tm); if (!b) throw Error("inpaint url is empty"); var I = yield ey(d, b, g, Z.vh.Inpaint), x = (0, o._)((0, a._)({}, n), { imageUploadCostTime: Date.now() - v, }); _.close(), null == f || f(); var { text2ImageParams: S, paintingParam: C, lastGenerate: T, } = m, A = ep(T) ? null == C ? void 0 : C.originPrompt : S.prompt; (S.prompt = i), eX(e, { url: I, record: (0, o._)((0, a._)({}, m), { text2ImageParams: S, }), historyGroupKeyMd5: null !== (c = m.historyGroupKeyMd5) && void 0 !== c ? c : "", imageIndex: s, instance: l, generateImageParamsManager: p, generateReportParams: x, reportService: u, onGenerateContentUpdate: h, originPrompt: A, containerService: d, }); } }); return function (e, i, n, r) { return t.apply(this, arguments); }; })(), containerService: d, reportService: u, record: m, }); (0, en.YA)( m, n, Z.tz.Inpaint, u, { showType: null == v ? void 0 : v.showType, secondPage: null == v ? void 0 : v.secondPage, }, d ); } } function e6(e, t) { return e4.apply(this, arguments); } function e4() { return (e4 = (0, r._)(function* (e, t) { var i, n, { record: s, instance: l, containerService: d, reportService: u, onGenerateInpaint: f, onGenerateContentUpdate: h, generateImageParamsManager: p, } = t, v = (0, $.I)(s), m = yield eI(e, v.originRecord.historyRecordId, l), g = m.itemList.findIndex( (e) => e.commonAttr.id === v.paintingParam.itemId ), _ = (0, N.Z)({ tool: Z.vh.Inpaint, item: m.itemList[g], generateType: c.pi.InPaint, extraParams: { brushContainerOverrideConfig: { brushConfig: { defaultOpen: !0 }, }, customMaskUpload: (e) => Promise.resolve(), }, overrideInitParams: { maskUrl: null === (i = v.paintingParam) || void 0 === i ? void 0 : i.maskUrl, prompt: null === (n = v.paintingParam) || void 0 === n ? void 0 : n.prompt, }, closeModalHandler: () => { _.close(); }, handleGenerate: (function () { var t = (0, r._)(function* (t, i, n, r) { if (!!d) { var s, c = Date.now(), { dataURL: y } = r, [b] = yield (0, M.CG)(y, w.cI, w.Tm); if (!b) throw Error("inpaint url is empty"); var I = m.itemList[g], x = yield ey(d, b, I, Z.vh.Inpaint), S = (0, o._)((0, a._)({}, n), { imageUploadCostTime: Date.now() - c, }); _.close(), null == f || f(); var { text2ImageParams: C, paintingParam: T, lastGenerate: A, } = v, k = ep(A) ? null == T ? void 0 : T.originPrompt : C.prompt; (C.prompt = i), eX(e, { url: x, record: (0, o._)((0, a._)({}, m), { text2ImageParams: C, }), imageIndex: g, historyGroupKeyMd5: null !== (s = v.historyGroupKeyMd5) && void 0 !== s ? s : "", instance: l, generateImageParamsManager: p, generateReportParams: S, reportService: u, onGenerateContentUpdate: h, originPrompt: k, containerService: d, }); } }); return function (e, i, n, r) { return t.apply(this, arguments); }; })(), containerService: d, reportService: u, record: v, }); (0, en.xi)(v, Z.tz.Reedit, d); })).apply(this, arguments); } function e3(e, t, i) { var { record: n, image: r, reportParams: a } = e; (0, en.YA)( n, r, Z.tz.More, t, { showType: null == a ? void 0 : a.showType, secondPage: null == a ? void 0 : a.secondPage, }, i ); } function e8(e, t) { return e9.apply(this, arguments); } function e9() { return (e9 = (0, r._)(function* (e, t) { var i, { record: n, instance: s, reportService: l, containerService: d, onGenerateInpaint: u, onGenerateContentUpdate: f, generateImageParamsManager: h, } = t, p = yield eI(e, n.originRecord.historyRecordId, s), v = p.itemList.findIndex( (e) => e.commonAttr.id === n.paintingParam.itemId ), m = (0, L.B)({ tool: Z.vh.Eliminate, item: p.itemList[v], generateType: c.pi.InPaintRemove, overrideInitParams: { maskUrl: null === (i = n.paintingParam) || void 0 === i ? void 0 : i.maskUrl, }, handleGenerate: (function () { var t = (0, r._)(function* (t, i, r, c) { if (!!d) { var g, _ = Date.now(), { dataURL: y } = c, [b] = yield (0, M.CG)(y, w.cI, w.Tm); if (!b) throw Error("inpaint remmove url is empty"); var I = p.itemList[v], x = yield ey(d, b, I, Z.vh.Eliminate), { text2ImageParams: S } = n, C = (0, o._)((0, a._)({}, r), { imageUploadCostTime: Date.now() - _, }), T = (0, o._)((0, a._)({}, p), { text2ImageParams: S }); m.close(), null == u || u(), e0(e, { url: x, record: T, imageIndex: v, instance: s, generateImageParamsManager: h, generateReportParams: C, reportService: l, historyGroupKeyMd5: null !== (g = n.historyGroupKeyMd5) && void 0 !== g ? g : "", onGenerateContentUpdate: f, containerService: d, }); } }); return function (e, i, n, r) { return t.apply(this, arguments); }; })(), closeModalHandler: () => { m.close(); }, extraParams: { brushContainerOverrideConfig: { brushConfig: { defaultOpen: !0 }, }, }, reportService: l, containerService: d, record: n, }); (0, en.xi)(n, Z.tz.Reedit, d); })).apply(this, arguments); } function e5(e, t) { var { record: i, image: n, imageIndex: s, instance: l, reportService: d, containerService: u, onGenerateInpaint: f, onGenerateContentUpdate: h, generateImageParamsManager: p, reportParams: v, } = t, m = i.itemList[s]; if (!!m && !!l) { var g = (0, L.B)({ tool: Z.vh.Eliminate, item: m, generateType: c.pi.InPaintRemove, handleGenerate: (function () { var t = (0, r._)(function* (t, n, r, c) { if (!!u) { var v, _ = Date.now(), { dataURL: y } = c, [b] = yield (0, M.CG)(y, w.cI, w.Tm); if (!b) throw Error("inpaint remmove url is empty"); var I = yield ey(u, b, m, Z.vh.Eliminate), x = (0, o._)((0, a._)({}, r), { imageUploadCostTime: Date.now() - _, }); g.close(), null == f || f(), e0(e, { url: I, record: i, imageIndex: s, instance: l, generateImageParamsManager: p, generateReportParams: x, reportService: d, onGenerateContentUpdate: h, historyGroupKeyMd5: null !== (v = i.historyGroupKeyMd5) && void 0 !== v ? v : "", containerService: u, }); } }); return function (e, i, n, r) { return t.apply(this, arguments); }; })(), closeModalHandler: () => { g.close(); }, extraParams: { brushContainerOverrideConfig: { brushConfig: { defaultOpen: !0 }, }, customMaskUpload: (e) => Promise.resolve(), }, reportService: d, containerService: u, record: i, }); (0, en.YA)( i, n, Z.tz.InpaintRemove, d, { showType: null == v ? void 0 : v.showType, secondPage: null == v ? void 0 : v.secondPage, }, u ); } } function e7(e) { var { record: t, image: i, reportService: n, imageIndex: r, switchOptions: s, containerService: l, contentGenerateService: c, reportParams: d, } = e, { isSuperResolution: u } = t; (0, en.YA)( t, i, Z.tz.ZoomIn, n, { showType: null == d ? void 0 : d.showType, secondPage: null == d ? void 0 : d.secondPage, }, l ); var { width: f, height: h, coverUrl: p, coverUrlMap: v } = i, m = (0, el.MK)(v, p), _ = () => (0, y.FT)({ record: t, contentGenerateService: c, imageIndex: r }), b = { width: f, height: h, coverUrl: m, downloadUrl: "", fileName: "", maxInitialScale: u ? void 0 : 1, }, { storeManager: I, dreaminaAssetsDataService: w, contentRecordListManager: x, } = l.invokeFunction((e) => ({ storeManager: e.get(q.N), dreaminaAssetsDataService: e.get(g.K), contentRecordListManager: e.get(J.N).contentRecordListManager, })); (0, R.S)({ imageInfo: b, containerService: l, switchOptions: s, getWatermarkDownloadInfo: _, onDownload: (t, i) => eZ((0, o._)((0, a._)({}, e), { isSuccessful: t, costTime: i })), handleZoomInImageExpose: (e) => (0, en.cV)(t, i, e, n), onZoomOut: () => (0, en.YA)( t, i, Z.tz.ZoomOut, n, { showType: null == d ? void 0 : d.showType, secondPage: null == d ? void 0 : d.secondPage, }, l ), contextMenu: [ (0, E.W)({ getWatermarkDownloadInfo: _, record: t, image: i, reportService: n, containerService: l, }), (0, P.w)({ getWatermarkDownloadInfo: _, page: "detail", containerService: l, }), (0, D.T)({ type: "image", initFavorited: (0, V.Mv)({ record: t, imageItemId: i.itemId }), markFavorite: () => { (0, G.R)({ selectedRecords: [ (0, o._)((0, a._)({}, t), { selectedImageList: [i] }), ], containerService: l, imageAssetsHistoryService: I, dreaminaAssetsDataService: w, contentRecordListManager: x, }); }, }), ], }); } function te(e) { var t, { record: i, imageIndex: r, image: a, reportService: o, reportParams: l, containerService: c, } = e, { coverUrl: d, downloadUrl: u, width: f, height: h, itemId: p, } = i.imageList[r], { format: v } = null !== (t = i.itemList[r].image) && void 0 !== t ? t : {}, m = "first_page", g = "dreamina", y = "dreamina", b = "1", I = "MaterialText", w = (0, _.TR)() === _.wt.Online ? "https://www.capcut.com" : "https://capcut-os.by".concat(Q._8, "edan").concat(Q.tf, "e"), x = "/editor-graphic?phototId=" .concat(p, "&photoType=") .concat(v, "&photoWidth=") .concat(f, "&photoHeight=") .concat(h, "&downloadUrl=") .concat(encodeURIComponent(u), "&coverUrl=") .concat(encodeURIComponent(d), "&enter_from=") .concat(m, "&from_page=") .concat(g, "&uploadCreateScenes=") .concat(y, "&uploadCreate=") .concat(b, "&activeTab=") .concat(I); window.open( n.w.protectUrl({ targetUrl: (0, s.C)(w + x, null, { logType: "js.window.location", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), filename: "$ERJNWQy%kRP$EJo$jJSc1kyaz$hb%l5T$hkaF-zaHNXRE5D-%dSSFozWmpNMHBx$ERKT2RscEhWWFZa-m13d1dsZFJk$0l6%201T%1teHNZM2s1-zJSd$pHeFph$*w2WTIxTmRtTklTblph%0Zac$pFTT$kR1F5$m1sT%0wNT$XW*s1-W1Je%1-%mlNalIyWkZo%2NHSkl%WFpq-lZac$lqTkthMHh-Z%hCak0xRjJZ$mMx-TFwW$oz$mtTRTQw$1ZoS2Jt%ll%$DA9", isBlank: !0, }) ), (0, en.YA)( i, a, Z.tz.CapcutEdit, o, { showType: null == l ? void 0 : l.showType, secondPage: null == l ? void 0 : l.secondPage, }, c ); } function tt(e) { var { record: t, imageIndex: i, containerService: n, navigate: r } = e, { width: a, height: o, itemId: s } = t.imageList[i]; (0, K.A)(n, { action: Z.tz.Click, page: K._.TextToImageEdit, pictureId: s, }), r( "/image-edit?itemId=" .concat(s, "&photoWidth=") .concat(a, "&photoHeight=") .concat(o), { replace: !1, state: { hasBack: !0 } } ); } function ti(e) { var { record: t, image: i, reportService: n, containerService: r, onSubmitFinish: a, reportParams: o, } = e; (0, O.xr)(r, { reportItemList: [e.record.itemList[e.imageIndex]], onSubmitFinish: a, }), (0, en.YA)( t, i, Z.tz.Report, n, { showType: null == o ? void 0 : o.showType, secondPage: null == o ? void 0 : o.secondPage, }, r ); } function tn(e, t) { var i, { record: n, imageIndex: r } = e, a = 0 !== r ? n.itemList[r] : null !== (i = n.itemList.find((e) => e.commonAttr.hasPublished)) && void 0 !== i ? i : n.itemList[0]; if (!!a) { var { publishedItemId: o, effectType: s } = a.commonAttr; null == t || t.imageDetailManager.setImageItems([a], 0, 0, d.Q8.Default), null == t || t.showWorkDetail({ detailId: String(o), detailType: l.ho.Image, modalType: l.w8.generateList, itemType: s, reportContext: { template_source: d.Q8.AigcImage, type: Z.px.Image, }, }); } } function tr(e) { var { reportService: t, record: i, image: n, reportParams: r, containerService: a, } = e; (0, en.YA)( i, n, Z.tz.Copy, t, { secondPage: null == r ? void 0 : r.secondPage, collect_source: null == r ? void 0 : r.collectSource, }, a ); } }, 586961: function (e, t, i) { "use strict"; i.d(t, { wU: () => F, Jg: () => R, yL: () => N, cU: () => U, Kv: () => C, ve: () => D, m4: () => Z, Km: () => O, ZS: () => z, Gs: () => W, sG: () => j, z2: () => G, K$: () => L, sI: () => V, IZ: () => A, i3: () => E, X$: () => k, Ls: () => B, }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("576261"), s = i("317825"), l = i("586315"), c = i("369617"), d = i("949274"), u = i("229025"), f = i("243302"), h = i("283349"), p = i("898387"), v = i("475578"), m = i("379311"); class g { getEventParams() { var { status: e, duration: t, resource_type: i, history_group_key_md5: n, submit_id: r, err_msg: a, } = this._params; return { status: e, duration: t, err_msg: a, history_group_key_md5: n, resource_type: i, submit_id: r, }; } constructor(e) { (this._params = e), (this.eventName = "websocket_md5_received"); } } function _(e, t) { (0, m.S$)(e, g, [t]); } var y = i("388977"), b = i("331480"), I = i("417699"), w = i("898758"); class x { getEventParams() { var { pictureType: e, recordId: t } = this._params; return { picture_type: e, record_id: t }; } constructor(e) { (this._params = e), (this.eventName = "return_icon_click"); } } function S(e, t) { (0, m.Kl)(e, x, [t]); } var M = (e, t) => new Promise((i) => { var n = 1100; t.updateHighlightRecordId(e), setTimeout(() => { t.updateHighlightRecordId(""), i(); }, n); }), C = (0, s.Tx)( "record-list-util", (function () { var e = (0, n._)(function* (e, t) { var { historyRecordId: i, historyGroupKeyMd5: n, instance: r, listContainerRef: a, containerService: o, ignoreWarning: s, } = t, l = !s, u = "result_toast_abnormal_retry", f = "Something went wrong. Try again later.", h = null == a ? void 0 : a.current, v = (e, t, a) => { if (!!o) (0, p.j)(o, { status: e, type: "locate", filter_type: (null == r ? void 0 : r.isGroupView) ? "group" : "timeline", duration: t, err_msg: a, extra: JSON.stringify({ historyRecordId: i, historyGroupKeyMd5: n, }), }); }, m = Date.now(); if (!r || !h || !i) { v("error", Date.now() - m, "locate_params_error"), l && c.s.warning(d.oc.t(u, {}, f)); return; } var g = r.getRecordIndex(i, n); if (-1 !== g) v("success", Date.now() - m, "locate_existed_success"), console.log("[record-list] locates a existing record ", i, g), setTimeout(() => { h.scrollToItemByIndex(g), M(i, r); }, 50); else { console.log( "[record-list] non-local element, locate remote data ", i ); var _ = yield null == r ? void 0 : r.locateContent(e, i, n), y = r.getRecordIndex(i, n); if (!_.ok || -1 === y) { var b = !_.ok; v( "error", Date.now() - m, b ? "locate_remote_fetch_error" : "locate_remote_index_error" ); var I = "errorcode_show", w = "The image has been deleted", x = b ? d.oc.t(u, {}, f) : d.oc.t(I, {}, w); l && c.s.warning(x); } else v("success", Date.now() - m, "locate_remote_success"), h.execInNextRender(() => { setTimeout(() => { h.scrollToItemByIndex(y), M(i, r); }, 50); }, r.displayRangeId); } }); return function (t, i) { return e.apply(this, arguments); }; })(), "locateRecord" ), T = (e) => { if (!e) return ( console.error( "%c[record-list] record should not be nullish value", "color: red;", e ), "" ); var { id: t } = e; return t; }, A = (e) => "record-".concat(T(e)), k = (0, s.Tx)( "record-list-util", (function () { var e = (0, n._)(function* (e, t, i, n, r) { var { record: a } = t, { originRecord: o } = a, { historyRecordId: s = "", itemList: l = [] } = null != o ? o : {}; s && S(i, { pictureType: l.length > 1 ? v.ry.thumbnail : v.ry.upscale, recordId: s, }), yield C(e, { historyRecordId: s, historyGroupKeyMd5: a.historyGroupKeyMd5, instance: n, listContainerRef: r, containerService: i, }); }); return function (t, i, n, r, a) { return e.apply(this, arguments); }; })(), "handleRecordLocateRecord" ); function P(e, t) { var i = e.current; if (!!i) i.scrollToStart(t); } var E = (e, t) => { var { hasSyncLastPageDataToGenerateContentListSucceed: i } = e; P(t, !i); }, D = (e) => (0, a._)((0, r._)({}, e), { createdTime: (0, u.Qd)(e.createdTime), sortCreateTime: (0, u.Qd)(e.sortCreateTime), }), R = (e) => "object" == typeof e && null !== e && "list" in e, N = (e) => Array.isArray(e) && R(null == e ? void 0 : e[0]); function L(e) { var t, i; return !!( (null == e ? void 0 : null === (t = e.i2vOpt) || void 0 === t ? void 0 : t.realmanAvatar) || (null == e ? void 0 : null === (i = e.v2vOpt) || void 0 === i ? void 0 : i.lipSyncUserVideo) ); } function j(e) { var t; return !!(null == e ? void 0 : null === (t = e.v2vOpt) || void 0 === t ? void 0 : t.videoTemplate); } function O(e) { var t; return !!(null == e ? void 0 : null === (t = e.i2vOpt) || void 0 === t ? void 0 : t.realmanAvatar); } var B = (e) => [f.pi.Text2Song, f.pi.Text2Instrumental].includes(e), F = (e) => !(0, h.w)(e) && !B(e), U = (e) => (0, h.w)(e.generateType), G = (e) => B(e.generateType), z = (e) => F(e.generateType), V = (e) => void 0 !== e.draftId && void 0 !== e.storyId && void 0 !== e.storyVersion, W = (e) => void 0 !== e.id && void 0 !== e.packageId, Z = (function () { var e = (0, n._)(function* (e) { var { containerService: t, submitId: i, type: n } = e, r = Date.now(), a = (0, y.ko)(t, b.Dx), s = (0, y.ko)(t, I.e), { promise: c, resolve: d, reject: u } = (0, o.PQ)(), f = null, h = s.isOversea ? 3e3 : 2e3, p = a.registerEventHandler(b.Te.GroupKeyGenerated, (e) => { Date.now(), _(t, { status: "success", duration: Date.now() - r, submit_id: i, history_group_key_md5: e.historyGroupKeyMd5, err_msg: JSON.stringify(e), resource_type: n, }), e.submitId === i && (f && clearTimeout(f), p.dispose(), d( (0, l.oW)({ submitId: i, historyGroupKeyMd5: e.historyGroupKeyMd5, isMockMd5: !1, }) )); }); return ( (f = setTimeout(() => { p.dispose(); var e = (0, w.V)(); _(t, { status: "timeout_error", duration: Date.now() - r, submit_id: i, history_group_key_md5: e, resource_type: n, }), f && clearTimeout(f), d( (0, l.oW)({ submitId: i, historyGroupKeyMd5: e, isMockMd5: !0, }) ); }, h)), yield c ); }); return function (t) { return e.apply(this, arguments); }; })(); }, 223654: function (e, t, i) { "use strict"; i.d(t, { eX: function () { return o; }, jg: function () { return s; }, y7: function () { return a; }, z3: function () { return r; }, }); var n = i(733787); function r(e) { return e ? { sr: e[0], input_edit: e[1], outpaint: e[2], input_remove: e[3], hd: e[4], i2i: e[5], face_gan: e[6], bgpaint: e[7], control_net: e[8], } : { sr: 0, input_edit: 0, outpaint: 0, input_remove: 0, hd: 0, i2i: 0, face_gan: 0, bgpaint: 0, control_net: 0, }; } function a(e) { try { return JSON.parse(e).logId; } catch (e) { return ""; } } function o(e) { var t = Object.values(n.eV).filter((e) => "number" == typeof e), i = Number(t[0]); return ( t.forEach((t) => { Math.abs(Number(t) - e) < Math.abs(i - e) && (i = Number(t)); }), i ); } function s(e) { try { return JSON.parse(e).errMsg; } catch (e) { return ""; } } }, 934669: function (e, t, i) { "use strict"; i.d(t, { T: () => g }); var n = i("139646"), r = i("772322"), a = i("369617"), o = i("949274"), s = "view-AoaQvE"; function l(e) { var { onClick: t } = e; return (0, r.jsx)("span", { onClick: t, className: s, children: o.ZP.t("batch_button_tip_view", {}, "View"), }); } var c = i("14606"), d = i("388977"), u = i("178589"), f = i("259273"), h = i("727279"); function p(e) { return v.apply(this, arguments); } function v() { return (v = (0, n._)(function* (e) { var t = (0, d.ko)(e, c.A), i = (0, d.ko)(e, u.e), n = yield t.aggregate.getCommonConfigByKey("secUid"); n && i.navigate(f.Sj.GuestPerson, { params: { secUid: n }, replace: !1, state: { fromSideMenu: !1 }, }); })).apply(this, arguments); } function m(e, t) { (0, d.ko)(e, u.e).navigate(f.Sj.Activity, { state: { autoScrollToList: !0 }, query: { [h.m.weeklyActivityKey]: t }, }); } function g(e) { var { containerService: t, weeklyActivityKey: i, customToastText: n, beforeRouteLeave: s, } = e, c = a.s.success({ id: "publish_success_message", content: (0, r.jsxs)("div", { children: [ n || o.ZP.t( "result_toast_publish_repeated", {}, "Image posted already" ), (0, r.jsx)(l, { onClick: () => { c(), null == s || s(), i ? m(t, i) : p(t); }, }), ], }), }); } }, 683973: function (e, t, i) { "use strict"; i.d(t, { YA: () => E, xi: () => D, PJ: () => k, X2: () => N, uK: () => M, $S: () => T, TQ: () => A, cV: () => L, l: () => R, }); var n = i("625572"), r = i("639880"), a = i("475578"), o = i("749314"), s = i("243302"), l = i("100470"), c = i("474297"), d = i("417281"), u = (e) => { var t = null == e ? void 0 : null === (i = e.imagePromptList) || void 0 === i ? void 0 : i.find((e) => e.name === d.UI.IpKeep); if (t) { var i, n, r, a = null !== (n = t.ipKeepList[0]) && void 0 !== n ? n : {}; return { ai_role_cnt: 1, role_id: null !== (r = a.characterId) && void 0 !== r ? r : void 0, role_face_intensity: void 0 !== a.refIdWeight ? Number((100 * a.refIdWeight).toFixed(2)) : void 0, role_subject_intensity: void 0 !== a.refIpWeight ? Number((100 * a.refIpWeight).toFixed(2)) : void 0, }; } return { ai_role_cnt: 0 }; }, f = i("881607"), h = i("924086"), p = i("223654"), v = i("724614"), m = i("789786"), g = i("379311"), _ = i("217448"), y = i("799108"); class b { getEventParams() { var { request_id: e, generate_id: t, model: i, prompt: n, prompt_source: r, scale: a = 1, steps: o, seed: s, page: l, action: c, template_source: d, position: u, picture_id: f, style_source: h, preset_style_id: p, preset_style_name: v, reply_message_id: m, aigc_mode: g, chat_session_id: _, image_tags: b, } = this._params, { isVip: I, currentVipLevel: w } = this._vipService; return { request_id: e, generate_id: t, model: i, prompt: n, prompt_source: r, scale: a, steps: o, seed: s, page: l, action: c, template_source: d, is_vip: I ? 1 : 0, user_subscribe_type: I ? y.TK[w] : 0, position: u, picture_id: f, style_source: h, preset_style_id: p, preset_style_name: v, reply_message_id: m, aigc_mode: g, chat_session_id: _, image_tags: b, }; } constructor(e, t) { (this._params = e), (this._vipService = t), (this.eventName = "generate_result_action"); } } function I(e, t) { (0, g.Kl)(e, b, [t]); } b = (0, m.gn)( [ (0, m.fM)(1, _.q), (0, m.w6)("design:type", Function), (0, m.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === _.q ? Object : _.q, ]), ], b ); var w = i("76931"), x = i("219974"), S = i("906193"), M = { [o.l.Preset]: "preset_style", [o.l.Custom]: "custom_style" }; function C(e) { if (!e) return a.eD.False; var t, i, { aigcImageParams: n } = e, { generateType: r } = n; return r === s.pi.SuperResolution ? ( null === (t = n.superResolutionParams) || void 0 === t ? void 0 : t.isDescribePrompt ) ? a.eD.True : a.eD.False : [s.pi.Text2Image, s.pi.Blend].includes(r) ? ( null === (i = n.text2imageParams) || void 0 === i ? void 0 : i.isDescribePrompt ) ? a.eD.True : a.eD.False : a.eD.False; } function T(e) { var t, i = null == e ? void 0 : null === (t = e.commonAttr) || void 0 === t ? void 0 : t.webExtra; if (i) try { return JSON.parse(i).mweb_abtags.join(","); } catch (e) {} return ""; } function A(e) { var t, i, o, s, d, u, m, g, { result: _, lastPictureId: y, isRetry: b = !1, reportService: I, generateReportParams: x, customSizeReportParams: M = {}, clickGenerateReportParam: A = {}, customStyleReportParams: k = {}, extraParams: P = {}, containerService: E, } = e; if (!!_ && !!I) { var { record: D, code: R, logId: N, costTime: L, errMsg: j, generateReportParams: O, } = _, { text2ImageParams: B, reportParam: F, blendImageParams: U, generateType: G, historyRecordId: z, itemList: V, failedImageList: W, imageList: Z, isDraftGen: K, failCode: H, task: q, generateId: J, } = D, { secondPage: Y } = P, Q = R === l.b.ErrSuccess, X = R === l.b.ErrAccessLimit ? a.T9.ReachLimit : a.T9.Fail, $ = Q ? a.T9.Success : X, ee = (0, n._)({}, F, A), et = (0, f.cu)( (0, h.Um)( null !== (s = null == U ? void 0 : U.imagePromptList) && void 0 !== s ? s : [] ) ), ei = (0, h.x_)( null !== (d = null == U ? void 0 : U.imagePromptList) && void 0 !== d ? d : [] ), { generateId: en, lastRequestId: er = "", originRequestId: ea, templateId: eo, generateCount: es, model: el, modelName: ec, prompt: ed, promptSource: eu, scale: ef, steps: eh, seed: ep, templateSource: ev, page: em, templatePrompt: eg, resolutionType: e_, } = (0, c.JD)(B, ee), ey = null == V ? void 0 : V[0], eb = null !== (u = null == ey ? void 0 : null === (o = ey.aigcImageParams) || void 0 === o ? void 0 : null === (i = o.text2imageParams) || void 0 === i ? void 0 : null === (t = i.actualModelConfig) || void 0 === t ? void 0 : t.modelNameStarlingKey) && void 0 !== u ? u : el; Z.forEach((e, t) => { var i, o, s, l, d, u, h, m, g, _, x, P, O, B, { itemId: U, requestId: z, coverUrl: W } = e, Z = null === (s = V[t]) || void 0 === s ? void 0 : null === (o = s.aigcImageParams) || void 0 === o ? void 0 : null === (i = o.text2imageParams) || void 0 === i ? void 0 : i.usePe, X = null === (u = V[t]) || void 0 === u ? void 0 : null === (d = u.aigcImageParams) || void 0 === d ? void 0 : null === (l = d.text2imageParams) || void 0 === l ? void 0 : l.scheduleConf, ee = C(V[t]), eI = Q ? U : "", ew = T(V[t]), ex = R ? { fail_reason: K ? H : R, task_status: null == q ? void 0 : q.status, error_code: D.ret, is_new_err_code: K ? 1 : 0, } : {}, eS = W ? (0, n._)({ picture_id: eI, status: $ }, ex) : (0, n._)({ picture_id: "", status: a.T9.Fail }, ex), eM = (0, a.ax)( null !== (x = null == ey ? void 0 : ey.refItem) && void 0 !== x ? x : {} ); P = Q ? en || J : (0, p.y7)(j) || J; var eC = E ? (0, w.Oj)(E) : {}, eT = (0, c.ZA)(F), eA = (0, r._)( (0, n._)( (0, r._)( (0, n._)( (0, r._)( (0, n._)( { err_msg: (0, p.jg)(j), actual_model: eb, generate_type: G, request_id: z, generate_id: P, last_picture_id: y, last_request_id: er, origin_request_id: ea, origin_prompt_source: "", template_id: eo, generate_cnt: es, model: el, model_name: ec, is_prompt_empty: a.eD.False, is_describe: ee, prompt: ed, prompt_source: eu, scale: ef, steps: eh, seed: ep, time_cost: L, page: em, template_source: ev, template_prompt: eg, use_pre_llm: Z ? a.eD.True : a.eD.False, is_retry: b ? a.eD.True : a.eD.False, is_internal_env: (0, v.i)() ? 1 : 0, logId: N, }, eS, et ), { ai_role_cnt: null == ei ? void 0 : ei.aiRoleCount, role_id: null == ei ? void 0 : ei.roleId, role_face_intensity: (null == ei ? void 0 : ei.roleFaceIntensity) !== void 0 ? Math.round( (null == ei ? void 0 : ei.roleFaceIntensity) * 100 ) : void 0, role_subject_intensity: (null == ei ? void 0 : ei.roleSubjectIntensity) !== void 0 ? Math.round( (null == ei ? void 0 : ei.roleSubjectIntensity) * 100 ) : void 0, } ), (0, f.cu)(M), (0, f.cu)(k) ), { impression_id: null !== (O = null == ey ? void 0 : null === (h = ey.clientTraceData) || void 0 === h ? void 0 : h.impressionId) && void 0 !== O ? O : (0, w.ww)( null == ey ? void 0 : null === (g = ey.refItem) || void 0 === g ? void 0 : null === (m = g.commonAttr) || void 0 === m ? void 0 : m.id ), template_type_id: (0, w.pm)(eo, eM), template_from: (0, w.lg)(eo, eM), event_page: (0, w.CB)(eM, ev), second_page: Y, ab_tags: ew, schedule_conf: X, definition: e_, } ), eC, eT ), { is_within_agent: null !== (B = null == A ? void 0 : A.isWithinAgent) && void 0 !== B ? B : void 0, } ); I.reportBusinessEvent("generate_status", eA, { syncServer: !0 }); var ek = null === (_ = S.Z.getReporter(D.submitId)) || void 0 === _ ? void 0 : _.mergeParams(eA) .markGenerateFinish() .setServerTotalCost(D.finishTime - D.createdTime); ek && (I.reportBusinessEvent(ek.eventName, ek.getEventParams()), I.reportDevEvent(ek.eventName, ek.getEventParams())); }); var eI = (0, f.cu)( null !== (m = null != x ? x : O) && void 0 !== m ? m : {} ), ew = (0, n._)({ generate_type: "".concat(G) }, eI), ex = null !== (g = a.r$[R]) && void 0 !== g ? g : "".concat(R), eS = R ? { fail_reason: K ? "".concat(H) : ex, is_new_err_code: K ? "1" : "0", code: "".concat(R), } : { code: "0" }, eM = (null != Z ? Z : []).length, eC = (null != W ? W : []).length; null == I || I.reportDevEvent( "generateContent", (0, n._)( { cost_time: L, model: el, record_id: z, success_item_count: eM, fail_item_count: eC, item_count: eM + eC, logId: N, second_page: Y, }, ew, eS ) ); } } function k(e, t, i) { if (!!i) { var { text2ImageParams: n, isSuperResolution: r, reportParam: o, generateType: s, } = e, { requestId: l, itemId: d } = t, { generateId: u, generateCount: f, model: h, prompt: p, promptSource: v, scale: m, steps: g, seed: _, templateSource: y, page: b, } = (0, c.JD)(n, o || {}); i.reportBusinessEvent("generate_picture_hover", { request_id: l, generate_id: u, generate_type: s, picture_id: d, is_super_resolution: r ? a.eD.True : a.eD.False, generate_cnt: f, model: h, prompt: p, prompt_source: v, scale: m, steps: g, seed: _, page: b, template_source: y, }), r && [a.vh.Inpaint, a.vh.Outpaint, a.vh.Eliminate].forEach((e) => { i.reportBusinessEvent("show_tool", { tool: e, request_id: l, generate_id: u, picture_id: d, page: b, }); }); } } function P(e) { return (0, x.kJ)(e); } function E(e, t, i, o, s, l) { var d, v, m, g, _, y, b, I = P(t) ? t[0] : t, x = e.itemList.find( (e) => e.commonAttr.id === (null == I ? void 0 : I.itemId) ), { originPromptSource: S = "", originRequestId: M, lastRequestId: A, aigcCntList: k, text2imageParams: E, } = null !== (v = null == x ? void 0 : x.aigcImageParams) && void 0 !== v ? v : {}, { text2ImageParams: D, isSuperResolution: R, reportParam: N, generateType: L, blendImageParams: j, } = e, O = (0, f.cu)( (0, h.Um)( null !== (m = null == j ? void 0 : j.imagePromptList) && void 0 !== m ? m : [] ) ), { generateId: B, generateCount: F, model: U, prompt: G, promptSource: z, scale: V, steps: W, seed: Z, templateSource: K, page: H, templateId: q, resolutionType: J, impressionId: Y, } = (0, c.JD)(D, N), Q = (0, c.ZA)(N), X = null == E ? void 0 : E.usePe, $ = C(x), ee = (0, p.z3)(k), et = (0, a.ax)( null !== (g = null == x ? void 0 : x.refItem) && void 0 !== g ? g : {} ), ei = e.imageList.filter((e) => P(t) ? t.some((t) => t.itemId === e.itemId) : e.itemId === (null == t ? void 0 : t.itemId) ), en = ei.map((e) => e.requestId).join(","), er = ei.map((e) => e.itemId).join(","), ea = T(x), eo = l ? (0, w.Oj)(l) : {}; null == o || o.reportBusinessEvent( "generate_picture_action", (0, n._)( (0, r._)( (0, n._)( { request_id: en, generate_type: L, generate_id: B, picture_id: er, is_super_resolution: R ? a.eD.True : a.eD.False, generate_cnt: F, model: U, prompt: G, template_id: q, prompt_source: z, scale: V, steps: W, seed: Z, page: H, action: i, use_pre_llm: X ? a.eD.True : a.eD.False, is_describe: $, template_source: K, origin_prompt_source: S, origin_request_id: M, last_request_id: A, download_source: null !== (_ = null == s ? void 0 : s.download_source) && void 0 !== _ ? _ : void 0, collect_source: null !== (y = null == s ? void 0 : s.collect_source) && void 0 !== y ? y : void 0, show_type: null == s ? void 0 : s.showType, second_page: null == s ? void 0 : s.secondPage, }, O, ee, u(j) ), { event_page: (0, w.CB)(et, K), template_from: (0, w.lg)(q, et), template_type_id: (0, w.pm)(q, et), impression_id: null !== (b = null != Y ? Y : null == x ? void 0 : null === (d = x.clientTraceData) || void 0 === d ? void 0 : d.impressionId) && void 0 !== b ? b : (0, w.ww)(q), ab_tags: ea, schedule_conf: null == E ? void 0 : E.scheduleConf, definition: J, } ), eo, Q ), { syncServer: !0 } ); } function D(e, t, i) { var { text2ImageParams: r, reportParam: a, imageList: o } = e, { generateId: s, model: l, prompt: d, promptSource: u, scale: f, steps: h, seed: p, templateSource: v, page: m, } = (0, c.JD)(r, a), g = (0, c.ZA)(a), _ = o.map((e) => e.requestId).join(","); I( i, (0, n._)( { request_id: _, generate_id: s, model: l, prompt: d, prompt_source: u, scale: f, steps: h, seed: p, page: m, action: t, template_source: v, }, g ) ); } function R(e, t, i, n, r) { if (!!t && !!n) { var { code: o, costTime: s, record: d } = t, { text2ImageParams: u, imageList: f, reportParam: h } = d, { itemId: p = "", requestId: v = "" } = (null == f ? void 0 : f[0]) || {}, m = o === l.b.ErrSuccess ? a.T9.Success : a.T9.Fail, g = a.r$[o] || "", { templateId: _, generateId: y, generateCount: b, model: I, prompt: w, promptSource: x, scale: S, steps: M, seed: C, templateSource: T, page: k, } = (0, c.JD)(u, h); n.reportBusinessEvent( "super_resolution_status", { is_super_resolution_retry: e ? a.eD.True : a.eD.False, request_id: v, generate_id: y, picture_id: p, model: I, prompt: w, prompt_source: x, scale: S, steps: M, seed: C, page: k, template_source: T, template_id: _, generate_cnt: b, status: m, time_cost: s, fail_reason: g, }, { syncServer: !0 } ), A({ result: t, reportService: n, lastPictureId: i, containerService: null != r ? r : null, }); } } function N(e, t, i, n) { if (!(i <= 500)) { var { text2ImageParams: r, reportParam: a } = e, { requestId: o, itemId: s } = t, { page: l, generateId: d, model: u, prompt: f, promptSource: h, scale: p, steps: v, seed: m, generateCount: g, templateId: _, templateSource: y, } = (0, c.JD)(r, a); null == n || n.reportBusinessEvent("stay_super_resolution_picture", { request_id: o, generate_id: d, picture_id: s, model: u, prompt: f, prompt_source: h, scale: p, steps: v, seed: m, template_source: y, template_id: _, generate_cnt: g, page: l, duration: i, }); } } function L(e, t, i, n) { if (!(i <= 500)) { var { text2ImageParams: r, reportParam: a } = e, { requestId: o, itemId: s } = t, { page: l, generateId: d, model: u, prompt: f, promptSource: h, scale: p, steps: v, seed: m, generateCount: g, templateId: _, templateSource: y, } = (0, c.JD)(r, a); null == n || n.reportBusinessEvent("stay_picture", { request_id: o, generate_id: d, picture_id: s, model: u, prompt: f, prompt_source: h, scale: p, steps: v, seed: m, template_source: y, template_id: _, generate_cnt: g, page: l, duration: i, }); } } }, 474297: function (e, t, i) { "use strict"; i.d(t, { JD: function () { return f; }, NS: function () { return h; }, ZA: function () { return m; }, h7: function () { return v; }, q5: function () { return p; }, }); var n = i(625572), r = i(639880), a = i(601135), o = i(642273), s = i(259273), l = i(441361), c = i(475578), d = i(940140), u = i(949274); function f(e, t) { var i, { prompt: d, sampleStrength: f, seed: h, modelConfig: p, largeImageInfo: v, usePe: m = !1, } = e, { generateCount: g = 0 } = null != t ? t : {}, _ = null !== (i = null == p ? void 0 : p.modelNameStarlingKey) && void 0 !== i ? i : "", y = null == p ? void 0 : p.modelNameStarlingKey, b = y ? u.ZP.t(y) : "", { width: I, height: w, resolutionType: x } = null != v ? v : {}, S = e.imageRatio ? c.lS[e.imageRatio] : "".concat(I, ":").concat(w), M = (0, a.LX)( o.EZ[s.Sj.StoryEditor], location.pathname.replace(o.NU, "") ) ? c.WZ.StoryEditor : c.WZ.AigcImage; return (0, r._)( (0, n._)( { prompt: d.replace(l.rO, ""), steps: f, seed: h, model: _, modelName: b, scale: S, page: M, usePe: m, resolutionType: x, }, t ), { generateCount: g || 1 } ); } function h(e) { var { page: t, action: i, itemId: n, requestId: r, generateParam: a, reportParam: o, isSuperResolution: s, templateSource: l, reportService: d, } = e, { generateId: u, model: h, prompt: p, promptSource: v, scale: m, steps: g, seed: _, generateCount: y, templateId: b, } = f(a, o); null == d || d.reportBusinessEvent("publish_action", { page: t, action: i, request_id: r, generate_id: u, picture_id: n, is_super_resolution: s ? c.eD.True : c.eD.False, model: h, prompt: p, prompt_source: v, scale: m, steps: g, seed: _, template_source: l, generate_cnt: y, template_id: b, }); } function p(e) { if (e.type !== d.F5.IMAGE) return c.xI.Exclude; var t = e.src; return t.type !== d.lJ.CloudImageSticker ? c.xI.Exclude : t.from === d.Tq.AutomaticCanvas ? c.xI.Include : c.xI.Exclude; } function v(e) { if (e.type !== d.F5.IMAGE) return !1; var t = e, { type: i } = t.src; if (i !== d.lJ.AiGenerateImage) return !1; var { associatedImageList: n = [] } = t, r = t.src, a = n.find((e) => r.id === e.id); return ( (null == a ? void 0 : a.generateType) === d.z9.SuperResolution || !1 ); } function m(e) { if (!!e) return { reply_message_id: e.replyMessageId, aigc_mode: e.aigcMode, chat_session_id: e.chatSessionId, image_tags: e.imageTags, }; } }, 590045: function (e, t, i) { "use strict"; function n(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; if (!!e) { var n = e.scrollTop + t; e.scrollTo && i ? e.scrollTo({ top: n, left: 0, behavior: "smooth" }) : (e.scrollTop = n); } } function r(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (!!e) { var { scrollHeight: i } = e; n(e, i, t); } } function a(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (!!e) { var { scrollTop: i } = e; n(e, -i, t); } } function o(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; !t && console.log("[record-list] assigned element does not exist", i, e); var r = n ? null == t ? void 0 : t.querySelector("#".concat(e)) : document.getElementById(e); if (!r || !t) { console.log("[record-list] assigned element does not exist", i, e); return; } r.scrollIntoView({ block: "start", inline: "nearest", behavior: i ? "smooth" : "instant", }); } i.d(t, { As: function () { return o; }, Dh: function () { return r; }, lL: function () { return a; }, tr: function () { return n; }, }); }, 460911: function (e, t, i) { "use strict"; i.d(t, { V: function () { return a; }, }); var n = i(246940), r = i(297425); class a { getItem(e) { return this._lruIns.get(e); } setItem(e, t) { this._lruIns.put(e, t), this._allKeys.add(e); var i = this._lruToJson(); n.T.setJson(this._storageKey, i); } _lruToJson() { var e = {}; for (var t of this._allKeys) { var i = this._lruIns.get(t); i && (e[t] = i); } return e; } constructor(e, t = 50) { (this._storageKey = e), (this.capacity = t), (this._allKeys = new Set()), (this._lruIns = new r.z(t)); var i = n.T.getJson(this._storageKey); i && Object.entries(i).forEach((e) => { var [t, i] = e; this._allKeys.add(t), this._lruIns.put(t, i); }); } } }, 246940: function (e, t, i) { "use strict"; i.d(t, { T: function () { return r; }, }); var n = "mweb_"; class r { static updateUserId() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; r._userId = e; } static generateKey(e) { return "".concat(n).concat(r._userId, "_").concat(e); } static getItem(e) { return localStorage.getItem(r.generateKey(e)); } static setItem(e, t) { return localStorage.setItem(r.generateKey(e), t); } static getJson(e) { if ("undefined" == typeof window || !navigator.cookieEnabled) return; var t, i = "undefined" != typeof localStorage && r.getItem(e); if (!!i) { try { t = JSON.parse(i); } catch (e) {} return t; } } static setJson(e, t) { if ("undefined" != typeof window && !!navigator.cookieEnabled) try { r.setItem(e, JSON.stringify(t)); } catch (e) {} } } r._userId = ""; }, 719494: function (e, t, i) { "use strict"; function n(e, t, i) { var n = e.split(t).map((e) => e.trim()); return n.length > 1 ? n.join(i) : e; } function r(e, t) { return e.length > t ? "".concat(e.slice(0, t), "...") : e; } function a(e, t, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0; if (0 === e.length) return "".concat(t, " 1"); var r = new RegExp("".concat(t, "\\s+(\\d+)")), a = Math.min( i, Math.max( ...e.map((e) => { var t = e.match(r); return t ? parseInt(t[1], 10) : 0; }) ) + n + 1 ); return "".concat(t, " ").concat(a); } i.d(t, { Lr: function () { return r; }, WY: function () { return a; }, ZX: function () { return n; }, }); }, 965245: function (e, t, i) { "use strict"; i.d(t, { s: function () { return o; }, }); var n = i(625572), r = i(639880), a = i(776913); function o(e, t) { if (!!t) { var { generateParams: i, blendImageParams: o = {}, reportParams: s, needUpdateSeed: l, paintingParam: c, } = e; t.updateGenerateParam( (0, r._)((0, n._)({}, i, o), { originPrompt: null == c ? void 0 : c.originPrompt, }), l ), s && a.Jg.getInstance().setPendingResumeReportParam(i, s); } } }, 259455: function (e, t, i) { "use strict"; function n(e) { var t, i, n, r; e.focus(), (e.selectionStart = null !== (n = null === (t = e.value) || void 0 === t ? void 0 : t.length) && void 0 !== n ? n : 0), (e.selectionEnd = null !== (r = null === (i = e.value) || void 0 === i ? void 0 : i.length) && void 0 !== r ? r : 0); } i.d(t, { K: function () { return n; }, }); }, 487437: function (e, t, i) { "use strict"; function n(e) { var { scrollWidth: t, clientWidth: i } = e || {}; return t > i; } function r(e) { var { scrollHeight: t, clientHeight: i } = e || {}; return t > i; } function a(e) { var { scrollHeight: t, clientHeight: i } = e || {}; return t > i; } i.d(t, { ao: function () { return n; }, ob: function () { return r; }, rw: function () { return a; }, }); }, 334766: function (e, t, i) { "use strict"; i.d(t, { J5: function () { return h; }, VG: function () { return g; }, jp: function () { return v; }, ue: function () { return y; }, }); var n = i(139646), r = i(224671), a = i(433965), o = i(369617), s = i(949274), l = i(863209), c = i(509525), d = i(782296); function u(e) { return f.apply(this, arguments); } function f() { return (f = (0, n._)(function* (e) { var { itemId: t, publishedItemId: i, contentGenerateService: n } = e; if (!!n) { if (i) { var { response: a } = yield n.repository.getItemInfo( (0, c.Tg)(), { itemIdList: [i], packItemOpt: { scene: r.og.Download } } ); if (a.ok) { var { effectItemList: o } = a.value; return null == o ? void 0 : o[0]; } } if (t) { var { response: s } = yield n.repository.getLocalItemList( (0, c.Tg)(), { itemIdList: [t], packItemOpt: { scene: r.og.Download } } ); if (s.ok) { var { itemList: l } = s.value; return null == l ? void 0 : l[0]; } } } })).apply(this, arguments); } function h(e) { return p.apply(this, arguments); } function p() { return (p = (0, n._)(function* (e) { var t, i, n, r, a = yield u(e); return null !== (r = null == a ? void 0 : null === (n = a.image) || void 0 === n ? void 0 : null === (i = n.largeImages) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.imageUrl) && void 0 !== r ? r : e.fallbackUrl; })).apply(this, arguments); } function v(e) { return m.apply(this, arguments); } function m() { return (m = (0, n._)(function* (e) { var t, i, n, r, a = yield u(e); return null !== (r = null == a ? void 0 : null === (n = a.video) || void 0 === n ? void 0 : null === (i = n.transcodedVideo) || void 0 === i ? void 0 : null === (t = i.origin) || void 0 === t ? void 0 : t.videoUrl) && void 0 !== r ? r : e.fallbackUrl; })).apply(this, arguments); } function g(e, t) { return _.apply(this, arguments); } function _() { return (_ = (0, n._)(function* (e, t) { var i, n, [r, o] = ["", ""]; if ((0, a.DF)(e)) { var s = yield (0, l.X)(e, t); (r = s.url), (o = s.fileName); } else (r = null !== (i = yield h({ publishedItemId: e.commonAttr.id, contentGenerateService: t })) && void 0 !== i ? i : ""), (o = "".concat(e.commonAttr.title).concat(null !== (n = e.image.format) && void 0 !== n ? n : "png")); return { url: r, fileName: o }; })).apply(this, arguments); } function y(e, t) { var i = !1; return (0, d.u)({ task: (0, n._)(function* () { var { url: n, fileName: r } = yield g(e, t); if (yield (0, l.ue)(n, r, void 0, () => i)) o.s.success( s.oc.t("result_toast_saved_success", {}, "Image downloaded") ); else { if (i) return; o.s.warning( s.oc.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ); } }), tipTxt: s.oc.t("t2i_align_downloading", {}, "Downloading..."), onCancel: () => { i = !0; }, }); } }, 387008: function (e, t, i) { "use strict"; i.d(t, { h: () => s }); var n = i("772322"), r = "container-jh1Kes", a = i("827955"), o = (e) => { var { content: t, style: i = {} } = e; return (0, n.jsx)("div", { className: r, style: i, children: t }); }; class s { static open(e) { var { content: t, delay: i = 3e3, bindContainer: r = document.body, uiStyle: s, } = e; if (!!r) { var l = document.createElement("div"); r.appendChild(l); var c = (0, a.s)((0, n.jsx)(o, { content: t, style: s }), l); setTimeout(() => { c.destroy(), r.removeChild(l), (l = null); }, i); } } } }, 648757: function (e, t, i) { "use strict"; i.d(t, { q: () => h }); var n = i("772322"), r = i("2910"), a = i("653061"), o = i("105789"), s = i.n(o), l = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAY1BMVEXX8P/W8P8AAADX8f/Y8f/Y8P/D5v/X8P/X8f/Y6//Y7//X8f/V8P/X8P/W8P/W8P/Y7P/W7//Y7//b8v/X7//X8f/X8P/X8f/X8f/X8P/c6v/X8P/Y7//X7//M5v/V7v/c9v+ylYZVAAAAIXRSTlNmnACUWWAHM4kNTW2ZanI6Go8sJkB+enaEUxOBRiAUJh3IyLBPAAAWkElEQVR42uycy26kMBBFrRIYtTdYwAYEyv//5fT0KMqrOwM2tm+Ze3ZZ16Hquuy0kctwW/w4dt00rc41d1rzwf3P2Tk3TV03bn65yWWoXgC7bEM/uaY1h2hnt3bD5q1UTr0C3O6FX5/V/agJaz/4RWqlRgHupZ/m1pzLvHZbjRrUJYBdHqVPRuv6wUtV1CPA39qbLMzTWE8vqEIA63vXmqy0rqsjIKoXwG79bAox95t6CVQLYH188eMl0B0K9AqwDK41GLhBbybQKYD1fWOgaCaljUChAHaE+fS/0K6jwhWyNgHs4AwwTp0DqgQAr75KB/QIoKL67w7oOR1qEcCvkHP/JdMmOlAhwNLpqv6DZlIxCvAFUNT6NY4CdAF8r/Dj/6CFbwPQAthR7cf/uQ0IMsACWI2TX10agBXAr6YiJtjLAlABfAW9X8ckQBTADmA3PefQQCqAJ0A1o/8nDeCWGE2Aisv/UKBDUwBLgMrLj6gAkgAXKD+eAjgCXKT8aAqgCHCh8mOdCEAEGC9VfiQFIATwxR9376BSBQAEqG/rtxcHEAWKC2B7c2HKXxOVFuBa2e8nTSclKS2Ar3LpryoKlBTgdtnhDzQHignA7v+JTgpRTAB2/680ixShkABXz/5Ic6CMABu7P0oYzC8Awx9UEyggwMDPH6gJZBaAnz9aE8grAKc/XBPIK4Ct6rH/P5Q3gYwC8Oy/j8ZLNvIKwLM/4GIwnwC3S776CKPJNQayCcDD3zHaQbKQSQCufo8zWclALgFuTH+oYyCDAGz/yGMguQBs/+H0kpr0AjD9g4+B5AJ4tn/opVBqAQZDoJdCaQWwkyHYQSChABz/GoJASgEWnv7xDUgowBvj30m0myQipQCdIQqiYCIBePdrlETBRAJYvvw7mdVKAtIIwPj/joIomEAAXv49UGLA+QLw+PcN7H8gPF0Abv/T0Z5uQAoB3gxJxpucyvkC8PYnMYOcyPkCcP3zFOSV0HkCsP5PQTfgLAFY/1eAG3COAKz/L2AbYCQe1v93oA2IF4D1/y/IBsQKwPrvAdiAOAFY/53gGhAjAOu/H1gDwgVg/Q+BakC8ANz/7gRzKxwvAO9/doN4M2QknsWQIniJx0g0C+//9wP3PiBWAL7/OgrYK7FjArD+YMQaEC+AZf2LMluJIV4A/vRnYZwEEy8A//8HgF4CCBeAC0A4OgkkXoDNEADeJIh4AW5cAECwZx0QKwAPgMgEHQbjBWD9YdhxGIwRgAcAeCbZQaAAPABoYJAAYgTwhkDh5SXhAjAA6qF9GQQjBGAAVMTLIBgsAAOgLnp5RbwAfAKogUGeECEAN4DKeBYDYgXgEwBNNFZ2EC0AfwEcll6+ESIAA4BiBvlCgAAMAKr5GgMCBeAGQDGzfCJUAF4BKKaXD8IE4BWAbry8EyQArwC0834WDBCAJ8AqWOVBCgFGQxSwyZ1jAnAA1ER7EzkmAAdAXTiRIwJwAFTHcEQADoD6ODAEDAdAjbj9AnAAVMm2WwAOgCr5w97ZbbcJA0F4VkpSChKB5PDTkvb9H7N1exMCFvjYiXcWfa+gPTOzI2Q/7q2DkA3AJs9XDUD+ITB+mt0DkC+BTfLgdoF8CWyVb7cbgO/I8LGvDEBOgGYp3Q6QKwC7NG4b5ARolz05EDkBGmZHDsTxOsBYD91YFK33Qf4RvG/bYuqGOsIWO/pAHCkBxrob2yAJQjt2Neyw3QfiKCtg7EcvO/HjUMEGzdUDUIKfWI9eLsQXAwxQug1gfgWMXUL10xQ9vxBsSQBsr4Cxb+Uq2p48GP5waWBZAOoxyNWEgjsVvrokMCsAsWvlRvgevGysgjAqAHEKckN8wZsG0m0QTHZA1Rjk1tCOQFoCYLAErgo5kUdgjwTAnAC8E/88AtsSAGsCMAX5RHwHQlISAFsCUHv5ZDxhQZiSAFgSgLhu/tkHEhIAQwLQBUly3FogIQEwIwBVovc5vAiclwBYEYAhSIqDi8B5CYCNEjCO8sWMXJdEZyUAJm4BKi9fjqeygbMSAAsC0Ae5A4HKBl7cOjAgAJPciQk8PLh1QC8AsZC7URAFgcatAvYvAS+1/8MGgfKSAfgNFi48/yNPwLoEgPstQB3kzniaD8be3Bqgfgtw//MXCTQTsLoJglkAegXn/xeWdXC1DALxDtiLEkgmYLUMAu8OWIsWWFzg1S0B7Q6owf/JJqB0S8AaASsviggc22DjFoA0Auo6f5Y+4HnPADwx/DFgVHb+Ip6hFV6JgeCMgIWoowAByztBUEbASRTCcDe4jIFgjIBqCgC+OuDnYgAII2ClaAFkWwUWbSD4WkB9AZAoCD5uDcAvqGcUtYxQT+PmgM4BlAaA/+h/N/aWHoAnaEdbA8QWAz5WAWArARQ2AO9poZ0XNwNkJYBqAzih/v146WaAqwTQbQAngvpNYO4B4HIA5QZAUQnPPQBUDjAIAdq/DZh7AKgcQL0BnPBQzswDwOQAnVCg/VZo5gEgcgD9CZAjB848AEQOQJAA/7B3JrkJA1EQLZewJUiQHYeNLbj/NeNBgQWwbOkV6neGr/avodsZR0DnB8r5Anw1KdD9wN83A3AVmpgDAC8FT28GgF0GzDkAFthHQNu9HIBBaIIOAHwuPPiOUpLgqAOALgR631FKFyjqAKALgYPvKOVRiBAPIOQImF8MwCgy+Bg4KxYe/Y9CbMCwA4DeDDm9GACR4VwF/4xQ8CEElSECw1ZAvhIcngagF5gz9CpI7hrYPw3AJDBxKyD+pthk7yiiD/7TBMJeAzvvKOFGUJYLeAf9Dbh5RwkrQOQXAG4F9N5RwgoQqAHw34DJO0pYAZpM2Dqg84YCXICIMnicFzR4QwG/CAv9AsC9oN4bCggC4nKAiBsCJ2+I3wYLFYF0Idh6Q/wuQOwKADcDZ6+IXwgHPwkTvQSMXhG/Dhi7AsCXgItXxLeBmmDIS8DkFeHLIIFdkBAnoPOC8DZQyJXgwDhg9oLwfdDgHTBhCxQ+CozsAkTkQRcvCO8DBrbBHnwLzOQF0X3AcxMNWQa0XhDdB4wWAXAZcLQteh0s2AjGPx58sy16FhytAuE6cLQt+ssgyL/DfIgOvNgW3QiObYMEPBYz2RbcCM62AeAD0NoWXASkDwDaCdLRFjwJSA6D8YGwbrbgSUAdgJKMtuBJQLYTDPeC1duCq8DoOsiKyFxtwVVgHYCSHGyxo6A6AEVpbcGvBdYBKEpnwVVgHYCizBY7C6wDUJabBbcBqgwsymixw+BqBJWlt+A2QB2AolwsdiO0hkFlOVlwHyi9DwAfgIMF94HSBwDdB5Bai10HCb8YRP9xhGTRfxZYS6FFOYrdB6q18MLMgjvB9WJIWQbBneB6NeyPvXPJaRgIgmilQxRhm2AFbxyZ+18Tm5Eg4rNEvKekrjClnurq39/iJej1QHovGO4EbwSAO8FyJwhuAyRHPgHUeSB6MKgRAL0gTJ8H0rPATHwCqNMAehKQKfBakDwNCB0LnwDmgjC8GLyiExBArALxGjBd4NVg78Wg3Y5vBCcPYR+Nl4uAPnQYCOAVAXwJ4CCAVgTAu0FWGJ5f7ATwJUDg/WDe09ErBC6ABdJ6kOAHkEBaDkBfDFJBmgjyk0ANlH8AvhdABKUZeP8BbjsPYJ+OtkHoBd1zgBv3gvC9IC7oZKCgDiDyAoVWgEYCKqoBPhloCQCKaqDxcIRFAnoIIAsBFhfQQwBXJmgJAJkFTaFp6HciWAKAoitYuCxGEwDSBb4l7gq9RwVoAkA6/miYMBHwBADDbKAvEdh7AkAm/ni4LwTgR4Jd+wF0EwIWE7ARgL8iRlcUFDSDq3YE2VJBkQJc8YpfE2fTgSYFuGLEL4q0lYU1ZeCGC35VrKwzxPUBJI/4ZdEuP1D2AST8dfGu5cGyDyCHSmnqwYK6MH8lzBfM/JMx3/GEtYP2ulGArlKiYgBcBgw2AZAsFfj1eNOkmE0ArDjyD0d6qkL06zA/4cw/HauxhG0OwMfpWJkVSBWCPgG4YeSfj/8FPYwBOgfo83y8zgkipgLS9z9UpXxOUMMJxIBBOgo8V6Xo16MNDJC+f5aqlNEIgNkBQgOg4bkqpTQCSAwYtO+fc1XKaQRwfgHr/79hfCeArSXkGqd/zwbN759LVcqaBzL8AGn+l4ZqBOAfDcEywP3+cyOAsCD8xt65YLcKAgHUQD7EX0JPVF7SHPe/y9eKesCgNWk1MwN3C1znB4JJJjZvQ6Cc//Z8NgJgbgNe2Bv0ff/P5NAIgLoN0JRzm4HQ/lncGwFwtwFPFQIh/dtcGwGQtwGaTG1WRuFO/3orqBEAexvQUq4aBFJUf4COEGsB0LcBLcmK3YDEH/6/OGkBCLQBKweBFNMNEBN8dALgPBX2XBAIzf8j504ApKfCXFSLBwGOefZvw7QAVKrAlmJRBVLssx+Df60AZKrA5fNAeqMS/b+5tAIQqgIXVkCQqP176lYASlXgggqkitbyR9G1E4DGLPBBAR6C/yQ7ZgiA7x/xVccCsiC3/FEUGwIgPhk8SS7Sv4j9dBo/k4MlAK7L4uaTlfKXH39J8ONvOPcC0BoFPZCU4tVvn2To79j3AlAbBTmoni8JucoJr74eA2kBKBcBBkml+PzFJxv4e06mABSOhc0iL5RMp6O+Kmh/+R33XgDyRcCQLK+Km5CS89aFlHMphCoqP5Zes+8F8KIICLhKAC2AL0VAwORkCEB7EhBwcn4QYE9uOyAwATMFoLsdEBghtgUgeCYgMMmHLQDJMwGBCa6PAqC9LSzwPFtmChAaQe+4WAKERtA7zpYAoRH0jR2zBAiNoG98jgiA6xHRwMvUQwH82xH0m6MlQMgBvhGzgQBhGOgXtS0A/hyQ5WWhhOT6hMfipJxLifn8yNEWAHMOyPJCLL3q5E6QxcwWAGsOSErx9ouCNVyUmP4brAcCYMwBWamALH4HFxWWSHAcCIAuB2QF0CfkJYpAELOBALhyANjVR+NA7RAAzX5ALgG8EPEDAvi/pPspAUC/IJXd4K9+A4ccBi7MJQCCPeFEIVl+4LfJ3McFgHxXSA468yNSYMt+EuAQwQPf8oNV4DImAOCzoQnAp8LRKnB0CQB6FICm9HNyA6ZAzFwCQB4FlJiX/wsO61mR2ikA3FFAgjL5w31ZZLcfFwDi8fDbhgRw7he+MKcAQEcB738VlFwQODoFAFoGFhtCwAgCMZsnQB29HwrZH9wjM7VbAIhlIJ3wD+ihiS0bEwDcNJBI9fefvTvQbhqGoQD68ubEc7c2JZRtDRvh/78SzmHQDWjAieSoje4vRFP8ZDUz9ho4jBWApcWg7cWO/mz/s6E0UgCWLoXvrq7920gDB54rAFtJ8Ppe/0YqoD9bAKaS4OOFz37N/sfRDf8KtNUCHqor9wkLGf6nABb/XsxVHv9NhIHA0QIwcie4gue/VAUMYwVgZRi0iue/TAUEjhWAkWHQSp7/IhUw8AzQTAu4qtsfYyfBkHgGaKUFXP35/60HlBV5DmikBeyuOv//7n6HkkIaKQAbLeB6578WZoKRZ4EmWsDanv/3CtiimJDGCsBEC7jS+78xH1BM5HmghRawmgAoEAZlGwBBAy1gVQHg5BFlRI4Al28B6zsA/HB/hxJC4ghw+Raw0udfVTcoYeAYcPEWsMoDwA9P0Bc4owA4QN2uWrEd1A2zCoBHKNuu9gVQZhoQOK8A9lD2VK3aE5QNMwuAG6i6q1ZuB1Ub/gM4oQV4AriYJJBmFwBb/METwKXsBhw4rQDGo6CPgCTdb6EmJIECYMTv/A5I0i3UREoUAAPe8hNgVV3IOTBQpgD2+MUbwKuLuBgeJhbAeBT0GWBVXUYLOFCqAFINDVf2ERBzLSAJFcDpHOgN4KdLaAGRcgXAAADeAH66hBYQKFkAewDwBnBivwX0ggVwmgd6BPjBfgs4UK4ATvNAnwFouYOskIQLgC/eAP5geEV4oGwBnIYBfg34i+EbgQPlCyDVAHwT/MTwpWBICgXADvAM+IbhY+BAjQLgxo+A71lNggdSpQBS7ZuA7xg9BoZEqhQAX/wIqOde9gWgUgB89ingG0bfAQfmAHM0wd8A7xjcEA+JOcAse38D/MbcfvCeWcA8rb8B3jE3Do7MA2Y6+gfh3rI2CwrMBGZKtU+BTqzNgurETGCuDnNtK6d0H9AxF5itxUyPldMJggdmA7M1wW+C3zAUBEPDbGC+VHsIPLETBOvEfOAEnV8EndgJgh0nAKdofRXgFzNBsOUU4BTN0Y8Ar8wEwcBJwBE6x4BVfRa8WBAMiZOA0+x9DvzKSBDccxpwos5vAn+yEAQjJwKnOngIfGUgCLacCpyqOXoIlLdVOQCqFABT8BAo7kHnAKhSAOxrD4HSbpUmgCoFwMFDoLR75HvhDOAc0UOgtJ1WAFApALb+ZUhhn9UCgEoBcOPLQLI+IM8z5wHnaY6+DCRrq7YCoFIATMGXgUQ96AVAlQJgCh4CJd0Wff4EZ+trnwMvEwTrnrOB8+09BC4TBHvOBwoY/BchS6wFDRQASug8BJYPgh0lgCKih8DSa0GRIkAZ0UNg2UNApAxQSPQQKOWp4PMnKCV6CBRyU/D5ExQTfRlIyF25509QTvRloDJBMFIOKCj6EaBEEIwUBEqKvgykHwQjJYGios+BtYNgpChQVvRfhOgGwUhZoLDOQ6BmEOwoDJQ2eAjUWwsaKA0U19ceAnXWguo9xYHy+uAhUGMtKPSUBypIwUOg/FpQSFQAakjBQ6B0EDwmagBVNM/+ixDZ34dsGqoAlbS+DCQ5DW6pBNQSfRlILghGagHVvNS+DCQTBOuBakA9KXgIlAiCoaceUFEKPgeeHwSPiYpAVa2HwLlB8NBQE6gr+i9C5q0FddQFKtsHD4HTg2C9pzJQWwoeAqeuBR0TtYH6Wg+BU+zQNlQHFtD5HHiCTx0LAEv44mOAbLc9SwCLaOrKZakbFgEW8uyjoAw3zywELMNfAzk+9SwFLGdTuf8SWA5Y0EdvAv/h9iMLAkv64mfBf9o2LAksq/UmMOqmZVlgUd4Exj32LAwszJuAhfB3ApbmTcDOnz+XKQBvAn9zE7kEcAHeBP4UGi4CXMhXbwIj2b8ccCE+GDy52XAx4FL8PfCtvXNbjRiEomjZagzmIQURYZDg/39lEyfQDulDS5lxn2PXL+zluZiE9Bz+TvoK8D8M9q3+jTf0JQyugAnoSX8BBu8DdkJXCAQAtmFfGc0R3SEQYNRRIBHETyLAiAqYFRSQCDCaAiZ0b/4NIgGwjbMQ8MTPJMAwCjDFzyXAEApwxc8mgHoF2OLnEwDY9I6DfPEzCgCtG8Fc+OInFQBY1d0OMtz6XaEVAKiqnhEspPETCwBsTkknYGz9J9QCQEcnyCtx/OwCAJsT/Vm5sbS1v8EvADDJLQOZcu7/igQBIHQaMKFCACIE2PGylgLDO/Y/IEcAUa1AQum/I0mAnU2CA5LShzABQO+AsPQhTwAcDiyUq6Eh3/i/Q6QAB5FtL5htFJg+xAqwUwtLMzC5vEMqcgU4iLb7jwiS1KPfkC7AzuT7SZCsFx0+oECAgymG/OK50GThJ/+OEgEadXUvKgXJFRG3vD9AkwCNWOwza4E5sldx8E/UCdCoPizpCdH7G/ShUYA7NRa7JPPn5OfF6oz+QLMAJ1P0JSw5md/mnp0tXlm9vzCAAJ/cavRrCM7lnNM8zw9x7+S8OBfCusaq98Bf+ACmHE5r65VrYwAAAABJRU5ErkJggg==", c = "avatar-hZRCHJ", d = "avatarHover-moAOhi", u = "errorImg-Sz20pP", f = i("2345"), h = (e) => { var { enableClick: t = !0, className: i = [], src: o, alt: h, crossOrigin: p, loader: v, onClick: m, onLoad: g, width: _, height: y, lazy: b, ignoreHidden: I, } = e, w = Array.isArray(i) ? i : [i]; return (0, n.jsx)(f.y, { value: { isHeroImage: !1 }, children: (0, n.jsx)(a.k, { src: (0, r.C)(o, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), sizePickMode: "cdn", cdnOptimizeConfig: { useWebp: !0 }, alt: h, crossOrigin: p, loader: v, className: s()(...w, c, { [d]: t }), errLoader: (0, n.jsx)("img", { src: (0, r.C)(l, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: u, crossOrigin: "anonymous", }), onClick: m, onLoad: g, width: _, height: y, lazy: b, ignoreHidden: I, "data-apm-action": "avatar", }), }); }; }, 630008: function (e, t, i) { "use strict"; i.d(t, { G: () => u }); var n = i("625572"), r = i("639880"), a = i("96"), o = i("772322"); i("894672"); var s = i("274993"), l = i("105789"), c = i.n(l), d = "tooltip-UPiVYK", u = (e) => { var t, { children: i, color: l, className: u, triggerProps: f } = e, h = (0, a._)(e, ["children", "color", "className", "triggerProps"]); return (0, o.jsx)( s.Z, (0, r._)( (0, n._)( { color: l, className: c()(u, d), triggerProps: (0, n._)( { arrowProps: { style: { backgroundColor: l } }, showArrow: !0, popupAlign: { [null !== (t = h.position) && void 0 !== t ? t : "top"]: 9, }, }, f ), }, h ), { children: i } ) ); }; }, 990880: function (e, t, i) { "use strict"; i.d(t, { _: () => j }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("772322"); i("894672"); var s = i("274993"), l = i("218571"), c = { "image-editor-conflict-modal-z-index": "999999", imageEditorConflictModalZIndex: "999999", "box-selection-z-index": "10100", boxSelectionZIndex: "10100", "character-generate-modal-z-index": "1001", characterGenerateModalZIndex: "1001", "commerce-info-tooltip-z-index": "1001", commerceInfoTooltipZIndex: "1001", "boximator-modal-z-index": "1001", boximatorModalZIndex: "1001", "video-container-z-index": "9", videoContainerZIndex: "9", "character-item": "character-item-tF8oth", characterItem: "character-item-tF8oth", itemText: "itemText-Z7f_Ax", "image-sm": "image-sm-Lw9sfp", imageSm: "image-sm-Lw9sfp", image: "image-dVGbeg", "radius-none": "radius-none-zvsUpk", radiusNone: "radius-none-zvsUpk", editable: "editable-C7dYhw", blank: "blank-JXF_ZP", panelContainer: "panelContainer-dz4Y3_", imgContainer: "imgContainer-aDNkEK", btnContainer: "btnContainer-Fuc8yj", imgBig: "imgBig-EzD4UR", btnBig: "btnBig-z6s4Oy", btnSm: "btnSm-TQDyxJ", }, d = i("653061"); i("155582"); var u = i("56370"), f = i("2910"), h = i("949274"), p = i("188754"), v = { panelContainer: "panelContainer-CFG8bs", desc: "desc-kkV29Q", btnContainer: "btnContainer-aAG0sc", imgBig: "imgBig-nEreCI", image: "image-edcAG5", btnBig: "btnBig-RebQ8A", btnSm: "btnSm-FCD0Kx", modalMain: "modalMain-MVdsPq", buttonContainer: "buttonContainer-zLcLBl", cancelButton: "cancelButton-qu1nd0", deleteButton: "deleteButton-Pa7a2R", }, m = i("967355"), g = i("925016"), _ = i("547850"), y = i("835787"), b = i("841798"), I = i("475578"), w = i("519171"), x = (e) => { var t, i, n, r, { onRemove: a, onEdit: s, imagePrompt: l, canOperate: c, containerService: x = null, currentData: S, imgUrl: M, imgSize: C, } = e, T = () => { a(), (0, _.rx)(x, { action: _.Ix.Confirm, type: _.xh.Delete }); }, A = () => { (0, _.rx)(x, { action: _.Ix.Cancel, type: _.xh.Delete }); }, k = null === (i = l.ipKeepList) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.characterId, P = () => { (0, _.rx)(x, { action: _.Ix.Show, type: _.xh.Delete }), (0, b.E8)(x, { action: b.GW.AtDelete, page: I.WZ.StoryEditor, roleId: k, source: b.gf.Click, }), (0, y.T)(x, { action: y.f.Delate }); var e = g.H.confirm( { icon: null, title: h.oc.t("wimg2img_tittle_delete", {}, "Delete image?"), content: h.oc.t( "wimg2img_content_deleteconfirm", {}, "The image will be permanently deleted and can\u2019t be recovered." ), footer: () => (0, o.jsxs)("div", { className: v.buttonContainer, children: [ (0, o.jsx)("div", { className: v.cancelButton, onClick: () => { A(), null == e || e.close(); }, children: h.oc.t( "wimg2img_button_cancel", {}, "Cancel" ), }), (0, o.jsx)(m.J, { text: h.oc.t("wimg2img_button_confirm", {}, "Delete"), className: v.deleteButton, onClick: () => { T(), (0, b.E8)(x, { action: b.GW.AtDeleteConfirm, page: I.WZ.StoryEditor, roleId: k, source: b.gf.Click, }), null == e || e.close(); }, }), ], }), }, { modalMainClassname: v.modalMain } ); }, E = c ? null == S ? void 0 : S.description : null == l ? void 0 : null === (r = l.ipKeepList) || void 0 === r ? void 0 : null === (n = r[0]) || void 0 === n ? void 0 : n.description; return (0, o.jsxs)("div", { className: v.panelContainer, children: [ (0, o.jsx)(d.k, { src: (0, f.C)(M, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: v.imgBig, imageClassName: v.image, crossOrigin: "anonymous", style: (0, w.T)(null != C ? C : l, 200), "data-apm-action": "character-prompt-item-hover-panel", }), E ? (0, o.jsx)(u.Z.Text, { className: v.desc, ellipsis: { rows: 2, showTooltip: { type: "tooltip", props: { triggerProps: { mouseEnterDelay: 1e3 }, style: { zIndex: 1002 }, }, }, cssEllipsis: !0, }, children: E, }) : null, c && (0, o.jsxs)("div", { className: v.btnContainer, children: [ (0, o.jsx)(m.J, { type: "tertiary", text: h.oc.t( "character_selecting_re_edit", {}, "\u7F16\u8F91\u89D2\u8272" ), toolTipsContent: h.oc.t( "character_selecting_re_edit", {}, "\u7F16\u8F91\u89D2\u8272" ), className: v.btnBig, overflowEllipsis: !0, onClick: s, }), (0, o.jsx)(m.J, { text: "", type: "tertiary", toolTipsContent: h.oc.t( "wimg2img_content_delete", {}, "Delete" ), className: v.btnSm, onClick: P, PrevIcon: p.R64, }), ], }), ], }); }, S = i("128468"), M = i("434712"), C = i("417281"), T = i("733437"), A = i("105789"), k = i.n(A), P = i("96035"), E = i.p + "static/image/character-delete.8497f984.png", D = i("880821"), R = i("187796"), N = i("699267"), L = (e) => { var t, i, r, { id: a, index: u, canOperate: f = !0, instance: p, onRemove: v, onDidMount: m, onUpdate: g, elementId: _, imagePrompt: w, containerService: M, characterGenerateModalService: C, } = e, A = (0, T.k)(p, (e) => { var t; return { mode: e.mode, characterList: null === (t = e.characterListManager) || void 0 === t ? void 0 : t.listData, }; }), { mode: N, characterList: L } = null != A ? A : {}, [j, O] = (0, l.useState)(!1), B = (0, l.useRef)(null), F = (0, l.useRef)(null), U = (0, l.useRef)(null); (0, l.useEffect)(() => { null == m || m({ placeholderElement: F.current, cursorElement: U.current }); }, []); var G = (e) => { if (e && M) { var t, i; (0, y.T)(M, { action: y.f.Show }), (0, b.E8)(M, { action: b.GW.Show, page: I.WZ.StoryEditor, roleId: null === (i = w.ipKeepList) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.characterId, source: b.gf.Hover, }); } O(e); }, z = null == L ? void 0 : L.find((e) => { var t, i; return ( e.characterId === (null == w ? void 0 : null === (i = w.ipKeepList) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.characterId) ); }), V = () => { var e; if (!!z) null == C || C.then((e) => e.showGenerateModal({ characterId: z.characterId, characterName: z.characterName, refImage: z.refImage, onSave: g, }) ), (0, b.E8)(M, { action: b.GW.Edit, page: I.WZ.StoryEditor, roleId: null === (e = w.ipKeepList) || void 0 === e ? void 0 : e[0].characterId, source: b.gf.Click, }); }; (0, P.u)(B.current, () => O(!1)); var W = f ? null == z ? void 0 : z.characterName : null === (i = w.ipKeepList) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.characterName, Z = f ? (null == z ? void 0 : z.url) : w.url, K = null !== (r = w.coverUrlMap && (0, R.iI)(w.coverUrlMap)) && void 0 !== r ? r : w.coverUrl, [H, q] = (0, l.useState)(); return ( (0, l.useEffect)(() => { (function () { var e = (0, n._)(function* () { if (Z) { var { width: e, height: t } = yield (0, D.po)(Z); q({ width: e, height: t }); } }); return function () { return e.apply(this, arguments); }; })()(); }, [Z]), (0, o.jsx)(o.Fragment, { children: (0, o.jsx)("span", { id: _, className: "blend-item", ref: B, children: (0, o.jsx)(s.Z, { position: "tl", style: { transform: "translateY(5px)" }, popupVisible: j, className: "dtTipWrapper", content: (0, o.jsx)(x, { containerService: M, canOperate: f, imagePrompt: w, onRemove: () => { null == v || v(); }, onEdit: V, currentData: z, imgUrl: Z, imgSize: H, }), triggerProps: { mouseEnterDelay: 300, getPopupContainer: () => document.body, }, trigger: ["hover", "click"], onVisibleChange: G, children: (0, o.jsxs)("span", { className: k()(c.characterItem, { [c.story]: N === S.JU.Story, }), contentEditable: "false", suppressContentEditableWarning: !0, children: [ (0, o.jsx)(d.k, { src: z ? K || Z : E, className: k()(c.imageSm, { [c.radiusNone]: !z }), imageClassName: c.image, crossOrigin: "anonymous", "data-apm-action": "character-prompt-item-content", }), (0, o.jsxs)("span", { className: c.itemText, children: [ "@", z ? W : h.ZP.t( "character_deleted_tips", {}, "\u5DF2\u5220\u9664\u7684\u89D2\u8272" ), ], }), ], }), }), }), }) ); }, j = (e) => { var t = (0, N.G)(M.t), { imagePrompt: i } = e; return i && (null == i ? void 0 : i.name) === C.UI.IpKeep ? (0, o.jsx)( L, (0, a._)((0, r._)({}, e), { containerService: t, imagePrompt: i, }) ) : null; }; }, 746860: function (e, t, i) { "use strict"; i.d(t, { w: () => tx }); var n = i("772322"), r = i("733437"), a = i("417281"), o = i("949274"); i("894672"); var s = i("804929"), l = i("274993"), c = i("434712"), d = i("139646"), u = i("625572"), f = i("639880"), h = i("540611"), p = i("644866"), v = i("537201"), m = i("547850"), g = i("835787"), _ = i("417699"), y = i("699267"), b = i("9156"), I = i("924086"), w = i("904667"), x = i("188754"), S = i("218571"); i("645523"); var M = i("293793"), C = i("835628"), T = i("750633"), A = i("2910"), k = { imageCard: "imageCard-Y8_2CB", otherStatusCard: "otherStatusCard-XdlcpG", loading: "loading-iA1i3V", canEditCard: "canEditCard-HoIdma", smallImageCard: "smallImageCard-m_6EHH", loadingSpin: "loadingSpin-Ri3sV0", imgError: "imgError-p66sK1", contentImg: "contentImg-AhqN5g", content: "content-iNS6G0", topRightOperate: "topRightOperate-Q0h7eX", bottomRightOperate: "bottomRightOperate-qNljKJ", operateBtn: "operateBtn-shiPyV", operateBtnTooltips: "operateBtnTooltips-o7mR50", }, P = i("653061"), E = i("967355"), D = i("70529"), R = i("369617"), N = i("880821"), L = "uploadWrap-i10lHm", j = "disableUpload-DYqNHH", O = i("246940"), B = i("44938"), F = i("949057"), U = i("382070"), G = i("186827"), z = i("475578"), V = i("373177"), W = i("158316"), Z = i("966728"), K = i("329870"), H = i("991303"), q = 0xa00000, J = 3, Y = 7e3, Q = 7e3, X = 1, $ = "image/jpeg,image/jpg,image/png,image/webp", ee = (e, t) => { var i, n = null == e ? void 0 : e.invokeFunction((e) => e.get(D.m)); null == n || n.reportDevEvent(V.o.MWEB_BLEND_FILE_INFORMATION, { file_raw_size: null == t ? void 0 : t.size, file_type: null == t ? void 0 : t.type, file_size_str: (0, W.y)( null !== (i = null == t ? void 0 : t.size) && void 0 !== i ? i : 0 ), }); }, et = (e, t) => { var i = { [N.nI.Rate]: K.cZ.RateError, [N.nI.Size]: K.cZ.SizeError, [N.nI.Width]: K.cZ.WidthError, [N.nI.Height]: K.cZ.HeightError, [N.nI.Type]: K.cZ.TypeError, [N.nI.Unknown]: K.cZ.Unknown, }[t]; (0, K.pi)(e, { status: K.io.Failed, failReason: i }); }, ei = (e) => { (0, K.pi)(e, { status: K.io.Success }); }; function en(e, t, i) { var n = { [Z.fu.PictureOverRate]: o.oc.t( "upload_error_ratio", { number0: 1, number1: H.dJ, number3: H.dJ, number4: 1 }, "Select an image with an aspect ratio between {number0}:{number1} and {number3}:{number4}" ), [Z.fu.PictureOverDimension]: o.oc.t( "upload_error_px", { number0: H.jc }, "Select an image whose length or width is less than {number0} px" ), [Z.fu.PictureOverSize]: o.oc.t( "upload_error_m", { number0: H.qr >> 20 }, "Select an image less than {number0} MB" ), [Z.fu.PictureWrongFormat]: o.oc.t( "upload_error_form", {}, "Select an image in JPG or PNG" ), [Z.fu.FileUploadFailed]: o.oc.t( "pc_sticker_size_big", {}, "File is too large" ), [Z.fu.PictureOverCount]: o.oc.t( "wimg2img_toast_subbmitsuccess", { number: X }, "You can only upload 1 image" ), }[e]; R.s.warning(n), t && (0, G.rR)(t, { importType: z.ge.aigcImage, status: z.MK.Fail, type: i ? G.ZF.Add : G.ZF.Replace, actionType: G.mG.Click, failReason: n, }); } function er(e) { return e ? (e.length >= X ? Z.fu.PictureOverCount : "") : ""; } function ea(e, t) { e === Z.fu.PictureOverCount && (0, U.S)(t, { failToast: U.f.max4 }); } var eo = (function () { var e = (0, d._)(function* (e, t, i, n) { try { ee(t, e); var r = yield (0, N.$3)(e, { maxSize: q, maxRate: J, maxWidth: Y, maxHeight: Q, }); if (!r.ok) { var { errorType: a } = r, o = { [N.nI.Rate]: Z.fu.PictureOverRate, [N.nI.Width]: Z.fu.PictureOverDimension, [N.nI.Height]: Z.fu.PictureOverDimension, [N.nI.Size]: Z.fu.PictureOverSize, [N.nI.Type]: Z.fu.PictureWrongFormat, [N.nI.Unknown]: Z.fu.FileUploadFailed, }[a]; en(o, t, n), et(t, a); return; } null == i || i({ file: e, width: r.width, height: r.height }), ei(t); } catch (e) { en(Z.fu.FileUploadFailed, t, n); } }); return function (t, i, n, r) { return e.apply(this, arguments); }; })(), es = (e) => { var { onSuccess: t, imagePromptList: i, children: r, containerService: a, isAdd: o, } = e, { isOverSea: s } = (0, S.useContext)(F.FN), l = (0, S.useRef)(null), c = (function () { var e = (0, d._)(function* (e) { var i = e.target; i.onchange = null; var n = i.files, r = null == n ? void 0 : n[0]; if (!r) return !1; yield eo(r, a, t, o), (i.value = ""); }); return function (t) { return e.apply(this, arguments); }; })(), u = () => { (0, g.T)(a, { action: g.f.Replace }), (0, U.S)(a, { importType: z.ge.aigcImage }); var e, t = !!O.T.getItem(B.u.isAgreeUploadImageLaw), n = er(i); if ((ea(n, a), !n && t)) { l.current && (l.current.onchange = c), null === (e = l.current) || void 0 === e || e.click(); return; } if (t && n) { en(n); return; } (0, m.rx)(a, { action: m.Ix.Show, type: m.xh.PhotoImport }), O.T.setItem(B.u.isAgreeUploadImageLaw, "true"), setTimeout(() => { var e; null === (e = l.current) || void 0 === e || e.click(); }, 100); }; return (0, n.jsxs)("div", { className: L, children: [ S.cloneElement(r, { onClick: u }), (0, n.jsx)("input", { ref: l, type: "file", className: j, accept: $, }), ], }); }, el = i("989719"), ec = i("105789"), ed = i.n(ec), eu = (e) => { var { isLoading: t, url: i, coverUrlMap: r, isSmallCard: a, canEdit: s, className: l, style: d, deleteImg: u, replaceImg: f, adjustImg: h, } = e, [p, v] = (0, C.default)(), [m, g] = (0, S.useState)(!1), _ = (0, y.G)(c.t), b = (0, M.default)(() => { g(!0); }), I = (0, S.useMemo)( () => t ? (0, n.jsx)(T.Z, { className: k.loadingSpin, size: 16 }) : m ? (0, n.jsx)(x.eXM, { size: 16, className: k.imgError }) : (0, n.jsx)("div", { className: k.content, children: i || r ? (0, n.jsx)(P.k, { imageClassName: k.contentImg, src: (0, A.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), resolutionUrlMap: r, loader: (0, n.jsx)(T.Z, { className: k.loadingSpin, size: 16, }), onError: b, }) : null, }), [t, i, r, m, b] ); return (0, n.jsxs)("div", { className: ed()(k.imageCard, l, { [k.otherStatusCard]: t || m, [k.loading]: t, [k.smallImageCard]: a, [k.canEditCard]: s, }), style: d, ref: p, children: [ I, v && !t && s ? (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)("div", { className: k.topRightOperate, children: (0, n.jsx)(E.J, { text: "", type: "tertiary", toolTipsContent: o.ZP.t( "wimg2img_content_delete", {}, "Delete" ), className: k.operateBtn, onClick: u, PrevIcon: x.ZVg, toolTipsClassName: k.operateBtnTooltips, }), }), (0, n.jsxs)("div", { className: k.bottomRightOperate, children: [ (0, n.jsx)(es, { onSuccess: null != f ? f : el.Z, containerService: _, children: (0, n.jsx)(E.J, { text: "", type: "tertiary", toolTipsContent: o.ZP.t( "wimg2img_content_change", {}, "Replace" ), className: k.operateBtn, PrevIcon: x.qT6, toolTipsClassName: k.operateBtnTooltips, }), }), (0, n.jsx)(E.J, { className: k.operateBtn, type: "tertiary", toolTipsContent: o.ZP.t( "wimg2img_content_se", {}, "Adjust" ), onClick: h, PrevIcon: x.TBd, toolTipsClassName: k.operateBtnTooltips, }), ], }), ], }) : null, ], }); }, ef = { panelContainer: "panelContainer-CxbsLc", header: "header-gU26_D", name: "name-cQ3CnE", closeIcon: "closeIcon-zP8gu7", imageCard: "imageCard-mDLpb3", tooltip: "tooltip-YBj4hz", }, eh = i("487437"); i("245535"); var ep = i("76894"), ev = "closeConfirmFooter-n_AuOS", em = "cancelButton-puWInB", eg = "closeButton-zj1L_X"; function e_(e) { var { confirmText: t, onCancel: i, onConfirm: r } = e; return (0, n.jsxs)("div", { className: ev, children: [ (0, n.jsx)("div", { className: em, onMouseDown: (e) => { e.stopPropagation(), e.preventDefault(), null == i || i(); }, children: o.ZP.t("wimg2img_button_cancel", {}, "Cancel"), }), (0, n.jsx)(E.J, { text: t, className: eg, onMouseDown: (e) => { e.stopPropagation(), e.preventDefault(), null == r || r(); }, }), ], }); } var ey = "confirmModal-pil0_8", eb = (e) => { var { title: t, content: i, confirmText: r, onConfirm: a, onCancel: o, } = e, s = ep.Z.confirm({ wrapClassName: ey, simple: !1, icon: null, closable: !0, maskClosable: !1, title: t, content: i, closeIcon: (0, n.jsx)(x.Rnl, {}), footer: () => (0, n.jsx)(e_, { confirmText: r, onCancel: () => { null == s || s.close(), null == o || o(); }, onConfirm: () => { null == a || a(), null == s || s.close(); }, }), onCancel: () => { null == o || o(); }, }); }; function eI(e, t) { if (!e || !t) return 1; var i = e / t; return i > 1.5 ? 1.5 : i < 2 / 3 ? 2 / 3 : 1; } var ew = (e) => { var { onClose: t, onRemove: i, imagePrompt: r, coverList: a = [], imagePromptList: s, instance: c, canOperate: S, onUpdate: M, containerService: C, } = e, T = (0, y.G)(b.A), A = (0, y.G)(_.e), { isOversea: k = !0 } = null != A ? A : {}; if (!r) return null; var P = (function () { var e = (0, d._)(function* (e, t) { var { uri: i, url: n, id: a, width: o, height: l, file: d, coverUrl: p, name: m, controlNetList: g, } = e, _ = (0, f._)((0, u._)({}, r), { name: v.i[m], isReplace: t }); (0, I.rx)({ containerService: C, imcConfigService: T, generateImageParamsManager: c, imageInfo: { file: d, uri: i, url: n, id: a, width: o, height: l, coverUrl: p, }, params: t ? { name: v.i[m], controlNetList: g, isReplace: t } : _, exitImagePromptList: s, onModalSave: (e) => { null == M || M(e); }, displayAbilities: yield (0, h.N3)(k, C, !1), }); }); return function (t, i) { return e.apply(this, arguments); }; })(), E = (function () { var e = (0, d._)(function* () { yield P(r), (0, g.T)(C, { action: g.f.ChangeSetting }); }); return function () { return e.apply(this, arguments); }; })(), D = () => { i(), (0, m.rx)(C, { action: m.Ix.Confirm, type: m.xh.Delete }); }, R = () => { (0, m.rx)(C, { action: m.Ix.Cancel, type: m.xh.Delete }); }, N = () => { (0, m.rx)(C, { action: m.Ix.Show, type: m.xh.Delete }), (0, g.T)(C, { action: g.f.Delate }), eb({ title: o.oc.t("wimg2img_tittle_delete", {}, "Delete image?"), content: o.oc.t( "wimg2img_content_deleteconfirm", {}, "The image will be permanently deleted and can\u2019t be recovered." ), confirmText: o.oc.t("wimg2img_button_confirm", {}, "Delete"), onConfirm: () => { D(); }, onCancel: () => { R(); }, }); }, L = (e) => { var { file: t, width: i, height: n } = e, a = URL.createObjectURL(t); P( (0, f._)((0, u._)({}, r), { coverUrl: a, url: a, file: t, width: i, height: n, }), !0 ); }, j = (0, p.O)(r), O = (0, w.G)(j), B = eI(r.width, r.height); return (0, n.jsxs)("div", { className: ef.panelContainer, children: [ S ? (0, n.jsxs)("div", { className: ef.header, children: [ (0, n.jsx)(l.Z, { className: ef.tooltip, checkOverflow: eh.ao, content: O, trigger: "hover", children: (0, n.jsx)("span", { className: ef.name, children: O, }), }), (0, n.jsx)(x.Rnl, { className: ef.closeIcon, onClick: t, }), ], }) : null, (0, n.jsx)(eu, { url: r.coverUrl, style: { aspectRatio: B }, isSmallCard: !1, className: ef.imageCard, canEdit: S, deleteImg: N, replaceImg: L, adjustImg: E, }), ], }); }, ex = i("96035"), eS = i("211580"), eM = 8; function eC(e) { var { rootElement: t, rootElementId: i = "", triggerElement: n, triggerElementId: r = "", } = e, [a, o] = (0, S.useState)({ left: 0, top: 0 }), [s, l] = (0, S.useState)({}), [c, d] = (0, S.useState)("right"), u = (0, M.default)(() => { var e = n || document.getElementById(r); return { rootEle: t || Array.from( document.querySelectorAll('[id="'.concat(i, '"]')) ).find((t) => t.contains(e)), triggerEle: e, }; }), f = (0, M.default)(() => { var e, { rootEle: t, triggerEle: i } = u(); if (!!t && !!i) { var { top: n, left: r, right: a, height: s, } = null !== (e = t.getBoundingClientRect()) && void 0 !== e ? e : {}, { top: c, height: f } = i.getBoundingClientRect(), h = "right", p = "".concat(a + eM, "px"), v = "auto"; window.innerWidth - a < r && ((h = "left"), (p = "auto"), (v = "".concat(window.innerWidth - r + eM, "px"))), d(h), l({ left: p, right: v }), o({ [h]: [0, s / 2 - (c - n) - f / 2] }); } }); return ( (0, S.useEffect)(() => { var { rootEle: e, triggerEle: t } = u(), i = new ResizeObserver((i) => { for (var n of i) (n.target === e || n.target === t) && (f(), setTimeout(() => { f(); }, 600)); }); return ( e && i.observe(e), t && i.observe(t), () => { i.disconnect(); } ); }, [n, r, t, i, f, u]), { tooltipStyle: s, tooltipPosition: c, tooltipPopupAlign: a, calTooltipPosition: f, } ); } var eT = i("665588"), eA = "tooltip-v2tJUD", ek = "canOperate-NofZx3", eP = "view-ZmHW34"; function eE(e) { var { imagePromptItem: t, imagePromptList: i, elementId: r, canOperate: a, disabled: o, disabledTooltipText: d, mode: u, loading: f, isHasMoreFaceGen: h, index: v, instance: m, onRemove: _, onUpdate: b, } = e, I = (0, y.G)(c.t), [x, M] = (0, S.useState)(!1), [C, T] = (0, s.default)(void 0, { rootMargin: "0px" }); (0, S.useEffect)(() => { !T && M(!1); }, [T]), (0, ex.u)(C.current, () => M(!1)); var A = (e) => { x && I && (0, g.T)(I, { action: g.f.Show }), M(e); }, k = (0, S.useMemo)(() => { var { coverUrl: e, coverUrlMap: i } = null != t ? t : {}; return [{ coverUrl: null != e ? e : "", coverUrlMap: i }]; }, [t]), P = (0, p.O)(t), E = (0, S.useMemo)( () => o ? d : (0, n.jsx)(ew, { containerService: I, canOperate: a, instance: m, imagePrompt: t, imagePromptList: i, coverList: k, onRemove: () => { null == _ || _(); }, onClose: () => { M(!1); }, onUpdate: b, }), [I, a, m, t, i, k, _, b, o, d] ), { tooltipStyle: D, tooltipPosition: R, tooltipPopupAlign: N, } = eC({ rootElementId: eT.dS, triggerElement: C.current, triggerElementId: r, }); return (0, n.jsx)("span", { id: r, className: "blend-item", ref: C, children: (0, n.jsx)(l.Z, { position: a ? R : "tl", popupVisible: x, className: ed()({ [eA]: !0, [ek]: a, [eP]: !a }), style: D, content: E, triggerProps: { mouseEnterDelay: 300, getPopupContainer: () => document.body, popupAlign: N, autoFitPosition: !0, alignPoint: !1, boundaryOffset: { top: 24 }, }, trigger: a ? ["click"] : ["hover", "click"], onVisibleChange: A, children: (0, n.jsx)("span", { children: (0, n.jsx)(eS.w, { mode: u, disabled: o, loading: f, index: v, name: (0, w.G)(P, h), coverList: k, }), }), }), }); } var eD = i("128468"), eR = i("451733"), eN = i("627420"), eL = i("489897"), ej = i("469229"), eO = i("861879"), eB = { styleUploadImageLargeSize: "143px", styleUploadImageSmallSize: "93px", styleUploadPanelImageGap: "10px", }, eF = i("636803"), eU = i("819340"), eG = i("745017"), ez = i("586315"), eV = i("462537"), eW = i("950835"), eZ = i("280166"), eK = (function (e) { return ( (e[(e.Uploading = 0)] = "Uploading"), (e[(e.Success = 1)] = "Success"), (e[(e.Fail = 2)] = "Fail"), e ); })({}); function eH(e) { var { dragUploadContainerId: t, beforeUploadPreFileFilter: i, sourceImageInfoList: n = [], onUploadImageTaskSuccessListChange: r, } = null != e ? e : {}, a = (0, y.G)(eU.Z), s = (0, y.G)(eZ.Y), l = (0, y.G)(eV.R), c = a.getImageXUploader(s.appId, eG.I), [h, p] = (0, S.useState)( n.map((e) => (0, f._)((0, u._)({}, e), { id: e.imageId, uploadStatus: 1 }) ) ), [v, m] = (0, S.useState)(!1), g = (e) => { p((t) => t.map((t) => (t.id === e.id ? (0, u._)({}, t, e) : t))); }, _ = (function () { var e = (0, d._)(function* (e) { try { var t = yield (0, N.$3)(e, { maxSize: H.qr, maxRate: H.dJ, maxWidth: H.jc, maxHeight: H.jn, }); if (!t.ok) return (0, ez.wf)((0, eF.vI)(t.errorType), ""); var i = yield c.uploadImage({ file: e }); if (!i.ok) return (0, ez.wf)(Z.fu.FileUploadFailed, ""); return (0, ez.oW)(i.value); } catch (e) { return (0, ez.wf)(Z.fu.FileUploadFailed, ""); } }); return function (t) { return e.apply(this, arguments); }; })(), b = (0, M.default)( (function () { var e = (0, d._)(function* (e) { var t, n = null !== (t = null == i ? void 0 : i(e)) && void 0 !== t ? t : e; if (!!n.length) { var r = n.map((e) => ({ id: (0, eW.Rl)(), file: e })); p((e) => e.concat( r.map((e) => { var { id: t, file: i } = e; return { id: t, uploadStatus: 0, imageUri: "", imageUrl: "", width: 0, height: 0, }; }) ) ); var a = []; yield Promise.allSettled( r.map( (function () { var e = (0, d._)(function* (e) { var { id: t, file: i } = e, n = yield _(i); if (n.ok) { var { uri: r, height: o, width: s } = n.value; g({ id: t, uploadStatus: 1, imageUrl: URL.createObjectURL(i), imageUri: r, width: s, height: o, }); } else a.push({ id: t, uploadError: n.code }); }); return function (t) { return e.apply(this, arguments); }; })() ) ), a.length && (1 === a.length ? (0, eF.tH)(a[0].uploadError) : R.s.warning({ content: o.ZP.t( "dre_t2i_style_upload_error_toast", {}, "Couldn't upload some images. Try again." ), style: { top: 36 }, }), p((e) => e.filter((e) => a.every((t) => t.id !== e.id)))); } }); return function (t) { return e.apply(this, arguments); }; })() ), I = (e) => { p(h.filter((t) => t.id !== e.id)); }, w = (function () { var e = (0, d._)(function* (e, t) { g({ id: e.id, uploadStatus: 0 }); var i = yield _(t); if (i.ok) { var { uri: n, width: r, height: a } = i.value; g({ id: e.id, uploadStatus: 1, imageUrl: URL.createObjectURL(t), imageUri: n, width: r, height: a, coverUrlMap: void 0, }); } else p((t) => t.filter((t) => t.id !== e.id)), (0, eF.tH)(i.code); }); return function (t, i) { return e.apply(this, arguments); }; })(); return ( (0, S.useEffect)(() => { t && l.registerMenuFileDragHandler({ containerId: t, handleDrop: (e) => { b(e); }, isAcceptFile: (e, t) => eR.lq.includes(e) || eR.lq.includes(t), handleDropOver: (e) => { m(e); }, }); }, [t, l, b]), (0, S.useEffect)(() => { var e = h.filter((e) => 1 === e.uploadStatus || e.imageUri), t = e.map((e) => e.imageUri), i = n.map((e) => e.imageUri); (e.length !== n.length || t.some((e) => !i.includes(e))) && (null == r || r(e)); }, [h, n, r]), { isOverDragging: v, uploadImageTaskList: h, uploadImages: b, deleteUploadImage: I, replaceUploadImage: w, } ); } var eq = "panelContainer-cJc5l0", eJ = "title-iTHhIs", eY = "titleText-ytR1rR", eQ = "close-zsDV3n", eX = "imageListContainer-JTGNwx", e$ = "imageList-J_JW9r", e0 = "smallCardList-VVM72R", e1 = "hidden-cB1S7K", e2 = "addPic-kWvgcv", e6 = "disabledAddPic-nGXT3C", e4 = "addIcon-n0fOim", e3 = "addPicInput-YiK9Js", e8 = "smallCard-N8S1Ya", e9 = "dragMask-etNtpw", e5 = "titleTextTooltip-vs8hT2", e7 = "addPicTooltip-jmdzqH", te = "IMG_PROMPT_MULTI_IMG_UPLOAD_INPUT_ID", tt = "IMG_PROMPT_MULTI_IMG_UPLOAD_DROP_CONTAINER_ID", ti = (e) => { var { text: t } = e; return (0, n.jsxs)("div", { className: e9, children: [(0, n.jsx)(x.CgY, { size: 20 }), t], }); }, tn = (e) => { var { isSmallCard: t, disabled: i, onFileChange: r } = e, a = (e) => { var t, { target: i } = e; null == r || r(Array.from(null !== (t = i.files) && void 0 !== t ? t : [])), (i.value = ""); }; return (0, n.jsx)(l.Z, { content: o.ZP.t( "multiple_three_only", {}, "Can't upload more images" ), position: "top", disabled: !i, className: e7, children: (0, n.jsxs)("label", { htmlFor: te, className: ed()(e2, { [e6]: i, [e8]: t }), children: [ (0, n.jsx)(x.SC9, { className: e4, size: 20 }), t ? "" : o.ZP.t( "dre_t2i_style_reference_batch_import", {}, "Upload images" ), (0, n.jsx)("input", { type: "file", multiple: !0, disabled: i, id: te, className: e3, accept: eR.lq.join(","), onChange: a, }), ], }), }); }, tr = (e) => { var t, { referImageList: i, imagePromptItemId: r, onStyleUploadPanelReferImageUpdate: s, onSourceImagePromptItemUpdate: p, title: m, generateImageParamsManager: g, onRemove: w, onClose: x, setForbiddenTooltipClose: C, onUploadingChange: T, onInsert: A, styleReferenceCount: k = 0, getImagePromptList: P, } = e, E = (0, y.G)(c.t), D = (0, y.G)(b.A), N = (0, y.G)(_.e), { isOversea: L = !0 } = null != N ? N : {}, j = (0, S.useRef)(i.length), O = (0, M.default)((e) => { s( e .filter((e) => e.uploadStatus === eK.Success) .reduce((e, t) => { var n = null == i ? void 0 : i.find( (e) => e.imageId === t.id && e.image.imageUri === t.imageUri ); return ( n ? e.push(n) : e.push({ styleWeight: eL.FY.default, image: { imageUri: t.imageUri, imageUrl: t.imageUrl, width: t.width, height: t.height, }, imageId: t.id, }), e ); }, []) ); }), B = k - j.current, { isOverDragging: F, uploadImageTaskList: U, uploadImages: G, deleteUploadImage: z, replaceUploadImage: V, } = eH({ dragUploadContainerId: tt, beforeUploadPreFileFilter: (e) => e ? U.length + e.length + B > eN.I ? (R.s.warning({ content: o.ZP.t( "dre_t2i_style_upload_limit_toast", { num: eN.I }, "You can only upload up to {num} style references" ), style: { top: 36 }, }), e.slice(0, eN.I - B - U.length)) : e : [], sourceImageInfoList: null !== (t = null == i ? void 0 : i.map((e) => (0, f._)((0, u._)({}, e.image), { imageId: e.imageId, }) )) && void 0 !== t ? t : [], onUploadImageTaskSuccessListChange: O, }), W = B + U.length >= eN.I, Z = (function () { var e = (0, d._)(function* (e, t) { yield V(t, e.file); }); return function (t, i) { return e.apply(this, arguments); }; })(), K = (function () { var e = (0, d._)(function* (e) { var t = null == i ? void 0 : i.find( (t) => t.imageId === e.id && t.image.imageUri === e.imageUri ); if (!!t) { var n = null == P ? void 0 : P(i); null == C || C(!0), (0, I.rx)({ containerService: E, imcConfigService: D, generateImageParamsManager: g, imageInfo: { uri: e.imageUri, url: e.imageUrl, width: e.width, height: e.height, }, params: { name: v.i[a.UI.StyleReference], imageUriList: [e.imageUri], imageWeightList: [t.styleWeight], styleReference: { image: { imageUri: e.imageUri, imageUrl: e.imageUrl, width: e.width, height: e.height, }, styleWeight: t.styleWeight, }, }, imagePromptList: n, onModalSave: (t) => { if ( (null == C || C(!1), t.name === a.UI.StyleReference) ) { var n, o, [l] = t.imageWeightList; s( null !== (o = null == i ? void 0 : i.map((t) => t.imageId === e.id && t.image.imageUri === e.imageUri ? (0, f._)((0, u._)({}, t), { styleWeight: l, }) : t )) && void 0 !== o ? o : [] ); } else 1 === U.length ? null == p || p((0, f._)((0, u._)({}, t), { id: r })) : (s( null !== (n = null == i ? void 0 : i.filter((t) => t.imageId !== e.id)) && void 0 !== n ? n : [], !0 ), null == A || A(t)); }, onModalCancel: () => { null == C || C(!1); }, displayAbilities: yield (0, h.N3)(L, E, !1), }); } }); return function (t) { return e.apply(this, arguments); }; })(), H = (e) => { var t = () => { z(e); }; 1 === U.filter((e) => e.uploadStatus === eK.Success).length ? eb({ title: o.ZP.t( "wimg2img_tittle_delete", {}, "Delete image?" ), content: o.ZP.t( "wimg2img_content_deleteconfirm", {}, "The image will be permanently deleted and can\u2019t be recovered." ), onConfirm: () => { t(), null == w || w(); }, confirmText: o.ZP.t( "wimg2img_button_confirm", {}, "Delete" ), }) : t(); }; (0, S.useEffect)(() => { var e = U.some((e) => e.uploadStatus === eK.Uploading); null == T || T(e); }, [U, T]); var [q, J] = (0, eO.q_)(() => ({ config: { tension: 400, friction: 30 }, height: 0, })); (0, S.useEffect)(() => { var e = U.length > 1, t = Math.ceil((U.length + 1) / 3), i = t * (e ? parseInt(eB.styleUploadImageSmallSize, 10) : parseInt(eB.styleUploadImageLargeSize, 10)) + (t - 1) * parseInt(eB.styleUploadPanelImageGap, 10); J.start({ height: i }); }, [U.length, J]); var Y = U.length > 1; return (null == i ? void 0 : i.length) ? (0, n.jsxs)("div", { className: eq, id: tt, children: [ (0, n.jsxs)("div", { className: eJ, children: [ (0, n.jsx)(l.Z, { checkOverflow: eh.ao, trigger: "hover", content: m, className: e5, children: (0, n.jsx)("div", { className: eY, children: m, }), }), (0, n.jsx)("div", { className: eQ, onClick: x, children: (0, n.jsx)(ej.Z, {}), }), ], }), (0, n.jsxs)("div", { className: eX, children: [ (0, n.jsxs)(eO.q.div, { className: ed()(e$, { [e1]: F, [e0]: Y }), style: q, children: [ (0, n.jsx)(tn, { isSmallCard: Y, onFileChange: G, disabled: W, }), U.map((e) => (0, n.jsx)( eu, { url: e.imageUrl, coverUrlMap: e.coverUrlMap, isLoading: e.uploadStatus === eK.Uploading, isSmallCard: Y, replaceImg: (t) => Z(t, e), deleteImg: () => { H(e); }, adjustImg: () => { K(e); }, canEdit: !0, }, e.id ) ), ], }), F ? (0, n.jsx)(ti, { text: o.ZP.t( "i2i_drag", {}, "Dragging image to upload " ), }) : null, ], }), ], }) : null; }, ta = i("519171"), to = { container: "container-XMBR3v", imgBig: "imgBig-t9ZTtT", image: "image-NfQOgv", topLeft: "topLeft-XTdQYj", picIndex: "picIndex-IJBdEM", bottomRight: "bottomRight-H0b0jm", btnSm: "btnSm-dwezG8", loadingSpin: "loadingSpin-ICGU_T", }, ts = (e) => { var { coverList: t, imagePrompt: i } = e, [r, a] = (0, S.useState)(0), o = () => { a((e) => (e + 1 >= t.length ? e : e + 1)); }, s = () => { a((e) => (e - 1 >= 0 ? e - 1 : e)); }; return t.length ? (0, n.jsxs)("div", { className: to.container, children: [ (0, n.jsx)(P.k, { src: t[r].coverUrl, resolutionUrlMap: t[r].coverUrlMap, className: to.imgBig, imageClassName: to.image, loader: (0, n.jsx)(T.Z, { className: to.loadingSpin, size: 16, }), style: (0, ta.T)(i), crossOrigin: "anonymous", "data-apm-action": "image-prompt-item-hover-panel", }), t.length > 1 ? (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)("div", { className: to.topLeft, children: (0, n.jsxs)("span", { className: to.picIndex, children: [r + 1, "/", t.length], }), }), (0, n.jsxs)("div", { className: to.bottomRight, children: [ (0, n.jsx)(E.J, { text: "", type: "tertiary", className: to.btnSm, PrevIcon: x.USi, onClick: s, disabled: 0 === r, }), (0, n.jsx)(E.J, { text: "", type: "tertiary", className: to.btnSm, PrevIcon: x.AQS, onClick: o, disabled: r === t.length - 1, }), ], }), ], }) : null, ], }) : null; }, tl = { panelContainer: "panelContainer-NoXHfn", header: "header-paYCQj", titleContainer: "titleContainer-y3TQC_", title: "title-ft3EeB", close: "close-Sg_6Xo", lockedDescTooltips: "lockedDescTooltips-IgcOrW", lockedIcon: "lockedIcon-Zb9Sfo", lockedIconCursor: "lockedIconCursor-TPec3f", imageListContainer: "imageListContainer-kjzLjY", imageList: "imageList-m9wf28", singleImageList: "singleImageList-wzZyFN", singleImageCard: "singleImageCard-MlfYFB", smallCardList: "smallCardList-n5m2cx", }, tc = (e) => { var { title: t, coverList: i, lockedDesc: r, onClose: a } = e; if (!i.length) return null; var o = i.length > 2, s = 1 === i.length; return (0, n.jsxs)("div", { className: tl.panelContainer, children: [ (0, n.jsxs)("div", { className: tl.header, children: [ (0, n.jsxs)("div", { className: tl.titleContainer, children: [ (0, n.jsx)("span", { className: tl.title, children: t }), (0, n.jsx)(l.Z, { position: "top", content: null != r ? r : "", className: tl.lockedDescTooltips, children: (0, n.jsx)(x.nsc, { className: ed()(tl.lockedIcon, { [tl.lockedIconCursor]: r, }), size: 16, }), }), ], }), (0, n.jsx)("div", { className: tl.close, onClick: a, children: (0, n.jsx)(ej.Z, {}), }), ], }), (0, n.jsx)("div", { className: tl.imageListContainer, children: (0, n.jsx)("div", { className: ed()(tl.imageList, { [tl.smallCardList]: o, [tl.singleImageList]: s, }), children: i.map((e) => (0, n.jsx)( eu, { url: e.coverUrl, coverUrlMap: e.coverUrlMap, isSmallCard: o, className: s ? tl.singleImageCard : "", }, e.coverUrl ) ), }), }), ], }); }, td = "tooltip-BSFx6l", tu = i("727280"), tf = i("108982"); function th(e) { var { uri: t = "", url: i = "", coverUrl: n = "", width: r = 0, height: a = 0, imageUriList: o, imageWeightList: s, coverUrlMap: l, } = e; return { image: { imageUri: o[0] || t, imageUrl: i || n, width: r, height: a, coverUrlMap: l, }, styleWeight: s[0], }; } function tp(e) { var { referImageList: t } = e.commonAsset; return t ? t.map((e) => ({ coverUrl: e.image.imageUrl, coverUrlMap: e.image.coverUrlMap, })) : []; } function tv(e) { if ((0, a.iB)(e)) { var t; return (0, f._)((0, u._)({}, e), { commonAsset: (0, f._)((0, u._)({}, e.commonAsset), { referImageList: null === (t = e.commonAsset.referImageList) || void 0 === t ? void 0 : t.map((e) => (0, f._)((0, u._)({}, e), { imageId: (0, eW.Rl)() }) ), }), }); } return (0, f._)((0, u._)({}, e), { imageId: (0, eW.Rl)() }); } function tm(e) { var { assetCode: t, referImageList: i } = e.commonAsset; if (t) { var n = o.ZP.t("dre_t2i_style_ref_trigger_word", {}, "style"); return o.ZP.t( "dre_t2i_style_code_format", { style: n, style_code: t }, "#{style}{style_code}" ); } return i && i.length > 1 ? o.ZP.t( "dre_t2i_style_reference_status_count", { num: i.length }, "{num} style references" ) : (0, w.G)(tf.s.StyleReference); } function tg(e, t) { var [i, n] = (0, S.useState)(tv(e)), r = (0, S.useMemo)(() => { if ((0, a.D3)(i)) return [(0, f._)((0, u._)({}, th(i)), { imageId: i.imageId })]; if ((0, a.iB)(i)) { var e, t; return null !== (t = null === (e = i.commonAsset) || void 0 === e ? void 0 : e.referImageList) && void 0 !== t ? t : []; } return []; }, [i]), o = (0, S.useMemo)(() => { if ((0, a.D3)(i)) { var e, t; return [ { coverUrl: null !== (t = null !== (e = null == i ? void 0 : i.coverUrl) && void 0 !== e ? e : null == i ? void 0 : i.url) && void 0 !== t ? t : "", coverUrlMap: null == i ? void 0 : i.coverUrlMap, }, ]; } return (0, a.iB)(i) ? tp(i) : []; }, [i]), s = (0, S.useMemo)( () => i ? (0, a.D3)(i) ? (0, w.G)(tf.s.StyleReference) : (0, a.iB)(i) ? tm(i) : "" : "", [i] ), l = (0, S.useMemo)(() => { if ((0, a.iB)(i)) { var e; return null === (e = i.commonAsset) || void 0 === e ? void 0 : e.assetCode; } return ""; }, [i]), c = (0, M.default)((e, r) => { if (1 === e.length) { var o = (0, tu.Tt)(e[0], i); n((0, f._)((0, u._)({}, o), { imageId: e[0].imageId })), r && (null == t || t(o)); } else if (e.length > 1) { var s = (0, f._)((0, u._)({}, i), { name: a.UI.StyleCode, commonAsset: (0, f._)( (0, u._)( {}, (0, a.D3)(i) ? { assetType: eD.d_.Style, assetCode: eN.o } : i.commonAsset ), { referImageList: e } ), }); n(s), r && (null == t || t(s)); } }); return ( (0, S.useEffect)(() => { n(tv(e)); }, [e]), { tempImagePromptItem: i, styleUploadPanelReferImageList: r, stylePromptItemCoverList: o, stylePromptItemName: s, stylePromptItemAssetCode: l, onStyleUploadPanelReferImageUpdate: c, } ); } var t_ = "style-code-prompt-item"; function ty(e, t) { var { referImageList: i = [] } = e.commonAsset, { referImageList: n = [] } = t.commonAsset; if (i.length !== n.length) return !1; for (var r = 0; r < i.length; r++) if ( i[r].image.imageUri !== n[r].image.imageUri || i[r].styleWeight !== n[r].styleWeight ) return !1; return !0; } function tb(e, t) { var { uri: i, imageWeightList: n } = e, { uri: r, imageWeightList: a } = t; return i === r && n[0] === a[0]; } var tI = (e) => { var { imagePromptItem: t, generateImageParamsManager: i, canOperate: r, disabled: d, disabledTooltipText: h, styleReferenceCount: p, elementId: v = t_, mode: m, loading: _, index: b, onRemove: I, onUpdate: w, onInsert: x, } = e, [C, T] = (0, S.useState)(!1), A = (0, y.G)(c.t), [k, P] = (0, S.useState)(!1), { tempImagePromptItem: E, styleUploadPanelReferImageList: D, stylePromptItemCoverList: R, stylePromptItemName: N, stylePromptItemAssetCode: L, onStyleUploadPanelReferImageUpdate: j, } = tg(t, w), O = (0, M.default)(() => { if (!!E) { if (E.name !== t.name) { null == w || w(E); return; } if ((0, a.iB)(t) && (0, a.iB)(E)) { !ty(t, E) && (null == w || w(E)); return; } if ((0, a.D3)(t) && (0, a.D3)(E)) { !tb(t, E) && (null == w || w(E)); return; } } }), [B, F] = (0, s.default)(void 0, { rootMargin: "0px" }); (0, S.useEffect)(() => { !F && (T(!1), O()); }, [F, O]), (0, ex.u)(B.current, () => { T(!1), O(); }); var { tooltipStyle: U, tooltipPosition: G, tooltipPopupAlign: z, } = eC({ rootElementId: eT.dS, triggerElement: B.current, triggerElementId: v, }), V = (0, S.useRef)(!1), W = (e) => { if (!k) { if (!e && V.current) { eb({ title: o.ZP.t( "dre_t2i_reference_upload_exit_popup_title", {}, "Upload is in progress" ), content: o.ZP.t( "dre_t2i_reference_upload_exit_popup_desc", {}, "Close window? Reference upload may not complete." ), onConfirm: () => { T(!1); }, confirmText: o.ZP.t("duanpian_confirm", {}, "Confirm"), }); return; } C && A && (0, g.T)(A, { action: g.f.Show }), !e && O(), T(e); } }, Z = () => { null == I || I(); }, K = (0, M.default)((e) => { V.current = e; }), H = (0, M.default)((e) => { var { imagePromptList: n = [], prompt: r = "" } = null != i ? i : {}, o = n.findIndex((e) => e.id === t.id), s = 1 === e.length ? (0, tu.Tt)(e[0], E) : (0, f._)((0, u._)({}, E), { name: a.UI.StyleCode, commonAsset: (0, f._)( (0, u._)( {}, (0, a.D3)(E) ? { assetType: eD.d_.Style, assetCode: eN.o } : E.commonAsset ), { referImageList: e } ), }), l = [...n.slice(0, o), s, ...n.slice(o + 1)].filter(Boolean); return (0, tu.Jf)({ imagePromptList: l, prompt: r }) .imagePromptList; }), q = () => d ? h : R.every((e) => !e.coverUrl && !e.coverUrlMap) ? null : r && !L ? (0, n.jsx)(tr, { generateImageParamsManager: i, referImageList: D, imagePromptItemId: t.id, title: N, onRemove: Z, onStyleUploadPanelReferImageUpdate: j, onSourceImagePromptItemUpdate: w, onClose: () => W(!1), setForbiddenTooltipClose: P, onInsert: x, styleReferenceCount: p, onUploadingChange: K, getImagePromptList: H, }) : r && L ? (0, n.jsx)(tc, { coverList: R, title: N, lockedDesc: o.ZP.t( "dre_t2i_style_cant_change_hover", {}, "Can't adjust with a style code applied" ), onClose: () => W(!1), }) : (0, n.jsx)(ts, { imagePrompt: t, coverList: R }); return (0, n.jsx)("span", { id: v, className: "blend-item", ref: B, children: (0, n.jsx)(l.Z, { position: r ? G : "tl", popupVisible: C, className: ed()({ [td]: !0, imageBlendDtTipWrapper: !d, imageBlendDtTipWrapperMultiUploadPanel: r && !d, }), style: U, content: q(), triggerProps: { mouseEnterDelay: 300, getPopupContainer: () => document.body, popupAlign: z, autoFitPosition: !0, alignPoint: !1, boundaryOffset: { top: 24 }, }, disabled: !R.length, trigger: r ? ["click"] : ["hover", "click"], onVisibleChange: W, children: (0, n.jsx)("span", { children: (0, n.jsx)(eS.w, { mode: m, disabled: d, loading: _, index: b, name: N, coverList: R, }), }), }), }); }, tw = i("817585"), tx = (e) => { var t, { id: i, index: s, canOperate: l = !0, instance: c, loading: d, onRemove: u, onDidMount: f, onUpdate: h, onInsert: p, elementId: v, imagePrompt: m, imageItemList: g, disabled: _, } = e, y = (0, r.k)(c, (e) => ({ imagePromptList: e.imagePromptList, mode: e.mode, generatePromptParams: e.generatePromptParams, })), { imagePromptList: b, mode: I, generatePromptParams: w, } = null != y ? y : {}, x = m || (null == b ? void 0 : b.find((e) => e.id === i)), M = ( null !== (t = null == w ? void 0 : w.imagePromptList.filter((e) => (0, a.D3)(e))) && void 0 !== t ? t : [] ).length, C = o.ZP.t( "import_character_reference_photo_fail_tips", {}, "\u8BBE\u7F6E\u51FA\u6F14\u89D2\u8272\u540E\uFF0C\u4E0D\u652F\u6301\u8BBE\u7F6E\u66F4\u591A\u53C2\u8003\u9879" ), T = (0, S.useMemo)(() => (0, tw.V)(null != b ? b : g), [g, b]); return x && ((0, a.iB)(x) || (0, a.D3)(x)) ? (0, n.jsx)(tI, { imagePromptItem: x, generateImageParamsManager: c, canOperate: l, disabled: _, disabledTooltipText: C, styleReferenceCount: M, elementId: v, mode: I, loading: d, index: s, onRemove: u, onUpdate: h, onInsert: p, }) : (0, n.jsx)(eE, { imagePromptItem: x, instance: c, canOperate: l, disabled: _, disabledTooltipText: C, elementId: v, mode: I, loading: d, isHasMoreFaceGen: T, index: s, onRemove: u, onUpdate: h, }); }; }, 636803: function (e, t, i) { "use strict"; i.d(t, { wA: () => L, vI: () => P, tH: () => E }); var n = i("139646"), r = i("772322"), a = i("218571"), o = i("949274"), s = i("369617"), l = i("880821"), c = i("966728"), d = "uploadWrap-X3GCmh", u = "disableUpload-KEhkod", f = i("246940"), h = i("44938"), p = i("547850"), v = i("949057"), m = i("991303"), g = i("70529"), _ = i("601191"), y = i("382070"), b = i("835787"), I = i("186827"), w = i("475578"), x = i("373177"), S = i("158316"), M = i("329870"), C = i("727280"), T = (e, t) => { var i, n = null == e ? void 0 : e.invokeFunction((e) => e.get(g.m)); null == n || n.reportDevEvent(x.o.MWEB_BLEND_FILE_INFORMATION, { file_raw_size: null == t ? void 0 : t.size, file_type: null == t ? void 0 : t.type, file_size_str: (0, S.y)( null !== (i = null == t ? void 0 : t.size) && void 0 !== i ? i : 0 ), }); }, A = (e, t) => { var i = { [l.nI.Rate]: M.cZ.RateError, [l.nI.Size]: M.cZ.SizeError, [l.nI.Width]: M.cZ.WidthError, [l.nI.Height]: M.cZ.HeightError, [l.nI.Type]: M.cZ.TypeError, [l.nI.Unknown]: M.cZ.Unknown, }[t]; (0, M.pi)(e, { status: M.io.Failed, failReason: i }); }, k = (e) => { (0, M.pi)(e, { status: M.io.Success }); }; function P(e) { return { [l.nI.Rate]: c.fu.PictureOverRate, [l.nI.Width]: c.fu.PictureOverDimension, [l.nI.Height]: c.fu.PictureOverDimension, [l.nI.Size]: c.fu.PictureOverSize, [l.nI.Type]: c.fu.PictureWrongFormat, [l.nI.Unknown]: c.fu.FileUploadFailed, }[e]; } function E(e, t, i) { var n = { [c.fu.PictureOverRate]: o.oc.t( "upload_error_ratio", { number0: 1, number1: m.dJ, number3: m.dJ, number4: 1 }, "Select an image with an aspect ratio between {number0}:{number1} and {number3}:{number4}" ), [c.fu.PictureOverDimension]: o.oc.t( "upload_error_px", { number0: m.jc }, "Select an image whose length or width is less than {number0} px" ), [c.fu.PictureOverSize]: o.oc.t( "upload_error_m", { number0: m.qr >> 20 }, "Select an image less than {number0} MB" ), [c.fu.PictureWrongFormat]: o.oc.t( "upload_error_form", {}, "Select an image in JPG or PNG" ), [c.fu.FileUploadFailed]: o.oc.t( "pc_sticker_size_big", {}, "File is too large" ), [c.fu.PictureOverCount]: o.oc.t( "wimg2img_toast_subbmitsuccess", { number: m.Uj }, "You can only upload 1 image" ), }[e]; s.s.warning({ content: n, style: { top: 36 } }), t && (0, I.rR)(t, { importType: w.ge.aigcImage, status: w.MK.Fail, type: i ? I.ZF.Add : I.ZF.Replace, actionType: I.mG.Click, failReason: n, }); } function D(e) { if (!e) return ""; var t = 0, i = 0, n = 0; for (var r of e) (0, C.DX)(r) || (0, _.vp)(r) ? !t && (t = 1) : (0, _.f4)(r) ? !n && (n = 1) : (i += 1); return t + i + n >= m.Uj ? c.fu.PictureOverCount : ""; } function R(e, t) { e === c.fu.PictureOverCount && (0, y.S)(t, { failToast: y.f.max4 }); } var N = (function () { var e = (0, n._)(function* (e, t, i, n) { try { T(t, e); var r = yield (0, l.$3)(e, { maxSize: m.qr, maxRate: m.dJ, maxWidth: m.jc, maxHeight: m.jn, }); if (!r.ok) { var { errorType: a } = r, o = P(a); E(o, t, n), A(t, a); return; } null == i || i({ file: e, width: r.width, height: r.height }), k(t); } catch (e) { E(c.fu.FileUploadFailed, t, n); } }); return function (t, i, n, r) { return e.apply(this, arguments); }; })(), L = (e) => { var { onSuccess: t, imagePromptList: i, children: o, containerService: s, isAdd: l, } = e, { isOverSea: c } = (0, a.useContext)(v.FN), g = (0, a.useRef)(null), _ = (e) => { (0, b.T)(s, { action: b.f.Replace }), (0, y.S)(s, { importType: w.ge.aigcImage }); var t, n = !!f.T.getItem(h.u.isAgreeUploadImageLaw), r = D(i); if ((R(r, s), !r && n)) { null === (t = g.current) || void 0 === t || t.click(); return; } if (r) { E(r); return; } (0, p.rx)(s, { action: p.Ix.Show, type: p.xh.PhotoImport }), f.T.setItem(h.u.isAgreeUploadImageLaw, "true"), setTimeout(() => { var e; null === (e = g.current) || void 0 === e || e.click(); }, 100); }, I = (function () { var e = (0, n._)(function* (e) { var i = e.target.files, n = null == i ? void 0 : i[0]; if (!!n) yield N(n, s, t, l), (e.target.value = ""); }); return function (t) { return e.apply(this, arguments); }; })(); return (0, r.jsxs)("div", { className: d, children: [ a.cloneElement(o, { onClick: _ }), (0, r.jsx)("input", { ref: g, type: "file", className: u, onChange: I, accept: m.I5, }), ], }); }; }, 96035: function (e, t, i) { "use strict"; i.d(t, { u: function () { return r; }, }); var n = i(218571), r = (e, t) => { (0, n.useEffect)(() => { if (!!e) { var i = new MutationObserver((e, i) => { for (var n of e) { if (!n.removedNodes.length) return; t(); } }), n = { childList: !0 }; return ( i.observe(e, n), () => { i.disconnect(); } ); } }, [e, t]); }; }, 966728: function (e, t, i) { "use strict"; i.d(t, { cL: function () { return n; }, fu: function () { return r; }, }); var n = (function (e) { return ( (e.ArrowRight = "ArrowRight"), (e.ArrowLeft = "ArrowLeft"), (e.Backspace = "Backspace"), (e.ArrowUp = "ArrowUp"), (e.ArrowDown = "ArrowDown"), e ); })({}), r = (function (e) { return ( (e[(e.PictureOverRate = 0)] = "PictureOverRate"), (e[(e.PictureOverDimension = 1)] = "PictureOverDimension"), (e[(e.PictureOverSize = 2)] = "PictureOverSize"), (e[(e.PictureWrongFormat = 3)] = "PictureWrongFormat"), (e[(e.FileUploadFailed = 4)] = "FileUploadFailed"), (e[(e.PictureOverCount = 5)] = "PictureOverCount"), e ); })({}); }, 904667: function (e, t, i) { "use strict"; i.d(t, { G: function () { return a; }, }); var n = i(108982), r = i(949274); function a(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return e ? { [n.s.FaceGan]: t ? "".concat( r.oc.t( "dre_t2i_reference_status_more_faces", {}, "\u53C2\u8003\u4EBA\u50CF\u5408\u5F71" ) ) : "".concat( r.oc.t( "dre_t2i_reference_status_one_face", {}, "Referenced a face in the image" ) ), [n.s.BgPaint]: "".concat( r.oc.t("wimg2img_content_mainreference") ), [n.s.IpKeep]: "".concat(r.oc.t("IP_web_cref_label")), [n.s.BasicBlend]: "".concat(r.oc.t("wimg2img_content_idea")), [n.s.ControlNetCanny]: "".concat(r.oc.t("canny_refer")), [n.s.ControlNetDepth]: "".concat(r.oc.t("depth_refer")), [n.s.ControlNetPose]: "".concat(r.oc.t("pose_refer")), [n.s.ControlNet]: "", [n.s.Unknown]: "", [n.s.Text2image]: "", [n.s.Image2image]: "", [n.s.StyleReference]: "".concat(r.oc.t("style_referenced")), [n.s.ByteEdit]: "".concat( r.oc.t("image_reference_custom_status") ), [n.s.StyleCode]: "".concat( r.oc.t("dre_t2i_style_code_placeholder") ), }[e] : ""; } }, 161814: function (e, t, i) { "use strict"; i.d(t, { QT: function () { return d; }, rY: function () { return u; }, }); var n = i(625572), r = i(772322), a = i(746860), o = i(441361), s = i(990880), l = i(182688), c = i(747029), d = (e, t, i, n) => { if (!(null == t ? void 0 : t.length) || !e) return e; var l = 0; return e .replace(o.rO, "__$1__") .replace(o.a3, "__$1__") .split("__") .map((e, c) => { var d = e === o.qi, u = null == t ? void 0 : t[l]; return d && u ? (l++, (0, r.jsx)( "div", { style: { display: "inline" }, children: (0, r.jsx)(a.w, { canOperate: !1, imagePrompt: u, imageItemList: t, loading: null == n ? void 0 : n.imageLoading, }), }, c )) : e === o.e1 && u ? (l++, (0, r.jsx)( "div", { style: { display: "inline" }, children: (0, r.jsx)(s._, { canOperate: !1, imagePrompt: u, instance: i, }), }, c )) : e ? (0, r.jsx)( "span", { style: { userSelect: "text" }, children: e }, c ) : null; }); }, u = (e) => ({ update: (t) => { var i = [...e.imagePromptList]; i.forEach((e, r) => { e.id === t.id && (i[r] = (0, n._)({}, e, t)); }), i.length !== e.imagePromptList.length && (0, l.TE)(e, i), e.updateImagePromptList(i); }, add: (t) => { var i = e.imagePromptList; t.id = (0, c.HG)(); var n = [...i, t]; n.length !== e.imagePromptList.length && (0, l.TE)(e, n), e.updateImagePromptList(n); }, remove: (t) => { var i = e.imagePromptList.filter((e) => e.id !== t.id); e.updateImagePromptList(i), (0, l.TE)(e, i); }, }); }, 68809: function (e, t, i) { "use strict"; i.d(t, { h: function () { return r; }, }); var n = i(441361), r = (e) => null == e ? void 0 : e.replace(n.hQ, "").replace(n.lr, "").replace(n.Y4, "").trim(); }, 924086: function (e, t, i) { "use strict"; i.d(t, { Pm: () => aS, GV: () => ax, bz: () => am, rx: () => ab, Bq: () => a_, x_: () => aw, Um: () => aI, }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("317825"), s = i("224671"), l = i("417281"), c = i("749314"), d = i("952739"), u = i("949274"), f = i("772322"); i("245535"); var h = i("76894"), p = i("188754"), v = i("967355"), m = "feedBackContainer-wzLgGx", g = "feedbackBtn-aa1oPH"; i("900992"); var _ = i("744932"), y = i("218571"), b = "feedBackUIContainer-CE21_V", I = "suggestionContainer-nqTsCd", w = "buttonContainer-O1X_X1", x = "cancelButton-XTGgai", S = "submitButton-lcPtyR", M = i("741310"), C = i("369617"), T = { imagine: "fromImagine - " }, A = i("547850"), { TextArea: k } = _.Z, P = 200, E = (e) => { var { onClose: t, containerService: i } = e, [r, a] = (0, y.useState)(""), o = "" === r || r.length > P, s = (e) => { a(e); }, l = () => { (0, A.rx)(i, { action: A.Ix.Cancel, type: A.xh.Feedback }), t(); }, c = (function () { var e = (0, n._)(function* () { (0, A.rx)(i, { action: A.Ix.Confirm, type: A.xh.Feedback }); try { var e = yield (0, M.z8)({ suggestion: "".concat(T.imagine).concat(r), }); 0 !== e.err_code ? C.s.warning( u.oc.t( "wimg2img_toast_feedbackfail", {}, "Couldn\u2019t submit. Try again." ) ) : (t(), C.s.success( u.oc.t( "wimg2img_toast_feedbacksuccess", {}, "Feedback submitted" ) )); } catch (e) { C.s.warning( u.oc.t( "wimg2img_toast_feedbackfail", {}, "Couldn\u2019t submit. Try again." ) ); } }); return function () { return e.apply(this, arguments); }; })(); return (0, f.jsxs)("div", { className: b, children: [ (0, f.jsx)(k, { className: I, value: r, onChange: s, placeholder: u.oc.t( "wimg2img_placeholder_feedback", {}, "Tell us what part of the uploaded image you want to reference" ), maxLength: { length: P, errorOnly: !0 }, showWordLimit: !0, }), (0, f.jsxs)("div", { className: w, children: [ (0, f.jsx)("div", { className: x, onClick: l, children: u.oc.t("wimg2img_button_cancel2", {}, "Cancel"), }), (0, f.jsx)(v.J, { disabled: o, className: S, text: u.oc.t("wimg2img_button_button", {}, "Submit"), onClick: c, }), ], }), ], }); }, D = i("466740"), R = i("108982"), N = i("379311"), L = (function (e) { return (e.Hover = "hover"), (e.Click = "click"), e; })({}), j = (function (e) { return ( (e.Face = "face"), (e.Subject = "subject"), (e.IpKeep = "ip_keep"), (e.Canny = "canny"), (e.Depth = "depth"), (e.Pose = "pose"), (e.Inspiration = "inspiration"), (e.Feedback = "feedback"), (e.Save = "save"), (e.ControlNet = "control_net"), (e.Text2image = "text_2_image"), (e.Image2image = "image_2_image"), (e.StyleReference = "style"), (e.ByteEdit = "instruct"), (e.None = ""), e ); })({}), O = { [R.s.FaceGan]: "face", [R.s.BgPaint]: "subject", [R.s.IpKeep]: "ip_keep", [R.s.BasicBlend]: "inspiration", [R.s.ControlNetCanny]: "canny", [R.s.ControlNetDepth]: "depth", [R.s.ControlNetPose]: "pose", [R.s.ControlNet]: "control_net", [R.s.Text2image]: "text_2_image", [R.s.Image2image]: "image_2_image", [R.s.StyleReference]: "style", [R.s.ByteEdit]: "instruct", [R.s.StyleCode]: "", }, B = (function (e) { return ( (e.MultiSubject = "has_subject"), (e.MultiIpKeep = "has_ip_keep"), (e.TwoFace = "has_face"), (e.MultiCanny = "has_canny"), (e.MultiDepth = "has_depth"), (e.MultiPose = "has_pose"), (e.UseSubject = "use_subject"), (e.UseControlNet = "use_control_net"), (e.MultiStyle = "has_style"), (e.ByteEdit = "has_byte_edit"), (e.Unknown = ""), e ); })({}), F = { [R.s.BgPaint]: "has_subject", [R.s.FaceGan]: "has_face", [R.s.IpKeep]: "has_ip_keep", [R.s.ControlNetCanny]: "has_canny", [R.s.ControlNetDepth]: "has_depth", [R.s.ControlNetPose]: "has_pose", [R.s.ControlNet]: "", [R.s.BasicBlend]: "", [R.s.Image2image]: "", [R.s.Text2image]: "", [R.s.StyleReference]: "has_style", [R.s.ByteEdit]: "has_byte_edit", [R.s.StyleCode]: "", [R.s.Unknown]: "", }; class U { getEventParams() { var { action: e, item: t, failToast: i, templateId: n, } = this._params, r = { action: e, item: t }; return i && (r.fail_toast = i), n && (r.template_id = n), r; } constructor(e) { (this._params = e), (this.eventName = "reference_photo_action"); } } function G(e, t) { (0, N.Kl)(e, U, [t]); } var z = i("776913"); function V(e, t, i, n) { var { textToImageGenerateParam: r } = null != n ? n : {}; if (r) { var { templateId: a } = z.Jg.getInstance().resumeReportParam(r); t.templateId = a; } i(e, t); } var W = () => { var e = (0, D.lS)(), { generateImageParamsManager: t } = (0, D.N_)(), i = () => { V(e, { action: L.Click, item: j.Feedback }, G, t), (0, A.rx)(e, { action: A.Ix.Show, type: A.xh.Feedback }); var i = h.Z.confirm({ wrapClassName: m, title: u.oc.t("wimg2img_title_feedback", {}, "Give feedback"), footer: null, icon: null, closeIcon: null, closable: !0, content: (0, f.jsx)(E, { onClose: () => i.close(), containerService: e, }), }); }; return (0, f.jsx)(v.J, { className: g, type: "tertiary", PrevIcon: p.nKk, text: u.oc.t("wimg2img_content_feedback", {}, "Give feedback"), onClick: i, }); }; i("347197"); var Z = i("693238"), K = "save-PKzSo9", H = "hoverText-Thmjas", q = (e) => { var { available: t, onClick: i, disablePopover: n } = e; return (0, f.jsx)(Z.Z, { disabled: n, position: "tr", showArrow: !1, content: (0, f.jsx)("div", { className: H, children: u.ZP.t( "wimg2img_content_select", {}, "Select what to reference" ), }), children: (0, f.jsx)(v.J, { disabled: !t, type: "default", text: u.ZP.t("wimg2img_button_save", {}, "Save"), className: K, onClick: i, }), }); }, J = i("2910"), Y = i("653061"), Q = i("319440"), X = { paintContainer: "paintContainer-KDEuCq", paintContent: "paintContent-l3Q9Ue", imageWrap: "imageWrap-lgUl32", image: "image-w0BbtD", imagineGraphicEditor: "imagineGraphicEditor-ONXJBB", hidden: "hidden-Td_8Vb", fadeOut: "fadeOut-Q0_zYP", visible: "visible-hWCHIY", fadeIn: "fadeIn-h2DzrE", }, $ = i("67608"), ee = i("586167"), et = new (i("950466").Qd)(), ei = new ee.D(), en = i("699301"); i("596477"); var er = i("216956"), ea = i("331730"), eo = i("767116"), es = i("342396"), el = 2, ec = (e) => { var { currentScale: t } = e, i = () => ( (et.scale = Math.min(Math.abs(et.scale * el), es.pv)), et.scale ), n = () => ( (et.scale = Math.max(Math.abs(et.scale / el), es.$A)), et.scale ), { scaleArr: r } = (0, eo.y)(), a = (e) => { var t = Math.round(100 * e); return "".concat(Math.abs(t), "%"); }, [o, s] = (0, y.useState)({ display: "none" }), l = (e) => { e ? s({ display: "block" }) : s({ display: "none" }); }, c = (0, y.useRef)(null), d = (t) => { var i, n, { value: r, resetOffset: a } = t; a && (et.resetOffset(), ei.resetMove()), null == e || null === (i = e.handleSelectScaleCallback) || void 0 === i || i.call(e, r), setTimeout(() => { et.scale = r; }), l(!1), null === (n = c.current) || void 0 === n || n.close(); }; return { handleScaleUp: i, handleScaleDown: n, getScaleName: a, menu: (0, f.jsx)(er.Z, { className: ea.Z.menu, selectedKeys: ["".concat(t)], children: r.map((e, t) => (0, f.jsx)( er.Z.Item, { className: ea.Z.menuItem, onClick: () => d(e), children: e.name, }, "".concat(e.value) ) ), }), dropdownStyle: o, dropdownRef: c, handleDropdownVisibleChange: l, }; }, ed = (function (e) { return (e.Click = "click"), (e.Use = "use"), e; })({}), eu = (function (e) { return ( (e.AIIdentification = "ai_identifiaction"), (e.Brush = "brush"), (e.BrushSlider = "brush_slider"), (e.Eraser = "eraser"), (e.EraserSlider = "eraser_slider"), (e.Undo = "undo"), (e.Redo = "redo"), (e.MoveCanvas = "move_canvas"), (e.MinusScale = "minus_scale"), (e.SelectScale = "select_scale"), (e.AddScale = "add_scale"), (e.MoveLayer = "move_layer"), e ); })({}); class ef { getEventParams() { var e; return { action: this._params.action, item: this._params.item, value: null !== (e = this._params.value) && void 0 !== e ? e : "", }; } constructor(e) { (this._params = e), (this.eventName = "reference_subject_item"); } } function eh(e, t) { (0, N.Kl)(e, ef, [t]); } var ep = i("164763"); function ev() { var e = (0, D.lS)(), t = ep.o.getGraphicToolStoreInstance(e); return null == t ? void 0 : t.bgPaintInstance; } var em = (e) => ( et.on("scale", e), () => { et.off("scale", e); } ), eg = () => { var e = ev(), t = (0, y.useSyncExternalStore)(em, et.getSnapshot.bind(et)); (0, y.useEffect)(() => { null == e || e.updatePaintScale(t); }, [t, e]); var i = (0, D.lS)(), n = ec({ handleSelectScaleCallback: (e) => { eh(i, { action: ed.Click, item: eu.SelectScale, value: e.toString(), }); }, currentScale: t, }), o = () => { var e = n.handleScaleUp(); eh(i, { action: ed.Click, item: eu.AddScale, value: e.toString(), }); }, s = () => { var e = n.handleScaleDown(); eh(i, { action: ed.Click, item: eu.MinusScale, value: e.toString(), }); }; return (0, f.jsx)(en.n, { scale: t, logic: (0, a._)((0, r._)({}, n), { handleScaleUp: o, handleScaleDown: s, }), }); }, e_ = "rightInteract-YxJHMG", ey = () => {}; function eb(e) { var t = (0, y.createContext)(e), i = (0, y.createContext)(ey); return [ (n) => { var { children: r } = n, [a, o] = (0, y.useState)(e); return (0, f.jsx)(t.Provider, { value: a, children: (0, f.jsx)(i.Provider, { value: o, children: r }), }); }, () => (0, y.useContext)(t), () => (0, y.useContext)(i), t, ]; } var [eI, ew, ex] = eb(!0), eS = () => { var e = ew(); return (0, f.jsx)("div", { className: e_, style: e ? {} : { display: "none" }, children: (0, f.jsx)(eg, {}), }); }, eM = "container-fjnxdj", eC = "intelligentRecognition-VrICI9", eT = "intelligentRecognitionIcon-GhCB65", eA = i("203169"), ek = i("733437"), eP = i("134077"), eE = i("925367"), eD = i("246940"), eR = i("44938"), eN = i("287967"), eL = () => { var e, { modeInstancesRef: t } = (0, y.useContext)(eN.S); return { paintModeInstance: null === (e = t.current) || void 0 === e ? void 0 : e.get(l.UI.BgPaint), }; }, ej = i("749623"), eO = i("934128"), eB = () => { var e; return null !== (e = (0, eO.m)(et, "scale")) && void 0 !== e ? e : es.hv; }, eF = i("106456"), eU = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return t ? e === eE.o4.Brush ? eu.BrushSlider : eu.EraserSlider : e === eE.o4.Brush ? eu.Brush : eu.Eraser; }, eG = () => { var e, t = (0, D.lS)(), { paintModeInstance: i } = eL(), n = ep.o.getGraphicToolStoreInstance(t), r = null == n ? void 0 : n.bgPaintInstance, { drawAction: a = eE.o4.Brush, brushSize: o = eP.Cg[eE.o4.Brush], eraserSize: s = eP.Cg[eE.o4.Eraser], } = null !== (e = (0, ek.k)(null == n ? void 0 : n.bgPaintInstance, (e) => ({ drawAction: null == e ? void 0 : e.drawAction, brushSize: null == e ? void 0 : e.brushSize, eraserSize: null == e ? void 0 : e.eraserSize, }))) && void 0 !== e ? e : {}, l = ex(); (0, y.useEffect)(() => { null == i || i.onPaintAction((e) => { var { action: t } = e; l(t !== ej.T.StartPaint); }); }, [i]); var c = eB(), d = (e, t) => { if (!Array.isArray(e)) { var i = { [eE.o4.Brush]: e, [eE.o4.Eraser]: e }; eD.T.setItem(eR.u.bgPaintBrushSize, JSON.stringify(i)), null == r || r.updateBrushSize(e), null == r || r.updateEraserSize(e); } }, u = (e) => { null == r || r.updateDrawAction(e), null == i || i.updateMousePosition({ offsetX: "50%", offsetY: "50%" }), eh(t, { action: ed.Click, item: eU(e) }); }, f = (e) => { var i, r, a, { action: o } = e, s = null == n ? void 0 : null === (i = n.bgPaintInstance) || void 0 === i ? void 0 : i.drawAction; o === ej.T.EndPaint && [eE.o4.Brush, eE.o4.Eraser].includes( null != s ? s : eE.o4.Move ) && eh(t, { action: ed.Use, item: eU( null !== (a = null == n ? void 0 : null === (r = n.bgPaintInstance) || void 0 === r ? void 0 : r.drawAction) && void 0 !== a ? a : eE.o4.Brush ), }); }, h = () => { var e = (0, eF.sd)((0, eP.Ek)()); null == r || r.updateBrushSize(e[eE.o4.Brush]), null == r || r.updateEraserSize(e[eE.o4.Eraser]), null == i || i.onPaintAction(f); }; (0, y.useEffect)(() => { h(); }, []), (0, y.useEffect)(() => { null == i || i.onPaintAction(f); }, [i]), (0, y.useEffect)(() => { if (a === eE.o4.Brush) { var e = (0, eP.rW)(o, c); null == i || i.brush.changeBrushSize(e); } if (a === eE.o4.Eraser) { var t = (0, eP.rW)(s, c); null == i || i.brush.changeBrushSize(t); } }, [s, o, a, i, c]), (0, y.useEffect)(() => { if (!!i && !![eE.o4.Brush, eE.o4.Eraser].includes(a)) i.updateDrawAction(a); }, [a, i]); var p = () => { null == i || i.clearCanvas(!0), eh(t, { action: ed.Click, item: eu.AIIdentification }); }; return { paintModeInstance: i, drawAction: a, brushSize: o, eraserSize: s, onChangeBrushSize: d, switchDrawAction: u, onClickReset: p, onAfterChange: (e, i) => { if (!Array.isArray(e)) eh(t, { action: ed.Click, item: eU(i, !0), value: e.toString(), }); }, }; }, ez = i("81372"), eV = i("345720"), eW = (e) => ( ei.on("status", e), () => { ei.off("status", e); } ), eZ = (e) => { var t, { className: i } = e, n = (0, y.useSyncExternalStore)(eW, ei.getSnapshot.bind(ei)), r = (0, D.lS)(), a = ep.o.getGraphicToolStoreInstance(r), o = null == a ? void 0 : a.bgPaintInstance, { paintModeInstance: s } = eL(), { drawAction: l = eE.o4.Brush } = null !== (t = (0, ek.k)(o, (e) => ({ drawAction: null == e ? void 0 : e.drawAction, }))) && void 0 !== t ? t : {}; (0, y.useEffect)(() => { l !== eE.o4.Move && ei.changeStatus(eV.L.Disable); }, [l]), (0, y.useEffect)(() => { n === eV.L.Active && (null == o || o.updateDrawAction(eE.o4.Move)), [eV.L.Active, eV.L.Advent].includes(n) && (null == s || s.updateMousePosition({ offsetX: "-9999px", offsetY: "-9999px", })); }, [n, o, s]); var c = () => { eh(r, { action: ed.Click, item: eu.MoveCanvas }), eV.L.Active === n ? ei.changeStatus(eV.L.Disable) : ei.changeStatus(eV.L.Active); }; return (0, f.jsx)("div", { className: i, children: (0, f.jsx)(ez.c, { dragActive: n === eV.L.Active, handleClickMove: c, }), }); }, eK = "active-u0iotg", eH = "item-MF3P2V", eq = i("533278"), eJ = i("105789"), eY = i.n(eJ), eQ = (e) => { var { onClick: t, isActive: i } = e; return (0, f.jsx)("div", { onClick: t, children: (0, f.jsx)(eq.z, { tips: u.oc.t("canvas_tool_select", {}, "Select"), className: eY()({ [eH]: !0, [eK]: i }), icon: (0, f.jsx)(p.Q_Q, { style: { fontSize: "16px" } }), }), }); }, eX = (e) => { var t, { className: i } = e, n = (0, D.lS)(), r = ep.o.getGraphicToolStoreInstance(n), a = null == r ? void 0 : r.bgPaintInstance, { paintModeInstance: o } = eL(), { drawAction: s = eE.o4.Brush, isSelectActive: l = !1 } = null !== (t = (0, ek.k)(a, (e) => ({ drawAction: null == e ? void 0 : e.drawAction, isSelectActive: null == e ? void 0 : e.isSelectActive, }))) && void 0 !== t ? t : {}; (0, y.useEffect)(() => { if (!!l) null == o || o.updateMousePosition({ offsetX: "-9999px", offsetY: "-9999px", }); }, [l]), (0, y.useEffect)(() => { s !== eE.o4.Select && (null == a || a.updateIsSelectActive(!1), null == a || a.updateIsSelectImage(!1)); }, [s, a]), (0, y.useEffect)(() => { null == a || a.updateDrawAction(eE.o4.Select), null == a || a.updateIsSelectActive(!0), null == a || a.updateIsSelectImage(!0); }, []); var c = () => { if ((eh(n, { action: ed.Click, item: eu.MoveLayer }), !l)) null == a || a.updateIsSelectActive(!0), null == a || a.updateIsSelectImage(!0), null == a || a.updateDrawAction(eE.o4.Select); }; return (0, f.jsx)("div", { className: i, children: (0, f.jsx)(eQ, { onClick: c, isActive: l }), }); }, e$ = { top: "-40px", left: "-72px", borderRadius: "8px", border: "0.5px solid var(--line-2)", }, e0 = { top: "-40px", left: "-108px", borderRadius: "8px", border: "0.5px solid var(--line-2)", }, e1 = (e) => { var { hiddenSelect: t, hiddenDrag: i } = e, { paintModeInstance: n, drawAction: a, brushSize: o, eraserSize: s, onChangeBrushSize: l, switchDrawAction: c, onClickReset: d, onAfterChange: h, } = eG(); return (0, f.jsxs)("div", { className: eM, children: [ !t && (0, f.jsx)(eX, {}), (0, f.jsx)(eq.z, { tips: u.oc.t("wimg2img_content_intelligent", {}, "Quick brush"), className: eC, icon: (0, f.jsx)(p.g$j, { onClick: d, className: eT }), }), (0, f.jsx)(eA.E, { brushConfig: { contentStyle: (0, r._)({}, e$), isActive: a === eE.o4.Brush, size: o, onChange: (e) => { l(e, eE.o4.Brush); }, onClick: () => c(eE.o4.Brush), onAfterChange: (e) => { l(e, eE.o4.Brush), h(e, eE.o4.Brush), null == n || n.updateMousePosition({ offsetX: "50%", offsetY: "50%", }); }, }, eraserConfig: { contentStyle: (0, r._)({}, e0), isActive: a === eE.o4.Eraser, size: s, onChange: (e) => { l(e, eE.o4.Eraser); }, onClick: () => c(eE.o4.Eraser), onAfterChange: (e) => { l(e, eE.o4.Eraser), h(e, eE.o4.Eraser), null == n || n.updateMousePosition({ offsetX: "50%", offsetY: "50%", }); }, }, }), !i && (0, f.jsx)(eZ, {}), ], }); }, e2 = "container-hF38_1", e6 = "divider-Y81pOK", e4 = i("711063"), e3 = "container-NccYOa", e8 = () => { var [e, t] = (0, y.useState)(!0), [i, n] = (0, y.useState)(!0), r = (0, D.lS)(), { paintModeInstance: a } = eL(); (0, y.useEffect)(() => { if (!!a) a.onCommandMangerModel("redoStack", (e) => { n(0 === e.length); }), a.onCommandMangerModel("undoStack", (e) => { t(0 === e.length); }); }, [a]), (0, y.useEffect)(() => { if (!!a) { var { redoStack: e, undoStack: i } = a.getCommandData(); n(0 === e.length), t(0 === i.length); } }, [a]); var o = () => { null == a || a.undo(), eh(r, { action: ed.Click, item: eu.Undo }); }, s = () => { null == a || a.redo(), eh(r, { action: ed.Click, item: eu.Redo }); }, l = { undo: e, redo: i }; return (0, f.jsx)("div", { className: e3, children: (0, f.jsx)(e4.$, { isLimit: l, handleUndo: o, handleRedo: s, }), }); }, e9 = (e) => { var t = ew(); return (0, f.jsxs)("div", { className: e2, style: t ? {} : { display: "none" }, children: [ (0, f.jsx)(e1, (0, r._)({}, e)), (0, f.jsx)("div", { className: e6 }), (0, f.jsx)(e8, {}), ], }); }, e5 = i("387008"), e7 = "container-gN_DC9", te = "svg-fXGz0S", tt = () => (0, f.jsxs)("div", { className: e7, children: [ (0, f.jsx)(p.C5$, { className: te }), (0, f.jsx)("div", { children: u.oc.t( "wimg2img_content_smear", {}, "Brush an object to select it" ), }), ], }), ti = i("489897"); function tn() { var e, t = (0, D.lS)(), i = ep.o.getGraphicToolStoreInstance(t), n = null == i ? void 0 : i.bgPaintInstance, { moveX: r = 0, moveY: a = 0, scale: o = 1, rotate: s = 0, } = null !== (e = (0, ek.k)(n, (e) => ({ moveX: e.moveX, moveY: e.moveY, scale: e.scale, rotate: e.rotate, }))) && void 0 !== e ? e : {}; return { moveX: r, moveY: a, scale: o, rotate: s }; } var tr = (e) => ( ei.on("move", e), () => { ei.off("move", e); } ); function ta() { var e = (0, y.useSyncExternalStore)( tr, ei.getMoveDataSnapshot.bind(ei) ); try { return Object.assign({ x: 0, y: 0 }, JSON.parse(e)); } catch (e) { return { x: 0, y: 0 }; } } function to(e) { var { containerWidth: t, containerHeight: i, paintWidth: n, paintHeight: r, imageWidth: a, imageHeight: o, } = e, { moveX: s, moveY: l, rotate: c, scale: d } = tn(), { x: u, y: f } = ta(), h = Math.abs(eB()), p = d * h, v = a * p, m = o * p, g = (t - n * h) / 2, _ = (i - r * h) / 2, b = g + u * h + (s * h - v / 2), I = _ + f * h + (l * h - m / 2); return { scale: p, frameSize: (0, y.useMemo)(() => ({ width: v, height: m }), [v, m]), framePosition: { width: "".concat(a * p, "px"), height: "".concat(o * p, "px"), transform: "translate(" .concat(b, "px, ") .concat(I, "px) rotate(") .concat(c, "deg)"), }, }; } var ts = (function (e) { return ( (e.TopLeft = "tl"), (e.TopRight = "tr"), (e.BottomLeft = "bl"), (e.BottomRight = "br"), e ); })({}), tl = (function (e) { return ( (e.Top = "top"), (e.Right = "right"), (e.Bottom = "bottom"), (e.Left = "left"), e ); })({}), tc = i("96"), td = "rotateButton-oiaxuO", tu = "icon-IzRaac", tf = "exposeSpot-AedSbq", th = "rotateButtonActive-rgV_aO", tp = "top-Tn_XKb", tv = "right-CRPYq8", tm = "bottom-vuYJQz", tg = "left-NBYaup", t_ = "iconActive-OR038l"; function ty(e, t, i, n) { var r = [0, 0], a = [0, 0], { x: o, y: s } = e, { x: l, y: c } = t, { x: d, y: u } = i; (r[0] = l - o), (r[1] = c - s), (a[0] = d - o), (a[1] = u - s); var f = r[0] * a[1] - r[1] * a[0], h = Math.sqrt(Math.pow(o - l, 2) + Math.pow(s - c, 2)), p = Math.sqrt(Math.pow(o - d, 2) + Math.pow(s - u, 2)), v = (Math.pow(h, 2) + Math.pow(p, 2) - Math.pow(Math.sqrt(Math.pow(l - d, 2) + Math.pow(c - u, 2)), 2)) / (2 * h * p), m = n ? Math.acos(v) : (180 * Math.acos(v)) / Math.PI; return f < 0 ? -m : m; } var tb = i("476295"), tI = (function (e) { return ( (e[(e.Hidden = 0)] = "Hidden"), (e[(e.Active = 1)] = "Active"), (e[(e.Initial = 2)] = "Initial"), e ); })({}); function tw(e) { var t, i = ev(), n = null !== (t = (0, ek.k)(i, (e) => e.transformType)) && void 0 !== t ? t : tb.OS.None, [r, a] = (0, y.useState)(!1), o = 2; return ( r && n === e ? (o = 1) : n !== tb.OS.None && (o = 0), { status: o, setActive: a } ); } function tx(e, t) { var { x: i, y: n } = e; return [ i * Math.cos(t) + n * Math.sin(t), -i * Math.sin(t) + n * Math.cos(t), ]; } function tS(e, t, i, n) { var r = (e / 180) * Math.PI, a = tx({ x: t / 2, y: i / 2 }, r), o = tx({ x: t / 2, y: -i / 2 }, r), s = tx({ x: -t / 2, y: -i / 2 }, r), l = tx({ x: -t / 2, y: i / 2 }, r), { x: c, y: d } = n; return { [ts.TopLeft]: { x: l[0] + c, y: -(l[1] - d) }, [ts.TopRight]: { x: a[0] + c, y: -(a[1] - d) }, [ts.BottomRight]: { x: o[0] + c, y: -(o[1] - d) }, [ts.BottomLeft]: { x: s[0] + c, y: -(s[1] - d) }, }; } function tM(e, t, i, n) { var r = (e / 180) * Math.PI, a = tx({ x: t / 2, y: i / 2 }, r), o = tx({ x: t / 2, y: -i / 2 }, r), s = tx({ x: -t / 2, y: -i / 2 }, r), l = tx({ x: -t / 2, y: i / 2 }, r), { x: c, y: d } = n; return { [ts.TopLeft]: { x: c - l[0], y: d + l[1] }, [ts.TopRight]: { x: c - a[0], y: d + a[1] }, [ts.BottomRight]: { x: c - o[0], y: d + o[1] }, [ts.BottomLeft]: { x: c - s[0], y: d + s[1] }, }; } function tC(e, t) { var { x: i, y: n } = e, { x: r, y: a } = t, o = i < r, s = n < a; if (o && s) return ts.TopLeft; if (o && !s) return ts.BottomLeft; if (!o && s) return ts.TopRight; else return ts.BottomRight; } function tT(e, t, i, n, r) { var [a, o] = { [tl.Top]: [ts.TopLeft, ts.TopRight], [tl.Right]: [ts.TopRight, ts.BottomRight], [tl.Bottom]: [ts.BottomRight, ts.BottomLeft], [tl.Left]: [ts.BottomLeft, ts.TopLeft], }[e], s = tS(t, i, n, r), l = s[a], c = s[o], d = tC(l, r), u = tC(c, r); if (d === ts.TopLeft && u === ts.TopRight) return tl.Top; if (d === ts.TopRight && u === ts.BottomRight) return tl.Right; if (d === ts.BottomRight && u === ts.BottomLeft) return tl.Bottom; else return tl.Left; } var tA = (0, y.createContext)({ width: 0, height: 0 }); function tk() { return (0, y.useContext)(tA); } var [tP, tE, tD] = eb({ x: 0, y: 0 }), tR = { [tl.Top]: tb.HK.RotateTop, [tl.Right]: tb.HK.RotateRight, [tl.Bottom]: tb.HK.RotateBottom, [tl.Left]: tb.HK.RotateLeft, }; function tN(e, t) { var i, n = ev(), { status: r, setActive: a } = tw(tb.OS.Rotate), { width: o, height: s } = tk(), l = ex(), c = tD(), { rotate: d = 0, moveX: u = 0, moveY: f = 0, } = null !== (i = (0, ek.k)(n, (e) => ({ rotate: e.rotate, moveX: e.moveX, moveY: e.moveY, }))) && void 0 !== i ? i : {}; return { status: r, startRotate: (i) => { if (!!t) { var { top: r, left: h } = t.getBoundingClientRect(), p = { x: i.pageX, y: i.pageY }, v = { x: h, y: r }, m = tR[tT(e, d, o, s, { x: u, y: f })]; l(!1), a(!0), null == n || n.updateTransformType(tb.OS.Rotate), null == n || n.updateActionCursor(m), c({ x: i.pageX, y: i.pageY }); var g = d, _ = (e) => { var { pageX: t, pageY: i } = e, r = (g + ty(v, p, { x: t, y: i }, !1) + 360) % 360; null == n || n.updateRotate(r), c({ x: t, y: i }); }, y = (e) => { window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", y), a(!1), l(!0), null == n || n.resetTransformType(), null == n || n.resetActionCursor(); }; window.addEventListener("mousemove", _), window.addEventListener("mouseup", y); } }, }; } function tL(e) { var t, { width: i, height: n } = tk(), r = ev(), { moveX: a = 0, moveY: o = 0, rotate: s = 0, } = null !== (t = (0, ek.k)(r, (e) => ({ moveX: e.moveX, moveY: e.moveY, rotate: e.rotate, }))) && void 0 !== t ? t : {}; return tT(e, s, i, n, { x: a, y: o }); } var tj = (function (e) { return (e.Move = "move"), (e.Zoom = "zoom"), (e.Rotate = "rotate"), e; })({}); class tO { getEventParams() { return { action: this._params.action }; } constructor(e) { (this._params = e), (this.eventName = "reference_subject_layer_action"); } } function tB(e, t) { (0, N.Kl)(e, tO, [t]); } var tF = (0, y.forwardRef)((e, t) => { var { isActive: i, sideDirection: n, style: o, centerRef: s } = e, l = (0, tc._)(e, [ "isActive", "sideDirection", "style", "centerRef", ]), c = (0, D.lS)(), { status: d, startRotate: u } = tN(n, s.current), h = tL(n), v = { [tl.Top]: 0, [tl.Right]: 90, [tl.Bottom]: 180, [tl.Left]: 270, }[n], m = eY()(tu, { [t_]: d === tI.Active }), g = i && (d === tI.Initial || d === tI.Active), _ = eY()( td, { [th]: g }, { [tl.Top]: tp, [tl.Right]: tv, [tl.Bottom]: tm, [tl.Left]: tg }[ h ] ), y = [tl.Left, tl.Right].includes(n), b = (e) => { e.stopPropagation(), tB(c, { action: tj.Rotate }), u(e); }; return (0, f.jsxs)( "div", (0, a._)((0, r._)({}, l), { style: (0, a._)((0, r._)({}, o), { transform: "" .concat( y ? "translateY(-50%)" : "translateX(-50%)", " rotate(" ) .concat(v, "deg)"), }), className: _, children: [ (0, f.jsx)("div", { className: m, onMouseDown: b, children: (0, f.jsx)(p.LIe, { fontSize: 16, style: { transform: "rotate(".concat(-v, "deg)") }, }), }), (0, f.jsx)("span", { className: tf, ref: t }), ], }) ); }), tU = i("528498"); function tG() { var e, { elementRef: t, isIntersecting: i, observe: n, unobserve: r, } = (0, tU.uy)(), a = ev(), o = null !== (e = (0, ek.k)(a, (e) => e.isTransforming)) && void 0 !== e && e; return ( (0, y.useEffect)(() => { if (!o) { n(); return; } r(); }, [o]), [t, i] ); } function tz() { var e, t = ev(), { moveX: i = 0, moveY: n = 0, rotate: r = 0, } = null !== (e = (0, ek.k)(t, (e) => ({ moveX: e.moveX, moveY: e.moveY, rotate: e.rotate, }))) && void 0 !== e ? e : {}, { width: a, height: o } = tk(), s = tT(tl.Top, r, a, o, { x: i, y: n }), l = tT(tl.Right, r, a, o, { x: i, y: n }), c = tT(tl.Left, r, a, o, { x: n, y: n }), d = tT(tl.Bottom, r, a, o, { x: n, y: n }), u = { [s]: tl.Top, [l]: tl.Right, [d]: tl.Bottom, [c]: tl.Left }; return [u[tl.Top], u[tl.Right], u[tl.Bottom], u[tl.Left]]; } function tV(e, t) { var [i, n] = (0, y.useState)(e); return ( (0, y.useEffect)(() => { t && n(e); }, [t]), i ); } function tW(e, t) { var i = t.map((t) => e[t]), n = t.findIndex((e, t) => i[t]); return n < 0 ? null : t[n]; } function tZ(e) { var t, { top: i, right: n, bottom: r, left: a } = e, o = ev(), s = null !== (t = (0, ek.k)(o, (e) => e.isTransforming)) && void 0 !== t && t, l = tV(tz(), !s); return tW( { [tl.Top]: i, [tl.Right]: n, [tl.Bottom]: r, [tl.Left]: a }, l ); } i("894672"); var tK = i("274993"), tH = "tip-hjhz_z", tq = "pointer-gBEBT6", tJ = i("717742"), tY = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHZpZXdCb3g9IjAgMCAyOCAyOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF82MjgxXzcyOTgpIj4KPHBhdGggZD0iTTkuMjk3NzEgMTAuNjQxMkM5LjkxNTIyIDEwLjAyMzcgMTAuNjQ4MyA5LjUzMzkgMTEuNDU1MSA5LjE5OTdDMTIuMjYxOSA4Ljg2NTUxIDEzLjEyNjcgOC42OTM1IDE0IDguNjkzNUMxNC44NzMzIDguNjkzNSAxNS43MzggOC44NjU1MSAxNi41NDQ4IDkuMTk5N0MxNy4zNTE2IDkuNTMzOSAxOC4wODQ3IDEwLjAyMzcgMTguNzAyMiAxMC42NDEyTDIwLjcxNzUgMTIuNjU2NUwyMy40MDQ1IDkuOTY5NDlWMTguMDMwNUwxNS4zNDM1IDE4LjAzMDVMMTguMDMwNSAxNS4zNDM1TDE2LjAxNTIgMTMuMzI4MkMxNS43NTA2IDEzLjA2MzYgMTUuNDM2NCAxMi44NTM3IDE1LjA5MDYgMTIuNzEwNEMxNC43NDQ4IDEyLjU2NzIgMTQuMzc0MiAxMi40OTM1IDE0IDEyLjQ5MzVDMTMuNjI1NyAxMi40OTM1IDEzLjI1NTEgMTIuNTY3MiAxMi45MDkzIDEyLjcxMDRDMTIuNTYzNSAxMi44NTM3IDEyLjI0OTQgMTMuMDYzNiAxMS45ODQ3IDEzLjMyODJMOS45Njk0NiAxNS4zNDM1TDEyLjY1NjUgMTguMDMwNUg0LjU5NTQ1VjkuOTY5NDlMNy4yODI0NiAxMi42NTY1TDkuMjk3NzEgMTAuNjQxMloiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMS4zMTM1IDEyLjY1NTZMOC42MjY0NSAxNS4zNDI2TDEwLjMwNTggMTcuMDIySDUuNjAzNTdMNS42MDM1NyAxMi4zMTk4TDcuMjgyOTUgMTMuOTk5MUw5Ljk2OTk1IDExLjMxMjFDMTAuNDk5MiAxMC43ODI4IDExLjEyNzYgMTAuMzYzIDExLjgxOTIgMTAuMDc2NUMxMi41MTA3IDkuNzkwMDggMTMuMjUxOSA5LjY0MjY1IDE0LjAwMDUgOS42NDI2NUMxNC43NDkgOS42NDI2NSAxNS40OTAyIDkuNzkwMDggMTYuMTgxOCAxMC4wNzY1QzE2Ljg3MzMgMTAuMzYzIDE3LjUwMTcgMTAuNzgyOCAxOC4wMzEgMTEuMzEyMUwyMC43MTggMTMuOTk5MUwyMi4zOTc0IDEyLjMxOThMMjIuMzk3NCAxNy4wMjJIMTcuNjk1MUwxOS4zNzQ1IDE1LjM0MjZMMTYuNjg3NSAxMi42NTU2QzE2LjMzNDYgMTIuMzAyOCAxNS45MTU3IDEyLjAyMjkgMTUuNDU0NyAxMS44MzE5QzE0Ljk5MzYgMTEuNjQwOSAxNC40OTk1IDExLjU0MjYgMTQuMDAwNSAxMS41NDI2QzEzLjUwMTQgMTEuNTQyNiAxMy4wMDczIDExLjY0MDkgMTIuNTQ2MyAxMS44MzE5QzEyLjA4NTIgMTIuMDIyOSAxMS42NjYzIDEyLjMwMjggMTEuMzEzNSAxMi42NTU2WiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzYyODFfNzI5OCIgeD0iMi43NDUxIiB5PSI3Ljg3MTA5IiB3aWR0aD0iMjIuNTA5MyIgaGVpZ2h0PSIxMy4wMzcxIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHk9IjEuMDI3ODQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMC45MjUwNTYiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuNjUgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd182MjgxXzcyOTgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfNjI4MV83Mjk4IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=", tQ = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHZpZXdCb3g9IjAgMCAyOCAyOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF82MjgxXzcyNzEpIj4KPHBhdGggZD0iTTE3LjM1ODggOS4yOTc3MUMxNy45NzYzIDkuOTE1MjIgMTguNDY2MSAxMC42NDgzIDE4LjgwMDMgMTEuNDU1MUMxOS4xMzQ1IDEyLjI2MTkgMTkuMzA2NSAxMy4xMjY3IDE5LjMwNjUgMTRDMTkuMzA2NSAxNC44NzMzIDE5LjEzNDUgMTUuNzM4IDE4LjgwMDMgMTYuNTQ0OEMxOC40NjYxIDE3LjM1MTYgMTcuOTc2MyAxOC4wODQ3IDE3LjM1ODggMTguNzAyMkwxNS4zNDM1IDIwLjcxNzVMMTguMDMwNSAyMy40MDQ1TDkuOTY5NDkgMjMuNDA0NUw5Ljk2OTQ5IDE1LjM0MzVMMTIuNjU2NSAxOC4wMzA1TDE0LjY3MTggMTYuMDE1MkMxNC45MzY0IDE1Ljc1MDYgMTUuMTQ2MyAxNS40MzY0IDE1LjI4OTYgMTUuMDkwNkMxNS40MzI4IDE0Ljc0NDggMTUuNTA2NSAxNC4zNzQyIDE1LjUwNjUgMTRDMTUuNTA2NSAxMy42MjU3IDE1LjQzMjggMTMuMjU1MSAxNS4yODk2IDEyLjkwOTNDMTUuMTQ2MyAxMi41NjM1IDE0LjkzNjQgMTIuMjQ5NCAxNC42NzE4IDExLjk4NDdMMTIuNjU2NSA5Ljk2OTQ2TDkuOTY5NDkgMTIuNjU2NUw5Ljk2OTQ5IDQuNTk1NDVMMTguMDMwNSA0LjU5NTQ1TDE1LjM0MzUgNy4yODI0NkwxNy4zNTg4IDkuMjk3NzFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTUuMzQ0NCAxMS4zMTM1TDEyLjY1NzMgOC42MjY0NUwxMC45NzggMTAuMzA1OEwxMC45NzggNS42MDM1N0wxNS42ODAyIDUuNjAzNTdMMTQuMDAwOSA3LjI4Mjk1TDE2LjY4NzkgOS45Njk5NkMxNy4yMTcyIDEwLjQ5OTIgMTcuNjM3IDExLjEyNzYgMTcuOTIzNSAxMS44MTkyQzE4LjIwOTkgMTIuNTEwNyAxOC4zNTc0IDEzLjI1MTkgMTguMzU3NCAxNC4wMDA1QzE4LjM1NzQgMTQuNzQ5IDE4LjIwOTkgMTUuNDkwMiAxNy45MjM1IDE2LjE4MThDMTcuNjM3IDE2Ljg3MzMgMTcuMjE3MiAxNy41MDE3IDE2LjY4NzkgMTguMDMxTDE0LjAwMDkgMjAuNzE4TDE1LjY4MDIgMjIuMzk3NEwxMC45NzggMjIuMzk3NEwxMC45NzggMTcuNjk1MUwxMi42NTc0IDE5LjM3NDVMMTUuMzQ0NCAxNi42ODc1QzE1LjY5NzIgMTYuMzM0NiAxNS45NzcxIDE1LjkxNTcgMTYuMTY4MSAxNS40NTQ3QzE2LjM1OTEgMTQuOTkzNiAxNi40NTc0IDE0LjQ5OTUgMTYuNDU3NCAxNC4wMDA1QzE2LjQ1NzQgMTMuNTAxNCAxNi4zNTkxIDEzLjAwNzMgMTYuMTY4MSAxMi41NDYzQzE1Ljk3NzEgMTIuMDg1MiAxNS42OTcyIDExLjY2NjMgMTUuMzQ0NCAxMS4zMTM1WiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzYyODFfNzI3MSIgeD0iOC4xMTk2MSIgeT0iMy43NzI5NCIgd2lkdGg9IjEzLjAzNzEiIGhlaWdodD0iMjIuNTA5MyIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0IGR5PSIxLjAyNzg0Ii8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjAuOTI1MDU2Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjY1IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNjI4MV83MjcxIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzYyODFfNzI3MSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K", tX = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHZpZXdCb3g9IjAgMCAyOCAyOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF82MjgxXzcyMzEpIj4KPHBhdGggZD0iTTE4LjcwMjMgMTcuMzU4OEMxOC4wODQ4IDE3Ljk3NjMgMTcuMzUxNyAxOC40NjYxIDE2LjU0NDkgMTguODAwM0MxNS43MzgxIDE5LjEzNDUgMTQuODczMyAxOS4zMDY1IDE0IDE5LjMwNjVDMTMuMTI2NyAxOS4zMDY1IDEyLjI2MiAxOS4xMzQ1IDExLjQ1NTIgMTguODAwM0MxMC42NDg0IDE4LjQ2NjEgOS45MTUyOCAxNy45NzYzIDkuMjk3NzcgMTcuMzU4OEw3LjI4MjUyIDE1LjM0MzVMNC41OTU1MSAxOC4wMzA1TDQuNTk1NTEgOS45Njk0OUwxMi42NTY1IDkuOTY5NDlMOS45Njk1MiAxMi42NTY1TDExLjk4NDggMTQuNjcxOEMxMi4yNDk0IDE0LjkzNjQgMTIuNTYzNiAxNS4xNDYzIDEyLjkwOTQgMTUuMjg5NkMxMy4yNTUyIDE1LjQzMjggMTMuNjI1OCAxNS41MDY1IDE0IDE1LjUwNjVDMTQuMzc0MyAxNS41MDY1IDE0Ljc0NDkgMTUuNDMyOCAxNS4wOTA3IDE1LjI4OTZDMTUuNDM2NSAxNS4xNDYzIDE1Ljc1MDYgMTQuOTM2NCAxNi4wMTUzIDE0LjY3MTdMMTguMDMwNSAxMi42NTY1TDE1LjM0MzUgOS45Njk0OUwyMy40MDQ2IDkuOTY5NDlMMjMuNDA0NSAxOC4wMzA1TDIwLjcxNzUgMTUuMzQzNUwxOC43MDIzIDE3LjM1ODhaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTYuNjg2NSAxNS4zNDQ0TDE5LjM3MzUgMTIuNjU3M0wxNy42OTQyIDEwLjk3OEwyMi4zOTY0IDEwLjk3OEwyMi4zOTY0IDE1LjY4MDJMMjAuNzE3MSAxNC4wMDA5TDE4LjAzIDE2LjY4NzlDMTcuNTAwOCAxNy4yMTcyIDE2Ljg3MjQgMTcuNjM3IDE2LjE4MDggMTcuOTIzNUMxNS40ODkzIDE4LjIwOTkgMTQuNzQ4MSAxOC4zNTc0IDEzLjk5OTUgMTguMzU3NEMxMy4yNTEgMTguMzU3NCAxMi41MDk4IDE4LjIwOTkgMTEuODE4MiAxNy45MjM1QzExLjEyNjcgMTcuNjM3IDEwLjQ5ODMgMTcuMjE3MiA5Ljk2OTAyIDE2LjY4NzlMNy4yODIwMiAxNC4wMDA5TDUuNjAyNjQgMTUuNjgwMkw1LjYwMjY0IDEwLjk3OEwxMC4zMDQ5IDEwLjk3OEw4LjYyNTUyIDEyLjY1NzRMMTEuMzEyNSAxNS4zNDQ0QzExLjY2NTQgMTUuNjk3MiAxMi4wODQzIDE1Ljk3NzEgMTIuNTQ1MyAxNi4xNjgxQzEzLjAwNjQgMTYuMzU5MSAxMy41MDA1IDE2LjQ1NzQgMTMuOTk5NSAxNi40NTc0QzE0LjQ5ODYgMTYuNDU3NCAxNC45OTI3IDE2LjM1OTEgMTUuNDUzNyAxNi4xNjgxQzE1LjkxNDggMTUuOTc3MSAxNi4zMzM3IDE1LjY5NzIgMTYuNjg2NSAxNS4zNDQ0WiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzYyODFfNzIzMSIgeD0iMi43NDU1OSIgeT0iOS4xNDc0NSIgd2lkdGg9IjIyLjUwOTMiIGhlaWdodD0iMTMuMDM3MSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0IGR5PSIxLjAyNzg0Ii8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjAuOTI1MDU2Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjY1IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNjI4MV83MjMxIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzYyODFfNzIzMSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K", t$ = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIHZpZXdCb3g9IjAgMCAyOCAyOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF82MjgxXzczMjUpIj4KPHBhdGggZD0iTTEwLjY0MTIgMTguNzAyM0MxMC4wMjM3IDE4LjA4NDggOS41MzM5IDE3LjM1MTcgOS4xOTk3IDE2LjU0NDlDOC44NjU1MSAxNS43MzgxIDguNjkzNSAxNC44NzMzIDguNjkzNSAxNEM4LjY5MzUgMTMuMTI2NyA4Ljg2NTUxIDEyLjI2MiA5LjE5OTcgMTEuNDU1MkM5LjUzMzkgMTAuNjQ4NCAxMC4wMjM3IDkuOTE1MjggMTAuNjQxMiA5LjI5Nzc3TDEyLjY1NjUgNy4yODI1Mkw5Ljk2OTQ5IDQuNTk1NTFMMTguMDMwNSA0LjU5NTUxTDE4LjAzMDUgMTIuNjU2NUwxNS4zNDM1IDkuOTY5NTJMMTMuMzI4MiAxMS45ODQ4QzEzLjA2MzYgMTIuMjQ5NCAxMi44NTM3IDEyLjU2MzYgMTIuNzEwNCAxMi45MDk0QzEyLjU2NzIgMTMuMjU1MiAxMi40OTM1IDEzLjYyNTggMTIuNDkzNSAxNEMxMi40OTM1IDE0LjM3NDMgMTIuNTY3MiAxNC43NDQ5IDEyLjcxMDQgMTUuMDkwN0MxMi44NTM3IDE1LjQzNjUgMTMuMDYzNiAxNS43NTA2IDEzLjMyODIgMTYuMDE1M0wxNS4zNDM1IDE4LjAzMDVMMTguMDMwNSAxNS4zNDM1TDE4LjAzMDUgMjMuNDA0Nkw5Ljk2OTQ5IDIzLjQwNDVMMTIuNjU2NSAyMC43MTc1TDEwLjY0MTIgMTguNzAyM1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMi42NTU2IDE2LjY4NjVMMTUuMzQyNyAxOS4zNzM1TDE3LjAyMiAxNy42OTQyTDE3LjAyMiAyMi4zOTY0TDEyLjMxOTggMjIuMzk2NEwxMy45OTkxIDIwLjcxNzFMMTEuMzEyMSAxOC4wM0MxMC43ODI4IDE3LjUwMDggMTAuMzYzIDE2Ljg3MjQgMTAuMDc2NSAxNi4xODA4QzkuNzkwMDggMTUuNDg5MyA5LjY0MjY1IDE0Ljc0ODEgOS42NDI2NSAxMy45OTk1QzkuNjQyNjUgMTMuMjUxIDkuNzkwMDggMTIuNTA5OCAxMC4wNzY1IDExLjgxODJDMTAuMzYzIDExLjEyNjcgMTAuNzgyOCAxMC40OTgzIDExLjMxMjEgOS45NjkwMkwxMy45OTkxIDcuMjgyMDJMMTIuMzE5OCA1LjYwMjY0TDE3LjAyMiA1LjYwMjY0TDE3LjAyMiAxMC4zMDQ5TDE1LjM0MjYgOC42MjU1MkwxMi42NTU2IDExLjMxMjVDMTIuMzAyOCAxMS42NjU0IDEyLjAyMjkgMTIuMDg0MyAxMS44MzE5IDEyLjU0NTNDMTEuNjQwOSAxMy4wMDY0IDExLjU0MjYgMTMuNTAwNSAxMS41NDI2IDEzLjk5OTVDMTEuNTQyNiAxNC40OTg2IDExLjY0MDkgMTQuOTkyNyAxMS44MzE5IDE1LjQ1MzdDMTIuMDIyOSAxNS45MTQ4IDEyLjMwMjggMTYuMzMzNyAxMi42NTU2IDE2LjY4NjVaIiBmaWxsPSJibGFjayIvPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfNjI4MV83MzI1IiB4PSI2Ljg0MzI1IiB5PSIzLjc3MzQzIiB3aWR0aD0iMTMuMDM3MSIgaGVpZ2h0PSIyMi41MDkzIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHk9IjEuMDI3ODQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMC45MjUwNTYiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuNjUgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd182MjgxXzczMjUiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfNjI4MV83MzI1IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=", t0 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF81ODM3Xzc1ODMpIj4KPHBhdGggZD0iTTkuMjQgMTIuMDdMMTMuMzEgMTYuMTRMMTAuNDkgMTguOTdMMTguOTYgMTguOTVMMTguOTcgMTAuNDhMMTYuMTMgMTMuMzJMMTIuMDYgOS4yNkwxMC42NCA3Ljg0TDEzLjQ5IDVINVYxMy40OEw3LjgzIDEwLjY2TDkuMjQgMTIuMDdaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTAuMyAxMS43MkwxNC43MyAxNi4xNEwxMi45IDE3Ljk3TDE3Ljk2IDE3Ljk1TDE3Ljk3IDEyLjlMMTYuMTMgMTQuNzRMMTEuNyAxMC4zMkw5LjIzIDcuODRMMTEuMDcgNkg2VjExLjA3TDcuODMgOS4yNEwxMC4zIDExLjcyWiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzU4MzdfNzU4MyIgeD0iMy4yIiB5PSI0LjIiIHdpZHRoPSIxNy41NyIgaGVpZ2h0PSIxNy41NyIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0IGR5PSIxIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjAuOSIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC42NSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzU4MzdfNzU4MyIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd181ODM3Xzc1ODMiIHJlc3VsdD0ic2hhcGUiLz4KPC9maWx0ZXI+CjwvZGVmcz4KPC9zdmc+Cg==", t1 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF81ODMzXzI5NzM4KSI+CjxwYXRoIGQ9Ik0xNC43MyAxMi4wN0wxMC42NiAxNi4xNEwxMy40OSAxOC45N0w1LjAxIDE4Ljk1TDUgMTAuNDhMNy44NCAxMy4zMkwxMS45MiA5LjI2TDEzLjMzIDcuODRMMTAuNDkgNUgxOC45N1YxMy40OEwxNi4xNCAxMC42NkwxNC43MyAxMi4wN1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMy42NyAxMS43Mkw5LjI0IDE2LjE0TDExLjA3IDE3Ljk3TDYuMDEgMTcuOTVMNiAxMi45TDcuODQgMTQuNzRMMTIuMjcgMTAuMzJMMTQuNzQgNy44NEwxMi45IDZIMTcuOTdWMTEuMDdMMTYuMTQgOS4yNEwxMy42NyAxMS43MloiIGZpbGw9ImJsYWNrIi8+CjwvZz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZF81ODMzXzI5NzM4IiB4PSIzLjIiIHk9IjQuMiIgd2lkdGg9IjE3LjU3IiBoZWlnaHQ9IjE3LjU3IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHk9IjEiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMC45Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjY1IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNTgzM18yOTczOCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd181ODMzXzI5NzM4IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo="; function t2(e) { return "url(".concat(e, ") 12 12, pointer"); } var t6 = { [tb.HK.Default]: "default", [tb.HK.ResizeTopLeftToBottomRight]: t2(t0), [tb.HK.ResizeTopRightToBottomLeft]: t2(t1), [tb.HK.Move]: "move", [tb.HK.RotateTop]: t2(tY), [tb.HK.RotateRight]: t2(tQ), [tb.HK.RotateBottom]: t2(tX), [tb.HK.RotateLeft]: t2(t$), }; function t4(e) { return t6[e]; } function t3() { var e, { x: t, y: i } = tE(), n = ev(), { rotate: r = 0, transformType: a = tb.OS.None, actionCursor: o = tb.HK.Default, } = null !== (e = (0, ek.k)(n, (e) => ({ transformType: e.transformType, rotate: e.rotate, actionCursor: e.actionCursor, }))) && void 0 !== e ? e : {}, s = (360 + (0, tJ.c)(r, 0)) % 360, l = a === tb.OS.Rotate, c = () => document.body; return l ? (0, f.jsx)(tK.Z, { content: "".concat(s, "\xb0"), className: tH, position: "bl", popupVisible: l, getPopupContainer: c, children: (0, f.jsx)("span", { className: tq, style: { left: t, top: i, cursor: t4(o) }, }), }) : null; } var t8 = i("195291"), t9 = "center-RQTcHW", t5 = -44, t7 = () => { var e = (0, y.useRef)(null), [t, i] = tG(), [n, r] = tG(), [a, o] = tG(), [s, l] = tG(), c = tZ({ top: i, right: r, bottom: o, left: l }); return (0, f.jsxs)(tP, { children: [ (0, f.jsx)(tF, { ref: t, isActive: c === tl.Top, sideDirection: tl.Top, style: { top: t5, left: "50%" }, centerRef: e, }), (0, f.jsx)(tF, { ref: n, isActive: c === tl.Right, sideDirection: tl.Right, style: { right: t5, top: "50%" }, centerRef: e, }), (0, f.jsx)(tF, { ref: a, isActive: c === tl.Bottom, sideDirection: tl.Bottom, style: { bottom: t5, left: "50%" }, centerRef: e, }), (0, f.jsx)(tF, { ref: s, isActive: c === tl.Left, sideDirection: tl.Left, style: { left: t5, top: "50%" }, centerRef: e, }), (0, f.jsx)("span", { ref: e, className: t9 }), (0, t8.createPortal)((0, f.jsx)(t3, {}), document.body), ], }); }, ie = "borderButton-l7_lIL", it = "borderButtonTl-iNv8ma", ii = "borderButtonTr-K6lQb8", ir = "borderButtonBr-khmeU_", ia = "borderButtonBl-T9HIwE", io = "borderButtonHidden-XFItdP", is = "borderButtonActive-QTlFFu", il = "circle-yvZCCf", ic = (0, y.createContext)({ width: 0, height: 0 }); function id() { return (0, y.useContext)(ic); } var iu = i("876220"), ih = i("930153"), ip = { [ts.TopLeft]: tb.HK.ResizeTopLeftToBottomRight, [ts.TopRight]: tb.HK.ResizeTopRightToBottomLeft, [ts.BottomRight]: tb.HK.ResizeTopLeftToBottomRight, [ts.BottomLeft]: tb.HK.ResizeTopRightToBottomLeft, }; function iv(e) { var t, i = ev(), { status: n, setActive: r } = tw(tb.OS.Resize), { moveX: a = 0, moveY: o = 0, scale: s = 1, rotate: l = 0, } = null !== (t = (0, ek.k)(i, (e) => ({ moveX: e.moveX, moveY: e.moveY, scale: e.scale, rotate: e.rotate, }))) && void 0 !== t ? t : {}, { width: c, height: d } = tk(), { width: u, height: f } = id(), h = eB(), p = ex(); return { status: n, startResize: (e, t) => { var n = { [ts.TopLeft]: ts.BottomRight, [ts.TopRight]: ts.BottomLeft, [ts.BottomRight]: ts.TopLeft, [ts.BottomLeft]: ts.TopRight, }[t]; if (!!document.getElementById("paint-container")) { var v = { x: e.clientX, y: e.clientY }; p(!1), r(!0), null == i || i.updateTransformType(tb.OS.Resize); var m = tS(l, c, d, { x: a, y: o }), g = m[n], _ = m[t], { x: y } = _, b = ip[tC(_, { x: a, y: o })]; null == i || i.updateActionCursor(b); var I = y < a, w = (e) => { var { clientX: t, clientY: r } = e, a = t, o = a - v.x, p = I ? c - o : c + o, m = p / c, _ = d * m; if (p < ih.d || _ < ih.d) return; var { x: y, y: b } = tM(l, p, _, g)[n], w = m * s; if (w < 0) return; var { x: x, y: S } = (0, iu.o)(l, p, _, u, f, h), { min: M, max: C } = x, { min: T, max: A } = S; if (!!(y >= M && y <= C && b >= T && b <= A)) null == i || i.updateScale(w), null == i || i.updateMoveX(y), null == i || i.updateMoveY(b); }, x = (e) => { window.removeEventListener("mousemove", w), r(!1), p(!0), null == i || i.resetTransformType(), null == i || i.resetActionCursor(); }; window.addEventListener("mousemove", w), window.addEventListener("mouseup", x); } }, }; } function im(e) { var t, { width: i, height: n } = tk(), r = ev(), { moveX: a = 0, moveY: o = 0, rotate: s = 0, } = null !== (t = (0, ek.k)(r, (e) => ({ moveX: e.moveX, moveY: e.moveY, rotate: e.rotate, }))) && void 0 !== t ? t : {}; return tC(tS(s, i, n, { x: a, y: o })[e], { x: a, y: o }); } var ig = (e) => { var { direction: t, style: i } = e, n = (0, tc._)(e, ["direction", "style"]), { startResize: o, status: s } = iv(t), l = im(t), c = (0, D.lS)(), d = (e) => { e.stopPropagation(), tB(c, { action: tj.Zoom }), o(e, t); }, u = { [ts.TopLeft]: { left: 0, top: 0, transform: "translate(-50%, -50%)", }, [ts.TopRight]: { right: 0, top: 0, transform: "translate(50%, -50%)", }, [ts.BottomRight]: { right: 0, bottom: 0, transform: "translate(50%, 50%)", }, [ts.BottomLeft]: { left: 0, bottom: 0, transform: "translate(-50%, 50%)", }, }[t], h = eY()( ie, { [it]: l === ts.TopLeft, [ii]: l === ts.TopRight, [ia]: l === ts.BottomLeft, [ir]: l === ts.BottomRight, }, { [is]: s === tI.Active, [io]: s === tI.Hidden } ); return (0, f.jsx)( "div", (0, a._)((0, r._)({}, n), { style: (0, r._)({}, u, i), className: h, onMouseDown: d, children: (0, f.jsx)("div", { className: il }), }) ); }, i_ = () => (0, f.jsxs)(f.Fragment, { children: [ (0, f.jsx)(ig, { direction: ts.TopLeft }), (0, f.jsx)(ig, { direction: ts.TopRight }), (0, f.jsx)(ig, { direction: ts.BottomRight }), (0, f.jsx)(ig, { direction: ts.BottomLeft }), ], }); function iy() { var e, { width: t, height: i } = id(), n = ev(), r = eB(), [a, o] = (0, y.useState)(!1), { moveX: s = 0, moveY: l = 0, rotate: c = 0, } = null !== (e = (0, ek.k)(n, (e) => ({ scale: e.scale, moveX: e.moveX, moveY: e.moveY, rotate: e.rotate, }))) && void 0 !== e ? e : {}, { width: d, height: u } = tk(), f = ex(); return { startMove: (e) => { var a = { x: e.clientX, y: e.clientY }; o(!0), f(!1), null == n || n.updateTransformType(tb.OS.Move), null == n || n.updateActionCursor(tb.HK.Move); var { x: h, y: p } = (0, iu.o)(c, d, u, t, i, r), v = (e) => { var { clientX: t, clientY: i } = e, r = t, o = i, c = r - a.x, d = o - a.y, u = Math.min(h.max, Math.max(h.min, s + c)), f = Math.min(p.max, Math.max(p.min, l + d)); null == n || n.updateMoveX(u), null == n || n.updateMoveY(f); }, m = (e) => { window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", m), o(!1), f(!0), null == n || n.resetTransformType(), null == n || n.resetActionCursor(); }; window.addEventListener("mousemove", v), window.addEventListener("mouseup", m); }, }; } var ib = "frameInteract-yYeJMe", iI = "frameInteractActive-p9_A_f", iw = "frameInteractActiveDefault-EnRXbr"; function ix(e) { var t, { children: i } = e, n = (0, tc._)(e, ["children"]), { startMove: o } = iy(), s = ev(), { isSelectImage: l = !1, isTransforming: c = !1 } = null !== (t = (0, ek.k)(s, (e) => ({ isSelectImage: e.isSelectImage, isTransforming: e.isTransforming, }))) && void 0 !== t ? t : {}, d = () => { if (null == s ? !void 0 : !s.isSelectImage) null == s || s.updateIsSelectImage(!0); }, u = (0, D.lS)(), h = (e) => { if ((e.stopPropagation(), !!l)) tB(u, { action: tj.Move }), o(e); }, p = eY()(ib, { [iI]: l && !c, [iw]: l && c }); return (0, f.jsx)( "div", (0, a._)((0, r._)({}, n), { className: p, onMouseDown: h, onClick: d, children: l ? i : null, }) ); } function iS() { var e, t = ev(), i = null !== (e = (0, ek.k)(t, (e) => e.actionCursor)) && void 0 !== e ? e : tb.HK.Default, n = (0, y.useRef)(null); (0, y.useEffect)(() => { var e, t = null === (e = document.getElementsByClassName(ti.Mp)) || void 0 === e ? void 0 : e[0]; if (!!t) { var i = t.firstElementChild; return ( (n.current = i), () => { n.current && (n.current.style.cursor = "default"); } ); } }, []), (0, y.useEffect)(() => { if (!!n.current) n.current.style.cursor = t4(i); }, [i]); } var iM = (e) => { var t, { containerWidth: i, containerHeight: n, paintWidth: o, paintHeight: s, imageWidth: l, imageHeight: c, } = e, { framePosition: d, frameSize: u } = to({ containerWidth: i, containerHeight: n, paintWidth: o, paintHeight: s, imageWidth: l, imageHeight: c, }), h = (0, y.useMemo)(() => ({ width: o, height: s }), [o, s]), p = ev(); iS(); var { isSelectActive: v, isTransforming: m } = null !== (t = (0, ek.k)(p, (e) => ({ isSelectActive: null == e ? void 0 : e.isSelectActive, isTransforming: null == e ? void 0 : e.isTransforming, }))) && void 0 !== t ? t : {}; if (!v) return null; var g = (0, a._)((0, r._)({}, d), { transition: m ? "" : "all .1s ease-in-out", }); return (0, f.jsx)(tA.Provider, { value: u, children: (0, f.jsx)(ic.Provider, { value: h, children: (0, f.jsxs)(ix, { style: g, children: [(0, f.jsx)(t7, {}), (0, f.jsx)(i_, {})], }), }), }); }, iC = i("238638"), iT = (e) => { var { hiddenSelect: t, hiddenDrag: i, containerWidth: n, containerHeight: r, paintWidth: a, paintHeight: o, imageDisplayWidth: s, imageDisplayHeight: l, hiddenRightInteract: c, drawMaskSuccessCb: d, } = e, { paintModeInstance: u } = eL(), h = (0, y.useRef)(u); h.current = u; var { triggerDrawMasks: p } = (0, iC.z)(h, d); (0, y.useEffect)(() => { null == u || u.changeCanvasContainerSize({ width: s, height: l }), p(); }, [l, s, u]); var v = () => { if (!eD.T.getItem(eR.u.isShowBGPaintMessage)) eD.T.setItem(eR.u.isShowBGPaintMessage, "true"), e5.h.open({ content: (0, f.jsx)(tt, {}), bindContainer: document.querySelector("#".concat(ti.uS)), uiStyle: { top: "200px" }, delay: 3e3, }); }; return ( (0, y.useEffect)(() => { v(); }, []), (0, f.jsxs)(eI, { children: [ (0, f.jsx)(iM, { containerWidth: n, containerHeight: r, paintWidth: a, paintHeight: o, imageWidth: s, imageHeight: l, }), (0, f.jsx)(e9, { hiddenSelect: t, hiddenDrag: i }), !c && (0, f.jsx)(eS, {}), ], }) ); }, iA = i("899716"); i("229254"); var ik = i("597793"), iP = "referenceLevelContainer-gLrRQi", iE = "left-yrB32m", iD = "right-C25_iI", iR = "slider-tLznaZ", iN = "text-bSjCt0", iL = (function (e) { return (e.Show = "Show"), (e.Click = "click"), e; })({}); class ij { getEventParams() { var e; return { action: this._params.action, value: null !== (e = this._params.value) && void 0 !== e ? e : "", }; } constructor(e) { (this._params = e), (this.eventName = "reference_inspiration_slider"); } } function iO(e, t) { (0, N.Kl)(e, ij, [t]); } var iB = (e) => { var t, { image: i } = e, n = (0, D.lS)(), r = ep.o.getGraphicToolStoreInstance(n), a = null == r ? void 0 : r.basicBlendInstance, { referenceLevel: o } = null !== (t = (0, ek.k)( null == r ? void 0 : r.basicBlendInstance, (e) => ({ referenceLevel: null == e ? void 0 : e.referenceLevel, }) )) && void 0 !== t ? t : {}, s = (e) => { if (!Array.isArray(e)) null == a || a.updateReferenceLevel(e); }, l = (e) => { if (!Array.isArray(e)) iO(n, { action: iL.Click, value: e }); }; return ( (0, y.useEffect)(() => { iO(n, { action: iL.Show, value: o }); }, []), (0, f.jsx)(f.Fragment, { children: (0, f.jsxs)("div", { className: iP, children: [ (0, f.jsx)("div", { className: iE, children: u.oc.t( "wimg2img_title_intensity", {}, "Intensity" ), }), (0, f.jsxs)("div", { className: iD, children: [ (0, f.jsx)(ik.Z, { max: ti.K5.max, min: ti.K5.min, step: ti.K5.step, value: o, onChange: s, className: iR, onAfterChange: l, }), (0, f.jsxs)("div", { className: iN, children: [ (0, f.jsx)("div", { children: u.oc.t( "wimg2img_content_strong", {}, "Weak" ), }), (0, f.jsx)("div", { children: u.oc.t( "wimg2img_content_medium", {}, "Medium" ), }), (0, f.jsx)("div", { children: u.oc.t( "wimg2img_content_weak", {}, "Strong" ), }), ], }), ], }), ], }), }) ); }, iF = i("494766"), iU = i("743568"), iG = "style-reference-interact-PYkarw", iz = i("100900"), iV = i("65830"), iW = (e) => { var t, { instance: i } = e, [n, r] = (0, y.useState)(iF.n.None), a = (0, D.lS)(), { referenceLevel: o = ti.FY.default } = null !== (t = (0, ek.k)(i, (e) => ({ referenceLevel: null == e ? void 0 : e.referenceLevel, }))) && void 0 !== t ? t : {}, s = (e) => { if (!Array.isArray(e)) null == i || i.updateReferenceLevel(e); }, l = (e) => { if (!Array.isArray(e)) (0, iz.b)(a, { action: iz.u.Click, type: iV.gZ.Style, value: e, }); }, c = (e) => { e ? (r(iF.n.AdjustReferenceLevel), (0, iz.b)(a, { action: iz.u.Show, type: iV.gZ.Style })) : r(iF.n.None); }; return (0, f.jsx)("div", { className: iG, children: (0, f.jsx)(iU.s, { referenceLevel: o, min: ti.FY.min, isActive: n === iF.n.AdjustReferenceLevel, onChange: s, onAfterChange: l, onUpdateActiveOption: r, onReferenceLevelVisibleChange: c, }), }); }, iZ = "style-reference-interact-RzMfFZ", iK = "referenceLevelContainer-axXjMN", iH = "referenceContent-upCV6B", iq = "sliderWrap-tslUt7", iJ = "slider-lm0AD0", iY = "sliderResult-VKrn6Z", iQ = "interactArea-ByZHGW", iX = "active-Yn8FM3", i$ = "paramIcon-eqEspQ", i0 = i("763284"), i1 = i("443213"), i2 = (e) => { var { value: t, isActive: i, sliderMax: n, sliderMin: r, sliderStep: a, name: o, onValueChange: s, onAfterValueChange: l, onUpdateReferenceBarActive: c, onReferenceLevelVisibleChange: d, } = e; return (0, f.jsx)(i1.E, { containerClassName: iK, contentClassName: iH, onVisibleChange: d, content: (0, f.jsxs)("div", { className: iq, children: [ (0, f.jsx)(i0.i, { max: n, min: r, step: a, value: t, onChange: s, triggerBar: !0, className: iJ, onAfterChange: l, }), (0, f.jsx)("span", { className: iY, children: Math.round(t) }), ], }), children: (0, f.jsxs)("div", { className: eY()(iQ, { [iX]: i }), onClick: () => c(), children: [ (0, f.jsx)(p.ygK, { className: i$ }), (0, f.jsx)("span", { children: o }), ], }), }); }, i6 = (e) => { var t, { instance: i } = e, [n, r] = (0, y.useState)(!1), a = (0, D.lS)(), { referenceLevel: o = ti.cR.default } = null !== (t = (0, ek.k)(i, (e) => ({ referenceLevel: null == e ? void 0 : e.referenceLevel, }))) && void 0 !== t ? t : {}, s = (e) => { if (!Array.isArray(e)) null == i || i.updateReferenceLevel(e); }, l = (e) => { if (!Array.isArray(e)) (0, iz.b)(a, { action: iz.u.Click, type: iV.gZ.ByteEdit, value: e, }); }, c = (e) => { e ? (r(!0), (0, iz.b)(a, { action: iz.u.Show, type: iV.gZ.ByteEdit })) : r(!1); }, d = () => { r(!0); }; return (0, f.jsx)("div", { className: iZ, children: (0, f.jsx)(i2, { value: o, isActive: n, sliderMin: ti.cR.min, sliderMax: ti.cR.max, sliderStep: ti.cR.step, onAfterValueChange: l, onValueChange: s, onReferenceLevelVisibleChange: c, onUpdateReferenceBarActive: d, name: u.ZP.t("wimg2img_title_intensity", {}, "Intensity"), }), }); }, i4 = (e) => { var { ability: t, image: i, params: n, imageScale: r, containerWidth: a, containerHeight: o, paintWidth: s, paintHeight: l, imageDisplayHeight: c, imageDisplayWidth: d, isEditorReady: u, drawMaskSuccessCb: h, } = e, p = (0, D.lS)(), v = ep.o.getGraphicToolStoreInstance(p); return { [R.s.FaceGan]: (0, f.jsx)($.e, { image: i, params: n, imageScale: r, }), [R.s.BgPaint]: u ? (0, f.jsx)(iT, { containerWidth: a, containerHeight: o, paintWidth: s, paintHeight: l, imageDisplayHeight: c, imageDisplayWidth: d, drawMaskSuccessCb: h, }) : (0, f.jsx)(f.Fragment, {}), [R.s.IpKeep]: (0, f.jsx)(iA.a, { instance: null == v ? void 0 : v.ipKeepInstance, }), [R.s.BasicBlend]: (0, f.jsx)(iB, { image: i }), [R.s.ControlNetCanny]: (0, f.jsx)(iF.d, { instance: null == v ? void 0 : v.cannyInstance, }), [R.s.ControlNetDepth]: (0, f.jsx)(iF.d, { instance: null == v ? void 0 : v.depthInstance, }), [R.s.ControlNetPose]: (0, f.jsx)(iF.d, { instance: null == v ? void 0 : v.poseInstance, }), [R.s.Unknown]: (0, f.jsx)(f.Fragment, {}), [R.s.ControlNet]: (0, f.jsx)(f.Fragment, {}), [R.s.Text2image]: (0, f.jsx)(f.Fragment, {}), [R.s.Image2image]: (0, f.jsx)(f.Fragment, {}), [R.s.StyleReference]: (0, f.jsx)(iW, { instance: null == v ? void 0 : v.styleInstance, }), [R.s.ByteEdit]: (0, f.jsx)(i6, { instance: null == v ? void 0 : v.byteEditInstance, }), [R.s.StyleCode]: (0, f.jsx)(f.Fragment, {}), }[t]; }, i3 = i("210708"), i8 = i("124217"), i9 = i("239643"), i5 = { singleImageWrap: "singleImageWrap-A_Y_zh", paintContainer: "paintContainer-dVFr5A", paintContent: "paintContent-chpz8W", text: "text-Tv5eC6", controlnetImageWrap: "controlnetImageWrap-saB7Ct", image: "image-jwfaHL", imagineGraphicEditor: "imagineGraphicEditor-sqQyLn", hidden: "hidden-kLqcvL", fadeOut: "fadeOut-dYyxux", visible: "visible-kFPoBd", fadeIn: "fadeIn-bA8_A0", loading: "loading-hmqpz_", }, i7 = i("880821"), ne = (e) => { var [t, i] = (0, y.useState)({ width: 0, height: 0 }), [n, r] = (0, y.useState)("string" == typeof e ? e : ""); return ( (0, y.useEffect)(() => { var t = "", n = !1; "string" == typeof e ? ((n = !1), (t = e)) : ((n = !0), (t = URL.createObjectURL(e))), (0, i7.po)(t) .then((e) => { var { width: t, height: n } = e; i({ width: t, height: n }); }) .catch(() => { i({ width: 0, height: 0 }); }) .finally(() => { r(t); }); }, [e]), { url: n, width: t.width, height: t.height } ); }; function nt(e, t) { var [i, n] = (0, y.useState)(e), r = (0, y.useRef)(); return ( (0, y.useEffect)(() => { r.current && clearTimeout(r.current), (r.current = setTimeout(() => { n(e); }, t)); }, [e, t]), (0, y.useEffect)( () => () => { r.current && clearTimeout(r.current); }, [] ), [i] ); } var ni = { [R.s.ControlNetCanny]: "function_canny_pic", [R.s.ControlNetDepth]: "function_depth_pic", [R.s.ControlNetPose]: "function_pose_pic", [R.s.IpKeep]: "", [R.s.BasicBlend]: "", [R.s.BgPaint]: "", [R.s.FaceGan]: "", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.ByteEdit]: "", [R.s.StyleCode]: "", }, nn = { [R.s.ControlNetCanny]: "Edge", [R.s.ControlNetDepth]: "Depth", [R.s.ControlNetPose]: "Pose", [R.s.IpKeep]: "", [R.s.BasicBlend]: "", [R.s.BgPaint]: "", [R.s.FaceGan]: "", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.ByteEdit]: "", [R.s.StyleCode]: "", }, nr = (e) => { var t, i, { ratio: n, image: r, paintWidth: a, paintHeight: o, abilityType: s, style: l = {}, className: c, } = e, [d, h] = (0, y.useState)(!0), p = (0, y.useRef)(n); (0, y.useEffect)(() => { h(!0); }, [s]), (0, y.useEffect)(() => { n !== p.current && d && h(!1); }, [n]); var v = (0, D.lS)(), m = null === (t = ep.o.getGraphicToolStoreInstance) || void 0 === t ? void 0 : t.call(ep.o, v), { fitMode: g, previewUrl: _ } = null !== (i = (0, ek.k)( null == m ? void 0 : m.getInstanceByAbility(s), (e) => ({ fitMode: null == e ? void 0 : e.fitMode, previewUrl: null == e ? void 0 : e.previewUrl, }) )) && void 0 !== i ? i : {}, [b] = nt(g, ti.hR), [I] = nt(_, _ ? 0 : ti.hR), w = null != _ ? _ : I, { width: x, height: S, url: M } = ne("file" in r ? r.file : r.url), { width: C, height: T } = (0, i9._X)({ paintWidth: a, paintHeight: o, imageWidth: x, imageHeight: S, fitMode: b, }), A = { overflow: "hidden", objectFit: "cover" }; return (0, f.jsxs)(f.Fragment, { children: [ (0, f.jsx)("div", { className: eY()(i5.singleImageWrap, c), style: l, children: (0, f.jsxs)("div", { className: i5.paintContent, style: { width: "".concat(a, "px"), height: "".concat(o, "px"), }, children: [ (0, f.jsx)("span", { className: i5.text, children: u.ZP.t("function_original", {}, "Original"), }), (0, f.jsx)("div", { className: i5.originImageContainer, style: { width: "".concat(C, "px"), height: "".concat(T, "px"), transition: d ? "none" : "all 300ms ease-in-out", }, children: (0, f.jsx)(Y.k, { loader: M ? (0, f.jsx)(Q.XG, { className: i5.loading, size: Q.XJ.Big, }) : null, className: i5.image, imageStyle: A, src: (0, J.C)(M, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", "data-apm-action": "control-net-images-image", }), }), ], }), }), (0, f.jsx)("div", { className: eY()(i5.singleImageWrap, c), style: l, children: (0, f.jsxs)("div", { className: i5.paintContent, style: { width: "".concat(a, "px"), height: "".concat(o, "px"), }, children: [ (0, f.jsx)("span", { className: i5.text, children: u.ZP.t(ni[s], {}, nn[s]), }), (0, f.jsx)("div", { className: i5.imageContainer, style: { width: "".concat(C, "px"), height: "".concat(T, "px"), transition: d ? "none" : "all 300ms ease-in-out", }, children: (0, f.jsx)(Y.k, { loader: w ? (0, f.jsx)(Q.XG, { className: i5.loading, size: Q.XJ.Big, }) : null, className: i5.image, imageStyle: A, onLoad: () => h(!1), src: (0, J.C)(w, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", "data-apm-action": "control-net-images-preview-url-display", }), }), ], }), }), ], }); }; function na(e) { var { imageWidth: t, imageHeight: i, paintWidth: n, paintHeight: r, abilityType: a, isInitActualSize: o, } = e, { moveX: s, moveY: l, scale: c, rotate: d } = tn(), u = a === R.s.BgPaint, f = Math.floor(u && o ? s - t / 2 : n / 2 - t / 2), h = Math.floor(u && o ? l - i / 2 : r / 2 - i / 2), p = u ? c : 1, v = u ? d : 0; return { width: "".concat(t, "px"), height: "".concat(i, "px"), transform: "translate(" .concat(f, "px, ") .concat(h, "px) scale(") .concat(p, ") rotate(") .concat(v, "deg)"), }; } var no = i("666204"), ns = i("699267"), nl = i("561658"), nc = 1; function nd(e) { var t, { rawImageWidth: i, rawImageHeight: n, paintWidth: r, paintHeight: a, imageUrl: o, abilityType: s, largeImageInfo: l, } = e, c = ev(), d = (0, y.useRef)(!1), u = (0, ns.G)(nl.N), f = null == u ? void 0 : u.imageParamsManager, h = null !== (t = null == f ? void 0 : f.imageRatio) && void 0 !== t ? t : ti.k0, { imcConfigService: p } = (0, D.N_)(); (0, y.useEffect)(() => { !d.current && n && i && o && s === R.s.BgPaint && ((d.current = !0), (0, no.u)(l, { width: i, height: n }, nc, p).then((e) => { var { width: t, height: s } = e; null == c || c.updateRawImageSize(i, n), null == c || c.updateImageUrl(o), null == c || c.initActualPaintSize(t, s), null == c || c.updatePaintSize(r, a, !1); })); }, [c, n, i, r, a, o, s, h, l, p]), (0, y.useEffect)(() => { d.current && (0, no.u)(l, { width: i, height: n }, nc, p).then((e) => { var { width: t, height: i } = e; null == c || c.updateActualPaintSize(t, i); }); }, [c, l, n, i, p]), (0, y.useEffect)(() => { d.current && (null == c || c.updatePaintSize(r, a, !0)); }, [c, r, a]); } var nu = (e) => { var { containerStyle: t, imageHeight: i, imageWidth: n, children: o, paintWidth: s, paintHeight: l, rawImageWidth: c, rawImageHeight: d, abilityType: u, isInitialLoad: h, imageUrl: p, largeImageInfo: v, } = e, m = (0, tc._)(e, [ "containerStyle", "imageHeight", "imageWidth", "children", "paintWidth", "paintHeight", "rawImageWidth", "rawImageHeight", "abilityType", "isInitialLoad", "imageUrl", "largeImageInfo", ]); nd({ rawImageWidth: c, rawImageHeight: d, paintWidth: s, paintHeight: l, imageUrl: p, abilityType: u, largeImageInfo: v, }); var g = ev(), _ = (0, ek.k)(g, (e) => e.isTransforming), y = na({ imageHeight: i, imageWidth: n, paintWidth: s, paintHeight: l, abilityType: u, isInitActualSize: null == g ? void 0 : g.isInitActualSize, }), b = { transition: h || _ ? "none" : "all 300ms ease-in-out" }; return (0, f.jsx)( "div", (0, a._)((0, r._)({}, m), { style: (0, r._)({}, t, y, b), children: o, }) ); }, nf = i("429398"); function nh() { var e = (0, y.useMemo)(() => [et, ei], []); return (0, nf.E)(e); } function np(e) { var { width: t = 0, height: i = 0, file: n = null, url: r = "", } = Object.assign({ width: 0, height: 0, file: null, url: "" }, e), [a, o] = (0, y.useState)({ width: t, height: i }), [s, l] = (0, y.useState)(r); return ( (0, y.useEffect)(() => { if (t && i) { o({ width: t, height: i }); return; } var e = ""; if ((r ? (e = r) : n && (e = URL.createObjectURL(n)), !!e)) (0, i7.po)(e) .then((e) => { var { width: t, height: i } = e; o({ width: t, height: i }); }) .catch(() => { o({ width: 0, height: 0 }); }) .finally(() => { l(e); }); }, [n, r, t, i]), { width: a.width, height: a.height, url: s } ); } var nv = (e) => { var { ratio: t, image: i, abilityType: n, params: o, paintWidth: s, paintHeight: l, isControlNetPreview: c, isControlNetPreviewDelay: d, isControlNetPreviewFurtherDelay: u, containerWidth: h, containerHeight: p, largeImageInfo: v, hideLoading: m, } = e, [g, _] = (0, y.useState)(!0), b = (0, y.useRef)(t); (0, y.useEffect)(() => { t !== b.current && g && _(!1); }, [t]); var I = (0, D.lS)(); (0, y.useEffect)(() => { var e = () => { eh(I, { action: ed.Use, item: eu.MoveCanvas }); }; return ei.on("onMouseUp", e), () => ei.off("onMouseUp", e); }, [I]); var { elementRef: w, elementStyle: x, resetTransformStyle: S, activateAllWatchers: M, deactivatedAllWatchers: C, } = nh(); (0, y.useEffect)(() => { n && S(), n === R.s.BgPaint ? M() : C(); }, [n, S, M, C]); var T = (0, y.useRef)(null); (0, y.useEffect)(() => { var e = () => { var e = T.current; if (!!e) { var { offsetHeight: t, offsetWidth: i } = e; ei.setRangeContainer(e, { width: i, height: t }); } }; return ( e(), window.addEventListener("resize", e), () => { window.removeEventListener("resize", e); } ); }, []); var A = "file" in i ? i.file : i.url, { width: k, height: P, url: E } = np(i), N = (0, y.useMemo)( () => ({ width: k, height: P, url: E }), [k, P, E] ), { graphicEditorStatus: L, containerRef: j, graphicEditorTools: O, } = (0, i3.q)({ abilityType: n, image: A }), { scale: B, width: F, height: U, } = (0, i9._X)({ paintWidth: s, paintHeight: l, imageWidth: k, imageHeight: P, }), G = L === i8.x.Success, z = ev(), V = (0, y.useRef)(null), W = (e) => { var { target: t } = e; (t === V.current || t === T.current) && (null == z || z.updateIsSelectImage(!1)); }; return (0, f.jsx)(eN.S.Provider, { value: O, children: (0, f.jsxs)("div", { ref: T, className: X.paintContainer, id: "paint-container", onMouseDown: W, style: { justifyContent: d ? "space-between" : "center" }, children: [ (0, f.jsx)(nr, { abilityType: n, image: i, params: o, paintHeight: l, paintWidth: s, ratio: t, style: { display: d ? "flex" : "none" }, className: c ? X.visible : X.hidden, }), (0, f.jsx)("div", { style: (0, a._)((0, r._)({}, x), { display: u ? "none" : "block", }), ref: w, className: eY()(X.imageWrap, c ? X.hidden : X.visible), children: (0, f.jsx)("div", { className: X.paintContent, style: { width: "".concat(s, "px"), height: "".concat(l, "px"), }, ref: V, children: (0, f.jsxs)(nu, { abilityType: n, className: X.imageContainer, imageWidth: F, imageHeight: U, paintHeight: l, paintWidth: s, rawImageHeight: P, rawImageWidth: k, containerStyle: { transition: g ? "none" : "all 300ms ease-in-out", }, largeImageInfo: v, isInitialLoad: g, imageUrl: E, children: [ (0, f.jsx)(Y.k, { loader: E ? (0, f.jsx)(Q.XG, { className: X.loading, size: Q.XJ.Big, }) : null, className: X.image, imageStyle: { overflow: "hidden", objectFit: "contain", }, src: (0, J.C)(E, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", "data-apm-action": "image-paint", }), (0, f.jsx)("div", { className: X.imagineGraphicEditor, ref: j, style: { width: "".concat(F, "px"), height: "".concat(U, "px"), opacity: G ? 1 : 0, }, }), ], }), }), }), (0, f.jsx)(i4, { params: o, image: N, ability: n, imageScale: B, paintHeight: l, paintWidth: s, isEditorReady: G, imageDisplayHeight: U, imageDisplayWidth: F, containerWidth: h, containerHeight: p, drawMaskSuccessCb: m, }), ], }), }); }; i("332861"); var nm = i("48541"), ng = i("839141"), n_ = { container: "container-B6JI17", tooltipContainer: "tooltipContainer-Vhr7DY", abilityType: "abilityType-HnCTwF", checkbox: "checkbox-oEBny2", checkboxContent: "checkboxContent-n4iHKO", checkboxText: "checkboxText-tbnJLr", checkboxSelected: "checkboxSelected-EURWHa", checkboxTextDisabled: "checkboxTextDisabled-GwqT_Y", checkboxTextSelected: "checkboxTextSelected-fthZLQ", divide: "divide-IDf0zn", hoverVideoWrap: "hoverVideoWrap-IVNt5m", hoverVideo: "hoverVideo-E59u99", hoverTip: "hoverTip-znsXcp", hoverImage: "hoverImage-axUkQ8", image: "image-GImyqs", hoverUsedText: "hoverUsedText-UHEsfH", dropdownContent: "dropdownContent-cC40YV", dropdownTips: "dropdownTips-_3bqas", dropdownBtn: "dropdownBtn-Y7EjOk", }, ny = i("799108"), nb = (e) => { var { isChecked: t, isDisabled: i, text: n, extraIcon: r } = e; return (0, f.jsxs)("span", { className: n_.checkboxContent, children: [ (() => t && !i ? (0, f.jsx)(p.qn1, { size: 16, className: n_.checkboxSelected, }) : t && i ? (0, f.jsx)(p.yNw, { size: 16 }) : !t && i ? (0, f.jsx)(p.W$H, { size: 16 }) : (0, f.jsx)(p.lSY, { size: 16 }))(), (0, f.jsx)("span", { className: eY()({ [n_.checkboxText]: !0, [n_.checkboxTextDisabled]: i, [n_.checkboxTextSelected]: t && !i, }), children: n, }), r, ], }); }, nI = i("605682"), nw = i("159895"), nx = i("133438"), nS = i("644866"), nM = (function (e) { return (e.Success = "success"), (e.Failed = "failed"), e; })({}), nC = (function (e) { return (e.Empty = "empty"), (e.NetWorkError = "network error"), e; })({}); class nT { getEventParams() { var { status: e, failReason: t } = this._params; return { status: e, fail_reason: t }; } constructor(e) { (this._params = e), (this.eventName = "load_ability_video"); } } function nA(e, t) { (0, N.S$)(e, nT, [t]); } var nk = i("727280"), nP = 5, nE = { [R.s.BgPaint]: "bgPaint", [R.s.FaceGan]: "faceGan", [R.s.IpKeep]: "ipKeep", [R.s.BasicBlend]: "fuzzBlend", [R.s.ControlNetCanny]: "canny", [R.s.ControlNetDepth]: "depth", [R.s.ControlNetPose]: "pose", [R.s.StyleReference]: "styleReference", [R.s.ByteEdit]: "byteEdit", }; function nD(e) { return e.reduce((e, t) => { var i, n, { name: r } = t; if (r === l.UI.StyleReference) return e + 1; if ((0, nk.DX)(t)) { return ( e + (null !== (n = null === (i = t.commonAsset.referImageList) || void 0 === i ? void 0 : i.length) && void 0 !== n ? n : 0) ); } return e; }, 0); } function nR(e) { for (var t = e.length - 1; t >= 0; t--) { var i = e[t]; if ((0, nk.DX)(i)) { var n = i.commonAsset.referImageList, r = null == n ? void 0 : n[n.length - 1]; if (r) return (0, nk.Tt)(r, i); } else if (i.name === l.UI.StyleReference) return i; } return null; } function nN(e, t, i) { function n() { if (e === R.s.FaceGan) { var i = t.filter((t) => (0, nS.O)(t) === e); return i.length > 1 ? i[i.length - 1] : null; } return e === R.s.StyleReference ? nD(t) >= nP ? nR(t) : null : t.find((t) => (0, nS.O)(t) === e); } if (i) { var r = i.name; if (((0, nx.od)(i) && (r = (0, nS.O)(i)), e === r)) return null; } return n(); } function nL(e) { var { ability: t, blendImagePromptList: i, imagineParams: r } = e, { imcConfigService: a } = (0, D.N_)(), o = (0, D.lS)(), [s, l] = (0, y.useState)(null), c = (function () { var e = (0, n._)(function* () { try { var e = yield null == a ? void 0 : a.aggregate.getImcConfigByKey(nw.c.ImagineConfigs); if (!e) { nA(o, { status: nM.Failed, failReason: nC.Empty }); return; } nA(o, { status: nM.Success }), l(e); } catch (e) { nA(o, { status: nM.Failed, failReason: nC.NetWorkError }); } var t = yield null == a ? void 0 : a.aggregate.getImcConfigByKey(nw.c.ImagineConfigs); if (!!t) l(t); }); return function () { return e.apply(this, arguments); }; })(), d = nN(t, i, r); (0, y.useEffect)(() => { c(); }, []); var u = d ? d.url : null == s ? void 0 : s[nE[t]]; return { blendItem: d, hoverUrl: u }; } var nj = (0, y.forwardRef)((e, t) => { var { url: i, tip: n } = e; return (0, f.jsxs)("div", { className: n_.hoverVideoWrap, children: [ (0, f.jsx)("video", { muted: !0, autoPlay: !0, loop: !0, className: n_.hoverVideo, ref: t, crossOrigin: "anonymous", children: (0, f.jsx)("source", { src: (0, J.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), type: "video/mp4", }), }), n ? (0, f.jsx)("p", { className: n_.hoverTip, children: n }) : null, ], }); }), nO = i("519171"); function nB(e) { var { url: t, text: i, imageWidth: n = 0, imageHeight: r = 0 } = e, a = (0, nO.T)({ width: n, height: r }); return (0, f.jsxs)("div", { className: n_.hoverImage, children: [ (0, f.jsx)(Y.k, { src: (0, J.C)(t, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), style: a, className: n_.image, imageStyle: { objectFit: "cover" }, "data-apm-action": "ability-type-hover-used", }), (0, f.jsx)("p", { className: n_.hoverUsedText, children: i }), ], }); } var nF = 512, nU = 512, nG = i("518814"), nz = i("279504"), nV = i("71129"), nW = i("846779"), nZ = { [R.s.FaceGan]: "", [R.s.BgPaint]: "", [R.s.BasicBlend]: "", [R.s.IpKeep]: "IP_web_notsupport_other", [R.s.ControlNetCanny]: "multiple_canny_cancel", [R.s.ControlNetDepth]: "multiple_depth_cancel", [R.s.ControlNetPose]: "multiple_pose_cancel", [R.s.ByteEdit]: "custom_reference_not_support_after_select_other", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.StyleCode]: "", }, nK = { [R.s.FaceGan]: "", [R.s.BgPaint]: "", [R.s.BasicBlend]: "", [R.s.IpKeep]: "Can\u2019t reference character after adding other references", [R.s.ControlNetCanny]: "Cant reference edge after selecting a reference object.", [R.s.ControlNetDepth]: "Can\u2019t reference depth after selecting a reference object.", [R.s.ControlNetPose]: "Can\u2019t reference pose after selecting a reference object.", [R.s.ByteEdit]: "Can't select custom reference after adding other references", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.StyleCode]: "", }; function nH(e) { return u.ZP.t(nZ[e], {}, nK[e]); } function nq(e) { for ( var t, i = arguments.length, n = Array(i > 1 ? i - 1 : 0), r = 1; r < i; r++ ) n[r - 1] = arguments[r]; return null !== (t = { 1: u.ZP.t( "multiple_object_cancel1", { string0: u.ZP.t(ti.rj[n[0]], {}, ti.kQ[n[0]]) }, "Can\u2019t reference an object after selecting {string0}" ), 2: u.ZP.t( "multiple_object_cancel2", { string0: u.ZP.t(ti.rj[n[0]], {}, ti.kQ[n[0]]), string1: u.ZP.t(ti.rj[n[1]], {}, ti.kQ[n[1]]), }, "Can\u2019t reference an object after selecting {string0} and {string1}" ), 3: u.ZP.t( "multiple_object_cancel3", { string0: u.ZP.t(ti.rj[n[0]], {}, ti.kQ[n[0]]), string1: u.ZP.t(ti.rj[n[1]], {}, ti.kQ[n[1]]), string2: u.ZP.t(ti.rj[n[2]], {}, ti.kQ[n[2]]), }, "Can\u2019t reference an object after selecting {string0}, {string1}, and {string2}" ), }[e]) && void 0 !== t ? t : ""; } var nJ = [R.s.ControlNetCanny, R.s.ControlNetDepth, R.s.ControlNetPose]; function nY(e, t, i, n) { var r = n.name; if ( ((0, nx.od)(n) && (r = (0, nS.O)(n)), r === R.s.BgPaint && ![R.s.IpKeep, R.s.ByteEdit].includes(e)) ) return { isAbilityConflict: !1, abilityTip: "" }; if (nJ.includes(r)) { var a = i .filter((e) => (0, nS.O)(e) !== r) .filter((e) => nJ.includes((0, nS.O)(e))); return e === R.s.BgPaint && a.length >= 1 ? { isAbilityConflict: !0, abilityTip: nq( a.length + (nJ.includes(t) ? 1 : 0), ...a.map((e) => (0, nS.O)(e)), t ), } : i.length > 1 && e === R.s.IpKeep ? { isAbilityConflict: !0, abilityTip: nH(R.s.IpKeep) } : i.length > 1 && e === R.s.ByteEdit ? { isAbilityConflict: !0, abilityTip: nH(R.s.ByteEdit) } : { isAbilityConflict: !1, abilityTip: "" }; } var o = i.find((e) => (0, nS.O)(e) === R.s.BgPaint), s = i.filter((e) => nJ.includes((0, nS.O)(e))); return o && nJ.includes(e) ? { isAbilityConflict: !0, abilityTip: nH(e) } : s.length && e === R.s.BgPaint ? { isAbilityConflict: !0, abilityTip: nq(s.length, ...s.map((e) => (0, nS.O)(e))), } : i.length > 1 && e === R.s.IpKeep ? { isAbilityConflict: !0, abilityTip: nH(R.s.IpKeep) } : i.length > 1 && e === R.s.ByteEdit ? { isAbilityConflict: !0, abilityTip: nH(R.s.ByteEdit) } : e === R.s.StyleReference && i.find((e) => (0, nS.O)(e) === R.s.StyleCode && !(0, nk.DX)(e)) ? { isAbilityConflict: !0, abilityTip: u.ZP.t( "dre_t2i_style_code_conflict_with_style_tip", {}, "Can't reference style after applying a style code" ), } : { isAbilityConflict: !1, abilityTip: "" }; } function nQ(e, t, i) { if ( ![ R.s.BgPaint, R.s.IpKeep, R.s.ByteEdit, R.s.StyleReference, ...nJ, ].includes(e) ) return { isAbilityConflict: !1, abilityTip: "" }; if (i.length && e === R.s.IpKeep) return { isAbilityConflict: !0, abilityTip: nH(R.s.IpKeep) }; if (i.length && e === R.s.ByteEdit) return { isAbilityConflict: !0, abilityTip: u.ZP.t( "custom_reference_not_support_after_select_other", {}, "Can't select custom reference after adding other references" ), }; var n = i.find((e) => (0, nS.O)(e) === R.s.BgPaint), r = i.filter((e) => nJ.includes((0, nS.O)(e))), a = nJ.includes(t); return e === R.s.BgPaint && r.length ? { isAbilityConflict: !0, abilityTip: nq( r.length + (a ? 1 : 0), ...r.map((e) => (0, nS.O)(e)), t ), } : nJ.includes(e) && n ? { isAbilityConflict: !0, abilityTip: nH(e) } : e === R.s.StyleReference && i.find((e) => (0, nS.O)(e) === R.s.StyleCode && !(0, nk.DX)(e)) ? { isAbilityConflict: !0, abilityTip: u.ZP.t( "dre_t2i_style_code_conflict_with_style_tip", {}, "Can't reference style after applying a style code" ), } : { isAbilityConflict: !1, abilityTip: "" }; } function nX(e, t, i, n) { return n ? nY(e, t, i, n) : nQ(e, t, i); } var n$ = i("417699"), n0 = (e) => { var { type: t, text: i, checked: n, currentAbility: r, blendImagePromptList: a, disabledText: o, imagineParams: s, scene: l, tip: c, onChange: d, } = e, { isOversea: h } = (0, ns.G)(n$.e), p = (0, D.lS)(), { generateImageParamsManager: m } = (0, D.N_)(), g = (0, y.useRef)(null), _ = (0, y.useRef)(null), b = (e) => { if ((d(e, t), t !== R.s.Unknown)) V(p, { action: L.Click, item: O[t] }, G, m); }, I = (e) => { var t; (0, nz.U)({ containerService: p, reportParam: { source: null !== (t = l ? ny.jJ[l] : void 0) && void 0 !== t ? t : nV.s.VIP_EXCLUSIVE_HONER, scene: l, }, }), l && (0, nW.SM)(p, { action: nW.bI.Click, vipFuncName: nW.WL[l], needVipLevel: e, scene: l, }); }, { blendItem: w, hoverUrl: x } = nL({ ability: t, blendImagePromptList: a, imagineParams: s, }), S = !!w, { isAbilityConflict: M, abilityTip: C } = nX(t, r, a, s), T = S || M, A = (e, i) => { var n, r; return t !== R.s.Unknown && x ? (0, f.jsxs)("div", { className: n_.dropdownContent, children: [ S ? (0, f.jsx)(nB, { url: x, text: o, imageWidth: null !== (n = null == w ? void 0 : w.width) && void 0 !== n ? n : nF, imageHeight: null !== (r = null == w ? void 0 : w.height) && void 0 !== r ? r : nU, }) : (0, f.jsx)(nj, { url: x, ref: _, tip: c }), e ? (0, f.jsx)("div", { className: n_.dropdownTips, children: u.ZP.t( "dre_m10n_pro_feature", { strong1: (e) => e }, "Upgrade to use this feature" ), }) : null, e ? (0, f.jsx)(v.J, { className: n_.dropdownBtn, onClick: () => I(i), text: u.ZP.t( "dre_m10n_hover_btn_subcribe", { string0: (0, ny.J2)({ level: i }) }, "Upgrade to {string0}" ), }) : null, ], }) : (0, f.jsx)(f.Fragment, {}); }, k = (e, i, n) => { if (e) { var r; null === (r = _.current) || void 0 === r || r.play(); } else { var a = _.current; a && (a.currentTime = 0); } if (!!e && t !== R.s.Unknown) l && i && (0, nW.SM)(p, { action: nW.bI.Click, vipFuncName: nW.WL[l], needVipLevel: n, scene: l, }), V( p, { action: L.Hover, item: O[t], failToast: S ? F[t] : void 0, }, G, m ); }, P = () => { var e; if (t !== R.s.Unknown) [ R.s.ControlNetCanny, R.s.ControlNetDepth, R.s.ControlNetPose, ].includes(t) ? (e = B.UseSubject) : t === R.s.BgPaint && (e = B.UseControlNet), M && V(p, { action: L.Hover, item: O[t], failToast: e }, G, m); }, E = (e, r) => (0, f.jsxs)("div", { className: n_.abilityType, children: [ (0, f.jsx)(i1.E, { isDisable: M, content: A(e, r), ref: g, contentStyle: { bottom: "43px", left: "0px", lineHeight: 0, fontSize: 0, background: "rgba(59, 69, 89, 0.8)", }, onVisibleChange: (t) => k(t, e, r), isUseHover: !0, children: (0, f.jsx)(tK.Z, { disabled: !M, position: "top", className: n_.tooltipContainer, content: C, style: { whiteSpace: "nowrap" }, children: (0, f.jsx)(nm.Z, { checked: n, onChange: b, className: eY()(n_.checkbox, n ? n_.active : ""), disabled: S || M, onMouseEnter: P, children: (e) => { var { checked: t } = e; return (0, f.jsx)(nb, { isChecked: t, isDisabled: T, text: i, extraIcon: h ? null : (0, f.jsx)(nG.Z, { style: { marginLeft: "4px" }, size: 14, level: r, }), }); }, }), }), }), t === R.s.ByteEdit && (0, f.jsx)("div", { className: n_.divide }), ], }); return l && !T ? (0, f.jsx)(nI.t, { scene: l, ignoreNeedCredits: !0, wrapperStyle: { display: "inline-block" }, children: (e) => E( e.needVip && !e.isVip && !e.isInFreemiumStage, e.needMinVipLevel ), }) : E(!1, ng.d.None); }, n1 = "section-Hut7ki", n2 = "introWrap-X6ywn5", n6 = "intro-u9j0tT", n4 = "abilitiesList-buX5xf", n3 = i("537201"), n8 = { [R.s.ByteEdit]: "", [R.s.FaceGan]: "multiple_face_only", [R.s.BgPaint]: "multiple_object_only", [R.s.IpKeep]: "", [R.s.BasicBlend]: "", [R.s.ControlNetCanny]: "multiple_canny_only", [R.s.ControlNetDepth]: "multiple_depth_only", [R.s.ControlNetPose]: "multiple_pose_only", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "style_already", [R.s.StyleCode]: "", }, n9 = { [R.s.FaceGan]: ny.hO.ImageControlNetHumanFace, [R.s.BgPaint]: ny.hO.ImageControlNetObject, [R.s.ControlNetCanny]: ny.hO.ImageControlNetCanny, [R.s.ControlNetDepth]: ny.hO.ImageControlNetDepth, [R.s.ControlNetPose]: ny.hO.ImageControlNetPose, [R.s.StyleReference]: ny.hO.ImageStyleReference, [R.s.ByteEdit]: ny.hO.ImageByteEdit, }, n5 = { [R.s.ByteEdit]: "", [R.s.FaceGan]: "You\u2019ve referenced the human face of this image", [R.s.BgPaint]: "You\u2019ve referenced the object of this image", [R.s.IpKeep]: "", [R.s.BasicBlend]: "", [R.s.ControlNetCanny]: "You\u2019ve referenced the edge of this image", [R.s.ControlNetDepth]: "You\u2019ve referenced the depth of this image", [R.s.ControlNetPose]: "You\u2019ve referenced the pose of this image", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "You\u2019ve referenced the style reference of this image", [R.s.StyleCode]: "", }; function n7(e) { return { [R.s.ByteEdit]: u.ZP.t( "image_reference_custom_description_detailed", {}, "Describe what you want the AI to refer to from this image and what to change. Example: Change the background color to green and make her hair short." ), [R.s.FaceGan]: "", [R.s.BgPaint]: "", [R.s.IpKeep]: "", [R.s.BasicBlend]: "", [R.s.ControlNetCanny]: "", [R.s.ControlNetDepth]: "", [R.s.ControlNetPose]: "", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.StyleCode]: "", }[e]; } var re = (e) => { var { ability: t, displayAbilities: i, blendImagePromptList: n, onChange: r, imagineParams: a, } = e, { isOversea: o } = (0, ns.G)(n$.e), s = (0, y.useMemo)(() => { var e, t = 0; null == n || n.forEach((e) => { n3.i[e.name] === R.s.FaceGan && ++t; }); var i = !o && 1 === t && n3.i[ null !== (e = null == a ? void 0 : a.name) && void 0 !== e ? e : "" ] !== R.s.FaceGan; return t > 1 || i; }, [n, a, o]); return (0, f.jsx)("div", { children: (0, f.jsxs)("div", { className: n1, children: [ (0, f.jsx)("div", { className: n2, children: (0, f.jsx)("p", { className: n6, children: u.ZP.t( "wimg2img_title_picturereference", {}, "Select what to reference" ), }), }), (0, f.jsx)("div", { className: n4, children: i.map((e) => { var i = e === R.s.FaceGan && s ? u.ZP.t( "dre_t2i_reference_option_more_faces", {}, "\u4EBA\u50CF\u5408\u5F71" ) : u.ZP.t(ti.rj[e], {}, ti.kQ[e]); return (0, f.jsx)( n0, { scene: n9[e], text: i, disabledText: u.ZP.t(n8[e], {}, n5[e]), checked: t === e, currentAbility: t, type: e, onChange: (t) => r(t, e), blendImagePromptList: n, imagineParams: a, tip: n7(e), }, e ); }), }), ], }), }); }, rt = { closeBtn: "closeBtn-ZWXEaM", abilitySelect: "abilitySelect-07U1z7", footer: "footer-q34R5T", }, ri = i("293793"), rn = i("787424"), rr = i("170197"), ra = { [R.s.FaceGan]: "wimg2img_content_faceidentifying", [R.s.BgPaint]: "wimg2img_content_mainidentifying", [R.s.IpKeep]: "IP_web_loading", [R.s.BasicBlend]: "", [R.s.ControlNetCanny]: "canny_detect", [R.s.ControlNetDepth]: "depth_detect", [R.s.ControlNetPose]: "pose_detect", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.ByteEdit]: "", [R.s.StyleCode]: "", }, ro = "reference_image_recognizing_toast", rs = { [R.s.FaceGan]: "wimg2img_toast_identifyfaild", [R.s.BgPaint]: "wimg2img_toast_faild", [R.s.IpKeep]: "IP_web_failed", [R.s.BasicBlend]: "", [R.s.ControlNetCanny]: "canny_network_fail", [R.s.ControlNetDepth]: "depth_network_error", [R.s.ControlNetPose]: "pose_network_fail", [R.s.Unknown]: "", [R.s.ControlNet]: "", [R.s.Text2image]: "", [R.s.Image2image]: "", [R.s.StyleReference]: "", [R.s.ByteEdit]: "", [R.s.StyleCode]: "", }, rl = i("649843"), rc = i("475578"), rd = "no face was detected", ru = "no pose was detected", rf = "safety check not passed", rh = i("100470"), rp = i("280166"), rv = i("186827"), rm = i("242566"), rg = i("586315"), r_ = i("819340"), ry = i("745017"), rb = i("460911"), rI = i("645078"); function rw(e) { var t = { [rl.J.Cancelled]: rc.MK.Cancel, [rl.J.Success]: rc.MK.Success, [rl.J.Empty]: rc.MK.Fail, [rl.J.NetworkError]: rc.MK.Fail, [rl.J.DownloadImageError]: rc.MK.Fail, [rl.J.FacePredictError]: rc.MK.Fail, [rl.J.NoSegmentObjectFoundError]: rc.MK.Fail, [rl.J.SegmentFailedError]: rc.MK.Fail, [rl.J.PoseDetectError]: rc.MK.Fail, [rl.J.IpKeepMultipySubject]: rc.MK.Success, [rl.J.SafetyCheckError]: rc.MK.Fail, [rl.J.IpKeepNoSubject]: rc.MK.Success, [rl.J.ImageIPIsBlocked]: rc.MK.Fail, }, i = { [rl.J.Cancelled]: "", [rl.J.Success]: "", [rl.J.Empty]: rd, [rl.J.NetworkError]: rc.r$[rh.b.ErrCommon], [rl.J.DownloadImageError]: rc.r$[rh.b.ErrDownloadImage], [rl.J.FacePredictError]: rc.r$[rh.b.ErrFacePredict], [rl.J.ImageIPIsBlocked]: rc.r$[rh.b.ErrPreTextIPBlockList], [rl.J.NoSegmentObjectFoundError]: rc.r$[rh.b.ErrNoSegmentObjectFound], [rl.J.SegmentFailedError]: rc.r$[rh.b.ErrSegmentFailed], [rl.J.PoseDetectError]: ru, [rl.J.IpKeepMultipySubject]: "", [rl.J.SafetyCheckError]: rf, [rl.J.IpKeepNoSubject]: "", }; return { reportStatus: t[e], reportFailReason: i[e] }; } var rx = (function () { var e = (0, n._)(function* (e) { var { containerService: t, file: i, isAdd: n } = e, r = t.invokeFunction((e) => e.get(rp.Y)), a = t.invokeFunction((e) => e.get(r_.Z)), o = n ? rv.ZF.Add : rv.ZF.Replace, s = Date.now(), l = a.getImageXUploader(r.appId, ry.I), c = yield l.uploadImage({ file: i }), d = Date.now() - s; if (!(null == c ? void 0 : c.ok)) { var f = u.ZP.t( "wimg2img_toast_neterror", {}, "Check your internet connection and try again" ); return ( (0, rv.rR)(t, { importType: rc.ge.aigcImage, status: rc.MK.Fail, type: o, actionType: rv.mG.Click, failReason: f, costTime: d, }), (0, rm.N)(t, { status: rm.G.Failed, failReason: null == c ? void 0 : c.msg, failCode: null == c ? void 0 : c.code, size: i.size, format: i.type, costTime: d, source: "origin", }), C.s.warning(f), (0, rg.wf)( null == c ? void 0 : c.code, null == c ? void 0 : c.msg, null == c ? void 0 : c.errorInfo ) ); } var { uri: h } = c.value; return ( (0, rv.rR)(t, { importType: rc.ge.aigcImage, status: rc.MK.Success, type: o, actionType: rv.mG.Click, costTime: d, }), (0, rm.N)(t, { status: rm.G.Success, size: i.size, format: i.type, costTime: d, source: "origin", }), (0, rg.oW)(h) ); }); return function (t) { return e.apply(this, arguments); }; })(), rS = (() => { var e = new rb.V("imagine-modal-upload-image"); return (function () { var t = (0, n._)(function* (t) { var i = Date.now(), n = yield (0, rI.r)(t.file), r = e.getItem(n); if (r) { var a = Date.now() - i, o = t.isAdd ? rv.ZF.Add : rv.ZF.Replace; return ( (0, rv.rR)(t.containerService, { importType: rc.ge.aigcImage, status: rc.MK.Success, type: o, actionType: rv.mG.Click, costTime: a, useCache: !0, }), (0, rm.N)(t.containerService, { status: rm.G.Success, size: t.file.size, format: t.file.type, costTime: a, useCache: !0, source: "origin", }), (0, rg.oW)(r) ); } var s = yield rx(t); return s.ok && e.setItem(n, s.value), s; }); return function (e) { return t.apply(this, arguments); }; })(); })(); function rM(e) { return ( e === R.s.ControlNetCanny || e === R.s.ControlNetDepth || e === R.s.ControlNetPose ); } var rC = i("881607"); class rT { getEventParams() { return (0, rC.cu)((0, r._)({}, this._params)); } constructor(e) { (this._params = e), (this.eventName = "blend_recognize_time"); } } function rA(e, t) { (0, N.S$)(e, rT, [t]); } function rk(e) { return (0, n._)(function* () { for (var t = arguments.length, i = Array(t), n = 0; n < t; n++) i[n] = arguments[n]; var r = Date.now(); return { result: yield e(...i), timeCost: Date.now() - r }; }); } var rP = i("19658"), rE = (e) => "file" in e, rD = -4, rR = [ R.s.FaceGan, R.s.BgPaint, R.s.ControlNetCanny, R.s.ControlNetDepth, R.s.ControlNetPose, ], rN = "wimg2img_toast_neterror", rL = "character_creating_import_photo_fail_tips", rj = "IP_web_none", rO = "dreamina_character_reference_block_toast", rB = (e) => { var t, { graphicToolInstance: i, imagineParams: r, image: a, containerService: o, selectedImageLength: s, displayAbilities: l, } = e, [c, d] = (0, y.useState)(R.s.Unknown), [h, p] = (0, y.useState)(!1), [v] = nt(h, ti.p4), [m] = nt(h, ti.Ze); (0, ns.G)(rP.S); var [g, _] = (0, y.useState)(!1), b = (0, y.useRef)(0), I = (0, y.useRef)(Promise.resolve(void 0)), w = (0, y.useRef)(), x = (0, y.useRef)(new rn.J()), S = (0, y.useRef)(null), M = (0, y.useRef)(0); (0, y.useLayoutEffect)(() => { if (!!S.current) M.current = S.current.getBoundingClientRect().top; }, []); var T = (function () { var e = (0, n._)(function* (e) { b.current = 1; var t = yield e; return (b.current = t.ok ? 2 : 3), t.ok ? t.value : void 0; }); return function (t) { return e.apply(this, arguments); }; })(), A = (e) => { C.s.warning({ content: u.oc.t(e), position: "top", style: { position: "relative", top: "".concat(M.current + rD, "px"), }, }); }, k = (e) => { d(e), null == i || i.changeCurrentAbility(e), _(e === R.s.Unknown); }, P = (e, t) => { var i = rs[e]; switch (t) { case rl.J.Success: k(e); break; case rl.J.NetworkError: A(rN); break; case rl.J.Empty: A(i); break; case rl.J.DownloadImageError: case rl.J.FacePredictError: A(rN); break; case rl.J.NoSegmentObjectFoundError: case rl.J.SegmentFailedError: case rl.J.PoseDetectError: A(i); break; case rl.J.SafetyCheckError: A(rO); break; case rl.J.IpKeepMultipySubject: k(e), A(rL); break; case rl.J.IpKeepNoSubject: k(e), A(rj); break; case rl.J.ImageIPIsBlocked: A(rO); } }, E = (e, t) => { if (!!(t && rR.includes(e))) { var { reportStatus: i, reportFailReason: n } = rw(t); e !== R.s.ControlNet && e !== R.s.Unknown && (0, iV.E)(o, { status: i, failReason: n, type: ti.hW[e], importType: rc.ge.aigcImage, }); } }, D = () => { var e = u.oc.t( "wimg2img_toast_neterror", {}, "Check your internet connection and try again" ); C.s.warning(e); }, N = (0, ri.default)( (function () { var e = (0, n._)(function* (e, t) { if (e === R.s.Unknown) return; var r, a = null !== (r = M.current) && void 0 !== r ? r : 0, s = ra[e], l = null == i ? void 0 : i.getInstanceByAbility(e), c = 1 === b.current, d = !!s, h = d ? s : ro, p = d || c; p && x.current.show( (0, f.jsx)(rr.G, { style: { top: "".concat(a, "px") }, content: (0, f.jsxs)(f.Fragment, { children: [ (0, f.jsx)(Q.XG, { size: Q.XJ.Middle }), (0, f.jsx)("span", { style: { paddingLeft: "8px" }, children: u.oc.t(h), }), ], }), onCancel: () => { null == l || l.cancelRecognize(), x.current.hide(); }, }) ); var v = rk( (0, n._)(function* () { return yield I.current; }) ), { result: m, timeCost: g } = yield v(); if (!m) { rA(o, { imageUploadTime: g, recognizeTime: 0, totalTime: g, ability: e, }), x.current.hide(), D(); return; } var _ = rk( (0, n._)(function* () { return yield null == l ? void 0 : l.recognize(m, w.current); }) ), { result: y, timeCost: S } = yield _(); if ( (rA(o, { imageUploadTime: g, recognizeTime: S, totalTime: g + S, ability: e, }), p && y !== rl.J.Cancelled && (e !== R.s.BgPaint || y !== rl.J.Success) && x.current.hide(), !!y) ) P(e, y), null == t || t.afterHandleRecognizeResult(e, y), rR.includes(e) && E(e, y); }); return function (t, i) { return e.apply(this, arguments); }; })() ), L = () => { var e = l.includes(R.s.ByteEdit); if (!(s > 0) && !!e) { var t = R.s.ByteEdit; null == i || i.changeCurrentAbility(t), N(t, { afterHandleRecognizeResult: (e, i) => { i === rl.J.SafetyCheckError && (d(t), _(!0)); }, }); } }, j = (0, ri.default)( (function () { var e = (0, n._)(function* (e, t) { if (!e) { d(R.s.Unknown), _(!0); return; } if (t !== R.s.Unknown) { _(!1); var n = null == i ? void 0 : i.getInstanceByAbility(t); if (null == n ? void 0 : n.isRecognized) { null == i || i.changeCurrentAbility(t), d(t); return; } yield N(t); } else d(t), null == i || i.changeCurrentAbility(c); }); return function (t, i) { return e.apply(this, arguments); }; })() ), O = (0, ri.default)((e) => { var t; if (!rE(e)) { null == i || i.reset(); var { uri: n, url: r } = e; (w.current = r), (I.current = T(Promise.resolve((0, rg.oW)(n)))), L(); return; } null == i || i.reset(), (w.current = e.file), (I.current = T( rS({ containerService: o, file: e.file, isAdd: !0 }) )), null == i || null === (t = i.preloadManager) || void 0 === t || t.handleUploadTransparentPngInIdleTime(e.file), L(); }), B = (0, ri.default)((e, t) => { if (rE(e)) (r = rS({ containerService: o, file: e.file, isAdd: !1 })), null == i || null === (a = i.preloadManager) || void 0 === a || a.handleUploadTransparentPngInIdleTime(e.file), (w.current = e.file); else { var n, r, a, { uri: s, url: l } = e; (w.current = l), (r = Promise.resolve((0, rg.oW)(s))); } null == i || i.changeCurrentAbility(t), null == i || null === (n = i.activeInstance) || void 0 === n || n.reset(), (I.current = T(r)), N(t); }), F = (0, ri.default)((e, t) => { if ("uri" in e) { var n, r = t.name; (0, nx.od)(t) && (r = (0, nS.O)(t)), (w.current = e.url); var a = (0, rg.oW)(e.uri); (I.current = T(Promise.resolve(a))), k(r), null == i || null === (n = i.activeInstance) || void 0 === n || n.initWithImagineParams(e.uri, t); } }), U = (0, ri.default)(() => { x.current.hide(); }), G = (0, ri.default)((e, t) => { if (!!rS) { if (e && !t) { O(e); return; } if (null == t ? void 0 : t.isReplace) { var { name: i } = t; (0, nx.od)(t) && (i = (0, nS.O)(t)), B(e, i); return; } if (e && t) { F(e, t); return; } } }); return ( (0, y.useEffect)(() => { G(a, r), I.current.then((e) => { e && (null == i || i.preloadRecognize(l, e, w.current)); }); }, [r, a, i]), (0, y.useEffect)(() => { var e; p( !!( rM(c) && (null == i ? void 0 : null === (e = i.activeInstance) || void 0 === e ? void 0 : e.isRecognized) ) ); }, [ c, null == i ? void 0 : null === (t = i.activeInstance) || void 0 === t ? void 0 : t.isRecognized, ]), { toastContainerRef: S, abilityType: c, isControlNetPreview: h, isControlNetPreviewDelay: v, isControlNetPreviewFurtherDelay: m, handleAbilityChange: j, hideLoading: U, disableSave: g, } ); }, rF = (e) => { var [t, i] = (0, y.useState)(e), n = (0, y.useRef)(null); return ( (0, y.useEffect)(() => { if (!!n.current) i((0, i9.VQ)(n.current)); }, [n]), (0, y.useEffect)(() => { var e = () => { if (!!n.current) i((0, i9.VQ)(n.current)); }; return ( window.addEventListener("resize", e), () => { window.removeEventListener("resize", e); } ); }, []), { containerWidth: t.width, containerHeight: t.height, containerRef: n, } ); }, rU = i("128468"), rG = "ratioConfig-aNbSrL", rz = "text-qKCU9q", rV = "iconWrap-D33O4L", rW = "icon-tWLnlL", rZ = "iconActive-CjNEyl", rK = "ratioConfigSelected-I885gV", rH = i("314068"), rq = i("752134"), rJ = function (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "", n = { [s.jP.OneOne]: { w: 20, h: 20 }, [s.jP.FourThree]: { w: 24, h: 18 }, [s.jP.ThreeTwo]: { w: 24, h: 16 }, [s.jP.SixteenNine]: { w: 24, h: 14 }, [s.jP.TwentyOneNine]: { w: 24, h: 10.5 }, [s.jP.ThreeFour]: { w: 18, h: 24 }, [s.jP.TwoThree]: { w: 16, h: 24 }, [s.jP.NineSixteen]: { w: 14, h: 24 }, }; return (0, f.jsx)("div", { className: rV, children: (0, f.jsx)("div", { className: eY()(rW, { [rZ]: t, [i]: t }), style: { width: "".concat(n[e].w, "px"), height: "".concat(n[e].h, "px"), }, }), }); }, rY = (e) => { var { configList: t, isDimensionLocked: i = !0, largeImageInfo: n = rH.jg, handleUpdateRatio: r, } = e, a = (e) => (0, rq.d$)(e, n) && i; return (0, f.jsx)(f.Fragment, { children: t.map((e) => { var { text: t, type: i } = e, n = eY()(rG, { [rK]: a(i) }); return (0, f.jsxs)( "div", { className: n, onClick: () => r(i), children: [ rJ(e.type, a(i)), (0, f.jsx)("div", { className: rz, children: t }), ], }, t ); }), }); }; class rQ { getEventParams() { var { secondPage: e, scale: t } = this._params; return { second_page: e, scale: t }; } constructor(e) { (this._params = e), (this.eventName = "click_scale"); } } function rX(e, t) { (0, N.Kl)(e, rQ, [t]); } var r$ = i("998463"), r0 = { container: "container-G31wkc", titleContainer: "titleContainer-hwa8Yb", title: "title-L284mT", selectIcon: "selectIcon-caacFl", sameRatio: "sameRatio-k0NV6X", ratioConfigContainer: "ratioConfigContainer-TtIJaS", }; class r1 { getEventParams() { var { action: e } = this._params; return { action: e }; } constructor(e) { (this._params = e), (this.eventName = "same_ratio_refer"); } } function r2(e, t) { (0, N.Kl)(e, r1, [t]); } var r6 = (e) => { var { generateImageParamsManager: t, isUseOriginRatio: i, page: n, secondPage: r, onUpdate: a, onSwitchUseOriginRatio: o, } = e, s = (0, ek.k)(t, (e) => ({ largeImageInfo: e.largeImageInfo, isDimensionLocked: e.isDimensionLocked, selectType: e.imageRatio, mode: e.mode, canCustomSize: e.canCustomSize, })), l = (0, D.lS)(), { largeImageInfo: c, selectType: d, mode: h, isDimensionLocked: v, canCustomSize: m, } = null != s ? s : {}, g = h === rU.JU.Story ? r$.sY : r$.RT, _ = (e) => { null == t || t.updateImageRatio(e), rX(l, { page: n, secondPage: r, scale: rc.lS[e] }), null == a || a(e); }, y = () => { null == o || o(), r2(l, { action: rc.tz.Click }); }; return (0, f.jsxs)("div", { className: r0.container, children: [ (0, f.jsxs)("div", { className: r0.titleContainer, children: [ (0, f.jsx)("div", { className: r0.title, children: u.oc.t("tool_adjust_ration", {}, "Aspect ratio"), }), m && (0, f.jsxs)("div", { className: r0.sameRatio, onClick: y, children: [ i ? (0, f.jsx)(p.eOZ, { className: r0.selectIcon }) : (0, f.jsx)(p.uCw, { className: r0.selectIcon }), (0, f.jsx)("span", { children: u.oc.t("ratio_ratio_align"), }), ], }), ], }), (0, f.jsx)("div", { className: r0.ratioConfigContainer, children: (0, f.jsx)(rY, { configList: g, isDimensionLocked: v, largeImageInfo: c, handleUpdateRatio: _, }), }), ], }); }, r4 = { imageRatio: "imageRatio-WR6Hlx", imageRatioContent: "imageRatioContent-oyUEa8", button: "button-c7Rdwk", disabled: "disabled-l1B929", icon: "icon-Pfyrwq", iconActive: "iconActive-o7kAvZ", }; class r3 { getEventParams() { var { page: e, secondPage: t } = this._params; return { page: e, second_page: t }; } constructor(e) { (this._params = e), (this.eventName = "click_scale_entrance"); } } function r8(e, t) { (0, N.Kl)(e, r3, [t]); } var r9 = i("415467"), r5 = i("575088"), r7 = i("461874"), ae = (0, y.forwardRef)((e, t) => { var { generateImageParamsManager: i, isUseOriginRatio: n, disabled: r, disableTip: a, onSwitchUseOriginRatio: o, onWidthChange: s, } = e, l = (0, ek.k)(i, (e) => ({ selectType: e.imageRatio, customRatio: e.customRatio, canCustomSize: e.canCustomSize, largeImageInfo: e.largeImageInfo, })), c = (0, D.lS)(), d = (0, y.useRef)(null), h = (0, y.useRef)(null), [v, m] = (0, y.useState)(!1), g = (e) => { m(e), e && (r8(c, { page: rc.WZ.Home, secondPage: rc.yc.Reference }), r2(c, { action: rc.tz.Show }), (0, r5.b_)(c, { page: r5.D$.Reference, action: rc.tz.Show, item: r5.xQ.Ratio, })); }, _ = (e) => { var t; null === (t = d.current) || void 0 === t || t.close(), (0, r5.b_)(c, { action: rc.tz.Click, item: r5.xQ.Ratio, page: r5.D$.Reference, ratioValue: rc.lS[e], }); }; (0, y.useImperativeHandle)(t, () => ({ getClientWidth() { var e, t; return null !== (t = null === (e = h.current) || void 0 === e ? void 0 : e.clientWidth) && void 0 !== t ? t : 0; }, })); var { selectType: b, canCustomSize: I, largeImageInfo: w, } = null != l ? l : {}, x = b && (0, r7.R6)(w) ? "".concat( u.ZP.t( "ratio_ratio_number", { ratio: b ? r$.pC[b] : "" }, "Aspect ratio {ratio}" ) ) : "".concat( u.ZP.t("ratio_ratio_customize", {}, "Aspect ratio") ); return ( (0, y.useEffect)(() => { if (x) { var e, t; null == s || s( null !== (t = null === (e = h.current) || void 0 === e ? void 0 : e.clientWidth) && void 0 !== t ? t : 0 ); } }, [s, x]), (0, f.jsx)(i1.E, { ref: d, containerClassName: r4.imageRatio, contentClassName: r4.imageRatioContent, content: (0, f.jsxs)(f.Fragment, { children: [ (0, f.jsx)(r6, { page: rc.WZ.Home, isUseOriginRatio: n, secondPage: rc.yc.Reference, generateImageParamsManager: i, onUpdate: _, onSwitchUseOriginRatio: o, }), I && (0, f.jsx)(r9.e, { instance: i, containerService: c, page: r5.D$.Reference, }), ], }), contentStyle: { display: v ? "block" : "none" }, onVisibleChange: g, isDisable: r, children: (0, f.jsx)(tK.Z, { position: "top", triggerProps: { trigger: "hover" }, content: a, disabled: !r, children: (0, f.jsxs)("div", { className: eY()(r4.button, { [r4.active]: v, [r4.disabled]: r, }), ref: h, children: [ x, (0, f.jsx)(p.f5h, { size: 12, className: eY()(r4.icon, v ? r4.iconActive : ""), }), ], }), }), }) ); }), at = { warningIcon: "warningIcon-I1XpiW", ratioWarningTip: "ratioWarningTip-mB6CbF", text: "text-opM2Ji", btnWrap: "btnWrap-OvSNtA", }, ai = 98, an = 4, ar = (e) => { var { imageRatio: t, rightDistance: i = ai, onUpdate: n } = e, [r, a] = (0, y.useState)(!1), o = (0, D.lS)(); (0, y.useEffect)(() => { r && (0, A.rx)(o, { action: A.Ix.Show, type: A.xh.ChangeScale }); }, [r]); var s = () => { a(!1), (0, A.rx)(o, { action: A.Ix.Cancel, type: A.xh.ChangeScale }); }, l = () => { a(!1), n(), (0, A.rx)(o, { action: A.Ix.Confirm, type: A.xh.ChangeScale }); }, c = () => { a(!0); }, d = () => { a(!1); }; return (0, f.jsx)(tK.Z, { className: at.ratioWarningTip, showArrow: !0, popupVisible: r, content: (0, f.jsxs)("div", { className: at.tooltipContent, onMouseLeave: d, children: [ (0, f.jsx)("div", { className: at.text, children: u.ZP.t( "ratio_difference", { ratio: r$.pC[t] }, "The aspect ratio of the reference image is quite different from the selected aspect ratio for the generated image. Change to {ratio}?" ), }), (0, f.jsxs)("div", { className: at.btnWrap, children: [ (0, f.jsx)(v.J, { text: u.ZP.t("ratio_no_action", {}, "Not now"), type: "tertiary", className: at.notProcess, onClick: s, }), (0, f.jsx)(v.J, { text: u.ZP.t("ratio_switch_now", {}, "Change"), className: at.changeNow, onClick: l, }), ], }), ], }), children: (0, f.jsx)(p.lHv, { className: at.warningIcon, style: { right: "".concat(i + an, "px") }, onMouseEnter: c, }), }); }, aa = (e, t, i, n) => { var r, { width: a, height: o } = ne("file" in e ? e.file : e.url), l = a / o, c = null !== (r = (0, d.Ir)(void 0, a, o)) && void 0 !== r ? r : s.jP.OneOne, u = Math.abs(ti.mg[c] - l), f = Math.abs(n.width / n.height - l) > u, h = (i === R.s.ControlNetDepth || i === R.s.ControlNetCanny) && f, p = () => { null == t || t.updateImageRatio(c); }; return { showWarning: h, maxCloseRatioType: c, changeToMaxCloseRatioType: p, }; }, ao = i("2654"), as = i("121365"), al = (e, t, i) => { var n = (0, ek.k)(e, (e) => ({ isUseOriginRatio: e.isUseOriginRatio, })), { isUseOriginRatio: r = !1 } = null != n ? n : {}, a = () => { r ? null == e || e.updateImageRatio(s.jP.OneOne) : (null == e || e.updateReferenceOriginRatio(t / i), null == e || e.updateImageRatio(void 0), null == e || e.updateLargeImageInfo((0, as.KY)(t, i))), null == e || e.updateIsSameOriginRatio(!r); }; return { isUseOriginRatio: r, handleSwitchUseOriginRatio: a }; }; function ac(e) { var { generateImageParamsManager: t, abilityType: i, width: n, height: r, } = e, a = (0, y.useRef)({ referenceOriginRatio: null == t ? void 0 : t.referenceOriginRatio, imageRatio: null == t ? void 0 : t.imageRatio, largeImageInfo: null == t ? void 0 : t.largeImageInfo, isUseOriginRatio: null == t ? void 0 : t.isUseOriginRatio, }); (0, y.useEffect)(() => { if (i === R.s.ByteEdit && n && r) { (a.current = { referenceOriginRatio: null == t ? void 0 : t.referenceOriginRatio, imageRatio: null == t ? void 0 : t.imageRatio, largeImageInfo: null == t ? void 0 : t.largeImageInfo, isUseOriginRatio: null == t ? void 0 : t.isUseOriginRatio, }), null == t || t.updateReferenceOriginRatio(n / r), null == t || t.updateImageRatio(void 0), null == t || t.updateLargeImageInfo((0, as.KY)(n, r)), null == t || t.updateIsSameOriginRatio(!0); return; } var { referenceOriginRatio: e, imageRatio: o, largeImageInfo: s, isUseOriginRatio: l, } = a.current; void 0 !== e && (null == t || t.updateReferenceOriginRatio(e)), null == t || t.updateImageRatio(o), void 0 !== s && (null == t || t.updateLargeImageInfo(s)), void 0 !== l && (null == t || t.updateIsSameOriginRatio(l)); }, [i, t, n, r]); } var ad = (e) => { var t, i, { image: n, params: r, children: a, onSave: o, containerService: s, imcConfigService: l, displayAbilities: c, imagePromptList: d, generateImageParamsManager: h, } = e, p = null === (t = ep.o.getGraphicToolStoreInstance) || void 0 === t ? void 0 : t.call(ep.o, s); null == p || p.setGenerateImageParamsManager(h); var v = (0, ek.k)(h, (e) => ({ selectImageRatio: e.imageRatio, largeImageInfo: e.largeImageInfo, prompt: e.prompt, generatePromptParams: e.generatePromptParams, })), { selectImageRatio: m, largeImageInfo: g = rH.jg, generatePromptParams: _, } = null != v ? v : {}, { imagePromptList: b = [] } = null != _ ? _ : {}, I = null != d ? d : b, { abilityType: w, handleAbilityChange: x, toastContainerRef: S, isControlNetPreview: M, isControlNetPreviewDelay: C, isControlNetPreviewFurtherDelay: T, hideLoading: A, disableSave: k, } = rB({ image: n, imagineParams: r, graphicToolInstance: p, containerService: s, selectedImageLength: I.length, displayAbilities: c, }), { containerRef: P, containerHeight: E, containerWidth: N, } = rF(i9.tn), O = (0, y.useRef)(null), [B, F] = (0, y.useState)( null === (i = O.current) || void 0 === i ? void 0 : i.getClientWidth() ), U = null != m ? m : ti.k0, { showWarning: z, maxCloseRatioType: W, changeToMaxCloseRatioType: Z, } = aa(n, h, w, g), { width: K, height: H } = np(n), { isUseOriginRatio: J, handleSwitchUseOriginRatio: Y } = al( h, K, H ), { width: Q, height: X } = (0, i9.Vv)(g, C ? (N - ti.yY) / 2 : N, E); ac({ abilityType: w, generateImageParamsManager: h, width: K, height: H, }); var $ = (0, y.useRef)(!1), ee = () => { if (!$.current) { if ( (($.current = !0), V(s, { action: L.Click, item: j.Save }, G, h), w === R.s.Unknown) ) { $.current = !1; return; } var e = null == p ? void 0 : p.getImagineParam(); if (!e) { $.current = !1; return; } (0, ao.L)(s, { step: ao.K.FromModal, data: JSON.stringify(e) }), o(e), ($.current = !1); } }, et = w !== R.s.Unknown, ei = w === R.s.ByteEdit, en = ei ? u.ZP.t( "custom_reference_change_ration", {}, "Can't change the aspect ratio after selecting custom reference" ) : ""; return n ? (0, f.jsx)(D.dR.Provider, { value: { imcConfigService: l, generateImageParamsManager: h }, children: (0, f.jsx)(D.Gj.Provider, { value: s, children: (0, f.jsxs)("div", { id: ti.uS, ref: P, children: [ (0, f.jsx)("div", { className: rt.imgContainer, ref: S, style: { height: "".concat(E, "px"), width: "".concat(N, "px"), }, children: (0, f.jsx)(nv, { abilityType: w, image: n, params: r, containerWidth: N, containerHeight: E, paintHeight: X, paintWidth: Q, ratio: U, largeImageInfo: g, isControlNetPreview: M, isControlNetPreviewDelay: C, isControlNetPreviewFurtherDelay: T, hideLoading: A, }), }), (0, f.jsxs)("div", { className: rt.abilitySelect, children: [ (0, f.jsx)(ae, { generateImageParamsManager: h, ref: O, isUseOriginRatio: J, onSwitchUseOriginRatio: Y, disabled: ei, disableTip: en, onWidthChange: F, }), z && (0, f.jsx)(ar, { rightDistance: B, imageRatio: W, onUpdate: Z, }), (0, f.jsx)("input", { type: "checkbox", style: { position: "absolute", top: 0, left: 0, width: 0, height: 0, opacity: 0, }, tabIndex: 1, }), (0, f.jsx)(re, { ability: w, onChange: x, displayAbilities: c, blendImagePromptList: I, imagineParams: r, children: a, }), ], }), (0, f.jsx)("div", { className: rt.footer, children: (0, f.jsx)(q, { disablePopover: et, available: !k, onClick: ee, }), }), ], }), }), }) : null; }, au = i("539686"); function af() { return !navigator.userAgent.includes("Chrome/131"); } function ah(e) { var t, i, { containerService: n, image: r, params: a, onSave: o, imcConfigService: s, displayAbilities: l, imagePromptList: c, generateImageParamsManager: d, onCancel: v, } = e, m = null === (t = ep.o.getGraphicToolStoreInstance) || void 0 === t ? void 0 : t.call(ep.o, n), g = () => { null == i || i.close(), (i = void 0), null == m || m.reset(); }, _ = (e) => { g(), null == o || o(e); }, y = () => { null == m || m.reset(), null == v || v(); }; return ( (0, au.M)(n, { secondPage: rc.yc.Reference }), (i = h.Z.confirm({ ariaModal: af(), wrapClassName: ti.Mp, title: u.ZP.t("wimg2img_title_reference", {}, "Reference image"), footer: null, simple: !1, escToExit: !1, icon: null, closeIcon: (0, f.jsx)(p.Rnl, { className: rt.closeBtn }), closable: !0, maskClosable: !1, onCancel: y, content: (0, f.jsx)(ns.$, { instantiationService: n, children: (0, f.jsx)(ad, { image: r, params: a, displayAbilities: l, containerService: n, imcConfigService: s, imagePromptList: c, generateImageParamsManager: d, onSave: _, onClose: g, children: (0, f.jsx)(W, {}), }), }), })) ); } var ap = i("683973"), av = 2; function am(e) { if (!e) return; var { largeImageInfo: t, imageRatio: i, isDimensionLocked: n, isUseOriginRatio: r, canCustomSize: a, } = e; if (!!a) { var o = { widthValue: t.width, heightValue: t.height, isLock: n, isSameRatio: r, }; return ( !(0, r7.rh)(t) && (o.ratioValue = rc.lS[null != i ? i : s.jP.OneOne]), o ); } } function ag(e) { for (var t of e) if (t.name === l.UI.StyleReference) { var i, n, r, a, o = ( null == t ? void 0 : null === (i = t.styleReference) || void 0 === i ? void 0 : i.styleType ) ? ap.uK[ null == t ? void 0 : null === (n = t.styleReference) || void 0 === n ? void 0 : n.styleType ] : void 0; if (o !== ap.uK[c.l.Preset]) return { styleSource: o }; return { presetStyleId: null == t ? void 0 : null === (r = t.styleReference) || void 0 === r ? void 0 : r.styleItemId, presetStyleName: null == t ? void 0 : null === (a = t.styleReference) || void 0 === a ? void 0 : a.styleTitle, styleSource: o, }; } return {}; } var a_ = (0, o.Tx)( "generateContent", (function () { var e = (0, n._)(function* (e, t, i) { var { instance: n, reportParam: r, reportService: a, onGenerateContentUpdate: o, generateImageParamsManager: s, prompt: l, promptList: c, submitId: d, modelConfig: f, imageRatio: h, largeImageInfo: p, containerService: v, } = t, m = null != c ? c : s.generatePromptParams.imagePromptList; if (n.isPendingGenerate) { C.s.warning( u.oc.t("attempt_max", {}, "Too many attempts. Try again later.") ); return; } if ( (n.increasePendingGenerateCount(), null == m ? void 0 : m.length) ) g = null !== (_ = yield n.generateBlendContent( e, { reportParam: r, onGenerateContentUpdate: o, isQueue: !0 }, i )) && void 0 !== _ ? _ : null; else { var g, _, y, b = { prompt: l, submitId: d, modelConfig: f, imageRatio: h, largeImageInfo: p, model: null == f ? void 0 : f.modelReqKey, }; g = null !== (y = yield n.generateContent( e, { reportParam: r, onGenerateContentUpdate: o, isQueue: !0 }, i, b )) && void 0 !== y ? y : null; } (0, ap.TQ)({ result: g, reportService: a, customSizeReportParams: am(s), clickGenerateReportParam: r, customStyleReportParams: ag(m), containerService: v, }), n.decreasePendingGenerateCount(); }); return function (t, i, n) { return e.apply(this, arguments); }; })() ); function ay(e, t) { var i = e; if (!i && t) { var n = t.name === R.s.ControlNet, r = t.name === R.s.BgPaint, a = 0, o = 1, s = 3, l = 1; if ("imageUriList" in t) { if (r) { var c, d, u, f, h, p, v = t.imageUriList.length === av; i = null !== (p = null === (h = t.imageUriList) || void 0 === h ? void 0 : h[v ? l : s]) && void 0 !== p ? p : ""; } else i = n ? null !== (d = null === (c = t.imageUriList) || void 0 === c ? void 0 : c[o]) && void 0 !== d ? d : "" : null !== (f = null === (u = t.imageUriList) || void 0 === u ? void 0 : u[a]) && void 0 !== f ? f : ""; } else i = ""; } return null != i ? i : ""; } function ab(e) { var { containerService: t, onModalSave: i, imageInfo: n, params: o, imcConfigService: s, displayAbilities: l, imagePromptList: c, generateImageParamsManager: d, onModalCancel: u, } = e, { uri: f, url: h, file: p, id: v, width: m = 0, height: g = 0, coverUrl: _, } = n, y = ay(f, o); if (!!(p || h)) ah({ containerService: t, image: p ? { file: p } : { url: h, uri: y, width: m, height: g }, params: o, imcConfigService: s, displayAbilities: l, imagePromptList: c, generateImageParamsManager: d, onSave(e) { if (!!e) i( (0, a._)((0, r._)({}, e), { id: v, url: h, coverUrl: _ || h, uri: e.uri, width: m, height: g, }) ); }, onCancel: u, }); } function aI(e) { var t, i = e.map((e) => { var t, i, n; return null !== (n = null !== (i = null !== (t = e.uri) && void 0 !== t ? t : e.coverUrl) && void 0 !== i ? i : e.url) && void 0 !== n ? n : ""; }), n = { referenceCnt: null !== (t = null == e ? void 0 : e.length) && void 0 !== t ? t : 0, ipReference: 0, faceReferenceCnt: 0, subjectReferenceCnt: 0, inspirationReferenceCnt: 0, cannyReferenceCnt: 0, depthReferenceCnt: 0, poseReferenceCnt: 0, styleReferenceCnt: 0, instructReferenceCnt: 0, blendImageUriList: i.join(";"), templateStyleCode: void 0, }; return ( null == e || e.forEach((e) => { switch (e.name) { case l.UI.FaceGan: n.faceReferenceCnt += 1; break; case l.UI.BgPaint: n.subjectReferenceCnt += 1; break; case l.UI.BasicBlend: n.inspirationReferenceCnt += 1; break; case l.UI.IpKeep: var t = e.ipKeepList[0]; (n.ipReference += 1), (n.ipReferenceLevel = t.refIpWeight * ti.ux.ip.rate), (n.idReferenceLevel = t.refIdWeight * ti.ux.id.rate); break; case l.UI.StyleReference: (n.styleReferenceCnt += 1), (n.styleReferenceLevel = null === (a = e.imageWeightList) || void 0 === a ? void 0 : a[0]), (n.styleSource = ( null == e ? void 0 : null === (o = e.styleReference) || void 0 === o ? void 0 : o.styleType ) ? ap.uK[ null == e ? void 0 : null === (s = e.styleReference) || void 0 === s ? void 0 : s.styleType ] : void 0), n.styleSource === ap.uK[c.l.Preset] && ((n.presetStyleId = null == e ? void 0 : null === (d = e.styleReference) || void 0 === d ? void 0 : d.styleItemId), (n.presetStyleName = null == e ? void 0 : null === (u = e.styleReference) || void 0 === u ? void 0 : u.styleTitle)); break; case l.UI.ByteEdit: (n.instructReferenceCnt += 1), (n.instructReferenceLevel = "strength" in e ? (null !== (f = e.strength) && void 0 !== f ? f : 0) * ti.cR.max : 0); break; case l.UI.StyleCode: var { assetCode: i } = e.commonAsset; n.templateStyleCode = n.templateStyleCode ? "".concat(n.templateStyleCode, ",").concat(i) : i; } if ( (null === (r = e.controlNetList) || void 0 === r || r.forEach((e) => { var t, i = (null !== (t = e.strength) && void 0 !== t ? t : 0) * ti.XR.max; switch (e.name) { case l.kR.ControlNetCanny: (n.cannyReferenceCnt += 1), (n.cannyReferenceLevel = i); break; case l.kR.ControlNetDepth: (n.depthReferenceCnt += 1), (n.depthReferenceLevel = i); break; case l.kR.ControlNetPose: (n.poseReferenceCnt += 1), (n.poseReferenceLevel = i); } }), e.name === l.UI.ControlNet) ) { var r, a, o, s, d, u, f, h, p, v, m = JSON.parse( null !== (v = e.extra) && void 0 !== v ? v : "[]" ); null == m || null === (h = (p = m.filter(Boolean)).forEach) || void 0 === h || h.call(p, (e) => { var t = e.fitMode === R.G.CenterCrop ? rc.eD.True : rc.eD.False; switch (e.name) { case l.kR.ControlNetCanny: n.cannyCutout = t; break; case l.kR.ControlNetDepth: n.depthCutout = t; break; case l.kR.ControlNetPose: n.poseCutout = t; } }); } }), n ); } function aw(e) { for (var t of e) if (t.name === l.UI.IpKeep) { var i, n; return { aiRoleCount: t.ipKeepList.length, roleId: t.ipKeepList.map((e) => e.characterId).join(",") || void 0, roleFaceIntensity: null === (i = t.ipKeepList[0]) || void 0 === i ? void 0 : i.refIdWeight, roleSubjectIntensity: null === (n = t.ipKeepList[0]) || void 0 === n ? void 0 : n.refIpWeight, }; } return { aiRoleCount: 0 }; } function ax(e, t) { var i = { widthValue: t.width, heightValue: t.height }; if (e && !(0, r7.rh)(t)) { var n = (0, d.Ir)(e, t.width, t.height); n && (i.ratioValue = rc.lS[n]); } return i; } var aS = (e) => e.find((e) => e.name === l.UI.IpKeep); }, 474139: function (e, t, i) { "use strict"; i.d(t, { W: function () { return r; }, }); var n = i(441361), r = (e) => (null == e ? void 0 : e.replace(n.hQ, "")); }, 987689: function (e, t, i) { "use strict"; i.d(t, { w: () => p }); var n = i("139646"), r = i("772322"), a = i("2910"), o = i("949274"), s = i("188754"), l = i("369617"), c = i("625572"), d = i("379311"); class u { getEventParams() { return (0, c._)({}, this._params); } constructor(e) { (this._params = e), (this.eventName = "right_function"); } } function f(e, t) { (0, d.Kl)(e, u, [t]); } var h = i("782296"), p = (e) => { var { getWatermarkDownloadInfo: t, page: i, containerService: c, onCopy: d, } = e; return { key: "copy-image", text: o.ZP.t( "t2i_align_image_copy", {}, "\u590D\u5236\u56FE\u7247" ), icon: (0, r.jsx)(s.ATl, {}), handler: () => { var e = !1; (0, h.u)({ task: (0, n._)(function* () { try { var r = (function () { var r = (0, n._)(function* () { var { url: n } = yield t(), r = () => new Promise((e, t) => { var i = new Image(); (i.crossOrigin = "anonymous"), (i.src = (0, a.C)(n, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })), (i.onload = () => { e(i); }), (i.onerror = (e) => { t(e); }); }), o = (e) => new Promise((t, i) => { e.toBlob((e) => { e ? t(e) : i(Error("no blob generate")); }, "image/png"); }); f(c, { page: i, function: "copy", type: "image" }), null == d || d(); var s = yield r(); if (e) return Promise.reject(Error("cancel")); var l = document.createElement("canvas"); return ((l.width = s.width), (l.height = s.height), l .getContext("2d") .drawImage(s, 0, 0, l.width, l.height), e) ? Promise.reject(Error("cancel")) : o(l); }); return function () { return r.apply(this, arguments); }; })(), s = new ClipboardItem({ "image/png": r() }); yield navigator.clipboard.write([s]), l.s.success(o.ZP.t("copy_success", {}, "Copy Success")); } catch (e) { l.s.warning( o.ZP.t( "copy_failed_please_retry", {}, "Copy failure, please retry." ) ); } finally { } }), tipTxt: o.ZP.t("t2i_align_copying", {}, "Coping..."), onCancel: () => { e = !0; }, }); }, }; }; }, 882598: function (e, t, i) { "use strict"; i.d(t, { W: function () { return f; }, }); var n = i(139646), r = i(772322), a = i(949274), o = i(188754), s = i(369617), l = i(863209), c = i(683973), d = i(475578), u = i(782296), f = (e) => ({ key: "download-image", text: a.ZP.t( "t2i_align_image_download", {}, "\u4E0B\u8F7D\u56FE\u7247" ), icon: (0, r.jsx)(o.zpr, {}), handler: () => { var t = !1; (0, c.YA)( e.record, e.image, d.tz.Download, e.reportService, { download_source: "right_button" }, e.containerService ), (0, u.u)({ task: (0, n._)(function* () { try { var { url: i, fileName: n } = yield e.getWatermarkDownloadInfo(); yield (0, l.ue)(i, n, e.reportService, () => t), s.s.success( a.ZP.t( "result_toast_saved_success", {}, "Image downloaded" ) ); } catch (e) { if (t) return; s.s.warning( a.ZP.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ); } }), tipTxt: a.ZP.t("t2i_align_downloading", {}, "Downloading..."), onCancel: () => { t = !0; }, }); }, }); }, 976112: function (e, t, i) { "use strict"; i.d(t, { T: function () { return l; }, }); var n = i(772322), r = i(218571), a = i(949274), o = i(49841), s = i(202428), l = (e) => ({ key: "favorite-assert", CustomRender: (t) => { var { onClick: i } = t; return () => { var t, l, [c, d] = (0, r.useState)( null !== (l = null !== (t = e.initFavorited) && void 0 !== t ? t : e.hasFavorited) && void 0 !== l && l ); (0, r.useEffect)(() => { void 0 !== e.hasFavorited && d(e.hasFavorited); }, [e.hasFavorited]); var u = { image: a.ZP.t( "t2i_align_image_favourite", {}, "\u6536\u85CF\u56FE\u7247" ), video: a.ZP.t( "t2i_align_video_favourite", {}, "\u6536\u85CF\u89C6\u9891" ), audio: a.ZP.t( "ai_music_collemusic", {}, "\u6536\u85CF\u97F3\u4E50" ), }[e.type]; return ( c && (u = a.ZP.t( "assets_feature_hovertips_cancel_favourite", {}, "\u53D6\u6D88\u6536\u85CF" )), (0, n.jsx)( s.h, { disable: !1, text: u, icon: (0, n.jsx)(o.m, { useCurrentColor: !0, hasFavorited: c, }), onClick: i, handler: () => { void 0 === e.hasFavorited && d(!c), e.markFavorite(); }, }, "favorite-".concat(e.type) ) ); }; }, }); }, 338944: function (e, t, i) { "use strict"; i.d(t, { W: function () { return p; }, }); var n = i(625572), r = i(639880), a = i(772322); i(585071); var o = i(451550), s = i(293793), l = i(218571), c = i(105789), d = i.n(c), u = i(202428), f = i(678482), h = i(815112), p = (0, l.memo)(function (e) { var { className: t, contextMenuClassName: i, style: c, containerProps: p, disable: v = !1, onVisibleChange: m, children: g, baseOptions: _ = [], extraOptions: y = [], getPopupContainer: b, } = e, I = (0, l.useRef)(null), [w, x] = (0, l.useState)(!1), S = (0, s.default)((e, t) => { e.stopPropagation(), null == m || m(!1), x(!1), null == t || t(); }), M = (e) => { if ((e.preventDefault(), !v)) null == m || m(!0), x(!0); }, C = () => { null == m || m(!1), x(!1); }, T = (0, l.useCallback)( (e) => { if ("CustomRender" in e) { var t = e.CustomRender({ onClick: S }); return (0, a.jsx)(t, {}, e.key); } var { handler: i, key: n, text: r } = e; return (0, a.jsx)( u.h, { disable: e.disable, onClick: (e) => { S(e, i); }, icon: e.icon, text: r, }, n ); }, [S] ), A = (0, l.useMemo)( () => (0, a.jsxs)("div", { className: d()(h.Z.contextMenu, i, "mweb-context-menu"), children: [ _.length > 0 && _.map(T), y.length > 0 && _.length > 0 && (0, a.jsx)("div", { className: h.Z.contextMenuDivide }), y.length > 0 && y.map(T), ], }), [_, i, y, T] ), k = (0, s.default)(() => { if (!!w) x(!1); }); return ( (0, l.useEffect)(() => { if (!!I.current) { var e = (0, f.I)(I.current); return ( e.forEach((e) => { e.addEventListener("scroll", k); }), () => { e.forEach((e) => { e.removeEventListener("scroll", k); }); } ); } }, [k]), (0, a.jsx)(o.Z, { alignPoint: !0, position: "bl", trigger: ["contextMenu", "click"], popup: () => A, popupVisible: w, disabled: v, onClickOutside: C, onClick: C, getPopupContainer: b, children: (0, a.jsx)( "div", (0, r._)((0, n._)({ ref: I }, p), { className: t, style: c, onContextMenu: M, children: g, }) ), }) ); }); }, 202428: function (e, t, i) { "use strict"; i.d(t, { h: () => s }); var n = i("772322"); i("218571"); var r = i("105789"), a = i.n(r), o = { contextMenuItem: "contextMenuItem-e7B2YI", contextMenuText: "contextMenuText-Y3lOO8", contextMenuIcon: "contextMenuIcon-ITOAt8", disable: "disable-R13Ipu", }, s = (e) => { var { key: t, disable: i, handler: r, onClick: s, text: l, icon: c, } = e; return (0, n.jsxs)( "div", { className: a()(o.contextMenuItem, "mweb-context-menu-item", { [o.disable]: i, }), onClick: (e) => { null == s || s(e), null == r || r(); }, children: [ c && (0, n.jsx)("div", { className: o.contextMenuIcon, children: c, }), (0, n.jsx)("div", { className: o.contextMenuText, children: l, }), ], }, t ); }; }, 782296: function (e, t, i) { "use strict"; i.d(t, { u: () => u }); var n = i("139646"), r = i("772322"); i("214865"); var a = i("644254"); i("218571"); var o = i("170197"), s = i("319440"), l = i("949274"), c = "spinMessage-fpXLEm", d = i("518376"); function u(e) { return f.apply(this, arguments); } function f() { return (f = (0, n._)(function* (e) { var { task: t, tipTxt: i, onCancel: n, showDelay: u = 200 } = e, f = !1, h = t(); if ( (h.finally(() => { f = !0; }), u && (yield (0, d._)(u)), !f) ) { var p = a.Z.info({ className: c, icon: null, duration: 0, showIcon: !1, content: (0, r.jsx)(o.G, { content: (0, r.jsxs)(r.Fragment, { children: [ (0, r.jsx)(s.XG, { size: s.XJ.Middle }), (0, r.jsx)("span", { style: { paddingLeft: "8px" }, children: null != i ? i : l.ZP.t("homepage_tab_project_loading"), }), ], }), onCancel: () => { p(), n(); }, }), }); h.finally(() => { p(); }); } })).apply(this, arguments); } }, 678482: function (e, t, i) { "use strict"; i.d(t, { I: function () { return r; }, }); var n = (e) => e.scrollHeight > e.offsetHeight || e.scrollWidth > e.offsetWidth, r = function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : document.documentElement, i = [], r = e; r && r !== t; ) n(r) && i.push(r), (r = r.parentElement); return i; }; }, 492278: function (e, t, i) { "use strict"; i.d(t, { oM: () => B, Hp: () => F }); var n = i("139646"), r = i("772322"); i("347197"), i("2860"), i("645523"), i("245535"); var a = i("293793"), o = i("693238"), s = i("298677"), l = i("750633"), c = i("76894"), d = i("2910"), u = i("218571"), f = i("105789"), h = i.n(f), p = i("52533"), v = i("949274"), m = i("388977"), g = i("699267"), _ = i("317825"), y = i("509525"), b = i("733437"), I = i("188754"), w = i("417699"), x = i("834634"), S = i("405013"), M = i("625572"), C = i("379311"), T = (function (e) { return (e.All = "all"), (e.Consume = "consume"), (e.Get = "get"), e; })({}); class A { getEventParams() { return (0, M._)({}, this._params); } constructor(e) { (this._params = e), (this.eventName = "credits_detail"); } } function k(e, t) { (0, C.Kl)(e, A, [t]); } function P(e) { var { dep: t, scrollElement: i, onReachEnd: n, triggerLimit: r = 200, } = e, o = (0, u.useRef)(!1); return ( (0, u.useEffect)(() => { o.current = !1; }, [t]), (0, a.default)(() => { i && !o.current && i.scrollHeight - i.scrollTop <= i.clientHeight + r && ((o.current = !0), null == n || n()); }) ); } var E = { creditHistoryModalWrapper: "creditHistoryModalWrapper-sz0KBy", creditHistoryModal: "creditHistoryModal-FPITvx", creditInfoDetailPopover: "creditInfoDetailPopover-eV1PA7", detailPopoverContent: "detailPopoverContent-eyzTWs", title: "title-OAnWII", scrollView: "scrollView-qcy6H7", detailList: "detailList-l7L78S", detailItem: "detailItem-PEd2Dg", detailItemInfo: "detailItemInfo-Jg5OuL", detailItemInfoTitle: "detailItemInfoTitle-wGDOMN", detailItemInfoValue: "detailItemInfoValue-xrZxeA", action: "action-ZarF30", backBtn: "backBtn-_MtUFZ", backBtnIcon: "backBtnIcon-xgiwSm", modalTitle: "modalTitle-riBS2d", closeBtn: "closeBtn-SDOGna", closeBtnIcon: "closeBtnIcon-Dznnei", header: "header-jprTS8", creditInfoWrapper: "creditInfoWrapper-aCeZmx", creditInfoItem: "creditInfoItem-injtuh", creditInfoItemTitle: "creditInfoItemTitle-iYyfeK", creditInfoItemAmount: "creditInfoItemAmount-Sm_7ac", creditInfoItemNum: "creditInfoItemNum-n2CDFb", creditInfoItemDetailIcon: "creditInfoItemDetailIcon-UwFLOF", creditCalcSymbolWrapper: "creditCalcSymbolWrapper-uMOJFa", creditCalcSymbolLeft: "creditCalcSymbolLeft-CL71Vj", creditCalcSymbolRight: "creditCalcSymbolRight-YoqxZX", creditCalcSymbol: "creditCalcSymbol-7dn9c1", contentWrapper: "contentWrapper-wdqBa6", content: "content-YIxQ0V", tabs: "tabs-Ppzjhw", tabTitleWrapper: "tabTitleWrapper-qjAy9m", creditHistoryWrapper: "creditHistoryWrapper-LX5KJC", creditHistory: "creditHistory-Hzu3lY", historyItem: "historyItem-GXNC0g", historyTitle: "historyTitle-fDMsQR", historyTime: "historyTime-z2qgT4", historyAmountWrapper: "historyAmountWrapper-hUzxMV", historyAmount: "historyAmount-g8ujO1", issued: "issued-RXNcGj", extraContent: "extraContent-rFgqbd", noMoreContent: "noMoreContent-rIW0ev", placeholder: "placeholder-fNCIiK", placeholderTitle: "placeholderTitle-XM9yGu", placeholderText: "placeholderText-r7LrdT", spin: "spin-MHffMP", bottomTips: "bottomTips-DCmstl", delayTips: "delayTips-JYbMzr", creditRules: "creditRules-AoL4hi", }, D = i("590045"), R = i("932616"), N = i("799108"), L = i("70137"), j = 94, O = (e) => { var { historyList: t, loading: i, hasMore: n } = e; return (null == t ? void 0 : t.length) || !i ? (0, p.Z)(t) || 0 === t.length ? (0, r.jsxs)("div", { className: E.placeholder, children: [ (0, r.jsx)("div", { className: E.placeholderTitle, children: v.ZP.t( "dre_m10n_credits_empty_title", {}, "No credit transactions yet" ), }), (0, r.jsx)("div", { className: E.placeholderText, children: v.ZP.t( "dre_m10n_credits_empty_desc", {}, "When you consume or gain credits, the transaction will appear here." ), }), ], }) : (0, r.jsxs)("div", { className: E.creditHistory, children: [ null == t ? void 0 : t.map((e, t) => { var { extraContent: i, title: n } = e; return (0, r.jsx)(r.Fragment, { children: (0, r.jsxs)( "div", { className: E.historyItem, children: [ (0, r.jsxs)("div", { children: [ (0, r.jsx)("div", { className: E.historyTitle, children: v.ZP.t(n, {}, n), }), (0, r.jsx)("div", { className: E.historyTime, children: (0, S.vc)( "yyyy-MM-dd hh:mm", 1e3 * e.createTime ), }), ], }), (0, r.jsxs)("div", { className: E.historyAmountWrapper, children: [ (0, r.jsxs)("div", { className: h()(E.historyAmount, { [E.issued]: e.historyType === x.P.ISSUED, }), children: [ e.historyType === x.P.ISSUED ? "+" : "-", e.amount, ], }), e.extraContent && (0, r.jsx)("div", { className: E.extraContent, children: v.ZP.t(i, {}, i), }), ], }), ], }, e.submitId ), }); }), !n && (0, r.jsx)("div", { className: E.noMoreContent, children: v.ZP.t( "dre_m10n_credit_balance_end", {}, "You\u2019ve reached the end" ), }), ], }) : (0, r.jsx)(l.Z, { className: E.spin, size: 24 }); }, B = (e) => { var t, { containerService: i, showBackBtn: n, onClose: l } = e, c = (0, m.ko)(i, L.aG), f = (0, m.ko)(i, w.e), h = (0, u.useRef)(null), [p, g] = (0, u.useState)(!1), x = (0, u.useRef)(null), M = (0, u.useRef)(null), C = (0, u.useRef)(null), A = (0, u.useRef)({ [T.All]: !1, [T.Consume]: !1, [T.Get]: !1 }), B = (0, u.useRef)(82), { isOversea: F } = f, { creditInfo: U, historyType: G, loadingCreditHistory: z, creditHistoryList: V, creditsDetail: W, } = null !== (t = (0, b.k)(c, (e) => ({ creditInfo: e.creditInfo, creditHistoryList: e.creditHistoryList, historyType: e.historyType, loadingCreditHistory: e.loadingCreditHistory, creditsDetail: e.creditsDetail, }))) && void 0 !== t ? t : {}, { vipCredit: Z, purchaseCredit: K, giftCredit: H, } = null != U ? U : {}, q = (0, u.useMemo)(() => { var e, t, i; return [ { key: "vipCredits", creditAmount: Z || "0", title: v.ZP.t( "dre_m10n_credits_sub", {}, "Subscription credits" ), hasDetail: !!((null == W ? void 0 : W.vipCredits) || []) .length, detailList: (null == W ? void 0 : null === (e = W.vipCredits) || void 0 === e ? void 0 : e.sort( (e, t) => e.creditsLifeEnd - t.creditsLifeEnd )) || [], }, { key: "purchaseCredits", creditAmount: K || "0", title: v.ZP.t( "dre_m10n_credits_purchased", {}, "Purchased credits" ), hasDetail: !!((null == W ? void 0 : W.purchaseCredits) || []) .length, detailList: (null == W ? void 0 : null === (t = W.purchaseCredits) || void 0 === t ? void 0 : t.sort( (e, t) => e.creditsLifeEnd - t.creditsLifeEnd )) || [], }, { key: "giftCredits", creditAmount: H || "0", title: v.ZP.t("dre_m10n_credits_bonus", {}, "Bonus credits"), hasDetail: !!((null == W ? void 0 : W.giftCredits) || []) .length, detailList: (null == W ? void 0 : null === (i = W.giftCredits) || void 0 === i ? void 0 : i.sort( (e, t) => e.creditsLifeEnd - t.creditsLifeEnd )) || [], }, ]; }, [H, K, Z, W]), J = (0, u.useMemo)( () => ({ key: "allCredit", creditAmount: (Z || 0) + (K || 0) + (H || 0) || "0", title: v.ZP.t( "dre_m10n_credits_detail", {}, "Residual credits" ), hasDetail: !1, }), [H, K, Z] ), Y = (0, u.useMemo)( () => (p && h.current ? h.current : void 0), [p] ), Q = (0, u.useCallback)( (e) => { c && (0, _.Rr)((t) => c.changeHistoryType(t, e, !1), { contextType: y.zO.UserInput, processName: "CreditHistoryModal", operationName: "handleTabChange", }); var t, n = B.current, r = null !== (t = null == Y ? void 0 : Y.scrollTop) && void 0 !== t ? t : 0; Y && r > n && (0, D.tr)(Y, -(r - n)), e !== L.Pi.CONSUMED || A.current[T.Consume] ? e === L.Pi.ISSUED && !A.current[T.Get] && (k(i, { tab: T.Get }), (A.current[T.Get] = !0)) : (k(i, { tab: T.Consume }), (A.current[T.Consume] = !0)); }, [c, i, Y] ), X = P({ scrollElement: Y, dep: V, onReachEnd: (0, u.useCallback)(() => { if (!!(null == c ? void 0 : c.hasMoreCreditHistory())) null == c || c.loadMoreCreditHistory((0, y.VM)()); }, [c]), triggerLimit: 400, }), $ = (0, u.useMemo)( () => (null == c ? void 0 : c.hasMoreCreditHistory()), [V] ); (0, u.useEffect)( () => ( g(!0), () => { c.resetHistoryData(); } ), [] ); var ee = (0, a.default)((e) => { var t = e.target, i = B.current, n = j + i, r = (i - t.scrollTop) / i; x.current && ((x.current.style.opacity = r > 0 ? r.toString() : "0"), (x.current.style.height = "".concat(n - t.scrollTop, "px"))), X(); }), et = () => { if (M.current) { var e = M.current.clientHeight; (B.current = e), C.current && (C.current.style.marginTop = "".concat(e, "px")), x.current && (x.current.style.height = "".concat(j + e, "px")); } }; (0, u.useEffect)(() => { et(); }, []), (0, u.useEffect)(() => { !A.current[T.All] && (k(i, { tab: T.All }), (A.current[T.All] = !0)); }, []); var ei = (0, R.h)(), en = (e) => "vipLevel" in e, er = (e) => { var t = () => (0, r.jsxs)("div", { className: E.detailPopoverContent, children: [ (0, r.jsx)("div", { className: E.title, children: e.title, }), (0, r.jsx)("div", { className: E.scrollView, children: (0, r.jsx)("div", { className: E.detailList, children: (e.detailList || []).map((e, t) => { var i; return (0, r.jsxs)( "div", { className: E.detailItem, children: [ en(e) && (0, r.jsxs)("div", { className: E.detailItemInfo, children: [ (0, r.jsx)("div", { className: E.detailItemInfoTitle, children: v.ZP.t( "dre_m10n_credits_detail_info1", {}, "Plan" ), }), (0, r.jsx)("div", { className: E.detailItemInfoValue, children: (0, N.sG)({ level: null !== (i = e.vipLevel) && void 0 !== i ? i : "", }), }), ], }), (0, r.jsxs)("div", { className: E.detailItemInfo, children: [ (0, r.jsx)("div", { className: E.detailItemInfoTitle, children: v.ZP.t( "dre_m10n_credits_detail_info2", {}, "Residual credits" ), }), (0, r.jsx)("div", { className: E.detailItemInfoValue, children: e.residualCredits, }), ], }), (0, r.jsxs)("div", { className: E.detailItemInfo, children: [ (0, r.jsx)("div", { className: E.detailItemInfoTitle, children: v.ZP.t( "dre_m10n_credits_detail_info3", {}, "Credits ends" ), }), (0, r.jsx)("div", { className: E.detailItemInfoValue, children: (0, S.vc)( "yyyy-MM-dd hh:mm", 1e3 * e.creditsLifeEnd ), }), ], }), ], }, t ); }), }), }), ], }); return (0, r.jsxs)( "div", { className: E.creditInfoItem, children: [ (0, r.jsx)("div", { className: E.creditInfoItemTitle, children: e.title, }), (0, r.jsxs)("div", { className: E.creditInfoItemAmount, children: [ (0, r.jsx)("div", { className: E.creditInfoItemNum, children: e.creditAmount, }), e.hasDetail && (0, r.jsx)(o.Z, { className: E.creditInfoDetailPopover, trigger: "hover", position: "bottom", content: t(), triggerProps: { showArrow: !1 }, getPopupContainer: () => document.body, children: (0, r.jsx)(I.oUg, { className: E.creditInfoItemDetailIcon, }), }), ], }), ], }, e.key ); }, ea = (e) => (0, r.jsxs)("div", { className: E.creditCalcSymbolWrapper, children: [ (0, r.jsx)("div", { className: E.creditCalcSymbolLeft }), (0, r.jsx)("div", { className: E.creditCalcSymbol, children: e, }), (0, r.jsx)("div", { className: E.creditCalcSymbolRight }), ], }); return (0, r.jsxs)("div", { className: E.creditHistoryModal, children: [ (0, r.jsxs)("div", { className: E.action, children: [ n ? (0, r.jsxs)("div", { className: E.backBtn, onClick: l, children: [ (0, r.jsx)(I.USi, { className: E.backBtnIcon }), (0, r.jsx)("span", { children: v.ZP.t( "dre_m10n_payment_back", {}, "Back" ), }), ], }) : (0, r.jsx)("div", { className: E.modalTitle, children: v.ZP.t( "dre_m10n_credits_balance", {}, "Credit balance" ), }), !n && (0, r.jsx)("div", { className: E.closeBtn, onClick: l, children: (0, r.jsx)(I.Rnl, { className: E.closeBtnIcon, }), }), ], }), (0, r.jsx)("div", { className: E.header, ref: x, children: (0, r.jsxs)("div", { className: E.creditInfoWrapper, ref: M, children: [ er(J), null == q ? void 0 : q.map((e, t) => (0, r.jsxs)(r.Fragment, { children: [0 === t ? ea("=") : ea("+"), er(e)], }) ), ], }), }), (0, r.jsx)("div", { className: E.contentWrapper, onScroll: ee, ref: h, children: (0, r.jsxs)("div", { className: E.content, ref: C, children: [ (0, r.jsxs)(s.Z, { className: E.tabs, activeTab: G, onChange: Q, renderTabTitle: (e) => (0, r.jsx)("div", { className: E.tabTitleWrapper, children: e, }), children: [ (0, r.jsx)( s.Z.TabPane, { title: v.ZP.t("dre_m10n_credits_all", {}, "All") }, L.Pi.NOT_LIMITED ), (0, r.jsx)( s.Z.TabPane, { title: v.ZP.t( "dre_m10n_credits_used", {}, "Consumed" ), }, L.Pi.CONSUMED ), (0, r.jsx)( s.Z.TabPane, { title: v.ZP.t( "dre_m10n_credits_gained", {}, "Gained" ), }, L.Pi.ISSUED ), ], }), (0, r.jsx)("div", { className: E.creditHistoryWrapper, children: (0, r.jsx)(O, { historyList: V, loading: z, hasMore: $, }), }), ], }), }), (0, r.jsxs)("div", { className: E.bottomTips, children: [ (0, r.jsx)("span", { className: E.delayTips, children: v.ZP.t( "dre_m10n_credits_delay", {}, "There may be delays in data updates." ), }), (0, r.jsx)("a", { target: "_blank", rel: "noreferrer", href: (0, d.C)(ei, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: E.creditRules, children: v.ZP.t( "dre_m10n_purchase_credits_rules", {}, "Rules" ), }), ], }), ], }); }; function F(e) { var { containerService: t } = e, i = (0, m.ko)(t, L.aG); (0, _.Rr)( (function () { var e = (0, n._)(function* (e) { yield Promise.all([ i.changeHistoryType(e, L.Pi.NOT_LIMITED), i.syncHistoryData(e, L.Pi.CONSUMED), i.syncHistoryData(e, L.Pi.ISSUED), ]); }); return function (t) { return e.apply(this, arguments); }; })(), { contextType: y.zO.Task, processName: "CreditHistoryModal", operationName: "showCreditHistoryModal", } ), i.syncRemoteCreditHistory(); var a = c.Z.confirm({ title: null, footer: null, icon: null, simple: !0, closable: !1, maskClosable: !0, maskStyle: { backdropFilter: "blur(8px)", WebkitBackdropFilter: "blur(8px)", }, wrapClassName: E.creditHistoryModalWrapper, content: (0, r.jsx)(g.$, { instantiationService: t, children: (0, r.jsx)(B, { onClose: () => a.close(), containerService: t, }), }), }); } }, 443213: function (e, t, i) { "use strict"; i.d(t, { E: () => f }); var n = i("772322"), r = i("293793"), a = i("105789"), o = i.n(a), s = i("218571"), l = "container-H92JQ_", c = "panel-tOQI3r", d = "panelWithBackdropFilter-DNipfD", u = "hidePanel-fx5vGm", f = (0, s.forwardRef)((e, t) => { var { content: i, children: a, containerClassName: f, contentClassName: h, contentStyle: p, isDisable: v = !1, needStopPropagation: m = !1, hasBackdropFilter: g = !0, isUseHover: _, onVisibleChange: y, handleMouseEnter: b, handleMouseOut: I, } = e, w = (0, s.useRef)(null), x = (0, s.useRef)(null), S = (0, s.useRef)(!1), M = (0, s.useRef)(!1), [C, T] = (0, s.useState)(!1), A = (e) => { if ((m && (null == e || e.stopPropagation()), !v)) { var t, i, n = !C; T(n); var r = e ? { x: e.clientX, y: e.clientY } : void 0, { width: a = 0, height: o = 0 } = null !== (i = null === (t = x.current) || void 0 === t ? void 0 : t.getBoundingClientRect()) && void 0 !== i ? i : {}; null == y || y(n, r, { width: a, height: o }); } }, k = (0, r.default)((e) => { var t = w.current; t && !t.contains(e.target) && C && (T(!1), null == y || y(!1)); }), P = () => { T(!1), null == y || y(!1); }, E = () => { A(); }, D = () => { if ((null == b || b(), !!_ && !v)) (S.current = !0), setTimeout(() => { !C && (S.current || M.current) && E(); }, 200); }, R = () => { if ((null == I || I(), !!_ && !v)) (S.current = !1), setTimeout(() => { !S.current && !M.current && C && P(); }, 200); }, N = () => { if (!!_ && !v) (M.current = !0), setTimeout(() => { !C && (S.current || M.current) && E(); }, 200); }, L = () => { if (!!_ && !v) (M.current = !1), setTimeout(() => { !S.current && !M.current && C && P(); }, 200); }; return ( (0, s.useEffect)( () => ( document.addEventListener("mousedown", k), () => { document.removeEventListener("mousedown", k); } ), [k] ), (0, s.useImperativeHandle)(t, () => ({ close: P, open: E })), (0, n.jsxs)("div", { className: o()(l, f), ref: w, children: [ (0, n.jsx)("div", { onClick: A, onMouseEnter: D, onMouseLeave: R, children: a, }), (0, n.jsx)("div", { ref: x, className: o()(c, h, { [u]: !C, [d]: g }), onMouseEnter: N, onMouseLeave: L, style: p, children: i, }), ], }) ); }); }, 284858: function (e, t, i) { "use strict"; i.d(t, { S: () => B }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("772322"); i("245535"); var s = i("293793"), l = i("76894"), c = i("218571"), d = i("188754"), u = i("319440"), f = i("2910"), h = i("105789"), p = i.n(h), v = (e, t, i, n, r) => { var a = t < n; r((!(e < i) || !a) && !0); }, m = (e, t, i, n) => { var { width: r, height: a } = t, { width: o, height: s } = i, l = r > o, c = a > s, d = Math.abs((r - o) / 2), u = Math.abs((a - s) / 2); n((t) => { var i = t.x + e.x, n = t.y + e.y; return ( (i = Math.min(d, Math.max(-d, i))), (n = Math.min(u, Math.max(-u, n))), { x: l ? Math.round(i) : t.x, y: c ? Math.round(n) : t.y } ); }); }, g = i("528498"), _ = i("691563"), y = i("54764"), b = 1.03, I = 0.97, w = 0.73, x = 0.92, S = i("717742"), M = i("185617"), C = i("338944"), T = { zoomImageContainer: "zoomImageContainer-hx8m5F", imageWrapper: "imageWrapper-ucLbW6", hoverContainer: "hoverContainer-ToJ2jV", transitionCls: "transitionCls-Jt0b8Y", loading: "loading-z7TZQZ", grabbingCursor: "grabbingCursor-iNAWi8", grabCursor: "grabCursor-P63WG3", zoomOutCursor: "zoomOutCursor-jSRvGD", }, A = (e) => { var { imageUrl: t, width: i, height: n, maxInitialScale: s = 1 / 0, isDownloading: l = !1, onClose: d = () => ({}), onZoomInImageExpose: h, contextMenu: A = [], } = e, [k, P] = (0, c.useState)({ x: 0, y: 0 }), E = (0, c.useRef)(null), D = (0, c.useRef)({ width: 1024, height: 798 }), [R, N] = (0, c.useState)(1), [L, j] = (0, c.useState)(!1), [O, B] = (0, c.useState)(!1), [F, U] = (0, c.useState)(!1), G = (0, c.useRef)(0), [z, V] = (0, g.CY)(), [W] = (0, _.Z)(t), Z = (0, c.useRef)({ step: 0.1, minScale: 0.5, maxScale: 3 }); (0, c.useEffect)(() => { t && (j(!1), setTimeout(() => { j(!0); }, 1e3)); }, [t]), (0, c.useEffect)(() => { var e = G.current, t = V && W && !e && L, i = (!V || !W) && e; if (t) G.current = Date.now(); else if (i) { var n = Date.now() - e; (G.current = 0), null == h || h(n); } }, [V, W, L]); var K = (0, c.useCallback)( (e, t) => { m( { x: e, y: t }, { width: i * R, height: n * R }, { width: D.current.width, height: D.current.height }, P ); }, [R, i, n] ), [H] = (0, y.c)(z, K), q = (e) => { var t, r = e ? I : b; N( (e) => ( m( { x: 0, y: 0 }, { width: i * (t = Math.max( Z.current.minScale, Math.min(Z.current.maxScale, e * r) )), height: n * t, }, { width: D.current.width, height: D.current.height }, P ), v(i * t, n * t, D.current.width, D.current.height, U), (0, S.c)(t, 2) ) ); }; (0, y.r)(z, q, K), (0, c.useEffect)(() => { var e = () => { var e = (0, M._U)(), t = (0, M.mP)(); D.current = { width: e, height: t }; var r = e * w, a = t * x, o = Math.min((i / n >= r / a ? r : (i / n) * a) / i, s), l = (2.5 * o) / 100; (Z.current = { step: l, minScale: o, maxScale: 3 * o }), N((0, S.c)(o, 2)); }; return ( window.addEventListener("resize", e), e(), setTimeout(() => { B(!0); }, 500), () => { window.removeEventListener("resize", e); } ); }, []); var J = (e) => { e.preventDefault(); }, Y = (0, c.useMemo)(() => { var { x: e, y: t } = k; return { width: "".concat(i, "px"), transform: "translate(calc(-50% + " .concat(e, "px), calc(-50% + ") .concat(t, "px)) scale(") .concat(R, ")"), }; }, [i, k, R]), Q = (0, c.useMemo)(() => { if (F) return H ? T.grabbingCursor : T.grabCursor; return T.zoomOutCursor; }, [F, H]), X = (0, a._)((0, r._)({}, Y), { height: "".concat(n, "px"), zIndex: l ? 2 : 0, }), $ = (e) => { !F && 2 !== e.button && d(); }; return (0, o.jsx)("div", { className: T.zoomImageContainer, ref: E, onClick: d, children: t ? (0, o.jsxs)(o.Fragment, { children: [ (0, o.jsx)(C.W, { disable: !(null == A ? void 0 : A.length), baseOptions: A, children: (0, o.jsxs)("div", { className: T.imageWrapper, style: { opacity: L ? 1 : 0 }, children: [ (0, o.jsx)("img", { ref: z, src: (0, f.C)(t, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: p()(Q, { [T.transitionCls]: O }), style: Y, onClick: (e) => e.stopPropagation(), onMouseUp: $, onLoad: () => j(!0), onContextMenu: J, crossOrigin: "anonymous", }), (0, o.jsx)("div", { className: T.hoverContainer, style: X, }), ], }), }), !L && (0, o.jsx)(u.XG, { className: T.loading, size: u.XJ.Big, }), ], }) : (0, o.jsx)(u.XG, { className: T.loading, size: u.XJ.Big }), }); }, k = i("863209"), P = { enlargeModalContent: "enlargeModalContent-sTFBOC", loading: "loading-L4BJBe", iconWrapper: "iconWrapper-mMZWsv", icon: "icon-lVsa8f", download: "download-cnkolm", close: "close-CHhBEr", previewAction: "previewAction-KFWNwH", }, E = i("699267"), D = i("70529"), R = i("568386"), N = i("487736"), L = i("259435"), j = (e) => { var { imageInfo: t, onClose: i, onDownload: r, onZoomOut: a, onZoomInImageExpose: l, showSwitch: f = !1, showSideSwitch: h = !1, onPreviewNext: p, onPreviewPrev: v, hasPrev: m = !1, hasNext: g = !0, contextMenu: _ = [], hideZoomInControl: y, getWatermarkDownloadInfo: b, } = e, { coverUrl: I = "", width: w = 100, height: x = 100, fileName: S = "", maxInitialScale: M, } = t, [C, T] = (0, c.useState)(!1), N = (0, E.G)(D.m), L = (function () { var e = (0, n._)(function* () { T(!0); var e = Date.now(), { url: t } = yield b(), i = yield (0, k.ue)(t, S, N); T(!1); var n = Date.now() - e; null == r || r(i, n); }); return function () { return e.apply(this, arguments); }; })(), j = () => { null == a || a(), i(); }, O = (0, s.default)(() => { null == v || v(); }), B = (0, s.default)(() => { null == p || p(); }); return (0, o.jsxs)("div", { className: P.enlargeModalContent, children: [ !y && (0, o.jsxs)("div", { className: P.iconWrapper, children: [ (0, o.jsx)("div", { className: P.icon, onClick: j, children: (0, o.jsx)(d.Rnl, { className: P.close }), }), (0, o.jsx)("div", { className: P.icon, onClick: L, children: (0, o.jsx)(d.zpr, { className: P.download }), }), ], }), f && (0, o.jsx)(R.U, { hasPrev: m, hasNext: g, onNext: B, onPrev: O, className: P.previewAction, }), h && (0, o.jsx)(R.W, { hasPrev: m, hasNext: g, onNext: B, onPrev: O, className: P.previewAction, }), C && (0, o.jsx)(u.XG, { className: P.loading }), (0, o.jsx)(A, { imageUrl: I, width: w, height: x, maxInitialScale: M, isDownloading: C, onZoomInImageExpose: l, onClose: i, contextMenu: _, }), ], }); }, O = null; function B(e) { var { imageInfo: t, contextMenu: i, getWatermarkDownloadInfo: n, onDownload: s, handleZoomInImageExpose: c, onZoomOut: d, switchOptions: u, } = e, f = (0, L.C)(e.containerService, N.M.ImgZoomInModal); if (O) { O.update({ footer: null, icon: null, simple: !0, closable: !1, maskClosable: !0, wrapClassName: "enlarge-image-modal", afterClose: () => { (O = null), (f = (0, L.X)( e.containerService, N.M.ImgZoomInModal )).unmount(); }, content: (0, o.jsx)(E.$, { instantiationService: e.containerService, children: (0, o.jsx)( j, (0, a._)((0, r._)({}, u), { contextMenu: i, imageInfo: t, getWatermarkDownloadInfo: n, onClose: () => (null == O ? void 0 : O.close()), onDownload: s, onZoomOut: d, onZoomInImageExpose: c, }) ), }), }); return; } O = l.Z.confirm({ footer: null, icon: null, simple: !0, closable: !1, maskClosable: !0, wrapClassName: "enlarge-image-modal", afterClose: () => { (O = null), (f = (0, L.X)(e.containerService, N.M.ImgZoomInModal)).unmount(); }, content: (0, o.jsx)(E.$, { instantiationService: e.containerService, children: (0, o.jsx)( j, (0, a._)((0, r._)({}, u), { contextMenu: i, imageInfo: t, getWatermarkDownloadInfo: n, onClose: () => (null == O ? void 0 : O.close()), onDownload: s, onZoomOut: d, onZoomInImageExpose: c, }) ), }), }); } }, 49841: function (e, t, i) { "use strict"; i.d(t, { m: function () { return s; }, }); var n = i(625572), r = i(96), a = i(772322); i(641183); var o = i(188754), s = (e) => { var { hasFavorited: t, useCurrentColor: i } = e, s = (0, r._)(e, ["hasFavorited", "useCurrentColor"]); return t ? (0, a.jsx)( o.jjQ, (0, n._)({ size: 16, color: "var(--state-warning)" }, s) ) : (0, a.jsx)( o.SQi, (0, n._)( { size: 16, color: i ? void 0 : "var(--text-secondary)" }, s ) ); }; }, 925016: function (e, t, i) { "use strict"; i.d(t, { H: () => _ }); var n = i("625572"), r = i("639880"), a = i("772322"), o = i("2910"), s = i("188754"); i("245535"); var l = i("76894"), c = i("570126"), d = { loadingContainer: "loadingContainer-k8bTOd", loadingContent: "loadingContent-it5Vun", mwebCommonGlobalModalContainer: "mwebCommonGlobalModalContainer-Vi13gH", closeBtn: "closeBtn-Q00F3i", closeIcon: "closeIcon-TttgHr", closeBtnWithHeaderImage: "closeBtnWithHeaderImage-z_sfnz", headerImageContainer: "headerImageContainer-fDQrSI", modalMain: "modalMain-NSou0q", modalMainWithHeaderImage: "modalMainWithHeaderImage-wZ3IAq", modalTitle: "modalTitle-m7U4OM", preIcon: "preIcon-YFiWnD", modalContent: "modalContent-WuC8aa", }, u = i("319440"); class f { static initialize() { var e = window.document.createElement("div"); window.document.body.append(e), (f.domContainer = c.createRoot(e)); } static load() { var e, t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; if ( (!f.isInitialize && (f.initialize(), (f.isInitialize = !0)), f.isLoading !== t) ) { f.isLoading = t; var i = t ? (0, a.jsx)("div", { className: d.loadingContainer, children: (0, a.jsx)(u.XG, { className: d.loadingContent, size: u.XJ.Big, }), }) : null; null === (e = f.domContainer) || void 0 === e || e.render(i); } } static openModal() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "info", t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; !f.isInitialize && (f.initialize(), (f.isInitialize = !0)), f.isLoading && f.load(!1); var i = l.Z[e]; return null == i ? void 0 : i((0, n._)({ className: d.mwebCommonGlobalModalContainer }, t)); } } (f.isLoading = !1), (f.isInitialize = !1); var h = i("653061"), p = i("105789"), v = i.n(p), m = { success: s.QD2, info: null, confirm: null, error: s.zeQ, warning: s.u2T, }, g = (e) => { var { action: t, modalProps: i } = e, n = m[t], { title: r } = i; return (0, a.jsxs)("div", { className: d.modalTitle, children: [n && (0, a.jsx)(n, { className: d.preIcon }), r], }); }; class _ extends f { static open(e) { var { action: t = "info", props: i, extraProps: l = {} } = e, { modalMainClassname: c = "", modalMainStyle: u = {}, modalContentClassname: f = "", } = l, { content: p } = i, { headerImage: m } = l, { url: _ } = null != m ? m : {}, y = !!_; return super.openModal( t, (0, r._)((0, n._)({}, i), { title: null, closeIcon: (0, a.jsx)("div", { className: v()({ [d.closeBtn]: !0, [d.closeBtnWithHeaderImage]: y, }), children: (0, a.jsx)(s.Rnl, { className: d.closeIcon }), }), content: (0, a.jsxs)(a.Fragment, { children: [ _ && (0, a.jsx)(h.k, { className: d.headerImageContainer, src: (0, o.C)(_, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", "data-apm-action": "global-modal-header-image", }), (0, a.jsxs)("div", { className: v()( { [d.modalMain]: !0, [d.modalMainWithHeaderImage]: y }, c ), style: u, children: [ (0, a.jsx)(g, { action: t, modalProps: i }), (0, a.jsx)("div", { className: v()(d.modalContent, f), children: p, }), ], }), ], }), }) ); } static info(e, t) { return this.open({ action: "info", props: e, extraProps: t }); } static success(e, t) { return this.open({ action: "success", props: e, extraProps: t }); } static error(e, t) { return this.open({ action: "error", props: e, extraProps: t }); } static warn(e, t) { return this.open({ action: "warning", props: e, extraProps: t }); } static confirm(e, t) { return this.open({ action: "confirm", props: e, extraProps: t }); } } }, 203169: function (e, t, i) { "use strict"; i.d(t, { E: () => S }); var n = i("772322"), r = i("188754"), a = "brushContainer-sXy_qA", o = "sliderBarBrush-3sS_0Z", s = "sliderBarEraser-KVH2mL", l = "icon-GM6eWg", c = i("625572"), d = i("639880"), u = i("218571"), f = i("105789"), h = i.n(f), p = "active-PKMEPz", v = "item-AJGEtf", m = i("443213"), g = "sliderBar-rt6NIJ", _ = i("763284"), y = i("489897"), b = (e) => { var { className: t, brushSize: i, onChange: r, onAfterChange: a } = e; return (0, n.jsx)(_.i, { className: h()(g, t), value: i, onChange: r, max: y.fx, min: y.zt, style: { width: 292 }, triggerBar: !0, onAfterChange: a, cssConfigs: { sliderWrapper: { style: { height: "12px", margin: "4px 0" } }, }, }); }, I = i("533278"), w = (e) => { var { contentStyle: t, sliderClassName: i, brushSize: r, tips: a, onChange: o, onClick: s, isActive: l, icon: f, buttonStyle: g, onVisibleChange: _, onAfterChange: y, isDefaultOpen: w = !1, } = e, [x, S] = (0, u.useState)(!w), M = (0, u.useRef)(null), C = (e) => { S(!e), null == _ || _(e); }; return ( (0, u.useEffect)(() => { var e; w && (null === (e = M.current) || void 0 === e || e.open()); }, [w]), (0, n.jsx)(m.E, { ref: M, contentStyle: (0, d._)((0, c._)({}, t), { display: x ? "none" : "", backdropFilter: "none", }), content: (0, n.jsx)(b, { className: i, brushSize: r, onChange: o, onAfterChange: y, }), onVisibleChange: C, children: (0, n.jsx)("div", { onClick: s, style: g, children: (0, n.jsx)(I.z, { tips: a, className: h()({ [v]: !0, [p]: l }), icon: f, }), }), }) ); }, x = i("949274"), S = (e) => { var { brushConfig: t, eraserConfig: i } = e; return (0, n.jsxs)("div", { className: a, children: [ (0, n.jsx)(w, { isDefaultOpen: t.defaultOpen, contentStyle: t.contentStyle, buttonStyle: t.buttonStyle, sliderClassName: o, brushSize: t.size, tips: x.oc.t("t2i_painter", {}, "Brush"), isActive: t.isActive, icon: (0, n.jsx)(r.C5$, { className: l }), onChange: t.onChange, onClick: t.onClick, onAfterChange: t.onAfterChange, }), (0, n.jsx)(w, { isDefaultOpen: i.defaultOpen, contentStyle: i.contentStyle, buttonStyle: i.buttonStyle, sliderClassName: s, brushSize: i.size, tips: x.oc.t("t2i_eraser2", {}, "Eraser"), isActive: i.isActive, icon: (0, n.jsx)(r.D03, { className: l }), onChange: i.onChange, onClick: i.onClick, onAfterChange: i.onAfterChange, }), ], }); }; }, 81372: function (e, t, i) { "use strict"; i.d(t, { c: () => p }); var n = i("772322"), r = i("188754"), a = "active-x6H3Wa", o = "item-HNwy0B", s = "tipContent-EkgJgA", l = "text-uzVeuP", c = "hotkey-zQzrwt", d = i("533278"), u = i("949274"), f = i("105789"), h = i.n(f), p = (e) => { var { handleClickMove: t, dragActive: i } = e; return (0, n.jsx)("div", { onClick: t, children: (0, n.jsx)(d.z, { tips: (0, n.jsxs)("div", { className: s, children: [ (0, n.jsx)("span", { className: l, children: u.oc.t("wimg2img_content_move", {}, "Move"), }), (0, n.jsx)("span", { className: c, children: "space" }), ], }), className: h()({ [o]: !0, [a]: i }), icon: (0, n.jsx)(r.UXD, { style: { fontSize: "16px" } }), }), }); }; }, 711063: function (e, t, i) { "use strict"; i.d(t, { $: () => v }); var n = i("772322"), r = i("533278"), a = i("188754"), o = "container-ofYLjT", s = "active-X4ZCX3", l = "iconContainer-jHU7o5", c = "icon-qjmzlv", d = "limit-aVczX3", u = "divider-foaIv4", f = i("105789"), h = i.n(f), p = { transform: "rotateY(180deg)" }, v = (e) => { var { isLimit: t, handleUndo: i, handleRedo: f, undoIconStyle: v = {}, redoIconStyle: m = {}, } = e; return (0, n.jsxs)("div", { className: o, children: [ (0, n.jsx)("div", { className: h()({ [d]: t.undo, [s]: !t.undo, [l]: !0 }), onClick: i, children: (0, n.jsx)(r.z, { className: c, containerStyle: p, icon: (0, n.jsx)(a.p9e, { className: c, style: m }), }), }), (0, n.jsx)("div", { className: u }), (0, n.jsx)("div", { className: h()({ [d]: t.redo, [s]: !t.redo, [l]: !0 }), onClick: f, children: (0, n.jsx)(r.z, { className: c, icon: (0, n.jsx)(a.p9e, { className: c, style: v }), }), }), ], }); }; }, 342396: function (e, t, i) { "use strict"; i.d(t, { $A: function () { return r; }, hv: function () { return a; }, pv: function () { return n; }, }); var n = 3, r = 0.33, a = -1; }, 699301: function (e, t, i) { "use strict"; i.d(t, { n: () => g }); var n = i("625572"), r = i("639880"), a = i("772322"), o = i("188754"), s = "scaleContainer-SIVbaC", l = "text-AZuh_Z", c = "dropContainer-wur3mr", d = "dropContent-Kspm0Z", u = i("105789"), f = i.n(u), h = "btnActive-MVzAcP", p = "btn-VrIjTR", v = (e) => { var { icon: t, active: i, onClick: n } = e; return (0, a.jsx)("div", { className: f()({ [p]: !0, [h]: !!i }), onClick: n, children: t, }); }, m = i("443213"), g = (e) => { var { scale: t, logic: i } = e, { handleScaleUp: u, handleScaleDown: f, getScaleName: h, menu: p, dropdownStyle: g, dropdownRef: _, handleDropdownVisibleChange: y, } = i; return (0, a.jsxs)("div", { className: s, children: [ (0, a.jsx)(v, { icon: (0, a.jsx)(o.S6A, { size: 16 }), onClick: f, }), (0, a.jsx)(m.E, { ref: _, containerClassName: c, contentClassName: d, content: p, contentStyle: (0, r._)((0, n._)({}, g), { backdropFilter: "none", }), onVisibleChange: y, children: (0, a.jsx)("span", { className: l, children: h(t) }), }), (0, a.jsx)(v, { icon: (0, a.jsx)(o.nGr, { size: 16 }), onClick: u, }), ], }); }; }, 767116: function (e, t, i) { "use strict"; i.d(t, { y: function () { return s; }, }); var n = i(625572), r = i(639880), a = i(949274), o = i(342396); function s() { var e = [ { name: "33%", value: 0.33 }, { name: "50%", value: 0.5 }, { name: "100%", value: 1 }, { name: "200%", value: 2 }, { name: "300%", value: 3 }, { name: a.ZP.t("wimg2img_content_overwiew", {}, "Zoom to fit"), value: o.hv, resetOffset: !0, }, ], t = e.reduce( (e, t) => (0, r._)((0, n._)({}, e), { [t.value]: t.name }), {} ); return { scaleArr: e, scaleMap: t }; } }, 925367: function (e, t, i) { "use strict"; i.d(t, { $h: function () { return f; }, FB: function () { return u; }, FD: function () { return h; }, KE: function () { return l; }, Up: function () { return r; }, fx: function () { return s; }, gn: function () { return c; }, o4: function () { return n; }, pb: function () { return a; }, qx: function () { return d; }, zt: function () { return o; }, }); var n = (function (e) { return ( (e[(e.Brush = 0)] = "Brush"), (e[(e.Eraser = 1)] = "Eraser"), (e[(e.Move = 2)] = "Move"), (e[(e.Select = 3)] = "Select"), e ); })({}), r = 4, a = 32, o = 1, s = 20, l = 3, c = 482, d = 774, u = (function (e) { return ( (e.Brush = "brush"), (e.Eraser = "eraser"), (e.BrushSlider = "brush_slider"), (e.EraserSlider = "eraser_slider"), (e.Reset = "reset"), (e.Redo = "redo"), (e.Undo = "undo"), (e.Prompt = "prompt"), (e.Move = "move"), (e.SmartCut = "smart_cut"), (e.RatioUp = "ratio_up"), (e.RatioDown = "ratio_down"), e ); })({}), f = { 0: "brush", 1: "eraser" }, h = (function (e) { return (e.Show = "show"), (e.Click = "click"), (e.Use = "use"), e; })({}); }, 202455: function (e, t, i) { "use strict"; i.d(t, { b: function () { return n; }, }); var n = (function (e) { return (e.Aigc = "aigc"), (e.Import = "import"), e; })({}); }, 114979: function (e, t, i) { "use strict"; i.d(t, { I: () => e$ }); var n = i("772322"), r = i("218571"), a = i("949274"), o = i("967355"), s = i("188754"), l = { contentContainer: "contentContainer-_aFKQl", title: "title-nfmnvG", textArea: "textArea-m0OYG_", withBtn: "withBtn-Eklxc3", bottomContainer: "bottomContainer-HvpsWf", helpIcon: "helpIcon-fjgrzg", tips: "tips-Xxbh7q", paintContainer: "paintContainer-AwJwCi", generateButton: "generateButton-D4fuFY", }, c = i("625572"), d = i("639880"), u = i("699301"); i("596477"); var f = i("216956"), h = i("331730"), p = i("767116"), v = i("342396"), m = 2, g = (e) => { var { resizeInstance: t, dragInstance: i } = e, a = (0, r.useSyncExternalStore)( (e) => ( null == t || t.on("scale", e), () => { null == t || t.off("scale", e); } ), () => { var e; return null !== (e = null == t ? void 0 : t.getSnapshot()) && void 0 !== e ? e : v.hv; } ), o = () => { if (!!t) { var i, n, r = Math.min(Math.abs(t.scale * m), v.pv); return ( null == e || null === (i = e.handleScaleChange) || void 0 === i || i.call( e, r, null !== (n = null == t ? void 0 : t.scale) && void 0 !== n ? n : v.hv ), (t.scale = r), t.scale ); } }, s = () => { if (!!t) { var i, n, r = Math.max(Math.abs(t.scale / m), v.$A); return ( null == e || null === (i = e.handleScaleChange) || void 0 === i || i.call( e, r, null !== (n = null == t ? void 0 : t.scale) && void 0 !== n ? n : v.hv ), (t.scale = r), t.scale ); } }, { scaleArr: l } = (0, p.y)(), c = (e) => { var t = Math.round(100 * e); return "".concat(Math.abs(t), "%"); }, [d, u] = (0, r.useState)({ display: "none" }), g = (e) => { e ? u({ display: "block" }) : u({ display: "none" }); }, _ = (0, r.useRef)(null), y = (n) => { if (!!t) { var r, a, o, { value: s, resetOffset: l } = n; l && (t.resetOffset(), null == i || i.resetMove()), null == e || null === (r = e.handleScaleChange) || void 0 === r || r.call( e, s, null !== (o = null == t ? void 0 : t.scale) && void 0 !== o ? o : v.hv ), setTimeout(() => { t.scale = s; }), g(!1), null === (a = _.current) || void 0 === a || a.close(); } }, b = (0, n.jsx)(f.Z, { className: h.Z.menu, selectedKeys: ["".concat(a)], children: l.map((e, t) => (0, n.jsx)( f.Z.Item, { className: h.Z.menuItem, onClick: () => y(e), children: e.name, }, "".concat(e.value) ) ), }); return { scale: a, logic: { handleScaleUp: o, handleScaleDown: s, getScaleName: c, menu: b, dropdownStyle: d, dropdownRef: _, handleDropdownVisibleChange: g, }, }; }, _ = (0, r.createContext)(null), y = () => ({ paintInteractContext: (0, r.useContext)(_) }), b = () => { var { paintInteractContext: e } = y(), { instanceConfig: t } = null != e ? e : {}; return (0, c._)({}, t); }, I = () => { var { paintInteractContext: e } = y(), { scaleConfig: t } = null != e ? e : {}, { onScaleChange: i } = null != t ? t : {}, { resizeInstance: r, dragInstance: a } = b(), { scale: o, logic: s } = g({ handleScaleChange: (e, t) => { if (e !== t) null == i || i(e, t); }, resizeInstance: r, dragInstance: a, }); return (0, n.jsx)(u.n, { scale: o, logic: s }); }, w = "rightInteract-mhkPkU", x = i("749623"), S = () => { var [e, t] = (0, r.useState)(!1), { paintInteractContext: i } = y(), { panelConfig: n } = null != i ? i : {}, { paintModeInstance: a } = b(); return ( (0, r.useEffect)(() => { null == a || a.onPaintAction((e) => { var { action: i } = e; t(i === x.T.StartPaint); }); }, [a]), { containerStyle: (0, r.useMemo)(() => { var t = e ? { display: "none" } : {}; return (null == n ? void 0 : n.panelStyle) ? (0, c._)({}, t, n.panelStyle) : t; }, [e, n]), } ); }, M = () => { var { containerStyle: e } = S(); return (0, n.jsx)("div", { className: w, style: e, children: (0, n.jsx)(I, {}), }); }, C = i("711063"), T = "container-wfzEc_", A = () => { var [e, t] = (0, r.useState)(!0), [i, a] = (0, r.useState)(!0), { paintModeInstance: o } = b(), { paintInteractContext: s } = y(), { undoRedoConfig: l } = null != s ? s : {}; (0, r.useEffect)(() => { if (!!o) o.onCommandMangerModel("redoStack", (e) => { a(0 === e.length); }), o.onCommandMangerModel("undoStack", (e) => { t(0 === e.length); }); }, [o]), (0, r.useEffect)(() => { if (!!o) { var { redoStack: e, undoStack: i } = o.getCommandData(); a(0 === e.length), t(0 === i.length); } }, [o]); var c = () => { null == o || o.undo(), null == l || l.onUndo(); }, d = () => { null == o || o.redo(), null == l || l.onRedo(); }, u = { undo: e, redo: i }; return (0, n.jsx)("div", { className: T, children: (0, n.jsx)(C.$, { isLimit: u, handleUndo: c, handleRedo: d, }), }); }, k = "container-sq8EFs", P = i("203169"), E = i("81372"), D = i("345720"), R = (e) => { var { className: t } = e, { paintInteractContext: i } = y(), { dragConfig: a, instanceConfig: o } = null != i ? i : {}, { dragStatus: s, handleClickMove: l = () => {} } = null != a ? a : {}, { paintModeInstance: c } = null != o ? o : {}; return ( (0, r.useEffect)(() => { if (void 0 !== s) [D.L.Active, D.L.Advent].includes(s) && (null == c || c.updateMousePosition({ offsetX: "-9999px", offsetY: "-9999px", })); }, [s, c]), (0, n.jsx)("div", { className: t, children: (0, n.jsx)(E.c, { dragActive: s === D.L.Active, handleClickMove: l, }), }) ); }, N = () => { var { paintInteractContext: e } = y(), { brushContainerConfig: t, paintBarButtons: i = [] } = null != e ? e : {}; if (!t) return null; var { brushConfig: r, eraserConfig: a } = t; return (0, n.jsxs)("div", { className: k, children: [ i, (0, n.jsx)(P.E, { brushConfig: r, eraserConfig: a }), (0, n.jsx)(R, {}), ], }); }, L = "container-vYgs0a", j = "divider-YqLljn", O = () => { var { containerStyle: e } = S(); return (0, n.jsxs)("div", { className: L, style: e, children: [ (0, n.jsx)(N, {}), (0, n.jsx)("div", { className: j }), (0, n.jsx)(A, {}), ], }); }, B = i("246940"), F = i("387008"), U = "container-y09SjR", G = "svg-YNQt1b", z = (e) => { var { message: t } = e; return (0, n.jsxs)("div", { className: U, children: [ (0, n.jsx)(s.C5$, { className: G }), (0, n.jsx)("div", { children: t }), ], }); }, V = (e) => { var { firstEntryMessageConfig: { storageKey: t, messageText: i }, loadSaliencySEGFinished: a, } = e, o = () => { if (!B.T.getItem(t)) B.T.setItem(t, "true"), F.h.open({ content: (0, n.jsx)(z, { message: i }), uiStyle: { top: "200px" }, delay: 3e3, }); }; (0, r.useEffect)(() => { a && o(); }, [a]); }, W = (e) => { var { firstEntryMessageConfig: t, panelConfig: i, instanceConfig: a, services: o, dragConfig: s, scaleConfig: l, brushContainerConfig: c, undoRedoConfig: d, paintBarButtons: u, loadSaliencySEGFinished: f, } = e; V({ firstEntryMessageConfig: t, loadSaliencySEGFinished: f }); var h = (0, r.useMemo)( () => ({ firstEntryMessageConfig: t, panelConfig: i, instanceConfig: a, services: o, dragConfig: s, scaleConfig: l, brushContainerConfig: c, undoRedoConfig: d, paintBarButtons: u, }), [t, i, a, o, s, l, c, d, u] ); return (0, n.jsxs)(_.Provider, { value: h, children: [(0, n.jsx)(O, {}), (0, n.jsx)(M, {})], }); }, Z = i("925367"), K = i("979870"), H = { top: "-40px", left: "0px", borderRadius: "8px", border: "0.5px solid var(--line-2)", }, q = { top: "-40px", left: "-36px", borderRadius: "8px", border: "0.5px solid var(--line-2)", }, J = (e) => { var { paintModeInstance: t, paintProps: i, brushSizeConfig: a, statusConfig: o, loadSaliencySEGFinished: s, } = e, { brushSize: l, eraserSize: u, onChangeBrushSize: f } = a, { drawAction: h, switchDrawAction: p, dragStatus: v } = o, { item: m, tool: g, reportService: _, extraParams: y } = i, { dragInstance: b, resizeInstance: I, firstEntryParams: w, paintBarButtons: x, itemReportEventName: S = "inpaint_item", brushContainerOverrideConfig: { brushConfig: M = {}, eraserConfig: C = {}, } = {}, } = y, T = (e) => { var { reportItem: t } = e, i = (0, K.BT)(m); null == _ || _.reportBusinessEvent( S, (0, d._)((0, c._)({}, i), { action: Z.FD.Show, item: t, tool: g, }) ); }, A = (e) => { var { reportItem: t } = e, i = (0, K.BT)(m); null == _ || _.reportBusinessEvent( S, (0, d._)((0, c._)({}, i), { action: Z.FD.Click, item: t, tool: g, }) ); }; (0, r.useEffect)( () => ( T({ reportItem: Z.FB.BrushSlider }), () => { null == I || I.reset(); } ), [] ); var k = { dragStatus: v, handleClickMove: () => { A({ reportItem: Z.FB.Move }), D.L.Active === v ? b.changeStatus(D.L.Disable) : b.changeStatus(D.L.Active); }, }, P = { brushConfig: (0, c._)( { contentStyle: (0, c._)({}, H), isActive: h === Z.o4.Brush, size: l, onChange: (e) => { f(e, Z.o4.Brush); }, onClick: () => { T({ reportItem: Z.FB.BrushSlider }), p(Z.o4.Brush); }, onAfterChange: (e) => { f(e, Z.o4.Brush), null == t || t.updateMousePosition({ offsetX: "50%", offsetY: "50%", }), "number" == typeof e && (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.FB.BrushSlider, item: m, tool: g, reportService: _, value: e, eventName: S, }); }, }, M ), eraserConfig: (0, c._)( { contentStyle: (0, c._)({}, q), isActive: h === Z.o4.Eraser, size: u, onChange: (e) => { f(e, Z.o4.Eraser); }, onClick: () => { T({ reportItem: Z.FB.EraserSlider }), p(Z.o4.Eraser); }, onAfterChange: (e) => { f(e, Z.o4.Eraser), null == t || t.updateMousePosition({ offsetX: "50%", offsetY: "50%", }), "number" == typeof e && (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.FB.EraserSlider, item: m, tool: g, reportService: _, value: e, eventName: S, }); }, }, C ), }, E = { onUndo: () => { (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.FB.Undo, item: m, tool: g, reportService: _, eventName: S, }); }, onRedo: () => { (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.FB.Redo, item: m, tool: g, reportService: _, eventName: S, }); }, }; return (0, n.jsx)(W, { paintBarButtons: x, firstEntryMessageConfig: { storageKey: w.storageKey, messageText: w.message, }, panelConfig: { panelStyle: { zIndex: 10 } }, instanceConfig: { paintModeInstance: t, dragInstance: b, resizeInstance: I, }, services: {}, dragConfig: k, scaleConfig: { onScaleChange: (e, t) => { var i = Math.abs(e) > Math.abs(t) ? Z.FB.RatioUp : Z.FB.RatioDown; (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: i, item: m, tool: g, reportService: _, eventName: S, }); }, }, brushContainerConfig: P, undoRedoConfig: E, loadSaliencySEGFinished: s, }); }, Y = i("2910"), Q = "canvasContainer-tH8U5d", X = "image-QVpjiA", $ = "imagineGraphicEditor-J9x9Db", ee = "loading-P3OZWj", et = i("653061"), ei = i("319440"), en = i("429398"); function er(e) { var { width: t, height: i } = e, n = Z.gn / i, r = n * t; if (r < Z.qx) return { width: r, height: Z.gn }; var a = (n = Z.qx / t) * i; return { width: Z.qx, height: a }; } var ea = (e) => { var { image: t, elementStyle: i } = e; return { canvasStyle: (0, r.useMemo)(() => { if (!t || !t.width || !t.height) return (0, d._)((0, c._)({}, i), { width: 0, height: 0 }); var { width: e, height: n } = t; return (0, c._)({}, i, er({ width: e, height: n })); }, [t, i]), }; }, eo = (e, t) => { var { url: i, image: a } = e, { paintProps: o } = e, { extraParams: s } = o, { resizeInstance: l, dragInstance: c } = s, d = (0, r.useMemo)(() => [l, c], []), { elementRef: u, elementStyle: f, resetTransformStyle: h, activateAllWatchers: p, deactivatedAllWatchers: v, } = (0, en.E)(d); (0, r.useEffect)( () => ( p(), () => { p(); } ), [h, p, v] ); var { canvasStyle: m } = ea({ image: a, elementStyle: f }); return (0, n.jsxs)("div", { className: Q, ref: u, style: m, children: [ (0, n.jsx)(et.k, { loader: (0, n.jsx)(ei.XG, { className: ee, size: ei.XJ.Big }), className: X, imageStyle: { overflow: "hidden", objectFit: "contain" }, src: (0, Y.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", "data-apm-action": "paint-canvas-ui", }), (0, n.jsx)("div", { className: $, ref: t }), ], }); }, es = (0, r.forwardRef)(eo), el = i("139646"), ec = i("293793"), ed = i("880821"), eu = i("106456"), ef = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADBJREFUOE9jbAp4ZsyAB4hISuKTZmAcNWBYhMG0zP9408Gb58/xp4NRAxgYh34YAABF7zjxN4qb+wAAAABJRU5ErkJggg==", eh = i("787424"), ep = i("170197"), ev = (e) => { var { extraParams: t, overrideInitParams: i } = e, o = (0, r.useRef)(), s = (0, eu.sd)((0, eu.CL)(t.brushSizeStorageKey)), { brushColor: l } = t, c = (function () { var e = (0, el._)(function* (e, t) { try { var i = yield (0, ed.po)(t), n = e.createPattern(i, "repeat"); if (!n) return; e.strokeStyle = n; } catch (e) {} }); return function (t, i) { return e.apply(this, arguments); }; })(); return { setup: (0, ec.default)( (function () { var t = (0, el._)(function* (t, r) { o.current = t; var { width: d, height: u } = r; if (!!d && !!u) { var f = er({ width: d, height: u }); t.changeCanvasSize({ width: d, height: u }), t.changeCanvasContainerSize(f); var h = t.getCanvasContext2D(); l ? t.brush.changeBrushColor(l) : yield c(h, ef); var p = Z.o4.Brush, v = (0, eu.j2)(s[p]); if ( (t.brush.changeBrushSize(v), null == i ? void 0 : i.maskUrl) ) { var m = new eh.J(); m.show( (0, n.jsx)(ep.G, { style: { top: "".concat( t.getCanvasElement().getBoundingClientRect().top, "px" ), }, content: (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)(ei.XG, { size: ei.XJ.Middle }), (0, n.jsx)("span", { style: { paddingLeft: "8px" }, children: a.ZP.t( "homepage_tab_project_loading" ), }), ], }), onCancel: () => { m.hide(), e.closeModalHandler(); }, }) ); var g = yield (0, ed.po)(i.maskUrl); if (g) { var { canvas: _, context: y } = (0, ed.pv)({ target: t.getCanvasElement(), maskData: g, }); t.drawImage({ image: _ }), t.recordFirstScreen( y.getImageData(0, 0, _.width, _.height) ), m.hide(); } } } }); return function (e, i) { return t.apply(this, arguments); }; })() ), paintBrushSize: s, }; }, em = (e) => { var { paintBrushSize: t, brushSizeStorageKey: i } = e, [n, a] = (0, r.useState)(t); return { brushSizeConfig: n, onChangeBrushSize: (e, t) => { if (!Array.isArray(e)) { var n = { [Z.o4.Brush]: e, [Z.o4.Eraser]: e }; B.T.setItem(i, JSON.stringify(n)), a(n); } }, }; }, eg = i("37764"), e_ = i("614854"), ey = (e) => { var { image: t, setup: i } = e, n = (0, r.useRef)(null), a = (0, r.useRef)(null), o = (0, r.useRef)(Symbol("paint")), [s, l] = (0, r.useState)(null), c = (e) => { var r, a = null === (r = n.current) || void 0 === r ? void 0 : r.changeMode(e); !s && t && a && i(a, t), a && l(a); }; return ( (0, r.useEffect)(() => { var e = a.current; if (!!e) { var t = new eg.O({ container: e }); return ( t.registerMode(o.current, e_.o), (n.current = t), c(o.current), () => { t.destroy(); } ); } }, []), { containerRef: a, paintModeInstance: s } ); }, eb = (e) => { var t, { props: i } = e, { item: n, extraParams: r } = i, a = null === (t = n.image.largeImages) || void 0 === t ? void 0 : t[0], { setup: o, paintBrushSize: s } = ev(i), { brushSizeStorageKey: l } = r, { containerRef: c, paintModeInstance: d } = ey({ setup: o, image: a, }), { brushSizeConfig: u, onChangeBrushSize: f } = em({ paintBrushSize: s, brushSizeStorageKey: l, }); return { containerRef: c, paintModeInstance: d, brushSizeConfig: u, onChangeBrushSize: f, }; }; i("900992"); var eI = i("744932"), ew = i("259455"), ex = i("997166"), eS = i("605682"), eM = { container: "container-iRY4v8", promptWrap: "promptWrap-t9nycD", promptContent: "promptContent-mV3Pch", promptTextArea: "promptTextArea-FNznsv", promptControlsWrap: "promptControlsWrap-RPlq5w", }, eC = i("4255"), eT = i("472159"), eA = i("780144"), ek = i("699267"), eP = i("434712"), eE = i("369617"), eD = 800, eR = (e) => { var { scene: t, prompt: i, onClickGenerate: o, onPromptChange: s, onClickInputArea: l, maxRows: c = 3, isFocus: d = !0, placeholder: u = "", isDisabledInsertQuotationBtn: f = !1, isShowInsertQuotationBtn: h = !1, } = e, p = (0, r.useRef)(null), v = (0, r.useRef)(!1), m = (0, ek.G)(eP.t), g = (e) => { s(e); }, _ = (e) => { var t = "Enter"; if (!!(e.key === t && !e.shiftKey)) e.preventDefault(), (0, ex.ti)(i) && !v.current && (o(), (v.current = !0)); }, y = () => { null == l || l(); }, { handleInsertQuotes: b } = (0, eT.R)(i, s, p), I = () => { if (i.length + 2 > eD) { eE.s.warning({ id: "promptLimit", content: a.ZP.t( "video_prompt_length_limit", { number0: eD }, "Prompt length exceeds {number0} characters" ), }); return; } b(), (0, eA.s)(m, { position: "post_edit_popup" }); }; return ( (0, r.useEffect)(() => { setTimeout(() => { var e = p.current; e && ((0, ew.K)(e.dom), d || e.blur()); }); }, [p]), (0, n.jsxs)("div", { className: eM.container, children: [ (0, n.jsxs)(eS.t, { scene: t, ignoreClickIntercept: !0, className: eM.promptWrap, children: [ (0, n.jsx)(eI.Z.TextArea, { ref: p, className: eM.promptTextArea, placeholder: u, maxLength: eD, autoSize: { maxRows: c }, value: i, onClick: y, onChange: g, onPressEnter: _, }), (0, n.jsx)("div", { className: eM.promptContent, style: { maxHeight: "".concat(24 * c, "px") }, children: i || u, }), ], }), h && (0, n.jsx)("div", { className: eM.promptControlsWrap, children: (0, n.jsx)(eC.F, { disabled: f, onClick: I, style: { color: "var(--text-primary)" }, }), }), ], }) ); }, eN = (e) => { var t = (0, r.useRef)(e); return ( (0, r.useEffect)(() => { t.current = e; }, [e]), [t] ); }, eL = (e) => e === Z.o4.Brush || e === Z.o4.Eraser, ej = i("934128"), eO = (e) => { var { paintModeInstance: t, brushSizeConfig: i, props: n } = e, { item: a, tool: o, reportService: s, extraParams: l } = n, { dragInstance: c, resizeInstance: d, itemReportEventName: u = "inpaint_item", } = l, f = (0, ej.m)(c, "status") || D.L.Disable, h = (0, ej.m)(d, "scale"), [p, v] = (0, r.useState)(Z.o4.Brush), m = (e) => { v(e); }, g = (e) => { m(e), null == t || t.updateMousePosition({ offsetX: "50%", offsetY: "50%" }), eL(e) && (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.$h[e], item: a, tool: o, reportService: s, eventName: u, }); }; (0, r.useEffect)(() => { if (eL(p)) { var e = (0, eu.j2)(i[p], h); null == t || t.brush.changeBrushSize(e); } }, [p, i, h]), (0, r.useEffect)(() => { if (!!t && !![Z.o4.Brush, Z.o4.Eraser].includes(p)) null == t || t.updateDrawAction(p); }, [p, t]), (0, r.useLayoutEffect)(() => { p !== Z.o4.Move && c.changeStatus(D.L.Disable); }, [p]), (0, r.useLayoutEffect)(() => { f === D.L.Active && m(Z.o4.Move), [D.L.Active, D.L.Advent].includes(f) && (null == t || t.updateMousePosition({ offsetX: "-9999px", offsetY: "-9999px", })); }, [f, t]); var [_, y] = (0, r.useState)(!1), [b] = eN(p); return ( (0, r.useEffect)(() => { if (!!t) t.onPaintAction((e) => { var { action: t } = e, { current: i } = b; i === Z.o4.Brush && t === x.T.EndPaint && y(!0), eL(i) && t === x.T.StartPaint && (0, K.Hj)({ reportInpaintAction: Z.FD.Use, reportDrawAction: Z.$h[i], item: a, tool: o, reportService: s, eventName: u, }); }); }, [t]), { drawAction: p, updateDrawAction: m, dragStatus: f, switchDrawAction: g, isUserDrawn: _, } ); }, eB = (e) => { var t, { props: i } = e, { item: n, tool: a, reportService: o, extraParams: s, overrideInitParams: l, } = i, [c, d] = (0, r.useState)( null !== (t = null == l ? void 0 : l.prompt) && void 0 !== t ? t : "" ), { itemReportEventName: u = "inpaint_item" } = s; return { prompt: c, updatePrompt: (e) => { d(e); }, onClickInputArea: () => { (0, K.Hj)({ reportInpaintAction: Z.FD.Click, reportDrawAction: Z.FB.Prompt, item: n, tool: a, reportService: o, eventName: u, }); }, }; }, eF = i("474139"), eU = i("475578"), eG = i("168511"), ez = i("936690"), eV = i("441361"), eW = i("379311"); class eZ { getEventParams() { var { status: e, generateType: t, failReason: i } = this._params; return { status: e, generate_type: t, fail_reason: i }; } constructor(e) { (this._params = e), (this.eventName = "canvas_edit_generate"); } } function eK(e, t) { (0, eW.S$)(e, eZ, [t]); } var eH = i("460537"), eq = (e) => { var { props: t, prompt: i, paintModeInstance: n, brushSizeConfig: o, drawAction: s, } = e, { handleGenerate: l, item: u, containerService: f, generateType: h, record: p, extraParams: v, scene: m, } = t, { customMaskUpload: g } = v, [_, y] = (0, r.useState)(!1), [b] = eN(s), [I, w] = (0, r.useState)({ [Z.o4.Brush]: !1, [Z.o4.Eraser]: !1 }), S = (0, ez.Tu)(u.aigcImageParams.firstGenerateType); (0, r.useEffect)(() => { if (!!n) n.onPaintAction((e) => { var { action: t } = e, { current: i } = b; t === x.T.EndPaint && w((e) => (0, d._)((0, c._)({}, e), { [i]: !0 })); }); }, [n]); var M = (0, ec.default)((e) => ({ isInpaintUploaded: eU.eD.False, inpaintBrushSize: o[Z.o4.Brush], inpaintEraserSize: o[Z.o4.Eraser], isInpaintBrush: I[Z.o4.Brush] ? eU.eD.True : eU.eD.False, isInpaintEraser: I[Z.o4.Eraser] ? eU.eD.True : eU.eD.False, originPrompt: e, })), C = (e) => { var { text2ImageParams: t, reportParam: n } = e, r = (0, d._)((0, c._)({}, t), { prompt: i }); if (!!f) { var a = u.aigcImageParams.text2imageParams.prompt; (0, eG.N)(f, { generateType: h, generateParam: r, reportParam: n, paintingReportParam: M(a), scene: m, benefits: [], }); } }, T = (function () { var e = (0, el._)(function* () { if (!!n && !_) { if (p) { var { text2ImageParams: e, reportParam: t } = p; C({ text2ImageParams: e, reportParam: t }); } try { var r = n.generatePaintContent(), o = u.aigcImageParams.text2imageParams.prompt, s = (0, eF.W)(i), c = "" === s ? o : i; if (!(0, ex.ti)(s, !0)) { eK(null != f ? f : null, { generateType: h, status: eU.T9.Fail, failReason: "prompt check failed", }); return; } if ((S && (c = "".concat(eV.qi).concat(c)), g)) { y(!0), yield g(r); var d = l( "", i, { imageUploadCostTime: 0, prompt: c, paintParams: M(o), }, { dataURL: r } ); yield Promise.resolve(d); } else { y(!0); var v = Date.now(), m = yield (0, ed.Ax)(r, f); if (!m) throw Error("url is empty."); var b = { imageUploadCostTime: Date.now() - v, prompt: c, paintParams: M(o), }, I = l(m, i, b, { dataURL: r }); yield Promise.resolve(I); } eK(null != f ? f : null, { status: eU.T9.Success, generateType: h, }); } catch (e) { eE.s.warning( a.oc.t( "work_details_fail_retry", {}, "Something went wrong. Try again later." ) ), eK(null != f ? f : null, { status: eU.T9.Fail, failReason: (0, eH.b)(e).message, generateType: h, }); } y(!1); } }); return function () { return e.apply(this, arguments); }; })(); return { isGenerating: _, onGenerate: T }; }, eJ = i("733437"), eY = i("182688"), eQ = i("105789"), eX = i.n(eQ), e$ = (e) => { var t, i, c, d, { prompt: u, updatePrompt: f, onClickInputArea: h, } = eB({ props: e }), { containerRef: p, paintModeInstance: v, brushSizeConfig: m, onChangeBrushSize: g, } = eb({ props: e, prompt: u }), { item: _, extraParams: y, initCallback: b, scene: I, promptInputScene: w, record: x, } = e, { coverUrl: S = "" } = null !== (c = null == _ ? void 0 : _.commonAttr) && void 0 !== c ? c : {}, { isUsePromptInput: M, paintUITitle: C, toolbarActionManager: T, } = y, A = null === (t = _.image.largeImages) || void 0 === t ? void 0 : t[0], { isModelSupportEtta: k, placeholder: P } = (0, r.useMemo)(() => { var e, { actualPrompt: t, prompt: i, modelConfig: n, } = null !== (e = null == x ? void 0 : x.text2ImageParams) && void 0 !== e ? e : {}, r = (0, eY.DR)(null == n ? void 0 : n.feats), o = t || i || ""; return { isModelSupportEtta: r, placeholder: (0, eY.h5)( o, a.oc.t( "ratio_inpaint_description", {}, "Describe the content you want to inpaint, or the image will be generated based on the original prompt" ), r ), }; }, [x]), E = null !== (d = null === (i = (0, eJ.k)(T, (e) => ({ loadSaliencySEGFinished: e.observableData.loadSaliencySEGFinished, }))) || void 0 === i ? void 0 : i.loadSaliencySEGFinished) && void 0 !== d && d, { drawAction: D, switchDrawAction: R, dragStatus: N, isUserDrawn: L, } = eO({ paintModeInstance: v, brushSizeConfig: m, props: e }), { isGenerating: j, onGenerate: O } = eq({ props: e, prompt: u, paintModeInstance: v, brushSizeConfig: m, drawAction: D, }), [B, F] = (0, r.useState)(!L); (0, r.useEffect)(() => { F(!L); }, [L]), (0, r.useEffect)(() => { null == v || v.onDrawImage(() => { F(!1); }); }, [v]), (0, r.useEffect)(() => { v && (null == b || b({ paintModeInstance: v })); }, [v]); var U = (0, r.useMemo)( () => (0, n.jsx)(eS.t, { scene: I, children: (e) => (0, n.jsx)(o.J, { loading: j, onClick: O, className: l.generateButton, text: a.oc.t("tool_button_generate_bottom"), SuffixIcon: () => (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)(s.p88, { className: l.suffixIcon }), e.needCredits, ], }), disabled: B, }), }), [I, j, O, B] ); return (0, n.jsxs)("div", { className: l.contentContainer, children: [ (0, n.jsx)("div", { className: l.title, children: C }), (0, n.jsxs)("div", { className: l.paintContainer, children: [ (0, n.jsx)(es, { url: S, image: A, paintProps: e, ref: p }), (0, n.jsx)(J, { paintModeInstance: v, paintProps: e, brushSizeConfig: { brushSize: m[Z.o4.Brush], eraserSize: m[Z.o4.Eraser], onChangeBrushSize: g, }, statusConfig: { drawAction: D, dragStatus: N, switchDrawAction: R, }, loadSaliencySEGFinished: E, }), ], }), M && (0, n.jsx)("div", { className: eX()(l.textArea, { [l.withBtn]: k }), children: (0, n.jsx)(eR, { scene: w, prompt: u, placeholder: P, isFocus: !1, onPromptChange: f, onClickGenerate: O, onClickInputArea: h, maxRows: k ? 2 : 3, isShowInsertQuotationBtn: k, }), }), (0, n.jsx)("button", { style: { position: "absolute", visibility: "hidden" }, }), (0, n.jsxs)("div", { className: l.bottomContainer, children: [(0, n.jsx)("div", {}), U], }), ], }); }; }, 106456: function (e, t, i) { "use strict"; i.d(t, { CL: function () { return c; }, j2: function () { return u; }, sd: function () { return d; }, }); var n = i(532128), r = i(925367), a = i(200953), o = { [r.o4.Brush]: r.KE, [r.o4.Eraser]: r.KE }, { k: s, b: l } = (0, a.j)({ x: r.zt, y: r.Up }, { x: r.fx, y: r.pb }); function c(e) { return (0, n.c)({ key: e, defaultSize: o, sizeLimit: { max: r.fx, min: r.zt }, }); } function d(e) { try { if (!Object.keys(e).some((e) => ["brush", "eraser"].includes(e))) return e; return { [r.o4.Brush]: e.brush, [r.o4.Eraser]: e.eraser }; } catch (e) { return o; } } function u(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; return (s * e + l) / Math.abs(t); } }, 979870: function (e, t, i) { "use strict"; i.d(t, { BT: function () { return l; }, Bo: function () { return c; }, Hj: function () { return d; }, }); var n = i(625572), r = i(639880), a = i(128468), o = i(925367), s = i(202455); function l(e) { var t, { aigcImageParams: i, commonAttr: n } = e; return { generate_id: i.generateId, request_id: i.requestId, picture_id: n.id, page: e.mode === a.JU.Story ? "aigc_story" : void 0, image_source: null !== (t = e.image.source) && void 0 !== t ? t : s.b.Aigc, }; } function c(e, t, i, a) { var s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : "inpaint_item"; if (!!a) { var c = l(e); i.forEach((e) => { a.reportBusinessEvent( s, (0, r._)((0, n._)({}, c), { action: o.FD.Show, item: e, tool: t }) ); }); } } function d(e) { var { reportInpaintAction: t, reportDrawAction: i, item: a, tool: o, value: s, reportService: c, eventName: d = "inpaint_item", } = e, u = l(a); null == c || c.reportBusinessEvent( d, (0, r._)((0, n._)({}, u), { action: t, item: i, tool: o, value: s }) ); } }, 40853: function (e, t, i) { "use strict"; i.d(t, { Z: () => b }); var n = i("625572"), r = i("772322"); i("245535"); var a = i("76894"); i("218571"); var o = i("925367"), s = i("114979"), l = i("979870"), c = i("44938"), d = i("586167"), u = new (i("950466").Qd)(), f = new d.D(), h = i("949274"), p = i("188754"), v = i("570878"), m = i("699267"), g = i("487736"), _ = i("799108"), y = i("259435"); function b(e) { var { tool: t, item: i, generateType: d, overrideInitParams: b, handleGenerate: I, reportService: w, record: x, containerService: S, extraParams: M, modalProps: C = {}, } = e, T = [ o.FB.Brush, o.FB.Eraser, o.FB.Redo, o.FB.Undo, o.FB.Prompt, o.FB.Move, ]; (0, l.Bo)(i, t, T, w); var A = (0, y.C)(S, g.M.InPaintRepaintModal), k = a.Z.info( (0, n._)( { className: "mwebStandardPaintModalContainer", footer: null, maskClosable: !1, focusLock: !0, afterClose: () => { A.unmount(); }, closeIcon: (0, r.jsx)(p.Rnl, { className: v.Z.closeBtn }), content: (0, r.jsx)(m.$, { instantiationService: S, children: (0, r.jsx)(s.I, { tool: t, item: i, generateType: d, reportService: w, containerService: S, record: x, scene: _.hO.ImageInPaintRepaintButton, promptInputScene: _.hO.ImageInPaintRepaintTextArea, handleGenerate: I, closeModalHandler: () => { k.close(); }, extraParams: (0, n._)( { brushSizeStorageKey: c.u.inpaintBrushSize, dragInstance: f, resizeInstance: u, firstEntryParams: { storageKey: c.u.isBeenOpenedInpaint, message: h.oc.t( "t2i_eraser_swap", {}, "Brush the area you want to inpaint" ), }, paintUITitle: h.oc.t("t2i_eraser1", {}, "Inpaint"), isUsePromptInput: !0, }, M ), overrideInitParams: b, }), }), }, C ) ); return k; } }, 480963: function (e, t, i) { "use strict"; i.d(t, { B: () => b }); var n = i("625572"), r = i("772322"); i("245535"); var a = i("76894"); i("218571"); var o = i("925367"), s = i("979870"), l = i("114979"), c = i("44938"), d = i("586167"), u = new (i("950466").Qd)(), f = new d.D(), h = i("949274"), p = i("188754"), v = i("570878"), m = i("699267"), g = i("487736"), _ = i("799108"), y = i("259435"), b = (e) => { var { tool: t, item: i, generateType: d, overrideInitParams: b, handleGenerate: I, reportService: w, record: x, containerService: S, extraParams: M, modalProps: C = {}, } = e, T = [o.FB.Brush, o.FB.Eraser, o.FB.Redo, o.FB.Undo, o.FB.Move]; (0, s.Bo)(i, t, T, w); var A = (0, y.C)(S, g.M.InPaintEraserModal), k = a.Z.info( (0, n._)( { className: "mwebStandardPaintModalContainer", footer: null, maskClosable: !1, afterClose: () => { A.unmount(); }, closeIcon: (0, r.jsx)(p.Rnl, { className: v.Z.closeBtn }), content: (0, r.jsx)(m.$, { instantiationService: S, children: (0, r.jsx)(l.I, { item: i, tool: t, generateType: d, reportService: w, containerService: S, record: x, scene: _.hO.ImageInPaintEraserButton, promptInputScene: _.hO.ImageInPaintEraserTextArea, handleGenerate: I, closeModalHandler: () => { k.close(); }, overrideInitParams: b, extraParams: (0, n._)( { brushSizeStorageKey: c.u.inpaintBrushSize, dragInstance: f, resizeInstance: u, firstEntryParams: { storageKey: c.u.isBeenOpenedInpaint, message: h.oc.t( "t2i_eraser_swap", {}, "Brush the area you want to inpaint" ), }, paintUITitle: h.oc.t( "reprompt_eilminate", {}, "Remove" ), }, M ), }), }), }, C ) ); return k; }; }, 533278: function (e, t, i) { "use strict"; i.d(t, { z: function () { return a; }, }); var n = i(772322); i(894672); var r = i(274993), a = (e) => { var { icon: t, tips: i, containerStyle: a = {}, className: o = "", } = e, s = (0, n.jsx)("div", { style: a, className: o, children: t }); return i ? (0, n.jsx)(r.Z, { content: i, children: s }) : s; }; }, 592326: function (e, t, i) { "use strict"; function n(e) { return class extends e { constructor(...e) { super(...e), (this.observers = new Map()), (this.on = (e, t) => { var i = this.observers.get(e); !i && ((i = new Set()), this.observers.set(e, i)), i.add(t); }), (this.off = (e, t) => { if (!t) { this.observers.delete(e); return; } var i = this.observers.get(e); if (!!i) i.delete(t); }), (this.clear = () => { this.observers.clear(); }), (this.notify = (e, t) => { var i = this.observers.get(e); null == i || i.forEach((e) => e(t)); }); } }; } i.d(t, { C: function () { return n; }, }); }, 37764: function (e, t, i) { "use strict"; i.d(t, { O: function () { return n; }, }); class n { get currentMode() { return this._currentMode; } get modeInstances() { return this._modeInstances; } registerMode(e, t) { this._modes.set(e, t); } _resolve(e) { var t = this._modes.get(e); if (!t) return; var i = this._modeInstances.get(e); if (i) return i; if ( !!this._container && ((i = new t({ container: this._container })), !!1) ) return this._modeInstances.set(e, i), i; } isInvalidKey(e) { return null == e || "" === e; } changeMode(e) { var t = this._container; if ( (null === (i = this._currentMode) || void 0 === i || i.hide(), !t || this.isInvalidKey(e)) ) return null; try { var i, n, r = this._resolve(e); return ( (this._currentMode = r), null === (n = this._currentMode) || void 0 === n || n.show(), r ); } catch (e) { return null; } } destroy() { this._modeInstances.forEach((e) => e.destroy()), (this._currentMode = void 0), this._modes.clear(), this._modeInstances.clear(), (this._container = null); } constructor(e) { (this._modes = new Map()), (this._modeInstances = new Map()); var { container: t } = e; this._container = t; } } }, 867644: function (e, t, i) { "use strict"; i.d(t, { x: function () { return n; }, }); class n { constructor(e) { var { container: t } = e; this._container = t; } } }, 749623: function (e, t, i) { "use strict"; i.d(t, { T: function () { return n; }, }); var n = (function (e) { return ( (e[(e.StartPaint = 0)] = "StartPaint"), (e[(e.EndPaint = 1)] = "EndPaint"), e ); })({}); }, 614854: function (e, t, i) { "use strict"; i.d(t, { o: () => T }); var n = i("867644"), r = i("789786"), a = i("592326"), o = 1, s = "#000000"; class l { get brushSize() { return this._brushSize; } set brushSize(e) { (this._brushSize = e), this.notify("brushSize", e); } get brushColor() { return this._brushColor; } set brushColor(e) { (this._brushColor = e), this.notify("brushColor", e); } get lastPosition() { return this._lastPosition; } set lastPosition(e) { this._lastPosition = e; } get mousePosition() { return this._mousePosition; } set mousePosition(e) { (this._mousePosition = e), this.notify("mousePosition", e); } get isDraw() { return this._isDraw; } set isDraw(e) { this._isDraw = e; } constructor() { (this._brushSize = o), (this._brushColor = s), (this._lastPosition = { lastX: 0, lastY: 0 }), (this._mousePosition = { offsetX: "50%", offsetY: "50%" }), (this._isDraw = !1); } } l = (0, r.gn)([a.C], l); var c = 100; class d { get undoStack() { return this._undoStack; } set undoStack(e) { (this._undoStack = e), this.notify("undoStack", e); } get redoStack() { return this._redoStack; } set redoStack(e) { (this._redoStack = e), this.notify("redoStack", e); } get undoCount() { return this.undoStack.length; } get redoCount() { return this.redoStack.length; } execute(e) { (this.undoStack = [...this.undoStack, e]), (this.redoStack = []); } undo() { var e = this.undoStack.pop(); if (((this.undoStack = [...this.undoStack]), !!e)) return ( (this.redoStack = [...this.redoStack, e]), this.undoStack.at(-1) ); } redo() { var e = this.redoStack.pop(); if (((this.redoStack = [...this.redoStack]), !!e)) return (this.undoStack = [...this.undoStack, e]), e; } reset() {} clearStack() { (this.redoStack = []), (this.undoStack = []); } constructor(e = {}) { (this._undoStack = []), (this._redoStack = []); var { limit: t = c } = e; this.limit = t; } } d = (0, r.gn)( [ a.C, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof ICommandStackParams ? Object : ICommandStackParams, ]), ], d ); class u { get container() { return this._container; } get paths() { return this._paths; } set paths(e) { this._paths = e; } get isVisible() { return this._isVisible; } set isVisible(e) { (this._isVisible = e), this.notify("isVisible", e); } get canvasOriginScale() { return this._canvasOriginScale; } set canvasOriginScale(e) { this._canvasOriginScale = e; } get canvasOriginSize() { return this._canvasOriginSize; } set canvasOriginSize(e) { this._canvasOriginSize = e; } constructor(e) { (this._paths = []), (this._isVisible = !1), (this._canvasOriginScale = 1), (this._canvasOriginSize = { width: 0, height: 0 }); var { container: t } = e; (this._container = t), (this.brushModel = new l()), (this.commandMangerModel = new d()); } } u = (0, r.gn)( [ a.C, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IPaintModelParams ? Object : IPaintModelParams, ]), ], u ); var f = i("870599"); class h { _initUI() { this.updateMouseUIPosition(this._model.brushModel.mousePosition); } _initListener() { this._model.brushModel.on( "mousePosition", this.updateMouseUIPosition.bind(this) ); } updateMouseUIPosition(e) { var t = this._roundMouseElement, { offsetX: i, offsetY: n } = e; "number" == typeof i && (i = "".concat(i, "px")), "number" == typeof n && (n = "".concat(n, "px")), (0, f.K)(t, { left: i, top: n }), this.changeVisible(!0); } handleInnerContainer(e) { (0, f.K)(e, { cursor: "none" }); } updateRoundSize(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._roundMouseElement, i = 2 * e; (0, f.K)(t, { width: "".concat(i, "px"), height: "".concat(i, "px"), }); } changeVisible(e) { this._roundMouseElement.style.display = e ? "block" : "none"; } constructor(e) { var { radius: t, innerContainer: i, model: n } = e; this._model = n; var r = document.createElement("div"); (0, f.K)(r, { position: "absolute", borderRadius: "50%", boxShadow: "inset 0px 0px 5px 0px var(--text-primary)", transform: "translate(-50%, -50%)", }), this.updateRoundSize(t, r), i.appendChild(r), this.handleInnerContainer(i), (this._roundMouseElement = r), this._initUI(), this._initListener(); } } function p(e, t) { return Math.round(e * Math.pow(10, t)) / Math.pow(10, t); } var v = i("356868"), m = i("925367"), g = 1024, _ = (e) => { var { width: t, height: i } = e, n = Math.max(t, i), r = 1; return n > g && (r = g / n), r; }, y = { [m.o4.Brush]: "xor", [m.o4.Eraser]: "destination-out", [m.o4.Move]: "xor", [m.o4.Select]: "xor", }, b = () => ({ type: m.o4.Brush, points: [], lineWidth: 1, lineCap: "round", strokeStyle: "", lineJoin: "round", }); class I { get canvasElement() { return this._canvasElement; } get context2D() { return this._context2D; } get path() { return this._path; } get offlineCanvas() { return this._offlineCanvas; } get actionType() { return this._actionType; } _reduceCanvasSize(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._canvasElement; (this._model.canvasOriginScale = _({ width: e.width, height: e.height, })), (t.width = e.width * this._model.canvasOriginScale), (t.height = e.height * this._model.canvasOriginScale), (this._model.canvasOriginSize = { width: e.width, height: e.height, }); } updateDrawAction(e) { this._actionType = e; } changeCanvasSize(e) { var { _canvasElement: t } = this; (t.width = e.width), (t.height = e.height), this._reduceCanvasSize(e), this.initContext(); } changeCanvasContainerSize(e) { var { _canvasElement: t, _listenerLayer: i } = this; this.containerSize = e; var { width: n, height: r } = e; (0, f.K)(this.innerContainer, { width: "".concat(n, "px"), height: "".concat(r, "px"), }), (t.style.width = "".concat(n, "px")), (t.style.height = "".concat(r, "px")), (i.style.width = "".concat(n, "px")), (i.style.height = "".concat(r, "px")), this.changeCanvasScale(t.width / n); } changeCanvasScale(e) { var t = this._scaleRatio; t > 0 && this._context2D.scale(1 / t, 1 / t); var i = p(e, 2); this._context2D.scale(i, i), (this._scaleRatio = i); } initContext() { (this._context2D.lineCap = this._lineCap), (this._context2D.lineJoin = this._lineJoin); } _createDivElement() { return document.createElement("div"); } _createCanvasElement() { return ( (this._offlineCanvas = new v.E(0, 0)), { canvasElement: this._offlineCanvas.element, context2D: this._offlineCanvas.element.getContext("2d"), } ); } _initInnerContainer(e, t) { var { containerSize: i, innerContainer: n } = e, { container: r } = t; (0, f.K)(n, { position: "relative", width: "".concat(i.width, "px"), height: "".concat(i.height, "px"), }), r.appendChild(n); } _initCanvasElement(e, t) { var { canvasElement: i, innerContainer: n } = e, { container: r } = t, a = r.getBoundingClientRect(); this._reduceCanvasSize(a, i), n.appendChild(i); } _initListenerLayer(e) { var { containerSize: t, listenerLayer: i, innerContainer: n } = e; (0, f.K)(i, { width: "".concat(t.width, "px"), height: "".concat(t.height, "px"), position: "absolute", top: "0px", left: "0px", }), n.appendChild(i); } _initListener() { this._model.brushModel.on("brushSize", (e) => { this.changeLineWidth(e), this.roundMouse.updateRoundSize(e); }), this._model.on( "isVisible", this.changeInnerContainerVisible.bind(this) ), this._model.brushModel.on( "brushColor", this.changeStrokeStyle.bind(this) ); } resetPath() { this._path = b(); } updatePathType(e) { this._path.type = e; } changeLineWidth(e) { (this._context2D.lineWidth = 2 * e), (this._lineWidth = 2 * e); } changeStrokeStyle(e) { (this._context2D.strokeStyle = e), (this._strokeStyle = e); } moveTo(e, t) { this._context2D.moveTo(e, t); } beginPath() { this._context2D.beginPath(); } closePath() { this._context2D.closePath(); } drawLine(e) { var { offsetX: t, offsetY: i } = e; this._model.brushModel.mousePosition = { offsetX: t, offsetY: i }; var { brushModel: n } = this._model, r = this._context2D, { isDraw: a } = n; if (!!a) { var { lastPosition: o } = n; r.save(), (r.globalCompositeOperation = y[this._actionType]), (r.lineWidth = this._lineWidth), (r.strokeStyle = this._strokeStyle), r.lineTo(t, i), r.stroke(), r.restore(); var { width: s, height: l } = this.containerSize; this.path.points.push([t / s, i / l]), Object.assign(this.path, { type: this._actionType, strokeStyle: this._strokeStyle, lineWidth: this._lineWidth, lineCap: this._lineCap, lineJoin: this._lineJoin, }), (o.lastX = t), (o.lastY = i); } } drawImage(e) { var { containerSize: t } = this, { image: i, x: n = 0, y: r = 0, width: a = t.width, height: o = t.height, } = e, s = this._context2D; s.save(), (s.imageSmoothingEnabled = !0), (s.imageSmoothingQuality = "high"), (s.globalCompositeOperation = "xor"), s.drawImage(i, n, r, a, o), s.restore(); } drawPaths(e) { var t = this._context2D, { width: i, height: n } = this.containerSize; e.forEach((e) => { var { points: r, type: a, lineWidth: o, strokeStyle: s } = e; t.save(), (t.globalCompositeOperation = y[a]), (t.filter = "blur(1px)"), (t.lineWidth = o), (t.strokeStyle = s), t.beginPath(); for (var l = 0; l < r.length; l++) { var c = r[l], d = c[0] * i, u = c[1] * n; 0 === l ? t.moveTo(d, u) : t.lineTo(d, u), t.stroke(); } t.restore(); }); } changeInnerContainerVisible(e) { (0, f.K)(this.innerContainer, { display: e ? "block" : "none" }); } clearRect() { var { width: e, height: t } = this.containerSize; this._context2D.clearRect(0, 0, e, t); } getListenerLayer() { return this._listenerLayer; } constructor(e) { (this._scaleRatio = -1), (this._path = b()), (this._actionType = m.o4.Brush), (this._lineWidth = 1), (this._lineCap = "round"), (this._lineJoin = "round"), (this._strokeStyle = ""); var { model: t, container: i } = e; this._model = t; var n = i.getBoundingClientRect(), r = { width: Math.round(n.width), height: Math.round(n.height) }; this.containerSize = r; var a = this._createDivElement(); this._initInnerContainer({ containerSize: r, innerContainer: a }, e), (this.innerContainer = a); var { canvasElement: o, context2D: s } = this._createCanvasElement(); this._initCanvasElement({ canvasElement: o, innerContainer: a }, e), (this._canvasElement = o), (this._context2D = s), this.initContext(), (this.roundMouse = new h({ radius: t.brushModel.brushSize, innerContainer: a, model: t, })); var l = this._createDivElement(); this._initListenerLayer({ containerSize: r, listenerLayer: l, innerContainer: a, }), (this._listenerLayer = l), this._initListener(); } } class w { get firstScreenContent() { return this._firstScreenContent; } clearRect() { this._view.clearRect(); } readSnapshotData() { var { canvasElement: e } = this._view; return e.toDataURL("image/png", 1); } drawMask(e) { if (!!e) { var { originImageData: t } = e, { canvasElement: i } = this._view, n = document.createElement("canvas"); (n.width = t.width), (n.height = t.height), n.getContext("2d").putImageData(t, 0, 0), this._view.clearRect(), this._view.drawImage({ image: n }), (n.width = 0), (n.height = 0); } } drawPaths(e) { if (!!e) { var { paths: t } = e; this.drawMask(this._firstScreenContent), this._view.drawPaths(t); } } recordFirstScreen(e) { if (!this._firstScreenContent) this._firstScreenContent = { originImageData: e }; } synchronizeCommandData() { try { var e = { paths: [...this._model.paths, this._view.path] }; this._model.paths.push(this._view.path), this._model.commandMangerModel.execute(e); } catch (e) {} } execUndo() { var e = this._model.commandMangerModel.undo(); e ? (this._model.paths = [...e.paths]) : (this._model.paths = []); var t = this._firstScreenContent; if (!e && t) { this.drawMask(t); return; } if ((this.execClear(), e)) { this.drawPaths(e); return; } } execRedo() { var e = this._model.commandMangerModel.redo(); if (!!e) this.execClear(), e && ((this._model.paths = [...e.paths]), this.drawPaths(e)); } execClear() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; if (e) { var t = this._firstScreenContent; this.drawMask(t), (this._model.paths = []), this._model.commandMangerModel.clearStack(); } else this.clearRect(); } getCommandData() { var { redoStack: e, undoStack: t } = this._model.commandMangerModel; return { redoStack: e, undoStack: t }; } constructor(e) { var { model: t, view: i } = e; (this._model = t), (this._view = i); } } var x = i("749623"); class S { getCanvasElement() { return this._view.canvasElement; } getCanvasContext2D() { return this._view.context2D; } getOfflineCanvas() { return this._view.offlineCanvas; } getPaths() { return this._model.paths; } handleEndDrawing() { this._isDrawing && (this.notify("onPaintAction", { action: x.T.EndPaint }), (this._isDrawing = !1)), (this._model.brushModel.isDraw = !1); } updateDrawAction(e) { this._view.updateDrawAction(e); } handleMousedown(e) { this.notify("onPaintAction", { action: x.T.StartPaint }), this._view.resetPath(), (this._isDrawing = !0), (this._model.brushModel.isDraw = !0), (this._model.brushModel.lastPosition = { lastX: e.offsetX, lastY: e.offsetY, }), this._view.beginPath(), this._view.moveTo(e.offsetX, e.offsetY); } handleMousemove(e) { this._view.drawLine(e); } handleMouseup(e) { if (!!this._model.brushModel.isDraw) { var { lastX: t, lastY: i } = this._model.brushModel.lastPosition, { offsetX: n, offsetY: r } = e; n === t && r === i && this._view.drawLine(e), this._view.closePath(), this.handleEndDrawing(), this.commandMangerController.synchronizeCommandData(); } } handleMouseover(e) { this._view.roundMouse.changeVisible(!0), (this._model.brushModel.lastPosition = { lastX: e.offsetX, lastY: e.offsetY, }); } getInnerContainer() { return this._view.innerContainer; } handleMouseout() { this._view.roundMouse.changeVisible(!1); } getContainerSize() { return this._view.containerSize; } handleCanvasVisible(e) { this._model.isVisible = e; } handleBrushSize(e) { this._model.brushModel.brushSize = e; } handleBrushColor(e) { this._model.brushModel.brushColor = e; } getBrushColor() { return this._model.brushModel.brushColor; } generatePaintContent() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0.8, { offscreenCanvas: t } = this.getOriginSizeCanvas(); return t.toDataURL("image/png", e); } getImageData() { var e = this._view.canvasElement; return this._view.context2D.getImageData(0, 0, e.width, e.height); } getOriginSizeCanvas() { var { firstScreenContent: e } = this.commandMangerController, { canvasElement: t } = this._view, i = document.createElement("canvas"), n = i.getContext("2d"); if ( ((i.width = this._model.canvasOriginSize.width), (i.height = this._model.canvasOriginSize.height), e) ) { var { originImageData: r } = e; (i.width = r.width), (i.height = r.height), r instanceof HTMLImageElement ? n.drawImage(r, 0, 0) : n.putImageData(r, 0, 0); } return ( (n.strokeStyle = this._view.context2D.strokeStyle), this._model.paths.forEach((e) => { var { points: t, type: r, lineWidth: a, lineCap: o, strokeStyle: s, lineJoin: l, } = e; n.beginPath(), n.save(), (n.globalCompositeOperation = y[r]), (n.lineWidth = a * (this._view.canvasElement.width / parseFloat(this._view.canvasElement.style.width)) * (1 / this._model.canvasOriginScale)), (n.lineJoin = l), (n.lineCap = o), (n.strokeStyle = s), r === m.o4.Eraser && (n.strokeStyle = "#ffffff"); for (var c = 0; c < t.length; c++) { var d = t[c], u = d[0] * i.width, f = d[1] * i.height; 0 === c ? n.moveTo(u, f) : n.lineTo(u, f); } n.stroke(), n.restore(); }), { offscreenCanvas: i, offscreenCtx: n } ); } getOriginSnapshotImageData() { var e; return null === (e = this.commandMangerController.firstScreenContent) || void 0 === e ? void 0 : e.originImageData; } changeCanvasSize(e) { this._view.changeCanvasSize(e); } changeCanvasContainerSize(e) { this._view.changeCanvasContainerSize(e); } onCommandMangerModel(e, t) { this._model.commandMangerModel.on(e, t); } drawImage(e) { this._view.drawImage(e); } drawPaths(e) { this._view.drawPaths(e); } recordFirstScreen(e) { this.commandMangerController.recordFirstScreen(e); } clearCanvas() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; this.commandMangerController.execClear(e); } updateMousePosition(e) { this._model.brushModel.mousePosition = e; } constructor(e) { var { model: t, view: i } = e; (this._model = t), (this._view = i), (this.commandMangerController = new w(e)), (this._isDrawing = !1); } } S = (0, r.gn)( [ a.C, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IPaintControllerParams ? Object : IPaintControllerParams, ]), ], S ); class M { _getBindContainer() { return this._view.getListenerLayer(); } _getEvents() { return Object.keys(this._listener); } bind() { var e = this._getBindContainer(), t = this._listener; this._getEvents().forEach((i) => { var n = t[i]; if ("mouseup" === i) { var r = "onpointerup" in window ? "pointerup" : "mouseup"; window.addEventListener(r, n); } else e.addEventListener(i, n); }); } unbind() { var e = this._getBindContainer(), t = this._listener; this._getEvents().forEach((i) => { var n = t[i]; if ("mouseup" === i) { var r = "onpointerup" in window ? "pointerup" : "mouseup"; window.removeEventListener(r, n); } else e.removeEventListener(i, n); }); } constructor(e) { this._listener = {}; var { view: t, controller: i } = e; (this._view = t), (this._controller = i), (this._listener.mousedown = i.handleMousedown.bind(i)), (this._listener.mousemove = i.handleMousemove.bind(i)), (this._listener.mouseup = i.handleMouseup.bind(i)), (this._listener.mouseover = i.handleMouseover.bind(i)), (this._listener.mouseout = i.handleMouseout.bind(i)); } } class C { changeBrushSize(e) { this._controller.handleBrushSize(e); } changeBrushColor(e) { this._controller.handleBrushColor(e); } getBrushColor() { var e = this._controller.getBrushColor(); return "string" == typeof e ? e : ""; } constructor(e) { var { controller: t } = e; this._controller = t; } } class T extends n.x { getCanvasElement() { return this._controller.getCanvasElement(); } getCanvasContext2D() { return this._controller.getCanvasContext2D(); } show() { this._controller.handleCanvasVisible(!0); } hide() { this._controller.handleCanvasVisible(!1); } redo() { this._controller.commandMangerController.execRedo(); } undo() { this._controller.commandMangerController.execUndo(); } generatePaintContent() { return this._controller.generatePaintContent(1); } getImageData() { return this._controller.getImageData(); } getOriginSnapshotImageData() { return this._controller.getOriginSnapshotImageData(); } getPaths() { return this._controller.getPaths(); } getContainerSize() { return this._controller.getContainerSize(); } changeCanvasSize(e) { this._controller.changeCanvasSize(e); } changeCanvasContainerSize(e) { this._controller.changeCanvasContainerSize(e); } drawImage(e) { this._controller.drawImage(e), this._controller.notify("onDrawImage", e); } drawPaths(e) { this._controller.drawPaths(e); } recordFirstScreen(e) { this._controller.recordFirstScreen(e); } clearCanvas() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; this._controller.clearCanvas(e); } onCommandMangerModel(e, t) { this._controller.onCommandMangerModel(e, t); } onPaintAction(e) { this._controller.on("onPaintAction", e); } onDrawImage(e) { this._controller.on("onDrawImage", e); } updateMousePosition(e) { this._controller.updateMousePosition(e); } updateDrawAction(e) { this._controller.updateDrawAction(e); } getCommandData() { return this._controller.commandMangerController.getCommandData(); } getModel() { return this._model; } destroy() { this._bindListener.unbind(); var e, t = this._container, i = this._controller.getInnerContainer(); t.removeChild(i), null === (e = this._controller.getOfflineCanvas()) || void 0 === e || e.destroy(); } constructor(e) { super(e); var { container: t } = e, i = new u({ container: t }), n = new I({ model: i, container: t }), r = new S({ model: i, view: n }); (this._controller = r), (this._model = i), (this._bindListener = new M({ controller: r, view: n })), this._bindListener.bind(), (this.brush = new C({ controller: this._controller })); } } }, 429398: function (e, t, i) { "use strict"; i.d(t, { E: function () { return a; }, }); var n = i(293793), r = i(218571), a = (e) => { var t = (0, r.useRef)(null), [i, a] = (0, r.useState)({}), o = (0, n.default)(() => i); (0, r.useEffect)(() => { var i = t.current; if (!!i) return ( e.forEach((e) => e.listen({ el: i, getElementStyle: o, setElementStyle: a }) ), () => { e.forEach((e) => e.stop()); } ); }, [o, e]); var s = (0, n.default)(() => { e.forEach((e) => e.reset()); }), l = (0, n.default)(() => { e.forEach((e) => e.activate()); }); return { elementRef: t, elementStyle: i, resetTransformStyle: s, activateAllWatchers: l, deactivatedAllWatchers: (0, n.default)(() => { e.forEach((e) => e.deactivated()); }), }; }; }, 934128: function (e, t, i) { "use strict"; i.d(t, { m: function () { return r; }, }); var n = i(218571); function r(e, t) { return (0, n.useSyncExternalStore)( (i) => ( e.on(t, i), () => { e.off(t, i); } ), () => e.getSnapshot() ); } }, 870599: function (e, t, i) { "use strict"; function n(e, t) { Object.assign(e.style, t); } i.d(t, { K: function () { return n; }, }); }, 532128: function (e, t, i) { "use strict"; i.d(t, { c: function () { return r; }, }); var n = i(246940); function r(e) { var { key: t, defaultSize: i, sizeLimit: r } = e; try { var a = n.T.getItem(t); if (!a) return i; var o = JSON.parse(a), s = !1; if ((s = Object.values(o).some((e) => e < r.min || e > r.max))) return i; return o; } catch (e) { return i; } } }, 976363: function (e, t, i) { "use strict"; i.d(t, { e: function () { return n; }, }); class n { listen(e) { var { el: t, getElementStyle: i, setElementStyle: n } = e; (this.element = t), (this.getElementStyle = i), (this.setElementStyle = n); } stop() { (this.element = void 0), (this.getElementStyle = void 0), (this.setElementStyle = void 0); } reset() {} activate() {} deactivated() {} constructor() { (this.element = void 0), (this.getElementStyle = void 0), (this.getElementStyle = void 0); } } }, 627387: function (e, t, i) { "use strict"; i.d(t, { t: function () { return n; }, }); var n = { transition: "transform 0.2s" }; }, 586167: function (e, t, i) { "use strict"; i.d(t, { D: () => f }); var n = i("625572"), r = i("639880"), a = i("789786"), o = i("345720"), s = i("976363"), l = i("592326"); class c { static addEventListener(e, t, i) { var n = "keydown" === t ? c._keydownHandlers : c._keyupHandlers, r = n.get(e), a = 0 === n.size; if (r) r.add(i); else { var o = new Set(); o.add(i), n.set(e, o); } a && document.addEventListener( t, "keydown" === t ? c._onKeydown : c._onKeyup ); } static removeEventListener(e, t, i) { var n = "keydown" === t ? c._keydownHandlers : c._keyupHandlers, r = n.get(e); if (!!r) r.delete(i), 0 === r.size && n.delete(e), 0 === n.size && document.removeEventListener( t, "keydown" === t ? c._onKeydown : c._onKeyup ); } static _onKeydown(e) { var t = e.key, i = c._keydownHandlers.get(t); if (!!i) i.forEach((t) => t(e)); } static _onKeyup(e) { var t = e.key, i = c._keyupHandlers.get(t); if (!!i) i.forEach((t) => t(e)); } } (c._keyupHandlers = new Map()), (c._keydownHandlers = new Map()); var d = i("627387"), u = " "; class f extends s.e { get containerWidth() { var e, t; return null !== (t = null === (e = this.element) || void 0 === e ? void 0 : e.clientWidth) && void 0 !== t ? t : 0; } get containerHeight() { var e, t; return null !== (t = null === (e = this.element) || void 0 === e ? void 0 : e.clientHeight) && void 0 !== t ? t : 0; } set status(e) { var t = this._status, i = e; if (t !== i && (t !== o.L.Active || i !== o.L.Advent)) { if (i === o.L.Disable) { (this._status = e), this._hideMask(), this.changeCursor("default"), this._unbindEvents(); return; } t === o.L.Disable && this._bindEvents(), this.changeCursor("pointer"), this._showMask(), (this._status = i), this.notify("status", e); } } get status() { return this._status; } changeCursor(e) { var t, i, a, o, s = (0, r._)( (0, n._)( {}, d.t, null === (t = (i = this).getElementStyle) || void 0 === t ? void 0 : t.call(i) ), { cursor: e } ); null === (a = (o = this).setElementStyle) || void 0 === a || a.call(o, s); } setRangeContainer(e, t) { (this._rangeContainer = e), (this._rangeContainerSize = t); } _bindEvents() { var e; null === (e = this.element) || void 0 === e || e.addEventListener("mousedown", this._handleMouseDown), document.addEventListener("mousemove", this._handleMouseMove), document.addEventListener("mouseup", this._handleMouseUp), document.addEventListener("mouseleave", this._handleMouseLeave); } _unbindEvents() { var e; null === (e = this.element) || void 0 === e || e.removeEventListener("mousedown", this._handleMouseDown), document.removeEventListener("mousemove", this._handleMouseMove), document.removeEventListener("mouseup", this._handleMouseUp), document.removeEventListener("mouseleave", this._handleMouseLeave); } _mouseDown(e) { this._status !== o.L.Disable && ((this._startDrag = !0), (this._startDragPosition = { x: e.clientX, y: e.clientY }), this._resetTransition()); } _mouseMove(e) { if (!this._startDrag) return; var { x: t, y: i } = this._startDragPosition, n = e.clientX - t, r = e.clientY - i; if (0 !== n || 0 !== r) (this._isDragging = !0), this._handleMove(n, r), (this._startDragPosition = { x: e.clientX, y: e.clientY }); } _getCurrentMove() { var e, t, i, n = ( null !== (i = null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t).transform) && void 0 !== i ? i : "" ).match(/translate\(([\-\d\.]+)px[^\d\.\-]+([\-\d\.]+)px\)/); return n ? { x: Number(n[1]), y: Number(n[2]) } : { x: 0, y: 0 }; } _handleMove(e, t) { var { x: i, y: n } = this._getCurrentMove(), r = this._getCurrentScale(), a = i + e / r, o = n + t / r, { x: s, y: l } = this._getRange(r); (this._x = this._getValueInRange(a, s)), (this._y = this._getValueInRange(o, l)), this.notify("move", ""), this._changeMoveStyle(r); } _getRange(e) { if (e >= 1 || !this._rangeContainerSize) { var t = Math.abs(this.containerWidth / 2), i = Math.abs(this.containerHeight / 2); return { x: { min: -t, max: t }, y: { min: -i, max: i } }; } var { width: n, height: r } = this._rangeContainerSize, a = (n - this.containerWidth * e) / 2 / e, o = (r - this.containerHeight * e) / 2 / e; return { x: { min: -a, max: a }, y: { min: -o, max: o } }; } _getValueInRange(e, t) { var { min: i, max: n } = t; return Math.min(n, Math.max(i, e)); } _changeMoveStyle(e) { var t, i, a, o, s = (0, r._)( (0, n._)( {}, null === (t = (i = this).getElementStyle) || void 0 === t ? void 0 : t.call(i) ), { transform: "scale(" .concat(e, ") translate(") .concat(this._x, "px, ") .concat(this._y, "px)"), } ); null === (a = (o = this).setElementStyle) || void 0 === a || a.call(o, s); } _resetTransition() { var e, t, i, a, o, s, l, c = null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t); this._elementTransitionValue = null !== (l = null == c ? void 0 : c.transition) && void 0 !== l ? l : ""; var d = (0, r._)( (0, n._)( {}, null === (i = (a = this).getElementStyle) || void 0 === i ? void 0 : i.call(a) ), { transition: "none" } ); null === (o = (s = this).setElementStyle) || void 0 === o || o.call(s, d); } _resumeTransition() { var e, t, i, a, o = (0, r._)( (0, n._)( {}, null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t) ), { transition: this._elementTransitionValue } ); null === (i = (a = this).setElementStyle) || void 0 === i || i.call(a, o); } _getCurrentScale() { var e, t, i = null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t), n = null == i ? void 0 : i.transform; if (!n) return 1; var r = n.match(/scale\(([^)]+)\)/); return (r && Number(r[1])) || 1; } _mouseUp() { (this._isDragging = !1), (this._startDrag = !1), this.notify("onMouseUp", void 0), this._resumeTransition(); } _mouseLeave() { this._isDragging && this._startDrag && this._resumeTransition(), (this._isDragging = !1), (this._startDrag = !1); } listen(e) { super.listen(e), this._initMask(); } _initMask() { var e, t, i = "__mask__"; if ( null === (e = this.element) || void 0 === e ? !void 0 : !e.querySelector("#".concat(i)) ) { var n = document.createElement("div"); n.setAttribute( "style", "position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; display: none;" ), (n.id = i), null === (t = this.element) || void 0 === t || t.appendChild(n), (this._mask = n); } } _showMask() { this._mask && (this._mask.style.display = "block"); } _hideMask() { this._mask && (this._mask.style.display = "none"); } _bindGlobalEvents() { c.addEventListener(u, "keydown", this._handleKeydown), c.addEventListener(u, "keyup", this._handleKeyup); } _unbindGlobalEvents() { c.removeEventListener(u, "keydown", this._handleKeydown), c.removeEventListener(u, "keyup", this._handleKeyup); } _onKeydown(e) { (this._beforeHotkeyDragStatus = this.status), (this.status = o.L.Advent); } _onKeyup(e) { this.status = this._beforeHotkeyDragStatus === o.L.Active ? o.L.Active : o.L.Disable; } stop() { super.stop(), this.deactivated(), this._unbindEvents(), this._unbindGlobalEvents(); } changeStatus(e) { this.status = e; } activate() { this._bindGlobalEvents(); } deactivated() { (this.status = o.L.Disable), this._unbindGlobalEvents(); } getSnapshot() { return this.status; } getMoveDataSnapshot() { return JSON.stringify({ x: this._x, y: this._y }); } reset() { var e, t; (this._x = 0), (this._y = 0), (this._status = o.L.Disable), (this._startDrag = !1), (this._startDragPosition = { x: 0, y: 0 }), (this._isDragging = !1), null === (e = (t = this).setElementStyle) || void 0 === e || e.call(t, (0, n._)({}, d.t)); } resetMove() { (this._x = 0), (this._y = 0), this.notify("move", ""); } constructor() { super(), (this._x = 0), (this._y = 0), (this._status = o.L.Disable), (this._startDrag = !1), (this._startDragPosition = { x: 0, y: 0 }), (this._isDragging = !1), (this._handleMouseDown = this._mouseDown.bind(this)), (this._handleMouseMove = this._mouseMove.bind(this)), (this._handleMouseUp = this._mouseUp.bind(this)), (this._handleMouseLeave = this._mouseLeave.bind(this)), (this._handleKeydown = this._onKeydown.bind(this)), (this._handleKeyup = this._onKeyup.bind(this)), (this._mask = null), (this._elementTransitionValue = ""), (this._beforeHotkeyDragStatus = o.L.Disable), (this._rangeContainer = null), (this._rangeContainerSize = null); } } f = (0, a.gn)( [ l.C, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", []), ], f ); }, 345720: function (e, t, i) { "use strict"; i.d(t, { L: function () { return n; }, }); var n = (function (e) { return ( (e.Active = "active"), (e.Advent = "advent"), (e.Disable = "disabled"), e ); })({}); }, 950466: function (e, t, i) { "use strict"; i.d(t, { Qd: () => g }); var n = i("625572"), r = i("639880"), a = i("789786"), o = i("592326"), s = i("976363"), l = 120, c = (function (e) { return ( (e.TouchPadPinchUp = "TouchPadPinchUp"), (e.TouchPadPinchDown = "TouchPadPinchDown"), (e.TouchPadMoveUp = "TouchPadMoveUp"), (e.TouchPadMoveDown = "TouchPadMoveDown"), (e.MouseUp = "MouseUp"), (e.MouseDown = "MouseDown"), e ); })({}), d = (e) => { if (e.ctrlKey) return { action: e.deltaY > 0 ? "TouchPadPinchDown" : "TouchPadPinchUp", }; var t = null == e ? void 0 : e.wheelDeltaY; return (t ? Math.abs(t) < l : 0 === e.deltaMode) ? { action: e.deltaY > 0 ? "TouchPadMoveUp" : "TouchPadMoveDown" } : { action: e.deltaY > 0 ? "MouseUp" : "MouseDown" }; }, u = i("342396"), f = i("627387"), h = 1.03, p = 0.97, v = 1.06, m = 0.94; class g extends s.e { get scale() { return this._scale; } set scale(e) { if (e !== this._scale) (this._scale = e), this._changeElementStyle(), this.notify("scale", void 0); } _changeElementStyle() { var e, t, i, a, o, s = null !== (o = null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t)) && void 0 !== o ? o : {}, l = s.transform, c = l ? l.replace( /scale\(([^)]+)\)/, "scale(".concat(Math.abs(this._scale), ")") ) : "scale(".concat(Math.abs(this._scale), ")"), d = (0, r._)((0, n._)({}, f.t, s), { transform: c }); null === (i = (a = this).setElementStyle) || void 0 === i || i.call(a, d); } _handlePinch(e, t) { var i = 1; i = t ? (e ? h : p) : e ? v : m; var n = Math.max(u.$A, Math.min(u.pv, Math.abs(this.scale * i))); this.scale = n; } _onWheel(e) { e.preventDefault(), e.stopPropagation(), null === (t = this.element) || void 0 === t || t.click(); var t, { action: i } = d(e); if ( !![ c.MouseUp, c.TouchPadPinchUp, c.MouseDown, c.TouchPadPinchDown, ].includes(i) ) { var n = i === c.TouchPadPinchDown || i === c.TouchPadPinchUp, r = i === c.MouseUp || i === c.TouchPadPinchUp; this._handlePinch(r, n); } } resetOffset() { var e, t, i, a, o, s = null !== (o = null === (e = (t = this).getElementStyle) || void 0 === e ? void 0 : e.call(t)) && void 0 !== o ? o : {}; null === (i = (a = this).setElementStyle) || void 0 === i || i.call( a, (0, r._)((0, n._)({}, f.t, s), { transform: "scale(".concat(Math.abs(this._scale), ")"), }) ); } _bindEvents() { var e; null === (e = this.element) || void 0 === e || e.addEventListener("wheel", this._handleWheel); } _unbindEvents() { var e; null === (e = this.element) || void 0 === e || e.removeEventListener("wheel", this._handleWheel); } stop() { this._unbindEvents(), (this.element = void 0), (this.getElementStyle = void 0), (this.setElementStyle = void 0); } getSnapshot() { return this._scale; } reset() { var e, t; (this._scale = u.hv), null === (e = (t = this).setElementStyle) || void 0 === e || e.call(t, (0, n._)({}, f.t)); } activate() { this._bindEvents(); } deactivated() { this._unbindEvents(); } constructor() { super(), (this._scale = u.hv), (this._handleWheel = this._onWheel.bind(this)); } } g = (0, a.gn)( [ o.C, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", []), ], g ); }, 210708: function (e, t, i) { "use strict"; i.d(t, { q: () => C }); var n = i("218571"), r = i("37764"), a = i("614854"), o = i("867644"), s = i("789786"), l = i("592326"); class c { handleContainerVisible(e) { this._model.isVisible = e; } updateRects(e) { this._model.rectangles = e; } destroy() { this._model.destroy(), this.clear(); } handleSelectRect(e) { this.notify("select", e); } constructor(e) { var { model: t } = e; this._model = t; } } c = (0, s.gn)( [ l.C, (0, s.w6)("design:type", Function), (0, s.w6)("design:paramtypes", [ "undefined" == typeof ISelectControllerParams ? Object : ISelectControllerParams, ]), ], c ); class d { get rectangles() { return this._rectangles; } set rectangles(e) { (this._rectangles = e), this.notify("rectangles", e); } get isVisible() { return this._isVisible; } set isVisible(e) { (this._isVisible = e), this.notify("isVisible", e); } destroy() { this.clear(), this.notify("onDestroy", void 0); } constructor() { (this._isVisible = !1), (this._rectangles = []), (this._isVisible = !0); } } d = (0, s.gn)( [ l.C, (0, s.w6)("design:type", Function), (0, s.w6)("design:paramtypes", []), ], d ); var u = i("625572"), f = i("639880"), h = i("2910"), p = i("870599"), v = i("105789"), m = i.n(v), g = { rectContainer: "rectContainer-njaAgY", largeRect: "largeRect-_kJs2C", box: "box-nE_Hsg", smallRect: "smallRect-NM9HLj", rect: "rect-GPtTcJ", rectActive: "rectActive-wdwkF5", }, _ = 58, y = 16, b = 16; class I { _initModelListeners() { this._model.on("isVisible", this.changeContainerVisible), this._model.on("rectangles", this.updateRectangleDoms), this._model.on("onDestroy", this.destroy); } _createRectanglesContainer() { var e = document.createElement("div"); return (e.className = g.rectContainer), e; } _addRectangleDomsToContainer() { var e, t = document.createDocumentFragment(); this._createRectangleDoms().forEach((e) => { t.appendChild(e); }), null === (e = this._rectangleContainer) || void 0 === e || e.appendChild(t), this._bindRectangleContainerListener(); } _handleClickRectangleContainer(e) { for ( var t, { target: i, currentTarget: n } = e, r = i; r !== n && !(null == r ? void 0 : r.dataset.key); ) r = null !== (t = null == r ? void 0 : r.parentElement) && void 0 !== t ? t : null; var a = null == r ? void 0 : r.dataset.key, o = null == r ? void 0 : r.className.includes(g.rectActive); a && !o && this._selectRectangle(a); } _updateRectangleDoms() { var e, t, i, n = [].slice .call( null !== (i = null === (e = this._rectangleContainer) || void 0 === e ? void 0 : e.childNodes) && void 0 !== i ? i : [] ) .map((e) => e.dataset.key), r = this._model.rectangles; if ( this._model.rectangles.length !== n.length || r.some((e, t) => e.key !== n[t]) ) { this._replaceAllRectangleNodes(); return; } var a = this._rectangleContainer.querySelector( "div[class~='".concat(g.rectActive, "']") ); if ( (null == a ? void 0 : a.dataset.key) !== (null === (t = r.find((e) => e.isSelected)) || void 0 === t ? void 0 : t.key) ) { this._updateSelectedRectangleDom(); return; } this._updateRectangleDomPosition(); } _bindRectangleContainerListener() { this._rectangleContainer.addEventListener( "click", this.handleClickRectangleContainer ); } _unbindRectangleContainerListener() { this._rectangleContainer.removeEventListener( "click", this.handleClickRectangleContainer ); } _destroy() { this._unbindRectangleContainerListener(), this._container.removeChild(this._rectangleContainer); } _changeContainerVisible(e) { e ? this._bindRectangleContainerListener() : this._unbindRectangleContainerListener(), (0, p.K)(this._rectangleContainer, { display: e ? "block" : "none", }); } _selectRectangle(e) { this._controller.handleSelectRect(e); } _getRectangleDomClassNames(e) { var { isSelected: t, rect: i } = e, [n, r, a, o] = i, s = Math.min(a, o) >= _; return m()({ [g.rect]: !0, [g.rectActive]: t, [g.smallRect]: !s, [g.largeRect]: s, }); } _createRectangleDoms() { return this._model.rectangles.map((e) => { var t = document.createElement("div"), { key: i } = e; return ( (t.className = this._getRectangleDomClassNames(e)), (t.dataset.key = i), (0, p.K)(t, this._getRectangleDomPositionStyle(e)), (t.innerHTML = (0, h.J)( "\n
\n
\n
\n
"), null, { logType: "js.innerHTML", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", } )), t ); }); } _updateSelectedRectangleDom() { var e, t, i, n = [].slice.call( null !== (i = null === (e = this._rectangleContainer) || void 0 === e ? void 0 : e.childNodes) && void 0 !== i ? i : [] ), r = null === (t = this._model.rectangles.find((e) => e.isSelected)) || void 0 === t ? void 0 : t.key; if ( (n.forEach((e) => { e.classList.remove(g.rectActive); }), r) ) { var a = this._rectangleContainer.querySelector( "div[data-key='".concat(r, "']") ); null == a || a.classList.add(g.rectActive); } } _updateRectangleDomPosition() { var e = this._rectangleContainer, t = this._model.rectangles.reduce( (e, t) => (0, f._)((0, u._)({}, e), { [t.key]: t }), {} ); [].slice.call(e.childNodes).forEach((e) => { var i, n = null !== (i = e.dataset.key) && void 0 !== i ? i : ""; if (n && n in t) { var r = t[n]; (e.className = this._getRectangleDomClassNames(r)), (0, p.K)(e, this._getRectangleDomPositionStyle(r)); } }); } _getRectangleDomPositionStyle(e) { var { rect: t } = e, [i, n, r, a] = t; if (Math.min(r, a) > y) return { width: "".concat(r, "px"), height: "".concat(a, "px"), transform: "translate(".concat(i, "px, ").concat(n, "px)"), }; var o = i - (b - r) / 2, s = n - (b - a) / 2; return { width: "".concat(b, "px"), height: "".concat(b, "px"), transform: "translate(".concat(o, "px, ").concat(s, "px)"), }; } _replaceAllRectangleNodes() { this._unbindRectangleContainerListener(), (this._rectangleContainer.innerHTML = ""), this._addRectangleDomsToContainer(); } constructor(e) { var { controller: t, model: i, container: n } = e; (this._controller = t), (this._model = i), (this._container = n), (this._rectangleContainer = this._createRectanglesContainer()), this._addRectangleDomsToContainer(), this._container.appendChild(this._rectangleContainer), (this.handleClickRectangleContainer = this._handleClickRectangleContainer.bind(this)), (this.updateRectangleDoms = this._updateRectangleDoms.bind(this)), (this.destroy = this._destroy.bind(this)), (this.changeContainerVisible = this._changeContainerVisible.bind(this)), this._initModelListeners(); } } class w extends o.x { updateRects(e) { this._controller.updateRects(e); } show() { this._controller.handleContainerVisible(!0); } hide() { this._controller.handleContainerVisible(!1); } destroy() { this._controller.destroy(); } on(e, t) { return this._controller.on(e, t); } constructor(e) { super(e); var { container: t } = e, i = new d(), n = new c({ model: i }); new I({ container: t, model: i, controller: n }), (this._controller = n); } } var x = i("417281"), S = () => { var e = (0, n.useRef)(null), t = (0, n.useRef)(null); return ( (0, n.useEffect)(() => { var i = t.current; if (!!i) { var n = new r.O({ container: i }); return ( (e.current = n), n.registerMode(x.UI.BgPaint, a.o), n.registerMode(x.UI.FaceGan, w), () => { n.destroy(); } ); } }, []), { graphicEditorRef: e, containerRef: t } ); }, M = i("124217"), C = (e) => { var { abilityType: t, image: i } = e, { graphicEditorRef: r, containerRef: a } = S(), { graphicEditorStatus: o, handleChangeMode: s } = (0, M.L)({ image: i, }), l = (0, n.useRef)(); return ( (0, n.useEffect)(() => { var e = r.current; s(t, e), (l.current = null == e ? void 0 : e.modeInstances); }, [t, s, r]), { graphicEditorStatus: o, graphicEditorTools: (0, n.useMemo)( () => ({ modeInstancesRef: l }), [l] ), graphicEditorRef: r, containerRef: a, } ); }; }, 124217: function (e, t, i) { "use strict"; i.d(t, { x: () => M, L: () => C }); var n = i("139646"), r = i("293793"), a = i("108982"); function o(e, t) { return t === a.s.BgPaint; } function s(e, t) { return t === a.s.FaceGan; } var l = i("218571"), c = i("733437"), d = i("164763"), u = i("466740"), f = i("350138"), h = (e) => e.map((e) => ({ rect: e.faceRect, isSelected: e.isSelected, key: e.faceKey, })), p = () => { var e = (0, u.lS)(), t = d.o.getGraphicToolStoreInstance(e), i = null == t ? void 0 : t.faceGanInstance, n = (0, c.k)(i, (e) => ({ rects: e.faceRects })), a = (0, l.useRef)(); return ( (0, l.useEffect)(() => { var e, t, i = h( null !== (t = null == n ? void 0 : n.rects) && void 0 !== t ? t : [] ); null === (e = a.current) || void 0 === e || e.updateRects(i); }, [n]), { setup: (0, r.default)((t) => { var r; (a.current = t), t.updateRects( h( null !== (r = null == n ? void 0 : n.rects) && void 0 !== r ? r : [] ) ), t.on("select", (t) => { if ("string" == typeof t) null == i || i.selectFaceRect(t), (0, f.x)(e, { position: f.h.Frame }); }); }), } ); }; class v { static getCSSPropertyValue(e) { var { declaration: t } = v; return ( !t && ((t = getComputedStyle(document.body)), (v.declaration = t)), t.getPropertyValue(e) ); } } var m = i("228342"), g = i("134077"), _ = i("489897"), y = i("238638"), b = "canvasStyle-jIDIPb", I = i("925367"), w = i("106456"), x = () => { var e = (0, l.useRef)(), t = (0, u.lS)(), { triggerDrawMasks: i } = (0, y.z)(e), n = d.o.getGraphicToolStoreInstance(t); return { setup: (0, r.default)((t, i) => { e.current = t; var { width: r, height: a } = i; t.changeCanvasSize({ width: r, height: a }); var o = null == n ? void 0 : n.bgPaintInstance; null == o || o.updatePaintModeInstance(t), t.getCanvasContext2D(); var s = v.getCSSPropertyValue("--main-default"), l = (0, w.sd)((0, g.Ek)()), c = I.o4.Brush, d = _.og; (t.getCanvasElement().className = b), t.brush.changeBrushColor((0, m.O)(s, d)); var u = (0, g.rW)(l[c]); t.brush.changeBrushSize(u); }), }; }, S = i("880821"), M = (function (e) { return ( (e[(e.Initial = 0)] = "Initial"), (e[(e.Success = 1)] = "Success"), (e[(e.Fail = 2)] = "Fail"), e ); })({}), C = (e) => { var { image: t } = e, { setup: i } = p(), { setup: a } = x(), [c, d] = (0, l.useState)(0), u = (e, t, n) => { if (o(e, t)) { a(e, n); return; } if (s(e, t)) { i(e); return; } }, f = (function () { var e = (0, n._)(function* (e, i) { try { d(0); var n = ""; n = "string" == typeof t ? t : URL.createObjectURL(t); var r = yield (0, S.po)(n), a = { width: r.width, height: r.height, url: r.src }; u(e, i, a), d(1); } catch (e) { d(2); } }); return function (t, i) { return e.apply(this, arguments); }; })(); return { graphicEditorStatus: c, handleChangeMode: (0, r.default)((e, t) => { if (!t) return; var i = t.modeInstances.has(e), n = t.changeMode(e); if (!!n && !i) f(n, e); }), }; }; }, 238638: function (e, t, i) { "use strict"; i.d(t, { z: () => g }); var n = i("139646"), r = /^data:image\/(\w+);base64,/, a = i("228342"), o = i("880821"), s = i("466740"), l = i("379311"), c = (function (e) { return (e.Success = "success"), (e.Failed = "failed"), e; })({}), d = (function (e) { return ( (e.TransferError = "transfer error"), (e.ImageLoadError = "image load error"), e ); })({}), u = (function (e) { return (e.Base64 = "base64"), (e.Url = "url"), e; })({}); class f { getEventParams() { var { status: e, maskUrl: t, failReason: i, maskUrlType: n, } = this._params; return { status: e, mask_url: t, mask_url_type: n, fail_reason: i }; } constructor(e) { (this._params = e), (this.eventName = "draw_bgpaint_mask"); } } function h(e, t) { (0, l.S$)(e, f, [t]); } var p = i("164763"), v = i("733437"), m = i("119814"), g = (e, t) => { var i = (0, s.lS)(), l = p.o.getGraphicToolStoreInstance(i), f = null == l ? void 0 : l.bgPaintInstance, g = (0, v.k)(f, (e) => { var t; return null !== (t = e.maskList) && void 0 !== t ? t : []; }), _ = (function () { var s = (0, n._)(function* (n) { if (!!e.current) { var s = n; e.current.getCanvasContext2D(); var l = !r.test(s), p = e.current.getCanvasElement(), v = document.createElement("canvas"), g = v.getContext("2d"), _ = e.current.getModel().canvasOriginSize; (v.width = p.width / _.width), (v.height = p.height / _.height); var y = () => { (g.imageSmoothingEnabled = !0), (g.imageSmoothingQuality = "high"); }; if ((y(), l)) { var [b, I] = yield (0, o.uX)( n, (0, a.U)(e.current.brush.getBrushColor(), !0) ); if ((null == t || t(), !I)) { h(i, { status: c.Failed, maskUrl: s, maskUrlType: u.Url, failReason: d.TransferError, }); return; } (v.width = I.width), (v.height = I.height), y(), g.putImageData(I, 0, 0), e.current.drawImage({ image: v }), e.current.recordFirstScreen(I), h(i, { status: c.Success, maskUrl: s, maskUrlType: u.Url, }); return; } var w = null == f ? void 0 : f.getMaskDataMap(s); if (w) { (v.width = w.width), (v.height = w.height), y(), g.putImageData(w, 0, 0), e.current.drawImage({ image: v }), h(i, { status: c.Success, maskUrlType: u.Base64 }); var x = null == f ? void 0 : f.getPaths(s); x && e.current.drawPaths(x), e.current.recordFirstScreen(w); return; } var S = yield (0, m.p)(s); if (!S) { h(i, { status: c.Failed, maskUrlType: u.Base64, failReason: d.ImageLoadError, }); return; } g.drawImage(S, 0, 0), e.current.drawImage({ image: v }), e.current.recordFirstScreen( g.getImageData(0, 0, v.width, v.height) ), h(i, { status: c.Success, maskUrlType: u.Base64 }); } }); return function (e) { return s.apply(this, arguments); }; })(); return { triggerDrawMasks: () => { if ((null == g ? void 0 : g.length) !== 0) null == g || g.forEach((e) => { _(e.mask.url); }); }, }; }; }, 461874: function (e, t, i) { "use strict"; i.d(t, { R6: function () { return c; }, q5: function () { return s; }, rh: function () { return l; }, }); var n = i(489897), r = i(314068), a = i(224671), o = i(752134); function s(e) { var t, i; return ( (null !== (t = null == e ? void 0 : e.width) && void 0 !== t ? t : r.jg.width) / (null !== (i = null == e ? void 0 : e.height) && void 0 !== i ? i : r.jg.height) ); } function l(e) { var t = s(e); for (var i of n.d7) if (i === t) return !1; return !0; } function c(e) { var t = s(e), i = 0.004; for (var r of [ a.jP.OneOne, a.jP.ThreeTwo, a.jP.TwoThree, a.jP.FourThree, a.jP.ThreeFour, a.jP.NineSixteen, a.jP.SixteenNine, a.jP.TwentyOneNine, ]) if (Math.abs(n.mg[r] - t) < i) return (0, o.d$)(r, e); return !1; } }, 134077: function (e, t, i) { "use strict"; i.d(t, { Cg: function () { return l; }, Ek: function () { return c; }, rW: function () { return f; }, }); var n = i(44938), r = i(200953), a = i(925367), o = i(532128), s = i(489897), l = { [a.o4.Brush]: s.KE, [a.o4.Eraser]: s.KE }; function c() { return (0, o.c)({ key: n.u.bgPaintBrushSize, defaultSize: l, sizeLimit: { max: s.fx, min: s.zt }, }); } var { k: d, b: u } = (0, r.j)({ x: s.zt, y: s.Up }, { x: s.fx, y: s.pb }); function f(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; return Math.round((d * e + u) / Math.abs(t)); } }, 239643: function (e, t, i) { "use strict"; i.d(t, { VQ: function () { return m; }, Vv: function () { return g; }, _X: function () { return _; }, tn: function () { return v; }, }); var n = i(185617), r = i(489897), a = i(108982), o = i(461874), s = 936, l = 648, c = 0.5, d = 80, u = 0, f = 0, h = 1; function p(e, t) { return isNaN(e) ? t : e; } function v() { var e = Math.min(Math.max((0, n._U)() * c, l), s) - d; return { width: e, height: e / r.Mu }; } function m(e) { var t = e.offsetWidth; return { width: t, height: t / r.Mu }; } function g(e, t, i) { var n = t / i, r = (0, o.q5)(e); return r === n ? { width: t, height: i } : r > n ? { width: t, height: t / r } : { width: p(i * r, t), height: p(i, i) }; } function _(e) { var { paintWidth: t, paintHeight: i, imageWidth: n, imageHeight: r, fitMode: o, } = e; if (o === a.G.CenterCrop) return { scale: 1, width: t, height: i }; var s = t / i, l = n / r; return l === s ? { scale: t / n, width: t, height: i } : l > s ? { scale: t / n, width: t, height: t / l } : { scale: p(i / r, h), width: p(i * l, u), height: p(i, f) }; } }, 666204: function (e, t, i) { "use strict"; i.d(t, { u: () => l }); var n = i("139646"), r = i("159895"); function a(e, t) { var { width: i, height: n } = e, { width: r, height: a } = t, o = 0, s = 0; return ( i > n ? ((o = Math.min(r, i)), (s = Math.floor((n / i) * o))) : ((s = Math.min(a, n)), (o = Math.floor((i / n) * s))), { width: o, height: s } ); } function o(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, n = t.width / t.height, r = e.width / e.height; if (n < r) { var a = Math.floor(t.height / i); return { width: Math.floor(r * a), height: a }; } var o = Math.floor(t.width / i); return { width: o, height: Math.floor(o / r) }; } var s = 1920; function l(e, t, i, n) { return c.apply(this, arguments); } function c() { return (c = (0, n._)(function* (e, t, i, n) { var l = o(e, t, i), c = yield null == n ? void 0 : n.aggregate.getImcConfigByKey(r.c.BlendConfig), { bgPaintResizeSize: d = s } = null != c ? c : {}; return a(l, { width: d, height: d }); })).apply(this, arguments); } }, 170197: function (e, t, i) { "use strict"; i.d(t, { G: () => o }); var n = i("772322"), r = { contentWrap: "contentWrap-BOtGMZ", cancel: "cancel-fl5xdN" }, a = i("949274"), o = (e) => { var { content: t, onCancel: i, showCancel: o = !0, style: s = {}, } = e; return (0, n.jsxs)("div", { className: r.contentWrap, style: s, children: [ t, o && (0, n.jsx)("span", { className: r.cancel, onClick: () => (null == i ? void 0 : i()), children: a.ZP.t("wimg2img_button_cancel", {}, "Cancel"), }), ], }); }; }, 930153: function (e, t, i) { "use strict"; i.d(t, { T: function () { return n; }, d: function () { return r; }, }); var n = 12, r = 36; }, 876220: function (e, t, i) { "use strict"; i.d(t, { o: function () { return a; }, x: function () { return r; }, }); var n = i(930153); function r(e, t, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1, r = (e / 180) * Math.PI, a = t / Math.abs(n), o = i / Math.abs(n); return { width: Math.abs(a * Math.cos(-r)) + Math.abs(o * Math.sin(-r)), height: Math.abs(a * Math.sin(-r)) + Math.abs(o * Math.cos(-r)), }; } function a(e, t, i, a, o, s) { var { width: l, height: c } = r(e, t, i, s); return { x: { min: -l / 2 + n.T, max: a + l / 2 - n.T }, y: { min: -c / 2 + n.T, max: o + c / 2 - n.T }, }; } }, 853270: function (e, t, i) { "use strict"; i.d(t, { D: () => c }); var n = i("717742"); function r(e, t) { return e >= t.min && e <= t.max; } function a(e, t) { return { x: { min: 0, max: e }, y: { min: 0, max: t } }; } var o = i("876220"), s = i("239643"); function l(e, t, i) { var { width: n, height: r } = e, { width: a, height: o } = t, { width: l, height: c } = (0, s._X)({ paintWidth: n, paintHeight: r, imageWidth: a, imageHeight: o, }); return { width: l * i, height: c * i }; } function c(e) { var { currentMove: t, currentSize: i, targetSize: s, imageSize: c, imageScale: d, imageRotate: u, paintScale: f = 1, needHandleEdge: h = !1, } = e, { moveX: p, moveY: v } = t, { width: m, height: g } = i, { width: _, height: y } = s, { x: b, y: I } = a(m, g), w = r(p, b), x = r(v, I), { width: S, height: M } = l(i, c, d), { width: C, height: T } = (0, o.x)(u, S, M), { width: A, height: k } = l(s, c, d), { width: P, height: E } = (0, o.x)(u, A, k), D = (0, n.c)((p / m) * _, 2); if (!w && h) { if (p < 0) { var R = C / 2 + p; D = (0, n.c)(-P / 2 + R, 2); } else { var N = C / 2 - (p - m); D = (0, n.c)(P / 2 + _ - N, 2); } } var L = (0, n.c)((v / g) * y, 2); if (!x && h) { if (v < 0) { var j = T / 2 + v; L = (0, n.c)(-E / 2 + j, 2); } else { var O = T / 2 - (v - g); L = (0, n.c)(E / 2 + y - O, 2); } } return { moveX: D, moveY: L }; } }, 287967: function (e, t, i) { "use strict"; i.d(t, { S: function () { return n; }, }); var n = (0, i(218571).createContext)(null); }, 494766: function (e, t, i) { "use strict"; i.d(t, { d: () => T, n: () => C }); var n = i("772322"), r = i("466740"), a = i("218571"), o = "controlNetInteract-Vw2xKV", s = "divider-lJeIjd", l = i("733437"), c = i("489897"), d = i("108982"), u = i("743568"); i("894672"); var f = i("274993"), h = i("105789"), p = i.n(h), v = i("188754"), m = { fitModeContainer: "fitModeContainer-bJORhC", fitModeOption: "fitModeOption-EN0atX", active: "active-NBf2Ze", adjustMode: "adjustMode-YG1DVD", interactArea: "interactArea-KhDKyF", helpIcon: "helpIcon-dT25bq", arrowIcon: "arrowIcon-L98cyn", }, g = i("443213"), _ = i("949274"), y = { [d.G.AdaptToCanvas]: "depth_go_along", [d.G.CenterCrop]: "depth_middle_cut", }, b = { [d.G.AdaptToCanvas]: "Fill", [d.G.CenterCrop]: "Center crop" }, I = (e) => { var { fitMode: t, isActive: i, onChangeFitMode: r, onVisibleChange: o, onWarningTipVisible: s, } = e, [l, c] = (0, a.useState)(!1), u = (0, a.useRef)(null), h = (e) => { c(e), o(e); }, I = (e) => { var t; r(e), null === (t = u.current) || void 0 === t || t.close(); }; return (0, n.jsx)(g.E, { contentClassName: m.fitModeContainer, onVisibleChange: h, ref: u, content: (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)("div", { className: p()(m.fitModeOption, { [m.active]: t === d.G.CenterCrop, }), onClick: () => I(d.G.CenterCrop), children: _.oc.t("depth_middle_cut", {}, "Center crop"), }), (0, n.jsxs)("div", { className: p()(m.fitModeOption, m.adjustMode, { [m.active]: t === d.G.AdaptToCanvas, }), onClick: () => I(d.G.AdaptToCanvas), children: [ _.oc.t("depth_go_along", {}, "Fill"), (0, n.jsx)(f.Z, { content: _.oc.t( "depth_add", {}, "Blank areas will be filled in automatically." ), onVisibleChange: s, children: (0, n.jsx)(v.NCl, { className: m.helpIcon }), }), ], }), ], }), children: (0, n.jsxs)("div", { className: p()(m.interactArea, { [m.active]: i }), children: [ (0, n.jsx)("span", { children: _.oc.t(y[t], {}, b[t]) }), (0, n.jsx)(v.f5h, { className: p()(m.arrowIcon, l ? m.active : ""), }), ], }), }); }, w = i("164763"), x = i("100900"), S = i("133438"), M = i("630516"), C = (function (e) { return ( (e.AdjustReferenceLevel = "adjust_reference_level"), (e.SelectCanvasMode = "select_canvas_mode"), (e.None = ""), e ); })({}), T = (e) => { var t, { instance: i } = e, [f, h] = (0, a.useState)(""), p = (0, r.lS)(), v = w.o.getGraphicToolStoreInstance(p), m = (0, S.W9)(null == i ? void 0 : i.name), { referenceLevel: g = c.XR.default, fitMode: _ = d.G.CenterCrop } = null !== (t = (0, l.k)(i, (e) => ({ referenceLevel: null == e ? void 0 : e.referenceLevel, fitMode: null == e ? void 0 : e.fitMode, }))) && void 0 !== t ? t : {}, y = (e) => { if (!Array.isArray(e)) null == i || i.updateReferenceLevel(e); }, b = (e) => { if (!Array.isArray(e)) m && (0, x.b)(p, { action: x.u.Click, type: c.hW[m], value: e }); }, C = (e) => { e ? (h("adjust_reference_level"), m && (0, x.b)(p, { action: x.u.Show, type: c.hW[m] })) : h(""); }, T = (e) => { e ? (h("select_canvas_mode"), m && (0, M.c2)(p, { action: M.QV.Show, type: c.hW[m] })) : h(""); }, A = (e) => { e && m && (0, M.c2)(p, { action: M.QV.Hover, type: c.hW[m], option: M.cU.NoCutout, }); }, k = (e) => { null == v || v.syncData({ fitMode: e }), m && (0, M.c2)(p, { action: M.QV.Click, type: c.hW[m], option: c.rK[e], }); }; return (0, n.jsxs)("div", { className: o, children: [ (0, n.jsx)(u.s, { referenceLevel: g, isActive: "adjust_reference_level" === f, onChange: y, onAfterChange: b, onUpdateActiveOption: h, onReferenceLevelVisibleChange: C, }), (0, n.jsx)("div", { className: s }), (0, n.jsx)(I, { fitMode: _, isActive: "select_canvas_mode" === f, onChangeFitMode: k, onVisibleChange: T, onWarningTipVisible: A, }), ], }); }; }, 743568: function (e, t, i) { "use strict"; i.d(t, { s: () => y }); var n = i("772322"), r = i("105789"), a = i.n(r), o = i("188754"), s = "referenceLevelContainer-I8TdNd", l = "referenceContent-EpUEhq", c = "sliderWrap-sNrOdL", d = "slider-VGJR0g", u = "interactArea-RCX1m2", f = "active-rQpT5A", h = "paramIcon-ixJkaz", p = i("763284"), v = i("443213"), m = i("949274"), g = i("494766"), _ = i("489897"), y = (e) => { var { referenceLevel: t, isActive: i, min: r = _.XR.min, onChange: y, onAfterChange: b, onUpdateActiveOption: I, onReferenceLevelVisibleChange: w, } = e; return (0, n.jsx)(v.E, { containerClassName: s, contentClassName: l, onVisibleChange: w, content: (0, n.jsxs)("div", { className: c, children: [ (0, n.jsx)(p.i, { max: _.XR.max, min: r, step: _.XR.step, value: t, onChange: y, triggerBar: !0, className: d, onAfterChange: b, }), (0, n.jsx)("span", { children: Math.round(t) }), ], }), children: (0, n.jsxs)("div", { className: a()(u, { [f]: i }), onClick: () => I(g.n.AdjustReferenceLevel), children: [ (0, n.jsx)(o.ygK, { className: h }), (0, n.jsx)("span", { children: m.oc.t("wimg2img_title_intensity", {}, "Intensity"), }), ], }), }); }; }, 67608: function (e, t, i) { "use strict"; i.d(t, { e: () => w }); var n = i("772322"), r = i("218571"), a = i("164763"), o = i("466740"), s = i("733437"), l = i("293793"), c = i("188754"), d = i("2910"), u = i("105789"), f = i.n(u), h = { switchContainer: "switchContainer-cqaSzY", switch: "switch-oT5oFu", itemWrap: "itemWrap-zxCI5q", item: "item-uxHxt8", itemActive: "itemActive-zk0vK2", image: "image-Z8UfmH", prevIcon: "prevIcon-Io8wau", nextIcon: "nextIcon-fk6gop", switchArrow: "switchArrow-koyVF4", }, p = (0, r.forwardRef)((e, t) => { var { faceKey: i, picture: r, active: a, onClick: o } = e, s = () => { null == o || o(i); }; return (0, n.jsx)("div", { ref: t, className: f()({ [h.item]: !0, [h.itemActive]: a }), onClick: s, children: (0, n.jsx)("img", { className: h.image, src: (0, d.C)(r, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), crossOrigin: "anonymous", }), }); }), v = (e) => { var { icon: t, externalClassName: i, onClick: r } = e; return (0, n.jsx)("div", { className: f()(h.switchArrow, i), onClick: r, children: (0, n.jsx)(t, { size: 20 }), }); }, m = i("528498"), g = 44, _ = 8, y = (e, t) => { var i = (0, r.useRef)(null), [n, a] = (0, r.useState)(!1), [o, s] = (0, m.CY)(void 0, () => { a(!0); }), [c, d] = (0, m.CY)(), [u, f] = (0, r.useState)(0), h = n && !s && t > 1, p = n && !d && t > 1, v = (0, l.default)((e) => { var n = i.current; return n ? Math.min( 0, Math.max(n.clientWidth - (g * t + _ * (t - 1)), e) ) : 0; }), y = (0, l.default)((e) => { var n = i.current; if (!n) return 0; for (var r = n.clientWidth / 2, a = 0, o = 0; o < t; o++) { var s = o * (g + _), l = (o + 1) * (g + _); if (r >= s && r < l) { a = o; break; } } var c = -(e - a) * (g + _); return e <= a ? 0 : v(c); }), b = (0, l.default)(() => { f(y(e)); }); return ( (0, r.useEffect)( () => ( window.addEventListener("resize", b), () => { window.removeEventListener("resize", b); } ), [] ), (0, r.useEffect)(() => { f(y(e)); }, [e, t, y]), { firstElementRef: o, lastElementRef: c, wrapRef: i, moveX: u, showNext: p, showPrev: h, movePrevOne: () => { f((e) => v(e + (g + _))); }, moveNextOne: () => { f((e) => v(e - (g + _))); }, } ); }, b = i("350138"), I = (e) => { var { faces: t, selectedIndex: i, onSelectFace: a } = e, s = (0, o.lS)(), d = (0, l.default)((e) => { null == a || a(e), (0, b.x)(s, { position: b.h.Thumbnail }); }), { moveX: u, moveNextOne: f, movePrevOne: m, showNext: g, showPrev: _, wrapRef: I, firstElementRef: w, lastElementRef: x, } = y(i, t.length), S = () => { m(); }, M = () => { f(); }, C = (0, r.useMemo)( () => t.map((e, i) => 0 === i ? (0, n.jsx)( p, { ref: w, active: e.isSelected, faceKey: e.faceKey, picture: e.picture, onClick: d, }, e.faceKey ) : i === t.length - 1 ? (0, n.jsx)( p, { ref: x, active: e.isSelected, faceKey: e.faceKey, picture: e.picture, onClick: d, }, e.faceKey ) : (0, n.jsx)( p, { active: e.isSelected, faceKey: e.faceKey, picture: e.picture, onClick: d, }, e.faceKey ) ), [t, w, x, d] ); return (0, n.jsx)("div", { className: h.switchContainer, children: (0, n.jsxs)("div", { className: h.switch, ref: I, children: [ (0, n.jsx)("div", { className: h.itemWrap, style: { transform: "translateX(".concat(u, "px)") }, children: C, }), _ && (0, n.jsx)(v, { externalClassName: h.prevIcon, icon: c.USi, onClick: S, }), g && (0, n.jsx)(v, { externalClassName: h.nextIcon, icon: c.AQS, onClick: M, }), ], }), }); }, w = (e) => { var t, i, { image: l, imageScale: c } = e, d = (0, o.lS)(), u = a.o.getGraphicToolStoreInstance(d), f = null == u ? void 0 : u.faceGanInstance, h = (0, s.k)(f, (e) => { var t, i; return { faceRects: null !== (t = e.faceRects) && void 0 !== t ? t : [], selectedIndex: null !== (i = e.selectRectIndex) && void 0 !== i ? i : -1, }; }); (0, r.useEffect)(() => { null == f || f.setScale(c); }, [f, c]), (0, r.useEffect)(() => { null == f || f.clipFacePicture(l.url); }, [f, l]); var p = (e) => { null == f || f.selectFaceRect(e); }; return (0, n.jsx)(I, { selectedIndex: null !== (t = null == h ? void 0 : h.selectedIndex) && void 0 !== t ? t : -1, faces: null !== (i = null == h ? void 0 : h.faceRects) && void 0 !== i ? i : [], onSelectFace: p, }); }; }, 899716: function (e, t, i) { "use strict"; i.d(t, { a: () => C }); var n = i("772322"), r = i("218571"), a = "ipKeepInteract-yupASB", o = i("733437"), s = i("489897"), l = i("105789"), c = i.n(l), d = i("188754"), u = "referenceLevelContainer-KDzjq5", f = "referenceContent-PGafI6", h = "paramPanel-gQpPze", p = "paramItem-SSPLpE", v = "sliderTitle-kZqg6r", m = "sliderWrap-pLJHn_", g = "slider-WYpcPn", _ = "sliderResult-xqniMw", y = "interactArea-JIJtDg", b = "active-FQajr0", I = "paramIcon-yHxKyZ", w = i("763284"), x = i("443213"), S = i("949274"), M = (e) => { var { ipWeight: t, idWeight: i, isActive: r, onIpWeightAfterChange: a, onIdWeightAfterChange: o, onIdWeightChange: l, onIpWeightChange: M, onUpdateReferenceBarActive: C, onReferenceLevelVisibleChange: T, } = e; return (0, n.jsx)(x.E, { containerClassName: u, contentClassName: f, onVisibleChange: T, content: (0, n.jsxs)("div", { className: h, children: [ (0, n.jsxs)("div", { className: p, children: [ (0, n.jsx)("div", { className: v, children: S.oc.t( "character_face_reference_intensity", {}, "Face guidance" ), }), (0, n.jsxs)("div", { className: m, children: [ (0, n.jsx)(w.i, { max: s.ux.id.max, min: s.ux.id.min, step: s.ux.id.step, value: i, onChange: l, triggerBar: !0, className: g, onAfterChange: o, }), (0, n.jsx)("span", { className: _, children: Math.round(i), }), ], }), ], }), (0, n.jsxs)("div", { className: p, children: [ (0, n.jsx)("div", { className: v, children: S.oc.t( "character_body_reference_intensity", {}, "Whole body guidance" ), }), (0, n.jsxs)("div", { className: m, children: [ (0, n.jsx)(w.i, { max: s.ux.ip.max, min: s.ux.ip.min, step: s.ux.ip.step, value: t, onChange: M, triggerBar: !0, className: g, onAfterChange: a, }), (0, n.jsx)("span", { className: _, children: Math.round(t), }), ], }), ], }), ], }), children: (0, n.jsxs)("div", { className: c()(y, { [b]: r }), onClick: () => C(), children: [ (0, n.jsx)(d.ygK, { className: I }), (0, n.jsx)("span", { children: S.oc.t("wimg2img_title_intensity", {}, "Intensity"), }), ], }), }); }, C = (e) => { var t, { instance: i } = e, [l, c] = (0, r.useState)(!1), { refIdWeight: d = s.ux.id.default, refIpWeight: u = s.ux.ip.default, } = null !== (t = (0, o.k)(i, (e) => ({ refIpWeight: null == e ? void 0 : e.refIpWeight, refIdWeight: null == e ? void 0 : e.refIdWeight, }))) && void 0 !== t ? t : {}, f = (e) => { if (!Array.isArray(e)) null == i || i.updateRefIdWeight(e); }, h = (e) => { if (!Array.isArray(e)) null == i || i.updateRefIpWeight(e); }, p = (e) => { c(e); }, v = () => { c(!0); }; return (0, n.jsx)("div", { className: a, children: (0, n.jsx)(M, { ipWeight: u, idWeight: d, isActive: l, onIdWeightChange: f, onIpWeightChange: h, onUpdateReferenceBarActive: v, onReferenceLevelVisibleChange: p, }), }); }; }, 489897: function (e, t, i) { "use strict"; i.d(t, { FY: function () { return f; }, K5: function () { return u; }, KE: function () { return b; }, Mp: function () { return h; }, Mu: function () { return I; }, Up: function () { return m; }, XR: function () { return S; }, Ze: function () { return A; }, cR: function () { return d; }, d7: function () { return R; }, fx: function () { return y; }, go: function () { return k; }, hR: function () { return C; }, hW: function () { return P; }, k0: function () { return w; }, kQ: function () { return l; }, mg: function () { return D; }, og: function () { return p; }, p4: function () { return T; }, pb: function () { return g; }, rK: function () { return E; }, rj: function () { return c; }, uS: function () { return v; }, ux: function () { return M; }, yY: function () { return x; }, zt: function () { return _; }, }); var n = i(224671), r = i(417281), a = i(108982), o = i(65830), s = i(630516), l = { [a.s.ByteEdit]: "Custom", [a.s.FaceGan]: "Human face", [a.s.BgPaint]: "Object", [a.s.BasicBlend]: "Reference image style", [a.s.IpKeep]: "Character", [a.s.ControlNetCanny]: "Edge", [a.s.ControlNetDepth]: "Depth", [a.s.ControlNetPose]: "Pose", [a.s.Unknown]: "", [a.s.ControlNet]: "", [a.s.Text2image]: "", [a.s.Image2image]: "", [a.s.StyleReference]: "Reference image style", [a.s.StyleCode]: "Style code", }, c = { [a.s.ByteEdit]: "image_reference_option_custom", [a.s.FaceGan]: "dre_t2i_reference_option_one_face", [a.s.BgPaint]: "wimg2img_content_body", [a.s.BasicBlend]: "wimg2img_content_spread", [a.s.IpKeep]: "IP_web_control", [a.s.ControlNetCanny]: "function_canny", [a.s.ControlNetDepth]: "function_depth", [a.s.ControlNetPose]: "function_pose", [a.s.Unknown]: "", [a.s.ControlNet]: "", [a.s.Text2image]: "", [a.s.Image2image]: "", [a.s.StyleReference]: "style_image", [a.s.StyleCode]: "dre_t2i_style_code_placeholder", }, d = { min: 1, max: 100, step: 1, default: 50 }, u = { min: 0, max: 1, step: 0.05, default: 0.25 }, f = { min: 0, max: 100, step: 1, default: 80 }, h = "imagine-modal", p = 0.5, v = "imagine-modal-main", m = 4, g = 32, _ = 1, y = 20, b = 3, I = 16 / 9, w = n.jP.OneOne, x = 4, S = { min: 1, max: 100, step: 1, default: 60 }, M = { ip: { min: 1, max: 100, step: 1, default: 70, rate: 100 }, id: { min: 1, max: 100, step: 1, default: 90, rate: 100 }, }, C = 150, T = 140, A = 160, k = { [a.s.ControlNetCanny]: r.kR.ControlNetCanny, [a.s.ControlNetDepth]: r.kR.ControlNetDepth, [a.s.ControlNetPose]: r.kR.ControlNetPose, }, P = { [a.s.ControlNetCanny]: o.gZ.Canny, [a.s.ControlNetDepth]: o.gZ.Depth, [a.s.ControlNetPose]: o.gZ.Pose, [a.s.BgPaint]: o.gZ.Subject, [a.s.FaceGan]: o.gZ.Face, [a.s.BasicBlend]: o.gZ.Basic, [a.s.Text2image]: o.gZ.Text2Image, [a.s.Image2image]: o.gZ.Image2Image, [a.s.IpKeep]: o.gZ.IpKeep, [a.s.StyleReference]: o.gZ.Style, [a.s.ByteEdit]: o.gZ.ByteEdit, [a.s.StyleCode]: o.gZ.StyleCode, }, E = { [a.G.AdaptToCanvas]: s.cU.NoCutout, [a.G.CenterCrop]: s.cU.Cutout, }, D = { [n.jP.OneOne]: 1, [n.jP.ThreeFour]: 3 / 4, [n.jP.SixteenNine]: 16 / 9, [n.jP.TwentyOneNine]: 21 / 9, [n.jP.FourThree]: 4 / 3, [n.jP.NineSixteen]: 9 / 16, [n.jP.TwoThree]: 2 / 3, [n.jP.ThreeTwo]: 1.5, }, R = [1, 3 / 4, 16 / 9, 21 / 9, 4 / 3, 9 / 16, 2 / 3, 1.5]; }, 537201: function (e, t, i) { "use strict"; i.d(t, { i: function () { return a; }, }); var n = i(417281), r = i(108982), a = { [n.kR.ControlNetCanny]: r.s.ControlNetCanny, [n.kR.ControlNetDepth]: r.s.ControlNetDepth, [n.kR.ControlNetPose]: r.s.ControlNetPose, [n.kR.ControlNetBgPaint]: r.s.BgPaint, [n.UI.ControlNet]: r.s.ControlNet, [n.UI.BasicBlend]: r.s.BasicBlend, [n.UI.BgPaint]: r.s.BgPaint, [n.UI.FaceGan]: r.s.FaceGan, [n.UI.StyleReference]: r.s.StyleReference, [n.UI.Unknown]: r.s.Unknown, [n.UI.Text2image]: r.s.Text2image, [n.UI.Image2image]: r.s.Image2image, [n.UI.IpKeep]: r.s.IpKeep, [n.UI.ByteEdit]: r.s.ByteEdit, [n.UI.StyleCode]: r.s.StyleCode, }; }, 466740: function (e, t, i) { "use strict"; i.d(t, { Gj: function () { return r; }, N_: function () { return s; }, dR: function () { return o; }, lS: function () { return a; }, }); var n = i(218571), r = (0, n.createContext)(null), a = () => (0, n.useContext)(r), o = (0, n.createContext)(null), s = () => { var e; return null !== (e = (0, n.useContext)(o)) && void 0 !== e ? e : {}; }; }, 108982: function (e, t, i) { "use strict"; i.d(t, { G: function () { return a; }, s: function () { return r; }, }); var n = i(417281), r = (function (e) { return ( (e[(e.ByteEdit = n.UI.ByteEdit)] = "ByteEdit"), (e[(e.FaceGan = n.UI.FaceGan)] = "FaceGan"), (e[(e.BgPaint = n.UI.BgPaint)] = "BgPaint"), (e[(e.BasicBlend = n.UI.BasicBlend)] = "BasicBlend"), (e[(e.IpKeep = n.UI.IpKeep)] = "IpKeep"), (e[(e.Unknown = n.UI.Unknown)] = "Unknown"), (e[(e.ControlNet = n.UI.ControlNet)] = "ControlNet"), (e[(e.ControlNetCanny = n.kR.ControlNetCanny)] = "ControlNetCanny"), (e[(e.ControlNetDepth = n.kR.ControlNetDepth)] = "ControlNetDepth"), (e[(e.ControlNetPose = n.kR.ControlNetPose)] = "ControlNetPose"), (e[(e.Text2image = n.UI.Text2image)] = "Text2image"), (e[(e.Image2image = n.UI.Image2image)] = "Image2image"), (e[(e.StyleReference = n.UI.StyleReference)] = "StyleReference"), (e[(e.StyleCode = n.UI.StyleCode)] = "StyleCode"), e ); })({}), a = (function (e) { return ( (e.CenterCrop = "center_crop"), (e.AdaptToCanvas = "adapt_to_canvas"), e ); })({}); }, 787424: function (e, t, i) { "use strict"; i.d(t, { J: () => v }); var n = i("625572"), r = i("772322"), a = i("218571"), o = i("105789"), s = i.n(o), l = "hanging-XeriwE", c = "fixed-bQRfc3", d = "hangingMask-muaoQC", u = "hangingMaskHidden-edsn1_", f = 300, h = (e) => { var { visible: t, content: i, onRemove: n, mask: o = !0, fixed: h = !0, zIndex: p = "99999", } = e; return ( (0, a.useEffect)(() => { var e; return ( !t && (e = setTimeout(() => { null == n || n(); }, f)), () => clearTimeout(e) ); }, [t, n]), (0, r.jsx)("div", { style: { zIndex: p }, className: s()(l, { [c]: h, [d]: o, [u]: !t }), children: (0, r.jsx)("div", { children: i }), }) ); }, p = i("827955"); class v { show(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { container: document.body, zIndex: "9999" }, { showMask: i = !0, container: n = document.body, zIndex: r = "9999", } = t, a = document.createElement("div"); (a.style.position = "relative"), (a.style.zIndex = r), n !== document.body && ((a.style.left = "50%"), (a.style.transform = "translateX(-50%)")), n.appendChild(a), (this._container = a); var o = () => { var e; null === (e = this._hangingRoot) || void 0 === e || e.destroy(), (this._hangingRoot = void 0), a.parentNode && a.parentNode.removeChild(a); }; (this._hangingProps = { content: e, visible: !0, mask: i, onRemove: () => { o(); }, zIndex: r, fixed: n === document.body, }), this._render(this._hangingProps); } hide() { this._hangingProps && ((this._hangingProps.visible = !1), this._render(this._hangingProps)); } constructor() { this._render = (e) => { if (!!this._container) { var t = (0, r.jsx)(h, (0, n._)({}, e)), i = this._hangingRoot; i ? i.render(t) : (this._hangingRoot = (0, p.s)(t, this._container)); } }; } } }, 827955: function (e, t, i) { "use strict"; i.d(t, { s: function () { return r; }, }); var n = i(570126), r = (e, t) => { var i = (0, n.createRoot)(t); return ( i.render(e), (i.destroy = function () { setTimeout(() => { var e; null == i || null === (e = i.unmount) || void 0 === e || e.call(i); }); }), i ); }; }, 193305: function (e, t, i) { "use strict"; i.d(t, { s: () => l }); var n = i("772322"); i("894672"); var r = i("274993"), a = "specialTipIconContainer-cJP3TU", o = "specialTipIcon-JvaQ6N", s = i("188754"), l = (e) => { var { content: t, containerStyle: i = {}, size: l } = e; return (0, n.jsx)(r.Z, { className: "specialTipWrapper", content: t, triggerProps: { mouseEnterDelay: 300 }, children: (0, n.jsx)("div", { className: a, style: i, children: (0, n.jsx)(s.oUg, { className: o, size: l }), }), }); }; }, 820: function (e, t, i) { "use strict"; i.d(t, { kt: function () { return l; }, l3: function () { return d; }, nv: function () { return c; }, }); var n = i(224671), r = i(799108), a = i(949274), o = i(150022), s = i(27433), l = (e) => !!e && Object.keys(e).length > 1, c = (e, t, i) => { if (!e) return []; var l = (e) => !!i && (0, s.be)({ scene: e, commercialStrategyService: i }) .isStrategyFreeTrial, c = { [n.YD.ImageResolutionType_2k]: { commercialKey: r.hO.ImageUhd, showTooltip: t || l(r.hO.ImageUhd), tooltipConfig: { img: o, text: a.ZP.t( "dre_t2i_setting_resolution_option_2k", {}, "High (2K)" ), desc: a.ZP.t( "dre_t2i_model_3_0_intro_desc", {}, "Supports native high-resolution generation, with enhanced structure and details." ), }, hasRights: t || l(r.hO.ImageUhd), }, [n.YD.ImageResolutionType_1k]: { commercialKey: void 0, showTooltip: !1, tooltipConfig: void 0, hasRights: !0, }, }; return Object.entries(e).map((e) => { var t, [i, n] = e, r = i; return { value: r, label: null !== (t = n.resolutionName) && void 0 !== t ? t : String(i), commercialKey: c[r].commercialKey, showTooltip: c[r].showTooltip, tooltipConfig: c[r].tooltipConfig, hasRights: c[r].hasRights, }; }); }, d = (e, t, i) => { if (!t || !i) return; var n = t[e]; if (!(null == n ? void 0 : n.imageRatioSizes)) return; var r = n.imageRatioSizes.find((e) => e.ratioType === i); if ( !!(null == r ? void 0 : r.width) && !!(null == r ? void 0 : r.height) ) return { width: r.width, height: r.height }; }; }, 665498: function (e, t, i) { "use strict"; i.d(t, { E7: function () { return a; }, UW: function () { return s; }, }); var n = i(224671), r = i(998463), a = { [n.jP.OneOne]: n.jP.OneOne, [n.jP.FourThree]: n.jP.FourThree, [n.jP.ThreeTwo]: n.jP.ThreeTwo, [n.jP.SixteenNine]: n.jP.SixteenNine, [n.jP.TwentyOneNine]: n.jP.TwentyOneNine, [n.jP.ThreeFour]: n.jP.ThreeFour, [n.jP.TwoThree]: n.jP.TwoThree, [n.jP.NineSixteen]: n.jP.NineSixteen, }, o = [ { text: r.pC[n.jP.TwentyOneNine], type: n.jP.TwentyOneNine }, { text: r.pC[n.jP.SixteenNine], type: n.jP.SixteenNine }, { text: r.pC[n.jP.ThreeTwo], type: n.jP.ThreeTwo }, { text: r.pC[n.jP.FourThree], type: n.jP.FourThree }, { text: r.pC[n.jP.OneOne], type: n.jP.OneOne }, { text: r.pC[n.jP.ThreeFour], type: n.jP.ThreeFour }, { text: r.pC[n.jP.TwoThree], type: n.jP.TwoThree }, { text: r.pC[n.jP.NineSixteen], type: n.jP.NineSixteen }, ], s = (e, t) => { if (t && e) { var i = t[e]; if (null == i ? void 0 : i.imageRatioSizes) return i.imageRatioSizes.map((e) => { var t, i = a[ null !== (t = e.ratioType) && void 0 !== t ? t : n.jP.OneOne ]; return { text: r.pC[i], type: i }; }); } return o; }; }, 671235: function (e, t, i) { "use strict"; i.d(t, { b: () => u }); var n = i("625572"), r = i("639880"), a = i("96"), o = i("772322"); i("894672"); var s = i("274993"), l = i("105789"), c = i.n(l), d = "infoTooltip-UbdA6M", u = (e) => { var { className: t, children: i } = e, l = (0, a._)(e, ["className", "children"]); return (0, o.jsx)( s.Z, (0, r._)( (0, n._)( { className: c()(t, d), showArrow: !0, triggerProps: { popupAlign: { bottom: 4 } }, }, l ), { children: i } ) ); }; }, 4255: function (e, t, i) { "use strict"; i.d(t, { F: () => L }); var n = i("772322"); i("894672"); var r = i("293793"), a = i("274993"), o = i("949274"), s = "insertQuotationMarksWrap-YV6mTg", l = "disabled-I3nY9C", c = "ettaIcon-M8gkfE", d = "tipsInfo-qIxC96", u = i("188754"), f = i("218571"), h = i("105789"), p = i.n(h), v = i("848303"), m = i("2910"), g = i("246940"), _ = i("44938"), y = "insert-quotation-marks-btn-guide-FA2ixa", b = "insert-quotation-marks-btn-guide-content-Ua4AhC", I = "insert-quotation-marks-btn-guide-mask-kBBpSO", w = "tipContent-QAHraV", x = "describe-_byA5Q", S = "name-SRiIm2", M = "img-akEA0n", C = i.p + "static/image/image-text-etta-guide.560b9aa1.gif", T = i.p + "static/image/image-text-etta-guide.92994ce4.webp", A = () => { var e = C, t = T; return (0, n.jsxs)("div", { className: w, children: [ (0, n.jsxs)("picture", { className: M, children: [ (0, n.jsx)("source", { srcSet: t, type: "image/webp" }), (0, n.jsx)("img", { src: (0, m.C)(e, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: M, crossOrigin: "anonymous", }), ], }), (0, n.jsx)("div", { className: S, children: o.ZP.t( "web_t2i_draw_words_popup_title", {}, 'Text in image Draw "text" on image' ), }), (0, n.jsx)("div", { className: x, children: o.ZP.t( "web_t2i_draw_words_popup_desc", {}, "Generate text in image via prompt by wrapping it inside quotation marks" ), }), ], }); }, k = (e) => { var { elementRef: t, handleConfirm: i } = e; return { key: g.T.generateKey(_.u.isShowImageEttaGuide), className: y, maskClassName: I, contentClassName: b, maskBackgroundColor: "var(--mask-40)", mask: !0, maskClosable: !1, showFooter: !0, placeholderBorderWidth: "0px", useNewArrow: !1, showStepText: !1, showSkipButton: !0, cancelWithSkip: !0, skipText: o.ZP.t("web_t2i_draw_words_popup_btn_ok", {}, "OK"), okText: o.ZP.t("web_t2i_draw_words_popup_btn_try", {}, "Try it"), placeholderRadius: 6, steps: [ { target: t, content: (0, n.jsx)(A, {}), placement: "bl", showCloseIcon: !1, confirm: () => (null == i ? void 0 : i()), }, ], }; }, P = i("699267"), E = i("509320"), D = i("178589"), R = i("48252"), N = 1e3 * parseFloat(v.Z.generateContainerAnimationDuration), L = (e) => { var { disabled: t = !0, disabledTips: i, onClick: h, needGuide: v = !1, style: m, } = e, g = (0, P.G)(E.W), _ = (0, f.useRef)(null), y = (0, P.G)(D.e), b = (0, r.default)(() => { if (!t) null == h || h(); }); return ( (0, f.useEffect)(() => { if (!v || !_.current || t) return; var e = k({ elementRef: _.current, handleConfirm: b }); if (!g.getShowStateByKey(e.key)) { setTimeout(() => { g.trigger(e); }, N); var i = null == y ? void 0 : y.onKeepAliveChange((t) => { if (t.status === R.G.InActivated) { var i = g.getCurrentShowState(); i.key === e.key && i.show && g.clear(); } }); return () => { i.dispose(); }; } }, [g, t, v, b, y]), (0, n.jsx)(a.Z, { content: t ? i : o.ZP.t( "web_t2i_draw_words_feature_hover", {}, "Text in image Visualize text" ), className: d, position: "top", children: (0, n.jsx)("div", { ref: _, className: p()(s, { [l]: t }), style: m, onClick: b, children: (0, n.jsx)(u.hkb, { className: c }), }), }) ); }; }, 161695: function (e, t, i) { "use strict"; i.d(t, { f: () => f }); var n = i("772322"); i("900992"); var r = i("744932"), a = i("159895"), o = { leftLabel: "leftLabel-UHs4bP", rightContent: "rightContent-lkwP82", itemTextarea: "itemTextarea-o61ksV", itemWrapper: "itemWrapper-qJid9o", itemTag: "itemTag-H0LWGd", itemTagActivate: "itemTagActivate-llkdwA", hidden: "hidden-pSWjlS", }, s = i("949274"), l = i("218571"), c = i("105789"), d = i.n(c), u = (0, l.memo)((e) => { var { config: t, handleTagsChange: i, handleOtherReasonChange: c, } = e, { formType: u, tagsValue: f, category: h, renderLabelHighLightFlag: p, rightContentClassNames: v, inputPlaceHolder: m, } = t, [g, _] = (0, l.useState)([]), y = (e) => { if (-1 !== g.findIndex((t) => t === e)) { var t = g.filter((t) => t !== e); _(t), null == i || i(h, t, e); } else { var n = [...g, e]; _(n), null == i || i(h, n, e); } }, b = (e) => { null == c || c(e); }; switch (u) { case a.T.tags: return (0, n.jsxs)("div", { className: o.itemWrapper, children: [ (0, n.jsxs)("div", { className: o.leftLabel, children: [s.ZP.t(h), null == p ? void 0 : p()], }), (0, n.jsx)("div", { className: d()(o.rightContent, v), children: f.map((e) => (0, n.jsx)( "div", { onClick: () => y(e), className: d()({ [o.itemTag]: !0, [o.itemTagActivate]: g.includes(e), }), children: s.ZP.t(e), }, e ) ), }), ], }); case a.T.textarea: return (0, n.jsxs)("div", { className: o.itemWrapper, children: [ (0, n.jsxs)("div", { className: o.leftLabel, children: [s.ZP.t(h), null == p ? void 0 : p()], }), (0, n.jsx)("div", { className: d()(o.rightContent, v), children: (0, n.jsx)(r.Z.TextArea, { autoFocus: !1, maxLength: 400, showWordLimit: !0, onChange: b, autoSize: !1, className: o.itemTextarea, placeholder: null != m ? m : s.ZP.t( "mreport_other", {}, "Why are you reporting this image?" ), }), }), ], }); default: return null; } }), f = (e) => { var { photoReportConfigs: t, handleOtherReasonChange: i, handleTagsChange: r, } = e; return (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)("button", { className: o.hidden }), (null != t ? t : []).map((e) => (0, n.jsx)( u, { handleOtherReasonChange: i, handleTagsChange: r, config: e, }, e.category ) ), ], }); }; }, 898678: function (e, t, i) { "use strict"; i.d(t, { xr: () => J, lO: () => Y, q8: () => q, iU: () => X, MY: () => Q, }); var n = i("139646"), r = i("772322"); i("245535"); var a = i("76894"), o = i("9156"), s = i("81612"), l = i("159895"), c = i("949274"), d = i("188754"), u = i("625572"), f = i("639880"), h = i("161695"), p = i("967355"), v = "wrapper-eRU1ZP", m = "button-qbLD2T", g = i("218571"), _ = i("369617"), y = (e) => { var { handleSubmit: t, onClose: i, disabled: a } = e, [o, s] = (0, g.useState)(!1), l = (function () { var e = (0, n._)(function* () { s(!0); try { yield null == t ? void 0 : t(), _.s.success(c.ZP.t("mreport_submittoast", {}, "Submitted")), i(); } catch (e) { _.s.warning( c.ZP.t( "mreport_networkerrortoast", {}, "Connect to the internet and try again" ) ); } finally { s(!1); } }); return function () { return e.apply(this, arguments); }; })(); return (0, r.jsx)("div", { className: v, children: (0, r.jsx)(p.J, { disabled: a, loading: o, type: "default", onClick: l, className: m, text: c.ZP.t("mreport_submit_button", {}, "Submit"), }), }); }, b = i("105789"), I = i.n(b), w = "wrapper-c8UObY", x = "imgItem-mBvfL5", S = "activateImgItem-vm6fGH", M = (e) => { var { updateCurrentIndex: t, currentIndex: i, reportItemList: n } = e, a = (e) => { t(e); }; return n.length <= 1 ? (0, r.jsx)(r.Fragment, {}) : (0, r.jsx)("div", { className: w, children: n.map((e, t) => (0, r.jsx)( "div", { onClick: () => a(t), className: I()({ [x]: !0, [S]: t === i }), children: (0, r.jsx)("img", { draggable: !1, src: e.coverUrl, alt: e.prompt, crossOrigin: "anonymous", }), }, e.id ) ), }); }, C = i("379311"); class T { getEventParams() { return { status: this._params.status }; } constructor(e) { (this._params = e), (this.eventName = "picture_report_toast"); } } function A(e, t) { (0, C.Kl)(e, T, [t]); } var k = "tips-fLhRGR", P = "redTips-X3et3J", E = (e) => { var { photoReportConfigs: t, reportItemList: i, containerService: a, mode: o, onClose: s, onSubmit: l, } = e, [d, p] = (0, g.useState)(0), [v, m] = (0, g.useState)({}), [_, b] = (0, g.useState)(""), I = (0, g.useMemo)( () => 0 === _.length && 0 === Object.values(v).reduce((e, t) => e + t.length, 0), [v, _] ), w = (e, t) => { m((0, f._)((0, u._)({}, v), { [e]: t })); }, x = (e) => { b(e); }, S = (function () { var e = (0, n._)(function* () { var e = Object.values(v).flat(), t = e.map((e) => c.ZP.t(e)); _.length && (e.push("mreport_other_tittle"), t.push(_)); var n = i[d]; if ( (yield l({ itemId: n.id, reasonKeyList: e, reasonDescList: t, selectedTags: v, otherReason: _, currentIndex: d, })).ok ) A(a, { status: "success" }); else throw (A(a, { status: "fail" }), Error("'Submit data fail.")); }); return function () { return e.apply(this, arguments); }; })(), C = (e) => { p(e); }; return (0, r.jsxs)(r.Fragment, { children: [ o === q.Photo ? (0, r.jsx)(M, { currentIndex: d, updateCurrentIndex: C, reportItemList: i, }) : null, (0, r.jsxs)("div", { className: k, children: [ c.ZP.t("mreport_select_tittle", {}, "Select reason"), (0, r.jsx)("span", { className: P, children: "*" }), ], }), (0, r.jsx)(h.f, { handleOtherReasonChange: x, handleTagsChange: w, photoReportConfigs: t, }), (0, r.jsx)(y, { onClose: s, handleSubmit: S, disabled: I }), ], }); }, D = i("475578"), R = i("881607"), N = (function (e) { return ( (e.Image = "image"), (e.Canvas = "canvas"), (e.Audio = "audio"), e ); })({}); class L { getEventParams() { return (0, u._)({}, (0, R.cu)(this._params)); } constructor(e) { (this._params = e), (this.eventName = "picture_report"); } } function j(e, t) { (0, C.Kl)(e, L, [t]); } var O = i("229025"), B = (e, t, i, n, r) => { var { commonAttr: { id: a }, aigcImageParams: { requestId: o, text2imageParams: s, generateType: l, }, } = e, { prompt: c, modelConfig: { modelNameStarlingKey: d }, } = s, u = (0, O.Cg)(l), f = []; for (var h of Object.entries(i)) h[1].length && f.push(h[0]); t.length && f.push("mreport_other_tittle"), j(n, { type: N.Image, reportCategory: Object.keys(i).flat().join(","), reportContent: Object.values(i).flat().join(","), otherReportContent: t, isSuperResolution: u ? D._O.True : D._O.False, model: d, pictureId: a, templateId: a, prompt: c, requestId: o, secondPage: r, }); }, F = (e, t, i, n, r) => { var { commonAttr: { id: a }, } = e, o = []; for (var s of Object.entries(i)) s[1].length && o.push(s[0]); t.length && o.push("mreport_other_tittle"), j(n, { type: N.Canvas, reportCategory: Object.keys(i).flat().join(","), reportContent: Object.values(i).flat().join(","), otherReportContent: t, templateId: a, secondPage: r, }); }, U = "modelContainer-cH0x6U", G = "modalWrapper-f_VR5U", z = "closeBtn-vbBgHY", V = (e) => e ? e.map((e) => { var { commonAttr: { id: t, coverUrl: i }, aigcImageParams: { text2imageParams: n }, } = e, { prompt: r } = n; return { coverUrl: i, id: t, prompt: r }; }) : [], W = (e) => e ? e.map((e) => { var { id: t, coverUrl: i, prompt: n, videoUrl: r } = e; return { videoUrl: r, coverUrl: i, id: t, prompt: n }; }) : [], Z = (e) => e ? e.map((e) => { var { commonAttr: t } = e, { id: i, coverUrl: n = "", title: r = "" } = t; return { id: i, coverUrl: n, prompt: r }; }) : [], K = i("487736"), H = i("259435"), q = (function (e) { return ( (e.Photo = "photo"), (e.Video = "video"), (e.Canvas = "canvas"), (e.Audio = "audio"), e ); })({}), J = (function () { var e = (0, n._)(function* (e, t) { var { reportItemList: i, secondPage: u, onSubmitFinish: f } = t, h = null == e ? void 0 : e.invokeFunction((e) => e.get(o.A)), p = null == e ? void 0 : e.invokeFunction((e) => e.get(s.m)), v = yield h.aggregate.getImcConfigByKey(l.c.PhotoReportConfigs), m = null, g = (function () { var t = (0, n._)(function* (t) { var { currentIndex: n, otherReason: r, selectedTags: a } = t, o = yield p.repository.reportPhoto(t); return B(i[n], r, a, e, u), null == f || f(), o; }); return function (e) { return t.apply(this, arguments); }; })(), _ = () => { null == m || m.close(); }, y = (0, H.C)(e, K.M.ReportModal); m = a.Z.confirm({ footer: null, icon: null, maskClosable: !1, afterClose: () => { y.unmount(); }, escToExit: !1, backspaceToExit: !1, title: c.ZP.t("mreport_tittle", {}, "Report image"), wrapClassName: G, className: U, closeIcon: (0, r.jsx)(d.Rnl, { className: z }), content: (0, r.jsx)(E, { photoReportConfigs: null != v ? v : [], onSubmit: g, onClose: _, reportItemList: V(i), containerService: e, mode: "photo", }), }); }); return function (t, i) { return e.apply(this, arguments); }; })(), Y = (function () { var e = (0, n._)(function* (e, t) { var { reportItemList: i, secondPage: u } = t, f = null == e ? void 0 : e.invokeFunction((e) => e.get(o.A)), h = yield f.aggregate.getImcConfigByKey(l.c.VideoReportConfigs), p = null == e ? void 0 : e.invokeFunction((e) => e.get(s.m)), v = null, m = (function () { var e = (0, n._)(function* (e) { var i, n = yield p.repository.reportPhoto(e); return ( null === (i = t.onSubmit) || void 0 === i || i.call(t), n ); }); return function (t) { return e.apply(this, arguments); }; })(), g = () => { null == v || v.close(); }, _ = (0, H.C)(e, K.M.ReportModal); v = a.Z.confirm({ footer: null, icon: null, maskClosable: !1, escToExit: !1, afterClose: () => { _.unmount(); }, backspaceToExit: !1, title: c.ZP.t("mreport_tittle", {}, "Report image"), wrapClassName: G, className: U, closeIcon: (0, r.jsx)(d.Rnl, { className: z }), content: (0, r.jsx)(E, { photoReportConfigs: null != h ? h : [], onSubmit: m, onClose: g, reportItemList: W(i), containerService: e, mode: "video", }), }); }); return function (t, i) { return e.apply(this, arguments); }; })(), Q = (function () { var e = (0, n._)(function* (e, t) { var { reportItemList: i, secondPage: u } = t, f = null == e ? void 0 : e.invokeFunction((e) => e.get(o.A)), h = yield f.aggregate.getImcConfigByKey(l.c.VideoReportConfigs), p = null == e ? void 0 : e.invokeFunction((e) => e.get(s.m)), v = null, m = (function () { var r = (0, n._)(function* (n) { var r, { currentIndex: a, otherReason: o, selectedTags: s } = n, l = yield p.repository.reportPhoto(n); return ( null === (r = t.onSubmit) || void 0 === r || r.call(t), F(i[a], o, s, e, u), l ); }); return function (e) { return r.apply(this, arguments); }; })(), g = () => { null == v || v.close(); }; v = a.Z.confirm({ footer: null, icon: null, maskClosable: !1, escToExit: !1, backspaceToExit: !1, title: c.ZP.t("mreport_tittle", {}, "Report image"), wrapClassName: G, className: U, closeIcon: (0, r.jsx)(d.Rnl, { className: z }), content: (0, r.jsx)(E, { photoReportConfigs: null != h ? h : [], onSubmit: m, onClose: g, reportItemList: Z(i), containerService: e, mode: "canvas", }), }); }); return function (t, i) { return e.apply(this, arguments); }; })(), X = (function () { var e = (0, n._)(function* (e, t) { var { reportItemList: i, secondPage: u } = t, f = null == e ? void 0 : e.invokeFunction((e) => e.get(o.A)), h = yield f.aggregate.getImcConfigByKey(l.c.AudioReportConfigs), p = null == e ? void 0 : e.invokeFunction((e) => e.get(s.m)), v = null, m = (function () { var e = (0, n._)(function* (e) { var i, n = yield p.repository.reportPhoto(e); return ( null === (i = t.onSubmit) || void 0 === i || i.call(t), n ); }); return function (t) { return e.apply(this, arguments); }; })(), g = () => { null == v || v.close(); }; v = a.Z.confirm({ footer: null, icon: null, maskClosable: !1, escToExit: !1, backspaceToExit: !1, title: c.ZP.t("ai_report_content", {}, "Report Audio"), wrapClassName: G, className: U, closeIcon: (0, r.jsx)(d.Rnl, { className: z }), content: (0, r.jsx)(E, { photoReportConfigs: null != h ? h : [], onSubmit: m, onClose: g, reportItemList: i, containerService: e, mode: "audio", }), }); }); return function (t, i) { return e.apply(this, arguments); }; })(); }, 747029: function (e, t, i) { "use strict"; i.d(t, { HG: function () { return r; }, Jh: function () { return s; }, OO: function () { return l; }, Yo: function () { return a; }, }); var n = i(950835); function r() { return (0, n.Rl)().toString(); } var a = (e) => { var t, i; return null !== (i = null === (t = document.getElementById(e)) || void 0 === t ? void 0 : t.getBoundingClientRect()) && void 0 !== i ? i : { left: 0, top: 0, right: 0, bottom: 0 }; }; function o(e) { return ( !e || (!!e.isText && !!(e.text && "string" == typeof e.text && "" === e.text.trim())) ); } function s(e, t) { for (var i = t; i > 0; ) { var n = e.state.doc.resolve(i - 1), r = n.nodeBefore; if (r && !o(r)) return r; if (n.depth <= 0) break; i = n.before(); } return null; } function l(e, t) { for (var i = t; i < e.state.doc.content.size; ) { var n = e.state.doc.resolve(i + 1), r = n.nodeAfter; if (r && !o(r)) return r; if (n.depth <= 0) break; i = n.after(); } return null; } }, 264022: function (e, t, i) { "use strict"; i.d(t, { r: () => b }); var n = i("139646"), r = i("772322"); i("155582"), i("645523"), i("596477"), i("120671"); var a = i("56370"), o = i("750633"), s = i("216956"), l = i("425962"), c = i("188754"), d = i("949274"), u = i("218571"), f = i("917730"), h = i("798181"), p = { activityButton: "activityButton-eyqqBs", staticActKey: "staticActKey-pEwLAj", activitySelectorMenu: "activitySelectorMenu-FzwRBH", activitySelectorMenuItem: "activitySelectorMenuItem-ySdsyy", selectedIcon: "selectedIcon-nHe5XO", emptyContent: "emptyContent-Ekp_nZ", }, v = i("967355"), m = i("105789"), g = i.n(m), _ = i("41723"), y = i.n(_), b = (e) => { var t, { mwebActivityService: i, publishItemType: m, className: _, setSelectedActivityInfo: b, emptyText: I = d.ZP.t( "dreamina_publish_no_for_now", {}, "No ongoing activities for now" ), } = e, [w, x] = (0, u.useState)([]), [S, M] = (0, u.useState)(!1), [C, T] = (0, u.useState)(!1), { weeklyActivityKey: A } = (0, h.Xj)(), [k, P] = (0, u.useState)({ key: "", name: "" }), E = (0, u.useMemo)( () => w.filter((e) => e.actWorkTypeList.includes(m) && !e.actTerms), [w, m] ), D = E.some( (e) => e.actKey === k.key && e.actWorkTypeList.includes(m) ), R = E.some((e) => e.actKey === A && e.actWorkTypeList.includes(m)), N = D ? k.key : "", L = k.name || (null === (t = w.find((e) => e.actKey === N)) || void 0 === t ? void 0 : t.actName), j = !R || !D, O = (0, u.useRef)(b); return ( (O.current = b), (0, u.useEffect)(() => { var e; null === (e = O.current) || void 0 === e || e.call(O, { key: N, name: null != L ? L : "" }); }, [N, L]), (0, u.useEffect)(() => { if (!!i) (function () { var e = (0, n._)(function* () { M(!0); var e = yield i.getWeeklyChallengeList(); if ((M(!1), !!e.ok)) x( e.value.actInfoList .filter((e) => e.actStatus === f.Dh.InProgress) .sort((e, t) => y()(e.actStartTime).valueOf() > y()(t.actStartTime).valueOf() ? -1 : 1 ) ), P({ key: null != A ? A : "", name: "" }); }); return function () { return e.apply(this, arguments); }; })()(); }, [i]), (0, r.jsx)(l.Z, { position: "bl", trigger: "click", popupVisible: C, onVisibleChange: (e) => { if (!e || !!j) T(e); }, droplist: (0, r.jsx)(o.Z, { loading: S, children: (0, r.jsxs)(s.Z, { selectedKeys: [N], className: p.activitySelectorMenu, children: [ !(null == E ? void 0 : E.length) && (0, r.jsx)("div", { className: p.emptyContent, children: I, }), !!(null == E ? void 0 : E.length) && E.map((e) => (0, r.jsxs)( s.Z.Item, { className: p.activitySelectorMenuItem, onClick: () => { P({ key: e.actKey, name: e.actName }), T(!1); }, children: [ (0, r.jsx)(a.Z.Paragraph, { ellipsis: { expanded: !0, wrapper: "span" }, children: e.actName, }), N === e.actKey && (0, r.jsx)("div", { className: p.selectedIcon, children: (0, r.jsx)(c.DLY, { size: 12 }), }), ], }, e.actKey ) ), ], }), }), children: (0, r.jsx)(v.J, { type: "tertiary", PrevIcon: () => N ? (0, r.jsx)(c.yAf, { size: 14 }) : (0, r.jsx)(c.zGS, { size: 14 }), SuffixIcon: j && N ? () => (0, r.jsx)(c.Rnl, { size: 14, onClick: (e) => { e.stopPropagation(), P({ key: "", name: "" }), T(!1); }, }) : void 0, className: g()(p.activityButton, _, !j && p.staticActKey), text: N ? L || N : d.ZP.t( "dreamina_publish_add_challenge", {}, "Select activity" ), overflowEllipsis: !0, }), }) ); }; }, 624772: function (e, t, i) { "use strict"; i.d(t, { V: () => d }); var n = i("772322"); i("900992"); var r = i("744932"), a = i("218571"), o = { textContainer: "textContainer-Ak3Icp", inputArea: "inputArea-SA7TIs", positionWrapper: "positionWrapper-Dhgn6q", focus: "focus-jb1APR", bottomLeftModule: "bottomLeftModule-vtNn38", lackTextInfo: "lackTextInfo-jHLVs5", }, s = i("79532"), l = i("105789"), c = i.n(l), d = (e) => { var { title: t, placeholder: i, maxLength: l, onTextChange: d, onTextFocus: u, onTextBlur: f, errorInfo: h, required: p, wrapperClassName: v, inputClassName: m, bottomLeftModule: g, } = e, [_, y] = (0, a.useState)(!1); return (0, n.jsxs)("div", { className: c()(o.textContainer, v), children: [ (0, n.jsxs)("div", { className: s.Z.textLabelContainer, children: [ (0, n.jsx)("span", { className: s.Z.textLabel, children: t }), p && (0, n.jsx)("span", { className: s.Z.forceInputIcon, children: "*", }), ], }), (0, n.jsxs)("div", { className: c()(o.positionWrapper, _ && o.focus, m), children: [ (0, n.jsx)(r.Z.TextArea, { className: o.inputArea, onChange: (e) => { null == d || d(e.trim()); }, onFocus: () => { y(!0), null == u || u(); }, onBlur: () => { y(!1), null == f || f(); }, placeholder: i, maxLength: { length: l, errorOnly: !1 }, showWordLimit: !0, }), (0, n.jsx)("div", { className: o.bottomLeftModule, children: g, }), (0, n.jsx)("div", { className: o.lackTextInfo, children: null != h ? h : "", }), ], }), ], }); }; }, 483487: function (e, t, i) { "use strict"; i.d(t, { F: () => u }); var n = i("772322"); i("218571"); var r = i("161814"), a = { promptWithImgWrapperHeight: "24px", promptWithImgWrapperWidth: "123px", promptSeedIconSize: "12px", videoPromptPaddingVertical: "12px", videoControlsHeight: "32px", videoPaddingTop: "20px", videoMarginBottom: "28px", generateListPadding: "24px", generateListDateWidth: "46px", videoContainerPaddingRight: "86px", feedCarouselHeight: "220px", videoFeedHeaderHeight: "45px", generatePanelMarginLeft: "16px", masonryGap: "8px", generationEntryHeight: "172px", generationEntryMarginBottom: "16px", videoMenuItemWidth: "184px", videoMenuWidth: "160px", exploreFeedTabHeight: "32px", exploreFeedTabPaddingBottom: "20px", headerHeight: "76px", exploreFeedCategoryHeight: "32px", exploreFeedCategoryPaddingBottom: "16px", videoMoreWidth: "16px", generateListPaddingTop: "4px", videoFailPaddingH: "12px", videoFailPaddingV: "8px", videoFailIconMargin: "8px", videoFailIconSize: "16px", personalMarginTop: "100px", personalProfileHeight: "250px", personalProfileWidthLarge: "360px", personalProfileWidthSmall: "320px", personalProfileWidthBreakPoint: "1536px", personalScrollHeaderGap: "24px", storyEditorPadding: "8px", storyExSmallScreenWidth: "1146px", storySmallScreenWidth: "1280px", storyMiddleScreenWidth: "1280px", storyLargeScreenWidth: "1280px", storyExLargeScreenWidth: "1536px", storySmallPromptWidth: "240px", storyMiddlePromptWidth: "280px", storyLargePromptWidth: "320px", pageIconColor: "#8f9ca5", videoRelaxProcessingHeight: "68px", timelineLargeGap: "16px", timelineThumbnailHeightTime: "125px", timelineScrollWidth: "6px", timelineInsertSegmentBtnWidth: "16px", characterGenerateModalPanelWidth: "280px", characterGenerateModalHeaderHeight: "48px", largestScreenWidth: "1920px", largeContainerWidth: "1650px", smallScreenWidth: "1024px", scrollBarWidth: "2px", "largeScreenGenerate-Width": "1398px", largeScreenGenerateWidth: "1398px", middleScreenGenerateWidth: "1366px", smallestScreenGenerateWidth: "1024px", generateVideoCardMaxWidth: "526px", generateVideoCardMinWidth: "383px", generateCardMarginLeft: "12px", generateCardSideBarWidth: "24px", generateCardHoverButtonSize: "28px", generateCardBgmButtonWidth: "68px", storyboardContainerPadding: "16px", storyboardGap: "4px", generateContainerAnimationDuration: ".5s", videoPromptTabHeight: "36px", videoPromptTabMarginBottom: "8px", agentChatMinHeight: "132px", promptTabHeight: "44px", "prompt-container": "prompt-container-eIJwbn", promptContainer: "prompt-container-eIJwbn", prompt: "prompt-lRcVvJ", rotating: "rotating-VS7uCJ", }, o = i("79532"), s = i("949274"), l = i("105789"), c = i.n(l), d = i("418188"), u = (e) => { var t, i, { record: l, title: u, className: f, style: h } = e, { prompt: p } = l.text2ImageParams, { originPrompt: v } = null !== (i = l.paintingParam) && void 0 !== i ? i : {}, m = v || p, g = (0, d.Jc)(l.generateType) ? m : p; return (0, n.jsxs)("div", { className: c()(a.publishPrompt, f), style: h, children: [ (0, n.jsx)("div", { className: o.Z.textLabelContainer, children: (0, n.jsx)("span", { className: o.Z.textLabel, children: null != u ? u : s.ZP.t("dreamina_publish_prompt_title", {}, "Prompt"), }), }), (0, n.jsx)("div", { className: a.promptContainer, children: (0, n.jsx)("div", { className: a.prompt, children: (0, r.QT)( g, null === (t = l.blendImageParams) || void 0 === t ? void 0 : t.imagePromptList ), }), }), ], }); }; }, 140772: function (e, t, i) { "use strict"; i.d(t, { D: () => g }); var n = i("772322"); i("245535"); var r = i("76894"), a = i("44938"), o = i("246940"), s = i("2910"), l = i("967355"), c = i("541829"), d = { authorizedModal: "authorizedModal-FTalKl", title: "title-WH325J", content: "content-k7MbQw", btnWrapper: "btnWrapper-DPEbD7", loading: "loading-kjAtJI", }, u = i("384478"), f = i.n(u), h = i("652494"), p = i("949274"), v = i("882273"), m = (e) => { var { onAgree: t } = e, [i, r] = (0, v.I)({ policyURL: h.y.AUTHOR_AGREEMENT(!1) }); return (0, n.jsxs)("div", { className: d.authorizedModal, children: [ (0, n.jsx)("h2", { className: d.title, children: i }), r ? (0, n.jsx)(c.y, { className: d.content, children: (0, n.jsx)("div", { dangerouslySetInnerHTML: { __html: (0, s.J)(f()(r, {}), null, { logType: "react.dangerouslySetInnerHTML", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), }, }), }) : (0, n.jsx)("div", { className: d.loading, children: p.ZP.t( "homepage_tab_project_loading", {}, "Loading..." ), }), (0, n.jsx)("div", { className: d.btnWrapper, children: (0, n.jsx)(l.J, { text: "\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", className: d.agree, onClick: t, }), }), ], }); }; function g() { var e = a.u.hasPublished, { promise: t, resolve: i } = Promise.withResolvers(); if (o.T.getItem(e)) return i("granted"), t; var s = r.Z.confirm({ icon: null, simple: !0, closable: !0, wrapClassName: "first-authorized-modal", content: (0, n.jsx)(m, { onCancel: () => { s.close(), i("denied"); }, onAgree: () => { s.close(), o.T.setItem(e, a.O.True), i("granted"); }, }), footer: null, }); return t; } }, 897905: function (e, t, i) { "use strict"; i.d(t, { e: () => V }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("772322"); i("245535"); var s = i("293793"), l = i("76894"), c = i("2910"), d = i("218571"), u = { singleImageModalWrapper: "singleImageModalWrapper-RDRxkP", singleImageModal: "singleImageModal-oXgRhU", singleImageModalHeader: "singleImageModalHeader-fFIVgT", title: "title-XgH6sN", closeBtn: "closeBtn-a2_y86", contentContainer: "contentContainer-d2YpEQ", contentWrapper: "contentWrapper-zgXMl2", imgContainer: "imgContainer-GPO_Um", img: "img-eIS2RJ", rightContainer: "rightContainer-LX1udg", inputContainer: "inputContainer-TXZnb0", publishContainer: "publishContainer-EVRQLy", publishCollection: "publishCollection-jdxlNw", publishButtonContainer: "publishButtonContainer-eq5uC9", btn: "btn-V1A6y_", publishButton: "publishButton-NNzY_D", disabled: "disabled-Fh8T2n", }, f = i("949274"), h = i("653061"), p = i("642273"), v = i("967355"), m = i("70529"), g = i("229025"), _ = i("100470"), y = i("369617"), b = i("193305"), I = i("259273"), w = i("727279"), x = i("487736"), S = i("441828"), M = i("887073"), C = i("972394"), T = i("699267"), A = i("264022"), k = i("624772"), P = i("483487"), E = i("79532"), D = i("798181"), R = i("105789"), N = i.n(R), L = i("188754"), j = i("417442"), O = i("700056"), B = i("259435"), F = i("917730"), U = i("68442"), G = 4, z = (e) => { var t, i, { containerService: l, mwebActivityService: x, navigate: R, record: B, showGotoCollection: z, onClickPublish: V, onPublishSuccess: W, closeModal: Z, reportParams: K, defaultSelectedIndex: H = 0, multiple: q = !0, beforeRouteLeave: J, } = e, [Y, Q] = (0, d.useState)(H), X = (0, d.useMemo)(() => B.itemList[Y], [Y, B.itemList]), [$, ee] = (0, d.useState)(""), [et, ei] = (0, d.useState)(""), [en, er] = (0, d.useState)({ key: "", name: "" }); (0, T.G)(m.m); var ea = (0, d.useRef)(!1), eo = q && B.imageList.length > 1, es = (0, g.Cg)(B.generateType), el = (0, d.useMemo)(() => { var e; return (0, r._)( { type: "picture", content_id: null === (e = B.imageList) || void 0 === e ? void 0 : e[Y].itemId, picture_cnt: 1, title: $, description: et, activity_id: en.key, activity: en.name, }, K ); }, [Y, B.imageList, K, en, $, et]), ec = null !== (t = null == X ? void 0 : X.commonAttr.coverUrl) && void 0 !== t ? t : "", ed = null !== (i = null == X ? void 0 : X.commonAttr.coverUrlMap) && void 0 !== i ? i : {}, eu = (0, d.useCallback)((e) => { Q(e); }, []), ef = (0, d.useCallback)(() => { ea.current = !0; }, []), eh = (0, d.useCallback)(() => { ea.current = !1; }, []), ep = (0, d.useCallback)(() => { if ( !!q && !ea.current && !( (null === (e = B.itemList) || void 0 === e ? void 0 : e.length) < 2 ) ) { var e, t = Y - 1; t < 0 && (t = G - 1), Q(t); } }, [Y, B.itemList]), ev = (0, d.useCallback)(() => { if ( !!q && !ea.current && !( (null === (e = B.itemList) || void 0 === e ? void 0 : e.length) < 2 ) ) { var e, t = Y + 1; t === G && (t = 0), Q(t); } }, [Y, B.itemList]); (0, M.r)(C.VD.ARROW_LEFT, ep), (0, M.r)(C.VD.ARROW_RIGHT, ev); var [em, eg] = (0, d.useState)(!1), e_ = d.useCallback(() => { (0, j.Oc)(l, (0, r._)({ action: "go_to_collection" }, el)), null == J || J(), R( "" .concat(p.EZ[I.Sj.History]) .concat( (0, D.Wf)({ keepSearchList: [w.m.weeklyActivityKey] }) ), { state: { record: (0, O.Z)(B) }, replace: !0 } ), Z(); }, [l, el, R, B, Z]), ey = $.length > 0, eb = (0, s.default)((e) => { if (W) { W(e); return; } y.s.success( f.ZP.t("result_toast_publish_success", {}, "Image posted") ); }), eI = d.useCallback(() => { if (!ey) { y.s.warning( f.ZP.t( "dreamina_publish_desc_enter_must", {}, "Enter a description to continue" ) ); return; } (0, j.Oc)(l, (0, r._)({ action: "publish" }, el)), eg(!0); var e = { singleItem: X, title: $, description: et, weeklyActivityKey: en.key, weeklyActivityName: en.name, }; V(e).then((t) => { eg(!1); var { code: i } = t; i === _.b.ErrSuccess && t.ok ? (eb( (0, a._)((0, r._)({}, e), { resultItem: t.value.item }) ), Z()) : i === _.b.ErrHasPublished ? y.s.warning( f.ZP.t( "result_toast_publish_repeated", {}, "Image posted already" ) ) : i === _.b.ErrSharkNotPass ? y.s.error( f.ZP.t( "dreamina_web_user_violate_operation", {}, "\u60A8\u6D89\u53CA\u8FDD\u89C4\u64CD\u4F5C\uFF0C\u6682\u65F6\u65E0\u6CD5\u4F7F\u7528\u8BE5\u529F\u80FD" ) ) : y.s.warning( f.ZP.t( "result_toast_publish_fail_retry", {}, "Couldn\u2019t post. Try again." ) ); }); }, [l, el, V, X, $, et, en.key, en.name, Z]); (0, d.useEffect)(() => { (function () { var e = (0, n._)(function* () { var { weeklyActivityKey: e } = (0, D.Xj)(), { activity: t } = el; if (e) { var i, n, o = yield null == x ? void 0 : x.getWeeklyChallengeByKey(e); if (!(null == o ? void 0 : o.ok)) return; t = null !== (n = null === (i = o.value) || void 0 === i ? void 0 : i.actName) && void 0 !== n ? n : ""; } (0, j.Oc)(l, (0, a._)((0, r._)({ action: "show" }, el), { activity: t })); }); return function () { return e.apply(this, arguments); }; })()(); }, []); var ew = [ { title: f.ZP.t("publish_title", {}, "Title"), maxLength: U.z, placeholder: f.ZP.t( "publish_title_content", {}, "Tell us about your creation..." ), required: !0, onTextChange: (e) => ee(e), onTextFocus: ef, onTextBlur: eh, bottomLeftModule: (0, o.jsx)(A.r, { publishItemType: F.KT.Image, mwebActivityService: x, setSelectedActivityInfo: er, }), }, { title: f.ZP.t("publish_description", {}, "Introduction"), maxLength: U.s, placeholder: f.ZP.t( "publish_description_content", {}, "Tell us about your creation..." ), required: !1, onTextChange: (e) => ei(e), onTextFocus: ef, onTextBlur: eh, inputClassName: u.inputContainer, }, ]; return (0, o.jsxs)("div", { className: u.singleImageModal, children: [ (0, o.jsxs)("div", { className: u.singleImageModalHeader, children: [ (0, o.jsxs)("div", { className: u.title, children: [ (0, o.jsx)("span", { children: f.ZP.t( "dreamina_post_works_title", {}, "Publish work" ), }), (0, o.jsx)(b.s, { content: f.ZP.t( "proportion_notice_public_display", {}, "By tapping \u201CPost,\u201D you acknowledge and agree that the reference images and prompt content you post will be visible to people who use Dreamina. Images you generate and post on Dreamina are hereby authorized to be synced with CapCut." ), }), ], }), (0, o.jsx)(L.Rnl, { className: u.closeBtn, onClick: Z }), ], }), (0, o.jsxs)("div", { className: u.contentContainer, children: [ (0, o.jsxs)("div", { className: u.contentWrapper, children: [ (0, o.jsxs)("div", { className: u.imgContainer, children: [ (0, o.jsx)("div", { className: E.Z.textLabelContainer, children: (0, o.jsx)("span", { className: E.Z.textLabel, children: f.ZP.t( "dreamina_publish_previews", {}, "Preview" ), }), }), (0, o.jsx)(h.k, { className: u.img, resolutionUrlMap: ed, src: (0, c.C)(ec, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), imageStyle: { objectFit: "contain", height: "100%", position: "unset", }, crossOrigin: "anonymous", "data-apm-action": "publish-single-image-image", }), eo && (0, o.jsx)(S.A, { itemList: B.itemList, currentItem: X, updateCurrentItem: eu, }), ], }), (0, o.jsxs)("div", { className: u.rightContainer, children: [ ew.map((e) => (0, o.jsx)(k.V, (0, r._)({}, e), e.title) ), (0, o.jsx)(P.F, { record: B }), ], }), ], }), (0, o.jsxs)("div", { className: u.publishContainer, children: [ z && !eo && es ? (0, o.jsx)("div", { className: u.publishCollection, onClick: e_, children: f.ZP.t( "collection_publish_publishcollection", {}, "Try posting collections" ), }) : (0, o.jsx)("div", {}), (0, o.jsx)("div", { className: u.publishButtonContainer, children: (0, o.jsx)(v.J, { className: N()(u.publishButton, u.btn, { [u.disabled]: !ey, }), text: f.ZP.t( "collection_publish_publishbutton", {}, "Post" ), loading: em, onClick: eI, }), }), ], }), ], }), ], }); }; function V(e) { var t, i, n, s, c, d, f, h, { containerService: p, mwebActivityService: v, navigate: m, record: g, showGotoCollection: _, onClickPublish: y, onPublishSuccess: b, reportParams: I, defaultSelectedIndex: w, multiple: S, beforeRouteLeave: M, } = e, C = () => { null == h || h.close(), (h = void 0); }, A = (0, B.C)(p, x.M.PublishModal); h = l.Z.confirm({ wrapClassName: u.singleImageModalWrapper, title: null, footer: null, simple: !1, escToExit: !1, icon: null, afterClose: () => { A.unmount(); }, closable: !1, maskClosable: !1, content: (0, o.jsx)(T.$, { instantiationService: p, children: (0, o.jsx)(z, { containerService: p, mwebActivityService: v, navigate: m, record: g, showGotoCollection: _, onClickPublish: y, onPublishSuccess: b, closeModal: C, reportParams: (0, a._)((0, r._)({}, I), { template_id: null == g ? void 0 : null === (s = g.itemList) || void 0 === s ? void 0 : null === (n = s[0]) || void 0 === n ? void 0 : null === (i = n.refItem) || void 0 === i ? void 0 : null === (t = i.commonAttr) || void 0 === t ? void 0 : t.id, impression_id: null == g ? void 0 : null === (f = g.itemList) || void 0 === f ? void 0 : null === (d = f[0]) || void 0 === d ? void 0 : null === (c = d.clientTraceData) || void 0 === c ? void 0 : c.impressionId, }), defaultSelectedIndex: w, multiple: S, }), }), }); } }, 441828: function (e, t, i) { "use strict"; i.d(t, { A: () => v }); var n = i("772322"); i("218571"); var r = "itemSelector-SltNe5", a = "singleItem-z402_n", o = "singleItemActive-_qi49m", s = "larger-KOT_1l", l = "mask-G3Ne0T", c = "singleItemImage-aXwAgI", d = "selectedIcon-dZL1C2", u = i("653061"), f = i("188754"), h = i("105789"), p = i.n(h), v = (e) => { var { itemList: t, currentItem: i, updateCurrentItem: h, larger: v = !1, } = e; return (0, n.jsx)("div", { className: r, children: t.map((e, t) => { var r = e.commonAttr.id, m = r === i.commonAttr.id; return (0, n.jsxs)( "div", { className: p()({ [a]: !0, [o]: m, [s]: v }), onClick: () => h(t), children: [ (0, n.jsx)(f.DLY, { className: d, style: { opacity: m ? 1 : 0 }, }), (0, n.jsx)("div", { className: l, style: { opacity: m ? 0.4 : 0.2, borderColor: m ? "var(--text-secondary)" : "", }, }), (0, n.jsx)(u.k, { className: c, src: e.commonAttr.coverUrl, "data-apm-action": "publish-single-image-item-selector", }), ], }, r ); }), }); }; }, 568386: function (e, t, i) { "use strict"; i.d(t, { U: () => m, W: () => g }); var n = i("772322"), r = i("293793"), a = i("105789"), o = i.n(a), s = i("887073"), l = i("972394"), c = i("188754"), d = "actionContainer-LwHxl4", u = "leftIcon-yarKYr", f = "rightIcon-IoHj5j", h = "action-tKEPBj", p = "sideAction-l3aOIi", v = "actionDisabled-UfYYtE", m = (e) => { var { hasPrev: t, hasNext: i, onNext: a, onPrev: u, listenerClosed: f, className: p, } = e, m = (0, r.default)(() => { t && u(); }), g = (0, r.default)(() => { i && a(); }); return ( (0, s.r)(l.VD.ARROW_UP, (null == f ? void 0 : f.up) ? void 0 : m), (0, s.r)( l.VD.ARROW_DOWN, (null == f ? void 0 : f.down) ? void 0 : g ), (0, s.r)( l.VD.ARROW_LEFT, (null == f ? void 0 : f.left) ? void 0 : m ), (0, s.r)( l.VD.ARROW_RIGHT, (null == f ? void 0 : f.right) ? void 0 : g ), (0, n.jsxs)("div", { className: o()(d, p), children: [ (0, n.jsx)(c.Ej_, { className: o()(h, { [v]: !t }), onClick: m, }), (0, n.jsx)(c.f5h, { className: o()(h, { [v]: !i }), onClick: g, }), ], }) ); }, g = (e) => { var { hasPrev: t, hasNext: i, onNext: a, onPrev: d, className: m, } = e, g = (0, r.default)(() => { t && d(); }), _ = (0, r.default)(() => { i && a(); }); return ( (0, s.r)(l.VD.ARROW_LEFT, g), (0, s.r)(l.VD.ARROW_RIGHT, _), (0, n.jsxs)(n.Fragment, { children: [ (0, n.jsx)(c.Ej_, { className: o()(h, p, u, { [v]: !t }), onClick: g, }), (0, n.jsx)(c.f5h, { className: o()(h, p, f, { [v]: !i }), onClick: _, }), ], }) ); }; }, 763284: function (e, t, i) { "use strict"; i.d(t, { i: () => x }); var n = i("772322"); i("894672"); var r = i("274993"), a = i("184620"), o = i("293793"), s = i("835628"), l = i("218571"), c = i("105789"), d = i.n(c), u = "slider-qVYRz3", f = "with-marks-OJdEaw", h = "slider-wrapper-Ue5Cnb", p = "slider-road-jKH9w9", v = "slider-bar-xg5G9h", m = "active-BHnehq", g = "slider-button-bar-BBkjJO", _ = "slider-road-disable-_vQfCs", y = "slider-button-brick-VtlI1x", b = "slider-dot-eP9ob4", I = i("52533"), w = i("102974"), x = (e) => { var t, i, { className: c, min: x, max: S, step: M = 1, marks: C, onlyMarkValue: T, value: A, style: k, cssConfigs: P, onChange: E, onAfterChange: D, formatTooltip: R, triggerBar: N = !1, isDisable: L = !1, showValueTooltip: j = !0, disableTooltip: O, } = e, B = (0, w.Z)(C).map(Number).sort(), F = B.length > 0, U = (0, o.default)( (e) => (Math.min(Math.max(x, e), S) - x) / (S - x) ), G = U(A), z = (0, l.useRef)(null), [V, W] = (0, l.useState)(G), [Z, K, H] = (0, a.default)(!1), [q, J] = (0, s.default)(), Y = (0, o.default)((e) => { var t, i = null === (t = z.current) || void 0 === t ? void 0 : t.getBoundingClientRect(); return i ? Math.max(0, Math.min((e.x - i.x) / i.width, 1)) : 0; }), Q = (e) => { var t = (S - x) * e + x; if (T && B.length) { for ( var i = B[0], n = Math.abs(B[0] - t), r = 1; r < B.length; r++ ) { var a = Math.abs(B[r] - t); a < n && ((n = a), (i = B[r])); } return i; } var o = Math.floor((t - x) / M), s = x + o * M, l = s + M; return t - s < l - t ? s : Math.min(l, S); }, X = (0, o.default)((e) => { if (!L) { K(!0); var t = Y(e); W(t), null == E || E(Q(t)); } }), $ = (0, o.default)((e) => { if (!L && !!H()) { K(!1); var t = Y(e); W(t), null == D || D(Q(t)); } }), ee = (0, o.default)((e) => { if (!L && !!H()) { var t = Y(e); W(t), null == E || E(Q(t)); } }); (0, l.useEffect)(() => { var e = z.current; return ( document.addEventListener("mouseup", $), document.addEventListener("mousemove", ee), null == e || e.addEventListener("mousedown", X), () => { document.removeEventListener("mouseup", $), document.removeEventListener("mousemove", ee), null == e || e.removeEventListener("mousedown", X); } ); }, [X, ee, $]); var et = Q(Z || (0, I.Z)(G) ? V : G), ei = U(et), en = R ? R(et) : "".concat(et), er = B.map((e) => U(e)); return (0, n.jsx)(r.Z, { content: O, disabled: !L, triggerProps: { popupAlign: { top: 8 } }, children: (0, n.jsx)("div", { className: d()(c, u, { [f]: F }), style: k, children: (0, n.jsxs)("div", { className: d()( h, null == P ? void 0 : null === (t = P.sliderWrapper) || void 0 === t ? void 0 : t.className ), style: null == P ? void 0 : null === (i = P.sliderWrapper) || void 0 === i ? void 0 : i.style, ref: z, children: [ (0, n.jsxs)("div", { className: d()(p, { [m]: Z, [_]: L }), children: [ (0, n.jsx)("div", { className: v, style: { right: "".concat((1 - ei) * 100, "%") }, }), (0, n.jsx)(r.Z, { content: en, popupVisible: !!j && (Z || J), triggerProps: { popupAlign: { top: 4 } }, children: (0, n.jsx)("div", { className: d()({ [g]: N, [y]: !N }), ref: q, style: { right: "".concat((1 - ei) * 100, "%") }, }), }), ], }), er.map((e, t) => (0, n.jsx)( "div", { className: d()(b, { [m]: e <= ei }), style: { right: "".concat((1 - e) * 100, "%") }, }, t ) ), ], }), }), }); }; }, 718189: function (e, t, i) { "use strict"; i.d(t, { o: () => ee }); var n = i("581148"), r = i("58871"), a = i("625572"), o = i("639880"), s = i("772322"); i("2860"), i("245535"); var l = i("298677"), c = i("76894"), d = i("218571"), u = i("434712"), f = i("699267"), h = i("188754"), p = i("949274"), v = i("518814"), m = i("799108"), g = i("217448"), _ = i("733437"), y = i("967355"), b = i("340471"), I = i("405013"), w = i("695001"), x = i("236242"), S = { title: "title-x3Me0g", defaultContent: "defaultContent-o1YzRS", desc: "desc-kv2Buo", planCard: "planCard-dUKXK2", planItem: "planItem-_OqApe", top: "top-hBk2sU", vipIcon: "vipIcon-RIuuZR", levelName: "levelName-u1uEPq", infoTitle: "infoTitle-Otg33n", infoValue: "infoValue-vMozfk", planItemSingle: "planItemSingle-oakqQi", left: "left-Opjlf4", right: "right-fjJ904", autoRenewalCard: "autoRenewalCard-SuO47k", flexBox: "flexBox-ebpHxC", bigTitle: "bigTitle-oJ3_ZP", bigBtn: "bigBtn-QpeM3O", infoList: "infoList-_JUuVa", smallTitle: "smallTitle-dISsix", info: "info-YvThJe", text: "text-beNMkV", copyIcon: "copyIcon-C83346", }, M = (e) => { switch (e) { case "ALI": return "\u652F\u4ED8\u5B9D"; case "WX": return "\u5FAE\u4FE1\u652F\u4ED8"; case "HZ": return "\u6296\u97F3\u652F\u4ED8"; default: return e; } }; function C(e) { var { reportParam: t, onClose: i } = e, n = (0, f.G)(g.q), r = (0, f.G)(u.t), { vipLevels: l, currentAutoRenewPlan: c, isVipExpired: h, currentVipLevel: C, curLevelEndTime: T, } = (0, _.k)(n, (e) => { var t, i, n; return { vipLevels: (null === (t = e.vipInfo) || void 0 === t ? void 0 : t.vipLevels) || [], isVipExpired: e.isVipExpired, currentAutoRenewPlan: null === (i = e.vipInfo) || void 0 === i ? void 0 : i.currentAutoRenewPlan, curLevelEndTime: null === (n = e.vipInfo) || void 0 === n ? void 0 : n.curLevelEndTime, currentVipLevel: e.currentVipLevel, }; }) || {}, { source: A } = t || {}, k = (0, d.useMemo)(() => { try { return l.map((e) => { var t = c && (null == c ? void 0 : c.level) === e.level, i = e.level === C, n = h ? p.ZP.t( "dre_m10n_management_page_expired_date", {}, "Expired time" ) : t ? i ? p.ZP.t( "dre_m10n_management_page_next_billing_date", {}, "Renew on" ) : p.ZP.t( "dre_m10n_management_page_starting_from_date", {}, "Starts on" ) : p.ZP.t( "dre_m10n_management_page_plan_ends_date", {}, "Expired on" ), r = t ? i ? (0, I.vc)("yyyy-MM-dd hh:mm", 1e3 * c.nextRenewalTime) : (0, I.vc)("yyyy-MM-dd hh:mm", 1e3 * e.beginTime) : (0, I.vc)("yyyy-MM-dd hh:mm", 1e3 * e.endTime); return (0, o._)((0, a._)({}, e), { title: n, levelName: (0, m.J2)({ level: e.level }), endTime: r, }); }); } catch (e) { return []; } }, [l, c, h]), P = (0, d.useMemo)(() => { try { if (!c) return; return { levelName: (0, m.sG)({ level: c.level }), infoList: [ { title: p.ZP.t( "dre_m10n_management_page_auto_renew_subscription_type", {}, "Subscription Methods" ), value: "YEAR" === c.cycleUnit ? p.ZP.t( "dre_m10n_management_page_auto_renew_subscription_type_yearly", {}, "YEARLY" ) : p.ZP.t( "dre_m10n_management_page_auto_renew_subscription_type_monthly", {}, "MONTHLY" ), }, { title: p.ZP.t( "dre_m10n_management_page_auto_renew_amount", {}, "Price" ), value: c.nextRenewalFee, }, { title: p.ZP.t( "dre_m10n_management_page_auto_renew_billing_date", {}, "Next billing time" ), value: (0, I.vc)( "yyyy-MM-dd hh:mm", 1e3 * c.nextRenewalTime ), }, { title: p.ZP.t( "dre_m10n_management_page_auto_renew_payment_method", {}, "Payment method" ), value: M(c.payChannel), }, ].map((e) => (0, o._)((0, a._)({}, e), { value: String(e.value) || "-" }) ), }; } catch (e) { return; } }, [c]), E = () => { (0, b.Q)({ containerService: r, preCreateRes: { obtainedVipInfo: { autoRenewEndTime: null == c ? void 0 : c.nextRenewalTime, }, upcomingVipInfo: {}, subscriptionChangeInfo: { changeType: "DEGRADE" }, }, reportParam: { source: w.fG.SubscribePlanManagePopupClickCancelAutoRenewal, }, }), (0, x.KB)(r, { action: x.Z.ClickCancelAutoRenewal, currentTab: x.Ak.ManagePlans, source: A, }); }, D = (e) => { var { title: t, desc: i, btnText: n, onClick: r } = e; return (0, s.jsxs)("div", { className: S.defaultContent, children: [ (0, s.jsx)("div", { className: S.title, children: t }), i && (0, s.jsx)("div", { className: S.desc, children: i }), n && (0, s.jsx)(y.J, { onClick: r, text: n, type: "tertiary" }), ], }); }, R = () => k.length ? (0, s.jsx)("div", { className: S.planCard, children: k.length > 1 ? k.map((e, t) => (0, s.jsxs)( "div", { className: S.planItem, children: [ (0, s.jsxs)("div", { className: S.top, children: [ (0, s.jsx)(v.Z, { className: S.vipIcon, inactive: h, size: 16, level: e.level, }), (0, s.jsx)("div", { className: S.levelName, children: e.levelName, }), ], }), (0, s.jsx)("div", { className: S.infoTitle, children: e.title, }), (0, s.jsx)("div", { className: S.infoValue, children: e.endTime, }), ], }, t ) ) : k.map((e, t) => (0, s.jsxs)( "div", { className: S.planItemSingle, children: [ (0, s.jsxs)("div", { className: S.left, children: [ (0, s.jsx)(v.Z, { inactive: h, className: S.vipIcon, size: 16, level: e.level, }), (0, s.jsx)("div", { className: S.levelName, children: e.levelName, }), ], }), (0, s.jsxs)("div", { className: S.right, children: [ (0, s.jsx)("div", { className: S.infoTitle, children: e.title, }), (0, s.jsx)("div", { className: S.infoValue, children: e.endTime, }), ], }), ], }, t ) ), }) : D({ title: "" }), N = () => P ? (0, s.jsxs)("div", { className: S.autoRenewalCard, children: [ (0, s.jsxs)("div", { className: S.flexBox, children: [ (0, s.jsx)("div", { className: S.bigTitle, children: P.levelName, }), (0, s.jsx)(y.J, { type: "tertiary", text: p.ZP.t( "dre_m10n_management_page_auto_renew_cancel", {}, "Cancel auto-renewal" ), className: S.bigBtn, onClick: E, }), ], }), (0, s.jsx)("div", { className: S.infoList, children: P.infoList.map((e, t) => (0, s.jsxs)( "div", { className: S.flexBox, children: [ (0, s.jsx)("div", { className: S.smallTitle, children: e.title, }), (0, s.jsx)("div", { className: S.info, children: (0, s.jsx)("div", { className: S.text, children: e.value, }), }), ], }, t ) ), }), ], }) : D({ title: p.ZP.t( "dre_m10n_management_page_auto_renew_null", {}, "You don't have an auto-renewal program yet" ), btnText: p.ZP.t( "dre_m10n_management_page_auto_renew_see_more", {}, "View subscription plans" ), onClick: i, }); return (0, s.jsxs)("div", { className: S.container, children: [ (0, s.jsx)("div", { className: S.title, children: p.ZP.t( "dre_m10n_management_page_membership", {}, "My plans" ), }), R(), (0, s.jsx)("div", { className: S.title, style: { marginTop: "8px" }, children: p.ZP.t( "dre_m10n_management_page_auto_renew", {}, "Auto renewal" ), }), N(), ], }); } var T = i("139646"); i("645523"), i("214865"); var A = i("804929"), k = i("750633"), P = i("644254"), E = i("789786"), D = i("260963"), R = i("473877"), N = i("787205"), L = i("909854"), j = i.n(L), O = i("417699"), B = 10; class F { get recordList() { return this._observableData.recordList || []; } get hasMore() { return this._observableData.hasMore; } get loading() { return this._observableData.loading; } loadOrderRecordList() { var e = this; return (0, T._)(function* () { try { if (e._pending) return; if ( ((e._pending = !0), (0, D.z)(() => { e._observableData.loading = !0; }), (t = e._dreaminaEnvironmentService.isOversea ? yield e._commerceDataService.fetchOverseaOrderRecords({ appId: e._dreaminaEnvironmentService.appId, cursor: Number(e._nextCursor), count: e._count, }) : yield e._commerceDataService.fetchOrderRecords({ cursor: e._nextCursor, count: e._count, })).ok) ) { var t, { hasMore: i, nextCursor: n, recordList: r } = t.value; (e._nextCursor = "".concat(n)), (0, D.z)(() => { (e._observableData.hasMore = i), (e._observableData.recordList = [ ...e._observableData.recordList, ...(r.map((t) => e.formatData(t)) || []), ]), (e._observableData.loading = !1); }); } else (0, D.z)(() => { e._observableData.loading = !1; }); } catch (t) { (0, D.z)(() => { e._observableData.loading = !1; }); } finally { e._pending = !1; } })(); } formatData(e) { return "paymentInfo" in e ? this.formatOverseaServerData(e) : this.formatDomesticServerData(e); } formatDomesticServerData(e) { return { title: "credit" === e.purchaseType ? p.ZP.t( "dre_m10n_management_page_tab_order_history_credits", { number0: e.creditsNumber }, "{number0} credits recharge" ) : (0, m.sG)({ level: null == e ? void 0 : e.level }), price: e.amount < 0 ? "-" : j()(e.amount / 100 || 0, { symbol: "CNY" === e.currencyCode ? "\xa5" : e.currencyCode, precision: 2, separator: ",", }).format(), orderId: e.orderId, purchaseDate: (0, I.vc)("yyyy-MM-dd hh:mm", 1e3 * e.payTime), paymentMethod: e.payChannelText, subscriptionMethods: e.cycleUnit ? (0, m.d8)(e.cycleUnit, "unauto" === e.subscribeType) : void 0, }; } formatOverseaServerData(e) { var t, { skuInfo: i } = e, { skuBenefit: n, skuCycle: r, skuType: a } = null != i ? i : {}; return { title: "vip" === e.scene ? (0, m.sG)({ level: null == n ? void 0 : n.level }) : p.ZP.t( "dre_m10n_management_page_tab_order_history_credits", { number0: null == n ? void 0 : null === (t = n.creditBenefit) || void 0 === t ? void 0 : t.amount, }, "{number0} credits recharge" ), price: e.paymentInfo.paymentAmount.amountTips, orderId: e.orderId, purchaseDate: (0, I.vc)( "yyyy-MM-dd hh:mm", 1e3 * e.paymentInfo.purchaseDate ), paymentMethod: e.paymentInfo.paymentMethod, subscriptionMethods: (null == r ? void 0 : r.cycleUnit) ? (0, m.d8)(r.cycleUnit, a === R.EV.ONEOFF) : void 0, }; } constructor(e, t, i) { (this._containerService = e), (this._commerceDataService = t), (this._dreaminaEnvironmentService = i), (this._nextCursor = "0"), (this._count = B), (this._pending = !1), (this._observableData = (0, D.LO)({ recordList: [], hasMore: !0, loading: !0, })); } } F = (0, E.gn)( [ (0, E.fM)(0, u.t), (0, E.fM)(1, N.$), (0, E.fM)(2, O.e), (0, E.w6)("design:type", Function), (0, E.w6)("design:paramtypes", [ void 0 === u.t ? Object : u.t, void 0 === N.$ ? Object : N.$, void 0 === O.e ? Object : O.e, ]), ], F ); var U = { container: "container-otwwYI", defaultContent: "defaultContent-Oa2jzx", title: "title-je11h7", desc: "desc-_wg6rY", recordCard: "recordCard-Z8iDF9", flexBox: "flexBox-LAGihY", bigTitle: "bigTitle-oGqMAy", infoList: "infoList-J1Loqb", smallTitle: "smallTitle-lictEL", info: "info-tNpoLJ", text: "text-VtQZ2x", copyIcon: "copyIcon-ZHfMb3", initSpin: "initSpin-lXh0Po", loadSpin: "loadSpin-NftnuE", spin: "spin-LYqdVF", noMore: "noMore-sQPf3r", }; function G() { var e = (0, f.G)(u.t), t = (0, d.useRef)(e.createInstance(F)).current, { loading: i, hasMore: n, recordList: r, } = (0, _.k)(t, (e) => ({ loading: e.loading, hasMore: e.hasMore, recordList: e.recordList || [], })) || {}, [l, c] = (0, A.default)(void 0, { rootMargin: "0px 0px 100px 0px" }), v = (0, d.useMemo)(() => { try { return r.map((e) => { var t = []; e.subscriptionMethods && t.push({ title: p.ZP.t( "dre_m10n_management_page_tab_order_history_subscription_type", {}, "Plan" ), value: e.subscriptionMethods, }); var { title: i } = e; return { title: i, orderId: e.orderId, infoList: [ ...t, { title: p.ZP.t( "dre_m10n_management_page_tab_order_history_price", {}, "Price" ), value: e.price, }, { title: p.ZP.t( "dre_m10n_management_page_tab_order_history_date", {}, "Date of purchase" ), value: e.purchaseDate, }, { title: p.ZP.t( "dre_m10n_management_page_tab_order_history_order_no", {}, "Order number" ), value: e.orderId, iconType: "copy", }, { title: p.ZP.t( "dre_m10n_management_page_tab_order_history_payment_method", {}, "Payment method" ), value: e.paymentMethod, }, ].map((e) => (0, o._)((0, a._)({}, e), { value: String(e.value) || "-" }) ), }; }); } catch (e) { return []; } }, [r]), m = (function () { var e = (0, T._)(function* (e) { try { yield navigator.clipboard.writeText(String(e)), P.Z.success({ icon: (0, s.jsx)(h.wR6, { size: 20, color: "rgba(17, 19, 24, 1)", }), content: p.ZP.t("copy_success", {}, "Copied"), }); } catch (e) { P.Z.warning( p.ZP.t( "copy_failed_please_retry", {}, "Couldn't copy. Try again." ) ); } }); return function (t) { return e.apply(this, arguments); }; })(); (0, d.useEffect)(() => { t.loadOrderRecordList(); }, []), (0, d.useEffect)(() => { c && t.loadOrderRecordList(); }, [c]); var g = (e) => { var { title: t, desc: i } = e; return (0, s.jsxs)("div", { className: U.defaultContent, children: [ (0, s.jsx)("div", { className: U.title, children: t }), i && (0, s.jsx)("div", { className: U.desc, children: i }), ], }); }, y = (e) => { var { title: t, orderId: i, infoList: n } = e; return (0, s.jsxs)( "div", { className: U.recordCard, children: [ (0, s.jsx)("div", { className: U.flexBox, children: (0, s.jsx)("div", { className: U.bigTitle, children: t, }), }), (0, s.jsx)("div", { className: U.infoList, children: n.map((e, t) => (0, s.jsxs)( "div", { className: U.flexBox, children: [ (0, s.jsx)("div", { className: U.smallTitle, children: e.title, }), (0, s.jsxs)("div", { className: U.info, children: [ "copy" === e.iconType && (0, s.jsx)(h.JmT, { className: U.copyIcon, size: 16, style: { cursor: "pointer" }, onClick: () => m(e.value), }), (0, s.jsx)("div", { className: U.text, children: e.value, }), ], }), ], }, t ) ), }), ], }, i ); }; return (0, s.jsxs)("div", { className: U.container, children: [ i && !v.length ? (0, s.jsx)("div", { className: U.initSpin, children: (0, s.jsx)(k.Z, { className: U.spin, size: 24 }), }) : null, i || v.length ? null : g({ title: p.ZP.t( "dre_m10n_management_page_tab_order_history_null", {}, "You don't have an payment record yet" ), }), v.length ? v.map((e) => y(e)) : null, (0, s.jsx)("div", { className: U.loadSpin, ref: l, style: { display: n && v.length ? "flex" : "none" }, children: (0, s.jsx)(k.Z, { className: U.spin, size: 16 }), }), i || !v.length || n ? null : (0, s.jsx)("div", { className: U.noMore, children: p.ZP.t( "dre_m10n_credit_balance_end", {}, "You\u2019ve reached the end" ), }), ], }); } var z = "subscriptionManageModalWrapper-upQXzL", V = "subscriptionManageModal-MPMvcg", W = "header-ordD3P", Z = "title-yDGPEi", K = "closeBtn-IdwyA4", H = "closeBtnIcon-oHaLNz", q = "container-RKSaJH", J = "tabs-m8U8C_", Y = "tabTitleWrapper-AzfWqe", Q = "scrollView-5trpx1", X = { [x.Ak.ManagePlans]: (e) => { var t = (0, n._)({}, (0, r._)(e)); return (0, s.jsx)( "div", (0, o._)((0, a._)({ className: Q }, t), { children: (0, s.jsx)(C, { onClose: t.onClose, reportParam: t.reportParam, }), }) ); }, [x.Ak.OrderRecords]: (e) => { var t = (0, n._)({}, (0, r._)(e)); return (0, s.jsx)( "div", (0, o._)((0, a._)({ className: Q }, t), { children: (0, s.jsx)(G, {}), }) ); }, }; function $(e) { var { onClose: t, reportParam: i } = e, n = (0, f.G)(u.t), { source: r } = i || {}, [a, o] = (0, d.useState)(x.Ak.ManagePlans), c = () => { null == t || t(); }, v = (e) => { (0, x.KB)(n, { action: x.Z.ClickTab, currentTab: a, clickTab: e, source: r, }), o(e); }; return ( (0, d.useEffect)(() => { (0, x.KB)(n, { action: x.Z.Show, currentTab: a, source: r }); }, []), (0, s.jsxs)("div", { className: V, children: [ (0, s.jsxs)("div", { className: W, children: [ (0, s.jsx)("div", { className: Z, children: p.ZP.t( "dre_m10n_management_page_title", {}, "Manage Subscription" ), }), (0, s.jsx)("div", { className: K, onClick: c, children: (0, s.jsx)(h.Rnl, { className: H }), }), ], }), (0, s.jsxs)("div", { className: q, children: [ (0, s.jsxs)(l.Z, { className: J, activeTab: a, onChange: v, renderTabTitle: (e) => (0, s.jsx)("div", { className: Y, children: e }), children: [ (0, s.jsx)( l.Z.TabPane, { title: p.ZP.t( "dre_m10n_management_page_tab_manage_plan", {}, "Manage Plans" ), }, x.Ak.ManagePlans ), (0, s.jsx)( l.Z.TabPane, { title: p.ZP.t( "dre_m10n_management_page_tab_order_history", {}, "Payment Records" ), }, x.Ak.OrderRecords ), ], }), [x.Ak.ManagePlans, x.Ak.OrderRecords].map((e) => { var t = X[e]; return (0, s.jsx)( t, { onClose: c, style: { display: e === a ? "block" : "none" }, reportParam: i, }, e ); }), ], }), ], }) ); } function ee(e) { var { containerService: t, reportParam: i } = e, n = c.Z.confirm({ title: null, footer: null, icon: null, simple: !0, closable: !1, maskClosable: !0, maskStyle: { backdropFilter: "blur(8px)", WebkitBackdropFilter: "blur(8px)", }, wrapClassName: z, content: (0, s.jsx)(f.$, { instantiationService: t, children: (0, s.jsx)($, { onClose: () => n.close(), reportParam: i, }), }), }); } }, 415467: function (e, t, i) { "use strict"; i.d(t, { e: () => T }); var n = i("625572"), r = i("639880"), a = i("772322"); i("894672"); var o = i("274993"), s = i("218571"), l = i("733437"), c = i("224671"), d = i("949274"), u = { title: "title-AqS3kR", icon: "icon-XIj4kF" }; i("248405"); var f = i("245848"), h = i("105789"), p = i.n(h), v = i("188754"), m = { container: "container-ZC8D9b", dimensionContainer: "dimensionContainer-trjU98", dimension: "dimension-gmOMCZ", kindText: "kindText-EMYvoJ", valueInput: "valueInput-ifacyB", lockIconContainer: "lockIconContainer-IEssA4", lockIcon: "lockIcon-jHKf61", lockIconDisable: "lockIconDisable-SUyZrS", lockIconContainerDisable: "lockIconContainerDisable-ZbC3B6", dimensionErrTips: "dimensionErrTips-Z0ygQf", }, g = (e) => { var { width: t, height: i, errTips: s, isLocked: l, className: c, minValue: u, maxValue: h, isWidthError: g = !1, isHeightError: _ = !1, dimensionItemStyle: y, isDisable: b, onLockChange: I, onWidthChange: w, onWidthClick: x, onWidthUpdateFinish: S, onHeightChange: M, onHeightClick: C, onHeightUpdateFinish: T, } = e, A = void 0 !== s, k = (l || (!l && t > 0 && i > 0)) && !b, P = "".concat(u, "~").concat(h), E = () => { k && I(!l); }, D = () => { null == S || S(); }, R = () => { null == T || T(); }, N = () => { null == x || x(); }, L = () => { null == C || C(); }, j = l ? d.ZP.t("canvas2_ratio_unbind", {}, "Unlock aspect ratio") : d.ZP.t("canvas2_ratio_fixed", {}, "Lock aspect ratio"); return (0, a.jsxs)("div", { className: p()(m.container, c), children: [ (0, a.jsxs)("div", { className: m.dimensionContainer, children: [ (0, a.jsxs)("div", { className: m.dimension, style: (0, r._)((0, n._)({}, y), { border: g ? "1px solid var(--state-warning)" : "", }), children: [ (0, a.jsx)("div", { className: m.kindText, children: "W", }), (0, a.jsx)(f.Z, { disabled: b, className: m.valueInput, value: t, onClick: N, onBlur: D, onChange: w, precision: 0, hideControl: !0, placeholder: P, }), ], }), (0, a.jsx)("div", { className: p()(m.lockIconContainer, { [m.lockIconContainerDisable]: !k, }), onClick: E, children: (0, a.jsx)(o.Z, { content: j, disabled: !k, children: l ? (0, a.jsx)(v.ikT, { className: p()(m.lockIcon, { [m.lockIconDisable]: !k, }), }) : (0, a.jsx)(v.EA8, { className: p()(m.lockIcon, { [m.lockIconDisable]: !k, }), }), }), }), (0, a.jsxs)("div", { className: m.dimension, style: (0, r._)((0, n._)({}, y), { border: _ ? "1px solid var(--state-warning)" : "", }), children: [ (0, a.jsx)("div", { className: m.kindText, children: "H", }), (0, a.jsx)(f.Z, { disabled: b, className: m.valueInput, style: { color: _ ? "var(--state-warning)" : "" }, value: i, onBlur: R, onChange: M, onClick: L, precision: 0, hideControl: !0, placeholder: P, }), ], }), ], }), A && (0, a.jsx)("div", { className: m.dimensionErrTips, children: s, }), ], }); }, _ = i("314068"), y = i("575088"), b = i("475578"), I = i("528498"), w = i("205253"), x = i("486965"), S = i("820"), M = i("489897"), C = (e, t, i) => e >= t && e <= i, T = (e) => { var t, i, f, h, p, v, { instance: m, containerService: T, page: A, hideTitle: k = !1, isDisable: P = !1, } = e, [E, D] = (0, I.CY)(), [R, N] = (0, s.useState)(""), [L, j] = (0, s.useState)(!1), [O, B] = (0, s.useState)(!1), F = (0, l.k)(m, (e) => ({ largeImageInfo: e.largeImageInfo, isDimensionLocked: e.isDimensionLocked, customRatio: null == e ? void 0 : e.customRatio, selectModel: e.selectModel, imageRatio: e.imageRatio, })), { largeImageInfo: U = _.jg, isDimensionLocked: G = !0, customRatio: z, selectModel: V, imageRatio: W = c.jP.OneOne, } = null != F ? F : {}, Z = (0, s.useMemo)( () => (0, x.h)( null == U ? void 0 : U.resolutionType, null == V ? void 0 : V.resolutionMap ), [V, null == U ? void 0 : U.resolutionType] ), K = (0, s.useCallback)( (e) => { if (null == U ? void 0 : U.resolutionType) return (0, S.l3)( U.resolutionType, null == V ? void 0 : V.resolutionMap, e ); }, [ null == U ? void 0 : U.resolutionType, null == V ? void 0 : V.resolutionMap, ] ), H = (0, s.useMemo)(() => { var e = Math.floor(Math.sqrt(Z.maxPixelNum * M.mg[W])), t = Math.floor(e / M.mg[W]); return { width: e, height: t }; }, [Z.maxPixelNum, W]), q = (0, s.useCallback)( (e, t) => { var i; return ( (i = G ? Math.min(t, Math.floor(Z.maxPixelNum / e), Z.maxLength) : Math.min(Z.maxLength, Math.floor(Z.maxPixelNum / e))), d.ZP.t( "canvas_tool_supported_inputs", { stringx: "".concat(Z.minLength, "px~").concat(i, "px") }, "Enter between: {stringx}" ) ); }, [Z, G] ); (0, s.useEffect)(() => { D && (0, y.b_)(T, { page: A, item: y.xQ.Lock, action: b.tz.Show }); }, [D]); var J = (e) => { if (!!e) { var t = Math.min(Z.maxLength, Z.maxPixelNum / U.width), i = void 0 === e || !C(e, Z.minLength, t); B(i), N(i ? q(U.width, H.height) : ""), null == m || m.updateSelectedImageHeight(e); } }, Y = (e) => { if (!!e) { var t = Math.min(Z.maxLength, Z.maxPixelNum / U.height), i = void 0 === e || !C(e, Z.minLength, t); j(i), N(i ? q(U.height, H.width) : ""), null == m || m.updateSelectedImageWidth(e); } }, Q = (e) => { null == m || m.updateIsDimensionLocked(e), (0, y.b_)(T, { item: y.xQ.Lock, action: b.tz.Click, page: A }); }, X = () => { if (!!m) { var { width: e, height: t } = m.largeImageInfo; if (e * t > Z.maxPixelNum) { if (G) { var i = K(W); i && m.updateLargeImageInfo( (0, r._)((0, n._)({}, i), { resolutionType: U.resolutionType, }) ); } else { var a = Math.floor(Z.maxPixelNum / t); m.updateSelectedImageWidth(a); } } j(!1), N(""); } }, $ = () => { if (!!m) { var { width: e, height: t } = m.largeImageInfo; if (e * t > Z.maxPixelNum) { if (G) { var i = K(W); i && m.updateLargeImageInfo( (0, r._)((0, n._)({}, i), { resolutionType: U.resolutionType, }) ); } else { var a = Math.floor(Z.maxPixelNum / e); m.updateSelectedImageHeight(a); } } B(!1), N(""); } }; return (0, a.jsxs)("div", { ref: E, children: [ !k && (0, a.jsxs)("div", { className: u.title, children: [ d.ZP.t("ratio_ratio_pic"), (0, a.jsx)(o.Z, { content: d.ZP.t( "ratio_ratio_quality", {}, "The larger the image size, the better the image quality, but it may also take longer to generate." ), children: (0, a.jsx)(w.MFE, { className: u.icon }), }), ], }), (0, a.jsx)(g, { width: null !== (h = null !== (f = null == U ? void 0 : U.width) && void 0 !== f ? f : null === (t = K(c.jP.OneOne)) || void 0 === t ? void 0 : t.width) && void 0 !== h ? h : _.jg.width, height: null !== (v = null !== (p = null == U ? void 0 : U.height) && void 0 !== p ? p : null === (i = K(c.jP.OneOne)) || void 0 === i ? void 0 : i.height) && void 0 !== v ? v : _.jg.height, minValue: Z.minLength, maxValue: Z.maxLength, isWidthError: L, isHeightError: O, isLocked: G, errTips: R, isDisable: P, onHeightChange: J, onWidthChange: Y, onLockChange: Q, onWidthUpdateFinish: X, onHeightUpdateFinish: $, }), ], }); }; }, 310509: function (e, t, i) { "use strict"; i.d(t, { i: () => g }); var n = i("625572"), r = i("639880"), a = i("96"), o = i("772322"); i("894672"); var s = i("274993"), l = i("218571"), c = i("105789"), d = i.n(c), u = i("52533"), f = { timeoutTooltip: "timeoutTooltip-EeUjLC", greyTip: "greyTip-N0KGXs", flexBox: "flex-box-LZn6Dk", closeIcon: "close-icon-FchpEf", }, h = i("699267"), p = i("434712"), v = i("259435"), m = i("188754"), g = (0, l.forwardRef)((e, t) => { var { children: i, className: c, content: g, onVisibleChange: _, waitingContextViewIds: y, tooltipStyle: b, needCloseIcon: I = !1, } = e, w = (0, a._)(e, [ "children", "className", "content", "onVisibleChange", "waitingContextViewIds", "tooltipStyle", "needCloseIcon", ]), [x, S] = (0, l.useState)(!1), [M, C] = (0, l.useState)(void 0), T = (0, l.useRef)(), A = (0, h.G)(p.t), k = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3e3; !(0, u.Z)(e) && C(e), S(!0), T.current && clearTimeout(T.current), (T.current = setTimeout(() => { S(!1), C(g), (T.current = void 0); }, t)); }, P = () => { if (!!x) T.current && clearTimeout(T.current), S(!1), C(g), (T.current = void 0); }, E = function (e) { var t, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3e3; if (y) { for (var n of y) if ((t = (0, v.X)(A, n))) break; } t ? t.onUnmount(() => { k(e, i); }) : k(e, i); }; (0, l.useImperativeHandle)(t, () => ({ show: E, hide: P })); var D = (e) => { !T.current && g && (S(e), null == _ || _(e)); }; return (0, o.jsx)( s.Z, (0, r._)( (0, n._)( { className: d()( f.timeoutTooltip, "grey" === b && f.greyTip, c ), popupVisible: x, content: (0, o.jsxs)("div", { className: f.flexBox, children: [ null != M ? M : g, I ? (0, o.jsx)(m.Rnl, { onClick: () => { P(); }, size: 12, className: f.closeIcon, }) : void 0, ], }), showArrow: !0, triggerProps: { popupAlign: { bottom: 4 } }, onVisibleChange: D, }, w ), { children: i } ) ); }); }, 518814: function (e, t, i) { "use strict"; i.d(t, { Z: () => d }); var n = i("625572"), r = i("772322"), a = i("218571"), o = i("188754"), s = i("839141"), l = { container: "container-GNgcRL" }, c = { [s.d.Standard]: { icon: o._VM, iconExpired: o.TrG }, [s.d.Artisan]: { icon: o.PxL, iconExpired: o.q1Y }, [s.d.Maestro]: { icon: o.lbg, iconExpired: o.enG }, }; function d(e) { var { className: t = "", style: i, level: o, inactive: d, enableClick: u = !1, size: f = 20, onClick: h, } = e, p = (0, a.useRef)(!1), v = (0, a.useCallback)( (e) => !!e && [s.d.Standard, s.d.Artisan, s.d.Maestro].includes(e), [] ), m = (0, a.useCallback)(() => { if (!!u) null == h || h(); }, [u, h]), g = (0, a.useCallback)(() => { var e = null; return o && v(o) && (e = d ? c[o].iconExpired : c[o].icon), e; }, [o, d, v]), _ = (0, a.useCallback)(() => { var e = { width: "".concat(f, "px"), height: "".concat(f, "px"), fontSize: "".concat(f, "px"), }; return u && (e.cursor = "pointer"), (0, n._)({}, e, i); }, [f, u, i]), y = (0, a.useCallback)((e) => { if (!p.current) { var t = null == e ? void 0 : e.querySelector("svg"); if (t) { var i = t.querySelectorAll("linearGradient"); i.length > 0 && (i.forEach((e) => { var i = e.getAttribute("id"); if (i) { var n = "" .concat(i, "_") .concat(Math.random().toString(36).substr(2, 9)); e.setAttribute("id", n), t .querySelectorAll('path[fill="url(#'.concat(i, ')"]')) .forEach((e) => { e.setAttribute("fill", "url(#".concat(n, ")")); }); } }), (p.current = !0)); } } }, []), b = g(); return b ? (0, r.jsx)("div", { className: l.container, ref: y, children: (0, r.jsx)(b, { className: t, style: _(), onClick: m }), }) : null; } }, 211580: function (e, t, i) { "use strict"; i.d(t, { w: () => u }); var n = i("772322"), r = i("2910"), a = i("105789"), o = i.n(a), s = { "image-editor-conflict-modal-z-index": "999999", imageEditorConflictModalZIndex: "999999", "box-selection-z-index": "10100", boxSelectionZIndex: "10100", "character-generate-modal-z-index": "1001", characterGenerateModalZIndex: "1001", "commerce-info-tooltip-z-index": "1001", commerceInfoTooltipZIndex: "1001", "boximator-modal-z-index": "1001", boximatorModalZIndex: "1001", "video-container-z-index": "9", videoContainerZIndex: "9", imageSm: "imageSm-vzVlWD", disabled: "disabled-ECQbmc", image: "image-UuNvBV", imageContainer: "imageContainer-KiTN3y", multiImageContainer: "multiImageContainer-oI3NME", lastImageSm: "lastImageSm-SObf2k", firstImageSm: "firstImageSm-J0fZjQ", lastImage: "lastImage-iWibJ0", editable: "editable-oKWxc3", blank: "blank-ZrU_Dr", imageItem: "imageItem-zngq8X", itemText: "itemText-jYHS1_", panelContainer: "panelContainer-lU1QNl", imgContainer: "imgContainer-l7wqhH", btnContainer: "btnContainer-cNaMyt", imgBig: "imgBig-Sqiylo", btnBig: "btnBig-Vw92Q6", btnSm: "btnSm-c3H91P", }, l = i("128468"), c = i("653061"), d = (e) => { var { useRawImg: t, src: i, className: a, loading: l, imageClassName: d, disabled: u, resolutionUrlMap: f, } = e; return t ? (0, n.jsx)("img", { src: (0, r.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), className: o()(s.imageSm, a, { [s.disabled]: u }), style: { width: "20px", height: "20px" }, crossOrigin: "anonymous", }) : (0, n.jsx)(c.k, { src: (0, r.C)(i, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", }), resolutionUrlMap: f, className: o()(s.imageSm, a, { [s.disabled]: u }), imageClassName: o()(s.image, d), style: { width: "20px", height: "20px" }, crossOrigin: "anonymous", loading: l, "data-apm-action": "work-detail-pure-image-prompt-item", }); }, u = (e) => { var { mode: t, coverList: i, disabled: r, loading: a, index: c, name: u, useRawImg: f, } = e, [h] = null != i ? i : [], p = Array.isArray(i) && (null == i ? void 0 : i.length) > 1 ? i[i.length - 1] : void 0; return (0, n.jsxs)("span", { className: o()(s.imageItem, { [s.story]: t === l.JU.Story, [s.multiImageItem]: h && p, }), tabIndex: 0, contentEditable: "false", suppressContentEditableWarning: !0, children: [ (null == h ? void 0 : h.coverUrl) || (null == h ? void 0 : h.coverUrlMap) ? (0, n.jsxs)("div", { className: o()(s.imageContainer, { [s.multiImageContainer]: h && p, }), children: [ (0, n.jsx)(d, { src: h.coverUrl, resolutionUrlMap: h.coverUrlMap, className: o()({ [s.firstImageSm]: p }), loading: a, disabled: r, useRawImg: f, }), (null == p ? void 0 : p.coverUrl) || (null == p ? void 0 : p.coverUrlMap) ? (0, n.jsx)(d, { src: p.coverUrl, resolutionUrlMap: p.coverUrlMap, className: s.lastImageSm, imageClassName: s.lastImage, loading: a, disabled: r, useRawImg: f, }) : null, ], }) : null, (0, n.jsx)("span", { className: o()(s.itemText, { [s.disabled]: r }), children: u, }), ], }); }; }, 863896: function (e, t, i) { "use strict"; i.d(t, { G: function () { return n; }, Q: function () { return r; }, }); var n = 300, r = 6e4; }, 94012: function (e, t, i) { "use strict"; i.d(t, { S: function () { return n; }, }); class n { static getInstance() { return !this._instance && (this._instance = new n()), this._instance; } static makeExploreFavorite(e, t) { var i; null === (i = this._instance) || void 0 === i || i.makeExploreItemFavorite(e, t); } init(e) { this._searchService = e; } setSearchFeedService(e) { this._searchFeedService = e; } makeExploreItemFavorite(e, t) { var i, n; null === (i = this._searchService) || void 0 === i || i.setExploreItemFavorite(e, t), null === (n = this._searchFeedService) || void 0 === n || n.updateVideoLikeStatus(e, t); } } }, 69529: function (e, t, i) { "use strict"; i.d(t, { R: function () { return f; }, z: function () { return u; }, }); var n = i(139646), r = i(761615), a = i(738210), o = i(70529), s = i(166320), l = i(683973), c = i(475578), d = i(388977); function u(e, t) { if (0 === e.length) return !1; for (var i of e) { var n, a, o = null !== (n = null == t ? void 0 : t.getRecord(i.historyRecordId)) && void 0 !== n ? n : i, s = ( null !== (a = i.selectedImageList) && void 0 !== a ? a : [] ).map((e) => e.itemId); if (s.length <= 0 && !(0, r.Mv)({ record: o })) return !1; for (var l of s) if (!(0, r.Mv)({ record: o, imageItemId: l })) return !1; } return !0; } function f(e) { return h.apply(this, arguments); } function h() { return (h = (0, n._)(function* (e) { var { selectedRecords: t, containerService: i, dreaminaAssetsDataService: n, imageAssetsHistoryService: f, contentRecordListManager: h, overwriteSelectedRecords: p, onSuccess: v, } = e, m = null == i ? void 0 : i.invokeFunction((e) => e.get(o.m)), g = t.map((e) => { var t; return { id: e.historyRecordId, type: s.Eu.Image, itemIdList: null === (t = e.selectedImageList) || void 0 === t ? void 0 : t.map((e) => e.itemId), }; }); t.forEach((e) => { var t; null === (t = e.selectedImageList) || void 0 === t || t.forEach((t) => { (0, l.YA)(e, t, c.tz.Collect, m, {}, i); }); }); var _ = !u(t, null == f ? void 0 : f.activeInstance); if ( (yield (0, r.uz)({ containerService: i, service: n, hasFavorited: _, ids: g, onSuccess: () => { null == f || f.setFavorite(g, _), null == v || v(); }, }), p) ) for (var y of t) { var b, I = (0, d.ko)(i, a.u); (0, r.i5)({ curIdItem: { id: y.historyRecordId, type: s.Eu.Image, itemIdList: null === (b = y.selectedImageList) || void 0 === b ? void 0 : b.map((e) => e.itemId), }, storeService: I, record: y, hasFavorited: _, }); } })).apply(this, arguments); } }, 339128: function (e, t, i) { "use strict"; i.d(t, { d$: function () { return s; }, tF: function () { return o; }, }); var n = i(513294), r = i(734696), a = i(586315), o = (function (e) { return ( (e.Init = "Init"), (e.Generating = "Generating"), (e.Success = "Success"), (e.Fail = "Fail"), (e.CanRetry = "CanRetry"), e ); })({}); class s extends r.JT { delete() { return ( this._onDidDelete.fire(), this.dispose(), Promise.resolve((0, a.ly)()) ); } constructor(...e) { super(...e), (this._onDidDelete = this._store.add(new n.Q())), (this.onDidDelete = this._onDidDelete.event), (this._onDidPolling = this._store.add(new n.Q())), (this.onDidPolling = this._onDidPolling.event), (this._onGenerateSuccess = this._store.add(new n.Q())), (this.onGenerateSuccess = this._onGenerateSuccess.event), (this._onGenerateFailure = this._store.add(new n.Q())), (this.onGenerateFailure = this._onGenerateFailure.event), (this._onModelChange = this._store.add(new n.Q())), (this.onModelChange = this._onModelChange.event), (this._onFavoriteChange = this._store.add(new n.Q())), (this.onFavoriteChange = this._onFavoriteChange.event); } } }, 613983: function (e, t, i) { "use strict"; i.d(t, { IU: function () { return r; }, Qp: function () { return a; }, kP: function () { return o; }, pO: function () { return n; }, }); var n = (function (e) { return ( (e[(e.GenerateVideo = 0)] = "GenerateVideo"), (e[(e.LipSync = 1)] = "LipSync"), e ); })({}), r = (function (e) { return ( (e.init = "init"), (e.uploading = "uploading"), (e.complete = "complete"), e ); })({}), a = (function (e) { return (e.lastFrame = "lastFrame"), (e.firstFrame = "firstFrame"), e; })({}), o = (function (e) { return (e.frame = "frame"), (e.custom = "custom"), e; })({}); }, 776913: function (e, t, i) { "use strict"; i.d(t, { Jg: function () { return l; }, UD: function () { return o; }, }); var n = i(625572), r = i(639880), a = i(224671), o = { templateId: "", generateCount: 1, promptSource: a.U_.Custom, templateSource: a.Q8.Default, lastRequestId: "", originRequestId: "", }, s = 1; class l { static getInstance() { return !this._instance && (this._instance = new l()), this._instance; } setPendingResumeReportParam(e, t) { var i = this._getFormatTextToImageGenerateParamJsonStringify(e); (this._lastPendingReportParamKey = i), (this._lastPendingReportParamPrompt = e.prompt), (this._pendingResumeReportParamMap[i] = t); } resumeReportParam(e) { var t = this._getFormatTextToImageGenerateParamJsonStringify(e), i = this._pendingResumeReportParamMap[t], s = this._pendingResumeReportParamMap[ this._lastPendingReportParamKey ], l = (null == s ? void 0 : s.promptSource) === a.U_.Template, c = this._resumeGenerateCount(e); return i ? (0, r._)((0, n._)({}, i), { generateCount: c }) : l ? (0, r._)((0, n._)({}, s), { promptSource: a.U_.TemplateEdit, templatePrompt: this._lastPendingReportParamPrompt, }) : (this._resetReportParam(t), o); } _resetReportParam(e) { (this._pendingResumeReportParamMap = {}), (this._pendingResumeReportParamMap[e] = o), (this._lastPendingReportParamKey = ""), (this._lastPendingReportParamPrompt = ""); } _getFormatTextToImageGenerateParamJsonStringify(e) { var { prompt: t, model: i, sampleStrength: n, imageRatio: r, negativePrompt: a, } = e, o = { prompt: t, model: i, sampleStrength: n, imageRatio: r, negativePrompt: a, }; try { return JSON.stringify(o); } catch (e) { return ""; } } _resumeGenerateCount(e) { var t = this._getFormatTextToImageGenerateParamJsonStringify(e), i = this._generateCountMap[t]; if (!i) return ( (this._generateCountMap = {}), (this._generateCountMap[t] = s), s ); var n = i + 1; return (this._generateCountMap[t] = n), n; } constructor() { (this._pendingResumeReportParamMap = {}), (this._generateCountMap = {}), (this._lastPendingReportParamKey = ""), (this._lastPendingReportParamPrompt = ""); } } }, 13523: function (e, t, i) { "use strict"; i.d(t, { F: function () { return n; }, }); var n = (function (e) { return ( (e[(e.Updated = 0)] = "Updated"), (e[(e.NotUpdated = 1)] = "NotUpdated"), (e[(e.NoAvailableModel = 2)] = "NoAvailableModel"), e ); })({}); }, 121365: function (e, t, i) { "use strict"; i.d(t, { KY: function () { return c; }, Ne: function () { return a; }, T7: function () { return d; }, X1: function () { return r; }, au: function () { return o; }, q5: function () { return s; }, th: function () { return l; }, }); var n = i(314068); function r(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : n.D1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.vS; return Math.min(Math.max(e, i), t); } function a(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.D1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.vS, o = e, s = e / t; return ( s > i ? (o = (s = i) * t) : s < a && (o = (s = a) * t), { width: r(Math.floor(o), i, a), height: r(Math.floor(s), i, a) } ); } function o(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.D1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.vS, o = e, s = e * t; return ( s > i ? (o = (s = i) / t) : s < n.vS && (o = (s = a) / t), { width: r(Math.floor(s), i, a), height: r(Math.floor(o), i, a) } ); } function s(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : n.D1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.vS; return e >= i && e <= t; } function l(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.D1, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.vS; if (!e || !t) return n.jg; var s = e / t; return e > t ? a(Math.min(e, i), s, i, r) : o(Math.min(t, i), s, i, r); } function c(e, t) { var i = e / t; return e > t ? { width: n.D1, height: Math.round(n.D1 / i) } : { width: Math.round(n.D1 * i), height: n.D1 }; } function d(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : n.vS, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.D1, a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : n.U7, o = e / t, s = Math.min( Math.floor(Math.floor(Math.sqrt(a / o)) * o), Math.floor(r * o), r ), l = Math.floor(s / o); return ( l > r && (s = Math.floor((l = r) * o)), s < i && ((s = i), (l = Math.floor(i / o))), s < i ? (s = i) : s > r ? (s = r) : l < i ? (l = i) : l > r && (l = r), { width: s, height: l } ); } }, 486965: function (e, t, i) { "use strict"; i.d(t, { E: function () { return o; }, h: function () { return s; }, }); var n = i(314068), r = i(665498), a = i(591586), o = (e, t) => { if (!(null == e ? void 0 : e.resolutionMap) || !t) return ( a.t.log( "getModelRatioSizeMap: \u6CA1\u6709\u9009\u62E9\u6A21\u578B\u6216\u5206\u8FA8\u7387\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u6620\u5C04" ), n.BN ); var i = e.resolutionMap[t]; return (null == i ? void 0 : i.imageRatioSizes) ? i.imageRatioSizes.reduce((e, t) => { var i = r.E7[t.ratioType]; return ( i && t.width && t.height && (e[i] = { width: t.width, height: t.height }), e ); }, {}) : (a.t.log( "getModelRatioSizeMap: \u6307\u5B9A\u5206\u8FA8\u7387\u7684\u914D\u7F6E\u4E0D\u5B58\u5728\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u6620\u5C04" ), n.BN); }, s = (e, t) => { var i = { minLength: n.vS, maxLength: n.D1, maxPixelNum: n.U7 }; if (!t || !e) return i; var r = t[e]; if (!(null == r ? void 0 : r.imageRangeConfig)) return i; var { minLength: a, maxLength: o, maxPixelNum: s, } = r.imageRangeConfig; return { minLength: a, maxLength: o, maxPixelNum: s }; }; }, 708171: function (e, t, i) { "use strict"; i.d(t, { E: function () { return o; }, Y: function () { return a; }, }); var n = i(891602), r = i(224671); function a(e) { return (t) => (0, n.ox)(t, e); } var o = (e) => { var t, i = Object.keys( null !== (t = null == e ? void 0 : e.resolutionMap) && void 0 !== t ? t : {} ); return 0 === i.length ? r.YD.ImageResolutionType_1k : i[0]; }; }, 964917: function (e, t, i) { "use strict"; i.d(t, { m: () => D }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("789786"), s = i("734696"), l = i("586315"), c = i("260963"), d = i("128468"), u = i("243302"), f = i("166320"), h = i("675601"), p = i("257843"), v = i("434712"), m = i("442052"), g = i("285993"), _ = i("741310"), y = i("761615"), b = i("379311"); class I { getEventParams() { var { result: e, mode: t, duration: i, action: n } = this._params; return { duration: i, action: n, status: e.ok ? "success" : "fail", code: "".concat(e.code), msg: e.msg, mode: t, }; } constructor(e) { (this._params = e), (this.eventName = "perf_ai_video_history"); } } function w(e, t) { (0, b.US)(e, I, [t]); } var x = i("800088"), S = i("869409"), M = i("224671"), C = i("831452"), T = i("182688"), A = i("54061"); class k extends s.JT { get isInitialized() { return this._initialized; } get isLoading() { return !!this._loadMorePromise; } get feedsTask() { return this._tempData.feedsTask; } get feedsData() { return this._tempData.feedsData; } insertTask(e) { return ( this._lastPageFeedsData.length > 0 && ((this._observableData.feedsData = this._lastPageFeedsData), (this._lastPageFeedsData = [])), (this._observableData.feedsData = this._observableData.feedsData.concat(e)), !0 ); } hardResetGeneratedList(e) { this._observableData.feedsData = e; } initFeedsData() { var e = this; return (0, n._)(function* () { return e.isInitialized ? (0, l.ly)() : yield e.loadMoreFeedsData(); })(); } hasMoreData(e) { return e === u.KB.PageUp ? !this._isFeedsDataUpPageFetchEnd : e === u.KB.PageDown ? !this._isFeedsDataBottomPageFetchEnd : !this._isFeedsDataUpPageFetchEnd || !this._isFeedsDataBottomPageFetchEnd; } loadMoreFeedsData() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : u.KB.PageUp, t = arguments.length > 1 ? arguments[1] : void 0, i = this; return (0, n._)(function* () { if (!i.hasMoreData(e)) return (0, l.ly)(); if (i._option.mode === d.JU.Story && !t) return (i._initialized = !0), (0, l.ly)(); if (i._loadMorePromise) { var n = yield i._loadMorePromise; return n.ok ? (0, l.ly)() : (0, l.wf)(n.code, n.msg); } var r = e === u.KB.PageUp ? i._observableData.feedsData[0] : i._observableData.feedsData[ i._observableData.feedsData.length - 1 ], a = null == r ? void 0 : r.taskData.inputParams.createdTime; i._loadMorePromise = i._dataService .fetchTaskList({ offset: null != a ? a : 0, count: i._pageCount, direction: e, mode: i._option.mode, historyOption: { storyId: t }, option: { orderBy: S.Q.CreateAt, onlyFavorited: i._option.onlyFavorited, }, }) .finally(() => { i._loadMorePromise = void 0; }); var o = Date.now(), s = yield i._loadMorePromise; if ( (w(i._containerService, { duration: Date.now() - o, action: a ? "pull" : "init", result: s, mode: i._option.mode, }), !s.ok) ) return (0, l.wf)(s.code, s.msg); (i._initialized = !0), i._updateIsContentListFetchEnd(e, !s.value.hasMore); var c = i._formatServerDataToTask(s.value.data); return ( (i._observableData.feedsData = e === u.KB.PageUp ? (0, C.Z)( c.reverse().concat(i._observableData.feedsData), "id" ) : (0, C.Z)( i._observableData.feedsData.concat(c.reverse()), "id" )), (0, l.ly)() ); })(); } getHistoryRecord(e) { var t = this; return (0, n._)(function* () { var i = t._observableData.feedsData.find((t) => t.id === e); if (i) return (0, l.oW)(i.taskData); var n = yield t._dataService.locateTask({ historyRecordId: e, preCount: 0, nextCount: t._pageCount, type: M.q.Text2Video, mode: d.JU.Workbench, }); if (!n.ok) return n; var r = n.value.data.find((t) => t.historyRecordId === e); return r ? (0, l.oW)(t._formatServerDataToTask([r])[0].taskData) : (0, l.wf)(-1, "history record not found"); })(); } locateHistory(e, t) { var i = this; return (0, n._)(function* () { if ( (i._loadMorePromise && (yield i._loadMorePromise), i._lastPageFeedsData.some((t) => t.id === e)) ) return i._syncLastPageDataToFeedsData(), (0, l.ly)(); i._loadMorePromise = i._dataService .locateTask({ historyRecordId: e, preCount: i._pageCount, nextCount: i._pageCount, type: M.q.Text2Video, mode: i._option.mode, historyOption: { storyId: t }, }) .finally(() => { i._loadMorePromise = void 0; }); var n = yield i._loadMorePromise; if (!n.ok) return (0, l.wf)(n.code, n.msg); var r = new Set(), a = []; for (var o of n.value.data) { if (!r.has(o.historyRecordId)) { if ( (r.add(o.historyRecordId), a.push(o), a.length > i._pageCount) ) break; } } i._refreshLastPageFeedsData(), i._updateIsContentListFetchEnd(u.KB.PageDown, !1), i._updateIsContentListFetchEnd(u.KB.PageUp, !1); var s = i._formatServerDataToTask(a); return (i._observableData.feedsData = s.reverse()), (0, l.ly)(); })(); } deleteData(e) { var t = this._observableData.feedsData.findIndex((t) => t.id === e); if (!(t < 0)) this._observableData.feedsData.splice(t, 1), (this._observableData.feedsData = [ ...this._observableData.feedsData, ]); } markPublish(e, t) { var i = this._observableData.feedsData.findIndex((t) => { var i, n, r, a; if (t.taskData.generateType && (0, T.sk)(t.taskData.generateType)) return ( (null === (n = t.observableData.data.videoDetail) || void 0 === n ? void 0 : n.aigcItemId) === e || (null === (a = t.taskData.videoDetail) || void 0 === a ? void 0 : null === (r = a.audioList) || void 0 === r ? void 0 : r.some((t) => { var { mixAudioVideo: i } = t; return (null == i ? void 0 : i.itemId) === e; })) ); return ( (null === (i = t.observableData.data.videoDetail) || void 0 === i ? void 0 : i.aigcItemId) === e ); }), n = this._observableData.feedsData[i]; n && n.markPublished(t); } markFavorite(e) { var t = !(arguments.length > 1) || void 0 === arguments[1] || arguments[1], i = {}, n = () => { (0, c.z)(() => { this._observableData.feedsData.map( (e) => ( void 0 !== i[e.taskData.id] && e.markFavorite(i[e.taskData.id]), e ) ); }); }, r = new Set(e.map((e) => e.id)); return ( this._observableData.feedsData.map( (e) => ( r.has(e.taskData.id) && ((i[e.taskData.id] = !!e.taskData.hasFavorited), e.markFavorite(t), r.delete(e.taskData.id)), e ) ), r.size > 0 && t && (e .filter((e) => r.has(e.taskData.id)) .forEach((e) => { var t, n, a = null !== (n = null === (t = this._observableData.feedsData[0]) || void 0 === t ? void 0 : t.taskData.inputParams.createdTime) && void 0 !== n ? n : 1 / 0; e.taskData.inputParams.createdTime >= a && ((i[e.taskData.id] = !!e.taskData.hasFavorited), this._observableData.feedsData.push(e), r.delete(e.taskData.id)); }), this._observableData.feedsData.sort( (e, t) => e.taskData.inputParams.createdTime - t.taskData.inputParams.createdTime ), r.size > 0 && this._updateIsContentListFetchEnd(u.KB.PageUp, !1)), { onError: () => n(), onSuccess: (e) => { e.forEach((e) => delete i[e]), n(), this.feedsData.length < 5 && this.loadMoreFeedsData(); }, } ); } _formatServerDataToTask(e) { var t = []; for (var i of e) try { var n = this._containerService.createInstance(x.U, { logger: this._logger, serviceData: i, option: this._option, }); t.push(n); } catch (e) { this._logger.error( "generate task instance fail, taskId: ".concat(i.task.taskId) ); } return t; } _refreshLastPageFeedsData() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : -this._pageCount, t = this._observableData.feedsData.slice(e); this._lastPageFeedsData = t; } _syncLastPageDataToFeedsData() { return ( !!this._lastPageFeedsData.length && ((this._observableData.feedsData = this._lastPageFeedsData), (this._lastPageFeedsData = []), this._updateIsContentListFetchEnd(u.KB.PageDown, !0), this._updateIsContentListFetchEnd(u.KB.PageUp, !1), !0) ); } _updateIsContentListFetchEnd(e, t) { e === u.KB.PageDown ? (this._isFeedsDataBottomPageFetchEnd = t) : (this._isFeedsDataUpPageFetchEnd = t); } constructor(e, t, i, n) { super(), (this._option = e), (this._loggerService = t), (this._containerService = i), (this._dataService = n), (this._pageCount = 10), (this._initialized = !1), (this._lastPageFeedsData = []), (this._isFeedsDataUpPageFetchEnd = !1), (this._isFeedsDataBottomPageFetchEnd = !0), (this._observableData = (0, c.LO)({ feedsData: [] })), (this._tempData = (0, c.LO)({ feedsData: [], feedsTask: [] })), (this._logger = this._loggerService.createLogger( "ai-video-store-instance-".concat( this._option.onlyFavorited ? "favorite" : "all" ) )), (0, c.U5)( () => this._observableData.feedsData .filter((e) => { var { taskData: t } = e; return !this._option.onlyFavorited || t.hasFavorited; }) .map((e) => e.taskData), (e) => { (0, c.z)(() => { this._tempData.feedsData = e; }); } ), (0, c.U5)( () => this._observableData.feedsData.filter((e) => { var { taskData: t } = e; return !this._option.onlyFavorited || t.hasFavorited; }), (e) => { (0, c.z)(() => { this._tempData.feedsTask = e; }); } ); } } (0, o.gn)( [ c.aD.bound, (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", []), (0, o.w6)("design:returntype", void 0), ], k.prototype, "_syncLastPageDataToFeedsData", null ), (k = (0, o.gn)( [ (0, o.fM)(1, A.VZ), (0, o.fM)(2, v.t), (0, o.fM)(3, h.g), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof GenerateVideoFeedsInstanceOptions ? Object : GenerateVideoFeedsInstanceOptions, void 0 === A.VZ ? Object : A.VZ, void 0 === v.t ? Object : v.t, void 0 === h.g ? Object : h.g, ]), ], k )); var P = i("351066"), E = i("586961"); class D extends s.JT { static markPublished(e, t) { if (!!this._instance) this._instance.markPublished(e, t); } insertTask(e) { if (this._option.mode === d.JU.Workbench) { var t = this; return ( (function () { var i = (0, n._)(function* () { if ( t._option.mode === d.JU.Workbench && e.taskData.historyGroupKeyMd5 ) { t._option.onRecordCreated(e); return; } var i = yield (0, E.m4)({ containerService: t._containerService, submitId: e.submitId, type: "video", }); if (i.ok && t._option.mode === d.JU.Workbench) { var n, { historyGroupKeyMd5: r } = i.value, a = null !== (n = t.getHistoryGroupKeyMd5FromExistedTask(e)) && void 0 !== n ? n : r; e.updateHistoryGroupKeyMd5(a), t._option.onRecordCreated(e); } }); return function () { return i.apply(this, arguments); }; })()(), !0 ); } return ( this.onlyFavorited && this.updateOnlyFavorited(!1), this.activeInstance.insertTask(e), !0 ); } getHistoryGroupKeyMd5FromExistedTask(e) { var t, i; return null === (i = this._allInstance.feedsTask.find((t) => this.checkInputIsSame(t, e) )) || void 0 === i ? void 0 : null === (t = i.taskData) || void 0 === t ? void 0 : t.historyGroupKeyMd5; } checkInputIsSame(e, t) { var i, { inputParams: n } = t.taskData, { inputParams: r } = e.taskData; return ( !!( (null === (i = n.inputImages) || void 0 === i ? void 0 : i.length) && n.inputImages.every((e, t) => { var i, n; return ( e.imageUri === (null === (n = r.inputImages) || void 0 === n ? void 0 : null === (i = n[t]) || void 0 === i ? void 0 : i.imageUri) ); }) ) || (!!n.textPrompt && n.textPrompt === r.textPrompt) || !1 ); } hardResetGeneratedList(e) { var { allTasks: t, favorTasks: i } = e; this._allInstance.hardResetGeneratedList(t), this._favorInstance.hardResetGeneratedList(i); } get activeInstance() { return this._observableData.onlyFavorited ? this._favorInstance : this._allInstance; } get isLoading() { return this.activeInstance.isLoading; } get feedsTask() { return this.activeInstance.feedsTask; } get feedsData() { return this.activeInstance.feedsData; } get generatingFeedsTask() { return this.activeInstance.feedsTask.filter((e) => [P.C.INIT, P.C.LOADING].includes(e.taskData.status) ); } get highlightHistoryId() { return this._observableData.highlightHistoryId; } get onlyFavorited() { return this._observableData.onlyFavorited; } get isInitialized() { return this._initialized || this.activeInstance.isInitialized; } initFeedsData() { var e = this; return (0, n._)(function* () { return e.isInitialized ? (0, l.ly)() : yield e.loadMoreFeedsData(); })(); } hasMoreData(e) { return this.activeInstance.hasMoreData(e); } updateHighlightHistoryId(e) { this._observableData.highlightHistoryId = e; } updateOnlyFavorited(e) { this._observableData.onlyFavorited = e; } loadMoreFeedsData() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : u.KB.PageUp; return this.activeInstance.loadMoreFeedsData(e, this._storyId); } getHistoryRecord(e) { return this.activeInstance.getHistoryRecord(e); } locateHistory(e) { return ( this.onlyFavorited && this.updateOnlyFavorited(!1), this._allInstance.locateHistory(e, this._storyId) ); } deleteData(e) { var t = !(arguments.length > 1) || void 0 === arguments[1] || arguments[1], i = this; return (0, n._)(function* () { if (t) { var n = i.activeInstance.feedsTask.findIndex((t) => t.id === e), r = i.feedsData[n]; if ( ![P.C.FAIL, P.C.SUCCESS, P.C.RETRYABLE_FAIL].includes( r.status ) || !r.taskDetail ) return (0, l.wf)( -1, "can not delete not final status task', " .concat(e, ", ") .concat(i.feedsData[n]) ); var a = yield i._dataService.deleteTask({ idList: [String(r.taskDetail.historyId)], }); if (!a.ok) return (0, l.wf)(a.code, a.msg); } return i._option.mode === d.JU.Workbench ? (i._option.onTaskRemove(e), (0, l.ly)()) : (i._allInstance.deleteData(e), i._favorInstance.deleteData(e), (0, l.ly)()); })(); } markFavorite(e) { var t = !(arguments.length > 1) || void 0 === arguments[1] || arguments[1], i = !(arguments.length > 2) || void 0 === arguments[2] || arguments[2], n = this.feedsTask.filter((t) => e.includes(t.id)), r = [ this._allInstance.markFavorite(n, t), this._favorInstance.markFavorite(n, t), ]; if (!!i) (0, y.uz)({ containerService: this._containerService, service: this._assetsDataService, ids: e.map((e) => ({ id: e, type: f.Eu.Video })), hasFavorited: t, onSuccess: (e) => { r.forEach((t) => t.onSuccess(e)); }, onError: () => { r.forEach((e) => e.onError()); }, }); } markPublished(e, t) { this._allInstance.markPublish(e, t), this._favorInstance.markPublish(e, t); } feedbackTask(e) { var t = this; return (0, n._)(function* () { var { id: i, feedbackType: n, reasonKeyList: r = [], reasonDescList: a = [], } = e, o = yield t._dataService.feedbackTask({ historyRecordId: i, feedBackType: n, }); return ( ((null == a ? void 0 : a.length) || (null == r ? void 0 : r.length)) && (yield (0, _.fK)({ localItemId: i, reasonDescList: a, reasonKeyList: r, })), o ); })(); } syncDataFromServer(e) { var t = this; return (0, n._)(function* () { var i = t.activeInstance.feedsTask.find( (t) => t.taskData.taskId === e ); if (!!i) return yield i.forceUpdateTask(); })(); } findTaskByHistoryId(e) { return this.activeInstance.feedsTask.find((t) => t.id === e); } findTaskById(e) { return this.activeInstance.feedsTask.find( (t) => t.taskData.taskId === e ); } updateDefaultAudio(e, t) { var i, n = this.findTaskById(e); if ( !!(null == n ? void 0 : null === (i = n.taskData.videoDetail) || void 0 === i ? void 0 : i.aigcItemId) && !!t.vid ) { var r = { videoItemId: n.taskData.videoDetail.aigcItemId, bgmVid: t.vid, }; n instanceof m.A && (n.updateDefaultBgm(t), this._dataService.updateVideoDefaultBGM(r)), n instanceof g.q && (n.updateDefault(t), this._dataService.updateVideoDefaultAudioEffect(r)); } } constructor(e, t, i, n) { if ( (super(), (this._dataService = t), (this._assetsDataService = i), (this._containerService = n), (this._initialized = !1), (this._observableData = (0, c.LO)({ highlightHistoryId: "", onlyFavorited: !1, })), (this._option = e), (this._allInstance = this._containerService.createInstance(k, e)), (this._favorInstance = this._containerService.createInstance( k, (0, a._)((0, r._)({}, e), { onlyFavorited: !0 }) )), this._option.mode === d.JU.Story) ) { var o = this._option.getStoryId(); o ? ((this._storyId = o), this.initFeedsData()) : (this._register( this._option.messageCenterAdapter.event.onCommitAccess(() => { var e; this._storyId = null !== (e = this._option.getStoryId()) && void 0 !== e ? e : ""; }) ), (this._initialized = !0)); } D._instance = this; } } (D._instance = void 0), (0, o.gn)( [ c.aD, (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [Boolean]), (0, o.w6)("design:returntype", void 0), ], D.prototype, "updateOnlyFavorited", null ), (D = (0, o.gn)( [ (0, o.fM)(1, h.g), (0, o.fM)(2, p.K), (0, o.fM)(3, v.t), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof GenerateVideoFeedsManagerOption ? Object : GenerateVideoFeedsManagerOption, void 0 === h.g ? Object : h.g, void 0 === p.K ? Object : p.K, void 0 === v.t ? Object : v.t, ]), ], D )); }, 761615: function (e, t, i) { "use strict"; i.d(t, { Gd: function () { return x; }, Mv: function () { return w; }, i5: function () { return m; }, od: function () { return I; }, py: function () { return y; }, uz: function () { return g; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(586961), s = i(388977), l = i(369617), c = i(738210), d = i(938678), u = i(229025), f = i(166320), h = i(949274), p = i(260963), v = "favorite_toast_id", m = (e) => { var { curIdItem: t, record: i, hasFavorited: n, storeService: r } = e; if (!!i) { if ( (null === (a = t.itemIdList) || void 0 === a ? void 0 : a.length) && (0, o.ZS)(i) && (0, u.FO)(i) ) { var a, s, l, c = [ ...(null !== (l = null === (s = i.assetOption) || void 0 === s ? void 0 : s.favoriteItemIdList) && void 0 !== l ? l : []), ]; t.itemIdList.forEach((e) => { var t = c.indexOf(e); n ? -1 === t && c.push(e) : -1 !== t && c.splice(t, 1); }), (0, p.z)(() => { i.assetOption ? ((i.assetOption.hasFavorited = !!c.length), (i.assetOption.favoriteItemIdList = c)) : (i.assetOption = { hasFavorited: !!c.length, favoriteItemIdList: c, }); }); } else (0, p.z)(() => { i.assetOption ? (i.assetOption.hasFavorited = n) : (i.assetOption = { hasFavorited: n }); }); if ((0, o.cU)(i)) { var d = r.getVideoTaskById(i.id); null == d || d.markFavorite(n); } if ((0, o.z2)(i)) { var f = r.getAudioTaskById(i.id); null == f || f.markFavorite(n); } } }; function g(e) { return _.apply(this, arguments); } function _() { return (_ = (0, n._)(function* (e) { var { service: t, containerService: i, ids: n, hasFavorited: r, onSuccess: a, onError: o, } = e, d = (0, s.ko)(i, c.u), u = r ? h.ZP.t( "assets_toast_favourite_success", {}, "Added to Favorites" ) : h.ZP.t( "assets_toast_unfavourite_success", {}, "Removed from Favorites" ), p = r ? h.ZP.t( "assets_toast_favourite_fail", {}, "Couldn\u2019t add to Favorites. Try again later." ) : h.ZP.t( "assets_toast_unfavourite_fail", {}, "Couldn\u2019t remove from Favorites. Try again later." ), g = !1, _ = []; try { var y, b = yield t.markFavorite({ ids: n, favoriteOp: r ? f.ie.FavoriteOpLike : f.ie.FavoriteOpUnLike, }), I = b.ok && b.value.every( (e) => (null == e ? void 0 : e.status) && [f.o$.Failed, f.o$.InvalidAsset].includes(e.status) ); b.ok && (null === (y = b.value) || void 0 === y ? void 0 : y.length) && !I ? (b.value.forEach((e) => { var { id: t, status: i } = e; i === f.o$.Success && (_.push(String(t)), l.s.success({ id: v, content: u })); }), (g = _.length > 0)) : (null == o || o(), l.s.error({ id: v, content: p })); } catch (e) { null == o || o(), l.s.error({ id: v, content: p }); } if (g) { for (var w of n) { if (!!w.id && !!_.includes(w.id)) { var x = d.getUnifiedRecordById(w.id); m({ curIdItem: w, storeService: d, record: x, hasFavorited: r, }); } } null == a || a(_); } else null == o || o(), l.s.error({ id: v, content: p }); })).apply(this, arguments); } function y(e) { var { ids: t, recordList: i, hasFavorited: n } = e, o = []; if (!t.length || !i.length) return { hasChanged: !1, resRecordList: i, markedRecordList: o }; var s = [...t]; return { hasChanged: !0, resRecordList: i.map((e) => { var t = s.findIndex((t) => t.id === e.historyRecordId); if (-1 === t) return e; var i = s.splice(t, 1)[0], l = (0, d.I)(e); if ( (null === (c = i.itemIdList) || void 0 === c ? void 0 : c.length) && (0, u.FO)(l) ) { var c, f, h, p, v = [ ...(null !== (p = null === (h = l.assetOption) || void 0 === h ? void 0 : h.favoriteItemIdList) && void 0 !== p ? p : []), ]; i.itemIdList.forEach((e) => { var t = v.indexOf(e); n ? -1 === t && v.push(e) : -1 !== t && v.splice(t, 1); }), (f = { hasFavorited: !!v.length, favoriteItemIdList: v }); } else f = { hasFavorited: n }; var m = (0, a._)((0, r._)({}, l), { assetOption: (0, r._)({}, l.assetOption, f), }); return o.push(m), m; }), markedRecordList: o, }; } var b = (e) => { var t; return null === (t = e.assetOption) || void 0 === t ? void 0 : t.hasFavorited; }; function I(e) { return e.recordList.filter((e) => b(e)); } function w(e) { var { record: t, imageItemId: i = "" } = e; if ( !(null === (n = t.assetOption) || void 0 === n ? void 0 : n.hasFavorited) ) return !1; if ((0, o.ZS)(t) && i) { var n, r, a, s, l, c, d = t; if ( null == d ? void 0 : null === (s = d.assetOption) || void 0 === s ? void 0 : null === (a = s.favoriteItemIdList) || void 0 === a ? void 0 : a.includes(i) ) return !0; if ( null == d ? void 0 : null === (c = d.assetOption) || void 0 === c ? void 0 : null === (l = c.favoriteItemIdList) || void 0 === l ? void 0 : l.length ) return !1; } return !!(null === (r = t.assetOption) || void 0 === r ? void 0 : r.hasFavorited); } function x(e, t) { return e.map((e) => { var { record: i, itemIdList: n = [] } = e; return (0, u.FO)(i) ? { id: i.historyRecordId, type: t, itemIdList: [...n] } : { id: i.historyRecordId, type: t }; }); } }, 39333: function (e, t, i) { "use strict"; i.d(t, { K: function () { return d; }, }); var n = i(789786), r = i(586961), a = i(923401), o = i(19658), s = i(869919), l = i(733787), c = "dreamina_ailab_generate_video_model_v1.2"; class d { getIsEnableToUseDraftGen(e, t) { return ( (null == t ? void 0 : t.input.modelReqKey) !== c && ((null == t ? void 0 : t.scene) === s.eA.VideoTemplate || this._configurationService.abTestManager.getBooleanAbTestValue( a.$s.videoDraftGen )) ); } getIsEnableToUseDraftPolling(e, t) { return ( (null == e ? !!void 0 : !!e.isUseDraftGen) || this.getIsEnableToUseDraftGen(e, t) ); } getIsAppLipSyncEnabledToPostEdit(e) { var { processFlows: t, isUseDraftGen: i } = null != e ? e : {}, n = null == t ? void 0 : t.map((e) => e.curProcessFlows).flat(); return ( !( i && (null == n ? void 0 : n.some((e) => [ l.v8.LipSync, l.v8.LipSyncImage, l.v8.LipSyncUserVideo, ].includes(e) )) ) || this.getIsEnableToUseDraftGen(e) ); } getIsActionCopyTaskEnabledToPostEdit(e) { return !(0, r.sG)(e) || this.getIsEnableToUseDraftGen(); } constructor(e) { this._configurationService = e; } } d = (0, n.gn)( [ (0, n.fM)(0, o.S), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [void 0 === o.S ? Object : o.S]), ], d ); }, 652660: function (e, t, i) { "use strict"; i.d(t, { Q: function () { return u; }, }); var n = i(789786), r = i(331480), a = i(317825), o = i(734696), s = i(509525), l = i(586315), c = i(57083), d = "WebsocketPollingManager"; class u extends o.JT { startListening(e) { this._pollingContext = e; var { methodId: t, signal: i } = this._config; if (null == i ? void 0 : i.aborted) { (0, a.xD)(this._pollingContext, a.cl.bool("signal.aborted", !0)); return; } if ( (null == i || i.addEventListener("abort", this._handleAbort), this._websocketService.state !== r.D8.OPEN) ) { this._fallbackToPolling("websocket state is not open"); return; } return ( (this._closeHandlerDisposable = this._websocketService.onClose( this._handleWebsocketClose )), this._setFallbackTimer(), (this._messageHandlerDisposable = this._websocketService.registerEventHandler( t, this._handleWebsocketMessage.bind(this, e) )), this._taskBarrier.wait() ); } dispose() { this._clearFallbackTimer(), this._disposeWebsocketHandlers(), this._taskBarrier.open(), super.dispose(); } _handleWebsocketMessage(e, t) { if (!this._hasFallbacked) { var { accepted: i, done: n } = this._config.websocketMessageHandler( e, t ); if (n) { (0, a.xD)(e, a.cl.bool("done", !0)), this._clearFallbackTimer(), this._disposeWebsocketHandlers(), this._taskBarrier.open(); return; } i && ((0, a.xD)(e, a.cl.bool("accepted", !0)), this._clearFallbackTimer(), this._setFallbackTimer()); } } _setFallbackTimer() { this._timeout = window.setTimeout( this._handleTimeout, this._config.timeout ); } _clearFallbackTimer() { clearTimeout(this._timeout); } _fallbackToPolling(e) { (0, a.xD)(this._pollingContext, a.cl.string("fallbackToPolling", e)); var { onFallbackToPolling: t, pollingHandler: i } = this._config; (this._hasFallbacked = !0), this._disposeWebsocketHandlers(); var n = (0, s.Tg)(); i(n), (0, a.a2)(n, this._pollingContext), null == t || t(e); } _disposeWebsocketHandlers() { var e, t; null === (e = this._closeHandlerDisposable) || void 0 === e || e.dispose(), null === (t = this._messageHandlerDisposable) || void 0 === t || t.dispose(); } constructor(e, t) { super(), (this._config = e), (this._websocketService = t), (this._hasFallbacked = !1), (this._pollingContext = null), (this._taskBarrier = new c.U()), (this._handleWebsocketClose = () => { this._taskBarrier.open(), this._clearFallbackTimer(), this._fallbackToPolling("websocket closed"); }), (this._handleAbort = () => { var { signal: e } = this._config; null == e || e.removeEventListener("abort", this._handleAbort), this._pollingContext && (0, a.uf)( this._pollingContext, (0, l.wf)(1e3, "signal aborted") ), this._disposeWebsocketHandlers(), this._clearFallbackTimer(), this._taskBarrier.open(); }), (this._handleTimeout = () => { this._pollingContext && (0, a.uf)(this._pollingContext, (0, l.wf)(1001, "timeout")), this._clearFallbackTimer(), this._fallbackToPolling("timeout"), this._taskBarrier.open(); }); } } (0, n.gn)( [ (0, a.lI)(d, "startListening"), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, ]), (0, n.w6)("design:returntype", void 0), ], u.prototype, "startListening", null ), (0, n.gn)( [ (0, a.lI)(d, "handleWebsocketMessage"), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof WebsocketMessageMap ? Object : WebsocketMessageMap, ]), (0, n.w6)("design:returntype", void 0), ], u.prototype, "_handleWebsocketMessage", null ), (u = (0, n.gn)( [ (0, n.fM)(1, r.Dx), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof WebsocketPollingConfig ? Object : WebsocketPollingConfig, void 0 === r.Dx ? Object : r.Dx, ]), ], u )); }, 766663: function (e, t, i) { "use strict"; i.d(t, { hk: function () { return n; }, j6: function () { return r; }, }); var n = (function (e) { return ( (e.GenerateSong = "generate_song"), (e.GenerateBackgroundMusic = "generate_background_music"), (e.GenerateInstrumental = "generate_instrumental"), e ); })({}), r = (function (e) { return ( (e.Text = "text"), (e.Paragraph = "paragraph"), (e.LyricsTag = "lyrics_tag"), e ); })({}); }, 127364: function (e, t, i) { "use strict"; i.d(t, { e: function () { return n; }, }); var n = (function (e) { return ( (e.AIGCModeWorkbench = "workbench"), (e.AIGCModeCanvas = "canvas"), (e.AIGCModeStory = "story"), (e.AIGCModeCharacter = "character"), (e.AIGCModeAIGCDraft = "aigc_draft"), (e.AIGCModeAIAgent = "ai_agent"), e ); })({}); }, 906193: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return a; }, }); var n = i(417281); class r { getEventParams() { return this._params; } markPreProcessFinish() { return ( (this._params.perf_pre_process_cost = Date.now() - this._clickGenerateTime), this ); } markGenerateFinish() { return ( (this._params.perf_total_cost = Date.now() - this._clickGenerateTime), this ); } setServerTotalCost(e) { return (this._params.perf_server_total_cost = e), this; } setBlendRefImageTypes(e) { try { if ("blendParams" in e) { var { blendParams: t } = e; if (t && "imagePromptList" in t) { var i, { imagePromptList: r } = t; this._params.blend_ref_types = null !== (i = null == r ? void 0 : r .map((e) => { if (e.name !== n.UI.ControlNet) return e.name; if ("controlNetList" in e) { var t, i; return null !== (i = null === (t = e.controlNetList) || void 0 === t ? void 0 : t.map((e) => e.name).join(",")) && void 0 !== i ? i : ""; } }) .join(",")) && void 0 !== i ? i : void 0; } } } catch (e) {} return this; } setClickGenerateTime(e) { return (this._clickGenerateTime = e), this; } mergeParams(e) { return Object.assign(this._params, e), this; } constructor(e, t) { (this.id = e), (this._params = t), (this.eventName = "perf_ai_image_generate_status"), (this._clickGenerateTime = 0); } } class a { static createReporter(e) { if (this._reporterList.has(e)) return this._reporterList.get(e); var t = new r(e, { perf_server_total_cost: 0, perf_pre_process_cost: 0, perf_total_cost: 0, perf_unit_id: e, }); return this._reporterList.set(e, t), t; } static getReporter(e) { return this._reporterList.get(e); } static removeReporter(e) { this._reporterList.delete(e); } } a._reporterList = new Map(); }, 67752: function (e, t, i) { "use strict"; i.d(t, { i: function () { return c; }, }); var n = i(625572), r = i(789786), a = i(379311), o = i(434712), s = i(76931); class l { getEventParams() { return (0, n._)({}, this._params, (0, s.Oj)(this._containerService)); } constructor(e, t) { (this._params = e), (this._containerService = t), (this.eventName = "ai_video_generate_status"); } } function c(e, t) { (0, a.Kl)(e, l, [t]); } l = (0, r.gn)( [ (0, r.fM)(1, o.t), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === o.t ? Object : o.t, ]), ], l ); }, 424437: function (e, t, i) { "use strict"; i.d(t, { M: function () { return p; }, v: function () { return u; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(27433), s = i(379311), l = i(799108), c = i(870730), d = i(484702), u = (function (e) { return ( (e.regenerate = "regenerate"), (e.rePrompt = "reprompt"), (e.addMore = "add_more"), (e.reDub = "re_dub"), (e.delete = "delete"), (e.lipSync = "lip_sync"), (e.upScale = "upscale"), (e.frameInterpolation = "frame_interpolation"), (e.continueGenerate = "continue_generate"), e ); })({}), f = { regenerate: l.hO.RetryButton, reprompt: void 0, add_more: l.hO.ExtendSeconds, re_dub: l.hO.ReDub, delete: void 0, lip_sync: l.hO.LipSync, upscale: l.hO.VideoUpscale, frame_interpolation: l.hO.VideoFrameInterpolation, continue_generate: l.hO.ContinueLabUpscaleVideo, }; class h { getEventParams() { var { action: e } = this._params, t = { is_freetrial: 0, vip_right_trial_type: c.a.nonTrial }, i = f[e]; if (i) { var a = (0, o.be)({ scene: i, commercialStrategyService: this._commercialStrategyService, }); t = { is_freetrial: Number(a.isStrategyFreeTrial), vip_right_trial_type: a.trialType, }; } return (0, r._)((0, n._)({}, t), { action: this._params.action, video_id: this._params.video_id, is_usable: this._params.is_usable, page: this._params.page, }); } constructor(e, t) { (this._params = e), (this._commercialStrategyService = t), (this.eventName = "ai_video_result_action_show"); } } function p(e, t) { (0, s.Kl)(e, h, [t]); } h = (0, a.gn)( [ (0, a.fM)(1, d.N), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === d.N ? Object : d.N, ]), ], h ); }, 593187: function (e, t, i) { "use strict"; i.d(t, { $: function () { return b; }, a: function () { return g; }, }); var n = i(625572), r = i(639880), a = i(96), o = i(789786), s = i(379311), l = i(434712), c = i(799108), d = i(27433), u = i(870730), f = i(475578), h = i(70137), p = i(484702), v = i(217448), m = i(76931), g = (function (e) { return ( (e.processShow = "process_show"), (e.failShow = "fail_show"), (e.completeShow = "complete_show"), (e.regenerate = "regenerate"), (e.reprompt = "reprompt"), (e.addMore = "add_more"), (e.download = "download"), (e.fullScreen = "full_screen"), (e.playStart = "play_start"), (e.playEnd = "play_end"), (e.pause = "pause"), (e.reviewToastShow = "review_toast_show"), (e.like = "like"), (e.dislike = "dislike"), (e.submitDislike = "submit_dislike"), (e.closeReviewToast = "close_review_toast"), (e.report = "report"), (e.submitReport = "submit_report"), (e.delete = "delete"), (e.confirmDelete = "confirm_delete"), (e.imageInputDetail = "image_input_detail"), (e.seedDetail = "seed_detail"), (e.copySeed = "copy_seed"), (e.refresh = "refresh"), (e.clickAddBackup = "click_add_backup"), (e.use = "use"), (e.clickLipSync = "click_lip_sync"), (e.hoverLipSync = "hover_lip_sync"), (e.backToOriginalVideo = "back_to_original_video"), (e.videoSourceDetail = "video_source_detail"), (e.audioSourceDetail = "audio_source_detail"), (e.audioSourcePlay = "audio_source_play"), (e.redub = "re_dub"), (e.dragToBackup = "drag_to_backup"), (e.collect = "collect"), (e.uncollect = "uncollect"), (e.frameInterpolation = "frame_interpolation"), (e.upscale = "upscale"), (e.continueGenerate = "continue_generate"), (e.aiMusic = "ai_music"), (e.aiMusicRegenerate = "ai_music_regenerate"), (e.v2aGenerate = "v2a_generate"), (e.v2aReGenerate = "v2a_re_generate"), (e.v2aSwitch = "v2a_switch"), e ); })({}), _ = { hover_lip_sync: c.hO.LipSync, click_lip_sync: c.hO.LipSync, re_dub: c.hO.ReDub, regenerate: c.hO.RetryButton, add_more: c.hO.ExtendSeconds, }; class y { getEventParams() { var e, t, i, { isVip: o, currentVipLevel: s } = this._vipService, l = this._params, { video_duration: h, frame_rate: p, scene_options: v, template_id: g, impression_id: y, } = l, b = (0, a._)(l, [ "video_duration", "frame_rate", "scene_options", "template_id", "impression_id", ]), I = null !== (t = null === (e = this._params) || void 0 === e ? void 0 : e.scene) && void 0 !== t ? t : _[b.action], w = I ? (0, d.Qp)({ scene: I, sceneOptions: v, videoDuration: h, commercialStrategyService: this._commercialStrategyService, }).credits : 0, x = { is_freetrial: 0, vip_right_trial_type: u.a.nonTrial }; if (I) { var S = (0, d.be)({ scene: I, commercialStrategyService: this._commercialStrategyService, }); x = { is_freetrial: Number(S.isStrategyFreeTrial), vip_right_trial_type: S.trialType, }; } return (0, n._)( (0, r._)((0, n._)({}, b, x), { video_duration: (null != h ? h : 0) * 1e3, credits_now: null !== (i = null == b ? void 0 : b.credits_now) && void 0 !== i ? i : this._commercialCreditService.localCredit, credits_need: w, is_vip: o ? 1 : 0, user_subscribe_type: o ? c.TK[s] : 0, frame_rate: p, event_page: (0, m.CB)(f.px.Video), template_from: (0, m.lg)(g, f.px.Video), template_type_id: f.px.Video, template_id: g, impression_id: null != y ? y : (0, m.ww)(g), }), (0, m.Oj)(this._containerService) ); } constructor(e, t, i, n, r) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this._commercialStrategyService = n), (this._containerService = r), (this.eventName = "ai_video_result_action"); } } function b(e, t) { (0, s.Kl)(e, y, [t]); } y = (0, o.gn)( [ (0, o.fM)(1, v.q), (0, o.fM)(2, h.aG), (0, o.fM)(3, p.N), (0, o.fM)(4, l.t), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === v.q ? Object : v.q, void 0 === h.aG ? Object : h.aG, void 0 === p.N ? Object : p.N, void 0 === l.t ? Object : l.t, ]), ], y ); }, 822040: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return S; }, s: function () { return x; }, }); var n = i(625572), r = i(639880), a = i(96), o = i(789786), s = i(379311), l = i(434712), c = i(243302), d = i(227700), u = i(217448), f = i(799108), h = i(44938), p = i(27433), v = i(246940), m = i(475578), g = i(870730), _ = i(484702), y = i(76931), b = i(773820), I = i(490165); class w { getEventParams() { var e, t, i, o, s = this._params, { scene: l, discount: c, withRelaxedGenerateModeSwitch: d, isRelaxedGenerate: u, aiType: h, aiSubType: v, video_duration: _, scene_options: b, impression_id: I, template_id: w, template_type_id: x, } = s, S = (0, a._)(s, [ "scene", "discount", "withRelaxedGenerateModeSwitch", "isRelaxedGenerate", "aiType", "aiSubType", "video_duration", "scene_options", "impression_id", "template_id", "template_type_id", ]), M = l ? (0, p.Qp)({ scene: l, sceneOptions: b, videoDuration: (null != _ ? _ : 0) * (null !== (t = null === (e = this._params) || void 0 === e ? void 0 : e.generate_num) && void 0 !== t ? t : 1), commercialStrategyService: this._commercialStrategyService, discount: c, }).credits : 0, C = !1; u && ((C = this._isFirstRelaxedGenerate()), this._updateIsFirstRelaxedGenerate()); var T = { is_freetrial: 0, vip_right_trial_type: g.a.nonTrial }; if (l) { var A = (0, p.be)({ scene: l, commercialStrategyService: this._commercialStrategyService, }); T = { is_freetrial: Number(A.isStrategyFreeTrial), vip_right_trial_type: A.trialType, }; } var { isVip: k, currentVipLevel: P } = this._vipService; return (0, n._)( (0, r._)((0, n._)({}, S, T), { video_duration: (null !== (i = S.origin_video_duration) && void 0 !== i ? i : 0) + (null !== (o = S.extend_duration_ms) && void 0 !== o ? o : 0), credits_need: M, is_vip: k ? 1 : 0, user_subscribe_type: k ? f.TK[P] : 0, is_first_relaxed_generate: C ? m.eD.True : m.eD.False, with_relaxed_generate_mode_switch: d ? m.eD.True : m.eD.False, is_relaxed_generate: u ? m.eD.True : m.eD.False, ai_type: h, ai_sub_type: v, template_id: w, impression_id: I, event_page: (0, y.CB)(m.px.Video), template_from: (0, y.lg)(w, m.px.Video), template_type_id: x, }), (0, y.Oj)(this._containerService) ); } _isFirstRelaxedGenerate() { return !v.T.getItem(this._isFirstRelaxedGenerateKey); } _updateIsFirstRelaxedGenerate() { v.T.setItem(this._isFirstRelaxedGenerateKey, Date.now().toString()); } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._commercialStrategyService = i), (this._containerService = n), (this.eventName = "click_ai_video_generate"), (this._isFirstRelaxedGenerateKey = v.T.generateKey( h.u.isUsedRelaxMode )); } } function x(e, t) { (0, s.Kl)(e, w, [t]); } function S(e, t) { var { submitId: i, taskExtraInfo: n, actionTemplateId: r, actionTemplateName: a, enterFrom: o, } = t, { resourceId: s, impressionId: l, promptSource: u } = n || {}, f = u === b.K.Remix, h = e.invokeFunction((e) => e.get(I.D)), p = null == h ? void 0 : h.userProfile.uid; x(e, { submit_id: i, template_id: f ? s : void 0, impression_id: l, video_action_template_id: r, video_action_template_name: a, enter_from: o, author_id: f ? p : void 0, prompt_source: null != u ? u : b.K.Custom, page: m.WZ.ActionCopy, generate_type: c.pi.VideoTemplate, aigc_type: "generate", image_prompt_cnt: 1, prompt_cnt: 0, prompt: "", movement_type: d.UW.unknown, video_speed: "", template_type_id: "video_action_driver", seed: "", aiType: m.CO.Video, aiSubType: m.sw.ActionCopy, is_preset: 0, is_quick_preview: 0, is_from_preview: 0, generate_num: 1, magic_box_cnt: 0, }); } w = (0, o.gn)( [ (0, o.fM)(1, u.q), (0, o.fM)(2, _.N), (0, o.fM)(3, l.t), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === u.q ? Object : u.q, void 0 === _.N ? Object : _.N, void 0 === l.t ? Object : l.t, ]), ], w ); }, 227700: function (e, t, i) { "use strict"; i.d(t, { $y: function () { return f; }, Ep: function () { return l; }, MY: function () { return h; }, PY: function () { return m; }, QG: function () { return d; }, QN: function () { return c; }, UW: function () { return a; }, hp: function () { return v; }, k$: function () { return u; }, mb: function () { return p; }, oT: function () { return o; }, qb: function () { return s; }, }); var n = i(869919), r = i(733787), a = (function (e) { return ( (e.stillShot = "still_shot"), (e.zoomIn = "zoom_in"), (e.zoomOut = "zoom_out"), (e.rotateClockwise = "rotate_clockwise"), (e.rotateAnticlockwise = "rotate_anticlockwise"), (e.panLeft = "pan_left"), (e.panRight = "pan_right"), (e.tiltUp = "tilt_up"), (e.tiltDown = "tilt_down"), (e.horizontalLeft = "horizontal_left"), (e.horizontalRight = "horizontal_right"), (e.verticalUp = "vertical_up"), (e.verticalDown = "vertical_down"), (e.unknown = ""), e ); })({}), o = (function (e) { return (e.normal = "normal"), (e.fluent = "fluent"), e; })({}), s = (function (e) { return ( (e.success = "success"), (e.fail = "fail"), (e.cancel = "cancel"), e ); })({}), l = { [n.Mc.Low]: "small", [n.Mc.Moderate]: "medium", [n.Mc.High]: "large", }, c = { [r.H7.StillShot]: "still_shot", [r.H7.ZoomIn]: "zoom_in", [r.H7.ZoomOut]: "zoom_out", [r.H7.RotateAnticlockwise]: "rotate_clockwise", [r.H7.RotateClockwise]: "rotate_anticlockwise", [r.H7.HorizontalLeft]: "horizontal_left", [r.H7.HorizontalRight]: "horizontal_right", [r.H7.VerticalDown]: "vertical_down", [r.H7.VerticalUp]: "vertical_up", [r.H7.TiltUp]: "tilt_up", [r.H7.TiltDown]: "tilt_down", [r.H7.PanLeft]: "pan_left", [r.H7.PanRight]: "pan_right", [r.H7.Default]: "", }, d = { [r.py.VideoAspectRatioType_21_9]: "21:9", [r.py.VideoAspectRatioType_16_9]: "16:9", [r.py.VideoAspectRatioType_4_3]: "4:3", [r.py.VideoAspectRatioType_1_1]: "1:1", [r.py.VideoAspectRatioType_3_4]: "3:4", [r.py.VideoAspectRatioType_9_16]: "9:16", }, u = { "21:9": r.py.VideoAspectRatioType_21_9, "16:9": r.py.VideoAspectRatioType_16_9, "4:3": r.py.VideoAspectRatioType_4_3, "1:1": r.py.VideoAspectRatioType_1_1, "3:4": r.py.VideoAspectRatioType_3_4, "9:16": r.py.VideoAspectRatioType_9_16, }, f = (function (e) { return ( (e.show = "show"), (e.addImage = "add_image"), (e.deleteImage = "delete_image"), (e.cancelImage = "cancel_image"), (e.openLastFrame = "open_last_frame"), (e.closeLastFrame = "close_last_frame"), (e.textInput = "text_input"), (e.imageInput = "image_input"), (e.characterInput = "character_input"), (e.characterFromLocal = "character_from_local"), (e.characterFromAssets = "character_from_assets"), (e.deleteCharacter = "delete_character"), (e.replaceCharacter = "replace_character"), (e.enterPrompt = "enter_prompt"), (e.openCameraControl = "open_camera_control"), (e.switchMovementType = "switch_movement_type"), (e.openVideoSetting = "open_video_setting"), (e.switchAspectRatio = "switch_aspect_ratio"), (e.switchVideoSpeed = "switch_video_speed"), (e.enterSeed = "enter_seed"), (e.openMovementSetting = "open_movement_setting"), (e.switchMovementStrength = "switch_movement_strength"), (e.movementReset = "movement_reset"), (e.movementApply = "movement_apply"), (e.switchGenerateMode = "switch_generate_mode"), (e.switchVideoDuration = "switch_video_duration"), (e.presetEdit = "preset_edit"), (e.presetReset = "preset_reset"), (e.switchGenerateNum = "switch_generate_num"), (e.clickMagicBox = "click_magic_box"), (e.openFramePopupShow = "open_frame_popup_show"), (e.openFramePopupConfirm = "open_frame_popup_confirm"), (e.switchModel = "switch_model"), e ); })({}), h = (function (e) { return ( (e.SideBar = "side_bar"), (e.FastEntrance = "fast_entrance"), (e.FirstPage = "first_page"), (e.Remix = "remix"), (e.Assets = "assets"), (e.UserTools = "userTools"), (e.Banner = "homebanner"), (e.Url = "url"), (e.SelectScene = "select_scene"), (e.GenerateVideo = "generate_video"), (e.ProjectMgr = "project_mgr"), (e.HomePage = "homepage"), (e.SwitchTab = "switch_tab"), (e.WorkCollection = "work_collection"), (e.TemplateDetail = "template_detail"), (e.Detail = "detail"), (e.DeepseekAgent = "agent"), e ); })({}), p = (function (e) { return (e.Normal = "normal"), (e.Collect = "collect"), e; })({}), v = (function (e) { return ( (e.frame = "music_based_on_picture"), (e.custom = "custom_ai_music"), e ); })({}), m = (function (e) { return ( (e.AddImage = "add_image"), (e.DeleteImage = "delete_image"), (e.AddTemplate = "add_template"), (e.DeleteTemplate = "delete_template"), (e.SelectTemplate = "select_template"), e ); })({}); }, 455091: function (e, t, i) { "use strict"; i.d(t, { k: function () { return c; }, }); var n = i(625572), r = i(789786), a = i(379311), o = i(434712), s = i(76931); class l { getEventParams() { return (0, n._)({}, this._params, (0, s.Oj)(this._containerService)); } constructor(e, t) { (this._params = e), (this._containerService = t), (this.eventName = "export_status"); } } function c(e, t) { (0, a.S$)(e, l, [t]); } l = (0, r.gn)( [ (0, r.fM)(1, o.t), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === o.t ? Object : o.t, ]), ], l ); }, 99123: function (e, t, i) { "use strict"; i.d(t, { FT: function () { return p; }, hw: function () { return v; }, lt: function () { return h; }, q: function () { return f; }, }); var n = i(625572), r = i(379311), a = i(773820), o = i(591586), s = i(243302), l = { dreamina_ic_generate_video_model_vgfm_lite: "\u89C6\u9891 S2.0", "dreamina_ic_generate_video_model_vgfm1.0": "\u89C6\u9891 S2.0 Pro", "dreamina_ailab_generate_video_model_v1.2": "\u89C6\u9891 1.2", "dreamina_ailab_generate_video_model_v1.4": "\u89C6\u9891 P2.0 Pro", }; class c { getEventParams() { var e, t, i, n, { data: r, status: o, duration: s, taskDuration: c, serverDuration: d, generateDuration: u, taskError: f, generateTaskStatus: h, taskId: p, mode: v, generateType: m, server2WebsocketDuration: g, failCode: _, generateId: y, isDraftGen: b, } = this._params, I = null === (e = r.inputImages) || void 0 === e ? void 0 : e[0], w = null === (t = r.inputImages) || void 0 === t ? void 0 : t[1]; "taskFail" === o && (null == f ? void 0 : f.code) ? (i = "".concat(f.code)) : "fail" === o && (i = "".concat(h)); var x = r.extra, S = null !== (n = null == x ? void 0 : x.promptSource) && void 0 !== n ? n : a.K.Custom; return { video_duration: r.originDurationMs, fps: r.originFps, generate_type: m, generate_type_str: "".concat(m), prompt_source: S, model_key: r.modelReqKey, model_name: r.modelReqKey ? l[r.modelReqKey] : void 0, motion_speed: "".concat(r.motionSpeed), motion_type: r.motionType, seed: "".concat(r.seed), video_ratio: r.videoRatio, video_generate_type: (null == I ? void 0 : I.imageUri) ? 2 : 1, first_frame_image_url: null == I ? void 0 : I.imageUrl, first_frame_image_uri: null == I ? void 0 : I.imageUri, last_frame_image_url: null == w ? void 0 : w.imageUrl, last_frame_image_uri: null == w ? void 0 : w.imageUri, text_prompt: r.textPrompt, scene: r.scene, task_duration: c, generate_duration: u, duration: s, server_duration: d, client_duration: s - d, server_to_websocket_duration: g, status: o, fail_code: i, task_fail_code: _, fail_reason: null == f ? void 0 : f.msg, task_id: p, mode: v, logId: this._logId, generate_id: y, is_draft_gen: b ? "1" : "0", }; } constructor(e, t) { (this._params = e), (this._logId = t), (this.eventName = "perf_ai_video_generate"); } } function d(e) { return [ s.Pd.FinalSuccess, s.Pd.FinalGenerateFail, s.Pd.PreTnsCheckNotPass, s.Pd.PostTnsCheckNotPass, ].includes(e); } class u { static getInstance() { return !u._instance && (u._instance = new u()), u._instance; } updateTaskRecord(e, t) { this._taskRecord[e] = (0, n._)({}, this._taskRecord[e], t); } getWebsocketFinishedTime(e) { var t; return null === (t = this._taskRecord[e]) || void 0 === t ? void 0 : t.websocketFinishedTime; } supplementTaskRecord(e, t, i) { if (!this._taskRecord[e]) this.updateTaskRecord(e, { data: t }), this.markTaskStart(e, i); } markTaskStart(e, t) { this.updateTaskRecord(e, { taskStartTime: null != t ? t : Date.now(), }); } markTaskEnd(e) { if ( !(null === (t = this._taskRecord[e]) || void 0 === t ? void 0 : t.taskStartTime) ) { o.t.warn("markTaskStart first"); return; } var t, i = Date.now(); this.updateTaskRecord(e, { taskDuration: i - this._taskRecord[e].taskStartTime, generateStartTime: i, }); } markGenerateEnd(e) { var t = this._taskRecord[e], i = Date.now(); if (!(null == t ? void 0 : t.taskStartTime)) { o.t.warn("markTaskStart first"); return; } this.updateTaskRecord(e, { generateDuration: t.generateStartTime ? i - t.generateStartTime : -1, duration: i - t.taskStartTime, }); } report(e, t, i) { if (!!this._taskRecord[t]) (0, r.Kl)(e, c, [this._taskRecord[t], i]), this._deleteRecord(t); } _deleteRecord(e) { this._taskRecord[e] && delete this._taskRecord[e]; } constructor() { this._taskRecord = {}; } } function f(e) { u.getInstance().updateTaskRecord(e, { websocketFinishedTime: Date.now(), }); } function h(e, t, i, n, r) { u .getInstance() .updateTaskRecord(e, { data: t, mode: i, generateType: n, isDraftGen: r, }), u.getInstance().markTaskStart(e); } function p(e, t, i, n, r) { var { createdTime: a, task: o, generateType: l, failCode: c, generateId: f, } = t, { submitId: h, status: p, taskId: v, finishTime: m, isUseDraftGen: g, } = o; if ( (r && (u.getInstance().supplementTaskRecord(h, r, r.createdTime), u.getInstance().updateTaskRecord(h, { mode: i, generateType: l })), f && u.getInstance().updateTaskRecord(h, { generateId: f }), void 0 !== g && u.getInstance().updateTaskRecord(h, { isDraftGen: g }), v && u.getInstance().updateTaskRecord(h, { taskId: v }), p === s.Pd.SubmitOk) ) u.getInstance().markTaskEnd(h); else if (d(p)) { var _ = u.getInstance().getWebsocketFinishedTime(h), y = _ ? _ - 1e3 * m : void 0; u.getInstance().markGenerateEnd(h), u .getInstance() .updateTaskRecord(h, { status: p === s.Pd.FinalSuccess ? "success" : "fail", generateTaskStatus: p, serverDuration: 1e3 * m - a, server2WebsocketDuration: y, failCode: c, }), u.getInstance().report(e, h, n); } } function v(e, t, i) { if ((u.getInstance().markTaskEnd(t), !i.ok)) { var n, [r] = i.pair(); u .getInstance() .updateTaskRecord(t, { status: "taskFail", taskError: r }), u .getInstance() .report( e, t, null === (n = i.errorInfo) || void 0 === n ? void 0 : n.logId ); } } }, 114527: function (e, t, i) { "use strict"; i.d(t, { $: function () { return o; }, K: function () { return s; }, }); var n = i(379311); class r { getEventParams() { var { cost: e, assetType: t } = this._params; return { cost: e, asset_type: t }; } constructor(e) { (this._params = e), (this.eventName = "get_history_time_consuming"); } } class a { getEventParams() { var { cost: e, assetType: t } = this._params; return { cost: e, asset_type: t }; } constructor(e) { (this._params = e), (this.eventName = "get_asset_list_time_consuming"); } } function o(e, t) { (0, n.S$)(e, r, [t]); } function s(e, t) { (0, n.S$)(e, a, [t]); } }, 841798: function (e, t, i) { "use strict"; i.d(t, { E8: function () { return c; }, GW: function () { return o; }, gf: function () { return s; }, }); var n = i(625572), r = i(379311), a = i(881607), o = (function (e) { return ( (e.Show = "show"), (e.Edit = "edit"), (e.DeleteRole = "delete_role"), (e.CorrectPrompt = "correct_prompt"), (e.DeleteRoleConfirm = "delete_role_confirm"), (e.CorrectPromptConfirm = "correct_prompt_confirm"), (e.Create = "create"), (e.Select = "select"), (e.AtDelete = "at_delete"), (e.AtDeleteConfirm = "at_delete_confirm"), (e.Reset = "reset"), e ); })({}), s = (function (e) { return (e.Click = "click"), (e.At = "at"), (e.Hover = "hover"), e; })({}); class l { getEventParams() { return (0, n._)({}, (0, a.cu)(this._params)); } constructor(e) { (this._params = e), (this.eventName = "ai_role_settings_popup"); } } function c(e, t) { (0, r.Kl)(e, l, [t]); } }, 785106: function (e, t, i) { "use strict"; i.d(t, { M: function () { return l; }, }); var n = i(139646), r = i(325946), a = i(561658), o = i(509525); class s extends r.C { _registerChildLevelService(e) { var { registry: t, lazyServiceRegister: i } = e; return (0, n._)(function* () { var e = [i({ lazy: a.r, real: a.N })]; yield Promise.all(e); })(); } } var l = (e) => e ? e.createInstance(s).createChild((0, o.fC)()) : Promise.resolve(e); }, 353790: function (e, t, i) { "use strict"; i.d(t, { U: function () { return m; }, r: function () { return p; }, }); var n = i(139646), r = i(625572), a = i(789786), o = i(379311), s = i(434712), l = i(487736), c = i(799108), d = i(217448), u = i(561658), f = i(259435), h = i(785106), p = (function (e) { return ( (e.Show = "show"), (e.ClickJoinVip = "click_join_vip"), (e.ClickGetCredits = "click_get_credits"), (e.Cancel = "cancel"), (e.Close = "close"), e ); })({}); class v { get otherReportParams() { return { second_page: (0, f.X)( this._containerService, l.M.WorkCollectionDetailModal ) ? "work_collection_detail" : void 0, show_type: this._contentGenerationService.contentRecordListManager .isGroupView ? "collect" : "normal", }; } getEventParams() { var { action: e, source: t, isQuickPreview: i, isFromPreview: n, batchNumber: a, } = this._params, { isVip: o, currentVipLevel: s } = this._vipService; return (0, r._)( { action: e, is_vip: o ? 1 : 0, user_subscribe_type: o ? c.TK[s] : 0, source: t, is_quick_preview: Number(null != i ? i : 0), is_from_preview: Number(null != n ? n : 0), generate_num: a, }, this.otherReportParams ); } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._contentGenerationService = i), (this._containerService = n), (this.eventName = "credit_limit_popup"); } } function m(e, t) { return g.apply(this, arguments); } function g() { return (g = (0, n._)(function* (e, t) { var i = yield (0, h.M)(e); (0, o.Kl)(i, v, [t]); })).apply(this, arguments); } v = (0, a.gn)( [ (0, a.fM)(1, d.q), (0, a.fM)(2, u.N), (0, a.fM)(3, s.t), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === d.q ? Object : d.q, void 0 === u.N ? Object : u.N, void 0 === s.t ? Object : s.t, ]), ], v ); }, 582152: function (e, t, i) { "use strict"; i.d(t, { ZD: function () { return b; }, wE: function () { return g; }, zh: function () { return _; }, }); var n = i(139646), r = i(625572), a = i(789786), o = i(379311), s = i(217448), l = i(434712), c = i(487736), d = i(799108), u = i(475578), f = i(664306), h = i(899229), p = i(561658), v = i(259435), m = i(785106), g = (function (e) { return ( (e.ClickGenerateButton = "click_generate_button"), (e.ClickTopAccountButtonAddCredits = "click_top_account_button_add_credits"), (e.CLICK_VIP_FUNCTION_3s = "click_vip_function_+3s"), (e.CLICK_REGENERATE_BUTTON = "click_regenerate_button"), (e.CREDIT_LIMIT_POPUP = "credit_limit_popup"), (e.MULTI_VIP_POPUP_GET_CREDITS = "multi_vip_popup_get_credits"), (e.SUBSCRIBE_PLAN_CHANGE_POPUP = "subscribe_plan_change_popup"), e ); })({}), _ = (function (e) { return ( (e.Show = "show"), (e.SelectProduct = "select_product"), (e.CheckDetail = "check_detail"), (e.AgreeProtocol = "agree_protocol"), (e.GetQrCode = "get_qr_code"), (e.FailToGetQrCode = "fail_to_get_qr_code"), (e.InvalidQrCode = "invalid_qr_code"), (e.ShowQrCode = "show_qr_code"), (e.VIPEnd = "vip_end"), (e.PaySuccess = "pay_success"), (e.PayFail = "pay_fail"), (e.ClickPurchase = "click_purchase"), e ); })({}); class y { get otherReportParams() { return { second_page: (0, v.X)( this._containerService, c.M.WorkCollectionDetailModal ) ? "work_collection_detail" : void 0, show_type: this._contentGenerationService.contentRecordListManager .isGroupView ? "collect" : "normal", }; } getEventParams() { var { source: e, action: t, creditNow: i, selectCreditsAmount: n, payChannel: a, payCurrency: o, payAmount: s, orderId: l, sku: c, scene: p, sceneOptions: v, videoDuration: m, isQuickPreview: g, isFromPreview: _, batchNumber: y, } = this._params, { isVip: b, currentVipLevel: I } = this._vipService, w = {}, x = {}; return ( p && ((w.ai_type = (0, f.MJ)({ scene: p }) ? u.CO.Video : (0, f.K6)({ scene: p }) ? u.CO.Audio : u.CO.Image), (w.vip_function_id = (0, h.cq)({ scene: p, sceneOptions: v })), (x = { video_mode: (() => { if ((null == v ? void 0 : v.version) !== h.dt.V2CharVideo) { if (v && "mode" in v) return v.mode; } })(), video_duration: m, vip_function_id: w.vip_function_id, })), (0, r._)( { source: e, action: t, is_vip: b ? 1 : 0, user_subscribe_type: b ? d.TK[I] : 0, credit_now: i, select_credits_amount: n, pay_channel: a, pay_amount: s, pay_currency: o, order_id: l, sku: c, extra: x, is_quick_preview: Number(null != g ? g : 0), is_from_preview: Number(null != _ ? _ : 0), generate_num: y, }, w, this.otherReportParams ) ); } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._contentGenerationService = i), (this._containerService = n), (this.eventName = "credit_popup"); } } function b(e, t) { return I.apply(this, arguments); } function I() { return (I = (0, n._)(function* (e, t) { var i = yield (0, m.M)(e); (0, o.Kl)(i, y, [t]); })).apply(this, arguments); } y = (0, a.gn)( [ (0, a.fM)(1, s.q), (0, a.fM)(2, p.N), (0, a.fM)(3, l.t), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === p.N ? Object : p.N, void 0 === l.t ? Object : l.t, ]), ], y ); }, 202070: function (e, t, i) { "use strict"; i.d(t, { DT: function () { return d; }, dz: function () { return f; }, }); var n = i(625572), r = i(789786), a = i(217448), o = i(603026), s = i(799108), l = i(27433), c = i(379311), d = (function (e) { return (e.Show = "show"), (e.Click = "click"), e; })({}); class u { getEventParams() { var { action: e } = this._params, { isVip: t, currentVipLevel: i } = this._vipService, { vipPriceList: r } = this._commercialGoodsService, a = (0, l.c3)(r); return (0, n._)( { action: e, user_subscribe_type: t ? s.TK[i] : 0, show_up_condition: "credit_not_enough", }, (0, l.Rg)(a) ); } constructor(e, t, i) { (this._params = e), (this._vipService = t), (this._commercialGoodsService = i), (this.eventName = "generate_button_bubble"); } } function f(e, t) { (0, c.Kl)(e, u, [t]); } u = (0, r.gn)( [ (0, r.fM)(1, a.q), (0, r.fM)(2, o.K), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === a.q ? Object : a.q, void 0 === o.K ? Object : o.K, ]), ], u ); }, 344312: function (e, t, i) { "use strict"; i.d(t, { Vq: function () { return l; }, b1: function () { return u; }, kD: function () { return c; }, vg: function () { return s; }, }); var n = i(789786), r = i(799108), a = i(379311), o = i(217448), s = (function (e) { return ( (e.Show = "show"), (e.ClickOk = "click_ok"), (e.ClickPayAgain = "click_pay_again"), (e.ClickReopenPipo = "click_reopen_pipo"), e ); })({}), l = (function (e) { return ( (e.PaySuccess = "pay_success"), (e.PayFail = "pay_fail"), (e.PayWaiting = "pay_waiting"), e ); })({}), c = (function (e) { return (e.Vip = "vip"), (e.Credits = "credits"), e; })({}); class d { getEventParams() { var { currentVipLevel: e } = this._vipService, { action: t, status: i, isVip: n, sku: a, orderId: o, payChannel: s, source: l, } = this._params; return { action: t, status: i, source: l, is_vip: n ? 1 : 0, user_subscribe_type: n ? r.TK[e] : 0, sku: a, pay_channel: s, order_id: o, }; } constructor(e, t) { (this._params = e), (this._vipService = t), (this.eventName = "payment_detail_popup"); } } function u(e, t) { (0, a.Kl)(e, d, [t]); } d = (0, n.gn)( [ (0, n.fM)(1, o.q), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === o.q ? Object : o.q, ]), ], d ); }, 563200: function (e, t, i) { "use strict"; i.d(t, { E: function () { return f; }, N: function () { return d; }, }); var n = i(789786), r = i(379311), a = i(475578), o = i(217448), s = i(27433), l = i(70137), c = i(484702), d = (function (e) { return (e.Show = "show"), (e.Click = "click"), e; })({}); class u { getEventParams() { var { action: e, aiType: t, aiSubType: i, scene: n, benefits: r, videoDuration: o, } = this._params, { credits: l } = (0, s.Qp)({ scene: n, extraBenefits: r, videoDuration: o, commercialStrategyService: this._commercialStrategyService, }); return { action: e, credits_now: this._commercialCreditService.localCredit, credits_need: l, ai_type: t, ai_sub_type: i, is_vip: this._vipService.isVip ? a.eD.True : a.eD.False, is_time_limited_free: this._commercialStrategyService .isInFreemiumStage ? a.eD.True : a.eD.False, }; } constructor(e, t, i, n) { (this._params = e), (this._commercialCreditService = t), (this._commercialStrategyService = i), (this._vipService = n), (this.eventName = "re_generate_credit_hover"); } } function f(e, t) { (0, r.Kl)(e, u, [t]); } u = (0, n.gn)( [ (0, n.fM)(1, l.aG), (0, n.fM)(2, c.N), (0, n.fM)(3, o.q), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === l.aG ? Object : l.aG, void 0 === c.N ? Object : c.N, void 0 === o.q ? Object : o.q, ]), ], u ); }, 695001: function (e, t, i) { "use strict"; i.d(t, { fG: function () { return d; }, oF: function () { return c; }, yf: function () { return f; }, }); var n = i(789786), r = i(379311), a = i(839141), o = i(799108), s = i(217448), l = i(603026), c = (function (e) { return ( (e.Show = "show"), (e.Close = "close"), (e.CancelSubscribe = "cancel_subscribe"), (e.ChangeSubscribe = "change_subscribe"), (e.GetPaymentQRCode = "get_payment_qr_code"), (e.ClickGetCredits = "click_getcredits"), (e.Success = "success"), (e.Failed = "failed"), e ); })({}), d = (function (e) { return ( (e.MultiVipPopupClickSubscribe = "multi_vip_popup_click_subscribe"), (e.SubscribePlanManagePopupClickCancelAutoRenewal = "subscribe_plan_manage_popup_click_cancel_auto_renewal"), e ); })({}); class u { getEventParams() { var { action: e, source: t, toProductId: i } = this._params, { isVip: n, currentVipLevel: r, vipInfo: s } = this._vipService, { vipPriceList: l } = this._goodsService, { cycleUnit: c, level: d } = (null == s ? void 0 : s.currentAutoRenewPlan) || {}, { level: u, cycleUnit: f, priceType: h, } = (l || []).find((e) => e.productId === i) || {}; return { action: e, source: t, membership_type_now: (() => n ? (d ? o.TK[d] : o.TK[r]) : o.TK[a.d.None])(), membership_pay_type_now: (() => { if (!!n) return c ? o.Y[c] : "single_purchase"; })(), membership_type_buy: void 0 !== u ? o.TK[u] : void 0, membership_pay_type_buy: (() => "auto" === h ? f ? o.Y[f] : void 0 : "un-auto" === h ? "single_purchase" : void 0)(), }; } constructor(e, t, i) { (this._params = e), (this._vipService = t), (this._goodsService = i), (this.eventName = "subscribe_plan_change_popup"); } } function f(e, t) { (0, r.Kl)(e, u, [t]); } u = (0, n.gn)( [ (0, n.fM)(1, s.q), (0, n.fM)(2, l.K), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === l.K ? Object : l.K, ]), ], u ); }, 236242: function (e, t, i) { "use strict"; i.d(t, { Ak: function () { return l; }, KB: function () { return u; }, Z: function () { return s; }, ym: function () { return c; }, }); var n = i(789786), r = i(379311), a = i(799108), o = i(217448), s = (function (e) { return ( (e.Show = "show"), (e.ClickTab = "click_tab"), (e.ClickCancelAutoRenewal = "click_cancel_auto_renewal"), e ); })({}), l = (function (e) { return ( (e.ManagePlans = "manage_plans"), (e.OrderRecords = "payment_record"), e ); })({}), c = (function (e) { return ( (e.MultiVipPopupTop = "multi_vip_popup_top"), (e.MultiVipPopupManagePlan = "multi_vip_popup_manage_plan"), e ); })({}); class d { getEventParams() { var { action: e, currentTab: t, clickTab: i, source: n, } = this._params, { isVip: r, currentVipLevel: o } = this._vipService; return { action: e, current_tab: t, click_tab: i, is_vip: r ? 1 : 0, user_subscribe_type: r ? a.TK[o] : 0, source: n, }; } constructor(e, t) { (this._params = e), (this._vipService = t), (this.eventName = "subscribe_plan_manage_popup"); } } function u(e, t) { (0, r.Kl)(e, d, [t]); } d = (0, n.gn)( [ (0, n.fM)(1, o.q), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === o.q ? Object : o.q, ]), ], d ); }, 71129: function (e, t, i) { "use strict"; i.d(t, { s: function () { return n; }, }); var n = (function (e) { return ( (e.CLICK_TOP_ACCOUNT_BUTTON_JOIN_VIP = "click_top_account_button_join_vip"), (e.CLICK_TOP_ACCOUNT_BUBBLE_VIP_END = "click_top_account_bubble_vip_end"), (e.CLICK_TOP_ACCOUNT_BUBBLE_RENEW_VIP = "click_top_account_bubble_renew_vip"), (e.CLICK_VIP_FUNCTION_3s = "click_vip_function_+3s"), (e.CLICK_VIP_FUNCTION_DELETE_WATERMARK = "click_vip_function_delete_watermark"), (e.CLICK_GENERATE_BUTTON = "click_generate_button"), (e.CLICK_REGENERATE_BUTTON = "click_regenerate_button"), (e.CLICK_VIP_END_CREDITS_PAGE = "click_vip_end_credits_page"), (e.CLICK_RENEW_VIP_CREDITS_PAGE = "click_renew_vip_credits_page"), (e.CLICK_PROFILE_VIP_BUTTON = "click_profile_vip_button"), (e.LIP_SYNC = "lip_sync"), (e.LIP_SYNC_AVATAR_SWITCH = "lip_sync_avatar_switch"), (e.ACTION_COPY = "action_copy"), (e.VIDEO_UPSCALE = "video_upscale"), (e.VIDEO_FRAME_INTERPLATION = "video_frame_interpolation"), (e.CONTINUE_LAB_UPSCALE_VIDEO = "continue_generate"), (e.GENERATE_VIDEO_BGM = "ai_music"), (e.RE_GENERATE_VIDEO_BGM = "ai_music_regenerate"), (e.RE_DUB = "re_dub"), (e.STORY_RENEW = "story_renew"), (e.LIP_SYNC_AVATAR_STD = "lip_sync_avatar_std"), (e.LIP_SYNC_AVATAR_LIVELY = "lip_sync_avatar_lively"), (e.VIDEO_AUDIO_EFFECT = "video_audio_effect"), (e.LIP_SYNC_AVATAR_MASTER = "lip_sync_avatar_master"), (e.LIP_SYNC_AVATAR_MASTER_FAST = "lip_sync_avatar_master_fast"), (e.BASIC_VIDEO_OPERATION_VGFM = "basic_video_operation_vgfm"), (e.BASIC_VIDEO_OPERATION_LAB_14 = "basic_video_operation_lab_14"), (e.CLICK_TEXT_TO_IMAGE_GENERATE_BUTTON = "click_text_to_image_generate_button"), (e.CLICK_CONTROL_NET = "click_controlnet"), (e.TEXT_GENERATE_PROMPT_EDITOR = "text_generate_prompt_editor"), (e.TEXT_GENERATE_RETRY_BUTTON = "text_generate_retry_button"), (e.TEXT_GENERATE_OUTPAINT_BUTTON = "text_generate_outpaint_button"), (e.TEXT_GENERATE_INPAINT_REPAINT_BUTTON = "text_generate_inpaint_repaint_button"), (e.TEXT_GENERATE_INPAINT_ERASER_BUTTON = "text_generate_inpaint_eraser_button"), (e.TEXT_GENERATE_MATTING_BUTTON = "text_generate_matting_button"), (e.TEXT_GENERATE_MAGNIFIC_BUTTON = "text_generate_magnific_button"), (e.TEXT_GENERATE_IMAGE_IP_KEEP = "text_generate_image_ip_keep"), (e.TEXT_GENERATE_IMAGE_BYTE_EDIT = "text_generate_image_byte_edit"), (e.RELAXED_GENERATE_MODE_VIP_GUIDE_ENTRANCE = "relaxed_generate_mode_vip_guide_entrance"), (e.CREDIT_LIMIT_POPUP = "credit_limit_popup"), (e.VIP_EXCLUSIVE_HONER = "vip_exclusive_honer"), (e.TEXT_GENERATE_FUSION_BUTTON = "TEXT_GENERATE_FUSION_BUTTON"), (e.CLICK_IMAGE_INSTA_DRAG_GENERATION_BUTTON = "click_insta_drag_generation_button"), (e.CLICK_IMAGE_PAINT_EDIT = "click_image_paint_edit"), (e.CLICK_IMAGE_UHD_BUTTON = "image_uhd"), (e.CLICK_TEXT_ART_GENERATION_BUTTON = "click_text_art_generation_button"), (e.CLICK_TEXT_ART_GENERATION_RETRY_BUTTON = "click_text_art_generation_retry_button"), (e.CLICK_VIDEO_BATCH_GENERATE_BUTTON = "click_video_batch_generate_button"), (e.CLICK_TEXT_TO_AUDIO_GENERATE_BUTTON = "click_text_to_audio_generate_button"), (e.CLICK_TEXT_TO_AUDIO_REGENERATE_BUTTON = "click_text_to_audio_regenerate_button"), (e.TOP_ACCOUNT_BUTTON_BUBBLE = "top_account_button_bubble"), (e.GENERATE_BUTTON_BUBBLE = "generate_button_bubble"), e ); })({}); }, 846779: function (e, t, i) { "use strict"; i.d(t, { Rc: function () { return p; }, SM: function () { return g; }, WL: function () { return v; }, bI: function () { return h; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(379311), s = i(799108), l = i(217448), c = i(27433), d = i(870730), u = i(484702), f = i(603026), h = (function (e) { return (e.Show = "show"), (e.Click = "click"), e; })({}), p = (function (e) { return ( (e.AddMore = "add_more"), (e.LipSync = "lip_sync"), (e.ReDub = "re_dub"), (e.ImageControlNetCanny = "image_control_net_canny"), (e.ImageControlNetDepth = "image_control_net_depth"), (e.ImageControlNetPose = "image_control_net_pose"), (e.VideoFrameInterpolation = "video_frame_interpolation"), (e.VideoUpscale = "video_upscale"), e ); })({}), v = { [s.hO.ExtendSeconds]: "add_more", [s.hO.LipSync]: "lip_sync", [s.hO.ReDub]: "re_dub", [s.hO.ImageControlNetCanny]: "image_control_net_canny", [s.hO.ImageControlNetDepth]: "image_control_net_depth", [s.hO.ImageControlNetPose]: "image_control_net_pose", }; class m { getEventParams() { var { action: e, vipFuncName: t, needVipLevel: i, scene: a, } = this._params, { isVip: o, currentVipLevel: l } = this._vipService, { vipPriceList: u } = this._commercialGoodsService, f = (0, c.c3)(u), h = { is_freetrial: 0, vip_right_trial_type: d.a.nonTrial }; if (a) { var p = (0, c.be)({ scene: a, commercialStrategyService: this._commercialStrategyService, }); h = { is_freetrial: Number(p.isStrategyFreeTrial), vip_right_trial_type: p.trialType, }; } return (0, n._)( (0, r._)((0, n._)({}, h), { action: e, is_vip: o ? 1 : 0, user_subscribe_type: o ? s.TK[l] : 0, vip_function_name: t, vip_right_subscribe_type: s.TK[i] || 0, }), (0, c.Rg)(f) ); } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._commercialStrategyService = i), (this._commercialGoodsService = n), (this.eventName = "vip_exclusive_honer"); } } function g(e, t) { (0, o.Kl)(e, m, [t]); } m = (0, a.gn)( [ (0, a.fM)(1, l.q), (0, a.fM)(2, u.N), (0, a.fM)(3, f.K), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === l.q ? Object : l.q, void 0 === u.N ? Object : u.N, void 0 === f.K ? Object : f.K, ]), ], m ); }, 399835: function (e, t, i) { "use strict"; i.d(t, { V: function () { return p; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(379311), s = i(217448), l = i(799108), c = i(27433), d = i(870730), u = i(70137), f = i(484702); class h { getEventParams() { var { vipFunctionName: e, action: t, scene: i } = this._params, { isVip: a, currentVipLevel: o } = this._vipService, s = i ? (0, c.Qp)({ scene: i, commercialStrategyService: this._commercialStrategyService, }).credits : 0, u = { is_freetrial: 0, vip_right_trial_type: d.a.nonTrial }; if (i) { var f = (0, c.be)({ scene: i, commercialStrategyService: this._commercialStrategyService, }); u = { is_freetrial: Number(f.isStrategyFreeTrial), vip_right_trial_type: f.trialType, }; } return (0, r._)((0, n._)({}, u), { vip_function_name: e, action: t, credit_need: s, credit_now: this._commercialCreditService.localCredit, is_vip: a ? 1 : 0, user_subscribe_type: a ? l.TK[o] : 0, }); } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this._commercialStrategyService = n), (this.eventName = "vip_function_button"); } } function p(e, t) { (0, o.Kl)(e, h, [t]); } h = (0, a.gn)( [ (0, a.fM)(1, s.q), (0, a.fM)(2, u.aG), (0, a.fM)(3, f.N), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === u.aG ? Object : u.aG, void 0 === f.N ? Object : f.N, ]), ], h ); }, 370549: function (e, t, i) { "use strict"; i.d(t, { A: function () { return f; }, G: function () { return d; }, }); var n = i(625572), r = i(789786), a = i(799108), o = i(27433), s = i(839141), l = i(379311), c = i(217448), d = (function (e) { return (e.Show = "show"), e; })({}); class u { getEventParams() { var { action: e, toProduct: t, currentTabKey: i } = this._params, { isVip: r, currentVipLevel: l, vipInfo: c } = this._vipService, { cycleUnit: d, level: u } = (null == c ? void 0 : c.currentAutoRenewPlan) || {}, { productId: f, totalAmount: h, level: p } = t || {}; return (0, n._)( { action: e, user_subscribe_type: r ? a.TK[l] : 0, membership_type_buy: void 0 !== p ? a.TK[p] : void 0, membership_pay_type_buy: i ? a.VG[i] : void 0, membership_type_now: (() => r ? (u ? a.TK[u] : a.TK[l]) : a.TK[s.d.None])(), membership_pay_type_now: (() => { if (!!r) return d ? a.Y[d] : "single_purchase"; })(), goods_id: f, pay_amount: h, }, (0, o.Rg)(t) ); } constructor(e, t) { (this._params = e), (this._vipService = t), (this.eventName = "vip_popup_pay_button_hover"); } } function f(e, t) { (0, l.Kl)(e, u, [t]); } u = (0, r.gn)( [ (0, r.fM)(1, c.q), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === c.q ? Object : c.q, ]), ], u ); }, 604201: function (e, t, i) { "use strict"; i.d(t, { K: function () { return R; }, c: function () { return E; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(789786), s = i(379311), l = i(839141), c = i(417281), d = i(243302), u = i(434712), f = i(487736), h = i(799108), p = i(259273), v = i(364767), m = i(561658), g = i(36159), _ = i(940140), y = i(855421), b = i(388977), I = i(475578), w = i(178589), x = i(27433), S = i(899229), M = i(664306), C = i(870730), T = i(484702), A = i(217448), k = i(259435), P = i(785106), E = (function (e) { return ( (e.Show = "show"), (e.AgreeProtocol = "agree_protocol"), (e.GetQrCode = "get_qr_code"), (e.FailToGetQrCode = "fail_to_get_qr_code"), (e.InvalidQrCode = "invalid_qr_code"), (e.ShowQrCode = "show_qr_code"), (e.CloseQrCodeModal = "close_qr_code_modal"), (e.VIPEnd = "vip_end"), (e.PaySuccess = "pay_success"), (e.PayFail = "pay_fail"), (e.ClickTab = "click_tab"), (e.VIPSelect = "vip_select"), (e.ClickSubscribe = "click_subscribe"), (e.ClickGetCredits = "click_get_credits"), (e.ClickPlansAndBilling = "click_plans_and_billing"), (e.ClickCurrentPlan = "click_current_plan"), (e.Close = "close"), (e.ClickBuy = "click_buy"), (e.CancelSubscribe = "cancel_subscribe"), (e.CLICK_PURCHASE = "click_purchase"), e ); })({}); class D { get otherReportParams() { return { second_page: (0, k.X)( this._containerService, f.M.WorkCollectionDetailModal ) ? "work_collection_detail" : void 0, show_type: this._contentGenerationService.contentRecordListManager .isGroupView ? "collect" : "normal", }; } getEventParams() { var { action: e, source: t, scene: i, benefits: n, payChannel: o, payAmount: s, orderId: c, toProduct: d, currentTabKey: u, clickTabKey: f, payCurrency: p, sku: v, sceneOptions: m, videoDuration: g, isQuickPreview: _, isFromPreview: b, batchNumber: I, } = this._params, { isVip: w, currentVipLevel: M, vipInfo: T } = this._vipService, { cycleUnit: A, level: k } = (null == T ? void 0 : T.currentAutoRenewPlan) || {}, { level: P, cycleUnit: E, priceType: D } = d || {}, R = {}, N = { is_freetrial: 0, vip_right_trial_type: C.a.nonTrial }; if (i) try { var L = (0, x.be)({ scene: i, sceneOptions: m, commercialStrategyService: this._commercialStrategyService, }); N = { is_freetrial: Number(L.isStrategyFreeTrial), vip_right_trial_type: L.trialType, }; var j = this._getExtraParam(i, n), O = () => { if ((null == m ? void 0 : m.version) !== S.dt.V2CharVideo) { if (m && "mode" in m) return m.mode; } }; R = { ai_type: j.aiType, ai_sub_type: j.aiSubType, vip_function_name: j.vipFunctionName, vip_function_id: j.vipFunctionId, model: j.model, generate_type: j.generateType, video_mode: O(), video_duration: g, }; } catch (e) { y.t.error("report `vip_popup` error, cannot get extra param", e); } return (0, r._)( (0, a._)((0, r._)({}, N, this.otherReportParams), { action: e, is_vip: w ? 1 : 0, user_subscribe_type: w ? h.TK[M] : 0, source: t, current_tab: u ? h.VG[u] : void 0, click_tab: f ? h.VG[f] : void 0, membership_type_now: (() => w ? (k ? h.TK[k] : h.TK[M]) : h.TK[l.d.None])(), membership_pay_type_now: (() => { if (!!w) return A ? h.Y[A] : "single_purchase"; })(), membership_type_buy: void 0 !== P ? h.TK[P] : void 0, membership_pay_type_buy: u ? h.VG[u] : void 0, pay_currency: p, order_id: c, pay_channel: o, pay_amount: s, sku: v, extra: R, is_quick_preview: Number(null != _ ? _ : 0), is_from_preview: Number(null != b ? b : 0), generate_num: I, }), (0, x.Rg)(d) ); } _getExtraParam(e) { var t, i, n, r, a, o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], { sceneOptions: s } = this._params, l = (0, S.cq)({ scene: e, sceneOptions: s }); if ((0, M.XA)({ scene: e })) { var c = this._getGenerateImageParam(); (t = I.CO.Image), (i = I.sw.Text2Image), (r = c.selectModelKey), (a = this._getImageGenerateType(e, o)); } else if ((0, M.MJ)({ scene: e })) { var d = this._getGenerateVideoParamsManager(); (t = I.CO.Video), (i = (null == d ? void 0 : d.videoBasicParams.useImage) ? I.sw.Image2Video : I.sw.Text2Video); } else (t = I.CO.Audio), (i = I.sw.GenerateAudio); return { aiType: t, aiSubType: i, vipFunctionName: n, vipFunctionId: l, model: r, generateType: a, }; } _isStoryEditor() { return this._getRouteId() === p.Sj.StoryEditor; } _isCanvasEditor() { return this._getRouteId() === p.Sj.ImageEdit; } _getRouteId() { var e, { routeId: t } = null !== (e = this._uiService.currentKeepAliveData) && void 0 !== e ? e : {}; return null != t ? t : p.Sj.Home; } _getGenerateImageParam() { if (this._isStoryEditor()) { var e = (0, b.ko)( this._containerService, g.L ).getGenerateImageParamsManager(); return { selectModelKey: null == e ? void 0 : e.selectModelKey }; } if (!this._isCanvasEditor()) return { selectModelKey: (0, b.ko)(this._containerService, m.N) .imageParamsManager.selectModelKey, }; var t, i = (0, b.ko)(this._containerService, v.C); return { selectModelKey: this._params.canvasEditorGenerateType === _.xt.HybridToImage ? c.Ij : null === (t = i.textToImageManager) || void 0 === t ? void 0 : t.selectModelKey, }; } _getGenerateVideoParamsManager() { return this._isStoryEditor() ? (0, b.ko)( this._containerService, g.L ).getGenerateVideoParamsManager() : (0, b.ko)(this._containerService, m.N); } _getImageGenerateType(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], i = [ h.vJ.ImageControlNetCanny, h.vJ.ImageControlNetDepth, h.vJ.ImageControlNetHumanFace, h.vJ.ImageControlNetObject, h.vJ.ImageControlNetPose, h.vJ.ImageControlNetReference, ]; switch (e) { case h.hO.ImageOutPaintButton: case h.hO.ImageOutPaintTextArea: return d.pi.OutPaint; case h.hO.ImageInPaintEraserButton: case h.hO.ImageInPaintEraserTextArea: return d.pi.InPaintRemove; case h.hO.ImageInPaintRepaintButton: case h.hO.ImageInPaintRepaintTextArea: return d.pi.InPaint; case h.hO.ImageMattingButton: return d.pi.Unknown; case h.hO.ImageBasicGenerate: case h.hO.ImagePromptEditor: return t.some((e) => i.includes(e)) ? d.pi.Blend : d.pi.Text2Image; default: return d.pi.Text2Image; } } constructor(e, t, i, n, r, a) { (this._params = e), (this._vipService = t), (this._containerService = i), (this._uiService = n), (this._commercialStrategyService = r), (this._contentGenerationService = a), (this.eventName = "vip_popup"); } } function R(e, t) { return N.apply(this, arguments); } function N() { return (N = (0, n._)(function* (e, t) { var i = yield (0, P.M)(e); (0, s.Kl)(i, D, [t]); })).apply(this, arguments); } D = (0, o.gn)( [ (0, o.fM)(1, A.q), (0, o.fM)(2, u.t), (0, o.fM)(3, w.e), (0, o.fM)(4, T.N), (0, o.fM)(5, m.N), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === A.q ? Object : A.q, void 0 === u.t ? Object : u.t, void 0 === w.e ? Object : w.e, void 0 === T.N ? Object : T.N, void 0 === m.N ? Object : m.N, ]), ], D ); }, 2654: function (e, t, i) { "use strict"; i.d(t, { K: function () { return r; }, L: function () { return o; }, }); var n = i(379311), r = (function (e) { return ( (e.FromModal = "from_model"), (e.BeforeMergeZip = "before_merge_zip"), (e.AfterMergeZip = "after_merge_zip"), (e.FinalParams = "final_params"), e ); })({}); class a { getEventParams() { return { step: this._params.step, data: this._params.data }; } constructor(e) { (this._params = e), (this.eventName = "blend_params"); } } function o(e, t) { (0, n.S$)(e, a, [t]); } }, 168511: function (e, t, i) { "use strict"; i.d(t, { N: function () { return y; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(379311), s = i(434712), l = i(475578), c = i(474297), d = i(881607), u = i(217448), f = i(27433), h = i(799108), p = i(484702), v = i(70137), m = i(76931), g = i(870730); class _ { getEventParams() { var { generateType: e, generateParam: t, reportParam: i, paintingReportParam: a = {}, blendReportParam: o = {}, aiRoleReportParams: s = { aiRoleCount: 0 }, customSizeReportParam: u = {}, isRetry: p = !1, lastRecord: v, secondPage: _, scene: y, benefits: b, commercialSceneOptions: I, } = this._params, { reportParam: w, imageList: x = [] } = null != v ? v : {}, S = x.map((e) => e.itemId).join(","), M = x.map((e) => e.requestId).join(","), { generateId: C = "" } = null != w ? w : {}, T = (0, r._)((0, n._)({}, i), { requestId: "", generateId: "" }), { templateId: A, generateCount: k, model: P, prompt: E, promptSource: D, scale: R, steps: N, seed: L, templateSource: j, page: O, templatePrompt: B, impressionId: F, templateTypeId: U, resolutionType: G, isWithinAgent: z, } = (0, c.JD)(t, T), V = (0, c.ZA)(i), W = { credits_need: 0, is_freetrial: 0, vip_right_trial_type: g.a.nonTrial, }; if (y) { var { credits: Z } = (0, f.Qp)({ scene: y, extraBenefits: b, sceneOptions: I, commercialStrategyService: this._commercialStrategyService, }), K = (0, f.be)({ scene: y, commercialStrategyService: this._commercialStrategyService, sceneOptions: I, }); W = { credits_need: Z, is_freetrial: Number(K.isStrategyFreeTrial), vip_right_trial_type: K.trialType, }; } return (0, r._)( (0, n._)( (0, r._)( (0, n._)( (0, r._)( (0, n._)( { generate_type: e, template_id: A, generate_cnt: k, model: P, is_prompt_empty: E ? l.eD.False : l.eD.True, prompt: E, prompt_source: D, scale: R, steps: N, seed: L, page: O, template_source: j, last_request_id: M, last_generate_id: C, last_picture_id: S, impression_id: F, is_retry: p ? l.eD.True : l.eD.False, second_page: _, template_prompt: B, ai_type: l.CO.Image, ai_sub_type: l.sw.Text2Image, is_vip: this._vipService.isVip ? l.eD.True : l.eD.False, user_subscribe_type: this._vipService.isVip ? h.TK[this._vipService.currentVipLevel] : 0, credits_now: this._commercialCreditService.localCredit, is_time_limited_free: this._commercialStrategyService .isInFreemiumStage ? l.eD.True : l.eD.False, }, (0, d.cu)((0, n._)({}, a)), (0, d.cu)((0, n._)({}, o)) ), { ai_role_cnt: null == s ? void 0 : s.aiRoleCount, role_id: null == s ? void 0 : s.roleId, role_face_intensity: (null == s ? void 0 : s.roleFaceIntensity) !== void 0 ? Math.round( (null == s ? void 0 : s.roleFaceIntensity) * 100 ) : void 0, role_subject_intensity: (null == s ? void 0 : s.roleSubjectIntensity) !== void 0 ? Math.round( (null == s ? void 0 : s.roleSubjectIntensity) * 100 ) : void 0, } ), (0, d.cu)((0, n._)({}, u)) ), { event_page: (0, m.CB)(U, j), template_from: (0, m.lg)(A, l.px.Image), template_type_id: U, definition: G, } ), (0, m.Oj)(this._containerService), W, V ), { is_within_agent: null != z ? z : 0 } ); } constructor(e, t, i, n, r) { (this._params = e), (this._commercialStrategyService = t), (this._commercialCreditService = i), (this._vipService = n), (this._containerService = r), (this.eventName = "click_generate"); } } function y(e, t) { (0, o.Kl)(e, _, [t]); } _ = (0, a.gn)( [ (0, a.fM)(1, p.N), (0, a.fM)(2, v.aG), (0, a.fM)(3, u.q), (0, a.fM)(4, s.t), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === p.N ? Object : p.N, void 0 === v.aG ? Object : v.aG, void 0 === u.q ? Object : u.q, void 0 === s.t ? Object : s.t, ]), ], _ ); }, 780144: function (e, t, i) { "use strict"; i.d(t, { s: function () { return o; }, }); var n = i(625572), r = i(379311); class a { getEventParams() { return (0, n._)({}, this._params); } constructor(e) { (this._params = e), (this.eventName = "click_quotation_mark"); } } function o(e, t) { (0, r.Kl)(e, a, [t]); } }, 102678: function (e, t, i) { "use strict"; i.d(t, { A: function () { return o; }, _: function () { return r; }, }); var n = i(379311), r = (function (e) { return ( (e.FrontPage = "front_page"), (e.TextToImageEdit = "text_to_image_edit"), e ); })({}); class a { getEventParams() { var { action: e, page: t, pictureId: i } = this._params; return { action: e, page: t, picture_id: i }; } constructor(e) { (this._params = e), (this.eventName = "go_to_canvas"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 575088: function (e, t, i) { "use strict"; i.d(t, { D$: function () { return a; }, b_: function () { return s; }, xQ: function () { return r; }, }); var n = i(379311), r = (function (e) { return (e.Ratio = "ratio"), (e.Lock = "lock"), e; })({}), a = (function (e) { return ( (e.Reference = "reference"), (e.TextToImage = "text_to_image"), e ); })({}); class o { getEventParams() { var { action: e, item: t, page: i, ratioValue: n, isWithinAgent: r, } = this._params; return { action: e, item: t, page: i, ratio_value: n, is_within_agent: r, }; } constructor(e) { (this._params = e), (this.eventName = "picture_ratio"); } } function s(e, t) { (0, n.Kl)(e, o, [t]); } }, 329870: function (e, t, i) { "use strict"; i.d(t, { cZ: function () { return a; }, io: function () { return r; }, pi: function () { return s; }, }); var n = i(379311), r = (function (e) { return (e.Success = "success"), (e.Failed = "failed"), e; })({}), a = (function (e) { return ( (e.RateError = "rate error"), (e.HeightError = "height error"), (e.WidthError = "width error"), (e.SizeError = "size error"), (e.TypeError = "type error"), (e.Unknown = "unknown error"), e ); })({}); class o { getEventParams() { var { status: e, failReason: t } = this._params; return { status: e, fail_reason: t }; } constructor(e) { (this._params = e), (this.eventName = "upload_blend_image_check"); } } function s(e, t) { (0, n.S$)(e, o, [t]); } }, 242566: function (e, t, i) { "use strict"; i.d(t, { G: function () { return r; }, N: function () { return o; }, }); var n = i(379311), r = (function (e) { return (e.Success = "success"), (e.Failed = "failed"), e; })({}); class a { getEventParams() { var { status: e, failReason: t, failCode: i, format: n, size: r, costTime: a, useCache: o, source: s, } = this._params; return { status: e, fail_reason: t, fail_code: i, format: n, size: r, cost_time: a, use_cache: o ? "1" : "0", source: s, }; } constructor(e) { (this._params = e), (this.eventName = "upload_blend_imagex"); } } function o(e, t) { (0, n.S$)(e, a, [t]); } }, 377898: function (e, t, i) { "use strict"; i.d(t, { E: function () { return c; }, }); var n = i(789786), r = i(70137), a = i(799108), o = i(379311), s = i(217448); class l { getEventParams() { var { status: e, duration: t, orderId: i, errMsg: n, productId: r, logId: o, orderType: s, } = this._params, { isVip: l, currentVipLevel: c } = this._vipService; return { status: e, duration: t, order_id: i, product_id: r, err_msg: n, order_type: s, log_id: o, is_vip: l ? 1 : 0, user_subscribe_type: l ? a.TK[c] : 0, credit_now: this._commercialCreditService.localCredit, }; } constructor(e, t, i) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this.eventName = "make_order_dev"); } } function c(e, t) { (0, o.S$)(e, l, [t]); } l = (0, n.gn)( [ (0, n.fM)(1, s.q), (0, n.fM)(2, r.aG), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === r.aG ? Object : r.aG, ]), ], l ); }, 711800: function (e, t, i) { "use strict"; i.d(t, { o: function () { return d; }, }); var n = i(789786), r = i(70137), a = i(603026), o = i(799108), s = i(379311), l = i(217448); class c { getEventParams() { var e, { status: t, duration: i, logId: n, paymentMethod: r, errMsg: a, code: s, orderId: l, orderType: c, productId: d, } = this._params, { isVip: u, currentVipLevel: f } = this._vipService, h = this._commercialGoodsService.vipPriceList.find( (e) => e.productId === d ); return { status: t, duration: i, log_id: n, err_msg: a, cycle_type: null !== (e = null == h ? void 0 : h.priceType) && void 0 !== e ? e : "un-auto", code: s, orderId: l, orderType: c, payment_method: r, is_vip: u ? 1 : 0, user_subscribe_type: u ? o.TK[f] : 0, credit_now: this._commercialCreditService.localCredit, }; } constructor(e, t, i, n) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this._commercialGoodsService = n), (this.eventName = "order_pay_dev"); } } function d(e, t) { (0, s.S$)(e, c, [t]); } c = (0, n.gn)( [ (0, n.fM)(1, l.q), (0, n.fM)(2, r.aG), (0, n.fM)(3, a.K), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === l.q ? Object : l.q, void 0 === r.aG ? Object : r.aG, void 0 === a.K ? Object : a.K, ]), ], c ); }, 331925: function (e, t, i) { "use strict"; i.d(t, { X: function () { return c; }, }); var n = i(789786), r = i(70137), a = i(799108), o = i(379311), s = i(217448); class l { getEventParams() { var { productId: e, orderId: t, orderType: i, confirmStatus: n, } = this._params, { isVip: r, currentVipLevel: o } = this._vipService; return { status: n, product_id: e, order_id: t, order_type: i, is_vip: r ? 1 : 0, user_subscribe_type: r ? a.TK[o] : 0, credit_now: this._commercialCreditService.localCredit, }; } constructor(e, t, i) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this.eventName = "pay_benefits_confirm"); } } function c(e, t) { (0, o.S$)(e, l, [t]); } l = (0, n.gn)( [ (0, n.fM)(1, s.q), (0, n.fM)(2, r.aG), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === r.aG ? Object : r.aG, ]), ], l ); }, 283919: function (e, t, i) { "use strict"; i.d(t, { h: function () { return c; }, }); var n = i(789786), r = i(70137), a = i(799108), o = i(379311), s = i(217448); class l { getEventParams() { var { status: e, duration: t, logId: i, errMsg: n, code: r, orderId: o, orderType: s, } = this._params, { isVip: l, currentVipLevel: c } = this._vipService; return { status: e, duration: t, log_id: i, err_msg: n, code: r, order_id: o, order_type: s, is_vip: l ? 1 : 0, user_subscribe_type: l ? a.TK[c] : 0, credit_now: this._commercialCreditService.localCredit, }; } constructor(e, t, i) { (this._params = e), (this._vipService = t), (this._commercialCreditService = i), (this.eventName = "query_order_dev"); } } function c(e, t) { (0, o.S$)(e, l, [t]); } l = (0, n.gn)( [ (0, n.fM)(1, s.q), (0, n.fM)(2, r.aG), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [ "undefined" == typeof IParams ? Object : IParams, void 0 === s.q ? Object : s.q, void 0 === r.aG ? Object : r.aG, ]), ], l ); }, 898387: function (e, t, i) { "use strict"; i.d(t, { j: function () { return a; }, }); var n = i(379311); class r { getEventParams() { var { status: e, duration: t, err_msg: i, type: n, filter_type: r, extra: a, } = this._params; return { status: e, duration: t, err_msg: i, type: n, filter_type: r, extra: a, }; } constructor(e) { (this._params = e), (this.eventName = "record_list_performance"); } } function a(e, t) { (0, n.S$)(e, r, [t]); } }, 65830: function (e, t, i) { "use strict"; i.d(t, { E: function () { return s; }, gZ: function () { return a; }, wU: function () { return l; }, }); var n = i(379311), r = i(475578), a = (function (e) { return ( (e.Face = "face"), (e.Subject = "subject"), (e.Canny = "canny"), (e.Depth = "depth"), (e.Pose = "pose"), (e.Style = "style"), (e.Basic = "basic"), (e.IpKeep = "ip_keep"), (e.ByteEdit = "instruct"), (e.Text2Image = ""), (e.Image2Image = ""), (e.StyleCode = ""), (e.Area = "area"), e ); })({}); class o { getEventParams() { var { status: e, failReason: t, type: i, importType: n, generateType: r, } = this._params; return { status: e, fail_reason: t, type: i, import_type: n, generate_type: r, }; } constructor(e) { (this._params = e), (this.eventName = "identification_status"); } } function s(e, t) { (0, n.Kl)(e, o, [t]); } function l(e, t, i) { s(e, { status: t, type: "subject", importType: r.ge.aigcRole, failReason: i, }); } }, 186827: function (e, t, i) { "use strict"; i.d(t, { OG: function () { return d; }, Yb: function () { return l; }, ZF: function () { return s; }, bc: function () { return h; }, fB: function () { return p; }, mG: function () { return c; }, rR: function () { return f; }, }); var n = i(625572), r = i(639880), a = i(379311), o = i(475578), s = (function (e) { return ( (e.Add = "add"), (e.Replace = "replace"), (e.Cancel = "cancel"), e ); })({}), l = (function (e) { return ( (e.firstFrame = "first_frame"), (e.lastFrame = "last_frame"), e ); })({}), c = (function (e) { return (e.Click = "click"), (e.Drag = "drag"), e; })({}), d = (function (e) { return (e.StyleControl = "style_control"), e; })({}); class u { getEventParams() { var { status: e, failReason: t, type: i, page: n, importType: r, aiVideoImageType: a, actionType: o, source: s, costTime: l, useCache: c, } = this._params; return { status: e, fail_reason: t, type: i, page: n, import_type: r, ai_video_image_type: a, action_type: o, source: s, time_cost: null != l ? l : 0, use_cache: c ? "1" : "0", }; } constructor(e) { (this._params = e), (this.eventName = "photo_import_status"); } } function f(e, t) { (0, a.S$)(e, u, [t]); } function h(e, t) { f( e, (0, r._)((0, n._)({}, t), { page: o.R7.aigcStory, importType: o.ge.aigcRole, type: "add", }) ); } function p(e, t) { f( e, (0, r._)((0, n._)({}, t), { page: o.R7.actionCopy, importType: o.ge.actionCopy, type: "add", }) ); } }, 630516: function (e, t, i) { "use strict"; i.d(t, { QV: function () { return r; }, c2: function () { return s; }, cU: function () { return a; }, }); var n = i(379311), r = (function (e) { return (e.Show = "show"), (e.Click = "click"), (e.Hover = "hover"), e; })({}), a = (function (e) { return (e.NoCutout = "no_cutout"), (e.Cutout = "cutout"), e; })({}); class o { getEventParams() { return { action: this._params.action, option: this._params.option, type: this._params.type, }; } constructor(e) { (this._params = e), (this.eventName = "reference_cutout_option"); } } function s(e, t) { (0, n.Kl)(e, o, [t]); } }, 100900: function (e, t, i) { "use strict"; i.d(t, { b: function () { return o; }, u: function () { return r; }, }); var n = i(379311), r = (function (e) { return (e.Show = "show"), (e.Click = "click"), e; })({}); class a { getEventParams() { var { action: e, type: t, value: i } = this._params, n = { action: e, type: t }; return i && (n.value = i), n; } constructor(e) { (this._params = e), (this.eventName = "reference_level_bar"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 547850: function (e, t, i) { "use strict"; i.d(t, { Ix: function () { return r; }, rx: function () { return s; }, xh: function () { return a; }, }); var n = i(379311), r = (function (e) { return ( (e.Show = "show"), (e.Cancel = "cancel"), (e.Confirm = "confirm"), e ); })({}), a = (function (e) { return ( (e.PhotoImport = "photo_import"), (e.Feedback = "feedback"), (e.Delete = "delete"), (e.Publish = "publish"), (e.ChangeScale = "change_scale"), e ); })({}); class o { getEventParams() { return { action: this._params.action, type: this._params.type }; } constructor(e) { (this._params = e), (this.eventName = "reference_popup"); } } function s(e, t) { (0, n.Kl)(e, o, [t]); } }, 350138: function (e, t, i) { "use strict"; i.d(t, { h: function () { return r; }, x: function () { return o; }, }); var n = i(379311), r = (function (e) { return (e.Thumbnail = "thumbnail"), (e.Frame = "frame"), e; })({}); class a { getEventParams() { var { position: e } = this._params; return { position: e }; } constructor(e) { (this._params = e), (this.eventName = "select_face"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 539686: function (e, t, i) { "use strict"; i.d(t, { M: function () { return o; }, }); var n = i(379311), r = i(526967); class a { getEventParams() { var e = new URLSearchParams(location.search).get(r.KL.isShared); return { second_page: this._params.secondPage, template_id: this._params.templateId, is_shared: e ? 1 : 0, }; } constructor(e) { (this._params = e), (this.eventName = "second_page_view"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 417442: function (e, t, i) { "use strict"; i.d(t, { Oc: function () { return h; }, TC: function () { return p; }, hg: function () { return v; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(379311), s = i(434712), l = i(475578), c = i(259273), d = i(727279), u = i(76931); class f { getEventParams() { var e, t; return (0, n._)( (0, r._)((0, n._)({}, this._params), { template_from: (0, u.lg)( this._params.template_id, this._params.type ), template_type_id: (0, u.pm)( this._params.template_id, this._params.type ), impression_id: null !== (t = this._params.impression_id) && void 0 !== t ? t : (0, u.ww)( (null !== (e = this._params.template_id) && void 0 !== e ? e : "" ) .split(",") .shift() ), }), (0, u.Oj)(this._containerService) ); } constructor(e, t) { (this._params = e), (this._containerService = t), (this.eventName = "publish_page"); } } function h(e, t) { (0, o.Kl)(e, f, [t]); } function p(e) { return e === c.Sj.Activity || new URLSearchParams(location.search).get(d.m.weeklyActivityKey) ? "activity" : e === c.Sj.Asset ? "asset" : e === c.Sj.ImageEdit ? "canvas" : "generation"; } function v() { return { type: "story", page: l.WZ.StoryEditor, channel: "story", author_type: l.nQ.Creator, }; } f = (0, a.gn)( [ (0, a.fM)(1, s.t), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IPublishPageParams ? Object : IPublishPageParams, void 0 === s.t ? Object : s.t, ]), ], f ); }, 474182: function (e, t, i) { "use strict"; i.d(t, { D8: function () { return b; }, Iz: function () { return I; }, dx: function () { return _; }, zj: function () { return y; }, }); var n = i(625572), r = i(639880), a = i(789786), o = i(379311), s = i(417281), l = i(434712), c = i(243302), d = i(100470), u = i(474297), f = i(475578), h = i(76931), p = i(683973); function v(e, t) { var i, n = e.itemList.find((e) => e.commonAttr.id === t); return null == n ? void 0 : null === (i = n.aigcImageParams.text2imageParams) || void 0 === i ? void 0 : i.usePe; } function m(e) { var t, { imagePromptList: i = [] } = null !== (t = e.blendImageParams) && void 0 !== t ? t : {}; return { templateStyleCode: i .reduce((e, t) => { if (t.name === s.UI.StyleCode) { var i; return e.concat( null !== (i = t.commonAsset.assetCode) && void 0 !== i ? i : "" ); } return e; }, []) .filter(Boolean), }; } class g { getEventParams() { var e, t, i, a; return (0, r._)( (0, n._)( (0, r._)((0, n._)({}, this._params), { template_from: (0, h.lg)( this._params.template_id, this._params.type ), template_type_id: (0, h.pm)( this._params.template_id, this._params.type ), impression_id: null !== (a = this._params.impression_id) && void 0 !== a ? a : (0, h.ww)( (null !== (i = this._params.template_id) && void 0 !== i ? i : "" ) .split(",") .shift() ), }), (0, h.Oj)(this._containerService) ), { agent_info: ( null === (e = this._params) || void 0 === e ? void 0 : e.agent_info ) ? JSON.stringify( null === (t = this._params) || void 0 === t ? void 0 : t.agent_info ) : void 0, } ); } constructor(e, t) { (this._params = e), (this._containerService = t), (this.eventName = "publish_status"); } } function _(e, t) { (0, o.Kl)(e, g, [t]); } function y(e) { var t = function (e) { var t, i, a = G.find((t) => t.commonAttr.id === e.itemId); if (!a) return "continue"; var { commonAttr: o, aigcImageParams: s, clientTraceData: l } = a, { text2imageParams: d, requestId: h, firstGenerateType: v, } = s || {}, { modelConfig: m } = d || {}, { generateId: g, model: _, prompt: y, promptSource: b, scale: U, steps: z, seed: V, generateCount: W, templateId: Z, templateSource: K, usePe: H, resolutionType: q, } = (0, u.JD)( (0, r._)((0, n._)({}, d), { model: null !== (t = null == m ? void 0 : m.modelReqKey) && void 0 !== t ? t : "", }), s ); q && F.push(q), I.push(o.id), w.push(h), x.push(g), S.push(_), M.push(y), C.push(b), T.push(U), A.push(z), k.push(V), P.push(W), E.push(Z), D.push(K), R.push(f.eD.True), N.push(v === c.pi.Blend), L.push(H ? f.eD.True : f.eD.False), (null == l ? void 0 : l.impressionId) && j.push(l.impressionId), O.push((0, p.$S)(a)), B.push( null !== (i = null == d ? void 0 : d.scheduleConf) && void 0 !== i ? i : "" ); }, { records: i, imageItems: a, resultCode: o, collectionId: s, channel: l, activity: h, activityId: v, title: g, description: _, authorType: y, publishStyleCode: b, } = e, I = [], w = [], x = [], S = [], M = [], C = [], T = [], A = [], k = [], P = [], E = [], D = [], R = [], N = [], L = [], j = [], O = [], B = [], F = [], U = i.reduce((e, t) => { var { templateStyleCode: i } = m(t); return e.concat(i); }, []), G = i.flatMap((e) => e.itemList); for (var z of null != a ? a : []) t(z); var V = o === d.b.ErrSuccess ? f.T9.Success : f.T9.Fail, W = o ? f.r$[o] : "", Z = {}; return ( G.forEach((e) => { var t = e.commonAttr.id, n = i.find((e) => e.itemList.some((e) => e.commonAttr.id === t)); if (n) { var r, a, o, s, l, c, d, u, f = null !== (l = null === (r = n.reportParam) || void 0 === r ? void 0 : r.aigcMode) && void 0 !== l ? l : "", h = null !== (c = null === (a = n.reportParam) || void 0 === a ? void 0 : a.imageTags) && void 0 !== c ? c : "", p = null !== (d = null === (o = n.reportParam) || void 0 === o ? void 0 : o.replyMessageId) && void 0 !== d ? d : "", v = null !== (u = null === (s = n.reportParam) || void 0 === s ? void 0 : s.chatSessionId) && void 0 !== u ? u : ""; Z[t] = { aigc_mode: f, image_tags: h, reply_message_id: p, chat_session_id: v, }; } }), { request_id: w.join(","), generate_id: x.join(","), content_id: I.join(","), is_super_resolution: R.join(","), model: S.join(","), prompt: M.join(","), prompt_source: C.join(","), scale: T.join(","), steps: A.join(","), seed: k.join(","), template_source: D.join(","), status: V, fail_reason: W, generate_cnt: P.join(","), template_id: E.join(","), picture_cnt: i.length, collection_id: s, is_reference: N.join(","), type: "composition", channel: l, activity_id: v, activity: h, title: g, description: _, author_type: y, use_pre_llm: L.join(","), impression_id: j.shift(), ab_tags: O.join(";"), schedule_conf: B.join(";"), template_style_code: U.join(","), publish_style_code: b, definition: F.join(","), agent_info: JSON.stringify(Z), } ); } function b(e) { var t, i, a, o, s, l, h, g, _, y, b, { record: I, resultCode: w, channel: x, activity: S, activityId: M, title: C, description: T, authorType: A, itemId: k, publishStyleCode: P, } = e, { commonAttr: E, aigcImageParams: D, clientTraceData: R, } = I.itemList[0], { text2imageParams: N, requestId: L, firstGenerateType: j } = D || {}, { modelConfig: O } = N || {}, B = (0, p.$S)(I.itemList[0]), { templateStyleCode: F } = m(I), { generateId: U, model: G, prompt: z, promptSource: V, scale: W, steps: Z, seed: K, generateCount: H, templateId: q, templateSource: J, resolutionType: Y, } = (0, u.JD)( (0, r._)((0, n._)({}, N), { model: null !== (h = null == O ? void 0 : O.modelReqKey) && void 0 !== h ? h : "", }), D ), Q = w === d.b.ErrSuccess ? f.T9.Success : f.T9.Fail, X = w ? f.r$[w] : "", $ = v(I, k), ee = JSON.stringify({ [k]: { aigc_mode: null !== (g = null === (t = I.reportParam) || void 0 === t ? void 0 : t.aigcMode) && void 0 !== g ? g : "", image_tags: null !== (_ = null === (i = I.reportParam) || void 0 === i ? void 0 : i.imageTags) && void 0 !== _ ? _ : "", reply_message_id: null !== (y = null === (a = I.reportParam) || void 0 === a ? void 0 : a.replyMessageId) && void 0 !== y ? y : "", chat_session_id: null !== (b = null === (o = I.reportParam) || void 0 === o ? void 0 : o.chatSessionId) && void 0 !== b ? b : "", }, }); return { request_id: L, generate_id: U, content_id: E.id, is_super_resolution: "true", model: G, prompt: z, prompt_source: V, scale: W, steps: null == Z ? void 0 : null === (s = Z.toString) || void 0 === s ? void 0 : s.call(Z), seed: null == K ? void 0 : null === (l = K.toString) || void 0 === l ? void 0 : l.call(K), template_source: J, status: Q, fail_reason: X, generate_cnt: H, template_id: q, picture_cnt: 1, is_reference: j === c.pi.Blend, type: "picture", channel: x, title: C, description: T, activity_id: M, activity: S, author_type: A, use_pre_llm: "".concat($ ? f.eD.True : f.eD.False), impression_id: null == R ? void 0 : R.impressionId, ab_tags: null != B ? B : "", schedule_conf: null == N ? void 0 : N.scheduleConf, template_style_code: F.join(","), publish_style_code: P, definition: Y, agent_info: ee, }; } function I(e) { var { authorType: t, activityId: i, activity: n, resultCode: r, channel: a, title: o, description: s, draftId: l, isPublishTemplate: c, } = e; return { content_id: l, template_source: "canvas", status: r === d.b.ErrSuccess ? f.T9.Success : f.T9.Fail, fail_reason: r ? f.r$[r] : "", type: "canvas", channel: a, title: o, description: s, activity_id: i, activity: n, author_type: t, is_publish_template: c ? f.eD.True : f.eD.False, }; } g = (0, a.gn)( [ (0, a.fM)(1, l.t), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IPublishStatusParams ? Object : IPublishStatusParams, void 0 === l.t ? Object : l.t, ]), ], g ); }, 288632: function (e, t, i) { "use strict"; i.d(t, { y: function () { return r; }, }); var n = i(798181); function r(e) { var t = e.item, i = (0, n.vu)(t); return null == i ? void 0 : i.join(","); } }, 382070: function (e, t, i) { "use strict"; i.d(t, { S: function () { return o; }, f: function () { return r; }, }); var n = i(379311), r = (function (e) { return (e.max4 = "max_4"), (e.oneSubjectOnly = "one_subject_only"), e; })({}); class a { getEventParams() { var { failToast: e, page: t, importType: i } = this._params; return { page: t, fail_toast: e, import_type: i }; } constructor(e) { (this._params = e), (this.eventName = "photo_import"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 835787: function (e, t, i) { "use strict"; i.d(t, { T: function () { return o; }, f: function () { return r; }, }); var n = i(379311), r = (function (e) { return ( (e.Show = "show"), (e.ChangeSetting = "change_setting"), (e.Replace = "replace"), (e.Delate = "delete"), e ); })({}); class a { getEventParams() { var { action: e } = this._params; return { action: e }; } constructor(e) { (this._params = e), (this.eventName = "reference_prompt_hover_action"); } } function o(e, t) { (0, n.Kl)(e, a, [t]); } }, 740242: function (e, t, i) { "use strict"; i.d(t, { bY: function () { return c; }, dz: function () { return l; }, k$: function () { return s; }, }); var n = i(379311); class r { getEventParams() { var { msg: e } = this._params; return { msg: e }; } constructor(e) { (this._params = e), (this.eventName = "websocket-error"); } } class a { getEventParams() { var { taskName: e, taskId: t, submitId: i, reason: n } = this._params; return { taskName: e, taskId: t, submitId: i, reason: n }; } constructor(e) { (this._params = e), (this.eventName = "websocket-fallback-to-polling"); } } class o { getEventParams() { var { taskName: e, taskId: t, submitId: i, taskStatus: n, duration: r, } = this._params; return { taskName: e, taskId: t, submitId: i, taskStatus: n, duration: r, }; } constructor(e) { (this._params = e), (this.eventName = "websocket-aigc-done-msg"); } } function s(e, t) { (0, n.US)(e, r, [t]); } function l(e, t) { (0, n.US)(e, a, [t]); } function c(e, t) { (0, n.US)(e, o, [t]); } }, 923401: function (e, t, i) { "use strict"; i.d(t, { $s: function () { return c; }, tQ: function () { return d; }, }); var n = i(139646), r = i(789786), a = i(969015), o = i(490165), s = i(855421), l = i(417699), c = (function (e) { return ( (e.imageCustomSize = "image_custom_size"), (e.enableIM = "enable_im"), (e.imagePostEditEnable = "post_edit_enable"), (e.draftGen = "draft_gen"), (e.videoDraftGen = "video_draft_gen"), (e.enableRuntimePrefetch = "web_runtime_prefetch_enable"), (e.enableRuntimePrefetchExtraFeed = "web_runtime_prefetch_extra_feed_enable"), (e.virtualListRenderStrategy = "virtualListRenderStrategy"), (e.lipSyncHDModel = "lip_sync_hd_enable"), (e.deepSeekEntrance = "deepseek_entrance"), (e.lipSyncHDFastModel = "lip_sync_hd_fast_enable"), e ); })({}); class d { get _isOverSea() { return this._environmentService.isOversea; } initAndExposeAbTest() { this._teaAdapterService.getABTestVar("enable_im", !1).then((e) => { (this._abGroupResult.enable_im = e), this._onDidChangeConfiguration.fire({ changedConfig: { [a.C0.AB_TEST]: { enable_im: e } }, source: a.C0.AB_TEST, previousConfig: { [a.C0.AB_TEST]: {} }, affectedSections: new Set([""]), }); }), this._teaAdapterService.getABTestVar("draft_gen", !1).then((e) => { (this._abGroupResult.draft_gen = e), this._onDidChangeConfiguration.fire({ changedConfig: { [a.C0.AB_TEST]: { draft_gen: e } }, source: a.C0.AB_TEST, previousConfig: { [a.C0.AB_TEST]: {} }, affectedSections: new Set([""]), }); }), this._teaAdapterService .getABTestVar("video_draft_gen", !1) .then((e) => { (this._abGroupResult.video_draft_gen = e), this._onDidChangeConfiguration.fire({ changedConfig: { [a.C0.AB_TEST]: { video_draft_gen: e } }, source: a.C0.AB_TEST, previousConfig: { [a.C0.AB_TEST]: {} }, affectedSections: new Set([""]), }); }), this._teaAdapterService .getABTestVar("deepseek_entrance", !1) .then((e) => { (this._abGroupResult.deepseek_entrance = e), this._onDidChangeConfiguration.fire({ changedConfig: { [a.C0.AB_TEST]: { deepseek_entrance: e } }, source: a.C0.AB_TEST, previousConfig: { [a.C0.AB_TEST]: {} }, affectedSections: new Set([""]), }); }), [ "post_edit_enable", "web_runtime_prefetch_enable", "web_runtime_prefetch_extra_feed_enable", "lip_sync_hd_fast_enable", ].forEach((e) => { this._teaAdapterService.getABTestVar(e, !1).then((t) => { this._abGroupResult[e] = t; }); }); } getBooleanRecommendTestValue() { if (this._isOverSea) return Promise.resolve(false); if (this._getLocalDreaminaRecommend()) return Promise.resolve(true); var e, t, i = null === (e = window) || void 0 === e ? void 0 : e._libra_server_abtest, n = null == i ? void 0 : null === (t = i.dreamina_recommend) || void 0 === t ? void 0 : t.all_tab_use_rec; return void 0 === n ? Promise.resolve(false) : (this._setLocalDreaminaRecommend(n), Promise.resolve(!!n)); } _getLocalDreaminaRecommend() { try { var e, t, i = null !== (t = null === (e = this._accountService) || void 0 === e ? void 0 : e.userProfile) && void 0 !== t ? t : {}; if ("{}" === JSON.stringify(i)) { var n = window.localStorage.getItem( "dreamina_recommend_hit_not_login" ); return null !== n && JSON.parse(n); } var { webId: r = "" } = null != i ? i : {}; if (!r) return !1; var a = window.localStorage.getItem( "dreamina_recommend_hit_".concat(r) ); return s.t.log("userProfile", r, a), null !== a && JSON.parse(a); } catch (e) { return !1; } } _setLocalDreaminaRecommend(e) { try { var t, i, n = null !== (i = null === (t = this._accountService) || void 0 === t ? void 0 : t.userProfile) && void 0 !== i ? i : {}; if ("{}" === JSON.stringify(n) && e) { window.localStorage.setItem( "dreamina_recommend_hit_not_login", JSON.stringify(e) ); return; } var { webId: r = "" } = null != n ? n : {}; r && e && window.localStorage.setItem( "dreamina_recommend_hit_".concat(r), JSON.stringify(e) ); } catch (e) { return !1; } } constructor(e, t, i, r) { var a = this; (this._teaAdapterService = e), (this._onDidChangeConfiguration = t), (this._environmentService = i), (this._accountService = r), (this._abGroupResult = {}), (this.getBooleanAbTestValue = (e, t) => { var i, n = null === (i = window) || void 0 === i ? void 0 : i._libra_abtest; return !!( (null == n ? void 0 : n[e]) || this._abGroupResult[e] || t ); }), (this.getAbTestValue = (function () { var e = (0, n._)(function* (e, t) { var i, n, r = null === (n = window) || void 0 === n ? void 0 : null === (i = n._libra_abtest) || void 0 === i ? void 0 : i[e]; return void 0 === r ? yield a._teaAdapterService.getABTestVar(e, t) : (a._teaAdapterService.getABTestVar(e, t), r || t); }); return function (t, i) { return e.apply(this, arguments); }; })()), (this.getBooleanAbTestValueAsync = (e, t) => { var i, n, r = null === (n = window) || void 0 === n ? void 0 : null === (i = n._libra_server_abtest) || void 0 === i ? void 0 : i.dreamina_generate_image; return (null == r ? void 0 : r[e]) === void 0 ? this._teaAdapterService.getABTestVar(e, !!t) : (this._teaAdapterService.getABTestVar(e, !!t), Promise.resolve( !!( (null == r ? void 0 : r[e]) || this._abGroupResult[e] || t ) )); }); } } d = (0, r.gn)( [ (0, r.fM)(2, l.e), (0, r.fM)(3, o.D), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof ITeaAdapterService ? Object : ITeaAdapterService, "undefined" == typeof Emitter ? Object : Emitter, void 0 === l.e ? Object : l.e, void 0 === o.D ? Object : o.D, ]), ], d ); }, 19658: function (e, t, i) { "use strict"; i.d(t, { S: function () { return a; }, }); var n = i(333597), r = i(969015), a = (0, n.LO)(r.Ui); }, 760021: function (e, t, i) { "use strict"; i.d(t, { G: function () { return u; }, q: function () { return f; }, }); var n = i(139646), r = i(789786), a = i(513294), o = i(243090), s = i(861312), l = i(576261), c = i(712942), d = i(573293), u = (function (e) { return (e.dreaminaOmniVip = "dreamina_omni_vip"), e; })({}); class f { get onDidChangeConfiguration() { return this._onDidChangeConfiguration.event; } initAndExposeAbTest() { var e = this; return (0, n._)(function* () { yield e._checkAbReady(); })(); } getAbTestValue(e, t) { var i = this; return (0, n._)(function* () { var n; return ( yield i._checkAbReady(), Promise.resolve( null !== (n = i._experimentParamsResult[e]) && void 0 !== n ? n : t ) ); })(); } getBooleanAbTestValue(e, t) { var i, n; return ( null !== (n = null !== (i = this._experimentParamsResult[e]) && void 0 !== i ? i : t) && void 0 !== n && n ); } _fetchAbTestConfig() { var e = this; return (0, n._)(function* () { var t, i = yield e._experimentService.getExperimentParams({ keys: ["dreamina_omni_vip"], aid: Number((0, c.Iv)()), }); i.ok && ((e._experimentParamsResult.dreamina_omni_vip = null === (t = (0, o.D)(i.value.params.dreamina_omni_vip || "{}")) || void 0 === t ? void 0 : t.enable), e._onDidChangeConfiguration.fire(e._experimentParamsResult)); })(); } _checkAbReady() { var e = this; return (0, n._)(function* () { yield e._abMutex.lock(); try { if (e._abReady) return; yield (0, l.Hp)(() => e._fetchAbTestConfig(), 3e3), (e._abReady = !0); } finally { e._abMutex.unLock(); } })(); } constructor(e) { (this._experimentService = e), (this._experimentParamsResult = {}), (this._onDidChangeConfiguration = new a.Q()), (this._abReady = !1), (this._abMutex = new s.L()); } } f = (0, r.gn)( [ (0, r.fM)(0, d.S), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === d.S ? Object : d.S]), ], f ); }, 917730: function (e, t, i) { "use strict"; i.d(t, { Dh: function () { return n; }, Hx: function () { return a; }, KT: function () { return r; }, }); var n = (function (e) { return ( (e.Pending = "pending"), (e.InProgress = "in_progress"), (e.InEvaluation = "in_evaluation"), (e.Awarded = "awarded"), e ); })({}), r = (function (e) { return ( (e.Video = "video"), (e.Image = "image"), (e.ShortVideo = "short_video"), (e.External = "external"), e ); })({}), a = (function (e) { return (e.POINT = "point"), (e.OTHER = "other"), e; })({}); }, 980598: function (e, t, i) { "use strict"; i.d(t, { u: function () { return n; }, }); var n = (0, i(333597).yh)("mWeb-activity-service"); }, 104818: function (e, t, i) { "use strict"; i.d(t, { P: function () { return n; }, }); var n = (0, i(333597).yh)("get-content-generation-history-service"); }, 455392: function (e, t, i) { "use strict"; i.d(t, { B: function () { return a; }, D: function () { return r; }, }); var n = i(172834); function r(e) { var t = new n.DABlendPromptPlaceHolderInfo(); return (t.abilityIndex = e.abilityIndex), t; } function a(e) { var t; return { abilityIndex: null !== (t = e.abilityIndex) && void 0 !== t ? t : 0, }; } }, 376564: function (e, t, i) { "use strict"; i.d(t, { J: function () { return o; }, a: function () { return a; }, }); var n = i(172834), r = i(716467); function a(e) { var t = new n.DACommonAssetResource(); return ( (t.assetType = r.d6[e.assetType]), (t.assetCode = e.assetCode), t ); } function o(e, t) { var i, n, a = null == t ? void 0 : null === (n = t.find((t) => t.key === e.assetCode)) || void 0 === n ? void 0 : null === (i = n.assetInfo) || void 0 === i ? void 0 : i.referImageList; return { assetType: r.H[e.assetType], assetCode: e.assetCode, referImageList: a, }; } }, 23290: function (e, t, i) { "use strict"; i.d(t, { F: function () { return a; }, _: function () { return r; }, }); var n = i(172834); function r(e) { var t = new n.DAImageControlNet(); return ( (t.name = e.name), (t.strength = e.strength), (t.imageIndex = e.imageIndex), (t.maskIndex = e.maskIndex), t ); } function a(e) { var t; if (!!e.name) return { name: e.name, strength: e.strength, imageIndex: null !== (t = e.imageIndex) && void 0 !== t ? t : 0, maskIndex: e.maskIndex, }; } }, 954681: function (e, t, i) { "use strict"; i.d(t, { X: function () { return r; }, b: function () { return a; }, }); var n = i(172834); function r(e) { var t = new n.DAImageFaceRecognize(); return ( (t.keypoint = null == e ? void 0 : e.keypoint), (t.faceRect = null == e ? void 0 : e.faceRect), (t.isSelected = null == e ? void 0 : e.isSelected), t ); } function a(e) { var t, i; return { keypoint: null !== (t = null == e ? void 0 : e.keypoint) && void 0 !== t ? t : [], faceRect: null !== (i = null == e ? void 0 : e.faceRect) && void 0 !== i ? i : [], isSelected: !!(null == e ? void 0 : e.isSelected), }; } }, 51520: function (e, t, i) { "use strict"; i.d(t, { J: function () { return a; }, V: function () { return r; }, }); var n = i(172834); function r(e) { var t = new n.DAImageIpKeep(); return ( (t.description = e.description), (t.refIdWeight = e.refIdWeight), (t.refIpWeight = e.refIpWeight), (t.characterId = e.characterId), (t.characterName = e.characterName), t ); } function a(e) { var t, i, n, r, a; return { description: null !== (t = e.description) && void 0 !== t ? t : "", refIdWeight: null !== (i = e.refIdWeight) && void 0 !== i ? i : 0, refIpWeight: null !== (n = e.refIpWeight) && void 0 !== n ? n : 0, characterId: String( null !== (r = e.characterId) && void 0 !== r ? r : "0" ), characterName: null !== (a = e.characterName) && void 0 !== a ? a : "", }; } }, 191414: function (e, t, i) { "use strict"; i.d(t, { _: function () { return o; }, t: function () { return s; }, }); var n = i(60684), r = i(172834), a = i(716467); function o(e) { var t = new r.DAImageStyleReference(); return ( (t.styleWeight = e.styleWeight), (t.styleItemId = e.styleItemId), (t.styleTitle = e.styleTitle), (t.styleTitleStarlingKey = e.styleTitleStarlingKey), (t.styleType = e.styleType && a.ed[e.styleType]), (t.image = (0, n.m)(e.image)), t ); } function s(e, t) { var i, r; return { styleWeight: null !== (i = e.styleWeight) && void 0 !== i ? i : 0, styleItemId: e.styleItemId, styleTitle: e.styleTitle, styleTitleStarlingKey: e.styleTitleStarlingKey, styleType: e.styleType && a.BH[e.styleType], image: null !== (r = (0, n.F)(e.image, t)) && void 0 !== r ? r : {}, }; } }, 716467: function (e, t, i) { "use strict"; i.d(t, { MD: () => g, ed: () => _, $P: () => A, H: () => T, db: () => I, BH: () => y, sc: () => v, Zv: () => M, $p: () => m, uC: () => x, d6: () => C, CB: () => b, nA: () => S, Di: () => w, }); var n = i("339128"), r = i("127364"), a = (function (e) { return ( (e.BgPaint = "bg_paint"), (e.Face = "face"), (e.Ip = "ip"), (e.StyleReference = "style_reference"), (e.Canny = "canny"), (e.Depth = "depth"), (e.Pose = "pose"), e ); })({}), o = i("128468"), s = i("243302"), l = i("955625"), c = i("100470"), d = i("417281"), u = i("749314"), f = i("224671"), h = i("552607"), p = i("172834"); r.e.AIGCModeWorkbench, o.JU.Workbench, r.e.AIGCModeAIGCDraft, o.JU.AIGCDraft, r.e.AIGCModeCanvas, o.JU.Canvas, r.e.AIGCModeCharacter, o.JU.Character, r.e.AIGCModeStory, o.JU.Story; var v = { [o.JU.Workbench]: p.DAAIGCMode.workbench, [o.JU.Canvas]: p.DAAIGCMode.canvas, [o.JU.Character]: p.DAAIGCMode.character, [o.JU.Story]: p.DAAIGCMode.story, [o.JU.AIGCDraft]: p.DAAIGCMode.aigcDraft, [o.JU.PostEditor]: p.DAAIGCMode.postEditor, [o.JU.CreationAgent]: p.DAAIGCMode.creationAgent, }, m = { [p.DAAIGCMode.none]: o.JU.Workbench, [p.DAAIGCMode.workbench]: o.JU.Workbench, [p.DAAIGCMode.canvas]: o.JU.Canvas, [p.DAAIGCMode.character]: o.JU.Character, [p.DAAIGCMode.story]: o.JU.Story, [p.DAAIGCMode.aigcDraft]: o.JU.AIGCDraft, [p.DAAIGCMode.postEditor]: o.JU.PostEditor, [p.DAAIGCMode.creationAgent]: o.JU.CreationAgent, }; n.tF.Init, s.Pd.Init, n.tF.Fail, s.Pd.PreTnsCheckNotPass, n.tF.Generating, s.Pd.SubmitOk, n.tF.Success, s.Pd.FinalSuccess, n.tF.CanRetry, s.Pd.FinalGenerateFail; var g = { [l.l.OutputImageRisk]: c.b.ErrPreImgRiskNotPass, [l.l.InputTextRisk]: c.b.ErrPreTextRiskNotPass, [l.l.InputTextIpBlock]: c.b.ErrPreTextIPBlockList, [l.l.GenerateFail]: c.b.ErrGenerate, [l.l.RateLimit1]: c.b.ErrRateLimit, [l.l.UnsupportedByBeta]: c.b.ErrUnsupportedByBeta, [l.l.ErrParam]: c.b.ErrParam, [l.l.ErrPostImgRiskNotPass]: c.b.ErrPostImgRiskNotPass, [l.l.ErrDownloadImage]: c.b.ErrDownloadImage, [l.l.ErrSuccess]: c.b.ErrSuccess, [l.l.ErrAssetsCodeNotExist]: c.b.ErrAssetsCodeNotExist, [l.l.ErrAssetsStatusInvalid]: c.b.ErrAssetsStatusInvalid, [l.l.ErrRateLimitForNonCommercialRegion]: c.b.ErrRateLimitForNonCommercialRegion, }; c.b.ErrPreImgRiskNotPass, l.l.OutputImageRisk, c.b.ErrPreTextRiskNotPass, l.l.InputTextRisk, c.b.ErrPreTextIPBlockList, l.l.InputTextIpBlock, c.b.ErrGenerate, l.l.GenerateFail, c.b.ErrRateLimit, l.l.RateLimit1, c.b.ErrUnsupportedByBeta, l.l.UnsupportedByBeta, c.b.ErrParam, l.l.ErrParam, c.b.ErrDownloadImage, l.l.ErrDownloadImage, c.b.ErrSuccess, l.l.ErrSuccess, c.b.ErrPostImgRiskNotPass, l.l.ErrPostImgRiskNotPass, d.kR.ControlNetPose, a.Pose, d.kR.ControlNetDepth, a.Depth, d.kR.ControlNetCanny, a.Canny, d.kR.ControlNetBgPaint, a.BgPaint; var _ = { [u.l.Preset]: p.DAImageStyleStyleType.Default, [u.l.Custom]: p.DAImageStyleStyleType.Customize, }, y = { [p.DAImageStyleStyleType.Default]: u.l.Preset, [p.DAImageStyleStyleType.Customize]: u.l.Custom, }, b = { [f.jP.OneOne]: p.DAImageRatioType.ImageRatioType_11, [f.jP.ThreeFour]: p.DAImageRatioType.ImageRatioType_34, [f.jP.FourThree]: p.DAImageRatioType.ImageRatioType_43, [f.jP.NineSixteen]: p.DAImageRatioType.ImageRatioType_916, [f.jP.SixteenNine]: p.DAImageRatioType.ImageRatioType_169, [f.jP.TwoThree]: p.DAImageRatioType.ImageRatioType_23, [f.jP.ThreeTwo]: p.DAImageRatioType.ImageRatioType_32, [f.jP.TwentyOneNine]: p.DAImageRatioType.ImageRatioType_219, }, I = { [p.DAImageRatioType.ImageRatioType_11]: f.jP.OneOne, [p.DAImageRatioType.ImageRatioType_34]: f.jP.ThreeFour, [p.DAImageRatioType.ImageRatioType_43]: f.jP.FourThree, [p.DAImageRatioType.ImageRatioType_916]: f.jP.NineSixteen, [p.DAImageRatioType.ImageRatioType_169]: f.jP.SixteenNine, [p.DAImageRatioType.ImageRatioType_23]: f.jP.TwoThree, [p.DAImageRatioType.ImageRatioType_32]: f.jP.ThreeTwo, [p.DAImageRatioType.ImageRatioType_219]: f.jP.TwentyOneNine, }, w = { [d.UI.FaceGan]: p.DABlendAbilityName.FaceGan, [d.UI.BgPaint]: p.DABlendAbilityName.BgPaint, [d.UI.Image2image]: p.DABlendAbilityName.I2I, [d.UI.ControlNet]: p.DABlendAbilityName.ControlNet, [d.UI.StyleReference]: p.DABlendAbilityName.StyleReference, [d.UI.IpKeep]: p.DABlendAbilityName.IpKeep, [d.UI.Unknown]: p.DABlendAbilityName.Unknown, [d.UI.Text2image]: p.DABlendAbilityName.T2I, [d.UI.ByteEdit]: p.DABlendAbilityName.ByteEdit, [d.UI.StyleCode]: p.DABlendAbilityName.StyleCode, }, x = { [p.DABlendAbilityName.FaceGan]: d.UI.FaceGan, [p.DABlendAbilityName.BgPaint]: d.UI.BgPaint, [p.DABlendAbilityName.I2I]: d.UI.Image2image, [p.DABlendAbilityName.ControlNet]: d.UI.ControlNet, [p.DABlendAbilityName.StyleReference]: d.UI.StyleReference, [p.DABlendAbilityName.IpKeep]: d.UI.IpKeep, [p.DABlendAbilityName.Unknown]: d.UI.Unknown, [p.DABlendAbilityName.T2I]: d.UI.Text2image, [p.DABlendAbilityName.ByteEdit]: d.UI.ByteEdit, [p.DABlendAbilityName.StyleCode]: d.UI.StyleCode, }, S = { [s.pi.Unknown]: p.DAAIGCGenerateType.none, [s.pi.Text2Image]: p.DAAIGCGenerateType.text2image, [s.pi.SuperResolution]: p.DAAIGCGenerateType.superResolution, [s.pi.FineTunePromptWithText2Image]: p.DAAIGCGenerateType.fineTunePromptWithText2Image, [s.pi.FineTunePromptWithSuperResolution]: p.DAAIGCGenerateType.fineTunePromptWithSuperResolution, [s.pi.Text2CreativeText]: p.DAAIGCGenerateType.text2CreativeTxet, [s.pi.SpecialEffect]: p.DAAIGCGenerateType.specialEffect, [s.pi.InPaint]: p.DAAIGCGenerateType.inPainting, [s.pi.OutPaint]: p.DAAIGCGenerateType.outPainting, [s.pi.InPaintRemove]: p.DAAIGCGenerateType.inPaintingRemove, [s.pi.Text2Video]: p.DAAIGCGenerateType.text2Video, [s.pi.Blend]: p.DAAIGCGenerateType.blend, [s.pi.SuperDefinition]: p.DAAIGCGenerateType.normalHD, [s.pi.Matting]: p.DAAIGCGenerateType.imageCut, [s.pi.Fusion]: p.DAAIGCGenerateType.imageFusion, [s.pi.VideoBGM]: p.DAAIGCGenerateType.videoBGM, [s.pi.AudioVideoMix]: p.DAAIGCGenerateType.audioVideoMix, [s.pi.InstaDrag]: p.DAAIGCGenerateType.instaDrag, [s.pi.Image2Avatar]: p.DAAIGCGenerateType.image2Avatar, [s.pi.Video2Avatar]: p.DAAIGCGenerateType.video2Avatar, [s.pi.Text2Song]: p.DAAIGCGenerateType.text2Song, [s.pi.Text2Instrumental]: p.DAAIGCGenerateType.text2Instrumental, [s.pi.LipSync]: p.DAAIGCGenerateType.lipSync, [s.pi.InPaintAndOutPaint]: p.DAAIGCGenerateType.inPaintingAndOutPainting, [s.pi.ByteEditPainting]: p.DAAIGCGenerateType.byteEditPainting, [s.pi.VideoTemplate]: p.DAAIGCGenerateType.videoTemplate, [s.pi.AIEffectWorkImage]: p.DAAIGCGenerateType.aIEffectWorkImage, [s.pi.AIEffectWorkVideo]: p.DAAIGCGenerateType.aIEffectWorkVideo, [s.pi.VideoAudioEffect]: p.DAAIGCGenerateType.none, [s.pi.VideoAudioEffectMix]: p.DAAIGCGenerateType.none, }, M = { [p.DAAIGCGenerateType.none]: s.pi.Unknown, [p.DAAIGCGenerateType.text2image]: s.pi.Text2Image, [p.DAAIGCGenerateType.superResolution]: s.pi.SuperResolution, [p.DAAIGCGenerateType.fineTunePromptWithText2Image]: s.pi.FineTunePromptWithText2Image, [p.DAAIGCGenerateType.fineTunePromptWithSuperResolution]: s.pi.FineTunePromptWithSuperResolution, [p.DAAIGCGenerateType.text2CreativeTxet]: s.pi.Text2CreativeText, [p.DAAIGCGenerateType.specialEffect]: s.pi.SpecialEffect, [p.DAAIGCGenerateType.inPainting]: s.pi.InPaint, [p.DAAIGCGenerateType.outPainting]: s.pi.OutPaint, [p.DAAIGCGenerateType.inPaintingRemove]: s.pi.InPaintRemove, [p.DAAIGCGenerateType.text2Video]: s.pi.Text2Video, [p.DAAIGCGenerateType.blend]: s.pi.Blend, [p.DAAIGCGenerateType.normalHD]: s.pi.SuperDefinition, [p.DAAIGCGenerateType.imageCut]: s.pi.Matting, [p.DAAIGCGenerateType.imageFusion]: s.pi.Fusion, [p.DAAIGCGenerateType.videoBGM]: s.pi.VideoBGM, [p.DAAIGCGenerateType.audioVideoMix]: s.pi.AudioVideoMix, [p.DAAIGCGenerateType.instaDrag]: s.pi.InstaDrag, [p.DAAIGCGenerateType.image2Avatar]: s.pi.Image2Avatar, [p.DAAIGCGenerateType.video2Avatar]: s.pi.Video2Avatar, [p.DAAIGCGenerateType.text2Song]: s.pi.Text2Song, [p.DAAIGCGenerateType.text2Instrumental]: s.pi.Text2Instrumental, [p.DAAIGCGenerateType.lipSync]: s.pi.LipSync, [p.DAAIGCGenerateType.inPaintingAndOutPainting]: s.pi.InPaintAndOutPaint, [p.DAAIGCGenerateType.byteEditPainting]: s.pi.ByteEditPainting, [p.DAAIGCGenerateType.videoTemplate]: s.pi.VideoTemplate, [p.DAAIGCGenerateType.aIEffectWorkImage]: s.pi.AIEffectWorkImage, [p.DAAIGCGenerateType.aIEffectWorkVideo]: s.pi.AIEffectWorkVideo, [p.DAAIGCGenerateType.videoAudioEffect]: s.pi.VideoAudioEffect, }, C = { [o.d_.Style]: p.DACommonAssetType.Style }, T = { [p.DACommonAssetType.Style]: o.d_.Style }; function A(e) { if (!e) return; var t = new p.DADraft({ JSONString: e }), i = new p.DADraft(), n = t.componentList.findIndex((e) => (0, h.r4)(e)), r = t.componentList.slice(0, n); if (0 !== r.length) { var a = r.pop(); return ( (i.componentList = r), a && i.setMainComponent(a), i.toJSONString() ); } } }, 645968: function (e, t, i) { "use strict"; i.d(t, { d: () => R, n: () => N }); var n = i("789786"), r = i("333597"), a = i("139646"), o = i("625572"), s = i("639880"), l = i("586315"), c = i("538337"), d = i("940140"), u = { getFeedList: { hostNameType: d.b_.Default, url: "/mweb/v1/feed" }, geExplorList: { hostNameType: d.b_.Default, url: "/mweb/v1/get_explore", }, getFeedPanel: { hostNameType: d.b_.Default, url: "/mweb/v1/get_panel_info", }, }, f = i("643590"), h = i("416105"), p = i("804274"), v = i("875649"), m = i("879976"); function g(e) { var t = new f.y().build({ headers: (0, o._)({ "Content-Type": "application/json" }, e), withCredentials: !0, }); return (0, m.V)(t), (0, h.mH)(t), (0, p.xP)(t), (0, v.e_)(t), t; } var _ = i("820266"), y = i("280166"), b = i("712942"), I = i("242089"), w = i("100470"), x = i("104974"), S = i("757330"), M = i("423719"), C = i("793723"), T = i("389657"), A = i("265587"); function k(e) { return P.apply(this, arguments); } function P() { return (P = (0, a._)(function* (e) { var t = (0, _.b)(e, p.D1), i = e.__cacheSyncToken, n = e.__logId; if (i && n && t.item_list) { var r = yield T.Li.decryptIV(i, n); yield (0, M.sh)(T.Li.decrypt.bind(T.Li), t.item_list, r); } var a = yield T.sn.getSignOptions(); if (((0, C.$U)(T.sn.sign.bind(T.sn), t.item_list, a), t.item_list)) for (var o = 0; o < t.item_list.length; o++) t.item_list[o].video && (t.item_list[o] = (0, A.Q)( t.item_list[o], t.item_list[o].video.origin_video )), (t.item_list[o].request_id = t.request_id), (t.item_list[o].impression_id = t.request_id); return (0, _.b)(t, p.zW, !1); })).apply(this, arguments); } class E { getFeedList(e) { var t = this; return (0, a._)(function* () { try { var i = "".concat((0, b.H4)()).concat(u.getFeedList.url), n = "".concat(i, "_").concat((0, c.SZ)(e)), r = yield (0, I.O)(n, () => t._networkClient.post( i, { category_id: e.categoryId, count: e.count, image_info: e.imageInfo, offset: e.offset, pack_item_opt: { need_data_integrity: !0 }, }, { params: { aid: t._environmentService.appId } } ) ), a = yield t._formateRes(r); return (0, l.oW)((0, S.s)(a)); } catch (e) { var { ret: o, errmsg: s } = e || {}, d = o ? Number(o) : w.b.ErrCommon; return (0, l.wf)(d, null != s ? s : "unknown error"); } })(); } getFeedListForRecommend(e) { var t = this; return (0, a._)(function* () { try { var i = "".concat((0, b.H4)()).concat(u.geExplorList.url), n = "".concat(i, "_").concat((0, c.SZ)(e)), r = yield (0, I.O)(n, () => t._networkClient.post( i, (0, _.X)( (0, s._)((0, o._)({}, e), { packItemOpt: { needDataIntegrity: !0 }, }) ), { params: { aigc_flow_version: x.currentDreaminaAgreementVersion, }, } ) ), a = yield t._formateRes(r); return (0, l.oW)((0, S.s)(a)); } catch (e) { var { ret: d, errmsg: f } = e || {}, h = d ? Number(d) : w.b.ErrCommon; return (0, l.wf)(h, null != f ? f : "unknown error"); } })(); } getFeedPanel(e) { var t = this; return (0, a._)(function* () { try { var i = "".concat((0, b.H4)()).concat(u.getFeedPanel.url), n = yield (0, I.O)(i, () => t._networkClient.post( "".concat((0, b.H4)()).concat(u.getFeedPanel.url), (0, o._)({}, e) ) ); return (0, l.oW)(n); } catch (e) { var { ret: r, errmsg: a } = e || {}, s = r ? Number(r) : w.b.ErrCommon; return (0, l.wf)(s, null != a ? a : "unknown error"); } })(); } _formateRes(e) { return k(e); } constructor(e) { (this._environmentService = e), (this._networkClient = g({ ch: "online" })); } } E = (0, n.gn)( [ (0, n.fM)(0, y.Y), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [void 0 === y.Y ? Object : y.Y]), ], E ); var D = i("434712"), R = (0, r.yh)("mWeb-feed-service"); class N { get feedRepository() { return this._feedRepository; } constructor(e) { (this._containerService = e), (this._feedRepository = this._containerService.createInstance(E)); } } N = (0, n.gn)( [ (0, n.fM)(0, D.t), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [void 0 === D.t ? Object : D.t]), ], N ); }, 757330: function (e, t, i) { "use strict"; i.d(t, { s: function () { return o; }, }); var n = i(625572), r = i(639880), a = i(247465); function o(e) { var t = e.itemList.map((e) => (0, a.q)(e)); return (0, r._)((0, n._)({}, e), { itemList: t }); } }, 247465: function (e, t, i) { "use strict"; i.d(t, { q: () => x }); var n = i("433965"), r = i("625572"), a = i("639880"), o = i("96"), s = i("936690"), l = i("601191"), c = i("128468"), d = i("60684"), u = i("172834"), f = i("716467"), h = i("455392"), p = i("191414"), v = i("954681"), m = i("51520"), g = i("23290"), _ = i("376564"), y = i("727280"), b = i("997166"); class I { convert() { var e, t, i, n, d = this._blendParams(); if (!d) return (0, r._)({}, this._item); var { originPrompt: u } = d, f = (0, o._)(d, ["originPrompt"]), h = (0, a._)((0, r._)({}, this._item.aigcImageParams), { blendParams: f, }); void 0 !== u && (0, s.V8)(h, u); var p = (0, s.qv)(this._item), v = (0, s.Uq)(f), m = (0, l.Mu)(p, f, c.JU.Workbench), g = (0, s.DI)(this._item, m), _ = null !== (n = null === (i = this._item) || void 0 === i ? void 0 : null === (t = i.commonAttr) || void 0 === t ? void 0 : null === (e = t.itemUrls) || void 0 === e ? void 0 : e[0]) && void 0 !== n ? n : ""; return (0, a._)((0, r._)({}, this._item), { aigcImageParams: h, blendParams: { blendAttributes: v, imagePromptList: m, promptPlaceholderInfoList: g, imagePromptZipUrl: _, }, }); } _blendParams() { var e, t, i, n, a, o, s, l, c, y, b, I = this._item.aigcImageParams.blendParams; if (!!I) { if (!this._mainComponent) return I; var { abilities: w } = null !== (o = this._mainComponent) && void 0 !== o ? o : {}, x = null === (e = this._draft) || void 0 === e ? void 0 : e.findRootComponent(), S = x instanceof u.DAImageBaseComponent ? x : void 0, M = null !== (s = null == w ? void 0 : w.blend) && void 0 !== s ? s : null == S ? void 0 : null === (t = S.abilities) || void 0 === t ? void 0 : t.blend; if (!M) return I; var C = { promptPlaceholderInfoList: null !== (l = null === (i = M.promptPlaceholderInfoList) || void 0 === i ? void 0 : i.map(h.B)) && void 0 !== l ? l : null == I ? void 0 : I.promptPlaceholderInfoList, abilityList: (null !== (c = null === (n = M.abilityList) || void 0 === n ? void 0 : n.map((e) => { var t, i, n, r, a = e.name && f.uC[e.name]; if (!!a) { var o = this._item.aigcDraftResources, s = e.styleReference ? (0, p.t)(e.styleReference, o) : void 0, l = null === (t = e.faceRecognizeList) || void 0 === t ? void 0 : t.map((e) => e.map(v.b)), c = null === (i = e.ipKeepList) || void 0 === i ? void 0 : i.map(m.J).filter(Boolean), u = null === (n = e.controlNetList) || void 0 === n ? void 0 : n.map(g.F).filter(Boolean), h = null === (r = e.imageList) || void 0 === r ? void 0 : r .map((e) => (0, d.F)(e, o)) .filter(Boolean), y = e.commonAsset ? (0, _.J)(e.commonAsset, o) : void 0; return { name: a, extra: e.extra, strength: e.strength, largeImageList: h, coverImageList: h, imageList: [], controlNetList: u, ipKeepList: c, styleReference: s, faceRecognizeList: l, commonAsset: y, }; } })) && void 0 !== c ? c : [] ).filter(Boolean), hasItemUrls: I.hasItemUrls, model: I.model, sampleStrength: I.sampleStrength, styleReference: I.styleReference, }, T = this._resolveStyleCodeBlendAbilityParams( null !== (y = null === (a = M.coreParam) || void 0 === a ? void 0 : a.prompt) && void 0 !== y ? y : "", C.abilityList, null !== (b = C.promptPlaceholderInfoList) && void 0 !== b ? b : [] ); return (0, r._)({ originPrompt: T.prompt }, C, T); } } _resolveStyleCodeBlendAbilityParams(e, t, i) { var n, r = (0, y.DH)({ prompt: e, imagePromptList: t.filter((e) => void 0 !== e), commonAssetList: null !== (n = this._item.aigcImageParams.publishAssetList) && void 0 !== n ? n : [], promptPlaceholderInfoList: i, }); return r ? r : { prompt: (0, b.IA)(this._item.aigcImageParams), abilityList: t, promptPlaceholderInfoList: i, }; } constructor(e) { this._item = e; var { aigcDraft: t } = e; if (null == t ? void 0 : t.content) { var i = new u.DADraft({ JSONString: t.content }); this._draft = i; var n = i.componentList.find((e) => e.id === i.mainComponentId); n instanceof u.DAImageBaseComponent && (this._mainComponent = n); } } } class w { convert() { var e, t, i = ( null !== (t = null === (e = this._item.collection) || void 0 === e ? void 0 : e.itemList) && void 0 !== t ? t : [] ).map((e) => new I(e).convert()); return (0, a._)((0, r._)({}, this._item), { collection: { itemList: i }, }); } constructor(e) { this._item = e; } } function x(e) { return (0, n.DF)(e) ? new I(e).convert() : (0, n.Rb)(e) ? new w(e).convert() : e; } }, 884569: function (e, t, i) { "use strict"; i.d(t, { o: () => P, M: () => E }); var n = i("789786"), r = i("333597"), a = i("139646"), o = i("625572"), s = i("639880"), l = i("643590"), c = i("416105"), d = i("879976"), u = i("956719"); function f() { var e = new l.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return (0, d.V)(e), (0, c.mH)(e), (0, u.E)(e), e; } var h = i("940140"), p = { getHomePage: { hostNameType: h.b_.Default, url: "/mweb/v1/get_homepage", }, getLikeList: { hostNameType: h.b_.Default, url: "/mweb/v1/get_favorite_list", }, doFollowUser: { hostNameType: h.b_.Default, url: "/mweb/v1/follow" }, }, v = i("586315"), m = i("820266"), g = i("423719"), _ = i("793723"), y = i("389657"), b = i("712942"), I = i("242089"), w = i("265587"), x = i("100470"), S = i("433965"), M = i("247465"); function C(e) { var t = e.itemList.map((e) => (0, S.jD)(e) || (0, S.Rb)(e) || (0, S.DF)(e) ? (0, M.q)(e) : e ); return (0, s._)((0, o._)({}, e), { itemList: t }); } function T(e) { return e ? e.replace(/_([a-z])/g, (e, t) => t.toUpperCase()) : ""; } class A { getDataList(e) { var t = this; return (0, a._)(function* () { try { var i, n = "".concat((0, b.H4)()).concat(p.getHomePage.url), r = "" .concat(n, "_") .concat( null !== (i = e.imageType) && void 0 !== i ? i : e.imageTypeList ); e.packItemOpt = (0, s._)((0, o._)({}, e.packItemOpt), { needDataIntegrity: !0, }); var a = yield (0, I.O)( r, () => t._networkClient.post(n, (0, m.X)(e)), !0 ), l = a.__cacheSyncToken, c = a.__logId; if (l) { var d = yield y.Li.decryptIV(l, c); yield (0, g.sh)(y.Li.decrypt.bind(y.Li), a.item_list, d); } var u = yield y.sn.getSignOptions(); (0, _.$U)(y.sn.sign.bind(y.sn), a.item_list, u); for (var f = 0; f < a.item_list.length; f++) a.item_list[f].video && (a.item_list[f] = (0, w.Q)(a.item_list[f])); var h = (0, m.b)(a, T), S = C(h); return (0, v.oW)(S); } catch (e) { var { ret: M, errmsg: A } = e || {}, k = M ? Number(M) : x.b.ErrCommon; return (0, v.wf)(k, null != A ? A : "unknown error"); } })(); } getLikeDataList(e) { var t = this; return (0, a._)(function* () { try { for ( var i, n = "".concat((0, b.H4)()).concat(p.getLikeList.url), r = "" .concat(n, "_") .concat( null !== (i = e.imageType) && void 0 !== i ? i : e.imageTypeList ), a = yield (0, I.O)( r, () => t._networkClient.post(n, (0, o._)({}, (0, m.X)(e))), !0 ), s = 0; s < a.item_list.length; s++ ) a.item_list[s].video && (a.item_list[s] = (0, w.Q)(a.item_list[s])); var l = (0, m.b)(a, T), c = C(l); return (0, v.oW)(c); } catch (e) { var { ret: d, errmsg: u } = e || {}, f = d ? Number(d) : x.b.ErrCommon; return (0, v.wf)(f, null != u ? u : "unknown error"); } })(); } doFollowUser(e) { var t = this; return (0, a._)(function* () { try { var i = "".concat((0, b.H4)()).concat(p.doFollowUser.url), n = "".concat(i, "_").concat(e.op, "_").concat(e.secUid), r = yield (0, I.O)(n, () => t._networkClient.post(i, (0, o._)({}, (0, m.X)(e))) ); return (0, v.oW)(r); } catch (e) { var { ret: a, errmsg: s } = e || {}, l = a ? Number(a) : x.b.ErrCommon; return (0, v.wf)(l, null != s ? s : "unknown error"); } })(); } constructor() { this._networkClient = f(); } } var k = i("434712"), P = (0, r.yh)("mWeb-home-page-service"); class E { get homePageRepository() { return this._homePageRepository; } constructor(e) { (this._containerService = e), (this._homePageRepository = this._containerService.createInstance(A)); } } E = (0, n.gn)( [ (0, n.fM)(0, k.t), (0, n.w6)("design:type", Function), (0, n.w6)("design:paramtypes", [void 0 === k.t ? Object : k.t]), ], E ); }, 902519: function (e, t, i) { "use strict"; i.d(t, { PK: function () { return a; }, Ym: function () { return r; }, im: function () { return o; }, lX: function () { return n; }, }); var n = (function (e) { return (e.Post = "post"), (e.Like = "like"), e; })({}), r = (function (e) { return (e.Template = "template"), (e.Story = "story"), e; })({}), a = (function (e) { return ( (e[(e.IMAGE_SINGLE = 1)] = "IMAGE_SINGLE"), (e[(e.IMAGE_COLLECTION = 2)] = "IMAGE_COLLECTION"), (e[(e.SINGLE_AND_COLLECTION = 3)] = "SINGLE_AND_COLLECTION"), (e[(e.VIDEO = 4)] = "VIDEO"), (e[(e.MASTERPIECE = 5)] = "MASTERPIECE"), (e[(e.MIXED_ROWS = 6)] = "MIXED_ROWS"), (e[(e.CANVAS_PRODUCTION = 7)] = "CANVAS_PRODUCTION"), e ); })({}), o = (function (e) { return ( (e[(e.Follow = 1)] = "Follow"), (e[(e.CancelFollow = 2)] = "CancelFollow"), e ); })({}); }, 665588: function (e, t, i) { "use strict"; i.d(t, { B9: function () { return r; }, B_: function () { return a; }, G8: function () { return s; }, dS: function () { return o; }, oE: function () { return n; }, }); var n = "storyboard-backup-drag-content", r = "storyboard-draft-backup-drag-content", a = "storyboard-timeline-drag-content", o = "image-input-drag-content", s = "story-image-input-drag-content"; }, 462537: function (e, t, i) { "use strict"; i.d(t, { R: function () { return n; }, }); var n = (0, i(333597).yh)("dragUploadFileService"); }, 331480: function (e, t, i) { "use strict"; i.d(t, { D8: function () { return r; }, Dx: function () { return s; }, Te: function () { return a; }, xq: function () { return o; }, }); var n = i(333597), r = (function (e) { return ( (e.DISCONNECTED = "disconnected"), (e.CONNECTING = "connecting"), (e.OPEN = "open"), e ); })({}), a = (function (e) { return ( (e[(e.GeneralMessage = 11015)] = "GeneralMessage"), (e[(e.AigcVideoTask = 10001)] = "AigcVideoTask"), (e[(e.AigcVideoFirstFrame = 10002)] = "AigcVideoFirstFrame"), (e[(e.TextArt = 10003)] = "TextArt"), (e[(e.GroupKeyGenerated = 10004)] = "GroupKeyGenerated"), (e[(e.AigcFlow = 10005)] = "AigcFlow"), (e[(e.AudioTaskProcessingMessage = 10006)] = "AudioTaskProcessingMessage"), (e[(e.GenerateTaskStatusMessage = 10007)] = "GenerateTaskStatusMessage"), (e[(e.IllegalAccountKickOut = 20001)] = "IllegalAccountKickOut"), (e[(e.VoiceTaskChange = 10013)] = "VoiceTaskChange"), (e[(e.VideoAudioMixed = 10014)] = "VideoAudioMixed"), (e[(e.LipSyncVideoDetectTask = 10015)] = "LipSyncVideoDetectTask"), (e[(e.PreProcessDetectTask = 10010)] = "PreProcessDetectTask"), e ); })({}), o = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.Processing = 10)] = "Processing"), (e[(e.Success = 20)] = "Success"), (e[(e.Fail = 30)] = "Fail"), e ); })({}), s = (0, n.yh)("dreamina-websocket-service"); }, 222721: function (e, t, i) { "use strict"; i.d(t, { e: function () { return n; }, }); var n = (0, i(333597).yh)("feed-prefetch-service"); }, 364767: function (e, t, i) { "use strict"; i.d(t, { C: function () { return n; }, }); var n = (0, i(333597).yh)("generate-image-params-service"); }, 285993: function (e, t, i) { "use strict"; i.d(t, { q: function () { return E; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(789786), s = i(243302), l = i(76212), c = i(992393), d = i(869919), u = i(434712), f = i(675601), h = i(77922), p = i(260963), v = i(208540), m = i(182688), g = i(351066), _ = i(566291), y = i(950835), b = i(586315), I = i(699813), w = i(899229), x = i(645421), S = i(800088), M = i(799108), C = i(292180), T = i(70137), A = i(484702), k = i(624515), P = i(99123); class E extends S.U { get status() { return this.taskData.status; } get audioData() { return this.observableAudioData; } startTask() { var e = this; return (0, n._)(function* () { try { if (e.observableData.data.status !== g.C.INIT) return (0, b.wf)(-1, "task can not start"); e._logger.info( "generate video audio effect start, submitId ".concat( e.observableData.data.id ) ); var t, i = e._formatSubmitParams(); (0, P.lt)(e.observableData.data.id, e.observableData.data.inputParams, e._option.mode, e.observableData.data.generateType, e._videoDraftGenerationManager.getIsEnableToUseDraftGen(e.taskData.taskDetail)); var n = (0, x.T)({ submitId: e.observableData.data.id, scene: e.observableData.data.scene, needCredits: e.observableData.data.needCredits, commercialStrategyService: e._commercialStrategyService, }), r = e._commercialCreditService.addLocalCreditHistory(n), a = yield e._submitAudioEffectTask(i); if ( (a.code && (e.observableData.data.errorCode = a.code), (0, P.hw)(e._containerService, e.observableData.data.id, a), !a.ok) ) return ( (0, p.z)(() => { e.observableData.data.status = g.C.FAIL; }), e._logger.error( "generate video audio effect fail, submitId " .concat(e.id, ", logId ") .concat( null === (t = a.errorInfo) || void 0 === t ? void 0 : t.logId ) ), (0, _.Y)(a), r.dispose(), e._commercialCreditService.syncRemoteCreditHistory(), a ); var { value: { task: o, historyRecordId: l, videoDreamina: c }, } = a; return ( (0, p.z)(() => { (e.observableData.data.taskId = o.taskId), (e.id = l), (e.observableData.data.id = l), (e.observableData.data.taskDetail = o), (e.observableData.data.videoDetail = c), (e.observableData.data.status = e._formatServerStatus( a.value )), (e.observableData.data.forecastGenerateCost = a.value.forecastGenerateCost), (e.observableData.data.forecastQueueCost = a.value.forecastQueueCost); }), e._logger.info( "generate task success, task id " .concat(o.taskId, ", params is ") .concat(JSON.stringify(i)) ), v.BW.includes(o.status) && e._createAndExecuteWebsocketPollingManager(), o.status === s.Pd.FinalSuccess && (e.observableData.data.videoResource = e._getResource( a.value )), (0, b.oW)(e.taskData) ); } catch (e) { return (0, b.wf)(-1, "submit Task fail", e); } })(); } _submitAudioEffectTask(e) { if (this._videoDraftGenerationManager.getIsEnableToUseDraftGen()) { var t = this._formatGenerateAudioEffectRequestParams(e); return this._dataService.submitTaskByDraft(t, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_audio_effect", feature_entrance: (0, l.b2)(), feature_entrance_detail: "".concat( (0, l.b2)(), "-audio-effect" ), }), }); } return this._dataService.submitVideoAudioEffectTask(e, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_audio_effect", feature_entrance: (0, l.b2)(), feature_entrance_detail: "".concat((0, l.b2)(), "-audio-effect"), }), }); } _formatGenerateAudioEffectRequestParams(e) { return new c.s(e).convert(); } updateDefault(e) { (0, p.z)(() => { var t; (this.observableAudioData.default = e), (null === (t = this.observableData.data.videoDetail) || void 0 === t ? void 0 : t.default) && (this.observableData.data.videoDetail.default = e); }); } markPublished(e) { var t, { videoDetail: i } = this.observableData.data; if (!!i) { var n = null === (t = i.audioList) || void 0 === t ? void 0 : t.map((t) => { var n, { audio: o, mixAudioVideo: s } = t; return o.vid === (null === (n = i.default) || void 0 === n ? void 0 : n.vid) && s ? { audio: o, mixAudioVideo: (0, a._)((0, r._)({}, s), { hasPublished: !!e, publishItemId: e, }), } : t; }); (0, p.z)(() => { this.observableData.data.videoDetail = (0, a._)((0, r._)({}, i), { audioList: n, }); }); } } createMixTask(e, t) { var i = this; return (0, n._)(function* () { var n = (0, y.Rl)(), o = { submitId: n, status: g.C.INIT, inputParams: { input: e, submitId: n, scene: d.zk.AudioEffect }, createdTime: Date.now(), }, s = i._containerService.createInstance( k.j, { data: o }, (0, a._)((0, r._)({}, t), { onMixSuccess: (e, n) => { var r; (0, p.z)(() => { i.observableData.data.videoDetail = e.videoDetail; }), null === (r = t.onMixSuccess) || void 0 === r || r.call(t, e, n); }, }) ); return ( yield s.startTask(), Promise.resolve((0, r._)({}, s.taskData)) ); })(); } _formatServerStatus(e) { var t, { videoDreamina: i, task: n } = e; return n.status !== s.Pd.FinalSuccess || (null == i ? void 0 : null === (t = i.audioList) || void 0 === t ? void 0 : t.length) ? (0, m.KZ)(n.status) : g.C.FAIL; } _formatServerData2AudioData(e) { var { videoDreamina: t } = e; return ( (0, p.z)(() => { this.observableData.data.status = this._formatServerStatus(e); }), { default: null == t ? void 0 : t.default } ); } _formatSubmitParams() { var e, t, i, n, r, a, { inputParams: o, scene: s, videoDetail: l } = this.taskData, { transcode: c, originVideo: d } = null != l ? l : {}, u = null !== (i = null !== (t = null !== (e = null == c ? void 0 : c["720p"]) && void 0 !== e ? e : null == c ? void 0 : c["360p"]) && void 0 !== t ? t : null == c ? void 0 : c.origin) && void 0 !== i ? i : d; return { submitId: this.submitId, mode: this._option.mode, commerceInfo: { resourceId: M.Zw, resourceIdType: "str", resourceSubType: "aigc", benefitType: (0, C.Z)( (0, w.cq)({ scene: s, sceneOptions: { version: w.dt.V2, mode: (0, w.xc)(o.originFps), containerService: this._containerService, }, }) ), }, historyOption: { storyId: this._option.storyId }, taskExtra: JSON.stringify(o.extra), videoAudioInput: { originHistoryId: null !== (n = this._originHistoryId) && void 0 !== n ? n : "", originItemId: null !== (r = null == l ? void 0 : l.aigcItemId) && void 0 !== r ? r : "", originVideoDetail: { videoId: null !== (a = null == l ? void 0 : l.videoId) && void 0 !== a ? a : "", coverUrl: null == l ? void 0 : l.coverUrl, durationMs: null == l ? void 0 : l.durationMs, duration: null == l ? void 0 : l.duration, originVideo: { videoUrl: (null == u ? void 0 : u.url) || "", width: null == u ? void 0 : u.width, height: null == u ? void 0 : u.height, }, }, }, draftContent: this._option.originDraftContent, v2vOpt: o.v2vOpt, }; } constructor(e, t, i, n, r, a) { super(e, t, i, n, r, a), (this._containerService = t), (this._dataService = i), (this._resourceService = n), (this._commercialCreditService = r), (this._commercialStrategyService = a), (this.observableAudioData = {}); var { data: o, serviceData: s, videoAudioData: l } = e; if ( ((0, I.Y2)(null != o ? o : s), (this._originHistoryId = null == l ? void 0 : l.originHistoryId), s) ) { var c = this._formatServerData2AudioData(s); this.observableAudioData = (0, p.LO)(c); } this.observableData.data.status === g.C.LOADING && this._createAndExecuteWebsocketPollingManager(); } } E = (0, o.gn)( [ (0, o.fM)(1, u.t), (0, o.fM)(2, f.g), (0, o.fM)(3, h.c), (0, o.fM)(4, T.aG), (0, o.fM)(5, A.N), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof VideoAudioEffectTaskParams ? Object : VideoAudioEffectTaskParams, void 0 === u.t ? Object : u.t, void 0 === f.g ? Object : f.g, void 0 === h.c ? Object : h.c, void 0 === T.aG ? Object : T.aG, void 0 === A.N ? Object : A.N, ]), ], E ); }, 442052: function (e, t, i) { "use strict"; i.d(t, { A: () => F }); var n = i("139646"), r = i("625572"), a = i("639880"), o = i("96"), s = i("789786"), l = i("243302"), c = i("76212"), d = i("869919"), u = i("868725"), f = i("434712"), h = i("675601"), p = i("77922"), v = i("260963"), m = i("208540"), g = i("182688"), _ = i("351066"), y = i("566291"), b = i("950835"), I = i("586315"), w = i("699813"), x = i("899229"), S = i("645421"), M = i("800088"), C = i("799108"), T = i("292180"), A = i("613983"), k = i("99123"), P = i("379311"), E = i("475578"), D = i("217448"); class R { getEventParams() { var { status: e, errorCode: t, errorMsg: i, rank: n, aiMusicType: r, submitId: a, taskId: o, time: s, videoId: l, musicPrompt: c, aiMusicId: d, } = this._params, { isVip: u, currentVipLevel: f } = this._vipService; return { status: e, error_code: t, error_msg: i, rank: n, ai_music_type: r, video_id: l, submit_id: a, task_id: o, ai_music_id: d, time: s, music_prompt: c, page: E.WZ.AigcVideo, is_vip: u ? 1 : 0, user_subscribe_type: u ? C.TK[f] : 0, }; } constructor(e, t) { (this._params = e), (this._vipService = t), (this.eventName = "ai_music_generate_status"); } } R = (0, s.gn)( [ (0, s.fM)(1, D.q), (0, s.w6)("design:type", Function), (0, s.w6)("design:paramtypes", [ "undefined" == typeof AiMusicGenerateStatusParams ? Object : AiMusicGenerateStatusParams, void 0 === D.q ? Object : D.q, ]), ], R ); var N = (e, t) => (0, P.Kl)(e, R, [t]), L = i("227700"), j = i("70137"), O = i("484702"), B = i("624515"); class F extends M.U { get taskData() { return this.observableData.data; } get status() { return this.taskData.status; } get bgmData() { return this.observableBgmData.data; } startTask() { var e = this; return (0, n._)(function* () { try { if (e.observableData.data.status !== _.C.INIT) return (0, I.wf)(-1, "task can not start"); e._logger.info( "generate bgm start, submitId ".concat(e.observableData.data.id) ), (0, k.lt)( e.observableData.data.id, e.observableData.data.inputParams, e._option.mode, e.observableData.data.generateType, e._videoDraftGenerationManager.getIsEnableToUseDraftGen( e.taskData.taskDetail ) ); var t, i = (0, S.T)({ submitId: e.observableData.data.id, scene: e.observableData.data.scene, needCredits: e.observableData.data.needCredits, commercialStrategyService: e._commercialStrategyService, }), n = e._commercialCreditService.addLocalCreditHistory(i), r = e._formatSubmitParams(), a = yield e._submitBGMTask(r); if ( (a.code && (e.observableData.data.errorCode = a.code), (0, k.hw)(e._containerService, e.observableData.data.id, a), !a.ok) ) return ( (0, v.z)(() => { e.observableData.data.status = _.C.FAIL; }), e._logger.error( "generate bgm fail, submitId " .concat(e.id, ", logId ") .concat( null === (t = a.errorInfo) || void 0 === t ? void 0 : t.logId ) ), (0, y.Y)(a), n.dispose(), e._commercialCreditService.syncRemoteCreditHistory(), a ); var { value: { task: o, historyRecordId: s, videoDreamina: c }, } = a; return ( (0, v.z)(() => { (e.observableData.data.taskId = o.taskId), (e.id = s), (e.observableData.data.id = s), (e.observableData.data.taskDetail = o), (e.observableData.data.videoDetail = c), (e.observableData.data.status = e._formatServerStatus( a.value )), (e.observableData.data.forecastGenerateCost = a.value.forecastGenerateCost), (e.observableData.data.forecastQueueCost = a.value.forecastQueueCost); }), e._logger.info( "generate task success, task id " .concat(o.taskId, ", params is ") .concat(JSON.stringify(r)) ), m.BW.includes(o.status) && e._createAndExecuteWebsocketPollingManager(), o.status === l.Pd.FinalSuccess && (e.observableData.data.videoResource = e._getResource( a.value )), e._reportAiMusicGenerateStatus(), (0, I.oW)(e.taskData) ); } catch (e) { return (0, I.wf)(-1, "submit Task fail", e); } })(); } _submitBGMTask(e) { if (this._videoDraftGenerationManager.getIsEnableToUseDraftGen()) { var t = this._formatGenerateBgmRequestParams(e); return this._dataService.submitTaskByDraft(t, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_video_bgm", feature_entrance: (0, c.b2)(), feature_entrance_detail: "".concat((0, c.b2)(), "-bgm"), }), }); } return this._dataService.submitVideoBGMTask(e, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_video_bgm", feature_entrance: (0, c.b2)(), feature_entrance_detail: "".concat((0, c.b2)(), "-bgm"), }), }); } updateDefaultBgm(e) { (0, v.z)(() => { var t; (this.observableBgmData.data.defaultBgm = e), (null === (t = this.observableData.data.videoDetail) || void 0 === t ? void 0 : t.default) && (this.observableData.data.videoDetail.default = e); }); } markPublished(e) { var t, { videoDetail: i } = this.observableData.data; if (!!i) { var n = null === (t = i.audioList) || void 0 === t ? void 0 : t.map((t) => { var n, { audio: o, mixAudioVideo: s } = t; return o.vid === (null === (n = i.default) || void 0 === n ? void 0 : n.vid) && s ? { audio: o, mixAudioVideo: (0, a._)((0, r._)({}, s), { hasPublished: !!e, publishItemId: e, }), } : t; }); (0, v.z)(() => { this.observableData.data.videoDetail = (0, a._)((0, r._)({}, i), { audioList: n, }); }); } } createMixTask(e, t) { var i = this; return (0, n._)(function* () { var n = (0, b.Rl)(), o = { submitId: n, status: _.C.INIT, inputParams: { input: e, submitId: n, scene: d.zk.BGM }, createdTime: Date.now(), }, s = i._containerService.createInstance( B.j, { data: o }, (0, a._)((0, r._)({}, t), { onMixSuccess: (e, n) => { var r; (0, v.z)(() => { i.observableData.data.videoDetail = e.videoDetail; }), null === (r = t.onMixSuccess) || void 0 === r || r.call(t, e, n); }, }) ); return ( yield s.startTask(), Promise.resolve((0, r._)({}, s.taskData)) ); })(); } _formatGenerateBgmRequestParams(e) { return new u.V(e).convert(); } _formatServerStatus(e) { var t, { videoDreamina: i, task: n } = e; return n.status !== l.Pd.FinalSuccess || (null == i ? void 0 : null === (t = i.audioList) || void 0 === t ? void 0 : t.length) ? (0, g.KZ)(n.status) : _.C.FAIL; } _formatServerData2BgmData(e) { var t, i, n, r, a, o, s, l, c, u, f, { videoDreamina: h, task: p } = e; return ( (0, v.z)(() => { this.observableData.data.status = this._formatServerStatus(e); }), { input: { originHistoryId: null !== (c = null === (t = p.videoBGMInfo) || void 0 === t ? void 0 : t.originHistoryId) && void 0 !== c ? c : "", originItemId: null !== (u = null === (i = p.videoBGMInfo) || void 0 === i ? void 0 : i.originItemId) && void 0 !== u ? u : "", duration: null !== (f = null === (n = p.videoBGMInfo) || void 0 === n ? void 0 : n.duration) && void 0 !== f ? f : 0, tags: null === (r = p.videoBGMInfo) || void 0 === r ? void 0 : r.tags, accord: (null === (a = p.videoBGMInfo) || void 0 === a ? void 0 : a.promptSource) === d.X2.Tag ? A.kP.custom : A.kP.frame, frameUrl: null === (s = p.videoBGMInfo) || void 0 === s ? void 0 : null === (o = s.videoFirstFrame) || void 0 === o ? void 0 : o.imageUrl, videoFirstFrame: null === (l = p.videoBGMInfo) || void 0 === l ? void 0 : l.videoFirstFrame, }, } ); } _formatSubmitParams() { var { inputParams: e, scene: t } = this.taskData, { input: i } = this.bgmData; return { submitId: this.submitId, input: { duration: i.duration, originHistoryId: i.originHistoryId, originItemId: i.originItemId, tags: i.accord === A.kP.custom ? i.tags : void 0, videoFirstFrame: i.accord === A.kP.frame ? i.videoFirstFrame : void 0, }, mode: this._option.mode, commerceInfo: { resourceId: C.Zw, resourceIdType: "str", resourceSubType: "aigc", benefitType: (0, T.Z)( (0, x.cq)({ scene: t, sceneOptions: { version: x.dt.V2, mode: (0, x.xc)(e.originFps), containerService: this._containerService, }, }) ), }, historyOption: { storyId: this._option.storyId }, draftContent: this._option.originDraftContent, taskExtra: JSON.stringify(e.extra), v2vOpt: e.v2vOpt, }; } _reportAiMusicGenerateStatus() { var { status: e, videoDetail: t, taskDetail: i, createdTime: n, submitId: r, errorCode: a, } = this.taskData; if (!![_.C.FAIL, _.C.SUCCESS].includes(e)) { var o = e === _.C.SUCCESS; if ( (null == t ? void 0 : t.audioList) && (null == i ? void 0 : i.videoBGMInfo) ) { var s, l = null === (s = i.videoBGMInfo.tags) || void 0 === s ? void 0 : s .map((e) => { var { name: t } = e; return t; }) .join(","); t.audioList.forEach((e, s) => { var c, u = o && "success" === e.audio.status; N(this._containerService, { status: u ? "success" : "fail", time: Date.now() - n, submitId: r, errorCode: o ? a : void 0, rank: s + 1, aiMusicType: (null === (c = i.videoBGMInfo) || void 0 === c ? void 0 : c.promptSource) === d.X2.Tag ? L.hp.custom : L.hp.frame, taskId: i.taskId, videoId: t.videoId, musicPrompt: l, aiMusicId: e.audio.vid, }); }); } } } constructor(e, t, i, n, r, a) { var { bgmData: s } = e, l = (0, o._)(e, ["bgmData"]); super(l, t, i, n, r, a), (this._containerService = t), (this._dataService = i), (this._resourceService = n), (this._commercialCreditService = r), (this._commercialStrategyService = a); var { data: c, serviceData: d } = l; if (((0, w.Y2)(null != c ? c : d), s)) this.observableBgmData = (0, v.LO)({ data: s }); else if (d) { var u = this._formatServerData2BgmData(d); this.observableBgmData = (0, v.LO)({ data: u }); } else throw Error("init bgm info loss"); this.observableData.data.status === _.C.LOADING && this._createAndExecuteWebsocketPollingManager(); } } F = (0, s.gn)( [ (0, s.fM)(1, f.t), (0, s.fM)(2, h.g), (0, s.fM)(3, p.c), (0, s.fM)(4, j.aG), (0, s.fM)(5, O.N), (0, s.w6)("design:type", Function), (0, s.w6)("design:paramtypes", [ "undefined" == typeof AigcVideoBGMTaskParams ? Object : AigcVideoBGMTaskParams, void 0 === f.t ? Object : f.t, void 0 === h.g ? Object : h.g, void 0 === p.c ? Object : p.c, void 0 === j.aG ? Object : j.aG, void 0 === O.N ? Object : O.N, ]), ], F ); }, 800088: function (e, t, i) { "use strict"; i.d(t, { U: function () { return Q; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(789786), s = i(260963), l = i(773820), c = i(317825), d = i(509525), u = i(586315), f = i(699813), h = i(588735), p = i(733787), v = i(76212), m = i(434487), g = i(224671), _ = i(243302), y = i(434712), b = i(675601), I = i(77922), w = i(474956), x = i(799108), S = i(292180), M = i(566291), C = i(3329), T = i(584531), A = i(331480), k = i(99123), P = i(227700), E = i(67752), D = i(70137), R = i(484702), N = i(899229), L = i(652660), j = i(388977), O = i(740242), B = i(475578), F = i(645421), U = i(351066), G = i(182688), z = i(208540), V = i(76931), W = i(97075), Z = i(39333), K = i(412961), H = i(673326), q = i(542462), J = i(950835), Y = "AigcVideoTask"; class Q { get submitId() { var e, t; return null !== (t = this._submitId) && void 0 !== t ? t : null === (e = this.taskData) || void 0 === e ? void 0 : e.submitId; } get taskData() { return this.observableData.data; } get status() { return this.taskData.status; } forceUpdateTask() { var e = this; return (0, n._)(function* () { if (!!e.taskData.taskId) try { var t, i = yield e._queryTask(); if (!i.ok) { e._logger.error( "generate task query fail, history id " .concat(e.taskData.id, " task id ") .concat(e.taskData.taskId, ", logId ") .concat( null === (t = i.errorInfo) || void 0 === t ? void 0 : t.logId ) ); return; } var n = i.value.taskResult; n.createdTime = 0 === n.createdTime ? e.observableData.data.createdTime : n.createdTime; var r = e._formateServerData(n, !0); return (e.observableData.data = r), r; } catch (t) { e._logger.error( "generate task query fail, history id " .concat(e.taskData.id, " task id ") .concat(e.taskData.taskId) ); return; } })(); } startTask() { var e = this; return (0, n._)(function* () { return yield e._startTask(); })(); } startTaskFromOuterPromise(e) { var t = this; return (0, n._)(function* () { return yield t._startTask(e); })(); } _startTask(e) { var t = this; return (0, n._)(function* () { try { if (t.observableData.data.status !== U.C.INIT) return (0, u.wf)(-1, "task can not start"); (t.observableData.data.errorCode = h.sb.Pending), t._logger.info( "generate task start, submitId ".concat( t.observableData.data.id ) ); var i, n, r, a = t._formatTaskDataToParams(); (0, k.lt)(t.observableData.data.id, t.observableData.data.inputParams, t._option.mode, t.observableData.data.generateType, t._videoDraftGenerationManager.getIsEnableToUseDraftGen(t.taskData.taskDetail, a)); var o = (0, F.T)({ submitId: t.observableData.data.id, scene: t.observableData.data.scene, needCredits: t.observableData.data.needCredits, commercialStrategyService: t._commercialStrategyService, }), l = t._commercialCreditService.addLocalCreditHistory(o), c = yield t._submitTask(a, e); if ( ((t.observableData.data.errorCode = void 0), (0, k.hw)(t._containerService, t.observableData.data.id, c), c.code && (t.observableData.data.errorCode = c.code), !c.ok) ) return ( [ h.sb.NoCredit, h.sb.NotInvited, h.sb.RateLimit, h.sb.TnsNotPass, h.sb.ErrPunishLimitAIGenerate, h.sb.ErrSharkNotPass, h.sb.ErrRateLimitForNonCommercialRegion, ].includes(c.code) ? (0, s.z)(() => { (t.observableData.data.status = U.C.FAIL), (t.observableData.data.taskDetail = c.errorInfo.data.task); }) : (0, s.z)(() => { (t.observableData.data.status = U.C.RETRYABLE_FAIL), (t.observableData.data.taskDetail = c.errorInfo.data.task); }), t._logger.error( "generate task fail, submitId " .concat(t.id, ", logId ") .concat( null === (r = c.errorInfo) || void 0 === r ? void 0 : r.logId ) ), (0, M.Y)(c), l.dispose(), t._commercialCreditService.syncRemoteCreditHistory(), c ); return ( (null === (i = c.value.firstFrameImage) || void 0 === i ? void 0 : i.imageUrl) && (t.observableData.data.firstFrameImage = c.value.firstFrameImage), (null === (n = c.value.lastFrameImage) || void 0 === n ? void 0 : n.imageUrl) && (t.observableData.data.lastFrameImage = c.value.lastFrameImage), (0, s.z)(() => { (t.observableData.data.taskId = c.value.task.taskId), (t.id = c.value.historyRecordId), (t.observableData.data.id = c.value.historyRecordId), (t.observableData.data.taskDetail = c.value.task), (t.observableData.data.videoDetail = c.value.videoDreamina), (t.observableData.data.status = (0, G.KZ)( c.value.task.status )), (t.observableData.data.forecastGenerateCost = c.value.forecastGenerateCost), (t.observableData.data.forecastQueueCost = c.value.forecastQueueCost), (t.observableData.data.failCode = c.value.failCode), (t.observableData.data.generateId = c.value.generateId); }), t._logger.info( "generate task success, task id " .concat(c.value.task.taskId, ", commercialScene is ") .concat(t.observableData.data.scene, " creditPatch is ") .concat(JSON.stringify(o), " currentCredit is ") .concat( t._commercialCreditService.localCredit, ", params is " ) .concat(JSON.stringify(a)) ), z.BW.includes(c.value.task.status) && c.value.task.priority !== p.T8.Relax && t._createAndExecuteWebsocketPollingManager(), (0, u.oW)(t.taskData) ); } catch (e) { return (0, u.wf)(-1, "submit Task fail", e); } })(); } _submitTask(e, t) { var i = (0, C.r)(e); if ( this._videoDraftGenerationManager.getIsEnableToUseDraftGen( this.taskData.taskDetail, e ) ) return this._dataService.submitTaskByDraft( this._formatGenerateVideoRequestParams(e), { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: i, feature_entrance: (0, v.b2)(), feature_entrance_detail: "" .concat((0, v.b2)(), "-") .concat("to_video-lipsync" === i ? "lipsync" : i), }), } ); var n = this._dataService.submitTask.bind(this); return (null != t ? t : n)(e, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: i, feature_entrance: (0, v.b2)(), feature_entrance_detail: "" .concat((0, v.b2)(), "-") .concat("to_video-lipsync" === i ? "lipsync" : i), }), }); } retryTask() { var e = this; return (0, n._)(function* () { return e.observableData.data.status !== U.C.RETRYABLE_FAIL ? (0, u.wf)(-1, "task can not Retry") : ((e.observableData.data.status = U.C.INIT), (e.observableData.data.inputParams.createdTime = Date.now()), yield e.startTask()); })(); } updateHistoryGroupKeyMd5(e) { (0, s.z)(() => { this.observableData.data.historyGroupKeyMd5 = e; }); } markFavorite(e) { this.observableData.data.hasFavorited = e; } markPublished(e) { this.observableData.data.videoDetail && (this.observableData.data.videoDetail = (0, a._)( (0, r._)({}, this.observableData.data.videoDetail), { publishedItemId: e } )); } _queryTask() { var e = this; return (0, n._)(function* () { var t = e._formatTaskDataToParams(); if ( e._videoDraftGenerationManager.getIsEnableToUseDraftPolling( e.taskData.taskDetail, t ) ) { var i = e.taskData.id, n = yield e._dataService.queryTaskByDraft({ historyIds: [i] }); return n.ok ? (0, u.oW)({ logId: n.value.logId, taskResult: n.value.taskMap[i], }) : n; } var r = "".concat(e.taskData.taskId), a = yield e._dataService.queryTask({ taskIdList: [r] }); return a.ok ? (0, u.oW)({ logId: a.value.logId, taskResult: a.value.taskMap[r], }) : a; })(); } _pollProgress() { var e = this; return (0, n._)(function* () { if (!!e.taskData.taskId) try { var t, i, n, o = yield e._queryTask(); if (!o.ok) { e._logger.error( "generate task query fail, isUseDraftGen is " .concat( null === (i = e.taskData.taskDetail) || void 0 === i ? void 0 : i.isUseDraftGen, " task submitId " ) .concat(e.taskData.submitId, " task id ") .concat(e.taskData.taskId, ", logId ") .concat( null === (n = o.errorInfo) || void 0 === n ? void 0 : n.logId ) ), (e._pollErrorCount += 1), e._pollErrorCount < z.nf && setTimeout(() => { e._pollProgress(); }, z.cr); return; } var { taskResult: l } = o.value; (e._pollErrorCount = 0), e._logger.info( "generate task query success, isUseDraftGen is " .concat( null === (t = e.taskData.taskDetail) || void 0 === t ? void 0 : t.isUseDraftGen, " task submitId " ) .concat(e.taskData.submitId, " task id ") .concat(e.taskData.taskId, ", status ") .concat(l.task.status, ", logId ") .concat(o.value.logId) ), z.BW.includes(l.task.status) && setTimeout(() => { e._pollProgress(); }, z.cr), (l.createdTime = 0 === l.createdTime ? e.observableData.data.createdTime : l.createdTime), (0, k.FT)( e._containerService, l, e._option.mode, o.value.logId, e.observableData.data.inputParams ); var c = e._formateServerData(l); !e.observableData.data.firstFrameImage && c.firstFrameImage && (e.observableData.data.firstFrameImage = c.firstFrameImage); var d = (0, G.KZ)(l.task.status); if (d === e.observableData.data.status) return; if ( ((0, s.z)(() => { e.observableData.data = (0, a._)( (0, r._)({}, e.observableData.data, c), { status: d, taskDetail: c.taskDetail, videoDetail: c.videoDetail, createdTime: c.createdTime, } ); }), [U.C.FAIL, U.C.SUCCESS].includes(d)) ) { var u = (0, T.Y)(l); (e.observableData.data.inputParams = u), e._commercialCreditService.syncRemoteCreditHistory(); } d === U.C.SUCCESS && (e.observableData.data.videoResource = e._getResource(l)); } catch (t) { (e._pollErrorCount += 1), e._pollErrorCount < z.nf && setTimeout(() => { e._pollProgress(); }, z.cr); } })(); } _formatTaskDataToParams() { var e, t, i, n, o, c, { inputParams: d, scene: u } = this.taskData, { originDraftContent: f, isRegenerate: h, originHistoryId: p, originItemId: v, } = this._option; return { submitId: this.observableData.data.submitId, input: { videoGenInputs: (0, r._)( { firstFrameImage: null === (e = d.inputImages) || void 0 === e ? void 0 : e.find((e) => e.type === l.z.FirstFrame), endFrameImage: null === (t = d.inputImages) || void 0 === t ? void 0 : t.find((e) => e.type === l.z.LastFrame), lensMotionType: d.motionType, motionSpeed: d.motionSpeed, prompt: d.textPrompt, vid: d.vid, audioVid: d.audioVid, v2vOpt: (0, s.ZN)(d.v2vOpt), i2vOpt: (0, s.ZN)(d.i2vOpt), originDurationMs: d.originDurationMs, originFps: d.originFps, videoMode: d.videoMode, motionIntensity: d.motionIntensity, batchNumber: d.batchNumber, templateId: d.templateId, }, d.boximator ? { boximator: (0, r._)({ enable: !0 }, d.boximator) } : {} ), seed: d.seed, videoAspectRatio: d.videoRatio, priority: d.priority, modelReqKey: d.modelReqKey, }, templateId: d.templateId, taskPayload: { taskExtra: (0, a._)( (0, r._)({}, null !== (n = d.extra) && void 0 !== n ? n : {}), { originTemplateId: d.templateId, impressionId: null !== (o = d.impressionId) && void 0 !== o ? o : (0, V.ww)(d.templateId), imageNameMapping: null === (i = d.inputImages) || void 0 === i ? void 0 : i.reduce( (e, t) => (t.name && (e[t.imageUri] = t.name), e), {} ), } ), }, commerceInfo: { resourceId: x.Zw, resourceIdType: "str", resourceSubType: "aigc", benefitType: (0, S.Z)( (0, N.cq)({ scene: u, sceneOptions: (0, N.S9)(u) ? { version: N.dt.V2CharVideo, characterMode: d.videoMode, containerService: this._containerService, } : { version: N.dt.V2, mode: (0, N.xc)(d.originFps), containerService: this._containerService, modelReqKey: d.modelReqKey, }, }) ), }, scene: d.scene, aiGenInfo: d.aiGenInfo, preTaskId: d.preTaskId, mode: this._option.mode, historyOption: { storyId: this._option.storyId }, clientTraceData: { impressionId: null !== (c = d.impressionId) && void 0 !== c ? c : (0, V.ww)(d.templateId), }, draftContent: f, originHistoryId: p, originItemId: v, isRegenerate: h, }; } _formatGenerateVideoRequestParams(e) { return new W.Z(e).convert(); } _formateServerData(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = (0, T.o)(e); return ( [U.C.SUCCESS, U.C.FAIL].includes(i.status) && (i.videoResource = this._getResource(e, t)), i ); } _getResource(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (!!e.videoDreamina) { var i = String(e.videoDreamina.key); t && this._resourceService.delete(i, w._g.VideoDreamina); var n = (0, m.nQ)( this._resourceService, w._g.VideoDreamina, e.videoDreamina ); return null == n || n.getCoverResourceToken().startImmediately(), n; } } _createPollingManager(e) { var { websocketMessageHandler: t, onFallbackToPolling: i } = e, n = this._formatTaskDataToParams(); return this._videoDraftGenerationManager.getIsEnableToUseDraftPolling( this.taskData.taskDetail, n ) ? this._containerService.createInstance(L.Q, { methodId: A.Te.GenerateTaskStatusMessage, websocketMessageHandler: (e, i) => t({ submitId: i.submitId, status: i.status }), onFallbackToPolling: i, pollingHandler: this._pollProgress.bind(this), timeout: 6e4, }) : this._containerService.createInstance(L.Q, { methodId: A.Te.AigcVideoTask, websocketMessageHandler: (e, i) => t({ submitId: i.submitId, status: i.taskStatus }), onFallbackToPolling: i, pollingHandler: this._pollProgress.bind(this), timeout: 3e5, }); } _createAndExecuteWebsocketPollingManager() { if (!this._websocketManager) { var e = Date.now(), t = this._createPollingManager({ websocketMessageHandler: (t) => this.observableData.data.submitId !== t.submitId || void 0 === t.status || [g.j0.Init, g.j0.SubmitOk].includes(t.status) ? { accepted: !1, done: !1 } : ((0, k.q)(t.submitId), (0, O.bY)(this._containerService, { taskName: "aigc-video", taskId: this.observableData.data.taskId, submitId: this.observableData.data.submitId, taskStatus: t.status, duration: Date.now() - e, }), this._pollProgress(), { accepted: !0, done: !0 }), onFallbackToPolling: (e) => { (0, O.dz)(this._containerService, { taskName: "aigc-video", taskId: this.observableData.data.taskId, submitId: this.observableData.data.submitId, reason: e, }); }, }); (0, j.ko)(this._containerService, A.Dx).registerEventHandler( A.Te.AigcVideoFirstFrame, (e) => { this.observableData.data.taskId === e.taskId && (0, s.z)(() => { var { width: t, height: i, format: n, imageUrl: r, } = e.imageInfo; this.observableData.data.firstFrameImage = { width: t, height: i, format: n, imageUrl: r, }; }); } ), (0, c.Rr)((e) => t.startListening(e), { contextType: d.zO.Task, processName: Y, }), (this._websocketManager = t); } } _registerTaskStateChangeReport() { (0, s.U5)( () => this.observableData.data.status, (e) => { var t; if (!![U.C.SUCCESS, U.C.FAIL].includes(e)) this._reportTaskStateChange( this.observableData.data, null === (t = this._option.reportParams) || void 0 === t ? void 0 : t.enterFrom ); } ); } _reportTaskStateChange(e) { var t, i, n, o, s, c, d, u, f, p, v = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : P.MY.FirstPage; if (Q.finishReportFlagMapper.get(this.submitId)) return; Q.finishReportFlagMapper.set(this.submitId, !0); var { videoDetail: m, status: g, id: y, taskDetail: b, errorCode: I, inputParams: w, failCode: x, generateType: S, generateId: M, } = e; if (!![U.C.SUCCESS, U.C.FAIL].includes(g)) { var C = g === U.C.FAIL ? P.qb.fail : P.qb.success, T = (0, K.iS)(m, b, y, w, S), A = (0, K.Wo)(w, b), k = null === (t = w.boximator) || void 0 === t ? void 0 : t.boxes.map((e, t) => { var i, n = e.motionPath.length ? 1 : 0, r = (null === (i = e.boundingBox) || void 0 === i ? void 0 : i.length) > 1 ? 1 : 0; return { ["Box".concat(t + 1)]: { is_path_added: n, is_end_added: r, }, }; }), D = [ _.Pd.PostTnsCheckNotPass, _.Pd.FinalGenerateFail, _.Pd.PostTnsCheckNotPass, _.Pd.PreTnsCheckNotPass, ], R = null !== (u = null == b ? void 0 : null === (i = b.taskPayload) || void 0 === i ? void 0 : i.taskExtra) && void 0 !== u ? u : w.extra, N = null == R ? void 0 : R.generateTimes, L = null == m ? void 0 : m.aigcParams.text2videoParams, j = (0, K.J8)({ taskDetail: b, videoDetail: m }), O = null !== (f = R.templateType) && void 0 !== f ? f : B.px.Video; (null == L ? void 0 : null === (c = L.videoGenInputs) || void 0 === c ? void 0 : null === (s = c[0]) || void 0 === s ? void 0 : null === (o = s.firstFrameImage) || void 0 === o ? void 0 : null === (n = o.aigcImage) || void 0 === n ? void 0 : n.itemId) && (O = B.px.TextToImageTOVideo); var { v2vOpt: F, i2vOpt: G } = null !== (p = null == b ? void 0 : b.originalInput.videoGenInputs[0]) && void 0 !== p ? p : w, z = null == R ? void 0 : R.lipSyncInfo, W = null == R ? void 0 : R.originSubmitId; null === (d = (0, q.Cb)(this._containerService)) || void 0 === d || d.then((t) => { var i, n, o, s, c, d, u, f, p, g, _, y; (0, E.i)( this._containerService, (0, r._)( (0, a._)( (0, r._)( (0, a._)( (0, r._)( { page: B.WZ.AigcVideo, status: C, is_draft_gen: ( null == b ? void 0 : b.isUseDraftGen ) ? B._O.True : B._O.False, time: Date.now() - e.createdTime, submit_id: e.submitId, error_code: void 0 !== I && I !== h.sb.Success ? "".concat(I) : void 0, task_error_code: (null == b ? void 0 : b.status) && D.includes(b.status) ? "".concat(b.status) : void 0, fail_code: x, fail_reason: b ? "".concat(x) : "taskFail", video_duration: m ? Number(m.durationMs) : w.originDurationMs, }, T ), { enter_from: v, origin_submit_id: W, add_more_cnt: T.prompt_source === l.K.AddMore && N ? N : void 0, original_frame_rate: A.originalFrameRate ? "".concat(A.originalFrameRate, "fps") : void 0, new_frame_rate: A.newFrameRate ? "".concat(A.newFrameRate, "fps") : void 0, original_resolution: A.originalResolution, new_resolution: A.newResolution, frame_interpolation_cnt: T.prompt_source === l.K.FrameInterpolation ? A.frameInterpolationCnt - 1 : A.frameInterpolationCnt, upscale_cnt: T.prompt_source === l.K.Upscale ? A.upscaleCnt - 1 : A.upscaleCnt, is_from_preview: b && (0, K.bN)(b) ? 1 : 0, is_quick_preview: (0, K.Iu)(w.videoMode) ? 1 : 0, is_preset: 0, generate_num: null !== (_ = T.batch_number) && void 0 !== _ ? _ : 1, magic_box_cnt: null !== (y = null === (i = w.boximator) || void 0 === i ? void 0 : i.boxes.length) && void 0 !== y ? y : 0, magic_box_info: JSON.stringify(k), model_key: w.modelReqKey, model_name: (0, K.CU)({ taskDetail: b, videoDetail: m, }), last_picture_id: null == j ? void 0 : j.itemId, last_generate_id: null == j ? void 0 : null === (n = j.aigcImageParams) || void 0 === n ? void 0 : n.generateId, picture_generate_type: null == j ? void 0 : null === (o = j.aigcImageParams) || void 0 === o ? void 0 : o.generateType, template_id: null == w ? void 0 : null === (s = w.extra) || void 0 === s ? void 0 : s.originTemplateId, impression_id: null == w ? void 0 : null === (c = w.extra) || void 0 === c ? void 0 : c.impressionId, event_page: (0, V.CB)(O, t), template_from: (0, V.lg)( null == w ? void 0 : null === (d = w.extra) || void 0 === d ? void 0 : d.originTemplateId, O ), template_type_id: (0, V.pm)( null == w ? void 0 : null === (u = w.extra) || void 0 === u ? void 0 : u.impressionId, O ), template_source: t, generate_type: S, generate_id: M, blend_image_uri_list: null === (p = w.inputImages) || void 0 === p ? void 0 : null === (f = p.map((e) => { var t; return null !== (t = e.imageUri) && void 0 !== t ? t : ""; })) || void 0 === f ? void 0 : f.join(";"), } ), (0, K.AX)(m, S) ), { emotion_key: null == z ? void 0 : null === (g = z.toneEmotion) || void 0 === g ? void 0 : g.nameKey, is_voice_clone: (0, H.$l)(F, G) ? 1 : 0, is_audio_to_audio: (0, H.eE)(z) ? 1 : 0, } ), (0, K.wu)(b) ) ); }); } } constructor( { logger: e, data: t, serviceData: i, option: n }, r, a, o, l, c ) { if ( ((this._containerService = r), (this._dataService = a), (this._resourceService = o), (this._commercialCreditService = l), (this._commercialStrategyService = c), (this._pollErrorCount = 0), (this.debugId = (0, J.Rl)()), (this._logger = e), (this._option = n), (0, f.Y2)(t || i), t) ) (this.id = t.id), (this._submitId = t.id), (this.observableData = (0, s.LO)({ data: t })); else if (i) { var d = this._formateServerData(i); (this.id = d.id), (this.observableData = (0, s.LO)({ data: d })); } else throw Error("init imformation loss"); (this._videoDraftGenerationManager = this._containerService.createInstance(Z.K)), [U.C.LOADING, U.C.INIT].includes(this.observableData.data.status) && this.observableData.data.inputParams.priority !== p.T8.Relax && this._createAndExecuteWebsocketPollingManager(), i && [U.C.SUCCESS, U.C.FAIL].includes( this.observableData.data.status ) && (this.observableData.data.videoResource = this._getResource(i)), this._registerTaskStateChangeReport(); } } (Q.finishReportFlagMapper = new Map()), (Q = (0, o.gn)( [ (0, o.fM)(1, y.t), (0, o.fM)(2, b.g), (0, o.fM)(3, I.c), (0, o.fM)(4, D.aG), (0, o.fM)(5, R.N), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof AigcVideoTaskParams ? Object : AigcVideoTaskParams, void 0 === y.t ? Object : y.t, void 0 === b.g ? Object : b.g, void 0 === I.c ? Object : I.c, void 0 === D.aG ? Object : D.aG, void 0 === R.N ? Object : R.N, ]), ], Q )); }, 208540: function (e, t, i) { "use strict"; i.d(t, { BW: function () { return o; }, cr: function () { return r; }, nf: function () { return a; }, }); var n = i(243302), r = 2e4, a = 5, o = [n.Pd.Init, n.Pd.SubmitOk]; }, 773820: function (e, t, i) { "use strict"; i.d(t, { K: function () { return n; }, z: function () { return r; }, }); var n = (function (e) { return ( (e.Custom = "custom"), (e.Regenerate = "regenerate"), (e.Remix = "remix"), (e.AddMore = "add_more"), (e.Reprompt = "reprompt"), (e.LipSync = "lip_sync"), (e.PhotoLipSync = "photo_lip_sync"), (e.VideoLipSync = "video_lip_sync"), (e.Redub = "re_dub"), (e.ActionCopy = "video_action_driver"), (e.FrameInterpolation = "frame_interpolation"), (e.Upscale = "upscale"), (e.Clip = "clip"), (e.ImageToVideo = "image_to_video"), (e.AiMusic = "ai_music"), (e.AiMusicReGenerate = "ai_music_regenerate"), (e.VideoAudioEffect = "v2a_generate"), (e.VideoAudioEffectReGenerate = "v2a_re_generate"), (e.DeepSeekAgent = "agent"), e ); })({}), r = (function (e) { return ( (e.FirstFrame = "first_frame"), (e.LastFrame = "last_frame"), e ); })({}); }, 624515: function (e, t, i) { "use strict"; i.d(t, { j: function () { return S; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(789786), s = i(351066), l = i(182688), c = i(740242), d = i(331480), u = i(208540), f = i(509525), h = i(586315), p = i(869919), v = i(76212), m = i(243302), g = i(202401), _ = i(434712), y = i(675601), b = i(173590), I = i(260963), w = i(652660), x = { [p.zk.BGM]: { featureKey: "to_video_bgm", featureEntranceDetailSuffix: "-bgm-mix_audio_video", }, [p.zk.AudioEffect]: { featureKey: "to_audio_effect", featureEntranceDetailSuffix: "-audio_effect-mix_audio_video", }, }; class S { get taskData() { return this.observableData.data; } get status() { return this.taskData.status; } get findMixData() { var e, t, i; return null === (i = this.taskData.videoDetail) || void 0 === i ? void 0 : null === (t = i.audioList) || void 0 === t ? void 0 : null === (e = t.find((e) => { var { audio: t } = e; return t.vid === this.taskData.inputParams.input.audioVid; })) || void 0 === e ? void 0 : e.mixAudioVideo; } startTask() { var e = this; return (0, n._)(function* () { try { if (e.observableData.data.status !== s.C.INIT) return (0, h.wf)(-1, "task can not start"); var t, i, n, a, { input: o, submitId: c, scene: d, } = e.observableData.data.inputParams; if (d === p.zk.AudioEffect && (yield e._handleAudioEffect())) return (0, h.oW)(e.taskData); var f = x[null != d ? d : p.zk.BGM], m = yield e._dataService.mixAudioVideoTask( { input: (0, r._)({}, o), submitId: c, scene: d }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: f.featureKey, feature_entrance: (0, v.b2)(), feature_entrance_detail: "" .concat((0, v.b2)()) .concat(f.featureEntranceDetailSuffix), }), } ); if (!m.ok) return ( (0, I.z)(() => { e.observableData.data.status = s.C.RETRYABLE_FAIL; }), null === (n = (a = e._hooks).onMixError) || void 0 === n || n.call(a), m ); var g = (0, l.KZ)(m.value.task.status); return ( (0, I.z)(() => { (e.id = m.value.historyRecordId), (e.observableData.data.taskId = m.value.task.taskId), (e.observableData.data.taskDetail = m.value.task), (e.observableData.data.status = g); }), u.BW.includes(m.value.task.status) && e._createAndExecuteWebsocketPollingManager(), g === s.C.SUCCESS && e._pollSuccess(), (0, h.oW)(e.taskData) ); } catch (n) { return ( null === (t = (i = e._hooks).onMixError) || void 0 === t || t.call(i), (0, h.wf)(-1, "submit Task fail", n) ); } })(); } retryTask() { var e = this; return (0, n._)(function* () { if (e.observableData.data.status !== s.C.RETRYABLE_FAIL) { var t, i; return ( null === (t = (i = e._hooks).onMixError) || void 0 === t || t.call(i), (0, h.wf)(-1, "task can not Retry") ); } return ( (e.observableData.data.status = s.C.INIT), (e.observableData.data.createdTime = Date.now()), yield e.startTask() ); })(); } _pollSuccess() { var e = this; return (0, n._)(function* () { if (!!e.taskData.inputParams.input.videoItemId) try { var t, i, n, o = yield e._dataService.fetchDownloadTask({ itemIdList: [e.taskData.inputParams.input.videoItemId], }); if (!o.ok) { e._retryFunUntilErrorLimit(e._pollSuccess.bind(e)); return; } e._pollErrorCount = 0; var l = null === (t = o.value.itemList) || void 0 === t ? void 0 : t[0]; l && ((0, I.z)(() => { e.observableData.data = (0, a._)( (0, r._)({}, e.observableData.data), { status: s.C.SUCCESS, videoDetail: l } ); }), null === (i = (n = e._hooks).onMixSuccess) || void 0 === i || i.call(n, e.taskData, e.findMixData)); } catch (t) { e._retryFunUntilErrorLimit(e._pollSuccess.bind(e)); } })(); } _pollProgress() { var e = this; return (0, n._)(function* () { if (!!e.taskData.taskId) try { var t, i, n = yield e._dataService.queryTask({ taskIdList: ["".concat(e.taskData.taskId)], }); if (!n.ok) { e._retryFunUntilErrorLimit(e._pollProgress.bind(e)); return; } var o = n.value.taskMap["".concat(e.taskData.taskId)]; (e._pollErrorCount = 0), u.BW.includes(o.task.status) && setTimeout(() => { e._pollProgress(); }, u.cr), (o.createdTime = 0 === o.createdTime ? e.observableData.data.createdTime : o.createdTime); var c = e._formateServerData(o), d = (0, l.KZ)(o.task.status); if (d === e.observableData.data.status) return; (0, I.z)(() => { e.observableData.data = (0, a._)( (0, r._)({}, e.observableData.data), { status: d, taskDetail: c.taskDetail, createdTime: c.createdTime, } ); }), d === s.C.SUCCESS && (null === (t = (i = e._hooks).onMixSuccess) || void 0 === t || t.call(i, e.taskData, e.findMixData)); } catch (t) { e._retryFunUntilErrorLimit(e._pollProgress.bind(e)); } })(); } _retryFunUntilErrorLimit(e) { if (((this._pollErrorCount += 1), this._pollErrorCount < u.nf)) setTimeout(() => { e(); }, u.cr); else { var t, i; null === (t = (i = this._hooks).onMixError) || void 0 === t || t.call(i); } } _formateServerData(e) { var { task: t, createdTime: i } = e, n = (0, l.KZ)(t.status); return { submitId: t.submitId, status: n, createdTime: i, inputParams: { input: { audioVid: "", videoItemId: "" }, submitId: t.submitId, }, taskDetail: t, }; } _createAndExecuteWebsocketPollingManager() { var e = Date.now(); this._containerService .createInstance(w.Q, { methodId: d.Te.AigcVideoTask, websocketMessageHandler: (t, i) => this.observableData.data.taskId !== i.taskId || void 0 === i.taskStatus || [m.Pd.Init, m.Pd.SubmitOk].includes(i.taskStatus) ? { accepted: !1, done: !1 } : ((0, c.bY)(this._containerService, { taskName: "mix-audio-and-video", taskId: this.observableData.data.taskId, taskStatus: i.taskStatus, duration: Date.now() - e, }), this._pollSuccess(), { accepted: !0, done: !0 }), onFallbackToPolling: (e) => { (0, c.dz)(this._containerService, { taskName: "mix-audio-and-video", taskId: this.observableData.data.taskId, reason: e, }); }, pollingHandler: this._pollProgress.bind(this), timeout: 18e4, }) .startListening((0, f.Tg)()); } _handleAudioEffect() { var e = this; return (0, n._)(function* () { try { var t, i, n, o, l, c, d = [e.observableData.data.inputParams.input.videoItemId]; if (!(null == d ? void 0 : d.length)) return !1; var u = yield e._dataService.fetchDownloadTask({ itemIdList: d }); if ( !u.ok || !(null === (t = u.value.itemList) || void 0 === t ? void 0 : t[0]) ) return !1; var { itemList: [f], } = u.value, h = null === (i = f.audioList) || void 0 === i ? void 0 : i.find((t) => { var { audio: i } = t; return ( (null == i ? void 0 : i.vid) === e.observableData.data.inputParams.input.audioVid ); }); if ( (null == h ? void 0 : null === (n = h.mixAudioVideo) || void 0 === n ? void 0 : n.status) === g.O.Fail ) return !1; if ( (null == h ? void 0 : null === (o = h.mixAudioVideo) || void 0 === o ? void 0 : o.status) === g.O.Success ) return ( (0, I.z)(() => { e.observableData.data = (0, a._)( (0, r._)({}, e.observableData.data), { status: s.C.SUCCESS, videoDetail: f } ); }), null === (l = (c = e._hooks).onMixSuccess) || void 0 === l || l.call(c, e.taskData, e.findMixData), !0 ); return yield e._waitForAudioEffectCompletion(d); } catch (e) { return !1; } })(); } _waitForAudioEffectCompletion(e) { var { promise: t, resolve: i } = Promise.withResolvers(), n = Date.now(); return ( this._containerService .createInstance(w.Q, { methodId: d.Te.VideoAudioMixed, websocketMessageHandler: (e, t) => { var { videoItemId: r, mixedVideoStatus: a, audioVid: o } = t, { inputParams: s } = this.observableData.data, { input: { videoItemId: l, audioVid: d }, } = s; return l === r && d === o && [g.O.Success, g.O.Fail].includes(a) ? a === g.O.Success ? ((0, c.bY)(this._containerService, { taskName: "mix-audio-and-video", taskId: this.observableData.data.taskId, taskStatus: t.mixedVideoStatus === g.O.Success ? m.Pd.FinalSuccess : m.Pd.FinalGenerateFail, duration: Date.now() - n, }), this._pollSuccess(), i(!0), { accepted: !0, done: !0 }) : (i(!1), { accepted: !0, done: !0 }) : { accepted: !1, done: !1 }; }, onFallbackToPolling: (e) => { (0, c.dz)(this._containerService, { taskName: "mix-audio-and-video", taskId: this.observableData.data.taskId, reason: e, }), i(!1); }, pollingHandler: () => {}, timeout: 1e4, }) .startListening((0, f.Tg)()), t ); } constructor(e, t, i, n, r) { (this._containerService = i), (this._dataService = n), (this._historyDataService = r), (this._pollErrorCount = 0), (this.id = e.data.submitId), (this.observableData = { data: e.data }), (this._hooks = t); } } S = (0, o.gn)( [ (0, o.fM)(2, _.t), (0, o.fM)(3, y.g), (0, o.fM)(4, b.m), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof MixAudioAndVideoParams ? Object : MixAudioAndVideoParams, "undefined" == typeof MixAudioAndVideoHooks ? Object : MixAudioAndVideoHooks, void 0 === _.t ? Object : _.t, void 0 === y.g ? Object : y.g, void 0 === b.m ? Object : b.m, ]), ], S ); }, 584531: function (e, t, i) { "use strict"; i.d(t, { Y: function () { return v; }, o: function () { return g; }, }); var n = i(625572), r = i(639880), a = i(549654), o = i(733787), s = i(117275), l = i(936690), c = i(243302), d = i(773820), u = i(182688), f = i(737451), h = i(260963), p = i(464974); function v(e) { var t, i, s, l, c, u, p, v, m, g, _, y, b, I, w, x, { createdTime: S, task: M } = e, { originalInput: C, taskPayload: T, lipSyncInfo: A, priority: k } = M, P = null == C ? void 0 : null === (t = C.videoGenInputs[0]) || void 0 === t ? void 0 : t.boximator, E = null == C ? void 0 : C.videoGenInputs[0].i2vOpt, D = null == C ? void 0 : C.videoGenInputs[0].v2vOpt, R = { modelReqKey: C.modelReqKey, textPrompt: null === (i = C.videoGenInputs[0]) || void 0 === i ? void 0 : i.prompt, inputImages: [ ( null == C ? void 0 : null === (s = C.videoGenInputs[0]) || void 0 === s ? void 0 : s.firstFrameImage ) ? (0, r._)( (0, n._)( {}, null == C ? void 0 : null === (l = C.videoGenInputs[0]) || void 0 === l ? void 0 : l.firstFrameImage ), { type: d.z.FirstFrame, coverUrlMap: null === (c = e.firstFrameImage) || void 0 === c ? void 0 : c.coverUrlMap, } ) : void 0, ( null == C ? void 0 : null === (u = C.videoGenInputs[0]) || void 0 === u ? void 0 : u.endFrameImage ) ? (0, r._)( (0, n._)( {}, null == C ? void 0 : null === (p = C.videoGenInputs[0]) || void 0 === p ? void 0 : p.endFrameImage ), { type: d.z.LastFrame, coverUrlMap: null === (v = e.lastFrameImage) || void 0 === v ? void 0 : v.coverUrlMap, } ) : void 0, ].filter(Boolean), motionSpeed: a.E[ null !== (x = null == C ? void 0 : null === (m = C.videoGenInputs[0]) || void 0 === m ? void 0 : m.motionSpeed) && void 0 !== x ? x : o.BY.Moderate ], videoRatio: null == C ? void 0 : C.videoAspectRatio, seed: null == C ? void 0 : C.seed, motionType: null == C ? void 0 : null === (g = C.videoGenInputs[0]) || void 0 === g ? void 0 : g.lensMotionType, createdTime: S, priority: k, scene: null == T ? void 0 : T.taskScene, extra: null == T ? void 0 : T.taskExtra, lipSyncExtra: (0, f.Z)(null == A ? void 0 : A.lipSyncExtra) ? JSON.parse(null == A ? void 0 : A.lipSyncExtra) : null == A ? void 0 : A.lipSyncExtra, i2vOpt: (0, h.ZN)(E), v2vOpt: (0, h.ZN)(D), originFps: null == C ? void 0 : null === (_ = C.videoGenInputs[0]) || void 0 === _ ? void 0 : _.fps, originDurationMs: null == C ? void 0 : null === (y = C.videoGenInputs[0]) || void 0 === y ? void 0 : y.durationMs, videoMode: null == C ? void 0 : null === (b = C.videoGenInputs[0]) || void 0 === b ? void 0 : b.videoMode, motionIntensity: null == C ? void 0 : null === (I = C.videoGenInputs[0]) || void 0 === I ? void 0 : I.cameraStrength, boximator: P ? { boxes: P.boxes.map((e) => ({ color: e.color, boundingBox: e.boxes.map((e) => ({ boxEdgeType: e.edgeType, vertex: e.vertexs, })), motionPath: e.motionPath, prompt: e.prompt, })), draft: P.draft, boximatorImage: P.boximatorImage, draftFile: P.draftFile ? { fileUri: P.draftFile.fileUri, fileUrl: P.draftFile.fileUrl, } : void 0, } : void 0, }; return ( (null === (w = R.inputImages) || void 0 === w ? void 0 : w.length) === 0 && (R.inputImages = void 0), R ); } function m(e) { var t, i; if ( !(null == e ? void 0 : null === (i = e.aigcParams) || void 0 === i ? void 0 : null === (t = i.text2videoParams) || void 0 === t ? void 0 : t.videoGenInputs) ) return e; e.aigcParams.text2videoParams.videoGenInputs.forEach((e) => { var t, i, a, { aigcImageParams: o } = null !== (i = null === (t = e.firstFrameImage) || void 0 === t ? void 0 : t.aigcImage) && void 0 !== i ? i : {}; if (!!(null == o ? void 0 : o.blendParams)) { var c = (0, s.o)({ prompt: (0, p.I)(o), abilityList: null !== (a = o.blendParams.abilityList) && void 0 !== a ? a : [], promptPlaceholderInfoList: o.blendParams.promptPlaceholderInfoList, }); (0, l.V8)(o, c.prompt), (o.blendParams = (0, r._)((0, n._)({}, o.blendParams), { abilityList: c.abilityList, promptPlaceholderInfoList: c.promptPlaceholderInfoList, })); } }); } function g(e) { var t, i, n = (0, u.KZ)(e.task.status), { historyRecordId: r, task: a, assetOption: o } = e, { submitId: s, taskPayload: l, taskId: d } = a; null == l || l.taskExtra; var f = v(e); return ( m(e.videoDreamina), { id: r, submitId: s, taskId: d, status: n, inputParams: f, createdTime: e.createdTime, firstFrameImage: ( null === (t = e.firstFrameImage) || void 0 === t ? void 0 : t.imageUrl ) ? e.firstFrameImage : void 0, lastFrameImage: ( null === (i = e.lastFrameImage) || void 0 === i ? void 0 : i.imageUrl ) ? e.lastFrameImage : void 0, hasFavorited: null == o ? void 0 : o.hasFavorited, taskDetail: e.task, videoDetail: e.videoDreamina, historyGroupKeyMd5: e.historyGroupKeyMd5, generateType: e.generateType, firstGenerateType: e.firstGenerateType, isDeleted: e.task.status === c.Pd.Deleted, forecastGenerateCost: e.forecastGenerateCost, forecastQueueCost: e.forecastQueueCost, failCode: e.failCode, } ); } }, 3329: function (e, t, i) { "use strict"; function n(e) { return "lip_sync" === e.scene ? "to_video-lipsync" : e.input.videoGenInputs.firstFrameImage || e.input.videoGenInputs.endFrameImage ? "image_to_video" : "text_to_video"; } i.d(t, { r: function () { return n; }, }); }, 566291: function (e, t, i) { "use strict"; i.d(t, { Y: function () { return a; }, }); var n = i(799108), r = i(369617), a = (e) => { !e.ok && String(e.code) === n.HR.GenerateViolation && r.s.warningByThrottle({ style: { zIndex: 9999 }, content: e.msg }); }; }, 97075: function (e, t, i) { "use strict"; var n = i(869919), r = i(724196), a = i(790915), o = i(106621), s = i(280275), l = i(611422), c = i(179419), d = i(19205); class u { convert() { return this._params.scene === n.eA.LipSync ? new r.D(this._params).convert() : this._params.scene === n.eA.VideoTemplate ? new a.r(this._params).convert() : this._params.scene === n.eA.InsertFrame ? new o.C(this._params).convert() : this._params.scene === n.eA.SuperResolution ? new s._(this._params).convert() : this._params.scene === n.eA.LipSyncImage || this._params.scene === n.eA.LipSyncUserVideo ? new l.F(this._params).convert() : this._params.scene === n.eA.VideoExtend ? new c.Q(this._params).convert() : new d.b(this._params).convert(); } constructor(e) { this._params = e; } } t.Z = u; }, 932683: function (e, t, i) { "use strict"; i.d(t, { E: function () { return r; }, N: function () { return a; }, }); var n = i(333597), r = (function (e) { return ( (e[(e.All = 1)] = "All"), (e[(e.Generate = 2)] = "Generate"), (e[(e.SuperResolution = 3)] = "SuperResolution"), (e[(e.Favoraite = 4)] = "Favoraite"), e ); })({}), a = (0, n.yh)("image-assets-history-service"); }, 200294: function (e, t, i) { "use strict"; i.d(t, { d: function () { return n; }, }); var n = (0, i(333597).yh)("prefetch-request-service"); }, 993308: function (e, t, i) { "use strict"; i.d(t, { _: function () { return g; }, s: function () { return m; }, }); var n = i(139646), r = i(625572), a = i(639880), o = i(789786), s = i(513294), l = i(734696), c = i(586315), d = i(241047), u = i(875488), f = i(863896), h = i(902519), p = i(884569), v = { offset: 0, count: d.iV.count, imageTypeList: [...d.fk[h.Ym.Template]], }, m = "homepage"; class g extends l.JT { get secUid() { return this._params.secUid; } get expiredAt() { return this._expiredAt; } isMatchByParams(e) { return this._params.secUid === e.secUid; } isMatchByRequestParams(e) { return ( !( !this._paramsHomepage || e.secUid !== this._paramsHomepage.secUid || e.count !== this._paramsHomepage.count || e.offset !== this._paramsHomepage.offset || (void 0 !== e.imageType && void 0 !== this._paramsHomepage.imageType && e.imageType !== this._paramsHomepage.imageType) || (Array.isArray(e.imageTypeList) && Array.isArray(this._paramsHomepage.imageTypeList) && e.imageTypeList.join("_") !== this._paramsHomepage.imageTypeList.join("_")) ) && (void 0 === e.imageInfo || void 0 === this._paramsHomepage.imageInfo || e.imageInfo.format === this._paramsHomepage.imageInfo.format) && !0 ); } _fetchHomepage() { var e = this; return (0, n._)(function* () { return ( (e._paramsHomepage = (0, a._)((0, r._)({}, v), { secUid: e._params.secUid, })), (e._paramsHomepage.imageInfo = yield (0, u.FI)()), e._homePageService.homePageRepository.getDataList( (0, a._)((0, r._)({}, e._paramsHomepage), { imageTypeList: [...e._paramsHomepage.imageTypeList], imageInfo: (0, r._)({}, e._paramsHomepage.imageInfo), }) ) ); })(); } _clearHomepage() { if (!this._paramsHomepage) return; } dispose() { this._clearHomepage(), super.dispose(); } constructor(e, t) { super(), (this._params = e), (this._homePageService = t), (this.displayName = m), (this._onSuccess = this._store.add(new s.Q())), (this.onSuccess = this._onSuccess.event), (this._onFailed = this._store.add(new s.Q())), (this.onFailed = this._onFailed.event), (this._onDidDone = this._store.add(new s.Q())), (this.onDidDone = this._onDidDone.event), (this.pRequest = this._fetchHomepage()), this.pRequest.then( (e) => { (this._expiredAt = Date.now() + f.Q), e.ok ? this._onSuccess.fire({ value: e, expiredAt: this._expiredAt, }) : this._onFailed.fire({ value: e, expiredAt: this._expiredAt, }), this._onDidDone.fire({ value: e, expiredAt: this._expiredAt, }); }, (e) => { this._onFailed.fire({ value: (0, c.Mx)(-1, "prefetech failed", e), expiredAt: -1, }), this._onDidDone.fire({ value: (0, c.Mx)(-1, "prefetech failed", e), expiredAt: -1, }); } ); } } g = (0, o.gn)( [ (0, o.fM)(1, p.o), (0, o.w6)("design:type", Function), (0, o.w6)("design:paramtypes", [ "undefined" == typeof IHomepagePrefetchTaskParams ? Object : IHomepagePrefetchTaskParams, void 0 === p.o ? Object : p.o, ]), ], g ); }, 161041: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return u; }, s: function () { return d; }, }); var n = i(625572), r = i(789786), a = i(513294), o = i(734696), s = i(586315), l = i(758261), c = i(863896), d = "user-info"; class u extends o.JT { get secUid() { return this._params.secUid; } get expiredAt() { return this._expiredAt; } isMatchByParams(e) { return this._params.secUid === e.secUid; } isMatchByRequestParams(e) { return ( !!this._requestParams && e.secUid === this._requestParams.secUid ); } _fetchUserInfo() { return ( (this._requestParams = { secUid: this._params.secUid }), this._userService.repository.getUserInfo( (0, n._)({}, this._requestParams) ) ); } _clearUserInfo() { if (!this._requestParams) return; } dispose() { this._clearUserInfo(), super.dispose(); } constructor(e, t) { super(), (this._params = e), (this._userService = t), (this.displayName = d), (this._onSuccess = this._store.add(new a.Q())), (this.onSuccess = this._onSuccess.event), (this._onFailed = this._store.add(new a.Q())), (this.onFailed = this._onFailed.event), (this._onDidDone = this._store.add(new a.Q())), (this.onDidDone = this._onDidDone.event), (this.pRequest = this._fetchUserInfo()), this.pRequest.then( (e) => { (this._expiredAt = Date.now() + c.Q), e.ok ? this._onSuccess.fire({ value: e, expiredAt: this._expiredAt, }) : this._onFailed.fire({ value: e, expiredAt: -1 }), this._onDidDone.fire({ value: e, expiredAt: this._expiredAt, }); }, (e) => { this._onFailed.fire({ value: (0, s.Mx)(-1, "prefetech failed", e), expiredAt: -1, }), this._onDidDone.fire({ value: (0, s.Mx)(-1, "prefetech failed", e), expiredAt: -1, }); } ); } } u = (0, r.gn)( [ (0, r.fM)(1, l.h), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IUserInfoPrefetchTaskParams ? Object : IUserInfoPrefetchTaskParams, void 0 === l.h ? Object : l.h, ]), ], u ); }, 738210: function (e, t, i) { "use strict"; i.d(t, { u: function () { return n; }, }); var n = (0, i(333597).yh)("record-store-service"); }, 214090: function (e, t, i) { "use strict"; i.d(t, { p: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-request-cache-service"); }, 970419: function (e, t, i) { "use strict"; i.d(t, { G: function () { return n; }, }); var n = (0, i(333597).yh)("server-injected-data-service"); }, 325563: function (e, t, i) { "use strict"; i.d(t, { v: function () { return n; }, }); var n = (0, i(333597).yh)("user-publish-authority-service"); }, 532185: function (e, t, i) { "use strict"; i.d(t, { G: () => O }); var n = i("139646"), r = i("789786"), a = i("2910"), o = i("41723"), s = i.n(o), l = i("260963"), c = i("518376"), d = i("538638"), u = i("166320"), f = i("882644"), h = i("434712"), p = i("77922"), v = i("257843"), m = i("675601"), g = i("657600"), _ = i("474956"), y = i("761615"), b = i("949274"), I = i("369617"), w = i("869409"), x = i("243302"), S = i("283349"), M = i("128468"), C = i("243494"), T = i("434487"), A = i("800088"), k = i("738210"), P = i("104818"), E = i("114527"), D = i("54061"), R = 50; class N { get listData() { return this._listData; } get ready() { return this._ready; } get loading() { return this._loading; } get hasMore() { return this._queryToken.hasMore; } get isError() { return this._isError; } get _onlyFavorited() { return this._type === d.F.Favor; } init() { return this.ready ? Promise.resolve() : this.loadMore(); } reInit() { return ( (0, l.z)(() => { (this._ready = !1), (this._loading = !1), (this._isError = !1), this._resetQueryToken(), (this._listData = this._listData.slice(0, R)); }), this.init() ); } loadMore() { var e = this; return (0, n._)(function* () { if (e.loading || !e.hasMore) return (0, l.gx)(() => !e.loading); (e._loading = !0), (e._isError = !1); try { var t = Date.now(), i = yield e._historyService.getAssetList({ assetType: w.d.Video, offset: e._queryToken.offset, count: e._queryToken.config.limit, direction: e._queryToken.config.direction, option: { orderBy: e._queryToken.config.orderBy, onlyFavorited: e._queryToken.config.onlyFavorited, withTaskStatus: [x.Pd.FinalSuccess], }, assetTypeList: [w.d.VideoBGM, w.d.VideoAudioEffect], }); (0, E.K)(e._containerService, { cost: Date.now() - t, assetType: w.d.Video, }), i.ok ? ((e._queryToken = (0, C.ib)( e._queryToken.config, i.value.list.filter((e) => { var t; return ( (0, S.w)(e.generateType) && !!(null === (t = e.itemList) || void 0 === t ? void 0 : t.length) ); }), { hasMore: i.value.hasMore, offset: i.value.offset } )), e._addResource(e._queryToken.value), e._setListData(e._queryToken.value)) : (e._isError = !0); } catch (t) { e._isError = !0; } finally { (e._loading = !1), (e._ready = !0); } })(); } markFavorite(e, t) { var i = {}, n = () => { (0, l.z)(() => { this.listData.forEach((e) => { void 0 !== i[e.historyRecordId] && (e.assetOption = { hasFavorited: i[e.historyRecordId] }); }); }); }, r = new Set(e); return ( this.listData.forEach((e) => { if (r.has(e.historyRecordId)) { var n; (i[e.historyRecordId] = !!(null === (n = e.assetOption) || void 0 === n ? void 0 : n.hasFavorited)), (e.assetOption = { hasFavorited: t }); } }), { onError: () => n(), onSuccess: (e) => { e.forEach((e) => delete i[e]), n(); }, } ); } markPublished(e, t) { var i = this.listData.findIndex((t) => t.aigcItemId === e); this.listData[i] && ((this.listData[i].itemList[0].commonAttr.publishedItemId = t), this.listData[i].videoDreamina && (this.listData[i].videoDreamina.publishedItemId = t)); } addAssets(e) { if (e) { var t = new Set(this.listData.map((e) => e.historyRecordId)), i = e.filter((e) => !t.has(e.historyRecordId)); this._setListData(this.listData.concat(i)); } } deleteAssets(e) { this._listData = this._listData.filter((t) => { var { historyRecordId: i } = t; return !e.includes(i); }); } getRecord(e) { return this._listData.find((t) => t.historyRecordId === e); } _resetQueryToken() { return ( (this._queryToken = (0, C.ib)( { limit: R, onlyFavorited: this._onlyFavorited, orderBy: w.Q.CreateAt, direction: x.KB.PageUp, }, [], { hasMore: !0, offset: void 0 } )), this._queryToken ); } _setListData(e) { if (!this._ready && this.listData.length) { var t = this.listData .filter( (t) => !e.some((e) => e.historyRecordId === t.historyRecordId) ) .map((e) => e.historyRecordId); this.deleteAssets(t); } e .filter((e) => { var { task: t } = e; return t.status === x.Pd.FinalSuccess; }) .forEach((e) => { var t = this.listData.findIndex( (t) => t.historyRecordId === e.historyRecordId ); -1 !== t ? (this.listData[t] = e) : this.listData.push(e), this._registerRecordOrTaskToStore(e); }), this.listData.sort((e, t) => t.createdTime - e.createdTime); } _addResource(e) { e.forEach((e) => { (0, T.U3)( this._resourceService, _._g.VideoDreamina, e.videoDreamina ); }); } _registerRecordOrTaskToStore(e) { try { var t = this._containerService.createInstance(A.U, { logger: this._logger, serviceData: e, option: { mode: M.JU.Workbench }, }); this._recordStoreService.setVideoTaskById(t.taskData.submitId, t); } catch (t) { this._logger.error( "generate task instance fail, taskId: ".concat(e.id) ); } } constructor(e, t, i, n, r, a) { (this._type = e), (this._resourceService = t), (this._containerService = i), (this._loggerService = n), (this._recordStoreService = r), (this._historyService = a), (this._listData = []), (this._ready = !1), (this._loading = !1), (this._isError = !1), (0, l.rC)(this), (this._logger = this._loggerService.createLogger("video-asset-list")), (this._queryToken = this._resetQueryToken()); } } (0, r.gn)( [l.LO, (0, r.w6)("design:type", Array)], N.prototype, "_listData", void 0 ), (0, r.gn)([l.LO], N.prototype, "_ready", void 0), (0, r.gn)([l.LO], N.prototype, "_loading", void 0), (0, r.gn)([l.LO], N.prototype, "_isError", void 0), (0, r.gn)( [ l.aD, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", Promise), ], N.prototype, "loadMore", null ), (0, r.gn)( [ l.aD, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Array, Boolean]), (0, r.w6)("design:returntype", void 0), ], N.prototype, "markFavorite", null ), (0, r.gn)( [ l.aD, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [String, String]), (0, r.w6)("design:returntype", void 0), ], N.prototype, "markPublished", null ), (0, r.gn)( [ l.aD, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Array]), (0, r.w6)("design:returntype", void 0), ], N.prototype, "_setListData", null ), (0, r.gn)( [ l.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IDreaminaGenerateVideoRecord ? Object : IDreaminaGenerateVideoRecord, ]), (0, r.w6)("design:returntype", void 0), ], N.prototype, "_registerRecordOrTaskToStore", null ), (N = (0, r.gn)( [ (0, r.fM)(1, p.c), (0, r.fM)(2, h.t), (0, r.fM)(3, D.VZ), (0, r.fM)(4, k.u), (0, r.fM)(5, P.P), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === d.F ? Object : d.F, void 0 === p.c ? Object : p.c, void 0 === h.t ? Object : h.t, void 0 === D.VZ ? Object : D.VZ, void 0 === k.u ? Object : k.u, void 0 === P.P ? Object : P.P, ]), ], N )); var L = i("561658"), j = i("719494"); class O { static markPublished(e, t) { if (!!this._instance) this._instance.markPublished(e, t); } preloadWithCheck(e, t) { return t.reInit ? this.reInit() : this._allInstance.ready && this._favorInstance.ready ? Promise.all([Promise.resolve(), Promise.resolve()]) : this.init(); } init() { return Promise.all([ this._allInstance.init(), this._favorInstance.init(), ]); } reInit() { return Promise.all([ this._allInstance.reInit(), this._favorInstance.reInit(), ]); } getInstance(e) { return { [d.F.ALL]: this._allInstance, [d.F.Favor]: this._favorInstance, }[e]; } changeActiveInstance(e) { this.activeType = e; var t = { [d.F.ALL]: this._allInstance, [d.F.Favor]: this._favorInstance, }; return ( (0, l.z)(() => { this.activeInstance = t[e]; }), this.activeInstance ); } markPublished(e, t) { this._allInstance.markPublished(e, t), this._favorInstance.markPublished(e, t); } markFavorite(e, t) { var i = [ this._allInstance.markFavorite(e, t), this._favorInstance.markFavorite(e, t), ], { activeInstance: r } = this; return new Promise((a, o) => { var s = this; (0, y.uz)({ containerService: this._containerService, service: this._assetService, ids: e.map((e) => ({ id: e, type: u.Eu.Video })), hasFavorited: t, onSuccess: (function () { var e = (0, n._)(function* (e) { var n = yield s._lazyContentGenerationService.getInstance(); if (t) { var o = r.listData.filter((t) => e.includes(t.historyRecordId) ); s._favorInstance.addAssets(o); } else s._favorInstance.deleteAssets(e); i.forEach((t) => (null == t ? void 0 : t.onSuccess(e))), n.feedManager.markFavorite(e, t, !1), a(e); }); return function (t) { return e.apply(this, arguments); }; })(), onError: () => { i.forEach((e) => (null == e ? void 0 : e.onError())), o(); }, }); }); } downloadAssets(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "dreamina_".concat(s()().format("YYYYMMDDHHmmss")), i = this; return (0, n._)(function* () { var n = yield i._createExportTask( t, e.map((e) => { var t; return { type: f.z.AIGCHistory, packFileName: "" .concat( (0, j.Lr)( null !== (t = e.task.originalInput.videoGenInputs[0].prompt) && void 0 !== t ? t : "", 100 ), "_" ) .concat(e.historyRecordId), aigcHistoryItem: { historyId: e.historyRecordId, itemId: e.videoDreamina.aigcItemId, }, }; }) ); n && (yield i._getCreateTaskPolling(n, t)); })(); } deleteAssets(e) { var t = this; return (0, n._)(function* () { return (yield t._videoService.deleteTask({ idList: e })).ok ? (e.forEach((e) => t._recordStoreService.deleteUnifiedRecordById(e) ), yield t._clearAssetsInListManager(e), I.s.success(b.ZP.t("video_deleted_toast", {}, "Deleted")), !0) : (I.s.error( b.ZP.t( "video_no_internet_connection", {}, "No Internet Connection" ) ), !1); })(); } _clearAssetsInListManager(e) { var t = this; return (0, n._)(function* () { var i = yield t._lazyContentGenerationService.getInstance(); t._allInstance.deleteAssets(e), t._favorInstance.deleteAssets(e), e.forEach((e) => { i.feedManager.deleteData(e, !1); }); })(); } getResourceInstance(e) { return this._resourceService.get(e, _._g.VideoDreamina); } _createExportTask(e, t) { var i = this; return (0, n._)(function* () { var [n, r] = (yield i._dreaminaStoryExportMaterialsDataService.createTask({ packFileName: e, materialList: t, })).pair(); if (n) { I.s.warning( b.ZP.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ); return; } return r.taskId; })(); } _getCreateTaskPolling(e, t) { var i = this; return (0, n._)(function* () { var [n, r] = (yield i._dreaminaStoryExportMaterialsDataService.getTask({ taskIdList: [e], })).pair(); if (n) { I.s.warning( b.ZP.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ); return; } var { taskMap: a } = r, [{ status: o, payload: s }] = Object.values(a); if (o === f.w.FinalSuccess) { i._download(s.result.downloadUrl, t), I.s.success(b.ZP.t("video_downloaded_toast", {}, "Downloaded")); return; } if (o === f.w.Fail) { I.s.warning( b.ZP.t( "result_toast_saved_fail_retry", {}, "Couldn\u2019t download. Try again." ) ); return; } yield (0, c._)(1e3), yield i._getCreateTaskPolling(e, t); })(); } _download(e, t) { var i = document.createElement("a"); (i.href = (0, a.C)(e, null, { logType: "js.href/src", reportOnly: "false", blackConfig: "{}", configMode: "merge", isCloseSSRReport: !1, bid: "cc_dreamina", region: "cn", urlLimit: "-1", htmlLimit: "-1", isSaveValidUrl: !1, isRuntimeLog: !1, isDOMParser: !1, escapeRule: "escape-report", })), i.setAttribute("download", t), document.body.appendChild(i), i.click(), document.body.removeChild(i); } constructor(e, t, i, n, r, a, o) { (this._containerService = e), (this._resourceService = t), (this._assetService = i), (this._videoService = n), (this._dreaminaStoryExportMaterialsDataService = r), (this._lazyContentGenerationService = a), (this._recordStoreService = o), (this.activeType = d.F.ALL), (this._allInstance = this._containerService.createInstance( N, d.F.ALL )), (this._favorInstance = this._containerService.createInstance( N, d.F.Favor )), (this.activeInstance = this._allInstance), (0, l.rC)(this, { activeType: l.LO, activeInstance: l.LO, changeActiveInstance: l.aD, }), (O._instance = this); } } (O._instance = void 0), (O = (0, r.gn)( [ (0, r.fM)(0, h.t), (0, r.fM)(1, p.c), (0, r.fM)(2, v.K), (0, r.fM)(3, m.g), (0, r.fM)(4, g._), (0, r.fM)(5, L.r), (0, r.fM)(6, k.u), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === h.t ? Object : h.t, void 0 === p.c ? Object : p.c, void 0 === v.K ? Object : v.K, void 0 === m.g ? Object : m.g, void 0 === g._ ? Object : g._, void 0 === L.r ? Object : L.r, void 0 === k.u ? Object : k.u, ]), ], O )); }, 648326: function (e, t, i) { "use strict"; i.d(t, { p: () => q }); var n = i("139646"), r = i("789786"), a = i("241047"), o = i("645968"), s = i("214090"), l = i("417699"), c = i("222721"), d = i("970419"), u = i("19658"), f = i("625572"), h = i("639880"), p = i("260963"), v = i("875488"), m = i("791628"), g = i("586315"), _ = i("927457"), y = i("7197"), b = i("757330"), I = { params: "__get_explore_params", result: "__get_explore_result" }, w = { params: "__get_feed_params", result: "__get_feed_result" }; function x(e) { return S.apply(this, arguments); } function S() { return (S = (0, n._)(function* (e) { var t, i, { params: n, result: r } = k.includes(e.categoryId) ? I : w, a = window[n]; if ( (null == a ? void 0 : a.category_id) !== e.categoryId || (null == a ? void 0 : a.offset) !== e.offset || (null == a ? void 0 : null === (t = a.image_info) || void 0 === t ? void 0 : t.format) !== (null === (i = e.imageInfo) || void 0 === i ? void 0 : i.format) ) return Promise.resolve((0, g.wf)(-1, "request params mismatched")); if (((window[n] = void 0), !window[r])) try { yield window.pExploreFeedList; } catch (e) { (0, _.P)(e); } var o = window[r]; if (((window[r] = void 0), !o)) return Promise.resolve( (0, g.wf)(-1, "failed to retrieve jsonp result") ); if ("0" !== o.ret) return Promise.resolve((0, g.wf)(Number(o.ret), o.msg)); var s = yield (0, y.G)(o.data, o.logid, o.cache_sync_token), l = (0, b.s)(s); return Promise.resolve((0, g.oW)(l)); })).apply(this, arguments); } var M = i("538337"), C = i("433965"), T = i("826717"), A = i("76931"), k = [11222, 11190]; class P { triggerRecommendType(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; k.includes(e) && !this._envService.isOversea ? this._setRecommendType(!0) : this._setRecommendType(!1), this._setDisableCache(t); } _setRecommendType(e) { this._useRecommendApi = e; } _setDisableCache(e) { this._disableCache = e; } get _fetchFeedList() { var e = !!new URLSearchParams(location.search).get("isDebug"); return this._requestCacheService.wrapperFetchFuncWithCache({ fetchFunc: this._feedService.feedRepository.getFeedList.bind( this._feedService.feedRepository ), calcRequestCacheKey: (e) => { var t = (0, M.SZ)(e); return "dreamina_inspairation_getFeedList_" .concat(this._envService.region, "_") .concat(this._envService.appEnv, "_") .concat(t); }, shouldDisableCache: () => !0, onOriginRequestDone: (e) => { if (!!e.ok) { var t, i, { itemList: n } = e.value, r = new Map(); for (var a of n || []) r.set( null !== (i = null === (t = a.commonAttr) || void 0 === t ? void 0 : t.id) && void 0 !== i ? i : a.key, a ); this.itemList.some((e) => { var t = (0, C.w3)(e) ? e.key : e.commonAttr.id, i = r.get(t); return ( (null == i ? !!void 0 : !!i.statistic) && (e.statistic.usageNum !== i.statistic.usageNum || e.statistic.favoriteNum !== i.statistic.favoriteNum || e.statistic.hasFavorited !== i.statistic.hasFavorited) ); }) && (0, p.z)(() => { this.itemList = this.itemList.map((e) => { var t, i = (0, C.w3)(e) ? e.key : e.commonAttr.id, n = r.get(i); return n ? (0, h._)((0, f._)({}, e), { statistic: null !== (t = null == n ? void 0 : n.statistic) && void 0 !== t ? t : e.statistic, }) : (0, f._)({}, e); }); }); } }, cacheExpirationDuration: 432e5, minUseCacheThresholdTime: 0, shouldLogDebugInfo: e, }); } get _fetchRecommendFeedList() { var e = !!new URLSearchParams(location.search).get("isDebug"); return this._requestCacheService.wrapperFetchFuncWithCache({ fetchFunc: this._feedService.feedRepository.getFeedListForRecommend.bind( this._feedService.feedRepository ), calcRequestCacheKey: (e) => { var t = (0, M.SZ)(e); return "dreamina_inspairation_recommennd_feedList_" .concat(this._envService.region, "_") .concat(this._envService.appEnv, "_") .concat(t); }, shouldDisableCache: () => !0, onOriginRequestDone: (e) => { if (!!e.ok) { var t, i, { itemList: n } = e.value, r = new Map(); for (var a of n || []) r.set( null !== (i = null === (t = a.commonAttr) || void 0 === t ? void 0 : t.id) && void 0 !== i ? i : a.key, a ); this.itemList.some((e) => { var t = (0, C.w3)(e) ? e.key : e.commonAttr.id, i = r.get(t); return ( (null == i ? !!void 0 : !!i.statistic) && (e.statistic.usageNum !== i.statistic.usageNum || e.statistic.favoriteNum !== i.statistic.favoriteNum || e.statistic.hasFavorited !== i.statistic.hasFavorited) ); }) && (0, p.z)(() => { this.itemList = this.itemList.map((e) => { var t, i = (0, C.w3)(e) ? e.key : e.commonAttr.id, n = r.get(i); return n ? (0, h._)((0, f._)({}, e), { statistic: null !== (t = null == n ? void 0 : n.statistic) && void 0 !== t ? t : e.statistic, }) : (0, f._)({}, e); }); }); } }, cacheExpirationDuration: 432e5, minUseCacheThresholdTime: 0, shouldLogDebugInfo: e, }); } getDataList(e) { var t = this; return (0, n._)(function* () { t.hasInitialized = !0; var i, n = yield (0, v.FI)(), { count: r, offset: o, imageInfo: s, feedRefer: l } = e, c = 0 === o ? a.Zc.firstTimeFetchCount : a.Zc.count, d = { offset: null != o ? o : t.offset, count: null != r ? r : c, imageInfo: null != s ? s : n, categoryId: t.categoryId, }; if ( (!((i = yield x(d)).ok && i.value) && (i = t._useRecommendApi ? yield t._fetchRecommendFeedList( (0, h._)((0, f._)({}, d), { feedRefer: null != l ? l : t.feedRefer, filter: { work_type_list: [T.X.Video, T.X.Image, T.X.Canvas], }, }) ) : yield t._fetchFeedList(d)), (0, p.z)(() => { t.hadFetch = !0; }), i.ok) ) { var u = i.value, { itemList: g } = u, _ = g.map((e) => { var t = (0, f._)({}, e); if ((0, C.DF)(e) || (0, C.jD)(e)) { var i, n, { width: r, height: a } = null !== (n = null === (i = e.image.largeImages) || void 0 === i ? void 0 : i[0]) && void 0 !== n ? n : {}; (t.width = r), (t.height = a); } return ( (0, C.w3)(e) && ((t.width = e.video.originVideo.width), (t.height = e.video.originVideo.height)), t ); }); _.forEach((e) => { var t, i, n, r; (0, C.DF)(e) || (0, C.jD)(e) ? (0, A.WK)( null === (t = e.commonAttr) || void 0 === t ? void 0 : t.publishedItemId, e.impressionId ) : (0, C.w3)(e) ? (0, A.WK)(e.publishedItemId, e.impressionId) : (0, C.Rb)(e) && ((0, A.WK)( null === (i = e.commonAttr) || void 0 === i ? void 0 : i.publishedItemId, e.impressionId ), null === (r = e.collection) || void 0 === r || null === (n = r.itemList) || void 0 === n || n.forEach((t) => { var i; (0, A.WK)( null === (i = t.commonAttr) || void 0 === i ? void 0 : i.publishedItemId, e.impressionId ); })); }), 0 !== o && t._feedPrefetchService.dispatchEvent({ name: "get-data-list-done", data: _, }), (0, p.z)(() => { 0 === o ? (t.itemList = _) : (t.itemList = (0, m.Ck)(t.itemList, _)), (t.hasMore = u.hasMore), (t._useRecommendApi || (0 === u.nextOffset && _.length)) && (t.feedRefer = T.p.FeedLoadmore), (t.offset = u.nextOffset); }); } return i; })(); } constructor(e, t, i, n, r) { (this._feedService = t), (this._requestCacheService = i), (this._envService = n), (this._feedPrefetchService = r), (this.categoryId = 0), (this.hadFetch = !1), (this.hasMore = !0), (this.itemList = []), (this.offset = 0), (this.hasInitialized = !1), (this.feedRefer = T.p.FeedEnterauto), (this._useRecommendApi = !1), (this._disableCache = !1), (this.categoryId = e), (0, p.rC)(this); } } (0, r.gn)([p.LO], P.prototype, "hadFetch", void 0), (0, r.gn)([p.LO], P.prototype, "hasMore", void 0), (0, r.gn)( [p.LO, (0, r.w6)("design:type", Array)], P.prototype, "itemList", void 0 ), (0, r.gn)([p.LO], P.prototype, "offset", void 0), (0, r.gn)([p.LO], P.prototype, "hasInitialized", void 0), (0, r.gn)([p.LO], P.prototype, "feedRefer", void 0), (P = (0, r.gn)( [ (0, r.fM)(1, o.d), (0, r.fM)(2, s.p), (0, r.fM)(3, l.e), (0, r.fM)(4, c.e), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ Number, void 0 === o.d ? Object : o.d, void 0 === s.p ? Object : s.p, void 0 === l.e ? Object : l.e, void 0 === c.e ? Object : c.e, ]), ], P )); var E = i("422600"), D = i("923253"), R = i("460029"), N = i("519927"), L = i("252805"), j = i("503006"), O = i("917730"), B = i("980598"), F = { result: "__get_weekly_challenge_list_result" }; function U() { return G.apply(this, arguments); } function G() { return (G = (0, n._)(function* () { var e, { result: t } = F; if (!(null === (e = window) || void 0 === e ? void 0 : e[t])) try { yield window.pWeeklyList; } catch (e) { (0, _.P)(e); } var i = window[t]; return i ? "0" !== i.ret ? Promise.resolve((0, g.wf)(Number(i.ret), i.msg)) : Promise.resolve((0, g.oW)(yield (0, y.G)(i.data))) : Promise.resolve((0, g.wf)(-1, "failed to retrieve jsonp result")); })).apply(this, arguments); } class z { getActList() { var e = this; return (0, n._)(function* () { if (e.hadFetchAct) return; var t = yield U(); if ( (!(t.ok && t.value) && (t = yield e._mwebActivityService.getWeeklyChallengeList()), (0, p.z)(() => { e.hadFetchAct = !0; }), !!t.ok) ) { var i = t.value.actInfoList.filter( (e) => e.actStatus === O.Dh.InProgress ); (0, p.z)(() => { e.carouselActList = i; }); } })(); } constructor(e) { (this._mwebActivityService = e), (this.hadFetchAct = !1), (this.carouselActList = []), (0, p.rC)(this); } } (0, r.gn)([p.LO], z.prototype, "hadFetchAct", void 0), (0, r.gn)( [p.LO, (0, r.w6)("design:type", Array)], z.prototype, "carouselActList", void 0 ), (z = (0, r.gn)( [ (0, r.fM)(0, B.u), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === B.u ? Object : B.u]), ], z )); var V = i("409625"), W = i("720979"); function Z(e) { var t = new URLSearchParams(globalThis.location.search).get( W.i.category ), i = 0; if (t) { var n = e.findIndex((e) => e.id === Number(t)); return -1 !== n ? n : i; } return i; } var K = i("949274"), H = "DREAMINA_DEFAULT_COMMUNITY_CATEGORY_ID"; class q { static getCommunityStoreInstance(e) { return ( !this._instance && (this._instance = null == e ? void 0 : e.createInstance(q, e)), this._instance ); } static makeItemFavoriteByInstance(e, t, i) { if (!!i) { var n = i.itemList.findIndex( (t) => ((0, C.w3)(t) ? t.key : t.commonAttr.id) === e ); if (n > -1) { var r = i.itemList[n]; (0, p.z)(() => { r.statistic && ((r.statistic.favoriteNum += t ? 1 : -1), (r.statistic.hasFavorited = t)); }); } } } static makeItemFavorite(e, t) { var i, n; if ( !!(null === (i = this._instance) || void 0 === i ? void 0 : i._instanceMap) ) for (var r of null === (n = this._instance) || void 0 === n ? void 0 : n._instanceMap.values()) q.makeItemFavoriteByInstance(e, t, r); } get _fetchPanel() { var e = !!new URLSearchParams(location.search).get("isDebug"); return this._requestCacheService.wrapperFetchFuncWithCache({ fetchFunc: this._feedService.feedRepository.getFeedPanel.bind( this._feedService.feedRepository ), calcRequestCacheKey: (e) => { var t = "" .concat(this._envService.region, "_") .concat(this._envService.appEnv, "_") .concat(e.panel, "_") .concat(K.ZP.language); return "dreamina_inspairation_fetch_panel_".concat(t); }, minUseCacheThresholdTime: 0, shouldLogDebugInfo: e, }); } _getOrCreateCategoryInstance(e, t) { var i = this._instanceMap.get(t); return i ? i : null == e ? void 0 : e.createInstance(P, t); } _preloadDefaultInstance(e, t) { (0, R.Ie)(V.iE); try { if (!e) return ""; var i, n = t.keyValue.query(H); if (!n.ok || !n.value) return ""; var r = Number.parseInt(n.value, 10); if (r) { var a = null == e ? void 0 : e.createInstance(P, r); null == a || a.triggerRecommendType(r, this._isAbTestForRecommend), this._instanceMap.set(r, a), null == a || a.getDataList({ offset: 0 }).then((e) => { e.ok && (this._feedPrefetchService.dispatchEvent({ name: "get-data-list-done", data: e.value.itemList, }), this._feedPrefetchService.dispatchEvent({ name: "fetch-recommends", data: { offset: 0 }, })); }); } return ( !this._envService.isOversea && (null === (i = this.activityInstance) || void 0 === i || i.getActList()), r ); } finally { (0, R.oe)(V.iE), (0, R.XH)(V.iE); } } getCategories() { var e = this; return (0, n._)(function* () { try { (0, R.Ie)(V.i_); var t = (0, E.b)( { panel: a.Zc.panel }, e._serverInjectedDataService ); if (t) return ( (0, p.z)(() => (e.categories = t.categoryList)), t.categoryList ); var i = !!new URLSearchParams(location.search).get( "use_test_pannel" ), { panel: n } = a.Zc; e._envService.isOversea && i && (n = a.JI.panel); var r = yield e._fetchPanel({ panel: n }); if (!r.ok) return []; var o = r.value.categoryList; return (0, p.z)(() => (e.categories = o)), o; } catch (e) { return []; } finally { (0, R.oe)(V.i_), (0, R.XH)(V.i_); } })(); } changeActiveInstance(e) { var t = this.categories[e].id, i = this._instanceMap.get(t); !(null == i ? void 0 : i.hadFetch) && (null == i || i.getDataList({ offset: 0 })), (0, p.z)(() => { (this.activeInstance = i), (this.activeCategoryIndex = e); }); } getStoreInstanceByCategoryId(e) { return this._instanceMap.get(e); } _start() { var e = this; return (0, n._)(function* () { (e._isAbTestForRecommend = yield e.configurationService.abTestManager.getBooleanRecommendTestValue()), e._preloadDefaultInstance(e.containerService, e._storageService), e.getCategories().then(() => { var t = Z(e.categories); e.categories.forEach((i, n) => { var r = e._getOrCreateCategoryInstance( e.containerService, i.id ), a = n === t; if ( (null == r || r.triggerRecommendType(i.id, e._isAbTestForRecommend), a) ) { if ( ((0, R.Ie)(V.U7), null == r ? void 0 : r.hasInitialized) ) (0, p.gx)( () => (null == r ? void 0 : r.hadFetch), () => { (0, R.oe)(V.U7), (0, R.XH)(V.U7); } ); else { var o, s = null == r ? void 0 : r.getDataList({ offset: 0 }); Promise.all([ e._envService.isOversea ? Promise.resolve() : null === (o = e.activityInstance) || void 0 === o ? void 0 : o.getActList(), s, ]).finally(() => { (0, R.oe)(V.U7), (0, R.XH)(V.U7); }), null == s || s.then((t) => { t.ok && (e._feedPrefetchService.dispatchEvent({ name: "get-data-list-done", data: t.value.itemList, }), e._feedPrefetchService.dispatchEvent({ name: "fetch-recommends", data: { offset: 0 }, })); }); } e._storageService.keyValue.set(H, "".concat(i.id)), (0, p.z)(() => { (e.activeInstance = r), (e.activeCategoryIndex = t); }); } else e._preloadService.addPreloadTask({ signal: N.l.PAGE_IDLE, runTask: () => null == r ? void 0 : r.getDataList({ offset: 0 }), priorityLevel: D.q.LowPriority, }); e._instanceMap.set(i.id, r); }); }); })(); } constructor(e, t, i, n, r, a, o, s, l) { (this.containerService = e), (this._feedService = t), (this._requestCacheService = i), (this._envService = n), (this._preloadService = r), (this._feedPrefetchService = a), (this._storageService = o), (this._serverInjectedDataService = s), (this.configurationService = l), (this._instanceMap = new Map()), (this.categories = []), (this.activeInstance = void 0), (this.activeCategoryIndex = 0), (this._isAbTestForRecommend = !1), (this.activityInstance = null == e ? void 0 : e.createInstance(z)), (0, p.rC)(this), this._start(); } } (0, r.gn)( [p.LO, (0, r.w6)("design:type", Array)], q.prototype, "categories", void 0 ), (0, r.gn)( [p.LO, (0, r.w6)("design:type", Object)], q.prototype, "activeInstance", void 0 ), (0, r.gn)( [p.LO, (0, r.w6)("design:type", Number)], q.prototype, "activeCategoryIndex", void 0 ), (q = (0, r.gn)( [ (0, r.fM)(1, o.d), (0, r.fM)(2, s.p), (0, r.fM)(3, l.e), (0, r.fM)(4, L.f), (0, r.fM)(5, c.e), (0, r.fM)(6, j.U), (0, r.fM)(7, d.G), (0, r.fM)(8, u.S), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ Object, void 0 === o.d ? Object : o.d, void 0 === s.p ? Object : s.p, void 0 === l.e ? Object : l.e, void 0 === L.f ? Object : L.f, void 0 === c.e ? Object : c.e, void 0 === j.U ? Object : j.U, void 0 === d.G ? Object : d.G, void 0 === u.S ? Object : u.S, ]), ], q )); }, 106863: function (e, t, i) { "use strict"; i.d(t, { B: () => f }); var n = i("85952"), r = i("139646"), a = i("789786"), o = i("875488"), s = i("526967"), l = i("317825"), c = i("509525"), d = i("260963"); class u { refreshData() { var e = this; return (0, r._)(function* () { e.setLoading(!0); try { var t = yield (0, o.FI)(), i = yield (0, l.Rr)( (i) => e._publishProductionService.repository.getProduction(i, { publishedItemId: e.publishedId, imageInfo: t, }), { contextType: c.zO.Task, processName: "ContentPublishedStoreInstance", operationName: "refreshData", } ); if (i.ok) { var n = new URL(location.href).searchParams.get( s.KL.impressionId ); n && (i.value.impressionId = n), (i.value.fromSSR = !1), e.setData(i.value); } } finally { e.setLoading(!1); } })(); } setLoading(e) { this.loading = e; } setData(e) { this.data = e; } updateFavoriteNum(e) { var t; if ( !!(null === (t = this.data) || void 0 === t ? void 0 : t.statistic) ) this.data.statistic.favoriteNum = e; } updateIsFavorite(e) { var t; if ( !!(null === (t = this.data) || void 0 === t ? void 0 : t.statistic) ) this.data.statistic.hasFavorited = e; } constructor(e, t) { (this._publishProductionService = t), (this.loading = !1), (this.publishedId = e), (0, d.rC)(this); } } (0, a.gn)( [d.LO, (0, a.w6)("design:type", String)], u.prototype, "publishedId", void 0 ), (0, a.gn)( [d.LO, (0, a.w6)("design:type", Object)], u.prototype, "data", void 0 ), (0, a.gn)([d.LO], u.prototype, "loading", void 0), (0, a.gn)( [ d.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [Boolean]), (0, a.w6)("design:returntype", void 0), ], u.prototype, "setLoading", null ), (0, a.gn)( [ d.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof TMWebProductionItem ? Object : TMWebProductionItem, ]), (0, a.w6)("design:returntype", void 0), ], u.prototype, "setData", null ), (0, a.gn)( [ d.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [Number]), (0, a.w6)("design:returntype", void 0), ], u.prototype, "updateFavoriteNum", null ), (0, a.gn)( [ d.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [Boolean]), (0, a.w6)("design:returntype", void 0), ], u.prototype, "updateIsFavorite", null ); class f { static getInstance(e) { return !this._instance && (this._instance = new f(e)), this._instance; } static makeItemFavorite(e, t) { this._makeItemFavoriteByInstance(e, t, this._instance); } static _makeItemFavoriteByInstance(e, t, i) { if (!i) return; var n = i._publishedIdToPublishedInfoMap[e]; if (!!(null == n ? void 0 : n.data)) { var { statistic: { favoriteNum: r = 0 }, } = n.data; n.updateFavoriteNum(r + (t ? 1 : -1)), n.updateIsFavorite(t); } } getPublishedWebEffectItem(e) { var t = this._publishedIdToPublishedInfoMap[e]; if (t) return t; var i = new u( e, this._containerService.invokeFunction((e) => e.get(n.p)) ); return ( i.refreshData(), (this._publishedIdToPublishedInfoMap[e] = i), i ); } constructor(e) { (this._publishedIdToPublishedInfoMap = {}), (this._containerService = e); } } }, 857611: function (e, t, i) { "use strict"; i.d(t, { h: function () { return s; }, }); var n = i(139646), r = i(685665), a = i(645078), o = i(297425); class s { reset() { this.mutexLock.isLocked && this.mutexLock.release(); } setRecognizeCache(e, t) { this.recognizeCacheMap.put(e, t); } getRecognizeCache(e) { return this.recognizeCacheMap.get(e); } getCacheKey(e, t) { return (0, n._)(function* () { return t ? t instanceof File ? yield (0, a.r)(t) : (0, a.V)(t) : e; })(); } constructor() { (this.mutexLock = new r.w()), (this.recognizeCacheMap = new o.z(10)); } } }, 476295: function (e, t, i) { "use strict"; i.d(t, { C9: function () { return x; }, HK: function () { return w; }, OS: function () { return I; }, }); var n = i(139646), r = i(789786), a = i(925367), o = i(128468), s = i(76212), l = i(100470), c = i(417281), d = i(871770), u = i(243090), f = i(260963), h = i(649843), p = i(133438), v = i(853270), m = i(717742), g = i(857611), _ = i(880821), y = 3, b = 4, I = (function (e) { return ( (e[(e.Resize = 0)] = "Resize"), (e[(e.Move = 1)] = "Move"), (e[(e.Rotate = 2)] = "Rotate"), (e[(e.None = 3)] = "None"), e ); })({}), w = (function (e) { return ( (e.Default = "default"), (e.ResizeTopLeftToBottomRight = "resize_top_left_to_bottom_right"), (e.ResizeTopRightToBottomLeft = "resize_top_right_to_bottom_left"), (e.Move = "move"), (e.RotateTop = "rotate_top"), (e.RotateRight = "rotate_right"), (e.RotateBottom = "rotate_bottom"), (e.RotateLeft = "rotate_left"), e ); })({}); class x extends g.h { get isTransforming() { return 3 !== this.transformType; } preRecognize(e) { var t = this; return (0, n._)(function* () { yield t.mutexLock.acquire(); try { var i = yield t.getCacheKey(e), n = t.getRecognizeCache(i), r = null == n ? void 0 : null === (f = n.resp) || void 0 === f ? void 0 : null === (u = f.response) || void 0 === u ? void 0 : u.ok; if (n && r) return n; var a = t.graphicToolService.graphicTool.getSaliencySEG( { imageUriList: [e], mode: o.JU.Canvas }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, s.b2)(), feature_entrance_detail: "".concat( (0, s.b2)(), "-referenceimage-object_detection" ), }), } ), l = yield t.graphicToolService.graphicTool.getSaliencySEG( { imageUriList: [e] }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, s.b2)(), feature_entrance_detail: "".concat( (0, s.b2)(), "-referenceimage-object_detection" ), }), } ), [c, d] = yield Promise.all([a, l]); if ( (c.response.ok && (d.response.ok && (null === (p = c.response.value) || void 0 === p ? void 0 : null === (h = p[0]) || void 0 === h ? void 0 : h.mask) && (null === (m = d.response.value) || void 0 === m ? void 0 : null === (v = m[0]) || void 0 === v ? void 0 : v.mask) && (c.response.value[0].mask.url = null === (y = d.response.value) || void 0 === y ? void 0 : null === (g = y[0]) || void 0 === g ? void 0 : g.mask.url), t.setRecognizeCache(i, { resp: c })), c.response.ok) ) { var u, f, h, p, v, m, g, y, b, I, w = c.response.value, x = null == w ? void 0 : null === (I = w[0]) || void 0 === I ? void 0 : null === (b = I.mask) || void 0 === b ? void 0 : b.url; (0, _.po)(x); } return { resp: c }; } finally { t.mutexLock.release(); } })(); } recognize(e) { var t = this; return (0, n._)(function* () { (t._isCancelRecognize = !1), (t.originURI = e); var { resp: i } = yield t.preRecognize(e), { response: n } = i; if (n.ok) { if (!t._isCancelRecognize) { var r = n.value; return ( (t._recognizeImageUrl = null == r ? void 0 : r[0].mask.url), (0, f.z)(() => { t.maskList = r; }), h.J.Success ); } return h.J.Cancelled; } var { code: a } = n; return a === l.b.ErrNoSegmentObjectFound ? h.J.NoSegmentObjectFoundError : a === l.b.ErrSegmentFailed ? h.J.SegmentFailedError : h.J.NetworkError; })(); } getImagineParams() { if (!!this.paintModeInstance) { var e = this.paintModeInstance.generatePaintContent(), t = this.paintModeInstance.getImageData(); this.maskUriToImageDataMap.clear(), this.maskUriToImageDataMap.set(e, t), this.paths.set(e, this.paintModeInstance.getPaths()); var { moveX: i, moveY: n } = (0, v.D)({ currentMove: { moveX: this.moveX, moveY: this.moveY }, currentSize: { width: this.paintWidth, height: this.paintHeight }, targetSize: this._actualPaintSize, imageSize: this._rawImageSize, imageScale: this.scale, imageRotate: this.rotate, paintScale: this._paintScale, }); return { uri: this.originURI, name: c.UI.BgPaint, imageUriList: ["", "", e, this.originURI], extra: JSON.stringify({ paintWidth: this._actualPaintSize.width, paintHeight: this._actualPaintSize.height, originImageUrl: this._rawImageUrl, originMaskUrl: e, recognizeImageUrl: this._recognizeImageUrl, moveX: (0, m.c)(i, 2), moveY: (0, m.c)(n, 2), scale: (0, m.c)(this.scale, 2), rotate: (0, m.c)(this.rotate, 2), }), }; } } getMaskDataMap(e) { return this.maskUriToImageDataMap.get(e); } getPaths(e) { return this.paths.get(e); } cancelRecognize() { this._isCancelRecognize = !0; } updateBrushSize(e) { this.brushSize = e; } updateEraserSize(e) { this.eraserSize = e; } updateDrawAction(e) { this.drawAction = e; } updatePaintModeInstance(e) { this.paintModeInstance = e; } reset() { (this.brushSize = 1), (this.eraserSize = 1), (this.maskList = []), (this.paintModeInstance = void 0), (this.moveX = 0), (this.moveY = 0), (this.scale = 1), (this.rotate = 0), (this.extra = ""), (this.paintHeight = 0), (this.paintWidth = 0), (this.drawAction = a.o4.Select), (this.isSelectImage = !0), (this.isSelectActive = !0), (this._actualPaintSize = { width: 0, height: 0 }), (this._isInitActualSize = !1), (this._paintScale = -1), (this._rawImageSize = { width: 0, height: 0 }), (this._rawImageUrl = ""), (this._recognizeImageUrl = ""), super.reset(); } initActualPaintSize(e, t) { this._actualPaintSize = { width: e, height: t }; var i = Object.keys((0, u.D)(this.extra)), n = i.length === b, r = 0 === i.length; if (n || r) { (this._isInitActualSize = !0), (0, f.z)(() => { (this.moveX = e / 2), (this.moveY = t / 2), (this.paintWidth = e), (this.paintHeight = t); }); return; } var { paintWidth: a = 0, paintHeight: o = 0, moveX: s = 0, moveY: l = 0, } = (0, u.D)(this.extra), { width: c, height: d } = this._rawImageSize, { moveX: h, moveY: p } = (0, v.D)({ currentMove: { moveX: s, moveY: l }, currentSize: { width: a, height: o }, targetSize: { width: e, height: t }, imageSize: { width: c, height: d }, imageScale: this.scale, imageRotate: this.rotate, paintScale: this._paintScale, }); (this._isInitActualSize = !0), (0, f.z)(() => { (this.moveX = h), (this.moveY = p), (this.paintWidth = e), (this.paintHeight = t); }); } updateActualPaintSize(e, t) { this._actualPaintSize = { width: e, height: t }; } updateRawImageSize(e, t) { this._rawImageSize = { width: e, height: t }; } updatePaintSize(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; if (!!this._isInitActualSize) { var { moveX: n, moveY: r } = this, { width: a, height: o } = this._rawImageSize, { moveX: s, moveY: l } = (0, v.D)({ currentMove: { moveX: n, moveY: r }, currentSize: { width: this.paintWidth, height: this.paintHeight, }, targetSize: { width: e, height: t }, imageSize: { width: a, height: o }, imageScale: this.scale, imageRotate: this.rotate, paintScale: this._paintScale, needHandleEdge: i, }); (0, f.z)(() => { (this.moveX = s), (this.moveY = l), (this.paintWidth = e), (this.paintHeight = t); }); } } updateMoveX(e) { this.moveX = e; } updateMoveY(e) { this.moveY = e; } updateScale(e) { this.scale = e; } updateRotate(e) { this.rotate = e; } updateImageUrl(e) { this._rawImageUrl = e; } updatePaintScale(e) { this._paintScale = e; } updateIsSelectActive(e) { this.isSelectActive = e; } updateIsSelectImage(e) { this.isSelectImage = e; } updateTransformType(e) { this.transformType = e; } resetTransformType() { this.transformType = 3; } updateActionCursor(e) { this.actionCursor = e; } resetActionCursor() { this.actionCursor = "default"; } initWithImagineParams(e, t) { if (!!(0, p.cj)(t)) { var i, n, { originMaskUrl: r = "", recognizeImageUrl: a = "" } = (0, u.D)( t.extra ); (this.originURI = null !== (n = null === (i = t.imageUriList) || void 0 === i ? void 0 : i[y]) && void 0 !== n ? n : ""), (this._recognizeImageUrl = a), (this.maskList = [{ mask: { uri: this.originURI, url: r } }]), this.initExtra(t.extra); } } initExtra(e) { this.extra = e; var { scale: t = 1, rotate: i = 0 } = (0, u.D)(e); this.updateScale(t), this.updateRotate(i); } get isRecognized() { return 0 !== this.maskList.length; } get isInitActualSize() { return this._isInitActualSize; } constructor(e) { super(), (this.graphicToolService = e), (this.originURI = ""), (this.maskList = []), (this.brushSize = 1), (this.eraserSize = 1), (this.drawAction = a.o4.Brush), (this.paintWidth = 0), (this.paintHeight = 0), (this.moveX = 0), (this.moveY = 0), (this.scale = 1), (this.rotate = 0), (this.isSelectActive = !1), (this.isSelectImage = !1), (this.maskUriToImageDataMap = new Map()), (this.paths = new Map()), (this.transformType = 3), (this.extra = ""), (this.actionCursor = "default"), (this._actualPaintSize = { width: 0, height: 0 }), (this._rawImageUrl = ""), (this._recognizeImageUrl = ""), (this._rawImageSize = { width: 0, height: 0 }), (this._paintScale = -1), (this._isCancelRecognize = !1), (this._isInitActualSize = !1), (0, f.rC)(this); } } (0, r.gn)( [ f.LO, (0, r.w6)( "design:type", "undefined" == typeof IMWebSaliencySEGMaskList ? Object : IMWebSaliencySEGMaskList ), ], x.prototype, "maskList", void 0 ), (0, r.gn)([f.LO], x.prototype, "brushSize", void 0), (0, r.gn)([f.LO], x.prototype, "eraserSize", void 0), (0, r.gn)([f.LO], x.prototype, "drawAction", void 0), (0, r.gn)([f.LO], x.prototype, "paintWidth", void 0), (0, r.gn)([f.LO], x.prototype, "paintHeight", void 0), (0, r.gn)([f.LO], x.prototype, "moveX", void 0), (0, r.gn)([f.LO], x.prototype, "moveY", void 0), (0, r.gn)([f.LO], x.prototype, "scale", void 0), (0, r.gn)([f.LO], x.prototype, "rotate", void 0), (0, r.gn)([f.LO], x.prototype, "isSelectActive", void 0), (0, r.gn)([f.LO], x.prototype, "isSelectImage", void 0), (0, r.gn)([f.LO], x.prototype, "transformType", void 0), (0, r.gn)([f.LO], x.prototype, "extra", void 0), (0, r.gn)([f.LO], x.prototype, "actionCursor", void 0), (0, r.gn)( [ f.Fl, (0, r.w6)("design:type", Boolean), (0, r.w6)("design:paramtypes", []), ], x.prototype, "isTransforming", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateBrushSize", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateEraserSize", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === a.o4 ? Object : a.o4]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateDrawAction", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], x.prototype, "reset", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number, Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "initActualPaintSize", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number, Number, void 0]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updatePaintSize", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateMoveX", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateMoveY", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateScale", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateRotate", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [String]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateImageUrl", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updatePaintScale", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Boolean]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateIsSelectActive", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Boolean]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateIsSelectImage", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === I ? Object : I]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateTransformType", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], x.prototype, "resetTransformType", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === w ? Object : w]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "updateActionCursor", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], x.prototype, "resetActionCursor", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "initWithImagineParams", null ), (0, r.gn)( [ f.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [String]), (0, r.w6)("design:returntype", void 0), ], x.prototype, "initExtra", null ), (0, r.gn)( [ f.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], x.prototype, "isRecognized", null ), (x = (0, r.gn)( [ (0, r.fM)(0, d.fQ), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === d.fQ ? Object : d.fQ]), ], x )); }, 649843: function (e, t, i) { "use strict"; i.d(t, { J: function () { return n; }, }); var n = (function (e) { return ( (e.Success = "success"), (e.Cancelled = "cancelled"), (e.Empty = "empty"), (e.DownloadImageError = "downloadImageError"), (e.FacePredictError = "facePredictError"), (e.NoSegmentObjectFoundError = "noSegmentObjectFoundError"), (e.SegmentFailedError = "segmentFailedError"), (e.NetworkError = "networkError"), (e.PoseDetectError = "poseDetectError"), (e.SafetyCheckError = "safetyCheckError"), (e.IpKeepMultipySubject = "ipKeepMultipySubject"), (e.IpKeepNoSubject = "ipKeepNoSubject"), (e.ImageIPIsBlocked = "imageIpIsBlocked"), e ); })({}); }, 164763: function (e, t, i) { "use strict"; i.d(t, { o: () => es }); var n = i("139646"), r = i("789786"), a = i("417281"), o = i("871770"), s = i("260963"), l = i("649843"), c = i("489897"), d = i("133438"), u = i("857611"), f = 0, h = 0; class p extends u.h { recognize(e) { var t = this; return (0, n._)(function* () { return (t.originURI = e), yield Promise.resolve(), l.J.Success; })(); } preRecognize(e) { return (0, n._)(function* () { yield Promise.resolve(); })(); } cancelRecognize() {} getImagineParams() { return { uri: this.originURI, name: a.UI.BasicBlend, imageUriList: [this.originURI], imageWeightList: [this.referenceLevel], }; } updateReferenceLevel(e) { this.referenceLevel = e; } reset() { (this.referenceLevel = Math.round((c.K5.max + c.K5.min) / 2)), (this.originURI = ""), super.reset(); } initWithImagineParams(e, t) { var i, n, r, a; if (!!(0, d.q0)(t)) (this.referenceLevel = null !== (r = null === (i = t.imageWeightList) || void 0 === i ? void 0 : i[f]) && void 0 !== r ? r : Math.round((c.K5.max + c.K5.min) / 2)), (this.originURI = null !== (a = null === (n = t.imageUriList) || void 0 === n ? void 0 : n[h]) && void 0 !== a ? a : ""); } get isRecognized() { return "" !== this.originURI; } constructor(e) { super(), (this.graphicToolService = e), (this.referenceLevel = c.K5.default), (this.originURI = ""), (0, s.rC)(this); } } (0, r.gn)([s.LO], p.prototype, "referenceLevel", void 0), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], p.prototype, "updateReferenceLevel", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], p.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], p.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], p.prototype, "isRecognized", null ), (p = (0, r.gn)( [ (0, r.fM)(0, o.fQ), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === o.fQ ? Object : o.fQ]), ], p )); var v = i("625572"), m = i("639880"), g = i("96"), _ = i("910629"), y = i("100470"), b = i("76212"), I = i("356868"), w = i("880821"); class x { init(e, t, i) { var r = this; return (0, n._)(function* () { if (!r._clipCanvas) throw Error("fail to init clip"); r._clipCanvas.clear(), (r._clipCanvas.width = t), (r._clipCanvas.height = i), (r._paintHeight = i), (r._paintWidth = t), (r._fileSrc = e); var n = yield (0, w.po)(r._fileSrc); r._imageElement = n; })(); } clipRect(e, t, i, n) { if ((this._clipCanvas.clear(), !this._imageElement)) return ""; var r, a, { ctx: o } = this._clipCanvas; if (!o) return ""; (this._clipCanvas.width = this._paintWidth), (this._clipCanvas.height = this._paintHeight), o.drawImage( this._imageElement, 0, 0, this._paintWidth, this._paintHeight ); var s = o.getImageData(e, t, i, n); return ( this._clipCanvas.clear(), (this._clipCanvas.width = i), (this._clipCanvas.height = n), o.putImageData(s, 0, 0), null !== (a = null === (r = this._clipCanvas.element) || void 0 === r ? void 0 : r.toDataURL()) && void 0 !== a ? a : "" ); } clear() { var e; null === (e = this._clipCanvas) || void 0 === e || e.clear(); } destroy() { this._clipCanvas.destroy(); } constructor() { (this._clipCanvas = new I.E(0, 0)), (this._fileSrc = ""), (this._imageElement = null), (this._paintHeight = 0), (this._paintWidth = 0); } } var S = i("586315"), M = i("509525"), C = 0, T = (e) => { var [t, i, n, r] = e; return "".concat(t, "_").concat(i, "_").concat(n, "_").concat(r); }, A = (e) => e .map((e) => { var { faceRect: t } = e, i = T(t); return (0, m._)((0, v._)({}, e), { picture: "", faceKey: i }); }) .sort((e, t) => { var i, n, { faceRect: r } = e, { faceRect: a } = t; return (null !== (i = r[0]) && void 0 !== i ? i : 0) > (null !== (n = a[0]) && void 0 !== n ? n : 0) ? 1 : -1; }); function k(e, t, i, n) { return i > n ? [e, Math.max(0, t - (i - n) / 2), i, i] : [Math.max(0, e - (n - i) / 2), t, n, n]; } function P(e, t) { var { faceRect: i, keypoint: n } = e, r = (0, g._)(e, ["faceRect", "keypoint"]), [a, o, s, l] = i; return (0, m._)((0, v._)({}, r), { faceRect: [a * t, o * t, s * t, l * t], keypoint: n.map((e) => e * t), }); } function E(e, t) { var [i, n, r, a] = t.faceRect, o = k(i, n, r, a); return e.clipRect(...o); } class D extends u.h { get faceRects() { return this.faceRecognizeList.map((e) => P( (0, m._)((0, v._)({}, e), { isSelected: this.selectedKey === e.faceKey, }), this.scale ) ); } get selectRectIndex() { return this.faceRects.findIndex((e) => e.isSelected); } preRecognize(e) { var t = this; return (0, n._)(function* () { yield t.mutexLock.acquire(); try { var i, n, r, a, o = yield t.getCacheKey(e), s = t.getRecognizeCache(o), l = (null == s ? void 0 : null === (n = s.auditResp) || void 0 === n ? void 0 : null === (i = n.response) || void 0 === i ? void 0 : i.ok) && (null == s ? void 0 : null === (a = s.recognizeResp) || void 0 === a ? void 0 : null === (r = a.response) || void 0 === r ? void 0 : r.ok); if (s && l) return s; var c = t._auditImage(e), d = t._recognizeFace(e), [u, f] = yield Promise.all([c, d]), h = [u, f].every((e) => e.response.ok), p = { recognizeResp: f, auditResp: u }; return h && t.setRecognizeCache(o, p), p; } finally { t.mutexLock.release(); } })(); } recognize(e) { var t = this; return (0, n._)(function* () { t._isCancelRecognize = !1; var { recognizeResp: i, auditResp: n } = yield t.preRecognize(e); if (!n.response.ok) return l.J.NetworkError; if (t._isCancelRecognize) return l.J.Cancelled; if (0 !== n.response.value.status) return l.J.ImageIPIsBlocked; var { response: r } = i; if (r.ok) { if (t._isCancelRecognize) return l.J.Cancelled; var a, { faceRecognizeList: o } = r.value, c = null !== (a = o[C]) && void 0 !== a ? a : [], d = A(c); return ((0, s.z)(() => { (t.imageUriList = [e]), (t.faceRecognizeList = d), (t.selectedKey = t.getDefaultSelectedFaceKey(d)); }), c.length) ? l.J.Success : l.J.Empty; } var { code: u } = r; if (u === y.b.ErrDownloadImage) return l.J.DownloadImageError; if (u === y.b.ErrFacePredict) return l.J.FacePredictError; if (u === y.b.ErrPreTextIPBlockList) return l.J.ImageIPIsBlocked; return l.J.NetworkError; })(); } _recognizeFace(e) { var t = this; return (0, n._)(function* () { return yield t.graphicToolService.graphicTool.getFaceRecognize( { imageUriList: [e] }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-referenceimage-human_face" ), }), } ); })(); } _auditImage(e) { var t = this; return (0, n._)(function* () { var i = (0, M.fC)(), n = yield t.mWebContentGenerateService.repository.requestAlgorithm( i, "benchmark_test_user_upload_image_input.image_face_ip", { params: {}, fileList: [{ fileUri: e }], options: { ipCheck: !0 }, }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "aigc_to_image", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-algo_proxy" ), }), } ), { response: r } = n, a = r.ok && n.logId ? 0 : 1; return (0, m._)((0, v._)({}, n), { response: (0, S.oW)({ status: a }) }); })(); } getDefaultSelectedFaceKey(e) { var t = 0, i = ""; return ( e.forEach((e) => { var { faceRect: n, faceKey: r } = e, [, , a, o] = n, s = a * o; s > t && ((t = s), (i = r)); }), i ); } getImagineParams() { var e, t = this.faceRecognizeList.map((e) => ({ keypoint: e.keypoint, faceRect: e.faceRect, isSelected: T(e.faceRect) === this.selectedKey, })), i = (0, s.ZN)(this.imageUriList); return { uri: null !== (e = null == i ? void 0 : i[0]) && void 0 !== e ? e : "", name: a.UI.FaceGan, imageUriList: i, faceRecognizeList: [t], }; } cancelRecognize() { this._isCancelRecognize = !0; } selectFaceRect(e) { this.selectedKey = e; } reset() { var e; (this.faceRecognizeList = []), (this.imageUriList = []), (this.selectedKey = ""), (this.scale = 1), null === (e = this._clipInstance) || void 0 === e || e.clear(), (this._clipInstance = null), super.reset(); } setScale(e) { this.scale = e; } initWithImagineParams(e, t) { if (!!(0, d.jq)(t)) { var i, n, r, { faceRecognizeList: a } = t, o = A( null !== (n = null == a ? void 0 : a[C]) && void 0 !== n ? n : [] ); (this.faceRecognizeList = o.map((e) => { var { isSelected: t } = e; return (0, g._)(e, ["isSelected"]); })), (this.selectedKey = null !== (r = null === (i = o.find((e) => e.isSelected)) || void 0 === i ? void 0 : i.faceKey) && void 0 !== r ? r : ""), (this.imageUriList = [e]); } } clipFacePicture(e) { var t = this; return (0, n._)(function* () { !t._clipInstance && (t._clipInstance = new x()); var i = t._clipInstance; try { var { width: n, height: r } = yield (0, w.po)(e); yield i.init(e, n, r); var a = t.faceRecognizeList.map((e) => (0, m._)((0, v._)({}, e), { picture: E(i, e) }) ); (0, s.z)(() => { t.faceRecognizeList = a; }); } catch (e) {} })(); } get isRecognized() { return 0 !== this.faceRecognizeList.length; } constructor(e, t) { super(), (this.graphicToolService = e), (this.mWebContentGenerateService = t), (this.imageUriList = []), (this.faceRecognizeList = []), (this.selectedKey = ""), (this.scale = 1), (this._isCancelRecognize = !1), (this._clipInstance = null), (0, s.rC)(this); } } (0, r.gn)( [s.LO, (0, r.w6)("design:type", Array)], D.prototype, "imageUriList", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Array)], D.prototype, "faceRecognizeList", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", String)], D.prototype, "selectedKey", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Number)], D.prototype, "scale", void 0 ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", Array), (0, r.w6)("design:paramtypes", []), ], D.prototype, "faceRects", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", Number), (0, r.w6)("design:paramtypes", []), ], D.prototype, "selectRectIndex", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [String]), (0, r.w6)("design:returntype", void 0), ], D.prototype, "selectFaceRect", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], D.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], D.prototype, "setScale", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], D.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], D.prototype, "isRecognized", null ), (D = (0, r.gn)( [ (0, r.fM)(0, o.fQ), (0, r.fM)(1, _.M), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === o.fQ ? Object : o.fQ, void 0 === _.M ? Object : _.M, ]), ], D )); var R = i("476295"), N = i("128468"), L = i("317825"); class j extends u.h { preRecognize(e) { var t = this; return (0, n._)(function* () { yield t.mutexLock.acquire(); try { var i, n = yield t.getCacheKey(e), r = t.getRecognizeCache(n), a = (null == r ? void 0 : null === (i = r.safetyCheckResp) || void 0 === i ? void 0 : i.status) === null; if (r && a) return r; var o = t._safetyCheck(e), s = t._subjectCheck(e), l = t._image2description(e), [c, d, u] = yield Promise.all([o, s, l]), f = { safetyCheckResp: c, subjectCheckResp: d, image2descriptionResp: u, }; return ( [c, d, u].every((e) => !e.stop) && t.setRecognizeCache(n, f), f ); } finally { t.mutexLock.release(); } })(); } recognize(e) { var t = this; return (0, n._)(function* () { t._isCancelRecognize = !1; var i, n, r, a, { safetyCheckResp: o, subjectCheckResp: c, image2descriptionResp: d, } = yield t.preRecognize(e); if (null == o ? void 0 : o.stop) return null !== (i = o.status) && void 0 !== i ? i : l.J.NetworkError; var u = l.J.Success; return c.stop ? null !== (n = c.status) && void 0 !== n ? n : l.J.NetworkError : ((u = null !== (r = c.status) && void 0 !== r ? r : l.J.Success), d.stop) ? null !== (a = d.status) && void 0 !== a ? a : l.J.NetworkError : (d.description && (0, s.z)(() => { var i; (t.imageDescription = null !== (i = d.description) && void 0 !== i ? i : ""), (t.imageUriList = [e]); }), u); })(); } _safetyCheck(e) { var t = this; return (0, n._)(function* () { var { ctx: i, span: n } = (0, L.VL)( (0, M.Tg)(), "text-to-image-ip-keep", "benchmark_test_user_upload_image_input" ), r = yield t.mWebContentGenerateService.repository.requestAlgorithm( i, "benchmark_test_user_upload_image_input.image_face_ip", { params: {}, fileList: [{ fileUri: e }], options: { ipCheck: !0 }, }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "aigc_to_image", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-algo_proxy" ), }), } ); return (n.end(), t._isCancelRecognize) ? { stop: !0, status: l.J.Cancelled } : r.response.ok ? { stop: !1, status: null } : { stop: !0, status: r.logId ? l.J.SafetyCheckError : l.J.NetworkError, }; })(); } _subjectCheck(e) { var t = this; return (0, n._)(function* () { var i = t.graphicToolService.graphicTool.getFaceRecognize( { imageUriList: [e] }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-referenceimage-human_face" ), }), } ), n = t.graphicToolService.graphicTool.getSaliencySEG( { imageUriList: [e], mode: N.JU.Canvas }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-referenceimage-object_detection" ), }), } ), [r, a] = yield Promise.all([i, n]); if (t._isCancelRecognize) return { stop: !0, status: l.J.Cancelled }; var { response: o } = r; if (!o.ok) return { stop: !1, status: null }; var { faceRecognizeList: s } = o.value, c = s[0].length, d = !1, { response: u } = a; return (u.ok && (d = !0), c > 1) ? { stop: !1, status: l.J.IpKeepMultipySubject } : 0 !== c || d ? { stop: !1, status: null } : { stop: !1, status: l.J.IpKeepNoSubject }; })(); } _image2description(e) { var t = this; return (0, n._)(function* () { var { ctx: i, span: n } = (0, L.VL)( (0, M.Tg)(), "text-to-image-ip-keep", "image-to-text" ), r = yield t.mWebContentGenerateService.repository.getImageDescription( i, { fileUri: e }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "aigc_to_image", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-get_image_description" ), }), } ); if ((n.end(), t._isCancelRecognize)) return { stop: !0, status: l.J.Cancelled }; if (!r.response.ok) return { stop: !0, status: l.J.NetworkError }; var { description: a } = r.response.value; return { stop: !1, description: a, status: l.J.Success }; })(); } getImagineParams() { var e, t = (0, s.ZN)(this.imageUriList); return { uri: null !== (e = null == t ? void 0 : t[0]) && void 0 !== e ? e : "", name: a.UI.IpKeep, imageUriList: t, ipKeepList: [ { description: this.imageDescription, refIpWeight: this.refIpWeight / c.ux.ip.rate, refIdWeight: this.refIdWeight / c.ux.id.rate, }, ], }; } cancelRecognize() { this._isCancelRecognize = !0; } updateRefIpWeight(e) { this.refIpWeight = e; } updateRefIdWeight(e) { this.refIdWeight = e; } reset() { (this.imageUriList = []), (this.imageDescription = ""), (this.refIdWeight = c.ux.id.default), (this.refIpWeight = c.ux.ip.default), super.reset(); } initWithImagineParams(e, t) { if (!!(0, d.PA)(t)) { var i, { imageUriList: n, ipKeepList: r } = t, { refIpWeight: a = c.ux.ip.default, refIdWeight: o = c.ux.id.default, description: l, } = null !== (i = r[0]) && void 0 !== i ? i : {}; (0, s.z)(() => { (this.imageUriList = n), (this.refIpWeight = a * c.ux.ip.rate), (this.refIdWeight = o * c.ux.id.rate), (this.imageDescription = l); }); } } getRecognizeStatus(e) { return e > 1 ? l.J.IpKeepMultipySubject : l.J.Success; } get isRecognized() { return 0 !== this.imageDescription.length; } constructor(e, t) { super(), (this.graphicToolService = e), (this.mWebContentGenerateService = t), (this.imageUriList = []), (this.refIpWeight = c.ux.ip.default), (this.refIdWeight = c.ux.id.default), (this.imageDescription = ""), (this._isCancelRecognize = !1), (0, s.rC)(this); } } (0, r.gn)( [s.LO, (0, r.w6)("design:type", Array)], j.prototype, "imageUriList", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Number)], j.prototype, "refIpWeight", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Number)], j.prototype, "refIdWeight", void 0 ), (0, r.gn)([s.LO], j.prototype, "imageDescription", void 0), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], j.prototype, "updateRefIpWeight", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], j.prototype, "updateRefIdWeight", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], j.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], j.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], j.prototype, "isRecognized", null ), (j = (0, r.gn)( [ (0, r.fM)(0, o.fQ), (0, r.fM)(1, _.M), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === o.fQ ? Object : o.fQ, void 0 === _.M ? Object : _.M, ]), ], j )); var O = i("434712"), B = i("280166"), F = i("537201"), U = i("108982"), G = i("819340"), z = i("417699"), V = i("745017"), W = i("875488"), Z = i("388977"), K = i("460911"), H = i("645078"), q = i("242566"), J = (function () { var e = (0, n._)(function* (e) { var { fileOrUrl: t, containerService: i } = e, n = "", r = !1; if (t instanceof File) { if ("image/png" !== t.type) return (0, S.oW)(void 0); (n = URL.createObjectURL(t)), (r = !0); } else if (((n = t), "image/png" !== (yield (0, W.io)(n)))) return (0, S.oW)(void 0); var a = "", { transferredUrl: o, hasChanged: s } = yield (0, w.$d)({ imageUrl: n, containerService: i, }); if ((r && URL.revokeObjectURL(n), !(a = null != o ? o : "") || !s)) return (0, S.oW)(void 0); var l = (0, Z.ko)(i, z.e), c = (0, Z.ko)(i, G.Z), d = yield (0, w.u)(a), u = c.getImageXUploader(l.appId, V.I), f = yield u.uploadImage({ file: d }); return f.ok ? (0, S.oW)(f.value.uri) : (0, S.wf)(-1, "upload failed"); }); return function (t) { return e.apply(this, arguments); }; })(), Y = (() => { var e = new K.V("transparent-png-upload-image"), t = new Map(); return (function () { var i = (0, n._)(function* (i) { var n, r = Date.now(), a = 0, o = "unknown"; i.fileOrUrl instanceof File ? ((n = yield (0, H.r)(i.fileOrUrl)), (a = i.fileOrUrl.size), (o = i.fileOrUrl.type)) : (n = (0, H.V)(i.fileOrUrl)); var s = t.get(n); if (s) { var l = yield s; return l.ok ? l.value : void 0; } var c = e.getItem(n); if (c) return ( (0, q.N)(i.containerService, { status: q.G.Success, size: a, format: o, costTime: Date.now() - r, useCache: !0, source: "transparent_png", }), c ); var d = J(i); t.set(n, d); var u = yield d; return ( u.ok && u.value && ((0, q.N)(i.containerService, { status: q.G.Success, size: a, format: o, costTime: Date.now() - r, useCache: !1, source: "transparent_png", }), e.setItem(n, u.value)), !u.ok && (0, q.N)(i.containerService, { status: q.G.Failed, size: a, format: o, costTime: Date.now() - r, useCache: !1, source: "transparent_png", }), t.delete(n), u.ok ? u.value : void 0 ); }); return function (e) { return i.apply(this, arguments); }; })(); })(), Q = 1; class X extends u.h { preRecognize(e, t) { var i = this; return (0, n._)(function* () { yield i.mutexLock.acquire(); try { var n, r, o, s, l, d, u, f = yield i.getCacheKey(e, t), h = i.getRecognizeCache(f), p = i.name === U.s.ControlNetPose ? (null == h ? void 0 : null === (r = h.blendPreviewRes) || void 0 === r ? void 0 : null === (n = r.response) || void 0 === n ? void 0 : n.ok) && "poseDetectRes" in h && (null === (s = h.poseDetectRes) || void 0 === s ? void 0 : null === (o = s.response) || void 0 === o ? void 0 : o.ok) : null == h ? void 0 : null === (d = h.blendPreviewRes) || void 0 === d ? void 0 : null === (l = d.response) || void 0 === l ? void 0 : l.ok; if (h && p) return h; var v = yield i.getRecognizeUri(e, t), m = i.graphicToolService.graphicTool.generateBlendPreview( { model: a.Ij, ability: { name: a.UI.ControlNet, imageUriList: [v], controlNetList: [ { name: c.go[i.name], strength: c.XR.default / c.XR.max, imageIndex: 0, }, ], }, }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, b.b2)(), feature_entrance_detail: "" .concat((0, b.b2)(), "-referenceimage-") .concat(i.name), }), } ); i.name === U.s.ControlNetPose && (u = i.graphicToolService.graphicTool.poseDetect( { uri: v }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "to_image_referenceimage", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-referenceimage-pose_detection" ), }), } )); var [g, _] = yield Promise.all([m, u]); return ( i.name === U.s.ControlNetPose ? g.response.ok && (null == _ ? void 0 : _.response.ok) && i.setRecognizeCache(f, { blendPreviewRes: g, poseDetectRes: _, name: U.s.ControlNetPose, }) : g.response.ok && i.setRecognizeCache(f, { blendPreviewRes: g, name: i.name, }), { name: i.name, blendPreviewRes: g, poseDetectRes: _ } ); } finally { i.mutexLock.release(); } })(); } getRecognizeUri(e, t) { var i = this; return (0, n._)(function* () { if (!t) return e; var n = yield Y({ fileOrUrl: t, containerService: i._containerService, }); return n ? n : e; })(); } recognize(e, t) { var i = this; return (0, n._)(function* () { var { name: n } = i; if (!(0, d.W9)(n)) return l.J.Empty; (i._isCancelRecognize = !1), (i.originUri = e); var r = yield i.preRecognize(e, t); if (r.name === U.s.ControlNetPose) { var { poseDetectRes: a } = r, { response: o } = a; if (!o.ok) return l.J.PoseDetectError; var { isPose: c } = o.value; if (!c) return l.J.PoseDetectError; } var { blendPreviewRes: u } = r, { response: f } = u; if (f.ok) { if (i._isCancelRecognize) return l.J.Cancelled; var { ability: h } = f.value; return ((0, s.z)(() => { var e, t, n, r, a, o; (i.previewUrl = null !== (a = null == h ? void 0 : null === (t = h.largeImageList) || void 0 === t ? void 0 : null === (e = t[0]) || void 0 === e ? void 0 : e.imageUrl) && void 0 !== a ? a : ""), (i.previewUri = null !== (o = null == h ? void 0 : null === (r = h.largeImageList) || void 0 === r ? void 0 : null === (n = r[0]) || void 0 === n ? void 0 : n.imageUri) && void 0 !== o ? o : ""); }), h) ? l.J.Success : l.J.Empty; } var { code: p } = f; return p === y.b.ErrPreImgRiskNotPass ? l.J.ImageIPIsBlocked : l.J.NetworkError; })(); } cancelRecognize() { this._isCancelRecognize = !0; } getImagineParams() { var { name: e } = this, t = (0, d.W9)(e); return t ? { uri: this.originUri, name: a.UI.ControlNet, imageUriList: ["", this.originUri, this.previewUri], previewInfo: { imageUri: this.previewUri, imageUrl: this.previewUrl, }, extra: JSON.stringify([ { name: this.name, fitMode: this.fitMode, imageIndex: 0 }, ]), controlNetList: [ { name: c.go[t], strength: this.referenceLevel / c.XR.max, imageIndex: 0, }, ], } : { uri: this.originUri, name: a.UI.ControlNet, imageUriList: ["", this.originUri, this.previewUri], controlNetList: [], }; } updateReferenceLevel(e) { this.referenceLevel = e; } updateFitMode(e) { this.fitMode = e; } syncData(e) { var { level: t, fitMode: i } = e; t && (this.referenceLevel = t), i && (this.fitMode = i); } reset() { (this.referenceLevel = Math.round(c.XR.default)), (this.originUri = ""), (this.previewUri = ""), (this.previewUrl = ""), super.reset(); } initWithImagineParams(e, t) { if (!(0, d.od)(t)) return; var { controlNetList: i, extra: n, previewInfo: r, imageUriList: a, } = t, { strength: o, name: s } = null !== (l = null == i ? void 0 : i[0]) && void 0 !== l ? l : {}; if (F.i[s] === this.name) { if ( (o && (this.referenceLevel = o * c.XR.max), r && ((this.previewUrl = r.imageUrl), (this.previewUri = r.imageUri)), n) ) { var l, u, f = JSON.parse(null != n ? n : "[]"), { fitMode: h } = null !== (u = null == f ? void 0 : f[0]) && void 0 !== u ? u : {}; this.fitMode = h; } this.originUri = null == a ? void 0 : a[Q]; } } get isRecognized() { return "" !== this.previewUrl; } constructor(e, t, i, n, r) { super(), (this.name = e), (this.graphicToolService = t), (this._uploadService = i), (this._containerService = n), (this._environmentService = r), (this.referenceLevel = c.XR.default), (this.fitMode = U.G.CenterCrop), (this.previewUrl = ""), (this.originUri = ""), (this.previewUri = ""), (this._isCancelRecognize = !1), (0, s.rC)(this); } } (0, r.gn)([s.LO], X.prototype, "referenceLevel", void 0), (0, r.gn)([s.LO], X.prototype, "fitMode", void 0), (0, r.gn)([s.LO], X.prototype, "previewUrl", void 0), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], X.prototype, "updateReferenceLevel", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === U.G ? Object : U.G]), (0, r.w6)("design:returntype", void 0), ], X.prototype, "updateFitMode", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof IControlNetSyncData ? Object : IControlNetSyncData, ]), (0, r.w6)("design:returntype", void 0), ], X.prototype, "syncData", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], X.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], X.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], X.prototype, "isRecognized", null ), (X = (0, r.gn)( [ (0, r.fM)(1, o.fQ), (0, r.fM)(2, G.Z), (0, r.fM)(3, O.t), (0, r.fM)(4, B.Y), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ "undefined" == typeof TValidControlNet ? Object : TValidControlNet, void 0 === o.fQ ? Object : o.fQ, void 0 === G.Z ? Object : G.Z, void 0 === O.t ? Object : O.t, void 0 === B.Y ? Object : B.Y, ]), ], X )); var $ = 0, ee = 0; class et extends u.h { preRecognize(e) { return (0, n._)(function* () {})(); } recognize(e) { var t = this; return (0, n._)(function* () { return (t.originURI = e), yield Promise.resolve(), l.J.Success; })(); } cancelRecognize() {} getImagineParams() { return { uri: this.originURI, name: a.UI.StyleReference, imageUriList: [this.originURI], imageWeightList: [this.referenceLevel], }; } updateReferenceLevel(e) { this.referenceLevel = e; } reset() { (this.referenceLevel = Math.round(c.FY.default)), (this.originURI = ""), super.reset(); } initWithImagineParams(e, t) { var i, n, r, a; if (!!(0, d.iP)(t)) (this.referenceLevel = null !== (r = null === (i = t.imageWeightList) || void 0 === i ? void 0 : i[$]) && void 0 !== r ? r : Math.round(c.FY.default)), (this.originURI = null !== (a = null === (n = t.imageUriList) || void 0 === n ? void 0 : n[ee]) && void 0 !== a ? a : ""); } get isRecognized() { return !1; } constructor(e) { super(), (this.graphicToolService = e), (this.referenceLevel = c.FY.default), (this.originURI = ""), (0, s.rC)(this); } } (0, r.gn)([s.LO], et.prototype, "referenceLevel", void 0), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], et.prototype, "updateReferenceLevel", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], et.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], et.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], et.prototype, "isRecognized", null ), (et = (0, r.gn)( [ (0, r.fM)(0, o.fQ), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === o.fQ ? Object : o.fQ]), ], et )); var ei = 0; class en extends u.h { preRecognize(e) { var t = this; return (0, n._)(function* () { yield t.mutexLock.acquire(); try { var i, n = yield t.getCacheKey(e), r = t.getRecognizeCache(n), a = (null == r ? void 0 : null === (i = r.safetyCheckResp) || void 0 === i ? void 0 : i.status) === null; if (r && a) return r; var o = yield t._safetyCheck(e), s = { safetyCheckResp: o }; return !o.stop && t.setRecognizeCache(n, s), s; } finally { t.mutexLock.release(); } })(); } recognize(e) { var t = this; return (0, n._)(function* () { (t.originURI = e), (t._isCancelRecognize = !1); var i, { safetyCheckResp: n } = yield t.preRecognize(e); return n.stop ? null !== (i = n.status) && void 0 !== i ? i : l.J.NetworkError : l.J.Success; })(); } _safetyCheck(e) { var t = this; return (0, n._)(function* () { var { ctx: i, span: n } = (0, L.VL)( (0, M.Tg)(), "text-to-image-ip-keep", "benchmark_test_user_upload_image_input" ), r = yield t.mWebContentGenerateService.repository.requestAlgorithm( i, "benchmark_test_user_upload_image_input.image_face_ip", { params: {}, fileList: [{ fileUri: e }], options: { ipCheck: !0 }, }, { babi_param: JSON.stringify({ scenario: "image_video_generation", feature_key: "aigc_to_image", feature_entrance: (0, b.b2)(), feature_entrance_detail: "".concat( (0, b.b2)(), "-algo_proxy" ), }), } ); return (n.end(), t._isCancelRecognize) ? { stop: !0, status: l.J.Cancelled } : r.response.ok ? { stop: !1, status: null } : { stop: !0, status: r.logId ? l.J.SafetyCheckError : l.J.NetworkError, }; })(); } cancelRecognize() { this._isCancelRecognize = !0; } getImagineParams() { return { uri: this.originURI, name: a.UI.ByteEdit, imageUriList: [this.originURI], strength: this.referenceLevel / c.cR.max, }; } updateReferenceLevel(e) { this.referenceLevel = e; } reset() { (this.referenceLevel = Math.round(c.cR.default)), (this.originURI = ""), super.reset(); } initWithImagineParams(e, t) { var i, n; if (!!(0, d.fA)(t)) (this.referenceLevel = t.strength ? Math.floor(t.strength * c.cR.max) : Math.round(c.cR.default)), (this.originURI = null !== (n = null === (i = t.imageUriList) || void 0 === i ? void 0 : i[ei]) && void 0 !== n ? n : ""); } get isRecognized() { return !1; } constructor(e, t) { super(), (this.graphicToolService = e), (this.mWebContentGenerateService = t), (this.referenceLevel = c.cR.default), (this.originURI = ""), (this._isCancelRecognize = !1), (0, s.rC)(this); } } (0, r.gn)([s.LO], en.prototype, "referenceLevel", void 0), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [Number]), (0, r.w6)("design:returntype", void 0), ], en.prototype, "updateReferenceLevel", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", []), (0, r.w6)("design:returntype", void 0), ], en.prototype, "reset", null ), (0, r.gn)( [ s.aD.bound, (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ String, "undefined" == typeof TImagineModalAbilityParams ? Object : TImagineModalAbilityParams, ]), (0, r.w6)("design:returntype", void 0), ], en.prototype, "initWithImagineParams", null ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", void 0), (0, r.w6)("design:paramtypes", []), ], en.prototype, "isRecognized", null ), (en = (0, r.gn)( [ (0, r.fM)(0, o.fQ), (0, r.fM)(1, _.M), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === o.fQ ? Object : o.fQ, void 0 === _.M ? Object : _.M, ]), ], en )); var er = i("663456"); class ea { handleUploadTransparentPngInIdleTime(e) { var t, i; ( (null === (t = window) || void 0 === t ? void 0 : t.requestIdleCallback) || (null === (i = window) || void 0 === i ? void 0 : i.setTimeout) )(() => { Y({ fileOrUrl: e, containerService: this._containerService }); }); } addPreloadTask(e) { for (var t of e) this._asyncQueue.addTask(t.loader); } constructor(e) { (this._containerService = e), (this._asyncQueue = new er.z({ concurrent: 2 })); } } ea = (0, r.gn)( [ (0, r.fM)(0, O.t), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === O.t ? Object : O.t]), ], ea ); var eo = i("111709"); class es { static getGraphicToolStoreInstance(e) { return ( !this._instance && (this._instance = null == e ? void 0 : e.createInstance(es, e)), this._instance ); } setGenerateImageParamsManager(e) { this._generateImageParamsManager = e; } changeCurrentAbility(e) { this.currentAbility = e; var t = this.getInstanceByAbility(this.currentAbility); this.activeInstance = t; } getInstanceByAbility(e) { return { [U.s.BasicBlend]: this.basicBlendInstance, [U.s.FaceGan]: this.faceGanInstance, [U.s.BgPaint]: this.bgPaintInstance, [U.s.IpKeep]: this.ipKeepInstance, [U.s.ControlNetCanny]: this.cannyInstance, [U.s.ControlNetDepth]: this.depthInstance, [U.s.ControlNetPose]: this.poseInstance, [U.s.Unknown]: void 0, [U.s.ControlNet]: void 0, [U.s.Text2image]: void 0, [U.s.Image2image]: void 0, [U.s.StyleReference]: this.styleInstance, [U.s.ByteEdit]: this.byteEditInstance, [U.s.StyleCode]: void 0, }[e]; } getImagineParam() { var e, t = null === (e = this.activeInstance) || void 0 === e ? void 0 : e.getImagineParams(); return t ? t : null; } preloadRecognize(e, t, i) { var r, a = this; null === (r = this.preloadManager) || void 0 === r || r.addPreloadTask([ { loader: (0, n._)(function* () { var i; if (!!e.includes(U.s.ByteEdit)) yield null === (i = a.byteEditInstance) || void 0 === i ? void 0 : i.preRecognize(t); }), }, { loader: (0, n._)(function* () { var i; if (!!e.includes(U.s.BgPaint)) yield null === (i = a.bgPaintInstance) || void 0 === i ? void 0 : i.preRecognize(t); }), }, { loader: (0, n._)(function* () { var i; if (!!e.includes(U.s.FaceGan)) yield null === (i = a.faceGanInstance) || void 0 === i ? void 0 : i.preRecognize(t); }), }, { loader: (0, n._)(function* () { var n; if (!!e.includes(U.s.ControlNetCanny)) yield null === (n = a.cannyInstance) || void 0 === n ? void 0 : n.preRecognize(t, i); }), }, { loader: (0, n._)(function* () { var i; if (!!e.includes(U.s.IpKeep)) yield null === (i = a.ipKeepInstance) || void 0 === i ? void 0 : i.preRecognize(t); }), }, ]); } reset() { var e, t, i, n, r, a, o, s; null === (e = this.basicBlendInstance) || void 0 === e || e.reset(), null === (t = this.faceGanInstance) || void 0 === t || t.reset(), null === (i = this.bgPaintInstance) || void 0 === i || i.reset(), null === (n = this.ipKeepInstance) || void 0 === n || n.reset(), null === (r = this.cannyInstance) || void 0 === r || r.reset(), null === (a = this.depthInstance) || void 0 === a || a.reset(), null === (o = this.poseInstance) || void 0 === o || o.reset(), null === (s = this.byteEditInstance) || void 0 === s || s.reset(), this._resetStrength(); } _resetStrength() { var e, t, i, n, r, a = this._generateImageParamsManager; if (a) { var o = a.getStrength(eo.oo.ByteEdit); null === (e = this.byteEditInstance) || void 0 === e || e.updateReferenceLevel(o); var s = a.getStrength(eo.oo.StyleReference); null === (t = this.styleInstance) || void 0 === t || t.updateReferenceLevel(s); var l = a.getStrength(eo.oo.Canny); null === (i = this.cannyInstance) || void 0 === i || i.updateReferenceLevel(l); var c = a.getStrength(eo.oo.Depth); null === (n = this.depthInstance) || void 0 === n || n.updateReferenceLevel(c); var d = a.getStrength(eo.oo.Pose); null === (r = this.poseInstance) || void 0 === r || r.updateReferenceLevel(d); } } syncData(e) { var t, i, n; null === (t = this.cannyInstance) || void 0 === t || t.syncData(e), null === (i = this.depthInstance) || void 0 === i || i.syncData(e), null === (n = this.poseInstance) || void 0 === n || n.syncData(e); } constructor(e) { (this.currentAbility = U.s.Unknown), (this.basicBlendInstance = null == e ? void 0 : e.createInstance(p)), (this.faceGanInstance = null == e ? void 0 : e.createInstance(D)), (this.bgPaintInstance = null == e ? void 0 : e.createInstance(R.C9)), (this.ipKeepInstance = null == e ? void 0 : e.createInstance(j)), (this.cannyInstance = null == e ? void 0 : e.createInstance(X, U.s.ControlNetCanny)), (this.depthInstance = null == e ? void 0 : e.createInstance(X, U.s.ControlNetDepth)), (this.poseInstance = null == e ? void 0 : e.createInstance(X, U.s.ControlNetPose)), (this.styleInstance = null == e ? void 0 : e.createInstance(et)), (this.byteEditInstance = null == e ? void 0 : e.createInstance(en)), (this.preloadManager = null == e ? void 0 : e.createInstance(ea)), (this.activeInstance = void 0); } } }, 133438: function (e, t, i) { "use strict"; i.d(t, { PA: function () { return c; }, W9: function () { return u; }, cj: function () { return o; }, fA: function () { return r; }, iP: function () { return d; }, jq: function () { return a; }, od: function () { return l; }, q0: function () { return s; }, }); var n = i(108982); function r(e) { return e.name === n.s.ByteEdit && 1 !== Object.keys(e).length; } function a(e) { return e.name === n.s.FaceGan && 1 !== Object.keys(e).length; } function o(e) { return e.name === n.s.BgPaint && 1 !== Object.keys(e).length; } function s(e) { return e.name === n.s.BasicBlend && 1 !== Object.keys(e).length; } function l(e) { return e.name === n.s.ControlNet && 1 !== Object.keys(e).length; } function c(e) { return e.name === n.s.IpKeep && 1 !== Object.keys(e).length; } function d(e) { return e.name === n.s.StyleReference && 1 !== Object.keys(e).length; } function u(e) { return ( (e === n.s.ControlNetCanny || e === n.s.ControlNetDepth || e === n.s.ControlNetPose) && e ); } }, 498973: function (e, t, i) { "use strict"; i.d(t, { e: () => C }); var n = i("625572"), r = i("639880"), a = i("789786"), o = i("433965"), s = i("260963"), l = i("902519"), c = i("200294"), d = i("139646"), u = i("241047"), f = i("875488"), h = i("936690"); function p(e, t) { var i, n = new Map(); for (var r of [...t, ...e]) n.set( (0, o.w3)(r) || (0, o.sQ)(r) ? r.key : null === (i = r.commonAttr) || void 0 === i ? void 0 : i.id, r ); return Array.from(n.values()).sort( (e, t) => ((0, o.w3)(t) || (0, o.sQ)(t) ? t.createTime : t.commonAttr.createTime) - ((0, o.w3)(e) || (0, o.sQ)(e) ? e.createTime : e.commonAttr.createTime) ); } function v(e, t) { var i, n, r = new Map(), a = []; for (var s of [...e, ...t]) { if ( !r.has( (0, o.w3)(s) || (0, o.sQ)(s) ? s.key : null === (i = s.commonAttr) || void 0 === i ? void 0 : i.id ) ) r.set( (0, o.w3)(s) || (0, o.sQ)(s) ? s.key : null === (n = s.commonAttr) || void 0 === n ? void 0 : n.id, s ), a.push(s); } return a; } var m = i("586315"), g = i("927457"), _ = i("7197"); function y(e) { return b.apply(this, arguments); } function b() { return (b = (0, d._)(function* (e) { var t, i, n, r, a, o, { secUid: s, imageTypeList: l } = e; if ( !(null === (t = window) || void 0 === t ? void 0 : t._personalFeedSecUid) || (null === (i = window) || void 0 === i ? void 0 : i._personalFeedSecUid) !== s ) return Promise.resolve((0, m.wf)(-1, "secUid mismatch")); if ( !(null === (n = window) || void 0 === n ? void 0 : n._personalFeedImageTypeList) || Array.isArray( null === (r = window) || void 0 === r ? void 0 : r._personalFeedImageTypeList ) ) { var c = new Set(l), d = new Set(window._personalFeedImageTypeList); if (0 !== c.difference(d).size || 0 !== d.difference(c).size) return Promise.resolve((0, m.wf)(-1, "subTab mismatch")); } if ( !(null === (a = window) || void 0 === a ? void 0 : a.__get_homepage_info_result) ) try { yield window.pPersonalFeedList; } catch (e) { (0, g.P)(e); } var u = null === (o = window) || void 0 === o ? void 0 : o.__get_homepage_info_result; return u ? "0" !== u.ret ? Promise.resolve((0, m.wf)(Number(u.ret), u.errmsg)) : ((window.__get_homepage_info_result = void 0), (window._personalFeedSecUid = void 0), (window._personalFeedImageTypeList = void 0), Promise.resolve( (0, m.oW)(yield (0, _.G)(u.data, u.logid, u.cache_sync_token)) )) : Promise.resolve((0, m.ly)()); })).apply(this, arguments); } var I = i("884569"), w = i("993308"); class x { get author() { var e; return null === (e = this.itemList[0]) || void 0 === e ? void 0 : e.author; } reset() { (this.hasMore = !0), (this.itemList = []), (this.offset = 0), (this.hadFetch = !1); } getDataList(e) { var t = this; return (0, d._)(function* () { var i, r = yield (0, f.FI)(), { count: a, secUid: c, offset: d, imageInfo: m } = e, g = { offset: null != d ? d : t.offset, count: null != a ? a : u.iV.count, imageTypeList: t.imageTypeList, secUid: null != c ? c : "", imageInfo: null != m ? m : r, }; if (t.tabType === l.lX.Post) { if ( !(i = yield y({ secUid: g.secUid, imageTypeList: t.imageTypeList, })) || !(i.ok && i.value) ) { var _ = t._prefetchRequestService.findReusableConnectByRequestParams({ displayName: w.s, requestParams: { secUid: g.secUid, offset: 0, count: u.iV.count, imageTypeList: t.imageTypeList, }, }); _ ? (t._prefetchRequestService.burnLater(_), (i = yield _.pRequest)) : (i = yield t._homePageService.homePageRepository.getDataList( g )); } } else i = yield t._homePageService.homePageRepository.getLikeDataList(g); if ( ((0, s.z)(() => { t.hadFetch = !0; }), i.ok) ) { var b = i.value, I = b.itemList .filter((e) => { var t; return ( !( (0, o.Rb)(e) && !(null === (t = e.collection) || void 0 === t ? void 0 : t.itemList) ) && !((0, o.w3)(e) && !e.video) ); }) .map((e) => { var t, i, r = (0, n._)({}, e); if ((0, o.DF)(r)) { var a, s, { width: l, height: c } = null !== (s = null === (a = r.image.largeImages) || void 0 === a ? void 0 : a[0]) && void 0 !== s ? s : {}; (r.width = l), (r.height = c), (r.blendParams = (0, h.tA)(r)); } else if ((0, o.jD)(r)) { var d, u, { width: f, height: p } = null !== (u = null === (d = r.image.largeImages) || void 0 === d ? void 0 : d[0]) && void 0 !== u ? u : {}; (r.width = f), (r.height = p); } else (0, o.Rb)(r) && (null === (i = r.collection) || void 0 === i || null === (t = i.itemList) || void 0 === t || t.forEach((e) => { (e.author = r.author), (e.blendParams = (0, h.tA)(e)); })); return r; }); (0, s.z)(() => { if (0 === d) t.itemList = I; else { var e = t.tabType === l.lX.Post ? p : v; t.itemList = e(t.itemList, I); } (t.hasMore = b.hasMore), (t.totalCount = b.totalCount), (t.offset = b.nextOffset); }); } return i; })(); } constructor(e, t, i, n) { (this._homePageService = i), (this._prefetchRequestService = n), (this.tabType = l.lX.Post), (this.imageTypeList = [l.PK.SINGLE_AND_COLLECTION]), (this.hadFetch = !1), (this.totalCount = 0), (this.hasMore = !0), (this.itemList = []), (this.offset = 0), (this.tabType = e), (this.imageTypeList = t), (0, s.rC)(this); } } (0, a.gn)([s.LO], x.prototype, "hadFetch", void 0), (0, a.gn)([s.LO], x.prototype, "totalCount", void 0), (0, a.gn)([s.LO], x.prototype, "hasMore", void 0), (0, a.gn)( [s.LO, (0, a.w6)("design:type", Array)], x.prototype, "itemList", void 0 ), (0, a.gn)([s.LO], x.prototype, "offset", void 0), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", Object), (0, a.w6)("design:paramtypes", []), ], x.prototype, "author", null ), (x = (0, a.gn)( [ (0, a.fM)(2, I.o), (0, a.fM)(3, c.d), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ void 0 === l.lX ? Object : l.lX, Array, void 0 === I.o ? Object : I.o, void 0 === c.d ? Object : c.d, ]), ], x )); var S = i("699813"); class M { resetFeedListIfNeed() { if (this.hasLikeStateChanged) { var e; (this.hasLikeStateChanged = !1), null === (e = this._instanceAll) || void 0 === e || e.reset(); } } refetchData(e) { var t, i, n; null === (t = this._instanceAllAndVideo) || void 0 === t || t.getDataList({ secUid: e, offset: 0 }), null === (i = this._instanceMasterpiece) || void 0 === i || i.getDataList({ secUid: e, offset: 0 }), null === (n = this._instanceAll) || void 0 === n || n.getDataList({ secUid: e, offset: 0 }); } removeTargetItem(e) { this.removeTargetItemByInstance(e, this._instanceAllAndVideo), this.removeTargetItemByInstance(e, this._instanceMasterpiece), this.removeTargetItemByInstance(e, this.instanceAll); } makeItemFavorite(e, t) { this.makeItemFavoriteByInstance(e, t, this._instanceAllAndVideo), this.makeItemFavoriteByInstance(e, t, this._instanceMasterpiece), this.makeItemFavoriteByInstance(e, t, this._instanceAll), (this.hasLikeStateChanged = !0); } removeTargetItemByInstance(e, t) { if (!!t) { var i = t.itemList.findIndex( (t) => ((0, o.w3)(t) || (0, o.sQ)(t) ? t.publishedItemId : t.commonAttr.id) === e ); i > -1 && (0, s.z)(() => { (t.itemList = t.itemList.filter((e, t) => t !== i)), t.totalCount && (t.totalCount -= 1); }); } } updateHasLikeReady(e) { this.hasLikeReady = e; } makeItemFavoriteByInstance(e, t, i) { if (!!i) { var n = i.itemList.findIndex( (t) => ((0, o.w3)(t) || (0, o.sQ)(t) ? t.key : t.commonAttr.id) === e ); if (n > -1) { var r = i.itemList[n]; (0, s.z)(() => { r.statistic && ((r.statistic.favoriteNum += t ? 1 : -1), (r.statistic.hasFavorited = t)); }); } (0, s.z)(() => { i.tabType === l.lX.Like && (i.totalCount += t ? 1 : -1); }); } } get instanceAll() { return this._instanceAll; } get activeImageType() { var e, t, i; return (null === (e = this.activeInstance) || void 0 === e ? void 0 : e.imageTypeList.length) === 1 && null !== (i = null === (t = this.activeInstance) || void 0 === t ? void 0 : t.imageTypeList[0]) && void 0 !== i ? i : l.PK.SINGLE_AND_COLLECTION; } get isActiveInstanceHadFetch() { var e, t; return ( null !== (t = null === (e = this.activeInstance) || void 0 === e ? void 0 : e.hadFetch) && void 0 !== t && t ); } get isActiveImageTypeEmpty() { var e; return ( (null === (e = this.activeInstance) || void 0 === e ? void 0 : e.itemList.length) === 0 ); } get allWorkCardCount() { var e, t; return null !== (t = null === (e = this._instanceAll) || void 0 === e ? void 0 : e.totalCount) && void 0 !== t ? t : 0; } get workCardList() { var e, t; return null !== (t = null === (e = this.activeInstance) || void 0 === e ? void 0 : e.itemList) && void 0 !== t ? t : []; } setActiveInstance(e) { this.activeInstance = e; } setActiveSubTabType(e) { this.activeSubTabType = e; } changeCurrentSubTabType(e) { switch (e) { case l.Ym.Story: this.setActiveSubTabType(l.Ym.Story), this.setActiveInstance(this._instanceMasterpiece); break; case l.Ym.Template: this.setActiveSubTabType(l.Ym.Template), this.setActiveInstance(this._instanceAllAndVideo); break; default: (0, S.bP)(e, "unknown sub tab type"); } } changeCurrentImageType(e) { switch (e) { case l.PK.IMAGE_SINGLE: (0, S.ss)( "currently no implementation for MWebImageType.IMAGE_SINGLE" ); case l.PK.IMAGE_COLLECTION: (0, S.ss)( "currently no implementation for MWebImageType.IMAGE_COLLECTION" ); case l.PK.SINGLE_AND_COLLECTION: this.setActiveInstance(this._instanceAll); break; case l.PK.MASTERPIECE: this.setActiveSubTabType(l.Ym.Story), this.setActiveInstance(this._instanceMasterpiece); break; default: this.setActiveSubTabType(l.Ym.Template), this.setActiveInstance(this._instanceAllAndVideo); } } constructor(e, t) { (this.hasLikeStateChanged = !1), (this.hasLikeReady = !0), (this._instanceAllAndVideo = void 0), (this._instanceMasterpiece = void 0), (this._instanceAll = void 0), (this.activeInstance = void 0), (this.activeSubTabType = l.Ym.Template), (this.listDataType = t), (this._instanceAllAndVideo = e.createInstance(x, t, [ ...u.fk[l.Ym.Template], ])), (this._instanceMasterpiece = e.createInstance(x, t, [ ...u.fk[l.Ym.Story], ])), (this._instanceAll = e.createInstance(x, t, [ l.PK.SINGLE_AND_COLLECTION, ])), (this.activeInstance = this._instanceAllAndVideo), (0, s.rC)(this); } } (0, a.gn)( [s.LO, (0, a.w6)("design:type", Object)], M.prototype, "activeInstance", void 0 ), (0, a.gn)( [s.LO, (0, a.w6)("design:type", void 0 === l.Ym ? Object : l.Ym)], M.prototype, "activeSubTabType", void 0 ), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", void 0 === l.PK ? Object : l.PK), (0, a.w6)("design:paramtypes", []), ], M.prototype, "activeImageType", null ), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", Boolean), (0, a.w6)("design:paramtypes", []), ], M.prototype, "isActiveInstanceHadFetch", null ), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", Boolean), (0, a.w6)("design:paramtypes", []), ], M.prototype, "isActiveImageTypeEmpty", null ), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", Number), (0, a.w6)("design:paramtypes", []), ], M.prototype, "allWorkCardCount", null ), (0, a.gn)( [ s.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], M.prototype, "workCardList", null ), (0, a.gn)( [ s.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [Object]), (0, a.w6)("design:returntype", void 0), ], M.prototype, "setActiveInstance", null ), (0, a.gn)( [ s.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [void 0 === l.Ym ? Object : l.Ym]), (0, a.w6)("design:returntype", void 0), ], M.prototype, "setActiveSubTabType", null ); class C { static getHomePageStoreInstance(e, t) { return ( (!this._instance || t.needCreateNewInstance) && (this._instance = null == e ? void 0 : e.createInstance(C, e, t)), this._instance ); } static removeTargetItem(e) { var t, i, n, r; null === (i = this._instance) || void 0 === i || null === (t = i._postTabInstanceMap) || void 0 === t || t.removeTargetItem(e), null === (r = this._instance) || void 0 === r || null === (n = r._likeTabInstanceMap) || void 0 === n || n.removeTargetItem(e); } static makeItemFavorite(e, t) { var i, a, s, l; if ( (null === (a = this._instance) || void 0 === a || null === (i = a._postTabInstanceMap) || void 0 === i || i.makeItemFavorite(e, t), null === (l = this._instance) || void 0 === l || null === (s = l._likeTabInstanceMap) || void 0 === s || s.makeItemFavorite(e, t), t) ) { var c, d, u, f, h, p = null === (u = this._instance) || void 0 === u ? void 0 : null === (d = u._postTabInstanceMap) || void 0 === d ? void 0 : null === (c = d.activeInstance) || void 0 === c ? void 0 : c.itemList.find( (t) => ((0, o.w3)(t) || (0, o.sQ)(t) ? t.key : t.commonAttr.id) === e ); p && (null === (h = this._instance) || void 0 === h ? void 0 : null === (f = h._likeTabInstanceMap) || void 0 === f ? void 0 : f.activeInstance) && (this._instance._likeTabInstanceMap.activeInstance.itemList = [ (0, r._)((0, n._)({}, p), { statistic: (0, n._)({}, p.statistic), }), ...this._instance._likeTabInstanceMap.activeInstance.itemList, ]); } else { var v, m, g, _, y, b = null === (g = this._instance) || void 0 === g ? void 0 : null === (m = g._likeTabInstanceMap) || void 0 === m ? void 0 : null === (v = m.activeInstance) || void 0 === v ? void 0 : v.itemList.find( (t) => ((0, o.w3)(t) || (0, o.sQ)(t) ? t.key : t.commonAttr.id) === e ); b && (null === (y = this._instance) || void 0 === y ? void 0 : null === (_ = y._likeTabInstanceMap) || void 0 === _ ? void 0 : _.activeInstance) && (this._instance._likeTabInstanceMap.activeInstance.itemList = this._instance._likeTabInstanceMap.activeInstance.itemList.filter( (e) => e !== b )); } } static refetchPostDataList(e) { var t, i; null === (i = this._instance) || void 0 === i || null === (t = i._postTabInstanceMap) || void 0 === t || t.refetchData(e); } static deletePrefetchCache(e) { var t, i; null === (i = this._instance) || void 0 === i || null === (t = i.deletePrefetchCache) || void 0 === t || t.call(i, e); } setActiveListTabInstance(e) { this.activeTabInstance = e; } get postTabInstance() { return this._postTabInstanceMap; } get likeTabInstance() { return this._likeTabInstanceMap; } changeTabImageType(e) { var t, i; null === (t = this.postTabInstance) || void 0 === t || t.changeCurrentImageType(e), null === (i = this.likeTabInstance) || void 0 === i || i.changeCurrentImageType(e); } changeCurrentListDataType(e) { switch (e) { case l.lX.Post: this.setActiveListTabInstance(this._postTabInstanceMap); break; case l.lX.Like: this.setActiveListTabInstance(this._likeTabInstanceMap); break; default: this.setActiveListTabInstance(this._postTabInstanceMap); } } deletePrefetchCache(e) { if (!!this._containerService) { var t = this._containerService.invokeFunction((e) => e.get(c.d)); t.deleteCache({ displayName: "homepage", params: { secUid: e } }), t.deleteCache({ displayName: "user-info", params: { secUid: e }, }); } } constructor(e, t) { if ( ((this._postTabInstanceMap = void 0), (this._likeTabInstanceMap = void 0), (this._containerService = void 0), (this.activeTabInstance = void 0), !e) ) return; this._containerService = e; var { hasPublishAuthority: i } = t; (this._postTabInstanceMap = e.createInstance(M, e, l.lX.Post)), (this._likeTabInstanceMap = e.createInstance(M, e, l.lX.Like)), (this.activeTabInstance = i ? this._postTabInstanceMap : this._likeTabInstanceMap), (0, s.rC)(this); } } (C._instance = void 0), (0, a.gn)( [s.LO, (0, a.w6)("design:type", Object)], C.prototype, "activeTabInstance", void 0 ), (0, a.gn)( [ s.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [M]), (0, a.w6)("design:returntype", void 0), ], C.prototype, "setActiveListTabInstance", null ); }, 610806: function (e, t, i) { "use strict"; i.d(t, { v: function () { return u; }, }); var n = i(139646), r = i(789786), a = i(836703), o = i(748312), s = i(260963), l = i(791628), c = i(875488), d = Math.max(16, Math.ceil(window.innerHeight / 62)); class u { static getNoticeStoreInstance(e) { return ( !this._instance && (this._instance = null == e ? void 0 : e.createInstance(u)), this._instance ); } static changeWorkValidStatus(e) { var t; if (!!this._instance) null === (t = this._instance.messageList) || void 0 === t || t.forEach((t) => { var i; (null === (i = t.noticeItem) || void 0 === i ? void 0 : i.itemId) === e && (0, s.z)(() => { t.noticeItem.status = a.p_.InValid; }); }); } static followUser(e) { var t; if (!!this._instance) null === (t = this._instance.messageList) || void 0 === t || t.forEach((t) => { t.messageFrom.secUid === e && (0, s.z)(() => { t.hasFollowed = !0; }); }); } static cancelFollowUser(e) { var t; if (!!this._instance) null === (t = this._instance.messageList) || void 0 === t || t.forEach((t) => { t.messageFrom.secUid === e && (0, s.z)(() => { t.hasFollowed = !1; }); }); } get totalNewMessageCount() { return ( this.newMessageCount[a.O8.Community] + this.newMessageCount[a.O8.System] ); } getUnreadCount() { var e = this; return (0, n._)(function* () { var t = yield e._noticeService.noticeRepository.getUnreadCount({ noticeTypeList: [a.O8.Community, a.O8.System], }); return ( t.ok && (0, s.z)(() => { e.newMessageCount = t.value; }), t ); })(); } requestNoticeList(e, t) { var i = this; return (0, n._)(function* () { var n = yield (0, c.FI)(); return yield i._noticeService.noticeRepository.getNoticeList({ count: d, noticeType: e, cursor: t, imageInfo: n, }); })(); } fetchNoticeList(e) { var t = this; return (0, n._)(function* () { var i = yield t.requestNoticeList(e, t.cursor[e]); if (i.ok) { var { hasMore: n, nextCursor: r, noticeList: o, messageList: c, } = i.value; (0, s.z)(() => { e === a.O8.Community ? (t.messageList = (0, l.xk)( t.messageList, null != c ? c : [] )) : (t.noticeList = (0, l.xk)( t.noticeList, null != o ? o : [] )), (t.hasMore[e] = n), (t.cursor[e] = r); }); } return i; })(); } fetchFirstPageNotice(e) { var t = this; return (0, n._)(function* () { if (!t.hasInitialized[e] || !(t.newMessageCount[e] <= 0)) { var i = yield t.requestNoticeList(e, 0); if (i.ok) { var { hasMore: n, nextCursor: r, noticeList: o, messageList: l, } = i.value; (0, s.z)(() => { e === a.O8.System ? (t.noticeList = o) : (t.messageList = l), (t.hasMore[e] = n), (t.hasInitialized[e] = !0), (t.cursor[e] = r); }); } return i; } })(); } fetchAllTypeFirstPageNotice() { var e = this; return (0, n._)(function* () { yield Promise.all([ e.fetchFirstPageNotice(a.O8.Community), e.fetchFirstPageNotice(a.O8.System), ]); })(); } setNewMessageCount(e) { (0, s.z)(() => { this.newMessageCount = { [a.O8.Community]: e, [a.O8.System]: e }; }); } constructor(e) { (this._noticeService = e), (this.newMessageCount = { [a.O8.Community]: 0, [a.O8.System]: 0 }), (this.hasMore = { [a.O8.Community]: !1, [a.O8.System]: !1 }), (this.hasInitialized = { [a.O8.Community]: !1, [a.O8.System]: !1 }), (this.cursor = { [a.O8.Community]: 0, [a.O8.System]: 0 }), (this.noticeList = []), (this.messageList = []), (0, s.rC)(this); } } (0, r.gn)( [ s.LO, (0, r.w6)( "design:type", "undefined" == typeof Record ? Object : Record ), ], u.prototype, "newMessageCount", void 0 ), (0, r.gn)( [ s.LO, (0, r.w6)( "design:type", "undefined" == typeof Record ? Object : Record ), ], u.prototype, "hasMore", void 0 ), (0, r.gn)( [ s.LO, (0, r.w6)( "design:type", "undefined" == typeof Record ? Object : Record ), ], u.prototype, "hasInitialized", void 0 ), (0, r.gn)( [ s.LO, (0, r.w6)( "design:type", "undefined" == typeof Record ? Object : Record ), ], u.prototype, "cursor", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Array)], u.prototype, "noticeList", void 0 ), (0, r.gn)( [s.LO, (0, r.w6)("design:type", Array)], u.prototype, "messageList", void 0 ), (0, r.gn)( [ s.Fl, (0, r.w6)("design:type", Number), (0, r.w6)("design:paramtypes", []), ], u.prototype, "totalNewMessageCount", null ), (u = (0, r.gn)( [ (0, r.fM)(0, o.Z), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === o.Z ? Object : o.Z]), ], u )); }, 735138: function (e, t, i) { "use strict"; i.d(t, { e: () => R }); var n = i("241047"), r = i("139646"), a = i("789786"), o = i("260963"), s = i("699813"), l = i("433965"), c = i("936690"), d = i("952739"), u = i("224671"), f = i("625572"), h = i("639880"), p = (e) => (Array.isArray(e) ? e : [e, e]); class v { addItems(e) { var t = e.map((e) => (0, h._)((0, f._)({}, e), { x: 0, y: 0, width: 0, height: 0, spanIndex: 0, }) ); this._originalItems.push(...t), this._prepared && t.forEach((e) => this._computeLayout(e)); } removeItem(e) { this._removeById(this._originalItems, e), this._removeById(this._crossSpanItems, e), this._layout.forEach((t) => this._removeById(t.items, e)), this._removeById(this.renderedItems, e); } replaceItem(e, t) { this._replaceById(this._originalItems, e, t), this._replaceById(this._crossSpanItems, e, t), this._layout.forEach((i) => this._replaceById(i.items, e, t)), this._replaceById(this.renderedItems, e, t); } repaint(e) { e && ((this._cellWidth = e.cellWidth), (this._columns = e.columns), (this._gutter = p(e.gutter))), (this._prepared = !0), this._initLayout(), (this._lastInsertIndex = -1), (this._crossSpanItems = []), (this.renderedItems = []), this._originalItems.forEach((e) => this._computeLayout(e)); } _initLayout() { this._layout = Array.from({ length: this._columns }, (e, t) => ({ index: t, height: 0, items: [], })); } _computeLayout(e) { e.span > 1 && this._crossSpanItems.push(e); for ( var t = this._getMinHeightColumnIndex(), i = { canInsert: !1, clips: [], reason: "OK" }; this._crossSpanItems.length; ) { var n = this._crossSpanItems[0]; if (!(i = this._canInsertCrossSpanItem(t, n)).canInsert) break; this._clipLayoutByCrossSpanItem(t, n, i.clips), this._updateSizeAndPosition(t, n), this._updateLayout(t, n), this._crossSpanItems.shift(), this.renderedItems.push(n), (this._lastInsertIndex = this.renderedItems.length - 1), (t = this._getMinHeightColumnIndex()); } e.span <= 1 && (this._updateSizeAndPosition(t, e), this._updateLayout(t, e), this.renderedItems.push(e)); } _canInsertCrossSpanItem(e, t) { if ( this.renderedItems.length - this._lastInsertIndex <= this._crossSpanFrequency && this._lastInsertIndex >= 0 ) return { canInsert: !1, clips: [], reason: "Frequency control: skipped by frequency control", }; var { span: i } = t, n = this._layout.slice(e, e + i); if (n.length < i) return { canInsert: !1, clips: [], reason: "No Space: not enough space to insert at this row", }; if (!this._allowFirstRowCrossSpan && n.every((e) => 0 === e.height)) return { canInsert: !1, clips: [], reason: "Bad position: cannot insert at first row", }; var r = n.map((e) => e.height), a = Math.min(...r), o = r.map((e) => e - a); return n.some((e, t) => !this._canClipped(e, o[t])) ? { canInsert: !1, clips: [], reason: "Bad clips: clipped images is not good enough", } : { canInsert: !0, clips: o, reason: "OK" }; } _canClipped(e, t) { var i = e.items.at(-1); return !i || (i.height - t) / i.width >= this._clipRatioLimit; } _getMinHeightColumnIndex() { var e = 1 / 0, t = -1; return ( this._layout.forEach((i) => { i.height < e && ((e = i.height), (t = i.index)); }), t ); } _updateSizeAndPosition(e, t) { var i = (this._cellWidth + this._gutter[0]) * e, n = this._layout[e].height && this._layout[e].height + this._gutter[1], r = (this._cellWidth + this._gutter[0]) * t.span - this._gutter[0], a = r * (t.originHeight / t.originWidth); return ( (t.x = i), (t.y = n), (t.width = r), (t.height = a + t.extraHeight), t ); } _updateLayout(e, t) { var [i = 0, n = 0] = p(t.extraMargin); t.y += t.y ? i : 0; for (var r = 0; r < t.span; r++) { var a = this._layout[e + r]; (t.spanIndex = r), a.items.push(t), (a.height = t.y + ~~t.height + n); } } _clipLayoutByCrossSpanItem(e, t, i) { for (var n = 0; n < t.span; n++) { var r = this._layout[e + n], a = r.items.at(-1), o = i.at(n); a && o && ((a.height -= o), (r.height -= o)); } } _removeById(e, t) { var i = e.findIndex((e) => e.id === t); -1 !== i && e.splice(i, 1); } _replaceById(e, t, i) { var n = e.findIndex((e) => e.id === t); -1 !== n && (e[n].data = i); } constructor(e) { (this._crossSpanItems = []), (this._layout = []), (this._lastInsertIndex = -1), (this._originalItems = []), (this._cellWidth = 0), (this._columns = 0), (this._gutter = [0, 0]), (this._prepared = !1), (this.renderedItems = []); var { allowFirstRowCrossSpan: t = !0, crossSpanFrequency: i = 1, clipRatioLimit: n = 1, } = null != e ? e : {}; (0, s.Y2)(i > 0, "crossSpanFrequency should be greater than 0"), (this._allowFirstRowCrossSpan = t), (this._crossSpanFrequency = i), (this._clipRatioLimit = n), this._initLayout(); } } var m = i("591586"), g = i("915814"), _ = i("6080"), y = i("645968"), b = 12; class I { get itemList() { return this._masonryStore.renderedItems.map((e) => e.data); } getFeedList(e) { var t = this; return (0, r._)(function* () { if (!!t.hasMore) { var i = yield t._feedService.feedRepository.getFeedList({ offset: t.offset, categoryId: t._categoryId, count: e.count, imageInfo: e.imageInfo, }); if (!i.ok) return i; var { itemList: n, hasMore: r } = i.value, a = []; return ( n.forEach((e) => { if ((0, l.Rb)(e)) { if (!e.collection.itemList.length) return m.t.error("Feed list dirty data", e); e.collection.itemList.forEach( (t) => ( (t.blendParams = (0, c.tA)(t)), (t.author = e.author), t ) ); var i = (0, _.q)(e.collection.itemList.length, 100, 100); (e.width = 100 * i.ratioWidth), (e.height = 100 * i.ratioHeight); } else if ((0, l.DF)(e)) { var n, r, { text2imageParams: o } = e.aigcImageParams, { width: s, height: u } = null !== (r = null === (n = e.image.largeImages) || void 0 === n ? void 0 : n[0]) && void 0 !== r ? r : {}; (o.imageRatio = (0, d.Ir)(o.imageRatio, s, u)), (e.width = s), (e.height = u), (e.blendParams = (0, c.tA)(e)); } else if ((0, l.jD)(e)) { var f, h, { width: p, height: v } = null !== (h = null === (f = e.image.largeImages) || void 0 === f ? void 0 : f[0]) && void 0 !== h ? h : {}; (e.width = p), (e.height = v); } !t._idSet.has(e.commonAttr.id) && (a.push(e), t._idSet.add(e.commonAttr.id)); }), a.length && (0, o.z)(() => { (t.hasMore = r), (t.offset += e.count), t._masonryStore.addItems( a.map((e) => { var t, i, n = e.commonAttr.effectType === u.O5.Single; return { id: e.commonAttr.id, originWidth: null !== (t = e.width) && void 0 !== t ? t : 0, originHeight: null !== (i = e.height) && void 0 !== i ? i : 0, extraHeight: n ? 0 : g.$P, extraMargin: n ? void 0 : b, span: n ? 1 : 2, data: e, }; }) ), (t.renderedItems = t._masonryStore.renderedItems); }), i ); } })(); } removeTargetItem(e) { this._masonryStore.removeItem(e), this._masonryStore.repaint(), (this.renderedItems = this._masonryStore.renderedItems); } makeItemFavorite(e, t) { var i = this.renderedItems.findIndex((t) => t.id === e); if (-1 !== i) { var n = this.renderedItems[i].data; n.statistic && ((n.statistic.favoriteNum += t ? 1 : -1), (n.statistic.hasFavorited = t)), this._masonryStore.replaceItem(e, this.renderedItems[i].data); } } repaint(e) { this._masonryStore.repaint(e), (this.renderedItems = this._masonryStore.renderedItems); } constructor(e, t) { (this._feedService = t), (this.hasMore = !0), (this.offset = 0), (this.renderedItems = []), (this._categoryId = e), (this._masonryStore = new v()), (this._idSet = new Set()), (0, o.rC)(this); } } (0, a.gn)( [o.LO, (0, a.w6)("design:type", v)], I.prototype, "_masonryStore", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Boolean)], I.prototype, "hasMore", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Number)], I.prototype, "offset", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Array)], I.prototype, "renderedItems", void 0 ), (0, a.gn)( [ o.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], I.prototype, "itemList", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IGetFeedListParam ? Object : IGetFeedListParam, ]), (0, a.w6)("design:returntype", Promise), ], I.prototype, "getFeedList", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [String]), (0, a.w6)("design:returntype", void 0), ], I.prototype, "removeTargetItem", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [String, Boolean]), (0, a.w6)("design:returntype", void 0), ], I.prototype, "makeItemFavorite", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof MasonryLayoutOptions ? Object : MasonryLayoutOptions, ]), (0, a.w6)("design:returntype", void 0), ], I.prototype, "repaint", null ), (I = (0, a.gn)( [ (0, a.fM)(1, y.d), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ Number, void 0 === y.d ? Object : y.d, ]), ], I )); var w = 0, x = 300; class S { static createFeedStoreInstance(e, t, i) { if (e) { var n, r = e.createInstance(I, t); null === (n = this._instance) || void 0 === n || n._feedStoreInstanceMap.set(i, r); } } static prepare(e) { return new Promise((t) => { var i; null === (i = this._instance) || void 0 === i || i ._getFeedPanel() .then((t) => { (0, s.Y2)(t.length > 0, "feed panel is empty"), t.forEach((t, i) => { var { id: n } = t; return this.createFeedStoreInstance(e, n, i); }); }) .catch(() => this.createFeedStoreInstance(e, n.qs, 0)) .finally(t); }); } static getFeedPanelInstance(e) { return this._instance ? { instance: this._instance, isFirstCreated: !1 } : ((this._instance = null == e ? void 0 : e.createInstance(S)), this._instance && (this._instance._prepareLock = this.prepare(e)), { instance: this._instance, isFirstCreated: !0 }); } static removeTargetItem(e) { (0, o.z)(() => { var t; if (!!this._instance) null === (t = this._instance._feedStoreInstanceMap.get( this._instance.selectIndex )) || void 0 === t || t.removeTargetItem(e); }); } static makeItemFavorite(e, t) { (0, o.z)(() => { var i; if (!!this._instance) null === (i = this._instance._feedStoreInstanceMap.get( this._instance.selectIndex )) || void 0 === i || i.makeItemFavorite(e, t); }); } get _stores() { return this.panelList.map((e, t) => this._feedStoreInstanceMap.get(t) ); } get renderItems() { return this._stores.map((e) => { var t; return null !== (t = null == e ? void 0 : e.renderedItems) && void 0 !== t ? t : []; }); } get feedData() { return this.renderItems.map((e) => e.map((e) => e.data)); } get repaintCurrentPanel() { var e = this._stores[this.selectIndex]; return e ? e.repaint.bind(e) : () => null; } prefetchAllPanelList(e) { var t = this; return (0, r._)(function* () { var i = function (i) { i !== t.selectIndex && setTimeout(() => { t._getIndexFeedList(e, i).then((e) => { (0, o.z)(() => { var n, r; t.prefetchStatus[i] = null !== (r = null == e ? void 0 : null === (n = e.response) || void 0 === n ? void 0 : n.ok) && void 0 !== r && r; }); }); }, x); }, { panelList: n } = t; !n.length && (n = yield t._getFeedPanel()); for (var r = 0; r < n.length; r++) i(r); (0, o.z)(() => { (t.prefetchStatus[t.selectIndex] = !0), (t.panelList = n); }); })(); } updateSelectIndex(e) { this.selectIndex = e; } getFeedList(e) { var t = this; return (0, r._)(function* () { return yield t._getIndexFeedList(e, t.selectIndex); })(); } _getIndexFeedList(e, t) { var i = this; return (0, r._)(function* () { yield i._prepareLock; var n = !i.panelList.length, r = i._feedStoreInstanceMap.get(t); if (n || !(null == r ? void 0 : r.hasMore)) return; var a = yield r.getFeedList(e); if (!!a) return { response: a, panelList: i.panelList }; })(); } _getFeedPanel() { var e = this; return (0, r._)(function* () { var t = yield e._feedService.feedRepository.getFeedPanel({ panel: n.Zc.panel, }); if (!t.ok) return []; var i = t.value.categoryList; return (0, o.z)(() => (e.panelList = i)), i; })(); } constructor(e) { (this._feedService = e), (this._feedStoreInstanceMap = new Map()), (this.visible = !1), (this.prefetchStatus = []), (this.panelList = []), (this.selectIndex = w), (0, o.rC)(this); } } (0, a.gn)( [ o.LO, (0, a.w6)("design:type", "undefined" == typeof Map ? Object : Map), ], S.prototype, "_feedStoreInstanceMap", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Boolean)], S.prototype, "visible", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Array)], S.prototype, "prefetchStatus", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Array)], S.prototype, "panelList", void 0 ), (0, a.gn)( [o.LO, (0, a.w6)("design:type", Number)], S.prototype, "selectIndex", void 0 ), (0, a.gn)( [ o.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], S.prototype, "_stores", null ), (0, a.gn)( [ o.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], S.prototype, "renderItems", null ), (0, a.gn)( [ o.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], S.prototype, "feedData", null ), (0, a.gn)( [ o.Fl, (0, a.w6)("design:type", void 0), (0, a.w6)("design:paramtypes", []), ], S.prototype, "repaintCurrentPanel", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ "undefined" == typeof IGetFeedListParam ? Object : IGetFeedListParam, ]), (0, a.w6)("design:returntype", Promise), ], S.prototype, "prefetchAllPanelList", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [Number]), (0, a.w6)("design:returntype", void 0), ], S.prototype, "updateSelectIndex", null ), (0, a.gn)( [ o.aD.bound, (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", []), (0, a.w6)("design:returntype", Promise), ], S.prototype, "_getFeedPanel", null ), (S = (0, a.gn)( [ (0, a.fM)(0, y.d), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [void 0 === y.d ? Object : y.d]), ], S )); var M = i("498973"), C = i("661551"), T = i("106863"), A = i("610806"), k = i("648326"), P = i("964917"), E = i("532185"), D = i("94012"); class R { static setActivityDetailManager(e) { this.activityDetailManager = e; } static publishProduction(e, t, i, r) { null == i || i.changePublishStatus(n.UN.Publish, e, t), null == r || r.changePublishStatus(n.UN.Publish, e, t), C.j.selfSecUid && M.e.deletePrefetchCache(C.j.selfSecUid), C.j.selfSecUid && M.e.refetchPostDataList(C.j.selfSecUid); } static unPublishProduction(e, t) { var i; M.e.removeTargetItem(e), S.removeTargetItem(e), null == t || t.changePublishStatus(n.UN.Delete, e, "0", !0), A.v.changeWorkValidStatus(e), null === (i = this.activityDetailManager) || void 0 === i || i.removeItem(e), C.j.selfSecUid && M.e.deletePrefetchCache(C.j.selfSecUid); } static publishVideo(e, t) { P.m.markPublished(e, t), E.G.markPublished(e, t), C.j.selfSecUid && M.e.deletePrefetchCache(C.j.selfSecUid), C.j.selfSecUid && M.e.refetchPostDataList(C.j.selfSecUid); } static unpublishVideo(e, t) { var i; P.m.markPublished(null != e ? e : ""), E.G.markPublished(null != e ? e : ""), M.e.removeTargetItem(t), S.removeTargetItem(t), A.v.changeWorkValidStatus(t), null === (i = this.activityDetailManager) || void 0 === i || i.removeItem(t), C.j.selfSecUid && M.e.deletePrefetchCache(C.j.selfSecUid); } static likeProduction(e, t) { var i, n; k.p.makeItemFavorite(e, !0), M.e.makeItemFavorite(e, !0), S.makeItemFavorite(e, !0), T.B.makeItemFavorite(e, !0), t && C.j.handlerLikeProduction(t), t && M.e.deletePrefetchCache(t), null === (n = this.activityDetailManager) || void 0 === n || null === (i = n.makeItemFavorite) || void 0 === i || i.call(n, e, !0), D.S.makeExploreFavorite(e, !0); } static unlikeProduction(e, t) { var i, n; k.p.makeItemFavorite(e, !1), M.e.makeItemFavorite(e, !1), S.makeItemFavorite(e, !1), T.B.makeItemFavorite(e, !1), t && C.j.handlerUnlikeProduction(t), t && M.e.deletePrefetchCache(t), null === (n = this.activityDetailManager) || void 0 === n || null === (i = n.makeItemFavorite) || void 0 === i || i.call(n, e, !1), D.S.makeExploreFavorite(e, !1); } static removePersonHistoryItems(e, t, i) { null == t || t.deleteContentRecords(e), null == i || i.deleteHistoryList(e); } static followUser(e) { C.j.handlerFollowUser(e), A.v.followUser(e), M.e.deletePrefetchCache(e); } static cancelFollowUser(e) { C.j.handlerCancelFollowUser(e), A.v.cancelFollowUser(e), M.e.deletePrefetchCache(e); } static usePromote(e) { C.j.handlerUsePromote(e); } } }, 661551: function (e, t, i) { "use strict"; i.d(t, { j: () => S }); var n = i("139646"), r = i("366103"), a = i("789786"), o = i("758261"), s = i("280166"), l = i("260963"), c = i("586315"), d = i("927457"), u = i("7197"); function f(e) { return h.apply(this, arguments); } function h() { return (h = (0, n._)(function* (e) { if ( !(null === (t = window) || void 0 === t ? void 0 : t._secUid) || (null === (i = window) || void 0 === i ? void 0 : i._secUid) !== e ) return Promise.resolve((0, c.wf)(-1, "secUid mismatch")); if ( !(null === (n = window) || void 0 === n ? void 0 : n.__get_user_info_result) ) try { yield window.pSecUserInfo; } catch (e) { (0, d.P)(e); } var t, i, n, r, a = null === (r = window) || void 0 === r ? void 0 : r.__get_user_info_result; return a ? "0" !== a.ret ? Promise.resolve((0, c.wf)(Number(a.ret), a.errmsg)) : ((window.__get_user_info_result = void 0), (window._secUid = void 0), Promise.resolve( (0, c.oW)(yield (0, u.G)(a.data, a.logid, a.cache_sync_token)) )) : Promise.resolve((0, c.ly)()); })).apply(this, arguments); } var p = i("745017"), v = i("819340"), m = i("200294"), g = i("161041"); class _ { refreshUserInfo(e) { var t = this; return (0, n._)(function* () { if (!(!e && t.isValid()) && !t.loading) { (0, l.z)(() => { t.loading = !0; }); var i = null; if ( (null === t.userInfo && (i = yield f(t.secUid)), !i || !(i.ok && i.value)) ) { var n = t._prefetchRequestService.findReusableConnect({ displayName: g.s, params: { secUid: t.secUid }, }); n ? (t._prefetchRequestService.burnLater(n), (i = yield n.pRequest)) : (i = yield t._userService.repository.getUserInfo({ secUid: t.secUid, })); } return ( (0, l.z)(() => { t.loading = !1; }), i.ok && (0, l.z)(() => { (t.userInfo = i.value), (t.updateTime = Date.now()); }), i ); } })(); } isValid() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.maxAge; return !!(this.userInfo && Date.now() - this.updateTime <= e) || !1; } updateUserInfo(e) { var t = this; return (0, n._)(function* () { return yield t._userService.repository.updateUserInfo(e); })(); } follow(e, t) { (0, l.z)(() => { if (!!this.userInfo) t ? (this.userInfo.follow += 1) : (this.userInfo.fans += 1), e === this.userInfo.secUid && (this.userInfo.hasFollowed = !0); }); } cancelFollow(e, t) { (0, l.z)(() => { if (!!this.userInfo) t && this.userInfo.follow > 0 ? (this.userInfo.follow -= 1) : !t && this.userInfo.fans > 0 && (this.userInfo.fans -= 1), e === this.userInfo.secUid && (this.userInfo.hasFollowed = !1); }); } increaseLikeCount() { (0, l.z)(() => { if (!!this.userInfo) this.userInfo.totalMaterialsFavorite += 1; }); } decreaseLikeCount() { (0, l.z)(() => { if (!!this.userInfo) this.userInfo.totalMaterialsFavorite > 0 && (this.userInfo.totalMaterialsFavorite -= 1); }); } increaseUsageCount() { (0, l.z)(() => { if (!!this.userInfo) this.userInfo.totalMaterialsUsage += 1; }); } updateAvatarImage(e) { var t = this; return (0, n._)(function* () { var i = t._uploadService.getImageXUploader( t._environmentService.appId, p.I ), n = yield i.uploadImage({ file: e }); if (n.ok) return n.value.uri; })(); } clear() { (0, l.z)(() => { this.userInfo = null; }); } constructor(e, t, i, n, r) { (this._userService = t), (this._environmentService = i), (this._uploadService = n), (this._prefetchRequestService = r), (this.userInfo = null), (this.secUid = ""), (this.loading = !1), (this.updateTime = 0), (this.maxAge = 36e4), (0, l.rC)(this), (this.secUid = e); } } (0, a.gn)( [l.LO, (0, a.w6)("design:type", Object)], _.prototype, "userInfo", void 0 ), (0, a.gn)([l.LO], _.prototype, "secUid", void 0), (0, a.gn)([l.LO], _.prototype, "loading", void 0), (0, a.gn)([l.LO], _.prototype, "updateTime", void 0), (_ = (0, a.gn)( [ (0, a.fM)(1, o.h), (0, a.fM)(2, s.Y), (0, a.fM)(3, v.Z), (0, a.fM)(4, m.d), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ String, void 0 === o.h ? Object : o.h, void 0 === s.Y ? Object : s.Y, void 0 === v.Z ? Object : v.Z, void 0 === m.d ? Object : m.d, ]), ], _ )); var y = i("894803"), b = i("902519"), I = i("884569"); class w { addFollowUser(e) { var t = this._webHomePageService.homePageRepository.doFollowUser({ secUid: e, op: b.im.Follow, }); return ( t.then((e) => { (0, y.m)(e.code); }), t ); } cancelFollowUser(e) { return this._webHomePageService.homePageRepository.doFollowUser({ secUid: e, op: b.im.CancelFollow, }); } constructor(e) { this._webHomePageService = e; } } w = (0, a.gn)( [ (0, a.fM)(0, I.o), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [void 0 === I.o ? Object : I.o]), ], w ); class x { loadData() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this; return (0, n._)(function* () { if ( (e && ((t.offset = 0), (t.hasMore = !0), (t.userList = [])), !!t.hasMore) ) { (0, l.z)(() => { t.loading = !0; }); var i = yield t.getFollowingUserList(); return ( (0, l.z)(() => { t.loading = !1; }), i.ok && (0, l.z)(() => { (t.userList = [ ...(e ? [] : t.userList), ...i.value.userList, ]), (t.offset = i.value.nextOffset), (t.hasMore = i.value.hasMore), (t.totalCount = i.value.totalCount); }), i ); } })(); } getFollowingUserList() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 20; return this._userService.repository.getFollowList({ listType: this.followListType, count: e, offset: this.offset, }); } follow(e) { var t = this.userList.find((t) => t.secUid === e); t && (0, l.z)(() => { (t.hasFollowed = !0), (t.fans += 1); }); } cancelFollow(e) { var t = this.userList.find((t) => t.secUid === e); t && (0, l.z)(() => { (t.hasFollowed = !1), t.fans > 0 && (t.fans -= 1); }); } constructor(e, t) { (this._userService = t), (this.followListType = r.bK.Fans), (this.offset = 0), (this.totalCount = 0), (this.hasMore = !0), (this.userList = []), (this.loading = !1), (this.followListType = e), (0, l.rC)(this); } } (0, a.gn)([l.LO], x.prototype, "offset", void 0), (0, a.gn)([l.LO], x.prototype, "totalCount", void 0), (0, a.gn)([l.LO], x.prototype, "hasMore", void 0), (0, a.gn)( [l.LO, (0, a.w6)("design:type", Array)], x.prototype, "userList", void 0 ), (0, a.gn)([l.LO], x.prototype, "loading", void 0), (x = (0, a.gn)( [ (0, a.fM)(1, o.h), (0, a.w6)("design:type", Function), (0, a.w6)("design:paramtypes", [ void 0 === r.bK ? Object : r.bK, void 0 === o.h ? Object : o.h, ]), ], x )); class S { static get selfSecUid() { return S._selfSecUid; } static initUserInfoInstance(e, t, i) { return this.updateSelfSecUid(t), this.getUserInfoInstance(e, i); } static updateSelfSecUid(e) { this._selfSecUid = e; } static getUserInfoInstance(e, t) { var i = this._userInfoInstanceCacheMap.get(t); return i ? (i.refreshUserInfo(), i) : this.createUserInfoInstance(e, t); } static getFollowInstance(e) { return ( !this._followStoreInstance && (this._followStoreInstance = e.createInstance(w)), this._followStoreInstance ); } static getMyFollowingListInstance(e) { return ( !this._myFollowingListInstance && (this._myFollowingListInstance = e.createInstance( x, r.bK.Follow )), this._myFollowingListInstance ); } static getMyFansListInstance(e) { return ( !this._myFansListInstance && (this._myFansListInstance = e.createInstance(x, r.bK.Fans)), this._myFansListInstance ); } static createUserInfoInstance(e, t) { var i = e.createInstance(_, t); return ( i.refreshUserInfo(), this._userInfoInstanceCacheMap.set(t, i), i ); } static handlerFollowUser(e) { var t, i, n = this._userInfoInstanceCacheMap.get(e), r = this._userInfoInstanceCacheMap.get(this._selfSecUid); n && n.follow(e, !1), r && r.follow(e, !0), null === (t = this._myFansListInstance) || void 0 === t || t.follow(e), null === (i = this._myFollowingListInstance) || void 0 === i || i.follow(e); } static handlerCancelFollowUser(e) { var t, i, n = this._userInfoInstanceCacheMap.get(e), r = this._userInfoInstanceCacheMap.get(this._selfSecUid); n && n.cancelFollow(e, !1), r && r.cancelFollow(e, !0), null === (t = this._myFansListInstance) || void 0 === t || t.cancelFollow(e), null === (i = this._myFollowingListInstance) || void 0 === i || i.cancelFollow(e); } static handlerLikeProduction(e) { var t = this._userInfoInstanceCacheMap.get(e); t && t.increaseLikeCount(); } static handlerUnlikeProduction(e) { var t = this._userInfoInstanceCacheMap.get(e); t && t.decreaseLikeCount(); } static handlerUsePromote(e) { var t = this._userInfoInstanceCacheMap.get(e); t && t.increaseUsageCount(); } static updateSelfUserInfo(e, t) { var i = this; return (0, n._)(function* () { var n = i.getUserInfoInstance(e, i._selfSecUid); return yield null == n ? void 0 : n.updateUserInfo(t); })(); } static getSelfUserInfoInstance(e) { return this.getUserInfoInstance(e, this._selfSecUid); } } S._userInfoInstanceCacheMap = new Map(); }, 791628: function (e, t, i) { "use strict"; i.d(t, { Ck: function () { return r; }, j$: function () { return o; }, xk: function () { return a; }, }); var n = i(433965); function r(e, t) { var i = new Map(), r = []; for (var a of [...e, ...t]) { var o = (0, n.w3)(a) ? a.key : a.commonAttr.id; if (!i.has(o)) i.set(o, a), r.push(a); } return r; } function a(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "id", n = new Map(), r = []; for (var a of [...e, ...t]) { if (!n.has(a[i])) n.set(a[i], a), r.push(a); } return r; } function o(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "id", n = new Map(), r = []; for (var a of [...e, ...t]) { if (!n.has(a[i])) n.set(a[i], a), r.push(a); } return Array.from(n.values()).sort((e, t) => t[i] - e[i]); } }, 36159: function (e, t, i) { "use strict"; i.d(t, { L: function () { return a; }, }); var n = i(333597), r = i(110850), a = (0, n.LO)(r.v); }, 645421: function (e, t, i) { "use strict"; i.d(t, { T: function () { return a; }, }); var n = i(27433), r = i(834634), a = (e) => { var { submitId: t, scene: i, commercialStrategyService: a, extraBenefits: o, sceneOptions: s, discount: l, needCredits: c, videoDuration: d, } = e, { credits: u } = (0, n.Qp)({ scene: i, videoDuration: d, extraBenefits: o, commercialStrategyService: a, discount: l, sceneOptions: s, }); return { amount: c || u, createTime: Date.now() / 1e3, title: "MOCK_DATA", historyType: r.P.CONSUMED, submitId: t, extraContent: "MOCK_DATA", tradeSource: r.v.EMPTY, }; }; }, 7197: function (e, t, i) { "use strict"; i.d(t, { G: function () { return d; }, }); var n = i(139646), r = i(389657), a = i(265587), o = i(820266), s = i(804274), l = i(423719), c = i(793723); function d(e, t, i) { return u.apply(this, arguments); } function u() { return (u = (0, n._)(function* (e, t, i) { var n = (0, o.b)(e, s.D1); if (i && t && n.item_list) { var d = yield r.Li.decryptIV(i, t); yield (0, l.sh)(r.Li.decrypt.bind(r.Li), n.item_list, d); } if (Array.isArray(n.item_list)) { var u = yield r.sn.getSignOptions(); (0, c.$U)(r.sn.sign.bind(r.sn), n.item_list, u); } if (n.item_list) for (var f = 0; f < n.item_list.length; f++) n.item_list[f].video && (n.item_list[f] = (0, a.Q)( n.item_list[f], n.item_list[f].video.origin_video )), 0 !== n.next_offset && n.request_id && (n.item_list[f].impressionId = n.request_id); return (0, o.b)(n, s.zW, !1); })).apply(this, arguments); } }, 422600: function (e, t, i) { "use strict"; i.d(t, { b: function () { return r; }, }); var n = i(259273); function r(e, t) { var i, { panel: r } = e, a = t.getData(n.Sj.Home); return a && a.panel === r && a.panelInfo ? (null === (i = a.panelInfo) || void 0 === i ? void 0 : i.ok) && a.panelInfo.value ? a.panelInfo.value : null : null; } }, 555192: function (e, t, i) { "use strict"; i.d(t, { u: function () { return n; }, }); var n = (0, i(333597).yh)("context-view-service"); }, 509320: function (e, t, i) { "use strict"; i.d(t, { W: function () { return a; }, c: function () { return r; }, }); var n = i(333597), r = (function (e) { return ( (e.CancelBtn = "CancelBtn"), (e.CancelLable = "CancelLable"), (e.ConfirmBtn = "ConfirmBtn"), (e.ConfirmLabel = "ConfirmLabel"), (e.CloseIcon = "CloseIcon"), (e.VisibleChange = "VisibleChange"), (e.ClickMask = "ClickMask"), (e.ClickFocus = "ClickFocus"), (e.ClickTarget = "ClickTarget"), e ); })({}), a = (0, n.yh)("guide"); }, 471605: function (e, t, i) { "use strict"; i.d(t, { S: function () { return n; }, }); var n = (0, i(333597).yh)("i18n-service"); }, 969015: function (e, t, i) { "use strict"; i.d(t, { C0: function () { return d; }, Ui: function () { return f; }, aU: function () { return u; }, }); var n = i(625572), r = i(639880), a = i(333597), o = i(513294), s = i(699813), l = i(266828), c = i(487059), d = (function (e) { return ( (e[(e.DYNAMIC_CONFIGURATION = 0)] = "DYNAMIC_CONFIGURATION"), (e[(e.AB_TEST = 1)] = "AB_TEST"), (e[(e.USER = 2)] = "USER"), e ); })({}); class u { getRegisteredConfigurations(e) { (0, s.ss)("not implemented"); } registerSectionConfigurations(e, t) { (0, s.ss)("not implemented"); } removeSectionConfiguration(e) { (0, s.ss)("not implemented"); } getConfigurationValues(e, t) { (0, s.ss)("not implemented"); } updateConfigurationValues(e, t) { (0, s.ss)("not implemented"); } reloadConfigurations() { (0, s.ss)("not implemented"); } getResourceTypeByPanel(e) { return Object.keys(this.resourcePanel).reduce((e, t) => { var i, a = this.resourcePanel[t], o = null !== (i = c.vJ[a]) && void 0 !== i ? i : a; return (0, r._)((0, n._)({}, e), { [o]: t }); }, {})[e]; } initAppConfiguration(e) { this._appConfiguration.init(e); } getAppConfigurationValue(e) { return this._appConfiguration.getValue(e); } setAppConfigurationValue(e, t) { this._appConfiguration.setValue(e, t); } constructor() { (this._onDidChangeConfiguration = new o.Q()), (this._appConfiguration = new l.V()), (this.onDidChangeConfiguration = this._onDidChangeConfiguration.event); } } var f = (0, a.yh)("configuration"); }, 266828: function (e, t, i) { "use strict"; i.d(t, { V: function () { return o; }, }); var n = i(716913), r = i(386527), a = i(824547); class o { get contents() { return this._contents; } getValue(e) { return (0, n.Z)(this._contents, e); } setValue(e, t) { (0, r.Z)(this._contents, e, t); } isEmpty() { return 0 === Object.keys(this._contents).length; } init(e) { this._contents = e; } reset(e) { this._contents = e; } merge(e) { return (0, a.Z)(this._contents, e), this; } constructor(e = {}) { this._contents = e; } } }, 917598: function (e, t, i) { "use strict"; i.d(t, { L2: function () { return s; }, M8: function () { return r; }, br: function () { return o; }, uy: function () { return a; }, wQ: function () { return n; }, }); var n = "48.0.0", r = (function (e) { return (e.Loki = "loki"), e; })({}), a = (function (e) { return ( (e[(e.CN = 2515)] = "CN"), (e[(e.OVERSEAS = 7356)] = "OVERSEAS"), e ); })({}), o = 513695, s = 513695; }, 542994: function (e, t, i) { "use strict"; i.d(t, { T: function () { return r; }, }); var n = i(243090); function r(e, t) { var i, r, a, o, s, l = (0, n.D)(e.common_attr.extra); return { key: "".concat(t, "_").concat(e.common_attr.id || e.common_attr.md5), resourceId: e.common_attr.id, effectId: e.common_attr.effect_id.toString(), effectType: e.common_attr.effect_type, publishSource: e.common_attr.publish_source, aspectRatio: e.common_attr.aspect_ratio, isBusiness: e.common_attr.is_business, md5: e.common_attr.md5, isVip: null !== (a = l.is_vip) && void 0 !== a && a, title: e.common_attr.title, description: e.common_attr.description, coverUrl: e.common_attr.cover_url, originUrl: null !== (s = null !== (o = null === (i = e.common_attr.item_urls) || void 0 === i ? void 0 : i[0]) && void 0 !== o ? o : null === (r = e.common_attr.download_info) || void 0 === r ? void 0 : r.url) && void 0 !== s ? s : "", isFavorite: e.common_attr.has_favorited, createTime: e.common_attr.create_time, coverUrlMap: e.common_attr.cover_url_map, localItemId: e.common_attr.local_item_id, thirdResourceId: e.common_attr.third_resource_id, status: e.common_attr.status, }; } }, 733787: function (e, t, i) { "use strict"; i.d(t, { BY: function () { return s; }, Dq: function () { return o; }, H7: function () { return a; }, IM: function () { return r; }, T8: function () { return u; }, Vr: function () { return l; }, eV: function () { return h; }, l$: function () { return d; }, os: function () { return c; }, py: function () { return n; }, v8: function () { return f; }, }); var n = (function (e) { return ( (e.VideoAspectRatioType_1_1 = "1:1"), (e.VideoAspectRatioType_3_4 = "3:4"), (e.VideoAspectRatioType_16_9 = "16:9"), (e.VideoAspectRatioType_4_3 = "4:3"), (e.VideoAspectRatioType_9_16 = "9:16"), (e.VideoAspectRatioType_21_9 = "21:9"), e ); })({}), r = { "1:1": 1, "3:4": 0.75, "16:9": 1.7778, "4:3": 1.3333, "9:16": 0.5625, "21:9": 2.3333, }, a = (function (e) { return ( (e.StillShot = "Still"), (e.ZoomIn = "ZoomIn"), (e.ZoomOut = "ZoomOut"), (e.RotateClockwise = "RotateClockwise"), (e.RotateAnticlockwise = "RotateAnticlockwise"), (e.PanLeft = "PanLeft"), (e.PanRight = "PanRight"), (e.TiltUp = "TiltUp"), (e.TiltDown = "TiltDown"), (e.HorizontalLeft = "HorizontalLeft"), (e.HorizontalRight = "HorizontalRight"), (e.VerticalUp = "VerticalUp"), (e.VerticalDown = "VerticalDown"), (e.Default = ""), e ); })({}), o = (function (e) { return ( (e[(e.Level1 = 2)] = "Level1"), (e[(e.Level2 = 3)] = "Level2"), (e[(e.Level3 = 4)] = "Level3"), e ); })({}), s = (function (e) { return ( (e.Low = "Low"), (e.Moderate = "Moderate"), (e.High = "High"), e ); })({}), l = (function (e) { return ( (e[(e.Unknow = 0)] = "Unknow"), (e[(e.NoWatermark = 1)] = "NoWatermark"), (e[(e.HasWatermark = 2)] = "HasWatermark"), e ); })({}), c = (function (e) { return ( (e[(e.Landscape = 1)] = "Landscape"), (e[(e.Portrait = 2)] = "Portrait"), (e[(e.Square = 3)] = "Square"), e ); })({}), d = (function (e) { return ( (e[(e.Pending = -1)] = "Pending"), (e[(e.Ok = 2e5)] = "Ok"), (e[(e.InputInvalid = 201e3)] = "InputInvalid"), (e[(e.NoFace = 204001)] = "NoFace"), (e[(e.FaceMouthOcclude = 204003)] = "FaceMouthOcclude"), (e[(e.MultiFace = 204006)] = "MultiFace"), (e[(e.InternalError = 200001)] = "InternalError"), (e[(e.StarFaceAuditError = 100)] = "StarFaceAuditError"), e ); })({}), u = (function (e) { return ( (e[(e.Normal = 0)] = "Normal"), (e[(e.Relax = 1)] = "Relax"), e ); })({}), f = (function (e) { return ( (e[(e.VideoGen = 1)] = "VideoGen"), (e[(e.SuperResolution = 2)] = "SuperResolution"), (e[(e.InsertFrame = 3)] = "InsertFrame"), (e[(e.LipSync = 4)] = "LipSync"), (e[(e.Extend = 5)] = "Extend"), (e[(e.LabSR = 6)] = "LabSR"), (e[(e.MixBGM = 7)] = "MixBGM"), (e[(e.BGMGenerate = 8)] = "BGMGenerate"), (e[(e.LipSyncImage = 9)] = "LipSyncImage"), (e[(e.LipSyncUserVideo = 10)] = "LipSyncUserVideo"), (e[(e.VideoTemplate = 11)] = "VideoTemplate"), (e[(e.VideoAudioEffect = 12)] = "VideoAudioEffect"), e ); })({}), h = (function (e) { return ( (e[(e.Eight = 8)] = "Eight"), (e[(e.Twelve = 12)] = "Twelve"), (e[(e.TwentyFour = 24)] = "TwentyFour"), (e[(e.Thirty = 30)] = "Thirty"), (e[(e.Sixty = 60)] = "Sixty"), e ); })({}); }, 387285: function (e, t, i) { "use strict"; i.d(t, { r: function () { return r; }, }); var n = i(585567), r = (e) => (e ? n.N : n.T); }, 380908: function (e, t, i) { "use strict"; i.d(t, { bd: function () { return a; }, qi: function () { return n; }, rO: function () { return r; }, }); var n = "##", r = RegExp("(".concat(n, ")"), "g"), a = [{ abilityIndex: 0 }]; }, 826717: function (e, t, i) { "use strict"; i.d(t, { X: function () { return n; }, p: function () { return r; }, }); var n = (function (e) { return ( (e.Image = "image"), (e.Video = "video"), (e.Canvas = "canvas"), (e.ShortVideo = "short_video"), e ); })({}), r = (function (e) { return ( (e.FeedEnterauto = "feed_enterauto"), (e.FeedLoadmore = "feed_loadmore"), (e.FeedRefresh = "feed_refresh"), (e.FeedPreloadMore = "feed_preloadmore"), e ); })({}); }, 830563: function (e, t, i) { "use strict"; i.d(t, { X: function () { return r; }, l: function () { return n; }, }); var n = (function (e) { return ( (e[(e.transcoding = 0)] = "transcoding"), (e[(e.success = 1)] = "success"), (e[(e.fail = 2)] = "fail"), e ); })({}), r = (function (e) { return ( (e[(e.Uploading = 1)] = "Uploading"), (e[(e.UploadFailed = 2)] = "UploadFailed"), (e[(e.WaitingForUploading = 3)] = "WaitingForUploading"), (e[(e.UploadSuccess = 4)] = "UploadSuccess"), (e[(e.EncodeSuccess = 10)] = "EncodeSuccess"), (e[(e.EncodeFailed = 20)] = "EncodeFailed"), (e[(e.Encoding = 30)] = "Encoding"), (e[(e.NonExist = 40)] = "NonExist"), e ); })({}); }, 599045: function (e, t, i) { "use strict"; i.d(t, { M: function () { return n; }, r: function () { return r; }, }); var n = (function (e) { return ( (e.TextToSpeech = "text-to-speech"), (e.LocalFile = "local-file"), e ); })({}), r = (function (e) { return (e[(e.Hard = 1)] = "Hard"), (e[(e.Soft = 2)] = "Soft"), e; })({}); }, 538638: function (e, t, i) { "use strict"; i.d(t, { F: function () { return n; }, }); var n = (function (e) { return (e.ALL = "all"), (e.Favor = "favor"), e; })({}); }, 128468: function (e, t, i) { "use strict"; i.d(t, { HJ: function () { return a; }, JU: function () { return n; }, d_: function () { return o; }, ok: function () { return r; }, }); var n = (function (e) { return ( (e.Canvas = "canvas"), (e.Workbench = "workbench"), (e.Story = "story"), (e.Character = "character"), (e.PostEditor = "post_editor"), (e.AIGCDraft = "aigc_draft"), (e.CreationAgent = "creation_agent"), e ); })({}), r = (function (e) { return (e[(e.Small = 360)] = "Small"), e; })({}), a = [16, 32, 100, 150, 360], o = (function (e) { return (e.Style = "style"), e; })({}); }, 243302: function (e, t, i) { "use strict"; i.d(t, { KB: function () { return n; }, Pd: function () { return a; }, pi: function () { return r; }, }); var n = (function (e) { return ( (e[(e.PageUp = 1)] = "PageUp"), (e[(e.PageDown = 2)] = "PageDown"), e ); })({}), r = (function (e) { return ( (e[(e.Unknown = -1)] = "Unknown"), (e[(e.Text2Image = 1)] = "Text2Image"), (e[(e.SuperResolution = 2)] = "SuperResolution"), (e[(e.FineTunePromptWithText2Image = 3)] = "FineTunePromptWithText2Image"), (e[(e.FineTunePromptWithSuperResolution = 4)] = "FineTunePromptWithSuperResolution"), (e[(e.Text2CreativeText = 5)] = "Text2CreativeText"), (e[(e.SpecialEffect = 6)] = "SpecialEffect"), (e[(e.InPaint = 7)] = "InPaint"), (e[(e.OutPaint = 8)] = "OutPaint"), (e[(e.InPaintRemove = 9)] = "InPaintRemove"), (e[(e.Text2Video = 10)] = "Text2Video"), (e[(e.Blend = 12)] = "Blend"), (e[(e.SuperDefinition = 13)] = "SuperDefinition"), (e[(e.Matting = 14)] = "Matting"), (e[(e.Fusion = 15)] = "Fusion"), (e[(e.VideoBGM = 16)] = "VideoBGM"), (e[(e.AudioVideoMix = 17)] = "AudioVideoMix"), (e[(e.InstaDrag = 18)] = "InstaDrag"), (e[(e.Image2Avatar = 20)] = "Image2Avatar"), (e[(e.Video2Avatar = 21)] = "Video2Avatar"), (e[(e.Text2Song = 22)] = "Text2Song"), (e[(e.Text2Instrumental = 23)] = "Text2Instrumental"), (e[(e.LipSync = 24)] = "LipSync"), (e[(e.InPaintAndOutPaint = 26)] = "InPaintAndOutPaint"), (e[(e.ByteEditPainting = 27)] = "ByteEditPainting"), (e[(e.VideoTemplate = 29)] = "VideoTemplate"), (e[(e.AIEffectWorkImage = 30)] = "AIEffectWorkImage"), (e[(e.AIEffectWorkVideo = 31)] = "AIEffectWorkVideo"), (e[(e.VideoAudioEffect = 32)] = "VideoAudioEffect"), (e[(e.VideoAudioEffectMix = 33)] = "VideoAudioEffectMix"), e ); })({}), a = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.PreTnsCheckNotPass = 10)] = "PreTnsCheckNotPass"), (e[(e.SubmitOk = 20)] = "SubmitOk"), (e[(e.FinalGenerateFail = 30)] = "FinalGenerateFail"), (e[(e.PostTnsCheckNotPass = 40)] = "PostTnsCheckNotPass"), (e[(e.FinalSuccess = 50)] = "FinalSuccess"), (e[(e.Deleted = 100)] = "Deleted"), e ); })({}); }, 955625: function (e, t, i) { "use strict"; i.d(t, { J: function () { return r; }, l: function () { return n; }, }); var n = (function (e) { return ( (e.ErrSuccess = "0"), (e.OutputImageRisk = "2039"), (e.InputTextRisk = "2038"), (e.InputTextIpBlock = "2047"), (e.GenerateFail = "2036"), (e.RateLimit1 = "1057"), (e.UnsupportedByBeta = "1182"), (e.ErrParam = "1001"), (e.ErrDownloadImage = "1059"), (e.ErrPostImgRiskNotPass = "2041"), (e.ErrAssetsCodeNotExist = "1190"), (e.ErrAssetsStatusInvalid = "1189"), (e.ErrRateLimitForNonCommercialRegion = "10020"), e ); })({}), r = (function (e) { return ( (e[(e.Unknown = 0)] = "Unknown"), (e[(e.ImageX = 1)] = "ImageX"), (e[(e.VCloud = 2)] = "VCloud"), (e[(e.Artist = 3)] = "Artist"), e ); })({}); }, 111709: function (e, t, i) { "use strict"; i.d(t, { Ao: function () { return o; }, Wn: function () { return a; }, fM: function () { return n; }, oo: function () { return r; }, }); var n = "high_aes_general_v30l:general_v3.0_18b", r = (function (e) { return ( (e.FaceWrap = "face_swap"), (e.BgPaint = "bg_paint"), (e.Canny = "canny"), (e.Depth = "depth"), (e.Pose = "pose"), (e.IpKeep = "ip_keep"), (e.Character = "character"), (e.StyleReference = "style_reference"), (e.ByteEdit = "byte_edit"), (e.ImageToImage = "i2i"), (e.Default = "default_scene"), (e.StyleCode = "style_code"), e ); })({}), a = (function (e) { return ( (e.BetaModel = "beta_model"), (e.NewModel = "new_model"), (e.ReadOnlySampleStrength = "read_only_sample_steps"), (e.ReadOnlySize = "read_only_size"), (e.readOnlyRatio = "read_only_ratio"), (e.ThirdParty = "third_party"), (e.Etta = "etta"), e ); })({}), o = (function (e) { return (e.LimitTimeDiscount = "limit_time_discout"), e; })({}); }, 202401: function (e, t, i) { "use strict"; i.d(t, { O: function () { return n; }, }); var n = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.Processing = 1)] = "Processing"), (e[(e.Fail = 2)] = "Fail"), (e[(e.Success = 3)] = "Success"), e ); })({}); }, 869919: function (e, t, i) { "use strict"; i.d(t, { Mc: function () { return s; }, N7: function () { return l; }, RM: function () { return a; }, WP: function () { return r; }, X2: function () { return d; }, eA: function () { return n; }, tB: function () { return o; }, zk: function () { return c; }, }); var n = (function (e) { return ( (e.LipSync = "lip_sync"), (e.InsertFrame = "insert_frame"), (e.SuperResolution = "super_resolution"), (e.LipSyncImage = "lip_sync_image"), (e.LipSyncUserVideo = "lip_sync_user_video"), (e.VideoExtend = "video_extend"), (e.VideoTemplate = "video_template"), (e.VideoBGM = "video_bgm"), (e.VideoAudioEffect = "video_audio_effect"), e ); })({}), r = (function (e) { return ( (e[(e.Normal = 8)] = "Normal"), (e[(e.Fluency = 12)] = "Fluency"), (e[(e.Cinematic = 24)] = "Cinematic"), e ); })({}), a = (function (e) { return ( (e[(e.second3 = 3e3)] = "second3"), (e[(e.second4 = 4e3)] = "second4"), (e[(e.second5 = 5e3)] = "second5"), (e[(e.second6 = 6e3)] = "second6"), (e[(e.second8 = 8e3)] = "second8"), (e[(e.second9 = 9e3)] = "second9"), (e[(e.second10 = 1e4)] = "second10"), (e[(e.second12 = 12e3)] = "second12"), e ); })({}), o = (function (e) { return ( (e[(e.Preview = 1)] = "Preview"), (e[(e.Default = 2)] = "Default"), (e[(e.Livephoto = 3)] = "Livephoto"), (e[(e.LipSyncDefault = 4)] = "LipSyncDefault"), (e[(e.LipSyncLively = 5)] = "LipSyncLively"), (e[(e.LipSyncMaster = 6)] = "LipSyncMaster"), (e[(e.LipSyncMasterFast = 7)] = "LipSyncMasterFast"), e ); })({}), s = (function (e) { return (e.Low = "0"), (e.Moderate = "1"), (e.High = "2"), e; })({}), l = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.Processing = 1)] = "Processing"), (e[(e.Fail = 2)] = "Fail"), (e[(e.Success = 3)] = "Success"), e ); })({}), c = (function (e) { return ( (e[(e.BGM = 0)] = "BGM"), (e[(e.AudioEffect = 1)] = "AudioEffect"), e ); })({}), d = (function (e) { return ( (e[(e.Unknown = 0)] = "Unknown"), (e[(e.Tag = 1)] = "Tag"), (e[(e.FirstFrame = 2)] = "FirstFrame"), e ); })({}); }, 839141: function (e, t, i) { "use strict"; i.d(t, { d: function () { return n; }, }); var n = (function (e) { return ( (e.Standard = "standard"), (e.Artisan = "artisan"), (e.Maestro = "maestro"), (e.None = ""), e ); })({}); }, 956719: function (e, t, i) { "use strict"; function n(e) { e.interceptors.response.use((e) => { if (200 === e.status) { var t, i = e.data; if ( (i.data && ((null == i ? void 0 : i.logId) || (null == i ? void 0 : i.logid) || (null == i ? void 0 : i.log_id)) && (i.data.__logId = i.logId || i.logid || i.log_id), i.data && ((null == i ? void 0 : i.cache_sync_token) || (null == i ? void 0 : i.cacheSyncToken)) && (i.data.__cacheSyncToken = i.cache_sync_token || (null == i ? void 0 : i.cacheSyncToken)), (null == i ? void 0 : i.ret) === "0" || (null == i ? void 0 : i.ret) === "1020" || (null == i ? void 0 : null === (t = i.BaseResp) || void 0 === t ? void 0 : t.StatusCode) === 0) ) return Promise.resolve(null == i ? void 0 : i.data); } return Promise.reject(e.data); }); } function r(e, t) { e.interceptors.response.use((e) => { var { disableRetCheck: i = !1 } = null != t ? t : {}; if (200 === e.status) { var n, r = e.data; return i || (null == r ? void 0 : r.ret) === "0" || (null == r ? void 0 : r.ret) === "1020" || (null == r ? void 0 : null === (n = r.BaseResp) || void 0 === n ? void 0 : n.StatusCode) === 0 || (null == r ? void 0 : r.status_code) === 0 || (null == r ? void 0 : r.ret) === "" || (null == r ? void 0 : r.err_no) === 0 ? Promise.resolve(r) : Promise.reject(r); } return Promise.reject(e); }); } i.d(t, { C: function () { return r; }, E: function () { return n; }, }); }, 601191: function (e, t, i) { "use strict"; i.d(t, { f4: () => h, vp: () => _, Mu: () => P }); var n = i("625572"), r = i("639880"), a = i("96"), o = i("243090"), s = i("417281"), l = i("380908"); function c(e) { var { name: t, largeImageList: i = [] } = e; return t === s.UI.BgPaint && 2 === i.length; } var d = [ s.UI.FaceGan, s.UI.BasicBlend, s.UI.BgPaint, s.UI.ControlNet, s.UI.Image2image, s.UI.IpKeep, s.UI.StyleReference, s.UI.ByteEdit, s.UI.StyleCode, ], u = i("128468"), f = i("952739"); function h(e) { return e.name === s.UI.FaceGan; } function p(e) { return e.name === s.UI.BgPaint; } function v(e) { return e.name === s.UI.Image2image; } function m(e) { return e.name === s.UI.ControlNet; } function g(e) { return e.name === s.UI.IpKeep; } function _(e) { return e.name === s.UI.StyleReference; } function y(e) { return e.name === s.UI.ByteEdit; } function b(e, t) { try { var i = JSON.parse(e); return JSON.stringify((0, n._)({}, i, t)); } catch (e) { return JSON.stringify(t); } } function I(e, t) { var i, r, a, o, l, c, { largeImageList: d = [], coverImageList: u = [], faceRecognizeList: f = [], extra: h, } = e, p = d.filter((e) => !!e).map((e) => e.imageUri), v = null !== (i = u[0]) && void 0 !== i ? i : {}, m = null !== (r = d[0]) && void 0 !== r ? r : {}, g = { coverUrl: null !== (a = v.imageUrl) && void 0 !== a ? a : "", coverUrlMap: v.coverUrlMap, url: null !== (o = m.imageUrl) && void 0 !== o ? o : "", width: null !== (l = m.width) && void 0 !== l ? l : 0, height: null !== (c = m.height) && void 0 !== c ? c : 0, extra: h, }, _ = { name: s.UI.FaceGan, faceRecognizeList: f, imageUriList: p }; return (0, n._)({}, g, _); } function w(e, t) { var i, r, a, o, l, d, u, f, h, p, v, m, g, _, y, I, w, x, S, M, C, T, A, k, P, E, D, { generatedImageSize: R } = t, { largeImageList: N = [], coverImageList: L = [], strength: j, extra: O = "", } = e, B = c(e), F = B ? [ "", "", null !== (v = null === (i = N[0]) || void 0 === i ? void 0 : i.imageUri) && void 0 !== v ? v : "", null !== (m = null === (r = N[1]) || void 0 === r ? void 0 : r.imageUri) && void 0 !== m ? m : "", ] : [ null !== (g = null === (a = N[0]) || void 0 === a ? void 0 : a.imageUri) && void 0 !== g ? g : "", null !== (_ = null === (o = N[1]) || void 0 === o ? void 0 : o.imageUri) && void 0 !== _ ? _ : "", null !== (y = null === (l = N[2]) || void 0 === l ? void 0 : l.imageUri) && void 0 !== y ? y : "", null !== (I = null === (d = N[3]) || void 0 === d ? void 0 : d.imageUri) && void 0 !== I ? I : "", ], { width: U = 0, height: G = 0 } = B ? null != R ? R : {} : null !== (w = N[1]) && void 0 !== w ? w : {}, z = { originMaskUrl: B ? null !== (x = null === (u = N[0]) || void 0 === u ? void 0 : u.imageUrl) && void 0 !== x ? x : "" : null !== (S = null === (f = N[2]) || void 0 === f ? void 0 : f.imageUrl) && void 0 !== S ? S : "", originImageUrl: B ? null !== (M = null === (h = N[1]) || void 0 === h ? void 0 : h.imageUrl) && void 0 !== M ? M : "" : null !== (C = null === (p = N[3]) || void 0 === p ? void 0 : p.imageUrl) && void 0 !== C ? C : "", paintWidth: U, paintHeight: G, }, V = null !== (T = B ? L[1] : L[3]) && void 0 !== T ? T : {}, W = null !== (A = B ? N[1] : N[3]) && void 0 !== A ? A : {}, Z = O ? b(O, z) : JSON.stringify(z), K = { coverUrlMap: V.coverUrlMap, coverUrl: null !== (k = V.imageUrl) && void 0 !== k ? k : "", extra: Z, url: null !== (P = W.imageUrl) && void 0 !== P ? P : "", width: null !== (E = W.width) && void 0 !== E ? E : 0, height: null !== (D = W.height) && void 0 !== D ? D : 0, }, H = { name: s.UI.BgPaint, imageUriList: F, extra: Z, strength: j }; return (0, n._)({}, K, H); } function x(e, t) { var i, r, a, o, l, c, d, u, { largeImageList: f = [], coverImageList: h = [], extra: p, strength: v, } = e, m = null !== (r = h[0]) && void 0 !== r ? r : {}, g = null !== (a = f[0]) && void 0 !== a ? a : {}, _ = { coverUrl: null !== (o = m.imageUrl) && void 0 !== o ? o : "", coverUrlMap: m.coverUrlMap, extra: p, url: null !== (l = g.imageUrl) && void 0 !== l ? l : "", width: null !== (c = g.width) && void 0 !== c ? c : 0, height: null !== (d = g.height) && void 0 !== d ? d : 0, }, y = { name: s.UI.Image2image, imageUriList: [ null !== (u = null === (i = f.filter((e) => !!e).map((e) => e.imageUri)) || void 0 === i ? void 0 : i[0]) && void 0 !== u ? u : "", ], strength: v, }; return (0, n._)({}, _, y); } function S(e, t) { if (!e) return { coverUrl: "", extra: "", url: "", width: 0, height: 0, name: s.UI.BasicBlend, imageUriList: [""], imageWeightList: [0], }; var i, r, a, o, l, c, d, u, { largeImageList: f = [], coverImageList: h = [], extra: p } = e, v = [ null !== (r = null === (i = f.filter((e) => !!e).map((e) => e.imageUri)) || void 0 === i ? void 0 : i[0]) && void 0 !== r ? r : "", ], m = null !== (a = h[0]) && void 0 !== a ? a : {}, g = null !== (o = f[0]) && void 0 !== o ? o : {}, _ = { coverUrl: null !== (l = m.imageUrl) && void 0 !== l ? l : "", coverUrlMap: m.coverUrlMap, extra: p, url: null !== (c = g.imageUrl) && void 0 !== c ? c : "", width: null !== (d = g.width) && void 0 !== d ? d : 0, height: null !== (u = g.height) && void 0 !== u ? u : 0, }, y = { name: s.UI.BasicBlend, imageUriList: v, imageWeightList: [0] }; return (0, n._)({}, _, y); } function M(e, t) { var { generatedImageSize: i } = t, { largeImageList: r = [], coverImageList: a = [], controlNetList: l = [], extra: c, } = e, d = (0, o.D)(null != c ? c : "[]"); return l.map((e, t) => { var i, o, l, c, u, f, h, p, v, m, g = e.name === s.kR.ControlNetBgPaint, { imageIndex: _, name: y, maskIndex: b, strength: I } = e; if (g) { var w, x, S, M, C, T, A, k, P, E, D, R, N, L, j, O, B, F, U, G, z, V, W = d[t], Z = [ null !== (E = null === (M = r[null != b ? b : 0]) || void 0 === M ? void 0 : M.imageUri) && void 0 !== E ? E : "", null !== (D = null === (C = r[_]) || void 0 === C ? void 0 : C.imageUri) && void 0 !== D ? D : "", null !== (R = null === (T = r[_ + 1]) || void 0 === T ? void 0 : T.imageUri) && void 0 !== R ? R : "", null !== (N = null === (A = r[_ + 2]) || void 0 === A ? void 0 : A.imageUri) && void 0 !== N ? N : "", ], K = null !== (L = a[_ + 2]) && void 0 !== L ? L : {}, H = null !== (j = r[_ + 2]) && void 0 !== j ? j : {}, q = { coverUrl: null !== (O = K.imageUrl) && void 0 !== O ? O : "", coverUrlMap: K.coverUrlMap, url: null !== (B = H.imageUrl) && void 0 !== B ? B : "", width: null !== (F = H.width) && void 0 !== F ? F : 0, height: null !== (U = H.height) && void 0 !== U ? U : 0, }, { width: J = 0, height: Y = 0 } = null !== (G = r[_]) && void 0 !== G ? G : {}, Q = { originMaskUrl: null !== (z = null === (k = r[_ + 1]) || void 0 === k ? void 0 : k.imageUrl) && void 0 !== z ? z : "", originImageUrl: null !== (V = null === (P = r[_ + 2]) || void 0 === P ? void 0 : P.imageUrl) && void 0 !== V ? V : "", paintWidth: J, paintHeight: Y, }, X = W ? JSON.stringify((0, n._)({}, W, Q)) : JSON.stringify(Q), $ = { name: s.UI.BgPaint, imageUriList: Z, strength: I, extra: X, }; return (0, n._)({}, q, $); } var ee = [ null !== (i = null === (w = r[_]) || void 0 === w ? void 0 : w.imageUri) && void 0 !== i ? i : "", null !== (o = null === (x = r[_ + 1]) || void 0 === x ? void 0 : x.imageUri) && void 0 !== o ? o : "", null !== (l = null === (S = r[_ + 2]) || void 0 === S ? void 0 : S.imageUri) && void 0 !== l ? l : "", ], et = null !== (c = a[_ + 1]) && void 0 !== c ? c : {}, ei = null !== (u = r[_ + 1]) && void 0 !== u ? u : {}, en = null !== (f = r[_ + 2]) && void 0 !== f ? f : {}, er = [{ imageIndex: 0, name: y, strength: I }], ea = { coverUrl: null !== (h = et.imageUrl) && void 0 !== h ? h : "", coverUrlMap: et.coverUrlMap, url: null !== (p = ei.imageUrl) && void 0 !== p ? p : "", width: null !== (v = ei.width) && void 0 !== v ? v : 0, height: null !== (m = ei.height) && void 0 !== m ? m : 0, previewInfo: en, controlNetList: er, }, eo = JSON.stringify([d[t]]), es = { name: s.UI.ControlNet, imageUriList: ee, controlNetList: er, extra: eo, }; return (0, n._)({}, ea, es); }); } function C(e, t) { var i, o, l, c, d, u, f, { ipKeepList: h = [], coverImageList: p = [], largeImageList: v = [], } = e, m = [ null !== (o = null === (i = v.filter((e) => !!e).map((e) => e.imageUri)) || void 0 === i ? void 0 : i[0]) && void 0 !== o ? o : "", ], g = null !== (l = p[0]) && void 0 !== l ? l : {}; return { name: s.UI.IpKeep, url: null !== (c = g.imageUrl) && void 0 !== c ? c : "", coverUrl: null !== (d = g.imageUrl) && void 0 !== d ? d : "", coverUrlMap: g.coverUrlMap, width: null !== (u = g.width) && void 0 !== u ? u : 0, height: null !== (f = g.height) && void 0 !== f ? f : 0, imageUriList: m, ipKeepList: h.map((e) => { var { status: t, characterId: i } = e, o = (0, a._)(e, ["status", "characterId"]); return (0, r._)((0, n._)({}, o), { characterId: "".concat(i) }); }), }; } function T(e, t) { var i, n, r, a, o, l, c, d, h, p, { mode: v } = t, { styleReference: m } = e; if (!!(null == m ? void 0 : m.styleItemId) || v !== u.JU.Story) { var g = (null == m ? void 0 : null === (i = m.image) || void 0 === i ? void 0 : i.imageUrl) || (0, f.a0)( null !== (l = null == m ? void 0 : null === (n = m.image) || void 0 === n ? void 0 : n.coverUrlMap) && void 0 !== l ? l : {} ); return { name: s.UI.StyleReference, url: g, coverUrl: g, coverUrlMap: null == m ? void 0 : null === (r = m.image) || void 0 === r ? void 0 : r.coverUrlMap, width: null !== (c = null == m ? void 0 : null === (a = m.image) || void 0 === a ? void 0 : a.width) && void 0 !== c ? c : 0, height: null !== (d = null == m ? void 0 : null === (o = m.image) || void 0 === o ? void 0 : o.height) && void 0 !== d ? d : 0, imageUriList: [ null !== (h = null == m ? void 0 : m.image.imageUri) && void 0 !== h ? h : "", ], imageWeightList: [ (null !== (p = null == m ? void 0 : m.styleWeight) && void 0 !== p ? p : 0) * 100, ], styleReference: null != m ? m : {}, }; } } function A(e, t) { var i, r, a, o, l, c, d, { largeImageList: u = [], coverImageList: f = [], strength: h } = e, p = u.filter((e) => !!e).map((e) => e.imageUri), v = null !== (i = f[0]) && void 0 !== i ? i : {}, m = null !== (r = u[0]) && void 0 !== r ? r : {}, g = { coverUrl: null !== (a = v.imageUrl) && void 0 !== a ? a : "", coverUrlMap: v.coverUrlMap, url: null !== (o = m.imageUrl) && void 0 !== o ? o : "", width: null !== (l = m.width) && void 0 !== l ? l : 0, height: null !== (c = m.height) && void 0 !== c ? c : 0, }, _ = { name: s.UI.ByteEdit, imageUriList: [null !== (d = p[0]) && void 0 !== d ? d : ""], strength: h, }; return (0, n._)({}, g, _); } function k(e, t) { var i, { commonAsset: a = { assetCode: "", assetType: u.d_.Style, referImageList: [], }, } = e, o = { coverUrl: void 0, coverUrlMap: void 0, url: void 0, width: void 0, height: void 0, }, l = { name: s.UI.StyleCode, commonAsset: (0, r._)((0, n._)({}, a), { referImageList: null === (i = a.referImageList) || void 0 === i ? void 0 : i.map((e) => { var t; return (0, r._)((0, n._)({}, e), { styleWeight: (null !== (t = e.styleWeight) && void 0 !== t ? t : 0) * 100, }); }), }), }; return (0, n._)({}, o, l); } function P(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : u.JU.Workbench; if (!t) return []; try { var n, { abilityList: r = [], promptPlaceholderInfoList: a } = t, o = null == r ? void 0 : r.filter((e) => { var { name: t } = e; return d.includes(t); }), c = (null == a ? void 0 : a.length) ? a : l.bd, f = { generatedImageSize: e, mode: i }, b = [], P = 0; for (var E of c) { var { abilityIndex: D } = E, R = o[D]; if (!!R) if (h(R)) { var N = I(R, f); b.push(N); } else if (p(R)) { var L = w(R, f); b.push(L); } else if (m(R)) !n && (n = M(R, f)), b.push(n[P]), P++; else if (v(R)) { var j = x(R, f); b.push(j); } else if (g(R)) { var O = C(R, f); b.push(O); } else if (_(R)) { var B = T(R, f); B && b.push(B); } else if (y(R)) { var F = A(R, f); b.push(F); } else if ((0, s.iB)(R)) { var U = k(R, f); b.push(U); } else { var G = S(R, f); b.push(G); } } return b; } catch (e) { return; } } }, 76212: function (e, t, i) { "use strict"; i.d(t, { Rb: function () { return c; }, b2: function () { return a; }, jb: function () { return o; }, kB: function () { return s; }, lh: function () { return l; }, }); var n = i(243302), r = i(417281); function a() { switch (!0) { case location.pathname.includes("image/generate"): return "to_image"; case location.pathname.includes("image-edit"): return "canvas"; case location.pathname.includes("video/generate"): return "to_video"; case location.pathname.includes("story-editor"): return "story"; case location.pathname.includes("audio/generate"): return "to_music"; case location.pathname.includes("workflow"): return "aigc"; default: return "makesame"; } } function o(e) { switch (e) { case n.pi.InPaint: return "to_image_inpaint"; case n.pi.OutPaint: return "to_image_expand"; case n.pi.InPaintRemove: return "to_image_remove"; default: return; } } function s(e) { var t = a(), i = ""; switch (e) { case n.pi.InPaint: i = "inpaint"; break; case n.pi.OutPaint: i = "expand"; break; case n.pi.InPaintRemove: i = "inpaintremove"; } return "".concat(t, "_").concat(i); } function l(e) { var t = a(), i = ""; switch (e) { case "text2image_high_aes_general_jianying": i = "generalv1.1"; break; case "text2image_high_aes_general_jianying_v12_hw": case "text2image_high_aes_general_jianying_v12": i = "generalv1.2"; break; case "high_aes_scheduler_svr": case "high_aes_scheduler_svr:anime_v1.3": i = "artflexxl"; break; case "text2img_xl_sft": i = "generalvxl"; break; case "text2image_high_aes_anime_jianying": i = "animev1.1"; break; default: i = e; } return "".concat(t, "-").concat(i); } function c(e) { var t = []; for (var i of e) switch (i.name) { case r.UI.ControlNet: if ("controlNetList" in i) { for (var n of i.controlNetList) t.push(n.name); break; } default: t.push(i.name); } return t.join(","); } }, 549654: function (e, t, i) { "use strict"; i.d(t, { E: function () { return r; }, o: function () { return a; }, }); var n = i(733787), r = { [n.BY.High]: n.Dq.Level3, [n.BY.Moderate]: n.Dq.Level2, [n.BY.Low]: n.Dq.Level1, }, a = { [n.Dq.Level3]: n.BY.High, [n.Dq.Level2]: n.BY.Moderate, [n.Dq.Level1]: n.BY.Low, }; }, 913390: function (e, t, i) { "use strict"; i.d(t, { i: function () { return o; }, l: function () { return a; }, }); var n = i(625572), r = i(172834); function a(e, t) { var i, r = null == e ? void 0 : e.vid; if (!!r) { var a = null == t ? void 0 : null === (i = t.find((e) => e.key === r)) || void 0 === i ? void 0 : i.videoInfo; return (0, n._)({ videoId: r }, a); } } function o(e, t) { if (!!(null == e ? void 0 : e.videoId)) { var i, n, a, o = new r.DAAudioResource(); return ( (o.sourceFrom = null !== (i = null == t ? void 0 : t.sourceFrom) && void 0 !== i ? i : r.DAResourceSourceFrom.upload), (o.vid = e.videoId), o.setDurationSecond( null !== (n = e.duration) && void 0 !== n ? n : 0 ), (o.name = null !== (a = null == t ? void 0 : t.name) && void 0 !== a ? a : ""), o ); } } }, 384295: function (e, t, i) { "use strict"; i.d(t, { j: () => s }); var n = i("172834"), r = i("869919"), a = { [r.zk.BGM]: n.DAGenerateVideoAudioScene.BGM, [r.zk.AudioEffect]: n.DAGenerateVideoAudioScene.EFFECT, }; function o(e) { if (!!e) return a[e]; } function s(e) { if (!!e) { var t = new n.DAVideoGenV2VAVMix(); return ( (t.enable = e.enable), (t.videoItemId = e.videoItemId), (t.audioVid = e.audioVid), (t.scene = o(e.scene)), t ); } } n.DAGenerateVideoAudioScene.BGM, r.zk.BGM, n.DAGenerateVideoAudioScene.EFFECT, r.zk.AudioEffect; }, 324319: function (e, t, i) { "use strict"; i.d(t, { IM: () => f, s3: () => p, mi: () => h }); var n = i("172834"), r = i("599045"), a = i("266352"), o = i("201636"), s = i("224671"), l = (e) => { if (!!e) { var t = new n.LipSyncInfoToneEmotion(); return ( (t.nameKey = e.nameKey), (t.text = e.text), (t.emotion = e.emotion), (t.emotionScale = e.emotionScale), t ); } }, c = (e) => { if (!!e) return { nameKey: e.nameKey, text: e.text, emotion: e.emotion, emotionScale: e.emotionScale, }; }, d = "upload_audio_placeholder_tone_id", u = (e) => e.sourceType === r.M.LocalFile && e.toneId === d ? "\u97F3\u9891\u539F\u58F0" : e.toneItemPlatform === o.oH.Local || e.toneItemPlatform === o.oH.Template ? "\u81EA\u5B9A\u4E49\u97F3\u8272" : e.toneKey; function f(e) { if ((null == e ? void 0 : e.sourceType) === r.M.LocalFile) return e.name; } function h(e) { if (!e) return new n.DALipSyncAbility(); var t, i = new n.DALipSyncAbility(); return e.sourceType === r.M.LocalFile ? ((i.ttsContent = void 0), (i.audioToneId = u(e)), (i.audioItemPlatform = (0, a.c)(e.toneItemPlatform)), (i.audioToneEmotion = l(e.toneEmotion)), (i.audioResourceId = ( null == e ? void 0 : null === (t = e.toneId) || void 0 === t ? void 0 : t.includes(d) ) ? void 0 : String(e.toneId)), (i.audioSpeed = void 0), (i.audioEffectId = void 0), (i.ttsContent = void 0), i) : ((i.ttsContent = e.text), (i.audioToneId = u(e)), (i.audioEffectId = e.toneEffectId), (i.audioResourceId = String(e.toneId)), (i.audioItemPlatform = (0, a.c)(e.toneItemPlatform)), (i.audioToneEmotion = l(e.toneEmotion)), (i.audioSpeed = e.speed), i); } function p(e) { if (!!e) { var t, i, n, l, u, f, h, p, v, m, g, _, y, b, I, w, x, S = e.ttsContent ? r.M.TextToSpeech : r.M.LocalFile, M = c(e.audioToneEmotion); return S === r.M.TextToSpeech ? { sourceType: S, name: null !== (i = e.audioToneId) && void 0 !== i ? i : "", toneId: null !== (n = e.audioResourceId) && void 0 !== n ? n : "", toneItemPlatform: null !== (l = (0, a.S)(e.audioItemPlatform)) && void 0 !== l ? l : o.oH.Loki, text: null !== (u = e.ttsContent) && void 0 !== u ? u : "", speed: null !== (f = e.audioSpeed) && void 0 !== f ? f : 1, toneEffectId: null !== (h = e.audioEffectId) && void 0 !== h ? h : "", toneCategoryId: 0, toneCategoryKey: "all", toneKey: null !== (p = e.audioToneId) && void 0 !== p ? p : "", toneEmotion: M, } : { sourceType: S, toneCategoryId: 0, toneCategoryKey: "all", toneKey: null !== (v = e.audioToneId) && void 0 !== v ? v : "", name: null !== (m = (null === (t = e.audio) || void 0 === t ? void 0 : t.name) || e.audioToneId) && void 0 !== m ? m : d, toneId: null !== (g = e.audioResourceId) && void 0 !== g ? g : d, tone: e.audioResourceId ? { id: null !== (_ = e.audioResourceId) && void 0 !== _ ? _ : "", idInfo: { id: null !== (y = e.audioResourceId) && void 0 !== y ? y : "", itemPlatform: null !== (b = (0, a.S)(e.audioItemPlatform)) && void 0 !== b ? b : o.oH.Loki, }, title: null !== (I = e.audioToneId) && void 0 !== I ? I : "", resourceId: null !== (w = e.audioResourceId) && void 0 !== w ? w : "", lokiInfo: "", isVip: !1, disableSpeedRate: !1, effectType: s.O5.DreaminaCloneTone, toneType: {}, } : void 0, toneItemPlatform: null !== (x = (0, a.S)(e.audioItemPlatform)) && void 0 !== x ? x : o.oH.Loki, toneEmotion: M, }; } } }, 675679: function (e, t, i) { "use strict"; i.d(t, { a: function () { return n; }, }); var n = (e) => { if (e && "object" == typeof e) return JSON.stringify(e); }; }, 766079: function (e, t, i) { "use strict"; i.d(t, { c: function () { return a; }, o: function () { return r; }, }); var n = i(172834); function r(e) { if (!!e) { var t = new n.DAVideoGenV2VExtend(); return ( (t.enable = !0), (t.extendDurationMs = e.extendDurationMs), (t.extendFps = e.extendFps), (t.extendPrompt = e.extendPrompt), t ); } } function a(e) { var t, i, n, r; if (!!e) return { enable: null !== (t = e.enable) && void 0 !== t && t, extendDurationMs: Number( null !== (i = e.extendDurationMs) && void 0 !== i ? i : 0 ), extendFps: Number( null !== (n = e.extendFps) && void 0 !== n ? n : 0 ), extendPrompt: null !== (r = e.extendPrompt) && void 0 !== r ? r : "", }; } }, 872432: function (e, t, i) { "use strict"; i.d(t, { e: function () { return s; }, }); var n = i(172834), r = i(549654), a = i(770449), o = i(839517), s = (e) => { var t = new n.DAVideoGenInput(), i = e.motionSpeed ? r.o[e.motionSpeed] : void 0, s = e.firstFrameImage, l = e.endFrameImage; return ( (t.prompt = e.prompt), (t.firstFrameImage = (0, a.QL)(s, (0, a.SW)(s))), (t.endFrameImage = (0, a.QL)(l, (0, a.SW)(l))), (t.lensMotionType = e.lensMotionType), (t.motionSpeed = i), (t.vid = e.vid), (t.audioVid = e.audioVid ? BigInt(e.audioVid) : void 0), (t.videoMode = (0, o.x)(e.videoMode)), (t.fps = e.originFps), (t.durationMs = e.originDurationMs), (t.cameraStrength = e.motionIntensity), (t.templateId = e.templateId), (t.endingControl = e.endFrameImage ? "1.0" : void 0), t ); }; }, 803188: function (e, t, i) { "use strict"; i.d(t, { $O: function () { return r; }, }); var n = i(172834); function r() { var e = new n.DAVideoGenerateAbilities(), t = new n.DAGenVideoAbility(); e.genVideo = t; var i = new n.DAText2VideoParams(); t.text2VideoParams = i; var r = new n.DAVideoGenInput(); i.videoGenInputs = [r]; var a = new n.DAVideoGenV2V(); return ( (r.v2vOpt = a), { abilities: e, ability: t, textToVideoParams: i, videoGenInput: r, v2vOpt: a, } ); } }, 593233: function (e, t, i) { "use strict"; i.d(t, { I: function () { return r; }, W: function () { return a; }, }); var n = i(172834); function r(e) { if (!!e) { var t = new n.DAVideoGenV2VInsertFrame(); return ( (t.enable = !0), (t.targetFps = e.targetFps), (t.originFps = e.originFps), (t.durationMs = e.durationMs), t ); } } function a(e) { var t, i, n; if (!!e) return { enable: null !== (t = e.enable) && void 0 !== t && t, targetFps: Number( null !== (i = e.targetFps) && void 0 !== i ? i : 0 ), originFps: Number( null !== (n = e.originFps) && void 0 !== n ? n : 0 ), durationMs: e.durationMs ? Number(e.durationMs) : void 0, }; } }, 43637: function (e, t, i) { "use strict"; i.d(t, { o: function () { return r; }, }); var n = i(172834); function r(e) { if (!!e) { var t = new n.DAVideoRefParam(); return ( (t.originHistoryId = e.originHistoryId), (t.itemId = e.originItemId), t ); } } }, 570697: function (e, t, i) { "use strict"; i.d(t, { N: function () { return r; }, y: function () { return a; }, }); var n = i(172834); function r(e) { if (!!e) { var t = new n.DAVideoGenV2VSuperResolution(); return ( (t.enable = !0), (t.targetHeight = e.targetHeight), (t.targetWidth = e.targetWidth), (t.originWidth = e.originWidth), (t.originHeight = e.originHeight), t ); } } function a(e) { var t, i, n, r, a; if (!!e) return { enable: null !== (t = e.enable) && void 0 !== t && t, targetWidth: Number( null !== (i = e.targetWidth) && void 0 !== i ? i : 0 ), targetHeight: Number( null !== (n = e.targetHeight) && void 0 !== n ? n : 0 ), originWidth: Number( null !== (r = e.originWidth) && void 0 !== r ? r : 0 ), originHeight: Number( null !== (a = e.originHeight) && void 0 !== a ? a : 0 ), }; } }, 295976: function (e, t, i) { "use strict"; i.d(t, { S: () => d, f: () => c }); var n = i("625572"), r = i("172834"), a = i("43212"), o = i("60684"); function s(e, t) { if (!e || !(null == t ? void 0 : t.length)) return; var { videoTemplate: i } = e; if (!i) return; var n = t.find((e) => e.key === String(i)); if (!!(null == n ? void 0 : n.effectRefItemInfo)) return n.effectRefItemInfo; } var l = i("626173"); function c(e) { if (!!e) { var t = new r.DAVideoGenVideoTemplate(); t.enable = !0; var i = new r.DAImageResource(); if ( ((i.sourceFrom = r.DAResourceSourceFrom.upload), (i.platformType = r.DAImageResourcePlatformType.imageX), (i.uri = e.imageInfo.imageUri), e.imageInfo.aigcImage) ) { var n = new r.DAAIGCImage(); (n.itemId = e.imageInfo.aigcImage.itemId), (i.aigcImage = n), (i.sourceFrom = r.DAResourceSourceFrom.produced); } return ( (t.imageInfo = i), (t.videoTemplate = e.videoTemplateItemId), (t.videoInfo = (0, a.E)(e.videoInfo)), t ); } } function d(e, t, i) { if (!e) return; var r, c, d = (0, o.F)(e.imageInfo, t), u = (0, a.f)(e.videoInfo, t); if (!!d) { var f = null !== (r = s(e, t)) && void 0 !== r ? r : i, h = u || (null == f ? void 0 : f.video); return { enable: null === (c = e.enable) || void 0 === c || c, videoTemplateItemId: e.videoTemplate ? String(e.videoTemplate) : void 0, imageInfo: d, videoInfo: h ? (0, n._)( {}, (0, l.Z)(e.videoInfo, [ "name", "vid", "width", "height", "aigcVideo", ]), h ) : void 0, videoTemplateItem: f, }; } } }, 362477: function (e, t, i) { "use strict"; i.d(t, { a: function () { return a; }, r: function () { return r; }, }); var n = i(172834); function r(e) { if (!!e) { var t = new n.DAEverPhoto(); return (t.workspaceId = e.workspaceId), (t.assetId = e.assetId), t; } } function a(e) { if (!!e) return { workspaceId: e.workspaceId, assetId: e.assetId }; } }, 60684: function (e, t, i) { "use strict"; i.d(t, { F: function () { return o; }, m: function () { return a; }, }); var n = i(172834), r = i(362477); function a(e) { if (!!e) { var t, i, a, o = new n.DAImageResource(); return ( (o.sourceFrom = n.DAResourceSourceFrom.upload), (o.platformType = n.DAImageResourcePlatformType.imageX), (o.uri = e.imageUri), (o.width = null !== (t = e.width) && void 0 !== t ? t : 0), (o.height = null !== (i = e.height) && void 0 !== i ? i : 0), (o.format = null !== (a = e.format) && void 0 !== a ? a : ""), (o.everPhoto = (0, r.r)(e.everPhoto)), o ); } } function o(e, t) { if (!!(null == e ? void 0 : e.uri)) { var i, n, a, o, s, l = null == t ? void 0 : null === (i = t.find((t) => t.key === e.uri)) || void 0 === i ? void 0 : i.imageInfo; return { imageUri: e.uri, imageUrl: null == l ? void 0 : l.imageUrl, width: null !== (n = null == l ? void 0 : l.width) && void 0 !== n ? n : e.width, height: null !== (a = null == l ? void 0 : l.height) && void 0 !== a ? a : e.height, format: null !== (o = null == l ? void 0 : l.format) && void 0 !== o ? o : e.format, everPhoto: null !== (s = null == l ? void 0 : l.everPhoto) && void 0 !== s ? s : (0, r.a)(e.everPhoto), coverUrlMap: null == l ? void 0 : l.coverUrlMap, }; } } }, 770449: function (e, t, i) { "use strict"; i.d(t, { QL: function () { return o; }, SW: function () { return a; }, Wc: function () { return s; }, }); var n = i(172834), r = i(362477); function a(e) { return (null == e ? void 0 : e.aigcImage) ? n.DAResourceSourceFrom.produced : n.DAResourceSourceFrom.upload; } function o(e, t) { if (!!e) { var i, a, o, s = new n.DAImageResource(); if ( ((s.sourceFrom = null != t ? t : n.DAResourceSourceFrom.upload), (s.platformType = n.DAImageResourcePlatformType.imageX), (s.uri = e.imageUri), (s.width = null !== (i = e.width) && void 0 !== i ? i : 0), (s.height = null !== (a = e.height) && void 0 !== a ? a : 0), (s.format = null !== (o = e.format) && void 0 !== o ? o : ""), e.aigcImage) ) { var l = new n.DAAIGCImage(); (l.itemId = e.aigcImage.itemId), (s.aigcImage = l); } return (s.everPhoto = (0, r.r)(e.everPhoto)), s; } } function s(e, t) { if (!!(null == e ? void 0 : e.uri)) { var i, n, a, o, s, l = null == t ? void 0 : null === (i = t.find((t) => t.key === e.uri)) || void 0 === i ? void 0 : i.imageInfo; return { imageUri: e.uri, imageUrl: null == l ? void 0 : l.imageUrl, width: null !== (n = null == l ? void 0 : l.width) && void 0 !== n ? n : e.width, height: null !== (a = null == l ? void 0 : l.height) && void 0 !== a ? a : e.height, format: null !== (o = null == l ? void 0 : l.format) && void 0 !== o ? o : e.format, everPhoto: null !== (s = null == l ? void 0 : l.everPhoto) && void 0 !== s ? s : (0, r.a)(e.everPhoto), coverUrlMap: null == l ? void 0 : l.coverUrlMap, }; } } }, 266352: function (e, t, i) { "use strict"; i.d(t, { S: function () { return l; }, c: function () { return s; }, }); var n = i(201636), r = i(172834), a = { [n.oH.Loki]: r.CommonItemPlatform.Loki, [n.oH.Local]: r.CommonItemPlatform.Local, [n.oH.Template]: r.CommonItemPlatform.Template, }, o = { [r.CommonItemPlatform.Loki]: n.oH.Loki, [r.CommonItemPlatform.Local]: n.oH.Local, [r.CommonItemPlatform.Template]: n.oH.Template, }; function s(e) { if (!!e) return a[e]; } function l(e) { if (!!e) return o[e]; } }, 763217: function (e, t, i) { "use strict"; i.d(t, { M: function () { return s; }, g: function () { return l; }, }); var n = i(869919), r = i(172834), a = { [n.tB.LipSyncDefault]: r.DALipSyncMode.standard, [n.tB.LipSyncLively]: r.DALipSyncMode.loopy, [n.tB.LipSyncMaster]: r.DALipSyncMode.hq, [n.tB.LipSyncMasterFast]: r.DALipSyncMode.hq480, }, o = { [r.DALipSyncMode.standard]: n.tB.LipSyncDefault, [r.DALipSyncMode.loopy]: n.tB.LipSyncLively, [r.DALipSyncMode.hq]: n.tB.LipSyncMaster, [r.DALipSyncMode.hq480]: n.tB.LipSyncMasterFast, }; function s(e) { if (!!e) return a[e]; } function l(e) { if (!!e) return o[e]; } }, 43212: function (e, t, i) { "use strict"; i.d(t, { E: function () { return o; }, f: function () { return a; }, }); var n = i(625572), r = i(172834); function a(e, t) { var i, r = null == e ? void 0 : e.vid; if (!!r) { var a = null == t ? void 0 : null === (i = t.find((e) => e.key === r)) || void 0 === i ? void 0 : i.videoInfo; return (0, n._)({ videoId: r }, a); } } function o(e) { if (!!(null == e ? void 0 : e.videoId)) { var t, i, n, a, o, s, l, c, d, u, f = new r.DAVideoResource(); (f.sourceFrom = r.DAResourceSourceFrom.upload), (f.vid = e.videoId); var h = null !== (s = null !== (o = null !== (a = null == e ? void 0 : null === (t = e.transcodedVideo) || void 0 === t ? void 0 : t["720p"]) && void 0 !== a ? a : null == e ? void 0 : null === (i = e.transcodedVideo) || void 0 === i ? void 0 : i["360p"]) && void 0 !== o ? o : null == e ? void 0 : null === (n = e.transcodedVideo) || void 0 === n ? void 0 : n.origin) && void 0 !== s ? s : null == e ? void 0 : e.originVideo; return ( (f.width = null !== (l = null == h ? void 0 : h.width) && void 0 !== l ? l : 0), (f.height = null !== (c = null == h ? void 0 : h.height) && void 0 !== c ? c : 0), (f.coverImage = null == h ? void 0 : h.coverUrl), e.durationMs && f.setDurationMilliSecond( null !== (d = e.durationMs) && void 0 !== d ? d : 0 ), e.duration && f.setDurationSecond( null !== (u = e.duration) && void 0 !== u ? u : 0 ), f ); } } }, 839517: function (e, t, i) { "use strict"; i.d(t, { r: function () { return l; }, x: function () { return s; }, }); var n = i(172834), r = i(869919), a = { [r.tB.Preview]: n.DAVideoMode.preview, [r.tB.Default]: n.DAVideoMode._default, [r.tB.Livephoto]: n.DAVideoMode.iCLivePhoto, [r.tB.LipSyncDefault]: n.DAVideoMode.avatar, [r.tB.LipSyncLively]: n.DAVideoMode.avatarLoopy, [r.tB.LipSyncMaster]: n.DAVideoMode.avatarHq, }, o = { [n.DAVideoMode.preview]: r.tB.Preview, [n.DAVideoMode._default]: r.tB.Default, [n.DAVideoMode.iCLivePhoto]: r.tB.Livephoto, [n.DAVideoMode.avatar]: r.tB.LipSyncDefault, [n.DAVideoMode.avatarLoopy]: r.tB.LipSyncLively, [n.DAVideoMode.avatarHq]: r.tB.LipSyncMaster, }; function s(e) { if (!!e) return a[e]; } function l(e) { if (!!e) return o[e]; } }, 43169: function (e, t, i) { "use strict"; i.d(t, { S: function () { return a; }, }); var n = i(243302), r = i(869919); function a(e) { var { bgmData: t, aigcImageParams: i, mixAvData: a, videoAudioEffect: o, } = e; if (i.generateType === n.pi.VideoBGM) return { audioList: t ? t.bgmList.map((e) => { var t, i, n = null == a ? void 0 : a.artifactList.find((t) => { var { audioVid: i } = t; return i === (null == e ? void 0 : e.vid); }); return { audio: { vid: null == e ? void 0 : e.vid, audioUrl: null == e ? void 0 : e.originAudio.url, status: e ? "success" : "fail", }, mixAudioVideo: n ? { itemId: null == n ? void 0 : n.itemId, videoItemId: null == n ? void 0 : n.videoItemId, audioVid: null == n ? void 0 : n.audioVid, videoUrl: null == n ? void 0 : null === (i = n.video) || void 0 === i ? void 0 : null === (t = i.originVideo) || void 0 === t ? void 0 : t.videoUrl, hasPublished: null == n ? void 0 : n.hasPublished, publishItemId: (null == n ? void 0 : n.hasPublished) ? null == n ? void 0 : n.publishedItemId : void 0, status: null == n ? void 0 : n.status, } : void 0, }; }) : void 0, default: t ? { vid: t.defaultBgm.vid, audioUrl: t.defaultBgm.originAudio.url, } : void 0, }; if (i.generateType === n.pi.VideoAudioEffect && o) { var { resultList: s, defaultAudio: l } = o; return { audioList: s.map((e) => { var t, i, { audio: n, mixedVideo: a, generateStatus: o, failCode: s } = e; return { audio: { vid: null == n ? void 0 : n.vid, audioUrl: null == n ? void 0 : n.originAudio.url, status: o === r.N7.Success ? "success" : "fail", failCode: s, }, mixAudioVideo: a ? { itemId: null == a ? void 0 : a.itemId, videoItemId: null == a ? void 0 : a.videoItemId, audioVid: null == a ? void 0 : a.audioVid, videoUrl: null == a ? void 0 : null === (i = a.video) || void 0 === i ? void 0 : null === (t = i.originVideo) || void 0 === t ? void 0 : t.videoUrl, hasPublished: null == a ? void 0 : a.hasPublished, publishItemId: (null == a ? void 0 : a.hasPublished) ? null == a ? void 0 : a.publishedItemId : void 0, status: null == a ? void 0 : a.status, } : void 0, }; }), default: { vid: l.vid, audioUrl: l.originAudio.url }, }; } } }, 936690: function (e, t, i) { "use strict"; i.d(t, { A1: function () { return m; }, DI: function () { return d; }, Dx: function () { return p; }, Hp: function () { return v; }, Tu: function () { return h; }, Uq: function () { return u; }, V8: function () { return g; }, qv: function () { return c; }, tA: function () { return f; }, }); var n = i(625572), r = i(639880), a = i(243302), o = i(601191), s = i(380908), l = i(128468); function c(e) { var t, i, n, { width: r = 0, height: a = 0 } = null !== (n = null == e ? void 0 : null === (i = e.image) || void 0 === i ? void 0 : null === (t = i.largeImages) || void 0 === t ? void 0 : t[0]) && void 0 !== n ? n : {}; return { width: r, height: a }; } function d(e, t) { var i, n, r; return (null == t ? void 0 : t.length) ? null !== (r = null == e ? void 0 : null === (n = e.aigcImageParams) || void 0 === n ? void 0 : null === (i = n.blendParams) || void 0 === i ? void 0 : i.promptPlaceholderInfoList) && void 0 !== r ? r : s.bd : []; } function u(e) { return { treatBgPaintAsControlNet: !1 }; } function f(e) { if (null == e ? void 0 : e.blendParams) return null == e ? void 0 : e.blendParams; var t, i, n, r, a = e && "mode" in e ? e.mode : l.JU.Workbench, s = null == e ? void 0 : null === (t = e.aigcImageParams) || void 0 === t ? void 0 : t.blendParams, f = c(e), h = u(s), p = (0, o.Mu)(f, s, a), v = d(e, p); return { blendAttributes: h, promptPlaceholderInfoList: v, imagePromptList: p, imagePromptZipUrl: null !== (r = null == e ? void 0 : null === (n = e.commonAttr) || void 0 === n ? void 0 : null === (i = n.itemUrls) || void 0 === i ? void 0 : i[0]) && void 0 !== r ? r : "", }; } function h(e) { return e === a.pi.Blend; } function p(e) { return e === a.pi.ByteEditPainting; } function v(e) { var t; return !!( e.canvasData || (null === (t = e.paintingParam) || void 0 === t ? void 0 : t.canvasData) ); } function m(e) { var t, i, n, { inPaintingParams: r, outPaintingParams: o, text2imageParams: s, generateType: l, } = e; return l === a.pi.InPaint ? null !== (t = null == r ? void 0 : r.originPrompt) && void 0 !== t ? t : "" : l === a.pi.OutPaint ? null !== (i = null == o ? void 0 : o.originPrompt) && void 0 !== i ? i : "" : null !== (n = null == s ? void 0 : s.prompt) && void 0 !== n ? n : ""; } function g(e, t) { var { inPaintingParams: i, outPaintingParams: o, text2imageParams: s, generateType: l, } = e; if (l === a.pi.InPaint && i) { e.inPaintingParams = (0, r._)((0, n._)({}, i), { originPrompt: t }); return; } if (l === a.pi.OutPaint && o) { e.outPaintingParams = (0, r._)((0, n._)({}, o), { originPrompt: t }); return; } if (s) { e.text2imageParams = (0, r._)((0, n._)({}, s), { prompt: t }); return; } } }, 952739: function (e, t, i) { "use strict"; i.d(t, { Ir: function () { return r; }, a0: function () { return o; }, fe: function () { return a; }, }); var n = i(639985); function r(e, t, i) { if (t && i) { var r = n.L2["0"].type, a = 1 / 0; for (var o of n.L2) { var s = Math.abs(o.value * t - i); s < a && ((r = o.type), (a = s)); } return r; } return e; } function a(e) { if (!e) return {}; var t = {}; return ( e.forEach((e) => { t[e.width.toString()] = e.imageUrl; }), t ); } function o(e) { var t, i = 1 / 0; for (var n in e) Number(n) <= i && (i = Number(n)); return null !== (t = e[i]) && void 0 !== t ? t : ""; } }, 117275: function (e, t, i) { "use strict"; i.d(t, { o: function () { return f; }, }); var n = i(625572), r = i(639880), a = i(380908), o = i(417281), s = i(128468), l = i(699813), c = ""; function d(e) { var t, i, a, l, d, { imageUri: u = "", imageUrl: f = "", width: h = 0, height: p = 0, aigcImage: v, } = null !== (l = null === (t = e.styleReference) || void 0 === t ? void 0 : t.image) && void 0 !== l ? l : {}, m = { image: (0, r._)( (0, n._)( {}, null === (i = e.styleReference) || void 0 === i ? void 0 : i.image ), { aigcImage: (0, r._)((0, n._)({}, v), { itemId: "" }), imageUri: u, imageUrl: f, width: h, height: p, } ), styleWeight: null !== (d = null === (a = e.styleReference) || void 0 === a ? void 0 : a.styleWeight) && void 0 !== d ? d : 0, }; return { name: o.UI.StyleCode, commonAsset: { assetType: s.d_.Style, assetCode: c, referImageList: [m], }, imageList: [], ipKeepList: [], }; } function u(e, t) { var i, a, l, d, u, f, h, { imageUri: p = "", imageUrl: v = "", width: m = 0, height: g = 0, aigcImage: _, } = null !== (u = null === (i = e.styleReference) || void 0 === i ? void 0 : i.image) && void 0 !== u ? u : {}, y = { image: (0, r._)( (0, n._)( {}, null === (a = e.styleReference) || void 0 === a ? void 0 : a.image ), { aigcImage: (0, r._)((0, n._)({}, _), { itemId: "" }), imageUri: p, imageUrl: v, width: m, height: g, } ), styleWeight: null !== (f = null === (l = e.styleReference) || void 0 === l ? void 0 : l.styleWeight) && void 0 !== f ? f : 0, }; return { name: o.UI.StyleCode, commonAsset: { assetType: s.d_.Style, assetCode: c, referImageList: [ ...(null !== (h = null === (d = t.commonAsset) || void 0 === d ? void 0 : d.referImageList) && void 0 !== h ? h : []), y, ], }, imageList: [], ipKeepList: [], }; } function f(e) { var { prompt: t, abilityList: i, promptPlaceholderInfoList: n } = e; if (i.filter((e) => (0, o.D3)(e)).length <= 1) return { prompt: t, abilityList: i, promptPlaceholderInfoList: n }; var r = t.replace(a.rO, "__$1__").split("__"), s = [], c = [], f = [], h = 0, p = -1, v = !1, m = null !== (_ = null == n ? void 0 : n.length) && void 0 !== _ ? _ : 0; for (var g of r) { var _, y, b = g === a.qi; if (!g) { s.push(g); continue; } if (!b) { s.push(g), (v = !g.trim() && v); continue; } if (h >= m) break; var I = i[ null !== (y = null == n ? void 0 : n[h].abilityIndex) && void 0 !== y ? y : 0 ]; if (I.name === o.UI.StyleReference) { if (v) { var w = c.pop(); (0, l.ZB)(w); var x = u( I, (null == w ? void 0 : w.name) === o.UI.StyleReference ? d(w) : w ); c.push(x); } else c.push(I), s.push(g), f.push({ abilityIndex: c.length - 1 }); v = !0; } else I.name === o.UI.ControlNet ? ((v = !1), -1 === p && (c.push(I), (p = c.length - 1)), s.push(g), f.push({ abilityIndex: p })) : ((v = !1), c.push(I), s.push(g), f.push({ abilityIndex: c.length - 1 })); h++; } return { prompt: s.join(""), abilityList: c, promptPlaceholderInfoList: f.length ? f : void 0, }; } }, 283349: function (e, t, i) { "use strict"; i.d(t, { L: function () { return a; }, w: function () { return r; }, }); var n = i(243302), r = (e) => [ n.pi.Text2Video, n.pi.VideoBGM, n.pi.AudioVideoMix, n.pi.Image2Avatar, n.pi.Video2Avatar, n.pi.VideoTemplate, n.pi.VideoAudioEffect, n.pi.VideoAudioEffectMix, n.pi.LipSync, ].includes(e), a = (e) => [n.pi.Text2Song, n.pi.Text2Instrumental].includes(e); }, 910629: function (e, t, i) { "use strict"; i.d(t, { M: () => L, y: () => j }); var n = i("333597"), r = i("317825"), a = i("139646"), o = i("625572"), s = i("639880"), l = i("789786"), c = i("655901"), d = i("340733"), u = i("820266"), f = i("100470"), h = i("243090"), p = i("586315"), v = i("242089"), m = i("712942"), g = i("923810"), _ = i("940140"), y = { queryTask: { hostNameType: _.b_.Default, url: "/mweb/v1/mget_generate_task", }, getRandomPrompt: { hostNameType: _.b_.Default, url: "/mweb/v1/random_prompt", }, generateContent: { hostNameType: _.b_.Default, url: "/mweb/v1/generate", }, generateBlendContent: { hostNameType: _.b_.Default, url: "/mweb/v1/blend", }, getGenerateContentHistory: { hostNameType: _.b_.Default, url: "/mweb/v1/get_history", }, generateSuperResolutionContent: { hostNameType: _.b_.Default, url: "/mweb/v1/super_resolution", }, generateSuperDefinitionContent: { hostNameType: _.b_.Default, url: "/mweb/v1/normal_hd", }, generatePaintingContent: { hostNameType: _.b_.Default, url: "/mweb/v1/painting", }, generateFusionContent: { hostNameType: _.b_.Default, url: "/mweb/v1/fusion", }, generateInstaDragContent: { HostNameType: _.b_.Default, url: "/mweb/v1/insta_drag", }, generateDoodleContent: { hostNameType: _.b_.Default, url: "/mweb/v1/doodle", }, generateDoodleContentAudit: { hostNameType: _.b_.Default, url: "/mweb/v1/doodle_audit", }, locateGenerateContent: { hostNameType: _.b_.Default, url: "/mweb/v1/locate_workbench", }, getLocalItemList: { hostNameType: _.b_.Default, url: "/mweb/v1/get_local_item_list", }, getItemInfo: { hostNameType: _.b_.Default, url: "/mweb/v1/mget_item_info", }, generateMixBlendContent: { hostNameType: _.b_.Default, url: "/mweb/v1/mixblend", }, saveLocalItemByCut: { hostNameType: _.b_.Default, url: "/mweb/v1/save_local_item_by_cut", }, requestAlgorithm: { hostNameType: _.b_.Default, url: "/mweb/v1/algo_proxy", }, getImageDescription: { HostNameType: _.b_.Default, url: "/mweb/v1/get_image_description", }, }, b = i("643590"), I = i("904337"), w = i("416105"), x = i("804274"), S = i("453604"), M = i("875649"), C = i("879976"); function T() { var e = new b.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return ( (0, C.V)(e), (0, I.$)(e), (0, w.mH)(e), (0, x.xP)(e), (0, S.d)(e), (0, M.i3)(e), e ); } var A = i("389657"), k = "CGRepository"; class P { getRandomPrompt(e, t) { var i = this; return (0, a._)(function* () { var n = "".concat((0, m.H4)()).concat(y.getRandomPrompt.url); return yield (0, v.O)(n, () => i._request(e, n, t)); })(); } queryTask(e, t) { var i = this; return (0, a._)(function* () { var { taskId: n, imageInfo: r } = t; return yield i._request( e, "".concat((0, m.H4)()).concat(y.queryTask.url), { task_id_list: [n], image_info: r } ); })(); } generateContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateContent.url), t, i ); })(); } generateBlendContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateBlendContent.url), t, i ); })(); } getHistoryById(e, t) { var i = this; return (0, a._)(function* () { var n = "".concat((0, m.H4)()).concat(g.v.getHistoryById.url); return yield i._request(e, n, { historyId: t }); })(); } generateSuperResolutionContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "" .concat((0, m.H4)()) .concat(y.generateSuperResolutionContent.url), t, i ); })(); } generateSuperDefinitionContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "" .concat((0, m.H4)()) .concat(y.generateSuperDefinitionContent.url), t, i ); })(); } locateGenerateContent(e, t) { var i = this; return (0, a._)(function* () { return yield i._request( e, "".concat((0, m.H4)()).concat(y.locateGenerateContent.url), t ); })(); } generatePaintingContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generatePaintingContent.url), t, i ); })(); } generateFusionContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateFusionContent.url), t, i ); })(); } generateInstaDragContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateInstaDragContent.url), t, i ); })(); } generateMixBlendContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateMixBlendContent.url), t, i ); })(); } generateDoodleContent(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateDoodleContent.url), t, i ); })(); } doodleContentAudit(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.generateDoodleContentAudit.url), t, i ); })(); } getLocalItemList(e, t) { var i = this; return (0, a._)(function* () { return yield i._request( e, "".concat((0, m.H4)()).concat(y.getLocalItemList.url), t ); })(); } getItemInfo(e, t) { var i = this; return (0, a._)(function* () { t.packItemOpt = (0, s._)((0, o._)({}, t.packItemOpt), { needDataIntegrity: !0, }); var n = yield i._request( e, "".concat((0, m.H4)()).concat(y.getItemInfo.url), t ); if (!n.response.ok) return n; var r = n.response.value, a = n.cacheSyncToken, { logId: l } = n; if (a && l) { var u = yield A.Li.decryptIV(a, l); yield (0, c.PM)(A.Li.decrypt.bind(A.Li), r.effectItemList, u); } var f = yield A.sn.getSignOptions(); return (0, d.PY)(A.sn.sign.bind(A.sn), r.effectItemList, f), n; })(); } saveLocalItemByCut(e, t) { var i = this; return (0, a._)(function* () { return yield i._request( e, "".concat((0, m.H4)()).concat(y.saveLocalItemByCut.url), t ); })(); } requestAlgorithm(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = !0, o = [String(f.b.ErrUploadImageCopyrightBlock)], { response: s, costTime: l, logId: c, } = yield r._request( e, "".concat((0, m.H4)()).concat(y.requestAlgorithm.url), r._formatAlgorithmRequest(t, i), n, a, o ); return s.ok ? { response: (0, p.oW)({ fileList: s.value.fileList, data: s.value.respParams ? (0, u.b)((0, h.D)(s.value.respParams)) : void 0, }), costTime: l, logId: c, } : { response: s, costTime: l, logId: c }; })(); } getImageDescription(e, t, i) { var n = this; return (0, a._)(function* () { return yield n._request( e, "".concat((0, m.H4)()).concat(y.getImageDescription.url), t, i ); })(); } _formatAlgorithmRequest(e, t) { var [i, n] = e.split("."), { fileList: r, options: a } = t; return { reqKey: i, scene: n, fileList: r, reqParams: this._formatAlgorithmRequestParams(t.params), options: a, }; } _formatAlgorithmRequestParams(e) { return Object.fromEntries( Object.entries(e).flatMap(this._formatAlgorithmRequestParamEntry) ); } _handleError(e, t) { var i = "ret" in t && void 0 !== t.ret, n = navigator.onLine ? f.b.ErrClientCommon : f.b.ErrOffline, r = i ? Number(t.ret) : n, a = this._formatErrorMessage(t); return (0, p.wf)(r, a); } _request(e, t, i, n) { var r = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], l = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : [], c = this; return (0, a._)(function* () { var a = Date.now(); try { var { data: d, logid: u, cacheSyncToken: f, } = yield c._networkClient.post(t, i, { ctx: e, params: (0, s._)((0, o._)({}, n), { needCache: r, cacheErrorCodes: l, }), }); return { response: (0, p.oW)(d), costTime: Date.now() - a, logId: u, cacheSyncToken: f, }; } catch (t) { return { response: c._handleError(e, t), costTime: Date.now() - a, logId: "ret" in t && void 0 !== t.ret ? t.logid : "", }; } })(); } constructor() { (this._formatAlgorithmRequestParamEntry = (e) => { var [t, i] = e; return Array.isArray(i) ? i.flatMap((e, i) => this._formatAlgorithmRequestParamEntry([ "".concat(t, ".").concat(i), e, ]) ) : "string" == typeof i ? [[t, { stringValue: i }]] : "number" == typeof i ? [[t, i % 1 > 0 ? { doubleValue: i } : { intValue: i }]] : Object.entries(i).flatMap((e) => { var [i, n] = e; return this._formatAlgorithmRequestParamEntry([ "".concat(t, ".").concat(i), n, ]); }); }), (this._formatErrorMessage = (e) => { var t, i, n = "logid" in e ? e.logid : ""; return JSON.stringify({ errMsg: "ret" in e ? e.errmsg : "message: " .concat( null !== (t = e.message) && void 0 !== t ? t : "", ", stack: " ) .concat( null !== (i = e.stack) && void 0 !== i ? i : "" ), logId: n, }); }), (this._networkClient = T()); } } (0, l.gn)( [ (0, r.f1)(k, "queryTask"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IGenerateTaskRequest ? Object : IGenerateTaskRequest, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "queryTask", null ), (0, l.gn)( [ (0, r.f1)(k, "genContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IGenerateContentRequest ? Object : IGenerateContentRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genBlendContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IGenerateBlendContentRequest ? Object : IGenerateBlendContentRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateBlendContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genSuperResolutionContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IGenerateSuperResolutionContentRequest ? Object : IGenerateSuperResolutionContentRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateSuperResolutionContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genSuperDefinitionContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IGenerateSuperDefinitionRequest ? Object : IGenerateSuperDefinitionRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateSuperDefinitionContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genPaintingContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IMWebGeneratePaintingParam ? Object : IMWebGeneratePaintingParam, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generatePaintingContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genFusionContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IMWebGenerateFusionParam ? Object : IMWebGenerateFusionParam, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateFusionContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genInstaDragContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof InstaDragRequestData ? Object : InstaDragRequestData, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateInstaDragContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genMixBlendContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IMWebMixBlendRequest ? Object : IMWebMixBlendRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateMixBlendContent", null ), (0, l.gn)( [ (0, r.f1)(k, "genDoodleContent"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, "undefined" == typeof IMWebDoodleRequest ? Object : IMWebDoodleRequest, "undefined" == typeof Record ? Object : Record, ]), (0, l.w6)("design:returntype", Promise), ], P.prototype, "generateDoodleContent", null ), (0, l.gn)( [ (0, r.lI)("ContentGenerateRepository", "handleError"), (0, l.w6)("design:type", Function), (0, l.w6)("design:paramtypes", [ "undefined" == typeof Context ? Object : Context, Object, ]), (0, l.w6)("design:returntype", void 0), ], P.prototype, "_handleError", null ); var E = i("518376"), D = i("229025"), R = i("243302"); class N { generateContent(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = (0, o._)({}, t); a.modelConfig && (a.modelConfig = void 0); var s = yield r._contentGenerateRepository.generateContent(e, a, i); return r._getFormatNetworkResponseResult(s, (e, t) => (0, D.cQ)(e, t, n) ); })(); } generateBlendContent(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = yield r._contentGenerateRepository.generateBlendContent( e, t, i ); return r._getFormatNetworkResponseResult(a, (e, t) => (0, D.cQ)(e, t, n) ); })(); } generateMixBlendContent(e, t, i) { var n = this; return (0, a._)(function* () { var r = yield n._contentGenerateRepository.generateMixBlendContent( e, t, i ); return n._getFormatNetworkResponseResult(r, D.cQ); })(); } locateGenerateContent(e, t, i) { var n = this; return (0, a._)(function* () { var r = yield n._contentGenerateRepository.locateGenerateContent( e, t ); return n._getFormatNetworkResponseResult(r, (e, t) => { var n, r = null !== (n = e.recordsList) && void 0 !== n ? n : [], a = (0, D.Qd)(e.nextOffset); return (0, s._)((0, o._)({}, e), { nextOffset: a, recordList: r.map((e) => (0, D.cQ)(e, t, i)), }); }); })(); } getHistoryById(e, t) { var i = this; return (0, a._)(function* () { var n = yield i._contentGenerateRepository.getHistoryById(e, t); return i._getFormatNetworkResponseResult(n, D.cQ); })(); } generateSuperResolutionContent(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = yield r._contentGenerateRepository.generateSuperResolutionContent( e, t, i ); return r._getFormatNetworkResponseResult(a, (e, t) => (0, D.cQ)(e, t, n) ); })(); } generateSuperDefinitionContent(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = yield r._contentGenerateRepository.generateSuperDefinitionContent( e, t, i ); return r._getFormatNetworkResponseResult(a, (e, t) => (0, D.cQ)(e, t, n) ); })(); } generatePaintingContent(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = yield r._contentGenerateRepository.generatePaintingContent( e, t, i ); return r._getFormatNetworkResponseResult(a, (e, t) => (0, D.cQ)(e, t, n) ); })(); } _getFormatNetworkResponseResult(e, t) { var { response: i, costTime: n, logId: r } = e; if (i.ok) { var { value: a } = i, o = t.call(this, a, n); return { response: (0, p.oW)(o), costTime: n, logId: r }; } return { response: i, costTime: n, logId: r }; } queryTask(e, t, i, n) { var r = this; return (0, a._)(function* () { var a = yield r._contentGenerateRepository.queryTask(e, { taskId: t, imageInfo: i, }); return r._getFormatNetworkResponseResult(a, (e, i) => (0, D.cQ)(e.taskMap[t], i, n) ); })(); } getTaskResult(e, t, i, n, r, o) { var s = this; return (0, a._)(function* () { var a, l, c = yield s.queryTask(e, t, n, r); for ( null == o || null === (a = o.afterEach) || void 0 === a || a.call(o, c); c.response.ok && [R.Pd.Init, R.Pd.SubmitOk].includes(c.response.value.status); ) yield (0, E._)((0, D.nV)(i)), (c = yield s.queryTask(e, t, n, r)), null == o || null === (l = o.afterEach) || void 0 === l || l.call(o, c); return c; })(); } constructor(e) { this._contentGenerateRepository = e; } } var L = (0, n.yh)("mWeb-content-generate-service"); class j { get repository() { return this._repository; } get aggregate() { return this._aggregate; } constructor() { (this._repository = (0, r.bu)("ContentGenerateRepository", new P())), (this._aggregate = (0, r.bu)( "ContentGenerateAggregate", new N(this._repository) )); } } }, 229025: function (e, t, i) { "use strict"; i.d(t, { Cg: function () { return u; }, FO: function () { return f; }, KG: function () { return m; }, Qd: function () { return x; }, cQ: function () { return S; }, nV: function () { return M; }, }); var n = i(625572), r = i(639880), a = i(243302), o = i(224671), s = i(107520), l = i(100470), c = i(936690), d = i(591586); function u(e) { return [ a.pi.SuperResolution, a.pi.InPaintRemove, a.pi.SuperDefinition, ].includes(e); } function f(e) { return e.itemList.length > 1; } function h(e, t) { var i = {}; if (t) try { i = JSON.parse(t); } catch (e) { d.t.error("metricsExtra parse error", e); } if (!e) return (0, n._)( { promptSource: o.U_.Default, templateSource: o.Q8.Default, templateId: "", generateCount: 1, generateId: "", lastRequestId: "", originRequestId: "", }, i ); var { promptSource: r, templateSource: a, templateId: s, generateCount: l, generateId: c, lastRequestId: u, originRequestId: f, } = e; return (0, n._)( { generateId: c, templateId: s, promptSource: r, templateSource: a, generateCount: l || 1, lastRequestId: u, originRequestId: f, }, i ); } function p(e, t, i) { if (!e) return { prompt: "", seed: -1, model: "", sampleStrength: 0.5, negativePrompt: "", imageRatio: o.jP.OneOne, largeImageInfo: { width: 1024, height: 1024, resolutionType: o.YD.ImageResolutionType_1k, }, }; var a, s = null === (a = e.modelConfig) || void 0 === a ? void 0 : a.modelReqKey; return (0, r._)((0, n._)({}, e), { model: s }); } function v() { var e = 1e3 * Math.random(); return { imageUri: "", requestId: "", itemId: "itemId-".concat(Date.now(), "-").concat(e), coverUri: "", coverUrl: "", downloadUri: "", downloadUrl: "", isErrorBlank: !0, imageRatio: o.jP.OneOne, publishedItemId: "", }; } function m(e, t) { var i, n = null !== (i = null == e ? void 0 : e.map((e) => { var t, i, n, r, a, o, s, { commonAttr: l, image: c, aigcImageParams: d, } = null != e ? e : {}, { id: u = "", coverUrl: f = "", coverUri: h = "", publishedItemId: p = "", } = null != l ? l : {}, { requestId: v = "" } = null != d ? d : {}, m = null !== (a = null == c ? void 0 : null === (i = c.largeImages) || void 0 === i ? void 0 : null === (t = i[0]) || void 0 === t ? void 0 : t.imageUrl) && void 0 !== a ? a : "", g = null !== (o = null == c ? void 0 : null === (r = c.largeImages) || void 0 === r ? void 0 : null === (n = r[0]) || void 0 === n ? void 0 : n.imageUri) && void 0 !== o ? o : "", { largeImages: _ = [] } = null != c ? c : {}, { width: y, height: b, imageUri: I, } = null !== (s = _[0]) && void 0 !== s ? s : {}; return { imageUri: I, itemId: u, requestId: v, coverUrl: f, coverUri: h, coverUrlMap: e.commonAttr.coverUrlMap, downloadUri: g, downloadUrl: m, publishedItemId: p, width: y, height: b, }; })) && void 0 !== i ? i : [], { length: r } = n, a = 1, o = 4; return ( t && r < a ? n.push(v()) : !t && r < o && Array(o - r) .fill(0) .map((e) => v()), n ); } function g(e) { var t; return null !== (t = null == e ? void 0 : e.map((e) => { var { commonAttr: t } = null != e ? e : {}, { id: i = "" } = null != t ? t : {}; return { imageUri: "", itemId: i, requestId: "", coverUrl: "", coverUri: "", downloadUrl: "", downloadUri: "", publishedItemId: "", width: 100, height: 100, genResultData: e.genResultData, }; })) && void 0 !== t ? t : []; } function _(e, t) { var { isSuperResolution: i, hasPublished: n } = e, { hasPublishAuthority: r = !1 } = null != t ? t : {}, a = [ o.Zz.SuperResolute, o.Zz.SuperDefinition, o.Zz.Download, o.Zz.Reedit, o.Zz.Regenerate, o.Zz.PhotoReport, o.Zz.GenerateVideo, o.Zz.Delete, o.Zz.DeepSeek, o.Zz.BatchDelete, o.Zz.Favorites, o.Zz.ImagePostEdit, ], s = [ o.Zz.Download, o.Zz.SuperDefinition, o.Zz.SuperResolute, o.Zz.ZoomIn, o.Zz.Inpaint, o.Zz.Outpaint, o.Zz.PhotoReport, o.Zz.InPaintRemove, o.Zz.GenerateVideo, o.Zz.Reedit, o.Zz.Regenerate, o.Zz.Delete, o.Zz.DeepSeek, o.Zz.Favorites, o.Zz.ImagePostEdit, ]; return r && (s.push(o.Zz.Publish), a.push(o.Zz.Publish)), i ? s : a; } function y(e) { var t, i, { ret: n, isSuperResolution: r, publishParam: a } = e, s = { [l.b.ErrSuccess]: () => _(e, a), [l.b.ErrGenerate]: () => r ? [o.Zz.Delete] : [o.Zz.Reedit, o.Zz.Regenerate, o.Zz.Delete], [l.b.ErrPreTextRiskNotPass]: () => r ? [o.Zz.Delete] : [o.Zz.Reedit, o.Zz.Delete], }; return null !== (i = null === (t = s[n]) || void 0 === t ? void 0 : t.call(s)) && void 0 !== i ? i : s[l.b.ErrGenerate](); } function b(e, t, i, o) { var s, { prompt: l } = t, { aigcImageParams: c } = null != i ? i : {}; if (!!c) { var { inPaintingParams: d, outPaintingParams: u, inPaintingRemoveParams: f, byteEditParams: h, } = c, p = { generateType: e, prompt: l }, v = { [a.pi.InPaint]: () => { var { originItemId: e = "", maskUri: t, maskUrl: i, originPrompt: a = "", } = null != d ? d : {}; return (0, r._)((0, n._)({}, p), { itemId: e, maskUri: t, maskUrl: i, submitId: null != o ? o : "", originPrompt: a, }); }, [a.pi.InPaintRemove]: () => { var { originItemId: e = "", maskUri: t, maskUrl: i, } = null != f ? f : {}; return (0, r._)((0, n._)({}, p), { itemId: e, maskUri: t, maskUrl: i, submitId: null != o ? o : "", }); }, [a.pi.OutPaint]: () => { var { originItemId: e = "", upScale: t, originPrompt: i = "", } = null != u ? u : {}; return (0, r._)((0, n._)({}, p), { itemId: e, upScale: t, submitId: null != o ? o : "", originPrompt: i, }); }, [a.pi.InPaintAndOutPaint]: () => { var { maskUri: e, maskUrl: t } = null != d ? d : {}, { originItemId: i = "", upScale: a, originPrompt: s = "", } = null != u ? u : {}; return (0, r._)((0, n._)({}, p), { maskUri: e, maskUrl: t, itemId: i, upScale: a, submitId: null != o ? o : "", originPrompt: s, }); }, [a.pi.ByteEditPainting]: () => { var { uri: e, strength: t, originItemId: i = "", originPrompt: a = "", } = null != h ? h : {}; return (0, r._)((0, n._)({}, p), { originUri: e, strength: t, itemId: i, submitId: null != o ? o : "", originPrompt: a, }); }, }; return null === (s = v[e]) || void 0 === s ? void 0 : s.call(v); } } function I(e, t) { if (!!e && !!(null == t ? void 0 : t.length)) return { historyRecordId: e, itemList: t }; } function w(e, t) { var { aigcImageParams: i } = null != t ? t : {}, { inPaintingParams: n, inPaintingRemoveParams: r, outPaintingParams: o, byteEditParams: s, normalHdParams: l, superResolutionParams: c, } = null != i ? i : {}; return e === a.pi.InPaintRemove ? null == r ? void 0 : r.originItemId : e === a.pi.OutPaint ? null == o ? void 0 : o.originItemId : e === a.pi.ByteEditPainting ? null == s ? void 0 : s.originItemId : e === a.pi.InPaint || e === a.pi.InPaintAndOutPaint ? null == n ? void 0 : n.originItemId : e === a.pi.SuperDefinition ? null == l ? void 0 : l.originItemId : e === a.pi.SuperResolution ? null == c ? void 0 : c.originItemId : void 0; } function x(e) { return e < 946656e6 ? 1e3 * e : e; } function S(e, t, i, n) { var r, o, d, f, v, _, S, M, C, T, A, k, P, E, { generateId: D, generateType: R = a.pi.Text2Image, historyRecordId: N, createdTime: L, finishTime: j, ret: O, originHistoryRecordId: B, task: F, assetOption: U, status: G, submitId: z, metricsExtra: V, draftContent: W, modelInfo: Z, resources: K, failCode: H, forecastGenerateCost: q, forecastQueueCost: J, } = e, Y = null !== (_ = e.itemList) && void 0 !== _ ? _ : [], Q = null !== (S = e.failedItemList) && void 0 !== S ? S : [], X = null !== (M = e.originItemList) && void 0 !== M ? M : [], $ = x(null != L ? L : Date.now()), ee = x(null != j ? j : Date.now()), et = Number( null !== (C = null != O ? O : null == F ? void 0 : null === (r = F.respRet) || void 0 === r ? void 0 : r.ret) && void 0 !== C ? C : l.b.ErrSuccess ), ei = null !== (A = null !== (T = Y[0]) && void 0 !== T ? T : Q[0]) && void 0 !== A ? A : { aigcImageParams: null === (o = e.task) || void 0 === o ? void 0 : o.aigcImageParams, mode: n, blendParams: null === (f = e.task) || void 0 === f ? void 0 : null === (d = f.aigcImageParams) || void 0 === d ? void 0 : d.blendParams, }, { image: en } = ei, er = null !== (k = ei.aigcImageParams) && void 0 !== k ? k : null == F ? void 0 : F.aigcImageParams, { width: ea = 0, height: eo = 0 } = null !== (P = null == en ? void 0 : null === (v = en.largeImages) || void 0 === v ? void 0 : v[0]) && void 0 !== P ? P : {}, es = h(null != er ? er : {}, V), { text2imageParams: el, firstGenerateType: ec, generateId: ed, lastGenerate: eu, } = null != er ? er : {}, ef = Y.map((e) => e.commonAttr.hasPublished).includes(!0), eh = p(el, ea, eo), ep = u(R), ev = m(Y, ep), em = g(Q), eg = Y.map((e) => (0, s.Z)(e, N)), e_ = y({ ret: et, isSuperResolution: ep, hasPublished: ef, publishParam: i, hasFavorited: null !== (E = null == U ? void 0 : U.hasFavorited) && void 0 !== E && E, }), ey = b(R, eh, ei, null == F ? void 0 : F.submitId), eb = I(B, X), eI = (0, c.tA)(ei); Y.forEach((e) => { (e.blendParams = eI), (e.mode = n); }); var ew = w(R, ei); return { id: N, generateId: null != ed ? ed : D, generateType: R, firstGenerateType: ec, lastGenerate: eu, ret: et, historyRecordId: N, originItemId: ew, historyGroupKeyMd5: null == e ? void 0 : e.historyGroupKeyMd5, imageList: ev, photosDreamina: eg, costTime: t, reportParam: es, text2ImageParams: eh, blendImageParams: eI, isSuperResolution: ep, createdTime: $, finishTime: ee, sortCreateTime: $, operationAuthorityList: e_, publishParam: i, itemList: Y, failedImageList: em, paintingParam: ey, originRecord: eb, mode: n, assetOption: U, task: F, status: G, submitId: z, draftContent: W, modelInfo: Z, resources: K, failCode: H, isDraftGen: !!W, forecastGenerateCost: q, forecastQueueCost: J, }; } a.pi.Text2Image, a.pi.OutPaint, a.pi.Blend; var M = (e) => { switch (e) { case a.pi.Blend: return o.Z8.Blend; case a.pi.SuperDefinition: return o.Z8.SuperDefinition; case a.pi.InPaint: case a.pi.OutPaint: case a.pi.InPaintRemove: return o.Z8.Painting; case a.pi.Text2Image: default: return o.Z8.Text2Image; } }; }, 869409: function (e, t, i) { "use strict"; i.d(t, { Q: function () { return r; }, d: function () { return n; }, }); var n = (function (e) { return ( (e[(e.All = 0)] = "All"), (e[(e.Image = 1)] = "Image"), (e[(e.Video = 2)] = "Video"), (e[(e.Story = 3)] = "Story"), (e[(e.Canvas = 4)] = "Canvas"), (e[(e.VideoBGM = 5)] = "VideoBGM"), (e[(e.Audio = 6)] = "Audio"), (e[(e.VideoAudioEffect = 7)] = "VideoAudioEffect"), e ); })({}), r = (function (e) { return ( (e[(e.CreateAt = 0)] = "CreateAt"), (e[(e.ModifyAt = 1)] = "ModifyAt"), e ); })({}); }, 166320: function (e, t, i) { "use strict"; i.d(t, { Eu: function () { return n; }, ie: function () { return r; }, o$: function () { return a; }, }); var n = (function (e) { return ( (e[(e.Image = 1)] = "Image"), (e[(e.Video = 2)] = "Video"), (e[(e.Story = 3)] = "Story"), (e[(e.Canvas = 4)] = "Canvas"), (e[(e.VideoBGM = 5)] = "VideoBGM"), (e[(e.Audio = 6)] = "Audio"), (e[(e.VideoAudioEffect = 7)] = "VideoAudioEffect"), (e[(e.VimoItem = 100)] = "VimoItem"), e ); })({}), r = (function (e) { return ( (e[(e.FavoriteOpLike = 1)] = "FavoriteOpLike"), (e[(e.FavoriteOpUnLike = 2)] = "FavoriteOpUnLike"), e ); })({}), a = (function (e) { return ( (e[(e.Success = 0)] = "Success"), (e[(e.Failed = 1)] = "Failed"), (e[(e.InvalidAsset = 2)] = "InvalidAsset"), e ); })({}); }, 257843: function (e, t, i) { "use strict"; i.d(t, { K: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-assets-data-service"); }, 787205: function (e, t, i) { "use strict"; i.d(t, { $: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-commerce-data-service"); }, 834634: function (e, t, i) { "use strict"; i.d(t, { P: function () { return n; }, v: function () { return r; }, }); var n = (function (e) { return ( (e[(e.ISSUED = 1)] = "ISSUED"), (e[(e.CONSUMED = 2)] = "CONSUMED"), e ); })({}), r = (function (e) { return ( (e.VIP_ISSUED = "VIP_GIFT"), (e.DAILY_ISSUED = "FREEMIUM_RECEIVE"), (e.ONEOFF_PURCHASE = "ONE_OFF_PURCHASE"), (e.ACTIVITY_GIFT = "ACTIVITY_GIFT"), (e.GENERATE_VIDEO = "GENERATE_VIDEO"), (e.REFUND = "REFUND"), (e.INIT_DATA = "INIT_DATA"), (e.EMPTY = ""), e ); })({}); }, 804362: function (e, t, i) { "use strict"; i.d(t, { I: function () { return r; }, N: function () { return n; }, }); var n = (function (e) { return ( (e.UPGRADE = "UPGRADE"), (e.DOWNGRADE = "DOWNGRADE"), (e.LATERAL = "LATERAL"), e ); })({}), r = (function (e) { return ( (e.FREE_TRIAL = "free_trial"), (e.INTRO = "intro"), (e.PAY_UP_FRONT = "pay_up_front"), (e.MULTI_PROMOTE = "multi_promote"), e ); })({}); }, 416794: function (e, t, i) { "use strict"; i.d(t, { o: function () { return a; }, }); var n = /([a-zA-Z])(_)(\d)|(\d)(_|$)([a-zA-Z])/g; function r(e) { var t = e.replace(n, (e, t, i, n, r, a, o) => t && n ? t + n : r && o ? r + o : e ); return t.length !== e.length ? r(t) : t; } function a(e) { if ("object" == typeof e && null !== e) for (var t of Object.keys(e)) { var i = r(t); i !== t && !(i in e) && (e[i] = e[t]), "object" == typeof e[t] && a(e[t]); } } }, 265587: function (e, t, i) { "use strict"; i.d(t, { Q: function () { return y; }, }); var n = i(625572), r = i(639880), a = i(474956), o = i(820266), s = i(804274), l = i(936690), c = i(733787), d = i(830563), u = i(542994), f = i(416794), h = i(938678), p = i(243090), v = i(296194), m = i(117275), g = i(782650); function _(e) { var t = (0, o.b)((0, h.I)(e), s.zW); return ( t.videoGenInputs.forEach((e) => { if ( ((null === (i = e.i2vOpt) || void 0 === i ? void 0 : null === (t = i.realmanAvatar) || void 0 === t ? void 0 : t.ttsInfo) && (e.i2vOpt.realmanAvatar.ttsInfo = (0, o.b)( (0, p.D)( null === (h = e.i2vOpt) || void 0 === h ? void 0 : null === (f = h.realmanAvatar) || void 0 === f ? void 0 : f.ttsInfo ) )), (null === (s = e.v2vOpt) || void 0 === s ? void 0 : null === (a = s.lipSyncUserVideo) || void 0 === a ? void 0 : a.ttsInfo) && (e.v2vOpt.lipSyncUserVideo.ttsInfo = (0, o.b)( (0, p.D)(e.v2vOpt.lipSyncUserVideo.ttsInfo) )), null === (u = e.firstFrameImage) || void 0 === u ? void 0 : null === (d = u.aigcImage) || void 0 === d ? void 0 : null === (c = d.aigcImageParams) || void 0 === c ? void 0 : c.blendParams) ) { var t, i, a, s, c, d, u, f, h, v, g, { aigcImageParams: _ } = e.firstFrameImage.aigcImage; if ( !!(null == _ ? void 0 : null === (v = _.blendParams) || void 0 === v ? void 0 : v.abilityList) ) { var y = (0, m.o)({ prompt: (0, l.A1)(_), abilityList: null == _ ? void 0 : null === (g = _.blendParams) || void 0 === g ? void 0 : g.abilityList, promptPlaceholderInfoList: null == _ ? void 0 : _.blendParams.promptPlaceholderInfoList, }); (_.blendParams = (0, r._)((0, n._)({}, _.blendParams), { abilityList: y.abilityList, promptPlaceholderInfoList: y.promptPlaceholderInfoList, })), (0, l.V8)(_, y.prompt); } } }), t ); } var y = (e, t) => { var i, l, p, m, y, b, I, w, x, S = (0, h.I)(e); (0, f.o)(S), (0, g.jc)(S), (S.video.transcoded_video = (0, v.Z)( S.video.transcoded_video, (e, t) => /^\d+_p$/.test(t) )); var M = (0, u.T)(S, a._g.DreaminaAiVideo), { aigc_image_params: C, statistic: T } = S, A = null !== (m = null !== (p = null !== (l = null !== (i = S.video.transcoded_video["720p"]) && void 0 !== i ? i : S.video.transcoded_video["360p"]) && void 0 !== l ? l : S.video.transcoded_video.origin) && void 0 !== p ? p : t) && void 0 !== m ? m : S.video.origin_video, k = Object.keys( null !== (y = S.video.transcoded_video) && void 0 !== y ? y : {} ), P = null == C ? void 0 : C.text2video_params, E = null == C ? void 0 : C.generate_type, D = P ? _(P) : { videoGenInputs: [], seed: 0, videoAspectRatio: c.py.VideoAspectRatioType_16_9, }, R = null == C ? void 0 : C.publish_opt; return ( R && (b = { publicCloneVoice: R.public_clone_voice, publicUserAudio: R.public_user_audio, }), (0, r._)((0, n._)({}, M), { generateType: E, publishedItemId: S.common_attr.published_item_id, author: S.author ? { avatar: S.author.avatar_url, name: S.author.name, uid: S.author.uid, secUid: S.author.sec_uid, } : { avatar: "", name: "", uid: "", secUid: "" }, video: { duration: S.video.duration, durationMs: BigInt(S.video.duration_ms), watermarkType: S.video.watermark_type, originVideo: A && { definition: A.definition, format: A.format, height: A.height, size: A.size, width: A.width, videoUrl: A.video_url, }, videoTranscodeInfo: k.reduce((e, t) => { var i, a, o = null !== (a = null === (i = S.video.transcoded_video) || void 0 === i ? void 0 : i[t]) && void 0 !== a ? a : {}, s = (0, r._)((0, n._)({}, e), { videoUrl: o.video_url }); return (0, r._)((0, n._)({}, e), { [t]: s }); }, {}), videoId: S.video.video_id, transcodeStatus: S.video.transcode_status, videoSizeType: S.video.video_size_type, }, fixedVdaStatus: S.video.vda_status === d.X.Encoding && k.length ? d.X.EncodeSuccess : S.video.vda_status, aigcVideoParam: (0, r._)((0, n._)({}, D), { publishOpt: b }), genVideoParams: D, statistic: { usageNum: null !== (I = T.usage_num) && void 0 !== I ? I : 0, hasFavorited: null !== (w = T.has_favorited) && void 0 !== w && w, favoriteNum: null !== (x = T.favorite_num) && void 0 !== x ? x : 0, }, coverUrlMap: S.common_attr.cover_url_map, categoryIdList: S.category_id_list, actData: S.act_data ? { weeklyChallengeList: S.act_data.weekly_challenge_list.map( (e) => { var { act_key: t, act_name: i, award_ranking: n } = e; return { actKey: t, actName: i, awardRanking: n }; } ), } : void 0, competitionData: S.competition_data ? { competitionKey: S.competition_data.competition_key, competitionTitle: S.competition_data.competition_title, award: S.competition_data.award, } : void 0, shortVideoData: S.short_video_data ? { aiTools: S.short_video_data.ai_tools, storyId: S.short_video_data.story_id, downloadable: S.short_video_data.downloadable, } : void 0, requestId: S.request_id, impressionId: S.request_id, publishOpt: b, videoTemplateItem: (0, o.b)(S.video_template_item, s.zW), }) ); }; }, 473877: function (e, t, i) { "use strict"; i.d(t, { EV: function () { return r; }, iF: function () { return n; }, sW: function () { return a; }, }); var n = (function (e) { return ( (e.INIT = "init"), (e.PROCESSING = "processing"), (e.SUCCESS = "success"), (e.FAILED = "failed"), e ); })({}), r = (function (e) { return ( (e.UNAUTO = "unauto"), (e.CONSUMABLES = "consumables"), (e.ONEOFF = "oneoff"), (e.SUBSCRIPTION = "subscription"), e ); })({}), a = (function (e) { return ( (e.INIT = "INIT"), (e.SUBMITTED = "SUBMITTED"), (e.SUCCESS = "SUCCESS"), (e.CLOSED = "CLOSED"), e ); })({}); }, 304483: function (e, t, i) { "use strict"; i.d(t, { fJ: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-pay-data-service"); }, 882644: function (e, t, i) { "use strict"; i.d(t, { w: function () { return r; }, z: function () { return n; }, }); var n = (function (e) { return ( (e[(e.Unknown = 0)] = "Unknown"), (e[(e.AIGCHistory = 1)] = "AIGCHistory"), (e[(e.EverPhoto = 2)] = "EverPhoto"), e ); })({}), r = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.Fail = 30)] = "Fail"), (e[(e.FinalSuccess = 50)] = "FinalSuccess"), (e[(e.Processing = 60)] = "Processing"), e ); })({}); }, 657600: function (e, t, i) { "use strict"; i.d(t, { _: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-story-export-materials-data-service"); }, 749314: function (e, t, i) { "use strict"; i.d(t, { l: function () { return n; }, }); var n = (function (e) { return ( (e[(e.Preset = 109)] = "Preset"), (e[(e.Custom = 214)] = "Custom"), e ); })({}); }, 201636: function (e, t, i) { "use strict"; i.d(t, { BQ: function () { return o; }, I: function () { return r; }, X0: function () { return n; }, dP: function () { return s; }, oH: function () { return a; }, }); var n = (function (e) { return ( (e[(e.VoiceAdd = 1)] = "VoiceAdd"), (e[(e.VoiceConversion = 2)] = "VoiceConversion"), e ); })({}), r = (function (e) { return ( (e[(e.Init = 0)] = "Init"), (e[(e.Processing = 10)] = "Processing"), (e[(e.Success = 20)] = "Success"), (e[(e.Fail = 30)] = "Fail"), e ); })({}), a = (function (e) { return ( (e[(e.Loki = 1)] = "Loki"), (e[(e.Local = 2)] = "Local"), (e[(e.Template = 3)] = "Template"), e ); })({}), o = (function (e) { return ( (e[(e.Generating = 1)] = "Generating"), (e[(e.Success = 2)] = "Success"), (e[(e.Fail = 3)] = "Fail"), e ); })({}), s = (function (e) { return (e[(e.CloneVoice = 218)] = "CloneVoice"), e; })({}); }, 573293: function (e, t, i) { "use strict"; i.d(t, { S: function () { return n; }, }); var n = (0, i(333597).yh)("experiment-service"); }, 871770: function (e, t, i) { "use strict"; i.d(t, { fQ: () => I, dF: () => w }); var n = i("333597"), r = i("139646"), a = i("625572"), o = i("639880"), s = i("643590"), l = i("904337"), c = i("416105"), d = i("804274"), u = i("453604"), f = i("875649"), h = i("879976"); function p() { var e = new s.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return ( (0, h.V)(e), (0, l.$)(e), (0, c.mH)(e), (0, d.xP)(e), (0, u.d)(e), (0, f.i3)(e), e ); } var v = i("940140"), m = { getRecognizeFace: { hostNameType: v.b_.Default, url: "/mweb/v1/face_recognize", }, getSaliencySEG: { hostNameType: v.b_.Default, url: "/mweb/v1/saliency_seg", }, generateBlendPreview: { HostNameType: v.b_.Default, url: "/mweb/v1/blend_preview", }, poseDetect: { HostNameType: v.b_.Default, url: "/mweb/v1/pose_detect", }, }, g = i("586315"), _ = i("712942"), y = i("100470"); class b { getFaceRecognize(e, t) { var i = this; return (0, r._)(function* () { return yield i._request( "".concat((0, _.H4)()).concat(m.getRecognizeFace.url), e, t, !0 ); })(); } _request(e, t, i) { var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], s = this; return (0, r._)(function* () { var r = Date.now(); try { var { data: l, logid: c } = yield s._networkClient.post(e, t, { params: (0, o._)((0, a._)({}, null != i ? i : {}), { needCache: n, }), }); return { response: (0, g.oW)(l), costTime: Date.now() - r, logId: c, }; } catch (e) { var { ret: d, errmsg: u = "", logid: f = "" } = e || {}, h = d ? Number(d) : y.b.ErrCommon, p = JSON.stringify({ errMsg: u, logId: f }); return { response: (0, g.wf)(h, p), costTime: Date.now() - r, logId: f, }; } })(); } getSaliencySEG(e, t) { var i = this; return (0, r._)(function* () { return yield i._request( "".concat((0, _.H4)()).concat(m.getSaliencySEG.url), e, t, !0 ); })(); } generateBlendPreview(e, t) { var i = this; return (0, r._)(function* () { return yield i._request( "".concat((0, _.H4)()).concat(m.generateBlendPreview.url), e, t ); })(); } poseDetect(e, t) { var i = this; return (0, r._)(function* () { return yield i._request( "".concat((0, _.H4)()).concat(m.poseDetect.url), e, t ); })(); } constructor() { this._networkClient = p(); } } var I = (0, n.yh)("mWeb-graphic-tool-service"); class w { get graphicTool() { return this._graphicTool; } constructor() { this._graphicTool = new b(); } } }, 417281: function (e, t, i) { "use strict"; i.d(t, { D3: function () { return d; }, G7: function () { return a; }, Ij: function () { return h; }, OC: function () { return l; }, Ti: function () { return o; }, U0: function () { return s; }, UI: function () { return r; }, hD: function () { return u; }, iB: function () { return f; }, kR: function () { return n; }, qB: function () { return c; }, }); var n = (function (e) { return ( (e.ControlNetCanny = "canny"), (e.ControlNetDepth = "depth"), (e.ControlNetPose = "pose"), (e.ControlNetBgPaint = "bgpaint"), e ); })({}), r = (function (e) { return ( (e.ByteEdit = "byte_edit"), (e.Text2image = "text2image"), (e.FaceGan = "face_gan"), (e.BgPaint = "bg_paint"), (e.BasicBlend = "fuzz_blend"), (e.Image2image = "image2image"), (e.ControlNet = "control_net"), (e.StyleReference = "style_reference"), (e.IpKeep = "ip_keep"), (e.StyleCode = "style_code"), (e.Unknown = ""), e ); })({}); function a(e) { return "face_gan" === e.name; } function o(e) { return "bg_paint" === e.name; } function s(e) { return "control_net" === e.name; } function l(e) { return "image2image" === e.name; } function c(e) { return "ip_keep" === e.name; } function d(e) { return "style_reference" === e.name; } function u(e) { return "byte_edit" === e.name; } function f(e) { return "style_code" === e.name; } var h = "img2img_xl_sft"; }, 923810: function (e, t, i) { "use strict"; i.d(t, { v: function () { return r; }, }); var n = i(940140), r = { removeHistory: { hostNameType: n.b_.Default, url: "/mweb/v1/remove_history", }, getHistoryById: { hostNameType: n.b_.Default, url: "/mweb/v1/get_history_by_id", }, getHistoryByIds: { hostNameType: n.b_.Default, url: "/mweb/v1/get_history_by_ids", }, getLocalItemList: { hostNameType: n.b_.Default, url: "/mweb/v1/get_local_item_list", }, }; }, 173590: function (e, t, i) { "use strict"; i.d(t, { m: () => v, T: () => m }); var n = i("139646"), r = i("586315"), a = i("643590"), o = i("416105"), s = i("804274"), l = i("875649"), c = i("879976"); function d() { var e = new a.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return (0, c.V)(e), (0, o.mH)(e), (0, s.xP)(e), (0, l.e_)(e), e; } var u = i("923810"), f = i("712942"), h = i("100470"); class p { removeHistory(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.v.removeHistory.url); return yield t._request(i, e); })(); } getHistoryById(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.v.getHistoryById.url); return yield t._request(i, { historyId: e }); })(); } getHistoryByIds(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.v.getHistoryByIds.url); return yield t._request(i, { historyIds: e }); })(); } getHistoryBySubmitIds(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.v.getHistoryByIds.url); return yield t._request(i, { submitIds: e }); })(); } getLocalItemList(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.v.getLocalItemList.url); return yield t._request(i, { itemIdList: e }); })(); } _request(e, t) { var i = this; return (0, n._)(function* () { try { var n = yield i._networkClient.post(e, t); return (0, r.oW)(n); } catch (e) { var { errNo: a, errTips: o } = e || {}, s = a ? Number(a) : h.b.ErrCommon; return (0, r.wf)(s, null != o ? o : "unknown error"); } })(); } constructor() { this._networkClient = d(); } } var v = (0, i("333597").yh)("mWeb-history-service"); class m { get repository() { return this._repository; } constructor() { this._repository = new p(); } } }, 748312: function (e, t, i) { "use strict"; i.d(t, { Z: () => _, N: () => y }); var n = i("333597"), r = i("139646"), a = i("643590"), o = i("416105"), s = i("804274"), l = i("875649"), c = i("879976"); function d() { var e = new a.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return (0, c.V)(e), (0, o.mH)(e), (0, s.xP)(e), (0, l.e_)(e), e; } var u = i("940140"), f = { getUnreadCount: { hostNameType: u.b_.Default, url: "/mweb/v1/get_unread_count", }, getNoticeList: { hostNameType: u.b_.Default, url: "/mweb/v1/get_notice_list", }, }, h = i("586315"), p = i("712942"), v = i("100470"), m = i("242089"); class g { getUnreadCount(e) { var t = this; return (0, r._)(function* () { return yield t._request( "".concat((0, p.H4)()).concat(f.getUnreadCount.url), e ); })(); } getNoticeList(e) { var t = this; return (0, r._)(function* () { var i = "".concat((0, p.H4)()).concat(f.getNoticeList.url), n = "".concat(i, "_").concat(e.noticeType); return yield (0, m.O)(n, () => t._request(i, e)); })(); } _request(e, t) { var i = this; return (0, r._)(function* () { try { var n = yield i._networkClient.post(e, t); return (0, h.oW)(n); } catch (e) { var { ret: r, errmsg: a } = e || {}, o = r ? Number(r) : v.b.ErrCommon; return (0, h.wf)(o, null != a ? a : "unknown error"); } })(); } constructor() { this._networkClient = d(); } } var _ = (0, n.yh)("mWeb-notice-service"); class y { get noticeRepository() { return this._noticeRepository; } constructor() { this._noticeRepository = new g(); } } }, 81612: function (e, t, i) { "use strict"; i.d(t, { m: () => v, x: () => m }); var n = i("139646"), r = i("586315"), a = i("643590"), o = i("416105"), s = i("804274"), l = i("875649"), c = i("879976"); function d() { var e = new a.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return (0, c.V)(e), (0, o.mH)(e), (0, s.xP)(e), (0, l.i3)(e), e; } var u = { photoReport: { hostNameType: i("940140").b_.Default, url: "/mweb/v1/add_report", }, }, f = i("712942"), h = i("100470"); class p { reportPhoto(e) { var t = this; return (0, n._)(function* () { var i = "".concat((0, f.H4)()).concat(u.photoReport.url); return yield t._request(i, e); })(); } _request(e, t) { var i = this; return (0, n._)(function* () { try { return yield i._networkClient.post(e, t), (0, r.ly)(); } catch (e) { var { errNo: n, errTips: a } = e || {}, o = n ? Number(n) : h.b.ErrCommon; return (0, r.wf)(o, null != a ? a : "unknown error"); } })(); } constructor() { this._networkClient = d(); } } var v = (0, i("333597").yh)("mWeb-photo-report-service"); class m { get repository() { return this._repository; } constructor() { this._repository = new p(); } } }, 104170: function (e, t, i) { "use strict"; i.d(t, { $: function () { return r; }, u: function () { return n; }, }); var n = (function (e) { return (e[(e.Like = 1)] = "Like"), (e[(e.Unlike = 2)] = "Unlike"), e; })({}), r = (function (e) { return ( (e[(e.Image = 9)] = "Image"), (e[(e.Video = 53)] = "Video"), (e[(e.Collection = 109)] = "Collection"), (e[(e.TextArt = 116)] = "TextArt"), (e[(e.Canvas = 211)] = "Canvas"), e ); })({}); }, 85952: function (e, t, i) { "use strict"; i.d(t, { p: function () { return n; }, }); var n = (0, i(333597).yh)("mWeb-production-service"); }, 230467: function (e, t, i) { "use strict"; i.d(t, { j: () => w }); var n = i("139646"), r = i("789786"), a = i("366103"), o = i("643590"), s = i("416105"), l = i("804274"), c = i("453604"), d = i("875649"), u = i("879976"); function f() { var e = new o.y().build({ headers: { "Content-Type": "application/json" }, withCredentials: !0, }); return ( (0, u.V)(e), (0, s.mH)(e), (0, l.xP)(e), (0, c.d)(e), (0, d.e_)(e), e ); } var h = i("940140"), p = { getEnableList: { hostNameType: h.b_.Default, url: "/lv/v1/user/get_enable_list", }, getInviteStatus: { hostNameType: h.b_.Default, url: "/mweb/v1/get_invite_status", }, postAuthorMarkupInviteCode: { hostNameType: h.b_.Default, url: "/mweb/v1/author_markup", }, getUserInfo: { hostNameType: h.b_.Default, url: "/mweb/v1/get_user_info", }, getUgRegisteredInfo: { hostNameType: h.b_.Default, url: "/mweb/v1/get_ug_info", }, updateUserInfo: { hostNameType: h.b_.Default, url: "/lv/v1/user/update", }, getBlockStatus: { hostNameType: h.b_.Default, url: "/mweb/v1/block" }, getFollowList: { hostNameType: h.b_.Default, url: "/mweb/v1/get_follow_list", }, postFeelGoodRecord: { hostNameType: h.b_.Default, url: "/lv/v1/user/feel_good", }, }, v = i("586315"), m = i("242089"), g = i("712942"), _ = i("100470"), y = i("949274"), b = i("280166"), I = i("917598"); class w { getEnableList() { var e = this; return (0, n._)(function* () { var t = "".concat((0, g.H4)()).concat(p.getEnableList.url); return yield (0, m.O)(t, () => e._request(t, {}, { params: { needCache: !0 } })); })(); } getUgRegisteredInfo() { var e = this; return (0, n._)(function* () { var t = "".concat((0, g.H4)()).concat(p.getUgRegisteredInfo.url); return yield (0, m.O)(t, () => e._request(t)); })(); } getInviteStatus() { var e = this; return (0, n._)(function* () { var t = "".concat((0, g.Ab)()).concat(p.getInviteStatus.url); return yield (0, m.O)(t, () => e._request(t)); })(); } getBlockStatus() { var e = this; return (0, n._)(function* () { return yield e._request( "".concat((0, g.Ab)()).concat(p.getBlockStatus.url) ); })(); } postAuthorMarkupInviteCode(e) { var t = this; return (0, n._)(function* () { return yield t._request( "".concat((0, g.H4)()).concat(p.postAuthorMarkupInviteCode.url), e ); })(); } getUserInfo(e) { var t = this; return (0, n._)(function* () { return yield t._request( "".concat((0, g.H4)()).concat(p.getUserInfo.url), e ); })(); } updateUserInfo(e) { var t = this; return (0, n._)(function* () { try { var i, n, r = yield t._networkClient.post( "".concat((0, g.H4)()).concat(p.updateUserInfo.url), e, { headers: { appid: null !== (n = null === (i = t._environmentService) || void 0 === i ? void 0 : i.appId) && void 0 !== n ? n : I.L2, }, } ); return (0, v.oW)(r); } catch (e) { var { ret: o, errmsg: s } = e || {}, l = o ? Number(o) : _.b.ErrCommon, c = s; if (l === a.Ou.reviewing) c = y.ZP.t( "information_toast_last_in_check", {}, "\u66F4\u65B0\u5931\u8D25,\u8BF7\u7B49\u5F85\u4E0A\u6B21\u8D44\u6599\u5BA1\u6838\u901A\u8FC7" ); else c = y.ZP.t( "result_toast_abnormal_retry", {}, "Something went wrong. Try again later." ); return (0, v.wf)(l, c); } })(); } _request(e, t, i) { var r = this; return (0, n._)(function* () { try { var n = yield r._networkClient.post(e, t, i); return (0, v.oW)(n); } catch (e) { var { ret: a, errmsg: o } = e || {}, s = a ? Number(a) : _.b.ErrCommon; return (0, v.wf)(s, null != o ? o : "unknown error"); } })(); } getFollowList(e) { var t = this; return (0, n._)(function* () { return yield t._request( "".concat((0, g.H4)()).concat(p.getFollowList.url), e ); })(); } setSubmitRecord(e) { var t = this; return (0, n._)(function* () { var i = (0, g.H4)(), n = "".concat(i).concat(p.postFeelGoodRecord.url); return yield t._request(n, { type: a.$B.Set, questionnaireIds: e.questionnaireIds, }); })(); } getSubmitRecord(e) { var t = this; return (0, n._)(function* () { var i = (0, g.H4)(), n = "".concat(i).concat(p.postFeelGoodRecord.url), r = yield t._request(n, { type: a.$B.Get, questionnaireIds: e.questionnaireIds, }); return ( r.ok && (r.value.hasFinishQuestionnaireMap = (0, l.fs)( r.value.hasFinishQuestionnaireMap, l.D1 )), r ); })(); } constructor(e) { (this._environmentService = e), (this._networkClient = f()); } } w = (0, r.gn)( [ (0, r.fM)(0, b.Y), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [void 0 === b.Y ? Object : b.Y]), ], w ); }, 758261: function (e, t, i) { "use strict"; i.d(t, { h: () => h, P: () => p }); var n = i("139646"), r = i("789786"), a = i("333597"), o = i("575588"), s = i("230467"), l = i("224671"), c = i("366103"), d = [l.$7.PublishImage, l.$7.PublishVideo, l.$7.PublishCanvas]; class u { getHasMWebUseAuthority() { var e = this; return (0, n._)(function* () { var t = yield e._userRepository.getInviteStatus(); return !!t.ok && t.value.inviteStatus === c.sN.BIND; })(); } getHasPublishAuthority() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : d, t = this; return (0, n._)(function* () { if ( [] .concat(e) .every((e) => [l.$7.PublishVideo, l.$7.PublishImage].includes(e) ) ) return !0; var i = yield t._userRepository.getEnableList(); return ( !!i.ok && [] .concat(e) .some((e) => i.value.enableList.some( (t) => t.whitelistType === e && t.isEnable ) ) ); })(); } isDreaminaPublisher() { var e = this; return (0, n._)(function* () { var t = yield e._userRepository.getEnableList(); if (t.ok) { var i = !1; return ( t.value.enableList.forEach((e) => { e.isEnable && d.includes(e.whitelistType) && (i = !0); }), i ); } return !1; })(); } constructor(e) { this._userRepository = e; } } var f = i("14606"), h = (0, a.yh)("mWeb-user-service"); class p { get repository() { return this._repository; } get aggregate() { return this._aggregate; } getDreaminaUserInfo() { var e = this; return (0, n._)(function* () { var t = yield e._commonConfigService.aggregate.getCommonConfigByKey( "secUid", !0 ); if (!t) throw Error(); return e.repository.getUserInfo({ secUid: t }); })(); } getIsInternalNet() { var e = this; return (0, n._)(function* () { var t = yield e._commonConfigService.repository.getCommonConfig(!1); if (t.ok) return t.value.isInternal; throw Error(t.msg); })(); } constructor(e, t) { (this._instantiationService = e), (this._commonConfigService = t), (this._repository = this._instantiationService.createInstance(s.j)), (this._aggregate = new u(this._repository)); } } p = (0, r.gn)( [ (0, r.fM)(0, o.T), (0, r.fM)(1, f.A), (0, r.w6)("design:type", Function), (0, r.w6)("design:paramtypes", [ void 0 === o.T ? Object : o.T, void 0 === f.A ? Object : f.A, ]), ], p ); }, 588735: function (e, t, i) { "use strict"; i.d(t, { Ix: function () { return r; }, sQ: function () { return o; }, sb: function () { return a; }, wd: function () { return n; }, }); var n = (function (e) { return ( (e[(e.Normal = 0)] = "Normal"), (e[(e.Like = 1)] = "Like"), (e[(e.Dislike = 2)] = "Dislike"), e ); })({}), r = (function (e) { return (e[(e.Like = 1)] = "Like"), (e[(e.UnLike = 2)] = "UnLike"), e; })({}), a = (function (e) { return ( (e[(e.Pending = -1)] = "Pending"), (e[(e.Success = 0)] = "Success"), (e[(e.RateLimit = 1)] = "RateLimit"), (e[(e.NotInvited = 2)] = "NotInvited"), (e[(e.NoCredit = 3)] = "NoCredit"), (e[(e.TnsNotPass = 4)] = "TnsNotPass"), (e[(e.ErrPunishLimitAIGenerate = 1018)] = "ErrPunishLimitAIGenerate"), (e[(e.ErrSharkNotPass = 1019)] = "ErrSharkNotPass"), (e[(e.VideoNoAudioEffectGenerate = 4007)] = "VideoNoAudioEffectGenerate"), (e[(e.ErrRateLimitForNonCommercialRegion = 10020)] = "ErrRateLimitForNonCommercialRegion"), e ); })({}), o = (function (e) { return ( (e[(e.ImageSecurityBlock = 2039)] = "ImageSecurityBlock"), (e[(e.ImageCopyrightBlock = 2048)] = "ImageCopyrightBlock"), (e[(e.TextSecurityBlock = 2038)] = "TextSecurityBlock"), (e[(e.TextCopyrightBlock = 2050)] = "TextCopyrightBlock"), (e[(e.VideoSecurityBlock = 2042)] = "VideoSecurityBlock"), (e[(e.AudioSecurityBlock = 2044)] = "AudioSecurityBlock"), (e[(e.SecurityNotRetry = 2043)] = "SecurityNotRetry"), (e[(e.SecurityNotPass = 2035)] = "SecurityNotPass"), (e[(e.ExternalNoCredits = 4001)] = "ExternalNoCredits"), (e[(e.VideoTemplateImageNotMatch = 4107)] = "VideoTemplateImageNotMatch"), (e[(e.ICDetectVideoNoAvailablePerson = 4101)] = "ICDetectVideoNoAvailablePerson"), (e[(e.ICDetectVideoSizeTooSmall = 4102)] = "ICDetectVideoSizeTooSmall"), (e[(e.ICDetectVideoSizeTooLarge = 4103)] = "ICDetectVideoSizeTooLarge"), (e[(e.ICDetectVideoDurationTooShort = 4104)] = "ICDetectVideoDurationTooShort"), (e[(e.ICDetectVideoDurationTooLong = 4105)] = "ICDetectVideoDurationTooLong"), (e[(e.ICDetectVideoScaleError = 4106)] = "ICDetectVideoScaleError"), (e[(e.RateLimit = 1057)] = "RateLimit"), (e[(e.InputAudioContainEnglishContent = 2056)] = "InputAudioContainEnglishContent"), e ); })({}); }, 675601: function (e, t, i) { "use strict"; i.d(t, { g: function () { return n; }, }); var n = (0, i(333597).yh)("dreamina-video-generate-data-service"); }, 971745: function (e, t, i) { "use strict"; i.d(t, { $: function () { return a; }, }); var n = i(591586), r = i(172834); class a { _getDraft() { var e = new r.DADraft(); if (this._sourceDraftContent) { for ( var t = function (e) { var t = i.componentList.find((t) => t.id === e); if (!t) return "break"; n.unshift(t), (a = t.parentId); }, i = new r.DADraft({ JSONString: this._sourceDraftContent }), n = [], a = i.mainComponentId, o = a; o && "break" !== t(o); o = a ); this._isReplaceMain && n.pop(), n.forEach((t) => { e.setMainComponent(t); }); } return e.setMainComponent(this._mainComponent), e; } _getMetadata() { var e = new r.DADraftMetadata(); return ( (e.createdPlatform = r.DADraftCreatedPlatform.WEB), (e.createdTimeInMs = Date.now().toString()), e ); } constructor(e) { if ( ((this._submitId = e.submitId), (this._templateId = e.templateId), (this._subTemplateId = e.subTemplateId), (this._sourceDraftContent = e.draftContent), (this._isReplaceMain = e.isRegenerate), e.reportParam) ) try { this._metricsExtra = JSON.stringify(e.reportParam); } catch (e) { n.t.error( "ParamsConverter: ".concat( this.constructor.name, " JSON.stringify error" ), e ); } (this._mainComponent = this.getComponent(e)), (this._mainComponent.metaData = this._getMetadata()); } } }, 868144: function (e, t, i) { "use strict"; i.d(t, { BB: function () { return s; }, qb: function () { return l; }, sc: function () { return o; }, }); var n = i(128468), r = i(733787), a = i(172834), o = { [n.JU.Workbench]: a.DAAIGCMode.workbench, [n.JU.Canvas]: a.DAAIGCMode.canvas, [n.JU.Character]: a.DAAIGCMode.character, [n.JU.Story]: a.DAAIGCMode.story, [n.JU.AIGCDraft]: a.DAAIGCMode.aigcDraft, [n.JU.PostEditor]: a.DAAIGCMode.postEditor, [n.JU.CreationAgent]: a.DAAIGCMode.creationAgent, }; function s(e) { return Object.entries(r.IM) .map((t) => { var [i, n] = t; return { key: i, diff: Math.abs(e - n) }; }) .sort((e, t) => e.diff - t.diff)[0].key; } function l() { return Math.floor(0x7fffffff * Math.random()); } }, 106621: function (e, t, i) { "use strict"; i.d(t, { C: function () { return p; }, }); var n = i(54969), r = i(868144), a = i(172834), o = i(128468), s = i(803188), l = i(872432), c = i(593233), d = i(384295), u = i(675679), f = i(43637); class h { convert() { var e, t, { abilities: i, ability: n, v2vOpt: r, textToVideoParams: a, } = (0, s.$O)(), o = (0, l.e)(this._params.input.videoGenInputs); return ( (a.videoGenInputs = [o]), (a.modelReqKey = this._params.input.modelReqKey), (a.videoAspectRatio = this._params.input.videoAspectRatio), (o.originHistoryId = this._params.originHistoryId), (o.v2vOpt = r), (r.insertFrame = (0, c.I)( null === (e = this._params.input.videoGenInputs.v2vOpt) || void 0 === e ? void 0 : e.insertFrame )), (r.avMix = (0, d.j)( null === (t = this._params.input.videoGenInputs.v2vOpt) || void 0 === t ? void 0 : t.avMix )), (n.scene = this._params.scene), (n.videoTaskExtra = (0, u.a)(this._params.taskPayload.taskExtra)), (n.videoRefParams = (0, f.o)(this._params)), i ); } constructor(e) { this._params = e; } } class p extends n.l { getComponent(e) { var t, i, n = new a.DAVideoBaseComponent(); return ( (n.generateType = a.DAVideoGenerateType.genVideo), (n.aigcMode = null !== (i = r.sc[ null !== (t = e.mode) && void 0 !== t ? t : o.JU.Workbench ]) && void 0 !== i ? i : a.DAAIGCMode.workbench), (n.abilities = new h(e).convert()), (n.processType = a.DAVideoProcessType.InsertFrame), n ); } } }, 611422: function (e, t, i) { "use strict"; i.d(t, { F: function () { return v; }, }); var n = i(625572), r = i(54969), a = i(868144), o = i(172834), s = i(324319), l = i(913390), c = i(599045), d = i(43212), u = i(763217), f = i(770449), h = i(128468); class p { convert() { var { v2vOpt: e, i2vOpt: t } = this._params.input.videoGenInputs, i = null == e ? void 0 : e.lipSyncUserVideo, r = null == t ? void 0 : t.realmanAvatar, h = null != i ? i : r, p = null == h ? void 0 : h.ttsInfo, v = (0, s.mi)(p), m = new o.DAVideoGenerateAbilities(); (m.lipSync = v), (v.audio = (0, l.i)( { videoId: null !== (b = null == h ? void 0 : null === (_ = h.originAudio) || void 0 === _ ? void 0 : _.vid) && void 0 !== b ? b : "", duration: null !== (I = null == h ? void 0 : null === (y = h.originAudio) || void 0 === y ? void 0 : y.duration) && void 0 !== I ? I : 0, }, { sourceFrom: (null == p ? void 0 : p.sourceType) === c.M.LocalFile ? o.DAResourceSourceFrom.upload : o.DAResourceSourceFrom.produced, name: (0, s.IM)(p), } )); var { videoMode: g } = this._params.input.videoGenInputs; if (i) { var _, y, b, I, w, x, S, M, C, { audioBeforeConversion: T } = i; (v.referenceType = o.DALipSyncReferenceType.video), (v.video = (0, d.E)(i.originVideo)), (v.mode = null !== (S = (0, u.M)(g)) && void 0 !== S ? S : o.DALipSyncMode.standard), (v.supportedModes = null !== (M = null === (x = i.supportedModes) || void 0 === x ? void 0 : null === (w = x.map(u.M)) || void 0 === w ? void 0 : w.filter((e) => void 0 !== e)) && void 0 !== M ? M : [o.DALipSyncMode.standard]), (v.audioBeforeConversion = (0, l.i)( (0, n._)( { videoId: null !== (C = null == T ? void 0 : T.vid) && void 0 !== C ? C : "", }, T ) )); } if (r) { var A, k, P, E, { audioBeforeConversion: D } = r; (v.referenceType = o.DALipSyncReferenceType.image), (v.image = (0, f.QL)(r.originImage)), (v.mode = (0, u.M)(g)), (v.audioBeforeConversion = (0, l.i)( (0, n._)( { videoId: null !== (P = null == D ? void 0 : D.vid) && void 0 !== P ? P : "", }, D ) )), (v.supportedModes = null === (k = null !== (E = r.supportedModes) && void 0 !== E ? E : [g]) || void 0 === k ? void 0 : null === (A = k.map(u.M)) || void 0 === A ? void 0 : A.filter((e) => void 0 !== e)); } return (v.seed = (0, a.qb)().toString()), m; } constructor(e) { this._params = e; } } class v extends r.l { getComponent(e) { var t, i, n = new o.DAVideoBaseComponent(); return ( (n.generateType = o.DAVideoGenerateType.lipSync), (n.aigcMode = null !== (i = a.sc[ null !== (t = e.mode) && void 0 !== t ? t : h.JU.Workbench ]) && void 0 !== i ? i : o.DAAIGCMode.workbench), (n.abilities = new p(e).convert()), n ); } } }, 724196: function (e, t, i) { "use strict"; i.d(t, { D: function () { return m; }, }); var n = i(625572), r = i(54969), a = i(868144), o = i(172834), s = i(324319), l = i(869919), c = i(913390), d = i(599045), u = i(43212), f = i(763217), h = i(43637), p = i(128468); class v { convert() { var e, t, i, r, p, v, m, g = null === (e = this._params.input.videoGenInputs.v2vOpt) || void 0 === e ? void 0 : e.lipSync, _ = null == g ? void 0 : g.ttsInfo, y = new o.DAVideoGenerateAbilities(), b = (0, s.mi)(_); (y.lipSync = b), (b.referenceType = o.DALipSyncReferenceType.aiVideo); var { videoMode: I } = this._params.input.videoGenInputs, w = null === (t = this._params.input.videoGenInputs.v2vOpt) || void 0 === t ? void 0 : t.avMix; return ( w && (w.scene === l.zk.AudioEffect ? (b.videoEffectAudio = (0, c.i)( { videoId: w.audioVid }, { sourceFrom: o.DAResourceSourceFrom.produced } )) : (b.videoBgmAudio = (0, c.i)( { videoId: w.audioVid }, { sourceFrom: o.DAResourceSourceFrom.produced } ))), g && ((b.audio = (0, c.i)( { videoId: g.audioVid }, { sourceFrom: (null == _ ? void 0 : _.sourceType) === d.M.LocalFile ? o.DAResourceSourceFrom.upload : o.DAResourceSourceFrom.produced, name: (0, s.IM)(_), } )), (b.video = (0, u.E)(g.originVideo)), b.video && ((b.video.sourceFrom = o.DAResourceSourceFrom.produced), (b.video.aigcVideo = new o.DAAIGCVideo()), (b.video.aigcVideo.itemId = g.videoItemId)), (b.audioBeforeConversion = (0, c.i)( (0, n._)( { videoId: null !== (v = null === (i = g.audioBeforeConversion) || void 0 === i ? void 0 : i.vid) && void 0 !== v ? v : "", }, g.audioBeforeConversion ) )), (b.supportedModes = null === (p = null !== (m = g.supportedModes) && void 0 !== m ? m : [I]) || void 0 === p ? void 0 : null === (r = p.map(f.M)) || void 0 === r ? void 0 : r.filter((e) => void 0 !== e))), (b.seed = (0, a.qb)().toString()), (b.mode = o.DALipSyncMode.standard), (b.supportedModes = [o.DALipSyncMode.standard]), (b.videoRefParams = (0, h.o)(this._params)), y ); } constructor(e) { this._params = e; } } class m extends r.l { getComponent(e) { var t, i, n = new o.DAVideoBaseComponent(); return ( (n.generateType = o.DAVideoGenerateType.lipSync), (n.aigcMode = null !== (i = a.sc[ null !== (t = e.mode) && void 0 !== t ? t : p.JU.Workbench ]) && void 0 !== i ? i : o.DAAIGCMode.workbench), (n.abilities = new v(e).convert()), (n.processType = o.DAVideoProcessType.LipSync), n ); } } }, 992393: function (e, t, i) { "use strict"; i.d(t, { s: function () { return v; }, }); var n = i(625572), r = i(639880), a = i(54969), o = i(868144), s = i(172834), l = i(160706), c = i(243090), d = i(43212), u = i(128468), f = i(43637), h = i(384295); class p { convert() { var e, t = new s.DAVideoGenerateAbilities(), i = new s.DAVideoAudioEffectAbility(); t.videoAudioEffect = i; var n = new s.DAVideoRefParam(); return ( (n.generateType = s.DAAIGCGenerateType.videoAudioEffect), (i.videoRefParams = n), (n.originHistoryId = this._params.videoAudioInput.originHistoryId), (n.itemId = this._params.videoAudioInput.originItemId), (i.originHistoryId = this._params.videoAudioInput.originHistoryId), (i.originItemId = this._params.videoAudioInput.originItemId), (i.videoResource = (0, d.E)( this._params.videoAudioInput.originVideoDetail )), (i.videoRefParams = (0, f.o)(this._params.videoAudioInput)), (i.avMix = (0, h.j)( null === (e = this._params.v2vOpt) || void 0 === e ? void 0 : e.avMix )), t ); } constructor(e) { this._params = e; } } class v extends a.l { getComponent(e) { var t, i, n = new s.DAVideoBaseComponent(); return ( (n.generateType = s.DAVideoGenerateType.videoAudioEffect), (n.aigcMode = null !== (i = o.sc[ null !== (t = e.mode) && void 0 !== t ? t : u.JU.Workbench ]) && void 0 !== i ? i : s.DAAIGCMode.workbench), (n.abilities = new p(e).convert()), n ); } constructor(e) { var t, i; super( (0, r._)((0, n._)({}, e), { reportParam: (0, l.Z)( null !== (t = e.reportParam) && void 0 !== t ? t : {}, (0, c.D)( null !== (i = null == e ? void 0 : e.taskExtra) && void 0 !== i ? i : "{}", {} ) ), }) ); } } }, 868725: function (e, t, i) { "use strict"; i.d(t, { V: function () { return v; }, }); var n = i(625572), r = i(639880), a = i(54969), o = i(868144), s = i(172834), l = i(243090), c = i(160706), d = i(770449), u = i(128468), f = i(384295), h = i(43637); class p { convert() { var e, t, i = new s.DAVideoGenerateAbilities(), n = new s.DAVideoBGMAbility(); return ( (n.duration = this._params.input.duration), (n.tags = null === (e = this._params.input.tags) || void 0 === e ? void 0 : e.map((e) => { var t = new s.DAAudioTag(); return (t.key = e.key), (t.name = e.name), t; })), (n.originHistoryId = this._params.input.originHistoryId), (n.originItemId = this._params.input.originItemId), (n.avMix = (0, f.j)( null === (t = this._params.v2vOpt) || void 0 === t ? void 0 : t.avMix )), (n.firstFrameImage = (0, d.QL)(this._params.input.videoFirstFrame)), (n.videoRefParams = (0, h.o)(this._params.input)), (i.videoBGM = n), i ); } constructor(e) { this._params = e; } } class v extends a.l { getComponent(e) { var t, i, n = new s.DAVideoBaseComponent(); return ( (n.generateType = s.DAVideoGenerateType.videoBgm), (n.aigcMode = null !== (i = o.sc[ null !== (t = e.mode) && void 0 !== t ? t : u.JU.Workbench ]) && void 0 !== i ? i : s.DAAIGCMode.workbench), (n.abilities = new p(e).convert()), (n.processType = s.DAVideoProcessType.VideoBGM), n ); } constructor(e) { var t, i; super( (0, r._)((0, n._)({}, e), { reportParam: (0, c.Z)( null !== (t = e.reportParam) && void 0 !== t ? t : {}, (0, l.D)( null !== (i = null == e ? void 0 : e.taskExtra) && void 0 !== i ? i : "{}", {} ) ), }) ); } } }, 179419: function (e, t, i) { "use strict"; i.d(t, { Q: function () { return p; }, }); var n = i(54969), r = i(868144), a = i(172834), o = i(128468), s = i(803188), l = i(872432), c = i(766079), d = i(384295), u = i(675679), f = i(43637); class h { convert() { var e, t, { abilities: i, ability: n, v2vOpt: r, textToVideoParams: a, } = (0, s.$O)(), o = (0, l.e)(this._params.input.videoGenInputs); return ( (a.videoGenInputs = [o]), (a.modelReqKey = this._params.input.modelReqKey), (a.videoAspectRatio = this._params.input.videoAspectRatio), (o.originHistoryId = this._params.originHistoryId), (o.v2vOpt = r), (r.extend = (0, c.o)( null === (e = this._params.input.videoGenInputs.v2vOpt) || void 0 === e ? void 0 : e.extend )), (r.avMix = (0, d.j)( null === (t = this._params.input.videoGenInputs.v2vOpt) || void 0 === t ? void 0 : t.avMix )), (n.scene = this._params.scene), (n.videoTaskExtra = (0, u.a)(this._params.taskPayload.taskExtra)), (n.videoRefParams = (0, f.o)(this._params)), i ); } constructor(e) { this._params = e; } } class p extends n.l { getComponent(e) { var t, i, n = new a.DAVideoBaseComponent(); return ( (n.generateType = a.DAVideoGenerateType.genVideo), (n.aigcMode = null !== (i = r.sc[ null !== (t = e.mode) && void 0 !== t ? t : o.JU.Workbench ]) && void 0 !== i ? i : a.DAAIGCMode.workbench), (n.abilities = new h(e).convert()), (n.processType = a.DAVideoProcessType.Extend), n ); } } }, 19205: function (e, t, i) { "use strict"; i.d(t, { b: () => h }); var n = i("54969"), r = i("868144"), a = i("172834"), o = i("733787"), s = { [o.T8.Normal]: a.DAPriority.Normal, [o.T8.Relax]: a.DAPriority.Relax, }; function l(e) { return e ? s[e] : void 0; } a.DAPriority.Normal, o.T8.Normal, a.DAPriority.Relax, o.T8.Relax; var c = i("128468"), d = i("675679"), u = i("872432"); class f { convert() { var e, t = new a.DAVideoGenerateAbilities(), i = new a.DAGenVideoAbility(), n = new a.DAText2VideoParams(), { input: r, scene: o, taskPayload: s } = this._params, { seed: c, videoAspectRatio: u, modelReqKey: f } = r, h = this._getVideoGenInput(r); return ( (n.videoGenInputs = [h]), (n.seed = c), (n.modelReqKey = f), (n.priority = l(this._params.input.priority)), (n.videoAspectRatio = null != u ? u : this._getImageAspectRatio( null !== (e = h.firstFrameImage) && void 0 !== e ? e : h.endFrameImage )), (i.text2VideoParams = n), (i.scene = o), (i.videoTaskExtra = (0, d.a)(s.taskExtra)), (t.genVideo = i), t ); } _getImageAspectRatio(e) { if (!!e) { var { width: t, height: i } = e; return (0, r.BB)(t / i); } } _getVideoGenInput(e) { var { videoGenInputs: t } = e; return (0, u.e)(t); } constructor(e) { this._params = e; } } class h extends n.l { getComponent(e) { var t, i, n = new a.DAVideoBaseComponent(); return ( (n.generateType = a.DAVideoGenerateType.genVideo), (n.aigcMode = null !== (i = r.sc[ null !== (t = e.mode) && void 0 !== t ? t : c.JU.Workbench ]) && void 0 !== i ? i : a.DAAIGCMode.workbench), (n.abilities = new f(e).convert()), (n.processType = a.DAVideoProcessType.VideoGen), n ); } } }, 54969: function (e, t, i) { "use strict"; i.d(t, { l: function () { return l; }, }); var n = i(625572), r = i(639880), a = i(172834), o = i(971745), s = i(160706); class l extends o.$ { convert() { var e = this._getDraft(), t = e.findRootComponent(); return { submitId: this._submitId, metricsExtra: this._metricsExtra, draftContent: e.toJSONString(), extend: { mVideoCommerceInfo: this._commerceInfo, templateId: this._templateId, rootModel: this._getRootModel(t), historyOption: this._historyOption, }, }; } _getRootModel(e) { if (e instanceof a.DAVideoBaseComponent) { var t, i, n; return null === (n = e.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : null === (t = i.text2VideoParams) || void 0 === t ? void 0 : t.modelReqKey; } } constructor(e) { var t, i, a; super( (0, r._)((0, n._)({}, e), { reportParam: (0, s.Z)( null !== (i = e.reportParam) && void 0 !== i ? i : {}, null !== (a = null === (t = e.taskPayload) || void 0 === t ? void 0 : t.taskExtra) && void 0 !== a ? a : {} ), }) ), (this._commerceInfo = e.commerceInfo), (this._historyOption = e.historyOption); } } }, 280275: function (e, t, i) { "use strict"; i.d(t, { _: function () { return p; }, }); var n = i(54969), r = i(868144), a = i(172834), o = i(128468), s = i(803188), l = i(872432), c = i(570697), d = i(384295), u = i(675679), f = i(43637); class h { convert() { var e, t, { abilities: i, ability: n, v2vOpt: r, textToVideoParams: a, } = (0, s.$O)(), o = (0, l.e)(this._params.input.videoGenInputs); return ( (a.videoGenInputs = [o]), (a.modelReqKey = this._params.input.modelReqKey), (a.videoAspectRatio = this._params.input.videoAspectRatio), (o.originHistoryId = this._params.originHistoryId), (o.v2vOpt = r), (r.superResolution = (0, c.N)( null === (e = this._params.input.videoGenInputs.v2vOpt) || void 0 === e ? void 0 : e.superResolution )), (r.avMix = (0, d.j)( null === (t = this._params.input.videoGenInputs.v2vOpt) || void 0 === t ? void 0 : t.avMix )), (n.scene = this._params.scene), (n.videoTaskExtra = (0, u.a)(this._params.taskPayload.taskExtra)), (n.videoRefParams = (0, f.o)(this._params)), i ); } constructor(e) { this._params = e; } } class p extends n.l { getComponent(e) { var t, i, n = new a.DAVideoBaseComponent(); return ( (n.generateType = a.DAVideoGenerateType.genVideo), (n.aigcMode = null !== (i = r.sc[ null !== (t = e.mode) && void 0 !== t ? t : o.JU.Workbench ]) && void 0 !== i ? i : a.DAAIGCMode.workbench), (n.abilities = new h(e).convert()), (n.processType = a.DAVideoProcessType.SR), n ); } } }, 790915: function (e, t, i) { "use strict"; i.d(t, { r: function () { return f; }, }); var n = i(54969), r = i(868144), a = i(172834), o = i(128468), s = i(803188), l = i(295976), c = i(675679), d = i(43637); class u { convert() { var e, { abilities: t, ability: i, v2vOpt: n, textToVideoParams: r, } = (0, s.$O)(); return ( (r.seed = this._params.input.seed), (n.videoTemplate = (0, l.f)( null === (e = this._params.input.videoGenInputs.v2vOpt) || void 0 === e ? void 0 : e.videoTemplate )), (i.scene = this._params.scene), (i.videoTaskExtra = (0, c.a)(this._params.taskPayload.taskExtra)), (i.videoRefParams = (0, d.o)(this._params)), t ); } constructor(e) { this._params = e; } } class f extends n.l { getComponent(e) { var t, i, n = new a.DAVideoBaseComponent(); return ( (n.generateType = a.DAVideoGenerateType.videoTemplate), (n.aigcMode = null !== (i = r.sc[ null !== (t = e.mode) && void 0 !== t ? t : o.JU.Workbench ]) && void 0 !== i ? i : a.DAAIGCMode.workbench), (n.abilities = new u(e).convert()), n ); } } }, 782650: function (e, t, i) { "use strict"; i.d(t, { Ks: () => ek, jc: () => eP, $q: () => eR, Lr: () => eA, ZF: () => eE, }); var n = i("625572"), r = i("639880"), a = i("820266"), o = i("804274"), s = i("243090"), l = i("43169"), c = i("283349"), d = i("243302"), u = i("699813"), f = i("56168"), h = i("938678"), p = i("160706"), v = i("626173"), m = (function (e) { return ( (e.VALIDATE = "validate"), (e.PREPROCESS = "preprocess"), (e.FORMAT = "format"), e ); })({}); class g { constructor(e) { this.stage = e; } } class _ extends g { execute(e) { this.preprocess(e); } constructor() { super("preprocess"); } } class y extends g { execute(e) { this.validate(e); } constructor() { super("validate"); } } class b extends g { execute(e) { this.executeFormat(e); } constructor() { super("format"); } } var I = i("591586"), w = i("950835"); class x { addProcessor(e) { var { stage: t } = e, i = this._processorsMap.get(t) || []; return this._processorsMap.set(t, [...i, e]), this; } addProcessors(e) { for (var t of e) this.addProcessor(t); return this; } executeFormatting(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : (0, w.Vj)(), i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = { inputData: (0, h.I)(e), outputData: void 0, errors: [], updateInputData: (e) => { (0, p.Z)(n.inputData, e); }, updateOutputData: (e) => { if (!n.outputData) { n.outputData = (0, h.I)(e); return; } (0, p.Z)(n.outputData, e); }, }; if ( (this._runStage(m.VALIDATE, n), this._runStage(m.PREPROCESS, n), this._runStage(m.FORMAT, n), !n.outputData && n.errors.push(Error("Format error. Cause output is nil.")), n.errors.length > 0 || !n.outputData) ) { var r = AggregateError(n.errors); throw ( (!i && (I.t.error( "FormattedDataPipeline[" .concat(this._name, "][summary][") .concat(t, "]\n"), (0, v.Z)(n, ["inputData", "outputData"]) ), n.errors.forEach((e) => { I.t.error( "FormattedDataPipeline[" .concat(this._name, "][") .concat(t, "]\n"), e ); })), r) ); } return n.outputData; } _runStage(e, t) { for (var i of this._processorsMap.get(e) || []) try { i.execute(t); } catch (r) { var n = r instanceof Error ? r : Error(String(r)); (n.message = "FormattedDataPipeline[" .concat(this._name, "][") .concat(e, "][") .concat(i.constructor.name, "]: \n") .concat(n.message)), t.errors.push(n); } } constructor(e) { (this._name = e), (this._processorsMap = new Map()); } } class S extends y { validate(e) { var { inputData: t } = e, { generateType: i } = t; !(0, c.w)(i) && (0, u.ss)("Video record can only be created from video type"); } } var M = i("552607"); class C extends _ { preprocess(e) { var { inputData: { draftContent: t }, } = e; if (!t) return; var i = (0, M.DN)(t), n = (0, M.Zu)(t), r = (0, M.Ij)(i), a = (0, M.Ij)(n); if (!!r && !!a) e.updateInputData({ firstGenerateType: r, generateType: a, task: { firstGenerateType: r }, }); } } class T extends _ { preprocess(e) { var t, { inputData: i } = e; ek(null === (t = i.itemList) || void 0 === t ? void 0 : t[0], { draftContent: i.draftContent, draftResources: i.resources, }); } } var A = i("172834"), k = i("733787"), P = i("913390"), E = i("43212"), D = i("270853"), R = i("869919"); function N(e) { var t, i, n, r, a, o, { abilities: s } = e; if ( null == s ? void 0 : null === (t = s.genVideo) || void 0 === t ? void 0 : t.scene ) return s.genVideo.scene; if (e.generateType === A.DAVideoGenerateType.videoTemplate) return R.eA.VideoTemplate; var l = null === (i = e.abilities) || void 0 === i ? void 0 : i.lipSync; switch (null == l ? void 0 : l.referenceType) { case A.DALipSyncReferenceType.aiVideo: return R.eA.LipSync; case A.DALipSyncReferenceType.image: return R.eA.LipSyncImage; case A.DALipSyncReferenceType.video: return R.eA.LipSyncUserVideo; } return ( null === (r = e.abilities) || void 0 === r ? void 0 : null === (n = r.videoBGM) || void 0 === n ? void 0 : n.originItemId ) ? R.eA.VideoBGM : ( null === (o = e.abilities) || void 0 === o ? void 0 : null === (a = o.videoAudioEffect) || void 0 === a ? void 0 : a.originItemId ) ? R.eA.VideoAudioEffect : void 0; } class L extends b { executeFormat(e) { var { inputData: { draftContent: t, modelInfo: i }, } = e, n = (0, M.Zu)(t), r = (0, M.DN)(t); if (!!n) e.updateOutputData({ videoAspectRatio: this._getVideoAspectRatioFromComponent(r), seed: this._getSeedFromComponent(n), taskScene: this._getTaskSceneFromComponent(n), modelReqKey: this._getModelReqKeyFromComponent(r), videoModelConfig: i, }); } _getVideoAspectRatioFromComponent(e) { var t, i, n; if (!!e) return null == e ? void 0 : null === (n = e.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : null === (t = i.text2VideoParams) || void 0 === t ? void 0 : t.videoAspectRatio; } _getSeedFromComponent(e) { var t, i, n; return null == e ? void 0 : null === (n = e.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : null === (t = i.text2VideoParams) || void 0 === t ? void 0 : t.seed; } _getTaskSceneFromComponent(e) { return N(e); } _getModelReqKeyFromComponent(e) { var t, i, n; if (!!e) return null == e ? void 0 : null === (n = e.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : null === (t = i.text2VideoParams) || void 0 === t ? void 0 : t.modelReqKey; } } var j = i("763217"), O = i("295976"), B = i("266352"), F = i("324319"); function U(e, t) { var i, n, r, a, o, s, l = null == e ? void 0 : e.vid; if (!l) return; var c = null == t ? void 0 : null === (i = t.find((e) => e.key === l)) || void 0 === i ? void 0 : i.videoInfo; if (!!c) return { vid: l, duration: null !== (a = c.duration) && void 0 !== a ? a : 0, fileId: l, fileHash: l, url: null !== (o = null === (n = c.originVideo) || void 0 === n ? void 0 : n.videoUrl) && void 0 !== o ? o : "", format: null !== (s = null === (r = c.originVideo) || void 0 === r ? void 0 : r.format) && void 0 !== s ? s : "", }; } var G = i("593233"), z = i("570697"), V = i("766079"); function W(e) { if (!!e) { var t = new A.DAVideoGenV2VLabSr(); return ( (t.enable = !0), (t.srFps = e.srFps), (t.srDurationMs = e.srDurationMs), t ); } } function Z(e) { var t, i, n; if (!!e) return { enable: null !== (t = e.enable) && void 0 !== t && t, srFps: Number(null !== (i = e.srFps) && void 0 !== i ? i : 0), srDurationMs: Number( null !== (n = e.srDurationMs) && void 0 !== n ? n : 0 ), }; } var K = i("201636"); class H extends b { executeFormat(e) { var t, i, n, r, a, o, { inputData: s } = e, { draftContent: l } = s, c = (0, M.Zu)(l), d = (0, M.DN)(l); if (!c || !d) return; var u = this._getVideoTemplateParams(d, s), f = this._getLipSyncInputParams(c, s), h = this._getInsertFrameInputParams(c, s), p = this._getSuperResolutionInputParams(c, s), v = this._getLabSrInputParams(c, s), m = this._getExtendInputParams(c, s), g = this._getLipSyncVideoInputParams(d, s); if (!![f, u, h, p, v, m, g].some(Boolean)) { var _ = null === (t = c.abilities) || void 0 === t ? void 0 : t.lipSync, y = (0, j.g)(null == _ ? void 0 : _.mode), b = null !== (o = null == f ? void 0 : f.vid) && void 0 !== o ? o : null === (a = c.abilities) || void 0 === a ? void 0 : null === (r = a.genVideo) || void 0 === r ? void 0 : null === (n = r.text2VideoParams) || void 0 === n ? void 0 : null === (i = n.videoGenInputs) || void 0 === i ? void 0 : i[0].vid; e.updateOutputData({ videoGenInputs: [ { videoMode: y, vid: b, audioVid: null == f ? void 0 : f.audioVid, v2vOpt: { insertFrame: h, superResolution: p, lipSync: f, videoTemplate: u, labSr: v, extend: m, lipSyncUserVideo: g, }, }, ], }); } } _getVideoTemplateParams(e, t) { var i, n, r, a, { resources: o, videoTemplateItem: s } = t, l = null === (n = e.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : i.text2VideoParams; if (!!l) return (0, O.S)( null === (a = l.videoGenInputs) || void 0 === a ? void 0 : null === (r = a[0].v2vOpt) || void 0 === r ? void 0 : r.videoTemplate, o, s ); } _getLipSyncInputParams(e, t) { var i, n, r, a, o, s, l, { resources: c } = t, d = null === (i = e.abilities) || void 0 === i ? void 0 : i.lipSync; if ( !!d && (null == d ? void 0 : d.referenceType) === A.DALipSyncReferenceType.aiVideo ) { var u = d.audioResourceId ? { id: null !== (o = d.audioResourceId) && void 0 !== o ? o : "", itemPlatform: null !== (s = (0, B.S)(d.audioItemPlatform)) && void 0 !== s ? s : K.oH.Loki, } : void 0; return { enable: !0, audioVid: null !== (l = null === (n = d.audio) || void 0 === n ? void 0 : n.vid) && void 0 !== l ? l : "", vid: null === (r = d.video) || void 0 === r ? void 0 : r.vid, ttsInfo: JSON.stringify((0, F.s3)(d)), voiceInfo: u ? { idInfo: u } : void 0, supportedModes: null === (a = d.supportedModes) || void 0 === a ? void 0 : a.map(j.g), audioBeforeConversion: U(d.audioBeforeConversion, c), }; } } _getLipSyncVideoInputParams(e, t) { var i, a, o, s, l, c, d, u, f, h, p, { resources: v, lipSyncIdInfo: m } = t, g = null === (i = e.abilities) || void 0 === i ? void 0 : i.lipSync; if ( !g || (null == g ? void 0 : g.referenceType) !== A.DALipSyncReferenceType.video ) return; var _ = (0, P.l)(g.audio, v), y = (0, E.f)(g.video, v); if (!!_ && !!y) { var b = null !== (f = null !== (u = null === (o = y.transcodedVideo) || void 0 === o ? void 0 : null === (a = o["720p"]) || void 0 === a ? void 0 : a.videoUrl) && void 0 !== u ? u : null === (l = y.transcodedVideo) || void 0 === l ? void 0 : null === (s = l["360p"]) || void 0 === s ? void 0 : s.videoUrl) && void 0 !== f ? f : null === (c = y.originVideo) || void 0 === c ? void 0 : c.videoUrl, I = (null != m ? m : g.audioResourceId) ? { id: null !== (h = g.audioResourceId) && void 0 !== h ? h : "", itemPlatform: null !== (p = (0, B.S)(g.audioItemPlatform)) && void 0 !== p ? p : K.oH.Loki, } : void 0; return { enable: !0, originVideo: y ? (0, r._)((0, n._)({}, y), { videoUrl: b }) : void 0, originAudio: U(g.audio, v), ttsInfo: JSON.stringify((0, F.s3)(g)), voiceInfo: I ? { idInfo: I } : void 0, supportedModes: null === (d = g.supportedModes) || void 0 === d ? void 0 : d.map(j.g), audioBeforeConversion: U(g.audioBeforeConversion, v), }; } } _getInsertFrameInputParams(e, t) { var i, n, r, a, o, s = null === (o = e.abilities) || void 0 === o ? void 0 : null === (a = o.genVideo) || void 0 === a ? void 0 : null === (r = a.text2VideoParams) || void 0 === r ? void 0 : null === (n = r.videoGenInputs) || void 0 === n ? void 0 : null === (i = n[0].v2vOpt) || void 0 === i ? void 0 : i.insertFrame; if (!!s) return (0, G.W)(s); } _getSuperResolutionInputParams(e, t) { var i, n, r, a, o, s = null === (o = e.abilities) || void 0 === o ? void 0 : null === (a = o.genVideo) || void 0 === a ? void 0 : null === (r = a.text2VideoParams) || void 0 === r ? void 0 : null === (n = r.videoGenInputs) || void 0 === n ? void 0 : null === (i = n[0].v2vOpt) || void 0 === i ? void 0 : i.superResolution; if (!!s) return (0, z.y)(s); } _getExtendInputParams(e, t) { var i, n, r, a, o, s = null === (o = e.abilities) || void 0 === o ? void 0 : null === (a = o.genVideo) || void 0 === a ? void 0 : null === (r = a.text2VideoParams) || void 0 === r ? void 0 : null === (n = r.videoGenInputs) || void 0 === n ? void 0 : null === (i = n[0].v2vOpt) || void 0 === i ? void 0 : i.extend; if (!!s) return (0, V.c)(s); } _getLabSrInputParams(e, t) { var i, n, r, a, o, s = null === (o = e.abilities) || void 0 === o ? void 0 : null === (a = o.genVideo) || void 0 === a ? void 0 : null === (r = a.text2VideoParams) || void 0 === r ? void 0 : null === (n = r.videoGenInputs) || void 0 === n ? void 0 : null === (i = n[0].v2vOpt) || void 0 === i ? void 0 : i.labSr; if (!!s) return Z(s); } } var q = i("770449"), J = i("839517"); class Y extends b { executeFormat(e) { var { inputData: t } = e, i = this._getVideoGenInput(t); if (!!i) e.updateOutputData({ videoGenInputs: [i] }); } _getVideoGenInput(e) { var t, i, n, r, a, o, s, l, c, d, { draftContent: u, resources: f, originText2VideoParams: h } = e, p = (0, M.DN)(u), v = null == p ? void 0 : null === (n = p.abilities) || void 0 === n ? void 0 : null === (i = n.genVideo) || void 0 === i ? void 0 : null === (t = i.text2VideoParams) || void 0 === t ? void 0 : t.videoGenInputs; if (!!(null == v ? void 0 : v[0])) { var m = v[0]; return { prompt: m.prompt, firstFrameImage: (0, q.Wc)(m.firstFrameImage, f), endFrameImage: (0, q.Wc)(m.endFrameImage, f), lensMotionType: m.lensMotionType, vid: null !== (l = m.vid) && void 0 !== l ? l : "", audioVid: m.audioVid ? String(m.audioVid) : void 0, videoMode: (0, J.r)(m.videoMode), durationMs: m.durationMs, cameraStrength: m.cameraStrength, motionSpeed: null !== (c = null == h ? void 0 : null === (a = h.videoGenInputs) || void 0 === a ? void 0 : null === (r = a[0]) || void 0 === r ? void 0 : r.motionSpeed) && void 0 !== c ? c : m.motionSpeed, fps: null !== (d = null == h ? void 0 : null === (s = h.videoGenInputs) || void 0 === s ? void 0 : null === (o = s[0]) || void 0 === o ? void 0 : o.fps) && void 0 !== d ? d : m.fps, }; } } } class Q extends b { executeFormat(e) { var { inputData: t } = e, { draftContent: i } = t, n = (0, M.DN)(i); if (!n) return; var r = this._getLipSyncImageInputParams(n, t); if (!![r].some(Boolean)) { var a = (0, j.g)(null == r ? void 0 : r.mode); e.updateOutputData({ videoGenInputs: [{ videoMode: a, i2vOpt: { realmanAvatar: r } }], }); } } _getLipSyncImageInputParams(e, t) { var i, n, r, a, o, s, { resources: l, lipSyncIdInfo: c } = t, d = null === (i = e.abilities) || void 0 === i ? void 0 : i.lipSync; if ( !!d && (null == d ? void 0 : d.referenceType) === A.DALipSyncReferenceType.image && !!(0, P.l)(d.audio, l) ) { var u = null != c ? c : d.audioResourceId ? { id: null !== (a = d.audioResourceId) && void 0 !== a ? a : "", itemPlatform: null !== (o = (0, B.S)(d.audioItemPlatform)) && void 0 !== o ? o : K.oH.Loki, } : void 0; return { enable: !0, audioVid: null !== (s = null === (n = d.audio) || void 0 === n ? void 0 : n.vid) && void 0 !== s ? s : "", originImage: (0, q.Wc)(d.image, l), originAudio: U(d.audio, l), ttsInfo: JSON.stringify((0, F.s3)(d)), voiceInfo: u ? { idInfo: u } : void 0, supportedModes: null === (r = d.supportedModes) || void 0 === r ? void 0 : r.map(j.g), mode: d.mode, audioBeforeConversion: U(d.audioBeforeConversion, l), }; } } } function X(e) { var t, i = new x("formatOriginalInputByDraft"); return ( i .addProcessor(new L()) .addProcessor(new H()) .addProcessor(new Y()) .addProcessor(new Q()), (0, p.Z)( null !== (t = e.originText2VideoParams) && void 0 !== t ? t : {}, i.executeFormatting(e) ) ); } class $ extends b { executeFormat(e) { var t, i, n, r, { inputData: { draftContent: a, videoResource: o }, } = e, s = (0, M.Zu)(a), l = null == s ? void 0 : null === (t = s.abilities) || void 0 === t ? void 0 : t.videoBGM; if (!!s && !!l) { var c = null === (i = l.tags) || void 0 === i ? void 0 : i.map((e) => { var t, i; return { key: null !== (t = e.key) && void 0 !== t ? t : "", name: null !== (i = e.name) && void 0 !== i ? i : "", }; }); e.updateOutputData({ originHistoryId: l.originHistoryId, originItemId: l.originItemId, videoFirstFrame: { imageUrl: null !== (n = null == o ? void 0 : o.coverUrl) && void 0 !== n ? n : "", imageUri: null !== (r = null == o ? void 0 : o.coverUri) && void 0 !== r ? r : "", width: 0, height: 0, }, duration: null == o ? void 0 : o.duration, tags: c, promptSource: (null == c ? void 0 : c.length) ? R.X2.Tag : R.X2.FirstFrame, }); } } } function ee(e) { try { var t = new x("formatVideoAudioParamsByDraft"); return ( t.addProcessor(new $()), t.executeFormatting(e, (0, w.Vj)(), !0) ); } catch (e) { return; } } var et = i("588735"); class ei { static findChildNodes(e, t) { if (void 0 !== t) for (var i = t.childNodes(), n = 0; n < i.length; n++) { var r = i[n]; if (void 0 !== r) { if (e(r)) return r; var a = ei.findChildNodes(e, r); if (void 0 !== a) return a; } } } } class en extends _ { preprocess(e) { var t, i, a, o, s, { inputData: l } = e, { draftContent: c, failCode: d, resources: u, metricsExtra: f } = l; if (!!c) { if (!(0, M.Sv)(c)) throw Error("draftContent is not valid"); var h = new A.DADraft({ JSONString: c }), p = X({ draftContent: c, resources: u, videoTemplateItem: l.videoTemplateItem, modelInfo: l.modelInfo ? (0, r._)((0, n._)({}, l.modelInfo), { options: null !== (s = l.modelInfo.videoModelOptions) && void 0 !== s ? s : [], }) : void 0, originText2VideoParams: null == l ? void 0 : null === (t = l.task) || void 0 === t ? void 0 : t.originalInput, }), v = ee({ draftContent: c, resources: u, videoResource: null === (a = l.itemList) || void 0 === a ? void 0 : null === (i = a[0]) || void 0 === i ? void 0 : i.video, }); e.updateInputData({ task: { originalInput: p, aigcImageParams: v && { videoBgmParams: v }, isUseDraftGen: !0, processFlows: this._getProcessFlowsFromDraft(h), taskPayload: this._getTaskPayloadFromDraft(h, f, p), draftContent: c, lipSyncInfo: { lipSyncExtra: this._getLipSyncExtra(h, u, d), lipSyncDetectionStatus: null === (o = l.lipSyncInfo) || void 0 === o ? void 0 : o.lipSyncDetectionStatus, }, }, }); } } _getProcessFlowsFromDraft(e) { for (var t = [], i = e.findMainComponent(); i && (0, M.r4)(i); ) { var n = null !== (a = null == i ? void 0 : i.processType) && void 0 !== a ? a : D.IR[i.generateType]; if ( null === (r = i.abilities) || void 0 === r ? void 0 : r.lipSync ) { var r, a, o, s = null === (o = i.abilities) || void 0 === o ? void 0 : o.lipSync; switch (null == s ? void 0 : s.referenceType) { case A.DALipSyncReferenceType.aiVideo: n = k.v8.LipSync; break; case A.DALipSyncReferenceType.image: n = k.v8.LipSyncImage; break; case A.DALipSyncReferenceType.video: n = k.v8.LipSyncUserVideo; } } n && t.unshift({ curProcessFlows: [n] }), (i = e.findParentComponent(i)); } return t; } _getTaskPayloadFromDraft(e, t, i) { var n = e.findMainComponent(); if (!!(0, M.r4)(n)) { var { abilities: r } = n; return { taskExtra: this._getTaskExtra(r, t, i), taskScene: N(n) }; } } _getTaskExtra(e, t, i) { var n = (null == e ? void 0 : null === (o = e.genVideo) || void 0 === o ? void 0 : o.videoTaskExtra) || t, r = (0, s.D)(null != n ? n : "{}", {}); if (!("lipSyncInfo" in r)) { var o, l, c, d, u, f, h, p, v, m, g = null == i ? void 0 : null === (l = i.videoGenInputs) || void 0 === l ? void 0 : l[0], _ = null !== (m = null !== (v = null == g ? void 0 : null === (d = g.v2vOpt) || void 0 === d ? void 0 : null === (c = d.lipSync) || void 0 === c ? void 0 : c.ttsInfo) && void 0 !== v ? v : null == g ? void 0 : null === (f = g.v2vOpt) || void 0 === f ? void 0 : null === (u = f.lipSyncUserVideo) || void 0 === u ? void 0 : u.ttsInfo) && void 0 !== m ? m : null == g ? void 0 : null === (p = g.i2vOpt) || void 0 === p ? void 0 : null === (h = p.realmanAvatar) || void 0 === h ? void 0 : h.ttsInfo; _ && (r.lipSyncInfo = (0, a.b)((0, s.D)(_, {}))); } if (!("previewId" in r)) { var y = ei.findChildNodes((e) => e instanceof A.DAVideoRefParam, e); r.previewId = null == y ? void 0 : y.originHistoryId; } return ( !("promptSource" in r) && (r.promptSource = "custom"), JSON.stringify(r) ); } _getLipSyncExtra(e, t, i) { var n, r, a, o, s, l, c, d, u = e.findMainComponent(); if (!(0, M.r4)(u)) return; var f = null === (n = u.abilities) || void 0 === n ? void 0 : n.lipSync, h = (0, P.l)(null == f ? void 0 : f.audio, t), p = (0, E.f)(null == f ? void 0 : f.video, t); if (!!f) { var v = String(et.sQ.InputAudioContainEnglishContent); return JSON.stringify({ audio: h ? { vid: h.videoId, duration: null !== (o = h.duration) && void 0 !== o ? o : 0, fileId: h.videoId, fileHash: h.videoId, url: null !== (s = null === (r = h.originVideo) || void 0 === r ? void 0 : r.videoUrl) && void 0 !== s ? s : "", format: null !== (l = null === (a = h.originVideo) || void 0 === a ? void 0 : a.format) && void 0 !== l ? l : "", isEnglishContent: String(i) === v, } : void 0, video: p ? { vid: null !== (c = p.videoId) && void 0 !== c ? c : "", duration: null !== (d = p.duration) && void 0 !== d ? d : 0, fileId: p.videoId, fileHash: p.videoId, } : void 0, }); } } } var er = i("229025"), ea = i("952739"), eo = (e, t) => { var i; return e ? ("uri" in e && (i = e.uri), "imageUri" in e && (i = e.imageUri), (0, r._)((0, n._)({}, e), { imageUri: i, coverUrlMap: (0, ea.fe)(t), })) : { imageUri: "", imageUrl: "", width: 0, height: 0 }; }; class es extends b { executeFormat(e) { var { inputData: t } = e, i = this._getVideoRecordData(t); e.updateOutputData(i); } _getVideoRecordData(e) { var t, i, n, r, a, o, s = null === (t = e.itemList) || void 0 === t ? void 0 : t[0], l = s ? (0, f.C)(s, e.historyRecordId) : void 0, c = eo( (null === (i = e.task) || void 0 === i ? void 0 : i.firstFrameImage) || (null === (n = e.originItemList) || void 0 === n ? void 0 : n[0]), e.task.multiSizeFirstFrameImage ), d = eo( null === (r = e.task) || void 0 === r ? void 0 : r.endFrameImage, e.task.multiSizeEndFrameImage ), u = (0, er.Qd)(e.createdTime), h = (0, er.Qd)( null !== (o = null === (a = e.task) || void 0 === a ? void 0 : a.finishTime) && void 0 !== o ? o : 0 ), { generateType: p, firstGenerateType: v } = e, m = eA(e.task); return { id: e.task.submitId, generateType: p, firstGenerateType: v, historyRecordId: e.historyRecordId, itemList: e.itemList, originItemList: e.originItemList, status: e.status, mode: e.mode, historyGroupKeyMd5: null == e ? void 0 : e.historyGroupKeyMd5, forecastGenerateCost: null == e ? void 0 : e.forecastGenerateCost, forecastQueueCost: null == e ? void 0 : e.forecastQueueCost, failCode: null == e ? void 0 : e.failCode, assetOption: e.assetOption, createdTime: u, sortCreateTime: u, finishTime: h, task: m, firstFrameImage: c, lastFrameImage: d, generateId: e.generateId, aigcItemId: null == l ? void 0 : l.aigcItemId, videoDreamina: l, }; } } var el = i("128468"), ec = i("549654"), ed = i("611422"), eu = i("724196"), ef = i("19205"), eh = i("280275"), ep = i("106621"), ev = i("179419"), em = i("54969"), eg = i("868144"), e_ = i("803188"), ey = i("384295"), eb = i("675679"), eI = i("43637"); class ew { convert() { var e, t, i, { abilities: n, ability: r, v2vOpt: a, videoGenInput: o, } = (0, e_.$O)(); return ( (o.vid = null === (e = this._params.input.videoGenInputs) || void 0 === e ? void 0 : e.vid), (a.labSr = W( null === (t = this._params.input.videoGenInputs.v2vOpt) || void 0 === t ? void 0 : t.labSr )), (a.avMix = (0, ey.j)( null === (i = this._params.input.videoGenInputs.v2vOpt) || void 0 === i ? void 0 : i.avMix )), (r.scene = this._params.scene), (r.videoTaskExtra = (0, eb.a)(this._params.taskPayload.taskExtra)), (r.videoRefParams = (0, eI.o)(this._params)), n ); } constructor(e) { this._params = e; } } class ex extends em.l { getComponent(e) { var t, i, n = new A.DAVideoBaseComponent(); return ( (n.generateType = A.DAVideoGenerateType.genVideo), (n.aigcMode = null !== (i = eg.sc[ null !== (t = e.mode) && void 0 !== t ? t : el.JU.Workbench ]) && void 0 !== i ? i : A.DAAIGCMode.workbench), (n.abilities = new ew(e).convert()), (n.processType = A.DAVideoProcessType.LabSR), n ); } } var eS = i("790915"), eM = i("992393"), eC = i("868725"); class eT extends _ { preprocess(e) { var { inputData: t } = e; if (!t.draftContent) try { var i = this._generateDraftContentFromLegacyData(t); if (!i) return; e.updateInputData({ draftContent: i, task: { draftContent: i } }); } catch (e) { I.t.error( "[FixDraftContentForLegacyDataPreprocessorPlugin] submitId: ", t.task.submitId, "error: ", e ); return; } } _generateDraftContentFromLegacyData(e) { var { task: t } = e, { processFlows: i } = t, n = null == i ? void 0 : i.map((e) => { var t; return null === (t = e.curProcessFlows) || void 0 === t ? void 0 : t[0]; }); if (!!(null == n ? void 0 : n.length)) { var r = this._getImageDraftContentFromLegacyData(e); return ( n.forEach( (t) => (r = this._createConverterFactory(t, e, r)().convert() .draftContent) ), r ); } } _createConverterFactory(e, t, i) { var n = this._createBaseParams(t, i); return { [k.v8.LipSyncImage]: () => new ed.F(n), [k.v8.LipSyncUserVideo]: () => new ed.F(n), [k.v8.LipSync]: () => new eu.D(n), [k.v8.VideoGen]: () => new ef.b(n), [k.v8.SuperResolution]: () => new eh._(n), [k.v8.InsertFrame]: () => new ep.C(n), [k.v8.Extend]: () => new ev.Q(n), [k.v8.LabSR]: () => new ex(n), [k.v8.VideoTemplate]: () => new eS.r(n), [k.v8.MixBGM]: () => new eC.V(this._createBGMParams(t, i)), [k.v8.BGMGenerate]: () => new eC.V(this._createBGMParams(t, i)), [k.v8.VideoAudioEffect]: () => new eM.s(this._createAudioEffectParams(t, i)), }[e]; } _createBaseParams(e, t) { var i, a, o, { task: l, itemList: c } = e, { taskPayload: d, submitId: u } = l, f = (null == d ? void 0 : d.taskExtra) ? (0, s.D)(null == d ? void 0 : d.taskExtra) : void 0, h = null !== (o = null == c ? void 0 : null === (a = c[0]) || void 0 === a ? void 0 : null === (i = a.aigcImageParams) || void 0 === i ? void 0 : i.text2videoParams) && void 0 !== o ? o : l.originalInput; return { input: (0, r._)((0, n._)({}, h), { videoGenInputs: this._getVideoGenInput(e), }), taskPayload: { taskExtra: f }, submitId: u, draftContent: t, }; } _createBGMParams(e, t) { var i, n, { task: r } = e, { taskPayload: a, submitId: o } = r, { originItemId: s, originHistoryId: l, tags: c, duration: d, } = null !== (n = null === (i = r.aigcImageParams) || void 0 === i ? void 0 : i.videoBgmParams) && void 0 !== n ? n : {}; return { input: { originHistoryId: l, originItemId: s, tags: c, duration: d, }, mode: el.JU.Workbench, historyOption: {}, commerceInfo: {}, submitId: o, taskExtra: null == a ? void 0 : a.taskExtra, draftContent: t, }; } _createAudioEffectParams(e, t) { var i, n, r, a, o, s, { task: l, itemList: c } = e, { taskPayload: d, submitId: u } = l; return { videoAudioInput: { originHistoryId: null == c ? void 0 : null === (r = c[0]) || void 0 === r ? void 0 : null === (n = r.aigcImageParams) || void 0 === n ? void 0 : null === (i = n.videoAudioEffectParams) || void 0 === i ? void 0 : i.originHistoryId, originItemId: null == c ? void 0 : null === (s = c[0]) || void 0 === s ? void 0 : null === (o = s.aigcImageParams) || void 0 === o ? void 0 : null === (a = o.videoAudioEffectParams) || void 0 === a ? void 0 : a.originItemId, }, mode: el.JU.Workbench, historyOption: {}, commerceInfo: {}, submitId: u, taskExtra: null == d ? void 0 : d.taskExtra, draftContent: t, }; } _getImageDraftContentFromLegacyData(e) { var t, i, n = this._getVideoGenInput(e), { aigcImage: r } = null !== (i = null == n ? void 0 : n.firstFrameImage) && void 0 !== i ? i : {}; if (!!r) { var { aigcImageParams: a, commonAttr: s } = r, l = (0, o.D1)(JSON.stringify(a)), c = (0, o.D1)( JSON.stringify({ commonAttr: { aspectRatio: null == s ? void 0 : s.aspectRatio, }, }) ); return null === (t = new A.ADTODA_ImageTransformer(l, c).convertToDraft()) || void 0 === t ? void 0 : t.toJSONString(); } } _getVideoGenInput(e) { var t, i, o, l, c, d, u, f, h, p, v, { task: m, itemList: g } = e, _ = null !== (p = null == g ? void 0 : null === (l = g[0]) || void 0 === l ? void 0 : null === (o = l.aigcImageParams) || void 0 === o ? void 0 : null === (i = o.text2videoParams) || void 0 === i ? void 0 : null === (t = i.videoGenInputs) || void 0 === t ? void 0 : t[0]) && void 0 !== p ? p : null === (d = m.originalInput) || void 0 === d ? void 0 : null === (c = d.videoGenInputs) || void 0 === c ? void 0 : c[0]; if (!!_) return (0, r._)((0, n._)({}, _), { boximator: _.boximator, motionSpeed: ec.E[_.motionSpeed], firstFrameImage: ( null === (u = _.firstFrameImage) || void 0 === u ? void 0 : u.imageUri ) ? _.firstFrameImage : void 0, endFrameImage: ( null === (f = _.endFrameImage) || void 0 === f ? void 0 : f.imageUri ) ? _.endFrameImage : void 0, v2vOpt: _.v2vOpt ? (0, r._)((0, n._)({}, _.v2vOpt), { lipSync: _.v2vOpt.lipSync ? (0, r._)((0, n._)({}, _.v2vOpt.lipSync), { ttsInfo: (0, a.b)( (0, s.D)( null !== (v = _.v2vOpt.lipSync.ttsInfo) && void 0 !== v ? v : "{}" ) ), }) : void 0, lipSyncUserVideo: _.v2vOpt.lipSyncUserVideo ? (0, r._)((0, n._)({}, _.v2vOpt.lipSyncUserVideo), { ttsInfo: (0, a.b)( (0, s.D)(_.v2vOpt.lipSyncUserVideo.ttsInfo) ), }) : void 0, }) : void 0, i2vOpt: _.i2vOpt ? (0, r._)((0, n._)({}, _.i2vOpt), { realmanAvatar: ( null === (h = _.i2vOpt) || void 0 === h ? void 0 : h.realmanAvatar ) ? (0, r._)((0, n._)({}, _.i2vOpt.realmanAvatar), { ttsInfo: (0, a.b)( (0, s.D)(_.i2vOpt.realmanAvatar.ttsInfo) ), }) : void 0, }) : void 0, }); } } var eA = (e) => { var t, i, o, l, c, d, u, f, h = e.originalInput.videoGenInputs[0]; return { taskId: "".concat(e.taskId), historyId: "".concat(e.historyId), aid: e.aid, submitId: e.submitId, status: e.status, finishTime: e.finishTime, firstFrameImage: e.firstFrameImage, firstGenerateType: e.firstGenerateType, imageToAvatar: e.imageToAvatar, isUseDraftGen: e.isUseDraftGen, originalInput: (0, r._)((0, n._)({}, e.originalInput), { videoGenInputs: [ (0, r._)((0, n._)({}, h), { firstFrameImage: ( null === (t = h.firstFrameImage) || void 0 === t ? void 0 : t.imageUri ) ? h.firstFrameImage : void 0, endFrameImage: ( null === (i = h.endFrameImage) || void 0 === i ? void 0 : i.imageUri ) ? h.endFrameImage : void 0, v2vOpt: h.v2vOpt ? (0, r._)((0, n._)({}, h.v2vOpt), { lipSyncUserVideo: h.v2vOpt.lipSyncUserVideo ? (0, r._)((0, n._)({}, h.v2vOpt.lipSyncUserVideo), { ttsInfo: (0, a.b)( (0, s.D)(h.v2vOpt.lipSyncUserVideo.ttsInfo) ), }) : void 0, }) : void 0, i2vOpt: h.i2vOpt ? (0, r._)((0, n._)({}, h.i2vOpt), { realmanAvatar: ( null === (o = h.i2vOpt) || void 0 === o ? void 0 : o.realmanAvatar ) ? (0, r._)((0, n._)({}, h.i2vOpt.realmanAvatar), { ttsInfo: (0, a.b)( (0, s.D)(h.i2vOpt.realmanAvatar.ttsInfo) ), }) : void 0, }) : void 0, }), ], }), taskPayload: (0, r._)((0, n._)({}, e.taskPayload), { taskExtra: (0, s.D)( null !== (u = null === (l = e.taskPayload) || void 0 === l ? void 0 : l.taskExtra) && void 0 !== u ? u : "{}" ), }), lipSyncInfo: e.lipSyncInfo ? (0, r._)((0, n._)({}, e.lipSyncInfo), { lipSyncExtra: (0, s.D)( null !== (f = null === (c = e.lipSyncInfo) || void 0 === c ? void 0 : c.lipSyncExtra) && void 0 !== f ? f : "" ), }) : void 0, processFlows: e.processFlows, priority: e.priority, videoBGMInfo: ( null === (d = e.aigcImageParams) || void 0 === d ? void 0 : d.videoBgmParams ) ? e.aigcImageParams.videoBgmParams : void 0, draftContent: e.draftContent, }; }; function ek(e, t) { var i, n, r, a = (null == e ? void 0 : null === (i = e.aigcDraft) || void 0 === i ? void 0 : i.content) || (null == t ? void 0 : t.draftContent), o = (null == e ? void 0 : e.aigcDraftResources) || (null == t ? void 0 : t.draftResources); if (!!a && !!o && !!e && !!(0, M.Sv)(a)) { var s = null === (n = e.aigcImageParams.publishedVoiceInfo) || void 0 === n ? void 0 : n.idInfo, l = X({ draftContent: a, resources: o, videoTemplateItem: e.videoTemplateItem, originText2VideoParams: e.aigcImageParams.text2videoParams, lipSyncIdInfo: s, }); (e.aigcImageParams.generateType = null !== (r = (0, M.Ij)((0, M.Zu)(a))) && void 0 !== r ? r : e.aigcImageParams.generateType), (e.aigcImageParams.text2videoParams = l); } } function eP(e) { var t, i, n, r = null == e ? void 0 : null === (t = e.aigc_draft) || void 0 === t ? void 0 : t.content; if (!!r && !!e && !!(0, M.Sv)(r)) { var a = null === (i = e.aigc_image_params.published_voice_info) || void 0 === i ? void 0 : i.id_info, s = X({ draftContent: r, resources: (0, o.fs)(e.aigc_draft_resources, o.zW), videoTemplateItem: (0, o.fs)(e.video_template_item, o.zW), originText2VideoParams: (0, o.fs)( e.aigc_image_params.text2video_params, o.zW ), lipSyncIdInfo: (0, o.fs)(a, o.zW), }); (e.aigc_image_params.generate_type = null !== (n = (0, M.Ij)((0, M.Zu)(r))) && void 0 !== n ? n : e.aigc_image_params.generate_type), (e.aigc_image_params.text2video_params = (0, o.fs)(s, o.D1)); } } var eE = (e) => { var t = new x("formatGenerateTaskRecordFromServer"); return ( t .addProcessor(new S()) .addProcessor(new C()) .addProcessor(new T()) .addProcessor(new en()) .addProcessor(new es()) .addProcessor(new eT()), t.executeFormatting(e, e.task.submitId) ); }, eD = (e, t) => { var i, a, o, s, c, u, h, p, v, m, g, _, y, b, I, w, x, S, M, C, T, A, k, P, E, D, R, N, { commonAttr: L } = e, { video: j, author: O } = e, B = e.aigcImageParams, F = "".concat(L.id), { requestId: U, generateId: G, generateType: z, text2videoParams: V, } = null != B ? B : {}, { transcodedVideo: W } = j, Z = null !== (y = null !== (_ = null === (i = j.transcodedVideo) || void 0 === i ? void 0 : i["720p"]) && void 0 !== _ ? _ : null === (a = j.transcodedVideo) || void 0 === a ? void 0 : a["360p"]) && void 0 !== y ? y : null === (o = j.transcodedVideo) || void 0 === o ? void 0 : o.origin, K = (0, f.K)(j.durationInfo), H = (null == K ? void 0 : K.playInfoDuration) ? (null == K ? void 0 : K.playInfoDuration) * 1e3 : j.durationMs, q = Math.round(H / 1e3); return (0, n._)( { key: F, resourceId: F, effectId: L.effectId, effectType: L.effectType, title: null !== (b = L.title) && void 0 !== b ? b : "", description: L.description, coverUri: L.coverUri, coverUrl: L.coverUrl, coverUrlMap: null !== (I = L.coverUrlMap) && void 0 !== I ? I : {}, watermarkType: j.watermarkType, createTime: L.createTime, aspectRatio: null !== (w = L.aspectRatio) && void 0 !== w ? w : 1, duration: q, durationMs: H, durationInfo: 0 === Object.values(K).length ? { playInfoDuration: q, audioStreamingDuration: q, videoStreamingDuration: q, } : K, author: O ? { avatar: O.avatarUrl, name: O.name, uid: O.secUid } : void 0, thumb: { thumbCommonInfo: { singleFrameHeight: null !== (x = null === (c = j.thumb) || void 0 === c ? void 0 : null === (s = c.thumbCommonInfo) || void 0 === s ? void 0 : s.singleFrameHeight) && void 0 !== x ? x : 0, singleFrameWidth: null !== (S = null === (h = j.thumb) || void 0 === h ? void 0 : null === (u = h.thumbCommonInfo) || void 0 === u ? void 0 : u.singleFrameWidth) && void 0 !== S ? S : 0, totalSetNum: null !== (M = null === (v = j.thumb) || void 0 === v ? void 0 : null === (p = v.thumbCommonInfo) || void 0 === p ? void 0 : p.totalSetNum) && void 0 !== M ? M : 0, }, detailInfos: null !== (C = null === (g = j.thumb) || void 0 === g ? void 0 : null === (m = g.detailInfos) || void 0 === m ? void 0 : m.map((e) => ({ frameCount: e.frameCount, imageHeight: e.imageHeight, imageWidth: e.imageWidth, mimeType: e.mimeType, url: e.url, uri: e.uri, }))) && void 0 !== C ? C : [], }, originVideo: { definition: null !== (T = null == Z ? void 0 : Z.definition) && void 0 !== T ? T : "", format: null !== (A = null == Z ? void 0 : Z.format) && void 0 !== A ? A : "", height: null !== (k = null == Z ? void 0 : Z.height) && void 0 !== k ? k : 0, width: null !== (P = null == Z ? void 0 : Z.width) && void 0 !== P ? P : 0, size: null !== (E = null == Z ? void 0 : Z.size) && void 0 !== E ? E : 0, url: null !== (D = null == Z ? void 0 : Z.videoUrl) && void 0 !== D ? D : "", fps: null !== (R = null == Z ? void 0 : Z.fps) && void 0 !== R ? R : 0, }, transcode: Object.keys(null != W ? W : {}).reduce((e, t) => { var i = null == W ? void 0 : W[t]; return i ? (0, r._)((0, n._)({}, e), { [t]: { definition: i.definition, format: i.format, height: i.height, width: i.width, size: i.size, url: i.videoUrl, }, }) : e; }, {}), aigcParams: { requestId: null !== (N = null != U ? U : e.requestId) && void 0 !== N ? N : "", generateId: null != G ? G : "", generateType: null != z ? z : d.pi.Unknown, text2videoParams: V ? (0, n._)({}, V) : V, }, videoId: j.videoId, historyRecordId: t ? String(t) : "", aigcItemId: L.localItemId ? String(L.localItemId) : "", publishedItemId: L.publishedItemId ? String(L.publishedItemId) : void 0, thirdResourceId: L.thirdResourceId ? String(L.thirdResourceId) : void 0, isMute: j.isMute, }, (0, l.S)(e) ); }, eR = (e) => { try { var t, i, n, r, a = null === (t = e.itemList) || void 0 === t ? void 0 : t[0], o = a ? eD(a, e.historyRecordId) : void 0, s = eo( e.task.firstFrameImage || (null === (i = e.originItemList) || void 0 === i ? void 0 : i[0]) ); return ( !(0, c.w)(e.generateType) && (0, u.ss)("Video record can only be created from video type"), { firstGenerateType: e.firstGenerateType, generateType: e.generateType, historyRecordId: null !== (n = e.historyRecordId) && void 0 !== n ? n : "", createdTime: (null !== (r = e.createdTime) && void 0 !== r ? r : 0) * 1e3, itemList: e.itemList, originItemList: e.originItemList, mode: e.mode, task: eA(e.task), assetOption: e.assetOption, firstFrameImage: s, aigcItemId: null == o ? void 0 : o.aigcItemId, videoDreamina: o, historyGroupKeyMd5: null == e ? void 0 : e.historyGroupKeyMd5, } ); } catch (e) { return; } }; }, 270853: function (e, t, i) { "use strict"; i.d(t, { A_: function () { return l; }, FU: function () { return s; }, IR: function () { return o; }, }); var n = i(733787), r = i(243302), a = i(172834), o = { [a.DAVideoGenerateType.genVideo]: n.v8.VideoGen, [a.DAVideoGenerateType.lipSync]: n.v8.LipSync, [a.DAVideoGenerateType.videoTemplate]: n.v8.VideoTemplate, [a.DAVideoGenerateType.videoBgm]: n.v8.BGMGenerate, [a.DAVideoGenerateType.videoAudioEffect]: n.v8.VideoAudioEffect, [a.DAVideoGenerateType.none]: n.v8.VideoGen, }, s = { [a.DALipSyncReferenceType.video]: r.pi.Video2Avatar, [a.DALipSyncReferenceType.image]: r.pi.Image2Avatar, [a.DALipSyncReferenceType.aiVideo]: r.pi.LipSync, [a.DALipSyncReferenceType.unknown]: r.pi.Unknown, }, l = { [a.DAVideoGenerateType.none]: r.pi.Unknown, [a.DAVideoGenerateType.lipSync]: r.pi.LipSync, [a.DAVideoGenerateType.genVideo]: r.pi.Text2Video, [a.DAVideoGenerateType.videoAudioEffect]: r.pi.VideoAudioEffect, [a.DAVideoGenerateType.videoTemplate]: r.pi.VideoTemplate, [a.DAVideoGenerateType.videoBgm]: r.pi.VideoBGM, }; }, 552607: function (e, t, i) { "use strict"; i.d(t, { DN: function () { return s; }, Ij: function () { return c; }, Sv: function () { return l; }, Zu: function () { return o; }, r4: function () { return a; }, }); var n = i(172834), r = i(270853); function a(e) { return !!e && e instanceof n.DAVideoBaseComponent; } function o(e) { if (!e) return; var t = new n.DADraft({ JSONString: e }).findMainComponent(); if (!!a(t)) return t; } function s(e) { if (!e) return; var t = new n.DADraft({ JSONString: e }), i = t.findMainComponent(); if (!i) return; var r = (e) => { var i = t.findParentComponent(e); return i && a(i) ? r(i) : e; }, o = r(i); if (!!a(o)) return o; } function l(e) { if (!e) return !1; var t = s(e); return ( !!t && [ n.DAVideoGenerateType.videoTemplate, n.DAVideoGenerateType.genVideo, n.DAVideoGenerateType.lipSync, ].includes(t.generateType) ); } function c(e) { if (!!a(e)) { if (e.generateType === n.DAVideoGenerateType.lipSync) { var t, i, o = null === (i = e.abilities) || void 0 === i ? void 0 : null === (t = i.lipSync) || void 0 === t ? void 0 : t.referenceType; if (!o) return; return r.FU[o]; } return r.A_[e.generateType]; } } }, 107520: function (e, t, i) { "use strict"; i.d(t, { Z: function () { return a; }, }); var n = i(625572), r = i(808515); function a(e, t) { var i, a, o, s, l, { commonAttr: c } = e, { image: d, author: u } = e, f = e.aigcImageParams, h = "".concat(c.id), p = (0, r.B)({ coverUrlMap: c.coverUrlMap, image: d }), { requestId: v, generateId: m, generateType: g, text2imageParams: _, blendParams: y, } = f; return { key: h, resourceId: h, effectId: c.effectId, effectType: c.effectType, title: null !== (o = c.title) && void 0 !== o ? o : "", description: c.description, coverUrl: c.coverUrl, createTime: c.createTime, aspectRatio: null !== (s = c.aspectRatio) && void 0 !== s ? s : 1, format: d.format, width: null === (i = d.largeImages[0]) || void 0 === i ? void 0 : i.width, height: null === (a = d.largeImages[0]) || void 0 === a ? void 0 : a.height, transcode: p, author: u ? { avatar: u.avatarUrl, name: u.name, uid: u.secUid } : void 0, aigcParams: { requestId: null !== (l = null != v ? v : e.requestId) && void 0 !== l ? l : "", generateId: m, generateType: g, text2imageParams: _ ? (0, n._)({}, _) : _, blendParams: y ? (0, n._)({}, y) : y, }, historyRecordId: t ? String(t) : "", aigcItemId: c.localItemId ? String(c.localItemId) : "", publishedItemId: c.publishedItemId ? String(c.publishedItemId) : "", }; } }, 808515: function (e, t, i) { "use strict"; i.d(t, { B: function () { return r; }, N: function () { return n; }, }); var n = [360, 480, 720, 1080, 2400]; function r(e) { var { coverUrlMap: t, image: i } = e; if (t) { var { width: r = 1, height: a = 1, imageUrl: o, imageUri: s, } = null !== (f = i.largeImages[0]) && void 0 !== f ? f : {}, l = r / a, c = {}; n.forEach((e) => { c[e] = t[e]; }), (u = Object.keys(c) .filter((e) => { var t = Number(e); return !(!isFinite(t) || t > Math.max(r, a)) && !0; }) .map((e) => { var t, i, n = Number(e); return ( r > a ? ((t = n), (i = Math.round(n / l))) : ((i = n), (t = Math.round(n * l))), { width: t, height: i, url: c[e], uri: s } ); })); var d = Math.max(r, a); if (!u.some((e) => Math.max(e.width, e.height) >= d) && d <= 2400) { var u, f, h, p = Math.max(...Object.keys(c).map(Number)), v = null !== (h = c[p]) && void 0 !== h ? h : o; u.push({ width: r, height: a, url: v, uri: s }); } } else { var m = i.largeImages[0]; u = [ { url: m.imageUrl, uri: null == m ? void 0 : m.imageUri, width: m.width, height: m.height, }, ]; } return u; } }, 926838: function (e, t, i) { "use strict"; i.d(t, { a: function () { return n; }, }); var n = (function (e) { return ( (e.Unknown = "unknown"), (e.Preparing = "Preparing"), (e.Prepared = "Prepared"), (e.PrepareFailure = "PrepareFailure"), (e.WaitingUpload = "waitingUpload"), (e.Uploading = "uploading"), (e.UploadFailure = "uploadFailure"), (e.Uploaded = "uploaded"), (e.Transcoding = "transcoding"), (e.TranscodeFailure = "transcodeFailure"), (e.Transcoded = "transcoded"), (e.WaitForSync2UserMaterial = "waitForSync2UserMaterial"), (e.Syncing2UserMaterial = "syncing2UserMaterial"), (e.Synced2UserMaterial = "synced2UserMaterial"), (e.Sync2UserMaterialFailure = "sync2UserMaterialFailure"), (e.Success = "Success"), e ); })({}); }, 56168: function (e, t, i) { "use strict"; i.d(t, { C: function () { return d; }, K: function () { return c; }, }); var n = i(625572), r = i(639880), a = i(820266), o = i(243090), s = i(43169), l = i(782650); function c(e) { var t = (0, a.b)((0, o.D)(e)); return { playInfoDuration: null == t ? void 0 : t.playInfoDuration, audioStreamingDuration: null == t ? void 0 : t.aDuration, videoStreamingDuration: null == t ? void 0 : t.vDuration, }; } function d(e, t) { var i, a, o, d, u, f, h, p, v, m, g, _, y, b, I, w, x, S, M, C, T, A, k, P, E, D, R, N, { commonAttr: L, video: j, author: O, aigcImageParams: B } = e, F = "".concat(L.id), { requestId: U, generateId: G, generateType: z, text2videoParams: V, } = B, { originVideo: W } = j, { transcodedVideo: Z } = j; !W && (W = null !== (y = null !== (_ = null === (v = j.transcodedVideo) || void 0 === v ? void 0 : v.origin) && void 0 !== _ ? _ : null === (m = j.transcodedVideo) || void 0 === m ? void 0 : m["720p"]) && void 0 !== y ? y : null === (g = j.transcodedVideo) || void 0 === g ? void 0 : g["360p"]), (0, l.Ks)(e); var K = c(j.durationInfo), H = (null == K ? void 0 : K.playInfoDuration) ? (null == K ? void 0 : K.playInfoDuration) * 1e3 : j.durationMs, q = Math.round(H / 1e3); return (0, n._)( { key: F, resourceId: F, effectId: L.effectId, effectType: L.effectType, title: null !== (b = L.title) && void 0 !== b ? b : "", description: L.description, coverUrl: L.coverUrl, coverUri: L.coverUri, coverUrlMap: null !== (I = L.coverUrlMap) && void 0 !== I ? I : {}, watermarkType: j.watermarkType, createTime: L.createTime, aspectRatio: null !== (w = L.aspectRatio) && void 0 !== w ? w : 1, duration: q, durationMs: H, durationInfo: 0 === Object.values(K).length ? { playInfoDuration: q, audioStreamingDuration: q, videoStreamingDuration: q, } : K, author: O ? { avatar: O.avatarUrl, name: O.name, uid: O.secUid } : void 0, thumb: { thumbCommonInfo: { singleFrameHeight: null !== (x = null === (a = j.thumb) || void 0 === a ? void 0 : null === (i = a.thumbCommonInfo) || void 0 === i ? void 0 : i.singleFrameHeight) && void 0 !== x ? x : 0, singleFrameWidth: null !== (S = null === (d = j.thumb) || void 0 === d ? void 0 : null === (o = d.thumbCommonInfo) || void 0 === o ? void 0 : o.singleFrameWidth) && void 0 !== S ? S : 0, totalSetNum: null !== (M = null === (f = j.thumb) || void 0 === f ? void 0 : null === (u = f.thumbCommonInfo) || void 0 === u ? void 0 : u.totalSetNum) && void 0 !== M ? M : 0, }, detailInfos: null !== (C = null === (p = j.thumb) || void 0 === p ? void 0 : null === (h = p.detailInfos) || void 0 === h ? void 0 : h.map((e) => ({ frameCount: e.frameCount, imageHeight: e.imageHeight, imageWidth: e.imageWidth, mimeType: e.mimeType, url: e.url, uri: e.uri, }))) && void 0 !== C ? C : [], }, originVideo: { definition: null !== (T = null == W ? void 0 : W.definition) && void 0 !== T ? T : "", format: null !== (A = null == W ? void 0 : W.format) && void 0 !== A ? A : "", height: null !== (k = null == W ? void 0 : W.height) && void 0 !== k ? k : 0, width: null !== (P = null == W ? void 0 : W.width) && void 0 !== P ? P : 0, size: null !== (E = null == W ? void 0 : W.size) && void 0 !== E ? E : 0, url: null !== (D = null == W ? void 0 : W.videoUrl) && void 0 !== D ? D : "", fps: null !== (R = null == W ? void 0 : W.fps) && void 0 !== R ? R : 0, }, transcode: Object.keys(null != Z ? Z : {}).reduce((e, t) => { var i = null == Z ? void 0 : Z[t]; return i ? (0, r._)((0, n._)({}, e), { [t]: { definition: i.definition, format: i.format, height: i.height, width: i.width, size: i.size, url: i.videoUrl, }, }) : e; }, {}), transcodeStatus: j.transcodeStatus, videoSizeType: j.videoSizeType, aigcParams: { requestId: null !== (N = null != U ? U : e.requestId) && void 0 !== N ? N : "", generateId: G, generateType: z, text2videoParams: V ? (0, r._)((0, n._)({}, V), { videoGenInputs: V.videoGenInputs.map((e) => (0, r._)((0, n._)({}, e), { firstFrameImage: e.firstFrameImage ? (0, r._)((0, n._)({}, e.firstFrameImage), { aigcImage: e.firstFrameImage.aigcImage ? (0, r._)( (0, n._)({}, e.firstFrameImage.aigcImage), { aigcImageParams: (0, r._)( (0, n._)( {}, e.firstFrameImage.aigcImage .aigcImageParams ), { text2imageParams: e.firstFrameImage.aigcImage .aigcImageParams.text2imageParams, } ), } ) : void 0, }) : void 0, }) ), }) : V, }, videoId: j.videoId, historyRecordId: t ? String(t) : "", aigcItemId: L.localItemId ? String(L.localItemId) : "", publishedItemId: L.publishedItemId ? String(L.publishedItemId) : void 0, thirdResourceId: L.thirdResourceId ? String(L.thirdResourceId) : void 0, isMute: j.isMute, }, (0, s.S)(e) ); } }, 519927: function (e, t, i) { "use strict"; i.d(t, { l: function () { return n; }, }); var n = (function (e) { return (e.PAGE_LOAD = "PAGE_LOAD"), (e.PAGE_IDLE = "PAGE_IDLE"), e; })({}); }, 252805: function (e, t, i) { "use strict"; i.d(t, { f: function () { return n; }, }); var n = (0, i(333597).yh)("preload"); }, 184564: function (e, t, i) { "use strict"; function n(e) { if (!e._fullResourceBrand) Object.defineProperty(e, "_fullResourceBrand", { value: () => !0, enumerable: !1, writable: !1, }); } function r(e) { return void 0 !== e._fullResourceBrand || !1; } i.d(t, { K: function () { return n; }, R: function () { return r; }, }); }, 819277: function (e, t, i) { "use strict"; i.d(t, { l: function () { return r; }, }); var n = i(184564); function r(e, t) { var i = !(arguments.length > 2) || void 0 === arguments[2] || arguments[2], r = Object.assign({}, { type: e }, t); return i && (0, n.K)(r), { key: r.key, resource: r }; } }, 434487: function (e, t, i) { "use strict"; i.d(t, { GL: function () { return c; }, U3: function () { return d; }, fA: function () { return l; }, nQ: function () { return u; }, }); var n = i(625572), r = i(639880), a = i(474956), o = i(926838), s = i(819277); function l(e) { return ( !![ o.a.Transcoded, o.a.WaitForSync2UserMaterial, o.a.Syncing2UserMaterial, o.a.Synced2UserMaterial, o.a.Sync2UserMaterialFailure, o.a.Success, ].includes(e.status) || !1 ); } function c(e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], { onModelUpdate: a, onResourceReady: o } = e; return (0, s.l)( t, (0, r._)((0, n._)({}, e), { onProgress: a, onReady: o }), i || l(e) ); } function d(e, t, i) { var n; return ( (n = [ a._g.UserAudio, a._g.UserFile, a._g.UserPhoto, a._g.UserVideo, a._g.UserFile, ].includes(t) ? c(i, t) : (0, s.l)(t, i)), e.add(n.key, n.resource), n ); } function u(e, t, i) { var n = d(e, t, i); return e.get(n.key, t); } }, 678244: function () {}, 639416: function () {}, 285499: function () {}, 403204: function () {}, 14059: function () {}, 821353: function () {}, 711900: function () {}, 861879: function (e, t, i) { "use strict"; i.d(t, { to: () => iE, q_: () => iC, bY: () => iM, Qr: () => ih, q: () => iq, Z5: () => eA, }); var n, r, a, o = i("218571"), s = Object.defineProperty, l = {}; ((e, t) => { for (var i in t) s(e, i, { get: t[i], enumerable: !0 }); })(l, { assign: () => G, colors: () => B, createStringInterpolator: () => n, skipAnimation: () => F, to: () => r, willAdvance: () => U, }); var c = C(), d = (e) => I(e, c), u = C(); d.write = (e) => I(e, u); var f = C(); d.onStart = (e) => I(e, f); var h = C(); d.onFrame = (e) => I(e, h); var p = C(); d.onFinish = (e) => I(e, p); var v = []; d.setTimeout = (e, t) => { let i = d.now() + t, n = () => { let e = v.findIndex((e) => e.cancel == n); ~e && v.splice(e, 1), (y -= ~e ? 1 : 0); }, r = { time: i, handler: e, cancel: n }; return v.splice(m(i), 0, r), (y += 1), w(), r; }; var m = (e) => ~(~v.findIndex((t) => t.time > e) || ~v.length); (d.cancel = (e) => { f.delete(e), h.delete(e), p.delete(e), c.delete(e), u.delete(e); }), (d.sync = (e) => { (b = !0), d.batchedUpdates(e), (b = !1); }), (d.throttle = (e) => { let t; function i() { try { e(...t); } finally { t = null; } } function n(...e) { (t = e), d.onStart(i); } return ( (n.handler = e), (n.cancel = () => { f.delete(i), (t = null); }), n ); }); var g = "undefined" != typeof window ? window.requestAnimationFrame : () => {}; (d.use = (e) => (g = e)), (d.now = "undefined" != typeof performance ? () => performance.now() : Date.now), (d.batchedUpdates = (e) => e()), (d.catch = console.error), (d.frameLoop = "always"), (d.advance = () => { "demand" !== d.frameLoop ? console.warn( "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" ) : M(); }); var _ = -1, y = 0, b = !1; function I(e, t) { b ? (t.delete(e), e(0)) : (t.add(e), w()); } function w() { _ < 0 && ((_ = 0), "demand" !== d.frameLoop && g(S)); } function x() { _ = -1; } function S() { ~_ && (g(S), d.batchedUpdates(M)); } function M() { let e = _, t = m((_ = d.now())); if ((t && (T(v.splice(0, t), (e) => e.handler()), (y -= t)), !y)) { x(); return; } f.flush(), c.flush(e ? Math.min(64, _ - e) : 16.667), h.flush(), u.flush(), p.flush(); } function C() { let e = new Set(), t = e; return { add(i) { (y += t != e || e.has(i) ? 0 : 1), e.add(i); }, delete: (i) => ((y -= t == e && e.has(i) ? 1 : 0), e.delete(i)), flush(i) { t.size && ((e = new Set()), (y -= t.size), T(t, (t) => t(i) && e.add(t)), (y += e.size), (t = e)); }, }; } function T(e, t) { e.forEach((e) => { try { t(e); } catch (e) { d.catch(e); } }); } function A() {} var k = (e, t, i) => Object.defineProperty(e, t, { value: i, writable: !0, configurable: !0, }), P = { arr: Array.isArray, obj: (e) => !!e && "Object" === e.constructor.name, fun: (e) => "function" == typeof e, str: (e) => "string" == typeof e, num: (e) => "number" == typeof e, und: (e) => void 0 === e, }; function E(e, t) { if (P.arr(e)) { if (!P.arr(t) || e.length !== t.length) return !1; for (let i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1; return !0; } return e === t; } var D = (e, t) => e.forEach(t); function R(e, t, i) { if (P.arr(e)) { for (let n = 0; n < e.length; n++) t.call(i, e[n], `${n}`); return; } for (let n in e) e.hasOwnProperty(n) && t.call(i, e[n], n); } var N = (e) => (P.und(e) ? [] : P.arr(e) ? e : [e]); function L(e, t) { if (e.size) { let i = Array.from(e); e.clear(), D(i, t); } } var j = (e, ...t) => L(e, (e) => e(...t)), O = () => "undefined" == typeof window || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), B = null, F = !1, U = A, G = (e) => { e.to && (r = e.to), e.now && (d.now = e.now), void 0 !== e.colors && (B = e.colors), null != e.skipAnimation && (F = e.skipAnimation), e.createStringInterpolator && (n = e.createStringInterpolator), e.requestAnimationFrame && d.use(e.requestAnimationFrame), e.batchedUpdates && (d.batchedUpdates = e.batchedUpdates), e.willAdvance && (U = e.willAdvance), e.frameLoop && (d.frameLoop = e.frameLoop); }, z = new Set(), V = [], W = [], Z = 0, K = { get idle() { return !z.size && !V.length; }, start(e) { Z > e.priority ? (z.add(e), d.onStart(H)) : (q(e), d(Y)); }, advance: Y, sort(e) { if (Z) d.onFrame(() => K.sort(e)); else { let t = V.indexOf(e); ~t && (V.splice(t, 1), J(e)); } }, clear() { (V = []), z.clear(); }, }; function H() { z.forEach(q), z.clear(), d(Y); } function q(e) { !V.includes(e) && J(e); } function J(e) { V.splice( Q(V, (t) => t.priority > e.priority), 0, e ); } function Y(e) { let t = W; for (let i = 0; i < V.length; i++) { let n = V[i]; (Z = n.priority), !n.idle && (U(n), n.advance(e), !n.idle && t.push(n)); } return (Z = 0), ((W = V).length = 0), (V = t).length > 0; } function Q(e, t) { let i = e.findIndex(t); return i < 0 ? e.length : i; } var X = (e, t, i) => Math.min(Math.max(i, e), t), $ = { transparent: 0, aliceblue: 0xf0f8ffff, antiquewhite: 0xfaebd7ff, aqua: 0xffffff, aquamarine: 0x7fffd4ff, azure: 0xf0ffffff, beige: 0xf5f5dcff, bisque: 0xffe4c4ff, black: 255, blanchedalmond: 0xffebcdff, blue: 65535, blueviolet: 0x8a2be2ff, brown: 0xa52a2aff, burlywood: 0xdeb887ff, burntsienna: 0xea7e5dff, cadetblue: 0x5f9ea0ff, chartreuse: 0x7fff00ff, chocolate: 0xd2691eff, coral: 0xff7f50ff, cornflowerblue: 0x6495edff, cornsilk: 0xfff8dcff, crimson: 0xdc143cff, cyan: 0xffffff, darkblue: 35839, darkcyan: 9145343, darkgoldenrod: 0xb8860bff, darkgray: 0xa9a9a9ff, darkgreen: 6553855, darkgrey: 0xa9a9a9ff, darkkhaki: 0xbdb76bff, darkmagenta: 0x8b008bff, darkolivegreen: 0x556b2fff, darkorange: 0xff8c00ff, darkorchid: 0x9932ccff, darkred: 0x8b0000ff, darksalmon: 0xe9967aff, darkseagreen: 0x8fbc8fff, darkslateblue: 0x483d8bff, darkslategray: 0x2f4f4fff, darkslategrey: 0x2f4f4fff, darkturquoise: 0xced1ff, darkviolet: 0x9400d3ff, deeppink: 0xff1493ff, deepskyblue: 0xbfffff, dimgray: 0x696969ff, dimgrey: 0x696969ff, dodgerblue: 0x1e90ffff, firebrick: 0xb22222ff, floralwhite: 0xfffaf0ff, forestgreen: 0x228b22ff, fuchsia: 0xff00ffff, gainsboro: 0xdcdcdcff, ghostwhite: 0xf8f8ffff, gold: 0xffd700ff, goldenrod: 0xdaa520ff, gray: 0x808080ff, green: 8388863, greenyellow: 0xadff2fff, grey: 0x808080ff, honeydew: 0xf0fff0ff, hotpink: 0xff69b4ff, indianred: 0xcd5c5cff, indigo: 0x4b0082ff, ivory: 0xfffff0ff, khaki: 0xf0e68cff, lavender: 0xe6e6faff, lavenderblush: 0xfff0f5ff, lawngreen: 0x7cfc00ff, lemonchiffon: 0xfffacdff, lightblue: 0xadd8e6ff, lightcoral: 0xf08080ff, lightcyan: 0xe0ffffff, lightgoldenrodyellow: 0xfafad2ff, lightgray: 0xd3d3d3ff, lightgreen: 0x90ee90ff, lightgrey: 0xd3d3d3ff, lightpink: 0xffb6c1ff, lightsalmon: 0xffa07aff, lightseagreen: 0x20b2aaff, lightskyblue: 0x87cefaff, lightslategray: 0x778899ff, lightslategrey: 0x778899ff, lightsteelblue: 0xb0c4deff, lightyellow: 0xffffe0ff, lime: 0xff00ff, limegreen: 0x32cd32ff, linen: 0xfaf0e6ff, magenta: 0xff00ffff, maroon: 0x800000ff, mediumaquamarine: 0x66cdaaff, mediumblue: 52735, mediumorchid: 0xba55d3ff, mediumpurple: 0x9370dbff, mediumseagreen: 0x3cb371ff, mediumslateblue: 0x7b68eeff, mediumspringgreen: 0xfa9aff, mediumturquoise: 0x48d1ccff, mediumvioletred: 0xc71585ff, midnightblue: 0x191970ff, mintcream: 0xf5fffaff, mistyrose: 0xffe4e1ff, moccasin: 0xffe4b5ff, navajowhite: 0xffdeadff, navy: 33023, oldlace: 0xfdf5e6ff, olive: 0x808000ff, olivedrab: 0x6b8e23ff, orange: 0xffa500ff, orangered: 0xff4500ff, orchid: 0xda70d6ff, palegoldenrod: 0xeee8aaff, palegreen: 0x98fb98ff, paleturquoise: 0xafeeeeff, palevioletred: 0xdb7093ff, papayawhip: 0xffefd5ff, peachpuff: 0xffdab9ff, peru: 0xcd853fff, pink: 0xffc0cbff, plum: 0xdda0ddff, powderblue: 0xb0e0e6ff, purple: 0x800080ff, rebeccapurple: 0x663399ff, red: 0xff0000ff, rosybrown: 0xbc8f8fff, royalblue: 0x4169e1ff, saddlebrown: 0x8b4513ff, salmon: 0xfa8072ff, sandybrown: 0xf4a460ff, seagreen: 0x2e8b57ff, seashell: 0xfff5eeff, sienna: 0xa0522dff, silver: 0xc0c0c0ff, skyblue: 0x87ceebff, slateblue: 0x6a5acdff, slategray: 0x708090ff, slategrey: 0x708090ff, snow: 0xfffafaff, springgreen: 0xff7fff, steelblue: 0x4682b4ff, tan: 0xd2b48cff, teal: 8421631, thistle: 0xd8bfd8ff, tomato: 0xff6347ff, turquoise: 0x40e0d0ff, violet: 0xee82eeff, wheat: 0xf5deb3ff, white: 0xffffffff, whitesmoke: 0xf5f5f5ff, yellow: 0xffff00ff, yellowgreen: 0x9acd32ff, }, ee = "[-+]?\\d*\\.?\\d+", et = ee + "%"; function ei(...e) { return "\\(\\s*(" + e.join(")\\s*,\\s*(") + ")\\s*\\)"; } var en = RegExp("rgb" + ei(ee, ee, ee)), er = RegExp("rgba" + ei(ee, ee, ee, ee)), ea = RegExp("hsl" + ei(ee, et, et)), eo = RegExp("hsla" + ei(ee, et, et, ee)), es = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, el = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, ec = /^#([0-9a-fA-F]{6})$/, ed = /^#([0-9a-fA-F]{8})$/; function eu(e) { let t; return "number" == typeof e ? e >>> 0 === e && e >= 0 && e <= 0xffffffff ? e : null : (t = ec.exec(e)) ? parseInt(t[1] + "ff", 16) >>> 0 : B && void 0 !== B[e] ? B[e] : (t = en.exec(e)) ? ((ep(t[1]) << 24) | (ep(t[2]) << 16) | (ep(t[3]) << 8) | 255) >>> 0 : (t = er.exec(e)) ? ((ep(t[1]) << 24) | (ep(t[2]) << 16) | (ep(t[3]) << 8) | em(t[4])) >>> 0 : (t = es.exec(e)) ? parseInt(t[1] + t[1] + t[2] + t[2] + t[3] + t[3] + "ff", 16) >>> 0 : (t = ed.exec(e)) ? parseInt(t[1], 16) >>> 0 : (t = el.exec(e)) ? parseInt( t[1] + t[1] + t[2] + t[2] + t[3] + t[3] + t[4] + t[4], 16 ) >>> 0 : (t = ea.exec(e)) ? (255 | eh(ev(t[1]), eg(t[2]), eg(t[3]))) >>> 0 : (t = eo.exec(e)) ? (eh(ev(t[1]), eg(t[2]), eg(t[3])) | em(t[4])) >>> 0 : null; } function ef(e, t, i) { return (i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6) ? e + (t - e) * 6 * i : i < 0.5 ? t : i < 2 / 3 ? e + (t - e) * (2 / 3 - i) * 6 : e; } function eh(e, t, i) { let n = i < 0.5 ? i * (1 + t) : i + t - i * t, r = 2 * i - n, a = ef(r, n, e + 1 / 3), o = ef(r, n, e); return ( (Math.round(255 * a) << 24) | (Math.round(255 * o) << 16) | (Math.round(255 * ef(r, n, e - 1 / 3)) << 8) ); } function ep(e) { let t = parseInt(e, 10); return t < 0 ? 0 : t > 255 ? 255 : t; } function ev(e) { return (((parseFloat(e) % 360) + 360) % 360) / 360; } function em(e) { let t = parseFloat(e); return t < 0 ? 0 : t > 1 ? 255 : Math.round(255 * t); } function eg(e) { let t = parseFloat(e); return t < 0 ? 0 : t > 100 ? 1 : t / 100; } function e_(e) { let t = eu(e); if (null === t) return e; let i = (0xff000000 & (t = t || 0)) >>> 24, n = (0xff0000 & t) >>> 16, r = (65280 & t) >>> 8, a = (255 & t) / 255; return `rgba(${i}, ${n}, ${r}, ${a})`; } var ey = (e, t, i) => { if (P.fun(e)) return e; if (P.arr(e)) return ey({ range: e, output: t, extrapolate: i }); if (P.str(e.output[0])) return n(e); let r = e, a = r.output, o = r.range || [0, 1], s = r.extrapolateLeft || r.extrapolate || "extend", l = r.extrapolateRight || r.extrapolate || "extend", c = r.easing || ((e) => e); return (e) => { let t = eI(e, o); return eb(e, o[t], o[t + 1], a[t], a[t + 1], c, s, l, r.map); }; }; function eb(e, t, i, n, r, a, o, s, l) { let c = l ? l(e) : e; if (c < t) { if ("identity" === o) return c; "clamp" === o && (c = t); } if (c > i) { if ("identity" === s) return c; "clamp" === s && (c = i); } return n === r ? n : t === i ? e <= t ? n : r : (t === -1 / 0 ? (c = -c) : i === 1 / 0 ? (c -= t) : (c = (c - t) / (i - t)), (c = a(c)), n === -1 / 0 ? (c = -c) : r === 1 / 0 ? (c += n) : (c = c * (r - n) + n), c); } function eI(e, t) { for (var i = 1; i < t.length - 1 && !(t[i] >= e); ++i); return i - 1; } var ew = 1.70158, ex = 2.5949095, eS = 2.70158, eM = (2 * Math.PI) / 3, eC = (2 * Math.PI) / 4.5, eT = (e) => { let t = 7.5625, i = 2.75; if (e < 0.36363636363636365) return t * e * e; if (e < 2 / i) return t * (e -= 1.5 / i) * e + 0.75; if (e < 2.5 / i) return t * (e -= 2.25 / i) * e + 0.9375; else return t * (e -= 2.625 / i) * e + 0.984375; }, eA = { linear: (e) => e, easeInQuad: (e) => e * e, easeOutQuad: (e) => 1 - (1 - e) * (1 - e), easeInOutQuad: (e) => e < 0.5 ? 2 * e * e : 1 - Math.pow(-2 * e + 2, 2) / 2, easeInCubic: (e) => e * e * e, easeOutCubic: (e) => 1 - Math.pow(1 - e, 3), easeInOutCubic: (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2, easeInQuart: (e) => e * e * e * e, easeOutQuart: (e) => 1 - Math.pow(1 - e, 4), easeInOutQuart: (e) => e < 0.5 ? 8 * e * e * e * e : 1 - Math.pow(-2 * e + 2, 4) / 2, easeInQuint: (e) => e * e * e * e * e, easeOutQuint: (e) => 1 - Math.pow(1 - e, 5), easeInOutQuint: (e) => e < 0.5 ? 16 * e * e * e * e * e : 1 - Math.pow(-2 * e + 2, 5) / 2, easeInSine: (e) => 1 - Math.cos((e * Math.PI) / 2), easeOutSine: (e) => Math.sin((e * Math.PI) / 2), easeInOutSine: (e) => -(Math.cos(Math.PI * e) - 1) / 2, easeInExpo: (e) => (0 === e ? 0 : Math.pow(2, 10 * e - 10)), easeOutExpo: (e) => (1 === e ? 1 : 1 - Math.pow(2, -10 * e)), easeInOutExpo: (e) => 0 === e ? 0 : 1 === e ? 1 : e < 0.5 ? Math.pow(2, 20 * e - 10) / 2 : (2 - Math.pow(2, -20 * e + 10)) / 2, easeInCirc: (e) => 1 - Math.sqrt(1 - Math.pow(e, 2)), easeOutCirc: (e) => Math.sqrt(1 - Math.pow(e - 1, 2)), easeInOutCirc: (e) => e < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * e, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * e + 2, 2)) + 1) / 2, easeInBack: (e) => eS * e * e * e - ew * e * e, easeOutBack: (e) => 1 + eS * Math.pow(e - 1, 3) + ew * Math.pow(e - 1, 2), easeInOutBack: (e) => e < 0.5 ? (Math.pow(2 * e, 2) * ((ex + 1) * 2 * e - ex)) / 2 : (Math.pow(2 * e - 2, 2) * ((ex + 1) * (2 * e - 2) + ex) + 2) / 2, easeInElastic: (e) => 0 === e ? 0 : 1 === e ? 1 : -Math.pow(2, 10 * e - 10) * Math.sin((10 * e - 10.75) * eM), easeOutElastic: (e) => 0 === e ? 0 : 1 === e ? 1 : Math.pow(2, -10 * e) * Math.sin((10 * e - 0.75) * eM) + 1, easeInOutElastic: (e) => 0 === e ? 0 : 1 === e ? 1 : e < 0.5 ? -(Math.pow(2, 20 * e - 10) * Math.sin((20 * e - 11.125) * eC)) / 2 : (Math.pow(2, -20 * e + 10) * Math.sin((20 * e - 11.125) * eC)) / 2 + 1, easeInBounce: (e) => 1 - eT(1 - e), easeOutBounce: eT, easeInOutBounce: (e) => e < 0.5 ? (1 - eT(1 - 2 * e)) / 2 : (1 + eT(2 * e - 1)) / 2, steps: (e, t = "end") => (i) => { let n = (i = "end" === t ? Math.min(i, 0.999) : Math.max(i, 0.001)) * e; return X(0, 1, ("end" === t ? Math.floor(n) : Math.ceil(n)) / e); }, }, ek = Symbol.for("FluidValue.get"), eP = Symbol.for("FluidValue.observers"), eE = (e) => !!(e && e[ek]), eD = (e) => (e && e[ek] ? e[ek]() : e), eR = (e) => e[eP] || null; function eN(e, t) { e.eventObserved ? e.eventObserved(t) : e(t); } function eL(e, t) { let i = e[eP]; i && i.forEach((e) => { eN(e, t); }); } var ej = class { constructor(e) { if (!e && !(e = this.get)) throw Error("Unknown getter"); eO(this, e); } }, eO = (e, t) => eU(e, ek, t); function eB(e, t) { if (e[ek]) { let i = e[eP]; !i && eU(e, eP, (i = new Set())), !i.has(t) && (i.add(t), e.observerAdded && e.observerAdded(i.size, t)); } return t; } function eF(e, t) { let i = e[eP]; if (i && i.has(t)) { let n = i.size - 1; n ? i.delete(t) : (e[eP] = null), e.observerRemoved && e.observerRemoved(n, t); } } var eU = (e, t, i) => Object.defineProperty(e, t, { value: i, writable: !0, configurable: !0, }), eG = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ez = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, eV = RegExp(`(${eG.source})(%|[a-z]+)`, "i"), eW = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, eZ = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, eK = (e) => { let [t, i] = eH(e); if (!t || O()) return e; let n = window .getComputedStyle(document.documentElement) .getPropertyValue(t); if (n) return n.trim(); if (i && i.startsWith("--")) { let e = window .getComputedStyle(document.documentElement) .getPropertyValue(i); if (e) return e; } else if (i && eZ.test(i)) return eK(i); else if (i) return i; return e; }, eH = (e) => { let t = eZ.exec(e); if (!t) return [,]; let [, i, n] = t; return [i, n]; }, eq = (e, t, i, n, r) => `rgba(${Math.round(t)}, ${Math.round(i)}, ${Math.round(n)}, ${r})`, eJ = (e) => { !a && (a = B ? RegExp(`(${Object.keys(B).join("|")})(?!\\w)`, "g") : /^\b$/); let t = e.output.map((e) => eD(e).replace(eZ, eK).replace(ez, e_).replace(a, e_) ), i = t.map((e) => e.match(eG).map(Number)), n = i[0] .map((e, t) => i.map((e) => { if (!(t in e)) throw Error( 'The arity of each "output" value must be equal' ); return e[t]; }) ) .map((t) => ey({ ...e, output: t })); return (e) => { let i = !eV.test(t[0]) && t.find((e) => eV.test(e))?.replace(eG, ""), r = 0; return t[0] .replace(eG, () => `${n[r++](e)}${i || ""}`) .replace(eW, eq); }; }, eY = "react-spring: ", eQ = (e) => { let t = e, i = !1; if ("function" != typeof t) throw TypeError(`${eY}once requires a function parameter`); return (...e) => { !i && (t(...e), (i = !0)); }; }, eX = eQ(console.warn); function e$() { eX( `${eY}The "interpolate" function is deprecated in v9 (use "to" instead)` ); } var e0 = eQ(console.warn); function e1() { e0( `${eY}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions` ); } function e2(e) { return ( P.str(e) && ("#" == e[0] || /\d/.test(e) || (!O() && eZ.test(e)) || e in (B || {})) ); } var e6 = O() ? o.useEffect : o.useLayoutEffect, e4 = () => { let e = (0, o.useRef)(!1); return ( e6( () => ( (e.current = !0), () => { e.current = !1; } ), [] ), e ); }; function e3() { let e = (0, o.useState)()[1], t = e4(); return () => { t.current && e(Math.random()); }; } function e8(e, t) { let [i] = (0, o.useState)(() => ({ inputs: t, result: e() })), n = (0, o.useRef)(), r = n.current, a = r; return ( a ? !(t && a.inputs && e9(t, a.inputs)) && (a = { inputs: t, result: e() }) : (a = i), (0, o.useEffect)(() => { (n.current = a), r == i && (i.inputs = i.result = void 0); }, [a]), a.result ); } function e9(e, t) { if (e.length !== t.length) return !1; for (let i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1; return !0; } var e5 = (e) => (0, o.useEffect)(e, e7), e7 = []; function te(e) { let t = (0, o.useRef)(); return ( (0, o.useEffect)(() => { t.current = e; }), t.current ); } var tt = Symbol.for("Animated:node"), ti = (e) => !!e && e[tt] === e, tn = (e) => e && e[tt], tr = (e, t) => k(e, tt, t), ta = (e) => e && e[tt] && e[tt].getPayload(), to = class { constructor() { tr(this, this); } getPayload() { return this.payload || []; } }, ts = class extends to { constructor(e) { super(), (this._value = e), (this.done = !0), (this.durationProgress = 0), P.num(this._value) && (this.lastPosition = this._value); } static create(e) { return new ts(e); } getPayload() { return [this]; } getValue() { return this._value; } setValue(e, t) { return ( P.num(e) && ((this.lastPosition = e), t && ((e = Math.round(e / t) * t), this.done && (this.lastPosition = e))), this._value !== e && ((this._value = e), !0) ); } reset() { let { done: e } = this; (this.done = !1), P.num(this._value) && ((this.elapsedTime = 0), (this.durationProgress = 0), (this.lastPosition = this._value), e && (this.lastVelocity = null), (this.v0 = null)); } }, tl = class extends ts { constructor(e) { super(0), (this._string = null), (this._toString = ey({ output: [e, e] })); } static create(e) { return new tl(e); } getValue() { let e = this._string; return null == e ? (this._string = this._toString(this._value)) : e; } setValue(e) { if (P.str(e)) { if (e == this._string) return !1; (this._string = e), (this._value = 1); } else { if (!super.setValue(e)) return !1; this._string = null; } return !0; } reset(e) { e && (this._toString = ey({ output: [this.getValue(), e] })), (this._value = 0), super.reset(); } }, tc = { dependencies: null }, td = class extends to { constructor(e) { super(), (this.source = e), this.setValue(e); } getValue(e) { let t = {}; return ( R(this.source, (i, n) => { ti(i) ? (t[n] = i.getValue(e)) : eE(i) ? (t[n] = eD(i)) : !e && (t[n] = i); }), t ); } setValue(e) { (this.source = e), (this.payload = this._makePayload(e)); } reset() { this.payload && D(this.payload, (e) => e.reset()); } _makePayload(e) { if (e) { let t = new Set(); return R(e, this._addToPayload, t), Array.from(t); } } _addToPayload(e) { tc.dependencies && eE(e) && tc.dependencies.add(e); let t = ta(e); t && D(t, (e) => this.add(e)); } }, tu = class extends td { constructor(e) { super(e); } static create(e) { return new tu(e); } getValue() { return this.source.map((e) => e.getValue()); } setValue(e) { let t = this.getPayload(); return e.length == t.length ? t.map((t, i) => t.setValue(e[i])).some(Boolean) : (super.setValue(e.map(tf)), !0); } }; function tf(e) { return (e2(e) ? tl : ts).create(e); } function th(e) { let t = tn(e); return t ? t.constructor : P.arr(e) ? tu : e2(e) ? tl : ts; } var tp = (e, t) => { let i = !P.fun(e) || (e.prototype && e.prototype.isReactComponent); return (0, o.forwardRef)((n, r) => { let a = (0, o.useRef)(null), s = i && (0, o.useCallback)( (e) => { a.current = tg(r, e); }, [r] ), [l, c] = tm(n, t), u = e3(), f = () => { let e = a.current; if (!i || !!e) !1 === (!!e && t.applyAnimatedValues(e, l.getValue(!0))) && u(); }, h = new tv(f, c), p = (0, o.useRef)(); e6( () => ( (p.current = h), D(c, (e) => eB(e, h)), () => { p.current && (D(p.current.deps, (e) => eF(e, p.current)), d.cancel(p.current.update)); } ) ), (0, o.useEffect)(f, []), e5(() => () => { let e = p.current; D(e.deps, (t) => eF(t, e)); }); let v = t.getComponentProps(l.getValue()); return o.createElement(e, { ...v, ref: s }); }); }, tv = class { constructor(e, t) { (this.update = e), (this.deps = t); } eventObserved(e) { "change" == e.type && d.write(this.update); } }; function tm(e, t) { let i = new Set(); return ( (tc.dependencies = i), e.style && (e = { ...e, style: t.createAnimatedStyle(e.style) }), (e = new td(e)), (tc.dependencies = null), [e, i] ); } function tg(e, t) { return e && (P.fun(e) ? e(t) : (e.current = t)), t; } var t_ = Symbol.for("AnimatedComponent"), ty = ( e, { applyAnimatedValues: t = () => !1, createAnimatedStyle: i = (e) => new td(e), getComponentProps: n = (e) => e, } = {} ) => { let r = { applyAnimatedValues: t, createAnimatedStyle: i, getComponentProps: n, }, a = (e) => { let t = tb(e) || "Anonymous"; return ( ((e = P.str(e) ? a[e] || (a[e] = tp(e, r)) : e[t_] || (e[t_] = tp(e, r))).displayName = `Animated(${t})`), e ); }; return ( R(e, (t, i) => { P.arr(e) && (i = tb(t)), (a[i] = a(t)); }), { animated: a } ); }, tb = (e) => P.str(e) ? e : e && P.str(e.displayName) ? e.displayName : (P.fun(e) && e.name) || null; function tI(e, ...t) { return P.fun(e) ? e(...t) : e; } var tw = (e, t) => !0 === e || !!(t && e && (P.fun(e) ? e(t) : N(e).includes(t))), tx = (e, t) => (P.obj(e) ? t && e[t] : e), tS = (e, t) => !0 === e.default ? e[t] : e.default ? e.default[t] : void 0, tM = (e) => e, tC = (e, t = tM) => { let i = tT; e.default && !0 !== e.default && (i = Object.keys((e = e.default))); let n = {}; for (let r of i) { let i = t(e[r], r); !P.und(i) && (n[r] = i); } return n; }, tT = [ "config", "onProps", "onStart", "onChange", "onPause", "onResume", "onRest", ], tA = { config: 1, from: 1, to: 1, ref: 1, loop: 1, reset: 1, pause: 1, cancel: 1, reverse: 1, immediate: 1, default: 1, delay: 1, onProps: 1, onStart: 1, onChange: 1, onPause: 1, onResume: 1, onRest: 1, onResolve: 1, items: 1, trail: 1, sort: 1, expires: 1, initial: 1, enter: 1, update: 1, leave: 1, children: 1, onDestroyed: 1, keys: 1, callId: 1, parentId: 1, }; function tk(e) { let t = {}, i = 0; if ( (R(e, (e, n) => { !tA[n] && ((t[n] = e), i++); }), i) ) return t; } function tP(e) { let t = tk(e); if (t) { let i = { to: t }; return R(e, (e, n) => n in t || (i[n] = e)), i; } return { ...e }; } function tE(e) { return ( (e = eD(e)), P.arr(e) ? e.map(tE) : e2(e) ? l.createStringInterpolator({ range: [0, 1], output: [e, e] })(1) : e ); } function tD(e) { for (let t in e) return !0; return !1; } function tR(e) { return P.fun(e) || (P.arr(e) && P.obj(e[0])); } function tN(e, t) { e.ref?.delete(e), t?.delete(e); } function tL(e, t) { t && e.ref !== t && (e.ref?.delete(e), t.add(e), (e.ref = t)); } var tj = { tension: 170, friction: 26 }, tO = { ...tj, mass: 1, damping: 1, easing: eA.linear, clamp: !1 }, tB = class { constructor() { (this.velocity = 0), Object.assign(this, tO); } }; function tF(e, t, i) { for (let n in (i && (tU((i = { ...i }), t), (t = { ...i, ...t })), tU(e, t), Object.assign(e, t), tO)) null == e[n] && (e[n] = tO[n]); let { frequency: n, damping: r } = e, { mass: a } = e; return ( !P.und(n) && (n < 0.01 && (n = 0.01), r < 0 && (r = 0), (e.tension = Math.pow((2 * Math.PI) / n, 2) * a), (e.friction = (4 * Math.PI * r * a) / n)), e ); } function tU(e, t) { if (P.und(t.decay)) { let i = !P.und(t.tension) || !P.und(t.friction); (i || !P.und(t.frequency) || !P.und(t.damping) || !P.und(t.mass)) && ((e.duration = void 0), (e.decay = void 0)), i && (e.frequency = void 0); } else e.duration = void 0; } var tG = [], tz = class { constructor() { (this.changed = !1), (this.values = tG), (this.toValues = null), (this.fromValues = tG), (this.config = new tB()), (this.immediate = !1); } }; function tV( e, { key: t, props: i, defaultProps: n, state: r, actions: a } ) { return new Promise((o, s) => { let c, u; let f = tw(i.cancel ?? n?.cancel, t); if (f) v(); else { !P.und(i.pause) && (r.paused = tw(i.pause, t)); let e = n?.pause; !0 !== e && (e = r.paused || tw(e, t)), (c = tI(i.delay || 0, t)), e ? (r.resumeQueue.add(p), a.pause()) : (a.resume(), p()); } function h() { r.resumeQueue.add(p), r.timeouts.delete(u), u.cancel(), (c = u.time - d.now()); } function p() { c > 0 && !l.skipAnimation ? ((r.delayed = !0), (u = d.setTimeout(v, c)), r.pauseQueue.add(h), r.timeouts.add(u)) : v(); } function v() { r.delayed && (r.delayed = !1), r.pauseQueue.delete(h), r.timeouts.delete(u), e <= (r.cancelId || 0) && (f = !0); try { a.start({ ...i, callId: e, cancel: f }, o); } catch (e) { s(e); } } }); } var tW = (e, t) => 1 == t.length ? t[0] : t.some((e) => e.cancelled) ? tH(e.get()) : t.every((e) => e.noop) ? tZ(e.get()) : tK( e.get(), t.every((e) => e.finished) ), tZ = (e) => ({ value: e, noop: !0, finished: !0, cancelled: !1 }), tK = (e, t, i = !1) => ({ value: e, finished: t, cancelled: i }), tH = (e) => ({ value: e, cancelled: !0, finished: !1 }); function tq(e, t, i, n) { let { callId: r, parentId: a, onRest: o } = t, { asyncTo: s, promise: c } = i; return a || e !== s || t.reset ? (i.promise = (async () => { let u, f, h; (i.asyncId = r), (i.asyncTo = e); let p = tC(t, (e, t) => ("onRest" === t ? void 0 : e)), v = new Promise((e, t) => ((u = e), (f = t))), m = (e) => { let t = (r <= (i.cancelId || 0) && tH(n)) || (r !== i.asyncId && tK(n, !1)); if (t) throw ((e.result = t), f(e), e); }, g = (e, t) => { let a = new tY(), o = new tQ(); return (async () => { if (l.skipAnimation) throw (tJ(i), (o.result = tK(n, !1)), f(o), o); m(a); let s = P.obj(e) ? { ...e } : { ...t, to: e }; (s.parentId = r), R(p, (e, t) => { P.und(s[t]) && (s[t] = e); }); let c = await n.start(s); return ( m(a), i.paused && (await new Promise((e) => { i.resumeQueue.add(e); })), c ); })(); }; if (l.skipAnimation) return tJ(i), tK(n, !1); try { let t; (t = P.arr(e) ? (async (e) => { for (let t of e) await g(t); })(e) : Promise.resolve(e(g, n.stop.bind(n)))), await Promise.all([t.then(u), v]), (h = tK(n.get(), !0, !1)); } catch (e) { if (e instanceof tY) h = e.result; else if (e instanceof tQ) h = e.result; else throw e; } finally { r == i.asyncId && ((i.asyncId = a), (i.asyncTo = a ? s : void 0), (i.promise = a ? c : void 0)); } return ( P.fun(o) && d.batchedUpdates(() => { o(h, n, n.item); }), h ); })()) : c; } function tJ(e, t) { L(e.timeouts, (e) => e.cancel()), e.pauseQueue.clear(), e.resumeQueue.clear(), (e.asyncId = e.asyncTo = e.promise = void 0), t && (e.cancelId = t); } var tY = class extends Error { constructor() { super( "An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise." ); } }, tQ = class extends Error { constructor() { super("SkipAnimationSignal"); } }, tX = (e) => e instanceof t0, t$ = 1, t0 = class extends ej { constructor() { super(...arguments), (this.id = t$++), (this._priority = 0); } get priority() { return this._priority; } set priority(e) { this._priority != e && ((this._priority = e), this._onPriorityChange(e)); } get() { let e = tn(this); return e && e.getValue(); } to(...e) { return l.to(this, e); } interpolate(...e) { return e$(), l.to(this, e); } toJSON() { return this.get(); } observerAdded(e) { 1 == e && this._attach(); } observerRemoved(e) { 0 == e && this._detach(); } _attach() {} _detach() {} _onChange(e, t = !1) { eL(this, { type: "change", parent: this, value: e, idle: t }); } _onPriorityChange(e) { !this.idle && K.sort(this), eL(this, { type: "priority", parent: this, priority: e }); } }, t1 = Symbol.for("SpringPhase"), t2 = 1, t6 = 2, t4 = 4, t3 = (e) => (e[t1] & t2) > 0, t8 = (e) => (e[t1] & t6) > 0, t9 = (e) => (e[t1] & t4) > 0, t5 = (e, t) => (t ? (e[t1] |= t6 | t2) : (e[t1] &= ~t6)), t7 = (e, t) => (t ? (e[t1] |= t4) : (e[t1] &= ~t4)), ie = class extends t0 { constructor(e, t) { if ( (super(), (this.animation = new tz()), (this.defaultProps = {}), (this._state = { paused: !1, delayed: !1, pauseQueue: new Set(), resumeQueue: new Set(), timeouts: new Set(), }), (this._pendingCalls = new Set()), (this._lastCallId = 0), (this._lastToId = 0), (this._memoizedDuration = 0), !P.und(e) || !P.und(t)) ) { let i = P.obj(e) ? { ...e } : { ...t, from: e }; P.und(i.default) && (i.default = !0), this.start(i); } } get idle() { return !(t8(this) || this._state.asyncTo) || t9(this); } get goal() { return eD(this.animation.to); } get velocity() { let e = tn(this); return e instanceof ts ? e.lastVelocity || 0 : e.getPayload().map((e) => e.lastVelocity || 0); } get hasAnimated() { return t3(this); } get isAnimating() { return t8(this); } get isPaused() { return t9(this); } get isDelayed() { return this._state.delayed; } advance(e) { let t = !0, i = !1, n = this.animation, { toValues: r } = n, { config: a } = n, o = ta(n.to); !o && eE(n.to) && (r = N(eD(n.to))), n.values.forEach((s, l) => { if (s.done) return; let c = s.constructor == tl ? 1 : o ? o[l].lastPosition : r[l], d = n.immediate, u = c; if (!d) { let t; if (((u = s.lastPosition), a.tension <= 0)) { s.done = !0; return; } let i = (s.elapsedTime += e), r = n.fromValues[l], o = null != s.v0 ? s.v0 : (s.v0 = P.arr(a.velocity) ? a.velocity[l] : a.velocity), f = a.precision || (r == c ? 0.005 : Math.min(1, 0.001 * Math.abs(c - r))); if (P.und(a.duration)) { if (a.decay) { let e = !0 === a.decay ? 0.998 : a.decay, n = Math.exp(-(1 - e) * i); (u = r + (o / (1 - e)) * (1 - n)), (d = Math.abs(s.lastPosition - u) <= f), (t = o * n); } else { t = null == s.lastVelocity ? o : s.lastVelocity; let i = a.restVelocity || f / 10, n = a.clamp ? 0 : a.bounce, l = !P.und(n), h = r == c ? s.v0 > 0 : r < c, p = !1, v = 1, m = Math.ceil(e / 1); for ( let e = 0; e < m && !(!(Math.abs(t) > i) && (d = Math.abs(c - u) <= f)); ++e ) { l && (p = u == c || u > c == h) && ((t = -t * n), (u = c)); let e = -(1e-6 * a.tension) * (u - c), i = (e + -(0.001 * a.friction) * t) / a.mass; (t += i * v), (u += t * v); } } } else { let n = 1; a.duration > 0 && (this._memoizedDuration !== a.duration && ((this._memoizedDuration = a.duration), s.durationProgress > 0 && ((s.elapsedTime = a.duration * s.durationProgress), (i = s.elapsedTime += e))), (n = (n = (a.progress || 0) + i / this._memoizedDuration) > 1 ? 1 : n < 0 ? 0 : n), (s.durationProgress = n)), (t = ((u = r + a.easing(n) * (c - r)) - s.lastPosition) / e), (d = 1 == n); } (s.lastVelocity = t), Number.isNaN(u) && (console.warn("Got NaN while animating:", this), (d = !0)); } o && !o[l].done && (d = !1), d ? (s.done = !0) : (t = !1), s.setValue(u, a.round) && (i = !0); }); let s = tn(this), l = s.getValue(); if (t) { let e = eD(n.to); (l !== e || i) && !a.decay ? (s.setValue(e), this._onChange(e)) : i && a.decay && this._onChange(l), this._stop(); } else i && this._onChange(l); } set(e) { return ( d.batchedUpdates(() => { this._stop(), this._focus(e), this._set(e); }), this ); } pause() { this._update({ pause: !0 }); } resume() { this._update({ pause: !1 }); } finish() { if (t8(this)) { let { to: e, config: t } = this.animation; d.batchedUpdates(() => { this._onStart(), !t.decay && this._set(e, !1), this._stop(); }); } return this; } update(e) { return (this.queue || (this.queue = [])).push(e), this; } start(e, t) { let i; return ( P.und(e) ? ((i = this.queue || []), (this.queue = [])) : (i = [P.obj(e) ? e : { ...t, to: e }]), Promise.all(i.map((e) => this._update(e))).then((e) => tW(this, e) ) ); } stop(e) { let { to: t } = this.animation; return ( this._focus(this.get()), tJ(this._state, e && this._lastCallId), d.batchedUpdates(() => this._stop(t, e)), this ); } reset() { this._update({ reset: !0 }); } eventObserved(e) { "change" == e.type ? this._start() : "priority" == e.type && (this.priority = e.priority + 1); } _prepareNode(e) { let t = this.key || "", { to: i, from: n } = e; (null == (i = P.obj(i) ? i[t] : i) || tR(i)) && (i = void 0), null == (n = P.obj(n) ? n[t] : n) && (n = void 0); let r = { to: i, from: n }; return ( !t3(this) && (e.reverse && ([i, n] = [n, i]), (n = eD(n)), P.und(n) ? !tn(this) && this._set(i) : this._set(n)), r ); } _update({ ...e }, t) { let { key: i, defaultProps: n } = this; e.default && Object.assign( n, tC(e, (e, t) => (/^on/.test(t) ? tx(e, i) : e)) ), il(this, e, "onProps"), ic(this, "onProps", e, this); let r = this._prepareNode(e); if (Object.isFrozen(this)) throw Error( "Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?" ); let a = this._state; return tV(++this._lastCallId, { key: i, props: e, defaultProps: n, state: a, actions: { pause: () => { !t9(this) && (t7(this, !0), j(a.pauseQueue), ic( this, "onPause", tK(this, it(this, this.animation.to)), this )); }, resume: () => { t9(this) && (t7(this, !1), t8(this) && this._resume(), j(a.resumeQueue), ic( this, "onResume", tK(this, it(this, this.animation.to)), this )); }, start: this._merge.bind(this, r), }, }).then((i) => { if (e.loop && i.finished && !(t && i.noop)) { let t = ii(e); if (t) return this._update(t, !0); } return i; }); } _merge(e, t, i) { if (t.cancel) return this.stop(!0), i(tH(this)); let n = !P.und(e.to), r = !P.und(e.from); if (n || r) { if (!(t.callId > this._lastToId)) return i(tH(this)); this._lastToId = t.callId; } let { key: a, defaultProps: o, animation: s } = this, { to: l, from: c } = s, { to: u = l, from: f = c } = e; r && !n && (!t.default || P.und(u)) && (u = f), t.reverse && ([u, f] = [f, u]); let h = !E(f, c); h && (s.from = f), (f = eD(f)); let p = !E(u, l); p && this._focus(u); let v = tR(t.to), { config: m } = s, { decay: g, velocity: _ } = m; (n || r) && (m.velocity = 0), t.config && !v && tF( m, tI(t.config, a), t.config !== o.config ? tI(o.config, a) : void 0 ); let y = tn(this); if (!y || P.und(u)) return i(tK(this, !0)); let b = P.und(t.reset) ? r && !t.default : !P.und(f) && tw(t.reset, a), I = b ? f : this.get(), w = tE(u), x = P.num(w) || P.arr(w) || e2(w), S = !v && (!x || tw(o.immediate || t.immediate, a)); if (p) { let e = th(u); if (e !== y.constructor) { if (S) y = this._set(w); else throw Error( `Cannot animate between ${y.constructor.name} and ${e.name}, as the "to" prop suggests` ); } } let M = y.constructor, C = eE(u), T = !1; if (!C) { let e = b || (!t3(this) && h); (p || e) && (C = !(T = E(tE(I), w))), ((!E(s.immediate, S) && !S) || !E(m.decay, g) || !E(m.velocity, _)) && (C = !0); } if ( (T && t8(this) && (s.changed && !b ? (C = !0) : !C && this._stop(l)), !v && ((C || eE(l)) && ((s.values = y.getPayload()), (s.toValues = eE(u) ? null : M == tl ? [1] : N(w))), s.immediate != S && ((s.immediate = S), !S && !b && this._set(l)), C)) ) { let { onRest: e } = s; D(is, (e) => il(this, t, e)); let n = tK(this, it(this, l)); j(this._pendingCalls, n), this._pendingCalls.add(i), s.changed && d.batchedUpdates(() => { (s.changed = !b), e?.(n, this), b ? tI(o.onRest, n) : s.onStart?.(n, this); }); } b && this._set(I), v ? i(tq(t.to, t, this._state, this)) : C ? this._start() : t8(this) && !p ? this._pendingCalls.add(i) : i(tZ(I)); } _focus(e) { let t = this.animation; e !== t.to && (eR(this) && this._detach(), (t.to = e), eR(this) && this._attach()); } _attach() { let e = 0, { to: t } = this.animation; eE(t) && (eB(t, this), tX(t) && (e = t.priority + 1)), (this.priority = e); } _detach() { let { to: e } = this.animation; eE(e) && eF(e, this); } _set(e, t = !0) { let i = eD(e); if (!P.und(i)) { let e = tn(this); if (!e || !E(i, e.getValue())) { let n = th(i); e && e.constructor == n ? e.setValue(i) : tr(this, n.create(i)), e && d.batchedUpdates(() => { this._onChange(i, t); }); } } return tn(this); } _onStart() { let e = this.animation; !e.changed && ((e.changed = !0), ic(this, "onStart", tK(this, it(this, e.to)), this)); } _onChange(e, t) { !t && (this._onStart(), tI(this.animation.onChange, e, this)), tI(this.defaultProps.onChange, e, this), super._onChange(e, t); } _start() { let e = this.animation; tn(this).reset(eD(e.to)), !e.immediate && (e.fromValues = e.values.map((e) => e.lastPosition)), !t8(this) && (t5(this, !0), !t9(this) && this._resume()); } _resume() { l.skipAnimation ? this.finish() : K.start(this); } _stop(e, t) { if (t8(this)) { t5(this, !1); let i = this.animation; D(i.values, (e) => { e.done = !0; }), i.toValues && (i.onChange = i.onPause = i.onResume = void 0), eL(this, { type: "idle", parent: this }); let n = t ? tH(this.get()) : tK(this.get(), it(this, e ?? i.to)); j(this._pendingCalls, n), i.changed && ((i.changed = !1), ic(this, "onRest", n, this)); } } }; function it(e, t) { let i = tE(t); return E(tE(e.get()), i); } function ii(e, t = e.loop, i = e.to) { let n = tI(t); if (n) { let r = !0 !== n && tP(n), a = (r || e).reverse, o = !r || r.reset; return ir({ ...e, loop: t, default: !1, pause: void 0, to: !a || tR(i) ? i : void 0, from: o ? e.from : void 0, reset: o, ...r, }); } } function ir(e) { let { to: t, from: i } = (e = tP(e)), n = new Set(); return ( P.obj(t) && io(t, n), P.obj(i) && io(i, n), (e.keys = n.size ? Array.from(n) : null), e ); } function ia(e) { let t = ir(e); return P.und(t.default) && (t.default = tC(t)), t; } function io(e, t) { R(e, (e, i) => null != e && t.add(i)); } var is = ["onStart", "onRest", "onChange", "onPause", "onResume"]; function il(e, t, i) { e.animation[i] = t[i] !== tS(t, i) ? tx(t[i], e.key) : void 0; } function ic(e, t, ...i) { e.animation[t]?.(...i), e.defaultProps[t]?.(...i); } var id = ["onStart", "onChange", "onRest"], iu = 1, ih = class { constructor(e, t) { (this.id = iu++), (this.springs = {}), (this.queue = []), (this._lastAsyncId = 0), (this._active = new Set()), (this._changed = new Set()), (this._started = !1), (this._state = { paused: !1, pauseQueue: new Set(), resumeQueue: new Set(), timeouts: new Set(), }), (this._events = { onStart: new Map(), onChange: new Map(), onRest: new Map(), }), (this._onFrame = this._onFrame.bind(this)), t && (this._flush = t), e && this.start({ default: !0, ...e }); } get idle() { return ( !this._state.asyncTo && Object.values(this.springs).every( (e) => e.idle && !e.isDelayed && !e.isPaused ) ); } get item() { return this._item; } set item(e) { this._item = e; } get() { let e = {}; return this.each((t, i) => (e[i] = t.get())), e; } set(e) { for (let t in e) { let i = e[t]; !P.und(i) && this.springs[t].set(i); } } update(e) { return e && this.queue.push(ir(e)), this; } start(e) { let { queue: t } = this; return (e ? (t = N(e).map(ir)) : (this.queue = []), this._flush) ? this._flush(this, t) : (ib(this, t), ip(this, t)); } stop(e, t) { if ((!!e !== e && (t = e), t)) { let i = this.springs; D(N(t), (t) => i[t].stop(!!e)); } else tJ(this._state, this._lastAsyncId), this.each((t) => t.stop(!!e)); return this; } pause(e) { if (P.und(e)) this.start({ pause: !0 }); else { let t = this.springs; D(N(e), (e) => t[e].pause()); } return this; } resume(e) { if (P.und(e)) this.start({ pause: !1 }); else { let t = this.springs; D(N(e), (e) => t[e].resume()); } return this; } each(e) { R(this.springs, e); } _onFrame() { let { onStart: e, onChange: t, onRest: i } = this._events, n = this._active.size > 0, r = this._changed.size > 0; ((n && !this._started) || (r && !this._started)) && ((this._started = !0), L(e, ([e, t]) => { (t.value = this.get()), e(t, this, this._item); })); let a = !n && this._started, o = r || (a && i.size) ? this.get() : null; r && t.size && L(t, ([e, t]) => { (t.value = o), e(t, this, this._item); }), a && ((this._started = !1), L(i, ([e, t]) => { (t.value = o), e(t, this, this._item); })); } eventObserved(e) { if ("change" == e.type) this._changed.add(e.parent), !e.idle && this._active.add(e.parent); else { if ("idle" != e.type) return; this._active.delete(e.parent); } d.onFrame(this._onFrame); } }; function ip(e, t) { return Promise.all(t.map((t) => iv(e, t))).then((t) => tW(e, t)); } async function iv(e, t, i) { let { keys: n, to: r, from: a, loop: o, onRest: s, onResolve: l } = t, c = P.obj(t.default) && t.default; o && (t.loop = !1), !1 === r && (t.to = null), !1 === a && (t.from = null); let u = P.arr(r) || P.fun(r) ? r : void 0; u ? ((t.to = void 0), (t.onRest = void 0), c && (c.onRest = void 0)) : D(id, (i) => { let n = t[i]; if (P.fun(n)) { let r = e._events[i]; (t[i] = ({ finished: e, cancelled: t }) => { let i = r.get(n); i ? (!e && (i.finished = !1), t && (i.cancelled = !0)) : r.set(n, { value: null, finished: e || !1, cancelled: t || !1, }); }), c && (c[i] = t[i]); } }); let f = e._state; !f.paused === t.pause ? ((f.paused = t.pause), j(t.pause ? f.pauseQueue : f.resumeQueue)) : f.paused && (t.pause = !0); let h = (n || Object.keys(e.springs)).map((i) => e.springs[i].start(t)), p = !0 === t.cancel || !0 === tS(t, "cancel"); (u || (p && f.asyncId)) && h.push( tV(++e._lastAsyncId, { props: t, state: f, actions: { pause: A, resume: A, start(t, i) { p ? (tJ(f, e._lastAsyncId), i(tH(e))) : ((t.onRest = s), i(tq(u, t, f, e))); }, }, }) ), f.paused && (await new Promise((e) => { f.resumeQueue.add(e); })); let v = tW(e, await Promise.all(h)); if (o && v.finished && !(i && v.noop)) { let i = ii(t, o, r); if (i) return ib(e, [i]), iv(e, i, !0); } return l && d.batchedUpdates(() => l(v, e, e.item)), v; } function im(e, t) { let i = { ...e.springs }; return ( t && D(N(t), (e) => { P.und(e.keys) && (e = ir(e)), !P.obj(e.to) && (e = { ...e, to: void 0 }), iy(i, e, (e) => i_(e)); }), ig(e, i), i ); } function ig(e, t) { R(t, (t, i) => { !e.springs[i] && ((e.springs[i] = t), eB(t, e)); }); } function i_(e, t) { let i = new ie(); return (i.key = e), t && eB(i, t), i; } function iy(e, t, i) { t.keys && D(t.keys, (n) => { (e[n] || (e[n] = i(n)))._prepareNode(t); }); } function ib(e, t) { D(t, (t) => { iy(e.springs, t, (t) => i_(t, e)); }); } var iI = ({ children: e, ...t }) => { let i = (0, o.useContext)(iw), n = t.pause || !!i.pause, r = t.immediate || !!i.immediate; t = e8(() => ({ pause: n, immediate: r }), [n, r]); let { Provider: a } = iw; return o.createElement(a, { value: t }, e); }, iw = ix(iI, {}); function ix(e, t) { return ( Object.assign(e, o.createContext(t)), (e.Provider._context = e), (e.Consumer._context = e), e ); } (iI.Provider = iw.Provider), (iI.Consumer = iw.Consumer); var iS = () => { let e = [], t = function (t) { e1(); let n = []; return ( D(e, (e, r) => { if (P.und(t)) n.push(e.start()); else { let a = i(t, e, r); a && n.push(e.start(a)); } }), n ); }; (t.current = e), (t.add = function (t) { !e.includes(t) && e.push(t); }), (t.delete = function (t) { let i = e.indexOf(t); ~i && e.splice(i, 1); }), (t.pause = function () { return D(e, (e) => e.pause(...arguments)), this; }), (t.resume = function () { return D(e, (e) => e.resume(...arguments)), this; }), (t.set = function (t) { D(e, (e, i) => { let n = P.fun(t) ? t(i, e) : t; n && e.set(n); }); }), (t.start = function (t) { let i = []; return ( D(e, (e, n) => { if (P.und(t)) i.push(e.start()); else { let r = this._getProps(t, e, n); r && i.push(e.start(r)); } }), i ); }), (t.stop = function () { return D(e, (e) => e.stop(...arguments)), this; }), (t.update = function (t) { return D(e, (e, i) => e.update(this._getProps(t, e, i))), this; }); let i = function (e, t, i) { return P.fun(e) ? e(i, t) : e; }; return (t._getProps = i), t; }; function iM(e, t, i) { let n = P.fun(t) && t; n && !i && (i = []); let r = (0, o.useMemo)( () => (n || 3 == arguments.length ? iS() : void 0), [] ), a = (0, o.useRef)(0), s = e3(), l = (0, o.useMemo)( () => ({ ctrls: [], queue: [], flush(e, t) { let i = im(e, t); return !(a.current > 0) || l.queue.length || Object.keys(i).some((t) => !e.springs[t]) ? new Promise((n) => { ig(e, i), l.queue.push(() => { n(ip(e, t)); }), s(); }) : ip(e, t); }, }), [] ), c = (0, o.useRef)([...l.ctrls]), d = [], u = te(e) || 0; function f(e, i) { for (let r = e; r < i; r++) { let e = c.current[r] || (c.current[r] = new ih(null, l.flush)), i = n ? n(r, e) : t[r]; i && (d[r] = ia(i)); } } (0, o.useMemo)(() => { D(c.current.slice(e, u), (e) => { tN(e, r), e.stop(!0); }), (c.current.length = e), f(u, e); }, [e]), (0, o.useMemo)(() => { f(0, Math.min(u, e)); }, i); let h = c.current.map((e, t) => im(e, d[t])), p = (0, o.useContext)(iI), v = te(p), m = p !== v && tD(p); e6(() => { a.current++, (l.ctrls = c.current); let { queue: e } = l; e.length && ((l.queue = []), D(e, (e) => e())), D(c.current, (e, t) => { r?.add(e), m && e.start({ default: p }); let i = d[t]; i && (tL(e, i.ref), e.ref ? e.queue.push(i) : e.start(i)); }); }), e5(() => () => { D(l.ctrls, (e) => e.stop(!0)); }); let g = h.map((e) => ({ ...e })); return r ? [g, r] : g; } function iC(e, t) { let i = P.fun(e), [[n], r] = iM(1, i ? e : [e], i ? t || [] : t); return i || 2 == arguments.length ? [n, r] : n; } var iT = class extends t0 { constructor(e, t) { super(), (this.source = e), (this.idle = !0), (this._active = new Set()), (this.calc = ey(...t)); let i = this._get(); tr(this, th(i).create(i)); } advance(e) { let t = this._get(); !E(t, this.get()) && (tn(this).setValue(t), this._onChange(t, this.idle)), !this.idle && ik(this._active) && iP(this); } _get() { let e = P.arr(this.source) ? this.source.map(eD) : N(eD(this.source)); return this.calc(...e); } _start() { this.idle && !ik(this._active) && ((this.idle = !1), D(ta(this), (e) => { e.done = !1; }), l.skipAnimation ? (d.batchedUpdates(() => this.advance()), iP(this)) : K.start(this)); } _attach() { let e = 1; D(N(this.source), (t) => { eE(t) && eB(t, this), tX(t) && (!t.idle && this._active.add(t), (e = Math.max(e, t.priority + 1))); }), (this.priority = e), this._start(); } _detach() { D(N(this.source), (e) => { eE(e) && eF(e, this); }), this._active.clear(), iP(this); } eventObserved(e) { "change" == e.type ? e.idle ? this.advance() : (this._active.add(e.parent), this._start()) : "idle" == e.type ? this._active.delete(e.parent) : "priority" == e.type && (this.priority = N(this.source).reduce( (e, t) => Math.max(e, (tX(t) ? t.priority : 0) + 1), 0 )); } }; function iA(e) { return !1 !== e.idle; } function ik(e) { return !e.size || Array.from(e).every(iA); } function iP(e) { !e.idle && ((e.idle = !0), D(ta(e), (e) => { e.done = !0; }), eL(e, { type: "idle", parent: e })); } var iE = (e, ...t) => new iT(e, t); l.assign({ createStringInterpolator: eJ, to: (e, t) => new iT(e, t) }), K.advance; var iD = i("195291"), iR = /^--/; function iN(e, t) { return null == t || "boolean" == typeof t || "" === t ? "" : "number" != typeof t || 0 === t || iR.test(e) || (iO.hasOwnProperty(e) && iO[e]) ? ("" + t).trim() : t + "px"; } var iL = {}; function ij(e, t) { if (!e.nodeType || !e.setAttribute) return !1; let i = "filter" === e.nodeName || (e.parentNode && "filter" === e.parentNode.nodeName), { style: n, children: r, scrollTop: a, scrollLeft: o, viewBox: s, ...l } = t, c = Object.values(l), d = Object.keys(l).map((t) => i || e.hasAttribute(t) ? t : iL[t] || (iL[t] = t.replace(/([A-Z])/g, (e) => "-" + e.toLowerCase())) ); for (let t in (void 0 !== r && (e.textContent = r), n)) if (n.hasOwnProperty(t)) { let i = iN(t, n[t]); iR.test(t) ? e.style.setProperty(t, i) : (e.style[t] = i); } d.forEach((t, i) => { e.setAttribute(t, c[i]); }), void 0 !== a && (e.scrollTop = a), void 0 !== o && (e.scrollLeft = o), void 0 !== s && e.setAttribute("viewBox", s); } var iO = { animationIterationCount: !0, borderImageOutset: !0, borderImageSlice: !0, borderImageWidth: !0, boxFlex: !0, boxFlexGroup: !0, boxOrdinalGroup: !0, columnCount: !0, columns: !0, flex: !0, flexGrow: !0, flexPositive: !0, flexShrink: !0, flexNegative: !0, flexOrder: !0, gridRow: !0, gridRowEnd: !0, gridRowSpan: !0, gridRowStart: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnSpan: !0, gridColumnStart: !0, fontWeight: !0, lineClamp: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, tabSize: !0, widows: !0, zIndex: !0, zoom: !0, fillOpacity: !0, floodOpacity: !0, stopOpacity: !0, strokeDasharray: !0, strokeDashoffset: !0, strokeMiterlimit: !0, strokeOpacity: !0, strokeWidth: !0, }, iB = (e, t) => e + t.charAt(0).toUpperCase() + t.substring(1), iF = ["Webkit", "Ms", "Moz", "O"]; iO = Object.keys(iO).reduce( (e, t) => (iF.forEach((i) => (e[iB(i, t)] = e[t])), e), iO ); var iU = /^(matrix|translate|scale|rotate|skew)/, iG = /^(translate)/, iz = /^(rotate|skew)/, iV = (e, t) => (P.num(e) && 0 !== e ? e + t : e), iW = (e, t) => P.arr(e) ? e.every((e) => iW(e, t)) : P.num(e) ? e === t : parseFloat(e) === t, iZ = class extends td { constructor({ x: e, y: t, z: i, ...n }) { let r = [], a = []; (e || t || i) && (r.push([e || 0, t || 0, i || 0]), a.push((e) => [ `translate3d(${e.map((e) => iV(e, "px")).join(",")})`, iW(e, 0), ])), R(n, (e, t) => { if ("transform" === t) r.push([e || ""]), a.push((e) => [e, "" === e]); else if (iU.test(t)) { if ((delete n[t], P.und(e))) return; let i = iG.test(t) ? "px" : iz.test(t) ? "deg" : ""; r.push(N(e)), a.push( "rotate3d" === t ? ([e, t, n, r]) => [ `rotate3d(${e},${t},${n},${iV(r, i)})`, iW(r, 0), ] : (e) => [ `${t}(${e.map((e) => iV(e, i)).join(",")})`, iW(e, t.startsWith("scale") ? 1 : 0), ] ); } }), r.length && (n.transform = new iK(r, a)), super(n); } }, iK = class extends ej { constructor(e, t) { super(), (this.inputs = e), (this.transforms = t), (this._value = null); } get() { return this._value || (this._value = this._get()); } _get() { let e = "", t = !0; return ( D(this.inputs, (i, n) => { let r = eD(i[0]), [a, o] = this.transforms[n](P.arr(r) ? r : i.map(eD)); (e += " " + a), (t = t && o); }), t ? "none" : e ); } observerAdded(e) { 1 == e && D(this.inputs, (e) => D(e, (e) => eE(e) && eB(e, this))); } observerRemoved(e) { 0 == e && D(this.inputs, (e) => D(e, (e) => eE(e) && eF(e, this))); } eventObserved(e) { "change" == e.type && (this._value = null), eL(this, e); } }, iH = [ "a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan", ]; l.assign({ batchedUpdates: iD.unstable_batchedUpdates, createStringInterpolator: eJ, colors: $, }); var iq = ty(iH, { applyAnimatedValues: ij, createAnimatedStyle: (e) => new iZ(e), getComponentProps: ({ scrollTop: e, scrollLeft: t, ...i }) => i, }).animated; }, 581148: function (e, t, i) { "use strict"; function n() { return (n = Object.assign || function (e) { for (var t = 1; t < arguments.length; t++) { var i = arguments[t]; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]); } return e; }).apply(this, arguments); } i.d(t, { _: function () { return n; }, }); }, 58871: function (e, t, i) { "use strict"; function n(e) { if (null == e) throw TypeError("Cannot destructure " + e); return e; } i.d(t, { _: function () { return n; }, }); }, 641601: function (e) { "use strict"; e.exports = JSON.parse( '{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}' ); }, 773777: function (e) { "use strict"; e.exports = JSON.parse( '{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}' ); }, 963079: function (e) { "use strict"; e.exports = JSON.parse( '{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}' ); }, 895968: function (e) { "use strict"; e.exports = JSON.parse( '{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}' ); }, 172353: function (e) { "use strict"; e.exports = { i8: "6.5.5" }; }, 431163: function (e) { "use strict"; e.exports = JSON.parse( '{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}' ); }, }, ]);