1import{a as i,o as g,p as y,T as w,u as l,q as m,t as f,r as T,s as I,v as S,w as c,x as k,M as x,y as M}from"./BuQWImh-.js";const _="aistory";async function B(s,t,e,r){if(!i().isLogin)return i().showLoginDialogStatus("auto"),"";r?.extraTrackInfo?.creation_stage&&(r.extraTrackInfo.creation_stage=g(r.extraTrackInfo.creation_stage));const d=y(),n={...d?{entry_type:d}:{},...r?.extraTrackInfo||{}},u={data:e,group_id:s,model:_},a={module:_,taskSource:"hook",isHookTask:!0,uniqueCode:t,algorithm:t,functionId:t,isFromTpl:!1,isFromCRCTpl:!1,isFromAiTools:!1,taskReported:!1,num:t,name:w.get(t),pscenario:"script_to_video",pworkflow:"core_process",pfunction:"script_to_video",pfunction_type:"ai_story",pfunction_display:"workflow",data:u,...r,extraTrackInfo:n,extra_track_data:n,...n,credits_number:r?.credits_number??n?.credit_cost??0};try{await(await l()).getSpaceIdAsync();const p=await m(t,{...u,user_data:a});return f("miai_creation_task",{task_status:"start",task_id:p?.task_id,miai_unit_code:a.num,miai_unit_name:a.name,explore_template_id:"",thumbnail_url:e.user_data?.thumbnail_url||"",cap_id:e.user_data?.cap_id||"",credit_cost:e?.user_data?.credits_number,pscenario:a.pscenario,pworkflow:a.pworkflow,pfunction:a.pfunction,pfunction_type:a.pfunction_type,pfunction_display:a.pfunction_display,...a?.extraTrackInfo},!0,!0),p?.task_id||""}catch(o){return f("miai_creation_task",{pscenario:a.pscenario,pworkflow:a.pworkflow,task_status:o?.code===490505||o?.code===490507?"insufficient_credits":"failed_to_start",task_id:o?.task_id,miai_unit_code:a.num,miai_unit_name:a.name,credit_cost:e?.user_data?.credits_number,fail_reason:o?.msg||o?.message,fail_code:o?.code,...a?.extraTrackInfo},!0,!0),await T(o,_,{data:u.data,user_data:a},e?.user_data?.uniqueCode||t),""}finally{i().updateUserInfo()}}async function L(s){if(!i().isLogin)return i().showLoginDialogStatus("auto"),"";try{await(await l()).getSpaceIdAsync();const e=await I(s.taskId,s.keepOrigin),r=s.keepOrigin?s.taskId:e.task_id;return r&&await S(r,"taskReported",!1),r||""}catch(t){let e;return t?.response?.status===401?e=t.response.data:e=t,e.code===c.PleaseBuyNow?k().popupBuySmart({aiType:s.algorithm}):e.code===c.MembershipLimitBuyNow&&k().popupBuySubscribe({aiType:s.algorithm}),e.code===c.DownloadButNotLogin&&i().showLoginDialogStatus("auto"),e.code!==c.PleaseBuyNow&&x.error(M("ai_video_generator.Network_error")),""}finally{i().updateUserInfo()}}export{B as c,L as r};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.