@pie-element/rubric 7.2.0-next.5 → 7.2.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [7.2.0-next.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@7.2.0-next.6...@pie-element/rubric@7.2.0-next.7) (2026-04-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs PIE-129 ([cee3e10](https://github.com/pie-framework/pie-elements/commit/cee3e109a9c1d9a68ab592781c968f6b27209846))
11
+
12
+ # [7.2.0-next.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@7.2.0-next.5...@pie-element/rubric@7.2.0-next.6) (2026-04-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - bump libs PIE-46, PIE-25, PIE-54, PIE-44, PIE-29, PIE-13, PIE-129 ([5c17838](https://github.com/pie-framework/pie-elements/commit/5c17838a53483437e42dc679a4361e16b7ef5e31))
17
+
6
18
  # [7.2.0-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@7.2.0-next.4...@pie-element/rubric@7.2.0-next.5) (2026-04-13)
7
19
 
8
20
  ### Bug Fixes
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.2.0-next.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@6.2.0-next.6...@pie-element/rubric-configure@6.2.0-next.7) (2026-04-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs PIE-129 ([cee3e10](https://github.com/pie-framework/pie-elements/commit/cee3e109a9c1d9a68ab592781c968f6b27209846))
11
+
12
+ # [6.2.0-next.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@6.2.0-next.5...@pie-element/rubric-configure@6.2.0-next.6) (2026-04-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - bump libs PIE-46, PIE-25, PIE-54, PIE-44, PIE-29, PIE-13, PIE-129 ([5c17838](https://github.com/pie-framework/pie-elements/commit/5c17838a53483437e42dc679a4361e16b7ef5e31))
17
+
6
18
  # [6.2.0-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@6.2.0-next.4...@pie-element/rubric-configure@6.2.0-next.5) (2026-04-13)
7
19
 
8
20
  ### Bug Fixes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/rubric-configure",
3
3
  "private": true,
4
- "version": "6.2.0-next.5",
4
+ "version": "6.2.0-next.7",
5
5
  "description": "Rubric authoring view",
6
6
  "main": "lib/index.js",
7
7
  "author": "Pie Framework Authors",
@@ -11,10 +11,10 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/config-ui": "12.2.0-next.29",
15
- "@pie-lib/editable-html-tip-tap": "1.2.0-next.28",
16
- "@pie-lib/render-ui": "5.2.0-next.7",
17
- "@pie-lib/rubric": "1.2.0-next.29",
14
+ "@pie-lib/config-ui": "12.2.0-next.36",
15
+ "@pie-lib/editable-html-tip-tap": "1.2.0-next.35",
16
+ "@pie-lib/render-ui": "5.2.0-next.8",
17
+ "@pie-lib/rubric": "1.2.0-next.36",
18
18
  "debug": "^4.1.1",
19
19
  "react": "18.3.1",
20
20
  "react-dom": "18.3.1"
package/module/element.js CHANGED
@@ -1 +1 @@
1
- import{_dll_react as e,_dll_mui__material_styles as t,_dll_mui__material as n,_dll_mui__material_collapse as i,_dll_pie_lib__render_ui as r,_dll_prop_types as o,_dll_react_dom as l,_dll_debug as s}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as a}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";const c=e,{styled:d}=t,{ListItem:h}=n,{List:p}=n,m=i,{color:u}=r,{UiLayout:g}=r,x=o,b=d(g)({color:u.text(),backgroundColor:u.background(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}}),_=d(h)({display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"}),f=d("div")({color:u.text()}),y=d("h3")({color:u.text(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"}),k=d("h4")({color:u.text(),fontSize:"16px",fontWeight:"normal",margin:0,paddingBottom:"6px"}),S=d("h2")(({theme:e})=>({display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:u.tertiary(),margin:0})),E=d("span")({display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"}),v=d("h2")({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}),w=x.shape({excludeZero:x.bool,points:x.arrayOf(x.string),sampleAnswers:x.arrayOf(x.string),animationsDisabled:x.bool});class C extends c.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),C.prototype.__init.call(this),C.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={model:x.object.isRequired,animationsDisabled:x.bool,value:w}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:i}=e||{},{points:r,sampleAnswers:o}=t,l=c.createElement(p,{component:"nav"},r.slice(0).reverse().map((e,n)=>{n=r.length-n-1;const i=t.excludeZero?n+1:n;return c.createElement(c.Fragment,{key:n},c.createElement(_,{key:`P${n}`},c.createElement(y,null,1===i?`${i} PT`:`${i} PTS`),c.createElement(f,{dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&c.createElement(_,{key:`S${n}`},c.createElement(k,null,"Sample Answer"),c.createElement(f,{dangerouslySetInnerHTML:{__html:o[n]}})))}));return c.createElement(b,{extraCSSRules:i},c.createElement(v,null,"Rubric"),n?l:c.createElement(c.Fragment,null,c.createElement(S,{id:"rubric-toggle",tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",c.createElement(E,{"aria-hidden":"true"},this.state.rubricOpen?c.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c.createElement("polyline",{points:"18 15 12 9 6 15"})):c.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c.createElement("polyline",{points:"6 9 12 15 18 9"})))),c.createElement(m,{in:this.state.rubricOpen,timeout:{enter:225,exit:195}},l)))}return null}}C.__initStatic();var R,L=l;R=L.createRoot,L.hydrateRoot;const M=e,O=s,{renderMath:P}=a;class T extends HTMLElement{constructor(){super(),O.log("constructor called"),this.onModelChanged=this.onModelChanged.bind(this),this._root=null}set model(e){this._model=e,this._render()}onModelChanged(e){this._model=e,this._render()}connectedCallback(){this._render()}_render(){if(this._model){const e=M.createElement(C,{value:this._model});this._root||(this._root=R(this)),this._root.render(e),queueMicrotask(()=>{P(this)})}}disconnectedCallback(){this._root&&this._root.unmount()}}export{T as default};
1
+ import{_dll_prop_types as e,_dll_react as t,_dll_mui__material_styles as n,_dll_react_dom as i,_dll_mui__material as r,_dll_debug as o,_dll_mui__material_collapse as s}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as l}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{green as a,orange as c,red as p,indigo as d,pink as u}from"@mui/material/colors";const h=t,m=e,f=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",E=({size:e,children:t})=>{const n={height:e=f(e),width:e,display:"inline-block",position:"relative"};return h.createElement("div",{style:n},t)};E.propTypes={size:m.number,children:m.oneOfType([m.arrayOf(m.node),m.node]).isRequired};const g=t,y=e,b=({size:e,children:t,sx:n})=>g.createElement(E,{size:e},g.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));b.propTypes={size:y.oneOfType([y.string,y.number]),children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired,sx:y.object},y.string.isRequired;const x=({fill:e})=>g.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});x.propTypes={fill:y.string.isRequired};const v=({fill:e})=>g.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});v.propTypes={fill:y.string.isRequired};const C=({fill:e})=>g.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});C.propTypes={fill:y.string.isRequired};const k=({fill:e})=>g.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});k.propTypes={fill:y.string.isRequired};const _=e,R=t;var S=(e,t)=>{class n extends R.Component{static __initStatic(){this.propTypes={iconSet:_.oneOf(["emoji","check"]),shape:_.oneOf(["round","square"]),category:_.oneOf(["feedback",void 0]),open:_.bool,size:_.oneOfType([_.number,_.string]),fg:_.string,bg:_.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:o,size:s,fg:l,bg:a}=this.props,c="check"===n?R.createElement(e,{fill:l}):R.createElement(t,{fill:l}),p="check"===n?R.createElement(e,{fill:a}):R.createElement(t,{fill:a});return o?R.createElement(b,{size:s},p):R.createElement(b,{size:s},"feedback"===r?"round"===i?R.createElement(v,{fill:a}):R.createElement(x,{fill:a}):"round"===i?R.createElement(C,{fill:a}):R.createElement(k,{fill:a}),c)}}return n.__initStatic(),n.__initStatic2(),n};const O=e,T=t,A=({fill:e})=>T.createElement("g",{transform:"translate(1, 0)"},T.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),T.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),T.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));A.propTypes={fill:O.string.isRequired};const N=({fill:e,x:t=0,y:n=0})=>T.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});N.propTypes={fill:O.string.isRequired,x:O.number,y:O.number};const D=S(N,A);D.propTypes={iconSet:O.oneOf(["emoji","check"]),shape:O.oneOf(["round","square"]),category:O.oneOf(["feedback",void 0]),open:O.bool,fg:O.string,bg:O.string,size:O.oneOfType([O.string,O.number])},D.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const M=e,{styled:B}=n;M.string.isRequired,M.string.isRequired,M.string.isRequired,M.string.isRequired,M.string.isRequired,B("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),M.bool,M.string;const F=e,w=t,L=({fill:e})=>w.createElement("g",{transform:"translate(0.5, 0.5)"},w.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),w.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));L.propTypes={fill:F.string.isRequired};const z=({fill:e})=>w.createElement("g",{transform:"translate(1,0)"},w.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),w.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),w.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));z.propTypes={fill:F.string.isRequired};const I=S(L,z);I.propTypes={iconSet:F.oneOf(["emoji","check"]),shape:F.oneOf(["round","square"]),category:F.oneOf(["feedback",void 0]),open:F.bool,fg:F.string,bg:F.string,size:F.oneOfType([F.string,F.number])},I.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const P=e,j=t,q=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return j.createElement("g",null,j.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),j.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),j.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},U=({children:e,size:t})=>j.createElement(E,{size:t},j.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));U.propTypes={children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,size:P.number};const Y=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),H=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class $ extends j.Component{constructor(e){super(e)}render(){return!0===this.props.open?j.createElement(U,null,j.createElement(Y,null),j.createElement(q,null)):j.createElement(U,null,j.createElement(H,null),j.createElement(q,null))}}$.propTypes={open:P.bool},$.defaultProps={open:!1};const W=e,K=t,G=({fill:e})=>K.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});G.propTypes={fill:W.string};class V extends K.Component{static __initStatic(){this.propTypes={classes:W.object.isRequired,size:W.number}}render(){const{size:e}=this.props;return!0===this.props.open?K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},K.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(G,{fill:"#1A9CFF"}))):K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(G,{fill:"1A9CFF"})))}}V.__initStatic(),V.propTypes={open:W.bool},V.defaultProps={open:!1};const J=e,X=t,Z=({fill:e})=>X.createElement("g",null,X.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),X.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Z.propTypes={fill:J.string.isRequired};const Q=({fill:e})=>X.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});Q.propTypes={fill:J.string.isRequired};const ee=({fill:e})=>X.createElement("g",null,X.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),X.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),X.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));ee.propTypes={fill:J.string.isRequired};class te extends X.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(Z,{fill:t})),emoji:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(ee,{fill:t})),feedback:{check:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(ee,{fill:t})),emoji:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(ee,{fill:t})),square:{check:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(Z,{fill:t})),emoji:X.createElement(b,null,X.createElement(Q,{fill:n}),X.createElement(ee,{fill:t})),open:{check:X.createElement(b,null,X.createElement(Z,{fill:n})),emoji:X.createElement(b,null,X.createElement(ee,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}te.propTypes={iconSet:J.oneOf(["emoji","check",void 0]),shape:J.oneOf(["square",void 0]),category:J.oneOf(["feedback",void 0]),open:J.bool,fg:J.string,bg:J.string},te.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const ne=e,ie=t,re=({fill:e})=>ie.createElement("g",{transform:"translate(0, 0)"},ie.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),ie.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));re.propTypes={fill:ne.string.isRequired};const oe=({fill:e})=>ie.createElement("g",{transform:"translate(2, 0)"},ie.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),ie.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),ie.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));oe.propTypes={fill:ne.string.isRequired};const se=S(re,oe);se.propTypes={iconSet:ne.oneOf(["emoji","check"]),shape:ne.oneOf(["round","square"]),category:ne.oneOf(["feedback",void 0]),open:ne.bool,fg:ne.string,bg:ne.string,size:ne.oneOfType([ne.string,ne.number])},se.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const le=e,ae=t,ce=({fill:e})=>ae.createElement("g",null,ae.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ae.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));ce.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ae.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});pe.propTypes={fill:le.string.isRequired};const de=({fill:e="#FFFFFF"})=>ae.createElement("g",null,ae.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),ae.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));de.propTypes={fill:le.string};const ue=({children:e,size:t})=>{const n=f(t),i={height:n,width:n,display:"inline-block",position:"relative"};return ae.createElement("div",{style:i},ae.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};ue.propTypes={children:le.oneOfType([le.arrayOf(le.node),le.node]).isRequired,size:le.oneOfType([le.string,le.number])};class he extends ae.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,o=ae.createElement(ce,{fill:n}),s={check:ae.createElement(ue,{size:this.props.size},ae.createElement(de,null),o,ae.createElement(pe,{fill:r})),emoji:ae.createElement(ue,{size:this.props.size},ae.createElement(de,null),o,ae.createElement(pe,{fill:r})),open:{check:ae.createElement(ue,{size:this.props.size},ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ae.createElement(ce,{fill:i}),ae.createElement(pe,{fill:"#FFFFFF"})),emoji:ae.createElement(ue,{size:this.props.size},ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ae.createElement(ce,{fill:i}),ae.createElement(pe,{fill:r}))}};return!0===t?s.open[e]:s[e]}}function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},me.apply(null,arguments)}function fe(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Ee(e,t){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ee(e,t)}function ge(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ee(e,t)}function ye(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}he.propTypes={iconSet:le.oneOf(["emoji","check"]),open:le.bool,fg:le.string,bg:le.string,border:le.string,size:le.oneOfType([le.string,le.number])},he.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var be=!1;var xe=t.createContext(null),ve=function(e){return e.scrollTop};const Ce=t,ke=i;var _e="unmounted",Re="exited",Se="entering",Oe="entered",Te="exiting",Ae=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=Re,i.appearStatus=Se):r=Oe:r=t.unmountOnExit||t.mountOnEnter?_e:Re,i.state={status:r},i.nextCallback=null,i}ge(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===_e?{status:Re}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Se&&n!==Oe&&(t=Se):n!==Se&&n!==Oe||(t=Te)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Se){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:ke.findDOMNode(this);n&&ve(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Re&&this.setState({status:_e})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[ke.findDOMNode(this),i],o=r[0],s=r[1],l=this.getTimeouts(),a=i?l.appear:l.enter;!e&&!n||be?this.safeSetState({status:Oe},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Se},function(){t.props.onEntering(o,s),t.onTransitionEnd(a,function(){t.safeSetState({status:Oe},function(){t.props.onEntered(o,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:ke.findDOMNode(this);t&&!be?(this.props.onExit(i),this.safeSetState({status:Te},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Re},function(){e.props.onExited(i)})})})):this.safeSetState({status:Re},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:ke.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=r[0],s=r[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===_e)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=fe(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ce.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,i):Ce.cloneElement(Ce.Children.only(n),i))},t}(Ce.Component);function Ne(){}Ae.contextType=xe,Ae.propTypes={},Ae.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ne,onEntering:Ne,onEntered:Ne,onExit:Ne,onExiting:Ne,onExited:Ne},Ae.UNMOUNTED=_e,Ae.EXITED=Re,Ae.ENTERING=Se,Ae.ENTERED=Oe,Ae.EXITING=Te;var De=Ae;const Me=t;var Be=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},Fe=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=ye(n.className,i):n.setAttribute("class",ye(n.className&&n.className.baseVal||"",i)));var n,i})},we=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.addClass(r,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}ge(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&ve(e),i&&(this.appliedClasses[t][n]=i,Be(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&Fe(e,i),r&&Fe(e,r),o&&Fe(e,o)},n.render=function(){var e=this.props;e.classNames;var t=fe(e,["classNames"]);return Me.createElement(De,me({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Me.Component);we.defaultProps={classNames:""},we.propTypes={};var Le=we;const{Children:ze}=t,{cloneElement:Ie}=t,{isValidElement:Pe}=t;function je(e,t){var n=Object.create(null);return e&&ze.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&Pe(e)?t(e):e}(e)}),n}function qe(e,t,n){return null!=n[t]?n[t]:e.props[t]}function Ue(e,t,n){var i=je(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var l={};for(var a in t){if(r[a])for(i=0;i<r[a].length;i++){var c=r[a][i];l[r[a][i]]=n(c)}l[a]=n(a)}for(i=0;i<o.length;i++)l[o[i]]=n(o[i]);return l}(t,i);return Object.keys(r).forEach(function(o){var s=r[o];if(Pe(s)){var l=o in t,a=o in i,c=t[o],p=Pe(c)&&!c.props.in;!a||l&&!p?a||!l||p?a&&l&&Pe(c)&&(r[o]=Ie(s,{onExited:n.bind(null,s),in:c.props.in,exit:qe(s,"exit",e),enter:qe(s,"enter",e)})):r[o]=Ie(s,{in:!1}):r[o]=Ie(s,{onExited:n.bind(null,s),in:!0,exit:qe(s,"exit",e),enter:qe(s,"enter",e)})}}),r}const Ye=t;var He=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},$e=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}ge(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,i=o,je(n.children,function(e){return Ie(e,{onExited:i.bind(null,e),in:!0,appear:qe(e,"appear",n),enter:qe(e,"enter",n),exit:qe(e,"exit",n)})})):Ue(e,r,o),firstRender:!1}},n.handleExited=function(e,t){var n=je(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=me({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=fe(e,["component","childFactory"]),r=this.state.contextValue,o=He(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?Ye.createElement(xe.Provider,{value:r},o):Ye.createElement(xe.Provider,{value:r},Ye.createElement(t,i,o))},t}(Ye.Component);$e.propTypes={},$e.defaultProps={component:"div",childFactory:function(e){return e}};var We=$e;const Ke={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:a[500],CORRECT_SECONDARY:a[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:c[500],INCORRECT_SECONDARY:p[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:p[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:d[500],PRIMARY_LIGHT:d[200],PRIMARY_DARK:d[800],SECONDARY:u.A400,SECONDARY_LIGHT:u[200],SECONDARY_DARK:u[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Ke);const Ge=(Ve="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${Ve}-${t}, ${e})`,t)});var Ve;const Je=()=>Ge("text",Ke.TEXT),Xe=t,Ze=e,{styled:Qe}=n,et=Qe("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),tt=Qe("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${Ge("disabled",Ke.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${Ge("correct",Ke.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${Ge("incorrect",Ke.INCORRECT)})`}}),nt=Qe("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class it extends Xe.Component{constructor(...e){super(...e),it.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:Ze.string,feedback:Ze.string}}__init(){this.nodeRef=Xe.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?Xe.createElement(Le,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},Xe.createElement(nt,{ref:this.nodeRef},Xe.createElement(et,null,Xe.createElement(tt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return Xe.createElement("div",null,Xe.createElement(We,null,this.renderFeedback()))}}it.__initStatic();const rt=t,ot=e,{Popover:st}=r,{styled:lt}=n,at=o("pie-libs:render-ui:response-indicators"),ct=lt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),pt=lt(st)({cursor:"pointer"}),dt=lt("div")({padding:"0",borderRadius:"4px"}),ut=(e,t)=>{class n extends rt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{at("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return rt.createElement(ct,{hasFeedback:!!n},rt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},rt.createElement(e,null)),n&&rt.createElement(pt,{PaperComponent:dt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},rt.createElement(it,{feedback:n,correctness:t})))}}return n.propTypes={feedback:ot.string},n};ut(D,"correct"),ut(I,"incorrect"),ut(se,"partially-correct"),ut(te,"nothing-submitted");const ht=t,{styled:mt}=n,ft=s,Et=e,{renderMath:gt}=l,yt=mt("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),bt=mt(ft)(({theme:e})=>({paddingTop:e.spacing(2)}));class xt extends ht.Component{constructor(...e){super(...e),xt.prototype.__init.call(this),xt.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:Et.string,children:Et.object,labels:Et.shape({visible:Et.string,hidden:Et.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){gt(this.root)}componentDidUpdate(){gt(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return ht.createElement("div",{className:n,ref:e=>this.root=e},ht.createElement("div",{onClick:this.toggleExpanded},ht.createElement(yt,null,i)),ht.createElement(bt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}xt.__initStatic(),xt.__initStatic2();const{Button:vt}=r,{styled:Ct}=n;Ct("div")({display:"flex",flexDirection:"column"}),Ct("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Ct("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Ct(vt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const kt=t,{createTheme:_t}=n,{styled:Rt}=n,{StyledEngineProvider:St}=n,{ThemeProvider:Ot}=n,Tt=e;const At=_t({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),Nt=Rt("div")({"& table, th, td":{fontSize:"inherit"}});class Dt extends kt.Component{static __initStatic(){this.propTypes={className:Tt.string,children:Tt.array,extraCSSRules:Tt.shape({names:Tt.arrayOf(Tt.string),rules:Tt.string}),fontSizeFactor:Tt.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),o=null!=e&&"number"==typeof e?e:1;return 1!==o?{fontSize:r*o+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...o}=i,s=this.computeStyle(n);return kt.createElement(St,{injectFirst:!0},kt.createElement(Ot,{theme:At},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],o=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=o(n)):"call"!==r&&"optionalCall"!==r||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?kt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,kt.createElement(Nt,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}Dt.__initStatic(),Dt.__initStatic2();const Mt=t,{styled:Bt}=n,Ft=e,wt=Bt(Dt)({display:"flex",flexDirection:"column",position:"relative"});class Lt extends Mt.Component{static __initStatic(){this.propTypes={ariaLabel:Ft.string,children:Ft.oneOfType([Ft.arrayOf(Ft.node),Ft.node]).isRequired,role:Ft.string,extraCSSRules:Ft.shape({names:Ft.arrayOf(Ft.string),rules:Ft.string}),fontSizeFactor:Ft.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:o}=this.props,s=t?{"aria-label":t,role:n}:{};return Mt.createElement(wt,{...s,extraCSSRules:i,fontSizeFactor:r,classes:o},e)}}Lt.__initStatic();const zt=t,It=e;class Pt extends zt.Component{static __initStatic(){this.propTypes={tag:It.string,className:It.string,html:It.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return zt.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Pt.__initStatic(),Pt.__initStatic2();const{InputLabel:jt}=r,{FormControl:qt}=r,Ut=e,{styled:Yt}=n;Yt(qt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Yt(jt)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Ut.oneOfType([Ut.string,Ut.object]).isRequired,Ut.string,Ut.oneOfType([Ut.arrayOf(Ut.node),Ut.node]).isRequired;const Ht=t,{Component:$t}=t,{styled:Wt}=n,Kt=e,{renderMath:Gt}=l,Vt=Wt("div")(({theme:e,tagName:t})=>({"&:not(.MathJax) > table":{borderCollapse:"collapse"},"&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Je()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Je()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),Jt=/\\embed\{newLine\}\[\]/g;class Xt extends $t{constructor(...e){super(...e),Xt.prototype.__init.call(this)}static __initStatic(){this.propTypes={prompt:Kt.string,tagName:Kt.string,className:Kt.string,onClick:Kt.func,defaultClassName:Kt.string,autoplayAudioEnabled:Kt.bool,customAudioButton:{playImage:Kt.string,pauseImage:Kt.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",o)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},l=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",s),i.addEventListener("pause",l),i.addEventListener("ended",o),this._handlePlayClick=r,this._handleAudioPlay=s,this._handleAudioPause=l,this._handleAudioEnded=o}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=document.getElementById("preview-prompt");e&&"function"==typeof Gt&&Gt(e)}alignImages(){document.querySelectorAll("#preview-prompt").forEach(e=>{const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}})}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,o=`${n||""} ${r||""} ${"legend"===t?"legend":""}`.trim();return Ht.createElement(Vt,{as:t||"div",id:"preview-prompt",onClick:i,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(Jt,"\\newline ")}})}}Xt.__initStatic(),Xt.__initStatic2();const Zt=e;Zt.node,Zt.bool;const Qt=e;Qt.node,Qt.string,"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const en=t,{styled:tn}=n,{ListItem:nn}=r,{List:rn}=r,on=s,sn=e,ln=tn(Dt)({color:Je(),backgroundColor:Ge("background",Ke.BACKGROUND),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}}),an=tn(nn)({display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"}),cn=tn("div")({color:Je()}),pn=tn("h3")({color:Je(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"}),dn=tn("h4")({color:Je(),fontSize:"16px",fontWeight:"normal",margin:0,paddingBottom:"6px"}),un=tn("h2")(({theme:e})=>({display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:Ge("tertiary",Ke.TERTIARY),margin:0})),hn=tn("span")({display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"}),mn=tn("h2")({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}),fn=sn.shape({excludeZero:sn.bool,points:sn.arrayOf(sn.string),sampleAnswers:sn.arrayOf(sn.string),animationsDisabled:sn.bool});class En extends en.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),En.prototype.__init.call(this),En.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={model:sn.object.isRequired,animationsDisabled:sn.bool,value:fn}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:i}=e||{},{points:r,sampleAnswers:o}=t,s=en.createElement(rn,{component:"nav"},r.slice(0).reverse().map((e,n)=>{n=r.length-n-1;const i=t.excludeZero?n+1:n;return en.createElement(en.Fragment,{key:n},en.createElement(an,{key:`P${n}`},en.createElement(pn,null,1===i?`${i} PT`:`${i} PTS`),en.createElement(cn,{dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&en.createElement(an,{key:`S${n}`},en.createElement(dn,null,"Sample Answer"),en.createElement(cn,{dangerouslySetInnerHTML:{__html:o[n]}})))}));return en.createElement(ln,{extraCSSRules:i},en.createElement(mn,null,"Rubric"),n?s:en.createElement(en.Fragment,null,en.createElement(un,{id:"rubric-toggle",tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",en.createElement(hn,{"aria-hidden":"true"},this.state.rubricOpen?en.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},en.createElement("polyline",{points:"18 15 12 9 6 15"})):en.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},en.createElement("polyline",{points:"6 9 12 15 18 9"})))),en.createElement(on,{in:this.state.rubricOpen,timeout:{enter:225,exit:195}},s)))}return null}}En.__initStatic();var gn,yn=i;gn=yn.createRoot,yn.hydrateRoot;const bn=t,xn=o,{renderMath:vn}=l;class Cn extends HTMLElement{constructor(){super(),xn.log("constructor called"),this.onModelChanged=this.onModelChanged.bind(this),this._root=null}set model(e){this._model=e,this._render()}onModelChanged(e){this._model=e,this._render()}connectedCallback(){this._render()}_render(){if(this._model){const e=bn.createElement(En,{value:this._model});this._root||(this._root=gn(this)),this._root.render(e),queueMicrotask(()=>{vn(this)})}}disconnectedCallback(){this._root&&this._root.unmount()}}export{Cn as default};
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/rubric@7.2.0-next.4</title>
5
+ <title>@pie-element/rubric@7.2.0-next.6</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
- "version": "7.2.0-next.4",
3
+ "version": "7.2.0-next.6",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/shared-module",
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/rubric@7.2.0-next.4</title>
5
+ <title>@pie-element/rubric@7.2.0-next.6</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1 +1 @@
1
- import{_dll_react_dom as e,_dll_react as t,_dll_mui__material_styles as n,_dll_mui__material as r,_dll_mui__material_collapse as i,_dll_pie_lib__render_ui as o,_dll_prop_types as l,_dll_debug as a}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as s}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";var c,u=e;c=u.createRoot,u.hydrateRoot;var p="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,h=p||d||Function("return this")(),m=h.Symbol,f=Object.prototype,g=f.hasOwnProperty,b=f.toString,v=m?m.toStringTag:void 0;var x=Object.prototype.toString;var y=m?m.toStringTag:void 0;function _(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=g.call(e,v),n=e[v];try{e[v]=void 0;var r=!0}catch(e){}var i=b.call(e);return r&&(t?e[v]=n:delete e[v]),i}(e):function(e){return x.call(e)}(e)}var S=/\s/;var k=/^\s+/;function E(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&S.test(e.charAt(t)););return t}(e)+1).replace(k,""):e}function j(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var O=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,T=/^0o[0-7]+$/i,R=parseInt;function L(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==_(e)}(e))return NaN;if(j(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=j(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=E(e);var n=w.test(e);return n||T.test(e)?R(e.slice(2),n?2:8):O.test(e)?NaN:+e}var C=function(){return h.Date.now()},M=Math.max,P=Math.min;function D(e,t,n){var r,i,o,l,a,s,c=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,o=i;return r=i=void 0,c=t,l=e.apply(o,n)}function m(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=o}function f(){var e=C();if(m(e))return g(e);a=setTimeout(f,function(e){var n=t-(e-s);return p?P(n,o-(e-c)):n}(e))}function g(e){return a=void 0,d&&r?h(e):(r=i=void 0,l)}function b(){var e=C(),n=m(e);if(r=arguments,i=this,s=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),u?h(e):l}(s);if(p)return clearTimeout(a),a=setTimeout(f,t),h(s)}return void 0===a&&(a=setTimeout(f,t)),l}return t=L(t)||0,j(n)&&(u=!!n.leading,o=(p="maxWait"in n)?M(L(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=s=i=a=void 0},b.flush=function(){return void 0===a?l:g(C())},b}const I=t,{styled:W}=n,{ListItem:$}=r,{List:A}=r,B=i,{color:H}=o,{UiLayout:N}=o,z=l,F=W(N)({color:H.text(),backgroundColor:H.background(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}}),J=W($)({display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"}),U=W("div")({color:H.text()}),Z=W("h3")({color:H.text(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"}),q=W("h4")({color:H.text(),fontSize:"16px",fontWeight:"normal",margin:0,paddingBottom:"6px"}),K=W("h2")(({theme:e})=>({display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:H.tertiary(),margin:0})),G=W("span")({display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"}),Q=W("h2")({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}),V=z.shape({excludeZero:z.bool,points:z.arrayOf(z.string),sampleAnswers:z.arrayOf(z.string),animationsDisabled:z.bool});class X extends I.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={model:z.object.isRequired,animationsDisabled:z.bool,value:V}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:r}=e||{},{points:i,sampleAnswers:o}=t,l=I.createElement(A,{component:"nav"},i.slice(0).reverse().map((e,n)=>{n=i.length-n-1;const r=t.excludeZero?n+1:n;return I.createElement(I.Fragment,{key:n},I.createElement(J,{key:`P${n}`},I.createElement(Z,null,1===r?`${r} PT`:`${r} PTS`),I.createElement(U,{dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&I.createElement(J,{key:`S${n}`},I.createElement(q,null,"Sample Answer"),I.createElement(U,{dangerouslySetInnerHTML:{__html:o[n]}})))}));return I.createElement(F,{extraCSSRules:r},I.createElement(Q,null,"Rubric"),n?l:I.createElement(I.Fragment,null,I.createElement(K,{id:"rubric-toggle",tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",I.createElement(G,{"aria-hidden":"true"},this.state.rubricOpen?I.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("polyline",{points:"18 15 12 9 6 15"})):I.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("polyline",{points:"6 9 12 15 18 9"})))),I.createElement(B,{in:this.state.rubricOpen,timeout:{enter:225,exit:195}},l)))}return null}}X.__initStatic();const Y=t,ee=a,{renderMath:te}=s,ne=ee("pie-element:rubric:print");class re extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=D(()=>{if(this._model&&this._session){const t=(e=this._model,"instructor"===this._options.role?(e.value={...e},e.mode="evaluate",e.animationsDisabled=!0,e):{}),n=this._options&&Y.createElement(X,{...t});this._root||(this._root=c(this)),this._root.render(n),queueMicrotask(()=>{ne("render complete - render math"),te(this)})}else ne("skip");var e},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{re as default};
1
+ import{_dll_react_dom as e,_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as i,_dll_mui__material as r,_dll_debug as o,_dll_mui__material_collapse as s}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as l}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{green as a,orange as c,red as p,indigo as d,pink as u}from"@mui/material/colors";var h,m=e;h=m.createRoot,m.hydrateRoot;var f="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,E=f||g||Function("return this")(),y=E.Symbol,b=Object.prototype,v=b.hasOwnProperty,x=b.toString,C=y?y.toStringTag:void 0;var k=Object.prototype.toString;var _=y?y.toStringTag:void 0;function R(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=v.call(e,C),n=e[C];try{e[C]=void 0;var i=!0}catch(e){}var r=x.call(e);return i&&(t?e[C]=n:delete e[C]),r}(e):function(e){return k.call(e)}(e)}var S=/\s/;var O=/^\s+/;function T(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&S.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=/^[-+]0x[0-9a-f]+$/i,D=/^0b[01]+$/i,M=/^0o[0-7]+$/i,B=parseInt;function F(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==R(e)}(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=T(e);var n=D.test(e);return n||M.test(e)?B(e.slice(2),n?2:8):N.test(e)?NaN:+e}var w=function(){return E.Date.now()},L=Math.max,z=Math.min;function I(e,t,n){var i,r,o,s,l,a,c=0,p=!1,d=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function m(e){var n=e-a;return void 0===a||n>=t||n<0||d&&e-c>=o}function f(){var e=w();if(m(e))return g(e);l=setTimeout(f,function(e){var n=t-(e-a);return d?z(n,o-(e-c)):n}(e))}function g(e){return l=void 0,u&&i?h(e):(i=r=void 0,s)}function E(){var e=w(),n=m(e);if(i=arguments,r=this,a=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(f,t),p?h(e):s}(a);if(d)return clearTimeout(l),l=setTimeout(f,t),h(a)}return void 0===l&&(l=setTimeout(f,t)),s}return t=F(t)||0,A(n)&&(p=!!n.leading,o=(d="maxWait"in n)?L(F(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),E.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=a=r=l=void 0},E.flush=function(){return void 0===l?s:g(w())},E}const P=n,j=t,q=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",U=({size:e,children:t})=>{const n={height:e=q(e),width:e,display:"inline-block",position:"relative"};return P.createElement("div",{style:n},t)};U.propTypes={size:j.number,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired};const Y=n,$=t,H=({size:e,children:t,sx:n})=>Y.createElement(U,{size:e},Y.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));H.propTypes={size:$.oneOfType([$.string,$.number]),children:$.oneOfType([$.arrayOf($.node),$.node]).isRequired,sx:$.object},$.string.isRequired;const W=({fill:e})=>Y.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});W.propTypes={fill:$.string.isRequired};const K=({fill:e})=>Y.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});K.propTypes={fill:$.string.isRequired};const G=({fill:e})=>Y.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});G.propTypes={fill:$.string.isRequired};const V=({fill:e})=>Y.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});V.propTypes={fill:$.string.isRequired};const J=t,X=n;var Z=(e,t)=>{class n extends X.Component{static __initStatic(){this.propTypes={iconSet:J.oneOf(["emoji","check"]),shape:J.oneOf(["round","square"]),category:J.oneOf(["feedback",void 0]),open:J.bool,size:J.oneOfType([J.number,J.string]),fg:J.string,bg:J.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:o,size:s,fg:l,bg:a}=this.props,c="check"===n?X.createElement(e,{fill:l}):X.createElement(t,{fill:l}),p="check"===n?X.createElement(e,{fill:a}):X.createElement(t,{fill:a});return o?X.createElement(H,{size:s},p):X.createElement(H,{size:s},"feedback"===r?"round"===i?X.createElement(K,{fill:a}):X.createElement(W,{fill:a}):"round"===i?X.createElement(G,{fill:a}):X.createElement(V,{fill:a}),c)}}return n.__initStatic(),n.__initStatic2(),n};const Q=t,ee=n,te=({fill:e})=>ee.createElement("g",{transform:"translate(1, 0)"},ee.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),ee.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),ee.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));te.propTypes={fill:Q.string.isRequired};const ne=({fill:e,x:t=0,y:n=0})=>ee.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});ne.propTypes={fill:Q.string.isRequired,x:Q.number,y:Q.number};const ie=Z(ne,te);ie.propTypes={iconSet:Q.oneOf(["emoji","check"]),shape:Q.oneOf(["round","square"]),category:Q.oneOf(["feedback",void 0]),open:Q.bool,fg:Q.string,bg:Q.string,size:Q.oneOfType([Q.string,Q.number])},ie.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const re=t,{styled:oe}=i;re.string.isRequired,re.string.isRequired,re.string.isRequired,re.string.isRequired,re.string.isRequired,oe("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),re.bool,re.string;const se=t,le=n,ae=({fill:e})=>le.createElement("g",{transform:"translate(0.5, 0.5)"},le.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),le.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));ae.propTypes={fill:se.string.isRequired};const ce=({fill:e})=>le.createElement("g",{transform:"translate(1,0)"},le.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),le.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),le.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));ce.propTypes={fill:se.string.isRequired};const pe=Z(ae,ce);pe.propTypes={iconSet:se.oneOf(["emoji","check"]),shape:se.oneOf(["round","square"]),category:se.oneOf(["feedback",void 0]),open:se.bool,fg:se.string,bg:se.string,size:se.oneOfType([se.string,se.number])},pe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const de=t,ue=n,he=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return ue.createElement("g",null,ue.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),ue.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),ue.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},me=({children:e,size:t})=>ue.createElement(U,{size:t},ue.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));me.propTypes={children:de.oneOfType([de.arrayOf(de.node),de.node]).isRequired,size:de.number};const fe=()=>ue.createElement("g",null,ue.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ue.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ue.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),ge=()=>ue.createElement("g",null,ue.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ue.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ue.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class Ee extends ue.Component{constructor(e){super(e)}render(){return!0===this.props.open?ue.createElement(me,null,ue.createElement(fe,null),ue.createElement(he,null)):ue.createElement(me,null,ue.createElement(ge,null),ue.createElement(he,null))}}Ee.propTypes={open:de.bool},Ee.defaultProps={open:!1};const ye=t,be=n,ve=({fill:e})=>be.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});ve.propTypes={fill:ye.string};class xe extends be.Component{static __initStatic(){this.propTypes={classes:ye.object.isRequired,size:ye.number}}render(){const{size:e}=this.props;return!0===this.props.open?be.createElement(U,{size:e},be.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},be.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),be.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),be.createElement(ve,{fill:"#1A9CFF"}))):be.createElement(U,{size:e},be.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},be.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),be.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),be.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",be.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),be.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),be.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),be.createElement(ve,{fill:"1A9CFF"})))}}xe.__initStatic(),xe.propTypes={open:ye.bool},xe.defaultProps={open:!1};const Ce=t,ke=n,_e=({fill:e})=>ke.createElement("g",null,ke.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),ke.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));_e.propTypes={fill:Ce.string.isRequired};const Re=({fill:e})=>ke.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});Re.propTypes={fill:Ce.string.isRequired};const Se=({fill:e})=>ke.createElement("g",null,ke.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),ke.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),ke.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));Se.propTypes={fill:Ce.string.isRequired};class Oe extends ke.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(_e,{fill:t})),emoji:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(Se,{fill:t})),feedback:{check:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(Se,{fill:t})),emoji:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(Se,{fill:t})),square:{check:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(_e,{fill:t})),emoji:ke.createElement(H,null,ke.createElement(Re,{fill:n}),ke.createElement(Se,{fill:t})),open:{check:ke.createElement(H,null,ke.createElement(_e,{fill:n})),emoji:ke.createElement(H,null,ke.createElement(Se,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Oe.propTypes={iconSet:Ce.oneOf(["emoji","check",void 0]),shape:Ce.oneOf(["square",void 0]),category:Ce.oneOf(["feedback",void 0]),open:Ce.bool,fg:Ce.string,bg:Ce.string},Oe.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const Te=t,Ae=n,Ne=({fill:e})=>Ae.createElement("g",{transform:"translate(0, 0)"},Ae.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Ae.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));Ne.propTypes={fill:Te.string.isRequired};const De=({fill:e})=>Ae.createElement("g",{transform:"translate(2, 0)"},Ae.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Ae.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Ae.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));De.propTypes={fill:Te.string.isRequired};const Me=Z(Ne,De);Me.propTypes={iconSet:Te.oneOf(["emoji","check"]),shape:Te.oneOf(["round","square"]),category:Te.oneOf(["feedback",void 0]),open:Te.bool,fg:Te.string,bg:Te.string,size:Te.oneOfType([Te.string,Te.number])},Me.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Be=t,Fe=n,we=({fill:e})=>Fe.createElement("g",null,Fe.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),Fe.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));we.propTypes={fill:Be.string.isRequired};const Le=({fill:e})=>Fe.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});Le.propTypes={fill:Be.string.isRequired};const ze=({fill:e="#FFFFFF"})=>Fe.createElement("g",null,Fe.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),Fe.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),Fe.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));ze.propTypes={fill:Be.string};const Ie=({children:e,size:t})=>{const n=q(t),i={height:n,width:n,display:"inline-block",position:"relative"};return Fe.createElement("div",{style:i},Fe.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};Ie.propTypes={children:Be.oneOfType([Be.arrayOf(Be.node),Be.node]).isRequired,size:Be.oneOfType([Be.string,Be.number])};class Pe extends Fe.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,o=Fe.createElement(we,{fill:n}),s={check:Fe.createElement(Ie,{size:this.props.size},Fe.createElement(ze,null),o,Fe.createElement(Le,{fill:r})),emoji:Fe.createElement(Ie,{size:this.props.size},Fe.createElement(ze,null),o,Fe.createElement(Le,{fill:r})),open:{check:Fe.createElement(Ie,{size:this.props.size},Fe.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Fe.createElement(we,{fill:i}),Fe.createElement(Le,{fill:"#FFFFFF"})),emoji:Fe.createElement(Ie,{size:this.props.size},Fe.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Fe.createElement(we,{fill:i}),Fe.createElement(Le,{fill:r}))}};return!0===t?s.open[e]:s[e]}}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},je.apply(null,arguments)}function qe(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Ue(e,t){return Ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ue(e,t)}function Ye(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ue(e,t)}function $e(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}Pe.propTypes={iconSet:Be.oneOf(["emoji","check"]),open:Be.bool,fg:Be.string,bg:Be.string,border:Be.string,size:Be.oneOfType([Be.string,Be.number])},Pe.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var He=!1;var We=n.createContext(null),Ke=function(e){return e.scrollTop};const Ge=n,Ve=e;var Je="unmounted",Xe="exited",Ze="entering",Qe="entered",et="exiting",tt=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=Xe,i.appearStatus=Ze):r=Qe:r=t.unmountOnExit||t.mountOnEnter?Je:Xe,i.state={status:r},i.nextCallback=null,i}Ye(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Je?{status:Xe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Ze&&n!==Qe&&(t=Ze):n!==Ze&&n!==Qe||(t=et)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Ze){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Ve.findDOMNode(this);n&&Ke(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Xe&&this.setState({status:Je})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Ve.findDOMNode(this),i],o=r[0],s=r[1],l=this.getTimeouts(),a=i?l.appear:l.enter;!e&&!n||He?this.safeSetState({status:Qe},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Ze},function(){t.props.onEntering(o,s),t.onTransitionEnd(a,function(){t.safeSetState({status:Qe},function(){t.props.onEntered(o,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Ve.findDOMNode(this);t&&!He?(this.props.onExit(i),this.safeSetState({status:et},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Xe},function(){e.props.onExited(i)})})})):this.safeSetState({status:Xe},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Ve.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=r[0],s=r[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Je)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=qe(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ge.createElement(We.Provider,{value:null},"function"==typeof n?n(e,i):Ge.cloneElement(Ge.Children.only(n),i))},t}(Ge.Component);function nt(){}tt.contextType=We,tt.propTypes={},tt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:nt,onEntering:nt,onEntered:nt,onExit:nt,onExiting:nt,onExited:nt},tt.UNMOUNTED=Je,tt.EXITED=Xe,tt.ENTERING=Ze,tt.ENTERED=Qe,tt.EXITING=et;var it=tt;const rt=n;var ot=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},st=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=$e(n.className,i):n.setAttribute("class",$e(n.className&&n.className.baseVal||"",i)));var n,i})},lt=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.addClass(r,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}Ye(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&Ke(e),i&&(this.appliedClasses[t][n]=i,ot(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&st(e,i),r&&st(e,r),o&&st(e,o)},n.render=function(){var e=this.props;e.classNames;var t=qe(e,["classNames"]);return rt.createElement(it,je({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(rt.Component);lt.defaultProps={classNames:""},lt.propTypes={};var at=lt;const{Children:ct}=n,{cloneElement:pt}=n,{isValidElement:dt}=n;function ut(e,t){var n=Object.create(null);return e&&ct.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&dt(e)?t(e):e}(e)}),n}function ht(e,t,n){return null!=n[t]?n[t]:e.props[t]}function mt(e,t,n){var i=ut(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var l={};for(var a in t){if(r[a])for(i=0;i<r[a].length;i++){var c=r[a][i];l[r[a][i]]=n(c)}l[a]=n(a)}for(i=0;i<o.length;i++)l[o[i]]=n(o[i]);return l}(t,i);return Object.keys(r).forEach(function(o){var s=r[o];if(dt(s)){var l=o in t,a=o in i,c=t[o],p=dt(c)&&!c.props.in;!a||l&&!p?a||!l||p?a&&l&&dt(c)&&(r[o]=pt(s,{onExited:n.bind(null,s),in:c.props.in,exit:ht(s,"exit",e),enter:ht(s,"enter",e)})):r[o]=pt(s,{in:!1}):r[o]=pt(s,{onExited:n.bind(null,s),in:!0,exit:ht(s,"exit",e),enter:ht(s,"enter",e)})}}),r}const ft=n;var gt=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Et=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}Ye(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,i=o,ut(n.children,function(e){return pt(e,{onExited:i.bind(null,e),in:!0,appear:ht(e,"appear",n),enter:ht(e,"enter",n),exit:ht(e,"exit",n)})})):mt(e,r,o),firstRender:!1}},n.handleExited=function(e,t){var n=ut(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=je({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=qe(e,["component","childFactory"]),r=this.state.contextValue,o=gt(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?ft.createElement(We.Provider,{value:r},o):ft.createElement(We.Provider,{value:r},ft.createElement(t,i,o))},t}(ft.Component);Et.propTypes={},Et.defaultProps={component:"div",childFactory:function(e){return e}};var yt=Et;const bt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:a[500],CORRECT_SECONDARY:a[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:c[500],INCORRECT_SECONDARY:p[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:p[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:d[500],PRIMARY_LIGHT:d[200],PRIMARY_DARK:d[800],SECONDARY:u.A400,SECONDARY_LIGHT:u[200],SECONDARY_DARK:u[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(bt);const vt=(xt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${xt}-${t}, ${e})`,t)});var xt;const Ct=()=>vt("text",bt.TEXT),kt=n,_t=t,{styled:Rt}=i,St=Rt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Ot=Rt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${vt("disabled",bt.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${vt("correct",bt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${vt("incorrect",bt.INCORRECT)})`}}),Tt=Rt("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class At extends kt.Component{constructor(...e){super(...e),At.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:_t.string,feedback:_t.string}}__init(){this.nodeRef=kt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?kt.createElement(at,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},kt.createElement(Tt,{ref:this.nodeRef},kt.createElement(St,null,kt.createElement(Ot,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return kt.createElement("div",null,kt.createElement(yt,null,this.renderFeedback()))}}At.__initStatic();const Nt=n,Dt=t,{Popover:Mt}=r,{styled:Bt}=i,Ft=o("pie-libs:render-ui:response-indicators"),wt=Bt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),Lt=Bt(Mt)({cursor:"pointer"}),zt=Bt("div")({padding:"0",borderRadius:"4px"}),It=(e,t)=>{class n extends Nt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Ft("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return Nt.createElement(wt,{hasFeedback:!!n},Nt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},Nt.createElement(e,null)),n&&Nt.createElement(Lt,{PaperComponent:zt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},Nt.createElement(At,{feedback:n,correctness:t})))}}return n.propTypes={feedback:Dt.string},n};It(ie,"correct"),It(pe,"incorrect"),It(Me,"partially-correct"),It(Oe,"nothing-submitted");const Pt=n,{styled:jt}=i,qt=s,Ut=t,{renderMath:Yt}=l,$t=jt("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Ht=jt(qt)(({theme:e})=>({paddingTop:e.spacing(2)}));class Wt extends Pt.Component{constructor(...e){super(...e),Wt.prototype.__init.call(this),Wt.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:Ut.string,children:Ut.object,labels:Ut.shape({visible:Ut.string,hidden:Ut.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Yt(this.root)}componentDidUpdate(){Yt(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Pt.createElement("div",{className:n,ref:e=>this.root=e},Pt.createElement("div",{onClick:this.toggleExpanded},Pt.createElement($t,null,i)),Pt.createElement(Ht,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Wt.__initStatic(),Wt.__initStatic2();const{Button:Kt}=r,{styled:Gt}=i;Gt("div")({display:"flex",flexDirection:"column"}),Gt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Gt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Gt(Kt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Vt=n,{createTheme:Jt}=i,{styled:Xt}=i,{StyledEngineProvider:Zt}=i,{ThemeProvider:Qt}=i,en=t;const tn=Jt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),nn=Xt("div")({"& table, th, td":{fontSize:"inherit"}});class rn extends Vt.Component{static __initStatic(){this.propTypes={className:en.string,children:en.array,extraCSSRules:en.shape({names:en.arrayOf(en.string),rules:en.string}),fontSizeFactor:en.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),o=null!=e&&"number"==typeof e?e:1;return 1!==o?{fontSize:r*o+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...o}=i,s=this.computeStyle(n);return Vt.createElement(Zt,{injectFirst:!0},Vt.createElement(Qt,{theme:tn},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],o=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=o(n)):"call"!==r&&"optionalCall"!==r||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Vt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Vt.createElement(nn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}rn.__initStatic(),rn.__initStatic2();const on=n,{styled:sn}=i,ln=t,an=sn(rn)({display:"flex",flexDirection:"column",position:"relative"});class cn extends on.Component{static __initStatic(){this.propTypes={ariaLabel:ln.string,children:ln.oneOfType([ln.arrayOf(ln.node),ln.node]).isRequired,role:ln.string,extraCSSRules:ln.shape({names:ln.arrayOf(ln.string),rules:ln.string}),fontSizeFactor:ln.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:o}=this.props,s=t?{"aria-label":t,role:n}:{};return on.createElement(an,{...s,extraCSSRules:i,fontSizeFactor:r,classes:o},e)}}cn.__initStatic();const pn=n,dn=t;class un extends pn.Component{static __initStatic(){this.propTypes={tag:dn.string,className:dn.string,html:dn.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return pn.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}un.__initStatic(),un.__initStatic2();const{InputLabel:hn}=r,{FormControl:mn}=r,fn=t,{styled:gn}=i;gn(mn)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),gn(hn)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),fn.oneOfType([fn.string,fn.object]).isRequired,fn.string,fn.oneOfType([fn.arrayOf(fn.node),fn.node]).isRequired;const En=n,{Component:yn}=n,{styled:bn}=i,vn=t,{renderMath:xn}=l,Cn=bn("div")(({theme:e,tagName:t})=>({"&:not(.MathJax) > table":{borderCollapse:"collapse"},"&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Ct()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Ct()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),kn=/\\embed\{newLine\}\[\]/g;class _n extends yn{constructor(...e){super(...e),_n.prototype.__init.call(this)}static __initStatic(){this.propTypes={prompt:vn.string,tagName:vn.string,className:vn.string,onClick:vn.func,defaultClassName:vn.string,autoplayAudioEnabled:vn.bool,customAudioButton:{playImage:vn.string,pauseImage:vn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",o)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},l=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",s),i.addEventListener("pause",l),i.addEventListener("ended",o),this._handlePlayClick=r,this._handleAudioPlay=s,this._handleAudioPause=l,this._handleAudioEnded=o}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=document.getElementById("preview-prompt");e&&"function"==typeof xn&&xn(e)}alignImages(){document.querySelectorAll("#preview-prompt").forEach(e=>{const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}})}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,o=`${n||""} ${r||""} ${"legend"===t?"legend":""}`.trim();return En.createElement(Cn,{as:t||"div",id:"preview-prompt",onClick:i,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(kn,"\\newline ")}})}}_n.__initStatic(),_n.__initStatic2();const Rn=t;Rn.node,Rn.bool;const Sn=t;Sn.node,Sn.string,"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const On=n,{styled:Tn}=i,{ListItem:An}=r,{List:Nn}=r,Dn=s,Mn=t,Bn=Tn(rn)({color:Ct(),backgroundColor:vt("background",bt.BACKGROUND),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}}),Fn=Tn(An)({display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"}),wn=Tn("div")({color:Ct()}),Ln=Tn("h3")({color:Ct(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"}),zn=Tn("h4")({color:Ct(),fontSize:"16px",fontWeight:"normal",margin:0,paddingBottom:"6px"}),In=Tn("h2")(({theme:e})=>({display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:vt("tertiary",bt.TERTIARY),margin:0})),Pn=Tn("span")({display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"}),jn=Tn("h2")({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}),qn=Mn.shape({excludeZero:Mn.bool,points:Mn.arrayOf(Mn.string),sampleAnswers:Mn.arrayOf(Mn.string),animationsDisabled:Mn.bool});class Un extends On.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),Un.prototype.__init.call(this),Un.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={model:Mn.object.isRequired,animationsDisabled:Mn.bool,value:qn}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:i}=e||{},{points:r,sampleAnswers:o}=t,s=On.createElement(Nn,{component:"nav"},r.slice(0).reverse().map((e,n)=>{n=r.length-n-1;const i=t.excludeZero?n+1:n;return On.createElement(On.Fragment,{key:n},On.createElement(Fn,{key:`P${n}`},On.createElement(Ln,null,1===i?`${i} PT`:`${i} PTS`),On.createElement(wn,{dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&On.createElement(Fn,{key:`S${n}`},On.createElement(zn,null,"Sample Answer"),On.createElement(wn,{dangerouslySetInnerHTML:{__html:o[n]}})))}));return On.createElement(Bn,{extraCSSRules:i},On.createElement(jn,null,"Rubric"),n?s:On.createElement(On.Fragment,null,On.createElement(In,{id:"rubric-toggle",tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",On.createElement(Pn,{"aria-hidden":"true"},this.state.rubricOpen?On.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},On.createElement("polyline",{points:"18 15 12 9 6 15"})):On.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},On.createElement("polyline",{points:"6 9 12 15 18 9"})))),On.createElement(Dn,{in:this.state.rubricOpen,timeout:{enter:225,exit:195}},s)))}return null}}Un.__initStatic();const Yn=n,$n=o,{renderMath:Hn}=l,Wn=$n("pie-element:rubric:print");class Kn extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=I(()=>{if(this._model&&this._session){const t=(e=this._model,"instructor"===this._options.role?(e.value={...e},e.mode="evaluate",e.animationsDisabled=!0,e):{}),n=this._options&&Yn.createElement(Un,{...t});this._root||(this._root=h(this)),this._root.render(n),queueMicrotask(()=>{Wn("render complete - render math"),Hn(this)})}else Wn("skip");var e},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Kn as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "7.2.0-next.5",
4
+ "version": "7.2.0-next.7",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
7
7
  "exports": {
@@ -25,12 +25,12 @@
25
25
  "@mui/icons-material": "^7.3.4",
26
26
  "@mui/material": "^7.3.4",
27
27
  "@pie-lib/math-rendering": "4.2.0-next.3",
28
- "@pie-lib/render-ui": "5.2.0-next.7",
28
+ "@pie-lib/render-ui": "5.2.0-next.8",
29
29
  "prop-types": "^15.8.1"
30
30
  },
31
31
  "author": "pie framework developers",
32
32
  "license": "ISC",
33
- "gitHead": "e9c9eb021e31f961170c60e147b17fc6a9f56957",
33
+ "gitHead": "8c88ef381fb968e335518ffdc7f37790859ee415",
34
34
  "scripts": {
35
35
  "postpublish": "../../scripts/postpublish"
36
36
  }