"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["30252"],{501108:function(e,t,i){i.d(t,{L:()=>r,P:()=>o});class r{}class o{constructor(){this.render=void 0,this.onClick=void 0}}},653162:function(e,t,i){i.d(t,{w:()=>a});var r=i(624682),o=i(386189),n=i(581810);class a{focusOnEditor(){(0,o.NS)().getState().updateFocusedState(!0)}updateEditorValue(e){(0,r.Z)(e)?(0,o.NS)().getState().updateEditorValue({data:[{type:n.f.Text,text:e}]}):(0,o.NS)().getState().updateEditorValue(e)}clearEditorValue(){this.updateEditorValue("")}}},341930:function(e,t,i){i.r(t),i.d(t,{VideoChatGuidanceCardPlugin:()=>p});var r=i(397458),o=i(264191),n=i(87608),a=i.n(n),s=i(501108),d=i(170246),l=i(932842),u=i(754751),c=i(653162);class p extends s.P{getTitleKey(){return"skill_video_title"}getDescKey(){return"onboarding_video_description"}constructor(...e){super(...e),this.skillType=u.SkillType.VideoGeneration,this._chatInputService=new c.w,this._route="/chat/create-video",this.renderIcon=e=>{var{className:t}=e;return(0,r.jsx)(o.Z,{className:a()(t,"text-[#f92d20] !text-16 p-3")})},this.renderTitle=e=>{var{renderTitleRaw:t}=e;return t()},this.renderDesc=e=>{var{renderDescRaw:t}=e;return t()},this.onClick=e=>{var{type:t,conversationId:i,navigate:r}=e;"open_skill"===t&&i?((0,l.GX)("chatInputStore").updateActiveSkillTypeMap(i,this.skillType,d.u.ClickSkill),this._chatInputService.focusOnEditor()):"navigate"===t&&r&&r(this._route,{state:{from:"guidance_page"}})}}}},386189:function(e,t,i){i.d(t,{dI:()=>S,NS:()=>g});var r=i(698127),o=i(837222),n=i(531484),a=i(230869),s=i(771197),d=i(706790),l=i(23898),u=i(635680),c=i(497176),p=i(434463),v=i(754751),_=i(41139),f={editorValue:{data:[]},focused:!1,inputOptionsMap:{},attachment:{},videoList:[],imageRef:"",videoGenInfo:{remain_count:0,has_generating_task:!1,is_beta_user:!1},hasFetched:!1},h={isInit:!1},y=(e,t)=>{var i;return(0,d._)((0,r._)({},f),{updateEditorValue:t=>{e((0,c.Uy)(e=>{e.editorValue=t}))},updateFocusedState:t=>{e((0,c.Uy)(e=>{e.focused=t}))},initVideoList:()=>{if(!h.isInit){var{fetchVideoList:e}=t();e(!0)}},fetchVideoList:(i=(0,s._)(function*(t){try{var{data:i}=yield p.mH.SkillPack({skill_type:v.SkillType.VideoGeneration}),o=null==i?void 0:i.video_generation;if(!(null==o?void 0:o.meta))return;e((0,c.Uy)(e=>{if(null==o?void 0:null===(n=o.meta)||void 0===n?void 0:n.option_list){var i,n,a,s,c=(0,l.Z)(null==o?void 0:null===(s=o.meta)||void 0===s?void 0:s.option_list,(e,t)=>(0,d._)((0,r._)({},e),{[String(t.value)]:(0,r._)({},t)}),{});e.inputOptionsMap=c}var p=(t?[]:(0,u.Z)(e.videoList)).concat(null!==(i=null==o?void 0:null===(a=o.template)||void 0===a?void 0:a.item_list)&&void 0!==i?i:[]);e.videoList=p,h.isInit=!0}))}catch(e){_.k.persist.warning({eventName:"init_image_list_error"})}}),function(e){return i.apply(this,arguments)}),updateVideoGenInfo:(0,s._)(function*(){try{var{data:t}=yield p.mH.QueryVideoGenInfo();return e((0,c.Uy)(e=>(0,d._)((0,r._)({},e),{hasFetched:!0,videoGenInfo:t}))),t}catch(e){e instanceof Error&&_.k.persist.error({error:e,message:null==e?void 0:e.message})}}),decreaseCount:()=>{e((0,c.Uy)(e=>{var t;(null===(t=e.videoGenInfo)||void 0===t?void 0:t.remain_count)&&(e.videoGenInfo=(0,d._)((0,r._)({},e.videoGenInfo),{remain_count:e.videoGenInfo.remain_count-1,has_generating_task:!0}))}))},updateRef:t=>{e((0,c.Uy)(e=>{e.imageRef=t}))}})},k=e=>{try{return{inputOptionsMap:e.inputOptionsMap,videoList:e.videoList}}catch(e){return _.k.persist.error({message:"[@video-skill-store] persist state limit error",error:e instanceof Error?e:Error(String(e))}),{}}},m=e=>{var{isEnableDebug:t,reduxDevToolsSnapshot:i,merge:r,partialize:s,storage:d}=e,l=(0,a.C1)({name:"video-skill-store",prefix:"samantha-web",storage:d,partialize:null!=s?s:k,version:1.5,merge:r}),u=(0,o.tJ)((0,o.XR)(y),l);return t&&i?(0,n.Ue)()((0,o.mW)(u,{name:"samantha-web-video-skill-store"})):(0,n.Ue)()(u)},g=()=>(V(),S),S=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];V();var{_useVideoSkillStore:r}=S.prototype;if(r)return r(...t);throw Error("useVideoSkillStore is not initialized")};function V(){var{_useVideoSkillStore:e}=S.prototype||{};if(!e){var t=m({});Object.setPrototypeOf(S.prototype,t),Object.defineProperties(S,(0,r._)({},Object.getOwnPropertyDescriptors(t))),S.prototype._useVideoSkillStore=t}}}}]);
//# sourceMappingURL=30252.js.map