1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6405],{46405:function(e,t,r){r.r(t),r.d(t,{createBirthdayApi:function(){return w},liveTransport:function(){return f},marketingFunnelRequestProfile:function(){return I},marketingFunnelReturnURL:function(){return p}});var i=r(11719),a=r(26015),o=r(73805),n=r(6231);let l={config:"/v1/api/h5/marketing-funnel/config",currentAttempt:"/v3/api/h5/marketing-funnel/attempt/current",session:"/v2/api/h5/marketing-funnel/session",precheck:"/v2/api/h5/marketing-funnel/precheck",products:"/v2/api/charge/combo/promo_package",quotes:"/v1/api/h5/marketing-funnel/quotes",checkout:"/v1/api/h5/marketing-funnel/checkout",order:"/v1/api/h5/marketing-funnel/order",photoBegin:"/v3/api/h5/marketing-funnel/photo/begin",policy:"/v1/api/files/request_policy",callback:"/v1/api/files/policy_callback",photo:"/v3/api/h5/marketing-funnel/photo",submit:"/v3/api/h5/marketing-funnel/generation/submit",attempt:"/v3/api/h5/marketing-funnel/attempt",purchases:"/v1/api/h5/marketing-funnel/purchases",close:"/v1/api/h5/marketing-funnel/checkout/close",delivery:"/v1/api/h5/marketing-funnel/delivery",resend:"/v1/api/h5/marketing-funnel/delivery/email/resend",access:"/v1/api/h5/marketing-funnel/delivery/access",activate:"/v1/api/h5/marketing-funnel/promo/activate",promo:"/v1/api/h5/marketing-funnel/promo/status"},s={11:"DELIVERY_ACCESS_EXPIRED",4901001:"SESSION_EXPIRED",4901002:"FLOW_EXPIRED",4901003:"REVISION_CONFLICT",4901004:"PURCHASE_IN_FLIGHT",4901005:"QUOTE_EXPIRED",4901006:"QUOTE_CHANGED",4901007:"PHOTO_REJECTED",4901008:"CREDIT_INSUFFICIENT",4901009:"TEMPORARY_FAILURE",4901010:"ACCOUNT_RESOLUTION_FAILED",4901011:"PAYMENT_PROCESSING",4901012:"PAYMENT_ALREADY_PAID",4901013:"PROMO_EXPIRED",4901014:"PROMO_INELIGIBLE",4901015:"PROMO_CONFLICT",4901016:"PAYMENT_EMAIL_MISSING"};var d=r(87297),u=r(95948),c=r(55269),v=r(98637);function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=e.pathname.replace(/\/(?:upload|result|return)\/?$/,"").replace(/\/$/,""),r=new URL("".concat(e.origin).concat(t,"/return"));if(e.href){let t=(0,c.r)(e.href);for(let[e,i]of Object.entries(t))r.searchParams.set(e,i);r.searchParams.set("hl_ads_url",(0,c.i)(e.href,t))}return r.toString()}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof navigator?"":navigator.userAgent;return{devicePlatformOverride:/Android/i.test(e)?"android":"iOS",params:{source:"h5",yy_platform:"h5"}}}let f=async(e,t)=>{let{body:o,key:n,csrf:l,signal:s,language:d}=t;null==s||s.throwIfAborted();let u=await (0,v.J)();null==s||s.throwIfAborted();let{default:c}=await Promise.resolve().then(r.bind(r,89461)),p=(0,a._)((0,i._)({signal:s,withCredentials:!0,languageOverride:d,showToast:!1,disableLoginIntercept:!0,disablePaymentIntercept:!0,disableRequestDiagnostics:!0},I()),{params:(0,a._)((0,i._)({},I().params),{device_id:u}),headers:(0,i._)({"Content-Type":"application/json"},void 0!==o&&l?{"X-CSRF-Token":l}:{},n?{"Idempotency-Key":n}:{})}),f=void 0===o?await c.get(e,p):await c.post(e,o,p);return{status:f.status,data:f.data}};async function h(e,t,i,a){let{default:o}=await r.e(9197).then(r.t.bind(r,84151,23)),n=new o({secure:!0,endpoint:e.endpoint,bucket:e.bucketName,accessKeyId:e.accessKeyId,accessKeySecret:e.accessKeySecret,stsToken:e.securityToken}),l=()=>{var e;return null===(e=n.cancel)||void 0===e?void 0:e.call(n)};null==a||a.throwIfAborted(),null==a||a.addEventListener("abort",l,{once:!0});try{await n.put(t,i),null==a||a.throwIfAborted()}finally{null==a||a.removeEventListener("abort",l)}}let m=(e,t)=>
1"".concat(e,"?").concat(new URLSearchParams(t)),E=e=>e===l.session||e.startsWith("".concat(l.session,"?"));function y(e){switch(null==e?void 0:e.auditStatus){case 1:case"PROCESSING":return(0,a._)((0,i._)({},e),{auditStatus:"PROCESSING"});case 2:case"PASS":return(0,a._)((0,i._)({},e),{auditStatus:"PASS"});case 3:case"REJECTED":return(0,a._)((0,i._)({},e),{auditStatus:"REJECTED"});default:throw Error("AUDIT_UNAVAILABLE")}}function w(){var e;let t,I,w,_,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},S=g.identityStorage;try{S||g.transport||(S=window.localStorage)}catch(e){}let O=(0,o.pB)(S),R=new AbortController,N=()=>{try{O.assertCurrent()}catch(t){var e;throw null===(e=g.onIdentityChanged)||void 0===e||e.call(g),t}};async function P(e){N();let t=await e();return N(),t}let T=null!==(e=g.transport)&&void 0!==e?e:f,b="",C="en",U="",k=new WeakSet,L=0,M=new WeakMap;function F(e){return M.set(e,L),e}function G(e){let t=M.get(e);if(void 0!==t&&t!==L)throw Error("SESSION_EXPIRED")}let x=new Map,H=new Map,B=new Set,Y=new Map,J=Promise.resolve(),q=new Map;function z(e,t,r,i){if(e!==l.precheck)return V(e,t,r,i);let a=JSON.stringify(t);if(q.has(a))return q.get(a);let o=J.then(()=>V(e,t,r,i));return J=o.catch(()=>void 0),q.set(a,o),o.finally(()=>q.delete(a)).catch(()=>void 0),o}async function V(e,t,r,i){var a,o,d,u,c,v,p,I,f,h,m,y,w,D,A,_,g,S,P,L,M,F,G,x,H,B;let J,q,z=!(arguments.length>4)||void 0===arguments[4]||arguments[4];N(),e===l.precheck&&O.advance(),void 0===t||E(e)||e===l.access||U||await W(b);let X=void 0===t?void 0:"".concat(e,":").concat(JSON.stringify(t));X&&!r&&(r=null!==(a=Y.get(X))&&void 0!==a?a:crypto.randomUUID(),Y.set(X,r));let j=E(e)?void 0:U;try{N();let a=await T(e,{language:C.startsWith("zh")?"zh-Intl":"en",body:t,key:void 0===t?void 0:null!=r?r:crypto.randomUUID(),csrf:j,signal:null!=i?i:R.signal});if(N(),J=a.data,q=a.status,e.startsWith(l.config+"?")&&200!==a.status)throw Error(404===a.status?"CONFIG_NOT_FOUND":400===a.status?"CONFIG_INVALID_ID":"CONFIG_LOAD_FAILED");if(a.status<200||a.status>=300||(null===(d=a.data)||void 0===d?void 0:null===(o=d.statusInfo)||void 0===o?void 0:o.code)!==0){if(401===a.status&&!s[null===(c=a.data)||void 0===c?void 0:null===(u=c.statusInfo)||void 0===u?void 0:u.code]&&!E(e))throw Error("AUTH_REQUIRED");if(s[null===(p=a.data)||void 0===p?void 0:null===(v=p.statusInfo)||void 0===v?void 0:v.code])throw Error(s[a.data.statusInfo.code]);if([401,403,404].includes(a.status))throw Error("DELIVERY_ACCESS_EXPIRED");throw Error(s[null===(f=a.data)||void 0===f?void 0:null===(I=f.statusInfo)||void 0===I?void 0:I.code]||"TEMPORARY_FAILURE")}return X&&Y.delete(X),a.data.data}catch(u){let a;if(u instanceof Error&&("AbortError"===u.name||"IDENTITY_CONTEXT_CHANGED"===u.message))throw u;a=u instanceof Error&&!("response"in u)?u:e.startsWith(l.config+"?")?Error((null===(A=u.response)||void 0===A?void 0:A.status)===404?"CONFIG_NOT_FOUND":(null===(_=u.response)||void 0===_?void 0:_.status)===400?"CONFIG_INVALID_ID":"CONFIG_LOAD_FAILED"):Error(s[null!==(G=null!==(F=null===(P=u.response)||void 0===P?void 0:null===(S=P.data)||void 0===S?void 0:null===(g=S.statusInfo)||void 0===g?void 0:g.code)&&void 0!==F?F:u.code)&&void 0!==G?G:0]||((null===(L=u.response)||void 0===L?void 0:L.status)!==401||E(e)?void 0:"AUTH_REQUIRED")||([401,403,404].includes(null!==(x=null===(M=u.response)||void 0===M?void 0:M.status)&&void 0!==x?x:0)?"DELIVERY_ACCESS_EXPIRED":"TEMPORARY_FAILURE"));let o=null!=q?q:null===(h=u.response)||void 0===h?void 0:h.status,d=null!==(B=null!==(H=null==J?void 0:null===(m=J.statusInfo)||void 0===m?void 0:m.code)&&void 0!==H?H:null===(D=u.response)||void 0===D?void 0:null===(w=D.data)||void 0===w?void 0:null===(y=w.statusInfo)||void 0===y?void 0:y.code)&&void 0!==B?B:u.code;if(e===l.session&&(403===o&&11===d||4901001===d&&(void 0===o||[200,401,403].includes(o)))&&k.add(a),z&&"TEMPORARY_FAILURE"===a.message&&e!==l.callback&&void 0!==t&&!E(e)&&e!==l.access)return await K(null!=j?j:""),V(e,t,r,i,!1);throw(0,n.T)(a,null!=J?J:u)}}function W(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b=e;let r=t?m(l.session,{reset:"1"}):l.session;return null!=I||(I=z(r,{campaignID:b,locale:C}).then(e=>(U=e.csrfToken,e)).catch(e=>{throw I=void 0,e})),I}async function K(e){U&&U!==e||(w||(I=void 0,w=W(b).finally(()=>{w=void 0})),await w)}function X(e){return"order"in e?(0,a._)((0,i._)({},e.order),{paymentPresentation:e.paymentPresentation}):e}function j(e){var t,r;let o=X(e);x.set(o.orderID,o);let n="PAID"===o.paymentStatus&&"READY"===o.grantStatus;return(0,a._)((0,i._)({},o),{attemptID:null!==(t=o.attemptID)&&void 0!==t?t:void 0,photoMode:"USER_PHOTO",fulfillmentStatus:n&&!o.attemptID?"WAITING_UPLOAD":null!==(r=o.fulfillmentStatus)&&void 0!==r?r:"NOT_SUBMITTED",nextAction:n&&!o.attemptID?"UPLOAD_PHOTO":"WAIT",retryable:!0,canRetryPayment:"PAYABLE"===o.paymentStatus&&!!o.paymentPresentation})}let Q=e=>{var t,r;return(0,a._)((0,i._)({},e),{claimID:null!==(t=e.claimID)&&void 0!==t?t:void 0,expiresAtMs:null!==(r=e.expiresAtMs)&&void 0!==r?r:0,serverNowMs:e.serverTimeMs})},$=e=>(x.set(e.order.orderID,e.order),{orderID:e.order.orderID,paymentStatus:e.order.paymentStatus,pollAfterMs:e.order.pollAfterMs,paymentPresentation:e.paymentPresentation});function Z(e){try{return B.has(e)||"1"===sessionStorage.getItem("hailuo.template.readonly.".concat(e))}catch(t){return B.has(e)}}let ee=()=>{var e;return"hailuo.template.submit.".concat(null!==(e=g.storageScope)&&void 0!==e?e:"live",".").concat(b)};function et(){try{var e;return null!==(e=JSON.parse(sessionStorage.getItem(ee())||"null"))&&void 0!==e?e:void 0}catch(e){return}}function er(e){try{sessionStorage.setItem(ee(),JSON.stringify(e))}catch(e){}}function ei(e){return _||(I=void 0,U="",Y.clear(),H.clear(),x.clear(),L+=1,_=W(e,!0)),_}let ea={assertIdentityCurrent:N,invalidateIdentity(){O.invalidate(),R.abort(),L+=1},setCampaign(e){e!==b&&(I=void 0,_=void 0,U="",L+=1),b=e},setLocale(e){C="zh"===e?"zh-Intl":e},session:async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(I=void 0,U=""),await W(e,t)},submissionDraftID:()=>{var e;return null===(e=et())||void 0===e?void 0:e.draftID},context:async(e,r)=>{let i;ea.setCampaign(e);let a=(0,u.y)(await z(m(l.config,{id:e})));if(a.id!==e)throw Error("CONFIG_INVALID_ID");let o=!1;try{o=!!(null==r?void 0:r.allowReset)&&!sessionStorage.getItem(ee())}catch(e){}let n=!1;if(o&&(null==r?void 0:r.restart))n=!0,i=await ei(e);else try{i=await W(e)}catch(t){if(!o||!k.has(t))throw t;n=!0,i=await ei(e)}return t=(0,d.t4)({sessionReset:n,page:a,questionnaireVersion:"".concat(a.id,":").concat(await A(a)),questions:(0,u.i)(a),capabilities:{promo:!0,recovery:!0,deliveryAccess:!0},uploadLimits:i.uploadLimits,serverNowMs:i.serverTimeMs,products:[],exampleImages:[],termsUrl:"https://hailuoai.video/d
1oc/terms-of-service.html",privacyUrl:"https://hailuoai.video/doc/privacy-policy.html",supportUrl:""})},saveDraft:async(e,t,r,a,o)=>{var n,l;return(0,i._)({draftID:null!==(n=null==o?void 0:o.draftID)&&void 0!==n?n:crypto.randomUUID(),revision:(null!==(l=null==o?void 0:o.revision)&&void 0!==l?l:0)+1,questionnaireVersion:t,answers:r,photoMode:a},"USER_PHOTO"===a&&(null==o?void 0:o.photoMode)==="USER_PHOTO"?{fileID:o.fileID,photoRevision:o.photoRevision,auditStatus:o.auditStatus}:{})},precheck:async(e,t)=>{var r,i,a;let o=await z(l.precheck,{campaignID:b,locale:C,purchaseEmail:t.trim()});return F({expiresAtMs:null!==(r=o.expiresAtMs)&&void 0!==r?r:0,decision:{LOGIN:"REQUIRE_AUTH",PAY:"ALLOW_CHECKOUT",WAIT:"PROCESSING",GENERATE:"GENERATE",RESTORE:"RESTORE"}[o.nextAction],orderID:null!==(i=o.orderID)&&void 0!==i?i:void 0,pollAfterMs:null!==(a=o.pollAfterMs)&&void 0!==a?a:void 0})},quotes:async(e,r,a,o,n)=>{G(r);let s=await z(l.products);if(!Array.isArray(s.packages))throw Error("CONFIG_UNAVAILABLE");let d=s.packages.map(e=>{var t,r,a,o;return(0,i._)({productID:e.productID||e.productId||"",membershipCredits:null===(t=e.bonus)||void 0===t?void 0:t.credit,creditDescription:null===(a=e.bonus)||void 0===a?void 0:null===(r=a.creditStr)||void 0===r?void 0:r.trim(),titleByLocale:{en:e.title||e.name||e.productID||e.productId||""}},(null===(o=e.countdownOfferID)||void 0===o?void 0:o.trim())?{countdownOfferID:e.countdownOfferID}:{})}).filter(e=>e.productID);if(t.products.splice(0,t.products.length,...d),!t.products.length)throw Error("CONFIG_UNAVAILABLE");return Promise.all(t.products.map(async t=>{var r,a,s,d;let{productID:u,countdownOfferID:c,membershipCredits:v,creditDescription:p}=t,I=await z(l.quotes,(0,i._)({campaignID:b,productID:u},c&&(null==o?void 0:o.claimID)&&!n?{promo:{claimID:o.claimID,expectedRevision:o.revision}}:{})),f="h5_android"===I.pricingPlatform&&(null===(r=I.initial.period)||void 0===r?void 0:r.unit)==="MONTH"&&1===I.initial.period.count&&(null===(a=I.renewal.period)||void 0===a?void 0:a.unit)==="MONTH"&&1===I.renewal.period.count&&I.initial.amount===I.renewal.amount;return F({quoteID:I.quoteID,productID:I.productID,amount:I.initial.amount,initialPeriod:I.initial.period,reference:I.reference,currency:I.initial.currency,discountBasisPoints:I.discountBasisPoints,renewalAmount:I.renewal.amount,renewalCurrency:I.renewal.currency,renewalPeriod:"".concat(I.renewal.period.count," ").concat(I.renewal.period.unit.toLowerCase()),credits:I.credits,membershipCredits:f?I.credits:v,creditDescription:"h5_ios"===I.pricingPlatform?p:void 0,creditPeriod:["week","year"].includes(I.renewal.period.unit.toLowerCase())?"week":"month",draftRevision:e.revision,expiresAtMs:I.expiresAtMs,promoExpiresAtMs:null!==(d=null===(s=I.promo)||void 0===s?void 0:s.expiresAtMs)&&void 0!==d?d:0,serverNowMs:I.serverTimeMs,allowedPaymentMethods:I.allowedPaymentMethods})}))},checkout:async function(e,t,r,i,a){var o;let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"LINK";if(G(t),G(r),!(null===(o=r.allowedPaymentMethods)||void 0===o?void 0:o.includes(n)))throw Error("PAYMENT_UNAVAILABLE");return $(await z(l.checkout,{campaignID:b,quoteID:r.quoteID,paymentMethod:n,returnUrl:p()},a))},order:async e=>j(await z(m(l.order,{orderID:e}))),attempt:e=>z(m(l.attempt,{attemptID:e})),generate:async(e,r)=>{if(N(),!e.fileID||"PASS"!==e.auditStatus||!(0,d.fu)(t,e.answers))throw Error("GENERATION_INPUT_REQUIRED");let o=t.questions.map(t=>{let r=e.answers.find(e=>e.questionID===t.questionID),i=t.options.filter(e=>(0,d.oo)(r).includes(e.optionID));if(!i.length)throw Error("GENERATION_INPUT_REQUIRED");return{question:(0,d.NC)(t.titleByLocale,C.startsWith("zh")?"zh":"en"),answer:i.map(e=>(0,d.NC)(e.textByLocale,C.startsWith("zh")?"zh":"en")).join(" / ")}}),n={campaignID:b,fileID:e.fileID,answers:o,useOriginPrompt:!1};N();let s=et();if((null==s?void 0:s.draftID)===e.draftID&&s.result)return s.result;(null==s?void 0:s.draftID)===e.draftID&&JSON.stringify(s.body)===JSON.stringify(n)&&(r=s.key);let u={draftID:e.draftID,key:r,body:n};er(u);try{let e=await z(l.submit,n,r);return er((0,a._)((0,i._)({},u),{body:void 0,result:e})),e}catch(e){if(["CREDIT_INSUFFICIENT","PHOTO_REJECTED","REVISION_CONFLICT"].includes(e.message))try{sessionStorage.removeItem(ee())}catch(e){}throw e}},resumeGeneration:async e=>{N();let t=et();if(!t||t.draftID!==e)return;if(t.result)return t.result;let r=await z(l.submit,t.body,t.key);return er((0,a._)((0,i._)({},t),{body:void 0,result:r})),r},memberGenerate:(e,t,r)=>ea.generate(e,r),currentAttempt:async e=>(b=e,z(m(l.currentAttempt,{campaignID:b}))),retryGeneration:(e,t)=>z(l.submit,{campaignID:b,retryAttemptID:e},t),delivery:async e=>{var t,r,i;let a=await z(m(l.delivery,{deliveryID:e}));return{deliveryID:e,generationStatus:"SUCCEEDED",outputAuditStatus:"PASS",playUrl:null!==(t=a.playbackUrl)&&void 0!==t?t:void 0,downloadUrl:null!==(r=a.downloadUrl)&&void 0!==r?r:void 0,coverUrl:null!==(i=a.coverUrl)&&void 0!==i?i:void 0,playUrlExpiresAtMs:a.mediaUrlExpiresAtMs,emailStatus:a.mailStatus,resendAfterMs:a.resendAfterMs,readOnly:Z(e)}},upload:async(e,t,o,n,s,u,c)=>{var v,p,I,f,E,w;if(null==c||c.throwIfAborted(),"USER_PHOTO"!==o.photoMode||n&&!(0,d.yV)(n))throw Error("UPLOAD_NOT_ALLOWED");let{default:D}=await Promise.resolve().then(r.t.bind(r,99766,23)),A=D(new Uint8Array(await e.arrayBuffer())),_="hailuo.template.upload.".concat(null!==(v=g.storageScope)&&void 0!==v?v:"live",".").concat(t,".").concat(null!==(p=null==n?void 0:n.orderID)&&void 0!==p?p:o.draftID,".").concat(A,".").concat(e.type),S=H.get(s);if(!S)try{let t=JSON.parse(sessionStorage.getItem(_)||"null");(null==t?void 0:null===(I=t.authorization)||void 0===I?void 0:I.uploadID)&&t.expires>Date.now()&&(S=(0,a._)((0,i._)({},t),{file:e}),H.set(s,S))}catch(e){if(S)throw e}let O=()=>{if(S)try{sessionStorage.setItem(_,JSON.stringify({authorization:S.authorization,uploaded:S.uploaded,callbackKey:S.callbackKey,callback:S.callback,expires:Date.now()+864e5}))}catch(e){}};if(S&&S.file!==e)throw Error("REVISION_CONFLICT");S&&(S.callback=await z(m(l.photo,{uploadID:S.authorization.uploadID}),void 0,void 0,c).then(y),O()),S||(S={authorization:await z(l.photoBegin,{campaignID:t,fileName:e.name,mimeType:e.type,sizeBytes:e.size},s,c),uploaded:!1,file:e,callbackKey:crypto.randomUUID()},H.set(s,S),O());let{authorization:R}=S;if(null==u||u((0,a._)((0,i._)({},o),{photoRevision:R.uploadRevision,auditStatus:"UPLOADING"})),!S.callback){let t=await z(m(l.policy,{funnelUploadID:R.uploadID}),void 0,void 0,c),r="".concat(t.dir.replace(/\/+$/,""),"/"),i=R.objectFileName.slice(r.length);if(!R.objectFileName.startsWith(r)||!i||i.includes("/")||i.includes("\\")||[".",".."].includes(i)||1e3*t.expiration<=1e3*t.serverTime+6e4)throw Error("UPLOAD_AUTH_EXPIRED");if(!S.uploaded){N(),await (null!==(f=g.uploadObject)&&void 0!==f?f:h)(t,R.objectFileName,e,c),null==c||c.throwIfAborted(),S.uploaded=!0,O();try{null===(E=g.onPhotoUploaded)||void 0===E||E.call(g,R.uploadID)}catch(e){}}S.callback=await z(l.callback,{dir:t.dir,endpoint:t.endpoint,bucketName:t.bucketName,size:String(e.size),mimeType:e.type,fileName:i,originFileName:e.name,fileMd5:A,fileScene:10,funnelUploadID:R.uploadID},S.callbackKey,c).then(y).catch(async e=>{if(!(e instanceof Error)||"TEMPORARY_FAILURE"!==e.message)throw e;return z(m(l.photo,{uploadID:R.uploadID}),void 0,void 0,c).then(y)})}O();let P=S.callback,T=()=>{var e;return null==u?void 0:u((0,a._)((0,i._)({},o),{photoRevision:R.uploadRevision,fileID:"PASS"===P.auditStatus&&null!==(e=P.fileID)&&void 0!==e?e:void 0,auditStatus:P.auditStatus}))};for(T();"PROCESSING"===P.auditStatus;)await function(e,t){return new Promise((r,i)=>{null==t||t.throwIfAborted();let a=()=>{clearTimeout(o),i(new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{null==t||t.removeEventListener("abort",a),r()},e);null==t||t.addEventListener("abort",a,{once:!0})})}(Math.max(1200,Math.min(null!==(w=P.pollAfterMs)&&void 0!==w?w:1500,1e4)),c),"undefined"!=typeof document&&document.hidden||(P=await z(m(l.photo,{uploadID:R.uploadID}),void 0,void 0,c).then(y));if(S.callback=P,O(),T(),"REJECTED"===P.auditStatus)throw Error("PHOTO_REJECTED");if("PASS"!==P.auditStatus||!P.fileID)throw Error("AUDIT_UNAVAILABLE");return(0,a._)((0,i._)({},o),{photoRevision:R.uploadRevision,fileID:P.fileID,auditStatus:"PASS"})},resend:(e,t)=>{if(Z(e))throw Error("DELIVERY_READ_ONLY");return z(l.resend,{deliveryID:e},t)},identity:async()=>{N();let e=await (g.authenticated?g.authenticated():D(N));return N(),{authenticated:e}},purchases:async(e,t)=>{let r=await z(m(l.purchases,{cursor:t,limit:"20"}));return{orders:r.orders.filter(t=>t.campaignID===e).map(e=>(0,a._)((0,i._)({},j(e)),{deliveryID:e.deliveryID})),nextCursor:r.nextCursor}},closeCheckout:async(e,t)=>{var r;let i=null!==(r=x.get(e))&&void 0!==r?r:X(await z(m(l.order,{orderID:e})));return j(await z(l.close,{orderID:e,expectedRevision:i.revision},t))},activatePromo:async(e,t,r)=>(await z(l.activate,{campaignID:b},r),Q(await z(m(l.promo,{campaignID:b})))),promoStatus:async()=>Q(await z(m(l.promo,{campaignID:b}))),accessDelivery:async(e,t)=>{let r=await z(l.access,{token:e},t);B.add(r.deliveryID);try{sessionStorage.setItem("hailuo.template.readonly.".concat(r.deliveryID),"1")}catch(e){}return r},sendCode:e=>P(async()=>{var t;g.sendCode||g.transport||await (0,v.J)();let i=null!==(t=g.sendCode)&&void 0!==t?t:(await Promise.resolve().then(r.bind(r,90975))).sendEmailLoginCode;return N(),{retryAfterMs:Math.max(12e4,(await i(e)).retryAfterMs)}}),login:(e,t)=>P(async()=>
1{if(g.login)return g.login(e,t);g.transport||await (0,v.J)();let a=await Promise.resolve().then(r.bind(r,90975));N();let o=window.location.href,n=await a.loginWithEmailCode(e,t,(0,i._)({marketingLogin:!0},o?{attributionUrl:(0,c.i)(o)}:{}));if(N(),!g.transport){let{refreshLandingAccount:e}=await Promise.resolve().then(r.bind(r,28638));await e(()=>(N(),!0),null==n?void 0:n.isRegister)}})};return ea}async function D(e){let{getLocalStorageToken:t}=await Promise.resolve().then(r.bind(r,33196));if(e(),!t())return!1;let{getCurrentUser:i}=await Promise.resolve().then(r.bind(r,97194));return e(),!!(await i({showToast:!1,disableLoginIntercept:!0})).userInfo}async function A(e){return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(e))))).map(e=>e.toString(16).padStart(2,"0")).join("")}}}]);
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.