1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[2898],{6871(e,t,a){a.d(t,{A:()=>f});var s=a(5043),n=a(8145),i=a(4669),r=a(9598),o=a(6095),l=a(9766),d=a(3390),c=a(3416),u=a(8615),m=a(1261),p=a(579);function f(e){let{assetId:t,assetType:a="image",sessionId:f=null,assetPath:h=null,prompt:v=null,size:g="sm",className:x}=e;const{getFeedback:y,setFeedback:b,getComment:N,setComment:_}=(0,m.j)(),[w,j]=(0,s.useState)(!1),[k,C]=(0,s.useState)(""),[A,P]=(0,s.useState)(!1);if(!t)return null;const D=y(t),z=N(t),L={assetType:a,sessionId:f,assetPath:h,prompt:v},S=e=>a=>{a.preventDefault(),a.stopPropagation(),b(t,e,L)},T="md"===g?"h-9 w-9":"xs"===g?"h-7 w-7":"h-8 w-8",R="md"===g?"h-5 w-5":"xs"===g?"h-3.5 w-3.5":"h-4 w-4",I="inline-flex items-center justify-center rounded-full border bg-black/40 backdrop-blur-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",E=z?n.A:i.A;return(0,p.jsxs)("div",{className:(0,l.cn)("flex items-center","xs"===g?"gap-1":"gap-1.5",x),children:[(0,p.jsx)("button",{type:"button","aria-label":"Thumbs up","aria-pressed":"like"===D,title:"like"===D?"Liked \u2014 click again to remove":"Like this result",onClick:S("like"),className:(0,l.cn)(I,T,"like"===D?"border-emerald-400/60 bg-emerald-500/80 text-white hover:bg-emerald-500":"border-white/20 text-white/90 hover:border-emerald-400/50 hover:text-emerald-300"),children:(0,p.jsx)(o.A,{className:(0,l.cn)(R,"like"===D&&"fill-current")})}),(0,p.jsx)("button",{type:"button","aria-label":"Thumbs down","aria-pressed":"dislike"===D,title:"dislike"===D?"Disliked \u2014 click again to remove":"Dislike this result",onClick:S("dislike"),className:(0,l.cn)(I,T,"dislike"===D?"border-red-400/60 bg-red-500/80 text-white hover:bg-red-500":"border-white/20 text-white/90 hover:border-red-400/50 hover:text-red-300"),children:(0,p.jsx)(r.A,{className:(0,l.cn)(R,"dislike"===D&&"fill-current")})}),"dislike"===D?(0,p.jsxs)(u.AM,{open:w,onOpenChange:j,children:[(0,p.jsx)(u.Wv,{asChild:!0,children:(0,p.jsx)("button",{type:"button","aria-label":z?"Edit comment":"Add a comment",title:z?"Edit your comment":"Add a comment",onClick:e=>{e.preventDefault(),e.stopPropagation(),C(z||""),j(!0)},className:(0,l.cn)(I,T,z?"border-sky-400/60 bg-sky-500/80 text-white hover:bg-sky-500":"border-white/20 text-white/90 hover:border-sky-400/50 hover:text-sky-300"),children:(0,p.jsx)(E,{className:R})})}),(0,p.jsxs)(u.hl,{align:"end",className:"z-[10001] w-72 space-y-2",onClick:e=>e.stopPropagation(),children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{className:"text-sm font-semibold text-foreground",children:z?"Edit your comment":"What went wrong?"}),(0,p.jsx)("p",{className:"text-xs text-muted-foreground",children:"Optional \u2014 help us improve this result."})]}),(0,p.jsx)(c.T,{value:k,onChange:e=>C(e.target.value.slice(0,2e3)),placeholder:"Tell us what could be better\u2026",rows:4,autoFocus:!0,className:"resize-none text-sm"}),(0,p.jsxs)("div",{className:"flex items-center justify-between",children:[(0,p.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[k.length,"/",2e3]}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)(d.$,{type:"button",variant:"ghost",size:"sm",onClick:e=>{e.stopPropagation(),j(!1)},disabled:A,children:"Cancel"}),(0,p.jsx)(d.$,{type:"button",size:"sm",onClick:async e=>{null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),P(!0);try{await _(t,k,L),j(!1)}finally{P(!1)}},disabled:A,children:A?"Saving\u2026":"Save"})]})]})]})]}):null]})}},6230(e,t,a){a.d(t,{A:()=>r});a(5043);var s=a(9432),n=a(5695),i=a(579);function r(e){let{amount:t,note:a,className:r=""}=e;return null==t||Number.isNaN(Number(t))?null:(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border/60 bg-secondary/40 px-2.5 py-1 text-xs font-medium text-muted-foreground "+r,title:"Credits used when you generate",children:[(0,i.jsx)(s.A,{className:"h-3.5 w-3.5 text-accent shrink-0"}),(0,i.jsxs)("span",{children:["Uses ",(0,n.Ak)(t),a?` ${a}`:""]})]})}},125(e,t,a){a.d(t,{Ay:()=>d,CJ:()=>l,cH:()=>o,g8:()=>r,w9:()=>i});var s=a(2353),n=a(579);const i={title:"Delete session?",description:"You will permanently lose this session and its generated assets. This action cannot be undone.",confirmText:"Delete",variant:"destructive"},r={title:"Discard this draft?",description:"You haven't generated anything yet, so this draft isn't saved and won't appear in your History. Continuing discards it. Choose Keep Editing to stay on this draft.",confirmText:"Discard Draft",cancelLabel:"Keep Editing",variant:"destructive"},o={title:"Leave while this is still generating?",description:"Your generation is still running. It will keep going and appear in your History when it finishes, but you'll stop seeing its progress here.",confirmText:"Leave Anyway",cancelLabel:"Stay Here",variant:"default"},l={title:"Leave while this is still generating?",description:"This localization is still running and hasn't been saved yet. If you leave now it may not appear in your History and you'd need to run it again.",confirmText:"Leave Anyway",cancelLabel:"Stay Here",variant:"destructive"};const d=function(e){let{open:t,onOpenChange:a,title:i,description:r,confirmText:o,cancelLabel:l="Cancel",onConfirm:d,variant:c="default",className:u,overlayClassName:m}=e;return(0,n.jsx)(s.Lt,{open:t,onOpenChange:a,children:(0,n.jsxs)(s.EO,{className:u,overlayClassName:m,children:[(0,n.jsxs)(s.wd,{children:[(0,n.jsx)(s.r7,{children:i}),(0,n.jsx)(s.$v,{children:r})]}),(0,n.jsxs)(s.ck,{children:[(0,n.jsx)(s.Zr,{children:l}),(0,n.jsx)(s.Rx,{onClick:d,className:"destructive"===c?"bg-destructive hover:bg-destructive/90":"",children:o})]})]})})}},7159(e,t,a){a.d(t,{A:()=>x});
1var s=a(5043),n=a(9463),i=a(8326),r=a(5379),o=a(9766),l=a(3390),d=a(579);const c=e=>{let{className:t,...a}=e;return(0,d.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,o.cn)("mx-auto flex w-full justify-center",t),...a})};c.displayName="Pagination";const u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,d.jsx)("ul",{ref:t,className:(0,o.cn)("flex flex-row items-center gap-1",a),...s})});u.displayName="PaginationContent";const m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,d.jsx)("li",{ref:t,className:(0,o.cn)("",a),...s})});m.displayName="PaginationItem";const p=e=>{let{className:t,isActive:a,size:s="icon",...n}=e;return(0,d.jsx)("a",{"aria-current":a?"page":void 0,className:(0,o.cn)((0,l.r)({variant:a?"default":"ghost",size:s}),a?"bg-accent text-white hover:bg-accent pointer-events-none shadow":"hover:bg-transparent hover:text-foreground",t),...n})};p.displayName="PaginationLink";const f=e=>{let{className:t,...a}=e;return(0,d.jsxs)(p,{"aria-label":"Go to previous page",size:"default",className:(0,o.cn)("gap-1 pl-2.5",t),...a,children:[(0,d.jsx)(n.A,{className:"h-4 w-4"}),(0,d.jsx)("span",{children:"Previous"})]})};f.displayName="PaginationPrevious";const h=e=>{let{className:t,...a}=e;return(0,d.jsxs)(p,{"aria-label":"Go to next page",size:"default",className:(0,o.cn)("gap-1 pr-2.5",t),...a,children:[(0,d.jsx)("span",{children:"Next"}),(0,d.jsx)(i.A,{className:"h-4 w-4"})]})};h.displayName="PaginationNext";const v=e=>{let{className:t,...a}=e;return(0,d.jsxs)("span",{"aria-hidden":!0,className:(0,o.cn)("flex h-9 w-9 items-center justify-center",t),...a,children:[(0,d.jsx)(r.A,{className:"h-4 w-4"}),(0,d.jsx)("span",{className:"sr-only",children:"More pages"})]})};function g(e,t){const a=[];if(t<=5)for(let s=1;s<=t;s+=1)a.push(s);else e<=3?a.push(1,2,3,4,"ellipsis",t):e>=t-2?a.push(1,"ellipsis",t-3,t-2,t-1,t):a.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return a}function x(e){let{currentPage:t,totalPages:a,onPageChange:s,className:n="mt-8 flex justify-center pb-4"}=e;return a<=1?null:(0,d.jsx)("div",{className:n,children:(0,d.jsx)(c,{children:(0,d.jsxs)(u,{className:"flex-wrap gap-1 justify-center",children:[(0,d.jsx)(m,{children:(0,d.jsx)(f,{onClick:()=>t>1&&s(t-1),className:(1===t?"pointer-events-none opacity-50":"cursor-pointer")+" text-xs sm:text-sm px-2 sm:px-3"})}),g(t,a).map((e,a)=>(0,d.jsx)(m,{children:"ellipsis"===e?(0,d.jsx)(v,{className:"h-8 w-6 sm:w-9"}):(0,d.jsx)(p,{isActive:e===t,onClick:()=>e!==t&&s(e),className:"cursor-pointer h-8 w-8 sm:h-9 sm:w-9 text-xs sm:text-sm",children:e})},`${e}-${a}`)),(0,d.jsx)(m,{children:(0,d.jsx)(h,{onClick:()=>t<a&&s(t+1),className:(t===a?"pointer-events-none opacity-50":"cursor-pointer")+" text-xs sm:text-sm px-2 sm:px-3"})})]})})})}v.displayName="PaginationEllipsis"},2353(e,t,a){a.d(t,{$v:()=>v,EO:()=>m,Lt:()=>l,Rx:()=>g,Zr:()=>x,ck:()=>f,r7:()=>h,tv:()=>d,wd:()=>p});var s=a(5043),n=a(4796),i=a(9766),r=a(3390),o=a(579);const l=n.bL,d=n.l9,c=n.ZL,u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,o.jsx)(n.hJ,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});u.displayName=n.hJ.displayName;const m=s.forwardRef((e,t)=>{let{className:a,overlayClassName:s,...r}=e;return(0,o.jsxs)(c,{children:[(0,o.jsx)(u,{className:s}),(0,o.jsx)(n.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...r})]})});m.displayName=n.UC.displayName;const p=e=>{let{className:t,...a}=e;return(0,o.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};p.displayName="AlertDialogHeader";const f=e=>{let{className:t,...a}=e;return(0,o.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="AlertDialogFooter";const h=s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,o.jsx)(n.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold",a),...s})});h.displayName=n.hE.displayName;const v=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,o.jsx)(n.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});v.displayName=n.VY.displayName;const g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,o.jsx)(n.rc,{ref:t,className:(0,i.cn)((0,r.r)(),a),...s})});g.displayName=n.rc.displayName;const x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,o.jsx)(n.ZD,{ref:t,className:(0,i.cn)((0,r.r)({variant:"outline"}),"mt-2 sm:mt-0",a),...s})});x.displayName=n.ZD.displayName},8615(e,t,a){a.d(t,{AM:()=>o,Wv:()=>l,hl:()=>d});var s=a(5043),n=a(942),i=a(9766),r=a(579);const o=n.bL,l=n.l9,d=(n.Mz,s.forwardRef((e,t)=>{let{className:a,align:s="center",sideOffset:o=4,...l}=e;return(0,r.jsx)(n.ZL,{children:(0,r.jsx)(n.UC,{ref:t,align:s,sideOffset:o,className:(0,i.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",a),...l})})}));d.displayName=n.UC.displayName},8669(e,t,a){a.d(t,{CG:()=>c,cj:()=>d,h:()=>f});var s=a(5043),n=a(7427),i=a(917),r=a(614),o=a(9766),l=a(579);const d=n.bL,c=n.l9,u=(n.bm,n.ZL),m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(n.hJ,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});m.displayName=n.hJ.displayName;const p=(0,i.F)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),f=s.forwardRef((e,t)=>{let{side:a="right",className:s,children:i,...d}=e;return(0,l.jsxs)(u,{children:[(0,l.jsx)(m,{}),(0,l.jsxs)(n.UC,{ref:t,className:(0,o.cn)(p({side:a}),s),...d,children:[(0,l.jsxs)(n.bm,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,l.jsx)(r.A,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"Close"})]}),i]})]})});f.displayName=n.UC.displayName;s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(n.hE,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...s})}).displayName=n.hE.displayName;s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(n.VY,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...s})}).displayName=n.VY.displayName},3416(e,t,a){a.d(t,{T:()=>r});var s=a(5043),n=a(9766),i=a(579);const r=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,i.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:t,...s})});r.displayName="Textarea"},5695(e,t,a){a.d(t,{$V:()=>u,Ak:()=>c,yl:()=>o,zz:()=>r});var s=a(5043),n=a(8931);const i={image_per_aspect_ratio:1,video_per_second:1,ad_clone:.5,avatar_product_generation:1,custom_avatar_preview:1,ad_concept:0,avatar_video_voice_per_second:1,avatar_video_mute_per_second:1,runway_avatar_ugc_per_second:2,runway_multi_shot_per_second:2,veo_multi_shot_per_second:1.25,veo_multi_shot_bridge_image_per_image:1,premium_image_per_aspect_ratio:1,premium_video_per_second:1,veo_video_per_second:1.5,veo_video_per_second_720p:1.25,veo_video_per_second_1080p:1.5,ad_localization:1};function r(){var e,t,a,s,n;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{soundEnabled:r,avatarScript:o,voiceId:l,provider:d,durationSeconds:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("veo"===d){var u,m;const e=null==c?null:i["veo_video_per_second_"+(p=c,Number(p)>=8?"1080p":"720p")];return null!==(u=null!==(m=null!==e&&void 0!==e?e:i.veo_video_per_second)&&void 0!==m?m:i.video_per_second)&&void 0!==u?u:0}var p,f,h;return!1===r?null!==(e=null!==(t=i.avatar_video_mute_per_second)&&void 0!==t?t:i.video_per_second)&&void 0!==e?e:0:o&&String(o).trim()||l&&String(l).trim()?null!==(f=null!==(h=i.avatar_video_voice_per_second)&&void 0!==h?h:i.video_per_second)&&void 0!==f?f:0:"runway"===d?null!==(a=null!==(s=i.premium_video_per_second)&&void 0!==s?s:i.video_per_second)&&void 0!==a?a:0:null!==(n=i.video_per_second)&&void 0!==n?n:0}function o(){var e,t,a;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{provider:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"runway"===n?null!==(e=null!==(t=s.premium_image_per_aspect_ratio)&&void 0!==t?t:s.image_per_aspect_ratio)&&void 0!==e?e:0:null!==(a=s.image_per_aspect_ratio)&&void 0!==a?a:0}let l=null,d=null;function c(e){return`${function(e){return(Number(e)||0).toLocaleString(void 0,{maximumFractionDigits:1})}(e)} credit${1===Number(e)?"":"s"}`}function u(){const[e,t]=(0,s.useState)(l||i);return(0,s.useEffect)(()=>{let e=!0;return(l?Promise.resolve(l):(d||(d=n.Ay.getCreditCosts().then(e=>(l={...i,...(null===e||void 0===e?void 0:e.costs)||{}},l)).catch(()=>({...i})).finally(()=>{d=null})),d)).then(a=>{e&&t(a)}),()=>{e=!1}},[]),e}},8936(e,t,a){a.d(t,{o:()=>r});var s=a(5043),n=a(125);const i=e=>Boolean("function"===typeof e?e():e);function r(){let{hasGeneratedAsset:e=!1,hasDraftInput:t=!1,isGenerating:a=!1,sessionId:r=null,onDiscardSession:o=null,onConfirmDiscard:l=null,generationSurvivesNavigation:d=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[c,u]=(0,s.useState)({open:!1,copy:null}),m=(0,s.useRef)(null),p=!e&&Boolean(r),f=a&&!e,h=(0,s.useRef)();h.current={hasGeneratedAsset:e,hasDraftInput:t,hasOrphanSession:p,isBusyOnUnfinishedWork:f,sessionId:r,onDiscardSession:o,onConfirmDiscard:l,generationSurvivesNavigation:d};const v=(0,s.useCallback)(async()=>
1{const{hasOrphanSession:e,sessionId:t,onDiscardSession:a}=h.current;if(e&&t&&a)try{await a(t)}catch(s){console.error("Failed to discard abandoned draft session:",s)}},[]),g=(0,s.useCallback)(()=>{u({open:!1,copy:null}),m.current=null},[]),x=(0,s.useCallback)(e=>{if("function"!==typeof e)return;const{hasGeneratedAsset:t,hasDraftInput:a,isBusyOnUnfinishedWork:s,generationSurvivesNavigation:r}=h.current,o=!t&&i(a);return s?(m.current=e,void u({open:!0,copy:r?n.cH:n.CJ})):o?(m.current=e,void u({open:!0,copy:n.g8})):(v(),void e())},[v]),y=(0,s.useCallback)(()=>{var e,t;const a=m.current;m.current=null,u({open:!1,copy:null}),h.current.isBusyOnUnfinishedWork||v(),null===(e=(t=h.current).onConfirmDiscard)||void 0===e||e.call(t),a&&a()},[v]);(0,s.useEffect)(()=>{const e=e=>{const{hasGeneratedAsset:t,hasDraftInput:a,isBusyOnUnfinishedWork:s}=h.current;(s||!t&&i(a))&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]);const b=(0,s.useMemo)(()=>{var e,t,a,s,n;return{open:c.open,onOpenChange:e=>{e||g()},title:null===(e=c.copy)||void 0===e?void 0:e.title,description:null===(t=c.copy)||void 0===t?void 0:t.description,confirmText:null===(a=c.copy)||void 0===a?void 0:a.confirmText,cancelLabel:null===(s=c.copy)||void 0===s?void 0:s.cancelLabel,variant:null===(n=c.copy)||void 0===n?void 0:n.variant,onConfirm:y,className:"z-[60]",overlayClassName:"z-[60]"}},[c,g,y]);return(0,s.useMemo)(()=>({confirmNavigation:x,dialogProps:b}),[x,b])}},9248(e,t,a){a.d(t,{R:()=>m});const s=["503","unavailable","high demand","spikes in demand"],n=["queue_full","at capacity","queue is full"],i=["generation_busy","already have a generation","generation in progress"],r=["413","file too large","file_too_large","payload too large","request entity too large"],o=["account balance","balance not enough","kling","1102","prepayment","depleted","billing","ai studio","credits are depleted","runway","insufficient credits","insufficient_credits","not have enough credits","do not have enough credits","no credits","out of credits","credit balance","billing_disabled","developer portal","payment failed","runway api error"],l=["rate limit","quota","resource exh
1austed","resource_exhausted","traffic","overloaded","temporarily unavailable"],d="AI model is currently busy. Please try again in a little while.",c="Our AI service is experiencing high traffic. Please try again in a few moments.";function u(e,t){return t.some(t=>e.includes(t))}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=t.fallback||"Something went wrong. Please try again.";let m="",p=t.status;"string"===typeof e?m=e:e&&"object"===typeof e&&(m=e.message||e.detail||"",null==p&&(p=e.status));const f=String(m||"").trim(),h=f.toLowerCase();return 413===p||u(h,r)?"File is too large. Use an image under 15 MB.":u(h,i)?"You already have a generation in progress. Wait for it to finish.":u(h,n)?"We're at capacity. Try again in a moment.":u(h,s)?d:u(h,o)||h.includes("resource_exhausted")&&h.includes("billing")?"AI generation service is temporarily unavailable due to provider credit limits. Please try again in a little while or contact support.":u(h,l)?c:401===p?"Your session has expired. Please sign in again.":402===p?f||"Insufficient credits. Please add credits to continue.":403===p?f||"You do not have permission for this action.":404===p?f||"The requested resource was not found.":429===p?c:503===p?d:"number"===typeof p&&p>=500?f||"Server error. Please try again.":!f||f.includes("{")||h.includes("request_id")?a:f}}}]); 2//# sourceMappingURL=2898.a92c5f8b.chunk.js.map
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.