// Kalibr v2.5 Item Bank — all 212 items, verbatim from Metadata file.
// Source: Kalibr_Metadata_v2_5.md. IPIP public-domain items + Grit-S + BRCS + Work Ethic + AI preferences.
// SD3 items removed (admin-only, not used in participant scoring).
// Format: { id, text, scale, reverse }. Likert = 1..5 (Very Inaccurate → Very Accurate).

const AMBI_ITEMS = [
  ['A001','Am the life of the party','Sociability',false],
  ['A002',"Sympathize with others' feelings",'Altruism',false],
  ['A003','Get chores done right away','Order',false],
  ['A004','Have frequent mood swings','Moodiness',false],
  ['A005','Have a vivid imagination','Fantasy',false],
  ['A006',"Don't talk a lot",'Sociability',true],
  ['A007','Am interested in people','Altruism',false],
  ['A008','Leave my belongings around','Order',true],
  ['A009','Am relaxed most of the time','Anxiety',true],
  ['A010','Have difficulty understanding abstract ideas','Intellect',true],
  ['A011','Feel comfortable around people','Sociability',false],
  ['A012','Insult people','Trust',true],
  ['A013','Pay attention to details','Order',false],
  ['A014','Worry about things','Anxiety',false],
  ['A015','Have a rich vocabulary','Intellect',false],
  ['A016','Keep in the background','Sociability',true],
  ['A017','Have a soft heart','Altruism',false],
  ['A018','Make a mess of things','Order',true],
  ['A019','Seldom feel blue','Moodiness',true],
  ['A020','Am not interested in abstract ideas','Intellect',true],
  ['A021','Start conversations','Sociability',false],
  ['A022',"Am not interested in other people's problems",'Altruism',true],
  ['A023','Get things done quickly','AchievementStriving',false],
  ['A024','Am easily disturbed','Anxiety',false],
  ['A025','Have excellent ideas','Intellect',false],
  ['A026','Have little to say','Sociability',true],
  ['A027','Have a warm heart toward others','Altruism',false],
  ['A028','Often forget to put things back in their proper place','Order',true],
  ['A029','Get upset easily','Anxiety',false],
  ['A030','Do not have a good imagination','Intellect',true],
  ['A031','Talk to a lot of different people at parties','Sociability',false],
  ['A032','Am not really interested in others','Altruism',true],
  ['A033','Like order','Order',false],
  ['A034','Change my mood a lot','Moodiness',false],
  ['A035','Am quick to understand things','Intellect',false],
  ['A037','Take time out for others','Altruism',false],
  ['A038','Shirk my duties','Achievement',true],
  ['A039','Have frequent mood swings','Moodiness',false],
  ['A040','Use difficult words','Intellect',false],
  ['A041',"Don't mind being the center of attention",'Sociability',false],
  ['A042',"Feel others' emotions",'Altruism',false],
  ['A043','Follow a schedule','Order',false],
  ['A044','Get irritated easily','AngryHostility',false],
  ['A046','Am quiet around strangers','Sociability',true],
  ['A047','Make people feel at ease','Altruism',false],
  ['A048','Am exacting in my work','Order',false],
  ['A049','Often feel blue','Depression',false],
  ['A050','Am full of ideas','Intellect',false],
  ['A051','Find it easy to stay focused on a task','SelfDiscipline',false],
  ['A052','Experience a lot of stress','Anxiety',false],
  ['A055',"Don't bother others with my problems",'Trust',true],
  ['A057','Rarely get irritated','AngryHostility',true],
  ['A058','Would rather read a book than go to a party','Intellect',false],
  ['A059','Believe that others have good intentions','Trust',false],
  ['A060','Am not sure about my goals in life','Achievement',true],
  ['A061','Feel threatened easily','Anxiety',false],
  ['A062','Prefer variety to routine','ActionsCuriosity',false],
  ['A064','Anticipate the needs of others','Altruism',false],
  ['A065','Work hard','AchievementStriving',false],
  ['A068','Am skilled in handling social situations','Sociability',false],
  ['A069','Love animals','Altruism',false],
  ['A071','Am often in a bad mood','Moodiness',false],
  ['A072','Like to get lost in thought','Fantasy',false],
  ['A073','Know how to captivate people','Sociability',false],
  ['A074','Believe in the importance of art','Aesthetics',false],
  ['A075','Try not to think about the needy','Altruism',true],
  ['A077','Easily lose my temper','AngryHostility',false],
  ['A078','Am interested in many things','Intellect',false],
  ['A079','Seldom feel sad','Depression',true],
  ['A080','Seek adventure','ActionsCuriosity',false],
  ['A081',"Suffer from others' sorrows",'Altruism',false],
  ['A082','Make friends easily','Sociability',false],
  ['A083','Am able to control my cravings','SelfDiscipline',false],
  ['A084','Find it hard to forgive others','Trust',true],
  ['A085','Am not easily annoyed','AngryHostility',true],
  ['A086','Try to understand myself','Intellect',false],
  ['A087','Have a good word for everyone','Altruism',false],
  ['A088','Give up easily','Achievement',true],
  ['A089','Experience my emotions intensely','Moodiness',false],
  ['A090','Enjoy wild flights of fantasy','Fantasy',false],
  ['A091','Let myself be used','Trust',true],
  ['A092','Know how to organize my time','Order',false],
  ['A093','Can deal with things calmly','Anxiety',true],
  ['A094','Show my feelings openly','Moodiness',false],
  ['A095','Like to visit new places','ActionsCuriosity',false],
  ['A096','Take advantage of others','Trust',true],
  ['A097','Carry out my plans','AchievementStriving',false],
  ['A098','Make rash decisions','Impulsiveness',false],
  ['A099','Am attached to conventional ways','ActionsCuriosity',true],
  ['A100','Have a good imagination','Fantasy',false],
  ['A101','Am hard to get to know','Sociability',true],
  ['A102','Believe that I am important','Trust',true],
  ['A103','Do just enough work to get by','Achievement',true],
  ['A104','Am able to remain calm in tense situations','Anxiety',true],
  ['A106','Am reserved','Sociability',true],
  ['A108','Jump into things without thinking','SelfDiscipline',true],
  ['A109','Dislike change','ActionsCuriosity',true],
  ['A110','Am not easily affected by my emotions','Moodiness',true],
  ['A111','Have a lot of fun','Sociability',false],
  ['A112','Enjoy being part of a group','Sociability',false],
  ['A113','Try to follow the rules','Order',false],
  ['A114','Lose my temper','AngryHostility',false],
  ['A115','Have read the great literary works','Intellect',false],
  ['A116','Avoid crowds','Sociability',true],
  ['A117','Get back at others','Trust',true],
  ['A118','Mess things up','Order',true],
  ['A119','Panic easily','Anxiety',false],
  ['A120','Love to read challenging material','Intellect',false],
  ['A121','Often feel awkward around people','Sociability',true],
  ['A122','Am indifferent to the feelings of others','Altruism',true],
  ['A123','Avoid responsibilities','Achievement',true],
  ['A124','Seldom get mad','AngryHostility',true],
  ['A125','Prefer to stick with things that I know','ActionsCuriosity',true],
  ['A126','Am skilled at handling people','Sociability',false],
  ['A127',"Inquire about others' well-being",'Altruism',false],
  ['A128','Try to do a good job','AchievementStriving',false],
  ['A129','Am quick to judge others','Trust',true],
  ['A130','Am not easily swayed by my emotions','Moodiness',true],
  ['A131','Like to tell jokes','Sociability',false],
  ['A132','Enjoy looking at maps of different places','Fantasy',false],
  ['A133',"Do more than what's expected of me",'AchievementStriving',false],
  ['A134','Am able to control my anger','AngryHostility',true],
  ['A135','Believe that too much tax money goes to support artists','Aesthetics',true],
  ['A136','Am the first to act','Sociability',false],
  ['A137','Trust what people say','Trust',false],
  ['A138','Consistently push myself to achieve my goals','AchievementStriving',false],
  ['A139','Do not know how to deal with emotional situations','Moodiness',false],
  ['A140','Seldom daydream','Fantasy',true],
  ['A141','Wait for others to lead the way','Sociability',true],
  ['A142',"Don't put a lot of thought into things",'SelfDiscipline',true],
  ['A143','Feel comfortable in unfamiliar situations','ActionsCuriosity',false],
  ['A144','Try hard to get the job done right','AchievementStriving',false],
  ['A145','Feel at home with myself','Depression',true],
  ['A146','Seek new experiences','ActionsCuriosity',false],
  ['A147','Treat all people equally','Altruism',false],
  ['A148','Handle my feelings well','Moodiness',true],
  ['A149','Adapt easily to new situations','ActionsCuriosity',false],
  ['A150',"Believe that I'm better than others",'Trust',true],
  ['A151','Want to solve complex problems','Intellect',false],
  ['A152','Am interested in science','Intellect',false],
  ['A153','Am able to stand up for myself','Assertiveness',false],
  ['A154','Accept people as they are','Altruism',false],
  ['A157','Cheer people up','Altruism',false],
  ['A158','Make things overly complicated','SelfDiscipline',true],
  ['A159','Get stressed out easily','Anxiety',false],
  ['A160','Prefer the conventional over the original','ActionsCuriosity',true],
  ['A161','Like to be direct','Assertiveness',false],
  ['A162','Feel sympathy for those who are worse off than myself','Altruism',false],
  ['A163','Keep my place tidy','Order',false],
  ['A164','Am easy to satisfy','Achievement',true],
  ['A166','Know how to get things done','AchievementStriving',false],
  ['A167',"Don't worry about things that have already happened",'Anxiety',true],
  ['A168','Seek to master things','AchievementStriving',false],
  ['A170','Come up with good solutions','Intellect',false],
  ['A171','Am good at many things','Intellect',false],
  ['A172','Give money to beggars','Altruism',false],
  ['A173','Often make last-minute plans','Order',true],
  ['A174','Am full of energy','Assertiveness',false],
  ['A175','Am interested in the lives of others','Altruism',false],
  ['A176','Tend to be disorganised','Order',true],
  ['A177','Am not easily bothered by things','Anxiety',true],
  ['A178','Do not enjoy going to art museums','Aesthetics',true],
  ['A179','Avoid imposing my will on others','Trust',false],
  ['A180','Like to keep my room clean','Order',false],
  ['A181','Look at the bright side of life','Depression',true],
];

const GRIT_ITEMS = [
  ['G001','New ideas and projects sometimes distract me from previous ones','Consistency',true],
  ['G002',"Setbacks don't discourage me",'Perseverance',false],
  ['G003','I have been obsessed with a certain idea or project for a short time but later lost interest','Consistency',true],
  ['G004','I am a hard worker','Perseverance',false],
  ['G005','I often set a goal but later choose to pursue a different one','Consistency',true],
  ['G006','I have difficulty maintaining my focus on projects that take more than a few months to complete','Consistency',true],
  ['G007','I finish whatever I begin','Perseverance',false],
  ['G008','I am diligent. I never give up','Perseverance',false],
];

const BRCS_ITEMS = [
  ['B001','I tend to bounce back quickly after hard times','BRCS',false],
  ['B002','I have a hard time making it through stressful events','BRCS',true],
  ['B003','It does not take me long to recover from a stressful event','BRCS',false],
  ['B004','It is hard for me to snap back when something bad happens','BRCS',true],
];

const WE_ITEMS = [
  ['W001','I am always prepared','WE_AS',false],
  ['W002','I pay attention to details','WE_AS',false],
  ['W003','I get things done right away','WE_AS',false],
  ['W004','I work hard','WE_AS',false],
  ['W005','I carry out my plans','WE_AS',false],
  ['W006','I waste my time','WE_SD',true],
  ['W007','I find it difficult to get down to work','WE_SD',true],
  ['W008','I do just enough to get by','WE_SD',true],
  ['W009',"I don't see things through to the end",'WE_SD',true],
  ['W010','I shirk my duties','WE_SD',true],
];

// AI Preference items — multiple choice. stem + option labels. Option → letter.
// Option letters used in formulas: CT majority of AI006–AI010 → A=100/B=50/C=25 for feedbackOrientation.
const AI_ITEMS = [
  { id:'AI001', scale:'informationProcessing', stem:'When working through a complex problem, I prefer to…',
    options:[['A','Break it down step-by-step, working through it sequentially'],['B','See the whole pattern first, then synthesise a direction']] },
  { id:'AI002', scale:'informationProcessing', stem:'When I receive information from an AI, I want it presented as…',
    options:[['A','Structured lists, sequential points'],['B','Narrative prose with nuance']] },
  { id:'AI003', scale:'informationProcessing', stem:'I am most frustrated when an AI…',
    options:[['A','Gives too much information — I want a quick answer'],['B','Oversimplifies — I want more depth']] },
  { id:'AI004', scale:'informationProcessing', stem:'When making decisions I rely primarily on…',
    options:[['A','Data, models, explicit reasoning'],['B','Intuition, experience, judgment']] },
  { id:'AI005', scale:'informationProcessing', stem:'My preferred depth of AI explanation…',
    options:[['A','Answer only'],['B','Answer plus reasoning'],['C','Full working and alternatives']] },
  { id:'AI006', scale:'challengeTolerance', stem:'I want my AI assistant to…',
    options:[['A','Challenge my assumptions regularly'],['B','Support and validate my thinking'],['C','Only push back when there is a clear error']] },
  { id:'AI007', scale:'challengeTolerance', stem:"When I'm wrong, I prefer the AI to…",
    options:[['A','Tell me directly and immediately'],['B','Gently guide me toward the right answer'],['C','Flag it but let me decide']] },
  { id:'AI008', scale:'challengeTolerance', stem:'I am comfortable with an AI that…',
    options:[['A','Frequently disagrees with me'],['B','Occasionally disagrees'],['C','Rarely disagrees or expresses doubt']] },
  { id:'AI009', scale:'challengeTolerance', stem:'When I share a plan or idea, I most want the AI to…',
    options:[['A','Find flaws and stress-test it'],['B','Build on and enhance it'],['C','Both equally']] },
  { id:'AI010', scale:'challengeTolerance', stem:'An AI that tells me what I want to hear would be…',
    options:[['A','Useless'],['B','Sometimes helpful'],['C','Generally fine']] },
  { id:'AI011', scale:'decisionSupport', stem:'I prefer my AI to…',
    options:[['A','Give a clear recommendation'],['B','Lay out options with pros and cons'],['C','Provide information only — I will decide']] },
  { id:'AI012', scale:'decisionSupport', stem:'When time-pressured, I want the AI to…',
    options:[['A','Answer directly — just give me the answer'],['B','Briefly explain why'],['C','Walk me through the options']] },
  { id:'AI013', scale:'decisionSupport', stem:'I am comfortable delegating decisions to AI when…',
    options:[['A','Stakes are low'],['B','The AI has outperformed me on similar problems'],['C','Never — advise only']] },
  { id:'AI014', scale:'decisionSupport', stem:'For my highest-stakes decisions, AI input should be…',
    options:[['A','One of several inputs'],['B','The primary input'],['C','A final check after I have decided']] },
  { id:'AI015', scale:'decisionSupport', stem:'I trust AI judgment most on…',
    options:[['A','Pattern recognition'],['B','Information retrieval'],['C','Analysis and synthesis'],['D','All equally']] },
  { id:'AI016', scale:'communicationTempo', stem:'My ideal AI response length for routine questions…',
    options:[['A','1–2 sentences'],['B','One paragraph'],['C','Several paragraphs']] },
  { id:'AI017', scale:'communicationTempo', stem:'For strategic conversations I prefer…',
    options:[['A','Sharp, compressed dialogue'],['B','Moderate depth with context'],['C','Extended exploration with worked examples']] },
  { id:'AI018', scale:'communicationTempo', stem:'I prefer AI that…',
    options:[['A','Waits for me to ask'],['B','Proactively raises relevant points'],['C','Anticipates needs before I articulate them']] },
  { id:'AI019', scale:'communicationTempo', stem:'When I return to a conversation I want the AI to…',
    options:[['A','Resume without preamble'],['B','Recap the key threads briefly'],['C','Re-open with a clarifying question']] },
  { id:'AI020', scale:'communicationTempo', stem:'My tolerance for AI going off on tangents…',
    options:[['A','Low — stay on topic'],['B','Moderate — tangents are fine if useful'],['C','High — I like exploratory detours']] },
  { id:'AI021', scale:'cognitiveBlindSpot', stem:'The cognitive pattern I most want an AI to help me resist is…',
    options:[['A','Anchoring on the first idea'],['B','Confirmation of what I already believe'],['C','Over-weighting recent or vivid events'],['D','Sunk-cost commitment'],['E','Groupthink or social proof']] },
  { id:'AI022', scale:'cognitiveBlindSpot', stem:'Under pressure I am most likely to…',
    options:[['A','Freeze on the first option'],['B','Seek data that confirms my leaning'],['C','React to the most recent input'],['D','Double down on existing commitments'],['E','Defer to whoever is loudest']] },
  { id:'AI023', scale:'cognitiveBlindSpot', stem:'My most common decision regret is…',
    options:[['A','Locking in too early'],['B','Not hearing the other side'],['C','Chasing the latest signal'],['D','Staying too long in a failing plan'],['E','Following the group against my instinct']] },
  { id:'AI024', scale:'cognitiveBlindSpot', stem:'The debiasing move I most want the AI to make…',
    options:[['A','Offer an alternative starting point'],['B','Actively argue the opposite view'],['C','Widen the time window I consider'],['D','Test whether I would reinvest today'],['E','Separate what I think from what the room thinks']] },
  { id:'AI025', scale:'cognitiveBlindSpot', stem:'When the AI pushes back on my reasoning I usually…',
    options:[['A','Notice I had locked in'],['B','Notice I had been searching for agreement'],['C','Notice I had over-weighted a recent event'],['D','Notice I was protecting a past choice'],['E','Notice I had echoed the group']] },
];

// Flatten to a single ordered array of Likert items (187 items; 25 AI items appended for 212 total)
const LIKERT_ITEMS = [...AMBI_ITEMS, ...GRIT_ITEMS, ...BRCS_ITEMS, ...WE_ITEMS].map(
  ([id, text, scale, reverse]) => ({ id, text, scale, reverse })
);

// Full ordered master list (for funnel navigation). type: 'likert' | 'ai'.
const ALL_ITEMS = [
  ...LIKERT_ITEMS.map(it => ({ ...it, type: 'likert' })),
  ...AI_ITEMS.map(it => ({ ...it, type: 'ai' })),
];

Object.assign(window, {
  AMBI_ITEMS, GRIT_ITEMS, BRCS_ITEMS, WE_ITEMS, AI_ITEMS,
  LIKERT_ITEMS, ALL_ITEMS,
});
