PageSourceSearch

https://sekai.best/assets/GachaDetail-rUQa4fP6.js

js sekai.best collected 2026-09-28 13:16:23 UTC 17,208 bytes, 2 lines download raw bytes

1import{o as Ze,aX as Je,l as et,f as tt,m as at,s as U,r as i,b as p,aY as rt,g as P,aZ as b,j as e,F as L,H as M,P as ue,C as me,G as t,ad as ge,T as h,a_ as y,k as nt,a5 as D,a$ as xe,ah as fe,aT as we}from"./index-BNV7g2AX.js";import{V as st}from"./index-aSpXWRYJ.js";import{c as it,C as ct,r as ot,a as lt,b as dt}from"./CardThumb-DeNVYbC6.js";import{T as ae}from"./TabPanelPadding-CiMxIEYo.js";import{C as je}from"./CardMediaCardImg-9_1sXQTY.js";import{L as ht}from"./LinkNoDecoration-2WNktDFZ.js";import{T as ut}from"./TabContext-DcPf6rS9.js";import{T as mt,a as re}from"./Tabs-CE5RdEGH.js";import{T as gt,a as xt,b as jt,c as pe,d as pt}from"./TableRow-CSgg0em3.js";import{T as B}from"./TableCell-Cv3ITajE.js";import{D as Ce}from"./DialogTitle-BTuzmS1R.js";import"./TabPanel-Bj0jkqrf.js";import"./useThemeProps-DkOVvTaI.js";import"./CardMedia-CB5zvBTs.js";import"./KeyboardArrowRight-BZOzo-_4.js";const O=({num:w,right:n=!1,trained:T=!1})=>e.jsx(t,{container:!0,justifyContent:n?"flex-end":"inherit",children:e.jsx(t,{item:!0,children:Array.from({length:w}).map((ne,m)=>e.jsx("img",{src:T?lt:dt,alt:"star",height:"24px"},m))})}),V=()=>e.jsx("img",{src:ot,alt:"star",height:"24px"}),ye=({title:w,content:n,...T})=>e.jsxs(fe,{...T,children:[e.jsx(Ce,{children:w}),e.jsx(we,{children:e.jsx(h,{style:{whiteSpace:"pre-line"},children:n})})]}),Wt=Ze(()=>{const{gachaId:w}=Je(),{t:n}=et(),{getTranslated:T}=tt(),{settings:{contentTransMode:ne},region:m}=at(),[A]=U("gachas"),[E]=U("gachaCeilItems"),[x]=U("cards"),[W]=U("cardRarities"),[r,be]=i.useState(),[G,Te]=i.useState(),[Re,F]=i.useState(!1),[se,Ie]=i.useState("2"),[_e,Q]=i.useState(0),[R,z]=i.useState({cost:{jewel:0,ticket:0},counts:[],spinCount:0}),[ve,ie]=i.useState([]),[g,Se]=i.useState([]),[I,ke]=i.useState([]),[_,$e]=i.useState([]),[v,ce]=i.useState([]),[De,oe]=i.useState(!1),[Be,le]=i.useState(!1),[We,H]=i.useState(!1),[Ge,q]=i.useState([]),Pe=i.useCallback(a=>
1{if(!r||!W||!x)return;const c=a.spinCount,u=g.map(()=>0),s=_.reduce((l,j)=>[...l,j+(l.slice(-1)[0]||0)],[]),o=v.reduce((l,j)=>[...l,j+(l.slice(-1)[0]||0)],[]),d=g.map(l=>r.gachaDetails.filter(j=>{var f;return((f=x.find(te=>te.id===j.cardId))==null?void 0:f.cardRarityType)===l.cardRarityType}).sort((j,f)=>j.weight-f.weight)),S=d.map(l=>l==null?void 0:l.map(j=>j.weight)),Z=[],J=a.gachaBehaviorType.startsWith("over_rarity");let ee=0;J&&(a.gachaBehaviorType==="over_rarity_3_once"?ee=3:a.gachaBehaviorType==="over_rarity_4_once"&&(ee=4));let N=0;for(let l=0;l<c;l++){if(l%10===9&&J&&N===9){const C=Math.random()*100,k=o.findIndex($=>C<$);u[k]+=1;const qe=S[k].reduce(($,Ye)=>[...$,Ye+($.slice(-1)[0]||0)],[]),Ke=I[k],Xe=Math.floor(Math.random()*Ke);Z.push(d[k][qe.filter($=>$<=Xe).length]),N=0;continue}else l%10===0&&(N=0);const j=Math.random()*100,f=s.findIndex(C=>j<C);u[f]+=1;const te=S[f].reduce((C,k)=>[...C,k+(C.slice(-1)[0]||0)],[]),ze=I[f],He=Math.floor(Math.random()*ze);Z.push(d[f][te.filter(C=>C<=He).length]),J&&p[g[f].cardRarityType]<ee&&(N+=1)}z(l=>Object.assign({},l,{cost:{jewel:a.costResourceType==="jewel"||a.costResourceType==="paid_jewel"?l.cost.jewel+(a.costResourceQuantity??0):l.cost.jewel,ticket:a.costResourceType==="gacha_ticket"?l.cost.ticket+(a.costResourceQuantity??0):l.cost.ticket},counts:l.counts.map((j,f)=>u[f]+j),spinCount:l.spinCount+a.spinCount})),ie(Z.slice(-10))},[x,r,g,v,_,W,I]),Le=i.useCallback(()=>{z(a=>({cost:{jewel:0,ticket:0},counts:a.counts.map(()=>0),spinCount:0})),ie([])},[]);i.useLayoutEffect(()=>{A&&A.length&&!r&&be(A.find(a=>a.id===Number(w)))},[r,w,A]),i.useLayoutEffect(()=>{r&&E&&E.length&&!G&&Te(E.find(a=>a.id===r.gachaCeilItemId))},[r,G,E]),i.useLayoutEffect(()=>{if(r&&W){const a=T(`gacha_name:${w}`,r.name);document.title=n("title:gachaDetail",{name:a});const c=[...r.gachaCardRarityRates].sort((s,o)=>o.rate-s.rate).map(s=>Object.assign({},s,W.find(o=>o.cardRarityType===s.cardRarityType))).filter(s=>!!s.rate);Se(c),$e(c.map(s=>s.rate));const u=c.reduce((s,o)=>[...s,o.rate+(s.slice(-1)[0]||0)],[]);if(r.gachaBehaviors.some(s=>s.gachaBehaviorType==="over_rarity_3_once")){const s=c.map(d=>d.rate),o=c.findIndex(d=>d.cardRarityType==="rarity_3");s[o]=u[o],c.forEach((d,S)=>{d.cardRarityType!=="rarity_birthday"&&p[d.cardRarityType]<3&&(s[S]=0)}),ce(s)}else if(r.gachaBehaviors.some(s=>s.gachaBehaviorType==="over_rarity_4_once")){const s=[...u],o=c.findIndex(d=>d.cardRarityType==="rarity_4");s[o]=u[o],c.forEach((d,S)=>{d.cardRarityType!=="rarity_birthday"&&p[d.cardRarityType]<4&&(s[S]=0)}),ce(s)}z(s=>Object.assign({},s,{counts:c.map(()=>0)}))}},[r,ne,w,T,n,W]),i.useLayoutEffect(()=>{if(x&&r&&g){const a=g.map(()=>0);r.gachaDetails.forEach(c=>{const u=x.find(s=>s.id===c.cardId);a[g.findIndex(s=>s.cardRarityType===u.cardRarityType)]+=c.weight}),ke(a)}},[x,r,g]);const[K,de]=i.useState(""),[X,he]=i.useState(""),[Me,Ae]=i.useState(""),[Ee,Fe]=i.useState(""),[Ne,Ue]=i.useState(""),[Y,Oe]=i.useState([]);i.useLayoutEffect(()=>(r&&rt(r.assetbundleName,m).then(({bg:a,card:c,cardname:u,img:s})=>{P(a[0],de,"minio",m),P(s[0],he,"minio",m),Oe([...a.map((o,d)=>({alt:`background image ${d}`,downloadUrl:`${b.minio[m]}/${o.replace(".webp",".png")}`,src:`${b.minio[m]}/${o.replace(".webp",".png")}`})),...s.map((o,d)=>({alt:`feature image ${d}`,downloadUrl:`${b.minio[m]}/${o.replace(".webp",".png")}`,src:`${b.minio[m]}/${o.replace(".webp",".png")}`})),...c.map((o,d)=>({alt:`card image ${d}`,downloadUrl:`${b.minio[m]}/${o.replace(".webp",".png")}`,src:`${b.minio[m]}/${o.replace(".webp",".png")}`})),...u.map((o,d)=>({alt:`cardname image ${d}`,downloadUrl:`${b.minio[m]}/${o.replace(".webp",".png")}`,src:`${b.minio[m]}/${o.replace(".webp",".png")}`}))])}),()=>{de(""),he("")}),[r,m]),i.useLayoutEffect(()=>{r&&(P(`gacha/${r.assetbundleName}/logo/logo.webp`,Ae,"minio",m),P(`home/banner/banner_gacha${r.id}/banner_gacha${r.id}.webp`,Fe,"minio",m))},[r,m]),i.useLayoutEffect(()=>{G&&P(`thumbnail/gacha_item/${G.assetbundleName}.webp`,Ue)},[G]);const Ve=(a,c)=>{Ie(c)},Qe=i.useCallback(a=>
1{if(r&&g.length&&x&&x.length){const c=r.gachaDetails.find(o=>o.cardId===a),u=x.find(o=>o.id===a),s=g.findIndex(o=>o.cardRarityType===u.cardRarityType);return Math.round(c.weight/I[s]*_[s]*1e3)/1e3+" %"+(p[u.cardRarityType]>=3&&r.gachaBehaviors.some(o=>o.gachaBehaviorType==="over_rarity_3_once")||p[u.cardRarityType]>=4&&r.gachaBehaviors.some(o=>o.gachaBehaviorType==="over_rarity_4_once")?`
2`+Math.round(c.weight/I[s]*v[s]*1e3)/1e3+" %":"")}return""},[x,r,g,v,_,I]);return r?e.jsxs(i.Fragment,{children:[e.jsx(L,{children:T(`gacha_name:${w}`,r.name)}),e.jsxs(M,{maxWidth:"md",children:[e.jsx(ut,{value:se,children:e.jsxs(ue,{children:[e.jsxs(mt,{value:se,onChange:Ve,variant:"scrollable",scrollButtons:!0,children:[e.jsx(re,{label:n("gacha:tab.title.banner_logo"),value:"2"}),K&&e.jsx(re,{label:n("gacha:tab.title[3]"),value:"0"}),X&&e.jsx(re,{label:n("gacha:tab.title[4]"),value:"1"})]}),e.jsx(ae,{value:"0",children:e.jsx(me,{onClick:()=>{Q(Y.findIndex(a=>a.src.includes(K.replace(".webp",".png")))),F(!0)},children:e.jsx(je,{image:K})})}),e.jsx(ae,{value:"1",children:e.jsx(me,{onClick:()=>{Q(Y.findIndex(a=>a.src.includes(X.replace(".webp",".png")))),F(!0)},children:e.jsx(je,{image:X})})}),e.jsx(ae,{value:"2",children:e.jsxs(t,{container:!0,direction:"row",spacing:1,alignItems:"center",children:[e.jsx(t,{item:!0,xs:12,md:6,children:e.jsx(ge,{src:Me,alt:"logo",bgColor:""})}),e.jsx(t,{item:!0,xs:12,md:6,children:e.jsx(ge,{src:Ee,alt:"banner",bgColor:""})})]})})]})}),e.jsxs(t,{container:!0,direction:"column",children:[e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("common:id")}),e.jsx(h,{children:r.id})]}),e.jsx(y,{style:{margin:"1% 0"}}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("common:title")}),e.jsx(nt,{contentKey:`gacha_name:${w}`,original:r.name,originalProps:{align:"right"},translatedProps:{align:"right"}})]}),e.jsx(y,{style:{margin:"1% 0"}}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("common:startAt")}),e.jsx(h,{children:new Date(r.startAt).toLocaleString()})]}),e.jsx(y,{style:{margin:"1% 0"}}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("common:endAt")}),e.jsx(h,{children:new Date(r.endAt).toLocaleString()})]}),e.jsx(y,{style:{margin:"1% 0"}}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("common:type")}),e.jsx(h,{children:n(`gacha:gachaType.${r.gachaType}`)})]}),e.jsx(y,{style:{margin:"1% 0"}}),r.gachaType==="ceil"&&e.jsxs(i.Fragment,{children:[e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:ceil_item")}),e.jsx("img",{src:Ne,alt:"gacha ceil item"})]}),e.jsx(y,{style:{margin:"1% 0"}})]}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:summary")}),e.jsx(D,{onClick:()=>oe(!0),variant:"contained",children:n("common:show")})]}),e.jsx(y,{style:{margin:"1% 0"}}),e.jsxs(t,{item:!0,container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:description")}),e.jsx(D,{onClick:()=>le(!0),variant:"contained",children:n("common:show")})]}),e.jsx(y,{style:{margin:"1% 0"}})]})]}),e.jsx(L,{children:n("gacha:gacha_rate")}),e.jsx(M,{maxWidth:"md",children:e.jsxs(t,{container:!0,direction:"row",children:[!!g&&!!_.length&&e.jsxs(i.Fragment,{children:[e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t,{item:!0,xs:2,md:4,children:e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:normalRate")})}),e.jsx(t,{item:!0,xs:9,md:4,children:e.jsx(t,{container:!0,direction:"row",alignItems:"flex-end",spacing:1,children:g.map((a,c)=>e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,alignItems:"center",children:[e.jsx(t,{item:!0,xs:7,children:a.cardRarityType==="rarity_birthday"?e.jsx(t,{container:!0,justifyContent:"flex-end",children:e.jsx(t,{item:!0,children:e.jsx(V,{})})}):e.jsx(O,{num:p[a.cardRarityType],right:!0,trained:p[a.cardRarityType]>=3})}),e.jsx(t,{item:!0,xs:5,children:e.jsx(t,{container:!0,justifyContent:"flex-end",children:e.jsxs(t,{item:!0,children:[_[c].toPrecision(3)," %"]})})})]})},c))})})]})}),e.jsx(t,{item:!0,xs:12,children:e.jsx(y,{style:{margin:"1% 0"}})})]}),!!g&&!!v.length&&e.jsxs(i.Fragment,{children:[e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t,{item:!0,xs:2,md:4,children:e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:guaranteedRate")})}),e.jsx(t,{item:!0,xs:9,md:4,children:e.jsx(t,{container:!0,direction:"row",alignItems:"flex-end",spacing:1,children:g.map((a,c)=>e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,alignItems:"center",children:[e.jsx(t,{item:!0,xs:7,children:a.cardRarityType==="rarity_birthday"?e.jsx(t,{container:!0,justifyContent:"flex-end",children:e.jsx(t,{item:!0,children:e.jsx(V,{})})}):e.jsx(O,{num:p[a.cardRarityType],right:!0,trained:p[a.cardRarityType]>=3})}),e.jsx(t,{item:!0,xs:5,children:e.jsx(t,{container:!0,justifyContent:"flex-end",children:e.jsxs(t,{item:!0,children:[v[c].toPrecision(3)," %"]})})})]})},c))})})]})}),e.jsx(t,{item:!0,xs:12,children:e.jsx(y,{style:{margin:"1% 0"}})})]})]})}),e.jsx(L,{children:n("gacha:gacha_cards")}),e.jsx(M,{maxWidth:"md",children:e.jsxs(t,{container:!0,direction:"row",children:[r.gachaPickups.length>0&&e.jsxs(i.Fragment,{children:[e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,wrap:"nowrap",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:n("gacha:pickupMember",{count:r.gachaPickups.length})}),e.jsx(D,{onClick:()=>{q(r.gachaPickups.map(a=>a.cardId)),H(!0)},variant:"contained",children:n("common:show")})]})}),e.jsx(t,{item:!0,xs:12,children:e.jsx(y,{style:{margin:"1% 0"}})})]}),g.map((a,c)=>e.jsxs(i.Fragment,{children:[e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,wrap:"nowrap",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t,{item:!0,children:a.cardRarityType==="rarity_birthday"?e.jsx(t,{container:!0,justifyContent:"flex-end",children:e.jsx(t,{item:!0,children:e.jsx(V,{})})}):e.jsx(O,{num:p[a.cardRarityType],trained:p[a.cardRarityType]>=3})}),e.jsx(D,{onClick:()=>{!x||!x.length||(q(r.gachaDetails.map(u=>u.cardId).filter(u=>x.find(s=>s.id===u).cardRarityType===a.cardRarityType)),H(!0))},variant:"contained",children:n("common:show")})]})}),e.jsx(t,{item:!0,xs:12,children:e.jsx(y,{style:{margin:"1% 0"}})})]},c))]})}),e.jsx(L,{children:n("gacha:gacha_behaviors")}),e.jsx(M,{maxWidth:"md",children:e.jsx(t,{container:!0,direction:"row",children:r.gachaBehaviors.map(a=>e.jsxs(i.Fragment,{children:[e.jsx(t,{item:!0,xs:12,children:e.jsxs(t,{container:!0,wrap:"nowrap",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t,{item:!0,children:e.jsx(h,{variant:"subtitle1",style:{fontWeight:600},children:a.resourceCategory==="free_resource"?n("gacha:behavior.free"):n("gacha:behavior."+a.gachaBehaviorType)})}),e.jsx(t,{item:!0,children:!!a.costResourceType&&e.jsx(xe,{materialName:a.costResourceType,materialId:a.costResourceId,quantity:a.resourceCategory==="free_resource"?n("gacha:behavior.free"):a.costResourceQuantity,justify:"center",maxWidth:"72px"})})]})}),e.jsx(t,{item:!0,xs:12,children:e.jsx(y,{style:{margin:"1% 0"}})})]},a.id))})}),e.jsx(L,{children:n("gacha:gacha_simulator")}),e.jsxs(M,{maxWidth:"md",children:[e.jsxs(t,{container:!0,spacing:1,justifyContent:"center",alignItems:"center",children:[r.gachaBehaviors.map((a,c)=>e.jsx(t,{item:!0,children:e.jsx(t,{container:!0,spacing:1,children:e.jsx(t,{item:!0,xs:12,children:e.jsx(t,{container:!0,justifyContent:"center",children:e.jsx(t,{item:!0,children:e.jsxs(D,{variant:"contained",color:"primary",onClick:()=>Pe(a),sx:u=>({padding:u.spacing(1,3.5)}),children:[!!a.costResourceType&&e.jsx(xe,{materialName:a.costResourceType,materialId:a.costResourceId,mini:!0,justify:"center"}),e.jsx(h,{variant:"body2",children:a.resourceCategory==="free_resource"?n("gacha:behavior.free"):a.costResourceQuantity})]})})})})})},c)),e.jsx(t,{item:!0,children:e.jsx(D,{variant:"contained",color:"secondary",onClick:()=>Le(),sx:a=>({padding:a.spacing(1,3.5)}),children:n("gacha:simulator.reset")})})]}),e.jsx("br",{}),e.jsxs(t,{container:!0,spacing:1,justifyContent:"center",children:[e.jsx(t,{item:!0,children:e.jsxs(h,{children:[n("gacha:simulator.total"),": ",R.spinCount]})}),e.jsx(t,{item:!0,children:e.jsxs(h,{children:[n("gacha:simulator.jewel"),": ",R.cost.jewel]})}),e.jsx(t,{item:!0,children:e.jsxs(h,{children:[n("gacha:simulator.ticket"),": ",R.cost.ticket]})})]}),e.jsx("br",{}),e.jsx(t,{container:!0,spacing:1,children:e.jsx(t,{item:!0,xs:12,children:e.jsx(t,{container:!0,children:e.jsx(t,{item:!0,xs:12,children:e.jsx(gt,{component:ue,children:e.jsxs(xt,{size:"small",children:[e.jsx(jt,{children:e.jsxs(pe,{children:[e.jsx(B,{children:n("common:rarity")}),e.jsx(B,{children:n("gacha:simulator.count")}),e.jsx(B,{children:n("gacha:simulator.percentage")})]})}),e.jsx(pt,{children:g.map((a,c)=>e.jsx(i.Fragment,{children:e.jsxs(pe,{children:[e.jsx(B,{children:a.cardRarityType==="rarity_birthday"?e.jsx(t,{container:!0,children:e.jsx(t,{item:!0,children:e.jsx(V,{})})}):e.jsx(O,{num:p[a.cardRarityType],trained:p[a.cardRarityType]>=3})}),e.jsx(B,{children:R.counts[c]}),e.jsx(B,{children:R.spinCount?(R.counts[c]/R.spinCount*100).toFixed(2):0})]})},c))})]})})})})})}),e.jsx("br",{}),e.jsx(it,{cardIds:ve.map(a=>a.cardId)})]}),e.jsx(st,{visible:Re,onClose:()=>F(!1),images:Y,zIndex:2e3,activeIndex:_e,downloadable:!0,downloadInNewWindow:!0,onMaskClick:()=>F(!1),zoomSpeed:.25,onChange:(a,c)=>Q(c)}),e.jsx(ye,{open:De,onClose:()=>oe(!1),title:n("gacha:summary"),content:r.gachaInformation.summary}),e.jsx(ye,{open:Be,onClose:()=>le(!1),title:n("gacha:description"),content:r.gachaInformation.description}),e.jsxs(fe,{open:We,onClose:()=>{q([]),H(!1)},fullWidth:!0,children:[e.jsx(Ce,{children:n("gacha:gacha_cards")}),e.jsx(we,{children:e.jsx(t,{container:!0,spacing:1,children:Ge.map(a=>e.jsx(t,{item:!0,xs:4,md:2,children:e.jsx(ht,{to:"/card/"+a,target:"_blank",children:e.jsxs(t,{container:!0,direction:"column",children:[e.jsx(ct,{cardId:a}),e.jsx(h,{align:"center",style:{whiteSpace:"pre-line"},children:Qe(a)})]})})},a))})})]})]}):e.jsxs("div",{children:["Loading... If you saw this for a while, gacha ",w," does not exist."]})});export{Wt 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.