1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6539],{18349:(e,s,a)=>{a.d(s,{T:()=>r});var t=a(95155);a(12115);var o=a(40980);function r({className:e,...s}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,o.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...s})}},21975:(e,s,a)=>{a.d(s,{A:()=>t});let t=(0,a(78340).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},46539:(e,s,a)=>{a.r(s),a.d(s,{CustomModPanel:()=>Y});var t=a(95155),o=a(96795),r=a(12115),l=a(66609),n=a(77531),i=a(92451),d=a(91958),c=a(21975),h=a(99412),m=a(89239),u=a(63818),p=a(53878),x=a(60529),g=a(33807),y=a(35942),b=a(18349),j=a(9192),v=a(42763),f=a(29991),N=a(42450),w=a(49361),C=a(35789),k=a(51152),F=a(24225),T=a(28111),P=
1a(80100),S=a(34193);let B=["embedded","toggle-only"],$={embedded:"Embedded","toggle-only":"Toggle only"},M=["none","while-combo","timed","timed-early-return","while-held","while-toggled"],R={none:"None","while-combo":"While combo runs",timed:"Timed after activation","timed-early-return":"Timed + early return","while-held":"While held","while-toggled":"While toggled"},A=[{key:"fire",label:"Fire"},{key:"adsFire",label:"ADS + Fire"},{key:"weaponSwap",label:"Weapon swap"},{key:"reload",label:"Reload"}],E={id:"custom-mod-active-by-default",label:"Active by default",hint:"Whether this mod is loaded when the script starts. Toggle only uses 1 memory slot for its ON / OFF menu state.",type:"toggle",default:0,editable:!0},O={gamepad:"PS5_UP",keyboard:"KEY_A"},I="text-xs text-muted-foreground",z="text-xs text-destructive",J="text-sm text-muted-foreground max-w-[90%]",V="text-sm font-medium text-foreground",L="mt-1 text-sm text-muted-foreground leading-relaxed max-w-[90%]",q=(e,s,a)=>{if("keyboard"!==e)return s.map(e=>(0,t.jsx)(f.eb,{value:e,children:(0,k.kX)(e,a)},e));let o=k.hE.filter(e=>s.includes(e)),r=k.GB.filter(e=>s.includes(e));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.s3,{children:[(0,t.jsx)(f.TR,{children:"Modifiers"}),o.map(e=>(0,t.jsx)(f.eb,{value:e,children:(0,k.kX)(e,a)},e))]}),(0,t.jsx)(f.mi,{}),(0,t.jsxs)(f.s3,{children:[(0,t.jsx)(f.TR,{children:"Keys"}),r.map(e=>(0,t.jsx)(f.eb,{value:e,children:(0,k.kX)(e,a)},e))]})]})},Y=({isOpen:e,mod:s,initialDraft:a,onClose:Y})=>{var D,U,K,W;let{customMods:Z,createCustomMod:_,updateCustomMod:G,deleteCustomMod:H}=(0,N.U)(),X=(0,o.Z)(),{hasAccess:Q,user:ee}=(0,w.R)(),[es,ea]=(0,r.useState)(()=>a??(0,F.nK)(s||void 0)),[et,eo]=(0,r.useState)({}),[er,el]=(0,r.useState)(!1),en=!!s,ei=!!(s?.loadoutId&&s?.authorId===ee?.id),ed=!!(s?.authorId&&s?.authorId!==ee?.id),ec=!!s?.loadoutId,eh=s?.authorName?.trim()||"the author",[em,eu]=(0,r.useState)(!1),[ep,ex]=(0,r.useState)(!1),[eg,ey]=(0,r.useState)(!1),[eb,ej]=(0,r.useState)(!1),[ev,ef]=(0,r.useState)(!1),[eN,ew]=(0,r.useState)(!1),eC=k.vl[es.handler.device],ek="toggle-only"===es.type,eF="hold"===es.handler.trigger,eT=!!es.handler.secondaryButton,eP="loop"===(D=es.handler.execution)?T.zx:"while-held"===D?T.mh:T.js,eS="keyboard"===es.handler.device?eT?"Primary stays held as the modifier. Secondary is the trigger key or second modifier.":"Optional. Add Secondary to build a shortcut. For combinations like Alt + F, put Alt in Primary and F in Secondary.":eT?"Primary button acts as a held modifier while Trigger applies to the secondary button.":"Optional. Add a second button to create a held modifier + trigger combination.",eB=(0,r.useMemo)(()=>"toggle-only"===es.type?{title:"Toggle only",description:"Creates a standard on / off mod in the Zen menu. It uses one memory slot for its startup toggle state, but still gives you full handler, function, and combo control."}:{title:"Embedded",description:"Compiled directly into the script and kept out of the Zen menu. Trigger defines the input gesture, execution defines the scaffold, and you write function and optional combo code."},[es.type]),e$=(0,T.Ys)(es.suppressCombat),eM=(e,s)=>{let a={name:e.name.trim(),note:e.note.trim(),tag:e.tag.trim(),type:e.type,enabled:e.enabled,handler:{...e.handler,primaryButton:(0,k.rM)(e.handler.primaryButton),secondaryButton:e.handler.secondaryButton?(0,k.rM)(e.handler.secondaryButton):void 0,holdMs:"hold"===e.handler.trigger?e.handler.holdMs||C.Jb:void 0},suppressCombat:(0,T.Ys)(e.suppressCombat),functionCode:(0,T.oO)(e.functionCode),comboCode:(0,T.oO)(e.comboCode)};return{..."toggle-only"===e.type?{...a,type:"toggle-only",activeByDefault:e.activeByDefault}:{...a,type:"embedded"},loadoutId:s?.loadoutId,loadoutVersion:s?.loadoutVersion,authorId:s?.authorId||ee?.id,authorName:s?.authorName}},eR=async()=>{ex(!0);try{let e=await fetch("/api/loadouts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:es.name,description:es.note,tag:es.tag,authorName:"Tunez",data:{...es,id:s?.id||""}})});if(!e.ok)throw Error();let a=await e.json(),t={...es,loadoutId:a.id,loadoutVersion:a.version};ea(t);let o=eM(t,{...s,loadoutId:a.id,loadoutVersion:a.version,authorId:ee?.id,authorName:ee?.name||"Tunez"});G(s.id,o),l.oR.success("Mod published to Loadouts"),Y()}catch{l.oR.error("Failed to publish (Admins only)")}finally{ex(!1),eu(!1)}},eA=async()=>{ej(!0);
1try{let e=await fetch(`/api/loadouts/${s?.loadoutId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:es.name,description:es.note,tag:es.tag,data:{...es,id:s?.id||""}})});if(!e.ok)throw Error();let a=await e.json(),t={...es,loadoutVersion:a.version};ea(t);let o=eM(t,{...s,loadoutVersion:a.version});G(s.id,o),l.oR.success("Public version updated"),Y()}catch{l.oR.error("Failed to update public version")}finally{ej(!1),ey(!1)}},eE=async()=>{ew(!0);try{let e=await fetch(`/api/loadouts/${s?.loadoutId}`);if(404===e.status){let e=eM(es,{...s,loadoutId:void 0,loadoutVersion:void 0});G(s.id,e),l.oR.error("The author removed this mod from Loadouts. It will no longer receive updates."),ef(!1);return}if(!e.ok)throw Error("Server returned an error");let a=await e.json();if(a){let e={...a.data,handler:es.handler,enabled:es.enabled,loadoutVersion:a.version};if(ea(e),a.version>(s?.loadoutVersion||0)){let t=eM(e,{...s,loadoutVersion:a.version});G(s.id,t),l.oR.success("Updated! Re-flash your Zen to apply."),Y()}else l.oR.success("You already have the latest version.")}else l.oR.error("Mod not found on the server.")}catch{l.oR.error("Failed to update")}finally{ew(!1),ef(!1)}},eO=(e,s)=>{ea(a=>({...a,[e]:s}))},eI=(e,s)=>{ea(a=>({...a,handler:{...a.handler,[e]:s}}))},ez=()=>{s&&(H(s.id),el(!1),Y())};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.cj,{open:e,onOpenChange:e=>!e&&Y(),children:(0,t.jsxs)(h.h,{"aria-describedby":void 0,className:"w-full sm:max-w-2xl bg-background border-l border-border flex flex-col p-0 gap-0 shadow-lg h-full overflow-hidden",children:[(0,t.jsx)(h.Fm,{className:p.m4,children:(0,t.jsx)(h.qp,{className:"text-xl font-bold tracking-tight text-foreground",children:s?s.name:"Add custom mod"})}),(0,t.jsx)(y.F,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{className:p.Q,children:(0,t.jsxs)("div",{className:p.Fy,children:[ed&&(0,t.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50/50 p-3 text-sm text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-300",children:[(0,t.jsx)("strong",{children:"Read-only code:"})," This mod was added from Loadouts. You can change its triggers, but the code is managed by ",eh,"."]}),(0,t.jsxs)("section",{className:p.Kh,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-name",children:"Mod name"}),(0,t.jsxs)("span",{className:I,children:[es.name.length,"/",T.BK]})]}),(0,t.jsx)(x.p,{id:"custom-mod-name",className:"h-8",value:es.name,maxLength:T.BK,onChange:e=>eO("name",e.target.value),disabled:ed,placeholder:"Custom Mod Name"}),et.name&&(0,t.jsx)("p",{className:z,children:et.name})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-note",children:"Note"}),(0,t.jsxs)("span",{className:I,children:[es.note.length,"/",T.w7]})]}),(0,t.jsx)(b.T,{id:"custom-mod-note",rows:3,maxLength:T.w7,value:es.note,onChange:e=>eO("note",e.target.value),disabled:ed,placeholder:"Short note for future you."}),et.note&&(0,t.jsx)("p",{className:z,children:et.note})]}),(0,t.jsxs)("div",{className:"space-y-2 sm:max-w-[220px]",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-tag",children:"Tag"}),(0,t.jsxs)("span",{className:I,children:[es.tag.length,"/",T.YZ]})]}),(0,t.jsx)(x.p,{id:"custom-mod-tag",className:"h-8",value:es.tag,maxLength:T.YZ,onChange:e=>eO("tag",e.target.value),disabled:ed,placeholder:"Arc Raiders"}),(0,t.jsx)("p",{className:I,children:"Optional. Shows as a single badge on the card."}),et.tag&&(0,t.jsx)("p",{className:z,children:et.tag})]}),(0,t.jsxs)("div",{className:"space-y-2 sm:max-w-[220px]",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-type",children:"Mod type"}),(0,t.jsxs)(f.l6,{value:es.type,onValueChange:e=>{ea(s=>({...s,type:e,activeByDefault:"toggle-only"===e&&s.activeByDefault}))},disabled:ed,children:[(0,t.jsx)(f.bq,{id:"custom-mod-type",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:B.map(e=>(0,t.jsx)(f.eb,{value:e,children:$[e]},e))})]})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[(0,t.jsx)("p",{className:V,children:eB.title}),(0,t.jsx)("p",{className:L,children:eB.description})]}
1),ek&&(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsx)(P.K,{setting:E,value:es.activeByDefault,onChange:e=>eO("activeByDefault",!!e)})})]}),(0,t.jsxs)("section",{className:p.Kh,children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:p.s8,children:"Handler"}),(0,t.jsx)("p",{className:J,children:"toggle-only"===es.type?"Handler defines when the on / off menu mod should fire its runtime logic. The handler only runs while the menu toggle is enabled.":"Input source is the device. Trigger defines the gesture. Execution defines whether the mod fires once, loops while enabled, or works only while input stays held."})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-4",children:(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-input-source",children:"Input source"}),(0,t.jsxs)(f.l6,{value:es.handler.device,onValueChange:e=>{let s,a,t,o;return s=(0,k.rM)(es.handler.primaryButton),a=es.handler.secondaryButton?(0,k.rM)(es.handler.secondaryButton):void 0,t=k.vl[e].includes(s)?s:O[e],o=a&&k.vl[e].includes(a)?a:void 0,void ea(s=>({...s,handler:{...s.handler,device:e,primaryButton:t,secondaryButton:o}}))},children:[(0,t.jsx)(f.bq,{id:"custom-mod-input-source",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:k.J3.map(e=>(0,t.jsx)(f.eb,{value:e,children:k.eI[e]},e))})]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-primary-button",children:"Primary button"}),(0,t.jsxs)(f.l6,{value:(0,k.rM)(es.handler.primaryButton),onValueChange:e=>eI("primaryButton",e),children:[(0,t.jsx)(f.bq,{id:"custom-mod-primary-button",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:q(es.handler.device,eC,X)})]}),et.primaryButton&&(0,t.jsx)("p",{className:z,children:et.primaryButton})]}),(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-secondary-button",children:"Secondary button"}),(0,t.jsxs)(f.l6,{value:(0,k.rM)(es.handler.secondaryButton||"NONE"),onValueChange:e=>eI("secondaryButton","NONE"===e?void 0:e),children:[(0,t.jsx)(f.bq,{id:"custom-mod-secondary-button",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsxs)(f.gC,{className:p.e6,position:"popper",align:"start",children:[(0,t.jsx)(f.eb,{value:"NONE",children:"None"}),q(es.handler.device,eC.filter(e=>e!==(0,k.rM)(es.handler.primaryButton)),X)]})]}),et.secondaryButton&&(0,t.jsx)("p",{className:z,children:et.secondaryButton})]})]}),(0,t.jsx)("div",{className:p.Zv,children:(0,t.jsx)("p",{children:eS})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-execution",children:"Execution"}),(0,t.jsxs)(f.l6,{value:es.handler.execution,onValueChange:e=>{ea(s=>({...s,handler:{...s.handler,execution:e,trigger:"while-held"===e?"held":"held"===s.handler.trigger?"tap":s.handler.trigger}}))},children:[(0,t.jsx)(f.bq,{id:"custom-mod-execution",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:C.w3.map(e=>(0,t.jsx)(f.eb,{value:e,children:C.jr[e]},e))})]}),et.execution&&(0,t.jsx)("p",{className:z,children:et.execution})]}),(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-trigger",children:"Trigger"}),(0,t.jsxs)(f.l6,{value:es.handler.trigger,onValueChange:e=>{ea(s=>({...s,handler:{...s.handler,trigger:e,execution:"held"===e?"while-held":"while-held"===s.handler.execution?"single":s.handler.execution}}))},children:[(0,t.jsx)(f.bq,{id:"custom-mod-trigger",size:"sm",className:"w-[160px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:C.y$.map(e=>(0,t.jsx)(f.eb,{value:e,disabled:"while-held"===es.handler.execution&&"held"!==e,children:C.B7[e]},e))})]}),et.trigger&&(0,t.jsx)("p",{className:z,children:et.trigger})]}),eF&&(0,t.jsxs)("div",{className:"w-[100px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-hold-ms",children:"Hold time (ms)"}),(0,t.jsx)(x.p,{id:"custom-mod-hold-ms",type:"number",className:"h-8 w-[100px]",min:50,step:10,value:String(es.handler.holdMs||C.Jb),onChange:e=>eI("holdMs",Number(e.target.value)||C.Jb)}),et.holdMs&&(0,t.jsx)("p",{className:z,children:et.holdMs})]})]}),(0,t.jsx)("div",{className:p.Zv,children:(0,t.jsx)("p",{children:"loop"===(U=es.handler.execution)?"Trigger flips internal state. The system keeps calling the run function while the generated state variable stays enabled.":"while-held"===U?"The mod runs only while the selected input stays held. No extra toggle state is generated.":"Trigger fires once and calls a single entry function. Use this for one-time actions and simple macros."})})]}),(0,t.jsxs)("section",{className:p.Kh,children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:p.s8,children:"Combat pause"}),(0,t.jsx)("p",{className:J,children:"Choose when this custom mod pauses core combat systems."})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsxs)("div",{className:"w-[220px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-pause-mode",children:"Pause mode"}),(0,t.jsxs)(f.l6,{value:e$.mode,onValueChange:e=>{ea(s=>{let a=(0,T.Ys)(s.suppressCombat);return"none"===e||"while-combo"===e||"while-held"===e||"while-toggled"===e?{...s,suppressCombat:{mode:e}}:{...s,suppressCombat:{mode:e,durationMs:a.durationMs||T.ap,..."timed-early-return"===e&&{earlyReturn:a.earlyReturn||{...T.nU}}}}})},disabled:ed,children:[(0,t.jsx)(f.bq,{id:"custom-mod-pause-mode",size:"sm",className:"w-[220px]",children:(0,t.jsx)(f.yv,{})}),(0,t.jsx)(f.gC,{className:p.e6,position:"popper",align:"start",children:M.map(e=>(0,t.jsx)(f.eb,{value:e,children:R[e]},e))})]})]}),("timed"===e$.mode||"timed-early-return"===e$.mode)&&(0,t.jsxs)("div",{className:"w-[140px] space-y-2",children:[(0,t.jsx)(g.J,{htmlFor:"custom-mod-suppress-duration",children:"Duration (ms)"}),(0,t.jsx)(x.p,{id:"custom-mod-suppress-duration",type:"number",className:"h-8 w-[140px]",min:T.P7,max:T.nW,step:100,value:String(e$.durationMs||T.ap),disabled:ed,onChange:e=>{var s;return s=Number(e.target.value)||T.ap,void ea(e=>{let a=(0,T.Ys)(e.suppressCombat);return{...e,suppressCombat:{...a,durationMs:s}}})}})]})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[(0,t.jsx)("p",{className:V,children:R[e$.mode]}),(0,t.jsx)("p",{className:L,children:"while-combo"===(K=e$.mode)?"Pauses Rapid Fire, Jump Shot, Anti-Recoil, and Aim Assist only while the generated combo is running.":"timed"===K?"Pauses combat systems for a fixed duration after the custom mod activates.":"timed-early-return"===K?"Pauses combat systems for a fixed duration, then resumes earlier when selected battle-return actions happen.":"while-held"===K?"Pauses combat systems while the trigger input stays held, and while the generated combo finishes.":"while-toggled"===K?"Pauses combat systems while the toggle-only mod or loop state is ON.":"Leaves core combat systems unchanged while this custom mod runs."})]}),"timed-early-return"===e$.mode&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-4 pt-2 sm:grid-cols-4",children:A.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(j.S,{id:`suppress-combat-${e.key}`,checked:!!e$.earlyReturn?.[e.key],disabled:ed,onCheckedChange:s=>{var a,t;return a=e.key,t=!0===s,void ea(e=>{let s=(0,T.Ys)(e.suppressCombat);return{...e,suppressCombat:{...s,earlyReturn:{...s.earlyReturn||T.nU,[a]:t}}}})}}),(0,t.jsx)("label",{htmlFor:`suppress-combat-${e.key}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:e.label})]},e.key))}),et.suppressCombat&&(0,t.jsx)("p",{className:z,children:et.suppressCombat})]}),!ed&&(0,t.jsxs)("section",{className:p.Kh,children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:p.s8,children:"Function"}),(0,t.jsx)("p",{className:J,children:"loop"===(W=es.handler.execution)?`System calls ${T.cP.toggleFunction}() when the trigger fires and ${T.cP.runFunction}() every frame while ${T.cP.stateVariable} is true. Use ${T.cP.comboName} for the generated combo name.`:"while-held"===W?`System calls ${T.cP.runFunction}() every frame while the held condition stays true. Use ${T.cP.comboName} for the generated combo name.`:`System calls ${T.cP.entryFunction}() once when the trigger condition is met. Use ${T.cP.comboName} for the generated combo name.`})]}),(0,t.jsx)(b.T,{rows:10,value:es.functionCode,onChange:e=>eO("functionCode",e.target.value),className:"min-h-56 text-xs leading-6 resize-y font-mono",placeholder:eP,spellCheck:!1}),et.functionCode&&(0,t.jsx)("p",{className:z,children:et.functionCode})]}),!ed&&(0,t.jsxs)("section",{className:p.Kh,children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:p.s8,children:"Combo"}),(0,t.jsx)("p",{className:J,children:"toggle-only"===es.type?`Optional. Use combo ${T.cP.comboName} so the generated combo name stays unique and can be stopped automatically when the menu toggle turns OFF. You can add more combos manually if your Function needs them.`:`Optional. Use combo ${T.cP.comboName} so the generated combo name stays unique and synced with Function. You can add more combos manually if your Function needs them.`})]}),(0,t.jsx)(b.T,{rows:8,value:es.comboCode,onChange:e=>eO("comboCode",e.target.value),className:"min-h-48 text-xs leading-6 resize-y font-mono",placeholder:T.ws,spellCheck:!1}),et.comboCode&&(0,t.jsx)("p",{className:z,children:et.comboCode})]})]})})}),(0,t.jsxs)(h.XW,{className:p.WF,children:[en?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,t.jsx)(m.$,{type:"button",variant:"outline",size:"sm",className:"text-destructive border-destructive/30 hover:bg-destructive/5",onClick:()=>el(!0),children:"Delete"}),ei&&(0,t.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>ey(!0),children:[(0,t.jsx)(n.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Push update"]}),!ei&&!ed&&(0,t.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>eu(!0),children:[(0,t.jsx)(i.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Publish"]}),ed&&ec&&(0,t.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>ef(!0),children:[(0,t.jsx)(d.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Check update"]})]}),(0,t.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>
1{if(s){if(!Q)return void l.oR.error("Subscription required",{description:"Activate your subscription to export custom mods."});(0,T.Fd)(s)}},disabled:!Q||ed,children:[(0,t.jsx)(c.A,{className:"mr-2 h-4 w-4"}),"Export"]})]}):(0,t.jsx)(m.$,{type:"button",variant:"outline",size:"sm",onClick:Y,children:"Cancel"}),(0,t.jsx)(m.$,{type:"button",size:"sm",onClick:()=>{if(!en&&!Q)return void l.oR.error("Subscription required",{description:"Activate your subscription to create new custom mods."});let e=(0,F.n4)(es,Z,s?.id);if(eo(e),Object.keys(e).length>0)return void l.oR.error("Fix the highlighted fields before saving.");let a=eM(es,s);s?G(s.id,a):(_(a),(0,S.s)("custom_mod_created")),Y()},disabled:!en&&!Q,children:"Save"})]})]})}),(0,t.jsx)(v.lG,{open:em,onOpenChange:eu,children:(0,t.jsxs)(v.Cf,{children:[(0,t.jsxs)(v.c7,{children:[(0,t.jsx)(v.L3,{children:"Publish to Loadouts"}),(0,t.jsx)(v.rr,{children:"This will make your mod publicly available to all Tunez users. You can update it later."})]}),(0,t.jsxs)(v.Es,{children:[(0,t.jsx)(m.$,{variant:"outline",onClick:()=>eu(!1),children:"Cancel"}),(0,t.jsx)(m.$,{onClick:eR,disabled:ep,children:(0,t.jsx)(u.g,{idle:"Publish",busy:"Publishing...",isBusy:ep})})]})]})}),(0,t.jsx)(v.lG,{open:eg,onOpenChange:ey,children:(0,t.jsxs)(v.Cf,{children:[(0,t.jsxs)(v.c7,{children:[(0,t.jsx)(v.L3,{children:"Push update to Loadouts"}),(0,t.jsx)(v.rr,{children:"This will silently update the public version of this mod. Existing users will see an update notification."})]}),(0,t.jsxs)(v.Es,{children:[(0,t.jsx)(m.$,{variant:"outline",onClick:()=>ey(!1),children:"Cancel"}),(0,t.jsx)(m.$,{onClick:eA,disabled:eb,children:(0,t.jsx)(u.g,{idle:"Push update",busy:"Updating...",isBusy:eb})})]})]})}),(0,t.jsx)(v.lG,{open:ev,onOpenChange:ef,children:(0,t.jsxs)(v.Cf,{children:[(0,t.jsxs)(v.c7,{children:[(0,t.jsx)(v.L3,{children:"Check for updates"}),(0,t.jsx)(v.rr,{children:"We will download the latest version of this mod. Your trigger settings will not be affected."})]}),(0,t.jsxs)(v.Es,{children:[(0,t.jsx)(m.$,{variant:"outline",onClick:()=>ef(!1),children:"Cancel"}),(0,t.jsx)(m.$,{onClick:eE,disabled:eN,children:eN?"Checking...":"Check update"})]})]})}),(0,t.jsx)(v.lG,{open:er,onOpenChange:el,children:(0,t.jsxs)(v.Cf,{className:"sm:max-w-md",children:[(0,t.jsxs)(v.c7,{children:[(0,t.jsx)(v.L3,{children:"Delete custom mod"}),(0,t.jsx)(v.rr,{children:ei?"This mod is published in Loadouts. Deleting it will destroy it in your profile and remove it from public access. Are you sure?":"This removes the mod from your custom library and from future script builds."})]}),(0,t.jsxs)(v.Es,{children:[(0,t.jsx)(m.$,{variant:"outline",onClick:()=>el(!1),children:"Cancel"}),(0,t.jsx)(m.$,{variant:"destructive",onClick:async()=>{if(ei&&s?.loadoutId)try{let e=await fetch(`/api/loadouts/${s?.loadoutId}`,{method:"DELETE"});if(!e.ok&&404!==e.status)throw Error("Server error");ez(),l.oR.success("Mod deleted and unpublished")}catch{l.oR.error("Failed to delete from Loadouts")}else ez()},children:"Delete"})]})]})})]})}},63818:(e,s,a)=>{a.d(s,{g:()=>r});var t=a(95155);a(12115);var o=a(40980);function r({idle:e,busy:s,isBusy:a,className:r}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"sr-only",children:a?s:e}),(0,t.jsxs)("span",{"aria-hidden":"true",className:(0,o.cn)("grid items-center justify-center",r),children:[(0,t.jsx)("span",{className:(0,o.cn)("col-start-1 row-start-1",a?"invisible":"visible"),children:e}),(0,t.jsx)("span",{className:(0,o.cn)("col-start-1 row-start-1",a?"visible":"invisible"),children:s})]})]})}},77531:(e,s,a)=>{a.d(s,{A:()=>t});let t=(0,a(78340).A)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])}}]);
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.