PageSourceSearch

https://www.newrecruit.eu/_nuxt/a5YHU4bL.js

js newrecruit.eu collected 2026-09-25 15:09:10 UTC 5,014 bytes, 1 lines download raw bytes

1import{_ as k}from"./BGykuWqv.js";import{K as h,L as b,M as w,N as D,e as S}from"./BpfpAR20.js";import{d as I,_ as C,c as l,F as g,g as y,h as F,o as p,a as L,b as _,f as u,C as N,m as T,n as v,l as $,t as O}from"./1RwgPIr0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a2b71a1-ae76-480b-9cc3-2fc159006a18",e._sentryDebugIdIdentifier="sentry-dbid-9a2b71a1-ae76-480b-9cc3-2fc159006a18")}catch{}})();const E="4ac9-fd30-1e3d-b249";function m(e){return(e||"").replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").replace(/\s+/g," ").trim().toLowerCase()}const M=I({name:"Wh40k11ForceDisposition",setup(){return{store:S()}},data(){return{detachmentMap:{},glyphs:D}},computed:{game(){return this.store.game},season(){var e;return(e=this.game)==null?void 0:e.season},allDispositions(){var e;return(((e=this.season)==null?void 0:e.force_dispositions)||[]).map(t=>{const n=b(t);return{name:t,code:n,accent:w[n]}})},forceDisp(){var t;const e=(t=this.game)==null?void 0:t.game_setup.force_disposition;return{p1:(e==null?void 0:e.p1)??(e==null?void 0:e.you)??null,p2:(e==null?void 0:e.p2)??(e==null?void 0:e.opponent)??null}},players(){const e=this.store.myIndex;return[this.buildPlayer(e),this.buildPlayer(1-e)]},lockedDispositions(){return this.players.map(e=>{var t;return`${e.key}=${e.locked&&((t=e.options[0])==null?void 0:t.name)||""}`}).join("|")}},watch:{lockedDispositions(){this.autoApplyLocked()}},async mounted(){try{const t=await(await fetch("/settings/wh40k-11e/force_dispositions.json")).json(),n=t&&t.flat||t||{},a={};for(const i of Object.keys(n))a[m(i)]=n[i];this.detachmentMap=a}catch{this.detachmentMap={}}this.$nextTick(()=>this.autoApplyLocked())},methods:{buildPlayer(e){const t=e===0?"p1":"p2",n=e===this.store.myIndex,a=e===0?this.game.player1:this.game.player2,i=(a==null?void 0:a.getName)&&a.getName()||(n?this.$referenceStore.getString("game_you"):this.$referenceStore.getString("game_opponent")),s=this.forcedDisposition(e),c=this.detachmentNames(e),o=s?[s]:[...new Set(c.map(f=>this.canonical(this.detachmentMap[m(f)])).filter(Boolean))],r=o.length?this.allDispositions.filter(f=>o.includes(f.name)):this.allDispositions,d=r.length===1;return{index:e,key:t,name:i,accent:n?"var(--color-blue)":"var(--color-red)",options:r,selected:this.forceDisp[t]||(d?r[0].name:null),constrainedBy:o.length?c.join(", "):null,locked:d}},forcedDisposition(e){var n,a;const t=(a=(n=e===0?this.game.player1:this.game.player2)==null?void 0:n.list)==null?void 0:a.army;if(!(t!=null&&t.getForces))return null;try{const i=t.getForces(!0).map(s=>s.getCategories()).flat(1).map(s=>s.getUnits()).flat(1).filter(s=>(h(s.source,"name")||"").toLowerCase().includes("force disposition"));for(const s of i){const c=String(s.calcOptionsList(!1,!0,!0)||"").split(/[,;]/).map(o=>o.trim()).filter(Boolean);for(const o of c){const r=this.canonical(o);if(r)return r}}}catch{}return null},detachmentNames(e){var n,a;const t=(a=(n=e===0?this.game.player1:this.game.player2)==null?void 0:n.list)==null?void 0:a.army;if(!(t!=null&&t.getForces))return[];try{return t.getForces(!0).map(s=>s.getCategories()).flat(1).filter(s=>s.getId()===E).map(s=>s.getUnits()).flat(1).filter(s=>(h(s.source,"name")||"").toLowerCase().includes("detachment")).map(s=>s.calcOptionsList(!1,!0,!0)).flatMap(s=>String(s||"").split(/[,;]/)).map(s=>s.trim()).filter(Boolean)}catch{return[]}},canonical(e){var n;if(!e)return null;const t=m(e);return(((n=this.season)==null?void 0:n.force_dispositions)||[]).find(a=>m(a)===t)||null},autoApplyLocked(){let e=!1;for(const t of this.players)t.locked&&t.options[0]&&this.forceDisp[t.key]!==t.options[0].name&&(this.write(t.key,t.options[0].name),e=!0);e&&this.store.saveGame()},select(e,t){e.locked||(this.write(e.key,t),this.store.saveGame())},write(e,t){this.game.game_setup.force_disposition={...this.forceDisp,[e]:t}}}}),B={key:0,class:"fd"},A={class:"fd-cards"},G=["aria-pressed","onClick","onKeydown"],P={class:"fd-card-name"},j={class:"fd-badge"},K=["innerHTML"];function V(e,t,n,a,i,s){const c=k;return e.store.game&&e.season?(p(),l("div",B,[(p(!0),l(g,null,y(e.players,o=>(p(),l("section",{key:o.index,class:"fd-player"},[L(c,{name:o.name,accent:o.accent},null,8,["name","accent"]),t[1]||(t[1]=_()),u("ul",A,[(p(!0),l(g,null,y(o.options,r=>(p(),l("li",{key:r.name,class:$(["fd-card",{"fd-card--on":o.selected===r.name,"fd-card--locked":o.locked}]),style:v({"--disp-accent":r.accent}),role:"button",tabindex:"0","aria-pressed":o.selected===r.name,onClick:d=>e.select(o,r.name),onKeydown:N(T(d=>e.select(o,r.name),["prevent"]),["enter","space"])},[u("span",P,O(r.name),1),t[0]||(t[0]=_()),u("span",j,[u("span",{class:"fd-glyph",innerHTML:e.glyphs[r.code]}
1,null,8,K)])],46,G))),128))])]))),128))])):F("",!0)}const z=C(M,[["render",V],["__scopeId","data-v-31025531"]]);export{z as default};

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.