@pie-element/passage 7.4.2 → 7.4.4

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,14 @@
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.4.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.3...@pie-element/passage@7.4.4) (2026-09-22)
7
+
8
+ **Note:** Version bump only for package @pie-element/passage
9
+
10
+ ## [7.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.2...@pie-element/passage@7.4.3) (2026-09-17)
11
+
12
+ **Note:** Version bump only for package @pie-element/passage
13
+
6
14
  ## [7.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.1...@pie-element/passage@7.4.2) (2026-09-04)
7
15
 
8
16
  ### Bug Fixes
@@ -3,6 +3,14 @@
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
+ ## [5.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.3...@pie-element/passage-configure@5.2.4) (2026-09-22)
7
+
8
+ **Note:** Version bump only for package @pie-element/passage-configure
9
+
10
+ ## [5.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.2...@pie-element/passage-configure@5.2.3) (2026-09-17)
11
+
12
+ **Note:** Version bump only for package @pie-element/passage-configure
13
+
6
14
  ## [5.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.1...@pie-element/passage-configure@5.2.2) (2026-09-04)
7
15
 
8
16
  ### Bug Fixes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-configure",
3
3
  "private": true,
4
- "version": "5.2.2",
4
+ "version": "5.2.4",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -13,8 +13,8 @@
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
15
  "@pie-framework/pie-configure-events": "^1.3.0",
16
- "@pie-lib/config-ui": "13.0.19",
17
- "@pie-lib/editable-html-tip-tap": "2.1.17",
16
+ "@pie-lib/config-ui": "13.0.21",
17
+ "@pie-lib/editable-html-tip-tap": "2.1.19",
18
18
  "lodash-es": "^4.17.23",
19
19
  "prop-types": "^15.8.1",
20
20
  "react": "18.3.1",
package/module/element.js CHANGED
@@ -1 +1 @@
1
- import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as i,_dll_react_dom as r,_dll_mui__material_colors as s,_dll_mui__material as o,_dll_debug as a,_dll_mui__material_collapse as l,_dll_react_dom_client as c}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var d={};Object.defineProperty(d,"__esModule",{value:!0});class p extends CustomEvent{constructor(e,t,n){super(p.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}p.TYPE="model-set";var h=d.ModelSetEvent=p;class u extends CustomEvent{constructor(e,t){super(u.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}u.TYPE="session-changed",d.SessionChangedEvent=u;const m=n,f=t,g=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",E=({size:e,children:t})=>{const n={height:e=g(e),width:e,display:"inline-block",position:"relative"};return m.createElement("div",{style:n},t)};E.propTypes={size:f.number,children:f.oneOfType([f.arrayOf(f.node),f.node]).isRequired};const b=n,y=t,v=({size:e,children:t,sx:n})=>b.createElement(E,{size:e},b.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));v.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})=>b.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 C=({fill:e})=>b.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});C.propTypes={fill:y.string.isRequired};const _=({fill:e})=>b.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});_.propTypes={fill:y.string.isRequired};const R=({fill:e})=>b.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});R.propTypes={fill:y.string.isRequired};const k=t,O=n;var T=(e,t)=>{class n extends O.Component{static __initStatic(){this.propTypes={iconSet:k.oneOf(["emoji","check"]),shape:k.oneOf(["round","square"]),category:k.oneOf(["feedback",void 0]),open:k.bool,size:k.oneOfType([k.number,k.string]),fg:k.string,bg:k.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:s,size:o,fg:a,bg:l}=this.props,c="check"===n?O.createElement(e,{fill:a}):O.createElement(t,{fill:a}),d="check"===n?O.createElement(e,{fill:l}):O.createElement(t,{fill:l});return s?O.createElement(v,{size:o},d):O.createElement(v,{size:o},"feedback"===r?"round"===i?O.createElement(C,{fill:l}):O.createElement(x,{fill:l}):"round"===i?O.createElement(_,{fill:l}):O.createElement(R,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const S=t,A=n,M=({fill:e})=>A.createElement("g",{transform:"translate(1, 0)"},A.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}),A.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),A.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));M.propTypes={fill:S.string.isRequired};const N=({fill:e,x:t=0,y:n=0})=>A.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:S.string.isRequired,x:S.number,y:S.number};const D=T(N,M);D.propTypes={iconSet:S.oneOf(["emoji","check"]),shape:S.oneOf(["round","square"]),category:S.oneOf(["feedback",void 0]),open:S.bool,fg:S.string,bg:S.string,size:S.oneOfType([S.string,S.number])},D.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const w=t,{styled:L}=i;w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,L("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),w.bool,w.string;const F=t,B=n,I=({fill:e})=>B.createElement("g",{transform:"translate(0.5, 0.5)"},B.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}),B.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}));I.propTypes={fill:F.string.isRequired};const z=({fill:e})=>B.createElement("g",{transform:"translate(1,0)"},B.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));z.propTypes={fill:F.string.isRequired};const P=T(I,z);P.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])},P.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const q=t,j=n,H=()=>{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"}))},W=({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));W.propTypes={children:q.oneOfType([q.arrayOf(q.node),q.node]).isRequired,size:q.number};const $=()=>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 "})),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:"#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 U extends j.Component{constructor(e){super(e)}render(){return!0===this.props.open?j.createElement(W,null,j.createElement($,null),j.createElement(H,null)):j.createElement(W,null,j.createElement(Y,null),j.createElement(H,null))}}U.propTypes={open:q.bool},U.defaultProps={open:!1};const G=t,K=n,J=({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"});J.propTypes={fill:G.string};class V extends K.Component{static __initStatic(){this.propTypes={classes:G.object.isRequired,size:G.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(J,{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(J,{fill:"1A9CFF"})))}}V.__initStatic(),V.propTypes={open:G.bool},V.defaultProps={open:!1};const X=t,Z=n,Q=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),Z.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Q.propTypes={fill:X.string.isRequired};const ee=({fill:e})=>Z.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});ee.propTypes={fill:X.string.isRequired};const te=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),Z.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}));te.propTypes={fill:X.string.isRequired};class ne extends Z.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),feedback:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),square:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),open:{check:Z.createElement(v,null,Z.createElement(Q,{fill:n})),emoji:Z.createElement(v,null,Z.createElement(te,{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]}}ne.propTypes={iconSet:X.oneOf(["emoji","check",void 0]),shape:X.oneOf(["square",void 0]),category:X.oneOf(["feedback",void 0]),open:X.bool,fg:X.string,bg:X.string},ne.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const ie=t,re=n,se=({fill:e})=>re.createElement("g",{transform:"translate(0, 0)"},re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));se.propTypes={fill:ie.string.isRequired};const oe=({fill:e})=>re.createElement("g",{transform:"translate(2, 0)"},re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),re.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:ie.string.isRequired};const ae=T(se,oe);ae.propTypes={iconSet:ie.oneOf(["emoji","check"]),shape:ie.oneOf(["round","square"]),category:ie.oneOf(["feedback",void 0]),open:ie.bool,fg:ie.string,bg:ie.string,size:ie.oneOfType([ie.string,ie.number])},ae.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const le=t,ce=n,de=({fill:e})=>ce.createElement("g",null,ce.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ce.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}));de.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ce.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 he=({fill:e="#FFFFFF"})=>ce.createElement("g",null,ce.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"}),ce.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"}),ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));he.propTypes={fill:le.string};const ue=({children:e,size:t})=>{const n=g(t),i={height:n,width:n,display:"inline-block",position:"relative"};return ce.createElement("div",{style:i},ce.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 me extends ce.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,s=ce.createElement(de,{fill:n}),o={check:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),open:{check:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:"#FFFFFF"})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:r}))}};return!0===t?o.open[e]:o[e]}}function fe(){return fe=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},fe.apply(null,arguments)}function ge(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 be(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,"")}me.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])},me.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var ve=!1;var xe=n.createContext(null),Ce=function(e){return e.scrollTop};const _e=n,Re=r;var ke="unmounted",Oe="exited",Te="entering",Se="entered",Ae="exiting",Me=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,s=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=Oe,i.appearStatus=Te):r=Se:r=t.unmountOnExit||t.mountOnEnter?ke:Oe,i.state={status:r},i.nextCallback=null,i}be(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:Oe}: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!==Te&&n!==Se&&(t=Te):n!==Te&&n!==Se||(t=Ae)}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===Te){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this);n&&Ce(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Oe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Re.findDOMNode(this),i],s=r[0],o=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||ve?this.safeSetState({status:Se},function(){t.props.onEntered(s)}):(this.props.onEnter(s,o),this.safeSetState({status:Te},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:Se},function(){t.props.onEntered(s,o)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Re.findDOMNode(this);t&&!ve?(this.props.onExit(i),this.safeSetState({status:Ae},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Oe},function(){e.props.onExited(i)})})})):this.safeSetState({status:Oe},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:Re.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],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)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=ge(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _e.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,i):_e.cloneElement(_e.Children.only(n),i))},t}(_e.Component);function Ne(){}Me.contextType=xe,Me.propTypes={},Me.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},Me.UNMOUNTED=ke,Me.EXITED=Oe,Me.ENTERING=Te,Me.ENTERED=Se,Me.EXITING=Ae;var De=Me;const we=n;var Le=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})},Be=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],s=i[1];t.removeClasses(r,"exit"),t.addClass(r,s?"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],s=i[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"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}be(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&&Ce(e),i&&(this.appliedClasses[t][n]=i,Le(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,s=n.done;this.appliedClasses[t]={},i&&Fe(e,i),r&&Fe(e,r),s&&Fe(e,s)},n.render=function(){var e=this.props;e.classNames;var t=ge(e,["classNames"]);return we.createElement(De,fe({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(we.Component);Be.defaultProps={classNames:""},Be.propTypes={};var Ie=Be;const{Children:ze}=n,{cloneElement:Pe}=n,{isValidElement:qe}=n;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&&qe(e)?t(e):e}(e)}),n}function He(e,t,n){return null!=n[t]?n[t]:e.props[t]}function We(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),s=[];for(var o in e)o in t?s.length&&(r[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<s.length;i++)a[s[i]]=n(s[i]);return a}(t,i);return Object.keys(r).forEach(function(s){var o=r[s];if(qe(o)){var a=s in t,l=s in i,c=t[s],d=qe(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&qe(c)&&(r[s]=Pe(o,{onExited:n.bind(null,o),in:c.props.in,exit:He(o,"exit",e),enter:He(o,"enter",e)})):r[s]=Pe(o,{in:!1}):r[s]=Pe(o,{onExited:n.bind(null,o),in:!0,exit:He(o,"exit",e),enter:He(o,"enter",e)})}}),r}const $e=n;var Ye=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Ue=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}be(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,s=t.handleExited;return{children:t.firstRender?(n=e,i=s,je(n.children,function(e){return Pe(e,{onExited:i.bind(null,e),in:!0,appear:He(e,"appear",n),enter:He(e,"enter",n),exit:He(e,"exit",n)})})):We(e,r,s),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=fe({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=ge(e,["component","childFactory"]),r=this.state.contextValue,s=Ye(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?$e.createElement(xe.Provider,{value:r},s):$e.createElement(xe.Provider,{value:r},$e.createElement(t,i,s))},t}($e.Component);Ue.propTypes={},Ue.defaultProps={component:"div",childFactory:function(e){return e}};var Ge=Ue;const{green:Ke}=s,{indigo:Je}=s,{orange:Ve}=s,{pink:Xe}=s,{red:Ze}=s,Qe={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:Ke[500],CORRECT_SECONDARY:Ke[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:Ve[500],INCORRECT_SECONDARY:Ze[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:Ze[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:Je[500],PRIMARY_LIGHT:Je[200],PRIMARY_DARK:Je[800],SECONDARY:Xe.A400,SECONDARY_LIGHT:Xe[200],SECONDARY_DARK:Xe[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",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",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)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Qe);const et=(tt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${tt}-${t}, ${e})`,t)});var tt;const nt=()=>et("text",Qe.TEXT),it=()=>et("background",Qe.BACKGROUND),rt=()=>et("border-gray",Qe.BORDER_GRAY),st=()=>et("table-stripe","background-dark",Qe.TABLE_STRIPE),ot=n,at=t,{styled:lt}=i,ct=lt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),dt=lt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${et("disabled",Qe.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${et("correct",Qe.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${et("incorrect",Qe.INCORRECT)})`}}),pt=lt("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 ht extends ot.Component{constructor(...e){super(...e),ht.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:at.string,feedback:at.string}}__init(){this.nodeRef=ot.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?ot.createElement(Ie,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},ot.createElement(pt,{ref:this.nodeRef},ot.createElement(ct,null,ot.createElement(dt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return ot.createElement("div",null,ot.createElement(Ge,null,this.renderFeedback()))}}ht.__initStatic();const ut=n,mt=t,{Popover:ft}=o,{styled:gt}=i,Et=a("pie-libs:render-ui:response-indicators"),bt=gt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),yt=gt(ft)({cursor:"pointer"}),vt=gt("div")({padding:"0",borderRadius:"4px"}),xt=(e,t)=>{class n extends ut.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Et("[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 ut.createElement(bt,{hasFeedback:!!n},ut.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},ut.createElement(e,null)),n&&ut.createElement(yt,{PaperComponent:vt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},ut.createElement(ht,{feedback:n,correctness:t})))}}return n.propTypes={feedback:mt.string},n};xt(D,"correct"),xt(P,"incorrect"),xt(ae,"partially-correct"),xt(ne,"nothing-submitted");const Ct=n,{styled:_t}=i,Rt=l,kt=t,{renderMath:Ot}=e,Tt=_t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),St=_t(Rt)(({theme:e})=>({paddingTop:e.spacing(2)}));class At extends Ct.Component{constructor(...e){super(...e),At.prototype.__init.call(this),At.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:kt.string,children:kt.object,labels:kt.shape({visible:kt.string,hidden:kt.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ot(this.root)}componentDidUpdate(){Ot(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Ct.createElement("div",{className:n,ref:e=>this.root=e},Ct.createElement("div",{onClick:this.toggleExpanded},Ct.createElement(Tt,null,i)),Ct.createElement(St,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}At.__initStatic(),At.__initStatic2();const{Button:Mt}=o,{styled:Nt}=i;Nt("div")({display:"flex",flexDirection:"column"}),Nt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Nt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Nt(Mt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Dt=n,{createTheme:wt}=i,{styled:Lt}=i,{StyledEngineProvider:Ft}=i,{ThemeProvider:Bt}=i,It=t;const zt=wt({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"}}}}}}),Pt=Lt("div")({"& table, th, td":{fontSize:"inherit"}});class qt extends Dt.Component{static __initStatic(){this.propTypes={className:It.string,children:It.array,extraCSSRules:It.shape({names:It.arrayOf(It.string),rules:It.string}),fontSizeFactor:It.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),s=null!=e&&"number"==typeof e?e:1;return 1!==s?{fontSize:r*s+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...s}=i,o=this.computeStyle(n);return Dt.createElement(Ft,{injectFirst:!0},Dt.createElement(Bt,{theme:zt},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Dt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Dt.createElement(Pt,{className:`${t} extraCSSRules`,...s,...o&&{style:o}},e)))}}qt.__initStatic(),qt.__initStatic2();const jt=n,{styled:Ht}=i,Wt=t,$t=Ht(qt)({display:"flex",flexDirection:"column",position:"relative"});class Yt extends jt.Component{static __initStatic(){this.propTypes={ariaLabel:Wt.string,children:Wt.oneOfType([Wt.arrayOf(Wt.node),Wt.node]).isRequired,role:Wt.string,extraCSSRules:Wt.shape({names:Wt.arrayOf(Wt.string),rules:Wt.string}),fontSizeFactor:Wt.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:s}=this.props,o=t?{"aria-label":t,role:n}:{};return jt.createElement($t,{...o,extraCSSRules:i,fontSizeFactor:r,classes:s},e)}}Yt.__initStatic();const Ut=n,Gt=t;class Kt extends Ut.Component{static __initStatic(){this.propTypes={tag:Gt.string,className:Gt.string,html:Gt.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return Ut.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Kt.__initStatic(),Kt.__initStatic2();const{InputLabel:Jt}=o,{FormControl:Vt}=o,Xt=t,{styled:Zt}=i;Zt(Vt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Zt(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)"}})),Xt.oneOfType([Xt.string,Xt.object]).isRequired,Xt.string,Xt.oneOfType([Xt.arrayOf(Xt.node),Xt.node]).isRequired;const Qt=n,{Component:en}=n,{styled:tn}=i,nn=t,{renderMath:rn}=e,sn=tn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:et("table-grid","text",Qe.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:st()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:st()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:nt()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${nt()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),on=/\\embed\{newLine\}\[\]/g;class an extends en{constructor(...e){super(...e),an.prototype.__init.call(this),an.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:nn.string,tagName:nn.string,className:nn.string,onClick:nn.func,defaultClassName:nn.string,autoplayAudioEnabled:nn.bool,customAudioButton:{playImage:nn.string,pauseImage:nn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=Qt.createRef()}__init2(){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",s)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},s=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",o),i.addEventListener("pause",a),i.addEventListener("ended",s),this._handlePlayClick=r,this._handleAudioPlay=o,this._handleAudioPause=a,this._handleAudioEnded=s}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=this.promptRef.current;e&&"function"==typeof rn&&rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;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,s=`${n||""} ${r||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return Qt.createElement(sn,{as:t||"div",ref:this.promptRef,onClick:i,className:s,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(on,"\\newline ")}})}}an.__initStatic(),an.__initStatic2();const ln=t;ln.node,ln.bool;const cn=t,dn=n,pn=e=>dn.createElement(dn.Fragment,null,dn.Children.map(e.children,t=>dn.cloneElement(t,{"data-pie-purpose":e.purpose})));function hn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const s=Math.min(6,Math.max(1,t+r-1)),o=n.createElement(`h${s}`);o.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}pn.propTypes={children:cn.node,purpose:cn.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const un=n,mn=t,{Tabs:fn}=o,{Tab:gn}=o,{styled:En}=i;const bn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},yn=En("div")({flexGrow:1,backgroundColor:it(),color:nt(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),vn=En("div")(({theme:e})=>({backgroundColor:it(),color:nt(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),xn=En("div")({fontSize:"1.75rem"}),Cn=En("div")({fontSize:"1.5rem"}),_n=En("div")({fontSize:"1.25rem"}),Rn=En(gn)(({theme:e})=>({background:it(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:nt(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:nt(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:et("tertiary",Qe.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:et("tertiary-light",Qe.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),kn=En("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:it()}));class On extends un.Component{constructor(...e){super(...e),On.prototype.__init.call(this),On.prototype.__init2.call(this),On.prototype.__init3.call(this),On.prototype.__init4.call(this),On.prototype.__init5.call(this),On.prototype.__init6.call(this),On.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:bn(),containerWidth:0}}__init2(){this.containerRef=un.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:bn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const s=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(s+1)%i.length;break;case"ArrowLeft":r=(s-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=s}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=un.createElement(an,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:un.createElement(At,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",s=n?Math.min(6,Math.max(1,i+1)):void 0;return un.createElement(vn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&un.createElement(pn,{purpose:"passage-title"},un.createElement(r,null,un.createElement(xn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&un.createElement(pn,{purpose:"passage-subtitle"},un.createElement(Cn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&un.createElement(pn,{purpose:"passage-author"},un.createElement(_n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&un.createElement(pn,{purpose:"passage-text"},un.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?hn(e.text,s):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:s}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:o}=e||{},a=(t||[]).find(e=>e.id===i),l=s>0?s/t.length:null,c=s>0&&s<=170*t.length;return un.createElement(qt,{extraCSSRules:o},un.createElement(yn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):un.createElement(un.Fragment,null,un.createElement(fn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:nt(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${et("background-dark",Qe.BACKGROUND_DARK)})`,borderBottom:`1px solid ${rt()}`},"& .MuiTabs-indicator":{backgroundColor:et("white",Qe.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>un.createElement(Rn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:un.createElement(un.Fragment,null,un.createElement(pn,{purpose:"passage-label"},c?un.createElement("span",{className:"passage-label"},`Passage ${t+1}`):un.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),un.createElement(kn,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}On.propTypes={tabs:mn.arrayOf(mn.shape({id:mn.number.isRequired,label:mn.string.isRequired,title:mn.string.isRequired,subtitle:mn.string,author:mn.string,text:mn.string.isRequired,teacherInstructions:mn.string}).isRequired).isRequired,disabledTabs:mn.bool,model:mn.object,baseHeadingLevel:mn.number};const{renderMath:Tn}=e,Sn=n,{createRoot:An}=c;function Mn(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(n=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=n?n:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var n,i}class Nn extends HTMLElement{constructor(){super(),Nn.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),Tn(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new h(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),n=Sn.createElement(On,{tabs:t,model:this._model,baseHeadingLevel:Mn(this)});this._root||(this._root=An(this)),this._root.render(n),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&(this._root.unmount(),this._root=null)}}export{Nn as default};
1
+ import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as i,_dll_react_dom as r,_dll_mui__material_colors as s,_dll_mui__material as o,_dll_debug as a,_dll_mui__material_collapse as l,_dll_react_dom_client as c}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var d={};Object.defineProperty(d,"__esModule",{value:!0});class p extends CustomEvent{constructor(e,t,n){super(p.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}p.TYPE="model-set";var h=d.ModelSetEvent=p;class u extends CustomEvent{constructor(e,t){super(u.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}u.TYPE="session-changed",d.SessionChangedEvent=u;const m=n,f=t,g=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",E=({size:e,children:t})=>{const n={height:e=g(e),width:e,display:"inline-block",position:"relative"};return m.createElement("div",{style:n},t)};E.propTypes={size:f.number,children:f.oneOfType([f.arrayOf(f.node),f.node]).isRequired};const b=n,y=t,v=({size:e,children:t,sx:n})=>b.createElement(E,{size:e},b.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));v.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})=>b.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 C=({fill:e})=>b.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});C.propTypes={fill:y.string.isRequired};const _=({fill:e})=>b.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});_.propTypes={fill:y.string.isRequired};const R=({fill:e})=>b.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});R.propTypes={fill:y.string.isRequired};const k=t,O=n;var T=(e,t)=>{class n extends O.Component{static __initStatic(){this.propTypes={iconSet:k.oneOf(["emoji","check"]),shape:k.oneOf(["round","square"]),category:k.oneOf(["feedback",void 0]),open:k.bool,size:k.oneOfType([k.number,k.string]),fg:k.string,bg:k.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:s,size:o,fg:a,bg:l}=this.props,c="check"===n?O.createElement(e,{fill:a}):O.createElement(t,{fill:a}),d="check"===n?O.createElement(e,{fill:l}):O.createElement(t,{fill:l});return s?O.createElement(v,{size:o},d):O.createElement(v,{size:o},"feedback"===r?"round"===i?O.createElement(C,{fill:l}):O.createElement(x,{fill:l}):"round"===i?O.createElement(_,{fill:l}):O.createElement(R,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const S=t,A=n,M=({fill:e})=>A.createElement("g",{transform:"translate(1, 0)"},A.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}),A.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),A.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));M.propTypes={fill:S.string.isRequired};const N=({fill:e,x:t=0,y:n=0})=>A.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:S.string.isRequired,x:S.number,y:S.number};const D=T(N,M);D.propTypes={iconSet:S.oneOf(["emoji","check"]),shape:S.oneOf(["round","square"]),category:S.oneOf(["feedback",void 0]),open:S.bool,fg:S.string,bg:S.string,size:S.oneOfType([S.string,S.number])},D.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const w=t,{styled:L}=i;w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,L("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),w.bool,w.string;const F=t,B=n,I=({fill:e})=>B.createElement("g",{transform:"translate(0.5, 0.5)"},B.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}),B.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}));I.propTypes={fill:F.string.isRequired};const z=({fill:e})=>B.createElement("g",{transform:"translate(1,0)"},B.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));z.propTypes={fill:F.string.isRequired};const P=T(I,z);P.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])},P.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const q=t,j=n,H=()=>{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"}))},$=({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));$.propTypes={children:q.oneOfType([q.arrayOf(q.node),q.node]).isRequired,size:q.number};const W=()=>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 "})),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:"#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 U extends j.Component{constructor(e){super(e)}render(){return!0===this.props.open?j.createElement($,null,j.createElement(W,null),j.createElement(H,null)):j.createElement($,null,j.createElement(Y,null),j.createElement(H,null))}}U.propTypes={open:q.bool},U.defaultProps={open:!1};const G=t,K=n,J=({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"});J.propTypes={fill:G.string};class V extends K.Component{static __initStatic(){this.propTypes={classes:G.object.isRequired,size:G.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(J,{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(J,{fill:"1A9CFF"})))}}V.__initStatic(),V.propTypes={open:G.bool},V.defaultProps={open:!1};const X=t,Z=n,Q=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),Z.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Q.propTypes={fill:X.string.isRequired};const ee=({fill:e})=>Z.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});ee.propTypes={fill:X.string.isRequired};const te=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),Z.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}));te.propTypes={fill:X.string.isRequired};class ne extends Z.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),feedback:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),square:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),open:{check:Z.createElement(v,null,Z.createElement(Q,{fill:n})),emoji:Z.createElement(v,null,Z.createElement(te,{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]}}ne.propTypes={iconSet:X.oneOf(["emoji","check",void 0]),shape:X.oneOf(["square",void 0]),category:X.oneOf(["feedback",void 0]),open:X.bool,fg:X.string,bg:X.string},ne.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const ie=t,re=n,se=({fill:e})=>re.createElement("g",{transform:"translate(0, 0)"},re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));se.propTypes={fill:ie.string.isRequired};const oe=({fill:e})=>re.createElement("g",{transform:"translate(2, 0)"},re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),re.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:ie.string.isRequired};const ae=T(se,oe);ae.propTypes={iconSet:ie.oneOf(["emoji","check"]),shape:ie.oneOf(["round","square"]),category:ie.oneOf(["feedback",void 0]),open:ie.bool,fg:ie.string,bg:ie.string,size:ie.oneOfType([ie.string,ie.number])},ae.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const le=t,ce=n,de=({fill:e})=>ce.createElement("g",null,ce.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ce.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}));de.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ce.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 he=({fill:e="#FFFFFF"})=>ce.createElement("g",null,ce.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"}),ce.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"}),ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));he.propTypes={fill:le.string};const ue=({children:e,size:t})=>{const n=g(t),i={height:n,width:n,display:"inline-block",position:"relative"};return ce.createElement("div",{style:i},ce.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 me extends ce.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,s=ce.createElement(de,{fill:n}),o={check:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),open:{check:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:"#FFFFFF"})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:r}))}};return!0===t?o.open[e]:o[e]}}function fe(){return fe=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},fe.apply(null,arguments)}function ge(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 be(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,"")}me.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])},me.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var ve=!1;var xe=n.createContext(null),Ce=function(e){return e.scrollTop};const _e=n,Re=r;var ke="unmounted",Oe="exited",Te="entering",Se="entered",Ae="exiting",Me=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,s=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=Oe,i.appearStatus=Te):r=Se:r=t.unmountOnExit||t.mountOnEnter?ke:Oe,i.state={status:r},i.nextCallback=null,i}be(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:Oe}: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!==Te&&n!==Se&&(t=Te):n!==Te&&n!==Se||(t=Ae)}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===Te){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this);n&&Ce(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Oe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Re.findDOMNode(this),i],s=r[0],o=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||ve?this.safeSetState({status:Se},function(){t.props.onEntered(s)}):(this.props.onEnter(s,o),this.safeSetState({status:Te},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:Se},function(){t.props.onEntered(s,o)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Re.findDOMNode(this);t&&!ve?(this.props.onExit(i),this.safeSetState({status:Ae},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Oe},function(){e.props.onExited(i)})})})):this.safeSetState({status:Oe},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:Re.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],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)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=ge(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _e.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,i):_e.cloneElement(_e.Children.only(n),i))},t}(_e.Component);function Ne(){}Me.contextType=xe,Me.propTypes={},Me.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},Me.UNMOUNTED=ke,Me.EXITED=Oe,Me.ENTERING=Te,Me.ENTERED=Se,Me.EXITING=Ae;var De=Me;const we=n;var Le=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})},Be=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],s=i[1];t.removeClasses(r,"exit"),t.addClass(r,s?"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],s=i[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"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}be(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&&Ce(e),i&&(this.appliedClasses[t][n]=i,Le(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,s=n.done;this.appliedClasses[t]={},i&&Fe(e,i),r&&Fe(e,r),s&&Fe(e,s)},n.render=function(){var e=this.props;e.classNames;var t=ge(e,["classNames"]);return we.createElement(De,fe({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(we.Component);Be.defaultProps={classNames:""},Be.propTypes={};var Ie=Be;const{Children:ze}=n,{cloneElement:Pe}=n,{isValidElement:qe}=n;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&&qe(e)?t(e):e}(e)}),n}function He(e,t,n){return null!=n[t]?n[t]:e.props[t]}function $e(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),s=[];for(var o in e)o in t?s.length&&(r[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<s.length;i++)a[s[i]]=n(s[i]);return a}(t,i);return Object.keys(r).forEach(function(s){var o=r[s];if(qe(o)){var a=s in t,l=s in i,c=t[s],d=qe(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&qe(c)&&(r[s]=Pe(o,{onExited:n.bind(null,o),in:c.props.in,exit:He(o,"exit",e),enter:He(o,"enter",e)})):r[s]=Pe(o,{in:!1}):r[s]=Pe(o,{onExited:n.bind(null,o),in:!0,exit:He(o,"exit",e),enter:He(o,"enter",e)})}}),r}const We=n;var Ye=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Ue=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}be(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,s=t.handleExited;return{children:t.firstRender?(n=e,i=s,je(n.children,function(e){return Pe(e,{onExited:i.bind(null,e),in:!0,appear:He(e,"appear",n),enter:He(e,"enter",n),exit:He(e,"exit",n)})})):$e(e,r,s),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=fe({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=ge(e,["component","childFactory"]),r=this.state.contextValue,s=Ye(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?We.createElement(xe.Provider,{value:r},s):We.createElement(xe.Provider,{value:r},We.createElement(t,i,s))},t}(We.Component);Ue.propTypes={},Ue.defaultProps={component:"div",childFactory:function(e){return e}};var Ge=Ue;const{green:Ke}=s,{indigo:Je}=s,{orange:Ve}=s,{pink:Xe}=s,{red:Ze}=s,Qe={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:Ke[500],CORRECT_SECONDARY:Ke[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:Ve[500],INCORRECT_SECONDARY:Ze[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:Ze[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:Je[500],PRIMARY_LIGHT:Je[200],PRIMARY_DARK:Je[800],SECONDARY:Xe.A400,SECONDARY_LIGHT:Xe[200],SECONDARY_DARK:Xe[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",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",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)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Qe);const et=(tt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${tt}-${t}, ${e})`,t)});var tt;const nt=()=>et("text",Qe.TEXT),it=()=>et("background",Qe.BACKGROUND),rt=()=>et("border-gray",Qe.BORDER_GRAY),st=()=>et("table-stripe","background-dark",Qe.TABLE_STRIPE),ot=n,at=t,{styled:lt}=i,ct=lt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),dt=lt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${et("disabled",Qe.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${et("correct",Qe.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${et("incorrect",Qe.INCORRECT)})`}}),pt=lt("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 ht extends ot.Component{constructor(...e){super(...e),ht.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:at.string,feedback:at.string}}__init(){this.nodeRef=ot.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?ot.createElement(Ie,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},ot.createElement(pt,{ref:this.nodeRef},ot.createElement(ct,null,ot.createElement(dt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return ot.createElement("div",null,ot.createElement(Ge,null,this.renderFeedback()))}}ht.__initStatic();const ut=n,mt=t,{Popover:ft}=o,{styled:gt}=i,Et=a("pie-libs:render-ui:response-indicators"),bt=gt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),yt=gt(ft)({cursor:"pointer"}),vt=gt("div")({padding:"0",borderRadius:"4px"}),xt=(e,t)=>{class n extends ut.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Et("[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 ut.createElement(bt,{hasFeedback:!!n},ut.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},ut.createElement(e,null)),n&&ut.createElement(yt,{PaperComponent:vt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},ut.createElement(ht,{feedback:n,correctness:t})))}}return n.propTypes={feedback:mt.string},n};xt(D,"correct"),xt(P,"incorrect"),xt(ae,"partially-correct"),xt(ne,"nothing-submitted");const Ct=n,{styled:_t}=i,Rt=l,kt=t,{renderMath:Ot}=e,Tt=_t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),St=_t(Rt)(({theme:e})=>({paddingTop:e.spacing(2)}));class At extends Ct.Component{constructor(...e){super(...e),At.prototype.__init.call(this),At.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:kt.string,children:kt.object,labels:kt.shape({visible:kt.string,hidden:kt.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ot(this.root)}componentDidUpdate(){Ot(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Ct.createElement("div",{className:n,ref:e=>this.root=e},Ct.createElement("div",{onClick:this.toggleExpanded},Ct.createElement(Tt,null,i)),Ct.createElement(St,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}At.__initStatic(),At.__initStatic2();const{Button:Mt}=o,{styled:Nt}=i;Nt("div")({display:"flex",flexDirection:"column"}),Nt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Nt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Nt(Mt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Dt=n,{createTheme:wt}=i,{styled:Lt}=i,{StyledEngineProvider:Ft}=i,{ThemeProvider:Bt}=i,It=t;const zt=wt({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"}}}}}}),Pt=Lt("div")({"& table, th, td":{fontSize:"inherit"}});class qt extends Dt.Component{static __initStatic(){this.propTypes={className:It.string,children:It.array,extraCSSRules:It.shape({names:It.arrayOf(It.string),rules:It.string}),fontSizeFactor:It.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),s=null!=e&&"number"==typeof e?e:1;return 1!==s?{fontSize:r*s+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...s}=i,o=this.computeStyle(n);return Dt.createElement(Ft,{injectFirst:!0},Dt.createElement(Bt,{theme:zt},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Dt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Dt.createElement(Pt,{className:`${t} extraCSSRules`,...s,...o&&{style:o}},e)))}}qt.__initStatic(),qt.__initStatic2();const jt=n,{styled:Ht}=i,$t=t,Wt=Ht(qt)({display:"flex",flexDirection:"column",position:"relative"});class Yt extends jt.Component{static __initStatic(){this.propTypes={ariaLabel:$t.string,children:$t.oneOfType([$t.arrayOf($t.node),$t.node]).isRequired,role:$t.string,extraCSSRules:$t.shape({names:$t.arrayOf($t.string),rules:$t.string}),fontSizeFactor:$t.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:s}=this.props,o=t?{"aria-label":t,role:n}:{};return jt.createElement(Wt,{...o,extraCSSRules:i,fontSizeFactor:r,classes:s},e)}}Yt.__initStatic();const Ut=n,Gt=t;class Kt extends Ut.Component{static __initStatic(){this.propTypes={tag:Gt.string,className:Gt.string,html:Gt.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return Ut.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Kt.__initStatic(),Kt.__initStatic2();const{InputLabel:Jt}=o,{FormControl:Vt}=o,Xt=t,{styled:Zt}=i;Zt(Vt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Zt(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)"}})),Xt.oneOfType([Xt.string,Xt.object]).isRequired,Xt.string,Xt.oneOfType([Xt.arrayOf(Xt.node),Xt.node]).isRequired;const Qt=n,{Component:en}=n,{styled:tn}=i,nn=t,{renderMath:rn}=e,sn=tn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:et("table-grid","text",Qe.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:st()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:st()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:nt()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${nt()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),on=/\\embed\{newLine\}\[\]/g;class an extends en{constructor(...e){super(...e),an.prototype.__init.call(this),an.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:nn.string,tagName:nn.string,className:nn.string,onClick:nn.func,defaultClassName:nn.string,autoplayAudioEnabled:nn.bool,customAudioButton:{playImage:nn.string,pauseImage:nn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=Qt.createRef()}__init2(){this.parsedText=e=>{const{autoplayAudioEnabled:t,customAudioButton:n}=this.props,i=document.createElement("div");i.innerHTML=e;const r=i.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),n){r.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?n.pauseImage:n.playImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return i.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",s)}).catch(e=>{n&&t&&(n.style.backgroundImage=`url(${t.playImage})`),console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&i.play()},s=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",o),i.addEventListener("pause",a),i.addEventListener("ended",s),this._handlePlayClick=r,this._handleAudioPlay=o,this._handleAudioPause=a,this._handleAudioEnded=s}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=this.promptRef.current;e&&"function"==typeof rn&&rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;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,s=`${n||""} ${r||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return Qt.createElement(sn,{as:t||"div",ref:this.promptRef,onClick:i,className:s,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(on,"\\newline ")}})}}an.__initStatic(),an.__initStatic2();const ln=t;ln.node,ln.bool;const cn=t,dn=n,pn=e=>dn.createElement(dn.Fragment,null,dn.Children.map(e.children,t=>dn.cloneElement(t,{"data-pie-purpose":e.purpose})));function hn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const s=Math.min(6,Math.max(1,t+r-1)),o=n.createElement(`h${s}`);o.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}pn.propTypes={children:cn.node,purpose:cn.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const un=n,mn=t,{Tabs:fn}=o,{Tab:gn}=o,{styled:En}=i;const bn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},yn=En("div")({flexGrow:1,backgroundColor:it(),color:nt(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),vn=En("div")(({theme:e})=>({backgroundColor:it(),color:nt(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),xn=En("div")({fontSize:"1.75rem"}),Cn=En("div")({fontSize:"1.5rem"}),_n=En("div")({fontSize:"1.25rem"}),Rn=En(gn)(({theme:e})=>({background:it(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:nt(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:nt(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:et("tertiary",Qe.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:et("tertiary-light",Qe.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),kn=En("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:it()}));class On extends un.Component{constructor(...e){super(...e),On.prototype.__init.call(this),On.prototype.__init2.call(this),On.prototype.__init3.call(this),On.prototype.__init4.call(this),On.prototype.__init5.call(this),On.prototype.__init6.call(this),On.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:bn(),containerWidth:0}}__init2(){this.containerRef=un.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:bn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const s=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(s+1)%i.length;break;case"ArrowLeft":r=(s-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=s}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=un.createElement(an,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:un.createElement(At,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",s=n?Math.min(6,Math.max(1,i+1)):void 0;return un.createElement(vn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&un.createElement(pn,{purpose:"passage-title"},un.createElement(r,null,un.createElement(xn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&un.createElement(pn,{purpose:"passage-subtitle"},un.createElement(Cn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&un.createElement(pn,{purpose:"passage-author"},un.createElement(_n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&un.createElement(pn,{purpose:"passage-text"},un.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?hn(e.text,s):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:s}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:o}=e||{},a=(t||[]).find(e=>e.id===i),l=s>0?s/t.length:null,c=s>0&&s<=170*t.length;return un.createElement(qt,{extraCSSRules:o},un.createElement(yn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):un.createElement(un.Fragment,null,un.createElement(fn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:nt(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${et("background-dark",Qe.BACKGROUND_DARK)})`,borderBottom:`1px solid ${rt()}`},"& .MuiTabs-indicator":{backgroundColor:et("white",Qe.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>un.createElement(Rn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:un.createElement(un.Fragment,null,un.createElement(pn,{purpose:"passage-label"},c?un.createElement("span",{className:"passage-label"},`Passage ${t+1}`):un.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),un.createElement(kn,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}On.propTypes={tabs:mn.arrayOf(mn.shape({id:mn.number.isRequired,label:mn.string.isRequired,title:mn.string.isRequired,subtitle:mn.string,author:mn.string,text:mn.string.isRequired,teacherInstructions:mn.string}).isRequired).isRequired,disabledTabs:mn.bool,model:mn.object,baseHeadingLevel:mn.number};const{renderMath:Tn}=e,Sn=n,{createRoot:An}=c;function Mn(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(n=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=n?n:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var n,i}class Nn extends HTMLElement{constructor(){super(),Nn.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),Tn(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new h(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),n=Sn.createElement(On,{tabs:t,model:this._model,baseHeadingLevel:Mn(this)});this._root||(this._root=An(this)),this._root.render(n),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&(this._root.unmount(),this._root=null)}}export{Nn 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/passage@7.4.1</title>
5
+ <title>@pie-element/passage@7.4.4</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/passage",
3
- "version": "7.4.1",
3
+ "version": "7.4.4",
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/passage@7.4.1</title>
5
+ <title>@pie-element/passage@7.4.4</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_prop_types as e,_dll_react as t,_dll_mui__material_styles as n,_dll_react_dom as i,_dll_mui__material_colors as r,_dll_mui__material as o,_dll_debug as s,_dll_mui__material_collapse as a,_dll_react_dom_client as l}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";var d="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,u=d||p||Function("return this")(),h=u.Symbol,m=Object.prototype,f=m.hasOwnProperty,g=m.toString,E=h?h.toStringTag:void 0;var b=Object.prototype.toString;var y=h?h.toStringTag:void 0;function v(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=f.call(e,E),n=e[E];try{e[E]=void 0;var i=!0}catch(e){}var r=g.call(e);return i&&(t?e[E]=n:delete e[E]),r}(e):function(e){return b.call(e)}(e)}var x=/\s/;var C=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&x.test(e.charAt(t)););return t}(e)+1).replace(C,""):e}function R(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var k=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,S=/^0o[0-7]+$/i,O=parseInt;function A(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]"==v(e)}(e))return NaN;if(R(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=R(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||S.test(e)?O(e.slice(2),n?2:8):k.test(e)?NaN:+e}var N=function(){return u.Date.now()},M=Math.max,D=Math.min;function w(e,t,n){var i,r,o,s,a,l,c=0,d=!1,p=!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-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function f(){var e=N();if(m(e))return g(e);a=setTimeout(f,function(e){var n=t-(e-l);return p?D(n,o-(e-c)):n}(e))}function g(e){return a=void 0,u&&i?h(e):(i=r=void 0,s)}function E(){var e=N(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?h(e):s}(l);if(p)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=A(t)||0,R(n)&&(d=!!n.leading,o=(p="maxWait"in n)?M(A(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),E.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},E.flush=function(){return void 0===a?s:g(N())},E}const I=t,B=e,F=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",L=({size:e,children:t})=>{const n={height:e=F(e),width:e,display:"inline-block",position:"relative"};return I.createElement("div",{style:n},t)};L.propTypes={size:B.number,children:B.oneOfType([B.arrayOf(B.node),B.node]).isRequired};const z=t,P=e,j=({size:e,children:t,sx:n})=>z.createElement(L,{size:e},z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));j.propTypes={size:P.oneOfType([P.string,P.number]),children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,sx:P.object},P.string.isRequired;const q=({fill:e})=>z.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});q.propTypes={fill:P.string.isRequired};const H=({fill:e})=>z.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});H.propTypes={fill:P.string.isRequired};const $=({fill:e})=>z.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});$.propTypes={fill:P.string.isRequired};const W=({fill:e})=>z.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});W.propTypes={fill:P.string.isRequired};const U=e,Y=t;var G=(e,t)=>{class n extends Y.Component{static __initStatic(){this.propTypes={iconSet:U.oneOf(["emoji","check"]),shape:U.oneOf(["round","square"]),category:U.oneOf(["feedback",void 0]),open:U.bool,size:U.oneOfType([U.number,U.string]),fg:U.string,bg:U.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:a,bg:l}=this.props,c="check"===n?Y.createElement(e,{fill:a}):Y.createElement(t,{fill:a}),d="check"===n?Y.createElement(e,{fill:l}):Y.createElement(t,{fill:l});return o?Y.createElement(j,{size:s},d):Y.createElement(j,{size:s},"feedback"===r?"round"===i?Y.createElement(H,{fill:l}):Y.createElement(q,{fill:l}):"round"===i?Y.createElement($,{fill:l}):Y.createElement(W,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const K=e,J=t,V=({fill:e})=>J.createElement("g",{transform:"translate(1, 0)"},J.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}),J.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),J.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));V.propTypes={fill:K.string.isRequired};const X=({fill:e,x:t=0,y:n=0})=>J.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});X.propTypes={fill:K.string.isRequired,x:K.number,y:K.number};const Z=G(X,V);Z.propTypes={iconSet:K.oneOf(["emoji","check"]),shape:K.oneOf(["round","square"]),category:K.oneOf(["feedback",void 0]),open:K.bool,fg:K.string,bg:K.string,size:K.oneOfType([K.string,K.number])},Z.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const Q=e,{styled:ee}=n;Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,ee("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),Q.bool,Q.string;const te=e,ne=t,ie=({fill:e})=>ne.createElement("g",{transform:"translate(0.5, 0.5)"},ne.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}),ne.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}));ie.propTypes={fill:te.string.isRequired};const re=({fill:e})=>ne.createElement("g",{transform:"translate(1,0)"},ne.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));re.propTypes={fill:te.string.isRequired};const oe=G(ie,re);oe.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])},oe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const se=e,ae=t,le=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return ae.createElement("g",null,ae.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),ae.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),ae.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},ce=({children:e,size:t})=>ae.createElement(L,{size:t},ae.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));ce.propTypes={children:se.oneOfType([se.arrayOf(se.node),se.node]).isRequired,size:se.number};const de=()=>ae.createElement("g",null,ae.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"}),ae.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 "}),ae.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"}),ae.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 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),ae.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 "})),pe=()=>ae.createElement("g",null,ae.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"}),ae.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 "}),ae.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"}),ae.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 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),ae.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 ue extends ae.Component{constructor(e){super(e)}render(){return!0===this.props.open?ae.createElement(ce,null,ae.createElement(de,null),ae.createElement(le,null)):ae.createElement(ce,null,ae.createElement(pe,null),ae.createElement(le,null))}}ue.propTypes={open:se.bool},ue.defaultProps={open:!1};const he=e,me=t,fe=({fill:e})=>me.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"});fe.propTypes={fill:he.string};class ge extends me.Component{static __initStatic(){this.propTypes={classes:he.object.isRequired,size:he.number}}render(){const{size:e}=this.props;return!0===this.props.open?me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},me.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"}),me.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"}),me.createElement(fe,{fill:"#1A9CFF"}))):me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},me.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"}),me.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"}),me.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"}),",",me.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"}),me.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"}),me.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"}),me.createElement(fe,{fill:"1A9CFF"})))}}ge.__initStatic(),ge.propTypes={open:he.bool},ge.defaultProps={open:!1};const Ee=e,be=t,ye=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),be.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));ye.propTypes={fill:Ee.string.isRequired};const ve=({fill:e})=>be.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});ve.propTypes={fill:Ee.string.isRequired};const xe=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),be.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),be.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}));xe.propTypes={fill:Ee.string.isRequired};class Ce extends be.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),feedback:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),square:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),open:{check:be.createElement(j,null,be.createElement(ye,{fill:n})),emoji:be.createElement(j,null,be.createElement(xe,{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]}}Ce.propTypes={iconSet:Ee.oneOf(["emoji","check",void 0]),shape:Ee.oneOf(["square",void 0]),category:Ee.oneOf(["feedback",void 0]),open:Ee.bool,fg:Ee.string,bg:Ee.string},Ce.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const _e=e,Re=t,ke=({fill:e})=>Re.createElement("g",{transform:"translate(0, 0)"},Re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));ke.propTypes={fill:_e.string.isRequired};const Te=({fill:e})=>Re.createElement("g",{transform:"translate(2, 0)"},Re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Re.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}));Te.propTypes={fill:_e.string.isRequired};const Se=G(ke,Te);Se.propTypes={iconSet:_e.oneOf(["emoji","check"]),shape:_e.oneOf(["round","square"]),category:_e.oneOf(["feedback",void 0]),open:_e.bool,fg:_e.string,bg:_e.string,size:_e.oneOfType([_e.string,_e.number])},Se.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Oe=e,Ae=t,Ne=({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}));Ne.propTypes={fill:Oe.string.isRequired};const Me=({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});Me.propTypes={fill:Oe.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:Oe.string};const we=({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))};we.propTypes={children:Oe.oneOfType([Oe.arrayOf(Oe.node),Oe.node]).isRequired,size:Oe.oneOfType([Oe.string,Oe.number])};class Ie extends Ae.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,o=Ae.createElement(Ne,{fill:n}),s={check:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),open:{check:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:"#FFFFFF"})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:r}))}};return!0===t?s.open[e]:s[e]}}function Be(){return Be=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},Be.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 Le(e,t){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Le(e,t)}function ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Le(e,t)}function Pe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}Ie.propTypes={iconSet:Oe.oneOf(["emoji","check"]),open:Oe.bool,fg:Oe.string,bg:Oe.string,border:Oe.string,size:Oe.oneOfType([Oe.string,Oe.number])},Ie.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var je=!1;var qe=t.createContext(null),He=function(e){return e.scrollTop};const $e=t,We=i;var Ue="unmounted",Ye="exited",Ge="entering",Ke="entered",Je="exiting",Ve=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=Ye,i.appearStatus=Ge):r=Ke:r=t.unmountOnExit||t.mountOnEnter?Ue:Ye,i.state={status:r},i.nextCallback=null,i}ze(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ue?{status:Ye}: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!==Ge&&n!==Ke&&(t=Ge):n!==Ge&&n!==Ke||(t=Je)}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===Ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:We.findDOMNode(this);n&&He(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ye&&this.setState({status:Ue})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[We.findDOMNode(this),i],o=r[0],s=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||je?this.safeSetState({status:Ke},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Ge},function(){t.props.onEntering(o,s),t.onTransitionEnd(l,function(){t.safeSetState({status:Ke},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:We.findDOMNode(this);t&&!je?(this.props.onExit(i),this.safeSetState({status:Je},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ye},function(){e.props.onExited(i)})})})):this.safeSetState({status:Ye},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:We.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===Ue)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 $e.createElement(qe.Provider,{value:null},"function"==typeof n?n(e,i):$e.cloneElement($e.Children.only(n),i))},t}($e.Component);function Xe(){}Ve.contextType=qe,Ve.propTypes={},Ve.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xe,onEntering:Xe,onEntered:Xe,onExit:Xe,onExiting:Xe,onExited:Xe},Ve.UNMOUNTED=Ue,Ve.EXITED=Ye,Ve.ENTERING=Ge,Ve.ENTERED=Ke,Ve.EXITING=Je;var Ze=Ve;const Qe=t;var et=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})},tt=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=Pe(n.className,i):n.setAttribute("class",Pe(n.className&&n.className.baseVal||"",i)));var n,i})},nt=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}ze(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&&He(e),i&&(this.appliedClasses[t][n]=i,et(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&&tt(e,i),r&&tt(e,r),o&&tt(e,o)},n.render=function(){var e=this.props;e.classNames;var t=Fe(e,["classNames"]);return Qe.createElement(Ze,Be({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Qe.Component);nt.defaultProps={classNames:""},nt.propTypes={};var it=nt;const{Children:rt}=t,{cloneElement:ot}=t,{isValidElement:st}=t;function at(e,t){var n=Object.create(null);return e&&rt.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&st(e)?t(e):e}(e)}),n}function lt(e,t,n){return null!=n[t]?n[t]:e.props[t]}function ct(e,t,n){var i=at(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 a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<o.length;i++)a[o[i]]=n(o[i]);return a}(t,i);return Object.keys(r).forEach(function(o){var s=r[o];if(st(s)){var a=o in t,l=o in i,c=t[o],d=st(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&st(c)&&(r[o]=ot(s,{onExited:n.bind(null,s),in:c.props.in,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})):r[o]=ot(s,{in:!1}):r[o]=ot(s,{onExited:n.bind(null,s),in:!0,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})}}),r}const dt=t;var pt=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ut=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}ze(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,at(n.children,function(e){return ot(e,{onExited:i.bind(null,e),in:!0,appear:lt(e,"appear",n),enter:lt(e,"enter",n),exit:lt(e,"exit",n)})})):ct(e,r,o),firstRender:!1}},n.handleExited=function(e,t){var n=at(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Be({},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=pt(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?dt.createElement(qe.Provider,{value:r},o):dt.createElement(qe.Provider,{value:r},dt.createElement(t,i,o))},t}(dt.Component);ut.propTypes={},ut.defaultProps={component:"div",childFactory:function(e){return e}};var ht=ut;const{green:mt}=r,{indigo:ft}=r,{orange:gt}=r,{pink:Et}=r,{red:bt}=r,yt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:mt[500],CORRECT_SECONDARY:mt[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:gt[500],INCORRECT_SECONDARY:bt[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:bt[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:ft[500],PRIMARY_LIGHT:ft[200],PRIMARY_DARK:ft[800],SECONDARY:Et.A400,SECONDARY_LIGHT:Et[200],SECONDARY_DARK:Et[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",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",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)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(yt);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",yt.TEXT),_t=()=>vt("background",yt.BACKGROUND),Rt=()=>vt("border-gray",yt.BORDER_GRAY),kt=()=>vt("table-stripe","background-dark",yt.TABLE_STRIPE),Tt=t,St=e,{styled:Ot}=n,At=Ot("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Nt=Ot("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${vt("disabled",yt.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",yt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${vt("incorrect",yt.INCORRECT)})`}}),Mt=Ot("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 Dt extends Tt.Component{constructor(...e){super(...e),Dt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:St.string,feedback:St.string}}__init(){this.nodeRef=Tt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?Tt.createElement(it,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},Tt.createElement(Mt,{ref:this.nodeRef},Tt.createElement(At,null,Tt.createElement(Nt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return Tt.createElement("div",null,Tt.createElement(ht,null,this.renderFeedback()))}}Dt.__initStatic();const wt=t,It=e,{Popover:Bt}=o,{styled:Ft}=n,Lt=s("pie-libs:render-ui:response-indicators"),zt=Ft("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),Pt=Ft(Bt)({cursor:"pointer"}),jt=Ft("div")({padding:"0",borderRadius:"4px"}),qt=(e,t)=>{class n extends wt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Lt("[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 wt.createElement(zt,{hasFeedback:!!n},wt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},wt.createElement(e,null)),n&&wt.createElement(Pt,{PaperComponent:jt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},wt.createElement(Dt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:It.string},n};qt(Z,"correct"),qt(oe,"incorrect"),qt(Se,"partially-correct"),qt(Ce,"nothing-submitted");const Ht=t,{styled:$t}=n,Wt=a,Ut=e,{renderMath:Yt}=c,Gt=$t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Kt=$t(Wt)(({theme:e})=>({paddingTop:e.spacing(2)}));class Jt extends Ht.Component{constructor(...e){super(...e),Jt.prototype.__init.call(this),Jt.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 Ht.createElement("div",{className:n,ref:e=>this.root=e},Ht.createElement("div",{onClick:this.toggleExpanded},Ht.createElement(Gt,null,i)),Ht.createElement(Kt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Jt.__initStatic(),Jt.__initStatic2();const{Button:Vt}=o,{styled:Xt}=n;Xt("div")({display:"flex",flexDirection:"column"}),Xt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Xt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Xt(Vt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Zt=t,{createTheme:Qt}=n,{styled:en}=n,{StyledEngineProvider:tn}=n,{ThemeProvider:nn}=n,rn=e;const on=Qt({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"}}}}}}),sn=en("div")({"& table, th, td":{fontSize:"inherit"}});class an extends Zt.Component{static __initStatic(){this.propTypes={className:rn.string,children:rn.array,extraCSSRules:rn.shape({names:rn.arrayOf(rn.string),rules:rn.string}),fontSizeFactor:rn.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 Zt.createElement(tn,{injectFirst:!0},Zt.createElement(nn,{theme:on},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])?Zt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Zt.createElement(sn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}an.__initStatic(),an.__initStatic2();const ln=t,{styled:cn}=n,dn=e,pn=cn(an)({display:"flex",flexDirection:"column",position:"relative"});class un extends ln.Component{static __initStatic(){this.propTypes={ariaLabel:dn.string,children:dn.oneOfType([dn.arrayOf(dn.node),dn.node]).isRequired,role:dn.string,extraCSSRules:dn.shape({names:dn.arrayOf(dn.string),rules:dn.string}),fontSizeFactor:dn.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 ln.createElement(pn,{...s,extraCSSRules:i,fontSizeFactor:r,classes:o},e)}}un.__initStatic();const hn=t,mn=e;class fn extends hn.Component{static __initStatic(){this.propTypes={tag:mn.string,className:mn.string,html:mn.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return hn.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}fn.__initStatic(),fn.__initStatic2();const{InputLabel:gn}=o,{FormControl:En}=o,bn=e,{styled:yn}=n;yn(En)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),yn(gn)(()=>({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)"}})),bn.oneOfType([bn.string,bn.object]).isRequired,bn.string,bn.oneOfType([bn.arrayOf(bn.node),bn.node]).isRequired;const vn=t,{Component:xn}=t,{styled:Cn}=n,_n=e,{renderMath:Rn}=c,kn=Cn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:vt("table-grid","text",yt.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:kt()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:kt()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) 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"}}})),Tn=/\\embed\{newLine\}\[\]/g;class Sn extends xn{constructor(...e){super(...e),Sn.prototype.__init.call(this),Sn.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:_n.string,tagName:_n.string,className:_n.string,onClick:_n.func,defaultClassName:_n.string,autoplayAudioEnabled:_n.bool,customAudioButton:{playImage:_n.string,pauseImage:_n.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=vn.createRef()}__init2(){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"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",s),i.addEventListener("pause",a),i.addEventListener("ended",o),this._handlePlayClick=r,this._handleAudioPlay=s,this._handleAudioPause=a,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=this.promptRef.current;e&&"function"==typeof Rn&&Rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;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":""} preview-prompt`.trim();return vn.createElement(kn,{as:t||"div",ref:this.promptRef,onClick:i,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(Tn,"\\newline ")}})}}Sn.__initStatic(),Sn.__initStatic2();const On=e;On.node,On.bool;const An=e,Nn=t,Mn=e=>Nn.createElement(Nn.Fragment,null,Nn.Children.map(e.children,t=>Nn.cloneElement(t,{"data-pie-purpose":e.purpose})));function Dn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const o=Math.min(6,Math.max(1,t+r-1)),s=n.createElement(`h${o}`);s.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&s.setAttribute(e.name,e.value)}),s.innerHTML=e.innerHTML,e.replaceWith(s)}),n.body.innerHTML}Mn.propTypes={children:An.node,purpose:An.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const wn=t,In=e,{Tabs:Bn}=o,{Tab:Fn}=o,{styled:Ln}=n;const zn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},Pn=Ln("div")({flexGrow:1,backgroundColor:_t(),color:Ct(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),jn=Ln("div")(({theme:e})=>({backgroundColor:_t(),color:Ct(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),qn=Ln("div")({fontSize:"1.75rem"}),Hn=Ln("div")({fontSize:"1.5rem"}),$n=Ln("div")({fontSize:"1.25rem"}),Wn=Ln(Fn)(({theme:e})=>({background:_t(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:Ct(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${Rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:Ct(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:vt("tertiary",yt.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:vt("tertiary-light",yt.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),Un=Ln("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:_t()}));class Yn extends wn.Component{constructor(...e){super(...e),Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),Yn.prototype.__init3.call(this),Yn.prototype.__init4.call(this),Yn.prototype.__init5.call(this),Yn.prototype.__init6.call(this),Yn.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:zn(),containerWidth:0}}__init2(){this.containerRef=wn.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:zn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const o=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(o+1)%i.length;break;case"ArrowLeft":r=(o-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=o}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=wn.createElement(Sn,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:wn.createElement(Jt,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",o=n?Math.min(6,Math.max(1,i+1)):void 0;return wn.createElement(jn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&wn.createElement(Mn,{purpose:"passage-title"},wn.createElement(r,null,wn.createElement(qn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&wn.createElement(Mn,{purpose:"passage-subtitle"},wn.createElement(Hn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&wn.createElement(Mn,{purpose:"passage-author"},wn.createElement($n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&wn.createElement(Mn,{purpose:"passage-text"},wn.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?Dn(e.text,o):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:o}=this.state;if(!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}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:s}=e||{},a=(t||[]).find(e=>e.id===i),l=o>0?o/t.length:null,c=o>0&&o<=170*t.length;return wn.createElement(an,{extraCSSRules:s},wn.createElement(Pn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):wn.createElement(wn.Fragment,null,wn.createElement(Bn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:Ct(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${vt("background-dark",yt.BACKGROUND_DARK)})`,borderBottom:`1px solid ${Rt()}`},"& .MuiTabs-indicator":{backgroundColor:vt("white",yt.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>wn.createElement(Wn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:wn.createElement(wn.Fragment,null,wn.createElement(Mn,{purpose:"passage-label"},c?wn.createElement("span",{className:"passage-label"},`Passage ${t+1}`):wn.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),wn.createElement(Un,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}Yn.propTypes={tabs:In.arrayOf(In.shape({id:In.number.isRequired,label:In.string.isRequired,title:In.string.isRequired,subtitle:In.string,author:In.string,text:In.string.isRequired,teacherInstructions:In.string}).isRequired).isRequired,disabledTabs:In.bool,model:In.object,baseHeadingLevel:In.number};const Gn=t,{createRoot:Kn}=l,Jn=s("pie-element:passage:print"),Vn=(e,t)=>(e=>null!=e)(e)?e:t;class Xn extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=w(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,i=Vn(e.teacherInstructionsEnabled,!0),r=Vn(e.titleEnabled,!0),o=Vn(e.authorEnabled,!1),s=Vn(e.subtitleEnabled,!0),a=Vn(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Vn(e.teacherInstructionsEnabled,i)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Vn(e.titleEnabled,r)&&e.title||"",author:Vn(e.authorEnabled,o)&&e.author||"",subtitle:Vn(e.subtitleEnabled,s)&&e.subtitle||"",text:Vn(e.textEnabled,a)&&e.text||""}))})(this._model,this._options),t=Gn.createElement(Yn,{disabledTabs:!0,tabs:e});this._root||(this._root=Kn(this)),this._root.render(t)}}else Jn("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Xn 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_colors as r,_dll_mui__material as o,_dll_debug as s,_dll_mui__material_collapse as a,_dll_react_dom_client as l}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";var d="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,u=d||p||Function("return this")(),h=u.Symbol,m=Object.prototype,f=m.hasOwnProperty,g=m.toString,E=h?h.toStringTag:void 0;var b=Object.prototype.toString;var y=h?h.toStringTag:void 0;function v(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=f.call(e,E),n=e[E];try{e[E]=void 0;var i=!0}catch(e){}var r=g.call(e);return i&&(t?e[E]=n:delete e[E]),r}(e):function(e){return b.call(e)}(e)}var x=/\s/;var C=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&x.test(e.charAt(t)););return t}(e)+1).replace(C,""):e}function R(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var k=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,S=/^0o[0-7]+$/i,O=parseInt;function A(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]"==v(e)}(e))return NaN;if(R(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=R(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||S.test(e)?O(e.slice(2),n?2:8):k.test(e)?NaN:+e}var N=function(){return u.Date.now()},M=Math.max,D=Math.min;function w(e,t,n){var i,r,o,s,a,l,c=0,d=!1,p=!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-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function f(){var e=N();if(m(e))return g(e);a=setTimeout(f,function(e){var n=t-(e-l);return p?D(n,o-(e-c)):n}(e))}function g(e){return a=void 0,u&&i?h(e):(i=r=void 0,s)}function E(){var e=N(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?h(e):s}(l);if(p)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=A(t)||0,R(n)&&(d=!!n.leading,o=(p="maxWait"in n)?M(A(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),E.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},E.flush=function(){return void 0===a?s:g(N())},E}const I=t,B=e,F=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",L=({size:e,children:t})=>{const n={height:e=F(e),width:e,display:"inline-block",position:"relative"};return I.createElement("div",{style:n},t)};L.propTypes={size:B.number,children:B.oneOfType([B.arrayOf(B.node),B.node]).isRequired};const z=t,P=e,j=({size:e,children:t,sx:n})=>z.createElement(L,{size:e},z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));j.propTypes={size:P.oneOfType([P.string,P.number]),children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,sx:P.object},P.string.isRequired;const q=({fill:e})=>z.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});q.propTypes={fill:P.string.isRequired};const H=({fill:e})=>z.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});H.propTypes={fill:P.string.isRequired};const $=({fill:e})=>z.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});$.propTypes={fill:P.string.isRequired};const W=({fill:e})=>z.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});W.propTypes={fill:P.string.isRequired};const U=e,Y=t;var G=(e,t)=>{class n extends Y.Component{static __initStatic(){this.propTypes={iconSet:U.oneOf(["emoji","check"]),shape:U.oneOf(["round","square"]),category:U.oneOf(["feedback",void 0]),open:U.bool,size:U.oneOfType([U.number,U.string]),fg:U.string,bg:U.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:a,bg:l}=this.props,c="check"===n?Y.createElement(e,{fill:a}):Y.createElement(t,{fill:a}),d="check"===n?Y.createElement(e,{fill:l}):Y.createElement(t,{fill:l});return o?Y.createElement(j,{size:s},d):Y.createElement(j,{size:s},"feedback"===r?"round"===i?Y.createElement(H,{fill:l}):Y.createElement(q,{fill:l}):"round"===i?Y.createElement($,{fill:l}):Y.createElement(W,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const K=e,J=t,V=({fill:e})=>J.createElement("g",{transform:"translate(1, 0)"},J.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}),J.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),J.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));V.propTypes={fill:K.string.isRequired};const X=({fill:e,x:t=0,y:n=0})=>J.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});X.propTypes={fill:K.string.isRequired,x:K.number,y:K.number};const Z=G(X,V);Z.propTypes={iconSet:K.oneOf(["emoji","check"]),shape:K.oneOf(["round","square"]),category:K.oneOf(["feedback",void 0]),open:K.bool,fg:K.string,bg:K.string,size:K.oneOfType([K.string,K.number])},Z.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const Q=e,{styled:ee}=n;Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,ee("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),Q.bool,Q.string;const te=e,ne=t,ie=({fill:e})=>ne.createElement("g",{transform:"translate(0.5, 0.5)"},ne.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}),ne.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}));ie.propTypes={fill:te.string.isRequired};const re=({fill:e})=>ne.createElement("g",{transform:"translate(1,0)"},ne.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));re.propTypes={fill:te.string.isRequired};const oe=G(ie,re);oe.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])},oe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const se=e,ae=t,le=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return ae.createElement("g",null,ae.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),ae.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),ae.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},ce=({children:e,size:t})=>ae.createElement(L,{size:t},ae.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));ce.propTypes={children:se.oneOfType([se.arrayOf(se.node),se.node]).isRequired,size:se.number};const de=()=>ae.createElement("g",null,ae.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"}),ae.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 "}),ae.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"}),ae.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 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),ae.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 "})),pe=()=>ae.createElement("g",null,ae.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"}),ae.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 "}),ae.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"}),ae.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 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),ae.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 ue extends ae.Component{constructor(e){super(e)}render(){return!0===this.props.open?ae.createElement(ce,null,ae.createElement(de,null),ae.createElement(le,null)):ae.createElement(ce,null,ae.createElement(pe,null),ae.createElement(le,null))}}ue.propTypes={open:se.bool},ue.defaultProps={open:!1};const he=e,me=t,fe=({fill:e})=>me.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"});fe.propTypes={fill:he.string};class ge extends me.Component{static __initStatic(){this.propTypes={classes:he.object.isRequired,size:he.number}}render(){const{size:e}=this.props;return!0===this.props.open?me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},me.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"}),me.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"}),me.createElement(fe,{fill:"#1A9CFF"}))):me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},me.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"}),me.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"}),me.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"}),",",me.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"}),me.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"}),me.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"}),me.createElement(fe,{fill:"1A9CFF"})))}}ge.__initStatic(),ge.propTypes={open:he.bool},ge.defaultProps={open:!1};const Ee=e,be=t,ye=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),be.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));ye.propTypes={fill:Ee.string.isRequired};const ve=({fill:e})=>be.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});ve.propTypes={fill:Ee.string.isRequired};const xe=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),be.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),be.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}));xe.propTypes={fill:Ee.string.isRequired};class Ce extends be.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),feedback:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),square:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),open:{check:be.createElement(j,null,be.createElement(ye,{fill:n})),emoji:be.createElement(j,null,be.createElement(xe,{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]}}Ce.propTypes={iconSet:Ee.oneOf(["emoji","check",void 0]),shape:Ee.oneOf(["square",void 0]),category:Ee.oneOf(["feedback",void 0]),open:Ee.bool,fg:Ee.string,bg:Ee.string},Ce.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const _e=e,Re=t,ke=({fill:e})=>Re.createElement("g",{transform:"translate(0, 0)"},Re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));ke.propTypes={fill:_e.string.isRequired};const Te=({fill:e})=>Re.createElement("g",{transform:"translate(2, 0)"},Re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Re.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}));Te.propTypes={fill:_e.string.isRequired};const Se=G(ke,Te);Se.propTypes={iconSet:_e.oneOf(["emoji","check"]),shape:_e.oneOf(["round","square"]),category:_e.oneOf(["feedback",void 0]),open:_e.bool,fg:_e.string,bg:_e.string,size:_e.oneOfType([_e.string,_e.number])},Se.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Oe=e,Ae=t,Ne=({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}));Ne.propTypes={fill:Oe.string.isRequired};const Me=({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});Me.propTypes={fill:Oe.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:Oe.string};const we=({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))};we.propTypes={children:Oe.oneOfType([Oe.arrayOf(Oe.node),Oe.node]).isRequired,size:Oe.oneOfType([Oe.string,Oe.number])};class Ie extends Ae.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,o=Ae.createElement(Ne,{fill:n}),s={check:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),open:{check:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:"#FFFFFF"})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:r}))}};return!0===t?s.open[e]:s[e]}}function Be(){return Be=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},Be.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 Le(e,t){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Le(e,t)}function ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Le(e,t)}function Pe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}Ie.propTypes={iconSet:Oe.oneOf(["emoji","check"]),open:Oe.bool,fg:Oe.string,bg:Oe.string,border:Oe.string,size:Oe.oneOfType([Oe.string,Oe.number])},Ie.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var je=!1;var qe=t.createContext(null),He=function(e){return e.scrollTop};const $e=t,We=i;var Ue="unmounted",Ye="exited",Ge="entering",Ke="entered",Je="exiting",Ve=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=Ye,i.appearStatus=Ge):r=Ke:r=t.unmountOnExit||t.mountOnEnter?Ue:Ye,i.state={status:r},i.nextCallback=null,i}ze(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ue?{status:Ye}: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!==Ge&&n!==Ke&&(t=Ge):n!==Ge&&n!==Ke||(t=Je)}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===Ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:We.findDOMNode(this);n&&He(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ye&&this.setState({status:Ue})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[We.findDOMNode(this),i],o=r[0],s=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||je?this.safeSetState({status:Ke},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Ge},function(){t.props.onEntering(o,s),t.onTransitionEnd(l,function(){t.safeSetState({status:Ke},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:We.findDOMNode(this);t&&!je?(this.props.onExit(i),this.safeSetState({status:Je},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ye},function(){e.props.onExited(i)})})})):this.safeSetState({status:Ye},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:We.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===Ue)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 $e.createElement(qe.Provider,{value:null},"function"==typeof n?n(e,i):$e.cloneElement($e.Children.only(n),i))},t}($e.Component);function Xe(){}Ve.contextType=qe,Ve.propTypes={},Ve.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xe,onEntering:Xe,onEntered:Xe,onExit:Xe,onExiting:Xe,onExited:Xe},Ve.UNMOUNTED=Ue,Ve.EXITED=Ye,Ve.ENTERING=Ge,Ve.ENTERED=Ke,Ve.EXITING=Je;var Ze=Ve;const Qe=t;var et=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})},tt=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=Pe(n.className,i):n.setAttribute("class",Pe(n.className&&n.className.baseVal||"",i)));var n,i})},nt=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}ze(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&&He(e),i&&(this.appliedClasses[t][n]=i,et(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&&tt(e,i),r&&tt(e,r),o&&tt(e,o)},n.render=function(){var e=this.props;e.classNames;var t=Fe(e,["classNames"]);return Qe.createElement(Ze,Be({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Qe.Component);nt.defaultProps={classNames:""},nt.propTypes={};var it=nt;const{Children:rt}=t,{cloneElement:ot}=t,{isValidElement:st}=t;function at(e,t){var n=Object.create(null);return e&&rt.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&st(e)?t(e):e}(e)}),n}function lt(e,t,n){return null!=n[t]?n[t]:e.props[t]}function ct(e,t,n){var i=at(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 a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<o.length;i++)a[o[i]]=n(o[i]);return a}(t,i);return Object.keys(r).forEach(function(o){var s=r[o];if(st(s)){var a=o in t,l=o in i,c=t[o],d=st(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&st(c)&&(r[o]=ot(s,{onExited:n.bind(null,s),in:c.props.in,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})):r[o]=ot(s,{in:!1}):r[o]=ot(s,{onExited:n.bind(null,s),in:!0,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})}}),r}const dt=t;var pt=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ut=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}ze(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,at(n.children,function(e){return ot(e,{onExited:i.bind(null,e),in:!0,appear:lt(e,"appear",n),enter:lt(e,"enter",n),exit:lt(e,"exit",n)})})):ct(e,r,o),firstRender:!1}},n.handleExited=function(e,t){var n=at(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Be({},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=pt(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?dt.createElement(qe.Provider,{value:r},o):dt.createElement(qe.Provider,{value:r},dt.createElement(t,i,o))},t}(dt.Component);ut.propTypes={},ut.defaultProps={component:"div",childFactory:function(e){return e}};var ht=ut;const{green:mt}=r,{indigo:ft}=r,{orange:gt}=r,{pink:Et}=r,{red:bt}=r,yt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:mt[500],CORRECT_SECONDARY:mt[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:gt[500],INCORRECT_SECONDARY:bt[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:bt[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:ft[500],PRIMARY_LIGHT:ft[200],PRIMARY_DARK:ft[800],SECONDARY:Et.A400,SECONDARY_LIGHT:Et[200],SECONDARY_DARK:Et[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",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",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)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(yt);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",yt.TEXT),_t=()=>vt("background",yt.BACKGROUND),Rt=()=>vt("border-gray",yt.BORDER_GRAY),kt=()=>vt("table-stripe","background-dark",yt.TABLE_STRIPE),Tt=t,St=e,{styled:Ot}=n,At=Ot("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Nt=Ot("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${vt("disabled",yt.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",yt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${vt("incorrect",yt.INCORRECT)})`}}),Mt=Ot("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 Dt extends Tt.Component{constructor(...e){super(...e),Dt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:St.string,feedback:St.string}}__init(){this.nodeRef=Tt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?Tt.createElement(it,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},Tt.createElement(Mt,{ref:this.nodeRef},Tt.createElement(At,null,Tt.createElement(Nt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return Tt.createElement("div",null,Tt.createElement(ht,null,this.renderFeedback()))}}Dt.__initStatic();const wt=t,It=e,{Popover:Bt}=o,{styled:Ft}=n,Lt=s("pie-libs:render-ui:response-indicators"),zt=Ft("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),Pt=Ft(Bt)({cursor:"pointer"}),jt=Ft("div")({padding:"0",borderRadius:"4px"}),qt=(e,t)=>{class n extends wt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Lt("[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 wt.createElement(zt,{hasFeedback:!!n},wt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},wt.createElement(e,null)),n&&wt.createElement(Pt,{PaperComponent:jt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},wt.createElement(Dt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:It.string},n};qt(Z,"correct"),qt(oe,"incorrect"),qt(Se,"partially-correct"),qt(Ce,"nothing-submitted");const Ht=t,{styled:$t}=n,Wt=a,Ut=e,{renderMath:Yt}=c,Gt=$t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Kt=$t(Wt)(({theme:e})=>({paddingTop:e.spacing(2)}));class Jt extends Ht.Component{constructor(...e){super(...e),Jt.prototype.__init.call(this),Jt.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 Ht.createElement("div",{className:n,ref:e=>this.root=e},Ht.createElement("div",{onClick:this.toggleExpanded},Ht.createElement(Gt,null,i)),Ht.createElement(Kt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Jt.__initStatic(),Jt.__initStatic2();const{Button:Vt}=o,{styled:Xt}=n;Xt("div")({display:"flex",flexDirection:"column"}),Xt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Xt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Xt(Vt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Zt=t,{createTheme:Qt}=n,{styled:en}=n,{StyledEngineProvider:tn}=n,{ThemeProvider:nn}=n,rn=e;const on=Qt({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"}}}}}}),sn=en("div")({"& table, th, td":{fontSize:"inherit"}});class an extends Zt.Component{static __initStatic(){this.propTypes={className:rn.string,children:rn.array,extraCSSRules:rn.shape({names:rn.arrayOf(rn.string),rules:rn.string}),fontSizeFactor:rn.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 Zt.createElement(tn,{injectFirst:!0},Zt.createElement(nn,{theme:on},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])?Zt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Zt.createElement(sn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}an.__initStatic(),an.__initStatic2();const ln=t,{styled:cn}=n,dn=e,pn=cn(an)({display:"flex",flexDirection:"column",position:"relative"});class un extends ln.Component{static __initStatic(){this.propTypes={ariaLabel:dn.string,children:dn.oneOfType([dn.arrayOf(dn.node),dn.node]).isRequired,role:dn.string,extraCSSRules:dn.shape({names:dn.arrayOf(dn.string),rules:dn.string}),fontSizeFactor:dn.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 ln.createElement(pn,{...s,extraCSSRules:i,fontSizeFactor:r,classes:o},e)}}un.__initStatic();const hn=t,mn=e;class fn extends hn.Component{static __initStatic(){this.propTypes={tag:mn.string,className:mn.string,html:mn.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return hn.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}fn.__initStatic(),fn.__initStatic2();const{InputLabel:gn}=o,{FormControl:En}=o,bn=e,{styled:yn}=n;yn(En)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),yn(gn)(()=>({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)"}})),bn.oneOfType([bn.string,bn.object]).isRequired,bn.string,bn.oneOfType([bn.arrayOf(bn.node),bn.node]).isRequired;const vn=t,{Component:xn}=t,{styled:Cn}=n,_n=e,{renderMath:Rn}=c,kn=Cn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:vt("table-grid","text",yt.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:kt()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:kt()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) 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"}}})),Tn=/\\embed\{newLine\}\[\]/g;class Sn extends xn{constructor(...e){super(...e),Sn.prototype.__init.call(this),Sn.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:_n.string,tagName:_n.string,className:_n.string,onClick:_n.func,defaultClassName:_n.string,autoplayAudioEnabled:_n.bool,customAudioButton:{playImage:_n.string,pauseImage:_n.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=vn.createRef()}__init2(){this.parsedText=e=>{const{autoplayAudioEnabled:t,customAudioButton:n}=this.props,i=document.createElement("div");i.innerHTML=e;const r=i.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),n){r.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?n.pauseImage:n.playImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return i.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=>{n&&t&&(n.style.backgroundImage=`url(${t.playImage})`),console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&i.play()},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",s),i.addEventListener("pause",a),i.addEventListener("ended",o),this._handlePlayClick=r,this._handleAudioPlay=s,this._handleAudioPause=a,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=this.promptRef.current;e&&"function"==typeof Rn&&Rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;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":""} preview-prompt`.trim();return vn.createElement(kn,{as:t||"div",ref:this.promptRef,onClick:i,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(Tn,"\\newline ")}})}}Sn.__initStatic(),Sn.__initStatic2();const On=e;On.node,On.bool;const An=e,Nn=t,Mn=e=>Nn.createElement(Nn.Fragment,null,Nn.Children.map(e.children,t=>Nn.cloneElement(t,{"data-pie-purpose":e.purpose})));function Dn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const o=Math.min(6,Math.max(1,t+r-1)),s=n.createElement(`h${o}`);s.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&s.setAttribute(e.name,e.value)}),s.innerHTML=e.innerHTML,e.replaceWith(s)}),n.body.innerHTML}Mn.propTypes={children:An.node,purpose:An.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const wn=t,In=e,{Tabs:Bn}=o,{Tab:Fn}=o,{styled:Ln}=n;const zn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},Pn=Ln("div")({flexGrow:1,backgroundColor:_t(),color:Ct(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),jn=Ln("div")(({theme:e})=>({backgroundColor:_t(),color:Ct(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),qn=Ln("div")({fontSize:"1.75rem"}),Hn=Ln("div")({fontSize:"1.5rem"}),$n=Ln("div")({fontSize:"1.25rem"}),Wn=Ln(Fn)(({theme:e})=>({background:_t(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:Ct(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${Rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:Ct(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:vt("tertiary",yt.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:vt("tertiary-light",yt.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),Un=Ln("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:_t()}));class Yn extends wn.Component{constructor(...e){super(...e),Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),Yn.prototype.__init3.call(this),Yn.prototype.__init4.call(this),Yn.prototype.__init5.call(this),Yn.prototype.__init6.call(this),Yn.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:zn(),containerWidth:0}}__init2(){this.containerRef=wn.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:zn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const o=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(o+1)%i.length;break;case"ArrowLeft":r=(o-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=o}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=wn.createElement(Sn,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:wn.createElement(Jt,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",o=n?Math.min(6,Math.max(1,i+1)):void 0;return wn.createElement(jn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&wn.createElement(Mn,{purpose:"passage-title"},wn.createElement(r,null,wn.createElement(qn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&wn.createElement(Mn,{purpose:"passage-subtitle"},wn.createElement(Hn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&wn.createElement(Mn,{purpose:"passage-author"},wn.createElement($n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&wn.createElement(Mn,{purpose:"passage-text"},wn.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?Dn(e.text,o):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:o}=this.state;if(!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}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:s}=e||{},a=(t||[]).find(e=>e.id===i),l=o>0?o/t.length:null,c=o>0&&o<=170*t.length;return wn.createElement(an,{extraCSSRules:s},wn.createElement(Pn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):wn.createElement(wn.Fragment,null,wn.createElement(Bn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:Ct(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${vt("background-dark",yt.BACKGROUND_DARK)})`,borderBottom:`1px solid ${Rt()}`},"& .MuiTabs-indicator":{backgroundColor:vt("white",yt.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>wn.createElement(Wn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:wn.createElement(wn.Fragment,null,wn.createElement(Mn,{purpose:"passage-label"},c?wn.createElement("span",{className:"passage-label"},`Passage ${t+1}`):wn.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),wn.createElement(Un,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}Yn.propTypes={tabs:In.arrayOf(In.shape({id:In.number.isRequired,label:In.string.isRequired,title:In.string.isRequired,subtitle:In.string,author:In.string,text:In.string.isRequired,teacherInstructions:In.string}).isRequired).isRequired,disabledTabs:In.bool,model:In.object,baseHeadingLevel:In.number};const Gn=t,{createRoot:Kn}=l,Jn=s("pie-element:passage:print"),Vn=(e,t)=>(e=>null!=e)(e)?e:t;class Xn extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=w(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,i=Vn(e.teacherInstructionsEnabled,!0),r=Vn(e.titleEnabled,!0),o=Vn(e.authorEnabled,!1),s=Vn(e.subtitleEnabled,!0),a=Vn(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Vn(e.teacherInstructionsEnabled,i)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Vn(e.titleEnabled,r)&&e.title||"",author:Vn(e.authorEnabled,o)&&e.author||"",subtitle:Vn(e.subtitleEnabled,s)&&e.subtitle||"",text:Vn(e.textEnabled,a)&&e.text||""}))})(this._model,this._options),t=Gn.createElement(Yn,{disabledTabs:!0,tabs:e});this._root||(this._root=Kn(this)),this._root.render(t)}}else Jn("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Xn as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "7.4.2",
4
+ "version": "7.4.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -15,12 +15,12 @@
15
15
  "@mui/material": "^7.3.4",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
17
  "@pie-lib/math-rendering": "5.1.0",
18
- "@pie-lib/render-ui": "7.0.2",
18
+ "@pie-lib/render-ui": "7.0.3",
19
19
  "prop-types": "^15.8.1",
20
20
  "react": "18.3.1",
21
21
  "react-dom": "18.3.1"
22
22
  },
23
- "gitHead": "2976324c2d55b1d41f54aadc9b8f493b3ae839b2",
23
+ "gitHead": "cff9952eb98a94ae5b7357ac8f7069be05cacd10",
24
24
  "scripts": {
25
25
  "postpublish": "../../scripts/postpublish"
26
26
  },