{"version":3,"file":"ElementSwap.C91FFdtu.mjs","names":["useState","c","p","__esmMin","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","init_framer_DKgW_P28","addPropertyControls","ElementSwap","props","y","setY","seen","setSeen","next","cur","YEARS","ceAccent","style","CSS","i","s","j","v","Y","COLS","c$1","HEAD","METALS","p$1","m","at","place","k","col","GT_REGULAR","GT_BOLD","ORDER","MAXROWS","__FramerMetadata__","init_ElementSwap","mm","ControlType","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerIntrinsicWidth\"","\"framerIntrinsicHeight\"","\"framerContractVersion\"","\"framerSupportedLayoutHeight\"","\"framerSupportedLayoutWidth\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/lFWgkEEBpwMDy4hA4Euo/cwz70NXPwRx10zKPdjuw/ElementSwap.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";// The element swap. Three columns, Short, Neither and Left over, open on 1985. The reader clicks\n// through the years and each metal slides to where that year's paper puts it. Cerium holds the top\n// of Left over every year. A pointer on the next year nudges the reader to click.\n//\n// Positions as each paper states them, nothing inferred:\n// 1985: Falconnet, The economics of rare earths, p.6 and p.7. Surplus of the cerics apart from\n//   neodymium; cerium, praseodymium and gadolinium named in excess; holmium, erbium, thulium,\n//   ytterbium, lutetium in excess; samarium in temporary shortage; yttrium may be short.\n//   Lanthanum, europium, terbium and dysprosium are not named one by one, so they are not shown.\n// 2013: Binnemans and others, Rare-earth economics: the balance problem, JOM, p.2. Cerium,\n//   praseodymium, samarium, gadolinium, holmium, thulium, ytterbium, lutetium in excess;\n//   lanthanum in balance; supply equals demand for europium, yttrium, erbium; terbium short;\n//   neodymium and dysprosium drive the market.\n// 2018: Binnemans, Jones, Muller and Yurramendi, Table 3. Lanthanum and cerium oversupply;\n//   europium slight oversupply; all others in balance.\n//\n// One colour only: cerium, the name that never moves, in bleu outremer 59 (Le Corbusier 4320K),\n// the blue of the heap in the terbium interactive. Every other name is ink with a grey dot.\nconst GT_REGULAR=\"https://framerusercontent.com/assets/fEtXBGKHzXt5I1r6Xu6Sif74qQ.woff2\";const GT_BOLD=\"https://framerusercontent.com/assets/Rp1S0GKIuHA3NGtqFhdsnbpnqDs.woff2\";const METALS=[\"Yttrium\",\"Lanthanum\",\"Cerium\",\"Praseodymium\",\"Neodymium\",\"Samarium\",\"Europium\",\"Gadolinium\",\"Terbium\",\"Dysprosium\",\"Holmium\",\"Erbium\",\"Thulium\",\"Ytterbium\",\"Lutetium\"];// cerium always takes the top line of Left over\nconst ORDER=[\"Cerium\",...METALS.filter(m=>m!==\"Cerium\")];const YEARS=[{year:\"1985\",src:\"Falconnet, 1985\",at:{Yttrium:\"S\",Lanthanum:null,Cerium:\"L\",Praseodymium:\"L\",Neodymium:\"N\",Samarium:\"S\",Europium:null,Gadolinium:\"L\",Terbium:null,Dysprosium:null,Holmium:\"L\",Erbium:\"L\",Thulium:\"L\",Ytterbium:\"L\",Lutetium:\"L\"},note:{Yttrium:\"maybe\"}},{year:\"2013\",src:\"Binnemans and others, 2013\",at:{Yttrium:\"N\",Lanthanum:\"N\",Cerium:\"L\",Praseodymium:\"L\",Neodymium:\"N\",Samarium:\"L\",Europium:\"N\",Gadolinium:\"L\",Terbium:\"S\",Dysprosium:\"N\",Holmium:\"L\",Erbium:\"N\",Thulium:\"L\",Ytterbium:\"L\",Lutetium:\"L\"}},{year:\"2018\",src:\"Binnemans and others, 2018\",at:{Yttrium:\"N\",Lanthanum:\"L\",Cerium:\"L\",Praseodymium:\"N\",Neodymium:\"N\",Samarium:\"N\",Europium:\"L\",Gadolinium:\"N\",Terbium:\"N\",Dysprosium:\"N\",Holmium:\"N\",Erbium:\"N\",Thulium:\"N\",Ytterbium:\"N\",Lutetium:\"N\"}}];const COLS=[\"S\",\"N\",\"L\"];const HEAD={S:\"Short\",N:\"Neither\",L:\"Left over\"};const MAXROWS=12;const place=(k,m)=>{const p=YEARS[k].at[m];if(!p)return null;let r=0;for(const mm of ORDER){if(mm===m)break;if(YEARS[k].at[mm]===p)r++;}return{col:COLS.indexOf(p),row:r};};// No quotation marks, greater-than, less-than or ampersand in this string:\n// Framer's server escapes them inside a style element (runbook Part 12).\nconst CSS=`\n@font-face { font-family: HomaGT; src: url(${GT_REGULAR}); font-weight: 400; font-style: normal; font-display: swap; }\n@font-face { font-family: HomaGT; src: url(${GT_BOLD}); font-weight: 700; font-style: normal; font-display: swap; }\n.es { position: relative; container-type: inline-size; width: 100%; color: rgb(10, 10, 10); -webkit-font-smoothing: antialiased; --es-row: clamp(30px, 6cqi, 40px); }\n.es-years { display: flex; gap: clamp(20px, 6cqi, 48px); align-items: baseline; border-top: 1px solid rgba(10, 10, 10, .38); padding-top: 18px; }\n.es-y { position: relative; appearance: none; border: none; background: none; padding: 0 0 6px; cursor: pointer; font-family: HomaGT, Georgia, serif; font-weight: 700; font-size: clamp(34px, 8cqi, 60px); line-height: 1; letter-spacing: -.02em; color: rgba(10, 10, 10, .2); border-bottom: 3px solid transparent; transition: color 200ms linear; }\n.es-y:hover { color: rgba(10, 10, 10, .55); }\n.es-y.cur { color: rgb(10, 10, 10); border-bottom-color: rgb(10, 10, 10); cursor: default; }\n.es-nudge { position: absolute; left: 50%; top: 60%; width: 0; height: 0; pointer-events: none; animation: es-press 2400ms ease-in-out infinite; }\n.es-nudge path { fill: rgb(10, 10, 10); stroke: rgb(255, 255, 255); stroke-width: 1.5; stroke-linejoin: round; }\n@keyframes es-press { 0%, 20% { transform: translate(22px, 18px); } 50%, 58% { transform: translate(0, 0) scale(.9); } 66% { transform: translate(0, 0) scale(1); } 100% { transform: translate(22px, 18px); } }\n.es-src { margin-top: 8px; font-size: 12px; color: rgba(10, 10, 10, .42); min-height: 1.4em; }\n.es-board { position: relative; margin-top: clamp(20px, 4cqi, 30px); height: calc(var(--es-row) * ${MAXROWS} + 44px); }\n.es-head { position: absolute; top: 0; height: 26px; width: calc(33.333% - 8px); display: flex; align-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: rgba(10, 10, 10, .42); border-bottom: 1px solid rgba(10, 10, 10, .2); }\n.es-chip { position: absolute; box-sizing: border-box; height: calc(var(--es-row) - 6px); width: calc(33.333% - 8px); display: flex; align-items: center; gap: 10px; font-family: HomaGT, Georgia, serif; font-size: clamp(15px, 3.3cqi, 21px); line-height: 1; white-space: nowrap; overflow: hidden; color: rgba(10, 10, 10, .82); transition: left 700ms cubic-bezier(.6, 0, .2, 1), top 700ms cubic-bezier(.6, 0, .2, 1), opacity 400ms linear; }\n.es-chip .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: rgba(10, 10, 10, .28); }\n.es-chip.ce { color: var(--es-accent); font-weight: 700; }\n.es-chip.ce .dot { background: var(--es-accent); }\n.es-chip.gone { opacity: 0; pointer-events: none; }\n.es-chip small { font-family: inherit; font-size: .7em; color: rgba(10, 10, 10, .42); margin-left: .1em; }\n.es-note { margin-top: 14px; border-top: 1px solid rgba(10, 10, 10, .15); padding-top: 10px; font-size: 12px; line-height: 1.6; color: rgba(10, 10, 10, .42); }\n.es-note i { font-style: italic; }\n@media (prefers-reduced-motion: reduce) { .es-chip, .es-y { transition: none; } .es-nudge { animation: none; } }\n@container (max-width: 520px) {\n  .es-chip { gap: 7px; }\n}\n`;/**\n * The element swap: which metals were short, and which were left over, 1985 to 2018\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 640\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ElementSwap(props){const{ceAccent=\"#395A8E\",style}=props;const[y,setY]=useState(0);const[seen,setSeen]=useState([true,false,false]);const next=seen.indexOf(false);const cur=YEARS[y];const vars={\"--es-accent\":ceAccent};return /*#__PURE__*/_jsxs(\"div\",{className:\"es\",style:{...vars,...style},children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsx(\"div\",{className:\"es-years\",children:YEARS.map((Y,i)=>/*#__PURE__*/_jsxs(\"button\",{className:\"es-y\"+(i===y?\" cur\":\"\"),onClick:()=>{setY(i);setSeen(s=>s.map((v,j)=>j===i?true:v));},\"aria-pressed\":i===y,children:[Y.year,i===next&&/*#__PURE__*/_jsx(\"span\",{className:\"es-nudge\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 14 21\",width:\"18\",height:\"27\",style:{overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M1 1 L1 17.4 L5.3 13.4 L8.2 19.8 L10.8 18.6 L8 12.4 L13.4 12.4 Z\"})})})]},Y.year))}),/*#__PURE__*/_jsx(\"div\",{className:\"es-src\",children:cur.src}),/*#__PURE__*/_jsxs(\"div\",{className:\"es-board\",\"aria-live\":\"polite\",children:[COLS.map((c,i)=>/*#__PURE__*/_jsx(\"div\",{className:\"es-head \"+c,style:{left:`calc(${i*100/3}% + ${i*4}px)`},children:HEAD[c]},c)),METALS.map(m=>{const p=cur.at[m];let at=place(y,m);if(!at){// not named this year: fade out where it was last, or where it first appears\nfor(let k=y;k>=0&&!at;k--)at=place(k,m);for(let k=y;k<YEARS.length&&!at;k++)at=place(k,m);}const col=at.col;return /*#__PURE__*/_jsxs(\"div\",{className:\"es-chip \"+(p||COLS[col])+(m===\"Cerium\"?\" ce\":\"\")+(p?\"\":\" gone\"),style:{left:`calc(${col*100/3}% + ${col*4}px)`,top:`calc(40px + var(--es-row) * ${at.row})`},\"aria-hidden\":p?undefined:true,children:[/*#__PURE__*/_jsx(\"i\",{className:\"dot\"}),m,p&&cur.note&&cur.note[m]?/*#__PURE__*/_jsx(\"small\",{children:cur.note[m]}):null]},m);})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"es-note\",children:[\"Each metal sits where that year's paper puts it: Falconnet, \",/*#__PURE__*/_jsx(\"i\",{children:\"Journal of the Less-Common Metals\"}),\" (1985); Binnemans and others, \",/*#__PURE__*/_jsx(\"i\",{children:\"JOM\"}),\" (2013); Binnemans, Jones, M\\xfcller and Yurramendi, \",/*#__PURE__*/_jsx(\"i\",{children:\"Journal of Sustainable Metallurgy\"}),\" (2018), Table 3. A metal the paper does not name on its own is left out that year. Neither means in balance, or, for neodymium and dysprosium in 2013, the metals the mines dig for.\"]})]});}addPropertyControls(ElementSwap,{ceAccent:{type:ControlType.Color,title:\"Cerium accent\",defaultValue:\"#395A8E\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ElementSwap\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"640\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ElementSwap.map"],"mappings":"A,4KAuDG,SAAwBW,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,UAAU,SAAOC,EAAW,CAACC,EAAEC,GAAMd,EAAS,CAAC,EAAO,CAACe,EAAKC,GAAShB,EAAS,CAAC,GAAK,GAAM,EAAK,CAAC,EAAQiB,EAAKF,EAAK,QAAQ,EAAK,EAAQG,EAAIC,EAAMN,GAAuC,MAAoB,gBAAM,MAAM,CAAC,UAAU,KAAK,MAAM,CAA9E,cAAcO,EAAyE,GAAGC,CAAK,EAAE,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAASC,CAAG,CAAC,EAAe,gBAAK,MAAM,CAAC,UAAU,WAAW,SAASH,EAAM,KAAK,EAAE,IAAiB,gBAAM,SAAS,CAAC,UAAU,QAAQI,IAAIV,EAAE,OAAO,IAAI,YAAY,CAACC,EAAKS,CAAC,EAAEP,EAAQ,GAAGQ,EAAE,KAAK,EAAE,IAAIC,IAAIF,GAAOG,CAAC,CAAC,CAAE,EAAE,eAAeH,IAAIV,EAAE,SAAS,CAACc,EAAE,KAAKJ,IAAIN,GAAmB,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