= 9}> {#if item} {#snippet children()} {#key item?.id ?? position}
= 9} class:editable={ctx?.canEdit()} onclick={() => viewDetails()} >
{#if awakeningImage} {`${item?.awakening?.type?.name?.en {/if}
{#each axSkillImages as skill} {skill.alt} {/each} {#each weaponKeyImages as skill} {skill.alt} {/each}
{displayName(item?.weapon)}
{/key} {/snippet} {#snippet contextMenu()} {m.context_view_details()} {#if ctx?.canEdit()} {m.context_replace()} {m.context_remove()} {/if} {/snippet} {#snippet dropdownMenu()} {m.context_view_details()} {#if ctx?.canEdit()} {m.context_replace()} {m.context_remove()} {/if} {/snippet}
{:else} {#key `empty-${position}`}
= 9} class:editable={ctx?.canEdit()} onclick={() => ctx?.canEdit() && ctx?.openPicker && ctx.openPicker({ type: 'weapon', position, item })} > {#if ctx?.canEdit()} {/if}
{/key} {/if} {#if item} { if (!item?.id || !ctx) return try { const editKey = ctx.getEditKey() const updated = await ctx.services.gridService.updateWeaponUncap(item.id, level, undefined, editKey || undefined) if (updated) { ctx.updateParty(updated) } } catch (err) { console.error('Failed to update weapon uncap:', err) // TODO: Show user-friendly error notification } }} updateTranscendence={async (stage) => { if (!item?.id || !ctx) return try { const editKey = ctx.getEditKey() // When setting transcendence > 0, also set uncap to max (6) const maxUncap = stage > 0 ? 6 : undefined const updated = await ctx.services.gridService.updateWeaponUncap(item.id, maxUncap, stage, editKey || undefined) if (updated) { ctx.updateParty(updated) } } catch (err) { console.error('Failed to update weapon transcendence:', err) // TODO: Show user-friendly error notification } }} /> {/if}
{item ? displayName(item?.weapon) : ''}